@learncard/simple-signing-plugin 1.1.8 → 1.1.10
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/simple-signing-plugin.cjs.development.cjs +40 -1483
- package/dist/simple-signing-plugin.cjs.development.cjs.map +4 -4
- package/dist/simple-signing-plugin.cjs.production.min.cjs +13 -18
- package/dist/simple-signing-plugin.cjs.production.min.cjs.map +4 -4
- package/dist/simple-signing-plugin.esm.js +39 -1482
- package/dist/simple-signing-plugin.esm.js.map +4 -4
- package/package.json +3 -2
|
@@ -569,10 +569,10 @@ function $constructor(name, initializer3, params) {
|
|
|
569
569
|
let Definition = _Definition;
|
|
570
570
|
Object.defineProperty(Definition, "name", { value: name });
|
|
571
571
|
function _(def) {
|
|
572
|
-
var
|
|
572
|
+
var _a2;
|
|
573
573
|
const inst = params?.Parent ? new Definition() : this;
|
|
574
574
|
init(inst, def);
|
|
575
|
-
(
|
|
575
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
576
576
|
for (const fn of inst._zod.deferred) {
|
|
577
577
|
fn();
|
|
578
578
|
}
|
|
@@ -1198,8 +1198,8 @@ function aborted(x, startIndex = 0) {
|
|
|
1198
1198
|
__name(aborted, "aborted");
|
|
1199
1199
|
function prefixIssues(path, issues) {
|
|
1200
1200
|
return issues.map((iss) => {
|
|
1201
|
-
var
|
|
1202
|
-
(
|
|
1201
|
+
var _a2;
|
|
1202
|
+
(_a2 = iss).path ?? (_a2.path = []);
|
|
1203
1203
|
iss.path.unshift(path);
|
|
1204
1204
|
return iss;
|
|
1205
1205
|
});
|
|
@@ -1380,7 +1380,7 @@ __name(formatError, "formatError");
|
|
|
1380
1380
|
function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
1381
1381
|
const result = { errors: [] };
|
|
1382
1382
|
const processError = /* @__PURE__ */ __name((error47, path = []) => {
|
|
1383
|
-
var
|
|
1383
|
+
var _a2, _b;
|
|
1384
1384
|
for (const issue2 of error47.issues) {
|
|
1385
1385
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1386
1386
|
issue2.errors.map((issues) => processError({ issues }, issue2.path));
|
|
@@ -1401,7 +1401,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
1401
1401
|
const terminal = i === fullpath.length - 1;
|
|
1402
1402
|
if (typeof el === "string") {
|
|
1403
1403
|
curr.properties ?? (curr.properties = {});
|
|
1404
|
-
(
|
|
1404
|
+
(_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
|
|
1405
1405
|
curr = curr.properties[el];
|
|
1406
1406
|
} else {
|
|
1407
1407
|
curr.items ?? (curr.items = []);
|
|
@@ -1704,10 +1704,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
|
1704
1704
|
|
|
1705
1705
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js
|
|
1706
1706
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1707
|
-
var
|
|
1707
|
+
var _a2;
|
|
1708
1708
|
inst._zod ?? (inst._zod = {});
|
|
1709
1709
|
inst._zod.def = def;
|
|
1710
|
-
(
|
|
1710
|
+
(_a2 = inst._zod).onattach ?? (_a2.onattach = []);
|
|
1711
1711
|
});
|
|
1712
1712
|
var numericOriginMap = {
|
|
1713
1713
|
number: "number",
|
|
@@ -1773,8 +1773,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
1773
1773
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1774
1774
|
$ZodCheck.init(inst, def);
|
|
1775
1775
|
inst._zod.onattach.push((inst2) => {
|
|
1776
|
-
var
|
|
1777
|
-
(
|
|
1776
|
+
var _a2;
|
|
1777
|
+
(_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
|
|
1778
1778
|
});
|
|
1779
1779
|
inst._zod.check = (payload) => {
|
|
1780
1780
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -1901,9 +1901,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1901
1901
|
};
|
|
1902
1902
|
});
|
|
1903
1903
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
1904
|
-
var
|
|
1904
|
+
var _a2;
|
|
1905
1905
|
$ZodCheck.init(inst, def);
|
|
1906
|
-
(
|
|
1906
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
1907
1907
|
const val = payload.value;
|
|
1908
1908
|
return !nullish(val) && val.size !== void 0;
|
|
1909
1909
|
});
|
|
@@ -1929,9 +1929,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1929
1929
|
};
|
|
1930
1930
|
});
|
|
1931
1931
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
1932
|
-
var
|
|
1932
|
+
var _a2;
|
|
1933
1933
|
$ZodCheck.init(inst, def);
|
|
1934
|
-
(
|
|
1934
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
1935
1935
|
const val = payload.value;
|
|
1936
1936
|
return !nullish(val) && val.size !== void 0;
|
|
1937
1937
|
});
|
|
@@ -1957,9 +1957,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1957
1957
|
};
|
|
1958
1958
|
});
|
|
1959
1959
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
1960
|
-
var
|
|
1960
|
+
var _a2;
|
|
1961
1961
|
$ZodCheck.init(inst, def);
|
|
1962
|
-
(
|
|
1962
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
1963
1963
|
const val = payload.value;
|
|
1964
1964
|
return !nullish(val) && val.size !== void 0;
|
|
1965
1965
|
});
|
|
@@ -1987,9 +1987,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
1987
1987
|
};
|
|
1988
1988
|
});
|
|
1989
1989
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
1990
|
-
var
|
|
1990
|
+
var _a2;
|
|
1991
1991
|
$ZodCheck.init(inst, def);
|
|
1992
|
-
(
|
|
1992
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
1993
1993
|
const val = payload.value;
|
|
1994
1994
|
return !nullish(val) && val.length !== void 0;
|
|
1995
1995
|
});
|
|
@@ -2016,9 +2016,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2016
2016
|
};
|
|
2017
2017
|
});
|
|
2018
2018
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
2019
|
-
var
|
|
2019
|
+
var _a2;
|
|
2020
2020
|
$ZodCheck.init(inst, def);
|
|
2021
|
-
(
|
|
2021
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
2022
2022
|
const val = payload.value;
|
|
2023
2023
|
return !nullish(val) && val.length !== void 0;
|
|
2024
2024
|
});
|
|
@@ -2045,9 +2045,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2045
2045
|
};
|
|
2046
2046
|
});
|
|
2047
2047
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
2048
|
-
var
|
|
2048
|
+
var _a2;
|
|
2049
2049
|
$ZodCheck.init(inst, def);
|
|
2050
|
-
(
|
|
2050
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
2051
2051
|
const val = payload.value;
|
|
2052
2052
|
return !nullish(val) && val.length !== void 0;
|
|
2053
2053
|
});
|
|
@@ -2076,7 +2076,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2076
2076
|
};
|
|
2077
2077
|
});
|
|
2078
2078
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2079
|
-
var
|
|
2079
|
+
var _a2, _b;
|
|
2080
2080
|
$ZodCheck.init(inst, def);
|
|
2081
2081
|
inst._zod.onattach.push((inst2) => {
|
|
2082
2082
|
const bag = inst2._zod.bag;
|
|
@@ -2087,7 +2087,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
2087
2087
|
}
|
|
2088
2088
|
});
|
|
2089
2089
|
if (def.pattern)
|
|
2090
|
-
(
|
|
2090
|
+
(_a2 = inst._zod).check ?? (_a2.check = (payload) => {
|
|
2091
2091
|
def.pattern.lastIndex = 0;
|
|
2092
2092
|
if (def.pattern.test(payload.value))
|
|
2093
2093
|
return;
|
|
@@ -2292,7 +2292,7 @@ var version = {
|
|
|
2292
2292
|
|
|
2293
2293
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js
|
|
2294
2294
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
2295
|
-
var
|
|
2295
|
+
var _a2;
|
|
2296
2296
|
inst ?? (inst = {});
|
|
2297
2297
|
inst._zod.def = def;
|
|
2298
2298
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -2307,7 +2307,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2307
2307
|
}
|
|
2308
2308
|
}
|
|
2309
2309
|
if (checks.length === 0) {
|
|
2310
|
-
(
|
|
2310
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
2311
2311
|
inst._zod.deferred?.push(() => {
|
|
2312
2312
|
inst._zod.run = inst._zod.parse;
|
|
2313
2313
|
});
|
|
@@ -3029,13 +3029,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3029
3029
|
}
|
|
3030
3030
|
return propValues;
|
|
3031
3031
|
});
|
|
3032
|
-
const
|
|
3032
|
+
const isObject2 = isObject;
|
|
3033
3033
|
const catchall = def.catchall;
|
|
3034
3034
|
let value;
|
|
3035
3035
|
inst._zod.parse = (payload, ctx) => {
|
|
3036
3036
|
value ?? (value = _normalized.value);
|
|
3037
3037
|
const input = payload.value;
|
|
3038
|
-
if (!
|
|
3038
|
+
if (!isObject2(input)) {
|
|
3039
3039
|
payload.issues.push({
|
|
3040
3040
|
expected: "object",
|
|
3041
3041
|
code: "invalid_type",
|
|
@@ -3109,7 +3109,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3109
3109
|
return (payload, ctx) => fn(shape, payload, ctx);
|
|
3110
3110
|
}, "generateFastpass");
|
|
3111
3111
|
let fastpass;
|
|
3112
|
-
const
|
|
3112
|
+
const isObject2 = isObject;
|
|
3113
3113
|
const jit = !globalConfig.jitless;
|
|
3114
3114
|
const allowsEval2 = allowsEval;
|
|
3115
3115
|
const fastEnabled = jit && allowsEval2.value;
|
|
@@ -3118,7 +3118,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3118
3118
|
inst._zod.parse = (payload, ctx) => {
|
|
3119
3119
|
value ?? (value = _normalized.value);
|
|
3120
3120
|
const input = payload.value;
|
|
3121
|
-
if (!
|
|
3121
|
+
if (!isObject2(input)) {
|
|
3122
3122
|
payload.issues.push({
|
|
3123
3123
|
expected: "object",
|
|
3124
3124
|
code: "invalid_type",
|
|
@@ -3226,19 +3226,19 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3226
3226
|
});
|
|
3227
3227
|
const disc = cached(() => {
|
|
3228
3228
|
const opts = def.options;
|
|
3229
|
-
const
|
|
3229
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
3230
3230
|
for (const o of opts) {
|
|
3231
3231
|
const values = o._zod.propValues?.[def.discriminator];
|
|
3232
3232
|
if (!values || values.size === 0)
|
|
3233
3233
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
3234
3234
|
for (const v of values) {
|
|
3235
|
-
if (
|
|
3235
|
+
if (map2.has(v)) {
|
|
3236
3236
|
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
3237
3237
|
}
|
|
3238
|
-
|
|
3238
|
+
map2.set(v, o);
|
|
3239
3239
|
}
|
|
3240
3240
|
}
|
|
3241
|
-
return
|
|
3241
|
+
return map2;
|
|
3242
3242
|
});
|
|
3243
3243
|
inst._zod.parse = (payload, ctx) => {
|
|
3244
3244
|
const input = payload.value;
|
|
@@ -11109,7 +11109,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
|
|
|
11109
11109
|
this.seen = /* @__PURE__ */ new Map();
|
|
11110
11110
|
}
|
|
11111
11111
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
11112
|
-
var
|
|
11112
|
+
var _a2;
|
|
11113
11113
|
const def = schema._zod.def;
|
|
11114
11114
|
const formatMap = {
|
|
11115
11115
|
guid: "uuid",
|
|
@@ -11623,7 +11623,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
|
|
|
11623
11623
|
delete result.schema.default;
|
|
11624
11624
|
}
|
|
11625
11625
|
if (this.io === "input" && result.schema._prefault)
|
|
11626
|
-
(
|
|
11626
|
+
(_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
|
|
11627
11627
|
delete result.schema._prefault;
|
|
11628
11628
|
const _result = this.seen.get(schema);
|
|
11629
11629
|
return _result.schema;
|
|
@@ -13058,9 +13058,9 @@ var ZodIssueCode = {
|
|
|
13058
13058
|
invalid_value: "invalid_value",
|
|
13059
13059
|
custom: "custom"
|
|
13060
13060
|
};
|
|
13061
|
-
function setErrorMap(
|
|
13061
|
+
function setErrorMap(map2) {
|
|
13062
13062
|
config({
|
|
13063
|
-
customError:
|
|
13063
|
+
customError: map2
|
|
13064
13064
|
});
|
|
13065
13065
|
}
|
|
13066
13066
|
__name(setErrorMap, "setErrorMap");
|
|
@@ -13114,1448 +13114,10 @@ var SigningAuthorityValidator = external_exports.object({
|
|
|
13114
13114
|
endpoint: external_exports.string().optional()
|
|
13115
13115
|
});
|
|
13116
13116
|
|
|
13117
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/objectSpread2-BvkFp-_Y.mjs
|
|
13118
|
-
var __create = Object.create;
|
|
13119
|
-
var __defProp2 = Object.defineProperty;
|
|
13120
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
13121
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
13122
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
13123
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
13124
|
-
var __commonJS = /* @__PURE__ */ __name((cb, mod) => function() {
|
|
13125
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13126
|
-
}, "__commonJS");
|
|
13127
|
-
var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {
|
|
13128
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13129
|
-
key = keys[i];
|
|
13130
|
-
if (!__hasOwnProp2.call(to, key) && key !== except) __defProp2(to, key, {
|
|
13131
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13132
|
-
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
13133
|
-
});
|
|
13134
|
-
}
|
|
13135
|
-
return to;
|
|
13136
|
-
}, "__copyProps");
|
|
13137
|
-
var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
13138
|
-
value: mod,
|
|
13139
|
-
enumerable: true
|
|
13140
|
-
}) : target, mod)), "__toESM");
|
|
13141
|
-
var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module2) {
|
|
13142
|
-
function _typeof$2(o) {
|
|
13143
|
-
"@babel/helpers - typeof";
|
|
13144
|
-
return module2.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
13145
|
-
return typeof o$1;
|
|
13146
|
-
} : function(o$1) {
|
|
13147
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
13148
|
-
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _typeof$2(o);
|
|
13149
|
-
}
|
|
13150
|
-
__name(_typeof$2, "_typeof$2");
|
|
13151
|
-
module2.exports = _typeof$2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13152
|
-
} });
|
|
13153
|
-
var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module2) {
|
|
13154
|
-
var _typeof$1 = require_typeof()["default"];
|
|
13155
|
-
function toPrimitive$1(t, r) {
|
|
13156
|
-
if ("object" != _typeof$1(t) || !t) return t;
|
|
13157
|
-
var e = t[Symbol.toPrimitive];
|
|
13158
|
-
if (void 0 !== e) {
|
|
13159
|
-
var i = e.call(t, r || "default");
|
|
13160
|
-
if ("object" != _typeof$1(i)) return i;
|
|
13161
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
13162
|
-
}
|
|
13163
|
-
return ("string" === r ? String : Number)(t);
|
|
13164
|
-
}
|
|
13165
|
-
__name(toPrimitive$1, "toPrimitive$1");
|
|
13166
|
-
module2.exports = toPrimitive$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13167
|
-
} });
|
|
13168
|
-
var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module2) {
|
|
13169
|
-
var _typeof = require_typeof()["default"];
|
|
13170
|
-
var toPrimitive = require_toPrimitive();
|
|
13171
|
-
function toPropertyKey$1(t) {
|
|
13172
|
-
var i = toPrimitive(t, "string");
|
|
13173
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
13174
|
-
}
|
|
13175
|
-
__name(toPropertyKey$1, "toPropertyKey$1");
|
|
13176
|
-
module2.exports = toPropertyKey$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13177
|
-
} });
|
|
13178
|
-
var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module2) {
|
|
13179
|
-
var toPropertyKey = require_toPropertyKey();
|
|
13180
|
-
function _defineProperty(e, r, t) {
|
|
13181
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
13182
|
-
value: t,
|
|
13183
|
-
enumerable: true,
|
|
13184
|
-
configurable: true,
|
|
13185
|
-
writable: true
|
|
13186
|
-
}) : e[r] = t, e;
|
|
13187
|
-
}
|
|
13188
|
-
__name(_defineProperty, "_defineProperty");
|
|
13189
|
-
module2.exports = _defineProperty, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13190
|
-
} });
|
|
13191
|
-
var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module2) {
|
|
13192
|
-
var defineProperty = require_defineProperty();
|
|
13193
|
-
function ownKeys(e, r) {
|
|
13194
|
-
var t = Object.keys(e);
|
|
13195
|
-
if (Object.getOwnPropertySymbols) {
|
|
13196
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
13197
|
-
r && (o = o.filter(function(r$1) {
|
|
13198
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
13199
|
-
})), t.push.apply(t, o);
|
|
13200
|
-
}
|
|
13201
|
-
return t;
|
|
13202
|
-
}
|
|
13203
|
-
__name(ownKeys, "ownKeys");
|
|
13204
|
-
function _objectSpread2(e) {
|
|
13205
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
13206
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
13207
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
|
|
13208
|
-
defineProperty(e, r$1, t[r$1]);
|
|
13209
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
13210
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
13211
|
-
});
|
|
13212
|
-
}
|
|
13213
|
-
return e;
|
|
13214
|
-
}
|
|
13215
|
-
__name(_objectSpread2, "_objectSpread2");
|
|
13216
|
-
module2.exports = _objectSpread2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13217
|
-
} });
|
|
13218
|
-
|
|
13219
|
-
// ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs
|
|
13220
|
-
function observable(subscribe) {
|
|
13221
|
-
const self = {
|
|
13222
|
-
subscribe(observer) {
|
|
13223
|
-
let teardownRef = null;
|
|
13224
|
-
let isDone = false;
|
|
13225
|
-
let unsubscribed = false;
|
|
13226
|
-
let teardownImmediately = false;
|
|
13227
|
-
function unsubscribe() {
|
|
13228
|
-
if (teardownRef === null) {
|
|
13229
|
-
teardownImmediately = true;
|
|
13230
|
-
return;
|
|
13231
|
-
}
|
|
13232
|
-
if (unsubscribed) return;
|
|
13233
|
-
unsubscribed = true;
|
|
13234
|
-
if (typeof teardownRef === "function") teardownRef();
|
|
13235
|
-
else if (teardownRef) teardownRef.unsubscribe();
|
|
13236
|
-
}
|
|
13237
|
-
__name(unsubscribe, "unsubscribe");
|
|
13238
|
-
teardownRef = subscribe({
|
|
13239
|
-
next(value) {
|
|
13240
|
-
var _observer$next;
|
|
13241
|
-
if (isDone) return;
|
|
13242
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);
|
|
13243
|
-
},
|
|
13244
|
-
error(err) {
|
|
13245
|
-
var _observer$error;
|
|
13246
|
-
if (isDone) return;
|
|
13247
|
-
isDone = true;
|
|
13248
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, err);
|
|
13249
|
-
unsubscribe();
|
|
13250
|
-
},
|
|
13251
|
-
complete() {
|
|
13252
|
-
var _observer$complete;
|
|
13253
|
-
if (isDone) return;
|
|
13254
|
-
isDone = true;
|
|
13255
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);
|
|
13256
|
-
unsubscribe();
|
|
13257
|
-
}
|
|
13258
|
-
});
|
|
13259
|
-
if (teardownImmediately) unsubscribe();
|
|
13260
|
-
return { unsubscribe };
|
|
13261
|
-
},
|
|
13262
|
-
pipe(...operations) {
|
|
13263
|
-
return operations.reduce(pipeReducer, self);
|
|
13264
|
-
}
|
|
13265
|
-
};
|
|
13266
|
-
return self;
|
|
13267
|
-
}
|
|
13268
|
-
__name(observable, "observable");
|
|
13269
|
-
function pipeReducer(prev, fn) {
|
|
13270
|
-
return fn(prev);
|
|
13271
|
-
}
|
|
13272
|
-
__name(pipeReducer, "pipeReducer");
|
|
13273
|
-
function observableToPromise(observable$1) {
|
|
13274
|
-
const ac = new AbortController();
|
|
13275
|
-
const promise2 = new Promise((resolve, reject) => {
|
|
13276
|
-
let isDone = false;
|
|
13277
|
-
function onDone() {
|
|
13278
|
-
if (isDone) return;
|
|
13279
|
-
isDone = true;
|
|
13280
|
-
obs$.unsubscribe();
|
|
13281
|
-
}
|
|
13282
|
-
__name(onDone, "onDone");
|
|
13283
|
-
ac.signal.addEventListener("abort", () => {
|
|
13284
|
-
reject(ac.signal.reason);
|
|
13285
|
-
});
|
|
13286
|
-
const obs$ = observable$1.subscribe({
|
|
13287
|
-
next(data) {
|
|
13288
|
-
isDone = true;
|
|
13289
|
-
resolve(data);
|
|
13290
|
-
onDone();
|
|
13291
|
-
},
|
|
13292
|
-
error(data) {
|
|
13293
|
-
reject(data);
|
|
13294
|
-
},
|
|
13295
|
-
complete() {
|
|
13296
|
-
ac.abort();
|
|
13297
|
-
onDone();
|
|
13298
|
-
}
|
|
13299
|
-
});
|
|
13300
|
-
});
|
|
13301
|
-
return promise2;
|
|
13302
|
-
}
|
|
13303
|
-
__name(observableToPromise, "observableToPromise");
|
|
13304
|
-
|
|
13305
|
-
// ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/observable-CUiPknO-.mjs
|
|
13306
|
-
function share(_opts) {
|
|
13307
|
-
return (source) => {
|
|
13308
|
-
let refCount = 0;
|
|
13309
|
-
let subscription = null;
|
|
13310
|
-
const observers = [];
|
|
13311
|
-
function startIfNeeded() {
|
|
13312
|
-
if (subscription) return;
|
|
13313
|
-
subscription = source.subscribe({
|
|
13314
|
-
next(value) {
|
|
13315
|
-
for (const observer of observers) {
|
|
13316
|
-
var _observer$next;
|
|
13317
|
-
(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);
|
|
13318
|
-
}
|
|
13319
|
-
},
|
|
13320
|
-
error(error46) {
|
|
13321
|
-
for (const observer of observers) {
|
|
13322
|
-
var _observer$error;
|
|
13323
|
-
(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, error46);
|
|
13324
|
-
}
|
|
13325
|
-
},
|
|
13326
|
-
complete() {
|
|
13327
|
-
for (const observer of observers) {
|
|
13328
|
-
var _observer$complete;
|
|
13329
|
-
(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);
|
|
13330
|
-
}
|
|
13331
|
-
}
|
|
13332
|
-
});
|
|
13333
|
-
}
|
|
13334
|
-
__name(startIfNeeded, "startIfNeeded");
|
|
13335
|
-
function resetIfNeeded() {
|
|
13336
|
-
if (refCount === 0 && subscription) {
|
|
13337
|
-
const _sub = subscription;
|
|
13338
|
-
subscription = null;
|
|
13339
|
-
_sub.unsubscribe();
|
|
13340
|
-
}
|
|
13341
|
-
}
|
|
13342
|
-
__name(resetIfNeeded, "resetIfNeeded");
|
|
13343
|
-
return observable((subscriber) => {
|
|
13344
|
-
refCount++;
|
|
13345
|
-
observers.push(subscriber);
|
|
13346
|
-
startIfNeeded();
|
|
13347
|
-
return { unsubscribe() {
|
|
13348
|
-
refCount--;
|
|
13349
|
-
resetIfNeeded();
|
|
13350
|
-
const index = observers.findIndex((v) => v === subscriber);
|
|
13351
|
-
if (index > -1) observers.splice(index, 1);
|
|
13352
|
-
} };
|
|
13353
|
-
});
|
|
13354
|
-
};
|
|
13355
|
-
}
|
|
13356
|
-
__name(share, "share");
|
|
13357
|
-
function behaviorSubject(initialValue) {
|
|
13358
|
-
let value = initialValue;
|
|
13359
|
-
const observerList = [];
|
|
13360
|
-
const addObserver = /* @__PURE__ */ __name((observer) => {
|
|
13361
|
-
if (value !== void 0) observer.next(value);
|
|
13362
|
-
observerList.push(observer);
|
|
13363
|
-
}, "addObserver");
|
|
13364
|
-
const removeObserver = /* @__PURE__ */ __name((observer) => {
|
|
13365
|
-
observerList.splice(observerList.indexOf(observer), 1);
|
|
13366
|
-
}, "removeObserver");
|
|
13367
|
-
const obs = observable((observer) => {
|
|
13368
|
-
addObserver(observer);
|
|
13369
|
-
return () => {
|
|
13370
|
-
removeObserver(observer);
|
|
13371
|
-
};
|
|
13372
|
-
});
|
|
13373
|
-
obs.next = (nextValue) => {
|
|
13374
|
-
if (value === nextValue) return;
|
|
13375
|
-
value = nextValue;
|
|
13376
|
-
for (const observer of observerList) observer.next(nextValue);
|
|
13377
|
-
};
|
|
13378
|
-
obs.get = () => value;
|
|
13379
|
-
return obs;
|
|
13380
|
-
}
|
|
13381
|
-
__name(behaviorSubject, "behaviorSubject");
|
|
13382
|
-
|
|
13383
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/splitLink-B7Cuf2c_.mjs
|
|
13384
|
-
function createChain(opts) {
|
|
13385
|
-
return observable((observer) => {
|
|
13386
|
-
function execute(index = 0, op = opts.op) {
|
|
13387
|
-
const next = opts.links[index];
|
|
13388
|
-
if (!next) throw new Error("No more links to execute - did you forget to add an ending link?");
|
|
13389
|
-
const subscription = next({
|
|
13390
|
-
op,
|
|
13391
|
-
next(nextOp) {
|
|
13392
|
-
const nextObserver = execute(index + 1, nextOp);
|
|
13393
|
-
return nextObserver;
|
|
13394
|
-
}
|
|
13395
|
-
});
|
|
13396
|
-
return subscription;
|
|
13397
|
-
}
|
|
13398
|
-
__name(execute, "execute");
|
|
13399
|
-
const obs$ = execute();
|
|
13400
|
-
return obs$.subscribe(observer);
|
|
13401
|
-
});
|
|
13402
|
-
}
|
|
13403
|
-
__name(createChain, "createChain");
|
|
13404
|
-
|
|
13405
|
-
// ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/utils-CLZnJdb_.mjs
|
|
13406
|
-
var TRPC_ERROR_CODES_BY_KEY = {
|
|
13407
|
-
PARSE_ERROR: -32700,
|
|
13408
|
-
BAD_REQUEST: -32600,
|
|
13409
|
-
INTERNAL_SERVER_ERROR: -32603,
|
|
13410
|
-
NOT_IMPLEMENTED: -32603,
|
|
13411
|
-
BAD_GATEWAY: -32603,
|
|
13412
|
-
SERVICE_UNAVAILABLE: -32603,
|
|
13413
|
-
GATEWAY_TIMEOUT: -32603,
|
|
13414
|
-
UNAUTHORIZED: -32001,
|
|
13415
|
-
PAYMENT_REQUIRED: -32002,
|
|
13416
|
-
FORBIDDEN: -32003,
|
|
13417
|
-
NOT_FOUND: -32004,
|
|
13418
|
-
METHOD_NOT_SUPPORTED: -32005,
|
|
13419
|
-
TIMEOUT: -32008,
|
|
13420
|
-
CONFLICT: -32009,
|
|
13421
|
-
PRECONDITION_FAILED: -32012,
|
|
13422
|
-
PAYLOAD_TOO_LARGE: -32013,
|
|
13423
|
-
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
13424
|
-
UNPROCESSABLE_CONTENT: -32022,
|
|
13425
|
-
PRECONDITION_REQUIRED: -32028,
|
|
13426
|
-
TOO_MANY_REQUESTS: -32029,
|
|
13427
|
-
CLIENT_CLOSED_REQUEST: -32099
|
|
13428
|
-
};
|
|
13429
|
-
var retryableRpcCodes = [
|
|
13430
|
-
TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,
|
|
13431
|
-
TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,
|
|
13432
|
-
TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,
|
|
13433
|
-
TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
|
|
13434
|
-
];
|
|
13435
|
-
function isObject2(value) {
|
|
13436
|
-
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
13437
|
-
}
|
|
13438
|
-
__name(isObject2, "isObject");
|
|
13439
|
-
|
|
13440
|
-
// ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/getErrorShape-BH60iMC2.mjs
|
|
13441
|
-
var __create2 = Object.create;
|
|
13442
|
-
var __defProp3 = Object.defineProperty;
|
|
13443
|
-
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
13444
|
-
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
13445
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
13446
|
-
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
13447
|
-
var __commonJS2 = /* @__PURE__ */ __name((cb, mod) => function() {
|
|
13448
|
-
return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13449
|
-
}, "__commonJS");
|
|
13450
|
-
var __copyProps3 = /* @__PURE__ */ __name((to, from, except, desc) => {
|
|
13451
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames3(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13452
|
-
key = keys[i];
|
|
13453
|
-
if (!__hasOwnProp3.call(to, key) && key !== except) __defProp3(to, key, {
|
|
13454
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13455
|
-
enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable
|
|
13456
|
-
});
|
|
13457
|
-
}
|
|
13458
|
-
return to;
|
|
13459
|
-
}, "__copyProps");
|
|
13460
|
-
var __toESM2 = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps3(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", {
|
|
13461
|
-
value: mod,
|
|
13462
|
-
enumerable: true
|
|
13463
|
-
}) : target, mod)), "__toESM");
|
|
13464
|
-
var noop = /* @__PURE__ */ __name(() => {
|
|
13465
|
-
}, "noop");
|
|
13466
|
-
var freezeIfAvailable = /* @__PURE__ */ __name((obj) => {
|
|
13467
|
-
if (Object.freeze) Object.freeze(obj);
|
|
13468
|
-
}, "freezeIfAvailable");
|
|
13469
|
-
function createInnerProxy(callback, path, memo) {
|
|
13470
|
-
var _memo$cacheKey;
|
|
13471
|
-
const cacheKey = path.join(".");
|
|
13472
|
-
(_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo[cacheKey] = new Proxy(noop, {
|
|
13473
|
-
get(_obj, key) {
|
|
13474
|
-
if (typeof key !== "string" || key === "then") return void 0;
|
|
13475
|
-
return createInnerProxy(callback, [...path, key], memo);
|
|
13476
|
-
},
|
|
13477
|
-
apply(_1, _2, args) {
|
|
13478
|
-
const lastOfPath = path[path.length - 1];
|
|
13479
|
-
let opts = {
|
|
13480
|
-
args,
|
|
13481
|
-
path
|
|
13482
|
-
};
|
|
13483
|
-
if (lastOfPath === "call") opts = {
|
|
13484
|
-
args: args.length >= 2 ? [args[1]] : [],
|
|
13485
|
-
path: path.slice(0, -1)
|
|
13486
|
-
};
|
|
13487
|
-
else if (lastOfPath === "apply") opts = {
|
|
13488
|
-
args: args.length >= 2 ? args[1] : [],
|
|
13489
|
-
path: path.slice(0, -1)
|
|
13490
|
-
};
|
|
13491
|
-
freezeIfAvailable(opts.args);
|
|
13492
|
-
freezeIfAvailable(opts.path);
|
|
13493
|
-
return callback(opts);
|
|
13494
|
-
}
|
|
13495
|
-
}));
|
|
13496
|
-
return memo[cacheKey];
|
|
13497
|
-
}
|
|
13498
|
-
__name(createInnerProxy, "createInnerProxy");
|
|
13499
|
-
var createRecursiveProxy = /* @__PURE__ */ __name((callback) => createInnerProxy(callback, [], /* @__PURE__ */ Object.create(null)), "createRecursiveProxy");
|
|
13500
|
-
var createFlatProxy = /* @__PURE__ */ __name((callback) => {
|
|
13501
|
-
return new Proxy(noop, { get(_obj, name) {
|
|
13502
|
-
if (name === "then") return void 0;
|
|
13503
|
-
return callback(name);
|
|
13504
|
-
} });
|
|
13505
|
-
}, "createFlatProxy");
|
|
13506
|
-
var require_typeof2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module2) {
|
|
13507
|
-
function _typeof$2(o) {
|
|
13508
|
-
"@babel/helpers - typeof";
|
|
13509
|
-
return module2.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
13510
|
-
return typeof o$1;
|
|
13511
|
-
} : function(o$1) {
|
|
13512
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
13513
|
-
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _typeof$2(o);
|
|
13514
|
-
}
|
|
13515
|
-
__name(_typeof$2, "_typeof$2");
|
|
13516
|
-
module2.exports = _typeof$2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13517
|
-
} });
|
|
13518
|
-
var require_toPrimitive2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module2) {
|
|
13519
|
-
var _typeof$1 = require_typeof2()["default"];
|
|
13520
|
-
function toPrimitive$1(t, r) {
|
|
13521
|
-
if ("object" != _typeof$1(t) || !t) return t;
|
|
13522
|
-
var e = t[Symbol.toPrimitive];
|
|
13523
|
-
if (void 0 !== e) {
|
|
13524
|
-
var i = e.call(t, r || "default");
|
|
13525
|
-
if ("object" != _typeof$1(i)) return i;
|
|
13526
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
13527
|
-
}
|
|
13528
|
-
return ("string" === r ? String : Number)(t);
|
|
13529
|
-
}
|
|
13530
|
-
__name(toPrimitive$1, "toPrimitive$1");
|
|
13531
|
-
module2.exports = toPrimitive$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13532
|
-
} });
|
|
13533
|
-
var require_toPropertyKey2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module2) {
|
|
13534
|
-
var _typeof = require_typeof2()["default"];
|
|
13535
|
-
var toPrimitive = require_toPrimitive2();
|
|
13536
|
-
function toPropertyKey$1(t) {
|
|
13537
|
-
var i = toPrimitive(t, "string");
|
|
13538
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
13539
|
-
}
|
|
13540
|
-
__name(toPropertyKey$1, "toPropertyKey$1");
|
|
13541
|
-
module2.exports = toPropertyKey$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13542
|
-
} });
|
|
13543
|
-
var require_defineProperty2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module2) {
|
|
13544
|
-
var toPropertyKey = require_toPropertyKey2();
|
|
13545
|
-
function _defineProperty(e, r, t) {
|
|
13546
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
13547
|
-
value: t,
|
|
13548
|
-
enumerable: true,
|
|
13549
|
-
configurable: true,
|
|
13550
|
-
writable: true
|
|
13551
|
-
}) : e[r] = t, e;
|
|
13552
|
-
}
|
|
13553
|
-
__name(_defineProperty, "_defineProperty");
|
|
13554
|
-
module2.exports = _defineProperty, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13555
|
-
} });
|
|
13556
|
-
var require_objectSpread22 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module2) {
|
|
13557
|
-
var defineProperty = require_defineProperty2();
|
|
13558
|
-
function ownKeys(e, r) {
|
|
13559
|
-
var t = Object.keys(e);
|
|
13560
|
-
if (Object.getOwnPropertySymbols) {
|
|
13561
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
13562
|
-
r && (o = o.filter(function(r$1) {
|
|
13563
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
13564
|
-
})), t.push.apply(t, o);
|
|
13565
|
-
}
|
|
13566
|
-
return t;
|
|
13567
|
-
}
|
|
13568
|
-
__name(ownKeys, "ownKeys");
|
|
13569
|
-
function _objectSpread2(e) {
|
|
13570
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
13571
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
13572
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
|
|
13573
|
-
defineProperty(e, r$1, t[r$1]);
|
|
13574
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
13575
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
13576
|
-
});
|
|
13577
|
-
}
|
|
13578
|
-
return e;
|
|
13579
|
-
}
|
|
13580
|
-
__name(_objectSpread2, "_objectSpread2");
|
|
13581
|
-
module2.exports = _objectSpread2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
13582
|
-
} });
|
|
13583
|
-
var import_objectSpread2 = __toESM2(require_objectSpread22(), 1);
|
|
13584
|
-
|
|
13585
|
-
// ../../../node_modules/.pnpm/@trpc+server@11.7.1_typescript@5.6.2/node_modules/@trpc/server/dist/tracked-Blz8XOf1.mjs
|
|
13586
|
-
var import_defineProperty = __toESM2(require_defineProperty2(), 1);
|
|
13587
|
-
var import_objectSpread2$1 = __toESM2(require_objectSpread22(), 1);
|
|
13588
|
-
function transformResultInner(response, transformer) {
|
|
13589
|
-
if ("error" in response) {
|
|
13590
|
-
const error46 = transformer.deserialize(response.error);
|
|
13591
|
-
return {
|
|
13592
|
-
ok: false,
|
|
13593
|
-
error: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response), {}, { error: error46 })
|
|
13594
|
-
};
|
|
13595
|
-
}
|
|
13596
|
-
const result = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response.result), (!response.result.type || response.result.type === "data") && {
|
|
13597
|
-
type: "data",
|
|
13598
|
-
data: transformer.deserialize(response.result.data)
|
|
13599
|
-
});
|
|
13600
|
-
return {
|
|
13601
|
-
ok: true,
|
|
13602
|
-
result
|
|
13603
|
-
};
|
|
13604
|
-
}
|
|
13605
|
-
__name(transformResultInner, "transformResultInner");
|
|
13606
|
-
var _a2;
|
|
13607
|
-
var TransformResultError = (_a2 = class extends Error {
|
|
13608
|
-
constructor() {
|
|
13609
|
-
super("Unable to transform response from server");
|
|
13610
|
-
}
|
|
13611
|
-
}, __name(_a2, "TransformResultError"), _a2);
|
|
13612
|
-
function transformResult(response, transformer) {
|
|
13613
|
-
let result;
|
|
13614
|
-
try {
|
|
13615
|
-
result = transformResultInner(response, transformer);
|
|
13616
|
-
} catch (_unused) {
|
|
13617
|
-
throw new TransformResultError();
|
|
13618
|
-
}
|
|
13619
|
-
if (!result.ok && (!isObject2(result.error.error) || typeof result.error.error["code"] !== "number")) throw new TransformResultError();
|
|
13620
|
-
if (result.ok && !isObject2(result.result)) throw new TransformResultError();
|
|
13621
|
-
return result;
|
|
13622
|
-
}
|
|
13623
|
-
__name(transformResult, "transformResult");
|
|
13624
|
-
var import_objectSpread22 = __toESM2(require_objectSpread22(), 1);
|
|
13625
|
-
|
|
13626
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/TRPCClientError-CjKyS10w.mjs
|
|
13627
|
-
var import_defineProperty2 = __toESM(require_defineProperty(), 1);
|
|
13628
|
-
var import_objectSpread23 = __toESM(require_objectSpread2(), 1);
|
|
13629
|
-
function isTRPCClientError(cause) {
|
|
13630
|
-
return cause instanceof TRPCClientError;
|
|
13631
|
-
}
|
|
13632
|
-
__name(isTRPCClientError, "isTRPCClientError");
|
|
13633
|
-
function isTRPCErrorResponse(obj) {
|
|
13634
|
-
return isObject2(obj) && isObject2(obj["error"]) && typeof obj["error"]["code"] === "number" && typeof obj["error"]["message"] === "string";
|
|
13635
|
-
}
|
|
13636
|
-
__name(isTRPCErrorResponse, "isTRPCErrorResponse");
|
|
13637
|
-
function getMessageFromUnknownError(err, fallback) {
|
|
13638
|
-
if (typeof err === "string") return err;
|
|
13639
|
-
if (isObject2(err) && typeof err["message"] === "string") return err["message"];
|
|
13640
|
-
return fallback;
|
|
13641
|
-
}
|
|
13642
|
-
__name(getMessageFromUnknownError, "getMessageFromUnknownError");
|
|
13643
|
-
var _a3;
|
|
13644
|
-
var TRPCClientError = (_a3 = class extends Error {
|
|
13645
|
-
constructor(message, opts) {
|
|
13646
|
-
var _opts$result, _opts$result2;
|
|
13647
|
-
const cause = opts === null || opts === void 0 ? void 0 : opts.cause;
|
|
13648
|
-
super(message, { cause });
|
|
13649
|
-
(0, import_defineProperty2.default)(this, "cause", void 0);
|
|
13650
|
-
(0, import_defineProperty2.default)(this, "shape", void 0);
|
|
13651
|
-
(0, import_defineProperty2.default)(this, "data", void 0);
|
|
13652
|
-
(0, import_defineProperty2.default)(this, "meta", void 0);
|
|
13653
|
-
this.meta = opts === null || opts === void 0 ? void 0 : opts.meta;
|
|
13654
|
-
this.cause = cause;
|
|
13655
|
-
this.shape = opts === null || opts === void 0 || (_opts$result = opts.result) === null || _opts$result === void 0 ? void 0 : _opts$result.error;
|
|
13656
|
-
this.data = opts === null || opts === void 0 || (_opts$result2 = opts.result) === null || _opts$result2 === void 0 ? void 0 : _opts$result2.error.data;
|
|
13657
|
-
this.name = "TRPCClientError";
|
|
13658
|
-
Object.setPrototypeOf(this, _a3.prototype);
|
|
13659
|
-
}
|
|
13660
|
-
static from(_cause, opts = {}) {
|
|
13661
|
-
const cause = _cause;
|
|
13662
|
-
if (isTRPCClientError(cause)) {
|
|
13663
|
-
if (opts.meta) cause.meta = (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, cause.meta), opts.meta);
|
|
13664
|
-
return cause;
|
|
13665
|
-
}
|
|
13666
|
-
if (isTRPCErrorResponse(cause)) return new _a3(cause.error.message, (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, { result: cause }));
|
|
13667
|
-
return new _a3(getMessageFromUnknownError(cause, "Unknown error"), (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, { cause }));
|
|
13668
|
-
}
|
|
13669
|
-
}, __name(_a3, "TRPCClientError"), _a3);
|
|
13670
|
-
|
|
13671
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/unstable-internals-Bg7n9BBj.mjs
|
|
13672
|
-
function getTransformer(transformer) {
|
|
13673
|
-
const _transformer = transformer;
|
|
13674
|
-
if (!_transformer) return {
|
|
13675
|
-
input: {
|
|
13676
|
-
serialize: /* @__PURE__ */ __name((data) => data, "serialize"),
|
|
13677
|
-
deserialize: /* @__PURE__ */ __name((data) => data, "deserialize")
|
|
13678
|
-
},
|
|
13679
|
-
output: {
|
|
13680
|
-
serialize: /* @__PURE__ */ __name((data) => data, "serialize"),
|
|
13681
|
-
deserialize: /* @__PURE__ */ __name((data) => data, "deserialize")
|
|
13682
|
-
}
|
|
13683
|
-
};
|
|
13684
|
-
if ("input" in _transformer) return _transformer;
|
|
13685
|
-
return {
|
|
13686
|
-
input: _transformer,
|
|
13687
|
-
output: _transformer
|
|
13688
|
-
};
|
|
13689
|
-
}
|
|
13690
|
-
__name(getTransformer, "getTransformer");
|
|
13691
|
-
|
|
13692
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpUtils-Dv57hbOd.mjs
|
|
13693
|
-
var isFunction2 = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
|
|
13694
|
-
function getFetch(customFetchImpl) {
|
|
13695
|
-
if (customFetchImpl) return customFetchImpl;
|
|
13696
|
-
if (typeof window !== "undefined" && isFunction2(window.fetch)) return window.fetch;
|
|
13697
|
-
if (typeof globalThis !== "undefined" && isFunction2(globalThis.fetch)) return globalThis.fetch;
|
|
13698
|
-
throw new Error("No fetch implementation found");
|
|
13699
|
-
}
|
|
13700
|
-
__name(getFetch, "getFetch");
|
|
13701
|
-
var import_objectSpread24 = __toESM(require_objectSpread2(), 1);
|
|
13702
|
-
function resolveHTTPLinkOptions(opts) {
|
|
13703
|
-
return {
|
|
13704
|
-
url: opts.url.toString(),
|
|
13705
|
-
fetch: opts.fetch,
|
|
13706
|
-
transformer: getTransformer(opts.transformer),
|
|
13707
|
-
methodOverride: opts.methodOverride
|
|
13708
|
-
};
|
|
13709
|
-
}
|
|
13710
|
-
__name(resolveHTTPLinkOptions, "resolveHTTPLinkOptions");
|
|
13711
|
-
function arrayToDict(array2) {
|
|
13712
|
-
const dict = {};
|
|
13713
|
-
for (let index = 0; index < array2.length; index++) {
|
|
13714
|
-
const element = array2[index];
|
|
13715
|
-
dict[index] = element;
|
|
13716
|
-
}
|
|
13717
|
-
return dict;
|
|
13718
|
-
}
|
|
13719
|
-
__name(arrayToDict, "arrayToDict");
|
|
13720
|
-
var METHOD = {
|
|
13721
|
-
query: "GET",
|
|
13722
|
-
mutation: "POST",
|
|
13723
|
-
subscription: "PATCH"
|
|
13724
|
-
};
|
|
13725
|
-
function getInput(opts) {
|
|
13726
|
-
return "input" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));
|
|
13727
|
-
}
|
|
13728
|
-
__name(getInput, "getInput");
|
|
13729
|
-
var getUrl = /* @__PURE__ */ __name((opts) => {
|
|
13730
|
-
const parts = opts.url.split("?");
|
|
13731
|
-
const base = parts[0].replace(/\/$/, "");
|
|
13732
|
-
let url2 = base + "/" + opts.path;
|
|
13733
|
-
const queryParts = [];
|
|
13734
|
-
if (parts[1]) queryParts.push(parts[1]);
|
|
13735
|
-
if ("inputs" in opts) queryParts.push("batch=1");
|
|
13736
|
-
if (opts.type === "query" || opts.type === "subscription") {
|
|
13737
|
-
const input = getInput(opts);
|
|
13738
|
-
if (input !== void 0 && opts.methodOverride !== "POST") queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);
|
|
13739
|
-
}
|
|
13740
|
-
if (queryParts.length) url2 += "?" + queryParts.join("&");
|
|
13741
|
-
return url2;
|
|
13742
|
-
}, "getUrl");
|
|
13743
|
-
var getBody = /* @__PURE__ */ __name((opts) => {
|
|
13744
|
-
if (opts.type === "query" && opts.methodOverride !== "POST") return void 0;
|
|
13745
|
-
const input = getInput(opts);
|
|
13746
|
-
return input !== void 0 ? JSON.stringify(input) : void 0;
|
|
13747
|
-
}, "getBody");
|
|
13748
|
-
var jsonHttpRequester = /* @__PURE__ */ __name((opts) => {
|
|
13749
|
-
return httpRequest((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts), {}, {
|
|
13750
|
-
contentTypeHeader: "application/json",
|
|
13751
|
-
getUrl,
|
|
13752
|
-
getBody
|
|
13753
|
-
}));
|
|
13754
|
-
}, "jsonHttpRequester");
|
|
13755
|
-
var _a4;
|
|
13756
|
-
var AbortError = (_a4 = class extends Error {
|
|
13757
|
-
constructor() {
|
|
13758
|
-
const name = "AbortError";
|
|
13759
|
-
super(name);
|
|
13760
|
-
this.name = name;
|
|
13761
|
-
this.message = name;
|
|
13762
|
-
}
|
|
13763
|
-
}, __name(_a4, "AbortError"), _a4);
|
|
13764
|
-
var throwIfAborted = /* @__PURE__ */ __name((signal) => {
|
|
13765
|
-
var _signal$throwIfAborte;
|
|
13766
|
-
if (!(signal === null || signal === void 0 ? void 0 : signal.aborted)) return;
|
|
13767
|
-
(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === void 0 || _signal$throwIfAborte.call(signal);
|
|
13768
|
-
if (typeof DOMException !== "undefined") throw new DOMException("AbortError", "AbortError");
|
|
13769
|
-
throw new AbortError();
|
|
13770
|
-
}, "throwIfAborted");
|
|
13771
|
-
async function fetchHTTPResponse(opts) {
|
|
13772
|
-
var _opts$methodOverride;
|
|
13773
|
-
throwIfAborted(opts.signal);
|
|
13774
|
-
const url2 = opts.getUrl(opts);
|
|
13775
|
-
const body = opts.getBody(opts);
|
|
13776
|
-
const method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== void 0 ? _opts$methodOverride : METHOD[opts.type];
|
|
13777
|
-
const resolvedHeaders = await (async () => {
|
|
13778
|
-
const heads = await opts.headers();
|
|
13779
|
-
if (Symbol.iterator in heads) return Object.fromEntries(heads);
|
|
13780
|
-
return heads;
|
|
13781
|
-
})();
|
|
13782
|
-
const headers = (0, import_objectSpread24.default)((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts.contentTypeHeader && method !== "GET" ? { "content-type": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { "trpc-accept": opts.trpcAcceptHeader } : void 0), resolvedHeaders);
|
|
13783
|
-
return getFetch(opts.fetch)(url2, {
|
|
13784
|
-
method,
|
|
13785
|
-
signal: opts.signal,
|
|
13786
|
-
body,
|
|
13787
|
-
headers
|
|
13788
|
-
});
|
|
13789
|
-
}
|
|
13790
|
-
__name(fetchHTTPResponse, "fetchHTTPResponse");
|
|
13791
|
-
async function httpRequest(opts) {
|
|
13792
|
-
const meta3 = {};
|
|
13793
|
-
const res = await fetchHTTPResponse(opts);
|
|
13794
|
-
meta3.response = res;
|
|
13795
|
-
const json2 = await res.json();
|
|
13796
|
-
meta3.responseJSON = json2;
|
|
13797
|
-
return {
|
|
13798
|
-
json: json2,
|
|
13799
|
-
meta: meta3
|
|
13800
|
-
};
|
|
13801
|
-
}
|
|
13802
|
-
__name(httpRequest, "httpRequest");
|
|
13803
|
-
|
|
13804
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpLink-DCFpUmZF.mjs
|
|
13805
|
-
var import_objectSpread25 = __toESM(require_objectSpread2(), 1);
|
|
13806
|
-
|
|
13807
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/httpBatchLink-BOe5aCcR.mjs
|
|
13808
|
-
var throwFatalError = /* @__PURE__ */ __name(() => {
|
|
13809
|
-
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
13810
|
-
}, "throwFatalError");
|
|
13811
|
-
function dataLoader(batchLoader) {
|
|
13812
|
-
let pendingItems = null;
|
|
13813
|
-
let dispatchTimer = null;
|
|
13814
|
-
const destroyTimerAndPendingItems = /* @__PURE__ */ __name(() => {
|
|
13815
|
-
clearTimeout(dispatchTimer);
|
|
13816
|
-
dispatchTimer = null;
|
|
13817
|
-
pendingItems = null;
|
|
13818
|
-
}, "destroyTimerAndPendingItems");
|
|
13819
|
-
function groupItems(items) {
|
|
13820
|
-
const groupedItems = [[]];
|
|
13821
|
-
let index = 0;
|
|
13822
|
-
while (true) {
|
|
13823
|
-
const item = items[index];
|
|
13824
|
-
if (!item) break;
|
|
13825
|
-
const lastGroup = groupedItems[groupedItems.length - 1];
|
|
13826
|
-
if (item.aborted) {
|
|
13827
|
-
var _item$reject;
|
|
13828
|
-
(_item$reject = item.reject) === null || _item$reject === void 0 || _item$reject.call(item, new Error("Aborted"));
|
|
13829
|
-
index++;
|
|
13830
|
-
continue;
|
|
13831
|
-
}
|
|
13832
|
-
const isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));
|
|
13833
|
-
if (isValid) {
|
|
13834
|
-
lastGroup.push(item);
|
|
13835
|
-
index++;
|
|
13836
|
-
continue;
|
|
13837
|
-
}
|
|
13838
|
-
if (lastGroup.length === 0) {
|
|
13839
|
-
var _item$reject2;
|
|
13840
|
-
(_item$reject2 = item.reject) === null || _item$reject2 === void 0 || _item$reject2.call(item, new Error("Input is too big for a single dispatch"));
|
|
13841
|
-
index++;
|
|
13842
|
-
continue;
|
|
13843
|
-
}
|
|
13844
|
-
groupedItems.push([]);
|
|
13845
|
-
}
|
|
13846
|
-
return groupedItems;
|
|
13847
|
-
}
|
|
13848
|
-
__name(groupItems, "groupItems");
|
|
13849
|
-
function dispatch() {
|
|
13850
|
-
const groupedItems = groupItems(pendingItems);
|
|
13851
|
-
destroyTimerAndPendingItems();
|
|
13852
|
-
for (const items of groupedItems) {
|
|
13853
|
-
if (!items.length) continue;
|
|
13854
|
-
const batch = { items };
|
|
13855
|
-
for (const item of items) item.batch = batch;
|
|
13856
|
-
const promise2 = batchLoader.fetch(batch.items.map((_item) => _item.key));
|
|
13857
|
-
promise2.then(async (result) => {
|
|
13858
|
-
await Promise.all(result.map(async (valueOrPromise, index) => {
|
|
13859
|
-
const item = batch.items[index];
|
|
13860
|
-
try {
|
|
13861
|
-
var _item$resolve;
|
|
13862
|
-
const value = await Promise.resolve(valueOrPromise);
|
|
13863
|
-
(_item$resolve = item.resolve) === null || _item$resolve === void 0 || _item$resolve.call(item, value);
|
|
13864
|
-
} catch (cause) {
|
|
13865
|
-
var _item$reject3;
|
|
13866
|
-
(_item$reject3 = item.reject) === null || _item$reject3 === void 0 || _item$reject3.call(item, cause);
|
|
13867
|
-
}
|
|
13868
|
-
item.batch = null;
|
|
13869
|
-
item.reject = null;
|
|
13870
|
-
item.resolve = null;
|
|
13871
|
-
}));
|
|
13872
|
-
for (const item of batch.items) {
|
|
13873
|
-
var _item$reject4;
|
|
13874
|
-
(_item$reject4 = item.reject) === null || _item$reject4 === void 0 || _item$reject4.call(item, new Error("Missing result"));
|
|
13875
|
-
item.batch = null;
|
|
13876
|
-
}
|
|
13877
|
-
}).catch((cause) => {
|
|
13878
|
-
for (const item of batch.items) {
|
|
13879
|
-
var _item$reject5;
|
|
13880
|
-
(_item$reject5 = item.reject) === null || _item$reject5 === void 0 || _item$reject5.call(item, cause);
|
|
13881
|
-
item.batch = null;
|
|
13882
|
-
}
|
|
13883
|
-
});
|
|
13884
|
-
}
|
|
13885
|
-
}
|
|
13886
|
-
__name(dispatch, "dispatch");
|
|
13887
|
-
function load(key) {
|
|
13888
|
-
var _dispatchTimer;
|
|
13889
|
-
const item = {
|
|
13890
|
-
aborted: false,
|
|
13891
|
-
key,
|
|
13892
|
-
batch: null,
|
|
13893
|
-
resolve: throwFatalError,
|
|
13894
|
-
reject: throwFatalError
|
|
13895
|
-
};
|
|
13896
|
-
const promise2 = new Promise((resolve, reject) => {
|
|
13897
|
-
var _pendingItems;
|
|
13898
|
-
item.reject = reject;
|
|
13899
|
-
item.resolve = resolve;
|
|
13900
|
-
(_pendingItems = pendingItems) !== null && _pendingItems !== void 0 || (pendingItems = []);
|
|
13901
|
-
pendingItems.push(item);
|
|
13902
|
-
});
|
|
13903
|
-
(_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== void 0 || (dispatchTimer = setTimeout(dispatch));
|
|
13904
|
-
return promise2;
|
|
13905
|
-
}
|
|
13906
|
-
__name(load, "load");
|
|
13907
|
-
return { load };
|
|
13908
|
-
}
|
|
13909
|
-
__name(dataLoader, "dataLoader");
|
|
13910
|
-
function allAbortSignals(...signals) {
|
|
13911
|
-
const ac = new AbortController();
|
|
13912
|
-
const count = signals.length;
|
|
13913
|
-
let abortedCount = 0;
|
|
13914
|
-
const onAbort = /* @__PURE__ */ __name(() => {
|
|
13915
|
-
if (++abortedCount === count) ac.abort();
|
|
13916
|
-
}, "onAbort");
|
|
13917
|
-
for (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) onAbort();
|
|
13918
|
-
else signal === null || signal === void 0 || signal.addEventListener("abort", onAbort, { once: true });
|
|
13919
|
-
return ac.signal;
|
|
13920
|
-
}
|
|
13921
|
-
__name(allAbortSignals, "allAbortSignals");
|
|
13922
|
-
var import_objectSpread26 = __toESM(require_objectSpread2(), 1);
|
|
13923
|
-
function httpBatchLink(opts) {
|
|
13924
|
-
var _opts$maxURLLength, _opts$maxItems;
|
|
13925
|
-
const resolvedOpts = resolveHTTPLinkOptions(opts);
|
|
13926
|
-
const maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;
|
|
13927
|
-
const maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;
|
|
13928
|
-
return () => {
|
|
13929
|
-
const batchLoader = /* @__PURE__ */ __name((type) => {
|
|
13930
|
-
return {
|
|
13931
|
-
validate(batchOps) {
|
|
13932
|
-
if (maxURLLength === Infinity && maxItems === Infinity) return true;
|
|
13933
|
-
if (batchOps.length > maxItems) return false;
|
|
13934
|
-
const path = batchOps.map((op) => op.path).join(",");
|
|
13935
|
-
const inputs = batchOps.map((op) => op.input);
|
|
13936
|
-
const url2 = getUrl((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
|
|
13937
|
-
type,
|
|
13938
|
-
path,
|
|
13939
|
-
inputs,
|
|
13940
|
-
signal: null
|
|
13941
|
-
}));
|
|
13942
|
-
return url2.length <= maxURLLength;
|
|
13943
|
-
},
|
|
13944
|
-
async fetch(batchOps) {
|
|
13945
|
-
const path = batchOps.map((op) => op.path).join(",");
|
|
13946
|
-
const inputs = batchOps.map((op) => op.input);
|
|
13947
|
-
const signal = allAbortSignals(...batchOps.map((op) => op.signal));
|
|
13948
|
-
const res = await jsonHttpRequester((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
|
|
13949
|
-
path,
|
|
13950
|
-
inputs,
|
|
13951
|
-
type,
|
|
13952
|
-
headers() {
|
|
13953
|
-
if (!opts.headers) return {};
|
|
13954
|
-
if (typeof opts.headers === "function") return opts.headers({ opList: batchOps });
|
|
13955
|
-
return opts.headers;
|
|
13956
|
-
},
|
|
13957
|
-
signal
|
|
13958
|
-
}));
|
|
13959
|
-
const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
|
|
13960
|
-
const result = resJSON.map((item) => ({
|
|
13961
|
-
meta: res.meta,
|
|
13962
|
-
json: item
|
|
13963
|
-
}));
|
|
13964
|
-
return result;
|
|
13965
|
-
}
|
|
13966
|
-
};
|
|
13967
|
-
}, "batchLoader");
|
|
13968
|
-
const query = dataLoader(batchLoader("query"));
|
|
13969
|
-
const mutation = dataLoader(batchLoader("mutation"));
|
|
13970
|
-
const loaders = {
|
|
13971
|
-
query,
|
|
13972
|
-
mutation
|
|
13973
|
-
};
|
|
13974
|
-
return ({ op }) => {
|
|
13975
|
-
return observable((observer) => {
|
|
13976
|
-
if (op.type === "subscription") throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
13977
|
-
const loader = loaders[op.type];
|
|
13978
|
-
const promise2 = loader.load(op);
|
|
13979
|
-
let _res = void 0;
|
|
13980
|
-
promise2.then((res) => {
|
|
13981
|
-
_res = res;
|
|
13982
|
-
const transformed = transformResult(res.json, resolvedOpts.transformer.output);
|
|
13983
|
-
if (!transformed.ok) {
|
|
13984
|
-
observer.error(TRPCClientError.from(transformed.error, { meta: res.meta }));
|
|
13985
|
-
return;
|
|
13986
|
-
}
|
|
13987
|
-
observer.next({
|
|
13988
|
-
context: res.meta,
|
|
13989
|
-
result: transformed.result
|
|
13990
|
-
});
|
|
13991
|
-
observer.complete();
|
|
13992
|
-
}).catch((err) => {
|
|
13993
|
-
observer.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));
|
|
13994
|
-
});
|
|
13995
|
-
return () => {
|
|
13996
|
-
};
|
|
13997
|
-
});
|
|
13998
|
-
};
|
|
13999
|
-
};
|
|
14000
|
-
}
|
|
14001
|
-
__name(httpBatchLink, "httpBatchLink");
|
|
14002
|
-
|
|
14003
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/loggerLink-ineCN1PO.mjs
|
|
14004
|
-
var import_objectSpread27 = __toESM(require_objectSpread2(), 1);
|
|
14005
|
-
|
|
14006
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/wsLink-CatceK3c.mjs
|
|
14007
|
-
var resultOf = /* @__PURE__ */ __name((value, ...args) => {
|
|
14008
|
-
return typeof value === "function" ? value(...args) : value;
|
|
14009
|
-
}, "resultOf");
|
|
14010
|
-
var import_defineProperty$3 = __toESM(require_defineProperty(), 1);
|
|
14011
|
-
function withResolvers() {
|
|
14012
|
-
let resolve;
|
|
14013
|
-
let reject;
|
|
14014
|
-
const promise2 = new Promise((res, rej) => {
|
|
14015
|
-
resolve = res;
|
|
14016
|
-
reject = rej;
|
|
14017
|
-
});
|
|
14018
|
-
return {
|
|
14019
|
-
promise: promise2,
|
|
14020
|
-
resolve,
|
|
14021
|
-
reject
|
|
14022
|
-
};
|
|
14023
|
-
}
|
|
14024
|
-
__name(withResolvers, "withResolvers");
|
|
14025
|
-
async function prepareUrl(urlOptions) {
|
|
14026
|
-
const url2 = await resultOf(urlOptions.url);
|
|
14027
|
-
if (!urlOptions.connectionParams) return url2;
|
|
14028
|
-
const prefix = url2.includes("?") ? "&" : "?";
|
|
14029
|
-
const connectionParams = `${prefix}connectionParams=1`;
|
|
14030
|
-
return url2 + connectionParams;
|
|
14031
|
-
}
|
|
14032
|
-
__name(prepareUrl, "prepareUrl");
|
|
14033
|
-
async function buildConnectionMessage(connectionParams) {
|
|
14034
|
-
const message = {
|
|
14035
|
-
method: "connectionParams",
|
|
14036
|
-
data: await resultOf(connectionParams)
|
|
14037
|
-
};
|
|
14038
|
-
return JSON.stringify(message);
|
|
14039
|
-
}
|
|
14040
|
-
__name(buildConnectionMessage, "buildConnectionMessage");
|
|
14041
|
-
var import_defineProperty$2 = __toESM(require_defineProperty(), 1);
|
|
14042
|
-
var import_defineProperty$1 = __toESM(require_defineProperty(), 1);
|
|
14043
|
-
function asyncWsOpen(ws) {
|
|
14044
|
-
const { promise: promise2, resolve, reject } = withResolvers();
|
|
14045
|
-
ws.addEventListener("open", () => {
|
|
14046
|
-
ws.removeEventListener("error", reject);
|
|
14047
|
-
resolve();
|
|
14048
|
-
});
|
|
14049
|
-
ws.addEventListener("error", reject);
|
|
14050
|
-
return promise2;
|
|
14051
|
-
}
|
|
14052
|
-
__name(asyncWsOpen, "asyncWsOpen");
|
|
14053
|
-
function setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {
|
|
14054
|
-
let pingTimeout;
|
|
14055
|
-
let pongTimeout;
|
|
14056
|
-
function start() {
|
|
14057
|
-
pingTimeout = setTimeout(() => {
|
|
14058
|
-
ws.send("PING");
|
|
14059
|
-
pongTimeout = setTimeout(() => {
|
|
14060
|
-
ws.close();
|
|
14061
|
-
}, pongTimeoutMs);
|
|
14062
|
-
}, intervalMs);
|
|
14063
|
-
}
|
|
14064
|
-
__name(start, "start");
|
|
14065
|
-
function reset() {
|
|
14066
|
-
clearTimeout(pingTimeout);
|
|
14067
|
-
start();
|
|
14068
|
-
}
|
|
14069
|
-
__name(reset, "reset");
|
|
14070
|
-
function pong() {
|
|
14071
|
-
clearTimeout(pongTimeout);
|
|
14072
|
-
reset();
|
|
14073
|
-
}
|
|
14074
|
-
__name(pong, "pong");
|
|
14075
|
-
ws.addEventListener("open", start);
|
|
14076
|
-
ws.addEventListener("message", ({ data }) => {
|
|
14077
|
-
clearTimeout(pingTimeout);
|
|
14078
|
-
start();
|
|
14079
|
-
if (data === "PONG") pong();
|
|
14080
|
-
});
|
|
14081
|
-
ws.addEventListener("close", () => {
|
|
14082
|
-
clearTimeout(pingTimeout);
|
|
14083
|
-
clearTimeout(pongTimeout);
|
|
14084
|
-
});
|
|
14085
|
-
}
|
|
14086
|
-
__name(setupPingInterval, "setupPingInterval");
|
|
14087
|
-
var _a5;
|
|
14088
|
-
var WsConnection = (_a5 = class {
|
|
14089
|
-
constructor(opts) {
|
|
14090
|
-
var _opts$WebSocketPonyfi;
|
|
14091
|
-
(0, import_defineProperty$1.default)(this, "id", ++_a5.connectCount);
|
|
14092
|
-
(0, import_defineProperty$1.default)(this, "WebSocketPonyfill", void 0);
|
|
14093
|
-
(0, import_defineProperty$1.default)(this, "urlOptions", void 0);
|
|
14094
|
-
(0, import_defineProperty$1.default)(this, "keepAliveOpts", void 0);
|
|
14095
|
-
(0, import_defineProperty$1.default)(this, "wsObservable", behaviorSubject(null));
|
|
14096
|
-
(0, import_defineProperty$1.default)(this, "openPromise", null);
|
|
14097
|
-
this.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== void 0 ? _opts$WebSocketPonyfi : WebSocket;
|
|
14098
|
-
if (!this.WebSocketPonyfill) throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
|
|
14099
|
-
this.urlOptions = opts.urlOptions;
|
|
14100
|
-
this.keepAliveOpts = opts.keepAlive;
|
|
14101
|
-
}
|
|
14102
|
-
get ws() {
|
|
14103
|
-
return this.wsObservable.get();
|
|
14104
|
-
}
|
|
14105
|
-
set ws(ws) {
|
|
14106
|
-
this.wsObservable.next(ws);
|
|
14107
|
-
}
|
|
14108
|
-
/**
|
|
14109
|
-
* Checks if the WebSocket connection is open and ready to communicate.
|
|
14110
|
-
*/
|
|
14111
|
-
isOpen() {
|
|
14112
|
-
return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;
|
|
14113
|
-
}
|
|
14114
|
-
/**
|
|
14115
|
-
* Checks if the WebSocket connection is closed or in the process of closing.
|
|
14116
|
-
*/
|
|
14117
|
-
isClosed() {
|
|
14118
|
-
return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);
|
|
14119
|
-
}
|
|
14120
|
-
async open() {
|
|
14121
|
-
var _this = this;
|
|
14122
|
-
if (_this.openPromise) return _this.openPromise;
|
|
14123
|
-
_this.id = ++_a5.connectCount;
|
|
14124
|
-
const wsPromise = prepareUrl(_this.urlOptions).then((url2) => new _this.WebSocketPonyfill(url2));
|
|
14125
|
-
_this.openPromise = wsPromise.then(async (ws) => {
|
|
14126
|
-
_this.ws = ws;
|
|
14127
|
-
ws.addEventListener("message", function({ data }) {
|
|
14128
|
-
if (data === "PING") this.send("PONG");
|
|
14129
|
-
});
|
|
14130
|
-
if (_this.keepAliveOpts.enabled) setupPingInterval(ws, _this.keepAliveOpts);
|
|
14131
|
-
ws.addEventListener("close", () => {
|
|
14132
|
-
if (_this.ws === ws) _this.ws = null;
|
|
14133
|
-
});
|
|
14134
|
-
await asyncWsOpen(ws);
|
|
14135
|
-
if (_this.urlOptions.connectionParams) ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams));
|
|
14136
|
-
});
|
|
14137
|
-
try {
|
|
14138
|
-
await _this.openPromise;
|
|
14139
|
-
} finally {
|
|
14140
|
-
_this.openPromise = null;
|
|
14141
|
-
}
|
|
14142
|
-
}
|
|
14143
|
-
/**
|
|
14144
|
-
* Closes the WebSocket connection gracefully.
|
|
14145
|
-
* Waits for any ongoing open operation to complete before closing.
|
|
14146
|
-
*/
|
|
14147
|
-
async close() {
|
|
14148
|
-
var _this2 = this;
|
|
14149
|
-
try {
|
|
14150
|
-
await _this2.openPromise;
|
|
14151
|
-
} finally {
|
|
14152
|
-
var _this$ws;
|
|
14153
|
-
(_this$ws = _this2.ws) === null || _this$ws === void 0 || _this$ws.close();
|
|
14154
|
-
}
|
|
14155
|
-
}
|
|
14156
|
-
}, __name(_a5, "WsConnection"), _a5);
|
|
14157
|
-
(0, import_defineProperty$1.default)(WsConnection, "connectCount", 0);
|
|
14158
|
-
var import_defineProperty3 = __toESM(require_defineProperty(), 1);
|
|
14159
|
-
var import_objectSpread28 = __toESM(require_objectSpread2(), 1);
|
|
14160
|
-
|
|
14161
|
-
// ../../../node_modules/.pnpm/@trpc+client@11.8.0_@trpc+server@11.7.1_typescript@5.6.2__typescript@5.6.2/node_modules/@trpc/client/dist/index.mjs
|
|
14162
|
-
var import_defineProperty4 = __toESM(require_defineProperty(), 1);
|
|
14163
|
-
var import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);
|
|
14164
|
-
var _a6;
|
|
14165
|
-
var TRPCUntypedClient = (_a6 = class {
|
|
14166
|
-
constructor(opts) {
|
|
14167
|
-
(0, import_defineProperty4.default)(this, "links", void 0);
|
|
14168
|
-
(0, import_defineProperty4.default)(this, "runtime", void 0);
|
|
14169
|
-
(0, import_defineProperty4.default)(this, "requestId", void 0);
|
|
14170
|
-
this.requestId = 0;
|
|
14171
|
-
this.runtime = {};
|
|
14172
|
-
this.links = opts.links.map((link) => link(this.runtime));
|
|
14173
|
-
}
|
|
14174
|
-
$request(opts) {
|
|
14175
|
-
var _opts$context;
|
|
14176
|
-
const chain$ = createChain({
|
|
14177
|
-
links: this.links,
|
|
14178
|
-
op: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, {
|
|
14179
|
-
context: (_opts$context = opts.context) !== null && _opts$context !== void 0 ? _opts$context : {},
|
|
14180
|
-
id: ++this.requestId
|
|
14181
|
-
})
|
|
14182
|
-
});
|
|
14183
|
-
return chain$.pipe(share());
|
|
14184
|
-
}
|
|
14185
|
-
async requestAsPromise(opts) {
|
|
14186
|
-
var _this = this;
|
|
14187
|
-
try {
|
|
14188
|
-
const req$ = _this.$request(opts);
|
|
14189
|
-
const envelope = await observableToPromise(req$);
|
|
14190
|
-
const data = envelope.result.data;
|
|
14191
|
-
return data;
|
|
14192
|
-
} catch (err) {
|
|
14193
|
-
throw TRPCClientError.from(err);
|
|
14194
|
-
}
|
|
14195
|
-
}
|
|
14196
|
-
query(path, input, opts) {
|
|
14197
|
-
return this.requestAsPromise({
|
|
14198
|
-
type: "query",
|
|
14199
|
-
path,
|
|
14200
|
-
input,
|
|
14201
|
-
context: opts === null || opts === void 0 ? void 0 : opts.context,
|
|
14202
|
-
signal: opts === null || opts === void 0 ? void 0 : opts.signal
|
|
14203
|
-
});
|
|
14204
|
-
}
|
|
14205
|
-
mutation(path, input, opts) {
|
|
14206
|
-
return this.requestAsPromise({
|
|
14207
|
-
type: "mutation",
|
|
14208
|
-
path,
|
|
14209
|
-
input,
|
|
14210
|
-
context: opts === null || opts === void 0 ? void 0 : opts.context,
|
|
14211
|
-
signal: opts === null || opts === void 0 ? void 0 : opts.signal
|
|
14212
|
-
});
|
|
14213
|
-
}
|
|
14214
|
-
subscription(path, input, opts) {
|
|
14215
|
-
const observable$ = this.$request({
|
|
14216
|
-
type: "subscription",
|
|
14217
|
-
path,
|
|
14218
|
-
input,
|
|
14219
|
-
context: opts.context,
|
|
14220
|
-
signal: opts.signal
|
|
14221
|
-
});
|
|
14222
|
-
return observable$.subscribe({
|
|
14223
|
-
next(envelope) {
|
|
14224
|
-
switch (envelope.result.type) {
|
|
14225
|
-
case "state": {
|
|
14226
|
-
var _opts$onConnectionSta;
|
|
14227
|
-
(_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === void 0 || _opts$onConnectionSta.call(opts, envelope.result);
|
|
14228
|
-
break;
|
|
14229
|
-
}
|
|
14230
|
-
case "started": {
|
|
14231
|
-
var _opts$onStarted;
|
|
14232
|
-
(_opts$onStarted = opts.onStarted) === null || _opts$onStarted === void 0 || _opts$onStarted.call(opts, { context: envelope.context });
|
|
14233
|
-
break;
|
|
14234
|
-
}
|
|
14235
|
-
case "stopped": {
|
|
14236
|
-
var _opts$onStopped;
|
|
14237
|
-
(_opts$onStopped = opts.onStopped) === null || _opts$onStopped === void 0 || _opts$onStopped.call(opts);
|
|
14238
|
-
break;
|
|
14239
|
-
}
|
|
14240
|
-
case "data":
|
|
14241
|
-
case void 0: {
|
|
14242
|
-
var _opts$onData;
|
|
14243
|
-
(_opts$onData = opts.onData) === null || _opts$onData === void 0 || _opts$onData.call(opts, envelope.result.data);
|
|
14244
|
-
break;
|
|
14245
|
-
}
|
|
14246
|
-
}
|
|
14247
|
-
},
|
|
14248
|
-
error(err) {
|
|
14249
|
-
var _opts$onError;
|
|
14250
|
-
(_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, err);
|
|
14251
|
-
},
|
|
14252
|
-
complete() {
|
|
14253
|
-
var _opts$onComplete;
|
|
14254
|
-
(_opts$onComplete = opts.onComplete) === null || _opts$onComplete === void 0 || _opts$onComplete.call(opts);
|
|
14255
|
-
}
|
|
14256
|
-
});
|
|
14257
|
-
}
|
|
14258
|
-
}, __name(_a6, "TRPCUntypedClient"), _a6);
|
|
14259
|
-
var untypedClientSymbol = /* @__PURE__ */ Symbol.for("trpc_untypedClient");
|
|
14260
|
-
var clientCallTypeMap = {
|
|
14261
|
-
query: "query",
|
|
14262
|
-
mutate: "mutation",
|
|
14263
|
-
subscribe: "subscription"
|
|
14264
|
-
};
|
|
14265
|
-
var clientCallTypeToProcedureType = /* @__PURE__ */ __name((clientCallType) => {
|
|
14266
|
-
return clientCallTypeMap[clientCallType];
|
|
14267
|
-
}, "clientCallTypeToProcedureType");
|
|
14268
|
-
function createTRPCClientProxy(client) {
|
|
14269
|
-
const proxy = createRecursiveProxy(({ path, args }) => {
|
|
14270
|
-
const pathCopy = [...path];
|
|
14271
|
-
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
|
|
14272
|
-
const fullPath = pathCopy.join(".");
|
|
14273
|
-
return client[procedureType](fullPath, ...args);
|
|
14274
|
-
});
|
|
14275
|
-
return createFlatProxy((key) => {
|
|
14276
|
-
if (key === untypedClientSymbol) return client;
|
|
14277
|
-
return proxy[key];
|
|
14278
|
-
});
|
|
14279
|
-
}
|
|
14280
|
-
__name(createTRPCClientProxy, "createTRPCClientProxy");
|
|
14281
|
-
function createTRPCClient(opts) {
|
|
14282
|
-
const client = new TRPCUntypedClient(opts);
|
|
14283
|
-
const proxy = createTRPCClientProxy(client);
|
|
14284
|
-
return proxy;
|
|
14285
|
-
}
|
|
14286
|
-
__name(createTRPCClient, "createTRPCClient");
|
|
14287
|
-
var import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);
|
|
14288
|
-
var import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);
|
|
14289
|
-
var require_asyncIterator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module2) {
|
|
14290
|
-
function _asyncIterator$1(r) {
|
|
14291
|
-
var n, t, o, e = 2;
|
|
14292
|
-
for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--; ) {
|
|
14293
|
-
if (t && null != (n = r[t])) return n.call(r);
|
|
14294
|
-
if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
|
|
14295
|
-
t = "@@asyncIterator", o = "@@iterator";
|
|
14296
|
-
}
|
|
14297
|
-
throw new TypeError("Object is not async iterable");
|
|
14298
|
-
}
|
|
14299
|
-
__name(_asyncIterator$1, "_asyncIterator$1");
|
|
14300
|
-
function AsyncFromSyncIterator(r) {
|
|
14301
|
-
function AsyncFromSyncIteratorContinuation(r$1) {
|
|
14302
|
-
if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object."));
|
|
14303
|
-
var n = r$1.done;
|
|
14304
|
-
return Promise.resolve(r$1.value).then(function(r$2) {
|
|
14305
|
-
return {
|
|
14306
|
-
value: r$2,
|
|
14307
|
-
done: n
|
|
14308
|
-
};
|
|
14309
|
-
});
|
|
14310
|
-
}
|
|
14311
|
-
__name(AsyncFromSyncIteratorContinuation, "AsyncFromSyncIteratorContinuation");
|
|
14312
|
-
return AsyncFromSyncIterator = /* @__PURE__ */ __name(function AsyncFromSyncIterator$1(r$1) {
|
|
14313
|
-
this.s = r$1, this.n = r$1.next;
|
|
14314
|
-
}, "AsyncFromSyncIterator$1"), AsyncFromSyncIterator.prototype = {
|
|
14315
|
-
s: null,
|
|
14316
|
-
n: null,
|
|
14317
|
-
next: /* @__PURE__ */ __name(function next() {
|
|
14318
|
-
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
14319
|
-
}, "next"),
|
|
14320
|
-
"return": /* @__PURE__ */ __name(function _return(r$1) {
|
|
14321
|
-
var n = this.s["return"];
|
|
14322
|
-
return void 0 === n ? Promise.resolve({
|
|
14323
|
-
value: r$1,
|
|
14324
|
-
done: true
|
|
14325
|
-
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
14326
|
-
}, "_return"),
|
|
14327
|
-
"throw": /* @__PURE__ */ __name(function _throw(r$1) {
|
|
14328
|
-
var n = this.s["return"];
|
|
14329
|
-
return void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
14330
|
-
}, "_throw")
|
|
14331
|
-
}, new AsyncFromSyncIterator(r);
|
|
14332
|
-
}
|
|
14333
|
-
__name(AsyncFromSyncIterator, "AsyncFromSyncIterator");
|
|
14334
|
-
module2.exports = _asyncIterator$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
14335
|
-
} });
|
|
14336
|
-
var import_asyncIterator = __toESM(require_asyncIterator(), 1);
|
|
14337
|
-
var import_objectSpread2$12 = __toESM(require_objectSpread2(), 1);
|
|
14338
|
-
var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module2) {
|
|
14339
|
-
function _usingCtx() {
|
|
14340
|
-
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
14341
|
-
var n$1 = Error();
|
|
14342
|
-
return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
|
|
14343
|
-
}, e = {}, n = [];
|
|
14344
|
-
function using(r$1, e$1) {
|
|
14345
|
-
if (null != e$1) {
|
|
14346
|
-
if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
14347
|
-
if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
14348
|
-
if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o;
|
|
14349
|
-
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
14350
|
-
t && (o = /* @__PURE__ */ __name(function o$1() {
|
|
14351
|
-
try {
|
|
14352
|
-
t.call(e$1);
|
|
14353
|
-
} catch (r$2) {
|
|
14354
|
-
return Promise.reject(r$2);
|
|
14355
|
-
}
|
|
14356
|
-
}, "o$1")), n.push({
|
|
14357
|
-
v: e$1,
|
|
14358
|
-
d: o,
|
|
14359
|
-
a: r$1
|
|
14360
|
-
});
|
|
14361
|
-
} else r$1 && n.push({
|
|
14362
|
-
d: e$1,
|
|
14363
|
-
a: r$1
|
|
14364
|
-
});
|
|
14365
|
-
return e$1;
|
|
14366
|
-
}
|
|
14367
|
-
__name(using, "using");
|
|
14368
|
-
return {
|
|
14369
|
-
e,
|
|
14370
|
-
u: using.bind(null, false),
|
|
14371
|
-
a: using.bind(null, true),
|
|
14372
|
-
d: /* @__PURE__ */ __name(function d() {
|
|
14373
|
-
var o, t = this.e, s = 0;
|
|
14374
|
-
function next() {
|
|
14375
|
-
for (; o = n.pop(); ) try {
|
|
14376
|
-
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
14377
|
-
if (o.d) {
|
|
14378
|
-
var r$1 = o.d.call(o.v);
|
|
14379
|
-
if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);
|
|
14380
|
-
} else s |= 1;
|
|
14381
|
-
} catch (r$2) {
|
|
14382
|
-
return err(r$2);
|
|
14383
|
-
}
|
|
14384
|
-
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
14385
|
-
if (t !== e) throw t;
|
|
14386
|
-
}
|
|
14387
|
-
__name(next, "next");
|
|
14388
|
-
function err(n$1) {
|
|
14389
|
-
return t = t !== e ? new r(n$1, t) : n$1, next();
|
|
14390
|
-
}
|
|
14391
|
-
__name(err, "err");
|
|
14392
|
-
return next();
|
|
14393
|
-
}, "d")
|
|
14394
|
-
};
|
|
14395
|
-
}
|
|
14396
|
-
__name(_usingCtx, "_usingCtx");
|
|
14397
|
-
module2.exports = _usingCtx, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
14398
|
-
} });
|
|
14399
|
-
var require_OverloadYield = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module2) {
|
|
14400
|
-
function _OverloadYield(e, d) {
|
|
14401
|
-
this.v = e, this.k = d;
|
|
14402
|
-
}
|
|
14403
|
-
__name(_OverloadYield, "_OverloadYield");
|
|
14404
|
-
module2.exports = _OverloadYield, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
14405
|
-
} });
|
|
14406
|
-
var require_awaitAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module2) {
|
|
14407
|
-
var OverloadYield$1 = require_OverloadYield();
|
|
14408
|
-
function _awaitAsyncGenerator$1(e) {
|
|
14409
|
-
return new OverloadYield$1(e, 0);
|
|
14410
|
-
}
|
|
14411
|
-
__name(_awaitAsyncGenerator$1, "_awaitAsyncGenerator$1");
|
|
14412
|
-
module2.exports = _awaitAsyncGenerator$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
14413
|
-
} });
|
|
14414
|
-
var require_wrapAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module2) {
|
|
14415
|
-
var OverloadYield = require_OverloadYield();
|
|
14416
|
-
function _wrapAsyncGenerator$1(e) {
|
|
14417
|
-
return function() {
|
|
14418
|
-
return new AsyncGenerator(e.apply(this, arguments));
|
|
14419
|
-
};
|
|
14420
|
-
}
|
|
14421
|
-
__name(_wrapAsyncGenerator$1, "_wrapAsyncGenerator$1");
|
|
14422
|
-
function AsyncGenerator(e) {
|
|
14423
|
-
var r, t;
|
|
14424
|
-
function resume(r$1, t$1) {
|
|
14425
|
-
try {
|
|
14426
|
-
var n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield;
|
|
14427
|
-
Promise.resolve(u ? o.v : o).then(function(t$2) {
|
|
14428
|
-
if (u) {
|
|
14429
|
-
var i = "return" === r$1 ? "return" : "next";
|
|
14430
|
-
if (!o.k || t$2.done) return resume(i, t$2);
|
|
14431
|
-
t$2 = e[i](t$2).value;
|
|
14432
|
-
}
|
|
14433
|
-
settle(n.done ? "return" : "normal", t$2);
|
|
14434
|
-
}, function(e$1) {
|
|
14435
|
-
resume("throw", e$1);
|
|
14436
|
-
});
|
|
14437
|
-
} catch (e$1) {
|
|
14438
|
-
settle("throw", e$1);
|
|
14439
|
-
}
|
|
14440
|
-
}
|
|
14441
|
-
__name(resume, "resume");
|
|
14442
|
-
function settle(e$1, n) {
|
|
14443
|
-
switch (e$1) {
|
|
14444
|
-
case "return":
|
|
14445
|
-
r.resolve({
|
|
14446
|
-
value: n,
|
|
14447
|
-
done: true
|
|
14448
|
-
});
|
|
14449
|
-
break;
|
|
14450
|
-
case "throw":
|
|
14451
|
-
r.reject(n);
|
|
14452
|
-
break;
|
|
14453
|
-
default:
|
|
14454
|
-
r.resolve({
|
|
14455
|
-
value: n,
|
|
14456
|
-
done: false
|
|
14457
|
-
});
|
|
14458
|
-
}
|
|
14459
|
-
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
14460
|
-
}
|
|
14461
|
-
__name(settle, "settle");
|
|
14462
|
-
this._invoke = function(e$1, n) {
|
|
14463
|
-
return new Promise(function(o, u) {
|
|
14464
|
-
var i = {
|
|
14465
|
-
key: e$1,
|
|
14466
|
-
arg: n,
|
|
14467
|
-
resolve: o,
|
|
14468
|
-
reject: u,
|
|
14469
|
-
next: null
|
|
14470
|
-
};
|
|
14471
|
-
t ? t = t.next = i : (r = t = i, resume(e$1, n));
|
|
14472
|
-
});
|
|
14473
|
-
}, "function" != typeof e["return"] && (this["return"] = void 0);
|
|
14474
|
-
}
|
|
14475
|
-
__name(AsyncGenerator, "AsyncGenerator");
|
|
14476
|
-
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
14477
|
-
return this;
|
|
14478
|
-
}, AsyncGenerator.prototype.next = function(e) {
|
|
14479
|
-
return this._invoke("next", e);
|
|
14480
|
-
}, AsyncGenerator.prototype["throw"] = function(e) {
|
|
14481
|
-
return this._invoke("throw", e);
|
|
14482
|
-
}, AsyncGenerator.prototype["return"] = function(e) {
|
|
14483
|
-
return this._invoke("return", e);
|
|
14484
|
-
};
|
|
14485
|
-
module2.exports = _wrapAsyncGenerator$1, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
14486
|
-
} });
|
|
14487
|
-
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
|
14488
|
-
var import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);
|
|
14489
|
-
var import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);
|
|
14490
|
-
var import_objectSpread29 = __toESM(require_objectSpread2(), 1);
|
|
14491
|
-
|
|
14492
|
-
// ../../learn-card-network/simple-signing-client/dist/simple-signing-client.esm.js
|
|
14493
|
-
var __defProp4 = Object.defineProperty;
|
|
14494
|
-
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp4(target, "name", { value, configurable: true }), "__name");
|
|
14495
|
-
var callbackLink = /* @__PURE__ */ __name2((callback) => {
|
|
14496
|
-
return () => {
|
|
14497
|
-
return ({ next, op }) => {
|
|
14498
|
-
return observable((observer) => {
|
|
14499
|
-
let request = null;
|
|
14500
|
-
let attempts = 0;
|
|
14501
|
-
let isDone = false;
|
|
14502
|
-
const attempt = /* @__PURE__ */ __name2(() => {
|
|
14503
|
-
attempts += 1;
|
|
14504
|
-
request?.unsubscribe();
|
|
14505
|
-
request = next(op).subscribe({
|
|
14506
|
-
error: /* @__PURE__ */ __name2(async (error46) => {
|
|
14507
|
-
if (attempts > 5 || error46.data?.httpStatus !== 401) {
|
|
14508
|
-
return observer.error(error46);
|
|
14509
|
-
}
|
|
14510
|
-
await callback();
|
|
14511
|
-
attempt();
|
|
14512
|
-
}, "error"),
|
|
14513
|
-
next: /* @__PURE__ */ __name2((result) => observer.next(result), "next"),
|
|
14514
|
-
complete: /* @__PURE__ */ __name2(() => {
|
|
14515
|
-
if (isDone) observer.complete();
|
|
14516
|
-
}, "complete")
|
|
14517
|
-
});
|
|
14518
|
-
}, "attempt");
|
|
14519
|
-
attempt();
|
|
14520
|
-
return () => {
|
|
14521
|
-
isDone = true;
|
|
14522
|
-
request?.unsubscribe();
|
|
14523
|
-
};
|
|
14524
|
-
});
|
|
14525
|
-
};
|
|
14526
|
-
};
|
|
14527
|
-
}, "callbackLink");
|
|
14528
|
-
var getClient = /* @__PURE__ */ __name2(async (url2, didAuthFunction) => {
|
|
14529
|
-
let challenges = [];
|
|
14530
|
-
const challengeRequester = createTRPCClient({
|
|
14531
|
-
links: [
|
|
14532
|
-
httpBatchLink({ url: url2, headers: { Authorization: `Bearer ${await didAuthFunction()}` } })
|
|
14533
|
-
]
|
|
14534
|
-
});
|
|
14535
|
-
const getChallenges = /* @__PURE__ */ __name2(async (amount = 95 + Math.round((Math.random() - 0.5) * 5)) => {
|
|
14536
|
-
return challengeRequester.utilities.getChallenges.query({ amount });
|
|
14537
|
-
}, "getChallenges");
|
|
14538
|
-
getChallenges().then((result) => challenges = result);
|
|
14539
|
-
const trpc = createTRPCClient({
|
|
14540
|
-
links: [
|
|
14541
|
-
callbackLink(async () => {
|
|
14542
|
-
challenges = await getChallenges();
|
|
14543
|
-
}),
|
|
14544
|
-
httpBatchLink({
|
|
14545
|
-
url: url2,
|
|
14546
|
-
headers: /* @__PURE__ */ __name2(async () => {
|
|
14547
|
-
if (challenges.length === 0) challenges.push(...await getChallenges());
|
|
14548
|
-
return { Authorization: `Bearer ${await didAuthFunction(challenges.pop())}` };
|
|
14549
|
-
}, "headers")
|
|
14550
|
-
})
|
|
14551
|
-
]
|
|
14552
|
-
});
|
|
14553
|
-
return trpc;
|
|
14554
|
-
}, "getClient");
|
|
14555
|
-
|
|
14556
13117
|
// src/plugin.ts
|
|
13118
|
+
var import_simple_signing_client = require("@learncard/simple-signing-client");
|
|
14557
13119
|
var getNewClient = /* @__PURE__ */ __name(async (url2, learnCard) => {
|
|
14558
|
-
return getClient(url2, async (challenge) => {
|
|
13120
|
+
return (0, import_simple_signing_client.getClient)(url2, async (challenge) => {
|
|
14559
13121
|
const jwt2 = await learnCard.invoke.getDidAuthVp({ proofFormat: "jwt", challenge });
|
|
14560
13122
|
if (typeof jwt2 !== "string") throw new Error("Error getting DID-Auth-JWT!");
|
|
14561
13123
|
return jwt2;
|
|
@@ -14605,9 +13167,4 @@ var getSimpleSigningPlugin = /* @__PURE__ */ __name(async (initialLearnCard, url
|
|
|
14605
13167
|
}
|
|
14606
13168
|
};
|
|
14607
13169
|
}, "getSimpleSigningPlugin");
|
|
14608
|
-
/*! Bundled license information:
|
|
14609
|
-
|
|
14610
|
-
@trpc/client/dist/httpBatchLink-BOe5aCcR.mjs:
|
|
14611
|
-
(* istanbul ignore if -- @preserve *)
|
|
14612
|
-
*/
|
|
14613
13170
|
//# sourceMappingURL=simple-signing-plugin.cjs.development.cjs.map
|