@uniformdev/next-app-router 20.63.0 → 20.63.1-alpha.12
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/{UniformComposition-d7_93l3F.d.ts → UniformComposition-BV6YnA2a.d.ts} +2 -2
- package/dist/{UniformComposition-hhRIBHmn.d.mts → UniformComposition-scIgVvIH.d.mts} +2 -2
- package/dist/cache.d.mts +2 -2
- package/dist/cache.d.ts +2 -2
- package/dist/cache.js +564 -495
- package/dist/cache.mjs +564 -495
- package/dist/{client-BCGVjYM-.d.mts → client-BlKZeE6C.d.mts} +1 -1
- package/dist/{client-BCGVjYM-.d.ts → client-BlKZeE6C.d.ts} +1 -1
- package/dist/compat.d.mts +3 -3
- package/dist/compat.d.ts +3 -3
- package/dist/component.js +0 -366
- package/dist/component.mjs +0 -366
- package/dist/handler.js +658 -589
- package/dist/handler.mjs +658 -589
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +649 -577
- package/dist/index.js +649 -577
- package/dist/index.mjs +649 -577
- package/dist/middleware.d.mts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +587 -522
- package/dist/middleware.mjs +587 -522
- package/dist/{resolveRouteFromCode-DgTsfMK8.d.ts → resolveRouteFromCode-3u61IwOW.d.ts} +1 -1
- package/dist/{resolveRouteFromCode-CKaYNXte.d.mts → resolveRouteFromCode-_CdAMtVM.d.mts} +1 -1
- package/package.json +9 -9
package/dist/index.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
|
|
|
@@ -178,14 +426,14 @@ var import_server_only = require("server-only");
|
|
|
178
426
|
// ../context/dist/api/api.mjs
|
|
179
427
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
180
428
|
var __defProp2 = Object.defineProperty;
|
|
181
|
-
var
|
|
429
|
+
var __typeError2 = (msg) => {
|
|
182
430
|
throw TypeError(msg);
|
|
183
431
|
};
|
|
184
|
-
var
|
|
185
|
-
var
|
|
186
|
-
var
|
|
187
|
-
var
|
|
188
|
-
var
|
|
432
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
433
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
434
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
435
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
436
|
+
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);
|
|
189
437
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
190
438
|
var ApiClientError = class _ApiClientError extends Error {
|
|
191
439
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -204,7 +452,7 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
204
452
|
};
|
|
205
453
|
var ApiClient = class _ApiClient {
|
|
206
454
|
constructor(options) {
|
|
207
|
-
|
|
455
|
+
__publicField2(this, "options");
|
|
208
456
|
var _a, _b, _c, _d, _e;
|
|
209
457
|
if (!options.apiKey && !options.bearerToken) {
|
|
210
458
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -374,12 +622,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
374
622
|
/** Fetches all aggregates for a project */
|
|
375
623
|
async get(options) {
|
|
376
624
|
const { projectId } = this.options;
|
|
377
|
-
const fetchUri = this.createUrl(
|
|
625
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url), { ...options, projectId });
|
|
378
626
|
return await this.apiClient(fetchUri);
|
|
379
627
|
}
|
|
380
628
|
/** Updates or creates (based on id) an Aggregate */
|
|
381
629
|
async upsert(body) {
|
|
382
|
-
const fetchUri = this.createUrl(
|
|
630
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
383
631
|
await this.apiClient(fetchUri, {
|
|
384
632
|
method: "PUT",
|
|
385
633
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -388,7 +636,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
388
636
|
}
|
|
389
637
|
/** Deletes an Aggregate */
|
|
390
638
|
async remove(body) {
|
|
391
|
-
const fetchUri = this.createUrl(
|
|
639
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
392
640
|
await this.apiClient(fetchUri, {
|
|
393
641
|
method: "DELETE",
|
|
394
642
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -397,7 +645,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
397
645
|
}
|
|
398
646
|
};
|
|
399
647
|
_url = /* @__PURE__ */ new WeakMap();
|
|
400
|
-
|
|
648
|
+
__privateAdd2(_AggregateClient, _url, "/api/v2/aggregate");
|
|
401
649
|
var _url2;
|
|
402
650
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
403
651
|
constructor(options) {
|
|
@@ -406,12 +654,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
406
654
|
/** Fetches the known score dimensions for a project */
|
|
407
655
|
async get(options) {
|
|
408
656
|
const { projectId } = this.options;
|
|
409
|
-
const fetchUri = this.createUrl(
|
|
657
|
+
const fetchUri = this.createUrl(__privateGet2(_DimensionClient2, _url2), { ...options, projectId });
|
|
410
658
|
return await this.apiClient(fetchUri);
|
|
411
659
|
}
|
|
412
660
|
};
|
|
413
661
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
414
|
-
|
|
662
|
+
__privateAdd2(_DimensionClient, _url2, "/api/v2/dimension");
|
|
415
663
|
var _url3;
|
|
416
664
|
var _valueUrl;
|
|
417
665
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -421,12 +669,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
421
669
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
422
670
|
async get(options) {
|
|
423
671
|
const { projectId } = this.options;
|
|
424
|
-
const fetchUri = this.createUrl(
|
|
672
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
425
673
|
return await this.apiClient(fetchUri);
|
|
426
674
|
}
|
|
427
675
|
/** Updates or creates (based on id) an enrichment category */
|
|
428
676
|
async upsertCategory(body) {
|
|
429
|
-
const fetchUri = this.createUrl(
|
|
677
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
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 category */
|
|
437
685
|
async removeCategory(body) {
|
|
438
|
-
const fetchUri = this.createUrl(
|
|
686
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
439
687
|
await this.apiClient(fetchUri, {
|
|
440
688
|
method: "DELETE",
|
|
441
689
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -444,7 +692,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
444
692
|
}
|
|
445
693
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
446
694
|
async upsertValue(body) {
|
|
447
|
-
const fetchUri = this.createUrl(
|
|
695
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
448
696
|
await this.apiClient(fetchUri, {
|
|
449
697
|
method: "PUT",
|
|
450
698
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -453,7 +701,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
453
701
|
}
|
|
454
702
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
455
703
|
async removeValue(body) {
|
|
456
|
-
const fetchUri = this.createUrl(
|
|
704
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
457
705
|
await this.apiClient(fetchUri, {
|
|
458
706
|
method: "DELETE",
|
|
459
707
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -463,8 +711,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
463
711
|
};
|
|
464
712
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
465
713
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
466
|
-
|
|
467
|
-
|
|
714
|
+
__privateAdd2(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
715
|
+
__privateAdd2(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
468
716
|
var _url4;
|
|
469
717
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
470
718
|
constructor(options) {
|
|
@@ -473,7 +721,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
473
721
|
/** Fetches the Context manifest for a project */
|
|
474
722
|
async get(options) {
|
|
475
723
|
const { projectId } = this.options;
|
|
476
|
-
const fetchUri = this.createUrl(
|
|
724
|
+
const fetchUri = this.createUrl(__privateGet2(_ManifestClient2, _url4), { ...options, projectId });
|
|
477
725
|
return await this.apiClient(fetchUri);
|
|
478
726
|
}
|
|
479
727
|
/** Publishes the Context manifest for a project */
|
|
@@ -487,7 +735,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
487
735
|
}
|
|
488
736
|
};
|
|
489
737
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
490
|
-
|
|
738
|
+
__privateAdd2(_ManifestClient, _url4, "/api/v2/manifest");
|
|
491
739
|
var ManifestClient = _ManifestClient;
|
|
492
740
|
var _url5;
|
|
493
741
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
@@ -497,12 +745,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
497
745
|
/** Fetches all Quirks for a project */
|
|
498
746
|
async get(options) {
|
|
499
747
|
const { projectId } = this.options;
|
|
500
|
-
const fetchUri = this.createUrl(
|
|
748
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5), { ...options, projectId });
|
|
501
749
|
return await this.apiClient(fetchUri);
|
|
502
750
|
}
|
|
503
751
|
/** Updates or creates (based on id) a Quirk */
|
|
504
752
|
async upsert(body) {
|
|
505
|
-
const fetchUri = this.createUrl(
|
|
753
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
506
754
|
await this.apiClient(fetchUri, {
|
|
507
755
|
method: "PUT",
|
|
508
756
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -511,7 +759,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
511
759
|
}
|
|
512
760
|
/** Deletes a Quirk */
|
|
513
761
|
async remove(body) {
|
|
514
|
-
const fetchUri = this.createUrl(
|
|
762
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
515
763
|
await this.apiClient(fetchUri, {
|
|
516
764
|
method: "DELETE",
|
|
517
765
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -520,7 +768,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
520
768
|
}
|
|
521
769
|
};
|
|
522
770
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
523
|
-
|
|
771
|
+
__privateAdd2(_QuirkClient, _url5, "/api/v2/quirk");
|
|
524
772
|
var _url6;
|
|
525
773
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
526
774
|
constructor(options) {
|
|
@@ -529,12 +777,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
529
777
|
/** Fetches all Signals for a project */
|
|
530
778
|
async get(options) {
|
|
531
779
|
const { projectId } = this.options;
|
|
532
|
-
const fetchUri = this.createUrl(
|
|
780
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6), { ...options, projectId });
|
|
533
781
|
return await this.apiClient(fetchUri);
|
|
534
782
|
}
|
|
535
783
|
/** Updates or creates (based on id) a Signal */
|
|
536
784
|
async upsert(body) {
|
|
537
|
-
const fetchUri = this.createUrl(
|
|
785
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
538
786
|
await this.apiClient(fetchUri, {
|
|
539
787
|
method: "PUT",
|
|
540
788
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -543,7 +791,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
543
791
|
}
|
|
544
792
|
/** Deletes a Signal */
|
|
545
793
|
async remove(body) {
|
|
546
|
-
const fetchUri = this.createUrl(
|
|
794
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
547
795
|
await this.apiClient(fetchUri, {
|
|
548
796
|
method: "DELETE",
|
|
549
797
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -552,425 +800,219 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
552
800
|
}
|
|
553
801
|
};
|
|
554
802
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
555
|
-
|
|
803
|
+
__privateAdd2(_SignalClient, _url6, "/api/v2/signal");
|
|
556
804
|
var _url7;
|
|
557
805
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
558
|
-
constructor(options) {
|
|
559
|
-
super(options);
|
|
560
|
-
}
|
|
561
|
-
/** Fetches all Tests for a project */
|
|
562
|
-
async get(options) {
|
|
563
|
-
const { projectId } = this.options;
|
|
564
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
565
|
-
return await this.apiClient(fetchUri);
|
|
566
|
-
}
|
|
567
|
-
/** Updates or creates (based on id) a Test */
|
|
568
|
-
async upsert(body) {
|
|
569
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
570
|
-
await this.apiClient(fetchUri, {
|
|
571
|
-
method: "PUT",
|
|
572
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
573
|
-
expectNoContent: true
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
/** Deletes a Test */
|
|
577
|
-
async remove(body) {
|
|
578
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
579
|
-
await this.apiClient(fetchUri, {
|
|
580
|
-
method: "DELETE",
|
|
581
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
582
|
-
expectNoContent: true
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
_url7 = /* @__PURE__ */ new WeakMap();
|
|
587
|
-
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
588
|
-
|
|
589
|
-
// ../canvas/dist/index.mjs
|
|
590
|
-
var __create2 = Object.create;
|
|
591
|
-
var __defProp3 = Object.defineProperty;
|
|
592
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
593
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
594
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
595
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
596
|
-
var __typeError2 = (msg) => {
|
|
597
|
-
throw TypeError(msg);
|
|
598
|
-
};
|
|
599
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
600
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
601
|
-
};
|
|
602
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
603
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
604
|
-
for (let key of __getOwnPropNames2(from))
|
|
605
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
606
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
607
|
-
}
|
|
608
|
-
return to;
|
|
609
|
-
};
|
|
610
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
611
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
612
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
613
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
614
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
615
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
616
|
-
mod
|
|
617
|
-
));
|
|
618
|
-
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
619
|
-
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
620
|
-
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);
|
|
621
|
-
var require_yocto_queue2 = __commonJS2({
|
|
622
|
-
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
|
|
623
|
-
"use strict";
|
|
624
|
-
var Node = class {
|
|
625
|
-
/// value;
|
|
626
|
-
/// next;
|
|
627
|
-
constructor(value) {
|
|
628
|
-
this.value = value;
|
|
629
|
-
this.next = void 0;
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
var Queue = class {
|
|
633
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
634
|
-
// #_head;
|
|
635
|
-
// #_tail;
|
|
636
|
-
// #_size;
|
|
637
|
-
constructor() {
|
|
638
|
-
this.clear();
|
|
639
|
-
}
|
|
640
|
-
enqueue(value) {
|
|
641
|
-
const node = new Node(value);
|
|
642
|
-
if (this._head) {
|
|
643
|
-
this._tail.next = node;
|
|
644
|
-
this._tail = node;
|
|
645
|
-
} else {
|
|
646
|
-
this._head = node;
|
|
647
|
-
this._tail = node;
|
|
648
|
-
}
|
|
649
|
-
this._size++;
|
|
650
|
-
}
|
|
651
|
-
dequeue() {
|
|
652
|
-
const current = this._head;
|
|
653
|
-
if (!current) {
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
this._head = this._head.next;
|
|
657
|
-
this._size--;
|
|
658
|
-
return current.value;
|
|
659
|
-
}
|
|
660
|
-
clear() {
|
|
661
|
-
this._head = void 0;
|
|
662
|
-
this._tail = void 0;
|
|
663
|
-
this._size = 0;
|
|
664
|
-
}
|
|
665
|
-
get size() {
|
|
666
|
-
return this._size;
|
|
667
|
-
}
|
|
668
|
-
*[Symbol.iterator]() {
|
|
669
|
-
let current = this._head;
|
|
670
|
-
while (current) {
|
|
671
|
-
yield current.value;
|
|
672
|
-
current = current.next;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
};
|
|
676
|
-
module2.exports = Queue;
|
|
677
|
-
}
|
|
678
|
-
});
|
|
679
|
-
var require_p_limit2 = __commonJS2({
|
|
680
|
-
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
|
|
681
|
-
"use strict";
|
|
682
|
-
var Queue = require_yocto_queue2();
|
|
683
|
-
var pLimit2 = (concurrency) => {
|
|
684
|
-
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
685
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
686
|
-
}
|
|
687
|
-
const queue = new Queue();
|
|
688
|
-
let activeCount = 0;
|
|
689
|
-
const next = () => {
|
|
690
|
-
activeCount--;
|
|
691
|
-
if (queue.size > 0) {
|
|
692
|
-
queue.dequeue()();
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
const run = async (fn, resolve, ...args) => {
|
|
696
|
-
activeCount++;
|
|
697
|
-
const result = (async () => fn(...args))();
|
|
698
|
-
resolve(result);
|
|
699
|
-
try {
|
|
700
|
-
await result;
|
|
701
|
-
} catch (e) {
|
|
702
|
-
}
|
|
703
|
-
next();
|
|
704
|
-
};
|
|
705
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
706
|
-
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
707
|
-
(async () => {
|
|
708
|
-
await Promise.resolve();
|
|
709
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
710
|
-
queue.dequeue()();
|
|
711
|
-
}
|
|
712
|
-
})();
|
|
713
|
-
};
|
|
714
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
715
|
-
enqueue(fn, resolve, ...args);
|
|
716
|
-
});
|
|
717
|
-
Object.defineProperties(generator, {
|
|
718
|
-
activeCount: {
|
|
719
|
-
get: () => activeCount
|
|
720
|
-
},
|
|
721
|
-
pendingCount: {
|
|
722
|
-
get: () => queue.size
|
|
723
|
-
},
|
|
724
|
-
clearQueue: {
|
|
725
|
-
value: () => {
|
|
726
|
-
queue.clear();
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
return generator;
|
|
731
|
-
};
|
|
732
|
-
module2.exports = pLimit2;
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
var require_retry_operation = __commonJS2({
|
|
736
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
737
|
-
"use strict";
|
|
738
|
-
function RetryOperation(timeouts, options) {
|
|
739
|
-
if (typeof options === "boolean") {
|
|
740
|
-
options = { forever: options };
|
|
741
|
-
}
|
|
742
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
743
|
-
this._timeouts = timeouts;
|
|
744
|
-
this._options = options || {};
|
|
745
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
746
|
-
this._fn = null;
|
|
747
|
-
this._errors = [];
|
|
748
|
-
this._attempts = 1;
|
|
749
|
-
this._operationTimeout = null;
|
|
750
|
-
this._operationTimeoutCb = null;
|
|
751
|
-
this._timeout = null;
|
|
752
|
-
this._operationStart = null;
|
|
753
|
-
this._timer = null;
|
|
754
|
-
if (this._options.forever) {
|
|
755
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
module2.exports = RetryOperation;
|
|
759
|
-
RetryOperation.prototype.reset = function() {
|
|
760
|
-
this._attempts = 1;
|
|
761
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
762
|
-
};
|
|
763
|
-
RetryOperation.prototype.stop = function() {
|
|
764
|
-
if (this._timeout) {
|
|
765
|
-
clearTimeout(this._timeout);
|
|
766
|
-
}
|
|
767
|
-
if (this._timer) {
|
|
768
|
-
clearTimeout(this._timer);
|
|
769
|
-
}
|
|
770
|
-
this._timeouts = [];
|
|
771
|
-
this._cachedTimeouts = null;
|
|
772
|
-
};
|
|
773
|
-
RetryOperation.prototype.retry = function(err) {
|
|
774
|
-
if (this._timeout) {
|
|
775
|
-
clearTimeout(this._timeout);
|
|
776
|
-
}
|
|
777
|
-
if (!err) {
|
|
778
|
-
return false;
|
|
779
|
-
}
|
|
780
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
781
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
782
|
-
this._errors.push(err);
|
|
783
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
784
|
-
return false;
|
|
785
|
-
}
|
|
786
|
-
this._errors.push(err);
|
|
787
|
-
var timeout = this._timeouts.shift();
|
|
788
|
-
if (timeout === void 0) {
|
|
789
|
-
if (this._cachedTimeouts) {
|
|
790
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
791
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
792
|
-
} else {
|
|
793
|
-
return false;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
var self = this;
|
|
797
|
-
this._timer = setTimeout(function() {
|
|
798
|
-
self._attempts++;
|
|
799
|
-
if (self._operationTimeoutCb) {
|
|
800
|
-
self._timeout = setTimeout(function() {
|
|
801
|
-
self._operationTimeoutCb(self._attempts);
|
|
802
|
-
}, self._operationTimeout);
|
|
803
|
-
if (self._options.unref) {
|
|
804
|
-
self._timeout.unref();
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
self._fn(self._attempts);
|
|
808
|
-
}, timeout);
|
|
809
|
-
if (this._options.unref) {
|
|
810
|
-
this._timer.unref();
|
|
811
|
-
}
|
|
812
|
-
return true;
|
|
813
|
-
};
|
|
814
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
815
|
-
this._fn = fn;
|
|
816
|
-
if (timeoutOps) {
|
|
817
|
-
if (timeoutOps.timeout) {
|
|
818
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
819
|
-
}
|
|
820
|
-
if (timeoutOps.cb) {
|
|
821
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
var self = this;
|
|
825
|
-
if (this._operationTimeoutCb) {
|
|
826
|
-
this._timeout = setTimeout(function() {
|
|
827
|
-
self._operationTimeoutCb();
|
|
828
|
-
}, self._operationTimeout);
|
|
829
|
-
}
|
|
830
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
831
|
-
this._fn(this._attempts);
|
|
832
|
-
};
|
|
833
|
-
RetryOperation.prototype.try = function(fn) {
|
|
834
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
835
|
-
this.attempt(fn);
|
|
836
|
-
};
|
|
837
|
-
RetryOperation.prototype.start = function(fn) {
|
|
838
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
839
|
-
this.attempt(fn);
|
|
840
|
-
};
|
|
841
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
842
|
-
RetryOperation.prototype.errors = function() {
|
|
843
|
-
return this._errors;
|
|
844
|
-
};
|
|
845
|
-
RetryOperation.prototype.attempts = function() {
|
|
846
|
-
return this._attempts;
|
|
847
|
-
};
|
|
848
|
-
RetryOperation.prototype.mainError = function() {
|
|
849
|
-
if (this._errors.length === 0) {
|
|
850
|
-
return null;
|
|
851
|
-
}
|
|
852
|
-
var counts = {};
|
|
853
|
-
var mainError = null;
|
|
854
|
-
var mainErrorCount = 0;
|
|
855
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
856
|
-
var error = this._errors[i];
|
|
857
|
-
var message = error.message;
|
|
858
|
-
var count = (counts[message] || 0) + 1;
|
|
859
|
-
counts[message] = count;
|
|
860
|
-
if (count >= mainErrorCount) {
|
|
861
|
-
mainError = error;
|
|
862
|
-
mainErrorCount = count;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
return mainError;
|
|
866
|
-
};
|
|
806
|
+
constructor(options) {
|
|
807
|
+
super(options);
|
|
867
808
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
})
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
809
|
+
/** Fetches all Tests for a project */
|
|
810
|
+
async get(options) {
|
|
811
|
+
const { projectId } = this.options;
|
|
812
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7), { ...options, projectId });
|
|
813
|
+
return await this.apiClient(fetchUri);
|
|
814
|
+
}
|
|
815
|
+
/** Updates or creates (based on id) a Test */
|
|
816
|
+
async upsert(body) {
|
|
817
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
818
|
+
await this.apiClient(fetchUri, {
|
|
819
|
+
method: "PUT",
|
|
820
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
821
|
+
expectNoContent: true
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
/** Deletes a Test */
|
|
825
|
+
async remove(body) {
|
|
826
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
827
|
+
await this.apiClient(fetchUri, {
|
|
828
|
+
method: "DELETE",
|
|
829
|
+
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
830
|
+
expectNoContent: true
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
_url7 = /* @__PURE__ */ new WeakMap();
|
|
835
|
+
__privateAdd2(_TestClient, _url7, "/api/v2/test");
|
|
836
|
+
|
|
837
|
+
// ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
838
|
+
var Node = class {
|
|
839
|
+
constructor(value) {
|
|
840
|
+
__publicField(this, "value");
|
|
841
|
+
__publicField(this, "next");
|
|
842
|
+
this.value = value;
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
var _head, _tail, _size;
|
|
846
|
+
var Queue = class {
|
|
847
|
+
constructor() {
|
|
848
|
+
__privateAdd(this, _head);
|
|
849
|
+
__privateAdd(this, _tail);
|
|
850
|
+
__privateAdd(this, _size);
|
|
851
|
+
this.clear();
|
|
852
|
+
}
|
|
853
|
+
enqueue(value) {
|
|
854
|
+
const node = new Node(value);
|
|
855
|
+
if (__privateGet(this, _head)) {
|
|
856
|
+
__privateGet(this, _tail).next = node;
|
|
857
|
+
__privateSet(this, _tail, node);
|
|
858
|
+
} else {
|
|
859
|
+
__privateSet(this, _head, node);
|
|
860
|
+
__privateSet(this, _tail, node);
|
|
861
|
+
}
|
|
862
|
+
__privateWrapper(this, _size)._++;
|
|
863
|
+
}
|
|
864
|
+
dequeue() {
|
|
865
|
+
const current = __privateGet(this, _head);
|
|
866
|
+
if (!current) {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
870
|
+
__privateWrapper(this, _size)._--;
|
|
871
|
+
if (!__privateGet(this, _head)) {
|
|
872
|
+
__privateSet(this, _tail, void 0);
|
|
873
|
+
}
|
|
874
|
+
return current.value;
|
|
875
|
+
}
|
|
876
|
+
peek() {
|
|
877
|
+
if (!__privateGet(this, _head)) {
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
return __privateGet(this, _head).value;
|
|
881
|
+
}
|
|
882
|
+
clear() {
|
|
883
|
+
__privateSet(this, _head, void 0);
|
|
884
|
+
__privateSet(this, _tail, void 0);
|
|
885
|
+
__privateSet(this, _size, 0);
|
|
886
|
+
}
|
|
887
|
+
get size() {
|
|
888
|
+
return __privateGet(this, _size);
|
|
889
|
+
}
|
|
890
|
+
*[Symbol.iterator]() {
|
|
891
|
+
let current = __privateGet(this, _head);
|
|
892
|
+
while (current) {
|
|
893
|
+
yield current.value;
|
|
894
|
+
current = current.next;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
*drain() {
|
|
898
|
+
while (__privateGet(this, _head)) {
|
|
899
|
+
yield this.dequeue();
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
_head = new WeakMap();
|
|
904
|
+
_tail = new WeakMap();
|
|
905
|
+
_size = new WeakMap();
|
|
906
|
+
|
|
907
|
+
// ../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js
|
|
908
|
+
function pLimit2(concurrency) {
|
|
909
|
+
validateConcurrency(concurrency);
|
|
910
|
+
const queue = new Queue();
|
|
911
|
+
let activeCount = 0;
|
|
912
|
+
const resumeNext = () => {
|
|
913
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
914
|
+
queue.dequeue()();
|
|
915
|
+
activeCount++;
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
const next = () => {
|
|
919
|
+
activeCount--;
|
|
920
|
+
resumeNext();
|
|
921
|
+
};
|
|
922
|
+
const run = async (function_, resolve, arguments_) => {
|
|
923
|
+
const result = (async () => function_(...arguments_))();
|
|
924
|
+
resolve(result);
|
|
925
|
+
try {
|
|
926
|
+
await result;
|
|
927
|
+
} catch (e) {
|
|
928
|
+
}
|
|
929
|
+
next();
|
|
930
|
+
};
|
|
931
|
+
const enqueue = (function_, resolve, arguments_) => {
|
|
932
|
+
new Promise((internalResolve) => {
|
|
933
|
+
queue.enqueue(internalResolve);
|
|
934
|
+
}).then(
|
|
935
|
+
run.bind(void 0, function_, resolve, arguments_)
|
|
936
|
+
);
|
|
937
|
+
(async () => {
|
|
938
|
+
await Promise.resolve();
|
|
939
|
+
if (activeCount < concurrency) {
|
|
940
|
+
resumeNext();
|
|
904
941
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
942
|
+
})();
|
|
943
|
+
};
|
|
944
|
+
const generator = (function_, ...arguments_) => new Promise((resolve) => {
|
|
945
|
+
enqueue(function_, resolve, arguments_);
|
|
946
|
+
});
|
|
947
|
+
Object.defineProperties(generator, {
|
|
948
|
+
activeCount: {
|
|
949
|
+
get: () => activeCount
|
|
950
|
+
},
|
|
951
|
+
pendingCount: {
|
|
952
|
+
get: () => queue.size
|
|
953
|
+
},
|
|
954
|
+
clearQueue: {
|
|
955
|
+
value() {
|
|
956
|
+
queue.clear();
|
|
920
957
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
958
|
+
},
|
|
959
|
+
concurrency: {
|
|
960
|
+
get: () => concurrency,
|
|
961
|
+
set(newConcurrency) {
|
|
962
|
+
validateConcurrency(newConcurrency);
|
|
963
|
+
concurrency = newConcurrency;
|
|
964
|
+
queueMicrotask(() => {
|
|
965
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
966
|
+
resumeNext();
|
|
926
967
|
}
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
for (var i = 0; i < methods.length; i++) {
|
|
930
|
-
var method = methods[i];
|
|
931
|
-
var original = obj[method];
|
|
932
|
-
obj[method] = function retryWrapper(original2) {
|
|
933
|
-
var op = exports2.operation(options);
|
|
934
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
935
|
-
var callback = args.pop();
|
|
936
|
-
args.push(function(err) {
|
|
937
|
-
if (op.retry(err)) {
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
if (err) {
|
|
941
|
-
arguments[0] = op.mainError();
|
|
942
|
-
}
|
|
943
|
-
callback.apply(this, arguments);
|
|
944
|
-
});
|
|
945
|
-
op.attempt(function() {
|
|
946
|
-
original2.apply(obj, args);
|
|
947
|
-
});
|
|
948
|
-
}.bind(obj, original);
|
|
949
|
-
obj[method].options = options;
|
|
968
|
+
});
|
|
950
969
|
}
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
return generator;
|
|
973
|
+
}
|
|
974
|
+
function validateConcurrency(concurrency) {
|
|
975
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
976
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
958
977
|
}
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
var
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
981
|
+
var import_retry = __toESM(require_retry2(), 1);
|
|
982
|
+
|
|
983
|
+
// ../../node_modules/.pnpm/is-network-error@1.1.0/node_modules/is-network-error/index.js
|
|
984
|
+
var objectToString = Object.prototype.toString;
|
|
985
|
+
var isError = (value) => objectToString.call(value) === "[object Error]";
|
|
986
|
+
var errorMessages = /* @__PURE__ */ new Set([
|
|
987
|
+
"network error",
|
|
988
|
+
// Chrome
|
|
963
989
|
"Failed to fetch",
|
|
964
990
|
// Chrome
|
|
965
991
|
"NetworkError when attempting to fetch resource.",
|
|
966
992
|
// Firefox
|
|
967
993
|
"The Internet connection appears to be offline.",
|
|
968
|
-
// Safari
|
|
994
|
+
// Safari 16
|
|
995
|
+
"Load failed",
|
|
996
|
+
// Safari 17+
|
|
969
997
|
"Network request failed",
|
|
970
998
|
// `cross-fetch`
|
|
971
|
-
"fetch failed"
|
|
999
|
+
"fetch failed",
|
|
1000
|
+
// Undici (Node.js)
|
|
1001
|
+
"terminated"
|
|
972
1002
|
// Undici (Node.js)
|
|
973
1003
|
]);
|
|
1004
|
+
function isNetworkError(error) {
|
|
1005
|
+
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
1006
|
+
if (!isValid) {
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
if (error.message === "Load failed") {
|
|
1010
|
+
return error.stack === void 0;
|
|
1011
|
+
}
|
|
1012
|
+
return errorMessages.has(error.message);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
974
1016
|
var AbortError = class extends Error {
|
|
975
1017
|
constructor(message) {
|
|
976
1018
|
super();
|
|
@@ -991,63 +1033,68 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
991
1033
|
error.retriesLeft = retriesLeft;
|
|
992
1034
|
return error;
|
|
993
1035
|
};
|
|
994
|
-
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
995
|
-
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
996
1036
|
async function pRetry(input, options) {
|
|
997
1037
|
return new Promise((resolve, reject) => {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
retries: 10,
|
|
1002
|
-
...options
|
|
1038
|
+
var _a, _b, _c;
|
|
1039
|
+
options = { ...options };
|
|
1040
|
+
(_a = options.onFailedAttempt) != null ? _a : options.onFailedAttempt = () => {
|
|
1003
1041
|
};
|
|
1042
|
+
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1043
|
+
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
1004
1044
|
const operation = import_retry.default.operation(options);
|
|
1045
|
+
const abortHandler = () => {
|
|
1046
|
+
var _a2;
|
|
1047
|
+
operation.stop();
|
|
1048
|
+
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1049
|
+
};
|
|
1050
|
+
if (options.signal && !options.signal.aborted) {
|
|
1051
|
+
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1052
|
+
}
|
|
1053
|
+
const cleanUp = () => {
|
|
1054
|
+
var _a2;
|
|
1055
|
+
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1056
|
+
operation.stop();
|
|
1057
|
+
};
|
|
1005
1058
|
operation.attempt(async (attemptNumber) => {
|
|
1006
1059
|
try {
|
|
1007
|
-
|
|
1060
|
+
const result = await input(attemptNumber);
|
|
1061
|
+
cleanUp();
|
|
1062
|
+
resolve(result);
|
|
1008
1063
|
} catch (error) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
} else {
|
|
1064
|
+
try {
|
|
1065
|
+
if (!(error instanceof Error)) {
|
|
1066
|
+
throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
|
|
1067
|
+
}
|
|
1068
|
+
if (error instanceof AbortError) {
|
|
1069
|
+
throw error.originalError;
|
|
1070
|
+
}
|
|
1071
|
+
if (error instanceof TypeError && !isNetworkError(error)) {
|
|
1072
|
+
throw error;
|
|
1073
|
+
}
|
|
1020
1074
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
reject(error2);
|
|
1025
|
-
return;
|
|
1075
|
+
if (!await options.shouldRetry(error)) {
|
|
1076
|
+
operation.stop();
|
|
1077
|
+
reject(error);
|
|
1026
1078
|
}
|
|
1079
|
+
await options.onFailedAttempt(error);
|
|
1027
1080
|
if (!operation.retry(error)) {
|
|
1028
|
-
|
|
1081
|
+
throw operation.mainError();
|
|
1029
1082
|
}
|
|
1083
|
+
} catch (finalError) {
|
|
1084
|
+
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1085
|
+
cleanUp();
|
|
1086
|
+
reject(finalError);
|
|
1030
1087
|
}
|
|
1031
1088
|
}
|
|
1032
1089
|
});
|
|
1033
|
-
if (options.signal && !options.signal.aborted) {
|
|
1034
|
-
options.signal.addEventListener("abort", () => {
|
|
1035
|
-
operation.stop();
|
|
1036
|
-
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1037
|
-
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1038
|
-
}, {
|
|
1039
|
-
once: true
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
1090
|
});
|
|
1043
1091
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}
|
|
1050
|
-
function pThrottle({ limit, interval, strict }) {
|
|
1092
|
+
|
|
1093
|
+
// ../../node_modules/.pnpm/p-throttle@7.0.0/node_modules/p-throttle/index.js
|
|
1094
|
+
var registry = new FinalizationRegistry(({ signal, aborted }) => {
|
|
1095
|
+
signal == null ? void 0 : signal.removeEventListener("abort", aborted);
|
|
1096
|
+
});
|
|
1097
|
+
function pThrottle({ limit, interval, strict, signal, onDelay }) {
|
|
1051
1098
|
if (!Number.isFinite(limit)) {
|
|
1052
1099
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1053
1100
|
}
|
|
@@ -1075,53 +1122,75 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1075
1122
|
const strictTicks = [];
|
|
1076
1123
|
function strictDelay() {
|
|
1077
1124
|
const now = Date.now();
|
|
1078
|
-
if (strictTicks.length
|
|
1079
|
-
strictTicks.
|
|
1080
|
-
return 0;
|
|
1125
|
+
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1126
|
+
strictTicks.length = 0;
|
|
1081
1127
|
}
|
|
1082
|
-
|
|
1083
|
-
if (now >= earliestTime) {
|
|
1128
|
+
if (strictTicks.length < limit) {
|
|
1084
1129
|
strictTicks.push(now);
|
|
1085
1130
|
return 0;
|
|
1086
1131
|
}
|
|
1087
|
-
strictTicks
|
|
1088
|
-
|
|
1132
|
+
const nextExecutionTime = strictTicks[0] + interval;
|
|
1133
|
+
strictTicks.shift();
|
|
1134
|
+
strictTicks.push(nextExecutionTime);
|
|
1135
|
+
return Math.max(0, nextExecutionTime - now);
|
|
1089
1136
|
}
|
|
1090
1137
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1091
1138
|
return (function_) => {
|
|
1092
|
-
const throttled = function(...
|
|
1139
|
+
const throttled = function(...arguments_) {
|
|
1093
1140
|
if (!throttled.isEnabled) {
|
|
1094
|
-
return (async () => function_.apply(this,
|
|
1141
|
+
return (async () => function_.apply(this, arguments_))();
|
|
1095
1142
|
}
|
|
1096
|
-
let
|
|
1143
|
+
let timeoutId;
|
|
1097
1144
|
return new Promise((resolve, reject) => {
|
|
1098
1145
|
const execute = () => {
|
|
1099
|
-
resolve(function_.apply(this,
|
|
1100
|
-
queue.delete(
|
|
1146
|
+
resolve(function_.apply(this, arguments_));
|
|
1147
|
+
queue.delete(timeoutId);
|
|
1101
1148
|
};
|
|
1102
|
-
|
|
1103
|
-
|
|
1149
|
+
const delay = getDelay();
|
|
1150
|
+
if (delay > 0) {
|
|
1151
|
+
timeoutId = setTimeout(execute, delay);
|
|
1152
|
+
queue.set(timeoutId, reject);
|
|
1153
|
+
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1154
|
+
} else {
|
|
1155
|
+
execute();
|
|
1156
|
+
}
|
|
1104
1157
|
});
|
|
1105
1158
|
};
|
|
1106
|
-
|
|
1159
|
+
const aborted = () => {
|
|
1107
1160
|
for (const timeout of queue.keys()) {
|
|
1108
1161
|
clearTimeout(timeout);
|
|
1109
|
-
queue.get(timeout)(
|
|
1162
|
+
queue.get(timeout)(signal.reason);
|
|
1110
1163
|
}
|
|
1111
1164
|
queue.clear();
|
|
1112
1165
|
strictTicks.splice(0, strictTicks.length);
|
|
1113
1166
|
};
|
|
1167
|
+
registry.register(throttled, { signal, aborted });
|
|
1168
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1169
|
+
signal == null ? void 0 : signal.addEventListener("abort", aborted, { once: true });
|
|
1114
1170
|
throttled.isEnabled = true;
|
|
1171
|
+
Object.defineProperty(throttled, "queueSize", {
|
|
1172
|
+
get() {
|
|
1173
|
+
return queue.size;
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1115
1176
|
return throttled;
|
|
1116
1177
|
};
|
|
1117
1178
|
}
|
|
1179
|
+
|
|
1180
|
+
// ../canvas/dist/index.mjs
|
|
1181
|
+
var __typeError3 = (msg) => {
|
|
1182
|
+
throw TypeError(msg);
|
|
1183
|
+
};
|
|
1184
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1185
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1186
|
+
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);
|
|
1118
1187
|
function createLimitPolicy({
|
|
1119
1188
|
throttle = { interval: 1e3, limit: 10 },
|
|
1120
|
-
retry:
|
|
1189
|
+
retry: retry3 = { retries: 1, factor: 1.66 },
|
|
1121
1190
|
limit = 10
|
|
1122
1191
|
}) {
|
|
1123
1192
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1124
|
-
const limiter = limit ? (
|
|
1193
|
+
const limiter = limit ? pLimit2(limit) : null;
|
|
1125
1194
|
return function limitPolicy(func) {
|
|
1126
1195
|
let currentFunc = async () => await func();
|
|
1127
1196
|
if (throttler) {
|
|
@@ -1132,13 +1201,13 @@ function createLimitPolicy({
|
|
|
1132
1201
|
const limitFunc = currentFunc;
|
|
1133
1202
|
currentFunc = () => limiter(limitFunc);
|
|
1134
1203
|
}
|
|
1135
|
-
if (
|
|
1204
|
+
if (retry3) {
|
|
1136
1205
|
const retryFunc = currentFunc;
|
|
1137
1206
|
currentFunc = () => pRetry(retryFunc, {
|
|
1138
|
-
...
|
|
1207
|
+
...retry3,
|
|
1139
1208
|
onFailedAttempt: async (error) => {
|
|
1140
|
-
if (
|
|
1141
|
-
await
|
|
1209
|
+
if (retry3.onFailedAttempt) {
|
|
1210
|
+
await retry3.onFailedAttempt(error);
|
|
1142
1211
|
}
|
|
1143
1212
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1144
1213
|
throw error;
|
|
@@ -1278,7 +1347,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1278
1347
|
}
|
|
1279
1348
|
getContentTypes(options) {
|
|
1280
1349
|
const { projectId } = this.options;
|
|
1281
|
-
const fetchUri = this.createUrl(
|
|
1350
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1282
1351
|
return this.apiClient(fetchUri);
|
|
1283
1352
|
}
|
|
1284
1353
|
getEntries(options) {
|
|
@@ -1286,11 +1355,11 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1286
1355
|
const { skipDataResolution, filters, ...params } = options;
|
|
1287
1356
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1288
1357
|
if (skipDataResolution) {
|
|
1289
|
-
const url = this.createUrl(
|
|
1358
|
+
const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
|
|
1290
1359
|
return this.apiClient(url);
|
|
1291
1360
|
}
|
|
1292
1361
|
const edgeUrl = this.createUrl(
|
|
1293
|
-
|
|
1362
|
+
__privateGet3(_ContentClient2, _entriesUrl),
|
|
1294
1363
|
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1295
1364
|
this.edgeApiHost
|
|
1296
1365
|
);
|
|
@@ -1308,7 +1377,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1308
1377
|
return this.apiClient(historyUrl);
|
|
1309
1378
|
}
|
|
1310
1379
|
async upsertContentType(body, opts = {}) {
|
|
1311
|
-
const fetchUri = this.createUrl(
|
|
1380
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1312
1381
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1313
1382
|
delete body.contentType.slugSettings;
|
|
1314
1383
|
}
|
|
@@ -1320,7 +1389,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1320
1389
|
});
|
|
1321
1390
|
}
|
|
1322
1391
|
async upsertEntry(body, options) {
|
|
1323
|
-
const fetchUri = this.createUrl(
|
|
1392
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1324
1393
|
const headers = {};
|
|
1325
1394
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1326
1395
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1334,7 +1403,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1334
1403
|
return { modified: response.headers.get("x-modified-at") };
|
|
1335
1404
|
}
|
|
1336
1405
|
async deleteContentType(body) {
|
|
1337
|
-
const fetchUri = this.createUrl(
|
|
1406
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1338
1407
|
await this.apiClient(fetchUri, {
|
|
1339
1408
|
method: "DELETE",
|
|
1340
1409
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1342,7 +1411,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1342
1411
|
});
|
|
1343
1412
|
}
|
|
1344
1413
|
async deleteEntry(body) {
|
|
1345
|
-
const fetchUri = this.createUrl(
|
|
1414
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1346
1415
|
await this.apiClient(fetchUri, {
|
|
1347
1416
|
method: "DELETE",
|
|
1348
1417
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1361,8 +1430,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1361
1430
|
};
|
|
1362
1431
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1363
1432
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1364
|
-
|
|
1365
|
-
|
|
1433
|
+
__privateAdd3(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1434
|
+
__privateAdd3(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1366
1435
|
var _url8;
|
|
1367
1436
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1368
1437
|
constructor(options) {
|
|
@@ -1371,12 +1440,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1371
1440
|
/** Fetches all DataTypes for a project */
|
|
1372
1441
|
async get(options) {
|
|
1373
1442
|
const { projectId } = this.options;
|
|
1374
|
-
const fetchUri = this.createUrl(
|
|
1443
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1375
1444
|
return await this.apiClient(fetchUri);
|
|
1376
1445
|
}
|
|
1377
1446
|
/** Updates or creates (based on id) a DataType */
|
|
1378
1447
|
async upsert(body) {
|
|
1379
|
-
const fetchUri = this.createUrl(
|
|
1448
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1380
1449
|
await this.apiClient(fetchUri, {
|
|
1381
1450
|
method: "PUT",
|
|
1382
1451
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1385,7 +1454,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1385
1454
|
}
|
|
1386
1455
|
/** Deletes a DataType */
|
|
1387
1456
|
async remove(body) {
|
|
1388
|
-
const fetchUri = this.createUrl(
|
|
1457
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1389
1458
|
await this.apiClient(fetchUri, {
|
|
1390
1459
|
method: "DELETE",
|
|
1391
1460
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1394,7 +1463,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1394
1463
|
}
|
|
1395
1464
|
};
|
|
1396
1465
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1397
|
-
|
|
1466
|
+
__privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1398
1467
|
function getComponentPath(ancestorsAndSelf) {
|
|
1399
1468
|
const path = [];
|
|
1400
1469
|
for (let i = ancestorsAndSelf.length - 1; i >= 0; i--) {
|
|
@@ -1533,7 +1602,7 @@ function hasReferencedVariables(value) {
|
|
|
1533
1602
|
return variableTokenCount;
|
|
1534
1603
|
}
|
|
1535
1604
|
function walkNodeTree(node, visitor, options) {
|
|
1536
|
-
var _a, _b;
|
|
1605
|
+
var _a, _b, _c;
|
|
1537
1606
|
const componentQueue = [
|
|
1538
1607
|
{
|
|
1539
1608
|
ancestorsAndSelf: Array.isArray(node) ? node : [{ node, type: "root" }],
|
|
@@ -1541,12 +1610,14 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1541
1610
|
}
|
|
1542
1611
|
];
|
|
1543
1612
|
const childContexts = /* @__PURE__ */ new Map();
|
|
1613
|
+
const order = (_a = options == null ? void 0 : options.order) != null ? _a : "dfs";
|
|
1614
|
+
const takeNext = () => order === "bfs" ? componentQueue.shift() : componentQueue.pop();
|
|
1544
1615
|
do {
|
|
1545
|
-
const currentQueueEntry =
|
|
1616
|
+
const currentQueueEntry = takeNext();
|
|
1546
1617
|
if (!currentQueueEntry) continue;
|
|
1547
1618
|
const currentComponent = currentQueueEntry.ancestorsAndSelf[0];
|
|
1548
1619
|
let visitDescendants = true;
|
|
1549
|
-
let descendantContext = (
|
|
1620
|
+
let descendantContext = (_b = childContexts.get(currentComponent.node)) != null ? _b : currentQueueEntry.context;
|
|
1550
1621
|
let visitorInfo;
|
|
1551
1622
|
if (currentComponent.type === "root" && isRootEntryReference(currentComponent) || currentComponent.type === "block") {
|
|
1552
1623
|
visitorInfo = {
|
|
@@ -1733,39 +1804,11 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1733
1804
|
continue;
|
|
1734
1805
|
}
|
|
1735
1806
|
const slots = "slots" in currentComponent.node && currentComponent.node.slots;
|
|
1736
|
-
|
|
1737
|
-
const slotKeys = Object.keys(slots);
|
|
1738
|
-
for (let slotIndex = slotKeys.length - 1; slotIndex >= 0; slotIndex--) {
|
|
1739
|
-
const slotKey = slotKeys[slotIndex];
|
|
1740
|
-
const components = slots[slotKey];
|
|
1741
|
-
for (let componentIndex = components.length - 1; componentIndex >= 0; componentIndex--) {
|
|
1742
|
-
const enqueueingComponent = components[componentIndex];
|
|
1743
|
-
const parentSlotIndexFn = () => {
|
|
1744
|
-
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1745
|
-
(x) => x === enqueueingComponent
|
|
1746
|
-
);
|
|
1747
|
-
return result;
|
|
1748
|
-
};
|
|
1749
|
-
componentQueue.push({
|
|
1750
|
-
ancestorsAndSelf: [
|
|
1751
|
-
{
|
|
1752
|
-
type: "slot",
|
|
1753
|
-
node: enqueueingComponent,
|
|
1754
|
-
parentSlot: slotKey,
|
|
1755
|
-
parentSlotIndexFn
|
|
1756
|
-
},
|
|
1757
|
-
...currentQueueEntry.ancestorsAndSelf
|
|
1758
|
-
],
|
|
1759
|
-
context: descendantContext
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1807
|
+
const childEntries = [];
|
|
1764
1808
|
const properties = getPropertiesValue(currentComponent.node);
|
|
1765
1809
|
if (properties) {
|
|
1766
1810
|
const propertyEntries = Object.entries(properties);
|
|
1767
|
-
for (
|
|
1768
|
-
const [propKey, propObject] = propertyEntries[propIndex];
|
|
1811
|
+
for (const [propKey, propObject] of propertyEntries) {
|
|
1769
1812
|
if (!isNestedNodeType(propObject.type)) {
|
|
1770
1813
|
continue;
|
|
1771
1814
|
}
|
|
@@ -1785,13 +1828,12 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1785
1828
|
continue;
|
|
1786
1829
|
}
|
|
1787
1830
|
}
|
|
1788
|
-
const blocks = (
|
|
1789
|
-
for (
|
|
1790
|
-
const enqueueingBlock = blocks[blockIndex];
|
|
1831
|
+
const blocks = (_c = propObject.value) != null ? _c : [];
|
|
1832
|
+
for (const enqueueingBlock of blocks) {
|
|
1791
1833
|
const blockIndexFn = () => {
|
|
1792
1834
|
return getBlockValue(currentComponent.node, propKey).findIndex((x) => x === enqueueingBlock);
|
|
1793
1835
|
};
|
|
1794
|
-
|
|
1836
|
+
childEntries.push({
|
|
1795
1837
|
ancestorsAndSelf: [
|
|
1796
1838
|
{
|
|
1797
1839
|
type: "block",
|
|
@@ -1806,6 +1848,36 @@ function walkNodeTree(node, visitor, options) {
|
|
|
1806
1848
|
}
|
|
1807
1849
|
}
|
|
1808
1850
|
}
|
|
1851
|
+
if (slots) {
|
|
1852
|
+
const slotKeys = Object.keys(slots);
|
|
1853
|
+
for (const slotKey of slotKeys) {
|
|
1854
|
+
const components = slots[slotKey];
|
|
1855
|
+
for (const enqueueingComponent of components) {
|
|
1856
|
+
const parentSlotIndexFn = () => {
|
|
1857
|
+
const result = currentComponent.node.slots[slotKey].findIndex(
|
|
1858
|
+
(x) => x === enqueueingComponent
|
|
1859
|
+
);
|
|
1860
|
+
return result;
|
|
1861
|
+
};
|
|
1862
|
+
childEntries.push({
|
|
1863
|
+
ancestorsAndSelf: [
|
|
1864
|
+
{
|
|
1865
|
+
type: "slot",
|
|
1866
|
+
node: enqueueingComponent,
|
|
1867
|
+
parentSlot: slotKey,
|
|
1868
|
+
parentSlotIndexFn
|
|
1869
|
+
},
|
|
1870
|
+
...currentQueueEntry.ancestorsAndSelf
|
|
1871
|
+
],
|
|
1872
|
+
context: descendantContext
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
if (order === "dfs") {
|
|
1878
|
+
childEntries.reverse();
|
|
1879
|
+
}
|
|
1880
|
+
componentQueue.push(...childEntries);
|
|
1809
1881
|
} while (componentQueue.length > 0);
|
|
1810
1882
|
}
|
|
1811
1883
|
function isNestedNodeType(type) {
|
|
@@ -1844,7 +1916,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1844
1916
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1845
1917
|
*/
|
|
1846
1918
|
get(options) {
|
|
1847
|
-
const fetchUri = this.createUrl(
|
|
1919
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1848
1920
|
...options,
|
|
1849
1921
|
teamId: this.teamId
|
|
1850
1922
|
});
|
|
@@ -1854,7 +1926,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1854
1926
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1855
1927
|
*/
|
|
1856
1928
|
async deploy(body) {
|
|
1857
|
-
const fetchUri = this.createUrl(
|
|
1929
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1858
1930
|
await this.apiClient(fetchUri, {
|
|
1859
1931
|
method: "PUT",
|
|
1860
1932
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1865,7 +1937,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1865
1937
|
* Removes a custom AI property editor from a Mesh app.
|
|
1866
1938
|
*/
|
|
1867
1939
|
async delete(body) {
|
|
1868
|
-
const fetchUri = this.createUrl(
|
|
1940
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1869
1941
|
await this.apiClient(fetchUri, {
|
|
1870
1942
|
method: "DELETE",
|
|
1871
1943
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1874,7 +1946,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1874
1946
|
}
|
|
1875
1947
|
};
|
|
1876
1948
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1877
|
-
|
|
1949
|
+
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1878
1950
|
var _url22;
|
|
1879
1951
|
var _projectsUrl;
|
|
1880
1952
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1883,7 +1955,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1883
1955
|
}
|
|
1884
1956
|
/** Fetches single Project */
|
|
1885
1957
|
async get(options) {
|
|
1886
|
-
const fetchUri = this.createUrl(
|
|
1958
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1887
1959
|
return await this.apiClient(fetchUri);
|
|
1888
1960
|
}
|
|
1889
1961
|
/**
|
|
@@ -1892,12 +1964,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1892
1964
|
* When omitted, returns all accessible teams and their projects.
|
|
1893
1965
|
*/
|
|
1894
1966
|
async getProjects(options) {
|
|
1895
|
-
const fetchUri = this.createUrl(
|
|
1967
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1896
1968
|
return await this.apiClient(fetchUri);
|
|
1897
1969
|
}
|
|
1898
1970
|
/** Updates or creates (based on id) a Project */
|
|
1899
1971
|
async upsert(body) {
|
|
1900
|
-
const fetchUri = this.createUrl(
|
|
1972
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1901
1973
|
return await this.apiClient(fetchUri, {
|
|
1902
1974
|
method: "PUT",
|
|
1903
1975
|
body: JSON.stringify({ ...body })
|
|
@@ -1905,7 +1977,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1905
1977
|
}
|
|
1906
1978
|
/** Deletes a Project */
|
|
1907
1979
|
async delete(body) {
|
|
1908
|
-
const fetchUri = this.createUrl(
|
|
1980
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1909
1981
|
await this.apiClient(fetchUri, {
|
|
1910
1982
|
method: "DELETE",
|
|
1911
1983
|
body: JSON.stringify({ ...body }),
|
|
@@ -1915,8 +1987,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1915
1987
|
};
|
|
1916
1988
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1917
1989
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1918
|
-
|
|
1919
|
-
|
|
1990
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1991
|
+
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1920
1992
|
var ROUTE_URL = "/api/v1/route";
|
|
1921
1993
|
var RouteClient = class extends ApiClient {
|
|
1922
1994
|
constructor(options) {
|
|
@@ -2174,7 +2246,7 @@ function createLimiter(concurrency) {
|
|
|
2174
2246
|
});
|
|
2175
2247
|
};
|
|
2176
2248
|
}
|
|
2177
|
-
async function
|
|
2249
|
+
async function retry2(fn, options) {
|
|
2178
2250
|
let lastError;
|
|
2179
2251
|
let delay = 1e3;
|
|
2180
2252
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -2214,7 +2286,7 @@ function createLimitPolicy2({
|
|
|
2214
2286
|
}
|
|
2215
2287
|
if (retryOptions) {
|
|
2216
2288
|
const retryFunc = currentFunc;
|
|
2217
|
-
currentFunc = () =>
|
|
2289
|
+
currentFunc = () => retry2(retryFunc, {
|
|
2218
2290
|
...retryOptions,
|
|
2219
2291
|
onFailedAttempt: async (error) => {
|
|
2220
2292
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2348,14 +2420,14 @@ var getManifest = async (options) => {
|
|
|
2348
2420
|
var import_server_only3 = require("server-only");
|
|
2349
2421
|
|
|
2350
2422
|
// ../project-map/dist/index.mjs
|
|
2351
|
-
var
|
|
2423
|
+
var __typeError4 = (msg) => {
|
|
2352
2424
|
throw TypeError(msg);
|
|
2353
2425
|
};
|
|
2354
|
-
var
|
|
2355
|
-
var
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var __privateMethod = (obj, member, method) => (
|
|
2426
|
+
var __accessCheck4 = (obj, member, msg) => member.has(obj) || __typeError4("Cannot " + msg);
|
|
2427
|
+
var __privateGet4 = (obj, member, getter) => (__accessCheck4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2428
|
+
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);
|
|
2429
|
+
var __privateSet2 = (obj, member, value, setter) => (__accessCheck4(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2430
|
+
var __privateMethod = (obj, member, method) => (__accessCheck4(obj, member, "access private method"), method);
|
|
2359
2431
|
var ProjectMapClient = class extends ApiClient {
|
|
2360
2432
|
constructor(options) {
|
|
2361
2433
|
super(options);
|
|
@@ -2502,12 +2574,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2502
2574
|
var _Route = class _Route2 {
|
|
2503
2575
|
constructor(route) {
|
|
2504
2576
|
this.route = route;
|
|
2505
|
-
|
|
2577
|
+
__privateAdd4(this, _routeInfo);
|
|
2506
2578
|
var _a;
|
|
2507
|
-
|
|
2579
|
+
__privateSet2(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2508
2580
|
}
|
|
2509
2581
|
get dynamicSegmentCount() {
|
|
2510
|
-
return
|
|
2582
|
+
return __privateGet4(this, _routeInfo).segments.reduce(
|
|
2511
2583
|
(count, segment) => {
|
|
2512
2584
|
var _a;
|
|
2513
2585
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2519,7 +2591,7 @@ var _Route = class _Route2 {
|
|
|
2519
2591
|
matches(path) {
|
|
2520
2592
|
var _a, _b;
|
|
2521
2593
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2522
|
-
const { segments: routeSegments } =
|
|
2594
|
+
const { segments: routeSegments } = __privateGet4(this, _routeInfo);
|
|
2523
2595
|
if (pathSegments.length !== routeSegments.length) {
|
|
2524
2596
|
return { match: false };
|
|
2525
2597
|
}
|
|
@@ -2540,7 +2612,7 @@ var _Route = class _Route2 {
|
|
|
2540
2612
|
return { match: false };
|
|
2541
2613
|
}
|
|
2542
2614
|
}
|
|
2543
|
-
for (const [key, value] of
|
|
2615
|
+
for (const [key, value] of __privateGet4(this, _routeInfo).queryParams) {
|
|
2544
2616
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2545
2617
|
}
|
|
2546
2618
|
return possibleMatch;
|
|
@@ -2550,7 +2622,7 @@ var _Route = class _Route2 {
|
|
|
2550
2622
|
*/
|
|
2551
2623
|
expand(options) {
|
|
2552
2624
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2553
|
-
const path =
|
|
2625
|
+
const path = __privateGet4(this, _routeInfo).segments.map((segment) => {
|
|
2554
2626
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2555
2627
|
if (!dynamicSegmentName) {
|
|
2556
2628
|
return segment;
|
|
@@ -2601,7 +2673,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2601
2673
|
}
|
|
2602
2674
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2603
2675
|
};
|
|
2604
|
-
|
|
2676
|
+
__privateAdd4(_Route, _Route_static);
|
|
2605
2677
|
_Route.dynamicSegmentPrefix = ":";
|
|
2606
2678
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2607
2679
|
if (!doNotEscapeVariables) {
|