@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/index.esm.js
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,238 +138,7 @@ 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
|
|
|
@@ -399,14 +151,14 @@ import "server-only";
|
|
|
399
151
|
// ../context/dist/api/api.mjs
|
|
400
152
|
var import_p_limit = __toESM(require_p_limit(), 1);
|
|
401
153
|
var __defProp2 = Object.defineProperty;
|
|
402
|
-
var
|
|
154
|
+
var __typeError = (msg) => {
|
|
403
155
|
throw TypeError(msg);
|
|
404
156
|
};
|
|
405
|
-
var
|
|
406
|
-
var
|
|
407
|
-
var
|
|
408
|
-
var
|
|
409
|
-
var
|
|
157
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
158
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
159
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
160
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
161
|
+
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);
|
|
410
162
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
411
163
|
var ApiClientError = class _ApiClientError extends Error {
|
|
412
164
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
@@ -425,7 +177,7 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
425
177
|
};
|
|
426
178
|
var ApiClient = class _ApiClient {
|
|
427
179
|
constructor(options) {
|
|
428
|
-
|
|
180
|
+
__publicField(this, "options");
|
|
429
181
|
var _a, _b, _c, _d, _e;
|
|
430
182
|
if (!options.apiKey && !options.bearerToken) {
|
|
431
183
|
throw new Error("You must provide an API key or a bearer token");
|
|
@@ -595,12 +347,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
595
347
|
/** Fetches all aggregates for a project */
|
|
596
348
|
async get(options) {
|
|
597
349
|
const { projectId } = this.options;
|
|
598
|
-
const fetchUri = this.createUrl(
|
|
350
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
|
|
599
351
|
return await this.apiClient(fetchUri);
|
|
600
352
|
}
|
|
601
353
|
/** Updates or creates (based on id) an Aggregate */
|
|
602
354
|
async upsert(body) {
|
|
603
|
-
const fetchUri = this.createUrl(
|
|
355
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
604
356
|
await this.apiClient(fetchUri, {
|
|
605
357
|
method: "PUT",
|
|
606
358
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -609,7 +361,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
609
361
|
}
|
|
610
362
|
/** Deletes an Aggregate */
|
|
611
363
|
async remove(body) {
|
|
612
|
-
const fetchUri = this.createUrl(
|
|
364
|
+
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
613
365
|
await this.apiClient(fetchUri, {
|
|
614
366
|
method: "DELETE",
|
|
615
367
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -618,7 +370,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
|
618
370
|
}
|
|
619
371
|
};
|
|
620
372
|
_url = /* @__PURE__ */ new WeakMap();
|
|
621
|
-
|
|
373
|
+
__privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
|
|
622
374
|
var _url2;
|
|
623
375
|
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
624
376
|
constructor(options) {
|
|
@@ -627,12 +379,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
|
627
379
|
/** Fetches the known score dimensions for a project */
|
|
628
380
|
async get(options) {
|
|
629
381
|
const { projectId } = this.options;
|
|
630
|
-
const fetchUri = this.createUrl(
|
|
382
|
+
const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
|
|
631
383
|
return await this.apiClient(fetchUri);
|
|
632
384
|
}
|
|
633
385
|
};
|
|
634
386
|
_url2 = /* @__PURE__ */ new WeakMap();
|
|
635
|
-
|
|
387
|
+
__privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
|
|
636
388
|
var _url3;
|
|
637
389
|
var _valueUrl;
|
|
638
390
|
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
@@ -642,12 +394,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
642
394
|
/** Fetches all enrichments and values for a project, grouped by category */
|
|
643
395
|
async get(options) {
|
|
644
396
|
const { projectId } = this.options;
|
|
645
|
-
const fetchUri = this.createUrl(
|
|
397
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
646
398
|
return await this.apiClient(fetchUri);
|
|
647
399
|
}
|
|
648
400
|
/** Updates or creates (based on id) an enrichment category */
|
|
649
401
|
async upsertCategory(body) {
|
|
650
|
-
const fetchUri = this.createUrl(
|
|
402
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
651
403
|
await this.apiClient(fetchUri, {
|
|
652
404
|
method: "PUT",
|
|
653
405
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -656,7 +408,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
656
408
|
}
|
|
657
409
|
/** Deletes an enrichment category */
|
|
658
410
|
async removeCategory(body) {
|
|
659
|
-
const fetchUri = this.createUrl(
|
|
411
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
660
412
|
await this.apiClient(fetchUri, {
|
|
661
413
|
method: "DELETE",
|
|
662
414
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -665,7 +417,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
665
417
|
}
|
|
666
418
|
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
667
419
|
async upsertValue(body) {
|
|
668
|
-
const fetchUri = this.createUrl(
|
|
420
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
669
421
|
await this.apiClient(fetchUri, {
|
|
670
422
|
method: "PUT",
|
|
671
423
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -674,7 +426,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
674
426
|
}
|
|
675
427
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
676
428
|
async removeValue(body) {
|
|
677
|
-
const fetchUri = this.createUrl(
|
|
429
|
+
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
678
430
|
await this.apiClient(fetchUri, {
|
|
679
431
|
method: "DELETE",
|
|
680
432
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -684,8 +436,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
|
684
436
|
};
|
|
685
437
|
_url3 = /* @__PURE__ */ new WeakMap();
|
|
686
438
|
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
687
|
-
|
|
688
|
-
|
|
439
|
+
__privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
440
|
+
__privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
689
441
|
var _url4;
|
|
690
442
|
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
691
443
|
constructor(options) {
|
|
@@ -694,7 +446,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
694
446
|
/** Fetches the Context manifest for a project */
|
|
695
447
|
async get(options) {
|
|
696
448
|
const { projectId } = this.options;
|
|
697
|
-
const fetchUri = this.createUrl(
|
|
449
|
+
const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
|
|
698
450
|
return await this.apiClient(fetchUri);
|
|
699
451
|
}
|
|
700
452
|
/** Publishes the Context manifest for a project */
|
|
@@ -708,7 +460,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
|
708
460
|
}
|
|
709
461
|
};
|
|
710
462
|
_url4 = /* @__PURE__ */ new WeakMap();
|
|
711
|
-
|
|
463
|
+
__privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
|
|
712
464
|
var ManifestClient = _ManifestClient;
|
|
713
465
|
var _url5;
|
|
714
466
|
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
@@ -718,12 +470,12 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
718
470
|
/** Fetches all Quirks for a project */
|
|
719
471
|
async get(options) {
|
|
720
472
|
const { projectId } = this.options;
|
|
721
|
-
const fetchUri = this.createUrl(
|
|
473
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
|
|
722
474
|
return await this.apiClient(fetchUri);
|
|
723
475
|
}
|
|
724
476
|
/** Updates or creates (based on id) a Quirk */
|
|
725
477
|
async upsert(body) {
|
|
726
|
-
const fetchUri = this.createUrl(
|
|
478
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
727
479
|
await this.apiClient(fetchUri, {
|
|
728
480
|
method: "PUT",
|
|
729
481
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -732,7 +484,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
732
484
|
}
|
|
733
485
|
/** Deletes a Quirk */
|
|
734
486
|
async remove(body) {
|
|
735
|
-
const fetchUri = this.createUrl(
|
|
487
|
+
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
736
488
|
await this.apiClient(fetchUri, {
|
|
737
489
|
method: "DELETE",
|
|
738
490
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -741,7 +493,7 @@ var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
|
741
493
|
}
|
|
742
494
|
};
|
|
743
495
|
_url5 = /* @__PURE__ */ new WeakMap();
|
|
744
|
-
|
|
496
|
+
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
745
497
|
var _url6;
|
|
746
498
|
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
747
499
|
constructor(options) {
|
|
@@ -750,12 +502,12 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
750
502
|
/** Fetches all Signals for a project */
|
|
751
503
|
async get(options) {
|
|
752
504
|
const { projectId } = this.options;
|
|
753
|
-
const fetchUri = this.createUrl(
|
|
505
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
754
506
|
return await this.apiClient(fetchUri);
|
|
755
507
|
}
|
|
756
508
|
/** Updates or creates (based on id) a Signal */
|
|
757
509
|
async upsert(body) {
|
|
758
|
-
const fetchUri = this.createUrl(
|
|
510
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
759
511
|
await this.apiClient(fetchUri, {
|
|
760
512
|
method: "PUT",
|
|
761
513
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -764,7 +516,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
764
516
|
}
|
|
765
517
|
/** Deletes a Signal */
|
|
766
518
|
async remove(body) {
|
|
767
|
-
const fetchUri = this.createUrl(
|
|
519
|
+
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
768
520
|
await this.apiClient(fetchUri, {
|
|
769
521
|
method: "DELETE",
|
|
770
522
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -773,7 +525,7 @@ var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
|
773
525
|
}
|
|
774
526
|
};
|
|
775
527
|
_url6 = /* @__PURE__ */ new WeakMap();
|
|
776
|
-
|
|
528
|
+
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
777
529
|
var _url7;
|
|
778
530
|
var _TestClient = class _TestClient2 extends ApiClient {
|
|
779
531
|
constructor(options) {
|
|
@@ -782,12 +534,12 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
782
534
|
/** Fetches all Tests for a project */
|
|
783
535
|
async get(options) {
|
|
784
536
|
const { projectId } = this.options;
|
|
785
|
-
const fetchUri = this.createUrl(
|
|
537
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
786
538
|
return await this.apiClient(fetchUri);
|
|
787
539
|
}
|
|
788
540
|
/** Updates or creates (based on id) a Test */
|
|
789
541
|
async upsert(body) {
|
|
790
|
-
const fetchUri = this.createUrl(
|
|
542
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
791
543
|
await this.apiClient(fetchUri, {
|
|
792
544
|
method: "PUT",
|
|
793
545
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -796,7 +548,7 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
796
548
|
}
|
|
797
549
|
/** Deletes a Test */
|
|
798
550
|
async remove(body) {
|
|
799
|
-
const fetchUri = this.createUrl(
|
|
551
|
+
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
800
552
|
await this.apiClient(fetchUri, {
|
|
801
553
|
method: "DELETE",
|
|
802
554
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -805,187 +557,393 @@ var _TestClient = class _TestClient2 extends ApiClient {
|
|
|
805
557
|
}
|
|
806
558
|
};
|
|
807
559
|
_url7 = /* @__PURE__ */ new WeakMap();
|
|
808
|
-
|
|
560
|
+
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
809
561
|
|
|
810
|
-
//
|
|
811
|
-
var
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
562
|
+
// ../canvas/dist/index.mjs
|
|
563
|
+
var __create2 = Object.create;
|
|
564
|
+
var __defProp3 = Object.defineProperty;
|
|
565
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
566
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
567
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
568
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
569
|
+
var __typeError2 = (msg) => {
|
|
570
|
+
throw TypeError(msg);
|
|
817
571
|
};
|
|
818
|
-
var
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
enqueue(value) {
|
|
827
|
-
const node = new Node(value);
|
|
828
|
-
if (__privateGet(this, _head)) {
|
|
829
|
-
__privateGet(this, _tail).next = node;
|
|
830
|
-
__privateSet(this, _tail, node);
|
|
831
|
-
} else {
|
|
832
|
-
__privateSet(this, _head, node);
|
|
833
|
-
__privateSet(this, _tail, node);
|
|
834
|
-
}
|
|
835
|
-
__privateWrapper(this, _size)._++;
|
|
836
|
-
}
|
|
837
|
-
dequeue() {
|
|
838
|
-
const current = __privateGet(this, _head);
|
|
839
|
-
if (!current) {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
843
|
-
__privateWrapper(this, _size)._--;
|
|
844
|
-
if (!__privateGet(this, _head)) {
|
|
845
|
-
__privateSet(this, _tail, void 0);
|
|
846
|
-
}
|
|
847
|
-
return current.value;
|
|
848
|
-
}
|
|
849
|
-
peek() {
|
|
850
|
-
if (!__privateGet(this, _head)) {
|
|
851
|
-
return;
|
|
852
|
-
}
|
|
853
|
-
return __privateGet(this, _head).value;
|
|
854
|
-
}
|
|
855
|
-
clear() {
|
|
856
|
-
__privateSet(this, _head, void 0);
|
|
857
|
-
__privateSet(this, _tail, void 0);
|
|
858
|
-
__privateSet(this, _size, 0);
|
|
572
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
573
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
574
|
+
};
|
|
575
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
576
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
577
|
+
for (let key of __getOwnPropNames2(from))
|
|
578
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
579
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
859
580
|
}
|
|
860
|
-
|
|
861
|
-
|
|
581
|
+
return to;
|
|
582
|
+
};
|
|
583
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
584
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
585
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
586
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
587
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
588
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
589
|
+
mod
|
|
590
|
+
));
|
|
591
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
592
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
593
|
+
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);
|
|
594
|
+
var require_yocto_queue2 = __commonJS2({
|
|
595
|
+
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
596
|
+
"use strict";
|
|
597
|
+
var Node = class {
|
|
598
|
+
/// value;
|
|
599
|
+
/// next;
|
|
600
|
+
constructor(value) {
|
|
601
|
+
this.value = value;
|
|
602
|
+
this.next = void 0;
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
var Queue = class {
|
|
606
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
607
|
+
// #_head;
|
|
608
|
+
// #_tail;
|
|
609
|
+
// #_size;
|
|
610
|
+
constructor() {
|
|
611
|
+
this.clear();
|
|
612
|
+
}
|
|
613
|
+
enqueue(value) {
|
|
614
|
+
const node = new Node(value);
|
|
615
|
+
if (this._head) {
|
|
616
|
+
this._tail.next = node;
|
|
617
|
+
this._tail = node;
|
|
618
|
+
} else {
|
|
619
|
+
this._head = node;
|
|
620
|
+
this._tail = node;
|
|
621
|
+
}
|
|
622
|
+
this._size++;
|
|
623
|
+
}
|
|
624
|
+
dequeue() {
|
|
625
|
+
const current = this._head;
|
|
626
|
+
if (!current) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
this._head = this._head.next;
|
|
630
|
+
this._size--;
|
|
631
|
+
return current.value;
|
|
632
|
+
}
|
|
633
|
+
clear() {
|
|
634
|
+
this._head = void 0;
|
|
635
|
+
this._tail = void 0;
|
|
636
|
+
this._size = 0;
|
|
637
|
+
}
|
|
638
|
+
get size() {
|
|
639
|
+
return this._size;
|
|
640
|
+
}
|
|
641
|
+
*[Symbol.iterator]() {
|
|
642
|
+
let current = this._head;
|
|
643
|
+
while (current) {
|
|
644
|
+
yield current.value;
|
|
645
|
+
current = current.next;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
module.exports = Queue;
|
|
862
650
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
651
|
+
});
|
|
652
|
+
var require_p_limit2 = __commonJS2({
|
|
653
|
+
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
654
|
+
"use strict";
|
|
655
|
+
var Queue = require_yocto_queue2();
|
|
656
|
+
var pLimit2 = (concurrency) => {
|
|
657
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
658
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
659
|
+
}
|
|
660
|
+
const queue = new Queue();
|
|
661
|
+
let activeCount = 0;
|
|
662
|
+
const next = () => {
|
|
663
|
+
activeCount--;
|
|
664
|
+
if (queue.size > 0) {
|
|
665
|
+
queue.dequeue()();
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
const run = async (fn, resolve, ...args) => {
|
|
669
|
+
activeCount++;
|
|
670
|
+
const result = (async () => fn(...args))();
|
|
671
|
+
resolve(result);
|
|
672
|
+
try {
|
|
673
|
+
await result;
|
|
674
|
+
} catch (e) {
|
|
675
|
+
}
|
|
676
|
+
next();
|
|
677
|
+
};
|
|
678
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
679
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
680
|
+
(async () => {
|
|
681
|
+
await Promise.resolve();
|
|
682
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
683
|
+
queue.dequeue()();
|
|
684
|
+
}
|
|
685
|
+
})();
|
|
686
|
+
};
|
|
687
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
688
|
+
enqueue(fn, resolve, ...args);
|
|
689
|
+
});
|
|
690
|
+
Object.defineProperties(generator, {
|
|
691
|
+
activeCount: {
|
|
692
|
+
get: () => activeCount
|
|
693
|
+
},
|
|
694
|
+
pendingCount: {
|
|
695
|
+
get: () => queue.size
|
|
696
|
+
},
|
|
697
|
+
clearQueue: {
|
|
698
|
+
value: () => {
|
|
699
|
+
queue.clear();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
return generator;
|
|
704
|
+
};
|
|
705
|
+
module.exports = pLimit2;
|
|
869
706
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
707
|
+
});
|
|
708
|
+
var require_retry_operation = __commonJS2({
|
|
709
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
710
|
+
"use strict";
|
|
711
|
+
function RetryOperation(timeouts, options) {
|
|
712
|
+
if (typeof options === "boolean") {
|
|
713
|
+
options = { forever: options };
|
|
714
|
+
}
|
|
715
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
716
|
+
this._timeouts = timeouts;
|
|
717
|
+
this._options = options || {};
|
|
718
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
719
|
+
this._fn = null;
|
|
720
|
+
this._errors = [];
|
|
721
|
+
this._attempts = 1;
|
|
722
|
+
this._operationTimeout = null;
|
|
723
|
+
this._operationTimeoutCb = null;
|
|
724
|
+
this._timeout = null;
|
|
725
|
+
this._operationStart = null;
|
|
726
|
+
this._timer = null;
|
|
727
|
+
if (this._options.forever) {
|
|
728
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
729
|
+
}
|
|
873
730
|
}
|
|
731
|
+
module.exports = RetryOperation;
|
|
732
|
+
RetryOperation.prototype.reset = function() {
|
|
733
|
+
this._attempts = 1;
|
|
734
|
+
this._timeouts = this._originalTimeouts.slice(0);
|
|
735
|
+
};
|
|
736
|
+
RetryOperation.prototype.stop = function() {
|
|
737
|
+
if (this._timeout) {
|
|
738
|
+
clearTimeout(this._timeout);
|
|
739
|
+
}
|
|
740
|
+
if (this._timer) {
|
|
741
|
+
clearTimeout(this._timer);
|
|
742
|
+
}
|
|
743
|
+
this._timeouts = [];
|
|
744
|
+
this._cachedTimeouts = null;
|
|
745
|
+
};
|
|
746
|
+
RetryOperation.prototype.retry = function(err) {
|
|
747
|
+
if (this._timeout) {
|
|
748
|
+
clearTimeout(this._timeout);
|
|
749
|
+
}
|
|
750
|
+
if (!err) {
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
754
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
755
|
+
this._errors.push(err);
|
|
756
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
757
|
+
return false;
|
|
758
|
+
}
|
|
759
|
+
this._errors.push(err);
|
|
760
|
+
var timeout = this._timeouts.shift();
|
|
761
|
+
if (timeout === void 0) {
|
|
762
|
+
if (this._cachedTimeouts) {
|
|
763
|
+
this._errors.splice(0, this._errors.length - 1);
|
|
764
|
+
timeout = this._cachedTimeouts.slice(-1);
|
|
765
|
+
} else {
|
|
766
|
+
return false;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
var self = this;
|
|
770
|
+
this._timer = setTimeout(function() {
|
|
771
|
+
self._attempts++;
|
|
772
|
+
if (self._operationTimeoutCb) {
|
|
773
|
+
self._timeout = setTimeout(function() {
|
|
774
|
+
self._operationTimeoutCb(self._attempts);
|
|
775
|
+
}, self._operationTimeout);
|
|
776
|
+
if (self._options.unref) {
|
|
777
|
+
self._timeout.unref();
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
self._fn(self._attempts);
|
|
781
|
+
}, timeout);
|
|
782
|
+
if (this._options.unref) {
|
|
783
|
+
this._timer.unref();
|
|
784
|
+
}
|
|
785
|
+
return true;
|
|
786
|
+
};
|
|
787
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
788
|
+
this._fn = fn;
|
|
789
|
+
if (timeoutOps) {
|
|
790
|
+
if (timeoutOps.timeout) {
|
|
791
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
792
|
+
}
|
|
793
|
+
if (timeoutOps.cb) {
|
|
794
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
var self = this;
|
|
798
|
+
if (this._operationTimeoutCb) {
|
|
799
|
+
this._timeout = setTimeout(function() {
|
|
800
|
+
self._operationTimeoutCb();
|
|
801
|
+
}, self._operationTimeout);
|
|
802
|
+
}
|
|
803
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
804
|
+
this._fn(this._attempts);
|
|
805
|
+
};
|
|
806
|
+
RetryOperation.prototype.try = function(fn) {
|
|
807
|
+
console.log("Using RetryOperation.try() is deprecated");
|
|
808
|
+
this.attempt(fn);
|
|
809
|
+
};
|
|
810
|
+
RetryOperation.prototype.start = function(fn) {
|
|
811
|
+
console.log("Using RetryOperation.start() is deprecated");
|
|
812
|
+
this.attempt(fn);
|
|
813
|
+
};
|
|
814
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
815
|
+
RetryOperation.prototype.errors = function() {
|
|
816
|
+
return this._errors;
|
|
817
|
+
};
|
|
818
|
+
RetryOperation.prototype.attempts = function() {
|
|
819
|
+
return this._attempts;
|
|
820
|
+
};
|
|
821
|
+
RetryOperation.prototype.mainError = function() {
|
|
822
|
+
if (this._errors.length === 0) {
|
|
823
|
+
return null;
|
|
824
|
+
}
|
|
825
|
+
var counts = {};
|
|
826
|
+
var mainError = null;
|
|
827
|
+
var mainErrorCount = 0;
|
|
828
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
829
|
+
var error = this._errors[i];
|
|
830
|
+
var message = error.message;
|
|
831
|
+
var count = (counts[message] || 0) + 1;
|
|
832
|
+
counts[message] = count;
|
|
833
|
+
if (count >= mainErrorCount) {
|
|
834
|
+
mainError = error;
|
|
835
|
+
mainErrorCount = count;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
return mainError;
|
|
839
|
+
};
|
|
874
840
|
}
|
|
875
|
-
};
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
const next = () => {
|
|
892
|
-
activeCount--;
|
|
893
|
-
resumeNext();
|
|
894
|
-
};
|
|
895
|
-
const run = async (function_, resolve, arguments_) => {
|
|
896
|
-
const result = (async () => function_(...arguments_))();
|
|
897
|
-
resolve(result);
|
|
898
|
-
try {
|
|
899
|
-
await result;
|
|
900
|
-
} catch (e) {
|
|
901
|
-
}
|
|
902
|
-
next();
|
|
903
|
-
};
|
|
904
|
-
const enqueue = (function_, resolve, arguments_) => {
|
|
905
|
-
new Promise((internalResolve) => {
|
|
906
|
-
queue.enqueue(internalResolve);
|
|
907
|
-
}).then(
|
|
908
|
-
run.bind(void 0, function_, resolve, arguments_)
|
|
909
|
-
);
|
|
910
|
-
(async () => {
|
|
911
|
-
await Promise.resolve();
|
|
912
|
-
if (activeCount < concurrency) {
|
|
913
|
-
resumeNext();
|
|
841
|
+
});
|
|
842
|
+
var require_retry = __commonJS2({
|
|
843
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports) {
|
|
844
|
+
"use strict";
|
|
845
|
+
var RetryOperation = require_retry_operation();
|
|
846
|
+
exports.operation = function(options) {
|
|
847
|
+
var timeouts = exports.timeouts(options);
|
|
848
|
+
return new RetryOperation(timeouts, {
|
|
849
|
+
forever: options && (options.forever || options.retries === Infinity),
|
|
850
|
+
unref: options && options.unref,
|
|
851
|
+
maxRetryTime: options && options.maxRetryTime
|
|
852
|
+
});
|
|
853
|
+
};
|
|
854
|
+
exports.timeouts = function(options) {
|
|
855
|
+
if (options instanceof Array) {
|
|
856
|
+
return [].concat(options);
|
|
914
857
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
pendingCount: {
|
|
925
|
-
get: () => queue.size
|
|
926
|
-
},
|
|
927
|
-
clearQueue: {
|
|
928
|
-
value() {
|
|
929
|
-
queue.clear();
|
|
858
|
+
var opts = {
|
|
859
|
+
retries: 10,
|
|
860
|
+
factor: 2,
|
|
861
|
+
minTimeout: 1 * 1e3,
|
|
862
|
+
maxTimeout: Infinity,
|
|
863
|
+
randomize: false
|
|
864
|
+
};
|
|
865
|
+
for (var key in options) {
|
|
866
|
+
opts[key] = options[key];
|
|
930
867
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
868
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
869
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
870
|
+
}
|
|
871
|
+
var timeouts = [];
|
|
872
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
873
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
874
|
+
}
|
|
875
|
+
if (options && options.forever && !timeouts.length) {
|
|
876
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
877
|
+
}
|
|
878
|
+
timeouts.sort(function(a, b) {
|
|
879
|
+
return a - b;
|
|
880
|
+
});
|
|
881
|
+
return timeouts;
|
|
882
|
+
};
|
|
883
|
+
exports.createTimeout = function(attempt, opts) {
|
|
884
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
885
|
+
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
886
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
887
|
+
return timeout;
|
|
888
|
+
};
|
|
889
|
+
exports.wrap = function(obj, options, methods) {
|
|
890
|
+
if (options instanceof Array) {
|
|
891
|
+
methods = options;
|
|
892
|
+
options = null;
|
|
893
|
+
}
|
|
894
|
+
if (!methods) {
|
|
895
|
+
methods = [];
|
|
896
|
+
for (var key in obj) {
|
|
897
|
+
if (typeof obj[key] === "function") {
|
|
898
|
+
methods.push(key);
|
|
940
899
|
}
|
|
941
|
-
}
|
|
900
|
+
}
|
|
942
901
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
902
|
+
for (var i = 0; i < methods.length; i++) {
|
|
903
|
+
var method = methods[i];
|
|
904
|
+
var original = obj[method];
|
|
905
|
+
obj[method] = function retryWrapper(original2) {
|
|
906
|
+
var op = exports.operation(options);
|
|
907
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
908
|
+
var callback = args.pop();
|
|
909
|
+
args.push(function(err) {
|
|
910
|
+
if (op.retry(err)) {
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
if (err) {
|
|
914
|
+
arguments[0] = op.mainError();
|
|
915
|
+
}
|
|
916
|
+
callback.apply(this, arguments);
|
|
917
|
+
});
|
|
918
|
+
op.attempt(function() {
|
|
919
|
+
original2.apply(obj, args);
|
|
920
|
+
});
|
|
921
|
+
}.bind(obj, original);
|
|
922
|
+
obj[method].options = options;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
950
925
|
}
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
var
|
|
959
|
-
var
|
|
960
|
-
|
|
961
|
-
// Chrome
|
|
926
|
+
});
|
|
927
|
+
var require_retry2 = __commonJS2({
|
|
928
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
929
|
+
"use strict";
|
|
930
|
+
module.exports = require_retry();
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
934
|
+
var import_retry = __toESM2(require_retry2(), 1);
|
|
935
|
+
var networkErrorMsgs = /* @__PURE__ */ new Set([
|
|
962
936
|
"Failed to fetch",
|
|
963
937
|
// Chrome
|
|
964
938
|
"NetworkError when attempting to fetch resource.",
|
|
965
939
|
// Firefox
|
|
966
940
|
"The Internet connection appears to be offline.",
|
|
967
|
-
// Safari
|
|
968
|
-
"Load failed",
|
|
969
|
-
// Safari 17+
|
|
941
|
+
// Safari
|
|
970
942
|
"Network request failed",
|
|
971
943
|
// `cross-fetch`
|
|
972
|
-
"fetch failed"
|
|
973
|
-
// Undici (Node.js)
|
|
974
|
-
"terminated"
|
|
944
|
+
"fetch failed"
|
|
975
945
|
// Undici (Node.js)
|
|
976
946
|
]);
|
|
977
|
-
function isNetworkError(error) {
|
|
978
|
-
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
979
|
-
if (!isValid) {
|
|
980
|
-
return false;
|
|
981
|
-
}
|
|
982
|
-
if (error.message === "Load failed") {
|
|
983
|
-
return error.stack === void 0;
|
|
984
|
-
}
|
|
985
|
-
return errorMessages.has(error.message);
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
// ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
989
947
|
var AbortError = class extends Error {
|
|
990
948
|
constructor(message) {
|
|
991
949
|
super();
|
|
@@ -1006,68 +964,63 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
|
|
|
1006
964
|
error.retriesLeft = retriesLeft;
|
|
1007
965
|
return error;
|
|
1008
966
|
};
|
|
967
|
+
var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
|
|
968
|
+
var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
|
|
1009
969
|
async function pRetry(input, options) {
|
|
1010
970
|
return new Promise((resolve, reject) => {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
971
|
+
options = {
|
|
972
|
+
onFailedAttempt() {
|
|
973
|
+
},
|
|
974
|
+
retries: 10,
|
|
975
|
+
...options
|
|
1014
976
|
};
|
|
1015
|
-
(_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
|
|
1016
|
-
(_c = options.retries) != null ? _c : options.retries = 10;
|
|
1017
977
|
const operation = import_retry.default.operation(options);
|
|
1018
|
-
const abortHandler = () => {
|
|
1019
|
-
var _a2;
|
|
1020
|
-
operation.stop();
|
|
1021
|
-
reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
|
|
1022
|
-
};
|
|
1023
|
-
if (options.signal && !options.signal.aborted) {
|
|
1024
|
-
options.signal.addEventListener("abort", abortHandler, { once: true });
|
|
1025
|
-
}
|
|
1026
|
-
const cleanUp = () => {
|
|
1027
|
-
var _a2;
|
|
1028
|
-
(_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
|
|
1029
|
-
operation.stop();
|
|
1030
|
-
};
|
|
1031
978
|
operation.attempt(async (attemptNumber) => {
|
|
1032
979
|
try {
|
|
1033
|
-
|
|
1034
|
-
cleanUp();
|
|
1035
|
-
resolve(result);
|
|
980
|
+
resolve(await input(attemptNumber));
|
|
1036
981
|
} catch (error) {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
982
|
+
if (!(error instanceof Error)) {
|
|
983
|
+
reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (error instanceof AbortError) {
|
|
987
|
+
operation.stop();
|
|
988
|
+
reject(error.originalError);
|
|
989
|
+
} else if (error instanceof TypeError && !isNetworkError(error.message)) {
|
|
990
|
+
operation.stop();
|
|
991
|
+
reject(error);
|
|
992
|
+
} else {
|
|
1047
993
|
decorateErrorWithCounts(error, attemptNumber, options);
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
994
|
+
try {
|
|
995
|
+
await options.onFailedAttempt(error);
|
|
996
|
+
} catch (error2) {
|
|
997
|
+
reject(error2);
|
|
998
|
+
return;
|
|
1051
999
|
}
|
|
1052
|
-
await options.onFailedAttempt(error);
|
|
1053
1000
|
if (!operation.retry(error)) {
|
|
1054
|
-
|
|
1001
|
+
reject(operation.mainError());
|
|
1055
1002
|
}
|
|
1056
|
-
} catch (finalError) {
|
|
1057
|
-
decorateErrorWithCounts(finalError, attemptNumber, options);
|
|
1058
|
-
cleanUp();
|
|
1059
|
-
reject(finalError);
|
|
1060
1003
|
}
|
|
1061
1004
|
}
|
|
1062
1005
|
});
|
|
1006
|
+
if (options.signal && !options.signal.aborted) {
|
|
1007
|
+
options.signal.addEventListener("abort", () => {
|
|
1008
|
+
operation.stop();
|
|
1009
|
+
const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
|
|
1010
|
+
reject(reason instanceof Error ? reason : getDOMException(reason));
|
|
1011
|
+
}, {
|
|
1012
|
+
once: true
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1063
1015
|
});
|
|
1064
1016
|
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1017
|
+
var AbortError2 = class extends Error {
|
|
1018
|
+
constructor() {
|
|
1019
|
+
super("Throttled function aborted");
|
|
1020
|
+
this.name = "AbortError";
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
function pThrottle({ limit, interval, strict }) {
|
|
1071
1024
|
if (!Number.isFinite(limit)) {
|
|
1072
1025
|
throw new TypeError("Expected `limit` to be a finite number");
|
|
1073
1026
|
}
|
|
@@ -1095,75 +1048,53 @@ function pThrottle({ limit, interval, strict, signal, onDelay }) {
|
|
|
1095
1048
|
const strictTicks = [];
|
|
1096
1049
|
function strictDelay() {
|
|
1097
1050
|
const now = Date.now();
|
|
1098
|
-
if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
|
|
1099
|
-
strictTicks.length = 0;
|
|
1100
|
-
}
|
|
1101
1051
|
if (strictTicks.length < limit) {
|
|
1102
1052
|
strictTicks.push(now);
|
|
1103
1053
|
return 0;
|
|
1104
1054
|
}
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1055
|
+
const earliestTime = strictTicks.shift() + interval;
|
|
1056
|
+
if (now >= earliestTime) {
|
|
1057
|
+
strictTicks.push(now);
|
|
1058
|
+
return 0;
|
|
1059
|
+
}
|
|
1060
|
+
strictTicks.push(earliestTime);
|
|
1061
|
+
return earliestTime - now;
|
|
1109
1062
|
}
|
|
1110
1063
|
const getDelay = strict ? strictDelay : windowedDelay;
|
|
1111
1064
|
return (function_) => {
|
|
1112
|
-
const throttled = function(...
|
|
1065
|
+
const throttled = function(...args) {
|
|
1113
1066
|
if (!throttled.isEnabled) {
|
|
1114
|
-
return (async () => function_.apply(this,
|
|
1067
|
+
return (async () => function_.apply(this, args))();
|
|
1115
1068
|
}
|
|
1116
|
-
let
|
|
1069
|
+
let timeout;
|
|
1117
1070
|
return new Promise((resolve, reject) => {
|
|
1118
1071
|
const execute = () => {
|
|
1119
|
-
resolve(function_.apply(this,
|
|
1120
|
-
queue.delete(
|
|
1072
|
+
resolve(function_.apply(this, args));
|
|
1073
|
+
queue.delete(timeout);
|
|
1121
1074
|
};
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
timeoutId = setTimeout(execute, delay);
|
|
1125
|
-
queue.set(timeoutId, reject);
|
|
1126
|
-
onDelay == null ? void 0 : onDelay(...arguments_);
|
|
1127
|
-
} else {
|
|
1128
|
-
execute();
|
|
1129
|
-
}
|
|
1075
|
+
timeout = setTimeout(execute, getDelay());
|
|
1076
|
+
queue.set(timeout, reject);
|
|
1130
1077
|
});
|
|
1131
1078
|
};
|
|
1132
|
-
|
|
1079
|
+
throttled.abort = () => {
|
|
1133
1080
|
for (const timeout of queue.keys()) {
|
|
1134
1081
|
clearTimeout(timeout);
|
|
1135
|
-
queue.get(timeout)(
|
|
1082
|
+
queue.get(timeout)(new AbortError2());
|
|
1136
1083
|
}
|
|
1137
1084
|
queue.clear();
|
|
1138
1085
|
strictTicks.splice(0, strictTicks.length);
|
|
1139
1086
|
};
|
|
1140
|
-
registry.register(throttled, { signal, aborted });
|
|
1141
|
-
signal == null ? void 0 : signal.throwIfAborted();
|
|
1142
|
-
signal == null ? void 0 : signal.addEventListener("abort", aborted, { once: true });
|
|
1143
1087
|
throttled.isEnabled = true;
|
|
1144
|
-
Object.defineProperty(throttled, "queueSize", {
|
|
1145
|
-
get() {
|
|
1146
|
-
return queue.size;
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
1149
1088
|
return throttled;
|
|
1150
1089
|
};
|
|
1151
1090
|
}
|
|
1152
|
-
|
|
1153
|
-
// ../canvas/dist/index.mjs
|
|
1154
|
-
var __typeError3 = (msg) => {
|
|
1155
|
-
throw TypeError(msg);
|
|
1156
|
-
};
|
|
1157
|
-
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
1158
|
-
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1159
|
-
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);
|
|
1160
1091
|
function createLimitPolicy({
|
|
1161
1092
|
throttle = { interval: 1e3, limit: 10 },
|
|
1162
|
-
retry:
|
|
1093
|
+
retry: retry2 = { retries: 1, factor: 1.66 },
|
|
1163
1094
|
limit = 10
|
|
1164
1095
|
}) {
|
|
1165
1096
|
const throttler = throttle ? pThrottle(throttle) : null;
|
|
1166
|
-
const limiter = limit ?
|
|
1097
|
+
const limiter = limit ? (0, import_p_limit2.default)(limit) : null;
|
|
1167
1098
|
return function limitPolicy(func) {
|
|
1168
1099
|
let currentFunc = async () => await func();
|
|
1169
1100
|
if (throttler) {
|
|
@@ -1174,13 +1105,13 @@ function createLimitPolicy({
|
|
|
1174
1105
|
const limitFunc = currentFunc;
|
|
1175
1106
|
currentFunc = () => limiter(limitFunc);
|
|
1176
1107
|
}
|
|
1177
|
-
if (
|
|
1108
|
+
if (retry2) {
|
|
1178
1109
|
const retryFunc = currentFunc;
|
|
1179
1110
|
currentFunc = () => pRetry(retryFunc, {
|
|
1180
|
-
...
|
|
1111
|
+
...retry2,
|
|
1181
1112
|
onFailedAttempt: async (error) => {
|
|
1182
|
-
if (
|
|
1183
|
-
await
|
|
1113
|
+
if (retry2.onFailedAttempt) {
|
|
1114
|
+
await retry2.onFailedAttempt(error);
|
|
1184
1115
|
}
|
|
1185
1116
|
if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
|
|
1186
1117
|
throw error;
|
|
@@ -1191,6 +1122,47 @@ function createLimitPolicy({
|
|
|
1191
1122
|
return currentFunc();
|
|
1192
1123
|
};
|
|
1193
1124
|
}
|
|
1125
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
1126
|
+
function appendCsv(out, key, values) {
|
|
1127
|
+
if (values === void 0) {
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
out[key] = values.join(",");
|
|
1131
|
+
}
|
|
1132
|
+
function projectionToQuery(spec) {
|
|
1133
|
+
const out = {};
|
|
1134
|
+
if (!spec) {
|
|
1135
|
+
return out;
|
|
1136
|
+
}
|
|
1137
|
+
const { fields, fieldTypes, slots } = spec;
|
|
1138
|
+
const p = SELECT_QUERY_PREFIX;
|
|
1139
|
+
if (fields) {
|
|
1140
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
1141
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
1142
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
1143
|
+
}
|
|
1144
|
+
if (fieldTypes) {
|
|
1145
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
1146
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
1147
|
+
}
|
|
1148
|
+
if (slots) {
|
|
1149
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
1150
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
1151
|
+
if (typeof slots.depth === "number") {
|
|
1152
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
1153
|
+
}
|
|
1154
|
+
if (slots.named) {
|
|
1155
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
1156
|
+
for (const slotName of slotNames) {
|
|
1157
|
+
const named = slots.named[slotName];
|
|
1158
|
+
if (named && typeof named.depth === "number") {
|
|
1159
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return out;
|
|
1165
|
+
}
|
|
1194
1166
|
var CANVAS_URL = "/api/v1/canvas";
|
|
1195
1167
|
var CanvasClient = class extends ApiClient {
|
|
1196
1168
|
constructor(options) {
|
|
@@ -1205,17 +1177,24 @@ var CanvasClient = class extends ApiClient {
|
|
|
1205
1177
|
/** Fetches lists of Canvas compositions, optionally by type */
|
|
1206
1178
|
async getCompositionList(params = {}) {
|
|
1207
1179
|
const { projectId } = this.options;
|
|
1208
|
-
const { resolveData, filters, ...originParams } = params;
|
|
1180
|
+
const { resolveData, filters, select, ...originParams } = params;
|
|
1209
1181
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1182
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1210
1183
|
if (!resolveData) {
|
|
1211
|
-
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1184
|
+
const fetchUri = this.createUrl(CANVAS_URL, {
|
|
1185
|
+
...originParams,
|
|
1186
|
+
projectId,
|
|
1187
|
+
...rewrittenFilters,
|
|
1188
|
+
...rewrittenSelect
|
|
1189
|
+
});
|
|
1212
1190
|
return this.apiClient(fetchUri);
|
|
1213
1191
|
}
|
|
1214
1192
|
const edgeParams = {
|
|
1215
1193
|
...originParams,
|
|
1216
1194
|
projectId,
|
|
1217
1195
|
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
1218
|
-
...rewrittenFilters
|
|
1196
|
+
...rewrittenFilters,
|
|
1197
|
+
...rewrittenSelect
|
|
1219
1198
|
};
|
|
1220
1199
|
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
1221
1200
|
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
@@ -1320,20 +1299,26 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1320
1299
|
}
|
|
1321
1300
|
getContentTypes(options) {
|
|
1322
1301
|
const { projectId } = this.options;
|
|
1323
|
-
const fetchUri = this.createUrl(
|
|
1302
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
1324
1303
|
return this.apiClient(fetchUri);
|
|
1325
1304
|
}
|
|
1326
1305
|
getEntries(options) {
|
|
1327
1306
|
const { projectId } = this.options;
|
|
1328
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
1307
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
1329
1308
|
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
1309
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1330
1310
|
if (skipDataResolution) {
|
|
1331
|
-
const url = this.createUrl(
|
|
1311
|
+
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), {
|
|
1312
|
+
...params,
|
|
1313
|
+
...rewrittenFilters,
|
|
1314
|
+
...rewrittenSelect,
|
|
1315
|
+
projectId
|
|
1316
|
+
});
|
|
1332
1317
|
return this.apiClient(url);
|
|
1333
1318
|
}
|
|
1334
1319
|
const edgeUrl = this.createUrl(
|
|
1335
|
-
|
|
1336
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
1320
|
+
__privateGet2(_ContentClient2, _entriesUrl),
|
|
1321
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
1337
1322
|
this.edgeApiHost
|
|
1338
1323
|
);
|
|
1339
1324
|
return this.apiClient(
|
|
@@ -1350,7 +1335,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1350
1335
|
return this.apiClient(historyUrl);
|
|
1351
1336
|
}
|
|
1352
1337
|
async upsertContentType(body, opts = {}) {
|
|
1353
|
-
const fetchUri = this.createUrl(
|
|
1338
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1354
1339
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
1355
1340
|
delete body.contentType.slugSettings;
|
|
1356
1341
|
}
|
|
@@ -1362,7 +1347,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1362
1347
|
});
|
|
1363
1348
|
}
|
|
1364
1349
|
async upsertEntry(body, options) {
|
|
1365
|
-
const fetchUri = this.createUrl(
|
|
1350
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1366
1351
|
const headers = {};
|
|
1367
1352
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1368
1353
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -1376,7 +1361,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1376
1361
|
return { modified: response.headers.get("x-modified-at") };
|
|
1377
1362
|
}
|
|
1378
1363
|
async deleteContentType(body) {
|
|
1379
|
-
const fetchUri = this.createUrl(
|
|
1364
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
|
|
1380
1365
|
await this.apiClient(fetchUri, {
|
|
1381
1366
|
method: "DELETE",
|
|
1382
1367
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1384,7 +1369,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1384
1369
|
});
|
|
1385
1370
|
}
|
|
1386
1371
|
async deleteEntry(body) {
|
|
1387
|
-
const fetchUri = this.createUrl(
|
|
1372
|
+
const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
|
|
1388
1373
|
await this.apiClient(fetchUri, {
|
|
1389
1374
|
method: "DELETE",
|
|
1390
1375
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1403,8 +1388,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
1403
1388
|
};
|
|
1404
1389
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
1405
1390
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
1406
|
-
|
|
1407
|
-
|
|
1391
|
+
__privateAdd2(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
1392
|
+
__privateAdd2(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
1408
1393
|
var _url8;
|
|
1409
1394
|
var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
1410
1395
|
constructor(options) {
|
|
@@ -1413,12 +1398,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1413
1398
|
/** Fetches all DataTypes for a project */
|
|
1414
1399
|
async get(options) {
|
|
1415
1400
|
const { projectId } = this.options;
|
|
1416
|
-
const fetchUri = this.createUrl(
|
|
1401
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1417
1402
|
return await this.apiClient(fetchUri);
|
|
1418
1403
|
}
|
|
1419
1404
|
/** Updates or creates (based on id) a DataType */
|
|
1420
1405
|
async upsert(body) {
|
|
1421
|
-
const fetchUri = this.createUrl(
|
|
1406
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1422
1407
|
await this.apiClient(fetchUri, {
|
|
1423
1408
|
method: "PUT",
|
|
1424
1409
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1427,7 +1412,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1427
1412
|
}
|
|
1428
1413
|
/** Deletes a DataType */
|
|
1429
1414
|
async remove(body) {
|
|
1430
|
-
const fetchUri = this.createUrl(
|
|
1415
|
+
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
1431
1416
|
await this.apiClient(fetchUri, {
|
|
1432
1417
|
method: "DELETE",
|
|
1433
1418
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -1436,7 +1421,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1436
1421
|
}
|
|
1437
1422
|
};
|
|
1438
1423
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1439
|
-
|
|
1424
|
+
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1440
1425
|
function getComponentPath(ancestorsAndSelf) {
|
|
1441
1426
|
const path = [];
|
|
1442
1427
|
for (let i = ancestorsAndSelf.length - 1; i >= 0; i--) {
|
|
@@ -1889,7 +1874,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1889
1874
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
1890
1875
|
*/
|
|
1891
1876
|
get(options) {
|
|
1892
|
-
const fetchUri = this.createUrl(
|
|
1877
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
1893
1878
|
...options,
|
|
1894
1879
|
teamId: this.teamId
|
|
1895
1880
|
});
|
|
@@ -1899,7 +1884,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1899
1884
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
1900
1885
|
*/
|
|
1901
1886
|
async deploy(body) {
|
|
1902
|
-
const fetchUri = this.createUrl(
|
|
1887
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1903
1888
|
await this.apiClient(fetchUri, {
|
|
1904
1889
|
method: "PUT",
|
|
1905
1890
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1910,7 +1895,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1910
1895
|
* Removes a custom AI property editor from a Mesh app.
|
|
1911
1896
|
*/
|
|
1912
1897
|
async delete(body) {
|
|
1913
|
-
const fetchUri = this.createUrl(
|
|
1898
|
+
const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
1914
1899
|
await this.apiClient(fetchUri, {
|
|
1915
1900
|
method: "DELETE",
|
|
1916
1901
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -1919,7 +1904,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1919
1904
|
}
|
|
1920
1905
|
};
|
|
1921
1906
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1922
|
-
|
|
1907
|
+
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1923
1908
|
var _url22;
|
|
1924
1909
|
var _projectsUrl;
|
|
1925
1910
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
@@ -1928,7 +1913,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1928
1913
|
}
|
|
1929
1914
|
/** Fetches single Project */
|
|
1930
1915
|
async get(options) {
|
|
1931
|
-
const fetchUri = this.createUrl(
|
|
1916
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
|
|
1932
1917
|
return await this.apiClient(fetchUri);
|
|
1933
1918
|
}
|
|
1934
1919
|
/**
|
|
@@ -1937,12 +1922,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1937
1922
|
* When omitted, returns all accessible teams and their projects.
|
|
1938
1923
|
*/
|
|
1939
1924
|
async getProjects(options) {
|
|
1940
|
-
const fetchUri = this.createUrl(
|
|
1925
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1941
1926
|
return await this.apiClient(fetchUri);
|
|
1942
1927
|
}
|
|
1943
1928
|
/** Updates or creates (based on id) a Project */
|
|
1944
1929
|
async upsert(body) {
|
|
1945
|
-
const fetchUri = this.createUrl(
|
|
1930
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1946
1931
|
return await this.apiClient(fetchUri, {
|
|
1947
1932
|
method: "PUT",
|
|
1948
1933
|
body: JSON.stringify({ ...body })
|
|
@@ -1950,7 +1935,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1950
1935
|
}
|
|
1951
1936
|
/** Deletes a Project */
|
|
1952
1937
|
async delete(body) {
|
|
1953
|
-
const fetchUri = this.createUrl(
|
|
1938
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
1954
1939
|
await this.apiClient(fetchUri, {
|
|
1955
1940
|
method: "DELETE",
|
|
1956
1941
|
body: JSON.stringify({ ...body }),
|
|
@@ -1960,8 +1945,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1960
1945
|
};
|
|
1961
1946
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1962
1947
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1963
|
-
|
|
1964
|
-
|
|
1948
|
+
__privateAdd2(_ProjectClient, _url22, "/api/v1/project");
|
|
1949
|
+
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1965
1950
|
var ROUTE_URL = "/api/v1/route";
|
|
1966
1951
|
var RouteClient = class extends ApiClient {
|
|
1967
1952
|
constructor(options) {
|
|
@@ -1975,7 +1960,9 @@ var RouteClient = class extends ApiClient {
|
|
|
1975
1960
|
/** Fetches lists of Canvas compositions, optionally by type */
|
|
1976
1961
|
async getRoute(options) {
|
|
1977
1962
|
const { projectId } = this.options;
|
|
1978
|
-
const
|
|
1963
|
+
const { select, ...rest } = options != null ? options : {};
|
|
1964
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1965
|
+
const fetchUri = this.createUrl(ROUTE_URL, { ...rest, projectId, ...rewrittenSelect }, this.edgeApiHost);
|
|
1979
1966
|
return await this.apiClient(
|
|
1980
1967
|
fetchUri,
|
|
1981
1968
|
this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
|
|
@@ -2219,7 +2206,7 @@ function createLimiter(concurrency) {
|
|
|
2219
2206
|
});
|
|
2220
2207
|
};
|
|
2221
2208
|
}
|
|
2222
|
-
async function
|
|
2209
|
+
async function retry(fn, options) {
|
|
2223
2210
|
let lastError;
|
|
2224
2211
|
let delay = 1e3;
|
|
2225
2212
|
for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
|
|
@@ -2259,7 +2246,7 @@ function createLimitPolicy2({
|
|
|
2259
2246
|
}
|
|
2260
2247
|
if (retryOptions) {
|
|
2261
2248
|
const retryFunc = currentFunc;
|
|
2262
|
-
currentFunc = () =>
|
|
2249
|
+
currentFunc = () => retry(retryFunc, {
|
|
2263
2250
|
...retryOptions,
|
|
2264
2251
|
onFailedAttempt: async (error) => {
|
|
2265
2252
|
if (retryOptions.onFailedAttempt) {
|
|
@@ -2393,14 +2380,14 @@ var getManifest = async (options) => {
|
|
|
2393
2380
|
import "server-only";
|
|
2394
2381
|
|
|
2395
2382
|
// ../project-map/dist/index.mjs
|
|
2396
|
-
var
|
|
2383
|
+
var __typeError3 = (msg) => {
|
|
2397
2384
|
throw TypeError(msg);
|
|
2398
2385
|
};
|
|
2399
|
-
var
|
|
2400
|
-
var
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2403
|
-
var __privateMethod = (obj, member, method) => (
|
|
2386
|
+
var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
|
|
2387
|
+
var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2388
|
+
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);
|
|
2389
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck3(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
2390
|
+
var __privateMethod = (obj, member, method) => (__accessCheck3(obj, member, "access private method"), method);
|
|
2404
2391
|
var ProjectMapClient = class extends ApiClient {
|
|
2405
2392
|
constructor(options) {
|
|
2406
2393
|
super(options);
|
|
@@ -2547,12 +2534,12 @@ var isDynamicRouteSegment_fn;
|
|
|
2547
2534
|
var _Route = class _Route2 {
|
|
2548
2535
|
constructor(route) {
|
|
2549
2536
|
this.route = route;
|
|
2550
|
-
|
|
2537
|
+
__privateAdd3(this, _routeInfo);
|
|
2551
2538
|
var _a;
|
|
2552
|
-
|
|
2539
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
2553
2540
|
}
|
|
2554
2541
|
get dynamicSegmentCount() {
|
|
2555
|
-
return
|
|
2542
|
+
return __privateGet3(this, _routeInfo).segments.reduce(
|
|
2556
2543
|
(count, segment) => {
|
|
2557
2544
|
var _a;
|
|
2558
2545
|
return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
@@ -2564,7 +2551,7 @@ var _Route = class _Route2 {
|
|
|
2564
2551
|
matches(path) {
|
|
2565
2552
|
var _a, _b;
|
|
2566
2553
|
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
2567
|
-
const { segments: routeSegments } =
|
|
2554
|
+
const { segments: routeSegments } = __privateGet3(this, _routeInfo);
|
|
2568
2555
|
if (pathSegments.length !== routeSegments.length) {
|
|
2569
2556
|
return { match: false };
|
|
2570
2557
|
}
|
|
@@ -2585,7 +2572,7 @@ var _Route = class _Route2 {
|
|
|
2585
2572
|
return { match: false };
|
|
2586
2573
|
}
|
|
2587
2574
|
}
|
|
2588
|
-
for (const [key, value] of
|
|
2575
|
+
for (const [key, value] of __privateGet3(this, _routeInfo).queryParams) {
|
|
2589
2576
|
possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
|
|
2590
2577
|
}
|
|
2591
2578
|
return possibleMatch;
|
|
@@ -2595,7 +2582,7 @@ var _Route = class _Route2 {
|
|
|
2595
2582
|
*/
|
|
2596
2583
|
expand(options) {
|
|
2597
2584
|
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
2598
|
-
const path =
|
|
2585
|
+
const path = __privateGet3(this, _routeInfo).segments.map((segment) => {
|
|
2599
2586
|
const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
|
|
2600
2587
|
if (!dynamicSegmentName) {
|
|
2601
2588
|
return segment;
|
|
@@ -2646,7 +2633,7 @@ isDynamicRouteSegment_fn = function(segment) {
|
|
|
2646
2633
|
}
|
|
2647
2634
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
2648
2635
|
};
|
|
2649
|
-
|
|
2636
|
+
__privateAdd3(_Route, _Route_static);
|
|
2650
2637
|
_Route.dynamicSegmentPrefix = ":";
|
|
2651
2638
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
2652
2639
|
if (!doNotEscapeVariables) {
|