n8n-nodes-cleanedweb 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +158 -2
- package/dist/credentials/CleanedWebApi.credentials.d.ts +13 -0
- package/dist/credentials/CleanedWebApi.credentials.js +51 -0
- package/dist/credentials/CleanedWebApi.credentials.js.map +1 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.d.ts +11 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.js +175 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.js.map +1 -0
- package/dist/nodes/CleanedWeb/CleanedWeb.node.json +19 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.d.ts +121 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.js +511 -0
- package/dist/nodes/CleanedWeb/GenericFunctions.js.map +1 -0
- package/dist/nodes/CleanedWeb/Operations.d.ts +9 -0
- package/dist/nodes/CleanedWeb/Operations.js +140 -0
- package/dist/nodes/CleanedWeb/Operations.js.map +1 -0
- package/dist/nodes/CleanedWeb/cleanedweb.dark.svg +11 -0
- package/dist/nodes/CleanedWeb/cleanedweb.svg +11 -0
- package/dist/nodes/CleanedWeb/constants.d.ts +14 -0
- package/dist/nodes/CleanedWeb/constants.js +18 -0
- package/dist/nodes/CleanedWeb/constants.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.d.ts +4 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.js +129 -0
- package/dist/nodes/CleanedWeb/descriptions/CatalogDescription.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.d.ts +3 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.js +44 -0
- package/dist/nodes/CleanedWeb/descriptions/PrivateApiDescription.js.map +1 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.d.ts +4 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.js +258 -0
- package/dist/nodes/CleanedWeb/descriptions/RunDescription.js.map +1 -0
- package/dist/package.json +66 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +65 -5
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultDeps = exports.ResultNotAcceptedError = exports.RunStillRunningError = exports.BrokerError = exports.CleanedWebUsageError = void 0;
|
|
4
|
+
exports.settle = settle;
|
|
5
|
+
exports.isRecord = isRecord;
|
|
6
|
+
exports.normalizeOrigin = normalizeOrigin;
|
|
7
|
+
exports.validateIdempotencyKey = validateIdempotencyKey;
|
|
8
|
+
exports.parseInput = parseInput;
|
|
9
|
+
exports.parseFields = parseFields;
|
|
10
|
+
exports.buildRunBody = buildRunBody;
|
|
11
|
+
exports.parseRetryAfter = parseRetryAfter;
|
|
12
|
+
exports.extractRunId = extractRunId;
|
|
13
|
+
exports.assertAccepted = assertAccepted;
|
|
14
|
+
exports.brokerRequest = brokerRequest;
|
|
15
|
+
exports.catalogGet = catalogGet;
|
|
16
|
+
exports.listCatalogApis = listCatalogApis;
|
|
17
|
+
exports.getCatalogApi = getCatalogApi;
|
|
18
|
+
exports.getCatalogContract = getCatalogContract;
|
|
19
|
+
exports.executeRun = executeRun;
|
|
20
|
+
exports.fetchRunItems = fetchRunItems;
|
|
21
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
22
|
+
const constants_1 = require("./constants");
|
|
23
|
+
class CleanedWebUsageError extends Error {
|
|
24
|
+
constructor(message, description) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.description = description;
|
|
27
|
+
this.name = 'CleanedWebUsageError';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CleanedWebUsageError = CleanedWebUsageError;
|
|
31
|
+
class BrokerError extends Error {
|
|
32
|
+
constructor(init) {
|
|
33
|
+
super(init.message);
|
|
34
|
+
this.name = 'BrokerError';
|
|
35
|
+
this.statusCode = init.statusCode;
|
|
36
|
+
this.description = init.description;
|
|
37
|
+
this.code = init.code;
|
|
38
|
+
this.errorCode = init.errorCode;
|
|
39
|
+
this.runId = init.runId;
|
|
40
|
+
this.unsure = init.unsure;
|
|
41
|
+
this.retryAfterSeconds = init.retryAfterSeconds;
|
|
42
|
+
this.body = init.body;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.BrokerError = BrokerError;
|
|
46
|
+
class RunStillRunningError extends Error {
|
|
47
|
+
constructor(runId, waitedSeconds) {
|
|
48
|
+
super(`The run was still going after waiting ${waitedSeconds} seconds` +
|
|
49
|
+
(runId ? ` (run ${runId})` : ''));
|
|
50
|
+
this.runId = runId;
|
|
51
|
+
this.waitedSeconds = waitedSeconds;
|
|
52
|
+
this.name = 'RunStillRunningError';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.RunStillRunningError = RunStillRunningError;
|
|
56
|
+
class ResultNotAcceptedError extends Error {
|
|
57
|
+
constructor(message, runId, body) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.runId = runId;
|
|
60
|
+
this.body = body;
|
|
61
|
+
this.name = 'ResultNotAcceptedError';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.ResultNotAcceptedError = ResultNotAcceptedError;
|
|
65
|
+
exports.defaultDeps = {
|
|
66
|
+
async sleep(ctx, ms) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
await (0, n8n_workflow_1.sleep)(ms);
|
|
69
|
+
if ((_b = (_a = ctx.getExecutionCancelSignal) === null || _a === void 0 ? void 0 : _a.call(ctx)) === null || _b === void 0 ? void 0 : _b.aborted) {
|
|
70
|
+
throw new CleanedWebUsageError('The execution was cancelled while waiting for the run');
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
now: () => Date.now(),
|
|
74
|
+
};
|
|
75
|
+
async function settle(promise) {
|
|
76
|
+
return await promise.then((value) => ({ ok: true, value }), (error) => ({ ok: false, error }));
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
80
|
+
}
|
|
81
|
+
function normalizeOrigin(raw) {
|
|
82
|
+
const text = typeof raw === 'string' ? raw.trim() : '';
|
|
83
|
+
if (!text)
|
|
84
|
+
return constants_1.DEFAULT_RUN_ORIGIN;
|
|
85
|
+
const url = URL.canParse(text) ? new URL(text) : undefined;
|
|
86
|
+
if (!url) {
|
|
87
|
+
throw new CleanedWebUsageError('The run origin in the credential is not a valid URL', 'Use https://api.cleanedweb.com, or the origin your workspace supplies.');
|
|
88
|
+
}
|
|
89
|
+
const local = ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname);
|
|
90
|
+
if (url.protocol !== 'https:' && !(url.protocol === 'http:' && local)) {
|
|
91
|
+
throw new CleanedWebUsageError('The run origin must use https', 'The API key is sent to this origin; plain http is only accepted for localhost.');
|
|
92
|
+
}
|
|
93
|
+
if ((url.pathname !== '/' && url.pathname !== '') || url.search || url.hash) {
|
|
94
|
+
throw new CleanedWebUsageError('The run origin must not include a path', 'Use only the origin, for example https://api.cleanedweb.com.');
|
|
95
|
+
}
|
|
96
|
+
return url.origin;
|
|
97
|
+
}
|
|
98
|
+
function validateIdempotencyKey(value) {
|
|
99
|
+
const key = typeof value === 'string' ? value.trim() : '';
|
|
100
|
+
if (!constants_1.IDEMPOTENCY_KEY_PATTERN.test(key)) {
|
|
101
|
+
throw new CleanedWebUsageError('The Idempotency Key is not valid', 'Use 1-200 characters: letters, numbers, ".", "_", ":" and "-". Use one key per intended run and reuse it only to recover that same run.');
|
|
102
|
+
}
|
|
103
|
+
return key;
|
|
104
|
+
}
|
|
105
|
+
const INVALID_JSON = Symbol('invalid json');
|
|
106
|
+
function safeJsonParse(text) {
|
|
107
|
+
try {
|
|
108
|
+
return JSON.parse(text);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return INVALID_JSON;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function parseInput(value) {
|
|
115
|
+
if (value === undefined || value === null || value === '')
|
|
116
|
+
return {};
|
|
117
|
+
if (isRecord(value))
|
|
118
|
+
return value;
|
|
119
|
+
if (typeof value === 'string') {
|
|
120
|
+
const text = value.trim();
|
|
121
|
+
if (text === '')
|
|
122
|
+
return {};
|
|
123
|
+
const parsed = safeJsonParse(text);
|
|
124
|
+
if (parsed === INVALID_JSON)
|
|
125
|
+
throw new CleanedWebUsageError('Input is not valid JSON');
|
|
126
|
+
if (isRecord(parsed))
|
|
127
|
+
return parsed;
|
|
128
|
+
}
|
|
129
|
+
throw new CleanedWebUsageError('Input must be a JSON object', 'Use the inputs listed by the API contract, for example {"sort": "desc_stars"}. An empty object {} is valid when the contract requires no inputs.');
|
|
130
|
+
}
|
|
131
|
+
function parseFields(value) {
|
|
132
|
+
if (Array.isArray(value))
|
|
133
|
+
value = value.join(',');
|
|
134
|
+
if (typeof value !== 'string')
|
|
135
|
+
return undefined;
|
|
136
|
+
const names = value
|
|
137
|
+
.split(',')
|
|
138
|
+
.map((name) => name.trim())
|
|
139
|
+
.filter((name) => name !== '');
|
|
140
|
+
if (names.length === 0)
|
|
141
|
+
return undefined;
|
|
142
|
+
return [...new Set(names)];
|
|
143
|
+
}
|
|
144
|
+
function integerInRange(name, value, min, max) {
|
|
145
|
+
const n = typeof value === 'number' ? value : Number(value);
|
|
146
|
+
if (!Number.isInteger(n) || n < min || n > max) {
|
|
147
|
+
throw new CleanedWebUsageError(`${name} must be a whole number from ${min} to ${max}`);
|
|
148
|
+
}
|
|
149
|
+
return n;
|
|
150
|
+
}
|
|
151
|
+
function buildRunBody(init) {
|
|
152
|
+
var _a, _b;
|
|
153
|
+
const body = { input: init.input };
|
|
154
|
+
if (init.maxItems !== undefined) {
|
|
155
|
+
body.max_items = integerInRange('Limit', init.maxItems, 1, Number.MAX_SAFE_INTEGER);
|
|
156
|
+
}
|
|
157
|
+
if (init.timeoutSeconds !== undefined) {
|
|
158
|
+
body.timeout_seconds = integerInRange('Run Timeout (Seconds)', init.timeoutSeconds, constants_1.MIN_TIMEOUT_SECONDS, constants_1.MAX_RUN_SECONDS);
|
|
159
|
+
}
|
|
160
|
+
if (init.waitSeconds !== undefined) {
|
|
161
|
+
body.wait_seconds = integerInRange('Wait Seconds', init.waitSeconds, 0, constants_1.MAX_RUN_SECONDS);
|
|
162
|
+
}
|
|
163
|
+
if (init.fields && init.fields.length > 0)
|
|
164
|
+
body.fields = init.fields;
|
|
165
|
+
if (init.nulls === true)
|
|
166
|
+
body.nulls = true;
|
|
167
|
+
if (init.version !== undefined) {
|
|
168
|
+
body.version = integerInRange('Version', init.version, 1, Number.MAX_SAFE_INTEGER);
|
|
169
|
+
}
|
|
170
|
+
const expected = (_a = init.expectedVersion) === null || _a === void 0 ? void 0 : _a.trim();
|
|
171
|
+
const definition = (_b = init.definitionVersion) === null || _b === void 0 ? void 0 : _b.trim();
|
|
172
|
+
if (expected && definition) {
|
|
173
|
+
throw new CleanedWebUsageError('Use either Expected Version or Definition Version, not both', 'Expected Version requires the active definition to match; Definition Version selects an accepted revision explicitly.');
|
|
174
|
+
}
|
|
175
|
+
if (expected)
|
|
176
|
+
body.expected_version = expected;
|
|
177
|
+
if (definition)
|
|
178
|
+
body.definition_version = definition;
|
|
179
|
+
return body;
|
|
180
|
+
}
|
|
181
|
+
function headerValue(headers, name) {
|
|
182
|
+
if (!headers)
|
|
183
|
+
return undefined;
|
|
184
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
185
|
+
if (key.toLowerCase() === name.toLowerCase()) {
|
|
186
|
+
return Array.isArray(value) ? value[0] : value;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
function parseRetryAfter(headers, now = Date.now()) {
|
|
192
|
+
var _a;
|
|
193
|
+
const raw = (_a = headerValue(headers, 'retry-after')) === null || _a === void 0 ? void 0 : _a.trim();
|
|
194
|
+
if (!raw)
|
|
195
|
+
return undefined;
|
|
196
|
+
if (/^\d+(\.\d+)?$/.test(raw))
|
|
197
|
+
return Math.ceil(Number(raw));
|
|
198
|
+
const at = Date.parse(raw);
|
|
199
|
+
if (Number.isNaN(at))
|
|
200
|
+
return undefined;
|
|
201
|
+
return Math.max(0, Math.ceil((at - now) / 1000));
|
|
202
|
+
}
|
|
203
|
+
const HINTS = {
|
|
204
|
+
insufficient_units: 'The workspace balance cannot fund the run. Add credit in Billing, then use a new Idempotency Key if the run failed.',
|
|
205
|
+
usage_budget_exceeded: "The workspace's monthly usage budget cannot cover the request.",
|
|
206
|
+
delivery_identity_conflict: 'This Idempotency Key was already used for a different endpoint, version or request. Use a new key for a new request.',
|
|
207
|
+
run_option_invalid: 'A run option is outside its range. Fix it; do not retry unchanged.',
|
|
208
|
+
idempotency_key_required: 'The Idempotency Key is missing or invalid.',
|
|
209
|
+
builder_billing_unavailable: 'Billing could not be confirmed, so the run was refused. Retry later with the same key and request.',
|
|
210
|
+
runs_unavailable: 'The run store could not answer. Retry later with the same key.',
|
|
211
|
+
source_input_invalid: 'An input value is not accepted by the API. Check the input against the API contract.',
|
|
212
|
+
};
|
|
213
|
+
function statusHint(status) {
|
|
214
|
+
switch (status) {
|
|
215
|
+
case 401:
|
|
216
|
+
return 'No valid credential. Check the API key; it needs the run scope.';
|
|
217
|
+
case 403:
|
|
218
|
+
return 'The key is not tied to a workspace account or lacks permission. Use a workspace key with the run scope.';
|
|
219
|
+
case 404:
|
|
220
|
+
return 'Not found: the API, endpoint, run or delivery does not exist for this key. The API may be unpublished.';
|
|
221
|
+
case 422:
|
|
222
|
+
return 'The request was rejected. Correct the input against the API contract.';
|
|
223
|
+
default:
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function buildBrokerError(response) {
|
|
228
|
+
const { statusCode, body, headers } = response;
|
|
229
|
+
const rawDetail = isRecord(body) ? body.detail : undefined;
|
|
230
|
+
const detail = isRecord(rawDetail) ? rawDetail : undefined;
|
|
231
|
+
const text = typeof rawDetail === 'string'
|
|
232
|
+
? rawDetail
|
|
233
|
+
: typeof (detail === null || detail === void 0 ? void 0 : detail.message) === 'string'
|
|
234
|
+
? detail.message
|
|
235
|
+
: undefined;
|
|
236
|
+
const code = typeof (detail === null || detail === void 0 ? void 0 : detail.code) === 'string' ? detail.code : undefined;
|
|
237
|
+
const errorCode = typeof (detail === null || detail === void 0 ? void 0 : detail.error_code) === 'string' ? detail.error_code : undefined;
|
|
238
|
+
const runId = typeof (detail === null || detail === void 0 ? void 0 : detail.run_id) === 'string' ? detail.run_id : undefined;
|
|
239
|
+
const failedRun = errorCode !== undefined && constants_1.FAILED_RUN_MARKERS.includes(errorCode);
|
|
240
|
+
const unsure = !failedRun && (statusCode >= 500 || statusCode === 408 || statusCode === 429);
|
|
241
|
+
let message = `CleanedWeb answered ${statusCode}`;
|
|
242
|
+
if (code)
|
|
243
|
+
message += ` ${code}`;
|
|
244
|
+
if (text && text !== code)
|
|
245
|
+
message += `: ${text}`;
|
|
246
|
+
let description = (code && HINTS[code]) || statusHint(statusCode);
|
|
247
|
+
if (failedRun) {
|
|
248
|
+
message = `${runId ? `Run ${runId}` : 'The run'} failed (${errorCode}): HTTP ${statusCode}${code ? ` ${code}` : ''}`;
|
|
249
|
+
description =
|
|
250
|
+
'A failed run is final for its Idempotency Key: the same key returns the same error for 7 days. Use a new key to run again. Records saved before the failure stay readable with Get Run Items.';
|
|
251
|
+
}
|
|
252
|
+
else if (unsure) {
|
|
253
|
+
description =
|
|
254
|
+
(description ? `${description} ` : '') +
|
|
255
|
+
'This does not show whether a run started. Keep the Idempotency Key and read the result before using a new key.';
|
|
256
|
+
}
|
|
257
|
+
return new BrokerError({
|
|
258
|
+
message,
|
|
259
|
+
statusCode,
|
|
260
|
+
description,
|
|
261
|
+
code,
|
|
262
|
+
errorCode,
|
|
263
|
+
runId,
|
|
264
|
+
unsure,
|
|
265
|
+
retryAfterSeconds: parseRetryAfter(headers),
|
|
266
|
+
body,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function extractRunId(body) {
|
|
270
|
+
if (!body)
|
|
271
|
+
return undefined;
|
|
272
|
+
if (typeof body.run_id === 'string')
|
|
273
|
+
return body.run_id;
|
|
274
|
+
if (isRecord(body.run) && typeof body.run.run_id === 'string')
|
|
275
|
+
return body.run.run_id;
|
|
276
|
+
if (isRecord(body.delivery) && typeof body.delivery.runId === 'string')
|
|
277
|
+
return body.delivery.runId;
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
280
|
+
function assertAccepted(body, expectedVersion) {
|
|
281
|
+
const summary = isRecord(body.summary) ? body.summary : undefined;
|
|
282
|
+
if (!summary)
|
|
283
|
+
return;
|
|
284
|
+
const runId = extractRunId(body);
|
|
285
|
+
const run = isRecord(body.run) ? body.run : undefined;
|
|
286
|
+
const problems = [];
|
|
287
|
+
if (!constants_1.ACCEPTED_SUMMARY_STATUSES.includes(String(summary.status))) {
|
|
288
|
+
problems.push(`summary.status is "${String(summary.status)}"`);
|
|
289
|
+
}
|
|
290
|
+
if (summary.within_scope_passed !== true)
|
|
291
|
+
problems.push('summary.within_scope_passed is not true');
|
|
292
|
+
if (run && run.status !== undefined && run.status !== 'finished') {
|
|
293
|
+
problems.push(`run.status is "${String(run.status)}"`);
|
|
294
|
+
}
|
|
295
|
+
if (expectedVersion && summary.definition_version !== expectedVersion) {
|
|
296
|
+
problems.push('summary.definition_version does not match the expected version');
|
|
297
|
+
}
|
|
298
|
+
if (problems.length > 0) {
|
|
299
|
+
const stop = run && run.stop_reason ? ` (stop reason: ${String(run.stop_reason)})` : '';
|
|
300
|
+
throw new ResultNotAcceptedError(`The run result needs review: ${problems.join('; ')}${stop}`, runId, body);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async function brokerRequest(ctx, request) {
|
|
304
|
+
var _a, _b, _c, _d;
|
|
305
|
+
const credentials = await ctx.getCredentials(constants_1.CREDENTIAL_NAME);
|
|
306
|
+
const origin = normalizeOrigin(credentials.origin);
|
|
307
|
+
const settled = await settle(ctx.helpers.httpRequestWithAuthentication.call(ctx, constants_1.CREDENTIAL_NAME, {
|
|
308
|
+
method: request.method,
|
|
309
|
+
url: `${origin}${request.path}`,
|
|
310
|
+
qs: request.qs,
|
|
311
|
+
body: request.body,
|
|
312
|
+
headers: { Accept: 'application/json', ...request.headers },
|
|
313
|
+
json: true,
|
|
314
|
+
returnFullResponse: true,
|
|
315
|
+
ignoreHttpStatusErrors: true,
|
|
316
|
+
disableFollowRedirect: true,
|
|
317
|
+
timeout: (_a = request.timeoutMs) !== null && _a !== void 0 ? _a : 60000,
|
|
318
|
+
}));
|
|
319
|
+
if (!settled.ok) {
|
|
320
|
+
throw new BrokerError({
|
|
321
|
+
message: 'No answer from the run origin (timeout or lost connection)',
|
|
322
|
+
description: 'A lost connection does not show whether a run started. Keep the Idempotency Key and read the result before using a new key.',
|
|
323
|
+
statusCode: 0,
|
|
324
|
+
unsure: true,
|
|
325
|
+
body: { message: settled.error.message },
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
const response = settled.value;
|
|
329
|
+
const statusCode = (_b = response.statusCode) !== null && _b !== void 0 ? _b : 0;
|
|
330
|
+
const result = {
|
|
331
|
+
statusCode,
|
|
332
|
+
headers: (_c = response.headers) !== null && _c !== void 0 ? _c : {},
|
|
333
|
+
body: isRecord(response.body) ? response.body : { raw: String((_d = response.body) !== null && _d !== void 0 ? _d : '') },
|
|
334
|
+
};
|
|
335
|
+
if (statusCode >= 300 && statusCode < 400) {
|
|
336
|
+
throw new BrokerError({
|
|
337
|
+
message: `The run origin answered a redirect (${statusCode}); nothing ran`,
|
|
338
|
+
description: 'The request went to the wrong origin. Use https://api.cleanedweb.com, or the origin your workspace supplies, in the credential.',
|
|
339
|
+
statusCode,
|
|
340
|
+
unsure: false,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
if (statusCode >= 400 || statusCode === 0)
|
|
344
|
+
throw buildBrokerError(result);
|
|
345
|
+
return result;
|
|
346
|
+
}
|
|
347
|
+
async function catalogGet(ctx, path, qs = {}) {
|
|
348
|
+
const response = await ctx.helpers.httpRequest({
|
|
349
|
+
method: 'GET',
|
|
350
|
+
url: `${constants_1.CATALOG_ORIGIN}${path}`,
|
|
351
|
+
qs,
|
|
352
|
+
headers: { Accept: 'application/json' },
|
|
353
|
+
json: true,
|
|
354
|
+
timeout: 30000,
|
|
355
|
+
});
|
|
356
|
+
if (!isRecord(response)) {
|
|
357
|
+
throw new CleanedWebUsageError('The catalog answered without a JSON object');
|
|
358
|
+
}
|
|
359
|
+
return response;
|
|
360
|
+
}
|
|
361
|
+
async function listCatalogApis(ctx, options = {}) {
|
|
362
|
+
const out = [];
|
|
363
|
+
for (let page = 0; page < constants_1.CATALOG_MAX_PAGES; page++) {
|
|
364
|
+
const remaining = options.limit === undefined ? Infinity : options.limit - out.length;
|
|
365
|
+
if (remaining <= 0)
|
|
366
|
+
break;
|
|
367
|
+
const pageSize = Math.min(constants_1.CATALOG_PAGE_SIZE, remaining);
|
|
368
|
+
const qs = { limit: pageSize, offset: out.length };
|
|
369
|
+
if (options.query)
|
|
370
|
+
qs.q = options.query;
|
|
371
|
+
if (options.category)
|
|
372
|
+
qs.category = options.category;
|
|
373
|
+
if (options.sort)
|
|
374
|
+
qs.sort = options.sort;
|
|
375
|
+
const response = await catalogGet(ctx, '/api/catalog/apis', qs);
|
|
376
|
+
const items = Array.isArray(response.items) ? response.items : [];
|
|
377
|
+
out.push(...items);
|
|
378
|
+
if (items.length < pageSize)
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
return options.limit === undefined ? out : out.slice(0, options.limit);
|
|
382
|
+
}
|
|
383
|
+
async function getCatalogApi(ctx, apiId) {
|
|
384
|
+
return await catalogGet(ctx, `/api/catalog/apis/${encodeURIComponent(apiId)}`);
|
|
385
|
+
}
|
|
386
|
+
async function getCatalogContract(ctx, apiId, endpointId, version) {
|
|
387
|
+
const qs = {};
|
|
388
|
+
if (version !== undefined)
|
|
389
|
+
qs.version = version;
|
|
390
|
+
return await catalogGet(ctx, `/api/catalog/apis/${encodeURIComponent(apiId)}/endpoints/${encodeURIComponent(endpointId)}/contract`, qs);
|
|
391
|
+
}
|
|
392
|
+
async function withSameKeyRetry(ctx, deps, attempt, attempts = constants_1.UNSURE_RETRY_ATTEMPTS) {
|
|
393
|
+
for (let n = 1;; n++) {
|
|
394
|
+
const result = await settle(attempt());
|
|
395
|
+
if (result.ok)
|
|
396
|
+
return result.value;
|
|
397
|
+
const error = result.error;
|
|
398
|
+
if (!(error instanceof BrokerError) || !error.unsure || n >= attempts) {
|
|
399
|
+
throw error;
|
|
400
|
+
}
|
|
401
|
+
const waitMs = error.retryAfterSeconds !== undefined
|
|
402
|
+
? Math.min(error.retryAfterSeconds, 60) * 1000
|
|
403
|
+
: constants_1.UNSURE_RETRY_BASE_MS * 2 ** (n - 1);
|
|
404
|
+
await deps.sleep(ctx, waitMs);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
async function executeRun(ctx, request, deps = exports.defaultDeps) {
|
|
408
|
+
var _a, _b, _c, _d;
|
|
409
|
+
const requestedWait = request.body.wait_seconds;
|
|
410
|
+
const serverWait = typeof requestedWait === 'number' ? requestedWait : constants_1.DEFAULT_WAIT_SECONDS;
|
|
411
|
+
const start = await withSameKeyRetry(ctx, deps, () => brokerRequest(ctx, {
|
|
412
|
+
method: 'POST',
|
|
413
|
+
path: request.startPath,
|
|
414
|
+
body: request.body,
|
|
415
|
+
headers: { 'Idempotency-Key': request.idempotencyKey },
|
|
416
|
+
timeoutMs: (serverWait + 30) * 1000,
|
|
417
|
+
}));
|
|
418
|
+
if (start.statusCode === 200) {
|
|
419
|
+
return { finished: true, body: start.body, runId: extractRunId(start.body) };
|
|
420
|
+
}
|
|
421
|
+
const runId = extractRunId(start.body);
|
|
422
|
+
if (start.statusCode !== 202) {
|
|
423
|
+
throw new BrokerError({
|
|
424
|
+
message: `CleanedWeb answered an unexpected ${start.statusCode}`,
|
|
425
|
+
statusCode: start.statusCode,
|
|
426
|
+
unsure: false,
|
|
427
|
+
body: start.body,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
if (!request.waitForResult)
|
|
431
|
+
return { finished: false, body: start.body, runId };
|
|
432
|
+
const deadline = deps.now() + request.maxWaitSeconds * 1000;
|
|
433
|
+
let latest = start;
|
|
434
|
+
let currentRunId = runId;
|
|
435
|
+
let failures = 0;
|
|
436
|
+
for (;;) {
|
|
437
|
+
const remainingMs = deadline - deps.now();
|
|
438
|
+
if (remainingMs <= 0)
|
|
439
|
+
throw new RunStillRunningError(currentRunId, request.maxWaitSeconds);
|
|
440
|
+
const hinted = (_b = (_a = parseRetryAfter(latest.headers, deps.now())) !== null && _a !== void 0 ? _a : (typeof latest.body.poll_after_seconds === 'number'
|
|
441
|
+
? latest.body.poll_after_seconds
|
|
442
|
+
: undefined)) !== null && _b !== void 0 ? _b : request.pollFallbackSeconds;
|
|
443
|
+
const delaySeconds = Math.min(Math.max(hinted, 1), 3600);
|
|
444
|
+
await deps.sleep(ctx, Math.min(delaySeconds * 1000, remainingMs));
|
|
445
|
+
const target = request.resultRequest(currentRunId);
|
|
446
|
+
const read = await settle(brokerRequest(ctx, {
|
|
447
|
+
method: 'GET',
|
|
448
|
+
path: target.path,
|
|
449
|
+
headers: target.headers,
|
|
450
|
+
timeoutMs: 120000,
|
|
451
|
+
}));
|
|
452
|
+
if (!read.ok) {
|
|
453
|
+
const error = read.error;
|
|
454
|
+
if (error instanceof BrokerError && error.unsure && ++failures <= constants_1.UNSURE_RETRY_ATTEMPTS + 2) {
|
|
455
|
+
latest = {
|
|
456
|
+
headers: error.retryAfterSeconds !== undefined
|
|
457
|
+
? { 'retry-after': String(error.retryAfterSeconds) }
|
|
458
|
+
: {},
|
|
459
|
+
body: {},
|
|
460
|
+
};
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
throw error;
|
|
464
|
+
}
|
|
465
|
+
failures = 0;
|
|
466
|
+
const poll = read.value;
|
|
467
|
+
if (poll.statusCode === 200) {
|
|
468
|
+
return { finished: true, body: poll.body, runId: (_c = extractRunId(poll.body)) !== null && _c !== void 0 ? _c : currentRunId };
|
|
469
|
+
}
|
|
470
|
+
if (poll.statusCode !== 202) {
|
|
471
|
+
throw new BrokerError({
|
|
472
|
+
message: `CleanedWeb answered an unexpected ${poll.statusCode} while reading the result`,
|
|
473
|
+
statusCode: poll.statusCode,
|
|
474
|
+
unsure: false,
|
|
475
|
+
body: poll.body,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
latest = poll;
|
|
479
|
+
currentRunId = (_d = extractRunId(poll.body)) !== null && _d !== void 0 ? _d : currentRunId;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
async function fetchRunItems(ctx, runId, options) {
|
|
483
|
+
var _a, _b;
|
|
484
|
+
const out = [];
|
|
485
|
+
let cursor = options.startCursor || '0';
|
|
486
|
+
for (;;) {
|
|
487
|
+
const remaining = options.returnAll ? Infinity : ((_a = options.limit) !== null && _a !== void 0 ? _a : 50) - out.length;
|
|
488
|
+
if (remaining <= 0)
|
|
489
|
+
break;
|
|
490
|
+
const qs = {
|
|
491
|
+
cursor,
|
|
492
|
+
limit: Math.min(options.pageSize, Number.isFinite(remaining) ? remaining : options.pageSize),
|
|
493
|
+
};
|
|
494
|
+
if (options.nulls)
|
|
495
|
+
qs.nulls = true;
|
|
496
|
+
const page = await brokerRequest(ctx, {
|
|
497
|
+
method: 'GET',
|
|
498
|
+
path: `/v1/runs/${encodeURIComponent(runId)}/items`,
|
|
499
|
+
qs,
|
|
500
|
+
});
|
|
501
|
+
const items = Array.isArray(page.body.items) ? page.body.items : [];
|
|
502
|
+
out.push(...items);
|
|
503
|
+
const next = page.body.next_cursor;
|
|
504
|
+
const nextCursor = next === null || next === undefined || next === '' ? undefined : String(next);
|
|
505
|
+
if (items.length === 0 || nextCursor === undefined || nextCursor === cursor)
|
|
506
|
+
break;
|
|
507
|
+
cursor = nextCursor;
|
|
508
|
+
}
|
|
509
|
+
return options.returnAll ? out : out.slice(0, (_b = options.limit) !== null && _b !== void 0 ? _b : 50);
|
|
510
|
+
}
|
|
511
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/CleanedWeb/GenericFunctions.ts"],"names":[],"mappings":";;;AA8HA,wBAKC;AAMD,4BAEC;AAGD,0CAwBC;AAED,wDASC;AAaD,gCAcC;AAED,kCASC;AA2BD,oCAgCC;AAgBD,0CAUC;AA4ED,oCAMC;AAQD,wCAwBC;AAmBD,sCAiDC;AAGD,gCAiBC;AAWD,0CAmBC;AAED,sCAEC;AAED,gDAaC;AAwDD,gCAuFC;AAcD,sCA4BC;AA1tBD,+CAAqC;AAErC,2CAcqB;AAKrB,MAAa,oBAAqB,SAAQ,KAAK;IAC9C,YACC,OAAe,EACN,WAAoB;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,gBAAW,GAAX,WAAW,CAAS;QAG7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;AARD,oDAQC;AAeD,MAAa,WAAY,SAAQ,KAAK;IAYrC,YAAY,IAAqB;QAChC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC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AC,KAAK,mCAAI,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
import { type Deps, type RunOutcome } from './GenericFunctions';
|
|
3
|
+
export declare function listApis(ctx: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
4
|
+
export declare function getApiContract(ctx: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
5
|
+
export declare function outcomeToItems(outcome: RunOutcome, outputMode: string, itemIndex: number): INodeExecutionData[];
|
|
6
|
+
export declare function startRun(ctx: IExecuteFunctions, i: number, kind: 'catalog' | 'source', deps?: Deps): Promise<INodeExecutionData[]>;
|
|
7
|
+
export declare function getRun(ctx: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
8
|
+
export declare function abortRun(ctx: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
9
|
+
export declare function getRunItems(ctx: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|