@uniformdev/next-app-router 20.50.2-alpha.149 → 20.50.2-alpha.180
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 +622 -497
- package/dist/cache.mjs +622 -497
- package/dist/component.js +51 -370
- package/dist/component.mjs +51 -370
- package/dist/handler.js +716 -586
- package/dist/handler.mjs +716 -586
- package/dist/index.esm.js +717 -585
- package/dist/index.js +720 -588
- package/dist/index.mjs +717 -585
- package/dist/middleware.js +661 -536
- package/dist/middleware.mjs +661 -536
- package/package.json +19 -19
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) {
|
|
@@ -175,18 +423,18 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
175
423
|
`${errorMessage}
|
|
176
424
|
${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
|
|
177
425
|
);
|
|
178
|
-
this
|
|
179
|
-
this
|
|
180
|
-
this
|
|
181
|
-
this
|
|
182
|
-
this
|
|
183
|
-
this
|
|
426
|
+
__publicField2(this, "errorMessage", errorMessage);
|
|
427
|
+
__publicField2(this, "fetchMethod", fetchMethod);
|
|
428
|
+
__publicField2(this, "fetchUri", fetchUri);
|
|
429
|
+
__publicField2(this, "statusCode", statusCode);
|
|
430
|
+
__publicField2(this, "statusText", statusText);
|
|
431
|
+
__publicField2(this, "requestId", requestId);
|
|
184
432
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
185
433
|
}
|
|
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,7 +717,7 @@ 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) {
|
|
@@ -478,480 +726,281 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
478
726
|
/** Fetches all Quirks for a project */
|
|
479
727
|
async get(options) {
|
|
480
728
|
const { projectId } = this.options;
|
|
481
|
-
const fetchUri = this.createUrl(
|
|
729
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5), { ...options, projectId });
|
|
482
730
|
return await this.apiClient(fetchUri);
|
|
483
731
|
}
|
|
484
732
|
/** Updates or creates (based on id) a Quirk */
|
|
485
733
|
async upsert(body) {
|
|
486
|
-
const fetchUri = this.createUrl(
|
|
734
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
487
735
|
await this.apiClient(fetchUri, {
|
|
488
736
|
method: "PUT",
|
|
489
737
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
490
738
|
expectNoContent: true
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
/** Deletes a Quirk */
|
|
494
|
-
async remove(body) {
|
|
495
|
-
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
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
|
-
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
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(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
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(__privateGet(_SignalClient2, _url6));
|
|
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(__privateGet(_SignalClient2, _url6));
|
|
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
|
-
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
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(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
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(__privateGet(_TestClient2, _url7));
|
|
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(__privateGet(_TestClient2, _url7));
|
|
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
|
-
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
569
|
-
|
|
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);
|
|
579
|
-
};
|
|
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 });
|
|
588
|
-
}
|
|
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;
|
|
658
|
-
}
|
|
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;
|
|
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
|
-
};
|
|
739
|
+
});
|
|
848
740
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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
|
|
944
|
-
|
|
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.3.2/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",
|
|
945
969
|
// Chrome
|
|
946
970
|
"NetworkError when attempting to fetch resource.",
|
|
947
971
|
// Firefox
|
|
948
972
|
"The Internet connection appears to be offline.",
|
|
949
|
-
// Safari
|
|
973
|
+
// Safari 16
|
|
950
974
|
"Network request failed",
|
|
951
975
|
// `cross-fetch`
|
|
952
|
-
"fetch failed"
|
|
976
|
+
"fetch failed",
|
|
953
977
|
// Undici (Node.js)
|
|
978
|
+
"terminated",
|
|
979
|
+
// Undici (Node.js)
|
|
980
|
+
" A network error occurred.",
|
|
981
|
+
// Bun (WebKit)
|
|
982
|
+
"Network connection lost"
|
|
983
|
+
// Cloudflare Workers (fetch)
|
|
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
|
+
const { message, stack } = error;
|
|
991
|
+
if (message === "Load failed" || message.startsWith("Load failed (") && message.endsWith(")")) {
|
|
992
|
+
return stack === void 0 || "__sentry_captured__" in error;
|
|
993
|
+
}
|
|
994
|
+
if (message.startsWith("error sending request for url")) {
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
if (message === "Failed to fetch" || message.startsWith("Failed to fetch (") && message.endsWith(")")) {
|
|
998
|
+
return true;
|
|
999
|
+
}
|
|
1000
|
+
return errorMessages.has(message);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
955
1004
|
var AbortError = class extends Error {
|
|
956
1005
|
constructor(message) {
|
|
957
1006
|
super();
|
|
@@ -972,63 +1021,71 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
972
1021
|
error.retriesLeft = retriesLeft;
|
|
973
1022
|
return error;
|
|
974
1023
|
};
|
|
975
|
-
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
976
|
-
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
977
1024
|
async function pRetry(input, options) {
|
|
978
1025
|
return new Promise((resolve, reject) => {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
retries: 10,
|
|
983
|
-
...options
|
|
1026
|
+
var _a, _b, _c;
|
|
1027
|
+
options = { ...options };
|
|
1028
|
+
(_a = options.onFailedAttempt) != null ? _a : options.onFailedAttempt = () => {
|
|
984
1029
|
};
|
|
1030
|
+
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1031
|
+
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
985
1032
|
const operation = import_retry.default.operation(options);
|
|
1033
|
+
const abortHandler = () => {
|
|
1034
|
+
var _a2;
|
|
1035
|
+
operation.stop();
|
|
1036
|
+
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1037
|
+
};
|
|
1038
|
+
if (options.signal && !options.signal.aborted) {
|
|
1039
|
+
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1040
|
+
}
|
|
1041
|
+
const cleanUp = () => {
|
|
1042
|
+
var _a2;
|
|
1043
|
+
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1044
|
+
operation.stop();
|
|
1045
|
+
};
|
|
986
1046
|
operation.attempt(async (attemptNumber) => {
|
|
987
1047
|
try {
|
|
988
|
-
|
|
1048
|
+
const result = await input(attemptNumber);
|
|
1049
|
+
cleanUp();
|
|
1050
|
+
resolve(result);
|
|
989
1051
|
} catch (error) {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
} else {
|
|
1052
|
+
try {
|
|
1053
|
+
if (!(error instanceof Error)) {
|
|
1054
|
+
throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
|
|
1055
|
+
}
|
|
1056
|
+
if (error instanceof AbortError) {
|
|
1057
|
+
throw error.originalError;
|
|
1058
|
+
}
|
|
1059
|
+
if (error instanceof TypeError && !isNetworkError(error)) {
|
|
1060
|
+
throw error;
|
|
1061
|
+
}
|
|
1001
1062
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
reject(error2);
|
|
1006
|
-
return;
|
|
1063
|
+
if (!await options.shouldRetry(error)) {
|
|
1064
|
+
operation.stop();
|
|
1065
|
+
reject(error);
|
|
1007
1066
|
}
|
|
1067
|
+
await options.onFailedAttempt(error);
|
|
1008
1068
|
if (!operation.retry(error)) {
|
|
1009
|
-
|
|
1069
|
+
throw operation.mainError();
|
|
1010
1070
|
}
|
|
1071
|
+
} catch (finalError) {
|
|
1072
|
+
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1073
|
+
cleanUp();
|
|
1074
|
+
reject(finalError);
|
|
1011
1075
|
}
|
|
1012
1076
|
}
|
|
1013
1077
|
});
|
|
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
1078
|
});
|
|
1024
1079
|
}
|
|
1080
|
+
|
|
1081
|
+
// ../../node_modules/.pnpm/p-throttle@6.2.0/node_modules/p-throttle/index.js
|
|
1025
1082
|
var AbortError2 = class extends Error {
|
|
1026
1083
|
constructor() {
|
|
1027
1084
|
super("Throttled function aborted");
|
|
1028
1085
|
this.name = "AbortError";
|
|
1029
1086
|
}
|
|
1030
1087
|
};
|
|
1031
|
-
function pThrottle({ limit, interval, strict }) {
|
|
1088
|
+
function pThrottle({ limit, interval, strict, onDelay }) {
|
|
1032
1089
|
if (!Number.isFinite(limit)) {
|
|
1033
1090
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1034
1091
|
}
|
|
@@ -1056,32 +1113,38 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1056
1113
|
const strictTicks = [];
|
|
1057
1114
|
function strictDelay() {
|
|
1058
1115
|
const now = Date.now();
|
|
1059
|
-
if (strictTicks.length
|
|
1060
|
-
strictTicks.
|
|
1061
|
-
return 0;
|
|
1116
|
+
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1117
|
+
strictTicks.length = 0;
|
|
1062
1118
|
}
|
|
1063
|
-
|
|
1064
|
-
if (now >= earliestTime) {
|
|
1119
|
+
if (strictTicks.length < limit) {
|
|
1065
1120
|
strictTicks.push(now);
|
|
1066
1121
|
return 0;
|
|
1067
1122
|
}
|
|
1068
|
-
strictTicks
|
|
1069
|
-
|
|
1123
|
+
const nextExecutionTime = strictTicks[0] + interval;
|
|
1124
|
+
strictTicks.shift();
|
|
1125
|
+
strictTicks.push(nextExecutionTime);
|
|
1126
|
+
return Math.max(0, nextExecutionTime - now);
|
|
1070
1127
|
}
|
|
1071
1128
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1072
1129
|
return (function_) => {
|
|
1073
|
-
const throttled = function(...
|
|
1130
|
+
const throttled = function(...arguments_) {
|
|
1074
1131
|
if (!throttled.isEnabled) {
|
|
1075
|
-
return (async () => function_.apply(this,
|
|
1132
|
+
return (async () => function_.apply(this, arguments_))();
|
|
1076
1133
|
}
|
|
1077
|
-
let
|
|
1134
|
+
let timeoutId;
|
|
1078
1135
|
return new Promise((resolve, reject) => {
|
|
1079
1136
|
const execute = () => {
|
|
1080
|
-
resolve(function_.apply(this,
|
|
1081
|
-
queue.delete(
|
|
1137
|
+
resolve(function_.apply(this, arguments_));
|
|
1138
|
+
queue.delete(timeoutId);
|
|
1082
1139
|
};
|
|
1083
|
-
|
|
1084
|
-
|
|
1140
|
+
const delay = getDelay();
|
|
1141
|
+
if (delay > 0) {
|
|
1142
|
+
timeoutId = setTimeout(execute, delay);
|
|
1143
|
+
queue.set(timeoutId, reject);
|
|
1144
|
+
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1145
|
+
} else {
|
|
1146
|
+
execute();
|
|
1147
|
+
}
|
|
1085
1148
|
});
|
|
1086
1149
|
};
|
|
1087
1150
|
throttled.abort = () => {
|
|
@@ -1093,16 +1156,29 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1093
1156
|
strictTicks.splice(0, strictTicks.length);
|
|
1094
1157
|
};
|
|
1095
1158
|
throttled.isEnabled = true;
|
|
1159
|
+
Object.defineProperty(throttled, "queueSize", {
|
|
1160
|
+
get() {
|
|
1161
|
+
return queue.size;
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1096
1164
|
return throttled;
|
|
1097
1165
|
};
|
|
1098
1166
|
}
|
|
1167
|
+
|
|
1168
|
+
// ../canvas/dist/index.mjs
|
|
1169
|
+
var __typeError3 = (msg) => {
|
|
1170
|
+
throw TypeError(msg);
|
|
1171
|
+
};
|
|
1172
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1173
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1174
|
+
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
1175
|
function createLimitPolicy({
|
|
1100
1176
|
throttle = { interval: 1e3, limit: 10 },
|
|
1101
|
-
retry:
|
|
1177
|
+
retry: retry3 = { retries: 1, factor: 1.66 },
|
|
1102
1178
|
limit = 10
|
|
1103
1179
|
}) {
|
|
1104
1180
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1105
|
-
const limiter = limit ? (
|
|
1181
|
+
const limiter = limit ? pLimit2(limit) : null;
|
|
1106
1182
|
return function limitPolicy(func) {
|
|
1107
1183
|
let currentFunc = async () => await func();
|
|
1108
1184
|
if (throttler) {
|
|
@@ -1113,13 +1189,13 @@ function createLimitPolicy({
|
|
|
1113
1189
|
const limitFunc = currentFunc;
|
|
1114
1190
|
currentFunc = () => limiter(limitFunc);
|
|
1115
1191
|
}
|
|
1116
|
-
if (
|
|
1192
|
+
if (retry3) {
|
|
1117
1193
|
const retryFunc = currentFunc;
|
|
1118
1194
|
currentFunc = () => pRetry(retryFunc, {
|
|
1119
|
-
...
|
|
1195
|
+
...retry3,
|
|
1120
1196
|
onFailedAttempt: async (error) => {
|
|
1121
|
-
if (
|
|
1122
|
-
await
|
|
1197
|
+
if (retry3.onFailedAttempt) {
|
|
1198
|
+
await retry3.onFailedAttempt(error);
|
|
1123
1199
|
}
|
|
1124
1200
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1125
1201
|
throw error;
|
|
@@ -1130,6 +1206,47 @@ function createLimitPolicy({
|
|
|
1130
1206
|
return currentFunc();
|
|
1131
1207
|
};
|
|
1132
1208
|
}
|
|
1209
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
1210
|
+
function appendCsv(out, key, values) {
|
|
1211
|
+
if (values === void 0) {
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
out[key] = values.join(",");
|
|
1215
|
+
}
|
|
1216
|
+
function projectionToQuery(spec) {
|
|
1217
|
+
const out = {};
|
|
1218
|
+
if (!spec) {
|
|
1219
|
+
return out;
|
|
1220
|
+
}
|
|
1221
|
+
const { fields, fieldTypes, slots } = spec;
|
|
1222
|
+
const p = SELECT_QUERY_PREFIX;
|
|
1223
|
+
if (fields) {
|
|
1224
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
1225
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
1226
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
1227
|
+
}
|
|
1228
|
+
if (fieldTypes) {
|
|
1229
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
1230
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
1231
|
+
}
|
|
1232
|
+
if (slots) {
|
|
1233
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
1234
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
1235
|
+
if (typeof slots.depth === "number") {
|
|
1236
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
1237
|
+
}
|
|
1238
|
+
if (slots.named) {
|
|
1239
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
1240
|
+
for (const slotName of slotNames) {
|
|
1241
|
+
const named = slots.named[slotName];
|
|
1242
|
+
if (named && typeof named.depth === "number") {
|
|
1243
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
return out;
|
|
1249
|
+
}
|
|
1133
1250
|
var CANVAS_URL = "/api/v1/canvas";
|
|
1134
1251
|
var CanvasClient = class extends ApiClient {
|
|
1135
1252
|
constructor(options) {
|
|
@@ -1144,17 +1261,24 @@ var CanvasClient = class extends ApiClient {
|
|
|
1144
1261
|
/** Fetches lists of Canvas compositions, optionally by type */
|
|
1145
1262
|
async getCompositionList(params = {}) {
|
|
1146
1263
|
const { projectId } = this.options;
|
|
1147
|
-
const { resolveData, filters, ...originParams } = params;
|
|
1264
|
+
const { resolveData, filters, select, ...originParams } = params;
|
|
1148
1265
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1266
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1149
1267
|
if (!resolveData) {
|
|
1150
|
-
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1268
|
+
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1269
|
+
...originParams,
|
|
1270
|
+
projectId,
|
|
1271
|
+
...rewrittenFilters,
|
|
1272
|
+
...rewrittenSelect
|
|
1273
|
+
});
|
|
1151
1274
|
return this.apiClient(fetchUri);
|
|
1152
1275
|
}
|
|
1153
1276
|
const edgeParams = {
|
|
1154
1277
|
...originParams,
|
|
1155
1278
|
projectId,
|
|
1156
1279
|
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
1157
|
-
...rewrittenFilters
|
|
1280
|
+
...rewrittenFilters,
|
|
1281
|
+
...rewrittenSelect
|
|
1158
1282
|
};
|
|
1159
1283
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
1160
1284
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
@@ -1259,20 +1383,26 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1259
1383
|
}
|
|
1260
1384
|
getContentTypes(options) {
|
|
1261
1385
|
const { projectId } = this.options;
|
|
1262
|
-
const fetchUri = this.createUrl(
|
|
1386
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1263
1387
|
return this.apiClient(fetchUri);
|
|
1264
1388
|
}
|
|
1265
1389
|
getEntries(options) {
|
|
1266
1390
|
const { projectId } = this.options;
|
|
1267
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
1391
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
1268
1392
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1393
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1269
1394
|
if (skipDataResolution) {
|
|
1270
|
-
const url = this.createUrl(
|
|
1395
|
+
const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), {
|
|
1396
|
+
...params,
|
|
1397
|
+
...rewrittenFilters,
|
|
1398
|
+
...rewrittenSelect,
|
|
1399
|
+
projectId
|
|
1400
|
+
});
|
|
1271
1401
|
return this.apiClient(url);
|
|
1272
1402
|
}
|
|
1273
1403
|
const edgeUrl = this.createUrl(
|
|
1274
|
-
|
|
1275
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1404
|
+
__privateGet3(_ContentClient2, _entriesUrl),
|
|
1405
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
1276
1406
|
this.edgeApiHost
|
|
1277
1407
|
);
|
|
1278
1408
|
return this.apiClient(
|
|
@@ -1289,7 +1419,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1289
1419
|
return this.apiClient(historyUrl);
|
|
1290
1420
|
}
|
|
1291
1421
|
async upsertContentType(body, opts = {}) {
|
|
1292
|
-
const fetchUri = this.createUrl(
|
|
1422
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1293
1423
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1294
1424
|
delete body.contentType.slugSettings;
|
|
1295
1425
|
}
|
|
@@ -1301,7 +1431,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1301
1431
|
});
|
|
1302
1432
|
}
|
|
1303
1433
|
async upsertEntry(body, options) {
|
|
1304
|
-
const fetchUri = this.createUrl(
|
|
1434
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1305
1435
|
const headers = {};
|
|
1306
1436
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1307
1437
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1315,7 +1445,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1315
1445
|
return { modified: response.headers.get("x-modified-at") };
|
|
1316
1446
|
}
|
|
1317
1447
|
async deleteContentType(body) {
|
|
1318
|
-
const fetchUri = this.createUrl(
|
|
1448
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1319
1449
|
await this.apiClient(fetchUri, {
|
|
1320
1450
|
method: "DELETE",
|
|
1321
1451
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1323,7 +1453,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1323
1453
|
});
|
|
1324
1454
|
}
|
|
1325
1455
|
async deleteEntry(body) {
|
|
1326
|
-
const fetchUri = this.createUrl(
|
|
1456
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1327
1457
|
await this.apiClient(fetchUri, {
|
|
1328
1458
|
method: "DELETE",
|
|
1329
1459
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1342,8 +1472,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1342
1472
|
};
|
|
1343
1473
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1344
1474
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1345
|
-
|
|
1346
|
-
|
|
1475
|
+
__privateAdd3(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1476
|
+
__privateAdd3(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1347
1477
|
var _url8;
|
|
1348
1478
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1349
1479
|
constructor(options) {
|
|
@@ -1352,12 +1482,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1352
1482
|
/** Fetches all DataTypes for a project */
|
|
1353
1483
|
async get(options) {
|
|
1354
1484
|
const { projectId } = this.options;
|
|
1355
|
-
const fetchUri = this.createUrl(
|
|
1485
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1356
1486
|
return await this.apiClient(fetchUri);
|
|
1357
1487
|
}
|
|
1358
1488
|
/** Updates or creates (based on id) a DataType */
|
|
1359
1489
|
async upsert(body) {
|
|
1360
|
-
const fetchUri = this.createUrl(
|
|
1490
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1361
1491
|
await this.apiClient(fetchUri, {
|
|
1362
1492
|
method: "PUT",
|
|
1363
1493
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1366,7 +1496,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1366
1496
|
}
|
|
1367
1497
|
/** Deletes a DataType */
|
|
1368
1498
|
async remove(body) {
|
|
1369
|
-
const fetchUri = this.createUrl(
|
|
1499
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1370
1500
|
await this.apiClient(fetchUri, {
|
|
1371
1501
|
method: "DELETE",
|
|
1372
1502
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1375,7 +1505,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1375
1505
|
}
|
|
1376
1506
|
};
|
|
1377
1507
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1378
|
-
|
|
1508
|
+
__privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1379
1509
|
var CANVAS_DRAFT_STATE = 0;
|
|
1380
1510
|
var CANVAS_EDITOR_STATE = 63;
|
|
1381
1511
|
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
@@ -1471,7 +1601,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1471
1601
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1472
1602
|
*/
|
|
1473
1603
|
get(options) {
|
|
1474
|
-
const fetchUri = this.createUrl(
|
|
1604
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1475
1605
|
...options,
|
|
1476
1606
|
teamId: this.teamId
|
|
1477
1607
|
});
|
|
@@ -1481,7 +1611,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1481
1611
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1482
1612
|
*/
|
|
1483
1613
|
async deploy(body) {
|
|
1484
|
-
const fetchUri = this.createUrl(
|
|
1614
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1485
1615
|
await this.apiClient(fetchUri, {
|
|
1486
1616
|
method: "PUT",
|
|
1487
1617
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1492,7 +1622,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1492
1622
|
* Removes a custom AI property editor from a Mesh app.
|
|
1493
1623
|
*/
|
|
1494
1624
|
async delete(body) {
|
|
1495
|
-
const fetchUri = this.createUrl(
|
|
1625
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1496
1626
|
await this.apiClient(fetchUri, {
|
|
1497
1627
|
method: "DELETE",
|
|
1498
1628
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1501,7 +1631,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1501
1631
|
}
|
|
1502
1632
|
};
|
|
1503
1633
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1504
|
-
|
|
1634
|
+
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1505
1635
|
var _url22;
|
|
1506
1636
|
var _projectsUrl;
|
|
1507
1637
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1510,7 +1640,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1510
1640
|
}
|
|
1511
1641
|
/** Fetches single Project */
|
|
1512
1642
|
async get(options) {
|
|
1513
|
-
const fetchUri = this.createUrl(
|
|
1643
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1514
1644
|
return await this.apiClient(fetchUri);
|
|
1515
1645
|
}
|
|
1516
1646
|
/**
|
|
@@ -1519,12 +1649,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1519
1649
|
* When omitted, returns all accessible teams and their projects.
|
|
1520
1650
|
*/
|
|
1521
1651
|
async getProjects(options) {
|
|
1522
|
-
const fetchUri = this.createUrl(
|
|
1652
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1523
1653
|
return await this.apiClient(fetchUri);
|
|
1524
1654
|
}
|
|
1525
1655
|
/** Updates or creates (based on id) a Project */
|
|
1526
1656
|
async upsert(body) {
|
|
1527
|
-
const fetchUri = this.createUrl(
|
|
1657
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1528
1658
|
return await this.apiClient(fetchUri, {
|
|
1529
1659
|
method: "PUT",
|
|
1530
1660
|
body: JSON.stringify({ ...body })
|
|
@@ -1532,7 +1662,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1532
1662
|
}
|
|
1533
1663
|
/** Deletes a Project */
|
|
1534
1664
|
async delete(body) {
|
|
1535
|
-
const fetchUri = this.createUrl(
|
|
1665
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1536
1666
|
await this.apiClient(fetchUri, {
|
|
1537
1667
|
method: "DELETE",
|
|
1538
1668
|
body: JSON.stringify({ ...body }),
|
|
@@ -1542,8 +1672,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1542
1672
|
};
|
|
1543
1673
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1544
1674
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1545
|
-
|
|
1546
|
-
|
|
1675
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1676
|
+
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1547
1677
|
var isAllowedReferrer = (referrer) => {
|
|
1548
1678
|
return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
|
|
1549
1679
|
};
|
|
@@ -1940,7 +2070,7 @@ function createLimiter(concurrency) {
|
|
|
1940
2070
|
});
|
|
1941
2071
|
};
|
|
1942
2072
|
}
|
|
1943
|
-
async function
|
|
2073
|
+
async function retry2(fn, options) {
|
|
1944
2074
|
let lastError;
|
|
1945
2075
|
let delay = 1e3;
|
|
1946
2076
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -1980,7 +2110,7 @@ function createLimitPolicy2({
|
|
|
1980
2110
|
}
|
|
1981
2111
|
if (retryOptions) {
|
|
1982
2112
|
const retryFunc = currentFunc;
|
|
1983
|
-
currentFunc = () =>
|
|
2113
|
+
currentFunc = () => retry2(retryFunc, {
|
|
1984
2114
|
...retryOptions,
|
|
1985
2115
|
onFailedAttempt: async (error) => {
|
|
1986
2116
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2054,14 +2184,14 @@ var getCanvasClient = (options) => {
|
|
|
2054
2184
|
var import_server_only2 = require("server-only");
|
|
2055
2185
|
|
|
2056
2186
|
// ../project-map/dist/index.mjs
|
|
2057
|
-
var
|
|
2187
|
+
var __typeError4 = (msg) => {
|
|
2058
2188
|
throw TypeError(msg);
|
|
2059
2189
|
};
|
|
2060
|
-
var
|
|
2061
|
-
var
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2064
|
-
var __privateMethod = (obj, member, method) => (
|
|
2190
|
+
var __accessCheck4 = (obj, member, msg) => member.has(obj) || __typeError4("Cannot " + msg);
|
|
2191
|
+
var __privateGet4 = (obj, member, getter) => (__accessCheck4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2192
|
+
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);
|
|
2193
|
+
var __privateSet2 = (obj, member, value, setter) => (__accessCheck4(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2194
|
+
var __privateMethod = (obj, member, method) => (__accessCheck4(obj, member, "access private method"), method);
|
|
2065
2195
|
var ProjectMapClient = class extends ApiClient {
|
|
2066
2196
|
constructor(options) {
|
|
2067
2197
|
super(options);
|
|
@@ -2208,12 +2338,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2208
2338
|
var _Route = class _Route2 {
|
|
2209
2339
|
constructor(route) {
|
|
2210
2340
|
this.route = route;
|
|
2211
|
-
|
|
2341
|
+
__privateAdd4(this, _routeInfo);
|
|
2212
2342
|
var _a;
|
|
2213
|
-
|
|
2343
|
+
__privateSet2(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2214
2344
|
}
|
|
2215
2345
|
get dynamicSegmentCount() {
|
|
2216
|
-
return
|
|
2346
|
+
return __privateGet4(this, _routeInfo).segments.reduce(
|
|
2217
2347
|
(count, segment) => {
|
|
2218
2348
|
var _a;
|
|
2219
2349
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2225,7 +2355,7 @@ var _Route = class _Route2 {
|
|
|
2225
2355
|
matches(path) {
|
|
2226
2356
|
var _a, _b;
|
|
2227
2357
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2228
|
-
const { segments: routeSegments } =
|
|
2358
|
+
const { segments: routeSegments } = __privateGet4(this, _routeInfo);
|
|
2229
2359
|
if (pathSegments.length !== routeSegments.length) {
|
|
2230
2360
|
return { match: false };
|
|
2231
2361
|
}
|
|
@@ -2246,7 +2376,7 @@ var _Route = class _Route2 {
|
|
|
2246
2376
|
return { match: false };
|
|
2247
2377
|
}
|
|
2248
2378
|
}
|
|
2249
|
-
for (const [key, value] of
|
|
2379
|
+
for (const [key, value] of __privateGet4(this, _routeInfo).queryParams) {
|
|
2250
2380
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2251
2381
|
}
|
|
2252
2382
|
return possibleMatch;
|
|
@@ -2256,7 +2386,7 @@ var _Route = class _Route2 {
|
|
|
2256
2386
|
*/
|
|
2257
2387
|
expand(options) {
|
|
2258
2388
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2259
|
-
const path =
|
|
2389
|
+
const path = __privateGet4(this, _routeInfo).segments.map((segment) => {
|
|
2260
2390
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2261
2391
|
if (!dynamicSegmentName) {
|
|
2262
2392
|
return segment;
|
|
@@ -2307,7 +2437,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2307
2437
|
}
|
|
2308
2438
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2309
2439
|
};
|
|
2310
|
-
|
|
2440
|
+
__privateAdd4(_Route, _Route_static);
|
|
2311
2441
|
_Route.dynamicSegmentPrefix = ":";
|
|
2312
2442
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2313
2443
|
if (!doNotEscapeVariables) {
|