n8n-nodes-base 0.223.2 → 0.224.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/GoogleBigQueryOAuth2Api.credentials.js +5 -1
- package/dist/credentials/GoogleBigQueryOAuth2Api.credentials.js.map +1 -1
- package/dist/known/credentials.json +3 -1
- package/dist/methods/defined.json +5 -4
- package/dist/methods/referenced.json +2 -1
- package/dist/nodes/Clockify/ClockifyTrigger.node.js +3 -4
- package/dist/nodes/Clockify/ClockifyTrigger.node.js.map +1 -1
- package/dist/nodes/Clockify/CommonDtos.d.ts +2 -2
- package/dist/nodes/Clockify/CommonDtos.js.map +1 -1
- package/dist/nodes/Clockify/EntryTypeEnum.d.ts +1 -1
- package/dist/nodes/Clockify/EntryTypeEnum.js.map +1 -1
- package/dist/nodes/Clockify/ProjectInterfaces.d.ts +2 -2
- package/dist/nodes/Clockify/ProjectInterfaces.js.map +1 -1
- package/dist/nodes/Clockify/UserDtos.d.ts +1 -1
- package/dist/nodes/Clockify/UserDtos.js.map +1 -1
- package/dist/nodes/Clockify/WorkpaceInterfaces.d.ts +4 -4
- package/dist/nodes/Clockify/WorkpaceInterfaces.js.map +1 -1
- package/dist/nodes/Code/Code.node.js +2 -2
- package/dist/nodes/Code/Code.node.js.map +1 -1
- package/dist/nodes/Cortex/AnalyzerDescriptions.js +4 -5
- package/dist/nodes/Cortex/AnalyzerDescriptions.js.map +1 -1
- package/dist/nodes/Cortex/AnalyzerInterface.d.ts +3 -3
- package/dist/nodes/Cortex/AnalyzerInterface.js.map +1 -1
- package/dist/nodes/Cortex/ResponderDescription.js +12 -13
- package/dist/nodes/Cortex/ResponderDescription.js.map +1 -1
- package/dist/nodes/CrateDb/CrateDb.node.js +4 -0
- package/dist/nodes/CrateDb/CrateDb.node.js.map +1 -1
- package/dist/nodes/EmailSend/v1/EmailSendV1.node.js +0 -6
- package/dist/nodes/EmailSend/v1/EmailSendV1.node.js.map +1 -1
- package/dist/nodes/Formstack/GenericFunctions.d.ts +1 -1
- package/dist/nodes/Formstack/GenericFunctions.js.map +1 -1
- package/dist/nodes/Freshdesk/Freshdesk.node.js.map +1 -1
- package/dist/nodes/Function/Function.node.js +1 -1
- package/dist/nodes/Function/Function.node.js.map +1 -1
- package/dist/nodes/FunctionItem/FunctionItem.node.js +2 -2
- package/dist/nodes/FunctionItem/FunctionItem.node.js.map +1 -1
- package/dist/nodes/Google/Ads/CampaignDescription.js +6 -8
- package/dist/nodes/Google/Ads/CampaignDescription.js.map +1 -1
- package/dist/nodes/Google/BigQuery/GoogleBigQuery.node.d.ts +3 -11
- package/dist/nodes/Google/BigQuery/GoogleBigQuery.node.js +9 -196
- package/dist/nodes/Google/BigQuery/GoogleBigQuery.node.js.map +1 -1
- package/dist/nodes/Google/BigQuery/test/v2/node/executeQuery.workflow.json +62 -0
- package/dist/nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.workflow.json +133 -0
- package/dist/nodes/Google/BigQuery/test/v2/node/insert.manualMode.workflow.json +99 -0
- package/dist/nodes/Google/BigQuery/v1/GenericFunctions.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v1/GoogleBigQueryV1.node.d.ts +14 -0
- package/dist/nodes/Google/BigQuery/v1/GoogleBigQueryV1.node.js +217 -0
- package/dist/nodes/Google/BigQuery/v1/GoogleBigQueryV1.node.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v1/RecordDescription.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/GoogleBigQueryV2.node.d.ts +12 -0
- package/dist/nodes/Google/BigQuery/v2/GoogleBigQueryV2.node.js +20 -0
- package/dist/nodes/Google/BigQuery/v2/GoogleBigQueryV2.node.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/commonDescriptions/RLC.description.d.ts +4 -0
- package/dist/nodes/Google/BigQuery/v2/actions/commonDescriptions/RLC.description.js +120 -0
- package/dist/nodes/Google/BigQuery/v2/actions/commonDescriptions/RLC.description.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/Database.resource.d.ts +5 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/Database.resource.js +89 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/Database.resource.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/executeQuery.operation.d.ts +23 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/executeQuery.operation.js +243 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/executeQuery.operation.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/insert.operation.d.ts +23 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/insert.operation.js +234 -0
- package/dist/nodes/Google/BigQuery/v2/actions/database/insert.operation.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/node.type.d.ts +7 -0
- package/dist/nodes/Google/BigQuery/v2/actions/node.type.js +3 -0
- package/dist/nodes/Google/BigQuery/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/router.d.ts +3 -0
- package/dist/nodes/Google/BigQuery/v2/actions/router.js +47 -0
- package/dist/nodes/Google/BigQuery/v2/actions/router.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/Google/BigQuery/v2/actions/versionDescription.js +95 -0
- package/dist/nodes/Google/BigQuery/v2/actions/versionDescription.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/interfaces.d.ts +28 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/interfaces.js +3 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/utils.d.ts +9 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/utils.js +110 -0
- package/dist/nodes/Google/BigQuery/v2/helpers/utils.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/methods/index.d.ts +2 -0
- package/dist/nodes/Google/BigQuery/v2/methods/index.js +29 -0
- package/dist/nodes/Google/BigQuery/v2/methods/index.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/methods/listSearch.d.ts +4 -0
- package/dist/nodes/Google/BigQuery/v2/methods/listSearch.js +71 -0
- package/dist/nodes/Google/BigQuery/v2/methods/listSearch.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/methods/loadOptions.d.ts +3 -0
- package/dist/nodes/Google/BigQuery/v2/methods/loadOptions.js +42 -0
- package/dist/nodes/Google/BigQuery/v2/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Google/BigQuery/v2/transport/index.d.ts +4 -0
- package/dist/nodes/Google/BigQuery/v2/transport/index.js +121 -0
- package/dist/nodes/Google/BigQuery/v2/transport/index.js.map +1 -0
- package/dist/nodes/Google/Chat/MessageInterface.d.ts +1 -1
- package/dist/nodes/Google/Chat/MessageInterface.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.d.ts +5 -5
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.js +5 -6
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheets.types.js.map +1 -1
- package/dist/nodes/ItemLists/V1/summarize.operation.js +10 -11
- package/dist/nodes/ItemLists/V1/summarize.operation.js.map +1 -1
- package/dist/nodes/ItemLists/V2/summarize.operation.js +10 -11
- package/dist/nodes/ItemLists/V2/summarize.operation.js.map +1 -1
- package/dist/nodes/Mailchimp/Mailchimp.node.js.map +1 -1
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +4 -0
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
- package/dist/nodes/MySql/v1/MySqlV1.node.js +4 -6
- package/dist/nodes/MySql/v1/MySqlV1.node.js.map +1 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js +2 -1
- package/dist/nodes/MySql/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/N8n/test/node/workflow.n8n.workflows.json +694 -0
- package/dist/nodes/PayPal/PaymentInteface.d.ts +2 -2
- package/dist/nodes/PayPal/PaymentInteface.js.map +1 -1
- package/dist/nodes/Postgres/v1/PostgresV1.node.js +4 -6
- package/dist/nodes/Postgres/v1/PostgresV1.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js +2 -1
- package/dist/nodes/Postgres/v2/actions/database/executeQuery.operation.js.map +1 -1
- package/dist/nodes/QuestDb/QuestDb.node.js +4 -0
- package/dist/nodes/QuestDb/QuestDb.node.js.map +1 -1
- package/dist/nodes/QuickChart/QuickChart.node.js.map +1 -1
- package/dist/nodes/SendInBlue/GenericFunctions.js +6 -6
- package/dist/nodes/SendInBlue/GenericFunctions.js.map +1 -1
- package/dist/nodes/Snowflake/Snowflake.node.js +3 -0
- package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
- package/dist/nodes/TheHive/descriptions/AlertDescription.js +12 -13
- package/dist/nodes/TheHive/descriptions/AlertDescription.js.map +1 -1
- package/dist/nodes/TheHive/descriptions/CaseDescription.js +12 -13
- package/dist/nodes/TheHive/descriptions/CaseDescription.js.map +1 -1
- package/dist/nodes/TheHive/descriptions/ObservableDescription.js +12 -13
- package/dist/nodes/TheHive/descriptions/ObservableDescription.js.map +1 -1
- package/dist/nodes/TheHive/interfaces/AlertInterface.d.ts +2 -2
- package/dist/nodes/TheHive/interfaces/AlertInterface.js.map +1 -1
- package/dist/nodes/TheHive/interfaces/CaseInterface.d.ts +3 -3
- package/dist/nodes/TheHive/interfaces/CaseInterface.js.map +1 -1
- package/dist/nodes/TheHive/interfaces/LogInterface.d.ts +1 -1
- package/dist/nodes/TheHive/interfaces/LogInterface.js.map +1 -1
- package/dist/nodes/TheHive/interfaces/ObservableInterface.d.ts +2 -2
- package/dist/nodes/TheHive/interfaces/ObservableInterface.js.map +1 -1
- package/dist/nodes/TheHive/interfaces/TaskInterface.d.ts +1 -1
- package/dist/nodes/TheHive/interfaces/TaskInterface.js.map +1 -1
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js +4 -0
- package/dist/nodes/TimescaleDb/TimescaleDb.node.js.map +1 -1
- package/dist/nodes/Todoist/v1/OperationHandler.d.ts +1 -1
- package/dist/nodes/Todoist/v1/OperationHandler.js +3 -3
- package/dist/nodes/Todoist/v1/OperationHandler.js.map +1 -1
- package/dist/nodes/Todoist/v1/Service.d.ts +1 -11
- package/dist/nodes/Todoist/v1/Service.js +1 -13
- package/dist/nodes/Todoist/v1/Service.js.map +1 -1
- package/dist/nodes/Todoist/v1/TodoistV1.node.js +1 -1
- package/dist/nodes/Todoist/v1/TodoistV1.node.js.map +1 -1
- package/dist/nodes/Todoist/v2/OperationHandler.d.ts +1 -1
- package/dist/nodes/Todoist/v2/OperationHandler.js +3 -3
- package/dist/nodes/Todoist/v2/OperationHandler.js.map +1 -1
- package/dist/nodes/Todoist/v2/Service.d.ts +1 -11
- package/dist/nodes/Todoist/v2/Service.js +1 -13
- package/dist/nodes/Todoist/v2/Service.js.map +1 -1
- package/dist/nodes/Todoist/v2/TodoistV2.node.js +1 -1
- package/dist/nodes/Todoist/v2/TodoistV2.node.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +13 -12
- package/package.json +4 -4
- package/dist/nodes/Google/BigQuery/GenericFunctions.js.map +0 -1
- package/dist/nodes/Google/BigQuery/RecordDescription.js.map +0 -1
- /package/dist/nodes/Google/BigQuery/{GenericFunctions.d.ts → v1/GenericFunctions.d.ts} +0 -0
- /package/dist/nodes/Google/BigQuery/{GenericFunctions.js → v1/GenericFunctions.js} +0 -0
- /package/dist/nodes/Google/BigQuery/{RecordDescription.d.ts → v1/RecordDescription.d.ts} +0 -0
- /package/dist/nodes/Google/BigQuery/{RecordDescription.js → v1/RecordDescription.js} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AllEntities, Entity } from 'n8n-workflow';
|
|
2
|
+
type GoogleBigQueryMap = {
|
|
3
|
+
database: 'executeQuery' | 'insert';
|
|
4
|
+
};
|
|
5
|
+
export type GoogleBigQuery = AllEntities<GoogleBigQueryMap>;
|
|
6
|
+
export type GoogleBigQueryDatabase = Entity<GoogleBigQueryMap, 'database'>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.type.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/actions/node.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.router = void 0;
|
|
27
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
28
|
+
const record = __importStar(require("./database/Database.resource"));
|
|
29
|
+
async function router() {
|
|
30
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
31
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
32
|
+
let returnData = [];
|
|
33
|
+
const googleBigQuery = {
|
|
34
|
+
resource,
|
|
35
|
+
operation,
|
|
36
|
+
};
|
|
37
|
+
switch (googleBigQuery.resource) {
|
|
38
|
+
case 'database':
|
|
39
|
+
returnData = await record[googleBigQuery.operation].execute.call(this);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not known`);
|
|
43
|
+
}
|
|
44
|
+
return this.prepareOutputData(returnData);
|
|
45
|
+
}
|
|
46
|
+
exports.router = router;
|
|
47
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/actions/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAkD;AAGlD,qEAAuD;AAEhD,KAAK,UAAU,MAAM;IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAiB,UAAU,EAAE,CAAC,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAExD,IAAI,UAAU,GAAyB,EAAE,CAAC;IAE1C,MAAM,cAAc,GAAG;QACtB,QAAQ;QACR,SAAS;KACS,CAAC;IAEpB,QAAQ,cAAc,CAAC,QAAQ,EAAE;QAChC,KAAK,UAAU;YACd,UAAU,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvE,MAAM;QACP;YACC,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,iBAAiB,QAAQ,gBAAgB,CAAC,CAAC;KACzF;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AApBD,wBAoBC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.versionDescription = void 0;
|
|
27
|
+
const database = __importStar(require("./database/Database.resource"));
|
|
28
|
+
exports.versionDescription = {
|
|
29
|
+
displayName: 'Google BigQuery',
|
|
30
|
+
name: 'googleBigQuery',
|
|
31
|
+
icon: 'file:googleBigQuery.svg',
|
|
32
|
+
group: ['input'],
|
|
33
|
+
version: 2,
|
|
34
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
35
|
+
description: 'Consume Google BigQuery API',
|
|
36
|
+
defaults: {
|
|
37
|
+
name: 'Google BigQuery',
|
|
38
|
+
},
|
|
39
|
+
inputs: ['main'],
|
|
40
|
+
outputs: ['main'],
|
|
41
|
+
credentials: [
|
|
42
|
+
{
|
|
43
|
+
name: 'googleApi',
|
|
44
|
+
required: true,
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: {
|
|
47
|
+
authentication: ['serviceAccount'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'googleBigQueryOAuth2Api',
|
|
53
|
+
required: true,
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
authentication: ['oAuth2'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
properties: [
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Authentication',
|
|
64
|
+
name: 'authentication',
|
|
65
|
+
type: 'options',
|
|
66
|
+
noDataExpression: true,
|
|
67
|
+
options: [
|
|
68
|
+
{
|
|
69
|
+
name: 'OAuth2 (recommended)',
|
|
70
|
+
value: 'oAuth2',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Service Account',
|
|
74
|
+
value: 'serviceAccount',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
default: 'oAuth2',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Resource',
|
|
81
|
+
name: 'resource',
|
|
82
|
+
type: 'hidden',
|
|
83
|
+
noDataExpression: true,
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
name: 'Database',
|
|
87
|
+
value: 'database',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
default: 'database',
|
|
91
|
+
},
|
|
92
|
+
...database.description,
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=versionDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionDescription.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/actions/versionDescription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uEAAyD;AAE5C,QAAA,kBAAkB,GAAyB;IACvD,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,8BAA8B;IACxC,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE;QACT,IAAI,EAAE,iBAAiB;KACvB;IACD,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,CAAC;IACjB,WAAW,EAAE;QACZ;YACC,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE;gBACf,IAAI,EAAE;oBACL,cAAc,EAAE,CAAC,gBAAgB,CAAC;iBAClC;aACD;SACD;QACD;YACC,IAAI,EAAE,yBAAyB;YAC/B,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE;gBACf,IAAI,EAAE;oBACL,cAAc,EAAE,CAAC,QAAQ,CAAC;iBAC1B;aACD;SACD;KACD;IACD,UAAU,EAAE;QACX;YACC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,SAAS;YACf,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE;gBACR;oBAEC,IAAI,EAAE,sBAAsB;oBAC5B,KAAK,EAAE,QAAQ;iBACf;gBACD;oBACC,IAAI,EAAE,iBAAiB;oBACvB,KAAK,EAAE,gBAAgB;iBACvB;aACD;YACD,OAAO,EAAE,QAAQ;SACjB;QACD;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE;gBACR;oBACC,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,UAAU;iBACjB;aACD;YACD,OAAO,EAAE,UAAU;SACnB;QACD,GAAG,QAAQ,CAAC,WAAW;KACvB;CACD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IDataObject } from 'n8n-workflow';
|
|
2
|
+
export type SchemaField = {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
mode: string;
|
|
6
|
+
fields?: SchemaField[];
|
|
7
|
+
};
|
|
8
|
+
export type TableSchema = {
|
|
9
|
+
fields: SchemaField[];
|
|
10
|
+
};
|
|
11
|
+
export type TableRawData = {
|
|
12
|
+
f: Array<{
|
|
13
|
+
v: IDataObject | TableRawData;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export type JobReference = {
|
|
17
|
+
projectId: string;
|
|
18
|
+
jobId: string;
|
|
19
|
+
location: string;
|
|
20
|
+
};
|
|
21
|
+
export type JobInsertResponse = {
|
|
22
|
+
kind: string;
|
|
23
|
+
id: string;
|
|
24
|
+
jobReference: JobReference;
|
|
25
|
+
status: {
|
|
26
|
+
state: 'PENDING' | 'RUNNING' | 'DONE';
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/helpers/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-core';
|
|
2
|
+
import type { IDataObject, INodeExecutionData } from 'n8n-workflow';
|
|
3
|
+
import type { SchemaField, TableRawData, TableSchema } from './interfaces';
|
|
4
|
+
export declare function wrapData(data: IDataObject | IDataObject[]): INodeExecutionData[];
|
|
5
|
+
export declare function simplify(data: TableRawData[], schema: SchemaField[], includeSchema?: boolean): IDataObject[];
|
|
6
|
+
export declare function prepareOutput(response: IDataObject, itemIndex: number, rawOutput: boolean, includeSchema?: boolean): import("n8n-workflow").NodeExecutionWithMetadata[];
|
|
7
|
+
export declare function checkSchema(this: IExecuteFunctions, schema: TableSchema, record: IDataObject, i: number): {
|
|
8
|
+
[x: string]: IDataObject | IDataObject[] | import("n8n-workflow").GenericValue | import("n8n-workflow").GenericValue[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkSchema = exports.prepareOutput = exports.simplify = exports.wrapData = void 0;
|
|
4
|
+
const n8n_core_1 = require("n8n-core");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
function getFieldValue(schemaField, field) {
|
|
7
|
+
if (schemaField.type === 'RECORD') {
|
|
8
|
+
return simplify([field.v], schemaField.fields);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
let value = field.v;
|
|
12
|
+
if (schemaField.type === 'JSON') {
|
|
13
|
+
try {
|
|
14
|
+
value = (0, n8n_workflow_1.jsonParse)(value);
|
|
15
|
+
}
|
|
16
|
+
catch (error) { }
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function wrapData(data) {
|
|
22
|
+
if (!Array.isArray(data)) {
|
|
23
|
+
return [{ json: data }];
|
|
24
|
+
}
|
|
25
|
+
return data.map((item) => ({
|
|
26
|
+
json: item,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
exports.wrapData = wrapData;
|
|
30
|
+
function simplify(data, schema, includeSchema = false) {
|
|
31
|
+
const returnData = [];
|
|
32
|
+
for (const entry of data) {
|
|
33
|
+
const record = {};
|
|
34
|
+
for (const [index, field] of entry.f.entries()) {
|
|
35
|
+
if (schema[index].mode !== 'REPEATED') {
|
|
36
|
+
record[schema[index].name] = getFieldValue(schema[index], field);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
record[schema[index].name] = field.v.flatMap((repeatedField) => {
|
|
40
|
+
return getFieldValue(schema[index], repeatedField);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (includeSchema) {
|
|
45
|
+
record._schema = schema;
|
|
46
|
+
}
|
|
47
|
+
returnData.push(record);
|
|
48
|
+
}
|
|
49
|
+
return returnData;
|
|
50
|
+
}
|
|
51
|
+
exports.simplify = simplify;
|
|
52
|
+
function prepareOutput(response, itemIndex, rawOutput, includeSchema = false) {
|
|
53
|
+
let responseData;
|
|
54
|
+
if (response === undefined)
|
|
55
|
+
return [];
|
|
56
|
+
if (rawOutput) {
|
|
57
|
+
responseData = response;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const { rows, schema } = response;
|
|
61
|
+
if (rows !== undefined && schema !== undefined) {
|
|
62
|
+
const fields = schema.fields;
|
|
63
|
+
responseData = rows;
|
|
64
|
+
responseData = simplify(responseData, fields, includeSchema);
|
|
65
|
+
}
|
|
66
|
+
else if (schema && includeSchema) {
|
|
67
|
+
responseData = { success: true, _schema: schema };
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
responseData = { success: true };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const executionData = (0, n8n_core_1.constructExecutionMetaData)(wrapData(responseData), {
|
|
74
|
+
itemData: { item: itemIndex },
|
|
75
|
+
});
|
|
76
|
+
return executionData;
|
|
77
|
+
}
|
|
78
|
+
exports.prepareOutput = prepareOutput;
|
|
79
|
+
function checkSchema(schema, record, i) {
|
|
80
|
+
const returnData = { ...record };
|
|
81
|
+
schema.fields.forEach(({ name, mode, type, fields }) => {
|
|
82
|
+
if (mode === 'REQUIRED' && returnData[name] === undefined) {
|
|
83
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The property '${name}' is required, please define it in the 'Fields to Send'`, { itemIndex: i });
|
|
84
|
+
}
|
|
85
|
+
if (type !== 'STRING' && returnData[name] === '') {
|
|
86
|
+
returnData[name] = null;
|
|
87
|
+
}
|
|
88
|
+
if (type === 'JSON') {
|
|
89
|
+
let value = returnData[name];
|
|
90
|
+
if (typeof value === 'object') {
|
|
91
|
+
value = JSON.stringify(value);
|
|
92
|
+
}
|
|
93
|
+
returnData[name] = value;
|
|
94
|
+
}
|
|
95
|
+
if (type === 'RECORD' && typeof returnData[name] !== 'object') {
|
|
96
|
+
let parsedField;
|
|
97
|
+
try {
|
|
98
|
+
parsedField = (0, n8n_workflow_1.jsonParse)(returnData[name]);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
const recordField = fields ? `Field Schema:\n ${JSON.stringify(fields)}` : '';
|
|
102
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The property '${name}' is a RECORD type, but the value is nor an object nor a valid JSON string`, { itemIndex: i, description: recordField });
|
|
103
|
+
}
|
|
104
|
+
returnData[name] = parsedField;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return returnData;
|
|
108
|
+
}
|
|
109
|
+
exports.checkSchema = checkSchema;
|
|
110
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/helpers/utils.ts"],"names":[],"mappings":";;;AACA,uCAAsD;AAEtD,+CAA6D;AAG7D,SAAS,aAAa,CAAC,WAAwB,EAAE,KAAkB;IAClE,IAAI,WAAW,CAAC,IAAI,KAAK,QAAQ,EAAE;QAElC,OAAO,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAiB,CAAC,EAAE,WAAW,CAAC,MAAkC,CAAC,CAAC;KAC3F;SAAM;QACN,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;QACpB,IAAI,WAAW,CAAC,IAAI,KAAK,MAAM,EAAE;YAChC,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UAAU,CAAC;AACnB,CAAC;AA3CD,kCA2CC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.listSearch = exports.loadOptions = void 0;
|
|
27
|
+
exports.loadOptions = __importStar(require("./loadOptions"));
|
|
28
|
+
exports.listSearch = __importStar(require("./listSearch"));
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6C;AAC7C,2DAA2C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';
|
|
2
|
+
export declare function searchProjects(this: ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<INodeListSearchResult>;
|
|
3
|
+
export declare function searchDatasets(this: ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<INodeListSearchResult>;
|
|
4
|
+
export declare function searchTables(this: ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<INodeListSearchResult>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchTables = exports.searchDatasets = exports.searchProjects = void 0;
|
|
4
|
+
const transport_1 = require("../transport");
|
|
5
|
+
async function searchProjects(filter, paginationToken) {
|
|
6
|
+
const qs = {
|
|
7
|
+
pageToken: paginationToken || undefined,
|
|
8
|
+
};
|
|
9
|
+
const response = await transport_1.googleApiRequest.call(this, 'GET', '/v2/projects', undefined, qs);
|
|
10
|
+
let { projects } = response;
|
|
11
|
+
if (filter) {
|
|
12
|
+
projects = projects.filter((project) => project.friendlyName.includes(filter) ||
|
|
13
|
+
project.id.includes(filter));
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
results: projects.map((project) => ({
|
|
17
|
+
name: project.friendlyName,
|
|
18
|
+
value: project.id,
|
|
19
|
+
url: `https://console.cloud.google.com/bigquery?project=${project.id}`,
|
|
20
|
+
})),
|
|
21
|
+
paginationToken: response.nextPageToken,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.searchProjects = searchProjects;
|
|
25
|
+
async function searchDatasets(filter, paginationToken) {
|
|
26
|
+
const projectId = this.getNodeParameter('projectId', undefined, {
|
|
27
|
+
extractValue: true,
|
|
28
|
+
});
|
|
29
|
+
const qs = {
|
|
30
|
+
pageToken: paginationToken || undefined,
|
|
31
|
+
};
|
|
32
|
+
const response = await transport_1.googleApiRequest.call(this, 'GET', `/v2/projects/${projectId}/datasets`, undefined, qs);
|
|
33
|
+
let { datasets } = response;
|
|
34
|
+
if (filter) {
|
|
35
|
+
datasets = datasets.filter((dataset) => dataset.datasetReference.datasetId.includes(filter));
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
results: datasets.map((dataset) => ({
|
|
39
|
+
name: dataset.datasetReference.datasetId,
|
|
40
|
+
value: dataset.datasetReference.datasetId,
|
|
41
|
+
})),
|
|
42
|
+
paginationToken: response.nextPageToken,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.searchDatasets = searchDatasets;
|
|
46
|
+
async function searchTables(filter, paginationToken) {
|
|
47
|
+
const projectId = this.getNodeParameter('projectId', undefined, {
|
|
48
|
+
extractValue: true,
|
|
49
|
+
});
|
|
50
|
+
const datasetId = this.getNodeParameter('datasetId', undefined, {
|
|
51
|
+
extractValue: true,
|
|
52
|
+
});
|
|
53
|
+
const qs = {
|
|
54
|
+
pageToken: paginationToken || undefined,
|
|
55
|
+
};
|
|
56
|
+
const response = await transport_1.googleApiRequest.call(this, 'GET', `/v2/projects/${projectId}/datasets/${datasetId}/tables`, undefined, qs);
|
|
57
|
+
let { tables } = response;
|
|
58
|
+
if (filter) {
|
|
59
|
+
tables = tables.filter((table) => table.tableReference.tableId.includes(filter));
|
|
60
|
+
}
|
|
61
|
+
const returnData = {
|
|
62
|
+
results: tables.map((table) => ({
|
|
63
|
+
name: table.tableReference.tableId,
|
|
64
|
+
value: table.tableReference.tableId,
|
|
65
|
+
})),
|
|
66
|
+
paginationToken: response.nextPageToken,
|
|
67
|
+
};
|
|
68
|
+
return returnData;
|
|
69
|
+
}
|
|
70
|
+
exports.searchTables = searchTables;
|
|
71
|
+
//# sourceMappingURL=listSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listSearch.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery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,CAAC,MAAM,CAAC,CACzD,CAAC;KACF;IAED,MAAM,UAAU,GAAG;QAClB,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAsC,EAAE,EAAE,CAAC,CAAC;YAChE,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC,OAAiB;YAC5C,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO;SACnC,CAAC,CAAC;QACH,eAAe,EAAE,QAAQ,CAAC,aAAa;KACvC,CAAC;IAEF,OAAO,UAAU,CAAC;AACnB,CAAC;AA1CD,oCA0CC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare function getDatasets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
3
|
+
export declare function getSchema(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSchema = exports.getDatasets = void 0;
|
|
4
|
+
const transport_1 = require("../transport");
|
|
5
|
+
async function getDatasets() {
|
|
6
|
+
const projectId = this.getNodeParameter('projectId', undefined, {
|
|
7
|
+
extractValue: true,
|
|
8
|
+
});
|
|
9
|
+
const returnData = [];
|
|
10
|
+
const { datasets } = await transport_1.googleApiRequest.call(this, 'GET', `/v2/projects/${projectId}/datasets`);
|
|
11
|
+
for (const dataset of datasets) {
|
|
12
|
+
returnData.push({
|
|
13
|
+
name: dataset.datasetReference.datasetId,
|
|
14
|
+
value: dataset.datasetReference.datasetId,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return returnData;
|
|
18
|
+
}
|
|
19
|
+
exports.getDatasets = getDatasets;
|
|
20
|
+
async function getSchema() {
|
|
21
|
+
const projectId = this.getNodeParameter('projectId', undefined, {
|
|
22
|
+
extractValue: true,
|
|
23
|
+
});
|
|
24
|
+
const datasetId = this.getNodeParameter('datasetId', undefined, {
|
|
25
|
+
extractValue: true,
|
|
26
|
+
});
|
|
27
|
+
const tableId = this.getNodeParameter('tableId', undefined, {
|
|
28
|
+
extractValue: true,
|
|
29
|
+
});
|
|
30
|
+
const returnData = [];
|
|
31
|
+
const { schema } = await transport_1.googleApiRequest.call(this, 'GET', `/v2/projects/${projectId}/datasets/${datasetId}/tables/${tableId}`, {});
|
|
32
|
+
for (const field of schema.fields) {
|
|
33
|
+
returnData.push({
|
|
34
|
+
name: field.name,
|
|
35
|
+
value: field.name,
|
|
36
|
+
description: `type: ${field.type}` + (field.mode ? ` mode: ${field.mode}` : ''),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return returnData;
|
|
40
|
+
}
|
|
41
|
+
exports.getSchema = getSchema;
|
|
42
|
+
//# sourceMappingURL=loadOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadOptions.js","sourceRoot":"","sources":["../../../../../../nodes/Google/BigQuery/v2/methods/loadOptions.ts"],"names":[],"mappings":";;;AACA,4CAAgD;AAEzC,KAAK,UAAU,WAAW;IAChC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,EAAE;QAC/D,YAAY,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,4BAAgB,CAAC,IAAI,CAC/C,IAAI,EACJ,KAAK,EACL,gBAAgB,SAAS,WAAW,CACpC,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC/B,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,SAAmB;YAClD,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS;SACzC,CAAC,CAAC;KACH;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAjBD,kCAiBC;AAEM,KAAK,UAAU,SAAS;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,EAAE;QAC/D,YAAY,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,EAAE;QAC/D,YAAY,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE;QAC3D,YAAY,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,UAAU,GAA2B,EAAE,CAAC;IAE9C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,4BAAgB,CAAC,IAAI,CAC7C,IAAI,EACJ,KAAK,EACL,gBAAgB,SAAS,aAAa,SAAS,WAAW,OAAO,EAAE,EACnE,EAAE,CACF,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAuB,EAAE;QACnD,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,IAAc;YAC1B,KAAK,EAAE,KAAK,CAAC,IAAc;YAE3B,WAAW,EACV,SAAS,KAAK,CAAC,IAAc,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,IAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvF,CAAC,CAAC;KACH;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AA9BD,8BA8BC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
|
2
|
+
import type { IDataObject } from 'n8n-workflow';
|
|
3
|
+
export declare function googleApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body?: IDataObject, qs?: IDataObject, uri?: string, headers?: IDataObject): Promise<any>;
|
|
4
|
+
export declare function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, endpoint: string, body?: IDataObject, query?: IDataObject): Promise<IDataObject[]>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.googleApiRequestAllItems = exports.googleApiRequest = void 0;
|
|
30
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
31
|
+
const jwt = __importStar(require("jsonwebtoken"));
|
|
32
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
33
|
+
async function getAccessToken(credentials) {
|
|
34
|
+
const privateKey = credentials.privateKey.replace(/\\n/g, '\n').trim();
|
|
35
|
+
const scopes = ['https://www.googleapis.com/auth/bigquery'];
|
|
36
|
+
const now = (0, moment_timezone_1.default)().unix();
|
|
37
|
+
const signature = jwt.sign({
|
|
38
|
+
iss: credentials.email,
|
|
39
|
+
sub: credentials.delegatedEmail || credentials.email,
|
|
40
|
+
scope: scopes.join(' '),
|
|
41
|
+
aud: 'https://oauth2.googleapis.com/token',
|
|
42
|
+
iat: now,
|
|
43
|
+
exp: now + 3600,
|
|
44
|
+
}, privateKey, {
|
|
45
|
+
algorithm: 'RS256',
|
|
46
|
+
header: {
|
|
47
|
+
kid: privateKey,
|
|
48
|
+
typ: 'JWT',
|
|
49
|
+
alg: 'RS256',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const options = {
|
|
53
|
+
headers: {
|
|
54
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
55
|
+
},
|
|
56
|
+
method: 'POST',
|
|
57
|
+
form: {
|
|
58
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
|
59
|
+
assertion: signature,
|
|
60
|
+
},
|
|
61
|
+
uri: 'https://oauth2.googleapis.com/token',
|
|
62
|
+
json: true,
|
|
63
|
+
};
|
|
64
|
+
return this.helpers.request(options);
|
|
65
|
+
}
|
|
66
|
+
async function googleApiRequest(method, resource, body = {}, qs = {}, uri, headers = {}) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
const authenticationMethod = this.getNodeParameter('authentication', 0, 'serviceAccount');
|
|
69
|
+
const options = {
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
},
|
|
73
|
+
method,
|
|
74
|
+
body,
|
|
75
|
+
qs,
|
|
76
|
+
uri: uri || `https://bigquery.googleapis.com/bigquery${resource}`,
|
|
77
|
+
json: true,
|
|
78
|
+
};
|
|
79
|
+
try {
|
|
80
|
+
if (Object.keys(headers).length !== 0) {
|
|
81
|
+
options.headers = Object.assign({}, options.headers, headers);
|
|
82
|
+
}
|
|
83
|
+
if (Object.keys(body).length === 0) {
|
|
84
|
+
delete options.body;
|
|
85
|
+
}
|
|
86
|
+
if (authenticationMethod === 'serviceAccount') {
|
|
87
|
+
const credentials = await this.getCredentials('googleApi');
|
|
88
|
+
if (credentials === undefined) {
|
|
89
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No credentials got returned!');
|
|
90
|
+
}
|
|
91
|
+
const { access_token } = await getAccessToken.call(this, credentials);
|
|
92
|
+
options.headers.Authorization = `Bearer ${access_token}`;
|
|
93
|
+
return await this.helpers.request(options);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return await this.helpers.requestOAuth2.call(this, 'googleBigQueryOAuth2Api', options);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
|
101
|
+
error.statusCode = '401';
|
|
102
|
+
}
|
|
103
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
|
|
104
|
+
message: ((_b = (_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message) || error.message,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.googleApiRequest = googleApiRequest;
|
|
109
|
+
async function googleApiRequestAllItems(propertyName, method, endpoint, body = {}, query = {}) {
|
|
110
|
+
const returnData = [];
|
|
111
|
+
let responseData;
|
|
112
|
+
query.maxResults = 10000;
|
|
113
|
+
do {
|
|
114
|
+
responseData = await googleApiRequest.call(this, method, endpoint, body, query);
|
|
115
|
+
query.pageToken = responseData.pageToken;
|
|
116
|
+
returnData.push.apply(returnData, responseData[propertyName]);
|
|
117
|
+
} while (responseData.pageToken !== undefined && responseData.pageToken !== '');
|
|
118
|
+
return returnData;
|
|
119
|
+
}
|
|
120
|
+
exports.googleApiRequestAllItems = googleApiRequestAllItems;
|
|
121
|
+
//# sourceMappingURL=index.js.map
|