@uniformdev/next-app-router 20.69.0 → 20.69.1-alpha.10
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 +556 -487
- package/dist/cache.mjs +556 -487
- package/dist/component.js +0 -366
- package/dist/component.mjs +0 -366
- package/dist/handler.js +655 -586
- package/dist/handler.mjs +655 -586
- package/dist/index.esm.js +655 -586
- package/dist/index.js +655 -586
- package/dist/index.mjs +655 -586
- package/dist/middleware.js +593 -531
- package/dist/middleware.mjs +593 -531
- package/package.json +8 -8
package/dist/handler.js
CHANGED
|
@@ -5,6 +5,10 @@ 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;
|
|
8
12
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
14
|
};
|
|
@@ -29,12 +33,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
33
|
mod
|
|
30
34
|
));
|
|
31
35
|
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
|
+
});
|
|
32
49
|
|
|
33
50
|
// ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
|
|
34
51
|
var require_yocto_queue = __commonJS({
|
|
35
52
|
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
|
|
36
53
|
"use strict";
|
|
37
|
-
var
|
|
54
|
+
var Node2 = class {
|
|
38
55
|
/// value;
|
|
39
56
|
/// next;
|
|
40
57
|
constructor(value) {
|
|
@@ -42,7 +59,7 @@ var require_yocto_queue = __commonJS({
|
|
|
42
59
|
this.next = void 0;
|
|
43
60
|
}
|
|
44
61
|
};
|
|
45
|
-
var
|
|
62
|
+
var Queue2 = class {
|
|
46
63
|
// TODO: Use private class fields when targeting Node.js 12.
|
|
47
64
|
// #_head;
|
|
48
65
|
// #_tail;
|
|
@@ -51,7 +68,7 @@ var require_yocto_queue = __commonJS({
|
|
|
51
68
|
this.clear();
|
|
52
69
|
}
|
|
53
70
|
enqueue(value) {
|
|
54
|
-
const node = new
|
|
71
|
+
const node = new Node2(value);
|
|
55
72
|
if (this._head) {
|
|
56
73
|
this._tail.next = node;
|
|
57
74
|
this._tail = node;
|
|
@@ -86,7 +103,7 @@ var require_yocto_queue = __commonJS({
|
|
|
86
103
|
}
|
|
87
104
|
}
|
|
88
105
|
};
|
|
89
|
-
module2.exports =
|
|
106
|
+
module2.exports = Queue2;
|
|
90
107
|
}
|
|
91
108
|
});
|
|
92
109
|
|
|
@@ -94,12 +111,12 @@ var require_yocto_queue = __commonJS({
|
|
|
94
111
|
var require_p_limit = __commonJS({
|
|
95
112
|
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
|
|
96
113
|
"use strict";
|
|
97
|
-
var
|
|
98
|
-
var
|
|
114
|
+
var Queue2 = require_yocto_queue();
|
|
115
|
+
var pLimit3 = (concurrency) => {
|
|
99
116
|
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
100
117
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
101
118
|
}
|
|
102
|
-
const queue = new
|
|
119
|
+
const queue = new Queue2();
|
|
103
120
|
let activeCount = 0;
|
|
104
121
|
const next = () => {
|
|
105
122
|
activeCount--;
|
|
@@ -144,7 +161,238 @@ var require_p_limit = __commonJS({
|
|
|
144
161
|
});
|
|
145
162
|
return generator;
|
|
146
163
|
};
|
|
147
|
-
module2.exports =
|
|
164
|
+
module2.exports = pLimit3;
|
|
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();
|
|
148
396
|
}
|
|
149
397
|
});
|
|
150
398
|
|
|
@@ -160,14 +408,14 @@ module.exports = __toCommonJS(handler_exports);
|
|
|
160
408
|
// ../context/dist/api/api.mjs
|
|
161
409
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
162
410
|
var __defProp2 = Object.defineProperty;
|
|
163
|
-
var
|
|
411
|
+
var __typeError2 = (msg) => {
|
|
164
412
|
throw TypeError(msg);
|
|
165
413
|
};
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
var
|
|
169
|
-
var
|
|
170
|
-
var
|
|
414
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
415
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
416
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
417
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
418
|
+
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);
|
|
171
419
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
172
420
|
var ApiClientError = class _ApiClientError extends Error {
|
|
173
421
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -186,7 +434,7 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
186
434
|
};
|
|
187
435
|
var ApiClient = class _ApiClient {
|
|
188
436
|
constructor(options) {
|
|
189
|
-
|
|
437
|
+
__publicField2(this, "options");
|
|
190
438
|
var _a, _b, _c, _d, _e;
|
|
191
439
|
if (!options.apiKey && !options.bearerToken) {
|
|
192
440
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -356,12 +604,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
356
604
|
/** Fetches all aggregates for a project */
|
|
357
605
|
async get(options) {
|
|
358
606
|
const { projectId } = this.options;
|
|
359
|
-
const fetchUri = this.createUrl(
|
|
607
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url), { ...options, projectId });
|
|
360
608
|
return await this.apiClient(fetchUri);
|
|
361
609
|
}
|
|
362
610
|
/** Updates or creates (based on id) an Aggregate */
|
|
363
611
|
async upsert(body) {
|
|
364
|
-
const fetchUri = this.createUrl(
|
|
612
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
365
613
|
await this.apiClient(fetchUri, {
|
|
366
614
|
method: "PUT",
|
|
367
615
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -370,7 +618,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
370
618
|
}
|
|
371
619
|
/** Deletes an Aggregate */
|
|
372
620
|
async remove(body) {
|
|
373
|
-
const fetchUri = this.createUrl(
|
|
621
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
374
622
|
await this.apiClient(fetchUri, {
|
|
375
623
|
method: "DELETE",
|
|
376
624
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -379,7 +627,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
379
627
|
}
|
|
380
628
|
};
|
|
381
629
|
_url = /* @__PURE__ */ new WeakMap();
|
|
382
|
-
|
|
630
|
+
__privateAdd2(_AggregateClient, _url, "/api/v2/aggregate");
|
|
383
631
|
var _url2;
|
|
384
632
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
385
633
|
constructor(options) {
|
|
@@ -388,12 +636,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
388
636
|
/** Fetches the known score dimensions for a project */
|
|
389
637
|
async get(options) {
|
|
390
638
|
const { projectId } = this.options;
|
|
391
|
-
const fetchUri = this.createUrl(
|
|
639
|
+
const fetchUri = this.createUrl(__privateGet2(_DimensionClient2, _url2), { ...options, projectId });
|
|
392
640
|
return await this.apiClient(fetchUri);
|
|
393
641
|
}
|
|
394
642
|
};
|
|
395
643
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
396
|
-
|
|
644
|
+
__privateAdd2(_DimensionClient, _url2, "/api/v2/dimension");
|
|
397
645
|
var _url3;
|
|
398
646
|
var _valueUrl;
|
|
399
647
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -403,12 +651,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
403
651
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
404
652
|
async get(options) {
|
|
405
653
|
const { projectId } = this.options;
|
|
406
|
-
const fetchUri = this.createUrl(
|
|
654
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
407
655
|
return await this.apiClient(fetchUri);
|
|
408
656
|
}
|
|
409
657
|
/** Updates or creates (based on id) an enrichment category */
|
|
410
658
|
async upsertCategory(body) {
|
|
411
|
-
const fetchUri = this.createUrl(
|
|
659
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
412
660
|
await this.apiClient(fetchUri, {
|
|
413
661
|
method: "PUT",
|
|
414
662
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -417,7 +665,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
417
665
|
}
|
|
418
666
|
/** Deletes an enrichment category */
|
|
419
667
|
async removeCategory(body) {
|
|
420
|
-
const fetchUri = this.createUrl(
|
|
668
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
421
669
|
await this.apiClient(fetchUri, {
|
|
422
670
|
method: "DELETE",
|
|
423
671
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -426,7 +674,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
426
674
|
}
|
|
427
675
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
428
676
|
async upsertValue(body) {
|
|
429
|
-
const fetchUri = this.createUrl(
|
|
677
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
430
678
|
await this.apiClient(fetchUri, {
|
|
431
679
|
method: "PUT",
|
|
432
680
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -435,7 +683,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
435
683
|
}
|
|
436
684
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
437
685
|
async removeValue(body) {
|
|
438
|
-
const fetchUri = this.createUrl(
|
|
686
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
439
687
|
await this.apiClient(fetchUri, {
|
|
440
688
|
method: "DELETE",
|
|
441
689
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -445,8 +693,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
445
693
|
};
|
|
446
694
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
447
695
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
448
|
-
|
|
449
|
-
|
|
696
|
+
__privateAdd2(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
697
|
+
__privateAdd2(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
450
698
|
var _url4;
|
|
451
699
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
452
700
|
constructor(options) {
|
|
@@ -455,7 +703,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
455
703
|
/** Fetches the Context manifest for a project */
|
|
456
704
|
async get(options) {
|
|
457
705
|
const { projectId } = this.options;
|
|
458
|
-
const fetchUri = this.createUrl(
|
|
706
|
+
const fetchUri = this.createUrl(__privateGet2(_ManifestClient2, _url4), { ...options, projectId });
|
|
459
707
|
return await this.apiClient(fetchUri);
|
|
460
708
|
}
|
|
461
709
|
/** Publishes the Context manifest for a project */
|
|
@@ -469,489 +717,283 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
469
717
|
}
|
|
470
718
|
};
|
|
471
719
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
472
|
-
|
|
720
|
+
__privateAdd2(_ManifestClient, _url4, "/api/v2/manifest");
|
|
473
721
|
var _url5;
|
|
474
722
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
475
723
|
constructor(options) {
|
|
476
724
|
super(options);
|
|
477
725
|
}
|
|
478
|
-
/** Fetches all Quirks for a project */
|
|
479
|
-
async get(options) {
|
|
480
|
-
const { projectId } = this.options;
|
|
481
|
-
const fetchUri = this.createUrl(
|
|
482
|
-
return await this.apiClient(fetchUri);
|
|
483
|
-
}
|
|
484
|
-
/** Updates or creates (based on id) a Quirk */
|
|
485
|
-
async upsert(body) {
|
|
486
|
-
const fetchUri = this.createUrl(
|
|
487
|
-
await this.apiClient(fetchUri, {
|
|
488
|
-
method: "PUT",
|
|
489
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
490
|
-
expectNoContent: true
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
/** Deletes a Quirk */
|
|
494
|
-
async remove(body) {
|
|
495
|
-
const fetchUri = this.createUrl(
|
|
496
|
-
await this.apiClient(fetchUri, {
|
|
497
|
-
method: "DELETE",
|
|
498
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
499
|
-
expectNoContent: true
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
_url5 = /* @__PURE__ */ new WeakMap();
|
|
504
|
-
|
|
505
|
-
var _url6;
|
|
506
|
-
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
507
|
-
constructor(options) {
|
|
508
|
-
super(options);
|
|
509
|
-
}
|
|
510
|
-
/** Fetches all Signals for a project */
|
|
511
|
-
async get(options) {
|
|
512
|
-
const { projectId } = this.options;
|
|
513
|
-
const fetchUri = this.createUrl(
|
|
514
|
-
return await this.apiClient(fetchUri);
|
|
515
|
-
}
|
|
516
|
-
/** Updates or creates (based on id) a Signal */
|
|
517
|
-
async upsert(body) {
|
|
518
|
-
const fetchUri = this.createUrl(
|
|
519
|
-
await this.apiClient(fetchUri, {
|
|
520
|
-
method: "PUT",
|
|
521
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
522
|
-
expectNoContent: true
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
/** Deletes a Signal */
|
|
526
|
-
async remove(body) {
|
|
527
|
-
const fetchUri = this.createUrl(
|
|
528
|
-
await this.apiClient(fetchUri, {
|
|
529
|
-
method: "DELETE",
|
|
530
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
531
|
-
expectNoContent: true
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
_url6 = /* @__PURE__ */ new WeakMap();
|
|
536
|
-
|
|
537
|
-
var _url7;
|
|
538
|
-
var _TestClient = class _TestClient2 extends ApiClient {
|
|
539
|
-
constructor(options) {
|
|
540
|
-
super(options);
|
|
541
|
-
}
|
|
542
|
-
/** Fetches all Tests for a project */
|
|
543
|
-
async get(options) {
|
|
544
|
-
const { projectId } = this.options;
|
|
545
|
-
const fetchUri = this.createUrl(
|
|
546
|
-
return await this.apiClient(fetchUri);
|
|
547
|
-
}
|
|
548
|
-
/** Updates or creates (based on id) a Test */
|
|
549
|
-
async upsert(body) {
|
|
550
|
-
const fetchUri = this.createUrl(
|
|
551
|
-
await this.apiClient(fetchUri, {
|
|
552
|
-
method: "PUT",
|
|
553
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
554
|
-
expectNoContent: true
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
/** Deletes a Test */
|
|
558
|
-
async remove(body) {
|
|
559
|
-
const fetchUri = this.createUrl(
|
|
560
|
-
await this.apiClient(fetchUri, {
|
|
561
|
-
method: "DELETE",
|
|
562
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
563
|
-
expectNoContent: true
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
_url7 = /* @__PURE__ */ new WeakMap();
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
//
|
|
571
|
-
var
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
)
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
dequeue()
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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;
|
|
714
|
-
}
|
|
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
|
-
}
|
|
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
|
-
};
|
|
848
|
-
}
|
|
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);
|
|
865
|
-
}
|
|
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];
|
|
875
|
-
}
|
|
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));
|
|
726
|
+
/** Fetches all Quirks for a project */
|
|
727
|
+
async get(options) {
|
|
728
|
+
const { projectId } = this.options;
|
|
729
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5), { ...options, projectId });
|
|
730
|
+
return await this.apiClient(fetchUri);
|
|
731
|
+
}
|
|
732
|
+
/** Updates or creates (based on id) a Quirk */
|
|
733
|
+
async upsert(body) {
|
|
734
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
735
|
+
await this.apiClient(fetchUri, {
|
|
736
|
+
method: "PUT",
|
|
737
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
738
|
+
expectNoContent: true
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
/** Deletes a Quirk */
|
|
742
|
+
async remove(body) {
|
|
743
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
744
|
+
await this.apiClient(fetchUri, {
|
|
745
|
+
method: "DELETE",
|
|
746
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
747
|
+
expectNoContent: true
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
_url5 = /* @__PURE__ */ new WeakMap();
|
|
752
|
+
__privateAdd2(_QuirkClient, _url5, "/api/v2/quirk");
|
|
753
|
+
var _url6;
|
|
754
|
+
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
755
|
+
constructor(options) {
|
|
756
|
+
super(options);
|
|
757
|
+
}
|
|
758
|
+
/** Fetches all Signals for a project */
|
|
759
|
+
async get(options) {
|
|
760
|
+
const { projectId } = this.options;
|
|
761
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6), { ...options, projectId });
|
|
762
|
+
return await this.apiClient(fetchUri);
|
|
763
|
+
}
|
|
764
|
+
/** Updates or creates (based on id) a Signal */
|
|
765
|
+
async upsert(body) {
|
|
766
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
767
|
+
await this.apiClient(fetchUri, {
|
|
768
|
+
method: "PUT",
|
|
769
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
770
|
+
expectNoContent: true
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
/** Deletes a Signal */
|
|
774
|
+
async remove(body) {
|
|
775
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
776
|
+
await this.apiClient(fetchUri, {
|
|
777
|
+
method: "DELETE",
|
|
778
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
779
|
+
expectNoContent: true
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
_url6 = /* @__PURE__ */ new WeakMap();
|
|
784
|
+
__privateAdd2(_SignalClient, _url6, "/api/v2/signal");
|
|
785
|
+
var _url7;
|
|
786
|
+
var _TestClient = class _TestClient2 extends ApiClient {
|
|
787
|
+
constructor(options) {
|
|
788
|
+
super(options);
|
|
789
|
+
}
|
|
790
|
+
/** Fetches all Tests for a project */
|
|
791
|
+
async get(options) {
|
|
792
|
+
const { projectId } = this.options;
|
|
793
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7), { ...options, projectId });
|
|
794
|
+
return await this.apiClient(fetchUri);
|
|
795
|
+
}
|
|
796
|
+
/** Updates or creates (based on id) a Test */
|
|
797
|
+
async upsert(body) {
|
|
798
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
799
|
+
await this.apiClient(fetchUri, {
|
|
800
|
+
method: "PUT",
|
|
801
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
802
|
+
expectNoContent: true
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
/** Deletes a Test */
|
|
806
|
+
async remove(body) {
|
|
807
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
808
|
+
await this.apiClient(fetchUri, {
|
|
809
|
+
method: "DELETE",
|
|
810
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
811
|
+
expectNoContent: true
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
_url7 = /* @__PURE__ */ new WeakMap();
|
|
816
|
+
__privateAdd2(_TestClient, _url7, "/api/v2/test");
|
|
817
|
+
|
|
818
|
+
// ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
819
|
+
var Node = class {
|
|
820
|
+
constructor(value) {
|
|
821
|
+
__publicField(this, "value");
|
|
822
|
+
__publicField(this, "next");
|
|
823
|
+
this.value = value;
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
var _head, _tail, _size;
|
|
827
|
+
var Queue = class {
|
|
828
|
+
constructor() {
|
|
829
|
+
__privateAdd(this, _head);
|
|
830
|
+
__privateAdd(this, _tail);
|
|
831
|
+
__privateAdd(this, _size);
|
|
832
|
+
this.clear();
|
|
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);
|
|
867
|
+
}
|
|
868
|
+
get size() {
|
|
869
|
+
return __privateGet(this, _size);
|
|
870
|
+
}
|
|
871
|
+
*[Symbol.iterator]() {
|
|
872
|
+
let current = __privateGet(this, _head);
|
|
873
|
+
while (current) {
|
|
874
|
+
yield current.value;
|
|
875
|
+
current = current.next;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
*drain() {
|
|
879
|
+
while (__privateGet(this, _head)) {
|
|
880
|
+
yield this.dequeue();
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
_head = new WeakMap();
|
|
885
|
+
_tail = new WeakMap();
|
|
886
|
+
_size = new WeakMap();
|
|
887
|
+
|
|
888
|
+
// ../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js
|
|
889
|
+
function pLimit2(concurrency) {
|
|
890
|
+
validateConcurrency(concurrency);
|
|
891
|
+
const queue = new Queue();
|
|
892
|
+
let activeCount = 0;
|
|
893
|
+
const resumeNext = () => {
|
|
894
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
895
|
+
queue.dequeue()();
|
|
896
|
+
activeCount++;
|
|
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();
|
|
885
922
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
923
|
+
})();
|
|
924
|
+
};
|
|
925
|
+
const generator = (function_, ...arguments_) => new Promise((resolve) => {
|
|
926
|
+
enqueue(function_, resolve, arguments_);
|
|
927
|
+
});
|
|
928
|
+
Object.defineProperties(generator, {
|
|
929
|
+
activeCount: {
|
|
930
|
+
get: () => activeCount
|
|
931
|
+
},
|
|
932
|
+
pendingCount: {
|
|
933
|
+
get: () => queue.size
|
|
934
|
+
},
|
|
935
|
+
clearQueue: {
|
|
936
|
+
value() {
|
|
937
|
+
queue.clear();
|
|
901
938
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
939
|
+
},
|
|
940
|
+
concurrency: {
|
|
941
|
+
get: () => concurrency,
|
|
942
|
+
set(newConcurrency) {
|
|
943
|
+
validateConcurrency(newConcurrency);
|
|
944
|
+
concurrency = newConcurrency;
|
|
945
|
+
queueMicrotask(() => {
|
|
946
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
947
|
+
resumeNext();
|
|
907
948
|
}
|
|
908
|
-
}
|
|
909
|
-
}
|
|
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;
|
|
949
|
+
});
|
|
931
950
|
}
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
return generator;
|
|
954
|
+
}
|
|
955
|
+
function validateConcurrency(concurrency) {
|
|
956
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
957
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
939
958
|
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
var
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
962
|
+
var import_retry = __toESM(require_retry2(), 1);
|
|
963
|
+
|
|
964
|
+
// ../../node_modules/.pnpm/is-network-error@1.1.0/node_modules/is-network-error/index.js
|
|
965
|
+
var objectToString = Object.prototype.toString;
|
|
966
|
+
var isError = (value) => objectToString.call(value) === "[object Error]";
|
|
967
|
+
var errorMessages = /* @__PURE__ */ new Set([
|
|
968
|
+
"network error",
|
|
969
|
+
// Chrome
|
|
944
970
|
"Failed to fetch",
|
|
945
971
|
// Chrome
|
|
946
972
|
"NetworkError when attempting to fetch resource.",
|
|
947
973
|
// Firefox
|
|
948
974
|
"The Internet connection appears to be offline.",
|
|
949
|
-
// Safari
|
|
975
|
+
// Safari 16
|
|
976
|
+
"Load failed",
|
|
977
|
+
// Safari 17+
|
|
950
978
|
"Network request failed",
|
|
951
979
|
// `cross-fetch`
|
|
952
|
-
"fetch failed"
|
|
980
|
+
"fetch failed",
|
|
981
|
+
// Undici (Node.js)
|
|
982
|
+
"terminated"
|
|
953
983
|
// Undici (Node.js)
|
|
954
984
|
]);
|
|
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
|
|
955
997
|
var AbortError = class extends Error {
|
|
956
998
|
constructor(message) {
|
|
957
999
|
super();
|
|
@@ -972,63 +1014,71 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
972
1014
|
error.retriesLeft = retriesLeft;
|
|
973
1015
|
return error;
|
|
974
1016
|
};
|
|
975
|
-
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
976
|
-
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
977
1017
|
async function pRetry(input, options) {
|
|
978
1018
|
return new Promise((resolve, reject) => {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
retries: 10,
|
|
983
|
-
...options
|
|
1019
|
+
var _a, _b, _c;
|
|
1020
|
+
options = { ...options };
|
|
1021
|
+
(_a = options.onFailedAttempt) != null ? _a : options.onFailedAttempt = () => {
|
|
984
1022
|
};
|
|
1023
|
+
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1024
|
+
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
985
1025
|
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
|
+
};
|
|
986
1039
|
operation.attempt(async (attemptNumber) => {
|
|
987
1040
|
try {
|
|
988
|
-
|
|
1041
|
+
const result = await input(attemptNumber);
|
|
1042
|
+
cleanUp();
|
|
1043
|
+
resolve(result);
|
|
989
1044
|
} catch (error) {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
} else {
|
|
1045
|
+
try {
|
|
1046
|
+
if (!(error instanceof Error)) {
|
|
1047
|
+
throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
|
|
1048
|
+
}
|
|
1049
|
+
if (error instanceof AbortError) {
|
|
1050
|
+
throw error.originalError;
|
|
1051
|
+
}
|
|
1052
|
+
if (error instanceof TypeError && !isNetworkError(error)) {
|
|
1053
|
+
throw error;
|
|
1054
|
+
}
|
|
1001
1055
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
reject(error2);
|
|
1006
|
-
return;
|
|
1056
|
+
if (!await options.shouldRetry(error)) {
|
|
1057
|
+
operation.stop();
|
|
1058
|
+
reject(error);
|
|
1007
1059
|
}
|
|
1060
|
+
await options.onFailedAttempt(error);
|
|
1008
1061
|
if (!operation.retry(error)) {
|
|
1009
|
-
|
|
1062
|
+
throw operation.mainError();
|
|
1010
1063
|
}
|
|
1064
|
+
} catch (finalError) {
|
|
1065
|
+
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1066
|
+
cleanUp();
|
|
1067
|
+
reject(finalError);
|
|
1011
1068
|
}
|
|
1012
1069
|
}
|
|
1013
1070
|
});
|
|
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
|
-
}
|
|
1023
1071
|
});
|
|
1024
1072
|
}
|
|
1073
|
+
|
|
1074
|
+
// ../../node_modules/.pnpm/p-throttle@6.2.0/node_modules/p-throttle/index.js
|
|
1025
1075
|
var AbortError2 = class extends Error {
|
|
1026
1076
|
constructor() {
|
|
1027
1077
|
super("Throttled function aborted");
|
|
1028
1078
|
this.name = "AbortError";
|
|
1029
1079
|
}
|
|
1030
1080
|
};
|
|
1031
|
-
function pThrottle({ limit, interval, strict }) {
|
|
1081
|
+
function pThrottle({ limit, interval, strict, onDelay }) {
|
|
1032
1082
|
if (!Number.isFinite(limit)) {
|
|
1033
1083
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1034
1084
|
}
|
|
@@ -1056,32 +1106,38 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1056
1106
|
const strictTicks = [];
|
|
1057
1107
|
function strictDelay() {
|
|
1058
1108
|
const now = Date.now();
|
|
1059
|
-
if (strictTicks.length
|
|
1060
|
-
strictTicks.
|
|
1061
|
-
return 0;
|
|
1109
|
+
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1110
|
+
strictTicks.length = 0;
|
|
1062
1111
|
}
|
|
1063
|
-
|
|
1064
|
-
if (now >= earliestTime) {
|
|
1112
|
+
if (strictTicks.length < limit) {
|
|
1065
1113
|
strictTicks.push(now);
|
|
1066
1114
|
return 0;
|
|
1067
1115
|
}
|
|
1068
|
-
strictTicks
|
|
1069
|
-
|
|
1116
|
+
const nextExecutionTime = strictTicks[0] + interval;
|
|
1117
|
+
strictTicks.shift();
|
|
1118
|
+
strictTicks.push(nextExecutionTime);
|
|
1119
|
+
return Math.max(0, nextExecutionTime - now);
|
|
1070
1120
|
}
|
|
1071
1121
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1072
1122
|
return (function_) => {
|
|
1073
|
-
const throttled = function(...
|
|
1123
|
+
const throttled = function(...arguments_) {
|
|
1074
1124
|
if (!throttled.isEnabled) {
|
|
1075
|
-
return (async () => function_.apply(this,
|
|
1125
|
+
return (async () => function_.apply(this, arguments_))();
|
|
1076
1126
|
}
|
|
1077
|
-
let
|
|
1127
|
+
let timeoutId;
|
|
1078
1128
|
return new Promise((resolve, reject) => {
|
|
1079
1129
|
const execute = () => {
|
|
1080
|
-
resolve(function_.apply(this,
|
|
1081
|
-
queue.delete(
|
|
1130
|
+
resolve(function_.apply(this, arguments_));
|
|
1131
|
+
queue.delete(timeoutId);
|
|
1082
1132
|
};
|
|
1083
|
-
|
|
1084
|
-
|
|
1133
|
+
const delay = getDelay();
|
|
1134
|
+
if (delay > 0) {
|
|
1135
|
+
timeoutId = setTimeout(execute, delay);
|
|
1136
|
+
queue.set(timeoutId, reject);
|
|
1137
|
+
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1138
|
+
} else {
|
|
1139
|
+
execute();
|
|
1140
|
+
}
|
|
1085
1141
|
});
|
|
1086
1142
|
};
|
|
1087
1143
|
throttled.abort = () => {
|
|
@@ -1093,16 +1149,29 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1093
1149
|
strictTicks.splice(0, strictTicks.length);
|
|
1094
1150
|
};
|
|
1095
1151
|
throttled.isEnabled = true;
|
|
1152
|
+
Object.defineProperty(throttled, "queueSize", {
|
|
1153
|
+
get() {
|
|
1154
|
+
return queue.size;
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1096
1157
|
return throttled;
|
|
1097
1158
|
};
|
|
1098
1159
|
}
|
|
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);
|
|
1099
1168
|
function createLimitPolicy({
|
|
1100
1169
|
throttle = { interval: 1e3, limit: 10 },
|
|
1101
|
-
retry:
|
|
1170
|
+
retry: retry3 = { retries: 1, factor: 1.66 },
|
|
1102
1171
|
limit = 10
|
|
1103
1172
|
}) {
|
|
1104
1173
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1105
|
-
const limiter = limit ? (
|
|
1174
|
+
const limiter = limit ? pLimit2(limit) : null;
|
|
1106
1175
|
return function limitPolicy(func) {
|
|
1107
1176
|
let currentFunc = async () => await func();
|
|
1108
1177
|
if (throttler) {
|
|
@@ -1113,13 +1182,13 @@ function createLimitPolicy({
|
|
|
1113
1182
|
const limitFunc = currentFunc;
|
|
1114
1183
|
currentFunc = () => limiter(limitFunc);
|
|
1115
1184
|
}
|
|
1116
|
-
if (
|
|
1185
|
+
if (retry3) {
|
|
1117
1186
|
const retryFunc = currentFunc;
|
|
1118
1187
|
currentFunc = () => pRetry(retryFunc, {
|
|
1119
|
-
...
|
|
1188
|
+
...retry3,
|
|
1120
1189
|
onFailedAttempt: async (error) => {
|
|
1121
|
-
if (
|
|
1122
|
-
await
|
|
1190
|
+
if (retry3.onFailedAttempt) {
|
|
1191
|
+
await retry3.onFailedAttempt(error);
|
|
1123
1192
|
}
|
|
1124
1193
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1125
1194
|
throw error;
|
|
@@ -1259,7 +1328,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1259
1328
|
}
|
|
1260
1329
|
getContentTypes(options) {
|
|
1261
1330
|
const { projectId } = this.options;
|
|
1262
|
-
const fetchUri = this.createUrl(
|
|
1331
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1263
1332
|
return this.apiClient(fetchUri);
|
|
1264
1333
|
}
|
|
1265
1334
|
getEntries(options) {
|
|
@@ -1267,11 +1336,11 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1267
1336
|
const { skipDataResolution, filters, ...params } = options;
|
|
1268
1337
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1269
1338
|
if (skipDataResolution) {
|
|
1270
|
-
const url = this.createUrl(
|
|
1339
|
+
const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
1271
1340
|
return this.apiClient(url);
|
|
1272
1341
|
}
|
|
1273
1342
|
const edgeUrl = this.createUrl(
|
|
1274
|
-
|
|
1343
|
+
__privateGet3(_ContentClient2, _entriesUrl),
|
|
1275
1344
|
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1276
1345
|
this.edgeApiHost
|
|
1277
1346
|
);
|
|
@@ -1289,7 +1358,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1289
1358
|
return this.apiClient(historyUrl);
|
|
1290
1359
|
}
|
|
1291
1360
|
async upsertContentType(body, opts = {}) {
|
|
1292
|
-
const fetchUri = this.createUrl(
|
|
1361
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1293
1362
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1294
1363
|
delete body.contentType.slugSettings;
|
|
1295
1364
|
}
|
|
@@ -1301,7 +1370,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1301
1370
|
});
|
|
1302
1371
|
}
|
|
1303
1372
|
async upsertEntry(body, options) {
|
|
1304
|
-
const fetchUri = this.createUrl(
|
|
1373
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1305
1374
|
const headers = {};
|
|
1306
1375
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1307
1376
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1315,7 +1384,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1315
1384
|
return { modified: response.headers.get("x-modified-at") };
|
|
1316
1385
|
}
|
|
1317
1386
|
async deleteContentType(body) {
|
|
1318
|
-
const fetchUri = this.createUrl(
|
|
1387
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1319
1388
|
await this.apiClient(fetchUri, {
|
|
1320
1389
|
method: "DELETE",
|
|
1321
1390
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1323,7 +1392,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1323
1392
|
});
|
|
1324
1393
|
}
|
|
1325
1394
|
async deleteEntry(body) {
|
|
1326
|
-
const fetchUri = this.createUrl(
|
|
1395
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1327
1396
|
await this.apiClient(fetchUri, {
|
|
1328
1397
|
method: "DELETE",
|
|
1329
1398
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1342,8 +1411,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1342
1411
|
};
|
|
1343
1412
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1344
1413
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1345
|
-
|
|
1346
|
-
|
|
1414
|
+
__privateAdd3(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1415
|
+
__privateAdd3(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1347
1416
|
var _url8;
|
|
1348
1417
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1349
1418
|
constructor(options) {
|
|
@@ -1352,12 +1421,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1352
1421
|
/** Fetches all DataTypes for a project */
|
|
1353
1422
|
async get(options) {
|
|
1354
1423
|
const { projectId } = this.options;
|
|
1355
|
-
const fetchUri = this.createUrl(
|
|
1424
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1356
1425
|
return await this.apiClient(fetchUri);
|
|
1357
1426
|
}
|
|
1358
1427
|
/** Updates or creates (based on id) a DataType */
|
|
1359
1428
|
async upsert(body) {
|
|
1360
|
-
const fetchUri = this.createUrl(
|
|
1429
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1361
1430
|
await this.apiClient(fetchUri, {
|
|
1362
1431
|
method: "PUT",
|
|
1363
1432
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1366,7 +1435,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1366
1435
|
}
|
|
1367
1436
|
/** Deletes a DataType */
|
|
1368
1437
|
async remove(body) {
|
|
1369
|
-
const fetchUri = this.createUrl(
|
|
1438
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1370
1439
|
await this.apiClient(fetchUri, {
|
|
1371
1440
|
method: "DELETE",
|
|
1372
1441
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1375,7 +1444,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1375
1444
|
}
|
|
1376
1445
|
};
|
|
1377
1446
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1378
|
-
|
|
1447
|
+
__privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1379
1448
|
var CANVAS_DRAFT_STATE = 0;
|
|
1380
1449
|
var CANVAS_EDITOR_STATE = 63;
|
|
1381
1450
|
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
@@ -1471,7 +1540,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1471
1540
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1472
1541
|
*/
|
|
1473
1542
|
get(options) {
|
|
1474
|
-
const fetchUri = this.createUrl(
|
|
1543
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1475
1544
|
...options,
|
|
1476
1545
|
teamId: this.teamId
|
|
1477
1546
|
});
|
|
@@ -1481,7 +1550,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1481
1550
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1482
1551
|
*/
|
|
1483
1552
|
async deploy(body) {
|
|
1484
|
-
const fetchUri = this.createUrl(
|
|
1553
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1485
1554
|
await this.apiClient(fetchUri, {
|
|
1486
1555
|
method: "PUT",
|
|
1487
1556
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1492,7 +1561,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1492
1561
|
* Removes a custom AI property editor from a Mesh app.
|
|
1493
1562
|
*/
|
|
1494
1563
|
async delete(body) {
|
|
1495
|
-
const fetchUri = this.createUrl(
|
|
1564
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1496
1565
|
await this.apiClient(fetchUri, {
|
|
1497
1566
|
method: "DELETE",
|
|
1498
1567
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1501,7 +1570,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1501
1570
|
}
|
|
1502
1571
|
};
|
|
1503
1572
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1504
|
-
|
|
1573
|
+
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1505
1574
|
var _url22;
|
|
1506
1575
|
var _projectsUrl;
|
|
1507
1576
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1510,7 +1579,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1510
1579
|
}
|
|
1511
1580
|
/** Fetches single Project */
|
|
1512
1581
|
async get(options) {
|
|
1513
|
-
const fetchUri = this.createUrl(
|
|
1582
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1514
1583
|
return await this.apiClient(fetchUri);
|
|
1515
1584
|
}
|
|
1516
1585
|
/**
|
|
@@ -1519,12 +1588,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1519
1588
|
* When omitted, returns all accessible teams and their projects.
|
|
1520
1589
|
*/
|
|
1521
1590
|
async getProjects(options) {
|
|
1522
|
-
const fetchUri = this.createUrl(
|
|
1591
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1523
1592
|
return await this.apiClient(fetchUri);
|
|
1524
1593
|
}
|
|
1525
1594
|
/** Updates or creates (based on id) a Project */
|
|
1526
1595
|
async upsert(body) {
|
|
1527
|
-
const fetchUri = this.createUrl(
|
|
1596
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1528
1597
|
return await this.apiClient(fetchUri, {
|
|
1529
1598
|
method: "PUT",
|
|
1530
1599
|
body: JSON.stringify({ ...body })
|
|
@@ -1532,7 +1601,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1532
1601
|
}
|
|
1533
1602
|
/** Deletes a Project */
|
|
1534
1603
|
async delete(body) {
|
|
1535
|
-
const fetchUri = this.createUrl(
|
|
1604
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1536
1605
|
await this.apiClient(fetchUri, {
|
|
1537
1606
|
method: "DELETE",
|
|
1538
1607
|
body: JSON.stringify({ ...body }),
|
|
@@ -1542,8 +1611,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1542
1611
|
};
|
|
1543
1612
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1544
1613
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1545
|
-
|
|
1546
|
-
|
|
1614
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1615
|
+
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1547
1616
|
var isAllowedReferrer = (referrer) => {
|
|
1548
1617
|
return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
|
|
1549
1618
|
};
|
|
@@ -1940,7 +2009,7 @@ function createLimiter(concurrency) {
|
|
|
1940
2009
|
});
|
|
1941
2010
|
};
|
|
1942
2011
|
}
|
|
1943
|
-
async function
|
|
2012
|
+
async function retry2(fn, options) {
|
|
1944
2013
|
let lastError;
|
|
1945
2014
|
let delay = 1e3;
|
|
1946
2015
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -1980,7 +2049,7 @@ function createLimitPolicy2({
|
|
|
1980
2049
|
}
|
|
1981
2050
|
if (retryOptions) {
|
|
1982
2051
|
const retryFunc = currentFunc;
|
|
1983
|
-
currentFunc = () =>
|
|
2052
|
+
currentFunc = () => retry2(retryFunc, {
|
|
1984
2053
|
...retryOptions,
|
|
1985
2054
|
onFailedAttempt: async (error) => {
|
|
1986
2055
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2054,14 +2123,14 @@ var getCanvasClient = (options) => {
|
|
|
2054
2123
|
var import_server_only2 = require("server-only");
|
|
2055
2124
|
|
|
2056
2125
|
// ../project-map/dist/index.mjs
|
|
2057
|
-
var
|
|
2126
|
+
var __typeError4 = (msg) => {
|
|
2058
2127
|
throw TypeError(msg);
|
|
2059
2128
|
};
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2064
|
-
var __privateMethod = (obj, member, method) => (
|
|
2129
|
+
var __accessCheck4 = (obj, member, msg) => member.has(obj) || __typeError4("Cannot " + msg);
|
|
2130
|
+
var __privateGet4 = (obj, member, getter) => (__accessCheck4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2131
|
+
var __privateAdd4 = (obj, member, value) => member.has(obj) ? __typeError4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2132
|
+
var __privateSet2 = (obj, member, value, setter) => (__accessCheck4(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2133
|
+
var __privateMethod = (obj, member, method) => (__accessCheck4(obj, member, "access private method"), method);
|
|
2065
2134
|
var ProjectMapClient = class extends ApiClient {
|
|
2066
2135
|
constructor(options) {
|
|
2067
2136
|
super(options);
|
|
@@ -2208,12 +2277,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2208
2277
|
var _Route = class _Route2 {
|
|
2209
2278
|
constructor(route) {
|
|
2210
2279
|
this.route = route;
|
|
2211
|
-
|
|
2280
|
+
__privateAdd4(this, _routeInfo);
|
|
2212
2281
|
var _a;
|
|
2213
|
-
|
|
2282
|
+
__privateSet2(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2214
2283
|
}
|
|
2215
2284
|
get dynamicSegmentCount() {
|
|
2216
|
-
return
|
|
2285
|
+
return __privateGet4(this, _routeInfo).segments.reduce(
|
|
2217
2286
|
(count, segment) => {
|
|
2218
2287
|
var _a;
|
|
2219
2288
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2225,7 +2294,7 @@ var _Route = class _Route2 {
|
|
|
2225
2294
|
matches(path) {
|
|
2226
2295
|
var _a, _b;
|
|
2227
2296
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2228
|
-
const { segments: routeSegments } =
|
|
2297
|
+
const { segments: routeSegments } = __privateGet4(this, _routeInfo);
|
|
2229
2298
|
if (pathSegments.length !== routeSegments.length) {
|
|
2230
2299
|
return { match: false };
|
|
2231
2300
|
}
|
|
@@ -2246,7 +2315,7 @@ var _Route = class _Route2 {
|
|
|
2246
2315
|
return { match: false };
|
|
2247
2316
|
}
|
|
2248
2317
|
}
|
|
2249
|
-
for (const [key, value] of
|
|
2318
|
+
for (const [key, value] of __privateGet4(this, _routeInfo).queryParams) {
|
|
2250
2319
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2251
2320
|
}
|
|
2252
2321
|
return possibleMatch;
|
|
@@ -2256,7 +2325,7 @@ var _Route = class _Route2 {
|
|
|
2256
2325
|
*/
|
|
2257
2326
|
expand(options) {
|
|
2258
2327
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2259
|
-
const path =
|
|
2328
|
+
const path = __privateGet4(this, _routeInfo).segments.map((segment) => {
|
|
2260
2329
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2261
2330
|
if (!dynamicSegmentName) {
|
|
2262
2331
|
return segment;
|
|
@@ -2307,7 +2376,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2307
2376
|
}
|
|
2308
2377
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2309
2378
|
};
|
|
2310
|
-
|
|
2379
|
+
__privateAdd4(_Route, _Route_static);
|
|
2311
2380
|
_Route.dynamicSegmentPrefix = ":";
|
|
2312
2381
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2313
2382
|
if (!doNotEscapeVariables) {
|