@uniformdev/next-app-router 20.63.1-alpha.12 → 20.63.1-alpha.18
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 +495 -564
- package/dist/cache.mjs +495 -564
- package/dist/component.js +366 -0
- package/dist/component.mjs +366 -0
- package/dist/handler.js +508 -577
- package/dist/handler.mjs +508 -577
- package/dist/index.esm.js +508 -577
- package/dist/index.js +508 -577
- package/dist/index.mjs +508 -577
- package/dist/middleware.js +453 -515
- package/dist/middleware.mjs +453 -515
- package/package.json +8 -8
package/dist/component.js
CHANGED
|
@@ -624,12 +624,378 @@ _url7 = /* @__PURE__ */ new WeakMap();
|
|
|
624
624
|
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
625
625
|
|
|
626
626
|
// ../canvas/dist/index.mjs
|
|
627
|
+
var __create2 = Object.create;
|
|
628
|
+
var __defProp3 = Object.defineProperty;
|
|
629
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
630
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
631
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
632
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
627
633
|
var __typeError2 = (msg) => {
|
|
628
634
|
throw TypeError(msg);
|
|
629
635
|
};
|
|
636
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
637
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
638
|
+
};
|
|
639
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
640
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
641
|
+
for (let key of __getOwnPropNames2(from))
|
|
642
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
643
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
644
|
+
}
|
|
645
|
+
return to;
|
|
646
|
+
};
|
|
647
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
648
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
649
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
650
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
651
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
652
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
|
|
653
|
+
mod
|
|
654
|
+
));
|
|
630
655
|
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
631
656
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
632
657
|
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);
|
|
658
|
+
var require_yocto_queue2 = __commonJS2({
|
|
659
|
+
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
|
|
660
|
+
"use strict";
|
|
661
|
+
var Node = class {
|
|
662
|
+
/// value;
|
|
663
|
+
/// next;
|
|
664
|
+
constructor(value) {
|
|
665
|
+
this.value = value;
|
|
666
|
+
this.next = void 0;
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
var Queue = class {
|
|
670
|
+
// TODO: Use private class fields when targeting Node.js 12.
|
|
671
|
+
// #_head;
|
|
672
|
+
// #_tail;
|
|
673
|
+
// #_size;
|
|
674
|
+
constructor() {
|
|
675
|
+
this.clear();
|
|
676
|
+
}
|
|
677
|
+
enqueue(value) {
|
|
678
|
+
const node = new Node(value);
|
|
679
|
+
if (this._head) {
|
|
680
|
+
this._tail.next = node;
|
|
681
|
+
this._tail = node;
|
|
682
|
+
} else {
|
|
683
|
+
this._head = node;
|
|
684
|
+
this._tail = node;
|
|
685
|
+
}
|
|
686
|
+
this._size++;
|
|
687
|
+
}
|
|
688
|
+
dequeue() {
|
|
689
|
+
const current = this._head;
|
|
690
|
+
if (!current) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
this._head = this._head.next;
|
|
694
|
+
this._size--;
|
|
695
|
+
return current.value;
|
|
696
|
+
}
|
|
697
|
+
clear() {
|
|
698
|
+
this._head = void 0;
|
|
699
|
+
this._tail = void 0;
|
|
700
|
+
this._size = 0;
|
|
701
|
+
}
|
|
702
|
+
get size() {
|
|
703
|
+
return this._size;
|
|
704
|
+
}
|
|
705
|
+
*[Symbol.iterator]() {
|
|
706
|
+
let current = this._head;
|
|
707
|
+
while (current) {
|
|
708
|
+
yield current.value;
|
|
709
|
+
current = current.next;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
module2.exports = Queue;
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
var require_p_limit2 = __commonJS2({
|
|
717
|
+
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
|
|
718
|
+
"use strict";
|
|
719
|
+
var Queue = require_yocto_queue2();
|
|
720
|
+
var pLimit2 = (concurrency) => {
|
|
721
|
+
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
722
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
723
|
+
}
|
|
724
|
+
const queue = new Queue();
|
|
725
|
+
let activeCount = 0;
|
|
726
|
+
const next = () => {
|
|
727
|
+
activeCount--;
|
|
728
|
+
if (queue.size > 0) {
|
|
729
|
+
queue.dequeue()();
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
const run = async (fn, resolve, ...args) => {
|
|
733
|
+
activeCount++;
|
|
734
|
+
const result = (async () => fn(...args))();
|
|
735
|
+
resolve(result);
|
|
736
|
+
try {
|
|
737
|
+
await result;
|
|
738
|
+
} catch (e) {
|
|
739
|
+
}
|
|
740
|
+
next();
|
|
741
|
+
};
|
|
742
|
+
const enqueue = (fn, resolve, ...args) => {
|
|
743
|
+
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
744
|
+
(async () => {
|
|
745
|
+
await Promise.resolve();
|
|
746
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
747
|
+
queue.dequeue()();
|
|
748
|
+
}
|
|
749
|
+
})();
|
|
750
|
+
};
|
|
751
|
+
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
752
|
+
enqueue(fn, resolve, ...args);
|
|
753
|
+
});
|
|
754
|
+
Object.defineProperties(generator, {
|
|
755
|
+
activeCount: {
|
|
756
|
+
get: () => activeCount
|
|
757
|
+
},
|
|
758
|
+
pendingCount: {
|
|
759
|
+
get: () => queue.size
|
|
760
|
+
},
|
|
761
|
+
clearQueue: {
|
|
762
|
+
value: () => {
|
|
763
|
+
queue.clear();
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
return generator;
|
|
768
|
+
};
|
|
769
|
+
module2.exports = pLimit2;
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
var require_retry_operation = __commonJS2({
|
|
773
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
|
|
774
|
+
"use strict";
|
|
775
|
+
function RetryOperation(timeouts, options) {
|
|
776
|
+
if (typeof options === "boolean") {
|
|
777
|
+
options = { forever: options };
|
|
778
|
+
}
|
|
779
|
+
this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
|
|
780
|
+
this._timeouts = timeouts;
|
|
781
|
+
this._options = options || {};
|
|
782
|
+
this._maxRetryTime = options && options.maxRetryTime || Infinity;
|
|
783
|
+
this._fn = null;
|
|
784
|
+
this._errors = [];
|
|
785
|
+
this._attempts = 1;
|
|
786
|
+
this._operationTimeout = null;
|
|
787
|
+
this._operationTimeoutCb = null;
|
|
788
|
+
this._timeout = null;
|
|
789
|
+
this._operationStart = null;
|
|
790
|
+
this._timer = null;
|
|
791
|
+
if (this._options.forever) {
|
|
792
|
+
this._cachedTimeouts = this._timeouts.slice(0);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
module2.exports = RetryOperation;
|
|
796
|
+
RetryOperation.prototype.reset = function() {
|
|
797
|
+
this._attempts = 1;
|
|
798
|
+
this._timeouts = this._originalTimeouts.slice(0);
|
|
799
|
+
};
|
|
800
|
+
RetryOperation.prototype.stop = function() {
|
|
801
|
+
if (this._timeout) {
|
|
802
|
+
clearTimeout(this._timeout);
|
|
803
|
+
}
|
|
804
|
+
if (this._timer) {
|
|
805
|
+
clearTimeout(this._timer);
|
|
806
|
+
}
|
|
807
|
+
this._timeouts = [];
|
|
808
|
+
this._cachedTimeouts = null;
|
|
809
|
+
};
|
|
810
|
+
RetryOperation.prototype.retry = function(err) {
|
|
811
|
+
if (this._timeout) {
|
|
812
|
+
clearTimeout(this._timeout);
|
|
813
|
+
}
|
|
814
|
+
if (!err) {
|
|
815
|
+
return false;
|
|
816
|
+
}
|
|
817
|
+
var currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
818
|
+
if (err && currentTime - this._operationStart >= this._maxRetryTime) {
|
|
819
|
+
this._errors.push(err);
|
|
820
|
+
this._errors.unshift(new Error("RetryOperation timeout occurred"));
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
this._errors.push(err);
|
|
824
|
+
var timeout = this._timeouts.shift();
|
|
825
|
+
if (timeout === void 0) {
|
|
826
|
+
if (this._cachedTimeouts) {
|
|
827
|
+
this._errors.splice(0, this._errors.length - 1);
|
|
828
|
+
timeout = this._cachedTimeouts.slice(-1);
|
|
829
|
+
} else {
|
|
830
|
+
return false;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
var self = this;
|
|
834
|
+
this._timer = setTimeout(function() {
|
|
835
|
+
self._attempts++;
|
|
836
|
+
if (self._operationTimeoutCb) {
|
|
837
|
+
self._timeout = setTimeout(function() {
|
|
838
|
+
self._operationTimeoutCb(self._attempts);
|
|
839
|
+
}, self._operationTimeout);
|
|
840
|
+
if (self._options.unref) {
|
|
841
|
+
self._timeout.unref();
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
self._fn(self._attempts);
|
|
845
|
+
}, timeout);
|
|
846
|
+
if (this._options.unref) {
|
|
847
|
+
this._timer.unref();
|
|
848
|
+
}
|
|
849
|
+
return true;
|
|
850
|
+
};
|
|
851
|
+
RetryOperation.prototype.attempt = function(fn, timeoutOps) {
|
|
852
|
+
this._fn = fn;
|
|
853
|
+
if (timeoutOps) {
|
|
854
|
+
if (timeoutOps.timeout) {
|
|
855
|
+
this._operationTimeout = timeoutOps.timeout;
|
|
856
|
+
}
|
|
857
|
+
if (timeoutOps.cb) {
|
|
858
|
+
this._operationTimeoutCb = timeoutOps.cb;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
var self = this;
|
|
862
|
+
if (this._operationTimeoutCb) {
|
|
863
|
+
this._timeout = setTimeout(function() {
|
|
864
|
+
self._operationTimeoutCb();
|
|
865
|
+
}, self._operationTimeout);
|
|
866
|
+
}
|
|
867
|
+
this._operationStart = (/* @__PURE__ */ new Date()).getTime();
|
|
868
|
+
this._fn(this._attempts);
|
|
869
|
+
};
|
|
870
|
+
RetryOperation.prototype.try = function(fn) {
|
|
871
|
+
console.log("Using RetryOperation.try() is deprecated");
|
|
872
|
+
this.attempt(fn);
|
|
873
|
+
};
|
|
874
|
+
RetryOperation.prototype.start = function(fn) {
|
|
875
|
+
console.log("Using RetryOperation.start() is deprecated");
|
|
876
|
+
this.attempt(fn);
|
|
877
|
+
};
|
|
878
|
+
RetryOperation.prototype.start = RetryOperation.prototype.try;
|
|
879
|
+
RetryOperation.prototype.errors = function() {
|
|
880
|
+
return this._errors;
|
|
881
|
+
};
|
|
882
|
+
RetryOperation.prototype.attempts = function() {
|
|
883
|
+
return this._attempts;
|
|
884
|
+
};
|
|
885
|
+
RetryOperation.prototype.mainError = function() {
|
|
886
|
+
if (this._errors.length === 0) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
var counts = {};
|
|
890
|
+
var mainError = null;
|
|
891
|
+
var mainErrorCount = 0;
|
|
892
|
+
for (var i = 0; i < this._errors.length; i++) {
|
|
893
|
+
var error = this._errors[i];
|
|
894
|
+
var message = error.message;
|
|
895
|
+
var count = (counts[message] || 0) + 1;
|
|
896
|
+
counts[message] = count;
|
|
897
|
+
if (count >= mainErrorCount) {
|
|
898
|
+
mainError = error;
|
|
899
|
+
mainErrorCount = count;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
return mainError;
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
var require_retry = __commonJS2({
|
|
907
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports2) {
|
|
908
|
+
"use strict";
|
|
909
|
+
var RetryOperation = require_retry_operation();
|
|
910
|
+
exports2.operation = function(options) {
|
|
911
|
+
var timeouts = exports2.timeouts(options);
|
|
912
|
+
return new RetryOperation(timeouts, {
|
|
913
|
+
forever: options && (options.forever || options.retries === Infinity),
|
|
914
|
+
unref: options && options.unref,
|
|
915
|
+
maxRetryTime: options && options.maxRetryTime
|
|
916
|
+
});
|
|
917
|
+
};
|
|
918
|
+
exports2.timeouts = function(options) {
|
|
919
|
+
if (options instanceof Array) {
|
|
920
|
+
return [].concat(options);
|
|
921
|
+
}
|
|
922
|
+
var opts = {
|
|
923
|
+
retries: 10,
|
|
924
|
+
factor: 2,
|
|
925
|
+
minTimeout: 1 * 1e3,
|
|
926
|
+
maxTimeout: Infinity,
|
|
927
|
+
randomize: false
|
|
928
|
+
};
|
|
929
|
+
for (var key in options) {
|
|
930
|
+
opts[key] = options[key];
|
|
931
|
+
}
|
|
932
|
+
if (opts.minTimeout > opts.maxTimeout) {
|
|
933
|
+
throw new Error("minTimeout is greater than maxTimeout");
|
|
934
|
+
}
|
|
935
|
+
var timeouts = [];
|
|
936
|
+
for (var i = 0; i < opts.retries; i++) {
|
|
937
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
938
|
+
}
|
|
939
|
+
if (options && options.forever && !timeouts.length) {
|
|
940
|
+
timeouts.push(this.createTimeout(i, opts));
|
|
941
|
+
}
|
|
942
|
+
timeouts.sort(function(a, b) {
|
|
943
|
+
return a - b;
|
|
944
|
+
});
|
|
945
|
+
return timeouts;
|
|
946
|
+
};
|
|
947
|
+
exports2.createTimeout = function(attempt, opts) {
|
|
948
|
+
var random = opts.randomize ? Math.random() + 1 : 1;
|
|
949
|
+
var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
|
|
950
|
+
timeout = Math.min(timeout, opts.maxTimeout);
|
|
951
|
+
return timeout;
|
|
952
|
+
};
|
|
953
|
+
exports2.wrap = function(obj, options, methods) {
|
|
954
|
+
if (options instanceof Array) {
|
|
955
|
+
methods = options;
|
|
956
|
+
options = null;
|
|
957
|
+
}
|
|
958
|
+
if (!methods) {
|
|
959
|
+
methods = [];
|
|
960
|
+
for (var key in obj) {
|
|
961
|
+
if (typeof obj[key] === "function") {
|
|
962
|
+
methods.push(key);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
for (var i = 0; i < methods.length; i++) {
|
|
967
|
+
var method = methods[i];
|
|
968
|
+
var original = obj[method];
|
|
969
|
+
obj[method] = function retryWrapper(original2) {
|
|
970
|
+
var op = exports2.operation(options);
|
|
971
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
972
|
+
var callback = args.pop();
|
|
973
|
+
args.push(function(err) {
|
|
974
|
+
if (op.retry(err)) {
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
if (err) {
|
|
978
|
+
arguments[0] = op.mainError();
|
|
979
|
+
}
|
|
980
|
+
callback.apply(this, arguments);
|
|
981
|
+
});
|
|
982
|
+
op.attempt(function() {
|
|
983
|
+
original2.apply(obj, args);
|
|
984
|
+
});
|
|
985
|
+
}.bind(obj, original);
|
|
986
|
+
obj[method].options = options;
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
var require_retry2 = __commonJS2({
|
|
992
|
+
"../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports2, module2) {
|
|
993
|
+
"use strict";
|
|
994
|
+
module2.exports = require_retry();
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
var import_p_limit2 = __toESM2(require_p_limit2());
|
|
998
|
+
var import_retry = __toESM2(require_retry2(), 1);
|
|
633
999
|
var _contentTypesUrl;
|
|
634
1000
|
var _entriesUrl;
|
|
635
1001
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|