@uniformdev/next-app-router 20.70.1-alpha.10 → 20.70.1-alpha.6
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/cache.js +494 -570
- package/dist/cache.mjs +494 -570
- package/dist/component.js +366 -0
- package/dist/component.mjs +366 -0
- package/dist/handler.js +507 -583
- package/dist/handler.mjs +507 -583
- package/dist/index.esm.js +538 -607
- package/dist/index.js +548 -617
- package/dist/index.mjs +538 -607
- package/dist/middleware.js +471 -524
- package/dist/middleware.mjs +471 -524
- package/package.json +8 -8
package/dist/cache.mjs
CHANGED
|
@@ -4,10 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __typeError = (msg) => {
|
|
8
|
-
throw TypeError(msg);
|
|
9
|
-
};
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
9
|
};
|
|
@@ -27,25 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
24
|
mod
|
|
29
25
|
));
|
|
30
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
32
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
33
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
34
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
35
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
36
|
-
set _(value) {
|
|
37
|
-
__privateSet(obj, member, value, setter);
|
|
38
|
-
},
|
|
39
|
-
get _() {
|
|
40
|
-
return __privateGet(obj, member, getter);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
26
|
|
|
44
27
|
// ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
|
|
45
28
|
var require_yocto_queue = __commonJS({
|
|
46
29
|
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
47
30
|
"use strict";
|
|
48
|
-
var
|
|
31
|
+
var Node = class {
|
|
49
32
|
/// value;
|
|
50
33
|
/// next;
|
|
51
34
|
constructor(value) {
|
|
@@ -53,7 +36,7 @@ var require_yocto_queue = __commonJS({
|
|
|
53
36
|
this.next = void 0;
|
|
54
37
|
}
|
|
55
38
|
};
|
|
56
|
-
var
|
|
39
|
+
var Queue = class {
|
|
57
40
|
// TODO: Use private class fields when targeting Node.js 12.
|
|
58
41
|
// #_head;
|
|
59
42
|
// #_tail;
|
|
@@ -62,7 +45,7 @@ var require_yocto_queue = __commonJS({
|
|
|
62
45
|
this.clear();
|
|
63
46
|
}
|
|
64
47
|
enqueue(value) {
|
|
65
|
-
const node = new
|
|
48
|
+
const node = new Node(value);
|
|
66
49
|
if (this._head) {
|
|
67
50
|
this._tail.next = node;
|
|
68
51
|
this._tail = node;
|
|
@@ -97,7 +80,7 @@ var require_yocto_queue = __commonJS({
|
|
|
97
80
|
}
|
|
98
81
|
}
|
|
99
82
|
};
|
|
100
|
-
module.exports =
|
|
83
|
+
module.exports = Queue;
|
|
101
84
|
}
|
|
102
85
|
});
|
|
103
86
|
|
|
@@ -105,12 +88,12 @@ var require_yocto_queue = __commonJS({
|
|
|
105
88
|
var require_p_limit = __commonJS({
|
|
106
89
|
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
107
90
|
"use strict";
|
|
108
|
-
var
|
|
109
|
-
var
|
|
91
|
+
var Queue = require_yocto_queue();
|
|
92
|
+
var pLimit2 = (concurrency) => {
|
|
110
93
|
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
111
94
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
112
95
|
}
|
|
113
|
-
const queue = new
|
|
96
|
+
const queue = new Queue();
|
|
114
97
|
let activeCount = 0;
|
|
115
98
|
const next = () => {
|
|
116
99
|
activeCount--;
|
|
@@ -155,238 +138,7 @@ var require_p_limit = __commonJS({
|
|
|
155
138
|
});
|
|
156
139
|
return generator;
|
|
157
140
|
};
|
|
158
|
-
module.exports =
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js
|
|
163
|
-
var require_retry_operation = __commonJS({
|
|
164
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
165
|
-
"use strict";
|
|
166
|
-
function RetryOperation(timeouts, options) {
|
|
167
|
-
if (typeof options === "boolean") {
|
|
168
|
-
options = { forever: options };
|
|
169
|
-
}
|
|
170
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
171
|
-
this._timeouts = timeouts;
|
|
172
|
-
this._options = options || {};
|
|
173
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
174
|
-
this._fn = null;
|
|
175
|
-
this._errors = [];
|
|
176
|
-
this._attempts = 1;
|
|
177
|
-
this._operationTimeout = null;
|
|
178
|
-
this._operationTimeoutCb = null;
|
|
179
|
-
this._timeout = null;
|
|
180
|
-
this._operationStart = null;
|
|
181
|
-
this._timer = null;
|
|
182
|
-
if (this._options.forever) {
|
|
183
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
module.exports = RetryOperation;
|
|
187
|
-
RetryOperation.prototype.reset = function() {
|
|
188
|
-
this._attempts = 1;
|
|
189
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
190
|
-
};
|
|
191
|
-
RetryOperation.prototype.stop = function() {
|
|
192
|
-
if (this._timeout) {
|
|
193
|
-
clearTimeout(this._timeout);
|
|
194
|
-
}
|
|
195
|
-
if (this._timer) {
|
|
196
|
-
clearTimeout(this._timer);
|
|
197
|
-
}
|
|
198
|
-
this._timeouts = [];
|
|
199
|
-
this._cachedTimeouts = null;
|
|
200
|
-
};
|
|
201
|
-
RetryOperation.prototype.retry = function(err) {
|
|
202
|
-
if (this._timeout) {
|
|
203
|
-
clearTimeout(this._timeout);
|
|
204
|
-
}
|
|
205
|
-
if (!err) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
209
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
210
|
-
this._errors.push(err);
|
|
211
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
this._errors.push(err);
|
|
215
|
-
var timeout = this._timeouts.shift();
|
|
216
|
-
if (timeout === void 0) {
|
|
217
|
-
if (this._cachedTimeouts) {
|
|
218
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
219
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
220
|
-
} else {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
var self = this;
|
|
225
|
-
this._timer = setTimeout(function() {
|
|
226
|
-
self._attempts++;
|
|
227
|
-
if (self._operationTimeoutCb) {
|
|
228
|
-
self._timeout = setTimeout(function() {
|
|
229
|
-
self._operationTimeoutCb(self._attempts);
|
|
230
|
-
}, self._operationTimeout);
|
|
231
|
-
if (self._options.unref) {
|
|
232
|
-
self._timeout.unref();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
self._fn(self._attempts);
|
|
236
|
-
}, timeout);
|
|
237
|
-
if (this._options.unref) {
|
|
238
|
-
this._timer.unref();
|
|
239
|
-
}
|
|
240
|
-
return true;
|
|
241
|
-
};
|
|
242
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
243
|
-
this._fn = fn;
|
|
244
|
-
if (timeoutOps) {
|
|
245
|
-
if (timeoutOps.timeout) {
|
|
246
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
247
|
-
}
|
|
248
|
-
if (timeoutOps.cb) {
|
|
249
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
var self = this;
|
|
253
|
-
if (this._operationTimeoutCb) {
|
|
254
|
-
this._timeout = setTimeout(function() {
|
|
255
|
-
self._operationTimeoutCb();
|
|
256
|
-
}, self._operationTimeout);
|
|
257
|
-
}
|
|
258
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
259
|
-
this._fn(this._attempts);
|
|
260
|
-
};
|
|
261
|
-
RetryOperation.prototype.try = function(fn) {
|
|
262
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
263
|
-
this.attempt(fn);
|
|
264
|
-
};
|
|
265
|
-
RetryOperation.prototype.start = function(fn) {
|
|
266
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
267
|
-
this.attempt(fn);
|
|
268
|
-
};
|
|
269
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
270
|
-
RetryOperation.prototype.errors = function() {
|
|
271
|
-
return this._errors;
|
|
272
|
-
};
|
|
273
|
-
RetryOperation.prototype.attempts = function() {
|
|
274
|
-
return this._attempts;
|
|
275
|
-
};
|
|
276
|
-
RetryOperation.prototype.mainError = function() {
|
|
277
|
-
if (this._errors.length === 0) {
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
280
|
-
var counts = {};
|
|
281
|
-
var mainError = null;
|
|
282
|
-
var mainErrorCount = 0;
|
|
283
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
284
|
-
var error = this._errors[i];
|
|
285
|
-
var message = error.message;
|
|
286
|
-
var count = (counts[message] || 0) + 1;
|
|
287
|
-
counts[message] = count;
|
|
288
|
-
if (count >= mainErrorCount) {
|
|
289
|
-
mainError = error;
|
|
290
|
-
mainErrorCount = count;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return mainError;
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js
|
|
299
|
-
var require_retry = __commonJS({
|
|
300
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
|
|
301
|
-
"use strict";
|
|
302
|
-
var RetryOperation = require_retry_operation();
|
|
303
|
-
exports.operation = function(options) {
|
|
304
|
-
var timeouts = exports.timeouts(options);
|
|
305
|
-
return new RetryOperation(timeouts, {
|
|
306
|
-
forever: options && (options.forever || options.retries === Infinity),
|
|
307
|
-
unref: options && options.unref,
|
|
308
|
-
maxRetryTime: options && options.maxRetryTime
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
exports.timeouts = function(options) {
|
|
312
|
-
if (options instanceof Array) {
|
|
313
|
-
return [].concat(options);
|
|
314
|
-
}
|
|
315
|
-
var opts = {
|
|
316
|
-
retries: 10,
|
|
317
|
-
factor: 2,
|
|
318
|
-
minTimeout: 1 * 1e3,
|
|
319
|
-
maxTimeout: Infinity,
|
|
320
|
-
randomize: false
|
|
321
|
-
};
|
|
322
|
-
for (var key in options) {
|
|
323
|
-
opts[key] = options[key];
|
|
324
|
-
}
|
|
325
|
-
if (opts.minTimeout > opts.maxTimeout) {
|
|
326
|
-
throw new Error("minTimeout is greater than maxTimeout");
|
|
327
|
-
}
|
|
328
|
-
var timeouts = [];
|
|
329
|
-
for (var i = 0; i < opts.retries; i++) {
|
|
330
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
331
|
-
}
|
|
332
|
-
if (options && options.forever && !timeouts.length) {
|
|
333
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
334
|
-
}
|
|
335
|
-
timeouts.sort(function(a, b) {
|
|
336
|
-
return a - b;
|
|
337
|
-
});
|
|
338
|
-
return timeouts;
|
|
339
|
-
};
|
|
340
|
-
exports.createTimeout = function(attempt, opts) {
|
|
341
|
-
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
342
|
-
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
343
|
-
timeout = Math.min(timeout, opts.maxTimeout);
|
|
344
|
-
return timeout;
|
|
345
|
-
};
|
|
346
|
-
exports.wrap = function(obj, options, methods) {
|
|
347
|
-
if (options instanceof Array) {
|
|
348
|
-
methods = options;
|
|
349
|
-
options = null;
|
|
350
|
-
}
|
|
351
|
-
if (!methods) {
|
|
352
|
-
methods = [];
|
|
353
|
-
for (var key in obj) {
|
|
354
|
-
if (typeof obj[key] === "function") {
|
|
355
|
-
methods.push(key);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
for (var i = 0; i < methods.length; i++) {
|
|
360
|
-
var method = methods[i];
|
|
361
|
-
var original = obj[method];
|
|
362
|
-
obj[method] = function retryWrapper(original2) {
|
|
363
|
-
var op = exports.operation(options);
|
|
364
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
365
|
-
var callback = args.pop();
|
|
366
|
-
args.push(function(err) {
|
|
367
|
-
if (op.retry(err)) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (err) {
|
|
371
|
-
arguments[0] = op.mainError();
|
|
372
|
-
}
|
|
373
|
-
callback.apply(this, arguments);
|
|
374
|
-
});
|
|
375
|
-
op.attempt(function() {
|
|
376
|
-
original2.apply(obj, args);
|
|
377
|
-
});
|
|
378
|
-
}.bind(obj, original);
|
|
379
|
-
obj[method].options = options;
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js
|
|
386
|
-
var require_retry2 = __commonJS({
|
|
387
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
388
|
-
"use strict";
|
|
389
|
-
module.exports = require_retry();
|
|
141
|
+
module.exports = pLimit2;
|
|
390
142
|
}
|
|
391
143
|
});
|
|
392
144
|
|
|
@@ -396,14 +148,14 @@ import { deserializeEvaluationResult } from "@uniformdev/next-app-router-shared"
|
|
|
396
148
|
// ../context/dist/api/api.mjs
|
|
397
149
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
398
150
|
var __defProp2 = Object.defineProperty;
|
|
399
|
-
var
|
|
151
|
+
var __typeError = (msg) => {
|
|
400
152
|
throw TypeError(msg);
|
|
401
153
|
};
|
|
402
|
-
var
|
|
403
|
-
var
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
var
|
|
154
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
155
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
156
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
157
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
158
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
407
159
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
408
160
|
var ApiClientError = class _ApiClientError extends Error {
|
|
409
161
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -411,18 +163,18 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
411
163
|
`${errorMessage}
|
|
412
164
|
${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
|
|
413
165
|
);
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
166
|
+
__publicField(this, "errorMessage", errorMessage);
|
|
167
|
+
__publicField(this, "fetchMethod", fetchMethod);
|
|
168
|
+
__publicField(this, "fetchUri", fetchUri);
|
|
169
|
+
__publicField(this, "statusCode", statusCode);
|
|
170
|
+
__publicField(this, "statusText", statusText);
|
|
171
|
+
__publicField(this, "requestId", requestId);
|
|
420
172
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
421
173
|
}
|
|
422
174
|
};
|
|
423
175
|
var ApiClient = class _ApiClient {
|
|
424
176
|
constructor(options) {
|
|
425
|
-
|
|
177
|
+
__publicField(this, "options");
|
|
426
178
|
var _a, _b, _c, _d, _e;
|
|
427
179
|
if (!options.apiKey && !options.bearerToken) {
|
|
428
180
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -592,12 +344,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
592
344
|
/** Fetches all aggregates for a project */
|
|
593
345
|
async get(options) {
|
|
594
346
|
const { projectId } = this.options;
|
|
595
|
-
const fetchUri = this.createUrl(
|
|
347
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
|
|
596
348
|
return await this.apiClient(fetchUri);
|
|
597
349
|
}
|
|
598
350
|
/** Updates or creates (based on id) an Aggregate */
|
|
599
351
|
async upsert(body) {
|
|
600
|
-
const fetchUri = this.createUrl(
|
|
352
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
601
353
|
await this.apiClient(fetchUri, {
|
|
602
354
|
method: "PUT",
|
|
603
355
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -606,7 +358,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
606
358
|
}
|
|
607
359
|
/** Deletes an Aggregate */
|
|
608
360
|
async remove(body) {
|
|
609
|
-
const fetchUri = this.createUrl(
|
|
361
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
610
362
|
await this.apiClient(fetchUri, {
|
|
611
363
|
method: "DELETE",
|
|
612
364
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -615,7 +367,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
615
367
|
}
|
|
616
368
|
};
|
|
617
369
|
_url = /* @__PURE__ */ new WeakMap();
|
|
618
|
-
|
|
370
|
+
__privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
|
|
619
371
|
var _url2;
|
|
620
372
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
621
373
|
constructor(options) {
|
|
@@ -624,12 +376,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
624
376
|
/** Fetches the known score dimensions for a project */
|
|
625
377
|
async get(options) {
|
|
626
378
|
const { projectId } = this.options;
|
|
627
|
-
const fetchUri = this.createUrl(
|
|
379
|
+
const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
|
|
628
380
|
return await this.apiClient(fetchUri);
|
|
629
381
|
}
|
|
630
382
|
};
|
|
631
383
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
632
|
-
|
|
384
|
+
__privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
|
|
633
385
|
var _url3;
|
|
634
386
|
var _valueUrl;
|
|
635
387
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -639,12 +391,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
639
391
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
640
392
|
async get(options) {
|
|
641
393
|
const { projectId } = this.options;
|
|
642
|
-
const fetchUri = this.createUrl(
|
|
394
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
643
395
|
return await this.apiClient(fetchUri);
|
|
644
396
|
}
|
|
645
397
|
/** Updates or creates (based on id) an enrichment category */
|
|
646
398
|
async upsertCategory(body) {
|
|
647
|
-
const fetchUri = this.createUrl(
|
|
399
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
648
400
|
await this.apiClient(fetchUri, {
|
|
649
401
|
method: "PUT",
|
|
650
402
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -653,7 +405,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
653
405
|
}
|
|
654
406
|
/** Deletes an enrichment category */
|
|
655
407
|
async removeCategory(body) {
|
|
656
|
-
const fetchUri = this.createUrl(
|
|
408
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
657
409
|
await this.apiClient(fetchUri, {
|
|
658
410
|
method: "DELETE",
|
|
659
411
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -662,7 +414,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
662
414
|
}
|
|
663
415
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
664
416
|
async upsertValue(body) {
|
|
665
|
-
const fetchUri = this.createUrl(
|
|
417
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
666
418
|
await this.apiClient(fetchUri, {
|
|
667
419
|
method: "PUT",
|
|
668
420
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -671,7 +423,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
671
423
|
}
|
|
672
424
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
673
425
|
async removeValue(body) {
|
|
674
|
-
const fetchUri = this.createUrl(
|
|
426
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
675
427
|
await this.apiClient(fetchUri, {
|
|
676
428
|
method: "DELETE",
|
|
677
429
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -681,8 +433,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
681
433
|
};
|
|
682
434
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
683
435
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
684
|
-
|
|
685
|
-
|
|
436
|
+
__privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
437
|
+
__privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
686
438
|
var _url4;
|
|
687
439
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
688
440
|
constructor(options) {
|
|
@@ -691,7 +443,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
691
443
|
/** Fetches the Context manifest for a project */
|
|
692
444
|
async get(options) {
|
|
693
445
|
const { projectId } = this.options;
|
|
694
|
-
const fetchUri = this.createUrl(
|
|
446
|
+
const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
|
|
695
447
|
return await this.apiClient(fetchUri);
|
|
696
448
|
}
|
|
697
449
|
/** Publishes the Context manifest for a project */
|
|
@@ -705,7 +457,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
705
457
|
}
|
|
706
458
|
};
|
|
707
459
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
708
|
-
|
|
460
|
+
__privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
|
|
709
461
|
var ManifestClient = _ManifestClient;
|
|
710
462
|
var _url5;
|
|
711
463
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
@@ -715,12 +467,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
715
467
|
/** Fetches all Quirks for a project */
|
|
716
468
|
async get(options) {
|
|
717
469
|
const { projectId } = this.options;
|
|
718
|
-
const fetchUri = this.createUrl(
|
|
470
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
|
|
719
471
|
return await this.apiClient(fetchUri);
|
|
720
472
|
}
|
|
721
473
|
/** Updates or creates (based on id) a Quirk */
|
|
722
474
|
async upsert(body) {
|
|
723
|
-
const fetchUri = this.createUrl(
|
|
475
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
724
476
|
await this.apiClient(fetchUri, {
|
|
725
477
|
method: "PUT",
|
|
726
478
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -729,7 +481,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
729
481
|
}
|
|
730
482
|
/** Deletes a Quirk */
|
|
731
483
|
async remove(body) {
|
|
732
|
-
const fetchUri = this.createUrl(
|
|
484
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
733
485
|
await this.apiClient(fetchUri, {
|
|
734
486
|
method: "DELETE",
|
|
735
487
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -738,7 +490,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
738
490
|
}
|
|
739
491
|
};
|
|
740
492
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
741
|
-
|
|
493
|
+
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
742
494
|
var _url6;
|
|
743
495
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
744
496
|
constructor(options) {
|
|
@@ -747,12 +499,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
747
499
|
/** Fetches all Signals for a project */
|
|
748
500
|
async get(options) {
|
|
749
501
|
const { projectId } = this.options;
|
|
750
|
-
const fetchUri = this.createUrl(
|
|
502
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
751
503
|
return await this.apiClient(fetchUri);
|
|
752
504
|
}
|
|
753
505
|
/** Updates or creates (based on id) a Signal */
|
|
754
506
|
async upsert(body) {
|
|
755
|
-
const fetchUri = this.createUrl(
|
|
507
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
756
508
|
await this.apiClient(fetchUri, {
|
|
757
509
|
method: "PUT",
|
|
758
510
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -761,7 +513,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
761
513
|
}
|
|
762
514
|
/** Deletes a Signal */
|
|
763
515
|
async remove(body) {
|
|
764
|
-
const fetchUri = this.createUrl(
|
|
516
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
765
517
|
await this.apiClient(fetchUri, {
|
|
766
518
|
method: "DELETE",
|
|
767
519
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -770,7 +522,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
770
522
|
}
|
|
771
523
|
};
|
|
772
524
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
773
|
-
|
|
525
|
+
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
774
526
|
var _url7;
|
|
775
527
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
776
528
|
constructor(options) {
|
|
@@ -779,12 +531,12 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
779
531
|
/** Fetches all Tests for a project */
|
|
780
532
|
async get(options) {
|
|
781
533
|
const { projectId } = this.options;
|
|
782
|
-
const fetchUri = this.createUrl(
|
|
534
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
783
535
|
return await this.apiClient(fetchUri);
|
|
784
536
|
}
|
|
785
537
|
/** Updates or creates (based on id) a Test */
|
|
786
538
|
async upsert(body) {
|
|
787
|
-
const fetchUri = this.createUrl(
|
|
539
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
788
540
|
await this.apiClient(fetchUri, {
|
|
789
541
|
method: "PUT",
|
|
790
542
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -793,7 +545,7 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
793
545
|
}
|
|
794
546
|
/** Deletes a Test */
|
|
795
547
|
async remove(body) {
|
|
796
|
-
const fetchUri = this.createUrl(
|
|
548
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
797
549
|
await this.apiClient(fetchUri, {
|
|
798
550
|
method: "DELETE",
|
|
799
551
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -802,194 +554,393 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
802
554
|
}
|
|
803
555
|
};
|
|
804
556
|
_url7 = /* @__PURE__ */ new WeakMap();
|
|
805
|
-
|
|
557
|
+
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
806
558
|
|
|
807
|
-
//
|
|
808
|
-
var
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
559
|
+
// ../canvas/dist/index.mjs
|
|
560
|
+
var __create2 = Object.create;
|
|
561
|
+
var __defProp3 = Object.defineProperty;
|
|
562
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
563
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
564
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
565
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
566
|
+
var __typeError2 = (msg) => {
|
|
567
|
+
throw TypeError(msg);
|
|
814
568
|
};
|
|
815
|
-
var
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
enqueue(value) {
|
|
824
|
-
const node = new Node(value);
|
|
825
|
-
if (__privateGet(this, _head)) {
|
|
826
|
-
__privateGet(this, _tail).next = node;
|
|
827
|
-
__privateSet(this, _tail, node);
|
|
828
|
-
} else {
|
|
829
|
-
__privateSet(this, _head, node);
|
|
830
|
-
__privateSet(this, _tail, node);
|
|
831
|
-
}
|
|
832
|
-
__privateWrapper(this, _size)._++;
|
|
833
|
-
}
|
|
834
|
-
dequeue() {
|
|
835
|
-
const current = __privateGet(this, _head);
|
|
836
|
-
if (!current) {
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
840
|
-
__privateWrapper(this, _size)._--;
|
|
841
|
-
if (!__privateGet(this, _head)) {
|
|
842
|
-
__privateSet(this, _tail, void 0);
|
|
843
|
-
}
|
|
844
|
-
return current.value;
|
|
569
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
570
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
571
|
+
};
|
|
572
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
573
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
574
|
+
for (let key of __getOwnPropNames2(from))
|
|
575
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
576
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
845
577
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
578
|
+
return to;
|
|
579
|
+
};
|
|
580
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
581
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
582
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
583
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
584
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
585
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
586
|
+
mod
|
|
587
|
+
));
|
|
588
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
589
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
590
|
+
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
591
|
+
var require_yocto_queue2 = __commonJS2({
|
|
592
|
+
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
593
|
+
"use strict";
|
|
594
|
+
var Node = class {
|
|
595
|
+
/// value;
|
|
596
|
+
/// next;
|
|
597
|
+
constructor(value) {
|
|
598
|
+
this.value = value;
|
|
599
|
+
this.next = void 0;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
var Queue = class {
|
|
603
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
604
|
+
// #_head;
|
|
605
|
+
// #_tail;
|
|
606
|
+
// #_size;
|
|
607
|
+
constructor() {
|
|
608
|
+
this.clear();
|
|
609
|
+
}
|
|
610
|
+
enqueue(value) {
|
|
611
|
+
const node = new Node(value);
|
|
612
|
+
if (this._head) {
|
|
613
|
+
this._tail.next = node;
|
|
614
|
+
this._tail = node;
|
|
615
|
+
} else {
|
|
616
|
+
this._head = node;
|
|
617
|
+
this._tail = node;
|
|
618
|
+
}
|
|
619
|
+
this._size++;
|
|
620
|
+
}
|
|
621
|
+
dequeue() {
|
|
622
|
+
const current = this._head;
|
|
623
|
+
if (!current) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
this._head = this._head.next;
|
|
627
|
+
this._size--;
|
|
628
|
+
return current.value;
|
|
629
|
+
}
|
|
630
|
+
clear() {
|
|
631
|
+
this._head = void 0;
|
|
632
|
+
this._tail = void 0;
|
|
633
|
+
this._size = 0;
|
|
634
|
+
}
|
|
635
|
+
get size() {
|
|
636
|
+
return this._size;
|
|
637
|
+
}
|
|
638
|
+
*[Symbol.iterator]() {
|
|
639
|
+
let current = this._head;
|
|
640
|
+
while (current) {
|
|
641
|
+
yield current.value;
|
|
642
|
+
current = current.next;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
module.exports = Queue;
|
|
859
647
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
648
|
+
});
|
|
649
|
+
var require_p_limit2 = __commonJS2({
|
|
650
|
+
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
651
|
+
"use strict";
|
|
652
|
+
var Queue = require_yocto_queue2();
|
|
653
|
+
var pLimit2 = (concurrency) => {
|
|
654
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
655
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
656
|
+
}
|
|
657
|
+
const queue = new Queue();
|
|
658
|
+
let activeCount = 0;
|
|
659
|
+
const next = () => {
|
|
660
|
+
activeCount--;
|
|
661
|
+
if (queue.size > 0) {
|
|
662
|
+
queue.dequeue()();
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
const run = async (fn, resolve, ...args) => {
|
|
666
|
+
activeCount++;
|
|
667
|
+
const result = (async () => fn(...args))();
|
|
668
|
+
resolve(result);
|
|
669
|
+
try {
|
|
670
|
+
await result;
|
|
671
|
+
} catch (e) {
|
|
672
|
+
}
|
|
673
|
+
next();
|
|
674
|
+
};
|
|
675
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
676
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
677
|
+
(async () => {
|
|
678
|
+
await Promise.resolve();
|
|
679
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
680
|
+
queue.dequeue()();
|
|
681
|
+
}
|
|
682
|
+
})();
|
|
683
|
+
};
|
|
684
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
685
|
+
enqueue(fn, resolve, ...args);
|
|
686
|
+
});
|
|
687
|
+
Object.defineProperties(generator, {
|
|
688
|
+
activeCount: {
|
|
689
|
+
get: () => activeCount
|
|
690
|
+
},
|
|
691
|
+
pendingCount: {
|
|
692
|
+
get: () => queue.size
|
|
693
|
+
},
|
|
694
|
+
clearQueue: {
|
|
695
|
+
value: () => {
|
|
696
|
+
queue.clear();
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
return generator;
|
|
701
|
+
};
|
|
702
|
+
module.exports = pLimit2;
|
|
866
703
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
704
|
+
});
|
|
705
|
+
var require_retry_operation = __commonJS2({
|
|
706
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
707
|
+
"use strict";
|
|
708
|
+
function RetryOperation(timeouts, options) {
|
|
709
|
+
if (typeof options === "boolean") {
|
|
710
|
+
options = { forever: options };
|
|
711
|
+
}
|
|
712
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
713
|
+
this._timeouts = timeouts;
|
|
714
|
+
this._options = options || {};
|
|
715
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
716
|
+
this._fn = null;
|
|
717
|
+
this._errors = [];
|
|
718
|
+
this._attempts = 1;
|
|
719
|
+
this._operationTimeout = null;
|
|
720
|
+
this._operationTimeoutCb = null;
|
|
721
|
+
this._timeout = null;
|
|
722
|
+
this._operationStart = null;
|
|
723
|
+
this._timer = null;
|
|
724
|
+
if (this._options.forever) {
|
|
725
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
726
|
+
}
|
|
870
727
|
}
|
|
728
|
+
module.exports = RetryOperation;
|
|
729
|
+
RetryOperation.prototype.reset = function() {
|
|
730
|
+
this._attempts = 1;
|
|
731
|
+
this._timeouts = this._originalTimeouts.slice(0);
|
|
732
|
+
};
|
|
733
|
+
RetryOperation.prototype.stop = function() {
|
|
734
|
+
if (this._timeout) {
|
|
735
|
+
clearTimeout(this._timeout);
|
|
736
|
+
}
|
|
737
|
+
if (this._timer) {
|
|
738
|
+
clearTimeout(this._timer);
|
|
739
|
+
}
|
|
740
|
+
this._timeouts = [];
|
|
741
|
+
this._cachedTimeouts = null;
|
|
742
|
+
};
|
|
743
|
+
RetryOperation.prototype.retry = function(err) {
|
|
744
|
+
if (this._timeout) {
|
|
745
|
+
clearTimeout(this._timeout);
|
|
746
|
+
}
|
|
747
|
+
if (!err) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
751
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
752
|
+
this._errors.push(err);
|
|
753
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
this._errors.push(err);
|
|
757
|
+
var timeout = this._timeouts.shift();
|
|
758
|
+
if (timeout === void 0) {
|
|
759
|
+
if (this._cachedTimeouts) {
|
|
760
|
+
this._errors.splice(0, this._errors.length - 1);
|
|
761
|
+
timeout = this._cachedTimeouts.slice(-1);
|
|
762
|
+
} else {
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
var self = this;
|
|
767
|
+
this._timer = setTimeout(function() {
|
|
768
|
+
self._attempts++;
|
|
769
|
+
if (self._operationTimeoutCb) {
|
|
770
|
+
self._timeout = setTimeout(function() {
|
|
771
|
+
self._operationTimeoutCb(self._attempts);
|
|
772
|
+
}, self._operationTimeout);
|
|
773
|
+
if (self._options.unref) {
|
|
774
|
+
self._timeout.unref();
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
self._fn(self._attempts);
|
|
778
|
+
}, timeout);
|
|
779
|
+
if (this._options.unref) {
|
|
780
|
+
this._timer.unref();
|
|
781
|
+
}
|
|
782
|
+
return true;
|
|
783
|
+
};
|
|
784
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
785
|
+
this._fn = fn;
|
|
786
|
+
if (timeoutOps) {
|
|
787
|
+
if (timeoutOps.timeout) {
|
|
788
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
789
|
+
}
|
|
790
|
+
if (timeoutOps.cb) {
|
|
791
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
var self = this;
|
|
795
|
+
if (this._operationTimeoutCb) {
|
|
796
|
+
this._timeout = setTimeout(function() {
|
|
797
|
+
self._operationTimeoutCb();
|
|
798
|
+
}, self._operationTimeout);
|
|
799
|
+
}
|
|
800
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
801
|
+
this._fn(this._attempts);
|
|
802
|
+
};
|
|
803
|
+
RetryOperation.prototype.try = function(fn) {
|
|
804
|
+
console.log("Using RetryOperation.try() is deprecated");
|
|
805
|
+
this.attempt(fn);
|
|
806
|
+
};
|
|
807
|
+
RetryOperation.prototype.start = function(fn) {
|
|
808
|
+
console.log("Using RetryOperation.start() is deprecated");
|
|
809
|
+
this.attempt(fn);
|
|
810
|
+
};
|
|
811
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
812
|
+
RetryOperation.prototype.errors = function() {
|
|
813
|
+
return this._errors;
|
|
814
|
+
};
|
|
815
|
+
RetryOperation.prototype.attempts = function() {
|
|
816
|
+
return this._attempts;
|
|
817
|
+
};
|
|
818
|
+
RetryOperation.prototype.mainError = function() {
|
|
819
|
+
if (this._errors.length === 0) {
|
|
820
|
+
return null;
|
|
821
|
+
}
|
|
822
|
+
var counts = {};
|
|
823
|
+
var mainError = null;
|
|
824
|
+
var mainErrorCount = 0;
|
|
825
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
826
|
+
var error = this._errors[i];
|
|
827
|
+
var message = error.message;
|
|
828
|
+
var count = (counts[message] || 0) + 1;
|
|
829
|
+
counts[message] = count;
|
|
830
|
+
if (count >= mainErrorCount) {
|
|
831
|
+
mainError = error;
|
|
832
|
+
mainErrorCount = count;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return mainError;
|
|
836
|
+
};
|
|
871
837
|
}
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
const next = () => {
|
|
889
|
-
activeCount--;
|
|
890
|
-
resumeNext();
|
|
891
|
-
};
|
|
892
|
-
const run = async (function_, resolve, arguments_) => {
|
|
893
|
-
const result = (async () => function_(...arguments_))();
|
|
894
|
-
resolve(result);
|
|
895
|
-
try {
|
|
896
|
-
await result;
|
|
897
|
-
} catch (e) {
|
|
898
|
-
}
|
|
899
|
-
next();
|
|
900
|
-
};
|
|
901
|
-
const enqueue = (function_, resolve, arguments_) => {
|
|
902
|
-
new Promise((internalResolve) => {
|
|
903
|
-
queue.enqueue(internalResolve);
|
|
904
|
-
}).then(
|
|
905
|
-
run.bind(void 0, function_, resolve, arguments_)
|
|
906
|
-
);
|
|
907
|
-
(async () => {
|
|
908
|
-
await Promise.resolve();
|
|
909
|
-
if (activeCount < concurrency) {
|
|
910
|
-
resumeNext();
|
|
838
|
+
});
|
|
839
|
+
var require_retry = __commonJS2({
|
|
840
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
|
|
841
|
+
"use strict";
|
|
842
|
+
var RetryOperation = require_retry_operation();
|
|
843
|
+
exports.operation = function(options) {
|
|
844
|
+
var timeouts = exports.timeouts(options);
|
|
845
|
+
return new RetryOperation(timeouts, {
|
|
846
|
+
forever: options && (options.forever || options.retries === Infinity),
|
|
847
|
+
unref: options && options.unref,
|
|
848
|
+
maxRetryTime: options && options.maxRetryTime
|
|
849
|
+
});
|
|
850
|
+
};
|
|
851
|
+
exports.timeouts = function(options) {
|
|
852
|
+
if (options instanceof Array) {
|
|
853
|
+
return [].concat(options);
|
|
911
854
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
pendingCount: {
|
|
922
|
-
get: () => queue.size
|
|
923
|
-
},
|
|
924
|
-
clearQueue: {
|
|
925
|
-
value() {
|
|
926
|
-
queue.clear();
|
|
855
|
+
var opts = {
|
|
856
|
+
retries: 10,
|
|
857
|
+
factor: 2,
|
|
858
|
+
minTimeout: 1 * 1e3,
|
|
859
|
+
maxTimeout: Infinity,
|
|
860
|
+
randomize: false
|
|
861
|
+
};
|
|
862
|
+
for (var key in options) {
|
|
863
|
+
opts[key] = options[key];
|
|
927
864
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
865
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
866
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
867
|
+
}
|
|
868
|
+
var timeouts = [];
|
|
869
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
870
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
871
|
+
}
|
|
872
|
+
if (options && options.forever && !timeouts.length) {
|
|
873
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
874
|
+
}
|
|
875
|
+
timeouts.sort(function(a, b) {
|
|
876
|
+
return a - b;
|
|
877
|
+
});
|
|
878
|
+
return timeouts;
|
|
879
|
+
};
|
|
880
|
+
exports.createTimeout = function(attempt, opts) {
|
|
881
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
882
|
+
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
883
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
884
|
+
return timeout;
|
|
885
|
+
};
|
|
886
|
+
exports.wrap = function(obj, options, methods) {
|
|
887
|
+
if (options instanceof Array) {
|
|
888
|
+
methods = options;
|
|
889
|
+
options = null;
|
|
890
|
+
}
|
|
891
|
+
if (!methods) {
|
|
892
|
+
methods = [];
|
|
893
|
+
for (var key in obj) {
|
|
894
|
+
if (typeof obj[key] === "function") {
|
|
895
|
+
methods.push(key);
|
|
937
896
|
}
|
|
938
|
-
}
|
|
897
|
+
}
|
|
939
898
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
899
|
+
for (var i = 0; i < methods.length; i++) {
|
|
900
|
+
var method = methods[i];
|
|
901
|
+
var original = obj[method];
|
|
902
|
+
obj[method] = function retryWrapper(original2) {
|
|
903
|
+
var op = exports.operation(options);
|
|
904
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
905
|
+
var callback = args.pop();
|
|
906
|
+
args.push(function(err) {
|
|
907
|
+
if (op.retry(err)) {
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
if (err) {
|
|
911
|
+
arguments[0] = op.mainError();
|
|
912
|
+
}
|
|
913
|
+
callback.apply(this, arguments);
|
|
914
|
+
});
|
|
915
|
+
op.attempt(function() {
|
|
916
|
+
original2.apply(obj, args);
|
|
917
|
+
});
|
|
918
|
+
}.bind(obj, original);
|
|
919
|
+
obj[method].options = options;
|
|
920
|
+
}
|
|
921
|
+
};
|
|
947
922
|
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
var
|
|
956
|
-
var
|
|
957
|
-
|
|
923
|
+
});
|
|
924
|
+
var require_retry2 = __commonJS2({
|
|
925
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
926
|
+
"use strict";
|
|
927
|
+
module.exports = require_retry();
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
931
|
+
var import_retry = __toESM2(require_retry2(), 1);
|
|
932
|
+
var networkErrorMsgs = /* @__PURE__ */ new Set([
|
|
933
|
+
"Failed to fetch",
|
|
958
934
|
// Chrome
|
|
959
935
|
"NetworkError when attempting to fetch resource.",
|
|
960
936
|
// Firefox
|
|
961
937
|
"The Internet connection appears to be offline.",
|
|
962
|
-
// Safari
|
|
938
|
+
// Safari
|
|
963
939
|
"Network request failed",
|
|
964
940
|
// `cross-fetch`
|
|
965
|
-
"fetch failed"
|
|
941
|
+
"fetch failed"
|
|
966
942
|
// Undici (Node.js)
|
|
967
|
-
"terminated",
|
|
968
|
-
// Undici (Node.js)
|
|
969
|
-
" A network error occurred.",
|
|
970
|
-
// Bun (WebKit)
|
|
971
|
-
"Network connection lost"
|
|
972
|
-
// Cloudflare Workers (fetch)
|
|
973
943
|
]);
|
|
974
|
-
function isNetworkError(error) {
|
|
975
|
-
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
976
|
-
if (!isValid) {
|
|
977
|
-
return false;
|
|
978
|
-
}
|
|
979
|
-
const { message, stack } = error;
|
|
980
|
-
if (message === "Load failed" || message.startsWith("Load failed (") && message.endsWith(")")) {
|
|
981
|
-
return stack === void 0 || "__sentry_captured__" in error;
|
|
982
|
-
}
|
|
983
|
-
if (message.startsWith("error sending request for url")) {
|
|
984
|
-
return true;
|
|
985
|
-
}
|
|
986
|
-
if (message === "Failed to fetch" || message.startsWith("Failed to fetch (") && message.endsWith(")")) {
|
|
987
|
-
return true;
|
|
988
|
-
}
|
|
989
|
-
return errorMessages.has(message);
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
993
944
|
var AbortError = class extends Error {
|
|
994
945
|
constructor(message) {
|
|
995
946
|
super();
|
|
@@ -1010,71 +961,63 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
1010
961
|
error.retriesLeft = retriesLeft;
|
|
1011
962
|
return error;
|
|
1012
963
|
};
|
|
964
|
+
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
965
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
1013
966
|
async function pRetry(input, options) {
|
|
1014
967
|
return new Promise((resolve, reject) => {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
968
|
+
options = {
|
|
969
|
+
onFailedAttempt() {
|
|
970
|
+
},
|
|
971
|
+
retries: 10,
|
|
972
|
+
...options
|
|
1018
973
|
};
|
|
1019
|
-
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1020
|
-
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
1021
974
|
const operation = import_retry.default.operation(options);
|
|
1022
|
-
const abortHandler = () => {
|
|
1023
|
-
var _a2;
|
|
1024
|
-
operation.stop();
|
|
1025
|
-
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1026
|
-
};
|
|
1027
|
-
if (options.signal && !options.signal.aborted) {
|
|
1028
|
-
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1029
|
-
}
|
|
1030
|
-
const cleanUp = () => {
|
|
1031
|
-
var _a2;
|
|
1032
|
-
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1033
|
-
operation.stop();
|
|
1034
|
-
};
|
|
1035
975
|
operation.attempt(async (attemptNumber) => {
|
|
1036
976
|
try {
|
|
1037
|
-
|
|
1038
|
-
cleanUp();
|
|
1039
|
-
resolve(result);
|
|
977
|
+
resolve(await input(attemptNumber));
|
|
1040
978
|
} catch (error) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
979
|
+
if (!(error instanceof Error)) {
|
|
980
|
+
reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (error instanceof AbortError) {
|
|
984
|
+
operation.stop();
|
|
985
|
+
reject(error.originalError);
|
|
986
|
+
} else if (error instanceof TypeError && !isNetworkError(error.message)) {
|
|
987
|
+
operation.stop();
|
|
988
|
+
reject(error);
|
|
989
|
+
} else {
|
|
1051
990
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
991
|
+
try {
|
|
992
|
+
await options.onFailedAttempt(error);
|
|
993
|
+
} catch (error2) {
|
|
994
|
+
reject(error2);
|
|
995
|
+
return;
|
|
1055
996
|
}
|
|
1056
|
-
await options.onFailedAttempt(error);
|
|
1057
997
|
if (!operation.retry(error)) {
|
|
1058
|
-
|
|
998
|
+
reject(operation.mainError());
|
|
1059
999
|
}
|
|
1060
|
-
} catch (finalError) {
|
|
1061
|
-
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1062
|
-
cleanUp();
|
|
1063
|
-
reject(finalError);
|
|
1064
1000
|
}
|
|
1065
1001
|
}
|
|
1066
1002
|
});
|
|
1003
|
+
if (options.signal && !options.signal.aborted) {
|
|
1004
|
+
options.signal.addEventListener("abort", () => {
|
|
1005
|
+
operation.stop();
|
|
1006
|
+
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1007
|
+
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1008
|
+
}, {
|
|
1009
|
+
once: true
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1067
1012
|
});
|
|
1068
1013
|
}
|
|
1069
|
-
|
|
1070
|
-
// ../../node_modules/.pnpm/p-throttle@6.2.0/node_modules/p-throttle/index.js
|
|
1071
1014
|
var AbortError2 = class extends Error {
|
|
1072
1015
|
constructor() {
|
|
1073
1016
|
super("Throttled function aborted");
|
|
1074
1017
|
this.name = "AbortError";
|
|
1075
1018
|
}
|
|
1076
1019
|
};
|
|
1077
|
-
function pThrottle({ limit, interval, strict
|
|
1020
|
+
function pThrottle({ limit, interval, strict }) {
|
|
1078
1021
|
if (!Number.isFinite(limit)) {
|
|
1079
1022
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1080
1023
|
}
|
|
@@ -1102,38 +1045,32 @@ function pThrottle({ limit, interval, strict, onDelay }) {
|
|
|
1102
1045
|
const strictTicks = [];
|
|
1103
1046
|
function strictDelay() {
|
|
1104
1047
|
const now = Date.now();
|
|
1105
|
-
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1106
|
-
strictTicks.length = 0;
|
|
1107
|
-
}
|
|
1108
1048
|
if (strictTicks.length < limit) {
|
|
1109
1049
|
strictTicks.push(now);
|
|
1110
1050
|
return 0;
|
|
1111
1051
|
}
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1052
|
+
const earliestTime = strictTicks.shift() + interval;
|
|
1053
|
+
if (now >= earliestTime) {
|
|
1054
|
+
strictTicks.push(now);
|
|
1055
|
+
return 0;
|
|
1056
|
+
}
|
|
1057
|
+
strictTicks.push(earliestTime);
|
|
1058
|
+
return earliestTime - now;
|
|
1116
1059
|
}
|
|
1117
1060
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1118
1061
|
return (function_) => {
|
|
1119
|
-
const throttled = function(...
|
|
1062
|
+
const throttled = function(...args) {
|
|
1120
1063
|
if (!throttled.isEnabled) {
|
|
1121
|
-
return (async () => function_.apply(this,
|
|
1064
|
+
return (async () => function_.apply(this, args))();
|
|
1122
1065
|
}
|
|
1123
|
-
let
|
|
1066
|
+
let timeout;
|
|
1124
1067
|
return new Promise((resolve, reject) => {
|
|
1125
1068
|
const execute = () => {
|
|
1126
|
-
resolve(function_.apply(this,
|
|
1127
|
-
queue.delete(
|
|
1069
|
+
resolve(function_.apply(this, args));
|
|
1070
|
+
queue.delete(timeout);
|
|
1128
1071
|
};
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
timeoutId = setTimeout(execute, delay);
|
|
1132
|
-
queue.set(timeoutId, reject);
|
|
1133
|
-
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1134
|
-
} else {
|
|
1135
|
-
execute();
|
|
1136
|
-
}
|
|
1072
|
+
timeout = setTimeout(execute, getDelay());
|
|
1073
|
+
queue.set(timeout, reject);
|
|
1137
1074
|
});
|
|
1138
1075
|
};
|
|
1139
1076
|
throttled.abort = () => {
|
|
@@ -1145,29 +1082,16 @@ function pThrottle({ limit, interval, strict, onDelay }) {
|
|
|
1145
1082
|
strictTicks.splice(0, strictTicks.length);
|
|
1146
1083
|
};
|
|
1147
1084
|
throttled.isEnabled = true;
|
|
1148
|
-
Object.defineProperty(throttled, "queueSize", {
|
|
1149
|
-
get() {
|
|
1150
|
-
return queue.size;
|
|
1151
|
-
}
|
|
1152
|
-
});
|
|
1153
1085
|
return throttled;
|
|
1154
1086
|
};
|
|
1155
1087
|
}
|
|
1156
|
-
|
|
1157
|
-
// ../canvas/dist/index.mjs
|
|
1158
|
-
var __typeError3 = (msg) => {
|
|
1159
|
-
throw TypeError(msg);
|
|
1160
|
-
};
|
|
1161
|
-
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1162
|
-
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1163
|
-
var __privateAdd3 = (obj, member, value) => member.has(obj) ? __typeError3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1164
1088
|
function createLimitPolicy({
|
|
1165
1089
|
throttle = { interval: 1e3, limit: 10 },
|
|
1166
|
-
retry:
|
|
1090
|
+
retry: retry2 = { retries: 1, factor: 1.66 },
|
|
1167
1091
|
limit = 10
|
|
1168
1092
|
}) {
|
|
1169
1093
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1170
|
-
const limiter = limit ?
|
|
1094
|
+
const limiter = limit ? (0, import_p_limit2.default)(limit) : null;
|
|
1171
1095
|
return function limitPolicy(func) {
|
|
1172
1096
|
let currentFunc = async () => await func();
|
|
1173
1097
|
if (throttler) {
|
|
@@ -1178,13 +1102,13 @@ function createLimitPolicy({
|
|
|
1178
1102
|
const limitFunc = currentFunc;
|
|
1179
1103
|
currentFunc = () => limiter(limitFunc);
|
|
1180
1104
|
}
|
|
1181
|
-
if (
|
|
1105
|
+
if (retry2) {
|
|
1182
1106
|
const retryFunc = currentFunc;
|
|
1183
1107
|
currentFunc = () => pRetry(retryFunc, {
|
|
1184
|
-
...
|
|
1108
|
+
...retry2,
|
|
1185
1109
|
onFailedAttempt: async (error) => {
|
|
1186
|
-
if (
|
|
1187
|
-
await
|
|
1110
|
+
if (retry2.onFailedAttempt) {
|
|
1111
|
+
await retry2.onFailedAttempt(error);
|
|
1188
1112
|
}
|
|
1189
1113
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1190
1114
|
throw error;
|
|
@@ -1205,7 +1129,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1205
1129
|
}
|
|
1206
1130
|
getContentTypes(options) {
|
|
1207
1131
|
const { projectId } = this.options;
|
|
1208
|
-
const fetchUri = this.createUrl(
|
|
1132
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1209
1133
|
return this.apiClient(fetchUri);
|
|
1210
1134
|
}
|
|
1211
1135
|
getEntries(options) {
|
|
@@ -1213,11 +1137,11 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1213
1137
|
const { skipDataResolution, filters, ...params } = options;
|
|
1214
1138
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1215
1139
|
if (skipDataResolution) {
|
|
1216
|
-
const url = this.createUrl(
|
|
1140
|
+
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
1217
1141
|
return this.apiClient(url);
|
|
1218
1142
|
}
|
|
1219
1143
|
const edgeUrl = this.createUrl(
|
|
1220
|
-
|
|
1144
|
+
__privateGet2(_ContentClient2, _entriesUrl),
|
|
1221
1145
|
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1222
1146
|
this.edgeApiHost
|
|
1223
1147
|
);
|
|
@@ -1235,7 +1159,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1235
1159
|
return this.apiClient(historyUrl);
|
|
1236
1160
|
}
|
|
1237
1161
|
async upsertContentType(body, opts = {}) {
|
|
1238
|
-
const fetchUri = this.createUrl(
|
|
1162
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1239
1163
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1240
1164
|
delete body.contentType.slugSettings;
|
|
1241
1165
|
}
|
|
@@ -1247,7 +1171,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1247
1171
|
});
|
|
1248
1172
|
}
|
|
1249
1173
|
async upsertEntry(body, options) {
|
|
1250
|
-
const fetchUri = this.createUrl(
|
|
1174
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1251
1175
|
const headers = {};
|
|
1252
1176
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1253
1177
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1261,7 +1185,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1261
1185
|
return { modified: response.headers.get("x-modified-at") };
|
|
1262
1186
|
}
|
|
1263
1187
|
async deleteContentType(body) {
|
|
1264
|
-
const fetchUri = this.createUrl(
|
|
1188
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1265
1189
|
await this.apiClient(fetchUri, {
|
|
1266
1190
|
method: "DELETE",
|
|
1267
1191
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1269,7 +1193,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1269
1193
|
});
|
|
1270
1194
|
}
|
|
1271
1195
|
async deleteEntry(body) {
|
|
1272
|
-
const fetchUri = this.createUrl(
|
|
1196
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1273
1197
|
await this.apiClient(fetchUri, {
|
|
1274
1198
|
method: "DELETE",
|
|
1275
1199
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1288,8 +1212,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1288
1212
|
};
|
|
1289
1213
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1290
1214
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1291
|
-
|
|
1292
|
-
|
|
1215
|
+
__privateAdd2(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1216
|
+
__privateAdd2(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1293
1217
|
var _url8;
|
|
1294
1218
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1295
1219
|
constructor(options) {
|
|
@@ -1298,12 +1222,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1298
1222
|
/** Fetches all DataTypes for a project */
|
|
1299
1223
|
async get(options) {
|
|
1300
1224
|
const { projectId } = this.options;
|
|
1301
|
-
const fetchUri = this.createUrl(
|
|
1225
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1302
1226
|
return await this.apiClient(fetchUri);
|
|
1303
1227
|
}
|
|
1304
1228
|
/** Updates or creates (based on id) a DataType */
|
|
1305
1229
|
async upsert(body) {
|
|
1306
|
-
const fetchUri = this.createUrl(
|
|
1230
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1307
1231
|
await this.apiClient(fetchUri, {
|
|
1308
1232
|
method: "PUT",
|
|
1309
1233
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1312,7 +1236,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1312
1236
|
}
|
|
1313
1237
|
/** Deletes a DataType */
|
|
1314
1238
|
async remove(body) {
|
|
1315
|
-
const fetchUri = this.createUrl(
|
|
1239
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1316
1240
|
await this.apiClient(fetchUri, {
|
|
1317
1241
|
method: "DELETE",
|
|
1318
1242
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1321,7 +1245,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1321
1245
|
}
|
|
1322
1246
|
};
|
|
1323
1247
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1324
|
-
|
|
1248
|
+
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1325
1249
|
var CANVAS_DRAFT_STATE = 0;
|
|
1326
1250
|
var CANVAS_PUBLISHED_STATE = 64;
|
|
1327
1251
|
var CANVAS_EDITOR_STATE = 63;
|
|
@@ -1340,7 +1264,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1340
1264
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1341
1265
|
*/
|
|
1342
1266
|
get(options) {
|
|
1343
|
-
const fetchUri = this.createUrl(
|
|
1267
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1344
1268
|
...options,
|
|
1345
1269
|
teamId: this.teamId
|
|
1346
1270
|
});
|
|
@@ -1350,7 +1274,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1350
1274
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1351
1275
|
*/
|
|
1352
1276
|
async deploy(body) {
|
|
1353
|
-
const fetchUri = this.createUrl(
|
|
1277
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1354
1278
|
await this.apiClient(fetchUri, {
|
|
1355
1279
|
method: "PUT",
|
|
1356
1280
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1361,7 +1285,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1361
1285
|
* Removes a custom AI property editor from a Mesh app.
|
|
1362
1286
|
*/
|
|
1363
1287
|
async delete(body) {
|
|
1364
|
-
const fetchUri = this.createUrl(
|
|
1288
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1365
1289
|
await this.apiClient(fetchUri, {
|
|
1366
1290
|
method: "DELETE",
|
|
1367
1291
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1370,7 +1294,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1370
1294
|
}
|
|
1371
1295
|
};
|
|
1372
1296
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1373
|
-
|
|
1297
|
+
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1374
1298
|
var _url22;
|
|
1375
1299
|
var _projectsUrl;
|
|
1376
1300
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1379,7 +1303,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1379
1303
|
}
|
|
1380
1304
|
/** Fetches single Project */
|
|
1381
1305
|
async get(options) {
|
|
1382
|
-
const fetchUri = this.createUrl(
|
|
1306
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
|
|
1383
1307
|
return await this.apiClient(fetchUri);
|
|
1384
1308
|
}
|
|
1385
1309
|
/**
|
|
@@ -1388,12 +1312,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1388
1312
|
* When omitted, returns all accessible teams and their projects.
|
|
1389
1313
|
*/
|
|
1390
1314
|
async getProjects(options) {
|
|
1391
|
-
const fetchUri = this.createUrl(
|
|
1315
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1392
1316
|
return await this.apiClient(fetchUri);
|
|
1393
1317
|
}
|
|
1394
1318
|
/** Updates or creates (based on id) a Project */
|
|
1395
1319
|
async upsert(body) {
|
|
1396
|
-
const fetchUri = this.createUrl(
|
|
1320
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1397
1321
|
return await this.apiClient(fetchUri, {
|
|
1398
1322
|
method: "PUT",
|
|
1399
1323
|
body: JSON.stringify({ ...body })
|
|
@@ -1401,7 +1325,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1401
1325
|
}
|
|
1402
1326
|
/** Deletes a Project */
|
|
1403
1327
|
async delete(body) {
|
|
1404
|
-
const fetchUri = this.createUrl(
|
|
1328
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1405
1329
|
await this.apiClient(fetchUri, {
|
|
1406
1330
|
method: "DELETE",
|
|
1407
1331
|
body: JSON.stringify({ ...body }),
|
|
@@ -1411,8 +1335,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1411
1335
|
};
|
|
1412
1336
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1413
1337
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1414
|
-
|
|
1415
|
-
|
|
1338
|
+
__privateAdd2(_ProjectClient, _url22, "/api/v1/project");
|
|
1339
|
+
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1416
1340
|
var ROUTE_URL = "/api/v1/route";
|
|
1417
1341
|
var RouteClient = class extends ApiClient {
|
|
1418
1342
|
constructor(options) {
|
|
@@ -1626,7 +1550,7 @@ function createLimiter(concurrency) {
|
|
|
1626
1550
|
});
|
|
1627
1551
|
};
|
|
1628
1552
|
}
|
|
1629
|
-
async function
|
|
1553
|
+
async function retry(fn, options) {
|
|
1630
1554
|
let lastError;
|
|
1631
1555
|
let delay = 1e3;
|
|
1632
1556
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -1666,7 +1590,7 @@ function createLimitPolicy2({
|
|
|
1666
1590
|
}
|
|
1667
1591
|
if (retryOptions) {
|
|
1668
1592
|
const retryFunc = currentFunc;
|
|
1669
|
-
currentFunc = () =>
|
|
1593
|
+
currentFunc = () => retry(retryFunc, {
|
|
1670
1594
|
...retryOptions,
|
|
1671
1595
|
onFailedAttempt: async (error) => {
|
|
1672
1596
|
if (retryOptions.onFailedAttempt) {
|