@uniformdev/next-app-router 20.49.1 → 20.49.3-alpha.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{UniformComposition-d7_93l3F.d.ts → UniformComposition-BWxMuY7i.d.ts} +2 -2
- package/dist/{UniformComposition-hhRIBHmn.d.mts → UniformComposition-Bo6UsTDC.d.mts} +2 -2
- package/dist/cache.d.mts +2 -2
- package/dist/cache.d.ts +2 -2
- package/dist/cache.js +768 -582
- package/dist/cache.mjs +768 -582
- package/dist/{client-BCGVjYM-.d.mts → client-DRMp2gpi.d.mts} +2 -1
- package/dist/{client-BCGVjYM-.d.ts → client-DRMp2gpi.d.ts} +2 -1
- package/dist/compat.d.mts +3 -3
- package/dist/compat.d.ts +3 -3
- package/dist/component.js +100 -387
- package/dist/component.mjs +101 -388
- package/dist/handler.js +797 -587
- package/dist/handler.mjs +797 -587
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +838 -596
- package/dist/index.js +845 -603
- package/dist/index.mjs +838 -596
- package/dist/middleware.d.mts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +790 -569
- package/dist/middleware.mjs +790 -569
- package/dist/{resolveRouteFromCode-DgTsfMK8.d.ts → resolveRouteFromCode-Bhz8EJBu.d.ts} +1 -1
- package/dist/{resolveRouteFromCode-CKaYNXte.d.mts → resolveRouteFromCode-C0dkUV2T.d.mts} +1 -1
- package/package.json +22 -21
package/dist/component.mjs
CHANGED
|
@@ -210,21 +210,28 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
210
210
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
211
211
|
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);
|
|
212
212
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
213
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
213
214
|
var ApiClientError = class _ApiClientError extends Error {
|
|
214
215
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
215
216
|
super(
|
|
216
217
|
`${errorMessage}
|
|
217
218
|
${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
|
|
218
219
|
);
|
|
219
|
-
this
|
|
220
|
-
this
|
|
221
|
-
this
|
|
222
|
-
this
|
|
223
|
-
this
|
|
224
|
-
this
|
|
220
|
+
__publicField(this, "errorMessage", errorMessage);
|
|
221
|
+
__publicField(this, "fetchMethod", fetchMethod);
|
|
222
|
+
__publicField(this, "fetchUri", fetchUri);
|
|
223
|
+
__publicField(this, "statusCode", statusCode);
|
|
224
|
+
__publicField(this, "statusText", statusText);
|
|
225
|
+
__publicField(this, "requestId", requestId);
|
|
225
226
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
226
227
|
}
|
|
227
228
|
};
|
|
229
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
230
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
231
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
232
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
228
235
|
var ApiClient = class _ApiClient {
|
|
229
236
|
constructor(options) {
|
|
230
237
|
__publicField(this, "options");
|
|
@@ -258,7 +265,7 @@ var ApiClient = class _ApiClient {
|
|
|
258
265
|
}
|
|
259
266
|
async apiClientWithResponse(fetchUri, options) {
|
|
260
267
|
return this.options.limitPolicy(async () => {
|
|
261
|
-
var _a;
|
|
268
|
+
var _a, _b;
|
|
262
269
|
const coreHeaders = this.options.apiKey ? {
|
|
263
270
|
"x-api-key": this.options.apiKey
|
|
264
271
|
} : {
|
|
@@ -294,9 +301,19 @@ var ApiClient = class _ApiClient {
|
|
|
294
301
|
} catch (e) {
|
|
295
302
|
message = `General error`;
|
|
296
303
|
}
|
|
304
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
305
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
306
|
+
message,
|
|
307
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
308
|
+
fetchUri.toString(),
|
|
309
|
+
apiResponse.status,
|
|
310
|
+
apiResponse.statusText,
|
|
311
|
+
_ApiClient.getRequestId(apiResponse)
|
|
312
|
+
);
|
|
313
|
+
}
|
|
297
314
|
throw new ApiClientError(
|
|
298
315
|
message,
|
|
299
|
-
(
|
|
316
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
300
317
|
fetchUri.toString(),
|
|
301
318
|
apiResponse.status,
|
|
302
319
|
apiResponse.statusText,
|
|
@@ -370,11 +387,25 @@ async function handleRateLimits(callApi) {
|
|
|
370
387
|
}
|
|
371
388
|
const base = Math.pow(2, backoffRetries - backoffRetriesLeft) * 333;
|
|
372
389
|
const backoffWait = base + Math.round(Math.random() * (base / 2)) * (Math.random() > 0.5 ? 1 : -1);
|
|
373
|
-
await new Promise((resolve) => setTimeout(resolve, resetWait + backoffWait));
|
|
390
|
+
await new Promise((resolve) => setTimeout(resolve, Math.max(0, resetWait + backoffWait)));
|
|
374
391
|
backoffRetriesLeft -= 1;
|
|
375
392
|
}
|
|
376
393
|
return response;
|
|
377
394
|
}
|
|
395
|
+
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
396
|
+
function rewriteFiltersForApi(filters) {
|
|
397
|
+
return Object.entries(filters != null ? filters : {}).reduce(
|
|
398
|
+
(acc, [key, value]) => {
|
|
399
|
+
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
400
|
+
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
401
|
+
return {
|
|
402
|
+
...acc,
|
|
403
|
+
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
{}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
378
409
|
var _url;
|
|
379
410
|
var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
380
411
|
constructor(options) {
|
|
@@ -595,391 +626,55 @@ _url7 = /* @__PURE__ */ new WeakMap();
|
|
|
595
626
|
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
596
627
|
|
|
597
628
|
// ../canvas/dist/index.mjs
|
|
598
|
-
var __create2 = Object.create;
|
|
599
|
-
var __defProp3 = Object.defineProperty;
|
|
600
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
601
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
602
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
603
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
604
629
|
var __typeError2 = (msg) => {
|
|
605
630
|
throw TypeError(msg);
|
|
606
631
|
};
|
|
607
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
608
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
609
|
-
};
|
|
610
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
611
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
612
|
-
for (let key of __getOwnPropNames2(from))
|
|
613
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
614
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
615
|
-
}
|
|
616
|
-
return to;
|
|
617
|
-
};
|
|
618
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
619
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
620
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
621
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
622
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
623
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
624
|
-
mod
|
|
625
|
-
));
|
|
626
632
|
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
627
633
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
628
634
|
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);
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
/// value;
|
|
634
|
-
/// next;
|
|
635
|
-
constructor(value) {
|
|
636
|
-
this.value = value;
|
|
637
|
-
this.next = void 0;
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
var Queue = class {
|
|
641
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
642
|
-
// #_head;
|
|
643
|
-
// #_tail;
|
|
644
|
-
// #_size;
|
|
645
|
-
constructor() {
|
|
646
|
-
this.clear();
|
|
647
|
-
}
|
|
648
|
-
enqueue(value) {
|
|
649
|
-
const node = new Node(value);
|
|
650
|
-
if (this._head) {
|
|
651
|
-
this._tail.next = node;
|
|
652
|
-
this._tail = node;
|
|
653
|
-
} else {
|
|
654
|
-
this._head = node;
|
|
655
|
-
this._tail = node;
|
|
656
|
-
}
|
|
657
|
-
this._size++;
|
|
658
|
-
}
|
|
659
|
-
dequeue() {
|
|
660
|
-
const current = this._head;
|
|
661
|
-
if (!current) {
|
|
662
|
-
return;
|
|
663
|
-
}
|
|
664
|
-
this._head = this._head.next;
|
|
665
|
-
this._size--;
|
|
666
|
-
return current.value;
|
|
667
|
-
}
|
|
668
|
-
clear() {
|
|
669
|
-
this._head = void 0;
|
|
670
|
-
this._tail = void 0;
|
|
671
|
-
this._size = 0;
|
|
672
|
-
}
|
|
673
|
-
get size() {
|
|
674
|
-
return this._size;
|
|
675
|
-
}
|
|
676
|
-
*[Symbol.iterator]() {
|
|
677
|
-
let current = this._head;
|
|
678
|
-
while (current) {
|
|
679
|
-
yield current.value;
|
|
680
|
-
current = current.next;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
module.exports = Queue;
|
|
635
|
+
var SELECT_QUERY_PREFIX = "select.";
|
|
636
|
+
function appendCsv(out, key, values) {
|
|
637
|
+
if (values === void 0) {
|
|
638
|
+
return;
|
|
685
639
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
const run = async (fn, resolve, ...args) => {
|
|
704
|
-
activeCount++;
|
|
705
|
-
const result = (async () => fn(...args))();
|
|
706
|
-
resolve(result);
|
|
707
|
-
try {
|
|
708
|
-
await result;
|
|
709
|
-
} catch (e) {
|
|
710
|
-
}
|
|
711
|
-
next();
|
|
712
|
-
};
|
|
713
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
714
|
-
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
715
|
-
(async () => {
|
|
716
|
-
await Promise.resolve();
|
|
717
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
718
|
-
queue.dequeue()();
|
|
719
|
-
}
|
|
720
|
-
})();
|
|
721
|
-
};
|
|
722
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
723
|
-
enqueue(fn, resolve, ...args);
|
|
724
|
-
});
|
|
725
|
-
Object.defineProperties(generator, {
|
|
726
|
-
activeCount: {
|
|
727
|
-
get: () => activeCount
|
|
728
|
-
},
|
|
729
|
-
pendingCount: {
|
|
730
|
-
get: () => queue.size
|
|
731
|
-
},
|
|
732
|
-
clearQueue: {
|
|
733
|
-
value: () => {
|
|
734
|
-
queue.clear();
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
return generator;
|
|
739
|
-
};
|
|
740
|
-
module.exports = pLimit2;
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
var require_retry_operation = __commonJS2({
|
|
744
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports, module) {
|
|
745
|
-
"use strict";
|
|
746
|
-
function RetryOperation(timeouts, options) {
|
|
747
|
-
if (typeof options === "boolean") {
|
|
748
|
-
options = { forever: options };
|
|
749
|
-
}
|
|
750
|
-
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
751
|
-
this._timeouts = timeouts;
|
|
752
|
-
this._options = options || {};
|
|
753
|
-
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
754
|
-
this._fn = null;
|
|
755
|
-
this._errors = [];
|
|
756
|
-
this._attempts = 1;
|
|
757
|
-
this._operationTimeout = null;
|
|
758
|
-
this._operationTimeoutCb = null;
|
|
759
|
-
this._timeout = null;
|
|
760
|
-
this._operationStart = null;
|
|
761
|
-
this._timer = null;
|
|
762
|
-
if (this._options.forever) {
|
|
763
|
-
this._cachedTimeouts = this._timeouts.slice(0);
|
|
764
|
-
}
|
|
640
|
+
out[key] = values.join(",");
|
|
641
|
+
}
|
|
642
|
+
function projectionToQuery(spec) {
|
|
643
|
+
const out = {};
|
|
644
|
+
if (!spec) {
|
|
645
|
+
return out;
|
|
646
|
+
}
|
|
647
|
+
const { fields, fieldTypes, slots } = spec;
|
|
648
|
+
const p = SELECT_QUERY_PREFIX;
|
|
649
|
+
if (fields) {
|
|
650
|
+
appendCsv(out, `${p}fields[only]`, fields.only);
|
|
651
|
+
appendCsv(out, `${p}fields[except]`, fields.except);
|
|
652
|
+
appendCsv(out, `${p}fields[locales]`, fields.locales);
|
|
653
|
+
if (fields.blockDepth === "preserveAll" || typeof fields.blockDepth === "number") {
|
|
654
|
+
out[`${p}fields[blockDepth]`] = String(fields.blockDepth);
|
|
765
655
|
}
|
|
766
|
-
module.exports = RetryOperation;
|
|
767
|
-
RetryOperation.prototype.reset = function() {
|
|
768
|
-
this._attempts = 1;
|
|
769
|
-
this._timeouts = this._originalTimeouts.slice(0);
|
|
770
|
-
};
|
|
771
|
-
RetryOperation.prototype.stop = function() {
|
|
772
|
-
if (this._timeout) {
|
|
773
|
-
clearTimeout(this._timeout);
|
|
774
|
-
}
|
|
775
|
-
if (this._timer) {
|
|
776
|
-
clearTimeout(this._timer);
|
|
777
|
-
}
|
|
778
|
-
this._timeouts = [];
|
|
779
|
-
this._cachedTimeouts = null;
|
|
780
|
-
};
|
|
781
|
-
RetryOperation.prototype.retry = function(err) {
|
|
782
|
-
if (this._timeout) {
|
|
783
|
-
clearTimeout(this._timeout);
|
|
784
|
-
}
|
|
785
|
-
if (!err) {
|
|
786
|
-
return false;
|
|
787
|
-
}
|
|
788
|
-
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
789
|
-
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
790
|
-
this._errors.push(err);
|
|
791
|
-
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
792
|
-
return false;
|
|
793
|
-
}
|
|
794
|
-
this._errors.push(err);
|
|
795
|
-
var timeout = this._timeouts.shift();
|
|
796
|
-
if (timeout === void 0) {
|
|
797
|
-
if (this._cachedTimeouts) {
|
|
798
|
-
this._errors.splice(0, this._errors.length - 1);
|
|
799
|
-
timeout = this._cachedTimeouts.slice(-1);
|
|
800
|
-
} else {
|
|
801
|
-
return false;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
var self = this;
|
|
805
|
-
this._timer = setTimeout(function() {
|
|
806
|
-
self._attempts++;
|
|
807
|
-
if (self._operationTimeoutCb) {
|
|
808
|
-
self._timeout = setTimeout(function() {
|
|
809
|
-
self._operationTimeoutCb(self._attempts);
|
|
810
|
-
}, self._operationTimeout);
|
|
811
|
-
if (self._options.unref) {
|
|
812
|
-
self._timeout.unref();
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
self._fn(self._attempts);
|
|
816
|
-
}, timeout);
|
|
817
|
-
if (this._options.unref) {
|
|
818
|
-
this._timer.unref();
|
|
819
|
-
}
|
|
820
|
-
return true;
|
|
821
|
-
};
|
|
822
|
-
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
823
|
-
this._fn = fn;
|
|
824
|
-
if (timeoutOps) {
|
|
825
|
-
if (timeoutOps.timeout) {
|
|
826
|
-
this._operationTimeout = timeoutOps.timeout;
|
|
827
|
-
}
|
|
828
|
-
if (timeoutOps.cb) {
|
|
829
|
-
this._operationTimeoutCb = timeoutOps.cb;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
var self = this;
|
|
833
|
-
if (this._operationTimeoutCb) {
|
|
834
|
-
this._timeout = setTimeout(function() {
|
|
835
|
-
self._operationTimeoutCb();
|
|
836
|
-
}, self._operationTimeout);
|
|
837
|
-
}
|
|
838
|
-
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
839
|
-
this._fn(this._attempts);
|
|
840
|
-
};
|
|
841
|
-
RetryOperation.prototype.try = function(fn) {
|
|
842
|
-
console.log("Using RetryOperation.try() is deprecated");
|
|
843
|
-
this.attempt(fn);
|
|
844
|
-
};
|
|
845
|
-
RetryOperation.prototype.start = function(fn) {
|
|
846
|
-
console.log("Using RetryOperation.start() is deprecated");
|
|
847
|
-
this.attempt(fn);
|
|
848
|
-
};
|
|
849
|
-
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
850
|
-
RetryOperation.prototype.errors = function() {
|
|
851
|
-
return this._errors;
|
|
852
|
-
};
|
|
853
|
-
RetryOperation.prototype.attempts = function() {
|
|
854
|
-
return this._attempts;
|
|
855
|
-
};
|
|
856
|
-
RetryOperation.prototype.mainError = function() {
|
|
857
|
-
if (this._errors.length === 0) {
|
|
858
|
-
return null;
|
|
859
|
-
}
|
|
860
|
-
var counts = {};
|
|
861
|
-
var mainError = null;
|
|
862
|
-
var mainErrorCount = 0;
|
|
863
|
-
for (var i = 0; i < this._errors.length; i++) {
|
|
864
|
-
var error = this._errors[i];
|
|
865
|
-
var message = error.message;
|
|
866
|
-
var count = (counts[message] || 0) + 1;
|
|
867
|
-
counts[message] = count;
|
|
868
|
-
if (count >= mainErrorCount) {
|
|
869
|
-
mainError = error;
|
|
870
|
-
mainErrorCount = count;
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
return mainError;
|
|
874
|
-
};
|
|
875
656
|
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
}
|
|
893
|
-
var opts = {
|
|
894
|
-
retries: 10,
|
|
895
|
-
factor: 2,
|
|
896
|
-
minTimeout: 1 * 1e3,
|
|
897
|
-
maxTimeout: Infinity,
|
|
898
|
-
randomize: false
|
|
899
|
-
};
|
|
900
|
-
for (var key in options) {
|
|
901
|
-
opts[key] = options[key];
|
|
902
|
-
}
|
|
903
|
-
if (opts.minTimeout > opts.maxTimeout) {
|
|
904
|
-
throw new Error("minTimeout is greater than maxTimeout");
|
|
905
|
-
}
|
|
906
|
-
var timeouts = [];
|
|
907
|
-
for (var i = 0; i < opts.retries; i++) {
|
|
908
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
909
|
-
}
|
|
910
|
-
if (options && options.forever && !timeouts.length) {
|
|
911
|
-
timeouts.push(this.createTimeout(i, opts));
|
|
912
|
-
}
|
|
913
|
-
timeouts.sort(function(a, b) {
|
|
914
|
-
return a - b;
|
|
915
|
-
});
|
|
916
|
-
return timeouts;
|
|
917
|
-
};
|
|
918
|
-
exports.createTimeout = function(attempt, opts) {
|
|
919
|
-
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
920
|
-
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
921
|
-
timeout = Math.min(timeout, opts.maxTimeout);
|
|
922
|
-
return timeout;
|
|
923
|
-
};
|
|
924
|
-
exports.wrap = function(obj, options, methods) {
|
|
925
|
-
if (options instanceof Array) {
|
|
926
|
-
methods = options;
|
|
927
|
-
options = null;
|
|
928
|
-
}
|
|
929
|
-
if (!methods) {
|
|
930
|
-
methods = [];
|
|
931
|
-
for (var key in obj) {
|
|
932
|
-
if (typeof obj[key] === "function") {
|
|
933
|
-
methods.push(key);
|
|
934
|
-
}
|
|
657
|
+
if (fieldTypes) {
|
|
658
|
+
appendCsv(out, `${p}fieldTypes[only]`, fieldTypes.only);
|
|
659
|
+
appendCsv(out, `${p}fieldTypes[except]`, fieldTypes.except);
|
|
660
|
+
}
|
|
661
|
+
if (slots) {
|
|
662
|
+
appendCsv(out, `${p}slots[only]`, slots.only);
|
|
663
|
+
appendCsv(out, `${p}slots[except]`, slots.except);
|
|
664
|
+
if (typeof slots.depth === "number") {
|
|
665
|
+
out[`${p}slots[depth]`] = String(slots.depth);
|
|
666
|
+
}
|
|
667
|
+
if (slots.named) {
|
|
668
|
+
const slotNames = Object.keys(slots.named).sort();
|
|
669
|
+
for (const slotName of slotNames) {
|
|
670
|
+
const named = slots.named[slotName];
|
|
671
|
+
if (named && typeof named.depth === "number") {
|
|
672
|
+
out[`${p}slots.${slotName}[depth]`] = String(named.depth);
|
|
935
673
|
}
|
|
936
674
|
}
|
|
937
|
-
|
|
938
|
-
var method = methods[i];
|
|
939
|
-
var original = obj[method];
|
|
940
|
-
obj[method] = function retryWrapper(original2) {
|
|
941
|
-
var op = exports.operation(options);
|
|
942
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
943
|
-
var callback = args.pop();
|
|
944
|
-
args.push(function(err) {
|
|
945
|
-
if (op.retry(err)) {
|
|
946
|
-
return;
|
|
947
|
-
}
|
|
948
|
-
if (err) {
|
|
949
|
-
arguments[0] = op.mainError();
|
|
950
|
-
}
|
|
951
|
-
callback.apply(this, arguments);
|
|
952
|
-
});
|
|
953
|
-
op.attempt(function() {
|
|
954
|
-
original2.apply(obj, args);
|
|
955
|
-
});
|
|
956
|
-
}.bind(obj, original);
|
|
957
|
-
obj[method].options = options;
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
|
-
var require_retry2 = __commonJS2({
|
|
963
|
-
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports, module) {
|
|
964
|
-
"use strict";
|
|
965
|
-
module.exports = require_retry();
|
|
675
|
+
}
|
|
966
676
|
}
|
|
967
|
-
|
|
968
|
-
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
969
|
-
var import_retry = __toESM2(require_retry2(), 1);
|
|
970
|
-
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
971
|
-
function rewriteFilters(filters) {
|
|
972
|
-
return Object.entries(filters != null ? filters : {}).reduce(
|
|
973
|
-
(acc, [key, value]) => {
|
|
974
|
-
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
975
|
-
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
976
|
-
return {
|
|
977
|
-
...acc,
|
|
978
|
-
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
979
|
-
};
|
|
980
|
-
},
|
|
981
|
-
{}
|
|
982
|
-
);
|
|
677
|
+
return out;
|
|
983
678
|
}
|
|
984
679
|
var _contentTypesUrl;
|
|
985
680
|
var _entriesUrl;
|
|
@@ -996,15 +691,21 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
996
691
|
}
|
|
997
692
|
getEntries(options) {
|
|
998
693
|
const { projectId } = this.options;
|
|
999
|
-
const { skipDataResolution, filters, ...params } = options;
|
|
1000
|
-
const rewrittenFilters =
|
|
694
|
+
const { skipDataResolution, filters, select, ...params } = options;
|
|
695
|
+
const rewrittenFilters = rewriteFiltersForApi(filters);
|
|
696
|
+
const rewrittenSelect = projectionToQuery(select);
|
|
1001
697
|
if (skipDataResolution) {
|
|
1002
|
-
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), {
|
|
698
|
+
const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), {
|
|
699
|
+
...params,
|
|
700
|
+
...rewrittenFilters,
|
|
701
|
+
...rewrittenSelect,
|
|
702
|
+
projectId
|
|
703
|
+
});
|
|
1003
704
|
return this.apiClient(url);
|
|
1004
705
|
}
|
|
1005
706
|
const edgeUrl = this.createUrl(
|
|
1006
707
|
__privateGet2(_ContentClient2, _entriesUrl),
|
|
1007
|
-
{ ...this.getEdgeOptions(params), ...rewrittenFilters },
|
|
708
|
+
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
1008
709
|
this.edgeApiHost
|
|
1009
710
|
);
|
|
1010
711
|
return this.apiClient(
|
|
@@ -1154,6 +855,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1154
855
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1155
856
|
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1156
857
|
var _url22;
|
|
858
|
+
var _projectsUrl;
|
|
1157
859
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
1158
860
|
constructor(options) {
|
|
1159
861
|
super({ ...options, bypassCache: true });
|
|
@@ -1163,6 +865,15 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1163
865
|
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
|
|
1164
866
|
return await this.apiClient(fetchUri);
|
|
1165
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* Fetches projects grouped by team.
|
|
870
|
+
* When teamId is provided, returns a single team with its projects.
|
|
871
|
+
* When omitted, returns all accessible teams and their projects.
|
|
872
|
+
*/
|
|
873
|
+
async getProjects(options) {
|
|
874
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
875
|
+
return await this.apiClient(fetchUri);
|
|
876
|
+
}
|
|
1166
877
|
/** Updates or creates (based on id) a Project */
|
|
1167
878
|
async upsert(body) {
|
|
1168
879
|
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
|
|
@@ -1182,7 +893,9 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1182
893
|
}
|
|
1183
894
|
};
|
|
1184
895
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
896
|
+
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1185
897
|
__privateAdd2(_ProjectClient, _url22, "/api/v1/project");
|
|
898
|
+
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1186
899
|
var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
|
|
1187
900
|
var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
1188
901
|
var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
|
|
@@ -1233,11 +946,11 @@ var LinebreakRichTextNode = () => {
|
|
|
1233
946
|
};
|
|
1234
947
|
|
|
1235
948
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
1236
|
-
import {
|
|
949
|
+
import { linkParamValueToAnchorProps } from "@uniformdev/richtext";
|
|
1237
950
|
import React4 from "react";
|
|
1238
951
|
var LinkRichTextNode = ({ children, node }) => {
|
|
1239
952
|
const { link } = node;
|
|
1240
|
-
return /* @__PURE__ */ React4.createElement("a", {
|
|
953
|
+
return /* @__PURE__ */ React4.createElement("a", { ...linkParamValueToAnchorProps(link) }, children);
|
|
1241
954
|
};
|
|
1242
955
|
|
|
1243
956
|
// src/components/nodes/ListItemRichTextNode.tsx
|