@uniformdev/next-app-router 20.61.2-alpha.4 → 20.62.1-alpha.4
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/handler.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
|
|
|
@@ -408,14 +160,14 @@ module.exports = __toCommonJS(handler_exports);
|
|
|
408
160
|
// ../context/dist/api/api.mjs
|
|
409
161
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
410
162
|
var __defProp2 = Object.defineProperty;
|
|
411
|
-
var
|
|
163
|
+
var __typeError = (msg) => {
|
|
412
164
|
throw TypeError(msg);
|
|
413
165
|
};
|
|
414
|
-
var
|
|
415
|
-
var
|
|
416
|
-
var
|
|
417
|
-
var
|
|
418
|
-
var
|
|
166
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
167
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
168
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
169
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
170
|
+
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);
|
|
419
171
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
420
172
|
var ApiClientError = class _ApiClientError extends Error {
|
|
421
173
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -434,7 +186,7 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
434
186
|
};
|
|
435
187
|
var ApiClient = class _ApiClient {
|
|
436
188
|
constructor(options) {
|
|
437
|
-
|
|
189
|
+
__publicField(this, "options");
|
|
438
190
|
var _a, _b, _c, _d, _e;
|
|
439
191
|
if (!options.apiKey && !options.bearerToken) {
|
|
440
192
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -604,12 +356,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
604
356
|
/** Fetches all aggregates for a project */
|
|
605
357
|
async get(options) {
|
|
606
358
|
const { projectId } = this.options;
|
|
607
|
-
const fetchUri = this.createUrl(
|
|
359
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
|
|
608
360
|
return await this.apiClient(fetchUri);
|
|
609
361
|
}
|
|
610
362
|
/** Updates or creates (based on id) an Aggregate */
|
|
611
363
|
async upsert(body) {
|
|
612
|
-
const fetchUri = this.createUrl(
|
|
364
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
613
365
|
await this.apiClient(fetchUri, {
|
|
614
366
|
method: "PUT",
|
|
615
367
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -618,7 +370,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
618
370
|
}
|
|
619
371
|
/** Deletes an Aggregate */
|
|
620
372
|
async remove(body) {
|
|
621
|
-
const fetchUri = this.createUrl(
|
|
373
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
622
374
|
await this.apiClient(fetchUri, {
|
|
623
375
|
method: "DELETE",
|
|
624
376
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -627,7 +379,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
627
379
|
}
|
|
628
380
|
};
|
|
629
381
|
_url = /* @__PURE__ */ new WeakMap();
|
|
630
|
-
|
|
382
|
+
__privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
|
|
631
383
|
var _url2;
|
|
632
384
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
633
385
|
constructor(options) {
|
|
@@ -636,12 +388,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
636
388
|
/** Fetches the known score dimensions for a project */
|
|
637
389
|
async get(options) {
|
|
638
390
|
const { projectId } = this.options;
|
|
639
|
-
const fetchUri = this.createUrl(
|
|
391
|
+
const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
|
|
640
392
|
return await this.apiClient(fetchUri);
|
|
641
393
|
}
|
|
642
394
|
};
|
|
643
395
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
644
|
-
|
|
396
|
+
__privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
|
|
645
397
|
var _url3;
|
|
646
398
|
var _valueUrl;
|
|
647
399
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -651,12 +403,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
651
403
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
652
404
|
async get(options) {
|
|
653
405
|
const { projectId } = this.options;
|
|
654
|
-
const fetchUri = this.createUrl(
|
|
406
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
655
407
|
return await this.apiClient(fetchUri);
|
|
656
408
|
}
|
|
657
409
|
/** Updates or creates (based on id) an enrichment category */
|
|
658
410
|
async upsertCategory(body) {
|
|
659
|
-
const fetchUri = this.createUrl(
|
|
411
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
660
412
|
await this.apiClient(fetchUri, {
|
|
661
413
|
method: "PUT",
|
|
662
414
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -665,7 +417,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
665
417
|
}
|
|
666
418
|
/** Deletes an enrichment category */
|
|
667
419
|
async removeCategory(body) {
|
|
668
|
-
const fetchUri = this.createUrl(
|
|
420
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
669
421
|
await this.apiClient(fetchUri, {
|
|
670
422
|
method: "DELETE",
|
|
671
423
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -674,7 +426,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
674
426
|
}
|
|
675
427
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
676
428
|
async upsertValue(body) {
|
|
677
|
-
const fetchUri = this.createUrl(
|
|
429
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
678
430
|
await this.apiClient(fetchUri, {
|
|
679
431
|
method: "PUT",
|
|
680
432
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -683,7 +435,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
683
435
|
}
|
|
684
436
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
685
437
|
async removeValue(body) {
|
|
686
|
-
const fetchUri = this.createUrl(
|
|
438
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
687
439
|
await this.apiClient(fetchUri, {
|
|
688
440
|
method: "DELETE",
|
|
689
441
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -693,8 +445,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
693
445
|
};
|
|
694
446
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
695
447
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
696
|
-
|
|
697
|
-
|
|
448
|
+
__privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
449
|
+
__privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
698
450
|
var _url4;
|
|
699
451
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
700
452
|
constructor(options) {
|
|
@@ -703,7 +455,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
703
455
|
/** Fetches the Context manifest for a project */
|
|
704
456
|
async get(options) {
|
|
705
457
|
const { projectId } = this.options;
|
|
706
|
-
const fetchUri = this.createUrl(
|
|
458
|
+
const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
|
|
707
459
|
return await this.apiClient(fetchUri);
|
|
708
460
|
}
|
|
709
461
|
/** Publishes the Context manifest for a project */
|
|
@@ -717,7 +469,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
717
469
|
}
|
|
718
470
|
};
|
|
719
471
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
720
|
-
|
|
472
|
+
__privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
|
|
721
473
|
var _url5;
|
|
722
474
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
723
475
|
constructor(options) {
|
|
@@ -726,12 +478,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
726
478
|
/** Fetches all Quirks for a project */
|
|
727
479
|
async get(options) {
|
|
728
480
|
const { projectId } = this.options;
|
|
729
|
-
const fetchUri = this.createUrl(
|
|
481
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
|
|
730
482
|
return await this.apiClient(fetchUri);
|
|
731
483
|
}
|
|
732
484
|
/** Updates or creates (based on id) a Quirk */
|
|
733
485
|
async upsert(body) {
|
|
734
|
-
const fetchUri = this.createUrl(
|
|
486
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
735
487
|
await this.apiClient(fetchUri, {
|
|
736
488
|
method: "PUT",
|
|
737
489
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -740,7 +492,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
740
492
|
}
|
|
741
493
|
/** Deletes a Quirk */
|
|
742
494
|
async remove(body) {
|
|
743
|
-
const fetchUri = this.createUrl(
|
|
495
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
744
496
|
await this.apiClient(fetchUri, {
|
|
745
497
|
method: "DELETE",
|
|
746
498
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -749,7 +501,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
749
501
|
}
|
|
750
502
|
};
|
|
751
503
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
752
|
-
|
|
504
|
+
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
753
505
|
var _url6;
|
|
754
506
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
755
507
|
constructor(options) {
|
|
@@ -758,12 +510,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
758
510
|
/** Fetches all Signals for a project */
|
|
759
511
|
async get(options) {
|
|
760
512
|
const { projectId } = this.options;
|
|
761
|
-
const fetchUri = this.createUrl(
|
|
513
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
762
514
|
return await this.apiClient(fetchUri);
|
|
763
515
|
}
|
|
764
516
|
/** Updates or creates (based on id) a Signal */
|
|
765
517
|
async upsert(body) {
|
|
766
|
-
const fetchUri = this.createUrl(
|
|
518
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
767
519
|
await this.apiClient(fetchUri, {
|
|
768
520
|
method: "PUT",
|
|
769
521
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -772,7 +524,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
772
524
|
}
|
|
773
525
|
/** Deletes a Signal */
|
|
774
526
|
async remove(body) {
|
|
775
|
-
const fetchUri = this.createUrl(
|
|
527
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
776
528
|
await this.apiClient(fetchUri, {
|
|
777
529
|
method: "DELETE",
|
|
778
530
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -781,7 +533,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
781
533
|
}
|
|
782
534
|
};
|
|
783
535
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
784
|
-
|
|
536
|
+
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
785
537
|
var _url7;
|
|
786
538
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
787
539
|
constructor(options) {
|
|
@@ -790,12 +542,12 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
790
542
|
/** Fetches all Tests for a project */
|
|
791
543
|
async get(options) {
|
|
792
544
|
const { projectId } = this.options;
|
|
793
|
-
const fetchUri = this.createUrl(
|
|
545
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
794
546
|
return await this.apiClient(fetchUri);
|
|
795
547
|
}
|
|
796
548
|
/** Updates or creates (based on id) a Test */
|
|
797
549
|
async upsert(body) {
|
|
798
|
-
const fetchUri = this.createUrl(
|
|
550
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
799
551
|
await this.apiClient(fetchUri, {
|
|
800
552
|
method: "PUT",
|
|
801
553
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -804,7 +556,7 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
804
556
|
}
|
|
805
557
|
/** Deletes a Test */
|
|
806
558
|
async remove(body) {
|
|
807
|
-
const fetchUri = this.createUrl(
|
|
559
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
808
560
|
await this.apiClient(fetchUri, {
|
|
809
561
|
method: "DELETE",
|
|
810
562
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -813,187 +565,393 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
813
565
|
}
|
|
814
566
|
};
|
|
815
567
|
_url7 = /* @__PURE__ */ new WeakMap();
|
|
816
|
-
|
|
568
|
+
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
817
569
|
|
|
818
|
-
//
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
570
|
+
// ../canvas/dist/index.mjs
|
|
571
|
+
var __create2 = Object.create;
|
|
572
|
+
var __defProp3 = Object.defineProperty;
|
|
573
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
574
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
575
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
576
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
577
|
+
var __typeError2 = (msg) => {
|
|
578
|
+
throw TypeError(msg);
|
|
825
579
|
};
|
|
826
|
-
var
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
enqueue(value) {
|
|
835
|
-
const node = new Node(value);
|
|
836
|
-
if (__privateGet(this, _head)) {
|
|
837
|
-
__privateGet(this, _tail).next = node;
|
|
838
|
-
__privateSet(this, _tail, node);
|
|
839
|
-
} else {
|
|
840
|
-
__privateSet(this, _head, node);
|
|
841
|
-
__privateSet(this, _tail, node);
|
|
842
|
-
}
|
|
843
|
-
__privateWrapper(this, _size)._++;
|
|
844
|
-
}
|
|
845
|
-
dequeue() {
|
|
846
|
-
const current = __privateGet(this, _head);
|
|
847
|
-
if (!current) {
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
851
|
-
__privateWrapper(this, _size)._--;
|
|
852
|
-
if (!__privateGet(this, _head)) {
|
|
853
|
-
__privateSet(this, _tail, void 0);
|
|
854
|
-
}
|
|
855
|
-
return current.value;
|
|
856
|
-
}
|
|
857
|
-
peek() {
|
|
858
|
-
if (!__privateGet(this, _head)) {
|
|
859
|
-
return;
|
|
860
|
-
}
|
|
861
|
-
return __privateGet(this, _head).value;
|
|
862
|
-
}
|
|
863
|
-
clear() {
|
|
864
|
-
__privateSet(this, _head, void 0);
|
|
865
|
-
__privateSet(this, _tail, void 0);
|
|
866
|
-
__privateSet(this, _size, 0);
|
|
580
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
581
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
582
|
+
};
|
|
583
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
584
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
585
|
+
for (let key of __getOwnPropNames2(from))
|
|
586
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
587
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
867
588
|
}
|
|
868
|
-
|
|
869
|
-
|
|
589
|
+
return to;
|
|
590
|
+
};
|
|
591
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
592
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
593
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
594
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
595
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
596
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
597
|
+
mod
|
|
598
|
+
));
|
|
599
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
600
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
601
|
+
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);
|
|
602
|
+
var require_yocto_queue2 = __commonJS2({
|
|
603
|
+
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
|
|
604
|
+
"use strict";
|
|
605
|
+
var Node = class {
|
|
606
|
+
/// value;
|
|
607
|
+
/// next;
|
|
608
|
+
constructor(value) {
|
|
609
|
+
this.value = value;
|
|
610
|
+
this.next = void 0;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
var Queue = class {
|
|
614
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
615
|
+
// #_head;
|
|
616
|
+
// #_tail;
|
|
617
|
+
// #_size;
|
|
618
|
+
constructor() {
|
|
619
|
+
this.clear();
|
|
620
|
+
}
|
|
621
|
+
enqueue(value) {
|
|
622
|
+
const node = new Node(value);
|
|
623
|
+
if (this._head) {
|
|
624
|
+
this._tail.next = node;
|
|
625
|
+
this._tail = node;
|
|
626
|
+
} else {
|
|
627
|
+
this._head = node;
|
|
628
|
+
this._tail = node;
|
|
629
|
+
}
|
|
630
|
+
this._size++;
|
|
631
|
+
}
|
|
632
|
+
dequeue() {
|
|
633
|
+
const current = this._head;
|
|
634
|
+
if (!current) {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
this._head = this._head.next;
|
|
638
|
+
this._size--;
|
|
639
|
+
return current.value;
|
|
640
|
+
}
|
|
641
|
+
clear() {
|
|
642
|
+
this._head = void 0;
|
|
643
|
+
this._tail = void 0;
|
|
644
|
+
this._size = 0;
|
|
645
|
+
}
|
|
646
|
+
get size() {
|
|
647
|
+
return this._size;
|
|
648
|
+
}
|
|
649
|
+
*[Symbol.iterator]() {
|
|
650
|
+
let current = this._head;
|
|
651
|
+
while (current) {
|
|
652
|
+
yield current.value;
|
|
653
|
+
current = current.next;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
module2.exports = Queue;
|
|
870
658
|
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
659
|
+
});
|
|
660
|
+
var require_p_limit2 = __commonJS2({
|
|
661
|
+
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
|
|
662
|
+
"use strict";
|
|
663
|
+
var Queue = require_yocto_queue2();
|
|
664
|
+
var pLimit2 = (concurrency) => {
|
|
665
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
666
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
667
|
+
}
|
|
668
|
+
const queue = new Queue();
|
|
669
|
+
let activeCount = 0;
|
|
670
|
+
const next = () => {
|
|
671
|
+
activeCount--;
|
|
672
|
+
if (queue.size > 0) {
|
|
673
|
+
queue.dequeue()();
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
const run = async (fn, resolve, ...args) => {
|
|
677
|
+
activeCount++;
|
|
678
|
+
const result = (async () => fn(...args))();
|
|
679
|
+
resolve(result);
|
|
680
|
+
try {
|
|
681
|
+
await result;
|
|
682
|
+
} catch (e) {
|
|
683
|
+
}
|
|
684
|
+
next();
|
|
685
|
+
};
|
|
686
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
687
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
688
|
+
(async () => {
|
|
689
|
+
await Promise.resolve();
|
|
690
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
691
|
+
queue.dequeue()();
|
|
692
|
+
}
|
|
693
|
+
})();
|
|
694
|
+
};
|
|
695
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
696
|
+
enqueue(fn, resolve, ...args);
|
|
697
|
+
});
|
|
698
|
+
Object.defineProperties(generator, {
|
|
699
|
+
activeCount: {
|
|
700
|
+
get: () => activeCount
|
|
701
|
+
},
|
|
702
|
+
pendingCount: {
|
|
703
|
+
get: () => queue.size
|
|
704
|
+
},
|
|
705
|
+
clearQueue: {
|
|
706
|
+
value: () => {
|
|
707
|
+
queue.clear();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
return generator;
|
|
712
|
+
};
|
|
713
|
+
module2.exports = pLimit2;
|
|
877
714
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
715
|
+
});
|
|
716
|
+
var require_retry_operation = __commonJS2({
|
|
717
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
718
|
+
"use strict";
|
|
719
|
+
function RetryOperation(timeouts, options) {
|
|
720
|
+
if (typeof options === "boolean") {
|
|
721
|
+
options = { forever: options };
|
|
722
|
+
}
|
|
723
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
724
|
+
this._timeouts = timeouts;
|
|
725
|
+
this._options = options || {};
|
|
726
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
727
|
+
this._fn = null;
|
|
728
|
+
this._errors = [];
|
|
729
|
+
this._attempts = 1;
|
|
730
|
+
this._operationTimeout = null;
|
|
731
|
+
this._operationTimeoutCb = null;
|
|
732
|
+
this._timeout = null;
|
|
733
|
+
this._operationStart = null;
|
|
734
|
+
this._timer = null;
|
|
735
|
+
if (this._options.forever) {
|
|
736
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
737
|
+
}
|
|
881
738
|
}
|
|
739
|
+
module2.exports = RetryOperation;
|
|
740
|
+
RetryOperation.prototype.reset = function() {
|
|
741
|
+
this._attempts = 1;
|
|
742
|
+
this._timeouts = this._originalTimeouts.slice(0);
|
|
743
|
+
};
|
|
744
|
+
RetryOperation.prototype.stop = function() {
|
|
745
|
+
if (this._timeout) {
|
|
746
|
+
clearTimeout(this._timeout);
|
|
747
|
+
}
|
|
748
|
+
if (this._timer) {
|
|
749
|
+
clearTimeout(this._timer);
|
|
750
|
+
}
|
|
751
|
+
this._timeouts = [];
|
|
752
|
+
this._cachedTimeouts = null;
|
|
753
|
+
};
|
|
754
|
+
RetryOperation.prototype.retry = function(err) {
|
|
755
|
+
if (this._timeout) {
|
|
756
|
+
clearTimeout(this._timeout);
|
|
757
|
+
}
|
|
758
|
+
if (!err) {
|
|
759
|
+
return false;
|
|
760
|
+
}
|
|
761
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
762
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
763
|
+
this._errors.push(err);
|
|
764
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
this._errors.push(err);
|
|
768
|
+
var timeout = this._timeouts.shift();
|
|
769
|
+
if (timeout === void 0) {
|
|
770
|
+
if (this._cachedTimeouts) {
|
|
771
|
+
this._errors.splice(0, this._errors.length - 1);
|
|
772
|
+
timeout = this._cachedTimeouts.slice(-1);
|
|
773
|
+
} else {
|
|
774
|
+
return false;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
var self = this;
|
|
778
|
+
this._timer = setTimeout(function() {
|
|
779
|
+
self._attempts++;
|
|
780
|
+
if (self._operationTimeoutCb) {
|
|
781
|
+
self._timeout = setTimeout(function() {
|
|
782
|
+
self._operationTimeoutCb(self._attempts);
|
|
783
|
+
}, self._operationTimeout);
|
|
784
|
+
if (self._options.unref) {
|
|
785
|
+
self._timeout.unref();
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
self._fn(self._attempts);
|
|
789
|
+
}, timeout);
|
|
790
|
+
if (this._options.unref) {
|
|
791
|
+
this._timer.unref();
|
|
792
|
+
}
|
|
793
|
+
return true;
|
|
794
|
+
};
|
|
795
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
796
|
+
this._fn = fn;
|
|
797
|
+
if (timeoutOps) {
|
|
798
|
+
if (timeoutOps.timeout) {
|
|
799
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
800
|
+
}
|
|
801
|
+
if (timeoutOps.cb) {
|
|
802
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
var self = this;
|
|
806
|
+
if (this._operationTimeoutCb) {
|
|
807
|
+
this._timeout = setTimeout(function() {
|
|
808
|
+
self._operationTimeoutCb();
|
|
809
|
+
}, self._operationTimeout);
|
|
810
|
+
}
|
|
811
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
812
|
+
this._fn(this._attempts);
|
|
813
|
+
};
|
|
814
|
+
RetryOperation.prototype.try = function(fn) {
|
|
815
|
+
console.log("Using RetryOperation.try() is deprecated");
|
|
816
|
+
this.attempt(fn);
|
|
817
|
+
};
|
|
818
|
+
RetryOperation.prototype.start = function(fn) {
|
|
819
|
+
console.log("Using RetryOperation.start() is deprecated");
|
|
820
|
+
this.attempt(fn);
|
|
821
|
+
};
|
|
822
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
823
|
+
RetryOperation.prototype.errors = function() {
|
|
824
|
+
return this._errors;
|
|
825
|
+
};
|
|
826
|
+
RetryOperation.prototype.attempts = function() {
|
|
827
|
+
return this._attempts;
|
|
828
|
+
};
|
|
829
|
+
RetryOperation.prototype.mainError = function() {
|
|
830
|
+
if (this._errors.length === 0) {
|
|
831
|
+
return null;
|
|
832
|
+
}
|
|
833
|
+
var counts = {};
|
|
834
|
+
var mainError = null;
|
|
835
|
+
var mainErrorCount = 0;
|
|
836
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
837
|
+
var error = this._errors[i];
|
|
838
|
+
var message = error.message;
|
|
839
|
+
var count = (counts[message] || 0) + 1;
|
|
840
|
+
counts[message] = count;
|
|
841
|
+
if (count >= mainErrorCount) {
|
|
842
|
+
mainError = error;
|
|
843
|
+
mainErrorCount = count;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return mainError;
|
|
847
|
+
};
|
|
882
848
|
}
|
|
883
|
-
};
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
const next = () => {
|
|
900
|
-
activeCount--;
|
|
901
|
-
resumeNext();
|
|
902
|
-
};
|
|
903
|
-
const run = async (function_, resolve, arguments_) => {
|
|
904
|
-
const result = (async () => function_(...arguments_))();
|
|
905
|
-
resolve(result);
|
|
906
|
-
try {
|
|
907
|
-
await result;
|
|
908
|
-
} catch (e) {
|
|
909
|
-
}
|
|
910
|
-
next();
|
|
911
|
-
};
|
|
912
|
-
const enqueue = (function_, resolve, arguments_) => {
|
|
913
|
-
new Promise((internalResolve) => {
|
|
914
|
-
queue.enqueue(internalResolve);
|
|
915
|
-
}).then(
|
|
916
|
-
run.bind(void 0, function_, resolve, arguments_)
|
|
917
|
-
);
|
|
918
|
-
(async () => {
|
|
919
|
-
await Promise.resolve();
|
|
920
|
-
if (activeCount < concurrency) {
|
|
921
|
-
resumeNext();
|
|
849
|
+
});
|
|
850
|
+
var require_retry = __commonJS2({
|
|
851
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports2) {
|
|
852
|
+
"use strict";
|
|
853
|
+
var RetryOperation = require_retry_operation();
|
|
854
|
+
exports2.operation = function(options) {
|
|
855
|
+
var timeouts = exports2.timeouts(options);
|
|
856
|
+
return new RetryOperation(timeouts, {
|
|
857
|
+
forever: options && (options.forever || options.retries === Infinity),
|
|
858
|
+
unref: options && options.unref,
|
|
859
|
+
maxRetryTime: options && options.maxRetryTime
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
exports2.timeouts = function(options) {
|
|
863
|
+
if (options instanceof Array) {
|
|
864
|
+
return [].concat(options);
|
|
922
865
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
pendingCount: {
|
|
933
|
-
get: () => queue.size
|
|
934
|
-
},
|
|
935
|
-
clearQueue: {
|
|
936
|
-
value() {
|
|
937
|
-
queue.clear();
|
|
866
|
+
var opts = {
|
|
867
|
+
retries: 10,
|
|
868
|
+
factor: 2,
|
|
869
|
+
minTimeout: 1 * 1e3,
|
|
870
|
+
maxTimeout: Infinity,
|
|
871
|
+
randomize: false
|
|
872
|
+
};
|
|
873
|
+
for (var key in options) {
|
|
874
|
+
opts[key] = options[key];
|
|
938
875
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
876
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
877
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
878
|
+
}
|
|
879
|
+
var timeouts = [];
|
|
880
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
881
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
882
|
+
}
|
|
883
|
+
if (options && options.forever && !timeouts.length) {
|
|
884
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
885
|
+
}
|
|
886
|
+
timeouts.sort(function(a, b) {
|
|
887
|
+
return a - b;
|
|
888
|
+
});
|
|
889
|
+
return timeouts;
|
|
890
|
+
};
|
|
891
|
+
exports2.createTimeout = function(attempt, opts) {
|
|
892
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
893
|
+
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
894
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
895
|
+
return timeout;
|
|
896
|
+
};
|
|
897
|
+
exports2.wrap = function(obj, options, methods) {
|
|
898
|
+
if (options instanceof Array) {
|
|
899
|
+
methods = options;
|
|
900
|
+
options = null;
|
|
901
|
+
}
|
|
902
|
+
if (!methods) {
|
|
903
|
+
methods = [];
|
|
904
|
+
for (var key in obj) {
|
|
905
|
+
if (typeof obj[key] === "function") {
|
|
906
|
+
methods.push(key);
|
|
948
907
|
}
|
|
949
|
-
}
|
|
908
|
+
}
|
|
950
909
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
910
|
+
for (var i = 0; i < methods.length; i++) {
|
|
911
|
+
var method = methods[i];
|
|
912
|
+
var original = obj[method];
|
|
913
|
+
obj[method] = function retryWrapper(original2) {
|
|
914
|
+
var op = exports2.operation(options);
|
|
915
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
916
|
+
var callback = args.pop();
|
|
917
|
+
args.push(function(err) {
|
|
918
|
+
if (op.retry(err)) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
if (err) {
|
|
922
|
+
arguments[0] = op.mainError();
|
|
923
|
+
}
|
|
924
|
+
callback.apply(this, arguments);
|
|
925
|
+
});
|
|
926
|
+
op.attempt(function() {
|
|
927
|
+
original2.apply(obj, args);
|
|
928
|
+
});
|
|
929
|
+
}.bind(obj, original);
|
|
930
|
+
obj[method].options = options;
|
|
931
|
+
}
|
|
932
|
+
};
|
|
958
933
|
}
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
var
|
|
967
|
-
var
|
|
968
|
-
|
|
969
|
-
// Chrome
|
|
934
|
+
});
|
|
935
|
+
var require_retry2 = __commonJS2({
|
|
936
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports2, module2) {
|
|
937
|
+
"use strict";
|
|
938
|
+
module2.exports = require_retry();
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
942
|
+
var import_retry = __toESM2(require_retry2(), 1);
|
|
943
|
+
var networkErrorMsgs = /* @__PURE__ */ new Set([
|
|
970
944
|
"Failed to fetch",
|
|
971
945
|
// Chrome
|
|
972
946
|
"NetworkError when attempting to fetch resource.",
|
|
973
947
|
// Firefox
|
|
974
948
|
"The Internet connection appears to be offline.",
|
|
975
|
-
// Safari
|
|
976
|
-
"Load failed",
|
|
977
|
-
// Safari 17+
|
|
949
|
+
// Safari
|
|
978
950
|
"Network request failed",
|
|
979
951
|
// `cross-fetch`
|
|
980
|
-
"fetch failed"
|
|
981
|
-
// Undici (Node.js)
|
|
982
|
-
"terminated"
|
|
952
|
+
"fetch failed"
|
|
983
953
|
// Undici (Node.js)
|
|
984
954
|
]);
|
|
985
|
-
function isNetworkError(error) {
|
|
986
|
-
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
987
|
-
if (!isValid) {
|
|
988
|
-
return false;
|
|
989
|
-
}
|
|
990
|
-
if (error.message === "Load failed") {
|
|
991
|
-
return error.stack === void 0;
|
|
992
|
-
}
|
|
993
|
-
return errorMessages.has(error.message);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
997
955
|
var AbortError = class extends Error {
|
|
998
956
|
constructor(message) {
|
|
999
957
|
super();
|
|
@@ -1014,68 +972,63 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
1014
972
|
error.retriesLeft = retriesLeft;
|
|
1015
973
|
return error;
|
|
1016
974
|
};
|
|
975
|
+
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
976
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
1017
977
|
async function pRetry(input, options) {
|
|
1018
978
|
return new Promise((resolve, reject) => {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
979
|
+
options = {
|
|
980
|
+
onFailedAttempt() {
|
|
981
|
+
},
|
|
982
|
+
retries: 10,
|
|
983
|
+
...options
|
|
1022
984
|
};
|
|
1023
|
-
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1024
|
-
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
1025
985
|
const operation = import_retry.default.operation(options);
|
|
1026
|
-
const abortHandler = () => {
|
|
1027
|
-
var _a2;
|
|
1028
|
-
operation.stop();
|
|
1029
|
-
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1030
|
-
};
|
|
1031
|
-
if (options.signal && !options.signal.aborted) {
|
|
1032
|
-
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1033
|
-
}
|
|
1034
|
-
const cleanUp = () => {
|
|
1035
|
-
var _a2;
|
|
1036
|
-
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1037
|
-
operation.stop();
|
|
1038
|
-
};
|
|
1039
986
|
operation.attempt(async (attemptNumber) => {
|
|
1040
987
|
try {
|
|
1041
|
-
|
|
1042
|
-
cleanUp();
|
|
1043
|
-
resolve(result);
|
|
988
|
+
resolve(await input(attemptNumber));
|
|
1044
989
|
} catch (error) {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
990
|
+
if (!(error instanceof Error)) {
|
|
991
|
+
reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
if (error instanceof AbortError) {
|
|
995
|
+
operation.stop();
|
|
996
|
+
reject(error.originalError);
|
|
997
|
+
} else if (error instanceof TypeError && !isNetworkError(error.message)) {
|
|
998
|
+
operation.stop();
|
|
999
|
+
reject(error);
|
|
1000
|
+
} else {
|
|
1055
1001
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1002
|
+
try {
|
|
1003
|
+
await options.onFailedAttempt(error);
|
|
1004
|
+
} catch (error2) {
|
|
1005
|
+
reject(error2);
|
|
1006
|
+
return;
|
|
1059
1007
|
}
|
|
1060
|
-
await options.onFailedAttempt(error);
|
|
1061
1008
|
if (!operation.retry(error)) {
|
|
1062
|
-
|
|
1009
|
+
reject(operation.mainError());
|
|
1063
1010
|
}
|
|
1064
|
-
} catch (finalError) {
|
|
1065
|
-
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1066
|
-
cleanUp();
|
|
1067
|
-
reject(finalError);
|
|
1068
1011
|
}
|
|
1069
1012
|
}
|
|
1070
1013
|
});
|
|
1014
|
+
if (options.signal && !options.signal.aborted) {
|
|
1015
|
+
options.signal.addEventListener("abort", () => {
|
|
1016
|
+
operation.stop();
|
|
1017
|
+
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1018
|
+
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1019
|
+
}, {
|
|
1020
|
+
once: true
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1071
1023
|
});
|
|
1072
1024
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1025
|
+
var AbortError2 = class extends Error {
|
|
1026
|
+
constructor() {
|
|
1027
|
+
super("Throttled function aborted");
|
|
1028
|
+
this.name = "AbortError";
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
function pThrottle({ limit, interval, strict }) {
|
|
1079
1032
|
if (!Number.isFinite(limit)) {
|
|
1080
1033
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1081
1034
|
}
|
|
@@ -1103,75 +1056,53 @@ function pThrottle({ limit, interval, strict, signal, onDelay }) {
|
|
|
1103
1056
|
const strictTicks = [];
|
|
1104
1057
|
function strictDelay() {
|
|
1105
1058
|
const now = Date.now();
|
|
1106
|
-
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1107
|
-
strictTicks.length = 0;
|
|
1108
|
-
}
|
|
1109
1059
|
if (strictTicks.length < limit) {
|
|
1110
1060
|
strictTicks.push(now);
|
|
1111
1061
|
return 0;
|
|
1112
1062
|
}
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1063
|
+
const earliestTime = strictTicks.shift() + interval;
|
|
1064
|
+
if (now >= earliestTime) {
|
|
1065
|
+
strictTicks.push(now);
|
|
1066
|
+
return 0;
|
|
1067
|
+
}
|
|
1068
|
+
strictTicks.push(earliestTime);
|
|
1069
|
+
return earliestTime - now;
|
|
1117
1070
|
}
|
|
1118
1071
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1119
1072
|
return (function_) => {
|
|
1120
|
-
const throttled = function(...
|
|
1073
|
+
const throttled = function(...args) {
|
|
1121
1074
|
if (!throttled.isEnabled) {
|
|
1122
|
-
return (async () => function_.apply(this,
|
|
1075
|
+
return (async () => function_.apply(this, args))();
|
|
1123
1076
|
}
|
|
1124
|
-
let
|
|
1077
|
+
let timeout;
|
|
1125
1078
|
return new Promise((resolve, reject) => {
|
|
1126
1079
|
const execute = () => {
|
|
1127
|
-
resolve(function_.apply(this,
|
|
1128
|
-
queue.delete(
|
|
1080
|
+
resolve(function_.apply(this, args));
|
|
1081
|
+
queue.delete(timeout);
|
|
1129
1082
|
};
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
timeoutId = setTimeout(execute, delay);
|
|
1133
|
-
queue.set(timeoutId, reject);
|
|
1134
|
-
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1135
|
-
} else {
|
|
1136
|
-
execute();
|
|
1137
|
-
}
|
|
1083
|
+
timeout = setTimeout(execute, getDelay());
|
|
1084
|
+
queue.set(timeout, reject);
|
|
1138
1085
|
});
|
|
1139
1086
|
};
|
|
1140
|
-
|
|
1087
|
+
throttled.abort = () => {
|
|
1141
1088
|
for (const timeout of queue.keys()) {
|
|
1142
1089
|
clearTimeout(timeout);
|
|
1143
|
-
queue.get(timeout)(
|
|
1090
|
+
queue.get(timeout)(new AbortError2());
|
|
1144
1091
|
}
|
|
1145
1092
|
queue.clear();
|
|
1146
1093
|
strictTicks.splice(0, strictTicks.length);
|
|
1147
1094
|
};
|
|
1148
|
-
registry.register(throttled, { signal, aborted });
|
|
1149
|
-
signal == null ? void 0 : signal.throwIfAborted();
|
|
1150
|
-
signal == null ? void 0 : signal.addEventListener("abort", aborted, { once: true });
|
|
1151
1095
|
throttled.isEnabled = true;
|
|
1152
|
-
Object.defineProperty(throttled, "queueSize", {
|
|
1153
|
-
get() {
|
|
1154
|
-
return queue.size;
|
|
1155
|
-
}
|
|
1156
|
-
});
|
|
1157
1096
|
return throttled;
|
|
1158
1097
|
};
|
|
1159
1098
|
}
|
|
1160
|
-
|
|
1161
|
-
// ../canvas/dist/index.mjs
|
|
1162
|
-
var __typeError3 = (msg) => {
|
|
1163
|
-
throw TypeError(msg);
|
|
1164
|
-
};
|
|
1165
|
-
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1166
|
-
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1167
|
-
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);
|
|
1168
1099
|
function createLimitPolicy({
|
|
1169
1100
|
throttle = { interval: 1e3, limit: 10 },
|
|
1170
|
-
retry:
|
|
1101
|
+
retry: retry2 = { retries: 1, factor: 1.66 },
|
|
1171
1102
|
limit = 10
|
|
1172
1103
|
}) {
|
|
1173
1104
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1174
|
-
const limiter = limit ?
|
|
1105
|
+
const limiter = limit ? (0, import_p_limit2.default)(limit) : null;
|
|
1175
1106
|
return function limitPolicy(func) {
|
|
1176
1107
|
let currentFunc = async () => await func();
|
|
1177
1108
|
if (throttler) {
|
|
@@ -1182,13 +1113,13 @@ function createLimitPolicy({
|
|
|
1182
1113
|
const limitFunc = currentFunc;
|
|
1183
1114
|
currentFunc = () => limiter(limitFunc);
|
|
1184
1115
|
}
|
|
1185
|
-
if (
|
|
1116
|
+
if (retry2) {
|
|
1186
1117
|
const retryFunc = currentFunc;
|
|
1187
1118
|
currentFunc = () => pRetry(retryFunc, {
|
|
1188
|
-
...
|
|
1119
|
+
...retry2,
|
|
1189
1120
|
onFailedAttempt: async (error) => {
|
|
1190
|
-
if (
|
|
1191
|
-
await
|
|
1121
|
+
if (retry2.onFailedAttempt) {
|
|
1122
|
+
await retry2.onFailedAttempt(error);
|
|
1192
1123
|
}
|
|
1193
1124
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1194
1125
|
throw error;
|
|
@@ -1328,7 +1259,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1328
1259
|
}
|
|
1329
1260
|
getContentTypes(options) {
|
|
1330
1261
|
const { projectId } = this.options;
|
|
1331
|
-
const fetchUri = this.createUrl(
|
|
1262
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1332
1263
|
return this.apiClient(fetchUri);
|
|
1333
1264
|
}
|
|
1334
1265
|
getEntries(options) {
|
|
@@ -1336,11 +1267,11 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1336
1267
|
const { skipDataResolution, filters, ...params } = options;
|
|
1337
1268
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1338
1269
|
if (skipDataResolution) {
|
|
1339
|
-
const url = this.createUrl(
|
|
1270
|
+
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
1340
1271
|
return this.apiClient(url);
|
|
1341
1272
|
}
|
|
1342
1273
|
const edgeUrl = this.createUrl(
|
|
1343
|
-
|
|
1274
|
+
__privateGet2(_ContentClient2, _entriesUrl),
|
|
1344
1275
|
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1345
1276
|
this.edgeApiHost
|
|
1346
1277
|
);
|
|
@@ -1358,7 +1289,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1358
1289
|
return this.apiClient(historyUrl);
|
|
1359
1290
|
}
|
|
1360
1291
|
async upsertContentType(body, opts = {}) {
|
|
1361
|
-
const fetchUri = this.createUrl(
|
|
1292
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1362
1293
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1363
1294
|
delete body.contentType.slugSettings;
|
|
1364
1295
|
}
|
|
@@ -1370,7 +1301,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1370
1301
|
});
|
|
1371
1302
|
}
|
|
1372
1303
|
async upsertEntry(body, options) {
|
|
1373
|
-
const fetchUri = this.createUrl(
|
|
1304
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1374
1305
|
const headers = {};
|
|
1375
1306
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1376
1307
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1384,7 +1315,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1384
1315
|
return { modified: response.headers.get("x-modified-at") };
|
|
1385
1316
|
}
|
|
1386
1317
|
async deleteContentType(body) {
|
|
1387
|
-
const fetchUri = this.createUrl(
|
|
1318
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1388
1319
|
await this.apiClient(fetchUri, {
|
|
1389
1320
|
method: "DELETE",
|
|
1390
1321
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1392,7 +1323,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1392
1323
|
});
|
|
1393
1324
|
}
|
|
1394
1325
|
async deleteEntry(body) {
|
|
1395
|
-
const fetchUri = this.createUrl(
|
|
1326
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1396
1327
|
await this.apiClient(fetchUri, {
|
|
1397
1328
|
method: "DELETE",
|
|
1398
1329
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1411,8 +1342,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1411
1342
|
};
|
|
1412
1343
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1413
1344
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1414
|
-
|
|
1415
|
-
|
|
1345
|
+
__privateAdd2(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1346
|
+
__privateAdd2(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1416
1347
|
var _url8;
|
|
1417
1348
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1418
1349
|
constructor(options) {
|
|
@@ -1421,12 +1352,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1421
1352
|
/** Fetches all DataTypes for a project */
|
|
1422
1353
|
async get(options) {
|
|
1423
1354
|
const { projectId } = this.options;
|
|
1424
|
-
const fetchUri = this.createUrl(
|
|
1355
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1425
1356
|
return await this.apiClient(fetchUri);
|
|
1426
1357
|
}
|
|
1427
1358
|
/** Updates or creates (based on id) a DataType */
|
|
1428
1359
|
async upsert(body) {
|
|
1429
|
-
const fetchUri = this.createUrl(
|
|
1360
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1430
1361
|
await this.apiClient(fetchUri, {
|
|
1431
1362
|
method: "PUT",
|
|
1432
1363
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1435,7 +1366,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1435
1366
|
}
|
|
1436
1367
|
/** Deletes a DataType */
|
|
1437
1368
|
async remove(body) {
|
|
1438
|
-
const fetchUri = this.createUrl(
|
|
1369
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1439
1370
|
await this.apiClient(fetchUri, {
|
|
1440
1371
|
method: "DELETE",
|
|
1441
1372
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1444,7 +1375,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1444
1375
|
}
|
|
1445
1376
|
};
|
|
1446
1377
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1447
|
-
|
|
1378
|
+
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1448
1379
|
var CANVAS_DRAFT_STATE = 0;
|
|
1449
1380
|
var CANVAS_EDITOR_STATE = 63;
|
|
1450
1381
|
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
@@ -1540,7 +1471,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1540
1471
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1541
1472
|
*/
|
|
1542
1473
|
get(options) {
|
|
1543
|
-
const fetchUri = this.createUrl(
|
|
1474
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1544
1475
|
...options,
|
|
1545
1476
|
teamId: this.teamId
|
|
1546
1477
|
});
|
|
@@ -1550,7 +1481,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1550
1481
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1551
1482
|
*/
|
|
1552
1483
|
async deploy(body) {
|
|
1553
|
-
const fetchUri = this.createUrl(
|
|
1484
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1554
1485
|
await this.apiClient(fetchUri, {
|
|
1555
1486
|
method: "PUT",
|
|
1556
1487
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1561,7 +1492,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1561
1492
|
* Removes a custom AI property editor from a Mesh app.
|
|
1562
1493
|
*/
|
|
1563
1494
|
async delete(body) {
|
|
1564
|
-
const fetchUri = this.createUrl(
|
|
1495
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1565
1496
|
await this.apiClient(fetchUri, {
|
|
1566
1497
|
method: "DELETE",
|
|
1567
1498
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1570,7 +1501,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1570
1501
|
}
|
|
1571
1502
|
};
|
|
1572
1503
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1573
|
-
|
|
1504
|
+
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1574
1505
|
var _url22;
|
|
1575
1506
|
var _projectsUrl;
|
|
1576
1507
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1579,7 +1510,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1579
1510
|
}
|
|
1580
1511
|
/** Fetches single Project */
|
|
1581
1512
|
async get(options) {
|
|
1582
|
-
const fetchUri = this.createUrl(
|
|
1513
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
|
|
1583
1514
|
return await this.apiClient(fetchUri);
|
|
1584
1515
|
}
|
|
1585
1516
|
/**
|
|
@@ -1588,12 +1519,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1588
1519
|
* When omitted, returns all accessible teams and their projects.
|
|
1589
1520
|
*/
|
|
1590
1521
|
async getProjects(options) {
|
|
1591
|
-
const fetchUri = this.createUrl(
|
|
1522
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1592
1523
|
return await this.apiClient(fetchUri);
|
|
1593
1524
|
}
|
|
1594
1525
|
/** Updates or creates (based on id) a Project */
|
|
1595
1526
|
async upsert(body) {
|
|
1596
|
-
const fetchUri = this.createUrl(
|
|
1527
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1597
1528
|
return await this.apiClient(fetchUri, {
|
|
1598
1529
|
method: "PUT",
|
|
1599
1530
|
body: JSON.stringify({ ...body })
|
|
@@ -1601,7 +1532,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1601
1532
|
}
|
|
1602
1533
|
/** Deletes a Project */
|
|
1603
1534
|
async delete(body) {
|
|
1604
|
-
const fetchUri = this.createUrl(
|
|
1535
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1605
1536
|
await this.apiClient(fetchUri, {
|
|
1606
1537
|
method: "DELETE",
|
|
1607
1538
|
body: JSON.stringify({ ...body }),
|
|
@@ -1611,8 +1542,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1611
1542
|
};
|
|
1612
1543
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1613
1544
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1614
|
-
|
|
1615
|
-
|
|
1545
|
+
__privateAdd2(_ProjectClient, _url22, "/api/v1/project");
|
|
1546
|
+
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1616
1547
|
var isAllowedReferrer = (referrer) => {
|
|
1617
1548
|
return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
|
|
1618
1549
|
};
|
|
@@ -2000,7 +1931,7 @@ function createLimiter(concurrency) {
|
|
|
2000
1931
|
});
|
|
2001
1932
|
};
|
|
2002
1933
|
}
|
|
2003
|
-
async function
|
|
1934
|
+
async function retry(fn, options) {
|
|
2004
1935
|
let lastError;
|
|
2005
1936
|
let delay = 1e3;
|
|
2006
1937
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -2040,7 +1971,7 @@ function createLimitPolicy2({
|
|
|
2040
1971
|
}
|
|
2041
1972
|
if (retryOptions) {
|
|
2042
1973
|
const retryFunc = currentFunc;
|
|
2043
|
-
currentFunc = () =>
|
|
1974
|
+
currentFunc = () => retry(retryFunc, {
|
|
2044
1975
|
...retryOptions,
|
|
2045
1976
|
onFailedAttempt: async (error) => {
|
|
2046
1977
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2114,14 +2045,14 @@ var getCanvasClient = (options) => {
|
|
|
2114
2045
|
var import_server_only2 = require("server-only");
|
|
2115
2046
|
|
|
2116
2047
|
// ../project-map/dist/index.mjs
|
|
2117
|
-
var
|
|
2048
|
+
var __typeError3 = (msg) => {
|
|
2118
2049
|
throw TypeError(msg);
|
|
2119
2050
|
};
|
|
2120
|
-
var
|
|
2121
|
-
var
|
|
2122
|
-
var
|
|
2123
|
-
var
|
|
2124
|
-
var __privateMethod = (obj, member, method) => (
|
|
2051
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
2052
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2053
|
+
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);
|
|
2054
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck3(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2055
|
+
var __privateMethod = (obj, member, method) => (__accessCheck3(obj, member, "access private method"), method);
|
|
2125
2056
|
var ProjectMapClient = class extends ApiClient {
|
|
2126
2057
|
constructor(options) {
|
|
2127
2058
|
super(options);
|
|
@@ -2268,12 +2199,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2268
2199
|
var _Route = class _Route2 {
|
|
2269
2200
|
constructor(route) {
|
|
2270
2201
|
this.route = route;
|
|
2271
|
-
|
|
2202
|
+
__privateAdd3(this, _routeInfo);
|
|
2272
2203
|
var _a;
|
|
2273
|
-
|
|
2204
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2274
2205
|
}
|
|
2275
2206
|
get dynamicSegmentCount() {
|
|
2276
|
-
return
|
|
2207
|
+
return __privateGet3(this, _routeInfo).segments.reduce(
|
|
2277
2208
|
(count, segment) => {
|
|
2278
2209
|
var _a;
|
|
2279
2210
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2285,7 +2216,7 @@ var _Route = class _Route2 {
|
|
|
2285
2216
|
matches(path) {
|
|
2286
2217
|
var _a, _b;
|
|
2287
2218
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2288
|
-
const { segments: routeSegments } =
|
|
2219
|
+
const { segments: routeSegments } = __privateGet3(this, _routeInfo);
|
|
2289
2220
|
if (pathSegments.length !== routeSegments.length) {
|
|
2290
2221
|
return { match: false };
|
|
2291
2222
|
}
|
|
@@ -2306,7 +2237,7 @@ var _Route = class _Route2 {
|
|
|
2306
2237
|
return { match: false };
|
|
2307
2238
|
}
|
|
2308
2239
|
}
|
|
2309
|
-
for (const [key, value] of
|
|
2240
|
+
for (const [key, value] of __privateGet3(this, _routeInfo).queryParams) {
|
|
2310
2241
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2311
2242
|
}
|
|
2312
2243
|
return possibleMatch;
|
|
@@ -2316,7 +2247,7 @@ var _Route = class _Route2 {
|
|
|
2316
2247
|
*/
|
|
2317
2248
|
expand(options) {
|
|
2318
2249
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2319
|
-
const path =
|
|
2250
|
+
const path = __privateGet3(this, _routeInfo).segments.map((segment) => {
|
|
2320
2251
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2321
2252
|
if (!dynamicSegmentName) {
|
|
2322
2253
|
return segment;
|
|
@@ -2367,7 +2298,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2367
2298
|
}
|
|
2368
2299
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2369
2300
|
};
|
|
2370
|
-
|
|
2301
|
+
__privateAdd3(_Route, _Route_static);
|
|
2371
2302
|
_Route.dynamicSegmentPrefix = ":";
|
|
2372
2303
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2373
2304
|
if (!doNotEscapeVariables) {
|