n8n-nodes-base 1.64.1 → 1.66.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/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.d.ts +8 -0
- package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.js +28 -0
- package/dist/credentials/GoogleBusinessProfileOAuth2Api.credentials.js.map +1 -0
- package/dist/known/credentials.json +15 -0
- package/dist/known/nodes.json +12 -0
- package/dist/nodes/Asana/GenericFunctions.js +1 -0
- package/dist/nodes/Asana/GenericFunctions.js.map +1 -1
- package/dist/nodes/Code/JsCodeValidator.js.map +1 -1
- package/dist/nodes/Code/JsTaskRunnerSandbox.js +5 -4
- package/dist/nodes/Code/JsTaskRunnerSandbox.js.map +1 -1
- package/dist/nodes/Code/Sandbox.d.ts +2 -2
- package/dist/nodes/Code/Sandbox.js.map +1 -1
- package/dist/nodes/Code/errors/WrappedExecutionError.js +0 -3
- package/dist/nodes/Code/errors/WrappedExecutionError.js.map +1 -1
- package/dist/nodes/DebugHelper/DebugHelper.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/Form/Form.node.d.ts +18 -0
- package/dist/nodes/Form/Form.node.js +331 -0
- package/dist/nodes/Form/Form.node.js.map +1 -0
- package/dist/nodes/Form/Form.node.json +18 -0
- package/dist/nodes/Form/FormTrigger.node.js +3 -2
- package/dist/nodes/Form/FormTrigger.node.js.map +1 -1
- package/dist/nodes/Form/interfaces.d.ts +1 -15
- package/dist/nodes/Form/interfaces.js.map +1 -1
- package/dist/nodes/Form/utils.d.ts +24 -5
- package/dist/nodes/Form/utils.js +157 -78
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/Form/v1/FormTriggerV1.node.d.ts +3 -1
- package/dist/nodes/Form/v1/FormTriggerV1.node.js +1 -1
- package/dist/nodes/Form/v1/FormTriggerV1.node.js.map +1 -1
- package/dist/nodes/Form/v2/FormTriggerV2.node.d.ts +3 -1
- package/dist/nodes/Form/v2/FormTriggerV2.node.js +33 -7
- package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
- package/dist/nodes/Github/GenericFunctions.d.ts +1 -0
- package/dist/nodes/Github/GenericFunctions.js +11 -0
- package/dist/nodes/Github/GenericFunctions.js.map +1 -1
- package/dist/nodes/Github/Github.node.d.ts +2 -1
- package/dist/nodes/Github/Github.node.js +169 -0
- package/dist/nodes/Github/Github.node.js.map +1 -1
- package/dist/nodes/Github/SearchFunctions.d.ts +1 -0
- package/dist/nodes/Github/SearchFunctions.js +23 -0
- package/dist/nodes/Github/SearchFunctions.js.map +1 -1
- package/dist/nodes/Google/BusinessProfile/GenericFunctions.d.ts +15 -0
- package/dist/nodes/Google/BusinessProfile/GenericFunctions.js +335 -0
- package/dist/nodes/Google/BusinessProfile/GenericFunctions.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.d.ts +13 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.js +79 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfile.node.json +19 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.d.ts +12 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.js +166 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.json +19 -0
- package/dist/nodes/Google/BusinessProfile/Interfaces.d.ts +21 -0
- package/dist/nodes/Google/BusinessProfile/Interfaces.js +3 -0
- package/dist/nodes/Google/BusinessProfile/Interfaces.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/PostDescription.d.ts +3 -0
- package/dist/nodes/Google/BusinessProfile/PostDescription.js +966 -0
- package/dist/nodes/Google/BusinessProfile/PostDescription.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/ReviewDescription.d.ts +3 -0
- package/dist/nodes/Google/BusinessProfile/ReviewDescription.js +552 -0
- package/dist/nodes/Google/BusinessProfile/ReviewDescription.js.map +1 -0
- package/dist/nodes/Google/BusinessProfile/googleBusinessProfile.svg +1 -0
- package/dist/nodes/Google/Sheet/v2/actions/sheet/append.operation.js +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/append.operation.js.map +1 -1
- package/dist/nodes/InvoiceNinja/InvoiceNinja.node.js.map +1 -1
- package/dist/nodes/Kafka/Kafka.node.js.map +1 -1
- package/dist/nodes/Lemlist/GenericFunctions.js +1 -1
- package/dist/nodes/Lemlist/GenericFunctions.js.map +1 -1
- package/dist/nodes/Lemlist/v2/descriptions/EnrichmentDescription.js +2 -2
- package/dist/nodes/Lemlist/v2/descriptions/LeadDescription.js +1 -1
- package/dist/nodes/Lemlist/v2/descriptions/TeamDescription.js +1 -1
- package/dist/nodes/Lemlist/v2/descriptions/TeamDescription.js.map +1 -1
- package/dist/nodes/Microsoft/Sql/GenericFunctions.d.ts +2 -1
- package/dist/nodes/Microsoft/Sql/GenericFunctions.js +30 -1
- package/dist/nodes/Microsoft/Sql/GenericFunctions.js.map +1 -1
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js +3 -9
- package/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
- package/dist/nodes/Postgres/v2/transport/index.js +5 -1
- package/dist/nodes/Postgres/v2/transport/index.js.map +1 -1
- package/dist/nodes/Set/v2/helpers/utils.d.ts +3 -3
- package/dist/nodes/Set/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/Set/v2/manual.mode.d.ts +2 -2
- package/dist/nodes/Set/v2/manual.mode.js.map +1 -1
- package/dist/nodes/Ssh/Ssh.node.js +36 -38
- package/dist/nodes/Ssh/Ssh.node.js.map +1 -1
- package/dist/nodes/Transform/RemoveDuplicates/v1/RemoveDuplicatesV1.node.js.map +1 -1
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +10 -7
- package/package.json +12 -8
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleDatesPresend = handleDatesPresend;
|
|
4
|
+
exports.addUpdateMaskPresend = addUpdateMaskPresend;
|
|
5
|
+
exports.handlePagination = handlePagination;
|
|
6
|
+
exports.handleErrorsDeletePost = handleErrorsDeletePost;
|
|
7
|
+
exports.handleErrorsGetPost = handleErrorsGetPost;
|
|
8
|
+
exports.handleErrorsUpdatePost = handleErrorsUpdatePost;
|
|
9
|
+
exports.handleErrorsDeleteReply = handleErrorsDeleteReply;
|
|
10
|
+
exports.handleErrorsGetReview = handleErrorsGetReview;
|
|
11
|
+
exports.handleErrorsReplyToReview = handleErrorsReplyToReview;
|
|
12
|
+
exports.googleApiRequest = googleApiRequest;
|
|
13
|
+
exports.searchAccounts = searchAccounts;
|
|
14
|
+
exports.searchLocations = searchLocations;
|
|
15
|
+
exports.searchReviews = searchReviews;
|
|
16
|
+
exports.searchPosts = searchPosts;
|
|
17
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
|
+
const addOptName = 'additionalOptions';
|
|
19
|
+
const possibleRootProperties = ['localPosts', 'reviews'];
|
|
20
|
+
const getAllParams = (execFns) => {
|
|
21
|
+
const params = execFns.getNode().parameters;
|
|
22
|
+
const additionalOptions = execFns.getNodeParameter(addOptName, {});
|
|
23
|
+
return { ...params, ...additionalOptions };
|
|
24
|
+
};
|
|
25
|
+
async function handleDatesPresend(opts) {
|
|
26
|
+
const params = getAllParams(this);
|
|
27
|
+
const body = Object.assign({}, opts.body);
|
|
28
|
+
const event = body.event ?? {};
|
|
29
|
+
if (!params.startDateTime && !params.startDate && !params.endDateTime && !params.endDate) {
|
|
30
|
+
return opts;
|
|
31
|
+
}
|
|
32
|
+
const createDateTimeObject = (dateString) => {
|
|
33
|
+
const date = new Date(dateString);
|
|
34
|
+
return {
|
|
35
|
+
date: {
|
|
36
|
+
year: date.getUTCFullYear(),
|
|
37
|
+
month: date.getUTCMonth() + 1,
|
|
38
|
+
day: date.getUTCDate(),
|
|
39
|
+
},
|
|
40
|
+
time: dateString.includes('T')
|
|
41
|
+
? {
|
|
42
|
+
hours: date.getUTCHours(),
|
|
43
|
+
minutes: date.getUTCMinutes(),
|
|
44
|
+
seconds: date.getUTCSeconds(),
|
|
45
|
+
nanos: 0,
|
|
46
|
+
}
|
|
47
|
+
: undefined,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const startDateTime = params.startDateTime || params.startDate
|
|
51
|
+
? createDateTimeObject((params.startDateTime || params.startDate))
|
|
52
|
+
: null;
|
|
53
|
+
const endDateTime = params.endDateTime || params.endDate
|
|
54
|
+
? createDateTimeObject((params.endDateTime || params.endDate))
|
|
55
|
+
: null;
|
|
56
|
+
const schedule = {
|
|
57
|
+
startDate: startDateTime?.date,
|
|
58
|
+
endDate: endDateTime?.date,
|
|
59
|
+
startTime: startDateTime?.time,
|
|
60
|
+
endTime: endDateTime?.time,
|
|
61
|
+
};
|
|
62
|
+
event.schedule = schedule;
|
|
63
|
+
Object.assign(body, { event });
|
|
64
|
+
opts.body = body;
|
|
65
|
+
return opts;
|
|
66
|
+
}
|
|
67
|
+
async function addUpdateMaskPresend(opts) {
|
|
68
|
+
const additionalOptions = this.getNodeParameter('additionalOptions');
|
|
69
|
+
const propertyMapping = {
|
|
70
|
+
postType: 'topicType',
|
|
71
|
+
actionType: 'actionType',
|
|
72
|
+
callToActionType: 'callToAction.actionType',
|
|
73
|
+
url: 'callToAction.url',
|
|
74
|
+
startDateTime: 'event.schedule.startDate,event.schedule.startTime',
|
|
75
|
+
endDateTime: 'event.schedule.endDate,event.schedule.endTime',
|
|
76
|
+
title: 'event.title',
|
|
77
|
+
startDate: 'event.schedule.startDate',
|
|
78
|
+
endDate: 'event.schedule.endDate',
|
|
79
|
+
couponCode: 'offer.couponCode',
|
|
80
|
+
redeemOnlineUrl: 'offer.redeemOnlineUrl',
|
|
81
|
+
termsAndConditions: 'offer.termsAndConditions',
|
|
82
|
+
};
|
|
83
|
+
if (Object.keys(additionalOptions).length) {
|
|
84
|
+
const updateMask = Object.keys(additionalOptions)
|
|
85
|
+
.map((key) => propertyMapping[key] || key)
|
|
86
|
+
.join(',');
|
|
87
|
+
opts.qs = {
|
|
88
|
+
...opts.qs,
|
|
89
|
+
updateMask,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return opts;
|
|
93
|
+
}
|
|
94
|
+
async function handlePagination(resultOptions) {
|
|
95
|
+
const aggregatedResult = [];
|
|
96
|
+
let nextPageToken;
|
|
97
|
+
const returnAll = this.getNodeParameter('returnAll');
|
|
98
|
+
let limit = 100;
|
|
99
|
+
if (!returnAll) {
|
|
100
|
+
limit = this.getNodeParameter('limit');
|
|
101
|
+
resultOptions.maxResults = limit;
|
|
102
|
+
}
|
|
103
|
+
resultOptions.paginate = true;
|
|
104
|
+
do {
|
|
105
|
+
if (nextPageToken) {
|
|
106
|
+
resultOptions.options.qs = { ...resultOptions.options.qs, pageToken: nextPageToken };
|
|
107
|
+
}
|
|
108
|
+
const responseData = await this.makeRoutingRequest(resultOptions);
|
|
109
|
+
for (const page of responseData) {
|
|
110
|
+
for (const prop of possibleRootProperties) {
|
|
111
|
+
if (page.json[prop]) {
|
|
112
|
+
const currentData = page.json[prop];
|
|
113
|
+
aggregatedResult.push(...currentData);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (!returnAll && aggregatedResult.length >= limit) {
|
|
117
|
+
return aggregatedResult.slice(0, limit).map((item) => ({ json: item }));
|
|
118
|
+
}
|
|
119
|
+
nextPageToken = page.json.nextPageToken;
|
|
120
|
+
}
|
|
121
|
+
} while (nextPageToken);
|
|
122
|
+
return aggregatedResult.map((item) => ({ json: item }));
|
|
123
|
+
}
|
|
124
|
+
async function handleErrorsDeletePost(data, response) {
|
|
125
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
126
|
+
const post = this.getNodeParameter('post', undefined);
|
|
127
|
+
if (post && response.statusCode === 404) {
|
|
128
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The post you are deleting could not be found. Adjust the "post" parameter setting to delete the post correctly.');
|
|
129
|
+
}
|
|
130
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
131
|
+
message: response.statusMessage,
|
|
132
|
+
httpCode: response.statusCode.toString(),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return data;
|
|
136
|
+
}
|
|
137
|
+
async function handleErrorsGetPost(data, response) {
|
|
138
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
139
|
+
const post = this.getNodeParameter('post', undefined);
|
|
140
|
+
if (post && response.statusCode === 404) {
|
|
141
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The post you are requesting could not be found. Adjust the "post" parameter setting to retrieve the post correctly.');
|
|
142
|
+
}
|
|
143
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
144
|
+
message: response.statusMessage,
|
|
145
|
+
httpCode: response.statusCode.toString(),
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return data;
|
|
149
|
+
}
|
|
150
|
+
async function handleErrorsUpdatePost(data, response) {
|
|
151
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
152
|
+
const post = this.getNodeParameter('post');
|
|
153
|
+
const additionalOptions = this.getNodeParameter('additionalOptions');
|
|
154
|
+
if (post && response.statusCode === 404) {
|
|
155
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The post you are updating could not be found. Adjust the "post" parameter setting to update the post correctly.');
|
|
156
|
+
}
|
|
157
|
+
if (response.statusCode === 400 && Object.keys(additionalOptions).length === 0) {
|
|
158
|
+
return [{ json: { success: true } }];
|
|
159
|
+
}
|
|
160
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
161
|
+
message: response.statusMessage,
|
|
162
|
+
httpCode: response.statusCode.toString(),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return data;
|
|
166
|
+
}
|
|
167
|
+
async function handleErrorsDeleteReply(data, response) {
|
|
168
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
169
|
+
const review = this.getNodeParameter('review', undefined);
|
|
170
|
+
if (review && response.statusCode === 404) {
|
|
171
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The review you are deleting could not be found. Adjust the "review" parameter setting to update the review correctly.');
|
|
172
|
+
}
|
|
173
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
174
|
+
message: response.statusMessage,
|
|
175
|
+
httpCode: response.statusCode.toString(),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return data;
|
|
179
|
+
}
|
|
180
|
+
async function handleErrorsGetReview(data, response) {
|
|
181
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
182
|
+
const review = this.getNodeParameter('review', undefined);
|
|
183
|
+
if (review && response.statusCode === 404) {
|
|
184
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The review you are requesting could not be found. Adjust the "review" parameter setting to update the review correctly.');
|
|
185
|
+
}
|
|
186
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
187
|
+
message: response.statusMessage,
|
|
188
|
+
httpCode: response.statusCode.toString(),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return data;
|
|
192
|
+
}
|
|
193
|
+
async function handleErrorsReplyToReview(data, response) {
|
|
194
|
+
if (response.statusCode < 200 || response.statusCode >= 300) {
|
|
195
|
+
const review = this.getNodeParameter('review', undefined);
|
|
196
|
+
if (review && response.statusCode === 404) {
|
|
197
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The review you are replying to could not be found. Adjust the "review" parameter setting to reply to the review correctly.');
|
|
198
|
+
}
|
|
199
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response.body, {
|
|
200
|
+
message: response.statusMessage,
|
|
201
|
+
httpCode: response.statusCode.toString(),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return data;
|
|
205
|
+
}
|
|
206
|
+
async function googleApiRequest(method, resource, body = {}, qs = {}, url) {
|
|
207
|
+
const options = {
|
|
208
|
+
headers: {
|
|
209
|
+
'Content-Type': 'application/json',
|
|
210
|
+
},
|
|
211
|
+
method,
|
|
212
|
+
body,
|
|
213
|
+
qs,
|
|
214
|
+
url: url ?? `https://mybusiness.googleapis.com/v4${resource}`,
|
|
215
|
+
json: true,
|
|
216
|
+
};
|
|
217
|
+
try {
|
|
218
|
+
if (Object.keys(body).length === 0) {
|
|
219
|
+
delete options.body;
|
|
220
|
+
}
|
|
221
|
+
return (await this.helpers.httpRequestWithAuthentication.call(this, 'googleBusinessProfileOAuth2Api', options));
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async function searchAccounts(filter, paginationToken) {
|
|
228
|
+
const query = {};
|
|
229
|
+
if (paginationToken) {
|
|
230
|
+
query.pageToken = paginationToken;
|
|
231
|
+
}
|
|
232
|
+
const responseData = await googleApiRequest.call(this, 'GET', '', {}, {
|
|
233
|
+
pageSize: 20,
|
|
234
|
+
...query,
|
|
235
|
+
}, 'https://mybusinessaccountmanagement.googleapis.com/v1/accounts');
|
|
236
|
+
const accounts = responseData.accounts;
|
|
237
|
+
const results = accounts
|
|
238
|
+
.map((a) => ({
|
|
239
|
+
name: a.accountName,
|
|
240
|
+
value: a.name,
|
|
241
|
+
}))
|
|
242
|
+
.filter((a) => !filter ||
|
|
243
|
+
a.name.toLowerCase().includes(filter.toLowerCase()) ||
|
|
244
|
+
a.value.toLowerCase().includes(filter.toLowerCase()))
|
|
245
|
+
.sort((a, b) => {
|
|
246
|
+
if (a.name.toLowerCase() < b.name.toLowerCase())
|
|
247
|
+
return -1;
|
|
248
|
+
if (a.name.toLowerCase() > b.name.toLowerCase())
|
|
249
|
+
return 1;
|
|
250
|
+
return 0;
|
|
251
|
+
});
|
|
252
|
+
return { results, paginationToken: responseData.nextPageToken };
|
|
253
|
+
}
|
|
254
|
+
async function searchLocations(filter, paginationToken) {
|
|
255
|
+
const query = {};
|
|
256
|
+
if (paginationToken) {
|
|
257
|
+
query.pageToken = paginationToken;
|
|
258
|
+
}
|
|
259
|
+
const account = this.getNodeParameter('account').value;
|
|
260
|
+
const responseData = await googleApiRequest.call(this, 'GET', '', {}, {
|
|
261
|
+
readMask: 'name',
|
|
262
|
+
pageSize: 100,
|
|
263
|
+
...query,
|
|
264
|
+
}, `https://mybusinessbusinessinformation.googleapis.com/v1/${account}/locations`);
|
|
265
|
+
const locations = responseData.locations;
|
|
266
|
+
const results = locations
|
|
267
|
+
.map((a) => ({
|
|
268
|
+
name: a.name,
|
|
269
|
+
value: a.name,
|
|
270
|
+
}))
|
|
271
|
+
.filter((a) => !filter || a.name.toLowerCase().includes(filter.toLowerCase()))
|
|
272
|
+
.sort((a, b) => {
|
|
273
|
+
if (a.name.toLowerCase() < b.name.toLowerCase())
|
|
274
|
+
return -1;
|
|
275
|
+
if (a.name.toLowerCase() > b.name.toLowerCase())
|
|
276
|
+
return 1;
|
|
277
|
+
return 0;
|
|
278
|
+
});
|
|
279
|
+
return { results, paginationToken: responseData.nextPageToken };
|
|
280
|
+
}
|
|
281
|
+
async function searchReviews(filter, paginationToken) {
|
|
282
|
+
const query = {};
|
|
283
|
+
if (paginationToken) {
|
|
284
|
+
query.pageToken = paginationToken;
|
|
285
|
+
}
|
|
286
|
+
const account = this.getNodeParameter('account').value;
|
|
287
|
+
const location = this.getNodeParameter('location').value;
|
|
288
|
+
const responseData = await googleApiRequest.call(this, 'GET', `/${account}/${location}/reviews`, {}, {
|
|
289
|
+
pageSize: 50,
|
|
290
|
+
...query,
|
|
291
|
+
});
|
|
292
|
+
const reviews = responseData.reviews;
|
|
293
|
+
const results = reviews
|
|
294
|
+
.map((a) => ({
|
|
295
|
+
name: a.comment,
|
|
296
|
+
value: a.name,
|
|
297
|
+
}))
|
|
298
|
+
.filter((a) => !filter || a.name.toLowerCase().includes(filter.toLowerCase()))
|
|
299
|
+
.sort((a, b) => {
|
|
300
|
+
if (a.name.toLowerCase() < b.name.toLowerCase())
|
|
301
|
+
return -1;
|
|
302
|
+
if (a.name.toLowerCase() > b.name.toLowerCase())
|
|
303
|
+
return 1;
|
|
304
|
+
return 0;
|
|
305
|
+
});
|
|
306
|
+
return { results, paginationToken: responseData.nextPageToken };
|
|
307
|
+
}
|
|
308
|
+
async function searchPosts(filter, paginationToken) {
|
|
309
|
+
const query = {};
|
|
310
|
+
if (paginationToken) {
|
|
311
|
+
query.pageToken = paginationToken;
|
|
312
|
+
}
|
|
313
|
+
const account = this.getNodeParameter('account').value;
|
|
314
|
+
const location = this.getNodeParameter('location').value;
|
|
315
|
+
const responseData = await googleApiRequest.call(this, 'GET', `/${account}/${location}/localPosts`, {}, {
|
|
316
|
+
pageSize: 100,
|
|
317
|
+
...query,
|
|
318
|
+
});
|
|
319
|
+
const localPosts = responseData.localPosts;
|
|
320
|
+
const results = localPosts
|
|
321
|
+
.map((a) => ({
|
|
322
|
+
name: a.summary,
|
|
323
|
+
value: a.name,
|
|
324
|
+
}))
|
|
325
|
+
.filter((a) => !filter || a.name.toLowerCase().includes(filter.toLowerCase()))
|
|
326
|
+
.sort((a, b) => {
|
|
327
|
+
if (a.name.toLowerCase() < b.name.toLowerCase())
|
|
328
|
+
return -1;
|
|
329
|
+
if (a.name.toLowerCase() > b.name.toLowerCase())
|
|
330
|
+
return 1;
|
|
331
|
+
return 0;
|
|
332
|
+
});
|
|
333
|
+
return { results, paginationToken: responseData.nextPageToken };
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../../nodes/Google/BusinessProfile/GenericFunctions.ts"],"names":[],"mappings":";;AAgCA,gDAoDC;AAGD,oDA+BC;AAGD,4CAsCC;AAID,wDAsBC;AAED,kDAsBC;AAED,wDA4BC;AAED,0DAsBC;AAED,sDAsBC;AAED,8DAsBC;AAGD,4CA+BC;AAID,wCA4CC;AAED,0CA0CC;AAED,sCAuCC;AAED,kCAuCC;AAvgBD,+CAgBsB;AAItB,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAEzD,MAAM,YAAY,GAAG,CAAC,OAAgC,EAA2B,EAAE;IAClF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC;IAC5C,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAA4B,CAAC;IAG9F,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAC;AAC5C,CAAC,CAAC;AAGK,KAAK,UAAU,kBAAkB,CAEvC,IAAyB;IAEzB,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAgB,CAAC;IACzD,MAAM,KAAK,GAAI,IAAI,CAAC,KAAqB,IAAK,EAAkB,CAAC;IAEjE,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC1F,OAAO,IAAI,CAAC;IACb,CAAC;I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AAC;QAC1D,OAAO,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { searchAccounts, searchLocations, searchPosts, searchReviews } from './GenericFunctions';
|
|
3
|
+
export declare class GoogleBusinessProfile implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: {
|
|
7
|
+
searchAccounts: typeof searchAccounts;
|
|
8
|
+
searchLocations: typeof searchLocations;
|
|
9
|
+
searchReviews: typeof searchReviews;
|
|
10
|
+
searchPosts: typeof searchPosts;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleBusinessProfile = void 0;
|
|
4
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
5
|
+
const PostDescription_1 = require("./PostDescription");
|
|
6
|
+
const ReviewDescription_1 = require("./ReviewDescription");
|
|
7
|
+
class GoogleBusinessProfile {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.description = {
|
|
10
|
+
displayName: 'Google Business Profile',
|
|
11
|
+
name: 'googleBusinessProfile',
|
|
12
|
+
icon: 'file:googleBusinessProfile.svg',
|
|
13
|
+
group: ['input'],
|
|
14
|
+
version: 1,
|
|
15
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
16
|
+
description: 'Consume Google Business Profile API',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Google Business Profile',
|
|
19
|
+
},
|
|
20
|
+
inputs: ["main"],
|
|
21
|
+
outputs: ["main"],
|
|
22
|
+
hints: [
|
|
23
|
+
{
|
|
24
|
+
message: 'Please select a parameter in the options to modify the post',
|
|
25
|
+
displayCondition: '={{$parameter["resource"] === "post" && $parameter["operation"] === "update" && Object.keys($parameter["additionalOptions"]).length === 0}}',
|
|
26
|
+
whenToDisplay: 'always',
|
|
27
|
+
location: 'outputPane',
|
|
28
|
+
type: 'warning',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
credentials: [
|
|
32
|
+
{
|
|
33
|
+
name: 'googleBusinessProfileOAuth2Api',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
requestDefaults: {
|
|
38
|
+
baseURL: 'https://mybusiness.googleapis.com/v4',
|
|
39
|
+
headers: {
|
|
40
|
+
Accept: 'application/json',
|
|
41
|
+
'Content-Type': 'application/json',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
properties: [
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Resource',
|
|
47
|
+
name: 'resource',
|
|
48
|
+
type: 'options',
|
|
49
|
+
noDataExpression: true,
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
name: 'Post',
|
|
53
|
+
value: 'post',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Review',
|
|
57
|
+
value: 'review',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
default: 'post',
|
|
61
|
+
},
|
|
62
|
+
...PostDescription_1.postOperations,
|
|
63
|
+
...PostDescription_1.postFields,
|
|
64
|
+
...ReviewDescription_1.reviewOperations,
|
|
65
|
+
...ReviewDescription_1.reviewFields,
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
this.methods = {
|
|
69
|
+
listSearch: {
|
|
70
|
+
searchAccounts: GenericFunctions_1.searchAccounts,
|
|
71
|
+
searchLocations: GenericFunctions_1.searchLocations,
|
|
72
|
+
searchReviews: GenericFunctions_1.searchReviews,
|
|
73
|
+
searchPosts: GenericFunctions_1.searchPosts,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.GoogleBusinessProfile = GoogleBusinessProfile;
|
|
79
|
+
//# sourceMappingURL=GoogleBusinessProfile.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleBusinessProfile.node.js","sourceRoot":"","sources":["../../../../nodes/Google/BusinessProfile/GoogleBusinessProfile.node.ts"],"names":[],"mappings":";;;AAEA,yDAAiG;AACjG,uDAA+D;AAC/D,2DAAqE;AAErE,MAAa,qBAAqB;IAAlC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE,gCAAgC;YACtC,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE;gBACT,IAAI,EAAE,yBAAyB;aAC/B;YACD,MAAM,EAAE,QAAyB;YACjC,OAAO,EAAE,QAAyB;YAClC,KAAK,EAAE;gBACN;oBACC,OAAO,EAAE,6DAA6D;oBACtE,gBAAgB,EACf,6IAA6I;oBAC9I,aAAa,EAAE,QAAQ;oBACvB,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,SAAS;iBACf;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,gCAAgC;oBACtC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,sCAAsC;gBAC/C,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;yBACb;wBACD;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;yBACf;qBACD;oBACD,OAAO,EAAE,MAAM;iBACf;gBACD,GAAG,gCAAc;gBACjB,GAAG,4BAAU;gBACb,GAAG,oCAAgB;gBACnB,GAAG,gCAAY;aACf;SACD,CAAC;QAEF,YAAO,GAAG;YACT,UAAU,EAAE;gBACX,cAAc,EAAd,iCAAc;gBACd,eAAe,EAAf,kCAAe;gBACf,aAAa,EAAb,gCAAa;gBACb,WAAW,EAAX,8BAAW;aACX;SACD,CAAC;IACH,CAAC;CAAA;AAtED,sDAsEC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.googleBusinessProfile",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Marketing", "Productivity"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlebusinessprofile/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"alias": ["Google My Business", "GMB", "My Business"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IPollFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { searchAccounts, searchLocations } from './GenericFunctions';
|
|
3
|
+
export declare class GoogleBusinessProfileTrigger implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch: {
|
|
7
|
+
searchAccounts: typeof searchAccounts;
|
|
8
|
+
searchLocations: typeof searchLocations;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleBusinessProfileTrigger = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
class GoogleBusinessProfileTrigger {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Google Business Profile Trigger',
|
|
10
|
+
name: 'googleBusinessProfileTrigger',
|
|
11
|
+
icon: 'file:googleBusinessProfile.svg',
|
|
12
|
+
group: ['trigger'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Fetches reviews from Google Business Profile and starts the workflow on specified polling intervals.',
|
|
15
|
+
subtitle: '={{"Google Business Profile Trigger"}}',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'Google Business Profile Trigger',
|
|
18
|
+
},
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'googleBusinessProfileOAuth2Api',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
polling: true,
|
|
26
|
+
inputs: [],
|
|
27
|
+
outputs: ["main"],
|
|
28
|
+
properties: [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Event',
|
|
31
|
+
name: 'event',
|
|
32
|
+
required: true,
|
|
33
|
+
type: 'options',
|
|
34
|
+
noDataExpression: true,
|
|
35
|
+
default: 'reviewAdded',
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Review Added',
|
|
39
|
+
value: 'reviewAdded',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Account',
|
|
45
|
+
name: 'account',
|
|
46
|
+
required: true,
|
|
47
|
+
type: 'resourceLocator',
|
|
48
|
+
default: { mode: 'list', value: '' },
|
|
49
|
+
description: 'The Google Business Profile account',
|
|
50
|
+
displayOptions: { show: { event: ['reviewAdded'] } },
|
|
51
|
+
modes: [
|
|
52
|
+
{
|
|
53
|
+
displayName: 'From list',
|
|
54
|
+
name: 'list',
|
|
55
|
+
type: 'list',
|
|
56
|
+
typeOptions: {
|
|
57
|
+
searchListMethod: 'searchAccounts',
|
|
58
|
+
searchable: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'By name',
|
|
63
|
+
name: 'name',
|
|
64
|
+
type: 'string',
|
|
65
|
+
hint: 'Enter the account name',
|
|
66
|
+
validation: [
|
|
67
|
+
{
|
|
68
|
+
type: 'regex',
|
|
69
|
+
properties: {
|
|
70
|
+
regex: 'accounts/[0-9]+',
|
|
71
|
+
errorMessage: 'The name must start with "accounts/"',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
placeholder: 'e.g. accounts/0123456789',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Location',
|
|
81
|
+
name: 'location',
|
|
82
|
+
required: true,
|
|
83
|
+
type: 'resourceLocator',
|
|
84
|
+
default: { mode: 'list', value: '' },
|
|
85
|
+
description: 'The specific location or business associated with the account',
|
|
86
|
+
displayOptions: { show: { event: ['reviewAdded'] } },
|
|
87
|
+
modes: [
|
|
88
|
+
{
|
|
89
|
+
displayName: 'From list',
|
|
90
|
+
name: 'list',
|
|
91
|
+
type: 'list',
|
|
92
|
+
typeOptions: {
|
|
93
|
+
searchListMethod: 'searchLocations',
|
|
94
|
+
searchable: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'By name',
|
|
99
|
+
name: 'name',
|
|
100
|
+
type: 'string',
|
|
101
|
+
hint: 'Enter the location name',
|
|
102
|
+
validation: [
|
|
103
|
+
{
|
|
104
|
+
type: 'regex',
|
|
105
|
+
properties: {
|
|
106
|
+
regex: 'locations/[0-9]+',
|
|
107
|
+
errorMessage: 'The name must start with "locations/"',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
placeholder: 'e.g. locations/0123456789',
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
this.methods = {
|
|
118
|
+
listSearch: {
|
|
119
|
+
searchAccounts: GenericFunctions_1.searchAccounts,
|
|
120
|
+
searchLocations: GenericFunctions_1.searchLocations,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async poll() {
|
|
125
|
+
const nodeStaticData = this.getWorkflowStaticData('node');
|
|
126
|
+
let responseData;
|
|
127
|
+
const qs = {};
|
|
128
|
+
const account = this.getNodeParameter('account').value;
|
|
129
|
+
const location = this.getNodeParameter('location').value;
|
|
130
|
+
const manualMode = this.getMode() === 'manual';
|
|
131
|
+
if (manualMode) {
|
|
132
|
+
qs.pageSize = 1;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
qs.pageSize = 50;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
responseData = (await GenericFunctions_1.googleApiRequest.call(this, 'GET', `/${account}/${location}/reviews`, {}, qs));
|
|
139
|
+
if (manualMode) {
|
|
140
|
+
responseData = responseData.reviews;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
if (!nodeStaticData.totalReviewCountLastTimeChecked) {
|
|
144
|
+
nodeStaticData.totalReviewCountLastTimeChecked = responseData.totalReviewCount;
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
if (!responseData?.reviews?.length ||
|
|
148
|
+
nodeStaticData?.totalReviewCountLastTimeChecked === responseData?.totalReviewCount) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const numNewReviews = responseData.totalReviewCount - nodeStaticData.totalReviewCountLastTimeChecked;
|
|
152
|
+
nodeStaticData.totalReviewCountLastTimeChecked = responseData.totalReviewCount;
|
|
153
|
+
responseData = responseData.reviews.slice(0, numNewReviews);
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(responseData) && responseData.length) {
|
|
156
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
157
|
+
}
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.GoogleBusinessProfileTrigger = GoogleBusinessProfileTrigger;
|
|
166
|
+
//# sourceMappingURL=GoogleBusinessProfileTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleBusinessProfileTrigger.node.js","sourceRoot":"","sources":["../../../../nodes/Google/BusinessProfile/GoogleBusinessProfileTrigger.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,yDAAuF;AAEvF,MAAa,4BAA4B;IAAzC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,8BAA8B;YACpC,IAAI,EAAE,gCAAgC;YACtC,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,WAAW,EACV,sGAAsG;YACvG,QAAQ,EAAE,wCAAwC;YAClD,QAAQ,EAAE;gBACT,IAAI,EAAE,iCAAiC;aACvC;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,gCAAgC;oBACtC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,QAAyB;YAClC,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,OAAO;oBACb,QAAQ,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