@uniformdev/next-app-router 20.50.2-alpha.146 → 20.50.2-alpha.167
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 +670 -515
- package/dist/cache.mjs +670 -515
- package/dist/component.js +81 -380
- package/dist/component.mjs +81 -380
- package/dist/handler.js +755 -640
- package/dist/handler.mjs +755 -640
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +775 -649
- package/dist/index.js +778 -652
- package/dist/index.mjs +775 -649
- package/dist/middleware.js +716 -599
- package/dist/middleware.mjs +716 -599
- package/package.json +19 -19
package/dist/cache.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
|
|
|
@@ -161,14 +409,14 @@ var import_next_app_router_shared = require("@uniformdev/next-app-router-shared"
|
|
|
161
409
|
// ../context/dist/api/api.mjs
|
|
162
410
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
163
411
|
var __defProp2 = Object.defineProperty;
|
|
164
|
-
var
|
|
412
|
+
var __typeError2 = (msg) => {
|
|
165
413
|
throw TypeError(msg);
|
|
166
414
|
};
|
|
167
|
-
var
|
|
168
|
-
var
|
|
169
|
-
var
|
|
170
|
-
var
|
|
171
|
-
var
|
|
415
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
416
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
417
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
418
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
419
|
+
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);
|
|
172
420
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
173
421
|
var ApiClientError = class _ApiClientError extends Error {
|
|
174
422
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -176,18 +424,18 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
176
424
|
`${errorMessage}
|
|
177
425
|
${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
|
|
178
426
|
);
|
|
179
|
-
this
|
|
180
|
-
this
|
|
181
|
-
this
|
|
182
|
-
this
|
|
183
|
-
this
|
|
184
|
-
this
|
|
427
|
+
__publicField2(this, "errorMessage", errorMessage);
|
|
428
|
+
__publicField2(this, "fetchMethod", fetchMethod);
|
|
429
|
+
__publicField2(this, "fetchUri", fetchUri);
|
|
430
|
+
__publicField2(this, "statusCode", statusCode);
|
|
431
|
+
__publicField2(this, "statusText", statusText);
|
|
432
|
+
__publicField2(this, "requestId", requestId);
|
|
185
433
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
186
434
|
}
|
|
187
435
|
};
|
|
188
436
|
var ApiClient = class _ApiClient {
|
|
189
437
|
constructor(options) {
|
|
190
|
-
|
|
438
|
+
__publicField2(this, "options");
|
|
191
439
|
var _a, _b, _c, _d, _e;
|
|
192
440
|
if (!options.apiKey && !options.bearerToken) {
|
|
193
441
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -357,12 +605,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
357
605
|
/** Fetches all aggregates for a project */
|
|
358
606
|
async get(options) {
|
|
359
607
|
const { projectId } = this.options;
|
|
360
|
-
const fetchUri = this.createUrl(
|
|
608
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url), { ...options, projectId });
|
|
361
609
|
return await this.apiClient(fetchUri);
|
|
362
610
|
}
|
|
363
611
|
/** Updates or creates (based on id) an Aggregate */
|
|
364
612
|
async upsert(body) {
|
|
365
|
-
const fetchUri = this.createUrl(
|
|
613
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
366
614
|
await this.apiClient(fetchUri, {
|
|
367
615
|
method: "PUT",
|
|
368
616
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -371,7 +619,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
371
619
|
}
|
|
372
620
|
/** Deletes an Aggregate */
|
|
373
621
|
async remove(body) {
|
|
374
|
-
const fetchUri = this.createUrl(
|
|
622
|
+
const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
|
|
375
623
|
await this.apiClient(fetchUri, {
|
|
376
624
|
method: "DELETE",
|
|
377
625
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -380,7 +628,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
380
628
|
}
|
|
381
629
|
};
|
|
382
630
|
_url = /* @__PURE__ */ new WeakMap();
|
|
383
|
-
|
|
631
|
+
__privateAdd2(_AggregateClient, _url, "/api/v2/aggregate");
|
|
384
632
|
var _url2;
|
|
385
633
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
386
634
|
constructor(options) {
|
|
@@ -389,12 +637,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
389
637
|
/** Fetches the known score dimensions for a project */
|
|
390
638
|
async get(options) {
|
|
391
639
|
const { projectId } = this.options;
|
|
392
|
-
const fetchUri = this.createUrl(
|
|
640
|
+
const fetchUri = this.createUrl(__privateGet2(_DimensionClient2, _url2), { ...options, projectId });
|
|
393
641
|
return await this.apiClient(fetchUri);
|
|
394
642
|
}
|
|
395
643
|
};
|
|
396
644
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
397
|
-
|
|
645
|
+
__privateAdd2(_DimensionClient, _url2, "/api/v2/dimension");
|
|
398
646
|
var _url3;
|
|
399
647
|
var _valueUrl;
|
|
400
648
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -404,12 +652,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
404
652
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
405
653
|
async get(options) {
|
|
406
654
|
const { projectId } = this.options;
|
|
407
|
-
const fetchUri = this.createUrl(
|
|
655
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
408
656
|
return await this.apiClient(fetchUri);
|
|
409
657
|
}
|
|
410
658
|
/** Updates or creates (based on id) an enrichment category */
|
|
411
659
|
async upsertCategory(body) {
|
|
412
|
-
const fetchUri = this.createUrl(
|
|
660
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
413
661
|
await this.apiClient(fetchUri, {
|
|
414
662
|
method: "PUT",
|
|
415
663
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -418,7 +666,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
418
666
|
}
|
|
419
667
|
/** Deletes an enrichment category */
|
|
420
668
|
async removeCategory(body) {
|
|
421
|
-
const fetchUri = this.createUrl(
|
|
669
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
|
|
422
670
|
await this.apiClient(fetchUri, {
|
|
423
671
|
method: "DELETE",
|
|
424
672
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -427,7 +675,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
427
675
|
}
|
|
428
676
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
429
677
|
async upsertValue(body) {
|
|
430
|
-
const fetchUri = this.createUrl(
|
|
678
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
431
679
|
await this.apiClient(fetchUri, {
|
|
432
680
|
method: "PUT",
|
|
433
681
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -436,7 +684,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
436
684
|
}
|
|
437
685
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
438
686
|
async removeValue(body) {
|
|
439
|
-
const fetchUri = this.createUrl(
|
|
687
|
+
const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
|
|
440
688
|
await this.apiClient(fetchUri, {
|
|
441
689
|
method: "DELETE",
|
|
442
690
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -446,8 +694,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
446
694
|
};
|
|
447
695
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
448
696
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
449
|
-
|
|
450
|
-
|
|
697
|
+
__privateAdd2(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
698
|
+
__privateAdd2(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
451
699
|
var _url4;
|
|
452
700
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
453
701
|
constructor(options) {
|
|
@@ -456,7 +704,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
456
704
|
/** Fetches the Context manifest for a project */
|
|
457
705
|
async get(options) {
|
|
458
706
|
const { projectId } = this.options;
|
|
459
|
-
const fetchUri = this.createUrl(
|
|
707
|
+
const fetchUri = this.createUrl(__privateGet2(_ManifestClient2, _url4), { ...options, projectId });
|
|
460
708
|
return await this.apiClient(fetchUri);
|
|
461
709
|
}
|
|
462
710
|
/** Publishes the Context manifest for a project */
|
|
@@ -470,7 +718,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
470
718
|
}
|
|
471
719
|
};
|
|
472
720
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
473
|
-
|
|
721
|
+
__privateAdd2(_ManifestClient, _url4, "/api/v2/manifest");
|
|
474
722
|
var ManifestClient = _ManifestClient;
|
|
475
723
|
var _url5;
|
|
476
724
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
@@ -480,12 +728,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
480
728
|
/** Fetches all Quirks for a project */
|
|
481
729
|
async get(options) {
|
|
482
730
|
const { projectId } = this.options;
|
|
483
|
-
const fetchUri = this.createUrl(
|
|
731
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5), { ...options, projectId });
|
|
484
732
|
return await this.apiClient(fetchUri);
|
|
485
733
|
}
|
|
486
734
|
/** Updates or creates (based on id) a Quirk */
|
|
487
735
|
async upsert(body) {
|
|
488
|
-
const fetchUri = this.createUrl(
|
|
736
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
489
737
|
await this.apiClient(fetchUri, {
|
|
490
738
|
method: "PUT",
|
|
491
739
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -494,7 +742,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
494
742
|
}
|
|
495
743
|
/** Deletes a Quirk */
|
|
496
744
|
async remove(body) {
|
|
497
|
-
const fetchUri = this.createUrl(
|
|
745
|
+
const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
|
|
498
746
|
await this.apiClient(fetchUri, {
|
|
499
747
|
method: "DELETE",
|
|
500
748
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -503,7 +751,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
503
751
|
}
|
|
504
752
|
};
|
|
505
753
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
506
|
-
|
|
754
|
+
__privateAdd2(_QuirkClient, _url5, "/api/v2/quirk");
|
|
507
755
|
var _url6;
|
|
508
756
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
509
757
|
constructor(options) {
|
|
@@ -512,12 +760,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
512
760
|
/** Fetches all Signals for a project */
|
|
513
761
|
async get(options) {
|
|
514
762
|
const { projectId } = this.options;
|
|
515
|
-
const fetchUri = this.createUrl(
|
|
763
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6), { ...options, projectId });
|
|
516
764
|
return await this.apiClient(fetchUri);
|
|
517
765
|
}
|
|
518
766
|
/** Updates or creates (based on id) a Signal */
|
|
519
767
|
async upsert(body) {
|
|
520
|
-
const fetchUri = this.createUrl(
|
|
768
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
521
769
|
await this.apiClient(fetchUri, {
|
|
522
770
|
method: "PUT",
|
|
523
771
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -526,7 +774,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
526
774
|
}
|
|
527
775
|
/** Deletes a Signal */
|
|
528
776
|
async remove(body) {
|
|
529
|
-
const fetchUri = this.createUrl(
|
|
777
|
+
const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
|
|
530
778
|
await this.apiClient(fetchUri, {
|
|
531
779
|
method: "DELETE",
|
|
532
780
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -535,7 +783,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
535
783
|
}
|
|
536
784
|
};
|
|
537
785
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
538
|
-
|
|
786
|
+
__privateAdd2(_SignalClient, _url6, "/api/v2/signal");
|
|
539
787
|
var _url7;
|
|
540
788
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
541
789
|
constructor(options) {
|
|
@@ -544,12 +792,12 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
544
792
|
/** Fetches all Tests for a project */
|
|
545
793
|
async get(options) {
|
|
546
794
|
const { projectId } = this.options;
|
|
547
|
-
const fetchUri = this.createUrl(
|
|
795
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7), { ...options, projectId });
|
|
548
796
|
return await this.apiClient(fetchUri);
|
|
549
797
|
}
|
|
550
798
|
/** Updates or creates (based on id) a Test */
|
|
551
799
|
async upsert(body) {
|
|
552
|
-
const fetchUri = this.createUrl(
|
|
800
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
553
801
|
await this.apiClient(fetchUri, {
|
|
554
802
|
method: "PUT",
|
|
555
803
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -558,7 +806,7 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
558
806
|
}
|
|
559
807
|
/** Deletes a Test */
|
|
560
808
|
async remove(body) {
|
|
561
|
-
const fetchUri = this.createUrl(
|
|
809
|
+
const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
|
|
562
810
|
await this.apiClient(fetchUri, {
|
|
563
811
|
method: "DELETE",
|
|
564
812
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -567,393 +815,194 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
567
815
|
}
|
|
568
816
|
};
|
|
569
817
|
_url7 = /* @__PURE__ */ new WeakMap();
|
|
570
|
-
|
|
818
|
+
__privateAdd2(_TestClient, _url7, "/api/v2/test");
|
|
571
819
|
|
|
572
|
-
//
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
579
|
-
var __typeError2 = (msg) => {
|
|
580
|
-
throw TypeError(msg);
|
|
581
|
-
};
|
|
582
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
583
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
584
|
-
};
|
|
585
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
586
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
587
|
-
for (let key of __getOwnPropNames2(from))
|
|
588
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
589
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
820
|
+
// ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
821
|
+
var Node = class {
|
|
822
|
+
constructor(value) {
|
|
823
|
+
__publicField(this, "value");
|
|
824
|
+
__publicField(this, "next");
|
|
825
|
+
this.value = value;
|
|
590
826
|
}
|
|
591
|
-
return to;
|
|
592
827
|
};
|
|
593
|
-
var
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
this.value = value;
|
|
612
|
-
this.next = void 0;
|
|
613
|
-
}
|
|
614
|
-
};
|
|
615
|
-
var Queue = class {
|
|
616
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
617
|
-
// #_head;
|
|
618
|
-
// #_tail;
|
|
619
|
-
// #_size;
|
|
620
|
-
constructor() {
|
|
621
|
-
this.clear();
|
|
622
|
-
}
|
|
623
|
-
enqueue(value) {
|
|
624
|
-
const node = new Node(value);
|
|
625
|
-
if (this._head) {
|
|
626
|
-
this._tail.next = node;
|
|
627
|
-
this._tail = node;
|
|
628
|
-
} else {
|
|
629
|
-
this._head = node;
|
|
630
|
-
this._tail = node;
|
|
631
|
-
}
|
|
632
|
-
this._size++;
|
|
633
|
-
}
|
|
634
|
-
dequeue() {
|
|
635
|
-
const current = this._head;
|
|
636
|
-
if (!current) {
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
this._head = this._head.next;
|
|
640
|
-
this._size--;
|
|
641
|
-
return current.value;
|
|
642
|
-
}
|
|
643
|
-
clear() {
|
|
644
|
-
this._head = void 0;
|
|
645
|
-
this._tail = void 0;
|
|
646
|
-
this._size = 0;
|
|
647
|
-
}
|
|
648
|
-
get size() {
|
|
649
|
-
return this._size;
|
|
650
|
-
}
|
|
651
|
-
*[Symbol.iterator]() {
|
|
652
|
-
let current = this._head;
|
|
653
|
-
while (current) {
|
|
654
|
-
yield current.value;
|
|
655
|
-
current = current.next;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
module2.exports = Queue;
|
|
828
|
+
var _head, _tail, _size;
|
|
829
|
+
var Queue = class {
|
|
830
|
+
constructor() {
|
|
831
|
+
__privateAdd(this, _head);
|
|
832
|
+
__privateAdd(this, _tail);
|
|
833
|
+
__privateAdd(this, _size);
|
|
834
|
+
this.clear();
|
|
835
|
+
}
|
|
836
|
+
enqueue(value) {
|
|
837
|
+
const node = new Node(value);
|
|
838
|
+
if (__privateGet(this, _head)) {
|
|
839
|
+
__privateGet(this, _tail).next = node;
|
|
840
|
+
__privateSet(this, _tail, node);
|
|
841
|
+
} else {
|
|
842
|
+
__privateSet(this, _head, node);
|
|
843
|
+
__privateSet(this, _tail, node);
|
|
844
|
+
}
|
|
845
|
+
__privateWrapper(this, _size)._++;
|
|
660
846
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
const next = () => {
|
|
673
|
-
activeCount--;
|
|
674
|
-
if (queue.size > 0) {
|
|
675
|
-
queue.dequeue()();
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
const run = async (fn, resolve, ...args) => {
|
|
679
|
-
activeCount++;
|
|
680
|
-
const result = (async () => fn(...args))();
|
|
681
|
-
resolve(result);
|
|
682
|
-
try {
|
|
683
|
-
await result;
|
|
684
|
-
} catch (e) {
|
|
685
|
-
}
|
|
686
|
-
next();
|
|
687
|
-
};
|
|
688
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
689
|
-
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
690
|
-
(async () => {
|
|
691
|
-
await Promise.resolve();
|
|
692
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
693
|
-
queue.dequeue()();
|
|
694
|
-
}
|
|
695
|
-
})();
|
|
696
|
-
};
|
|
697
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
698
|
-
enqueue(fn, resolve, ...args);
|
|
699
|
-
});
|
|
700
|
-
Object.defineProperties(generator, {
|
|
701
|
-
activeCount: {
|
|
702
|
-
get: () => activeCount
|
|
703
|
-
},
|
|
704
|
-
pendingCount: {
|
|
705
|
-
get: () => queue.size
|
|
706
|
-
},
|
|
707
|
-
clearQueue: {
|
|
708
|
-
value: () => {
|
|
709
|
-
queue.clear();
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
return generator;
|
|
714
|
-
};
|
|
715
|
-
module2.exports = pLimit2;
|
|
847
|
+
dequeue() {
|
|
848
|
+
const current = __privateGet(this, _head);
|
|
849
|
+
if (!current) {
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
853
|
+
__privateWrapper(this, _size)._--;
|
|
854
|
+
if (!__privateGet(this, _head)) {
|
|
855
|
+
__privateSet(this, _tail, void 0);
|
|
856
|
+
}
|
|
857
|
+
return current.value;
|
|
716
858
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
"use strict";
|
|
721
|
-
function RetryOperation(timeouts, options) {
|
|
722
|
-
if (typeof options === "boolean") {
|
|
723
|
-
options = { forever: options };
|
|
724
|
-
}
|
|
725
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
726
|
-
this._timeouts = timeouts;
|
|
727
|
-
this._options = options || {};
|
|
728
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
729
|
-
this._fn = null;
|
|
730
|
-
this._errors = [];
|
|
731
|
-
this._attempts = 1;
|
|
732
|
-
this._operationTimeout = null;
|
|
733
|
-
this._operationTimeoutCb = null;
|
|
734
|
-
this._timeout = null;
|
|
735
|
-
this._operationStart = null;
|
|
736
|
-
this._timer = null;
|
|
737
|
-
if (this._options.forever) {
|
|
738
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
739
|
-
}
|
|
859
|
+
peek() {
|
|
860
|
+
if (!__privateGet(this, _head)) {
|
|
861
|
+
return;
|
|
740
862
|
}
|
|
741
|
-
|
|
742
|
-
RetryOperation.prototype.reset = function() {
|
|
743
|
-
this._attempts = 1;
|
|
744
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
745
|
-
};
|
|
746
|
-
RetryOperation.prototype.stop = function() {
|
|
747
|
-
if (this._timeout) {
|
|
748
|
-
clearTimeout(this._timeout);
|
|
749
|
-
}
|
|
750
|
-
if (this._timer) {
|
|
751
|
-
clearTimeout(this._timer);
|
|
752
|
-
}
|
|
753
|
-
this._timeouts = [];
|
|
754
|
-
this._cachedTimeouts = null;
|
|
755
|
-
};
|
|
756
|
-
RetryOperation.prototype.retry = function(err) {
|
|
757
|
-
if (this._timeout) {
|
|
758
|
-
clearTimeout(this._timeout);
|
|
759
|
-
}
|
|
760
|
-
if (!err) {
|
|
761
|
-
return false;
|
|
762
|
-
}
|
|
763
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
764
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
765
|
-
this._errors.push(err);
|
|
766
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
767
|
-
return false;
|
|
768
|
-
}
|
|
769
|
-
this._errors.push(err);
|
|
770
|
-
var timeout = this._timeouts.shift();
|
|
771
|
-
if (timeout === void 0) {
|
|
772
|
-
if (this._cachedTimeouts) {
|
|
773
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
774
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
775
|
-
} else {
|
|
776
|
-
return false;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
var self = this;
|
|
780
|
-
this._timer = setTimeout(function() {
|
|
781
|
-
self._attempts++;
|
|
782
|
-
if (self._operationTimeoutCb) {
|
|
783
|
-
self._timeout = setTimeout(function() {
|
|
784
|
-
self._operationTimeoutCb(self._attempts);
|
|
785
|
-
}, self._operationTimeout);
|
|
786
|
-
if (self._options.unref) {
|
|
787
|
-
self._timeout.unref();
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
self._fn(self._attempts);
|
|
791
|
-
}, timeout);
|
|
792
|
-
if (this._options.unref) {
|
|
793
|
-
this._timer.unref();
|
|
794
|
-
}
|
|
795
|
-
return true;
|
|
796
|
-
};
|
|
797
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
798
|
-
this._fn = fn;
|
|
799
|
-
if (timeoutOps) {
|
|
800
|
-
if (timeoutOps.timeout) {
|
|
801
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
802
|
-
}
|
|
803
|
-
if (timeoutOps.cb) {
|
|
804
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
var self = this;
|
|
808
|
-
if (this._operationTimeoutCb) {
|
|
809
|
-
this._timeout = setTimeout(function() {
|
|
810
|
-
self._operationTimeoutCb();
|
|
811
|
-
}, self._operationTimeout);
|
|
812
|
-
}
|
|
813
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
814
|
-
this._fn(this._attempts);
|
|
815
|
-
};
|
|
816
|
-
RetryOperation.prototype.try = function(fn) {
|
|
817
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
818
|
-
this.attempt(fn);
|
|
819
|
-
};
|
|
820
|
-
RetryOperation.prototype.start = function(fn) {
|
|
821
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
822
|
-
this.attempt(fn);
|
|
823
|
-
};
|
|
824
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
825
|
-
RetryOperation.prototype.errors = function() {
|
|
826
|
-
return this._errors;
|
|
827
|
-
};
|
|
828
|
-
RetryOperation.prototype.attempts = function() {
|
|
829
|
-
return this._attempts;
|
|
830
|
-
};
|
|
831
|
-
RetryOperation.prototype.mainError = function() {
|
|
832
|
-
if (this._errors.length === 0) {
|
|
833
|
-
return null;
|
|
834
|
-
}
|
|
835
|
-
var counts = {};
|
|
836
|
-
var mainError = null;
|
|
837
|
-
var mainErrorCount = 0;
|
|
838
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
839
|
-
var error = this._errors[i];
|
|
840
|
-
var message = error.message;
|
|
841
|
-
var count = (counts[message] || 0) + 1;
|
|
842
|
-
counts[message] = count;
|
|
843
|
-
if (count >= mainErrorCount) {
|
|
844
|
-
mainError = error;
|
|
845
|
-
mainErrorCount = count;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
return mainError;
|
|
849
|
-
};
|
|
863
|
+
return __privateGet(this, _head).value;
|
|
850
864
|
}
|
|
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
|
-
|
|
885
|
-
|
|
886
|
-
|
|
865
|
+
clear() {
|
|
866
|
+
__privateSet(this, _head, void 0);
|
|
867
|
+
__privateSet(this, _tail, void 0);
|
|
868
|
+
__privateSet(this, _size, 0);
|
|
869
|
+
}
|
|
870
|
+
get size() {
|
|
871
|
+
return __privateGet(this, _size);
|
|
872
|
+
}
|
|
873
|
+
*[Symbol.iterator]() {
|
|
874
|
+
let current = __privateGet(this, _head);
|
|
875
|
+
while (current) {
|
|
876
|
+
yield current.value;
|
|
877
|
+
current = current.next;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
*drain() {
|
|
881
|
+
while (__privateGet(this, _head)) {
|
|
882
|
+
yield this.dequeue();
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
_head = new WeakMap();
|
|
887
|
+
_tail = new WeakMap();
|
|
888
|
+
_size = new WeakMap();
|
|
889
|
+
|
|
890
|
+
// ../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js
|
|
891
|
+
function pLimit2(concurrency) {
|
|
892
|
+
validateConcurrency(concurrency);
|
|
893
|
+
const queue = new Queue();
|
|
894
|
+
let activeCount = 0;
|
|
895
|
+
const resumeNext = () => {
|
|
896
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
897
|
+
queue.dequeue()();
|
|
898
|
+
activeCount++;
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
const next = () => {
|
|
902
|
+
activeCount--;
|
|
903
|
+
resumeNext();
|
|
904
|
+
};
|
|
905
|
+
const run = async (function_, resolve, arguments_) => {
|
|
906
|
+
const result = (async () => function_(...arguments_))();
|
|
907
|
+
resolve(result);
|
|
908
|
+
try {
|
|
909
|
+
await result;
|
|
910
|
+
} catch (e) {
|
|
911
|
+
}
|
|
912
|
+
next();
|
|
913
|
+
};
|
|
914
|
+
const enqueue = (function_, resolve, arguments_) => {
|
|
915
|
+
new Promise((internalResolve) => {
|
|
916
|
+
queue.enqueue(internalResolve);
|
|
917
|
+
}).then(
|
|
918
|
+
run.bind(void 0, function_, resolve, arguments_)
|
|
919
|
+
);
|
|
920
|
+
(async () => {
|
|
921
|
+
await Promise.resolve();
|
|
922
|
+
if (activeCount < concurrency) {
|
|
923
|
+
resumeNext();
|
|
887
924
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
925
|
+
})();
|
|
926
|
+
};
|
|
927
|
+
const generator = (function_, ...arguments_) => new Promise((resolve) => {
|
|
928
|
+
enqueue(function_, resolve, arguments_);
|
|
929
|
+
});
|
|
930
|
+
Object.defineProperties(generator, {
|
|
931
|
+
activeCount: {
|
|
932
|
+
get: () => activeCount
|
|
933
|
+
},
|
|
934
|
+
pendingCount: {
|
|
935
|
+
get: () => queue.size
|
|
936
|
+
},
|
|
937
|
+
clearQueue: {
|
|
938
|
+
value() {
|
|
939
|
+
queue.clear();
|
|
903
940
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
941
|
+
},
|
|
942
|
+
concurrency: {
|
|
943
|
+
get: () => concurrency,
|
|
944
|
+
set(newConcurrency) {
|
|
945
|
+
validateConcurrency(newConcurrency);
|
|
946
|
+
concurrency = newConcurrency;
|
|
947
|
+
queueMicrotask(() => {
|
|
948
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
949
|
+
resumeNext();
|
|
909
950
|
}
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
for (var i = 0; i < methods.length; i++) {
|
|
913
|
-
var method = methods[i];
|
|
914
|
-
var original = obj[method];
|
|
915
|
-
obj[method] = function retryWrapper(original2) {
|
|
916
|
-
var op = exports2.operation(options);
|
|
917
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
918
|
-
var callback = args.pop();
|
|
919
|
-
args.push(function(err) {
|
|
920
|
-
if (op.retry(err)) {
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
if (err) {
|
|
924
|
-
arguments[0] = op.mainError();
|
|
925
|
-
}
|
|
926
|
-
callback.apply(this, arguments);
|
|
927
|
-
});
|
|
928
|
-
op.attempt(function() {
|
|
929
|
-
original2.apply(obj, args);
|
|
930
|
-
});
|
|
931
|
-
}.bind(obj, original);
|
|
932
|
-
obj[method].options = options;
|
|
951
|
+
});
|
|
933
952
|
}
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
return generator;
|
|
956
|
+
}
|
|
957
|
+
function validateConcurrency(concurrency) {
|
|
958
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
959
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
941
960
|
}
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
var
|
|
946
|
-
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
964
|
+
var import_retry = __toESM(require_retry2(), 1);
|
|
965
|
+
|
|
966
|
+
// ../../node_modules/.pnpm/is-network-error@1.3.2/node_modules/is-network-error/index.js
|
|
967
|
+
var objectToString = Object.prototype.toString;
|
|
968
|
+
var isError = (value) => objectToString.call(value) === "[object Error]";
|
|
969
|
+
var errorMessages = /* @__PURE__ */ new Set([
|
|
970
|
+
"network error",
|
|
947
971
|
// Chrome
|
|
948
972
|
"NetworkError when attempting to fetch resource.",
|
|
949
973
|
// Firefox
|
|
950
974
|
"The Internet connection appears to be offline.",
|
|
951
|
-
// Safari
|
|
975
|
+
// Safari 16
|
|
952
976
|
"Network request failed",
|
|
953
977
|
// `cross-fetch`
|
|
954
|
-
"fetch failed"
|
|
978
|
+
"fetch failed",
|
|
979
|
+
// Undici (Node.js)
|
|
980
|
+
"terminated",
|
|
955
981
|
// Undici (Node.js)
|
|
982
|
+
" A network error occurred.",
|
|
983
|
+
// Bun (WebKit)
|
|
984
|
+
"Network connection lost"
|
|
985
|
+
// Cloudflare Workers (fetch)
|
|
956
986
|
]);
|
|
987
|
+
function isNetworkError(error) {
|
|
988
|
+
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
989
|
+
if (!isValid) {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
const { message, stack } = error;
|
|
993
|
+
if (message === "Load failed" || message.startsWith("Load failed (") && message.endsWith(")")) {
|
|
994
|
+
return stack === void 0 || "__sentry_captured__" in error;
|
|
995
|
+
}
|
|
996
|
+
if (message.startsWith("error sending request for url")) {
|
|
997
|
+
return true;
|
|
998
|
+
}
|
|
999
|
+
if (message === "Failed to fetch" || message.startsWith("Failed to fetch (") && message.endsWith(")")) {
|
|
1000
|
+
return true;
|
|
1001
|
+
}
|
|
1002
|
+
return errorMessages.has(message);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
957
1006
|
var AbortError = class extends Error {
|
|
958
1007
|
constructor(message) {
|
|
959
1008
|
super();
|
|
@@ -974,63 +1023,71 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
974
1023
|
error.retriesLeft = retriesLeft;
|
|
975
1024
|
return error;
|
|
976
1025
|
};
|
|
977
|
-
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
978
|
-
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
979
1026
|
async function pRetry(input, options) {
|
|
980
1027
|
return new Promise((resolve, reject) => {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
retries: 10,
|
|
985
|
-
...options
|
|
1028
|
+
var _a, _b, _c;
|
|
1029
|
+
options = { ...options };
|
|
1030
|
+
(_a = options.onFailedAttempt) != null ? _a : options.onFailedAttempt = () => {
|
|
986
1031
|
};
|
|
1032
|
+
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1033
|
+
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
987
1034
|
const operation = import_retry.default.operation(options);
|
|
1035
|
+
const abortHandler = () => {
|
|
1036
|
+
var _a2;
|
|
1037
|
+
operation.stop();
|
|
1038
|
+
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1039
|
+
};
|
|
1040
|
+
if (options.signal && !options.signal.aborted) {
|
|
1041
|
+
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1042
|
+
}
|
|
1043
|
+
const cleanUp = () => {
|
|
1044
|
+
var _a2;
|
|
1045
|
+
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1046
|
+
operation.stop();
|
|
1047
|
+
};
|
|
988
1048
|
operation.attempt(async (attemptNumber) => {
|
|
989
1049
|
try {
|
|
990
|
-
|
|
1050
|
+
const result = await input(attemptNumber);
|
|
1051
|
+
cleanUp();
|
|
1052
|
+
resolve(result);
|
|
991
1053
|
} catch (error) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
} else {
|
|
1054
|
+
try {
|
|
1055
|
+
if (!(error instanceof Error)) {
|
|
1056
|
+
throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
|
|
1057
|
+
}
|
|
1058
|
+
if (error instanceof AbortError) {
|
|
1059
|
+
throw error.originalError;
|
|
1060
|
+
}
|
|
1061
|
+
if (error instanceof TypeError && !isNetworkError(error)) {
|
|
1062
|
+
throw error;
|
|
1063
|
+
}
|
|
1003
1064
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
reject(error2);
|
|
1008
|
-
return;
|
|
1065
|
+
if (!await options.shouldRetry(error)) {
|
|
1066
|
+
operation.stop();
|
|
1067
|
+
reject(error);
|
|
1009
1068
|
}
|
|
1069
|
+
await options.onFailedAttempt(error);
|
|
1010
1070
|
if (!operation.retry(error)) {
|
|
1011
|
-
|
|
1071
|
+
throw operation.mainError();
|
|
1012
1072
|
}
|
|
1073
|
+
} catch (finalError) {
|
|
1074
|
+
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1075
|
+
cleanUp();
|
|
1076
|
+
reject(finalError);
|
|
1013
1077
|
}
|
|
1014
1078
|
}
|
|
1015
1079
|
});
|
|
1016
|
-
if (options.signal && !options.signal.aborted) {
|
|
1017
|
-
options.signal.addEventListener("abort", () => {
|
|
1018
|
-
operation.stop();
|
|
1019
|
-
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1020
|
-
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1021
|
-
}, {
|
|
1022
|
-
once: true
|
|
1023
|
-
});
|
|
1024
|
-
}
|
|
1025
1080
|
});
|
|
1026
1081
|
}
|
|
1082
|
+
|
|
1083
|
+
// ../../node_modules/.pnpm/p-throttle@6.2.0/node_modules/p-throttle/index.js
|
|
1027
1084
|
var AbortError2 = class extends Error {
|
|
1028
1085
|
constructor() {
|
|
1029
1086
|
super("Throttled function aborted");
|
|
1030
1087
|
this.name = "AbortError";
|
|
1031
1088
|
}
|
|
1032
1089
|
};
|
|
1033
|
-
function pThrottle({ limit, interval, strict }) {
|
|
1090
|
+
function pThrottle({ limit, interval, strict, onDelay }) {
|
|
1034
1091
|
if (!Number.isFinite(limit)) {
|
|
1035
1092
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1036
1093
|
}
|
|
@@ -1058,32 +1115,38 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1058
1115
|
const strictTicks = [];
|
|
1059
1116
|
function strictDelay() {
|
|
1060
1117
|
const now = Date.now();
|
|
1061
|
-
if (strictTicks.length
|
|
1062
|
-
strictTicks.
|
|
1063
|
-
return 0;
|
|
1118
|
+
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1119
|
+
strictTicks.length = 0;
|
|
1064
1120
|
}
|
|
1065
|
-
|
|
1066
|
-
if (now >= earliestTime) {
|
|
1121
|
+
if (strictTicks.length < limit) {
|
|
1067
1122
|
strictTicks.push(now);
|
|
1068
1123
|
return 0;
|
|
1069
1124
|
}
|
|
1070
|
-
strictTicks
|
|
1071
|
-
|
|
1125
|
+
const nextExecutionTime = strictTicks[0] + interval;
|
|
1126
|
+
strictTicks.shift();
|
|
1127
|
+
strictTicks.push(nextExecutionTime);
|
|
1128
|
+
return Math.max(0, nextExecutionTime - now);
|
|
1072
1129
|
}
|
|
1073
1130
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1074
1131
|
return (function_) => {
|
|
1075
|
-
const throttled = function(...
|
|
1132
|
+
const throttled = function(...arguments_) {
|
|
1076
1133
|
if (!throttled.isEnabled) {
|
|
1077
|
-
return (async () => function_.apply(this,
|
|
1134
|
+
return (async () => function_.apply(this, arguments_))();
|
|
1078
1135
|
}
|
|
1079
|
-
let
|
|
1136
|
+
let timeoutId;
|
|
1080
1137
|
return new Promise((resolve, reject) => {
|
|
1081
1138
|
const execute = () => {
|
|
1082
|
-
resolve(function_.apply(this,
|
|
1083
|
-
queue.delete(
|
|
1139
|
+
resolve(function_.apply(this, arguments_));
|
|
1140
|
+
queue.delete(timeoutId);
|
|
1084
1141
|
};
|
|
1085
|
-
|
|
1086
|
-
|
|
1142
|
+
const delay = getDelay();
|
|
1143
|
+
if (delay > 0) {
|
|
1144
|
+
timeoutId = setTimeout(execute, delay);
|
|
1145
|
+
queue.set(timeoutId, reject);
|
|
1146
|
+
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1147
|
+
} else {
|
|
1148
|
+
execute();
|
|
1149
|
+
}
|
|
1087
1150
|
});
|
|
1088
1151
|
};
|
|
1089
1152
|
throttled.abort = () => {
|
|
@@ -1095,16 +1158,29 @@ function pThrottle({ limit, interval, strict }) {
|
|
|
1095
1158
|
strictTicks.splice(0, strictTicks.length);
|
|
1096
1159
|
};
|
|
1097
1160
|
throttled.isEnabled = true;
|
|
1161
|
+
Object.defineProperty(throttled, "queueSize", {
|
|
1162
|
+
get() {
|
|
1163
|
+
return queue.size;
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1098
1166
|
return throttled;
|
|
1099
1167
|
};
|
|
1100
1168
|
}
|
|
1169
|
+
|
|
1170
|
+
// ../canvas/dist/index.mjs
|
|
1171
|
+
var __typeError3 = (msg) => {
|
|
1172
|
+
throw TypeError(msg);
|
|
1173
|
+
};
|
|
1174
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1175
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1176
|
+
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);
|
|
1101
1177
|
function createLimitPolicy({
|
|
1102
1178
|
throttle = { interval: 1e3, limit: 10 },
|
|
1103
|
-
retry:
|
|
1179
|
+
retry: retry3 = { retries: 1, factor: 1.66 },
|
|
1104
1180
|
limit = 10
|
|
1105
1181
|
}) {
|
|
1106
1182
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1107
|
-
const limiter = limit ? (
|
|
1183
|
+
const limiter = limit ? pLimit2(limit) : null;
|
|
1108
1184
|
return function limitPolicy(func) {
|
|
1109
1185
|
let currentFunc = async () => await func();
|
|
1110
1186
|
if (throttler) {
|
|
@@ -1115,13 +1191,13 @@ function createLimitPolicy({
|
|
|
1115
1191
|
const limitFunc = currentFunc;
|
|
1116
1192
|
currentFunc = () => limiter(limitFunc);
|
|
1117
1193
|
}
|
|
1118
|
-
if (
|
|
1194
|
+
if (retry3) {
|
|
1119
1195
|
const retryFunc = currentFunc;
|
|
1120
1196
|
currentFunc = () => pRetry(retryFunc, {
|
|
1121
|
-
...
|
|
1197
|
+
...retry3,
|
|
1122
1198
|
onFailedAttempt: async (error) => {
|
|
1123
|
-
if (
|
|
1124
|
-
await
|
|
1199
|
+
if (retry3.onFailedAttempt) {
|
|
1200
|
+
await retry3.onFailedAttempt(error);
|
|
1125
1201
|
}
|
|
1126
1202
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1127
1203
|
throw error;
|
|
@@ -1132,6 +1208,55 @@ function createLimitPolicy({
|
|
|
1132
1208
|
return currentFunc();
|
|
1133
1209
|
};
|
|
1134
1210
|
}
|
|
1211
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
1212
|
+
function appendCsv(out, key, values) {
|
|
1213
|
+
if (values === void 0) {
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
out[key] = values.join(",");
|
|
1217
|
+
}
|
|
1218
|
+
function projectionToQuery(spec) {
|
|
1219
|
+
const out = {};
|
|
1220
|
+
if (!spec) {
|
|
1221
|
+
return out;
|
|
1222
|
+
}
|
|
1223
|
+
const { fields, fieldTypes, slots } = spec;
|
|
1224
|
+
const p = SELECT_QUERY_PREFIX;
|
|
1225
|
+
if (fields) {
|
|
1226
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
1227
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
1228
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
1229
|
+
}
|
|
1230
|
+
if (fieldTypes) {
|
|
1231
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
1232
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
1233
|
+
}
|
|
1234
|
+
if (slots) {
|
|
1235
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
1236
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
1237
|
+
if (typeof slots.depth === "number") {
|
|
1238
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
1239
|
+
}
|
|
1240
|
+
if (slots.named) {
|
|
1241
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
1242
|
+
for (const slotName of slotNames) {
|
|
1243
|
+
const named = slots.named[slotName];
|
|
1244
|
+
if (named && typeof named.depth === "number") {
|
|
1245
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
return out;
|
|
1251
|
+
}
|
|
1252
|
+
var CANVAS_DRAFT_STATE = 0;
|
|
1253
|
+
var CANVAS_PUBLISHED_STATE = 64;
|
|
1254
|
+
var CANVAS_EDITOR_STATE = 63;
|
|
1255
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1256
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1257
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1258
|
+
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1259
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1135
1260
|
var _contentTypesUrl;
|
|
1136
1261
|
var _entriesUrl;
|
|
1137
1262
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
@@ -1142,20 +1267,26 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1142
1267
|
}
|
|
1143
1268
|
getContentTypes(options) {
|
|
1144
1269
|
const { projectId } = this.options;
|
|
1145
|
-
const fetchUri = this.createUrl(
|
|
1270
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1146
1271
|
return this.apiClient(fetchUri);
|
|
1147
1272
|
}
|
|
1148
1273
|
getEntries(options) {
|
|
1149
1274
|
const { projectId } = this.options;
|
|
1150
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
1275
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
1151
1276
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1277
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1152
1278
|
if (skipDataResolution) {
|
|
1153
|
-
const url = this.createUrl(
|
|
1279
|
+
const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), {
|
|
1280
|
+
...params,
|
|
1281
|
+
...rewrittenFilters,
|
|
1282
|
+
...rewrittenSelect,
|
|
1283
|
+
projectId
|
|
1284
|
+
});
|
|
1154
1285
|
return this.apiClient(url);
|
|
1155
1286
|
}
|
|
1156
1287
|
const edgeUrl = this.createUrl(
|
|
1157
|
-
|
|
1158
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1288
|
+
__privateGet3(_ContentClient2, _entriesUrl),
|
|
1289
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
1159
1290
|
this.edgeApiHost
|
|
1160
1291
|
);
|
|
1161
1292
|
return this.apiClient(
|
|
@@ -1172,7 +1303,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1172
1303
|
return this.apiClient(historyUrl);
|
|
1173
1304
|
}
|
|
1174
1305
|
async upsertContentType(body, opts = {}) {
|
|
1175
|
-
const fetchUri = this.createUrl(
|
|
1306
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1176
1307
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1177
1308
|
delete body.contentType.slugSettings;
|
|
1178
1309
|
}
|
|
@@ -1184,7 +1315,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1184
1315
|
});
|
|
1185
1316
|
}
|
|
1186
1317
|
async upsertEntry(body, options) {
|
|
1187
|
-
const fetchUri = this.createUrl(
|
|
1318
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1188
1319
|
const headers = {};
|
|
1189
1320
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1190
1321
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1198,7 +1329,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1198
1329
|
return { modified: response.headers.get("x-modified-at") };
|
|
1199
1330
|
}
|
|
1200
1331
|
async deleteContentType(body) {
|
|
1201
|
-
const fetchUri = this.createUrl(
|
|
1332
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
|
|
1202
1333
|
await this.apiClient(fetchUri, {
|
|
1203
1334
|
method: "DELETE",
|
|
1204
1335
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1206,7 +1337,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1206
1337
|
});
|
|
1207
1338
|
}
|
|
1208
1339
|
async deleteEntry(body) {
|
|
1209
|
-
const fetchUri = this.createUrl(
|
|
1340
|
+
const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
|
|
1210
1341
|
await this.apiClient(fetchUri, {
|
|
1211
1342
|
method: "DELETE",
|
|
1212
1343
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1225,31 +1356,39 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1225
1356
|
};
|
|
1226
1357
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1227
1358
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1228
|
-
|
|
1229
|
-
|
|
1359
|
+
__privateAdd3(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1360
|
+
__privateAdd3(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1230
1361
|
var _url8;
|
|
1231
1362
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1232
1363
|
constructor(options) {
|
|
1233
1364
|
super(options);
|
|
1234
1365
|
}
|
|
1235
|
-
/** Fetches
|
|
1236
|
-
async
|
|
1366
|
+
/** Fetches a list of DataTypes for a project */
|
|
1367
|
+
async list(options) {
|
|
1237
1368
|
const { projectId } = this.options;
|
|
1238
|
-
const fetchUri = this.createUrl(
|
|
1369
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1239
1370
|
return await this.apiClient(fetchUri);
|
|
1240
1371
|
}
|
|
1372
|
+
/** @deprecated Use {@link list} instead. */
|
|
1373
|
+
async get(options) {
|
|
1374
|
+
return this.list(options);
|
|
1375
|
+
}
|
|
1241
1376
|
/** Updates or creates (based on id) a DataType */
|
|
1242
|
-
async
|
|
1243
|
-
const fetchUri = this.createUrl(
|
|
1377
|
+
async save(body) {
|
|
1378
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1244
1379
|
await this.apiClient(fetchUri, {
|
|
1245
1380
|
method: "PUT",
|
|
1246
1381
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
1247
1382
|
expectNoContent: true
|
|
1248
1383
|
});
|
|
1249
1384
|
}
|
|
1385
|
+
/** @deprecated Use {@link save} instead. */
|
|
1386
|
+
async upsert(body) {
|
|
1387
|
+
return this.save(body);
|
|
1388
|
+
}
|
|
1250
1389
|
/** Deletes a DataType */
|
|
1251
1390
|
async remove(body) {
|
|
1252
|
-
const fetchUri = this.createUrl(
|
|
1391
|
+
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1253
1392
|
await this.apiClient(fetchUri, {
|
|
1254
1393
|
method: "DELETE",
|
|
1255
1394
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1258,15 +1397,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1258
1397
|
}
|
|
1259
1398
|
};
|
|
1260
1399
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1261
|
-
|
|
1262
|
-
var CANVAS_DRAFT_STATE = 0;
|
|
1263
|
-
var CANVAS_PUBLISHED_STATE = 64;
|
|
1264
|
-
var CANVAS_EDITOR_STATE = 63;
|
|
1265
|
-
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1266
|
-
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1267
|
-
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1268
|
-
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1269
|
-
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1400
|
+
__privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1270
1401
|
var _baseUrl;
|
|
1271
1402
|
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
|
|
1272
1403
|
constructor(options) {
|
|
@@ -1277,7 +1408,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1277
1408
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1278
1409
|
*/
|
|
1279
1410
|
get(options) {
|
|
1280
|
-
const fetchUri = this.createUrl(
|
|
1411
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1281
1412
|
...options,
|
|
1282
1413
|
teamId: this.teamId
|
|
1283
1414
|
});
|
|
@@ -1287,7 +1418,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1287
1418
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1288
1419
|
*/
|
|
1289
1420
|
async deploy(body) {
|
|
1290
|
-
const fetchUri = this.createUrl(
|
|
1421
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1291
1422
|
await this.apiClient(fetchUri, {
|
|
1292
1423
|
method: "PUT",
|
|
1293
1424
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1298,7 +1429,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1298
1429
|
* Removes a custom AI property editor from a Mesh app.
|
|
1299
1430
|
*/
|
|
1300
1431
|
async delete(body) {
|
|
1301
|
-
const fetchUri = this.createUrl(
|
|
1432
|
+
const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1302
1433
|
await this.apiClient(fetchUri, {
|
|
1303
1434
|
method: "DELETE",
|
|
1304
1435
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1307,7 +1438,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1307
1438
|
}
|
|
1308
1439
|
};
|
|
1309
1440
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1310
|
-
|
|
1441
|
+
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1311
1442
|
var _url22;
|
|
1312
1443
|
var _projectsUrl;
|
|
1313
1444
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1316,7 +1447,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1316
1447
|
}
|
|
1317
1448
|
/** Fetches single Project */
|
|
1318
1449
|
async get(options) {
|
|
1319
|
-
const fetchUri = this.createUrl(
|
|
1450
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1320
1451
|
return await this.apiClient(fetchUri);
|
|
1321
1452
|
}
|
|
1322
1453
|
/**
|
|
@@ -1324,32 +1455,44 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1324
1455
|
* When teamId is provided, returns a single team with its projects.
|
|
1325
1456
|
* When omitted, returns all accessible teams and their projects.
|
|
1326
1457
|
*/
|
|
1327
|
-
async
|
|
1328
|
-
const fetchUri = this.createUrl(
|
|
1458
|
+
async list(options) {
|
|
1459
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1329
1460
|
return await this.apiClient(fetchUri);
|
|
1330
1461
|
}
|
|
1462
|
+
/** @deprecated Use {@link list} instead. */
|
|
1463
|
+
async getProjects(options) {
|
|
1464
|
+
return this.list(options);
|
|
1465
|
+
}
|
|
1331
1466
|
/** Updates or creates (based on id) a Project */
|
|
1332
|
-
async
|
|
1333
|
-
const fetchUri = this.createUrl(
|
|
1467
|
+
async save(body) {
|
|
1468
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1334
1469
|
return await this.apiClient(fetchUri, {
|
|
1335
1470
|
method: "PUT",
|
|
1336
1471
|
body: JSON.stringify({ ...body })
|
|
1337
1472
|
});
|
|
1338
1473
|
}
|
|
1474
|
+
/** @deprecated Use {@link save} instead. */
|
|
1475
|
+
async upsert(body) {
|
|
1476
|
+
return this.save(body);
|
|
1477
|
+
}
|
|
1339
1478
|
/** Deletes a Project */
|
|
1340
|
-
async
|
|
1341
|
-
const fetchUri = this.createUrl(
|
|
1479
|
+
async remove(body) {
|
|
1480
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1342
1481
|
await this.apiClient(fetchUri, {
|
|
1343
1482
|
method: "DELETE",
|
|
1344
1483
|
body: JSON.stringify({ ...body }),
|
|
1345
1484
|
expectNoContent: true
|
|
1346
1485
|
});
|
|
1347
1486
|
}
|
|
1487
|
+
/** @deprecated Use {@link remove} instead. */
|
|
1488
|
+
async delete(body) {
|
|
1489
|
+
return this.remove(body);
|
|
1490
|
+
}
|
|
1348
1491
|
};
|
|
1349
1492
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1350
1493
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1351
|
-
|
|
1352
|
-
|
|
1494
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1495
|
+
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1353
1496
|
var ROUTE_URL = "/api/v1/route";
|
|
1354
1497
|
var RouteClient = class extends ApiClient {
|
|
1355
1498
|
constructor(options) {
|
|
@@ -1360,15 +1503,27 @@ var RouteClient = class extends ApiClient {
|
|
|
1360
1503
|
super(options);
|
|
1361
1504
|
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
|
1362
1505
|
}
|
|
1363
|
-
/**
|
|
1364
|
-
|
|
1506
|
+
/**
|
|
1507
|
+
* Resolves a route to a composition, redirect, or not-found result.
|
|
1508
|
+
*
|
|
1509
|
+
* An optional `select` projection applies to the resolved composition when
|
|
1510
|
+
* the route matches one; redirect / notFound responses pass through
|
|
1511
|
+
* untouched.
|
|
1512
|
+
*/
|
|
1513
|
+
async get(options) {
|
|
1365
1514
|
const { projectId } = this.options;
|
|
1366
|
-
const
|
|
1515
|
+
const { select, ...rest } = options != null ? options : {};
|
|
1516
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1517
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...rest, projectId, ...rewrittenSelect }, this.edgeApiHost);
|
|
1367
1518
|
return await this.apiClient(
|
|
1368
1519
|
fetchUri,
|
|
1369
1520
|
this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
|
|
1370
1521
|
);
|
|
1371
1522
|
}
|
|
1523
|
+
/** @deprecated use {@link RouteClient.get} instead (renamed). */
|
|
1524
|
+
async getRoute(options) {
|
|
1525
|
+
return this.get(options);
|
|
1526
|
+
}
|
|
1372
1527
|
};
|
|
1373
1528
|
|
|
1374
1529
|
// src/data/client.ts
|
|
@@ -1563,7 +1718,7 @@ function createLimiter(concurrency) {
|
|
|
1563
1718
|
});
|
|
1564
1719
|
};
|
|
1565
1720
|
}
|
|
1566
|
-
async function
|
|
1721
|
+
async function retry2(fn, options) {
|
|
1567
1722
|
let lastError;
|
|
1568
1723
|
let delay = 1e3;
|
|
1569
1724
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -1603,7 +1758,7 @@ function createLimitPolicy2({
|
|
|
1603
1758
|
}
|
|
1604
1759
|
if (retryOptions) {
|
|
1605
1760
|
const retryFunc = currentFunc;
|
|
1606
|
-
currentFunc = () =>
|
|
1761
|
+
currentFunc = () => retry2(retryFunc, {
|
|
1607
1762
|
...retryOptions,
|
|
1608
1763
|
onFailedAttempt: async (error) => {
|
|
1609
1764
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -1818,14 +1973,14 @@ var DefaultDataClient = class {
|
|
|
1818
1973
|
if (oldCachedRoute) {
|
|
1819
1974
|
(0, import_functions.waitUntil)(
|
|
1820
1975
|
(async () => {
|
|
1821
|
-
const result2 = await routeClient.
|
|
1976
|
+
const result2 = await routeClient.get(route);
|
|
1822
1977
|
await cacheNewRoute(result2);
|
|
1823
1978
|
})()
|
|
1824
1979
|
);
|
|
1825
1980
|
return oldCachedRoute;
|
|
1826
1981
|
}
|
|
1827
1982
|
}
|
|
1828
|
-
const result = await routeClient.
|
|
1983
|
+
const result = await routeClient.get(route);
|
|
1829
1984
|
(0, import_functions.waitUntil)(
|
|
1830
1985
|
(async () => {
|
|
1831
1986
|
await Promise.all([
|