From 69a350e262acecaa50bb58dc2503e1f5e5d478dd Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 19 Nov 2020 07:47:26 +0100 Subject: [PATCH] :sparkles: Add Firebase node (#1173) * :zap: Added node for Google firebase Firestore database * :zap: added firebase's realtime database node * Added operation to run queries on documents collection * Improvements to Firebase Database nodes - Realtime Database: improved how the node interacts with input database - Cloud Firestore: improved how the node interacts with input database - Cloud Firestore: improved input / output format so it's similar to JSON and more intuitive, abstracting Firestore's format * :zap: Improvements to Firestore-Node * :zap: improvements to Firebase-Node * :zap: Improvements :zap: Improvements * :zap: Improvements * :zap: Minor improvements to Firebase Nodes Co-authored-by: Omar Ajoue Co-authored-by: ricardo --- ...baseCloudFirestoreOAuth2Api.credentials.ts | 26 + ...seRealtimeDatabaseOAuth2Api.credentials.ts | 27 + .../CloudFirestore/CloudFirestore.node.ts | 341 ++++++++ .../CloudFirestore/CollectionDescription.ts | 114 +++ .../CloudFirestore/DocumentDescription.ts | 745 ++++++++++++++++++ .../CloudFirestore/GenericFunctions.ts | 153 ++++ .../googleFirebaseCloudFirestore.png | Bin 0 -> 2144 bytes .../RealtimeDatabase/GenericFunctions.ts | 78 ++ .../RealtimeDatabase/RealtimeDatabase.node.ts | 204 +++++ .../googleFirebaseRealtimeDatabase.png | Bin 0 -> 2103 bytes packages/nodes-base/package.json | 4 + 11 files changed, 1692 insertions(+) create mode 100644 packages/nodes-base/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CloudFirestore.node.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CollectionDescription.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/CloudFirestore/DocumentDescription.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/CloudFirestore/googleFirebaseCloudFirestore.png create mode 100644 packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/RealtimeDatabase.node.ts create mode 100644 packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/googleFirebaseRealtimeDatabase.png diff --git a/packages/nodes-base/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.ts new file mode 100644 index 0000000000..60faa5ee61 --- /dev/null +++ b/packages/nodes-base/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.ts @@ -0,0 +1,26 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +const scopes = [ + 'https://www.googleapis.com/auth/datastore', + 'https://www.googleapis.com/auth/firebase', +]; + +export class GoogleFirebaseCloudFirestoreOAuth2Api implements ICredentialType { + name = 'googleFirebaseCloudFirestoreOAuth2Api'; + extends = [ + 'googleOAuth2Api', + ]; + displayName = 'Google Firebase Cloud Firestore OAuth2 API'; + documentationUrl = 'google'; + properties = [ + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), + }, + ]; +} diff --git a/packages/nodes-base/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.ts new file mode 100644 index 0000000000..845c78107d --- /dev/null +++ b/packages/nodes-base/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.ts @@ -0,0 +1,27 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +const scopes = [ + 'https://www.googleapis.com/auth/userinfo.email', + 'https://www.googleapis.com/auth/firebase.database', + 'https://www.googleapis.com/auth/firebase', +]; + +export class GoogleFirebaseRealtimeDatabaseOAuth2Api implements ICredentialType { + name = 'googleFirebaseRealtimeDatabaseOAuth2Api'; + extends = [ + 'googleOAuth2Api', + ]; + displayName = 'Google Firebase Realtime Database OAuth2 API'; + documentationUrl = 'google'; + properties = [ + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), + }, + ]; +} diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CloudFirestore.node.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CloudFirestore.node.ts new file mode 100644 index 0000000000..d654505189 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CloudFirestore.node.ts @@ -0,0 +1,341 @@ +import { + IExecuteFunctions, +} from 'n8n-core'; + +import { + IDataObject, + ILoadOptionsFunctions, + INodeExecutionData, + INodePropertyOptions, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + +import { + fullDocumentToJson, + googleApiRequest, + googleApiRequestAllItems, + jsonToDocument +} from './GenericFunctions'; + +import { + collectionFields, + collectionOperations, +} from './CollectionDescription'; + +import { + documentFields, + documentOperations, +} from './DocumentDescription'; + +export class CloudFirestore implements INodeType { + description: INodeTypeDescription = { + displayName: 'Google Firebase Cloud Firestore', + name: 'googleFirebaseCloudFirestore', + icon: 'file:googleFirebaseCloudFirestore.png', + group: ['input'], + version: 1, + subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}', + description: 'Interact with Google Firebase - Cloud Firestore API', + defaults: { + name: 'Google Cloud Firestore', + color: '#ffcb2d', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'googleFirebaseCloudFirestoreOAuth2Api', + required: true, + }, + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Document', + value: 'document', + }, + { + name: 'Collection', + value: 'collection', + }, + ], + default: 'document', + description: 'The resource to operate on.', + }, + ...documentOperations, + ...documentFields, + ...collectionOperations, + ...collectionFields, + ], + }; + + methods = { + loadOptions: { + async getProjects( + this: ILoadOptionsFunctions, + ): Promise { + const collections = await googleApiRequestAllItems.call( + this, + 'results', + 'GET', + '', + {}, + {}, + 'https://firebase.googleapis.com/v1beta1/projects', + ); + // @ts-ignore + const returnData = collections.map(o => ({ name: o.projectId, value: o.projectId })) as INodePropertyOptions[]; + return returnData; + }, + }, + }; + + async execute(this: IExecuteFunctions): Promise { + + const items = this.getInputData(); + const returnData: IDataObject[] = []; + let responseData; + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + + if (resource === 'document') { + if (operation === 'get') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + const simple = this.getNodeParameter('simple', 0) as boolean; + const documentList = items.map((item: IDataObject, i: number) => { + const collection = this.getNodeParameter('collection', i) as string; + const documentId = this.getNodeParameter('documentId', i) as string; + return `projects/${projectId}/databases/${database}/documents/${collection}/${documentId}`; + }); + + responseData = await googleApiRequest.call( + this, + 'POST', + `/${projectId}/databases/${database}/documents:batchGet`, + { documents: documentList }, + ); + + if (simple === false) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push.apply(returnData, responseData.map((element: IDataObject) => { + return fullDocumentToJson(element.found as IDataObject); + }).filter((el: IDataObject) => !!el)); + } + } else if (operation === 'create') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + const simple = this.getNodeParameter('simple', 0) as boolean; + + await Promise.all(items.map(async (item: IDataObject, i: number) => { + const collection = this.getNodeParameter('collection', i) as string; + const columns = this.getNodeParameter('columns', i) as string; + const columnList = columns.split(',').map(column => column.trim()); + const document = { fields: {} }; + columnList.map(column => { + // @ts-ignore + document.fields[column] = item['json'][column] ? jsonToDocument(item['json'][column]) : jsonToDocument(null); + }); + responseData = await googleApiRequest.call( + this, + 'POST', + `/${projectId}/databases/${database}/documents/${collection}`, + document, + ); + if (simple === false) { + returnData.push(responseData); + } else { + returnData.push(fullDocumentToJson(responseData as IDataObject)); + } + })); + } else if (operation === 'getAll') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + const collection = this.getNodeParameter('collection', 0) as string; + const returnAll = this.getNodeParameter('returnAll', 0) as string; + const simple = this.getNodeParameter('simple', 0) as boolean; + + if (returnAll) { + responseData = await googleApiRequestAllItems.call( + this, + 'documents', + 'GET', + `/${projectId}/databases/${database}/documents/${collection}`, + ); + } else { + const limit = this.getNodeParameter('limit', 0) as string; + const getAllResponse = await googleApiRequest.call( + this, + 'GET', + `/${projectId}/databases/${database}/documents/${collection}`, + {}, + { pageSize: limit }, + ) as IDataObject; + responseData = getAllResponse.documents; + } + if (simple === false) { + returnData.push.apply(returnData, responseData); + } else { + returnData.push.apply(returnData, responseData.map((element: IDataObject) => fullDocumentToJson(element as IDataObject))); + } + } else if (operation === 'delete') { + const responseData: IDataObject[] = []; + + await Promise.all(items.map(async (item: IDataObject, i: number) => { + const projectId = this.getNodeParameter('projectId', i) as string; + const database = this.getNodeParameter('database', i) as string; + const collection = this.getNodeParameter('collection', i) as string; + const documentId = this.getNodeParameter('documentId', i) as string; + + await googleApiRequest.call( + this, + 'DELETE', + `/${projectId}/databases/${database}/documents/${collection}/${documentId}`, + ); + + responseData.push({ success: true }); + + })); + returnData.push.apply(returnData, responseData); + + } else if (operation === 'upsert') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + + const updates = items.map((item: IDataObject, i: number) => { + const collection = this.getNodeParameter('collection', i) as string; + const updateKey = this.getNodeParameter('updateKey', i) as string; + // @ts-ignore + const documentId = item['json'][updateKey] as string; + const columns = this.getNodeParameter('columns', i) as string; + const columnList = columns.split(',').map(column => column.trim()) as string[]; + const document = {}; + columnList.map(column => { + // @ts-ignore + document[column] = item['json'].hasOwnProperty(column) ? jsonToDocument(item['json'][column]) : jsonToDocument(null); + }); + + return { + update: { + name: `projects/${projectId}/databases/${database}/documents/${collection}/${documentId}`, + fields: document, + }, + updateMask: { + fieldPaths: columnList, + }, + }; + + }); + + responseData = []; + + const { writeResults, status } = await googleApiRequest.call( + this, + 'POST', + `/${projectId}/databases/${database}/documents:batchWrite`, + { writes: updates }, + ); + + for (let i = 0; i < writeResults.length; i++) { + writeResults[i]['status'] = status[i]; + Object.assign(writeResults[i], items[i].json); + responseData.push(writeResults[i]); + } + + returnData.push.apply(returnData, responseData); + + // } else if (operation === 'update') { + // const projectId = this.getNodeParameter('projectId', 0) as string; + // const database = this.getNodeParameter('database', 0) as string; + // const simple = this.getNodeParameter('simple', 0) as boolean; + + // await Promise.all(items.map(async (item: IDataObject, i: number) => { + // const collection = this.getNodeParameter('collection', i) as string; + // const updateKey = this.getNodeParameter('updateKey', i) as string; + // // @ts-ignore + // const documentId = item['json'][updateKey] as string; + // const columns = this.getNodeParameter('columns', i) as string; + // const columnList = columns.split(',').map(column => column.trim()) as string[]; + // const document = {}; + // columnList.map(column => { + // // @ts-ignore + // document[column] = item['json'].hasOwnProperty(column) ? jsonToDocument(item['json'][column]) : jsonToDocument(null); + // }); + // responseData = await googleApiRequest.call( + // this, + // 'PATCH', + // `/${projectId}/databases/${database}/documents/${collection}/${documentId}`, + // { fields: document }, + // { [`updateMask.fieldPaths`]: columnList }, + // ); + // if (simple === false) { + // returnData.push(responseData); + // } else { + // returnData.push(fullDocumentToJson(responseData as IDataObject)); + // } + // })); + + } else if (operation === 'query') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + const simple = this.getNodeParameter('simple', 0) as boolean; + + + await Promise.all(items.map(async (item: IDataObject, i: number) => { + const query = this.getNodeParameter('query', i) as string; + responseData = await googleApiRequest.call( + this, + 'POST', + `/${projectId}/databases/${database}/documents:runQuery`, + JSON.parse(query), + ); + if (simple === false) { + returnData.push.apply(returnData, responseData); + } else { + //@ts-ignore + returnData.push.apply(returnData, responseData.map((element: IDataObject) => { + return fullDocumentToJson(element.document as IDataObject); + }).filter((element: IDataObject) => !!element)); + } + })); + } + } else if (resource === 'collection') { + if (operation === 'getAll') { + const projectId = this.getNodeParameter('projectId', 0) as string; + const database = this.getNodeParameter('database', 0) as string; + const returnAll = this.getNodeParameter('returnAll', 0) as string; + + if (returnAll) { + const getAllResponse = await googleApiRequestAllItems.call( + this, + 'collectionIds', + 'POST', + `/${projectId}/databases/${database}/documents:listCollectionIds`, + ); + // @ts-ignore + responseData = getAllResponse.map(o => ({ name: o })); + } else { + const limit = this.getNodeParameter('limit', 0) as string; + const getAllResponse = await googleApiRequest.call( + this, + 'POST', + `/${projectId}/databases/${database}/documents:listCollectionIds`, + {}, + { pageSize: limit }, + ) as IDataObject; + // @ts-ignore + responseData = getAllResponse.collectionIds.map(o => ({ name: o })); + } + returnData.push.apply(returnData, responseData); + } + } + + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CollectionDescription.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CollectionDescription.ts new file mode 100644 index 0000000000..df338c340f --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/CollectionDescription.ts @@ -0,0 +1,114 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const collectionOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'collection', + ], + }, + }, + options: [ + { + name: 'Get All', + value: 'getAll', + description: 'Get all root collections', + }, + ], + default: 'getAll', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const collectionFields = [ + /* -------------------------------------------------------------------------- */ + /* collection:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'collection', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'collection', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + default: false, + displayOptions: { + show: { + resource: [ + 'collection', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'If all results should be returned or only up to a given limit.', + required: true, + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'collection', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 500, + }, + default: 100, + description: 'How many results to return.', + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/DocumentDescription.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/DocumentDescription.ts new file mode 100644 index 0000000000..b8f74c82a5 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/DocumentDescription.ts @@ -0,0 +1,745 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const documentOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'document', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a document', + }, + { + name: 'Create/Update', + value: 'upsert', + description: 'Create/Update a document', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete a document', + }, + { + name: 'Get', + value: 'get', + description: 'Get a document', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all documents from a collection', + }, + // { + // name: 'Update', + // value: 'update', + // description: 'Update a document', + // }, + { + name: 'Query', + value: 'query', + description: 'Runs a query against your documents', + }, + ], + default: 'get', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const documentFields = [ + /* -------------------------------------------------------------------------- */ + /* document:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'create', + ], + }, + }, + description: 'As displayed in firebase console URL.', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'create', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Collection', + name: 'collection', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'create', + ], + }, + }, + description: 'Collection name', + required: true, + }, + { + displayName: 'Columns / attributes', + name: 'columns', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'create', + ], + }, + }, + description: 'List of attributes to save', + required: true, + placeholder: 'productId, modelName, description', + }, + { + displayName: 'Simple', + name: 'simple', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'create', + ], + resource: [ + 'document', + ], + }, + }, + default: true, + description: 'When set to true a simplify version of the response will be used else the raw data.', + }, + + /* -------------------------------------------------------------------------- */ + /* document:get */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'get', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'get', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Collection', + name: 'collection', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'get', + ], + }, + }, + description: 'Collection name', + required: true, + }, + { + displayName: 'Document ID', + name: 'documentId', + type: 'string', + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'document', + ], + }, + }, + default: '', + description: 'Document ID', + required: true, + }, + { + displayName: 'Simple', + name: 'simple', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'document', + ], + }, + }, + default: true, + description: 'When set to true a simplify version of the response will be used else the raw data.', + }, + + /* -------------------------------------------------------------------------- */ + /* document:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Collection', + name: 'collection', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'Collection name', + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + default: false, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'getAll', + ], + }, + }, + description: 'If all results should be returned or only up to a given limit.', + required: true, + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 500, + }, + default: 100, + description: 'How many results to return.', + }, + { + displayName: 'Simple', + name: 'simple', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'document', + ], + }, + }, + default: true, + description: 'When set to true a simplify version of the response will be used else the raw data.', + }, + + /* -------------------------------------------------------------------------- */ + /* document:delete */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'delete', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'delete', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Collection', + name: 'collection', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'delete', + ], + }, + }, + description: 'Collection name', + required: true, + }, + { + displayName: 'Document ID', + name: 'documentId', + type: 'string', + displayOptions: { + show: { + operation: [ + 'delete', + ], + resource: [ + 'document', + ], + }, + }, + default: '', + description: 'Document ID', + required: true, + }, + // /* ---------------------------------------------------------------------- */ + // /* document:update */ + // /* -------------------------------------------------------------------------- */ + // { + // displayName: 'Project ID', + // name: 'projectId', + // type: 'options', + // default: '', + // typeOptions: { + // loadOptionsMethod: 'getProjects', + // }, + // displayOptions: { + // show: { + // resource: [ + // 'document', + // ], + // operation: [ + // 'update', + // ], + // }, + // }, + // description: 'As displayed in firebase console URL', + // required: true, + // }, + // { + // displayName: 'Database', + // name: 'database', + // type: 'string', + // default: '(default)', + // displayOptions: { + // show: { + // resource: [ + // 'document', + // ], + // operation: [ + // 'update', + // ], + // }, + // }, + // description: 'Usually the provided default value will work', + // required: true, + // }, + // { + // displayName: 'Collection', + // name: 'collection', + // type: 'string', + // default: '', + // displayOptions: { + // show: { + // resource: [ + // 'document', + // ], + // operation: [ + // 'update', + // ], + // }, + // }, + // description: 'Collection name', + // required: true, + // }, + // { + // displayName: 'Update Key', + // name: 'updateKey', + // type: 'string', + // displayOptions: { + // show: { + // resource: [ + // 'document', + // ], + // operation: [ + // 'update', + // ], + // }, + // }, + // default: '', + // description: 'Must correspond to a document ID', + // required: true, + // placeholder: 'documentId', + // }, + // { + // displayName: 'Columns /Attributes', + // name: 'columns', + // type: 'string', + // default: '', + // displayOptions: { + // show: { + // resource: [ + // 'document', + // ], + // operation: [ + // 'update', + // ], + // }, + // }, + // description: 'Columns to insert', + // required: true, + // placeholder: 'age, city, location', + // }, + // { + // displayName: 'Simple', + // name: 'simple', + // type: 'boolean', + // displayOptions: { + // show: { + // operation: [ + // 'update', + // ], + // resource: [ + // 'document', + // ], + // }, + // }, + // default: true, + // description: 'When set to true a simplify version of the response will be used else the raw data.', + // }, + /* -------------------------------------------------------------------------- */ + /* document:upsert */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'upsert', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'upsert', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Collection', + name: 'collection', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'upsert', + ], + }, + }, + description: 'Collection name', + required: true, + }, + { + displayName: 'Update Key', + name: 'updateKey', + type: 'string', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'upsert', + ], + }, + }, + default: '', + description: 'Must correspond to a document ID', + required: true, + placeholder: 'documentId', + }, + { + displayName: 'Columns /Attributes', + name: 'columns', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'upsert', + ], + }, + }, + description: 'Columns to insert', + required: true, + placeholder: 'age, city, location', + }, + /* -------------------------------------------------------------------------- */ + /* document:query */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'query', + ], + }, + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Database', + name: 'database', + type: 'string', + default: '(default)', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'query', + ], + }, + }, + description: 'Usually the provided default value will work', + required: true, + }, + { + displayName: 'Query JSON', + name: 'query', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'document', + ], + operation: [ + 'query', + ], + }, + }, + description: 'JSON query to execute', + required: true, + typeOptions: { + alwaysOpenEditWindow: true, + }, + placeholder: '{"structuredQuery": {"where": {"fieldFilter": {"field": {"fieldPath": "age"},"op": "EQUAL", "value": {"integerValue": 28}}}, "from": [{"collectionId": "users-collection"}]}}', + }, + { + displayName: 'Simple', + name: 'simple', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'query', + ], + resource: [ + 'document', + ], + }, + }, + default: true, + description: 'When set to true a simplify version of the response will be used else the raw data.', + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts new file mode 100644 index 0000000000..32e4ac1aa2 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GenericFunctions.ts @@ -0,0 +1,153 @@ +import { + OptionsWithUri, +} from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri: string | null = null): Promise { // tslint:disable-line:no-any + + const options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/json', + }, + method, + body, + qs, + qsStringifyOptions: { + arrayFormat: 'repeat', + }, + uri: uri || `https://firestore.googleapis.com/v1/projects${resource}`, + json: true, + }; + try { + if (Object.keys(body).length === 0) { + delete options.body; + } + + //@ts-ignore + return await this.helpers.requestOAuth2.call(this, 'googleFirebaseCloudFirestoreOAuth2Api', options); + } catch (error) { + let errors; + + if (error.response && error.response.body) { + + if (Array.isArray(error.response.body)) { + + errors = error.response.body; + + errors = errors.map((e: { error: { message: string } }) => e.error.message).join('|'); + } else { + errors = error.response.body.error.message; + } + + // Try to return the error prettier + throw new Error( + `Google Firebase error response [${error.statusCode}]: ${errors}`, + ); + } + throw error; + } +} + +export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, endpoint: string, body: any = {}, query: IDataObject = {}, uri: string | null = null): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + query.pageSize = 100; + + do { + responseData = await googleApiRequest.call(this, method, endpoint, body, query, uri); + query.pageToken = responseData['nextPageToken']; + returnData.push.apply(returnData, responseData[propertyName]); + } while ( + responseData['nextPageToken'] !== undefined && + responseData['nextPageToken'] !== '' + ); + + return returnData; +} + + +// Both functions below were taken from Stack Overflow jsonToDocument was fixed as it was unable to handle null values correctly +// https://stackoverflow.com/questions/62246410/how-to-convert-a-firestore-document-to-plain-json-and-vice-versa +// Great thanks to https://stackoverflow.com/users/3915246/mahindar +export function jsonToDocument(value: string | number | IDataObject | IDataObject[]): IDataObject { + if (value === 'true' || value === 'false' || typeof value === 'boolean') { + return { 'booleanValue': value }; + } else if (value === null) { + return { 'nullValue': null }; + } else if (!isNaN(value as number)) { + if (value.toString().indexOf('.') !== -1) { + return { 'doubleValue': value }; + } else { + return { 'integerValue': value }; + } + } else if (Date.parse(value as string)) { + const date = new Date(Date.parse(value as string)); + return { 'timestampValue': date.toISOString() }; + } else if (typeof value === 'string') { + return { 'stringValue': value }; + } else if (value && value.constructor === Array) { + return { 'arrayValue': { values: value.map(v => jsonToDocument(v)) } }; + } else if (typeof value === 'object') { + const obj = {}; + for (const o of Object.keys(value)) { + //@ts-ignore + obj[o] = jsonToDocument(value[o]); + } + return { 'mapValue': { fields: obj } }; + } + + return {}; +} + +export function fullDocumentToJson(data: IDataObject): IDataObject { + if (data === undefined) { + return data; + } + + return { + _name: data.name, + _createTime: data.createTime, + _updateTime: data.updateTime, + ...documentToJson(data.fields as IDataObject), + }; +} + + +export function documentToJson(fields: IDataObject): IDataObject { + const result = {}; + for (const f of Object.keys(fields)) { + const key = f, value = fields[f], + isDocumentType = ['stringValue', 'booleanValue', 'doubleValue', + 'integerValue', 'timestampValue', 'mapValue', 'arrayValue'].find(t => t === key); + if (isDocumentType) { + const item = ['stringValue', 'booleanValue', 'doubleValue', 'integerValue', 'timestampValue'] + .find(t => t === key); + if (item) { + return value as IDataObject; + } else if ('mapValue' === key) { + //@ts-ignore + return documentToJson(value!.fields || {}); + } else if ('arrayValue' === key) { + // @ts-ignore + const list = value.values as IDataObject[]; + // @ts-ignore + return !!list ? list.map(l => documentToJson(l)) : []; + } + } else { + // @ts-ignore + result[key] = documentToJson(value); + } + } + return result; +} diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/googleFirebaseCloudFirestore.png b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/googleFirebaseCloudFirestore.png new file mode 100644 index 0000000000000000000000000000000000000000..4be94a2b80c859e0d05d62159518723162b83454 GIT binary patch literal 2144 zcmXX`2{_bS8=s_X?WruO_)^_OSA@$TYcpeLY-O2bkB`eRi+v~5wWN%j&~{~4V`*%I znK8s*P#H@!DBZd!-I+0F`+t8u-}}7hocFx%Iq!LYzw?}vi*mZWTTx9B0)gy?!)#r^ z5xUjnw{Lm0ez^pJY=@wbZg$`lSac%ba3Y$ua5z9jM@p$MfQAqcS^iWD(B@J6@jrz? zAOH+Fzs&`pBI4uYK;Qae?4!JJZcm_uY02vj0BGR%FCGJ(2np2= zpu%xD95CuEqS%3<&9+NoDhe35!tH{KhOSQfLclGOF&hcfLey+59&nU2TS~j^Hv25Z zgBD;2Gz4@DEFLeQn@eBAc-{URJy0+Ym|WOv1NJyPexu7w^wZ|HLxsI=(jg>R^JbeZ z*b6(|GZOLhHx2lS5aC}2!qPLml-(E%Mm%Z-jQj@B9fZ#=@M0iyt#17EU0_=AunnkS zPGG=s3pgDC9s$rC06I*>+@ffMY9Ss&h({5%#4tgxIjCD;M}9)9|Bc%nAR4(0ZWOU# zK>vC1D4g5ne=89KEE$3%{OI&w?f38ujo&I@=+YKI+7?~HK`Zcdeu^vr00aUa7%>IQ zlMGpI@zx9Hr|*x6iHVMm2Ktfwq;09Gso>QB@9mP3l7JycVJ9>pAt5Lz2*kqA+{rC)(Z#b z?RZaYfetHPwg!-|&d)krzi})Vd;@7X7bjQ9Hd)#23UWfeSRfXOHbmYBBpc7=C6Y}( zmoqfbPHuToU!Lb_Wqk31j;6+*?NX^kA{L7T+?CI47X4Yp-Q4uV@X(Mzlp_NAi?-I` z{c=(;EZp1#$=cXh{qp(a$7%Mvx8q|BT2mA0MO{q|@pf)jYD&1jHwtbIHPt(D+_uOF z0+G#!+giE7239BCV`qGocXBLWV|1V1ClqamR>54kKy7k@h?9sU``E+uQxEhxl zKBpJMNq<;^?Y{S2j@u)BWioYRs%H$+jGjhSTI)6m524>0=~4WNQK6!>Q=VaYQK-R} zWnVruWlra~PI>;?cxGB{e(LyIUG$S*E6&uf80ShnKSu9p(5k>fzZ_QnruYoyUi`23 z6sz$_1E(P}8rkih62I$KFhhCYHCe|wT-=|!{q~h*I*((clH>YL zxegotsSY)&f$ixFMjM^&@R9Wh)R;B2KR2)Klin8Ir$=JD6BTRdIl_vuf}^h4g&ncU0lqr_*IA{Vbe(Lfa+2==2;nl()it`!=T%S|Rzdj_&K z-2Q=T^A*FskG#=TJ{VCP!BP;2582R4K0imTH_9x%kEZTSj=g&}Rh4*srv0hfloA5C zc*|kT^uw`|OOJ^Pb2d8qzVhw|h`U{H=nF)rkH$Y>wcKn#Jtq#zuIrd-?V&fdXR-hF z^=>VeqJ|vI`1Qri>I0b~{rZPW1M=JQ3L5$eI6(G6txVw zm!x=H{O~?=zvv6EP*v?7;R9mGMP;&Fj+Au1({Ac^*_g?~!%EVadHsb&fe)d^#JROM zZ|6kg^9JiDuaCd*_SmZ<^&t{wV(VQLVS+jF_yfZ(hw%en*^wX3&+fl38NZt3 zJNKac%D)y5x^`(23zFQcBOCBzFPD#~pGY~pI<<@mzoT^f$c@R&&=()n7<(Nr%)Y*PyBm zn)2ST9LFk#wio;ei!%MadCHtK!(zjZVF>EGy51_x)M*LFoY-rt8IjT8%`RV9?_U!3G@+%Ko;>vO;536TzxUeEb>-4RgXB&5aj{+d1Tpom69Au;a!vs0#l3=Xh506pexH^7t~cF8{i+KW z1x-l3k{xAf2`8gFbx-==`})$ks@OK48?T1ZcWZUDDbeZqKF}I}U#;PdZKg_waa9QZ zK+X89M1iqD!?p)yV2qCkS9$G?w*54**Z~{);-OVys73xJr~Q3&2J zJov|`?hh1sl5xvH+eYo;`GVdHhfk|p&&?V|c+|=y253g;WEuQqlRv)b&w(hy1qW(7^tl}N2bJfUZPp8}mzexz(&dIjX+Bf}w4-So+ literal 0 HcmV?d00001 diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts new file mode 100644 index 0000000000..66a38a0666 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts @@ -0,0 +1,78 @@ +import { + OptionsWithUrl, +} from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, projectId: string, method: string, resource: string, body: any = {}, qs: IDataObject = {}, headers: IDataObject = {}, uri: string | null = null): Promise { // tslint:disable-line:no-any + + const options: OptionsWithUrl = { + headers: { + 'Content-Type': 'application/json', + }, + method, + body, + qs, + url: uri || `https://${projectId}.firebaseio.com/${resource}.json`, + json: true, + }; + try { + if (Object.keys(headers).length !== 0) { + options.headers = Object.assign({}, options.headers, headers); + } + if (Object.keys(body).length === 0) { + delete options.body; + } + + return await this.helpers.requestOAuth2!.call(this, 'googleFirebaseRealtimeDatabaseOAuth2Api', options); + } catch (error) { + if (error.response && error.response.body && error.response.body.error) { + + let errors; + + if (error.response.body.error.errors) { + + errors = error.response.body.error.errors; + + errors = errors.map((e: IDataObject) => e.message).join('|'); + + } else { + errors = error.response.body.error.message; + } + + // Try to return the error prettier + throw new Error( + `Google Firebase error response [${error.statusCode}]: ${errors}`, + ); + } + throw error; + } +} + + +export async function googleApiRequestAllItems(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, projectId: string, method: string, resource: string, body: any = {}, qs: IDataObject = {}, headers: IDataObject = {}, uri: string | null = null): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + qs.pageSize = 100; + + do { + responseData = await googleApiRequest.call(this, projectId, method, resource, body, qs, {}, uri); + qs.pageToken = responseData['nextPageToken']; + returnData.push.apply(returnData, responseData[resource]); + } while ( + responseData['nextPageToken'] !== undefined && + responseData['nextPageToken'] !== '' + ); + + return returnData; +} diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/RealtimeDatabase.node.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/RealtimeDatabase.node.ts new file mode 100644 index 0000000000..82c9d3fc01 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/RealtimeDatabase.node.ts @@ -0,0 +1,204 @@ +import { + IExecuteFunctions, +} from 'n8n-core'; + +import { + IDataObject, + ILoadOptionsFunctions, + INodeExecutionData, + INodePropertyOptions, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + +import { + googleApiRequest, + googleApiRequestAllItems, +} from './GenericFunctions'; + +export class RealtimeDatabase implements INodeType { + description: INodeTypeDescription = { + displayName: 'Google Firebase Realtime Database', + name: 'googleFirebaseRealtimeDatabase', + icon: 'file:googleFirebaseRealtimeDatabase.png', + group: ['input'], + version: 1, + subtitle: '={{$parameter["operation"]}}', + description: 'Interact with Google Firebase - Realtime Database API', + defaults: { + name: 'Google Cloud Realtime Database', + color: '#ffcb2d', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'googleFirebaseRealtimeDatabaseOAuth2Api', + }, + ], + properties: [ + { + displayName: 'Project ID', + name: 'projectId', + type: 'options', + default: '', + typeOptions: { + loadOptionsMethod: 'getProjects', + }, + description: 'As displayed in firebase console URL', + required: true, + }, + { + displayName: 'Operation', + name: 'operation', + type: 'options', + options: [ + { + name: 'Create', + value: 'create', + description: 'Write data to a database', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete data from a database', + }, + { + name: 'Get', + value: 'get', + description: 'Get a record from a database', + }, + { + name: 'Push', + value: 'push', + description: 'Append to a list of data', + }, + { + name: 'Update', + value: 'update', + description: 'Update item on a database', + }, + ], + default: 'create', + description: 'The operation to perform.', + required: true, + }, + { + displayName: 'Object Path', + name: 'path', + type: 'string', + default: '', + placeholder: '/app/users', + description: 'Object path on database. With leading slash. Do not append .json.', + required: true, + }, + { + displayName: 'Columns / Attributes', + name: 'attributes', + type: 'string', + default: '', + displayOptions: { + show: { + operation: [ + 'create', + 'push', + 'update', + ], + }, + }, + description: 'Attributes to save', + required: true, + placeholder: 'age, name, city', + }, + ], + }; + + methods = { + loadOptions: { + async getProjects( + this: ILoadOptionsFunctions, + ): Promise { + const projects = await googleApiRequestAllItems.call( + this, + 'projects', + 'GET', + 'results', + {}, + {}, + {}, + 'https://firebase.googleapis.com/v1beta1/projects', + ); + const returnData = projects.map((o: IDataObject) => ({ name: o.projectId, value: o.projectId })) as INodePropertyOptions[]; + return returnData; + }, + }, + }; + + async execute(this: IExecuteFunctions): Promise { + + const items = this.getInputData(); + const returnData: IDataObject[] = []; + const length = (items.length as unknown) as number; + let responseData; + const operation = this.getNodeParameter('operation', 0) as string; + //https://firebase.google.com/docs/reference/rest/database + + if (['push', 'create', 'update'].includes(operation) && items.length === 1 && Object.keys(items[0].json).length === 0) { + throw new Error(`The ${operation} operation needs input data`); + } + + for (let i = 0; i < length; i++) { + const projectId = this.getNodeParameter('projectId', i) as string; + let method = 'GET', attributes = ''; + const document: IDataObject = {}; + if (operation === 'create') { + method = 'PUT'; + attributes = this.getNodeParameter('attributes', i) as string; + } else if (operation === 'delete') { + method = 'DELETE'; + } else if (operation === 'get') { + method = 'GET'; + } else if (operation === 'push') { + method = 'POST'; + attributes = this.getNodeParameter('attributes', i) as string; + } else if (operation === 'update') { + method = 'PATCH'; + attributes = this.getNodeParameter('attributes', i) as string; + } + + if (attributes) { + const attributeList = attributes.split(',').map(el => el.trim()); + attributeList.map((attribute: string) => { + if (items[i].json.hasOwnProperty(attribute)) { + document[attribute] = items[i].json[attribute]; + } + }); + } + + responseData = await googleApiRequest.call( + this, + projectId, + method, + this.getNodeParameter('path', i) as string, + document, + ); + + if (responseData === null) { + if (operation === 'get') { + throw new Error(`Google Firebase error response: Requested entity was not found.`); + } else if (method === 'DELETE') { + responseData = { success: true }; + } + } + + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else if (typeof responseData === 'string' || typeof responseData === 'number') { + returnData.push({ [this.getNodeParameter('path', i) as string]: responseData } as IDataObject); + } else { + returnData.push(responseData as IDataObject); + } + } + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/googleFirebaseRealtimeDatabase.png b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/googleFirebaseRealtimeDatabase.png new file mode 100644 index 0000000000000000000000000000000000000000..a95667610749659b31f1395f467b1a41d59ad878 GIT binary patch literal 2103 zcmX9;3pmql8=tdyajDSZqa4bqdR0gc898iDTO%RfR3;jq(`J%6Ha-+lFU=_>Qc6h9 zWDPTmJT+eeo_w&2&`*$Cn=Xx^H9?nV%`xIa>m=Y4~QPKy`$ufIcrV3oYt&gjAa?a8a8B1cG!Fw*v|Ed0)C77ZVdB z?r`KM|M4%+X3v=z0s$CwSWpla>~&8}xG8*cQdng0I0pyP-GL!Hs03lf2_6wP)8rK&M_BI)0^Xm6 zCPWJ*BcRy|XlH~>_vZyTLAMRSLI59JL8=R+1>d>KlZJ7;q2-uU@^nHDpI561N7ndq^UYgzeV+Bq?yvl24KV2i!r9 zqnLSypQ6f7RRsIo__tKo*4BoHhx7CEaX1{<;|flk<))I|6-u{lF14IOqXFH%mo=-AHb)qmW_GPm$**$;{5qGMUVto}S#?+*_$h z$w^7^H{xPr30N!^{D1<7;NW|!t@lePc;_jzMl->>l>DRa|{-2t?MNG^>D_Yp^0nR$`%I!sMmZBO9L7~1N zUz<-><=ueI&(C*ub~ZINg-6AL?5NJixTpD{y_J^+pZky2`d~c0mODJeweG7>=r%hZ z#ah^C#>>zIbN2Je>h%O?edyiC<1rqdFiB~7X&HboB@}G!kP~eRWJCfnAR1>}R8tU% zHnKOabm3gRqe}{FKTL@J2oy8z!5C;Dz*px!GQVY&*^O+Dt8(Mq-JT#%Oj>{W=fL)WjRd)HuWoN z?YsZd9I0%L)aCi};aeHn3X#&?XsfY8S1m&MUSB(u@Q8@;@wCD!jGenS?ljCdv$4Ie zHPL^JqVS-w9)mEm-lzHT0Dt^(v_ZDkbg~Kfe$l?d1!KuvCf{V@1h5};3v7PpxJ%ms z<4_s6>+JdvT$^*EAOQ8;sbOqa+M&JHe}VSJJNA${z13*;az-FI&NEJSXq*hEWhWP% z_mlj)F|4}4!TChMx2e-f}rk#!Kizf7F5%X{DA?tMyQpLc#ktf8^AL1R{Va(TN! zA>7C3)M#u&GbS@Q@gUM}wNL5$ruvi@85a|BTb5_PH54?b_&uEy zXm}wk?cxo8%9fkl8ODwoKyoU*D6+FM4}bY9rkp}$<;Y&L*iV2xlbdkTZRI{Xp4{77 zG4-~e<*?&x+k@&si=~`u2ZO0B4lUr`%Dm2zrWKX{3Z>77am`DX*EPI!RH6bR(=k5| zzm~2FGQT8vUH8-Y<@~IcCEAp`NO)R;uc1<>ReT;kXH@;ZtrO6#l0Z5_m?@~H7e^{< zVQwr}rK*`6lU44l!kLEgS)Fa1fulD3dG!(>aH96t#41X9RHOUpUvl>-pO5K1rav4* z?b+$ZDXXoGdeg0LssJCYRl_nue%Nalhqu*gs2Dq!XTMr?``sJ;MAFpnVBz1_O!fr( zW@s5(^<@*p;vMsGlWieK>Xe)$I!?cK)2;dVMy9*FY@FR5-?-+}eEeYH?kZhB_^aom z>Shw%C3zz+q822iQX(0TM((br5tCEabB~uY7k8>#9+#k}zy_3^Do=d21@Er~N-3K< TolD#P31LV_4~JU&z|?;LSnq0; literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 7403c6a4ff..8e76b9045d 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -83,6 +83,8 @@ "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", "dist/credentials/GoogleContactsOAuth2Api.credentials.js", "dist/credentials/GoogleDriveOAuth2Api.credentials.js", + "dist/credentials/GoogleFirebaseCloudFirestoreOAuth2Api.credentials.js", + "dist/credentials/GoogleFirebaseRealtimeDatabaseOAuth2Api.credentials.js", "dist/credentials/GoogleOAuth2Api.credentials.js", "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", "dist/credentials/GSuiteAdminOAuth2Api.credentials.js", @@ -291,6 +293,8 @@ "dist/nodes/Google/Calendar/GoogleCalendar.node.js", "dist/nodes/Google/Contacts/GoogleContacts.node.js", "dist/nodes/Google/Drive/GoogleDrive.node.js", + "dist/nodes/Google/Firebase/CloudFirestore/CloudFirestore.node.js", + "dist/nodes/Google/Firebase/RealtimeDatabase/RealtimeDatabase.node.js", "dist/nodes/Google/Gmail/Gmail.node.js", "dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js", "dist/nodes/Google/Sheet/GoogleSheets.node.js",