@uniformdev/next-app-router 20.63.1-alpha.12 → 20.63.1-alpha.17
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 +547 -567
- package/dist/cache.mjs +547 -567
- package/dist/component.js +416 -3
- package/dist/component.mjs +416 -3
- package/dist/handler.js +567 -582
- package/dist/handler.mjs +567 -582
- package/dist/index.esm.js +570 -583
- package/dist/index.js +570 -583
- package/dist/index.mjs +570 -583
- package/dist/middleware.js +516 -522
- package/dist/middleware.mjs +516 -522
- package/package.json +8 -8
package/dist/handler.mjs
CHANGED
|
@@ -4,10 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __typeError = (msg) => {
|
|
8
|
-
throw TypeError(msg);
|
|
9
|
-
};
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
9
|
};
|
|
@@ -27,25 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
24
|
mod
|
|
29
25
|
));
|
|
30
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
32
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
33
|
-
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);
|
|
34
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
35
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
36
|
-
set _(value) {
|
|
37
|
-
__privateSet(obj, member, value, setter);
|
|
38
|
-
},
|
|
39
|
-
get _() {
|
|
40
|
-
return __privateGet(obj, member, getter);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
26
|
|
|
44
27
|
// ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
|
|
45
28
|
var require_yocto_queue = __commonJS({
|
|
46
29
|
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
47
30
|
"use strict";
|
|
48
|
-
var
|
|
31
|
+
var Node = class {
|
|
49
32
|
/// value;
|
|
50
33
|
/// next;
|
|
51
34
|
constructor(value) {
|
|
@@ -53,7 +36,7 @@ var require_yocto_queue = __commonJS({
|
|
|
53
36
|
this.next = void 0;
|
|
54
37
|
}
|
|
55
38
|
};
|
|
56
|
-
var
|
|
39
|
+
var Queue = class {
|
|
57
40
|
// TODO: Use private class fields when targeting Node.js 12.
|
|
58
41
|
// #_head;
|
|
59
42
|
// #_tail;
|
|
@@ -62,7 +45,7 @@ var require_yocto_queue = __commonJS({
|
|
|
62
45
|
this.clear();
|
|
63
46
|
}
|
|
64
47
|
enqueue(value) {
|
|
65
|
-
const node = new
|
|
48
|
+
const node = new Node(value);
|
|
66
49
|
if (this._head) {
|
|
67
50
|
this._tail.next = node;
|
|
68
51
|
this._tail = node;
|
|
@@ -97,7 +80,7 @@ var require_yocto_queue = __commonJS({
|
|
|
97
80
|
}
|
|
98
81
|
}
|
|
99
82
|
};
|
|
100
|
-
module.exports =
|
|
83
|
+
module.exports = Queue;
|
|
101
84
|
}
|
|
102
85
|
});
|
|
103
86
|
|
|
@@ -105,12 +88,12 @@ var require_yocto_queue = __commonJS({
|
|
|
105
88
|
var require_p_limit = __commonJS({
|
|
106
89
|
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
107
90
|
"use strict";
|
|
108
|
-
var
|
|
109
|
-
var
|
|
91
|
+
var Queue = require_yocto_queue();
|
|
92
|
+
var pLimit2 = (concurrency) => {
|
|
110
93
|
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
111
94
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
112
95
|
}
|
|
113
|
-
const queue = new
|
|
96
|
+
const queue = new Queue();
|
|
114
97
|
let activeCount = 0;
|
|
115
98
|
const next = () => {
|
|
116
99
|
activeCount--;
|
|
@@ -155,252 +138,21 @@ var require_p_limit = __commonJS({
|
|
|
155
138
|
});
|
|
156
139
|
return generator;
|
|
157
140
|
};
|
|
158
|
-
module.exports =
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js
|
|
163
|
-
var require_retry_operation = __commonJS({
|
|
164
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
165
|
-
"use strict";
|
|
166
|
-
function RetryOperation(timeouts, options) {
|
|
167
|
-
if (typeof options === "boolean") {
|
|
168
|
-
options = { forever: options };
|
|
169
|
-
}
|
|
170
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
171
|
-
this._timeouts = timeouts;
|
|
172
|
-
this._options = options || {};
|
|
173
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
174
|
-
this._fn = null;
|
|
175
|
-
this._errors = [];
|
|
176
|
-
this._attempts = 1;
|
|
177
|
-
this._operationTimeout = null;
|
|
178
|
-
this._operationTimeoutCb = null;
|
|
179
|
-
this._timeout = null;
|
|
180
|
-
this._operationStart = null;
|
|
181
|
-
this._timer = null;
|
|
182
|
-
if (this._options.forever) {
|
|
183
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
module.exports = RetryOperation;
|
|
187
|
-
RetryOperation.prototype.reset = function() {
|
|
188
|
-
this._attempts = 1;
|
|
189
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
190
|
-
};
|
|
191
|
-
RetryOperation.prototype.stop = function() {
|
|
192
|
-
if (this._timeout) {
|
|
193
|
-
clearTimeout(this._timeout);
|
|
194
|
-
}
|
|
195
|
-
if (this._timer) {
|
|
196
|
-
clearTimeout(this._timer);
|
|
197
|
-
}
|
|
198
|
-
this._timeouts = [];
|
|
199
|
-
this._cachedTimeouts = null;
|
|
200
|
-
};
|
|
201
|
-
RetryOperation.prototype.retry = function(err) {
|
|
202
|
-
if (this._timeout) {
|
|
203
|
-
clearTimeout(this._timeout);
|
|
204
|
-
}
|
|
205
|
-
if (!err) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
209
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
210
|
-
this._errors.push(err);
|
|
211
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
this._errors.push(err);
|
|
215
|
-
var timeout = this._timeouts.shift();
|
|
216
|
-
if (timeout === void 0) {
|
|
217
|
-
if (this._cachedTimeouts) {
|
|
218
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
219
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
220
|
-
} else {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
var self = this;
|
|
225
|
-
this._timer = setTimeout(function() {
|
|
226
|
-
self._attempts++;
|
|
227
|
-
if (self._operationTimeoutCb) {
|
|
228
|
-
self._timeout = setTimeout(function() {
|
|
229
|
-
self._operationTimeoutCb(self._attempts);
|
|
230
|
-
}, self._operationTimeout);
|
|
231
|
-
if (self._options.unref) {
|
|
232
|
-
self._timeout.unref();
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
self._fn(self._attempts);
|
|
236
|
-
}, timeout);
|
|
237
|
-
if (this._options.unref) {
|
|
238
|
-
this._timer.unref();
|
|
239
|
-
}
|
|
240
|
-
return true;
|
|
241
|
-
};
|
|
242
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
243
|
-
this._fn = fn;
|
|
244
|
-
if (timeoutOps) {
|
|
245
|
-
if (timeoutOps.timeout) {
|
|
246
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
247
|
-
}
|
|
248
|
-
if (timeoutOps.cb) {
|
|
249
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
var self = this;
|
|
253
|
-
if (this._operationTimeoutCb) {
|
|
254
|
-
this._timeout = setTimeout(function() {
|
|
255
|
-
self._operationTimeoutCb();
|
|
256
|
-
}, self._operationTimeout);
|
|
257
|
-
}
|
|
258
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
259
|
-
this._fn(this._attempts);
|
|
260
|
-
};
|
|
261
|
-
RetryOperation.prototype.try = function(fn) {
|
|
262
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
263
|
-
this.attempt(fn);
|
|
264
|
-
};
|
|
265
|
-
RetryOperation.prototype.start = function(fn) {
|
|
266
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
267
|
-
this.attempt(fn);
|
|
268
|
-
};
|
|
269
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
270
|
-
RetryOperation.prototype.errors = function() {
|
|
271
|
-
return this._errors;
|
|
272
|
-
};
|
|
273
|
-
RetryOperation.prototype.attempts = function() {
|
|
274
|
-
return this._attempts;
|
|
275
|
-
};
|
|
276
|
-
RetryOperation.prototype.mainError = function() {
|
|
277
|
-
if (this._errors.length === 0) {
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
280
|
-
var counts = {};
|
|
281
|
-
var mainError = null;
|
|
282
|
-
var mainErrorCount = 0;
|
|
283
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
284
|
-
var error = this._errors[i];
|
|
285
|
-
var message = error.message;
|
|
286
|
-
var count = (counts[message] || 0) + 1;
|
|
287
|
-
counts[message] = count;
|
|
288
|
-
if (count >= mainErrorCount) {
|
|
289
|
-
mainError = error;
|
|
290
|
-
mainErrorCount = count;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return mainError;
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js
|
|
299
|
-
var require_retry = __commonJS({
|
|
300
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
|
|
301
|
-
"use strict";
|
|
302
|
-
var RetryOperation = require_retry_operation();
|
|
303
|
-
exports.operation = function(options) {
|
|
304
|
-
var timeouts = exports.timeouts(options);
|
|
305
|
-
return new RetryOperation(timeouts, {
|
|
306
|
-
forever: options && (options.forever || options.retries === Infinity),
|
|
307
|
-
unref: options && options.unref,
|
|
308
|
-
maxRetryTime: options && options.maxRetryTime
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
exports.timeouts = function(options) {
|
|
312
|
-
if (options instanceof Array) {
|
|
313
|
-
return [].concat(options);
|
|
314
|
-
}
|
|
315
|
-
var opts = {
|
|
316
|
-
retries: 10,
|
|
317
|
-
factor: 2,
|
|
318
|
-
minTimeout: 1 * 1e3,
|
|
319
|
-
maxTimeout: Infinity,
|
|
320
|
-
randomize: false
|
|
321
|
-
};
|
|
322
|
-
for (var key in options) {
|
|
323
|
-
opts[key] = options[key];
|
|
324
|
-
}
|
|
325
|
-
if (opts.minTimeout > opts.maxTimeout) {
|
|
326
|
-
throw new Error("minTimeout is greater than maxTimeout");
|
|
327
|
-
}
|
|
328
|
-
var timeouts = [];
|
|
329
|
-
for (var i = 0; i < opts.retries; i++) {
|
|
330
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
331
|
-
}
|
|
332
|
-
if (options && options.forever && !timeouts.length) {
|
|
333
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
334
|
-
}
|
|
335
|
-
timeouts.sort(function(a, b) {
|
|
336
|
-
return a - b;
|
|
337
|
-
});
|
|
338
|
-
return timeouts;
|
|
339
|
-
};
|
|
340
|
-
exports.createTimeout = function(attempt, opts) {
|
|
341
|
-
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
342
|
-
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
343
|
-
timeout = Math.min(timeout, opts.maxTimeout);
|
|
344
|
-
return timeout;
|
|
345
|
-
};
|
|
346
|
-
exports.wrap = function(obj, options, methods) {
|
|
347
|
-
if (options instanceof Array) {
|
|
348
|
-
methods = options;
|
|
349
|
-
options = null;
|
|
350
|
-
}
|
|
351
|
-
if (!methods) {
|
|
352
|
-
methods = [];
|
|
353
|
-
for (var key in obj) {
|
|
354
|
-
if (typeof obj[key] === "function") {
|
|
355
|
-
methods.push(key);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
for (var i = 0; i < methods.length; i++) {
|
|
360
|
-
var method = methods[i];
|
|
361
|
-
var original = obj[method];
|
|
362
|
-
obj[method] = function retryWrapper(original2) {
|
|
363
|
-
var op = exports.operation(options);
|
|
364
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
365
|
-
var callback = args.pop();
|
|
366
|
-
args.push(function(err) {
|
|
367
|
-
if (op.retry(err)) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (err) {
|
|
371
|
-
arguments[0] = op.mainError();
|
|
372
|
-
}
|
|
373
|
-
callback.apply(this, arguments);
|
|
374
|
-
});
|
|
375
|
-
op.attempt(function() {
|
|
376
|
-
original2.apply(obj, args);
|
|
377
|
-
});
|
|
378
|
-
}.bind(obj, original);
|
|
379
|
-
obj[method].options = options;
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
// ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js
|
|
386
|
-
var require_retry2 = __commonJS({
|
|
387
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
388
|
-
"use strict";
|
|
389
|
-
module.exports = require_retry();
|
|
141
|
+
module.exports = pLimit2;
|
|
390
142
|
}
|
|
391
143
|
});
|
|
392
144
|
|
|
393
145
|
// ../context/dist/api/api.mjs
|
|
394
146
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
395
147
|
var __defProp2 = Object.defineProperty;
|
|
396
|
-
var
|
|
148
|
+
var __typeError = (msg) => {
|
|
397
149
|
throw TypeError(msg);
|
|
398
150
|
};
|
|
399
|
-
var
|
|
400
|
-
var
|
|
401
|
-
var
|
|
402
|
-
var
|
|
403
|
-
var
|
|
151
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
152
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
153
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
154
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
155
|
+
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);
|
|
404
156
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
405
157
|
var ApiClientError = class _ApiClientError extends Error {
|
|
406
158
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -419,7 +171,7 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
419
171
|
};
|
|
420
172
|
var ApiClient = class _ApiClient {
|
|
421
173
|
constructor(options) {
|
|
422
|
-
|
|
174
|
+
__publicField(this, "options");
|
|
423
175
|
var _a, _b, _c, _d, _e;
|
|
424
176
|
if (!options.apiKey && !options.bearerToken) {
|
|
425
177
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -589,12 +341,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
589
341
|
/** Fetches all aggregates for a project */
|
|
590
342
|
async get(options) {
|
|
591
343
|
const { projectId } = this.options;
|
|
592
|
-
const fetchUri = this.createUrl(
|
|
344
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
|
|
593
345
|
return await this.apiClient(fetchUri);
|
|
594
346
|
}
|
|
595
347
|
/** Updates or creates (based on id) an Aggregate */
|
|
596
348
|
async upsert(body) {
|
|
597
|
-
const fetchUri = this.createUrl(
|
|
349
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
598
350
|
await this.apiClient(fetchUri, {
|
|
599
351
|
method: "PUT",
|
|
600
352
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -603,7 +355,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
603
355
|
}
|
|
604
356
|
/** Deletes an Aggregate */
|
|
605
357
|
async remove(body) {
|
|
606
|
-
const fetchUri = this.createUrl(
|
|
358
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
607
359
|
await this.apiClient(fetchUri, {
|
|
608
360
|
method: "DELETE",
|
|
609
361
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -612,7 +364,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
612
364
|
}
|
|
613
365
|
};
|
|
614
366
|
_url = /* @__PURE__ */ new WeakMap();
|
|
615
|
-
|
|
367
|
+
__privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
|
|
616
368
|
var _url2;
|
|
617
369
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
618
370
|
constructor(options) {
|
|
@@ -621,12 +373,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
621
373
|
/** Fetches the known score dimensions for a project */
|
|
622
374
|
async get(options) {
|
|
623
375
|
const { projectId } = this.options;
|
|
624
|
-
const fetchUri = this.createUrl(
|
|
376
|
+
const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
|
|
625
377
|
return await this.apiClient(fetchUri);
|
|
626
378
|
}
|
|
627
379
|
};
|
|
628
380
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
629
|
-
|
|
381
|
+
__privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
|
|
630
382
|
var _url3;
|
|
631
383
|
var _valueUrl;
|
|
632
384
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -636,12 +388,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
636
388
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
637
389
|
async get(options) {
|
|
638
390
|
const { projectId } = this.options;
|
|
639
|
-
const fetchUri = this.createUrl(
|
|
391
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
640
392
|
return await this.apiClient(fetchUri);
|
|
641
393
|
}
|
|
642
394
|
/** Updates or creates (based on id) an enrichment category */
|
|
643
395
|
async upsertCategory(body) {
|
|
644
|
-
const fetchUri = this.createUrl(
|
|
396
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
645
397
|
await this.apiClient(fetchUri, {
|
|
646
398
|
method: "PUT",
|
|
647
399
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -650,7 +402,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
650
402
|
}
|
|
651
403
|
/** Deletes an enrichment category */
|
|
652
404
|
async removeCategory(body) {
|
|
653
|
-
const fetchUri = this.createUrl(
|
|
405
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
654
406
|
await this.apiClient(fetchUri, {
|
|
655
407
|
method: "DELETE",
|
|
656
408
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -659,7 +411,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
659
411
|
}
|
|
660
412
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
661
413
|
async upsertValue(body) {
|
|
662
|
-
const fetchUri = this.createUrl(
|
|
414
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
663
415
|
await this.apiClient(fetchUri, {
|
|
664
416
|
method: "PUT",
|
|
665
417
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -668,7 +420,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
668
420
|
}
|
|
669
421
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
670
422
|
async removeValue(body) {
|
|
671
|
-
const fetchUri = this.createUrl(
|
|
423
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
672
424
|
await this.apiClient(fetchUri, {
|
|
673
425
|
method: "DELETE",
|
|
674
426
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -678,8 +430,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
678
430
|
};
|
|
679
431
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
680
432
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
681
|
-
|
|
682
|
-
|
|
433
|
+
__privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
434
|
+
__privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
683
435
|
var _url4;
|
|
684
436
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
685
437
|
constructor(options) {
|
|
@@ -688,7 +440,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
688
440
|
/** Fetches the Context manifest for a project */
|
|
689
441
|
async get(options) {
|
|
690
442
|
const { projectId } = this.options;
|
|
691
|
-
const fetchUri = this.createUrl(
|
|
443
|
+
const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
|
|
692
444
|
return await this.apiClient(fetchUri);
|
|
693
445
|
}
|
|
694
446
|
/** Publishes the Context manifest for a project */
|
|
@@ -702,7 +454,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
702
454
|
}
|
|
703
455
|
};
|
|
704
456
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
705
|
-
|
|
457
|
+
__privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
|
|
706
458
|
var _url5;
|
|
707
459
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
708
460
|
constructor(options) {
|
|
@@ -711,12 +463,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
711
463
|
/** Fetches all Quirks for a project */
|
|
712
464
|
async get(options) {
|
|
713
465
|
const { projectId } = this.options;
|
|
714
|
-
const fetchUri = this.createUrl(
|
|
466
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
|
|
715
467
|
return await this.apiClient(fetchUri);
|
|
716
468
|
}
|
|
717
469
|
/** Updates or creates (based on id) a Quirk */
|
|
718
470
|
async upsert(body) {
|
|
719
|
-
const fetchUri = this.createUrl(
|
|
471
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
720
472
|
await this.apiClient(fetchUri, {
|
|
721
473
|
method: "PUT",
|
|
722
474
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -725,7 +477,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
725
477
|
}
|
|
726
478
|
/** Deletes a Quirk */
|
|
727
479
|
async remove(body) {
|
|
728
|
-
const fetchUri = this.createUrl(
|
|
480
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
729
481
|
await this.apiClient(fetchUri, {
|
|
730
482
|
method: "DELETE",
|
|
731
483
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -734,7 +486,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
734
486
|
}
|
|
735
487
|
};
|
|
736
488
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
737
|
-
|
|
489
|
+
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
738
490
|
var _url6;
|
|
739
491
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
740
492
|
constructor(options) {
|
|
@@ -743,12 +495,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
743
495
|
/** Fetches all Signals for a project */
|
|
744
496
|
async get(options) {
|
|
745
497
|
const { projectId } = this.options;
|
|
746
|
-
const fetchUri = this.createUrl(
|
|
498
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
747
499
|
return await this.apiClient(fetchUri);
|
|
748
500
|
}
|
|
749
501
|
/** Updates or creates (based on id) a Signal */
|
|
750
502
|
async upsert(body) {
|
|
751
|
-
const fetchUri = this.createUrl(
|
|
503
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
752
504
|
await this.apiClient(fetchUri, {
|
|
753
505
|
method: "PUT",
|
|
754
506
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -757,7 +509,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
757
509
|
}
|
|
758
510
|
/** Deletes a Signal */
|
|
759
511
|
async remove(body) {
|
|
760
|
-
const fetchUri = this.createUrl(
|
|
512
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
761
513
|
await this.apiClient(fetchUri, {
|
|
762
514
|
method: "DELETE",
|
|
763
515
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -766,7 +518,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
766
518
|
}
|
|
767
519
|
};
|
|
768
520
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
769
|
-
|
|
521
|
+
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
770
522
|
var _url7;
|
|
771
523
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
772
524
|
constructor(options) {
|
|
@@ -775,12 +527,12 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
775
527
|
/** Fetches all Tests for a project */
|
|
776
528
|
async get(options) {
|
|
777
529
|
const { projectId } = this.options;
|
|
778
|
-
const fetchUri = this.createUrl(
|
|
530
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
779
531
|
return await this.apiClient(fetchUri);
|
|
780
532
|
}
|
|
781
533
|
/** Updates or creates (based on id) a Test */
|
|
782
534
|
async upsert(body) {
|
|
783
|
-
const fetchUri = this.createUrl(
|
|
535
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
784
536
|
await this.apiClient(fetchUri, {
|
|
785
537
|
method: "PUT",
|
|
786
538
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -789,7 +541,7 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
789
541
|
}
|
|
790
542
|
/** Deletes a Test */
|
|
791
543
|
async remove(body) {
|
|
792
|
-
const fetchUri = this.createUrl(
|
|
544
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
793
545
|
await this.apiClient(fetchUri, {
|
|
794
546
|
method: "DELETE",
|
|
795
547
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -798,187 +550,393 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
798
550
|
}
|
|
799
551
|
};
|
|
800
552
|
_url7 = /* @__PURE__ */ new WeakMap();
|
|
801
|
-
|
|
553
|
+
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
802
554
|
|
|
803
|
-
//
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
555
|
+
// ../canvas/dist/index.mjs
|
|
556
|
+
var __create2 = Object.create;
|
|
557
|
+
var __defProp3 = Object.defineProperty;
|
|
558
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
559
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
560
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
561
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
562
|
+
var __typeError2 = (msg) => {
|
|
563
|
+
throw TypeError(msg);
|
|
810
564
|
};
|
|
811
|
-
var
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
enqueue(value) {
|
|
820
|
-
const node = new Node(value);
|
|
821
|
-
if (__privateGet(this, _head)) {
|
|
822
|
-
__privateGet(this, _tail).next = node;
|
|
823
|
-
__privateSet(this, _tail, node);
|
|
824
|
-
} else {
|
|
825
|
-
__privateSet(this, _head, node);
|
|
826
|
-
__privateSet(this, _tail, node);
|
|
827
|
-
}
|
|
828
|
-
__privateWrapper(this, _size)._++;
|
|
829
|
-
}
|
|
830
|
-
dequeue() {
|
|
831
|
-
const current = __privateGet(this, _head);
|
|
832
|
-
if (!current) {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
836
|
-
__privateWrapper(this, _size)._--;
|
|
837
|
-
if (!__privateGet(this, _head)) {
|
|
838
|
-
__privateSet(this, _tail, void 0);
|
|
839
|
-
}
|
|
840
|
-
return current.value;
|
|
841
|
-
}
|
|
842
|
-
peek() {
|
|
843
|
-
if (!__privateGet(this, _head)) {
|
|
844
|
-
return;
|
|
845
|
-
}
|
|
846
|
-
return __privateGet(this, _head).value;
|
|
847
|
-
}
|
|
848
|
-
clear() {
|
|
849
|
-
__privateSet(this, _head, void 0);
|
|
850
|
-
__privateSet(this, _tail, void 0);
|
|
851
|
-
__privateSet(this, _size, 0);
|
|
565
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
566
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
567
|
+
};
|
|
568
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
569
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
570
|
+
for (let key of __getOwnPropNames2(from))
|
|
571
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
572
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
852
573
|
}
|
|
853
|
-
|
|
854
|
-
|
|
574
|
+
return to;
|
|
575
|
+
};
|
|
576
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
577
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
578
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
579
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
580
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
581
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
582
|
+
mod
|
|
583
|
+
));
|
|
584
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
585
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
586
|
+
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);
|
|
587
|
+
var require_yocto_queue2 = __commonJS2({
|
|
588
|
+
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
589
|
+
"use strict";
|
|
590
|
+
var Node = class {
|
|
591
|
+
/// value;
|
|
592
|
+
/// next;
|
|
593
|
+
constructor(value) {
|
|
594
|
+
this.value = value;
|
|
595
|
+
this.next = void 0;
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
var Queue = class {
|
|
599
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
600
|
+
// #_head;
|
|
601
|
+
// #_tail;
|
|
602
|
+
// #_size;
|
|
603
|
+
constructor() {
|
|
604
|
+
this.clear();
|
|
605
|
+
}
|
|
606
|
+
enqueue(value) {
|
|
607
|
+
const node = new Node(value);
|
|
608
|
+
if (this._head) {
|
|
609
|
+
this._tail.next = node;
|
|
610
|
+
this._tail = node;
|
|
611
|
+
} else {
|
|
612
|
+
this._head = node;
|
|
613
|
+
this._tail = node;
|
|
614
|
+
}
|
|
615
|
+
this._size++;
|
|
616
|
+
}
|
|
617
|
+
dequeue() {
|
|
618
|
+
const current = this._head;
|
|
619
|
+
if (!current) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
this._head = this._head.next;
|
|
623
|
+
this._size--;
|
|
624
|
+
return current.value;
|
|
625
|
+
}
|
|
626
|
+
clear() {
|
|
627
|
+
this._head = void 0;
|
|
628
|
+
this._tail = void 0;
|
|
629
|
+
this._size = 0;
|
|
630
|
+
}
|
|
631
|
+
get size() {
|
|
632
|
+
return this._size;
|
|
633
|
+
}
|
|
634
|
+
*[Symbol.iterator]() {
|
|
635
|
+
let current = this._head;
|
|
636
|
+
while (current) {
|
|
637
|
+
yield current.value;
|
|
638
|
+
current = current.next;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
module.exports = Queue;
|
|
855
643
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
644
|
+
});
|
|
645
|
+
var require_p_limit2 = __commonJS2({
|
|
646
|
+
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
647
|
+
"use strict";
|
|
648
|
+
var Queue = require_yocto_queue2();
|
|
649
|
+
var pLimit2 = (concurrency) => {
|
|
650
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
651
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
652
|
+
}
|
|
653
|
+
const queue = new Queue();
|
|
654
|
+
let activeCount = 0;
|
|
655
|
+
const next = () => {
|
|
656
|
+
activeCount--;
|
|
657
|
+
if (queue.size > 0) {
|
|
658
|
+
queue.dequeue()();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
const run = async (fn, resolve, ...args) => {
|
|
662
|
+
activeCount++;
|
|
663
|
+
const result = (async () => fn(...args))();
|
|
664
|
+
resolve(result);
|
|
665
|
+
try {
|
|
666
|
+
await result;
|
|
667
|
+
} catch (e) {
|
|
668
|
+
}
|
|
669
|
+
next();
|
|
670
|
+
};
|
|
671
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
672
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
673
|
+
(async () => {
|
|
674
|
+
await Promise.resolve();
|
|
675
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
676
|
+
queue.dequeue()();
|
|
677
|
+
}
|
|
678
|
+
})();
|
|
679
|
+
};
|
|
680
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
681
|
+
enqueue(fn, resolve, ...args);
|
|
682
|
+
});
|
|
683
|
+
Object.defineProperties(generator, {
|
|
684
|
+
activeCount: {
|
|
685
|
+
get: () => activeCount
|
|
686
|
+
},
|
|
687
|
+
pendingCount: {
|
|
688
|
+
get: () => queue.size
|
|
689
|
+
},
|
|
690
|
+
clearQueue: {
|
|
691
|
+
value: () => {
|
|
692
|
+
queue.clear();
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
return generator;
|
|
697
|
+
};
|
|
698
|
+
module.exports = pLimit2;
|
|
862
699
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
700
|
+
});
|
|
701
|
+
var require_retry_operation = __commonJS2({
|
|
702
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
703
|
+
"use strict";
|
|
704
|
+
function RetryOperation(timeouts, options) {
|
|
705
|
+
if (typeof options === "boolean") {
|
|
706
|
+
options = { forever: options };
|
|
707
|
+
}
|
|
708
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
709
|
+
this._timeouts = timeouts;
|
|
710
|
+
this._options = options || {};
|
|
711
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
712
|
+
this._fn = null;
|
|
713
|
+
this._errors = [];
|
|
714
|
+
this._attempts = 1;
|
|
715
|
+
this._operationTimeout = null;
|
|
716
|
+
this._operationTimeoutCb = null;
|
|
717
|
+
this._timeout = null;
|
|
718
|
+
this._operationStart = null;
|
|
719
|
+
this._timer = null;
|
|
720
|
+
if (this._options.forever) {
|
|
721
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
722
|
+
}
|
|
866
723
|
}
|
|
724
|
+
module.exports = RetryOperation;
|
|
725
|
+
RetryOperation.prototype.reset = function() {
|
|
726
|
+
this._attempts = 1;
|
|
727
|
+
this._timeouts = this._originalTimeouts.slice(0);
|
|
728
|
+
};
|
|
729
|
+
RetryOperation.prototype.stop = function() {
|
|
730
|
+
if (this._timeout) {
|
|
731
|
+
clearTimeout(this._timeout);
|
|
732
|
+
}
|
|
733
|
+
if (this._timer) {
|
|
734
|
+
clearTimeout(this._timer);
|
|
735
|
+
}
|
|
736
|
+
this._timeouts = [];
|
|
737
|
+
this._cachedTimeouts = null;
|
|
738
|
+
};
|
|
739
|
+
RetryOperation.prototype.retry = function(err) {
|
|
740
|
+
if (this._timeout) {
|
|
741
|
+
clearTimeout(this._timeout);
|
|
742
|
+
}
|
|
743
|
+
if (!err) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
747
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
748
|
+
this._errors.push(err);
|
|
749
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
750
|
+
return false;
|
|
751
|
+
}
|
|
752
|
+
this._errors.push(err);
|
|
753
|
+
var timeout = this._timeouts.shift();
|
|
754
|
+
if (timeout === void 0) {
|
|
755
|
+
if (this._cachedTimeouts) {
|
|
756
|
+
this._errors.splice(0, this._errors.length - 1);
|
|
757
|
+
timeout = this._cachedTimeouts.slice(-1);
|
|
758
|
+
} else {
|
|
759
|
+
return false;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
var self = this;
|
|
763
|
+
this._timer = setTimeout(function() {
|
|
764
|
+
self._attempts++;
|
|
765
|
+
if (self._operationTimeoutCb) {
|
|
766
|
+
self._timeout = setTimeout(function() {
|
|
767
|
+
self._operationTimeoutCb(self._attempts);
|
|
768
|
+
}, self._operationTimeout);
|
|
769
|
+
if (self._options.unref) {
|
|
770
|
+
self._timeout.unref();
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
self._fn(self._attempts);
|
|
774
|
+
}, timeout);
|
|
775
|
+
if (this._options.unref) {
|
|
776
|
+
this._timer.unref();
|
|
777
|
+
}
|
|
778
|
+
return true;
|
|
779
|
+
};
|
|
780
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
781
|
+
this._fn = fn;
|
|
782
|
+
if (timeoutOps) {
|
|
783
|
+
if (timeoutOps.timeout) {
|
|
784
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
785
|
+
}
|
|
786
|
+
if (timeoutOps.cb) {
|
|
787
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
var self = this;
|
|
791
|
+
if (this._operationTimeoutCb) {
|
|
792
|
+
this._timeout = setTimeout(function() {
|
|
793
|
+
self._operationTimeoutCb();
|
|
794
|
+
}, self._operationTimeout);
|
|
795
|
+
}
|
|
796
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
797
|
+
this._fn(this._attempts);
|
|
798
|
+
};
|
|
799
|
+
RetryOperation.prototype.try = function(fn) {
|
|
800
|
+
console.log("Using RetryOperation.try() is deprecated");
|
|
801
|
+
this.attempt(fn);
|
|
802
|
+
};
|
|
803
|
+
RetryOperation.prototype.start = function(fn) {
|
|
804
|
+
console.log("Using RetryOperation.start() is deprecated");
|
|
805
|
+
this.attempt(fn);
|
|
806
|
+
};
|
|
807
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
808
|
+
RetryOperation.prototype.errors = function() {
|
|
809
|
+
return this._errors;
|
|
810
|
+
};
|
|
811
|
+
RetryOperation.prototype.attempts = function() {
|
|
812
|
+
return this._attempts;
|
|
813
|
+
};
|
|
814
|
+
RetryOperation.prototype.mainError = function() {
|
|
815
|
+
if (this._errors.length === 0) {
|
|
816
|
+
return null;
|
|
817
|
+
}
|
|
818
|
+
var counts = {};
|
|
819
|
+
var mainError = null;
|
|
820
|
+
var mainErrorCount = 0;
|
|
821
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
822
|
+
var error = this._errors[i];
|
|
823
|
+
var message = error.message;
|
|
824
|
+
var count = (counts[message] || 0) + 1;
|
|
825
|
+
counts[message] = count;
|
|
826
|
+
if (count >= mainErrorCount) {
|
|
827
|
+
mainError = error;
|
|
828
|
+
mainErrorCount = count;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
return mainError;
|
|
832
|
+
};
|
|
867
833
|
}
|
|
868
|
-
};
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
const next = () => {
|
|
885
|
-
activeCount--;
|
|
886
|
-
resumeNext();
|
|
887
|
-
};
|
|
888
|
-
const run = async (function_, resolve, arguments_) => {
|
|
889
|
-
const result = (async () => function_(...arguments_))();
|
|
890
|
-
resolve(result);
|
|
891
|
-
try {
|
|
892
|
-
await result;
|
|
893
|
-
} catch (e) {
|
|
894
|
-
}
|
|
895
|
-
next();
|
|
896
|
-
};
|
|
897
|
-
const enqueue = (function_, resolve, arguments_) => {
|
|
898
|
-
new Promise((internalResolve) => {
|
|
899
|
-
queue.enqueue(internalResolve);
|
|
900
|
-
}).then(
|
|
901
|
-
run.bind(void 0, function_, resolve, arguments_)
|
|
902
|
-
);
|
|
903
|
-
(async () => {
|
|
904
|
-
await Promise.resolve();
|
|
905
|
-
if (activeCount < concurrency) {
|
|
906
|
-
resumeNext();
|
|
834
|
+
});
|
|
835
|
+
var require_retry = __commonJS2({
|
|
836
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
|
|
837
|
+
"use strict";
|
|
838
|
+
var RetryOperation = require_retry_operation();
|
|
839
|
+
exports.operation = function(options) {
|
|
840
|
+
var timeouts = exports.timeouts(options);
|
|
841
|
+
return new RetryOperation(timeouts, {
|
|
842
|
+
forever: options && (options.forever || options.retries === Infinity),
|
|
843
|
+
unref: options && options.unref,
|
|
844
|
+
maxRetryTime: options && options.maxRetryTime
|
|
845
|
+
});
|
|
846
|
+
};
|
|
847
|
+
exports.timeouts = function(options) {
|
|
848
|
+
if (options instanceof Array) {
|
|
849
|
+
return [].concat(options);
|
|
907
850
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
pendingCount: {
|
|
918
|
-
get: () => queue.size
|
|
919
|
-
},
|
|
920
|
-
clearQueue: {
|
|
921
|
-
value() {
|
|
922
|
-
queue.clear();
|
|
851
|
+
var opts = {
|
|
852
|
+
retries: 10,
|
|
853
|
+
factor: 2,
|
|
854
|
+
minTimeout: 1 * 1e3,
|
|
855
|
+
maxTimeout: Infinity,
|
|
856
|
+
randomize: false
|
|
857
|
+
};
|
|
858
|
+
for (var key in options) {
|
|
859
|
+
opts[key] = options[key];
|
|
923
860
|
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
861
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
862
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
863
|
+
}
|
|
864
|
+
var timeouts = [];
|
|
865
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
866
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
867
|
+
}
|
|
868
|
+
if (options && options.forever && !timeouts.length) {
|
|
869
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
870
|
+
}
|
|
871
|
+
timeouts.sort(function(a, b) {
|
|
872
|
+
return a - b;
|
|
873
|
+
});
|
|
874
|
+
return timeouts;
|
|
875
|
+
};
|
|
876
|
+
exports.createTimeout = function(attempt, opts) {
|
|
877
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
878
|
+
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
879
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
880
|
+
return timeout;
|
|
881
|
+
};
|
|
882
|
+
exports.wrap = function(obj, options, methods) {
|
|
883
|
+
if (options instanceof Array) {
|
|
884
|
+
methods = options;
|
|
885
|
+
options = null;
|
|
886
|
+
}
|
|
887
|
+
if (!methods) {
|
|
888
|
+
methods = [];
|
|
889
|
+
for (var key in obj) {
|
|
890
|
+
if (typeof obj[key] === "function") {
|
|
891
|
+
methods.push(key);
|
|
933
892
|
}
|
|
934
|
-
}
|
|
893
|
+
}
|
|
935
894
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
895
|
+
for (var i = 0; i < methods.length; i++) {
|
|
896
|
+
var method = methods[i];
|
|
897
|
+
var original = obj[method];
|
|
898
|
+
obj[method] = function retryWrapper(original2) {
|
|
899
|
+
var op = exports.operation(options);
|
|
900
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
901
|
+
var callback = args.pop();
|
|
902
|
+
args.push(function(err) {
|
|
903
|
+
if (op.retry(err)) {
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
if (err) {
|
|
907
|
+
arguments[0] = op.mainError();
|
|
908
|
+
}
|
|
909
|
+
callback.apply(this, arguments);
|
|
910
|
+
});
|
|
911
|
+
op.attempt(function() {
|
|
912
|
+
original2.apply(obj, args);
|
|
913
|
+
});
|
|
914
|
+
}.bind(obj, original);
|
|
915
|
+
obj[method].options = options;
|
|
916
|
+
}
|
|
917
|
+
};
|
|
943
918
|
}
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
var
|
|
953
|
-
|
|
954
|
-
// Chrome
|
|
919
|
+
});
|
|
920
|
+
var require_retry2 = __commonJS2({
|
|
921
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
922
|
+
"use strict";
|
|
923
|
+
module.exports = require_retry();
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
927
|
+
var import_retry = __toESM2(require_retry2(), 1);
|
|
928
|
+
var networkErrorMsgs = /* @__PURE__ */ new Set([
|
|
955
929
|
"Failed to fetch",
|
|
956
930
|
// Chrome
|
|
957
931
|
"NetworkError when attempting to fetch resource.",
|
|
958
932
|
// Firefox
|
|
959
933
|
"The Internet connection appears to be offline.",
|
|
960
|
-
// Safari
|
|
961
|
-
"Load failed",
|
|
962
|
-
// Safari 17+
|
|
934
|
+
// Safari
|
|
963
935
|
"Network request failed",
|
|
964
936
|
// `cross-fetch`
|
|
965
|
-
"fetch failed"
|
|
966
|
-
// Undici (Node.js)
|
|
967
|
-
"terminated"
|
|
937
|
+
"fetch failed"
|
|
968
938
|
// Undici (Node.js)
|
|
969
939
|
]);
|
|
970
|
-
function isNetworkError(error) {
|
|
971
|
-
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
972
|
-
if (!isValid) {
|
|
973
|
-
return false;
|
|
974
|
-
}
|
|
975
|
-
if (error.message === "Load failed") {
|
|
976
|
-
return error.stack === void 0;
|
|
977
|
-
}
|
|
978
|
-
return errorMessages.has(error.message);
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
982
940
|
var AbortError = class extends Error {
|
|
983
941
|
constructor(message) {
|
|
984
942
|
super();
|
|
@@ -999,68 +957,63 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
999
957
|
error.retriesLeft = retriesLeft;
|
|
1000
958
|
return error;
|
|
1001
959
|
};
|
|
960
|
+
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
961
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
1002
962
|
async function pRetry(input, options) {
|
|
1003
963
|
return new Promise((resolve, reject) => {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
964
|
+
options = {
|
|
965
|
+
onFailedAttempt() {
|
|
966
|
+
},
|
|
967
|
+
retries: 10,
|
|
968
|
+
...options
|
|
1007
969
|
};
|
|
1008
|
-
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1009
|
-
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
1010
970
|
const operation = import_retry.default.operation(options);
|
|
1011
|
-
const abortHandler = () => {
|
|
1012
|
-
var _a2;
|
|
1013
|
-
operation.stop();
|
|
1014
|
-
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1015
|
-
};
|
|
1016
|
-
if (options.signal && !options.signal.aborted) {
|
|
1017
|
-
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1018
|
-
}
|
|
1019
|
-
const cleanUp = () => {
|
|
1020
|
-
var _a2;
|
|
1021
|
-
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1022
|
-
operation.stop();
|
|
1023
|
-
};
|
|
1024
971
|
operation.attempt(async (attemptNumber) => {
|
|
1025
972
|
try {
|
|
1026
|
-
|
|
1027
|
-
cleanUp();
|
|
1028
|
-
resolve(result);
|
|
973
|
+
resolve(await input(attemptNumber));
|
|
1029
974
|
} catch (error) {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
975
|
+
if (!(error instanceof Error)) {
|
|
976
|
+
reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
if (error instanceof AbortError) {
|
|
980
|
+
operation.stop();
|
|
981
|
+
reject(error.originalError);
|
|
982
|
+
} else if (error instanceof TypeError && !isNetworkError(error.message)) {
|
|
983
|
+
operation.stop();
|
|
984
|
+
reject(error);
|
|
985
|
+
} else {
|
|
1040
986
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
987
|
+
try {
|
|
988
|
+
await options.onFailedAttempt(error);
|
|
989
|
+
} catch (error2) {
|
|
990
|
+
reject(error2);
|
|
991
|
+
return;
|
|
1044
992
|
}
|
|
1045
|
-
await options.onFailedAttempt(error);
|
|
1046
993
|
if (!operation.retry(error)) {
|
|
1047
|
-
|
|
994
|
+
reject(operation.mainError());
|
|
1048
995
|
}
|
|
1049
|
-
} catch (finalError) {
|
|
1050
|
-
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1051
|
-
cleanUp();
|
|
1052
|
-
reject(finalError);
|
|
1053
996
|
}
|
|
1054
997
|
}
|
|
1055
998
|
});
|
|
999
|
+
if (options.signal && !options.signal.aborted) {
|
|
1000
|
+
options.signal.addEventListener("abort", () => {
|
|
1001
|
+
operation.stop();
|
|
1002
|
+
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1003
|
+
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1004
|
+
}, {
|
|
1005
|
+
once: true
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1056
1008
|
});
|
|
1057
1009
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1010
|
+
var AbortError2 = class extends Error {
|
|
1011
|
+
constructor() {
|
|
1012
|
+
super("Throttled function aborted");
|
|
1013
|
+
this.name = "AbortError";
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
function pThrottle({ limit, interval, strict }) {
|
|
1064
1017
|
if (!Number.isFinite(limit)) {
|
|
1065
1018
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1066
1019
|
}
|
|
@@ -1088,75 +1041,53 @@ function pThrottle({ limit, interval, strict, signal, onDelay }) {
|
|
|
1088
1041
|
const strictTicks = [];
|
|
1089
1042
|
function strictDelay() {
|
|
1090
1043
|
const now = Date.now();
|
|
1091
|
-
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1092
|
-
strictTicks.length = 0;
|
|
1093
|
-
}
|
|
1094
1044
|
if (strictTicks.length < limit) {
|
|
1095
1045
|
strictTicks.push(now);
|
|
1096
1046
|
return 0;
|
|
1097
1047
|
}
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1048
|
+
const earliestTime = strictTicks.shift() + interval;
|
|
1049
|
+
if (now >= earliestTime) {
|
|
1050
|
+
strictTicks.push(now);
|
|
1051
|
+
return 0;
|
|
1052
|
+
}
|
|
1053
|
+
strictTicks.push(earliestTime);
|
|
1054
|
+
return earliestTime - now;
|
|
1102
1055
|
}
|
|
1103
1056
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1104
1057
|
return (function_) => {
|
|
1105
|
-
const throttled = function(...
|
|
1058
|
+
const throttled = function(...args) {
|
|
1106
1059
|
if (!throttled.isEnabled) {
|
|
1107
|
-
return (async () => function_.apply(this,
|
|
1060
|
+
return (async () => function_.apply(this, args))();
|
|
1108
1061
|
}
|
|
1109
|
-
let
|
|
1062
|
+
let timeout;
|
|
1110
1063
|
return new Promise((resolve, reject) => {
|
|
1111
1064
|
const execute = () => {
|
|
1112
|
-
resolve(function_.apply(this,
|
|
1113
|
-
queue.delete(
|
|
1065
|
+
resolve(function_.apply(this, args));
|
|
1066
|
+
queue.delete(timeout);
|
|
1114
1067
|
};
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
timeoutId = setTimeout(execute, delay);
|
|
1118
|
-
queue.set(timeoutId, reject);
|
|
1119
|
-
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1120
|
-
} else {
|
|
1121
|
-
execute();
|
|
1122
|
-
}
|
|
1068
|
+
timeout = setTimeout(execute, getDelay());
|
|
1069
|
+
queue.set(timeout, reject);
|
|
1123
1070
|
});
|
|
1124
1071
|
};
|
|
1125
|
-
|
|
1072
|
+
throttled.abort = () => {
|
|
1126
1073
|
for (const timeout of queue.keys()) {
|
|
1127
1074
|
clearTimeout(timeout);
|
|
1128
|
-
queue.get(timeout)(
|
|
1075
|
+
queue.get(timeout)(new AbortError2());
|
|
1129
1076
|
}
|
|
1130
1077
|
queue.clear();
|
|
1131
1078
|
strictTicks.splice(0, strictTicks.length);
|
|
1132
1079
|
};
|
|
1133
|
-
registry.register(throttled, { signal, aborted });
|
|
1134
|
-
signal == null ? void 0 : signal.throwIfAborted();
|
|
1135
|
-
signal == null ? void 0 : signal.addEventListener("abort", aborted, { once: true });
|
|
1136
1080
|
throttled.isEnabled = true;
|
|
1137
|
-
Object.defineProperty(throttled, "queueSize", {
|
|
1138
|
-
get() {
|
|
1139
|
-
return queue.size;
|
|
1140
|
-
}
|
|
1141
|
-
});
|
|
1142
1081
|
return throttled;
|
|
1143
1082
|
};
|
|
1144
1083
|
}
|
|
1145
|
-
|
|
1146
|
-
// ../canvas/dist/index.mjs
|
|
1147
|
-
var __typeError3 = (msg) => {
|
|
1148
|
-
throw TypeError(msg);
|
|
1149
|
-
};
|
|
1150
|
-
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1151
|
-
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1152
|
-
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);
|
|
1153
1084
|
function createLimitPolicy({
|
|
1154
1085
|
throttle = { interval: 1e3, limit: 10 },
|
|
1155
|
-
retry:
|
|
1086
|
+
retry: retry2 = { retries: 1, factor: 1.66 },
|
|
1156
1087
|
limit = 10
|
|
1157
1088
|
}) {
|
|
1158
1089
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1159
|
-
const limiter = limit ?
|
|
1090
|
+
const limiter = limit ? (0, import_p_limit2.default)(limit) : null;
|
|
1160
1091
|
return function limitPolicy(func) {
|
|
1161
1092
|
let currentFunc = async () => await func();
|
|
1162
1093
|
if (throttler) {
|
|
@@ -1167,13 +1098,13 @@ function createLimitPolicy({
|
|
|
1167
1098
|
const limitFunc = currentFunc;
|
|
1168
1099
|
currentFunc = () => limiter(limitFunc);
|
|
1169
1100
|
}
|
|
1170
|
-
if (
|
|
1101
|
+
if (retry2) {
|
|
1171
1102
|
const retryFunc = currentFunc;
|
|
1172
1103
|
currentFunc = () => pRetry(retryFunc, {
|
|
1173
|
-
...
|
|
1104
|
+
...retry2,
|
|
1174
1105
|
onFailedAttempt: async (error) => {
|
|
1175
|
-
if (
|
|
1176
|
-
await
|
|
1106
|
+
if (retry2.onFailedAttempt) {
|
|
1107
|
+
await retry2.onFailedAttempt(error);
|
|
1177
1108
|
}
|
|
1178
1109
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1179
1110
|
throw error;
|
|
@@ -1184,6 +1115,47 @@ function createLimitPolicy({
|
|
|
1184
1115
|
return currentFunc();
|
|
1185
1116
|
};
|
|
1186
1117
|
}
|
|
1118
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
1119
|
+
function appendCsv(out, key, values) {
|
|
1120
|
+
if (values === void 0) {
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
out[key] = values.join(",");
|
|
1124
|
+
}
|
|
1125
|
+
function projectionToQuery(spec) {
|
|
1126
|
+
const out = {};
|
|
1127
|
+
if (!spec) {
|
|
1128
|
+
return out;
|
|
1129
|
+
}
|
|
1130
|
+
const { fields, fieldTypes, slots } = spec;
|
|
1131
|
+
const p = SELECT_QUERY_PREFIX;
|
|
1132
|
+
if (fields) {
|
|
1133
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
1134
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
1135
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
1136
|
+
}
|
|
1137
|
+
if (fieldTypes) {
|
|
1138
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
1139
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
1140
|
+
}
|
|
1141
|
+
if (slots) {
|
|
1142
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
1143
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
1144
|
+
if (typeof slots.depth === "number") {
|
|
1145
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
1146
|
+
}
|
|
1147
|
+
if (slots.named) {
|
|
1148
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
1149
|
+
for (const slotName of slotNames) {
|
|
1150
|
+
const named = slots.named[slotName];
|
|
1151
|
+
if (named && typeof named.depth === "number") {
|
|
1152
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return out;
|
|
1158
|
+
}
|
|
1187
1159
|
var CANVAS_URL = "/api/v1/canvas";
|
|
1188
1160
|
var CanvasClient = class extends ApiClient {
|
|
1189
1161
|
constructor(options) {
|
|
@@ -1198,17 +1170,24 @@ var CanvasClient = class extends ApiClient {
|
|
|
1198
1170
|
/** Fetches lists of Canvas compositions, optionally by type */
|
|
1199
1171
|
async getCompositionList(params = {}) {
|
|
1200
1172
|
const { projectId } = this.options;
|
|
1201
|
-
const { resolveData, filters, ...originParams } = params;
|
|
1173
|
+
const { resolveData, filters, select, ...originParams } = params;
|
|
1202
1174
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1175
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1203
1176
|
if (!resolveData) {
|
|
1204
|
-
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1177
|
+
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1178
|
+
...originParams,
|
|
1179
|
+
projectId,
|
|
1180
|
+
...rewrittenFilters,
|
|
1181
|
+
...rewrittenSelect
|
|
1182
|
+
});
|
|
1205
1183
|
return this.apiClient(fetchUri);
|
|
1206
1184
|
}
|
|
1207
1185
|
const edgeParams = {
|
|
1208
1186
|
...originParams,
|
|
1209
1187
|
projectId,
|
|
1210
1188
|
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
1211
|
-
...rewrittenFilters
|
|
1189
|
+
...rewrittenFilters,
|
|
1190
|
+
...rewrittenSelect
|
|
1212
1191
|
};
|
|
1213
1192
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
1214
1193
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
@@ -1313,20 +1292,26 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1313
1292
|
}
|
|
1314
1293
|
getContentTypes(options) {
|
|
1315
1294
|
const { projectId } = this.options;
|
|
1316
|
-
const fetchUri = this.createUrl(
|
|
1295
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1317
1296
|
return this.apiClient(fetchUri);
|
|
1318
1297
|
}
|
|
1319
1298
|
getEntries(options) {
|
|
1320
1299
|
const { projectId } = this.options;
|
|
1321
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
1300
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
1322
1301
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1302
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1323
1303
|
if (skipDataResolution) {
|
|
1324
|
-
const url = this.createUrl(
|
|
1304
|
+
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), {
|
|
1305
|
+
...params,
|
|
1306
|
+
...rewrittenFilters,
|
|
1307
|
+
...rewrittenSelect,
|
|
1308
|
+
projectId
|
|
1309
|
+
});
|
|
1325
1310
|
return this.apiClient(url);
|
|
1326
1311
|
}
|
|
1327
1312
|
const edgeUrl = this.createUrl(
|
|
1328
|
-
|
|
1329
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1313
|
+
__privateGet2(_ContentClient2, _entriesUrl),
|
|
1314
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
1330
1315
|
this.edgeApiHost
|
|
1331
1316
|
);
|
|
1332
1317
|
return this.apiClient(
|
|
@@ -1343,7 +1328,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1343
1328
|
return this.apiClient(historyUrl);
|
|
1344
1329
|
}
|
|
1345
1330
|
async upsertContentType(body, opts = {}) {
|
|
1346
|
-
const fetchUri = this.createUrl(
|
|
1331
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1347
1332
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1348
1333
|
delete body.contentType.slugSettings;
|
|
1349
1334
|
}
|
|
@@ -1355,7 +1340,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1355
1340
|
});
|
|
1356
1341
|
}
|
|
1357
1342
|
async upsertEntry(body, options) {
|
|
1358
|
-
const fetchUri = this.createUrl(
|
|
1343
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1359
1344
|
const headers = {};
|
|
1360
1345
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1361
1346
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1369,7 +1354,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1369
1354
|
return { modified: response.headers.get("x-modified-at") };
|
|
1370
1355
|
}
|
|
1371
1356
|
async deleteContentType(body) {
|
|
1372
|
-
const fetchUri = this.createUrl(
|
|
1357
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1373
1358
|
await this.apiClient(fetchUri, {
|
|
1374
1359
|
method: "DELETE",
|
|
1375
1360
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1377,7 +1362,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1377
1362
|
});
|
|
1378
1363
|
}
|
|
1379
1364
|
async deleteEntry(body) {
|
|
1380
|
-
const fetchUri = this.createUrl(
|
|
1365
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1381
1366
|
await this.apiClient(fetchUri, {
|
|
1382
1367
|
method: "DELETE",
|
|
1383
1368
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1396,8 +1381,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1396
1381
|
};
|
|
1397
1382
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1398
1383
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1399
|
-
|
|
1400
|
-
|
|
1384
|
+
__privateAdd2(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1385
|
+
__privateAdd2(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1401
1386
|
var _url8;
|
|
1402
1387
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1403
1388
|
constructor(options) {
|
|
@@ -1406,12 +1391,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1406
1391
|
/** Fetches all DataTypes for a project */
|
|
1407
1392
|
async get(options) {
|
|
1408
1393
|
const { projectId } = this.options;
|
|
1409
|
-
const fetchUri = this.createUrl(
|
|
1394
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1410
1395
|
return await this.apiClient(fetchUri);
|
|
1411
1396
|
}
|
|
1412
1397
|
/** Updates or creates (based on id) a DataType */
|
|
1413
1398
|
async upsert(body) {
|
|
1414
|
-
const fetchUri = this.createUrl(
|
|
1399
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1415
1400
|
await this.apiClient(fetchUri, {
|
|
1416
1401
|
method: "PUT",
|
|
1417
1402
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1420,7 +1405,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1420
1405
|
}
|
|
1421
1406
|
/** Deletes a DataType */
|
|
1422
1407
|
async remove(body) {
|
|
1423
|
-
const fetchUri = this.createUrl(
|
|
1408
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1424
1409
|
await this.apiClient(fetchUri, {
|
|
1425
1410
|
method: "DELETE",
|
|
1426
1411
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1429,7 +1414,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1429
1414
|
}
|
|
1430
1415
|
};
|
|
1431
1416
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1432
|
-
|
|
1417
|
+
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1433
1418
|
var CANVAS_DRAFT_STATE = 0;
|
|
1434
1419
|
var CANVAS_EDITOR_STATE = 63;
|
|
1435
1420
|
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
@@ -1525,7 +1510,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1525
1510
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1526
1511
|
*/
|
|
1527
1512
|
get(options) {
|
|
1528
|
-
const fetchUri = this.createUrl(
|
|
1513
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1529
1514
|
...options,
|
|
1530
1515
|
teamId: this.teamId
|
|
1531
1516
|
});
|
|
@@ -1535,7 +1520,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1535
1520
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1536
1521
|
*/
|
|
1537
1522
|
async deploy(body) {
|
|
1538
|
-
const fetchUri = this.createUrl(
|
|
1523
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1539
1524
|
await this.apiClient(fetchUri, {
|
|
1540
1525
|
method: "PUT",
|
|
1541
1526
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1546,7 +1531,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1546
1531
|
* Removes a custom AI property editor from a Mesh app.
|
|
1547
1532
|
*/
|
|
1548
1533
|
async delete(body) {
|
|
1549
|
-
const fetchUri = this.createUrl(
|
|
1534
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1550
1535
|
await this.apiClient(fetchUri, {
|
|
1551
1536
|
method: "DELETE",
|
|
1552
1537
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1555,7 +1540,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1555
1540
|
}
|
|
1556
1541
|
};
|
|
1557
1542
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1558
|
-
|
|
1543
|
+
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1559
1544
|
var _url22;
|
|
1560
1545
|
var _projectsUrl;
|
|
1561
1546
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1564,7 +1549,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1564
1549
|
}
|
|
1565
1550
|
/** Fetches single Project */
|
|
1566
1551
|
async get(options) {
|
|
1567
|
-
const fetchUri = this.createUrl(
|
|
1552
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
|
|
1568
1553
|
return await this.apiClient(fetchUri);
|
|
1569
1554
|
}
|
|
1570
1555
|
/**
|
|
@@ -1573,12 +1558,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1573
1558
|
* When omitted, returns all accessible teams and their projects.
|
|
1574
1559
|
*/
|
|
1575
1560
|
async getProjects(options) {
|
|
1576
|
-
const fetchUri = this.createUrl(
|
|
1561
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1577
1562
|
return await this.apiClient(fetchUri);
|
|
1578
1563
|
}
|
|
1579
1564
|
/** Updates or creates (based on id) a Project */
|
|
1580
1565
|
async upsert(body) {
|
|
1581
|
-
const fetchUri = this.createUrl(
|
|
1566
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1582
1567
|
return await this.apiClient(fetchUri, {
|
|
1583
1568
|
method: "PUT",
|
|
1584
1569
|
body: JSON.stringify({ ...body })
|
|
@@ -1586,7 +1571,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1586
1571
|
}
|
|
1587
1572
|
/** Deletes a Project */
|
|
1588
1573
|
async delete(body) {
|
|
1589
|
-
const fetchUri = this.createUrl(
|
|
1574
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1590
1575
|
await this.apiClient(fetchUri, {
|
|
1591
1576
|
method: "DELETE",
|
|
1592
1577
|
body: JSON.stringify({ ...body }),
|
|
@@ -1596,8 +1581,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1596
1581
|
};
|
|
1597
1582
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1598
1583
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1599
|
-
|
|
1600
|
-
|
|
1584
|
+
__privateAdd2(_ProjectClient, _url22, "/api/v1/project");
|
|
1585
|
+
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1601
1586
|
var isAllowedReferrer = (referrer) => {
|
|
1602
1587
|
return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
|
|
1603
1588
|
};
|
|
@@ -1985,7 +1970,7 @@ function createLimiter(concurrency) {
|
|
|
1985
1970
|
});
|
|
1986
1971
|
};
|
|
1987
1972
|
}
|
|
1988
|
-
async function
|
|
1973
|
+
async function retry(fn, options) {
|
|
1989
1974
|
let lastError;
|
|
1990
1975
|
let delay = 1e3;
|
|
1991
1976
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -2025,7 +2010,7 @@ function createLimitPolicy2({
|
|
|
2025
2010
|
}
|
|
2026
2011
|
if (retryOptions) {
|
|
2027
2012
|
const retryFunc = currentFunc;
|
|
2028
|
-
currentFunc = () =>
|
|
2013
|
+
currentFunc = () => retry(retryFunc, {
|
|
2029
2014
|
...retryOptions,
|
|
2030
2015
|
onFailedAttempt: async (error) => {
|
|
2031
2016
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2099,14 +2084,14 @@ var getCanvasClient = (options) => {
|
|
|
2099
2084
|
import "server-only";
|
|
2100
2085
|
|
|
2101
2086
|
// ../project-map/dist/index.mjs
|
|
2102
|
-
var
|
|
2087
|
+
var __typeError3 = (msg) => {
|
|
2103
2088
|
throw TypeError(msg);
|
|
2104
2089
|
};
|
|
2105
|
-
var
|
|
2106
|
-
var
|
|
2107
|
-
var
|
|
2108
|
-
var
|
|
2109
|
-
var __privateMethod = (obj, member, method) => (
|
|
2090
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
2091
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2092
|
+
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);
|
|
2093
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck3(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2094
|
+
var __privateMethod = (obj, member, method) => (__accessCheck3(obj, member, "access private method"), method);
|
|
2110
2095
|
var ProjectMapClient = class extends ApiClient {
|
|
2111
2096
|
constructor(options) {
|
|
2112
2097
|
super(options);
|
|
@@ -2253,12 +2238,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2253
2238
|
var _Route = class _Route2 {
|
|
2254
2239
|
constructor(route) {
|
|
2255
2240
|
this.route = route;
|
|
2256
|
-
|
|
2241
|
+
__privateAdd3(this, _routeInfo);
|
|
2257
2242
|
var _a;
|
|
2258
|
-
|
|
2243
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2259
2244
|
}
|
|
2260
2245
|
get dynamicSegmentCount() {
|
|
2261
|
-
return
|
|
2246
|
+
return __privateGet3(this, _routeInfo).segments.reduce(
|
|
2262
2247
|
(count, segment) => {
|
|
2263
2248
|
var _a;
|
|
2264
2249
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2270,7 +2255,7 @@ var _Route = class _Route2 {
|
|
|
2270
2255
|
matches(path) {
|
|
2271
2256
|
var _a, _b;
|
|
2272
2257
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2273
|
-
const { segments: routeSegments } =
|
|
2258
|
+
const { segments: routeSegments } = __privateGet3(this, _routeInfo);
|
|
2274
2259
|
if (pathSegments.length !== routeSegments.length) {
|
|
2275
2260
|
return { match: false };
|
|
2276
2261
|
}
|
|
@@ -2291,7 +2276,7 @@ var _Route = class _Route2 {
|
|
|
2291
2276
|
return { match: false };
|
|
2292
2277
|
}
|
|
2293
2278
|
}
|
|
2294
|
-
for (const [key, value] of
|
|
2279
|
+
for (const [key, value] of __privateGet3(this, _routeInfo).queryParams) {
|
|
2295
2280
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2296
2281
|
}
|
|
2297
2282
|
return possibleMatch;
|
|
@@ -2301,7 +2286,7 @@ var _Route = class _Route2 {
|
|
|
2301
2286
|
*/
|
|
2302
2287
|
expand(options) {
|
|
2303
2288
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2304
|
-
const path =
|
|
2289
|
+
const path = __privateGet3(this, _routeInfo).segments.map((segment) => {
|
|
2305
2290
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2306
2291
|
if (!dynamicSegmentName) {
|
|
2307
2292
|
return segment;
|
|
@@ -2352,7 +2337,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2352
2337
|
}
|
|
2353
2338
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2354
2339
|
};
|
|
2355
|
-
|
|
2340
|
+
__privateAdd3(_Route, _Route_static);
|
|
2356
2341
|
_Route.dynamicSegmentPrefix = ":";
|
|
2357
2342
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2358
2343
|
if (!doNotEscapeVariables) {
|