n8n-nodes-base 0.209.1 → 0.209.2
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/dist/credentials/GoogleSheetsTriggerOAuth2Api.credentials.d.ts +8 -0
- package/dist/credentials/GoogleSheetsTriggerOAuth2Api.credentials.js +27 -0
- package/dist/credentials/GoogleSheetsTriggerOAuth2Api.credentials.js.map +1 -0
- package/dist/known/credentials.json +7 -0
- package/dist/known/nodes.json +4 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.d.ts +16 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +540 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.json +20 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.utils.d.ts +8 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.utils.js +160 -0
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.utils.js.map +1 -0
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.d.ts +3 -3
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/methods/listSearch.js +1 -1
- package/dist/nodes/Google/Sheet/v2/methods/listSearch.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/transport/index.d.ts +3 -3
- package/dist/nodes/Google/Sheet/v2/transport/index.js +5 -1
- package/dist/nodes/Google/Sheet/v2/transport/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +2 -1
- package/package.json +3 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class GoogleSheetsTriggerOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
extends: string[];
|
|
5
|
+
displayName: string;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleSheetsTriggerOAuth2Api = void 0;
|
|
4
|
+
const scopes = [
|
|
5
|
+
'https://www.googleapis.com/auth/drive',
|
|
6
|
+
'https://www.googleapis.com/auth/drive.file',
|
|
7
|
+
'https://www.googleapis.com/auth/spreadsheets',
|
|
8
|
+
'https://www.googleapis.com/auth/drive.metadata',
|
|
9
|
+
];
|
|
10
|
+
class GoogleSheetsTriggerOAuth2Api {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'googleSheetsTriggerOAuth2Api';
|
|
13
|
+
this.extends = ['googleOAuth2Api'];
|
|
14
|
+
this.displayName = 'Google Sheets Trigger OAuth2 API';
|
|
15
|
+
this.documentationUrl = 'google/oauth-single-service';
|
|
16
|
+
this.properties = [
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Scope',
|
|
19
|
+
name: 'scope',
|
|
20
|
+
type: 'hidden',
|
|
21
|
+
default: scopes.join(' '),
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.GoogleSheetsTriggerOAuth2Api = GoogleSheetsTriggerOAuth2Api;
|
|
27
|
+
//# sourceMappingURL=GoogleSheetsTriggerOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleSheetsTriggerOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/GoogleSheetsTriggerOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAG;IACd,uCAAuC;IACvC,4CAA4C;IAC5C,8CAA8C;IAC9C,gDAAgD;CAChD,CAAC;AAEF,MAAa,4BAA4B;IAAzC;QACC,SAAI,GAAG,8BAA8B,CAAC;QAEtC,YAAO,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE9B,gBAAW,GAAG,kCAAkC,CAAC;QAEjD,qBAAgB,GAAG,6BAA6B,CAAC;QAEjD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;aACzB;SACD,CAAC;IACH,CAAC;CAAA;AAjBD,oEAiBC"}
|
|
@@ -762,6 +762,13 @@
|
|
|
762
762
|
"googleSheets"
|
|
763
763
|
]
|
|
764
764
|
},
|
|
765
|
+
"googleSheetsTriggerOAuth2Api": {
|
|
766
|
+
"className": "GoogleSheetsTriggerOAuth2Api",
|
|
767
|
+
"sourcePath": "dist/credentials/GoogleSheetsTriggerOAuth2Api.credentials.js",
|
|
768
|
+
"nodesToTestWith": [
|
|
769
|
+
"googleSheetsTrigger"
|
|
770
|
+
]
|
|
771
|
+
},
|
|
765
772
|
"googleSlidesOAuth2Api": {
|
|
766
773
|
"className": "GoogleSlidesOAuth2Api",
|
|
767
774
|
"sourcePath": "dist/credentials/GoogleSlidesOAuth2Api.credentials.js",
|
package/dist/known/nodes.json
CHANGED
|
@@ -1451,6 +1451,10 @@
|
|
|
1451
1451
|
"className": "GoogleSheets",
|
|
1452
1452
|
"sourcePath": "dist/nodes/Google/Sheet/GoogleSheets.node.js"
|
|
1453
1453
|
},
|
|
1454
|
+
"googleSheetsTrigger": {
|
|
1455
|
+
"className": "GoogleSheetsTrigger",
|
|
1456
|
+
"sourcePath": "dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js"
|
|
1457
|
+
},
|
|
1454
1458
|
"googleSlides": {
|
|
1455
1459
|
"className": "GoogleSlides",
|
|
1456
1460
|
"sourcePath": "dist/nodes/Google/Slides/GoogleSlides.node.js"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { INodeExecutionData, INodeType, INodeTypeDescription, IPollFunctions } from 'n8n-workflow';
|
|
2
|
+
import { sheetsSearch, spreadSheetsSearch } from './v2/methods/listSearch';
|
|
3
|
+
import { getSheetHeaderRowAndSkipEmpty } from './v2/methods/loadOptions';
|
|
4
|
+
export declare class GoogleSheetsTrigger implements INodeType {
|
|
5
|
+
description: INodeTypeDescription;
|
|
6
|
+
methods: {
|
|
7
|
+
listSearch: {
|
|
8
|
+
spreadSheetsSearch: typeof spreadSheetsSearch;
|
|
9
|
+
sheetsSearch: typeof sheetsSearch;
|
|
10
|
+
};
|
|
11
|
+
loadOptions: {
|
|
12
|
+
getSheetHeaderRowAndSkipEmpty: typeof getSheetHeaderRowAndSkipEmpty;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleSheetsTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("./v2/transport");
|
|
6
|
+
const listSearch_1 = require("./v2/methods/listSearch");
|
|
7
|
+
const GoogleSheet_1 = require("./v2/helpers/GoogleSheet");
|
|
8
|
+
const loadOptions_1 = require("./v2/methods/loadOptions");
|
|
9
|
+
const GoogleSheetsTrigger_utils_1 = require("./GoogleSheetsTrigger.utils");
|
|
10
|
+
class GoogleSheetsTrigger {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.description = {
|
|
13
|
+
displayName: 'Google Sheets Trigger',
|
|
14
|
+
name: 'googleSheetsTrigger',
|
|
15
|
+
icon: 'file:googleSheets.svg',
|
|
16
|
+
group: ['trigger'],
|
|
17
|
+
version: 1,
|
|
18
|
+
subtitle: '={{($parameter["event"])}}',
|
|
19
|
+
description: 'Starts the workflow when Google Sheets events occur',
|
|
20
|
+
defaults: {
|
|
21
|
+
name: 'Google Sheets Trigger',
|
|
22
|
+
},
|
|
23
|
+
inputs: [],
|
|
24
|
+
outputs: ['main'],
|
|
25
|
+
credentials: [
|
|
26
|
+
{
|
|
27
|
+
name: 'googleSheetsTriggerOAuth2Api',
|
|
28
|
+
required: true,
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: {
|
|
31
|
+
authentication: ['triggerOAuth2'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
polling: true,
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Authentication',
|
|
40
|
+
name: 'authentication',
|
|
41
|
+
type: 'hidden',
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: 'OAuth2 (recommended)',
|
|
45
|
+
value: 'triggerOAuth2',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
default: 'triggerOAuth2',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Document',
|
|
52
|
+
name: 'documentId',
|
|
53
|
+
type: 'resourceLocator',
|
|
54
|
+
default: { mode: 'list', value: '' },
|
|
55
|
+
required: true,
|
|
56
|
+
modes: [
|
|
57
|
+
{
|
|
58
|
+
displayName: 'From List',
|
|
59
|
+
name: 'list',
|
|
60
|
+
type: 'list',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
searchListMethod: 'spreadSheetsSearch',
|
|
63
|
+
searchable: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'By URL',
|
|
68
|
+
name: 'url',
|
|
69
|
+
type: 'string',
|
|
70
|
+
extractValue: {
|
|
71
|
+
type: 'regex',
|
|
72
|
+
regex: 'https:\\/\\/(?:drive|docs)\\.google\\.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
|
|
73
|
+
},
|
|
74
|
+
validation: [
|
|
75
|
+
{
|
|
76
|
+
type: 'regex',
|
|
77
|
+
properties: {
|
|
78
|
+
regex: 'https:\\/\\/(?:drive|docs)\\.google.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
|
|
79
|
+
errorMessage: 'Not a valid Google Drive File URL',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'By ID',
|
|
86
|
+
name: 'id',
|
|
87
|
+
type: 'string',
|
|
88
|
+
validation: [
|
|
89
|
+
{
|
|
90
|
+
type: 'regex',
|
|
91
|
+
properties: {
|
|
92
|
+
regex: '[a-zA-Z0-9\\-_]{2,}',
|
|
93
|
+
errorMessage: 'Not a valid Google Drive File ID',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
url: '=https://docs.google.com/spreadsheets/d/{{$value}}/edit',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Sheet',
|
|
103
|
+
name: 'sheetName',
|
|
104
|
+
type: 'resourceLocator',
|
|
105
|
+
default: { mode: 'list', value: '' },
|
|
106
|
+
required: true,
|
|
107
|
+
modes: [
|
|
108
|
+
{
|
|
109
|
+
displayName: 'From List',
|
|
110
|
+
name: 'list',
|
|
111
|
+
type: 'list',
|
|
112
|
+
typeOptions: {
|
|
113
|
+
searchListMethod: 'sheetsSearch',
|
|
114
|
+
searchable: false,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'By URL',
|
|
119
|
+
name: 'url',
|
|
120
|
+
type: 'string',
|
|
121
|
+
extractValue: {
|
|
122
|
+
type: 'regex',
|
|
123
|
+
regex: 'https:\\/\\/docs\\.google\\.com/spreadsheets\\/d\\/[0-9a-zA-Z\\-_]+\\/edit\\#gid=([0-9]+)',
|
|
124
|
+
},
|
|
125
|
+
validation: [
|
|
126
|
+
{
|
|
127
|
+
type: 'regex',
|
|
128
|
+
properties: {
|
|
129
|
+
regex: 'https:\\/\\/docs\\.google\\.com/spreadsheets\\/d\\/[0-9a-zA-Z\\-_]+\\/edit\\#gid=([0-9]+)',
|
|
130
|
+
errorMessage: 'Not a valid Sheet URL',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
displayName: 'By ID',
|
|
137
|
+
name: 'id',
|
|
138
|
+
type: 'string',
|
|
139
|
+
validation: [
|
|
140
|
+
{
|
|
141
|
+
type: 'regex',
|
|
142
|
+
properties: {
|
|
143
|
+
regex: '((gid=)?[0-9]{1,})',
|
|
144
|
+
errorMessage: 'Not a valid Sheet ID',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Trigger On',
|
|
153
|
+
name: 'event',
|
|
154
|
+
type: 'options',
|
|
155
|
+
description: "It will be triggered also by newly created columns (if the 'Columns to Watch' option is not set)",
|
|
156
|
+
options: [
|
|
157
|
+
{
|
|
158
|
+
name: 'Row Added',
|
|
159
|
+
value: 'rowAdded',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'Row Updated',
|
|
163
|
+
value: 'rowUpdate',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'Row Added or Updated',
|
|
167
|
+
value: 'anyUpdate',
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
default: 'anyUpdate',
|
|
171
|
+
required: true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Include in Output',
|
|
175
|
+
name: 'includeInOutput',
|
|
176
|
+
type: 'options',
|
|
177
|
+
default: 'new',
|
|
178
|
+
description: 'This option will be effective only when automatically executing the workflow',
|
|
179
|
+
options: [
|
|
180
|
+
{
|
|
181
|
+
name: 'New Version',
|
|
182
|
+
value: 'new',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'Old Version',
|
|
186
|
+
value: 'old',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'Both Versions',
|
|
190
|
+
value: 'both',
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
displayOptions: {
|
|
194
|
+
hide: {
|
|
195
|
+
event: ['rowAdded'],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'Options',
|
|
201
|
+
name: 'options',
|
|
202
|
+
type: 'collection',
|
|
203
|
+
placeholder: 'Add Option',
|
|
204
|
+
default: {},
|
|
205
|
+
options: [
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Columns to Watch',
|
|
208
|
+
name: 'columnsToWatch',
|
|
209
|
+
type: 'multiOptions',
|
|
210
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
211
|
+
typeOptions: {
|
|
212
|
+
loadOptionsDependsOn: ['sheetName.value'],
|
|
213
|
+
loadOptionsMethod: 'getSheetHeaderRowAndSkipEmpty',
|
|
214
|
+
},
|
|
215
|
+
default: [],
|
|
216
|
+
displayOptions: {
|
|
217
|
+
show: {
|
|
218
|
+
'/event': ['anyUpdate', 'rowUpdate'],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Data Location on Sheet',
|
|
224
|
+
name: 'dataLocationOnSheet',
|
|
225
|
+
type: 'fixedCollection',
|
|
226
|
+
placeholder: 'Select Range',
|
|
227
|
+
default: { values: { rangeDefinition: 'specifyRangeA1' } },
|
|
228
|
+
options: [
|
|
229
|
+
{
|
|
230
|
+
displayName: 'Values',
|
|
231
|
+
name: 'values',
|
|
232
|
+
values: [
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Range Definition',
|
|
235
|
+
name: 'rangeDefinition',
|
|
236
|
+
type: 'options',
|
|
237
|
+
options: [
|
|
238
|
+
{
|
|
239
|
+
name: 'Specify Range (A1 Notation)',
|
|
240
|
+
value: 'specifyRangeA1',
|
|
241
|
+
description: 'Manually specify the data range',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Specify Range (Rows)',
|
|
245
|
+
value: 'specifyRange',
|
|
246
|
+
description: 'Manually specify the data range',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
default: '',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Header Row',
|
|
253
|
+
name: 'headerRow',
|
|
254
|
+
type: 'number',
|
|
255
|
+
typeOptions: {
|
|
256
|
+
minValue: 1,
|
|
257
|
+
},
|
|
258
|
+
default: 1,
|
|
259
|
+
description: 'Index of the row which contains the keys. Starts at 1. The incoming node data is matched to the keys for assignment. The matching is case sensitive.',
|
|
260
|
+
hint: 'First row is row 1',
|
|
261
|
+
displayOptions: {
|
|
262
|
+
show: {
|
|
263
|
+
rangeDefinition: ['specifyRange'],
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
displayName: 'First Data Row',
|
|
269
|
+
name: 'firstDataRow',
|
|
270
|
+
type: 'number',
|
|
271
|
+
typeOptions: {
|
|
272
|
+
minValue: 1,
|
|
273
|
+
},
|
|
274
|
+
default: 2,
|
|
275
|
+
description: 'Index of the first row which contains the actual data and not the keys. Starts with 1.',
|
|
276
|
+
hint: 'First row is row 1',
|
|
277
|
+
displayOptions: {
|
|
278
|
+
show: {
|
|
279
|
+
rangeDefinition: ['specifyRange'],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
displayName: 'Range',
|
|
285
|
+
name: 'range',
|
|
286
|
+
type: 'string',
|
|
287
|
+
default: '',
|
|
288
|
+
placeholder: 'A:Z',
|
|
289
|
+
description: 'The table range to read from or to append data to. See the Google <a href="https://developers.google.com/sheets/api/guides/values#writing">documentation</a> for the details.',
|
|
290
|
+
hint: 'You can specify both the rows and the columns, e.g. C4:E7',
|
|
291
|
+
displayOptions: {
|
|
292
|
+
show: {
|
|
293
|
+
rangeDefinition: ['specifyRangeA1'],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
displayName: 'Value Render',
|
|
303
|
+
name: 'valueRender',
|
|
304
|
+
type: 'options',
|
|
305
|
+
options: [
|
|
306
|
+
{
|
|
307
|
+
name: 'Unformatted',
|
|
308
|
+
value: 'UNFORMATTED_VALUE',
|
|
309
|
+
description: 'Values will be calculated, but not formatted in the reply',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: 'Formatted',
|
|
313
|
+
value: 'FORMATTED_VALUE',
|
|
314
|
+
description: "Values will be formatted and calculated according to the cell's formatting (based on the spreadsheet's locale)",
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'Formula',
|
|
318
|
+
value: 'FORMULA',
|
|
319
|
+
description: 'Values will not be calculated. The reply will include the formulas.',
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
default: 'UNFORMATTED_VALUE',
|
|
323
|
+
description: 'Determines how values will be rendered in the output. <a href="https://developers.google.com/sheets/api/reference/rest/v4/ValueRenderOption" target="_blank">More info</a>.',
|
|
324
|
+
displayOptions: {
|
|
325
|
+
hide: {
|
|
326
|
+
'/event': ['anyUpdate', 'rowUpdate'],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
displayName: 'DateTime Render',
|
|
332
|
+
name: 'dateTimeRenderOption',
|
|
333
|
+
type: 'options',
|
|
334
|
+
options: [
|
|
335
|
+
{
|
|
336
|
+
name: 'Serial Number',
|
|
337
|
+
value: 'SERIAL_NUMBER',
|
|
338
|
+
description: 'Fields will be returned as doubles in "serial number" format (as popularized by Lotus 1-2-3)',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'Formatted String',
|
|
342
|
+
value: 'FORMATTED_STRING',
|
|
343
|
+
description: 'Fields will be rendered as strings in their given number format (which depends on the spreadsheet locale)',
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
default: 'SERIAL_NUMBER',
|
|
347
|
+
description: 'Determines how dates should be rendered in the output. <a href="https://developers.google.com/sheets/api/reference/rest/v4/DateTimeRenderOption" target="_blank">More info</a>.',
|
|
348
|
+
displayOptions: {
|
|
349
|
+
hide: {
|
|
350
|
+
'/event': ['anyUpdate', 'rowUpdate'],
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
};
|
|
358
|
+
this.methods = {
|
|
359
|
+
listSearch: { spreadSheetsSearch: listSearch_1.spreadSheetsSearch, sheetsSearch: listSearch_1.sheetsSearch },
|
|
360
|
+
loadOptions: { getSheetHeaderRowAndSkipEmpty: loadOptions_1.getSheetHeaderRowAndSkipEmpty },
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
async poll() {
|
|
364
|
+
var _a, _b, _c, _d, _e, _f;
|
|
365
|
+
try {
|
|
366
|
+
const workflowStaticData = this.getWorkflowStaticData('node');
|
|
367
|
+
const event = this.getNodeParameter('event', 0);
|
|
368
|
+
const documentId = this.getNodeParameter('documentId', undefined, {
|
|
369
|
+
extractValue: true,
|
|
370
|
+
});
|
|
371
|
+
let sheetId = this.getNodeParameter('sheetName', undefined, {
|
|
372
|
+
extractValue: true,
|
|
373
|
+
});
|
|
374
|
+
sheetId = sheetId === 'gid=0' ? '0' : sheetId;
|
|
375
|
+
if (this.getMode() !== 'manual' &&
|
|
376
|
+
(workflowStaticData.documentId !== documentId || workflowStaticData.sheetId !== sheetId)) {
|
|
377
|
+
workflowStaticData.documentId = documentId;
|
|
378
|
+
workflowStaticData.sheetId = sheetId;
|
|
379
|
+
workflowStaticData.lastRevision = undefined;
|
|
380
|
+
workflowStaticData.lastRevisionLink = undefined;
|
|
381
|
+
workflowStaticData.lastIndexChecked = undefined;
|
|
382
|
+
}
|
|
383
|
+
const googleSheet = new GoogleSheet_1.GoogleSheet(documentId, this);
|
|
384
|
+
const sheetName = await googleSheet.spreadsheetGetSheetNameById(sheetId);
|
|
385
|
+
const options = this.getNodeParameter('options');
|
|
386
|
+
const previousRevision = workflowStaticData.lastRevision;
|
|
387
|
+
const previousRevisionLink = workflowStaticData.lastRevisionLink;
|
|
388
|
+
if (event !== 'rowAdded') {
|
|
389
|
+
let pageToken;
|
|
390
|
+
do {
|
|
391
|
+
const { revisions, nextPageToken } = await transport_1.apiRequest.call(this, 'GET', '', undefined, {
|
|
392
|
+
fields: 'revisions(id, exportLinks), nextPageToken',
|
|
393
|
+
pageToken,
|
|
394
|
+
pageSize: 1000,
|
|
395
|
+
}, `https://www.googleapis.com/drive/v3/files/${documentId}/revisions`);
|
|
396
|
+
if (nextPageToken) {
|
|
397
|
+
pageToken = nextPageToken;
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
pageToken = undefined;
|
|
401
|
+
const lastRevision = +revisions[revisions.length - 1].id;
|
|
402
|
+
if (lastRevision <= previousRevision) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
if (this.getMode() !== 'manual') {
|
|
407
|
+
workflowStaticData.lastRevision = lastRevision;
|
|
408
|
+
workflowStaticData.lastRevisionLink =
|
|
409
|
+
revisions[revisions.length - 1].exportLinks[GoogleSheetsTrigger_utils_1.BINARY_MIME_TYPE];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} while (pageToken);
|
|
414
|
+
}
|
|
415
|
+
let range = 'A:ZZZ';
|
|
416
|
+
let keyRow = 1;
|
|
417
|
+
let startIndex = 2;
|
|
418
|
+
let rangeDefinition = '';
|
|
419
|
+
const [from, to] = range.split(':');
|
|
420
|
+
let keyRange = `${from}${keyRow}:${to}${keyRow}`;
|
|
421
|
+
let rangeToCheck = `${from}${startIndex}:${to}`;
|
|
422
|
+
if (options.dataLocationOnSheet) {
|
|
423
|
+
const locationDefine = options.dataLocationOnSheet.values;
|
|
424
|
+
rangeDefinition = locationDefine.rangeDefinition;
|
|
425
|
+
if (rangeDefinition === 'specifyRangeA1') {
|
|
426
|
+
if (locationDefine.range === '') {
|
|
427
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "The field 'Range' is empty, please provide a range");
|
|
428
|
+
}
|
|
429
|
+
range = locationDefine.range;
|
|
430
|
+
}
|
|
431
|
+
if (rangeDefinition === 'specifyRange') {
|
|
432
|
+
keyRow = parseInt(locationDefine.headerRow, 10);
|
|
433
|
+
startIndex = parseInt(locationDefine.firstDataRow, 10);
|
|
434
|
+
}
|
|
435
|
+
const [rangeFrom, rangeTo] = range.split(':');
|
|
436
|
+
const cellDataFrom = (_a = rangeFrom.match(/([a-zA-Z]{1,10})([0-9]{0,10})/)) !== null && _a !== void 0 ? _a : [];
|
|
437
|
+
const cellDataTo = (_b = rangeTo.match(/([a-zA-Z]{1,10})([0-9]{0,10})/)) !== null && _b !== void 0 ? _b : [];
|
|
438
|
+
if (rangeDefinition === 'specifyRangeA1' && cellDataFrom[2] !== undefined) {
|
|
439
|
+
keyRange = `${cellDataFrom[1]}${+cellDataFrom[2]}:${cellDataTo[1]}${+cellDataFrom[2]}`;
|
|
440
|
+
rangeToCheck = `${cellDataFrom[1]}${+cellDataFrom[2] + 1}:${rangeTo}`;
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
keyRange = `${cellDataFrom[1]}${keyRow}:${cellDataTo[1]}${keyRow}`;
|
|
444
|
+
rangeToCheck = `${cellDataFrom[1]}${startIndex}:${rangeTo}`;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
const qs = {};
|
|
448
|
+
Object.assign(qs, options);
|
|
449
|
+
if (event === 'rowAdded') {
|
|
450
|
+
const [columns] = (await transport_1.apiRequest.call(this, 'GET', `/v4/spreadsheets/${documentId}/values/${sheetName}!${keyRange}`)).values || [[]];
|
|
451
|
+
if (!(columns === null || columns === void 0 ? void 0 : columns.length)) {
|
|
452
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Could not retrieve the columns from key row');
|
|
453
|
+
}
|
|
454
|
+
const sheetData = await googleSheet.getData(`${sheetName}!${rangeToCheck}`, options.valueRender || 'UNFORMATTED_VALUE', options.dateTimeRenderOption || 'FORMATTED_STRING');
|
|
455
|
+
if (this.getMode() === 'manual') {
|
|
456
|
+
if (Array.isArray(sheetData)) {
|
|
457
|
+
const returnData = (0, GoogleSheetsTrigger_utils_1.arrayOfArraysToJson)(sheetData, columns);
|
|
458
|
+
if (Array.isArray(returnData) && returnData.length !== 0) {
|
|
459
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (Array.isArray(sheetData) && this.getMode() !== 'manual') {
|
|
464
|
+
if (workflowStaticData.lastIndexChecked === undefined) {
|
|
465
|
+
workflowStaticData.lastIndexChecked = sheetData.length;
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
const addedRows = (_c = sheetData === null || sheetData === void 0 ? void 0 : sheetData.slice(workflowStaticData.lastIndexChecked)) !== null && _c !== void 0 ? _c : [];
|
|
469
|
+
const returnData = (0, GoogleSheetsTrigger_utils_1.arrayOfArraysToJson)(addedRows, columns);
|
|
470
|
+
workflowStaticData.lastIndexChecked = sheetData.length;
|
|
471
|
+
if (Array.isArray(returnData) && returnData.length !== 0) {
|
|
472
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (event === 'anyUpdate' || event === 'rowUpdate') {
|
|
477
|
+
const sheetRange = `${sheetName}!${range}`;
|
|
478
|
+
let dataStartIndex = startIndex - 1;
|
|
479
|
+
if (rangeDefinition !== 'specifyRangeA1') {
|
|
480
|
+
dataStartIndex = keyRow < startIndex ? startIndex - 2 : startIndex - 1;
|
|
481
|
+
}
|
|
482
|
+
const currentData = (await googleSheet.getData(sheetRange, 'UNFORMATTED_VALUE', 'SERIAL_NUMBER')) || [];
|
|
483
|
+
if (previousRevision === undefined) {
|
|
484
|
+
if (currentData.length === 0) {
|
|
485
|
+
return [[]];
|
|
486
|
+
}
|
|
487
|
+
const zeroBasedKeyRow = keyRow - 1;
|
|
488
|
+
const columns = currentData[zeroBasedKeyRow];
|
|
489
|
+
currentData.splice(zeroBasedKeyRow, 1);
|
|
490
|
+
let returnData;
|
|
491
|
+
if (rangeDefinition !== 'specifyRangeA1') {
|
|
492
|
+
returnData = (0, GoogleSheetsTrigger_utils_1.arrayOfArraysToJson)(currentData.slice(dataStartIndex), columns);
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
returnData = (0, GoogleSheetsTrigger_utils_1.arrayOfArraysToJson)(currentData, columns);
|
|
496
|
+
}
|
|
497
|
+
if (Array.isArray(returnData) && returnData.length !== 0 && this.getMode() === 'manual') {
|
|
498
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
const previousRevisionBinaryData = await GoogleSheetsTrigger_utils_1.getRevisionFile.call(this, previousRevisionLink);
|
|
505
|
+
const previousRevisionSheetData = (0, GoogleSheetsTrigger_utils_1.sheetBinaryToArrayOfArrays)(previousRevisionBinaryData, sheetName, rangeDefinition === 'specifyRangeA1' ? range : undefined) || [];
|
|
506
|
+
const includeInOutput = this.getNodeParameter('includeInOutput', 'new');
|
|
507
|
+
let returnData;
|
|
508
|
+
if (options.columnsToWatch) {
|
|
509
|
+
returnData = (0, GoogleSheetsTrigger_utils_1.compareRevisions)(previousRevisionSheetData, currentData, keyRow, includeInOutput, options.columnsToWatch, dataStartIndex, event);
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
returnData = (0, GoogleSheetsTrigger_utils_1.compareRevisions)(previousRevisionSheetData, currentData, keyRow, includeInOutput, [], dataStartIndex, event);
|
|
513
|
+
}
|
|
514
|
+
if (Array.isArray(returnData) && returnData.length !== 0) {
|
|
515
|
+
return [this.helpers.returnJsonArray(returnData)];
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
catch (error) {
|
|
520
|
+
if ((_d = error === null || error === void 0 ? void 0 : error.description) === null || _d === void 0 ? void 0 : _d.toLowerCase().includes('user does not have sufficient permissions for file')) {
|
|
521
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Edit access to the document is required for the 'Row Update' and 'Row Added or Updated' triggers. Request edit access to the document's owner or select the 'Row Added' trigger in the 'Trigger On' dropdown.");
|
|
522
|
+
}
|
|
523
|
+
if (((_f = (_e = error === null || error === void 0 ? void 0 : error.error) === null || _e === void 0 ? void 0 : _e.error) === null || _f === void 0 ? void 0 : _f.message) !== undefined &&
|
|
524
|
+
!error.error.error.message.toLocaleLowerCase().includes('unknown error') &&
|
|
525
|
+
!error.error.error.message.toLocaleLowerCase().includes('bad request')) {
|
|
526
|
+
let [message, ...description] = error.error.error.message.split('. ');
|
|
527
|
+
if (message.toLowerCase() === 'access not configured') {
|
|
528
|
+
message = 'Missing Google Drive API';
|
|
529
|
+
}
|
|
530
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), message, {
|
|
531
|
+
description: description.join('.\n '),
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
throw error;
|
|
535
|
+
}
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
exports.GoogleSheetsTrigger = GoogleSheetsTrigger;
|
|
540
|
+
//# sourceMappingURL=GoogleSheetsTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleSheetsTrigger.node.js","sourceRoot":"","sources":["../../../../nodes/Google/Sheet/GoogleSheetsTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,8CAA4C;AAC5C,wDAA2E;AAC3E,0DAAuD;AACvD,0DAAyE;AAGzE,2EAMqC;AAErC,MAAa,mBAAmB;IAAhC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,4BAA4B;YACtC,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE;gBACT,IAAI,EAAE,uBAAuB;aAC7B;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,8BAA8B;oBACpC,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,eAAe,CAAC;yBACjC;qBACD;iBACD;aACD;YACD,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBAEX;oBACC,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE;wBACR;4BAEC,IAAI,EAAE,sBAAsB;4BAC5B,KAAK,EAAE,eAAe;yBACtB;qBACD;oBACD,OAAO,EAAE,eAAe;iBACxB;gBACD;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;oBACpC,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE;wBACN;4BACC,WAAW,EAAE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