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