@settlemint/dalp-cli 2.1.7-main.22780452484 → 2.1.7-main.22784829103
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/dalp.js +762 -1357
- package/package.json +2 -2
package/dist/dalp.js
CHANGED
|
@@ -45104,9 +45104,9 @@ var require_first_match = __commonJS((exports, module) => {
|
|
|
45104
45104
|
return d;
|
|
45105
45105
|
}
|
|
45106
45106
|
function first(array3, callback, context) {
|
|
45107
|
-
var callback = callback || truthy, context = context || array3,
|
|
45107
|
+
var callback = callback || truthy, context = context || array3, value2;
|
|
45108
45108
|
for (var i = 0, l = array3.length;i < l; i += 1) {
|
|
45109
|
-
if (
|
|
45109
|
+
if (value2 = callback.call(context, array3[i], i))
|
|
45110
45110
|
return array3[i];
|
|
45111
45111
|
}
|
|
45112
45112
|
}
|
|
@@ -46887,17 +46887,17 @@ var require_iso_4217_publish_date = __commonJS((exports, module) => {
|
|
|
46887
46887
|
module.exports = "2024-06-25";
|
|
46888
46888
|
});
|
|
46889
46889
|
|
|
46890
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
46890
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/error-codes.mjs
|
|
46891
46891
|
function defineErrorCodes(codes2) {
|
|
46892
|
-
return Object.fromEntries(Object.entries(codes2).map(([key,
|
|
46892
|
+
return Object.fromEntries(Object.entries(codes2).map(([key, value3]) => [key, {
|
|
46893
46893
|
code: key,
|
|
46894
|
-
message:
|
|
46894
|
+
message: value3,
|
|
46895
46895
|
toString: () => key
|
|
46896
46896
|
}]));
|
|
46897
46897
|
}
|
|
46898
46898
|
var init_error_codes = () => {};
|
|
46899
46899
|
|
|
46900
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
46900
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/env/env-impl.mjs
|
|
46901
46901
|
function toBoolean(val) {
|
|
46902
46902
|
return val ? val !== "false" : false;
|
|
46903
46903
|
}
|
|
@@ -46920,9 +46920,9 @@ var init_env_impl = __esm(() => {
|
|
|
46920
46920
|
has(_, prop) {
|
|
46921
46921
|
return prop in _getEnv() || prop in _envShim;
|
|
46922
46922
|
},
|
|
46923
|
-
set(_, prop,
|
|
46923
|
+
set(_, prop, value3) {
|
|
46924
46924
|
const env2 = _getEnv(true);
|
|
46925
|
-
env2[prop] =
|
|
46925
|
+
env2[prop] = value3;
|
|
46926
46926
|
return true;
|
|
46927
46927
|
},
|
|
46928
46928
|
deleteProperty(_, prop) {
|
|
@@ -46964,7 +46964,7 @@ var init_env_impl = __esm(() => {
|
|
|
46964
46964
|
});
|
|
46965
46965
|
});
|
|
46966
46966
|
|
|
46967
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
46967
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/env/color-depth.mjs
|
|
46968
46968
|
function getColorDepth() {
|
|
46969
46969
|
if (getEnvVar("FORCE_COLOR") !== undefined)
|
|
46970
46970
|
switch (getEnvVar("FORCE_COLOR")) {
|
|
@@ -47069,7 +47069,7 @@ var init_color_depth = __esm(() => {
|
|
|
47069
47069
|
];
|
|
47070
47070
|
});
|
|
47071
47071
|
|
|
47072
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47072
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/env/logger.mjs
|
|
47073
47073
|
function shouldPublishLog(currentLogLevel, logLevel) {
|
|
47074
47074
|
return levels.indexOf(logLevel) >= levels.indexOf(currentLogLevel);
|
|
47075
47075
|
}
|
|
@@ -47153,14 +47153,14 @@ var init_logger = __esm(() => {
|
|
|
47153
47153
|
logger = createLogger();
|
|
47154
47154
|
});
|
|
47155
47155
|
|
|
47156
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47156
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/env/index.mjs
|
|
47157
47157
|
var init_env = __esm(() => {
|
|
47158
47158
|
init_env_impl();
|
|
47159
47159
|
init_color_depth();
|
|
47160
47160
|
init_logger();
|
|
47161
47161
|
});
|
|
47162
47162
|
|
|
47163
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47163
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/error/codes.mjs
|
|
47164
47164
|
var BASE_ERROR_CODES;
|
|
47165
47165
|
var init_codes = __esm(() => {
|
|
47166
47166
|
init_error_codes();
|
|
@@ -47350,7 +47350,7 @@ var init_error = __esm(() => {
|
|
|
47350
47350
|
APIError = makeErrorForHideStackFrame(InternalAPIError, Error);
|
|
47351
47351
|
});
|
|
47352
47352
|
|
|
47353
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47353
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/error/index.mjs
|
|
47354
47354
|
var BetterAuthError, APIError2;
|
|
47355
47355
|
var init_error2 = __esm(() => {
|
|
47356
47356
|
init_codes();
|
|
@@ -47379,7 +47379,7 @@ var init_error2 = __esm(() => {
|
|
|
47379
47379
|
};
|
|
47380
47380
|
});
|
|
47381
47381
|
|
|
47382
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47382
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/string.mjs
|
|
47383
47383
|
function capitalizeFirstLetter(str) {
|
|
47384
47384
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
47385
47385
|
}
|
|
@@ -47437,19 +47437,19 @@ function createRandomStringGenerator(...baseAlphabets) {
|
|
|
47437
47437
|
}
|
|
47438
47438
|
var init_random = () => {};
|
|
47439
47439
|
|
|
47440
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47440
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/get-tables.mjs
|
|
47441
47441
|
var getAuthTables = (options) => {
|
|
47442
47442
|
const pluginSchema = (options.plugins ?? []).reduce((acc, plugin) => {
|
|
47443
47443
|
const schema = plugin.schema;
|
|
47444
47444
|
if (!schema)
|
|
47445
47445
|
return acc;
|
|
47446
|
-
for (const [key,
|
|
47446
|
+
for (const [key, value3] of Object.entries(schema))
|
|
47447
47447
|
acc[key] = {
|
|
47448
47448
|
fields: {
|
|
47449
47449
|
...acc[key]?.fields,
|
|
47450
|
-
...
|
|
47450
|
+
...value3.fields
|
|
47451
47451
|
},
|
|
47452
|
-
modelName:
|
|
47452
|
+
modelName: value3.modelName || key
|
|
47453
47453
|
};
|
|
47454
47454
|
return acc;
|
|
47455
47455
|
}, {});
|
|
@@ -47704,31 +47704,31 @@ var getAuthTables = (options) => {
|
|
|
47704
47704
|
};
|
|
47705
47705
|
var init_get_tables = () => {};
|
|
47706
47706
|
|
|
47707
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47708
|
-
function reviveDate(
|
|
47709
|
-
if (typeof
|
|
47710
|
-
const date6 = new Date(
|
|
47707
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/json.mjs
|
|
47708
|
+
function reviveDate(value3) {
|
|
47709
|
+
if (typeof value3 === "string" && iso8601Regex.test(value3)) {
|
|
47710
|
+
const date6 = new Date(value3);
|
|
47711
47711
|
if (!isNaN(date6.getTime()))
|
|
47712
47712
|
return date6;
|
|
47713
47713
|
}
|
|
47714
|
-
return
|
|
47715
|
-
}
|
|
47716
|
-
function reviveDates(
|
|
47717
|
-
if (
|
|
47718
|
-
return
|
|
47719
|
-
if (typeof
|
|
47720
|
-
return reviveDate(
|
|
47721
|
-
if (
|
|
47722
|
-
return
|
|
47723
|
-
if (Array.isArray(
|
|
47724
|
-
return
|
|
47725
|
-
if (typeof
|
|
47714
|
+
return value3;
|
|
47715
|
+
}
|
|
47716
|
+
function reviveDates(value3) {
|
|
47717
|
+
if (value3 === null || value3 === undefined)
|
|
47718
|
+
return value3;
|
|
47719
|
+
if (typeof value3 === "string")
|
|
47720
|
+
return reviveDate(value3);
|
|
47721
|
+
if (value3 instanceof Date)
|
|
47722
|
+
return value3;
|
|
47723
|
+
if (Array.isArray(value3))
|
|
47724
|
+
return value3.map(reviveDates);
|
|
47725
|
+
if (typeof value3 === "object") {
|
|
47726
47726
|
const result = {};
|
|
47727
|
-
for (const key of Object.keys(
|
|
47728
|
-
result[key] = reviveDates(
|
|
47727
|
+
for (const key of Object.keys(value3))
|
|
47728
|
+
result[key] = reviveDates(value3[key]);
|
|
47729
47729
|
return result;
|
|
47730
47730
|
}
|
|
47731
|
-
return
|
|
47731
|
+
return value3;
|
|
47732
47732
|
}
|
|
47733
47733
|
function safeJSONParse(data2) {
|
|
47734
47734
|
try {
|
|
@@ -47737,7 +47737,7 @@ function safeJSONParse(data2) {
|
|
|
47737
47737
|
return null;
|
|
47738
47738
|
return reviveDates(data2);
|
|
47739
47739
|
}
|
|
47740
|
-
return JSON.parse(data2, (_,
|
|
47740
|
+
return JSON.parse(data2, (_, value3) => reviveDate(value3));
|
|
47741
47741
|
} catch (e) {
|
|
47742
47742
|
logger.error("Error parsing JSON", { error: e });
|
|
47743
47743
|
return null;
|
|
@@ -47750,7 +47750,7 @@ var init_json = __esm(() => {
|
|
|
47750
47750
|
iso8601Regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
|
|
47751
47751
|
});
|
|
47752
47752
|
|
|
47753
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47753
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/id.mjs
|
|
47754
47754
|
var generateId = (size3) => {
|
|
47755
47755
|
return createRandomStringGenerator("a-z", "A-Z", "0-9")(size3 || 32);
|
|
47756
47756
|
};
|
|
@@ -47758,18 +47758,18 @@ var init_id2 = __esm(() => {
|
|
|
47758
47758
|
init_random();
|
|
47759
47759
|
});
|
|
47760
47760
|
|
|
47761
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47761
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.mjs
|
|
47762
47762
|
var init_get_default_model_name = __esm(() => {
|
|
47763
47763
|
init_error2();
|
|
47764
47764
|
});
|
|
47765
47765
|
|
|
47766
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47766
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.mjs
|
|
47767
47767
|
var init_get_default_field_name = __esm(() => {
|
|
47768
47768
|
init_error2();
|
|
47769
47769
|
init_get_default_model_name();
|
|
47770
47770
|
});
|
|
47771
47771
|
|
|
47772
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47772
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-id-field.mjs
|
|
47773
47773
|
var init_get_id_field = __esm(() => {
|
|
47774
47774
|
init_logger();
|
|
47775
47775
|
init_env();
|
|
@@ -47777,7 +47777,7 @@ var init_get_id_field = __esm(() => {
|
|
|
47777
47777
|
init_get_default_model_name();
|
|
47778
47778
|
});
|
|
47779
47779
|
|
|
47780
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47780
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.mjs
|
|
47781
47781
|
var init_get_field_attributes = __esm(() => {
|
|
47782
47782
|
init_error2();
|
|
47783
47783
|
init_get_default_model_name();
|
|
@@ -47785,21 +47785,21 @@ var init_get_field_attributes = __esm(() => {
|
|
|
47785
47785
|
init_get_id_field();
|
|
47786
47786
|
});
|
|
47787
47787
|
|
|
47788
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47788
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-field-name.mjs
|
|
47789
47789
|
var init_get_field_name = __esm(() => {
|
|
47790
47790
|
init_get_default_model_name();
|
|
47791
47791
|
init_get_default_field_name();
|
|
47792
47792
|
});
|
|
47793
47793
|
|
|
47794
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47794
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/get-model-name.mjs
|
|
47795
47795
|
var init_get_model_name = __esm(() => {
|
|
47796
47796
|
init_get_default_model_name();
|
|
47797
47797
|
});
|
|
47798
47798
|
|
|
47799
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47799
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/utils.mjs
|
|
47800
47800
|
var init_utils = () => {};
|
|
47801
47801
|
|
|
47802
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47802
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/factory.mjs
|
|
47803
47803
|
var init_factory = __esm(() => {
|
|
47804
47804
|
init_get_tables();
|
|
47805
47805
|
init_color_depth();
|
|
@@ -47816,7 +47816,7 @@ var init_factory = __esm(() => {
|
|
|
47816
47816
|
init_utils();
|
|
47817
47817
|
});
|
|
47818
47818
|
|
|
47819
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
47819
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/adapter/index.mjs
|
|
47820
47820
|
var init_adapter = __esm(() => {
|
|
47821
47821
|
init_get_default_model_name();
|
|
47822
47822
|
init_get_default_field_name();
|
|
@@ -47828,7 +47828,7 @@ var init_adapter = __esm(() => {
|
|
|
47828
47828
|
init_factory();
|
|
47829
47829
|
});
|
|
47830
47830
|
|
|
47831
|
-
// ../../node_modules/.bun/@better-auth+kysely-adapter@1.5.
|
|
47831
|
+
// ../../node_modules/.bun/@better-auth+kysely-adapter@1.5.4+7abcac640a66963f/node_modules/@better-auth/kysely-adapter/dist/index.mjs
|
|
47832
47832
|
var init_dist = __esm(() => {
|
|
47833
47833
|
init_adapter();
|
|
47834
47834
|
init_string2();
|
|
@@ -52618,6 +52618,16 @@ function isObject2(value) {
|
|
|
52618
52618
|
function isTypescriptObject(value) {
|
|
52619
52619
|
return !!value && (typeof value === "object" || typeof value === "function");
|
|
52620
52620
|
}
|
|
52621
|
+
function get(object4, path3) {
|
|
52622
|
+
let current = object4;
|
|
52623
|
+
for (const key of path3) {
|
|
52624
|
+
if (!isTypescriptObject(current)) {
|
|
52625
|
+
return;
|
|
52626
|
+
}
|
|
52627
|
+
current = current[key];
|
|
52628
|
+
}
|
|
52629
|
+
return current;
|
|
52630
|
+
}
|
|
52621
52631
|
function value(value2, ...args) {
|
|
52622
52632
|
if (typeof value2 === "function") {
|
|
52623
52633
|
return value2(...args);
|
|
@@ -53769,546 +53779,7 @@ class RPCLink extends StandardRPCLink {
|
|
|
53769
53779
|
}
|
|
53770
53780
|
}
|
|
53771
53781
|
|
|
53772
|
-
// ../../node_modules/.bun/@orpc+
|
|
53773
|
-
function resolveMaybeOptionalOptions2(rest) {
|
|
53774
|
-
return rest[0] ?? {};
|
|
53775
|
-
}
|
|
53776
|
-
var ORPC_SHARED_PACKAGE_NAME2 = "@orpc/shared";
|
|
53777
|
-
var ORPC_SHARED_PACKAGE_VERSION2 = "1.13.5";
|
|
53778
|
-
function once2(fn) {
|
|
53779
|
-
let cached2;
|
|
53780
|
-
return () => {
|
|
53781
|
-
if (cached2) {
|
|
53782
|
-
return cached2.result;
|
|
53783
|
-
}
|
|
53784
|
-
const result = fn();
|
|
53785
|
-
cached2 = { result };
|
|
53786
|
-
return result;
|
|
53787
|
-
};
|
|
53788
|
-
}
|
|
53789
|
-
function sequential2(fn) {
|
|
53790
|
-
let lastOperationPromise = Promise.resolve();
|
|
53791
|
-
return (...args) => {
|
|
53792
|
-
return lastOperationPromise = lastOperationPromise.catch(() => {}).then(() => {
|
|
53793
|
-
return fn(...args);
|
|
53794
|
-
});
|
|
53795
|
-
};
|
|
53796
|
-
}
|
|
53797
|
-
var GLOBAL_OTEL_CONFIG_KEY2 = `__${ORPC_SHARED_PACKAGE_NAME2}@${ORPC_SHARED_PACKAGE_VERSION2}/otel/config__`;
|
|
53798
|
-
function isAsyncIteratorObject2(maybe) {
|
|
53799
|
-
if (!maybe || typeof maybe !== "object") {
|
|
53800
|
-
return false;
|
|
53801
|
-
}
|
|
53802
|
-
return "next" in maybe && typeof maybe.next === "function" && Symbol.asyncIterator in maybe && typeof maybe[Symbol.asyncIterator] === "function";
|
|
53803
|
-
}
|
|
53804
|
-
var fallbackAsyncDisposeSymbol2 = Symbol.for("asyncDispose");
|
|
53805
|
-
var asyncDisposeSymbol2 = Symbol.asyncDispose ?? fallbackAsyncDisposeSymbol2;
|
|
53806
|
-
|
|
53807
|
-
class AsyncIteratorClass2 {
|
|
53808
|
-
#isDone = false;
|
|
53809
|
-
#isExecuteComplete = false;
|
|
53810
|
-
#cleanup;
|
|
53811
|
-
#next;
|
|
53812
|
-
constructor(next, cleanup) {
|
|
53813
|
-
this.#cleanup = cleanup;
|
|
53814
|
-
this.#next = sequential2(async () => {
|
|
53815
|
-
if (this.#isDone) {
|
|
53816
|
-
return { done: true, value: undefined };
|
|
53817
|
-
}
|
|
53818
|
-
try {
|
|
53819
|
-
const result = await next();
|
|
53820
|
-
if (result.done) {
|
|
53821
|
-
this.#isDone = true;
|
|
53822
|
-
}
|
|
53823
|
-
return result;
|
|
53824
|
-
} catch (err) {
|
|
53825
|
-
this.#isDone = true;
|
|
53826
|
-
throw err;
|
|
53827
|
-
} finally {
|
|
53828
|
-
if (this.#isDone && !this.#isExecuteComplete) {
|
|
53829
|
-
this.#isExecuteComplete = true;
|
|
53830
|
-
await this.#cleanup("next");
|
|
53831
|
-
}
|
|
53832
|
-
}
|
|
53833
|
-
});
|
|
53834
|
-
}
|
|
53835
|
-
next() {
|
|
53836
|
-
return this.#next();
|
|
53837
|
-
}
|
|
53838
|
-
async return(value2) {
|
|
53839
|
-
this.#isDone = true;
|
|
53840
|
-
if (!this.#isExecuteComplete) {
|
|
53841
|
-
this.#isExecuteComplete = true;
|
|
53842
|
-
await this.#cleanup("return");
|
|
53843
|
-
}
|
|
53844
|
-
return { done: true, value: value2 };
|
|
53845
|
-
}
|
|
53846
|
-
async throw(err) {
|
|
53847
|
-
this.#isDone = true;
|
|
53848
|
-
if (!this.#isExecuteComplete) {
|
|
53849
|
-
this.#isExecuteComplete = true;
|
|
53850
|
-
await this.#cleanup("throw");
|
|
53851
|
-
}
|
|
53852
|
-
throw err;
|
|
53853
|
-
}
|
|
53854
|
-
async[asyncDisposeSymbol2]() {
|
|
53855
|
-
this.#isDone = true;
|
|
53856
|
-
if (!this.#isExecuteComplete) {
|
|
53857
|
-
this.#isExecuteComplete = true;
|
|
53858
|
-
await this.#cleanup("dispose");
|
|
53859
|
-
}
|
|
53860
|
-
}
|
|
53861
|
-
[Symbol.asyncIterator]() {
|
|
53862
|
-
return this;
|
|
53863
|
-
}
|
|
53864
|
-
}
|
|
53865
|
-
class EventPublisher2 {
|
|
53866
|
-
#listenersMap = /* @__PURE__ */ new Map;
|
|
53867
|
-
#maxBufferedEvents;
|
|
53868
|
-
constructor(options = {}) {
|
|
53869
|
-
this.#maxBufferedEvents = options.maxBufferedEvents ?? 100;
|
|
53870
|
-
}
|
|
53871
|
-
get size() {
|
|
53872
|
-
return this.#listenersMap.size;
|
|
53873
|
-
}
|
|
53874
|
-
publish(event, payload) {
|
|
53875
|
-
const listeners = this.#listenersMap.get(event);
|
|
53876
|
-
if (!listeners) {
|
|
53877
|
-
return;
|
|
53878
|
-
}
|
|
53879
|
-
for (const listener of listeners) {
|
|
53880
|
-
listener(payload);
|
|
53881
|
-
}
|
|
53882
|
-
}
|
|
53883
|
-
subscribe(event, listenerOrOptions) {
|
|
53884
|
-
if (typeof listenerOrOptions === "function") {
|
|
53885
|
-
let listeners = this.#listenersMap.get(event);
|
|
53886
|
-
if (!listeners) {
|
|
53887
|
-
this.#listenersMap.set(event, listeners = []);
|
|
53888
|
-
}
|
|
53889
|
-
listeners.push(listenerOrOptions);
|
|
53890
|
-
return once2(() => {
|
|
53891
|
-
listeners.splice(listeners.indexOf(listenerOrOptions), 1);
|
|
53892
|
-
if (listeners.length === 0) {
|
|
53893
|
-
this.#listenersMap.delete(event);
|
|
53894
|
-
}
|
|
53895
|
-
});
|
|
53896
|
-
}
|
|
53897
|
-
const signal = listenerOrOptions?.signal;
|
|
53898
|
-
const maxBufferedEvents = listenerOrOptions?.maxBufferedEvents ?? this.#maxBufferedEvents;
|
|
53899
|
-
signal?.throwIfAborted();
|
|
53900
|
-
const bufferedEvents = [];
|
|
53901
|
-
const pullResolvers = [];
|
|
53902
|
-
const unsubscribe = this.subscribe(event, (payload) => {
|
|
53903
|
-
const resolver = pullResolvers.shift();
|
|
53904
|
-
if (resolver) {
|
|
53905
|
-
resolver[0]({ done: false, value: payload });
|
|
53906
|
-
} else {
|
|
53907
|
-
bufferedEvents.push(payload);
|
|
53908
|
-
if (bufferedEvents.length > maxBufferedEvents) {
|
|
53909
|
-
bufferedEvents.shift();
|
|
53910
|
-
}
|
|
53911
|
-
}
|
|
53912
|
-
});
|
|
53913
|
-
const abortListener = (event2) => {
|
|
53914
|
-
unsubscribe();
|
|
53915
|
-
pullResolvers.forEach((resolver) => resolver[1](event2.target.reason));
|
|
53916
|
-
pullResolvers.length = 0;
|
|
53917
|
-
bufferedEvents.length = 0;
|
|
53918
|
-
};
|
|
53919
|
-
signal?.addEventListener("abort", abortListener, { once: true });
|
|
53920
|
-
return new AsyncIteratorClass2(async () => {
|
|
53921
|
-
if (signal?.aborted) {
|
|
53922
|
-
throw signal.reason;
|
|
53923
|
-
}
|
|
53924
|
-
if (bufferedEvents.length > 0) {
|
|
53925
|
-
return { done: false, value: bufferedEvents.shift() };
|
|
53926
|
-
}
|
|
53927
|
-
return new Promise((resolve, reject) => {
|
|
53928
|
-
pullResolvers.push([resolve, reject]);
|
|
53929
|
-
});
|
|
53930
|
-
}, async () => {
|
|
53931
|
-
unsubscribe();
|
|
53932
|
-
signal?.removeEventListener("abort", abortListener);
|
|
53933
|
-
pullResolvers.forEach((resolver) => resolver[0]({ done: true, value: undefined }));
|
|
53934
|
-
pullResolvers.length = 0;
|
|
53935
|
-
bufferedEvents.length = 0;
|
|
53936
|
-
});
|
|
53937
|
-
}
|
|
53938
|
-
}
|
|
53939
|
-
|
|
53940
|
-
class SequentialIdGenerator2 {
|
|
53941
|
-
index = BigInt(1);
|
|
53942
|
-
generate() {
|
|
53943
|
-
const id = this.index.toString(36);
|
|
53944
|
-
this.index++;
|
|
53945
|
-
return id;
|
|
53946
|
-
}
|
|
53947
|
-
}
|
|
53948
|
-
function stringifyJSON2(value2) {
|
|
53949
|
-
return JSON.stringify(value2);
|
|
53950
|
-
}
|
|
53951
|
-
function getConstructor2(value2) {
|
|
53952
|
-
if (!isTypescriptObject2(value2)) {
|
|
53953
|
-
return null;
|
|
53954
|
-
}
|
|
53955
|
-
return Object.getPrototypeOf(value2)?.constructor;
|
|
53956
|
-
}
|
|
53957
|
-
function isObject3(value2) {
|
|
53958
|
-
if (!value2 || typeof value2 !== "object") {
|
|
53959
|
-
return false;
|
|
53960
|
-
}
|
|
53961
|
-
const proto = Object.getPrototypeOf(value2);
|
|
53962
|
-
return proto === Object.prototype || !proto || !proto.constructor;
|
|
53963
|
-
}
|
|
53964
|
-
function isTypescriptObject2(value2) {
|
|
53965
|
-
return !!value2 && (typeof value2 === "object" || typeof value2 === "function");
|
|
53966
|
-
}
|
|
53967
|
-
function get(object4, path3) {
|
|
53968
|
-
let current = object4;
|
|
53969
|
-
for (const key of path3) {
|
|
53970
|
-
if (!isTypescriptObject2(current)) {
|
|
53971
|
-
return;
|
|
53972
|
-
}
|
|
53973
|
-
current = current[key];
|
|
53974
|
-
}
|
|
53975
|
-
return current;
|
|
53976
|
-
}
|
|
53977
|
-
// ../../node_modules/.bun/@orpc+client@1.13.5+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.BF1R3smX.mjs
|
|
53978
|
-
var ORPC_CLIENT_PACKAGE_NAME2 = "@orpc/client";
|
|
53979
|
-
var ORPC_CLIENT_PACKAGE_VERSION2 = "1.13.5";
|
|
53980
|
-
var COMMON_ORPC_ERROR_DEFS2 = {
|
|
53981
|
-
BAD_REQUEST: {
|
|
53982
|
-
status: 400,
|
|
53983
|
-
message: "Bad Request"
|
|
53984
|
-
},
|
|
53985
|
-
UNAUTHORIZED: {
|
|
53986
|
-
status: 401,
|
|
53987
|
-
message: "Unauthorized"
|
|
53988
|
-
},
|
|
53989
|
-
FORBIDDEN: {
|
|
53990
|
-
status: 403,
|
|
53991
|
-
message: "Forbidden"
|
|
53992
|
-
},
|
|
53993
|
-
NOT_FOUND: {
|
|
53994
|
-
status: 404,
|
|
53995
|
-
message: "Not Found"
|
|
53996
|
-
},
|
|
53997
|
-
METHOD_NOT_SUPPORTED: {
|
|
53998
|
-
status: 405,
|
|
53999
|
-
message: "Method Not Supported"
|
|
54000
|
-
},
|
|
54001
|
-
NOT_ACCEPTABLE: {
|
|
54002
|
-
status: 406,
|
|
54003
|
-
message: "Not Acceptable"
|
|
54004
|
-
},
|
|
54005
|
-
TIMEOUT: {
|
|
54006
|
-
status: 408,
|
|
54007
|
-
message: "Request Timeout"
|
|
54008
|
-
},
|
|
54009
|
-
CONFLICT: {
|
|
54010
|
-
status: 409,
|
|
54011
|
-
message: "Conflict"
|
|
54012
|
-
},
|
|
54013
|
-
PRECONDITION_FAILED: {
|
|
54014
|
-
status: 412,
|
|
54015
|
-
message: "Precondition Failed"
|
|
54016
|
-
},
|
|
54017
|
-
PAYLOAD_TOO_LARGE: {
|
|
54018
|
-
status: 413,
|
|
54019
|
-
message: "Payload Too Large"
|
|
54020
|
-
},
|
|
54021
|
-
UNSUPPORTED_MEDIA_TYPE: {
|
|
54022
|
-
status: 415,
|
|
54023
|
-
message: "Unsupported Media Type"
|
|
54024
|
-
},
|
|
54025
|
-
UNPROCESSABLE_CONTENT: {
|
|
54026
|
-
status: 422,
|
|
54027
|
-
message: "Unprocessable Content"
|
|
54028
|
-
},
|
|
54029
|
-
TOO_MANY_REQUESTS: {
|
|
54030
|
-
status: 429,
|
|
54031
|
-
message: "Too Many Requests"
|
|
54032
|
-
},
|
|
54033
|
-
CLIENT_CLOSED_REQUEST: {
|
|
54034
|
-
status: 499,
|
|
54035
|
-
message: "Client Closed Request"
|
|
54036
|
-
},
|
|
54037
|
-
INTERNAL_SERVER_ERROR: {
|
|
54038
|
-
status: 500,
|
|
54039
|
-
message: "Internal Server Error"
|
|
54040
|
-
},
|
|
54041
|
-
NOT_IMPLEMENTED: {
|
|
54042
|
-
status: 501,
|
|
54043
|
-
message: "Not Implemented"
|
|
54044
|
-
},
|
|
54045
|
-
BAD_GATEWAY: {
|
|
54046
|
-
status: 502,
|
|
54047
|
-
message: "Bad Gateway"
|
|
54048
|
-
},
|
|
54049
|
-
SERVICE_UNAVAILABLE: {
|
|
54050
|
-
status: 503,
|
|
54051
|
-
message: "Service Unavailable"
|
|
54052
|
-
},
|
|
54053
|
-
GATEWAY_TIMEOUT: {
|
|
54054
|
-
status: 504,
|
|
54055
|
-
message: "Gateway Timeout"
|
|
54056
|
-
}
|
|
54057
|
-
};
|
|
54058
|
-
function fallbackORPCErrorStatus2(code, status) {
|
|
54059
|
-
return status ?? COMMON_ORPC_ERROR_DEFS2[code]?.status ?? 500;
|
|
54060
|
-
}
|
|
54061
|
-
function fallbackORPCErrorMessage2(code, message) {
|
|
54062
|
-
return message || COMMON_ORPC_ERROR_DEFS2[code]?.message || code;
|
|
54063
|
-
}
|
|
54064
|
-
var GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL2 = Symbol.for(`__${ORPC_CLIENT_PACKAGE_NAME2}@${ORPC_CLIENT_PACKAGE_VERSION2}/error/ORPC_ERROR_CONSTRUCTORS__`);
|
|
54065
|
-
globalThis[GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL2] ??= /* @__PURE__ */ new WeakSet;
|
|
54066
|
-
var globalORPCErrorConstructors2 = globalThis[GLOBAL_ORPC_ERROR_CONSTRUCTORS_SYMBOL2];
|
|
54067
|
-
|
|
54068
|
-
class ORPCError2 extends Error {
|
|
54069
|
-
defined;
|
|
54070
|
-
code;
|
|
54071
|
-
status;
|
|
54072
|
-
data;
|
|
54073
|
-
constructor(code, ...rest) {
|
|
54074
|
-
const options = resolveMaybeOptionalOptions2(rest);
|
|
54075
|
-
if (options.status !== undefined && !isORPCErrorStatus2(options.status)) {
|
|
54076
|
-
throw new Error("[ORPCError] Invalid error status code.");
|
|
54077
|
-
}
|
|
54078
|
-
const message = fallbackORPCErrorMessage2(code, options.message);
|
|
54079
|
-
super(message, options);
|
|
54080
|
-
this.code = code;
|
|
54081
|
-
this.status = fallbackORPCErrorStatus2(code, options.status);
|
|
54082
|
-
this.defined = options.defined ?? false;
|
|
54083
|
-
this.data = options.data;
|
|
54084
|
-
}
|
|
54085
|
-
toJSON() {
|
|
54086
|
-
return {
|
|
54087
|
-
defined: this.defined,
|
|
54088
|
-
code: this.code,
|
|
54089
|
-
status: this.status,
|
|
54090
|
-
message: this.message,
|
|
54091
|
-
data: this.data
|
|
54092
|
-
};
|
|
54093
|
-
}
|
|
54094
|
-
static [Symbol.hasInstance](instance) {
|
|
54095
|
-
if (globalORPCErrorConstructors2.has(this)) {
|
|
54096
|
-
const constructor = getConstructor2(instance);
|
|
54097
|
-
if (constructor && globalORPCErrorConstructors2.has(constructor)) {
|
|
54098
|
-
return true;
|
|
54099
|
-
}
|
|
54100
|
-
}
|
|
54101
|
-
return super[Symbol.hasInstance](instance);
|
|
54102
|
-
}
|
|
54103
|
-
}
|
|
54104
|
-
globalORPCErrorConstructors2.add(ORPCError2);
|
|
54105
|
-
function toORPCError2(error48) {
|
|
54106
|
-
return error48 instanceof ORPCError2 ? error48 : new ORPCError2("INTERNAL_SERVER_ERROR", {
|
|
54107
|
-
message: "Internal server error",
|
|
54108
|
-
cause: error48
|
|
54109
|
-
});
|
|
54110
|
-
}
|
|
54111
|
-
function isORPCErrorStatus2(status) {
|
|
54112
|
-
return status < 200 || status >= 400;
|
|
54113
|
-
}
|
|
54114
|
-
function isORPCErrorJson2(json2) {
|
|
54115
|
-
if (!isObject3(json2)) {
|
|
54116
|
-
return false;
|
|
54117
|
-
}
|
|
54118
|
-
const validKeys = ["defined", "code", "status", "message", "data"];
|
|
54119
|
-
if (Object.keys(json2).some((k) => !validKeys.includes(k))) {
|
|
54120
|
-
return false;
|
|
54121
|
-
}
|
|
54122
|
-
return "defined" in json2 && typeof json2.defined === "boolean" && "code" in json2 && typeof json2.code === "string" && "status" in json2 && typeof json2.status === "number" && isORPCErrorStatus2(json2.status) && "message" in json2 && typeof json2.message === "string";
|
|
54123
|
-
}
|
|
54124
|
-
function createORPCErrorFromJson2(json2, options = {}) {
|
|
54125
|
-
return new ORPCError2(json2.code, {
|
|
54126
|
-
...options,
|
|
54127
|
-
...json2
|
|
54128
|
-
});
|
|
54129
|
-
}
|
|
54130
|
-
// ../../node_modules/.bun/@orpc+standard-server@1.13.5+460773ef8ff1e07c/node_modules/@orpc/standard-server/dist/index.mjs
|
|
54131
|
-
class EventEncoderError2 extends TypeError {
|
|
54132
|
-
}
|
|
54133
|
-
|
|
54134
|
-
class EventDecoderError2 extends TypeError {
|
|
54135
|
-
}
|
|
54136
|
-
|
|
54137
|
-
class ErrorEvent2 extends Error {
|
|
54138
|
-
data;
|
|
54139
|
-
constructor(options) {
|
|
54140
|
-
super(options?.message ?? "An error event was received", options);
|
|
54141
|
-
this.data = options?.data;
|
|
54142
|
-
}
|
|
54143
|
-
}
|
|
54144
|
-
function decodeEventMessage2(encoded) {
|
|
54145
|
-
const lines = encoded.replace(/\n+$/, "").split(/\n/);
|
|
54146
|
-
const message = {
|
|
54147
|
-
data: undefined,
|
|
54148
|
-
event: undefined,
|
|
54149
|
-
id: undefined,
|
|
54150
|
-
retry: undefined,
|
|
54151
|
-
comments: []
|
|
54152
|
-
};
|
|
54153
|
-
for (const line of lines) {
|
|
54154
|
-
const index = line.indexOf(":");
|
|
54155
|
-
const key = index === -1 ? line : line.slice(0, index);
|
|
54156
|
-
const value2 = index === -1 ? "" : line.slice(index + 1).replace(/^\s/, "");
|
|
54157
|
-
if (index === 0) {
|
|
54158
|
-
message.comments.push(value2);
|
|
54159
|
-
} else if (key === "data") {
|
|
54160
|
-
message.data ??= "";
|
|
54161
|
-
message.data += `${value2}
|
|
54162
|
-
`;
|
|
54163
|
-
} else if (key === "event") {
|
|
54164
|
-
message.event = value2;
|
|
54165
|
-
} else if (key === "id") {
|
|
54166
|
-
message.id = value2;
|
|
54167
|
-
} else if (key === "retry") {
|
|
54168
|
-
const maybeInteger = Number.parseInt(value2);
|
|
54169
|
-
if (Number.isInteger(maybeInteger) && maybeInteger >= 0 && maybeInteger.toString() === value2) {
|
|
54170
|
-
message.retry = maybeInteger;
|
|
54171
|
-
}
|
|
54172
|
-
}
|
|
54173
|
-
}
|
|
54174
|
-
message.data = message.data?.replace(/\n$/, "");
|
|
54175
|
-
return message;
|
|
54176
|
-
}
|
|
54177
|
-
|
|
54178
|
-
class EventDecoder2 {
|
|
54179
|
-
constructor(options = {}) {
|
|
54180
|
-
this.options = options;
|
|
54181
|
-
}
|
|
54182
|
-
incomplete = "";
|
|
54183
|
-
feed(chunk) {
|
|
54184
|
-
this.incomplete += chunk;
|
|
54185
|
-
const lastCompleteIndex = this.incomplete.lastIndexOf(`
|
|
54186
|
-
|
|
54187
|
-
`);
|
|
54188
|
-
if (lastCompleteIndex === -1) {
|
|
54189
|
-
return;
|
|
54190
|
-
}
|
|
54191
|
-
const completes = this.incomplete.slice(0, lastCompleteIndex).split(/\n\n/);
|
|
54192
|
-
this.incomplete = this.incomplete.slice(lastCompleteIndex + 2);
|
|
54193
|
-
for (const encoded of completes) {
|
|
54194
|
-
const message = decodeEventMessage2(`${encoded}
|
|
54195
|
-
|
|
54196
|
-
`);
|
|
54197
|
-
if (this.options.onEvent) {
|
|
54198
|
-
this.options.onEvent(message);
|
|
54199
|
-
}
|
|
54200
|
-
}
|
|
54201
|
-
}
|
|
54202
|
-
end() {
|
|
54203
|
-
if (this.incomplete) {
|
|
54204
|
-
throw new EventDecoderError2("Event Iterator ended before complete");
|
|
54205
|
-
}
|
|
54206
|
-
}
|
|
54207
|
-
}
|
|
54208
|
-
|
|
54209
|
-
class EventDecoderStream2 extends TransformStream {
|
|
54210
|
-
constructor() {
|
|
54211
|
-
let decoder;
|
|
54212
|
-
super({
|
|
54213
|
-
start(controller) {
|
|
54214
|
-
decoder = new EventDecoder2({
|
|
54215
|
-
onEvent: (event) => {
|
|
54216
|
-
controller.enqueue(event);
|
|
54217
|
-
}
|
|
54218
|
-
});
|
|
54219
|
-
},
|
|
54220
|
-
transform(chunk) {
|
|
54221
|
-
decoder.feed(chunk);
|
|
54222
|
-
},
|
|
54223
|
-
flush() {
|
|
54224
|
-
decoder.end();
|
|
54225
|
-
}
|
|
54226
|
-
});
|
|
54227
|
-
}
|
|
54228
|
-
}
|
|
54229
|
-
function assertEventId2(id) {
|
|
54230
|
-
if (id.includes(`
|
|
54231
|
-
`)) {
|
|
54232
|
-
throw new EventEncoderError2("Event's id must not contain a newline character");
|
|
54233
|
-
}
|
|
54234
|
-
}
|
|
54235
|
-
function assertEventRetry2(retry) {
|
|
54236
|
-
if (!Number.isInteger(retry) || retry < 0) {
|
|
54237
|
-
throw new EventEncoderError2("Event's retry must be a integer and >= 0");
|
|
54238
|
-
}
|
|
54239
|
-
}
|
|
54240
|
-
function assertEventComment2(comment) {
|
|
54241
|
-
if (comment.includes(`
|
|
54242
|
-
`)) {
|
|
54243
|
-
throw new EventEncoderError2("Event's comment must not contain a newline character");
|
|
54244
|
-
}
|
|
54245
|
-
}
|
|
54246
|
-
var EVENT_SOURCE_META_SYMBOL2 = Symbol("ORPC_EVENT_SOURCE_META");
|
|
54247
|
-
function withEventMeta2(container, meta3) {
|
|
54248
|
-
if (meta3.id === undefined && meta3.retry === undefined && !meta3.comments?.length) {
|
|
54249
|
-
return container;
|
|
54250
|
-
}
|
|
54251
|
-
if (meta3.id !== undefined) {
|
|
54252
|
-
assertEventId2(meta3.id);
|
|
54253
|
-
}
|
|
54254
|
-
if (meta3.retry !== undefined) {
|
|
54255
|
-
assertEventRetry2(meta3.retry);
|
|
54256
|
-
}
|
|
54257
|
-
if (meta3.comments !== undefined) {
|
|
54258
|
-
for (const comment of meta3.comments) {
|
|
54259
|
-
assertEventComment2(comment);
|
|
54260
|
-
}
|
|
54261
|
-
}
|
|
54262
|
-
return new Proxy(container, {
|
|
54263
|
-
get(target, prop, receiver) {
|
|
54264
|
-
if (prop === EVENT_SOURCE_META_SYMBOL2) {
|
|
54265
|
-
return meta3;
|
|
54266
|
-
}
|
|
54267
|
-
return Reflect.get(target, prop, receiver);
|
|
54268
|
-
}
|
|
54269
|
-
});
|
|
54270
|
-
}
|
|
54271
|
-
function getEventMeta2(container) {
|
|
54272
|
-
return isTypescriptObject2(container) ? Reflect.get(container, EVENT_SOURCE_META_SYMBOL2) : undefined;
|
|
54273
|
-
}
|
|
54274
|
-
|
|
54275
|
-
// ../../node_modules/.bun/@orpc+client@1.13.5+460773ef8ff1e07c/node_modules/@orpc/client/dist/shared/client.BLtwTQUg.mjs
|
|
54276
|
-
function mapEventIterator2(iterator, maps) {
|
|
54277
|
-
const mapError = async (error48) => {
|
|
54278
|
-
let mappedError = await maps.error(error48);
|
|
54279
|
-
if (mappedError !== error48) {
|
|
54280
|
-
const meta3 = getEventMeta2(error48);
|
|
54281
|
-
if (meta3 && isTypescriptObject2(mappedError)) {
|
|
54282
|
-
mappedError = withEventMeta2(mappedError, meta3);
|
|
54283
|
-
}
|
|
54284
|
-
}
|
|
54285
|
-
return mappedError;
|
|
54286
|
-
};
|
|
54287
|
-
return new AsyncIteratorClass2(async () => {
|
|
54288
|
-
const { done, value: value2 } = await (async () => {
|
|
54289
|
-
try {
|
|
54290
|
-
return await iterator.next();
|
|
54291
|
-
} catch (error48) {
|
|
54292
|
-
throw await mapError(error48);
|
|
54293
|
-
}
|
|
54294
|
-
})();
|
|
54295
|
-
let mappedValue = await maps.value(value2, done);
|
|
54296
|
-
if (mappedValue !== value2) {
|
|
54297
|
-
const meta3 = getEventMeta2(value2);
|
|
54298
|
-
if (meta3 && isTypescriptObject2(mappedValue)) {
|
|
54299
|
-
mappedValue = withEventMeta2(mappedValue, meta3);
|
|
54300
|
-
}
|
|
54301
|
-
}
|
|
54302
|
-
return { done, value: mappedValue };
|
|
54303
|
-
}, async () => {
|
|
54304
|
-
try {
|
|
54305
|
-
await iterator.return?.();
|
|
54306
|
-
} catch (error48) {
|
|
54307
|
-
throw await mapError(error48);
|
|
54308
|
-
}
|
|
54309
|
-
});
|
|
54310
|
-
}
|
|
54311
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.5+460773ef8ff1e07c/node_modules/@orpc/contract/dist/shared/contract.D_dZrO__.mjs
|
|
53782
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.6+460773ef8ff1e07c/node_modules/@orpc/contract/dist/shared/contract.D_dZrO__.mjs
|
|
54312
53783
|
class ValidationError2 extends Error {
|
|
54313
53784
|
issues;
|
|
54314
53785
|
data;
|
|
@@ -54324,26 +53795,26 @@ function mergeErrorMap(errorMap1, errorMap2) {
|
|
|
54324
53795
|
async function validateORPCError(map3, error48) {
|
|
54325
53796
|
const { code, status, message, data, cause, defined } = error48;
|
|
54326
53797
|
const config2 = map3?.[error48.code];
|
|
54327
|
-
if (!config2 ||
|
|
54328
|
-
return defined ? new
|
|
53798
|
+
if (!config2 || fallbackORPCErrorStatus(error48.code, config2.status) !== error48.status) {
|
|
53799
|
+
return defined ? new ORPCError(code, { defined: false, status, message, data, cause }) : error48;
|
|
54329
53800
|
}
|
|
54330
53801
|
if (!config2.data) {
|
|
54331
|
-
return defined ? error48 : new
|
|
53802
|
+
return defined ? error48 : new ORPCError(code, { defined: true, status, message, data, cause });
|
|
54332
53803
|
}
|
|
54333
53804
|
const validated = await config2.data["~standard"].validate(error48.data);
|
|
54334
53805
|
if (validated.issues) {
|
|
54335
|
-
return defined ? new
|
|
53806
|
+
return defined ? new ORPCError(code, { defined: false, status, message, data, cause }) : error48;
|
|
54336
53807
|
}
|
|
54337
|
-
return new
|
|
53808
|
+
return new ORPCError(code, { defined: true, status, message, data: validated.value, cause });
|
|
54338
53809
|
}
|
|
54339
53810
|
|
|
54340
53811
|
class ContractProcedure {
|
|
54341
53812
|
"~orpc";
|
|
54342
53813
|
constructor(def) {
|
|
54343
|
-
if (def.route?.successStatus &&
|
|
53814
|
+
if (def.route?.successStatus && isORPCErrorStatus(def.route.successStatus)) {
|
|
54344
53815
|
throw new Error("[ContractProcedure] Invalid successStatus.");
|
|
54345
53816
|
}
|
|
54346
|
-
if (Object.values(def.errorMap).some((val) => val && val.status && !
|
|
53817
|
+
if (Object.values(def.errorMap).some((val) => val && val.status && !isORPCErrorStatus(val.status))) {
|
|
54347
53818
|
throw new Error("[ContractProcedure] Invalid error status code.");
|
|
54348
53819
|
}
|
|
54349
53820
|
this["~orpc"] = def;
|
|
@@ -54356,7 +53827,7 @@ function isContractProcedure(item) {
|
|
|
54356
53827
|
return (typeof item === "object" || typeof item === "function") && item !== null && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "errorMap" in item["~orpc"] && "route" in item["~orpc"] && "meta" in item["~orpc"];
|
|
54357
53828
|
}
|
|
54358
53829
|
|
|
54359
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.
|
|
53830
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.6+460773ef8ff1e07c/node_modules/@orpc/contract/dist/plugins/index.mjs
|
|
54360
53831
|
class RequestValidationPluginError extends Error {
|
|
54361
53832
|
}
|
|
54362
53833
|
|
|
@@ -54375,7 +53846,7 @@ class RequestValidationPlugin {
|
|
|
54375
53846
|
if (inputSchema) {
|
|
54376
53847
|
const result = await inputSchema["~standard"].validate(input);
|
|
54377
53848
|
if (result.issues) {
|
|
54378
|
-
throw new
|
|
53849
|
+
throw new ORPCError("BAD_REQUEST", {
|
|
54379
53850
|
message: "Input validation failed",
|
|
54380
53851
|
data: {
|
|
54381
53852
|
issues: result.issues
|
|
@@ -54421,7 +53892,7 @@ class ResponseValidationPlugin {
|
|
|
54421
53892
|
}
|
|
54422
53893
|
return result.value;
|
|
54423
53894
|
} catch (e) {
|
|
54424
|
-
if (e instanceof
|
|
53895
|
+
if (e instanceof ORPCError) {
|
|
54425
53896
|
throw await validateORPCError(procedure["~orpc"].errorMap, e);
|
|
54426
53897
|
}
|
|
54427
53898
|
throw e;
|
|
@@ -54438,74 +53909,7 @@ init_zod();
|
|
|
54438
53909
|
init_zod();
|
|
54439
53910
|
init_zod();
|
|
54440
53911
|
init_zod();
|
|
54441
|
-
// ../../node_modules/.bun/@orpc+
|
|
54442
|
-
class StandardRPCSerializer2 {
|
|
54443
|
-
constructor(jsonSerializer) {
|
|
54444
|
-
this.jsonSerializer = jsonSerializer;
|
|
54445
|
-
}
|
|
54446
|
-
serialize(data) {
|
|
54447
|
-
if (isAsyncIteratorObject2(data)) {
|
|
54448
|
-
return mapEventIterator2(data, {
|
|
54449
|
-
value: async (value3) => this.#serialize(value3, false),
|
|
54450
|
-
error: async (e) => {
|
|
54451
|
-
return new ErrorEvent2({
|
|
54452
|
-
data: this.#serialize(toORPCError2(e).toJSON(), false),
|
|
54453
|
-
cause: e
|
|
54454
|
-
});
|
|
54455
|
-
}
|
|
54456
|
-
});
|
|
54457
|
-
}
|
|
54458
|
-
return this.#serialize(data, true);
|
|
54459
|
-
}
|
|
54460
|
-
#serialize(data, enableFormData) {
|
|
54461
|
-
const [json2, meta_, maps, blobs] = this.jsonSerializer.serialize(data);
|
|
54462
|
-
const meta3 = meta_.length === 0 ? undefined : meta_;
|
|
54463
|
-
if (!enableFormData || blobs.length === 0) {
|
|
54464
|
-
return {
|
|
54465
|
-
json: json2,
|
|
54466
|
-
meta: meta3
|
|
54467
|
-
};
|
|
54468
|
-
}
|
|
54469
|
-
const form = new FormData;
|
|
54470
|
-
form.set("data", stringifyJSON2({ json: json2, meta: meta3, maps }));
|
|
54471
|
-
blobs.forEach((blob, i) => {
|
|
54472
|
-
form.set(i.toString(), blob);
|
|
54473
|
-
});
|
|
54474
|
-
return form;
|
|
54475
|
-
}
|
|
54476
|
-
deserialize(data) {
|
|
54477
|
-
if (isAsyncIteratorObject2(data)) {
|
|
54478
|
-
return mapEventIterator2(data, {
|
|
54479
|
-
value: async (value3) => this.#deserialize(value3),
|
|
54480
|
-
error: async (e) => {
|
|
54481
|
-
if (!(e instanceof ErrorEvent2)) {
|
|
54482
|
-
return e;
|
|
54483
|
-
}
|
|
54484
|
-
const deserialized = this.#deserialize(e.data);
|
|
54485
|
-
if (isORPCErrorJson2(deserialized)) {
|
|
54486
|
-
return createORPCErrorFromJson2(deserialized, { cause: e });
|
|
54487
|
-
}
|
|
54488
|
-
return new ErrorEvent2({
|
|
54489
|
-
data: deserialized,
|
|
54490
|
-
cause: e
|
|
54491
|
-
});
|
|
54492
|
-
}
|
|
54493
|
-
});
|
|
54494
|
-
}
|
|
54495
|
-
return this.#deserialize(data);
|
|
54496
|
-
}
|
|
54497
|
-
#deserialize(data) {
|
|
54498
|
-
if (data === undefined) {
|
|
54499
|
-
return;
|
|
54500
|
-
}
|
|
54501
|
-
if (!(data instanceof FormData)) {
|
|
54502
|
-
return this.jsonSerializer.deserialize(data.json, data.meta ?? []);
|
|
54503
|
-
}
|
|
54504
|
-
const serialized = JSON.parse(data.get("data"));
|
|
54505
|
-
return this.jsonSerializer.deserialize(serialized.json, serialized.meta ?? [], serialized.maps, (i) => data.get(i.toString()));
|
|
54506
|
-
}
|
|
54507
|
-
}
|
|
54508
|
-
// ../../node_modules/.bun/@orpc+contract@1.13.5+460773ef8ff1e07c/node_modules/@orpc/contract/dist/index.mjs
|
|
53912
|
+
// ../../node_modules/.bun/@orpc+contract@1.13.6+460773ef8ff1e07c/node_modules/@orpc/contract/dist/index.mjs
|
|
54509
53913
|
function mergeMeta(meta1, meta22) {
|
|
54510
53914
|
return { ...meta1, ...meta22 };
|
|
54511
53915
|
}
|
|
@@ -54640,11 +54044,11 @@ var DEFAULT_CONFIG = {
|
|
|
54640
54044
|
defaultInputStructure: "compact",
|
|
54641
54045
|
defaultOutputStructure: "compact"
|
|
54642
54046
|
};
|
|
54643
|
-
function fallbackContractConfig(key,
|
|
54644
|
-
if (
|
|
54047
|
+
function fallbackContractConfig(key, value2) {
|
|
54048
|
+
if (value2 === undefined) {
|
|
54645
54049
|
return DEFAULT_CONFIG[key];
|
|
54646
54050
|
}
|
|
54647
|
-
return
|
|
54051
|
+
return value2;
|
|
54648
54052
|
}
|
|
54649
54053
|
var EVENT_ITERATOR_DETAILS_SYMBOL = Symbol("ORPC_EVENT_ITERATOR_DETAILS");
|
|
54650
54054
|
function eventIterator(yields, returns) {
|
|
@@ -54654,23 +54058,23 @@ function eventIterator(yields, returns) {
|
|
|
54654
54058
|
vendor: "orpc",
|
|
54655
54059
|
version: 1,
|
|
54656
54060
|
validate(iterator) {
|
|
54657
|
-
if (!
|
|
54061
|
+
if (!isAsyncIteratorObject(iterator)) {
|
|
54658
54062
|
return { issues: [{ message: "Expect event iterator", path: [] }] };
|
|
54659
54063
|
}
|
|
54660
|
-
const mapped =
|
|
54661
|
-
async value(
|
|
54064
|
+
const mapped = mapEventIterator(iterator, {
|
|
54065
|
+
async value(value2, done) {
|
|
54662
54066
|
const schema = done ? returns : yields;
|
|
54663
54067
|
if (!schema) {
|
|
54664
|
-
return
|
|
54068
|
+
return value2;
|
|
54665
54069
|
}
|
|
54666
|
-
const result = await schema["~standard"].validate(
|
|
54070
|
+
const result = await schema["~standard"].validate(value2);
|
|
54667
54071
|
if (result.issues) {
|
|
54668
|
-
throw new
|
|
54072
|
+
throw new ORPCError("EVENT_ITERATOR_VALIDATION_FAILED", {
|
|
54669
54073
|
message: "Event iterator validation failed",
|
|
54670
54074
|
cause: new ValidationError2({
|
|
54671
54075
|
issues: result.issues,
|
|
54672
54076
|
message: "Event iterator validation failed",
|
|
54673
|
-
data:
|
|
54077
|
+
data: value2
|
|
54674
54078
|
})
|
|
54675
54079
|
});
|
|
54676
54080
|
}
|
|
@@ -54689,28 +54093,29 @@ function getEventIteratorSchemaDetails(schema) {
|
|
|
54689
54093
|
}
|
|
54690
54094
|
return schema["~standard"][EVENT_ITERATOR_DETAILS_SYMBOL];
|
|
54691
54095
|
}
|
|
54096
|
+
|
|
54692
54097
|
// ../sdk/dist/index.js
|
|
54693
54098
|
init_zod();
|
|
54694
|
-
// ../../node_modules/.bun/viem@2.
|
|
54695
|
-
function isHex(
|
|
54696
|
-
if (!
|
|
54099
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/isHex.js
|
|
54100
|
+
function isHex(value2, { strict = true } = {}) {
|
|
54101
|
+
if (!value2)
|
|
54697
54102
|
return false;
|
|
54698
|
-
if (typeof
|
|
54103
|
+
if (typeof value2 !== "string")
|
|
54699
54104
|
return false;
|
|
54700
|
-
return strict ? /^0x[0-9a-fA-F]*$/.test(
|
|
54105
|
+
return strict ? /^0x[0-9a-fA-F]*$/.test(value2) : value2.startsWith("0x");
|
|
54701
54106
|
}
|
|
54702
54107
|
|
|
54703
|
-
// ../../node_modules/.bun/viem@2.
|
|
54704
|
-
function size(
|
|
54705
|
-
if (isHex(
|
|
54706
|
-
return Math.ceil((
|
|
54707
|
-
return
|
|
54108
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/size.js
|
|
54109
|
+
function size(value2) {
|
|
54110
|
+
if (isHex(value2, { strict: false }))
|
|
54111
|
+
return Math.ceil((value2.length - 2) / 2);
|
|
54112
|
+
return value2.length;
|
|
54708
54113
|
}
|
|
54709
54114
|
|
|
54710
|
-
// ../../node_modules/.bun/viem@2.
|
|
54711
|
-
var version2 = "2.
|
|
54115
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/version.js
|
|
54116
|
+
var version2 = "2.47.0";
|
|
54712
54117
|
|
|
54713
|
-
// ../../node_modules/.bun/viem@2.
|
|
54118
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/base.js
|
|
54714
54119
|
var errorConfig = {
|
|
54715
54120
|
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : undefined,
|
|
54716
54121
|
version: `viem@${version2}`
|
|
@@ -54795,7 +54200,7 @@ function walk2(err, fn) {
|
|
|
54795
54200
|
return fn ? null : err;
|
|
54796
54201
|
}
|
|
54797
54202
|
|
|
54798
|
-
// ../../node_modules/.bun/viem@2.
|
|
54203
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/address.js
|
|
54799
54204
|
class InvalidAddressError extends BaseError2 {
|
|
54800
54205
|
constructor({ address }) {
|
|
54801
54206
|
super(`Address "${address}" is invalid.`, {
|
|
@@ -54808,7 +54213,7 @@ class InvalidAddressError extends BaseError2 {
|
|
|
54808
54213
|
}
|
|
54809
54214
|
}
|
|
54810
54215
|
|
|
54811
|
-
// ../../node_modules/.bun/viem@2.
|
|
54216
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/lru.js
|
|
54812
54217
|
class LruMap extends Map {
|
|
54813
54218
|
constructor(size2) {
|
|
54814
54219
|
super();
|
|
@@ -54821,15 +54226,15 @@ class LruMap extends Map {
|
|
|
54821
54226
|
this.maxSize = size2;
|
|
54822
54227
|
}
|
|
54823
54228
|
get(key) {
|
|
54824
|
-
const
|
|
54825
|
-
if (super.has(key) &&
|
|
54229
|
+
const value2 = super.get(key);
|
|
54230
|
+
if (super.has(key) && value2 !== undefined) {
|
|
54826
54231
|
this.delete(key);
|
|
54827
|
-
super.set(key,
|
|
54232
|
+
super.set(key, value2);
|
|
54828
54233
|
}
|
|
54829
|
-
return
|
|
54234
|
+
return value2;
|
|
54830
54235
|
}
|
|
54831
|
-
set(key,
|
|
54832
|
-
super.set(key,
|
|
54236
|
+
set(key, value2) {
|
|
54237
|
+
super.set(key, value2);
|
|
54833
54238
|
if (this.maxSize && this.size > this.maxSize) {
|
|
54834
54239
|
const firstKey = this.keys().next().value;
|
|
54835
54240
|
if (firstKey)
|
|
@@ -54839,14 +54244,14 @@ class LruMap extends Map {
|
|
|
54839
54244
|
}
|
|
54840
54245
|
}
|
|
54841
54246
|
|
|
54842
|
-
// ../../node_modules/.bun/viem@2.
|
|
54247
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/data.js
|
|
54843
54248
|
class SizeExceedsPaddingSizeError extends BaseError2 {
|
|
54844
54249
|
constructor({ size: size2, targetSize, type }) {
|
|
54845
54250
|
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
54846
54251
|
}
|
|
54847
54252
|
}
|
|
54848
54253
|
|
|
54849
|
-
// ../../node_modules/.bun/viem@2.
|
|
54254
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/data/pad.js
|
|
54850
54255
|
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
54851
54256
|
if (typeof hexOrBytes === "string")
|
|
54852
54257
|
return padHex(hexOrBytes, { dir, size: size2 });
|
|
@@ -54881,10 +54286,10 @@ function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
|
|
|
54881
54286
|
return paddedBytes;
|
|
54882
54287
|
}
|
|
54883
54288
|
|
|
54884
|
-
// ../../node_modules/.bun/viem@2.
|
|
54289
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/errors/encoding.js
|
|
54885
54290
|
class IntegerOutOfRangeError extends BaseError2 {
|
|
54886
|
-
constructor({ max, min, signed, size: size2, value:
|
|
54887
|
-
super(`Number "${
|
|
54291
|
+
constructor({ max, min, signed, size: size2, value: value2 }) {
|
|
54292
|
+
super(`Number "${value2}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
54888
54293
|
}
|
|
54889
54294
|
}
|
|
54890
54295
|
class SizeOverflowError extends BaseError2 {
|
|
@@ -54893,7 +54298,7 @@ class SizeOverflowError extends BaseError2 {
|
|
|
54893
54298
|
}
|
|
54894
54299
|
}
|
|
54895
54300
|
|
|
54896
|
-
// ../../node_modules/.bun/viem@2.
|
|
54301
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
54897
54302
|
function assertSize(hexOrBytes, { size: size2 }) {
|
|
54898
54303
|
if (size(hexOrBytes) > size2)
|
|
54899
54304
|
throw new SizeOverflowError({
|
|
@@ -54902,30 +54307,30 @@ function assertSize(hexOrBytes, { size: size2 }) {
|
|
|
54902
54307
|
});
|
|
54903
54308
|
}
|
|
54904
54309
|
|
|
54905
|
-
// ../../node_modules/.bun/viem@2.
|
|
54310
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
54906
54311
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
54907
|
-
function toHex(
|
|
54908
|
-
if (typeof
|
|
54909
|
-
return numberToHex(
|
|
54910
|
-
if (typeof
|
|
54911
|
-
return stringToHex(
|
|
54912
|
-
}
|
|
54913
|
-
if (typeof
|
|
54914
|
-
return boolToHex(
|
|
54915
|
-
return bytesToHex(
|
|
54916
|
-
}
|
|
54917
|
-
function boolToHex(
|
|
54918
|
-
const hex3 = `0x${Number(
|
|
54312
|
+
function toHex(value2, opts = {}) {
|
|
54313
|
+
if (typeof value2 === "number" || typeof value2 === "bigint")
|
|
54314
|
+
return numberToHex(value2, opts);
|
|
54315
|
+
if (typeof value2 === "string") {
|
|
54316
|
+
return stringToHex(value2, opts);
|
|
54317
|
+
}
|
|
54318
|
+
if (typeof value2 === "boolean")
|
|
54319
|
+
return boolToHex(value2, opts);
|
|
54320
|
+
return bytesToHex(value2, opts);
|
|
54321
|
+
}
|
|
54322
|
+
function boolToHex(value2, opts = {}) {
|
|
54323
|
+
const hex3 = `0x${Number(value2)}`;
|
|
54919
54324
|
if (typeof opts.size === "number") {
|
|
54920
54325
|
assertSize(hex3, { size: opts.size });
|
|
54921
54326
|
return pad(hex3, { size: opts.size });
|
|
54922
54327
|
}
|
|
54923
54328
|
return hex3;
|
|
54924
54329
|
}
|
|
54925
|
-
function bytesToHex(
|
|
54330
|
+
function bytesToHex(value2, opts = {}) {
|
|
54926
54331
|
let string5 = "";
|
|
54927
|
-
for (let i = 0;i <
|
|
54928
|
-
string5 += hexes[
|
|
54332
|
+
for (let i = 0;i < value2.length; i++) {
|
|
54333
|
+
string5 += hexes[value2[i]];
|
|
54929
54334
|
}
|
|
54930
54335
|
const hex3 = `0x${string5}`;
|
|
54931
54336
|
if (typeof opts.size === "number") {
|
|
@@ -54936,7 +54341,7 @@ function bytesToHex(value3, opts = {}) {
|
|
|
54936
54341
|
}
|
|
54937
54342
|
function numberToHex(value_, opts = {}) {
|
|
54938
54343
|
const { signed, size: size2 } = opts;
|
|
54939
|
-
const
|
|
54344
|
+
const value2 = BigInt(value_);
|
|
54940
54345
|
let maxValue;
|
|
54941
54346
|
if (size2) {
|
|
54942
54347
|
if (signed)
|
|
@@ -54947,7 +54352,7 @@ function numberToHex(value_, opts = {}) {
|
|
|
54947
54352
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
54948
54353
|
}
|
|
54949
54354
|
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
54950
|
-
if (maxValue &&
|
|
54355
|
+
if (maxValue && value2 > maxValue || value2 < minValue) {
|
|
54951
54356
|
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
54952
54357
|
throw new IntegerOutOfRangeError({
|
|
54953
54358
|
max: maxValue ? `${maxValue}${suffix}` : undefined,
|
|
@@ -54957,31 +54362,31 @@ function numberToHex(value_, opts = {}) {
|
|
|
54957
54362
|
value: `${value_}${suffix}`
|
|
54958
54363
|
});
|
|
54959
54364
|
}
|
|
54960
|
-
const hex3 = `0x${(signed &&
|
|
54365
|
+
const hex3 = `0x${(signed && value2 < 0 ? (1n << BigInt(size2 * 8)) + BigInt(value2) : value2).toString(16)}`;
|
|
54961
54366
|
if (size2)
|
|
54962
54367
|
return pad(hex3, { size: size2 });
|
|
54963
54368
|
return hex3;
|
|
54964
54369
|
}
|
|
54965
54370
|
var encoder = /* @__PURE__ */ new TextEncoder;
|
|
54966
54371
|
function stringToHex(value_, opts = {}) {
|
|
54967
|
-
const
|
|
54968
|
-
return bytesToHex(
|
|
54372
|
+
const value2 = encoder.encode(value_);
|
|
54373
|
+
return bytesToHex(value2, opts);
|
|
54969
54374
|
}
|
|
54970
54375
|
|
|
54971
|
-
// ../../node_modules/.bun/viem@2.
|
|
54376
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
54972
54377
|
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
54973
|
-
function toBytes(
|
|
54974
|
-
if (typeof
|
|
54975
|
-
return numberToBytes(
|
|
54976
|
-
if (typeof
|
|
54977
|
-
return boolToBytes(
|
|
54978
|
-
if (isHex(
|
|
54979
|
-
return hexToBytes(
|
|
54980
|
-
return stringToBytes(
|
|
54981
|
-
}
|
|
54982
|
-
function boolToBytes(
|
|
54378
|
+
function toBytes(value2, opts = {}) {
|
|
54379
|
+
if (typeof value2 === "number" || typeof value2 === "bigint")
|
|
54380
|
+
return numberToBytes(value2, opts);
|
|
54381
|
+
if (typeof value2 === "boolean")
|
|
54382
|
+
return boolToBytes(value2, opts);
|
|
54383
|
+
if (isHex(value2))
|
|
54384
|
+
return hexToBytes(value2, opts);
|
|
54385
|
+
return stringToBytes(value2, opts);
|
|
54386
|
+
}
|
|
54387
|
+
function boolToBytes(value2, opts = {}) {
|
|
54983
54388
|
const bytes = new Uint8Array(1);
|
|
54984
|
-
bytes[0] = Number(
|
|
54389
|
+
bytes[0] = Number(value2);
|
|
54985
54390
|
if (typeof opts.size === "number") {
|
|
54986
54391
|
assertSize(bytes, { size: opts.size });
|
|
54987
54392
|
return pad(bytes, { size: opts.size });
|
|
@@ -55026,12 +54431,12 @@ function hexToBytes(hex_, opts = {}) {
|
|
|
55026
54431
|
}
|
|
55027
54432
|
return bytes;
|
|
55028
54433
|
}
|
|
55029
|
-
function numberToBytes(
|
|
55030
|
-
const hex3 = numberToHex(
|
|
54434
|
+
function numberToBytes(value2, opts) {
|
|
54435
|
+
const hex3 = numberToHex(value2, opts);
|
|
55031
54436
|
return hexToBytes(hex3);
|
|
55032
54437
|
}
|
|
55033
|
-
function stringToBytes(
|
|
55034
|
-
const bytes = encoder2.encode(
|
|
54438
|
+
function stringToBytes(value2, opts = {}) {
|
|
54439
|
+
const bytes = encoder2.encode(value2);
|
|
55035
54440
|
if (typeof opts.size === "number") {
|
|
55036
54441
|
assertSize(bytes, { size: opts.size });
|
|
55037
54442
|
return pad(bytes, { dir: "right", size: opts.size });
|
|
@@ -55312,16 +54717,16 @@ class Keccak extends Hash {
|
|
|
55312
54717
|
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
55313
54718
|
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
55314
54719
|
|
|
55315
|
-
// ../../node_modules/.bun/viem@2.
|
|
55316
|
-
function keccak256(
|
|
54720
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
54721
|
+
function keccak256(value2, to_) {
|
|
55317
54722
|
const to = to_ || "hex";
|
|
55318
|
-
const bytes = keccak_256(isHex(
|
|
54723
|
+
const bytes = keccak_256(isHex(value2, { strict: false }) ? toBytes(value2) : value2);
|
|
55319
54724
|
if (to === "bytes")
|
|
55320
54725
|
return bytes;
|
|
55321
54726
|
return toHex(bytes);
|
|
55322
54727
|
}
|
|
55323
54728
|
|
|
55324
|
-
// ../../node_modules/.bun/viem@2.
|
|
54729
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/address/getAddress.js
|
|
55325
54730
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
55326
54731
|
function checksumAddress(address_, chainId) {
|
|
55327
54732
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -55347,7 +54752,7 @@ function getAddress(address, chainId) {
|
|
|
55347
54752
|
return checksumAddress(address, chainId);
|
|
55348
54753
|
}
|
|
55349
54754
|
|
|
55350
|
-
// ../../node_modules/.bun/viem@2.
|
|
54755
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/address/isAddress.js
|
|
55351
54756
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
55352
54757
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
55353
54758
|
function isAddress(address, options) {
|
|
@@ -55367,7 +54772,7 @@ function isAddress(address, options) {
|
|
|
55367
54772
|
isAddressCache.set(cacheKey, result);
|
|
55368
54773
|
return result;
|
|
55369
54774
|
}
|
|
55370
|
-
// ../../node_modules/.bun/viem@2.
|
|
54775
|
+
// ../../node_modules/.bun/viem@2.47.0+10bb0f8eb665a8bc/node_modules/viem/_esm/utils/hash/isHash.js
|
|
55371
54776
|
function isHash(hash3) {
|
|
55372
54777
|
return isHex(hash3) && size(hash3) === 32;
|
|
55373
54778
|
}
|
|
@@ -55388,14 +54793,14 @@ var secondsInQuarter = secondsInMonth * 3;
|
|
|
55388
54793
|
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
55389
54794
|
|
|
55390
54795
|
// ../../node_modules/.bun/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
|
|
55391
|
-
function constructFrom(date6,
|
|
54796
|
+
function constructFrom(date6, value2) {
|
|
55392
54797
|
if (typeof date6 === "function")
|
|
55393
|
-
return date6(
|
|
54798
|
+
return date6(value2);
|
|
55394
54799
|
if (date6 && typeof date6 === "object" && constructFromSymbol in date6)
|
|
55395
|
-
return date6[constructFromSymbol](
|
|
54800
|
+
return date6[constructFromSymbol](value2);
|
|
55396
54801
|
if (date6 instanceof Date)
|
|
55397
|
-
return new date6.constructor(
|
|
55398
|
-
return new Date(
|
|
54802
|
+
return new date6.constructor(value2);
|
|
54803
|
+
return new Date(value2);
|
|
55399
54804
|
}
|
|
55400
54805
|
|
|
55401
54806
|
// ../../node_modules/.bun/date-fns@4.1.0/node_modules/date-fns/toDate.js
|
|
@@ -57207,41 +56612,41 @@ function splitNumber(number5) {
|
|
|
57207
56612
|
function powerOfTen(zeroes) {
|
|
57208
56613
|
return BigInt("1" + "0".repeat(zeroes));
|
|
57209
56614
|
}
|
|
57210
|
-
function roundToPower(
|
|
57211
|
-
const a =
|
|
56615
|
+
function roundToPower(value2, power) {
|
|
56616
|
+
const a = value2 / power * power;
|
|
57212
56617
|
const b = a + power;
|
|
57213
|
-
return
|
|
56618
|
+
return value2 - a >= b - value2 ? b : a;
|
|
57214
56619
|
}
|
|
57215
|
-
function ceilToPower(
|
|
57216
|
-
const remainder =
|
|
57217
|
-
return remainder === 0n ?
|
|
56620
|
+
function ceilToPower(value2, power) {
|
|
56621
|
+
const remainder = value2 % power;
|
|
56622
|
+
return remainder === 0n ? value2 : value2 / power * power + power;
|
|
57218
56623
|
}
|
|
57219
|
-
function floorToPower(
|
|
57220
|
-
return
|
|
56624
|
+
function floorToPower(value2, power) {
|
|
56625
|
+
return value2 / power * power;
|
|
57221
56626
|
}
|
|
57222
|
-
function abs(
|
|
57223
|
-
return
|
|
56627
|
+
function abs(value2) {
|
|
56628
|
+
return value2 < 0n ? -value2 : value2;
|
|
57224
56629
|
}
|
|
57225
|
-
function isDnum(
|
|
57226
|
-
return Array.isArray(
|
|
56630
|
+
function isDnum(value2) {
|
|
56631
|
+
return Array.isArray(value2) && value2.length === 2 && typeof value2[0] === "bigint" && typeof value2[1] === "number";
|
|
57227
56632
|
}
|
|
57228
56633
|
var NUM_RE = /^-?(?:[0-9]+|(?:[0-9]*(?:\.[0-9]+)))$/;
|
|
57229
|
-
function from(
|
|
57230
|
-
if (isDnum(
|
|
57231
|
-
return setDecimals(
|
|
56634
|
+
function from(value2, decimals = true) {
|
|
56635
|
+
if (isDnum(value2)) {
|
|
56636
|
+
return setDecimals(value2, decimals === true ? value2[1] : decimals);
|
|
57232
56637
|
}
|
|
57233
|
-
|
|
57234
|
-
if (
|
|
57235
|
-
|
|
56638
|
+
value2 = String(value2);
|
|
56639
|
+
if (value2.includes("e")) {
|
|
56640
|
+
value2 = import_from_exponential.default(value2);
|
|
57236
56641
|
}
|
|
57237
|
-
if (!
|
|
57238
|
-
throw new Error(`dnum: incorrect number (${
|
|
56642
|
+
if (!value2.match(NUM_RE)) {
|
|
56643
|
+
throw new Error(`dnum: incorrect number (${value2})`);
|
|
57239
56644
|
}
|
|
57240
|
-
const negative =
|
|
56645
|
+
const negative = value2.startsWith("-");
|
|
57241
56646
|
if (negative) {
|
|
57242
|
-
|
|
56647
|
+
value2 = value2.slice(1);
|
|
57243
56648
|
}
|
|
57244
|
-
const parts = splitNumber(
|
|
56649
|
+
const parts = splitNumber(value2);
|
|
57245
56650
|
const whole = parts[0];
|
|
57246
56651
|
let fraction = parts[1];
|
|
57247
56652
|
if (decimals === true) {
|
|
@@ -57252,39 +56657,39 @@ function from(value3, decimals = true) {
|
|
|
57252
56657
|
const result = (BigInt(whole) * powerOfTen(decimals) + BigInt(fraction)) * (negative ? -1n : 1n);
|
|
57253
56658
|
return [result, decimals];
|
|
57254
56659
|
}
|
|
57255
|
-
function setValueDecimals(
|
|
56660
|
+
function setValueDecimals(value2, decimalsDiff, options = {}) {
|
|
57256
56661
|
options.rounding ??= "ROUND_HALF";
|
|
57257
56662
|
if (decimalsDiff > 0) {
|
|
57258
|
-
return
|
|
56663
|
+
return value2 * powerOfTen(decimalsDiff);
|
|
57259
56664
|
}
|
|
57260
56665
|
if (decimalsDiff < 0) {
|
|
57261
|
-
return divideAndRound(
|
|
56666
|
+
return divideAndRound(value2, powerOfTen(-decimalsDiff), options.rounding);
|
|
57262
56667
|
}
|
|
57263
|
-
return
|
|
56668
|
+
return value2;
|
|
57264
56669
|
}
|
|
57265
|
-
function setDecimals(
|
|
56670
|
+
function setDecimals(value2, decimals, options = {}) {
|
|
57266
56671
|
options.rounding ??= "ROUND_HALF";
|
|
57267
|
-
if (
|
|
57268
|
-
return
|
|
56672
|
+
if (value2[1] === decimals) {
|
|
56673
|
+
return value2;
|
|
57269
56674
|
}
|
|
57270
|
-
if (
|
|
56675
|
+
if (value2[1] < 0 || decimals < 0) {
|
|
57271
56676
|
throw new Error("dnum: decimals cannot be negative");
|
|
57272
56677
|
}
|
|
57273
|
-
const decimalsDiff = decimals -
|
|
56678
|
+
const decimalsDiff = decimals - value2[1];
|
|
57274
56679
|
return [
|
|
57275
|
-
setValueDecimals(
|
|
56680
|
+
setValueDecimals(value2[0], decimalsDiff, options),
|
|
57276
56681
|
decimals
|
|
57277
56682
|
];
|
|
57278
56683
|
}
|
|
57279
|
-
function toJSON([
|
|
57280
|
-
return JSON.stringify([String(
|
|
56684
|
+
function toJSON([value2, decimals]) {
|
|
56685
|
+
return JSON.stringify([String(value2), decimals]);
|
|
57281
56686
|
}
|
|
57282
56687
|
function fromJSON(jsonValue) {
|
|
57283
|
-
const [
|
|
57284
|
-
return [BigInt(
|
|
56688
|
+
const [value2, decimals] = JSON.parse(jsonValue);
|
|
56689
|
+
return [BigInt(value2), decimals];
|
|
57285
56690
|
}
|
|
57286
56691
|
function toParts(dnum, optionsOrDigits = {}) {
|
|
57287
|
-
const [
|
|
56692
|
+
const [value2, decimals] = dnum;
|
|
57288
56693
|
const options = typeof optionsOrDigits === "number" ? { digits: optionsOrDigits } : optionsOrDigits;
|
|
57289
56694
|
const {
|
|
57290
56695
|
digits = decimals,
|
|
@@ -57292,8 +56697,8 @@ function toParts(dnum, optionsOrDigits = {}) {
|
|
|
57292
56697
|
decimalsRounding
|
|
57293
56698
|
} = options;
|
|
57294
56699
|
const decimalsDivisor = powerOfTen(decimals);
|
|
57295
|
-
let whole =
|
|
57296
|
-
const fractionValue = abs(
|
|
56700
|
+
let whole = value2 / decimalsDivisor;
|
|
56701
|
+
const fractionValue = abs(value2 % decimalsDivisor);
|
|
57297
56702
|
const roundFn = decimalsRounding === "ROUND_UP" ? ceilToPower : decimalsRounding === "ROUND_DOWN" ? floorToPower : roundToPower;
|
|
57298
56703
|
let fraction = String(roundFn(BigInt("1" + "0".repeat(Math.max(0, String(decimalsDivisor).length - String(fractionValue).length - 1)) + String(fractionValue)), powerOfTen(Math.max(0, decimals - digits))));
|
|
57299
56704
|
if (fraction.startsWith("2")) {
|
|
@@ -57306,9 +56711,9 @@ function toParts(dnum, optionsOrDigits = {}) {
|
|
|
57306
56711
|
fraction === "" || BigInt(fraction) === 0n && !trailingZeros ? null : fraction
|
|
57307
56712
|
];
|
|
57308
56713
|
}
|
|
57309
|
-
function toString(
|
|
57310
|
-
const [whole, fraction] = toParts(
|
|
57311
|
-
return (
|
|
56714
|
+
function toString(value2, optionsOrDigits) {
|
|
56715
|
+
const [whole, fraction] = toParts(value2, optionsOrDigits);
|
|
56716
|
+
return (value2[0] >= 0n ? "" : "-") + whole + (fraction ? `.${fraction}` : "");
|
|
57312
56717
|
}
|
|
57313
56718
|
function floor(num, decimals) {
|
|
57314
56719
|
return round(num, { decimals, rounding: "ROUND_DOWN" });
|
|
@@ -57718,15 +57123,15 @@ var RoleRequirementSchema = exports_external.lazy(() => exports_external.union([
|
|
|
57718
57123
|
all: exports_external.array(RoleRequirementSchema)
|
|
57719
57124
|
})
|
|
57720
57125
|
]));
|
|
57721
|
-
function
|
|
57126
|
+
function resolveMaybeOptionalOptions2(rest) {
|
|
57722
57127
|
return rest[0] ?? {};
|
|
57723
57128
|
}
|
|
57724
|
-
function
|
|
57725
|
-
return Array.isArray(
|
|
57129
|
+
function toArray2(value2) {
|
|
57130
|
+
return Array.isArray(value2) ? value2 : value2 === undefined || value2 === null ? [] : [value2];
|
|
57726
57131
|
}
|
|
57727
|
-
var
|
|
57728
|
-
var
|
|
57729
|
-
function
|
|
57132
|
+
var ORPC_SHARED_PACKAGE_NAME2 = "@orpc/shared";
|
|
57133
|
+
var ORPC_SHARED_PACKAGE_VERSION2 = "1.13.6";
|
|
57134
|
+
function once2(fn) {
|
|
57730
57135
|
let cached2;
|
|
57731
57136
|
return () => {
|
|
57732
57137
|
if (cached2) {
|
|
@@ -57737,7 +57142,7 @@ function once3(fn) {
|
|
|
57737
57142
|
return result;
|
|
57738
57143
|
};
|
|
57739
57144
|
}
|
|
57740
|
-
function
|
|
57145
|
+
function sequential2(fn) {
|
|
57741
57146
|
let lastOperationPromise = Promise.resolve();
|
|
57742
57147
|
return (...args) => {
|
|
57743
57148
|
return lastOperationPromise = lastOperationPromise.catch(() => {}).then(() => {
|
|
@@ -57746,15 +57151,15 @@ function sequential3(fn) {
|
|
|
57746
57151
|
};
|
|
57747
57152
|
}
|
|
57748
57153
|
var SPAN_ERROR_STATUS2 = 2;
|
|
57749
|
-
var
|
|
57750
|
-
function
|
|
57751
|
-
return globalThis[
|
|
57154
|
+
var GLOBAL_OTEL_CONFIG_KEY2 = `__${ORPC_SHARED_PACKAGE_NAME2}@${ORPC_SHARED_PACKAGE_VERSION2}/otel/config__`;
|
|
57155
|
+
function getGlobalOtelConfig2() {
|
|
57156
|
+
return globalThis[GLOBAL_OTEL_CONFIG_KEY2];
|
|
57752
57157
|
}
|
|
57753
|
-
function
|
|
57754
|
-
const tracer =
|
|
57158
|
+
function startSpan2(name, options = {}, context) {
|
|
57159
|
+
const tracer = getGlobalOtelConfig2()?.tracer;
|
|
57755
57160
|
return tracer?.startSpan(name, options, context);
|
|
57756
57161
|
}
|
|
57757
|
-
function
|
|
57162
|
+
function setSpanError2(span, error48, options = {}) {
|
|
57758
57163
|
if (!span) {
|
|
57759
57164
|
return;
|
|
57760
57165
|
}
|
|
@@ -57781,8 +57186,8 @@ function toOtelException2(error48) {
|
|
|
57781
57186
|
}
|
|
57782
57187
|
return { message: String(error48) };
|
|
57783
57188
|
}
|
|
57784
|
-
async function
|
|
57785
|
-
const tracer =
|
|
57189
|
+
async function runWithSpan2({ name, context, ...options }, fn) {
|
|
57190
|
+
const tracer = getGlobalOtelConfig2()?.tracer;
|
|
57786
57191
|
if (!tracer) {
|
|
57787
57192
|
return fn();
|
|
57788
57193
|
}
|
|
@@ -57790,7 +57195,7 @@ async function runWithSpan3({ name, context, ...options }, fn) {
|
|
|
57790
57195
|
try {
|
|
57791
57196
|
return await fn(span);
|
|
57792
57197
|
} catch (e) {
|
|
57793
|
-
|
|
57198
|
+
setSpanError2(span, e, options);
|
|
57794
57199
|
throw e;
|
|
57795
57200
|
} finally {
|
|
57796
57201
|
span.end();
|
|
@@ -57802,31 +57207,31 @@ async function runWithSpan3({ name, context, ...options }, fn) {
|
|
|
57802
57207
|
return tracer.startActiveSpan(name, options, callback);
|
|
57803
57208
|
}
|
|
57804
57209
|
}
|
|
57805
|
-
async function
|
|
57806
|
-
const otelConfig =
|
|
57210
|
+
async function runInSpanContext2(span, fn) {
|
|
57211
|
+
const otelConfig = getGlobalOtelConfig2();
|
|
57807
57212
|
if (!span || !otelConfig) {
|
|
57808
57213
|
return fn();
|
|
57809
57214
|
}
|
|
57810
57215
|
const ctx = otelConfig.trace.setSpan(otelConfig.context.active(), span);
|
|
57811
57216
|
return otelConfig.context.with(ctx, fn);
|
|
57812
57217
|
}
|
|
57813
|
-
function
|
|
57218
|
+
function isAsyncIteratorObject2(maybe) {
|
|
57814
57219
|
if (!maybe || typeof maybe !== "object") {
|
|
57815
57220
|
return false;
|
|
57816
57221
|
}
|
|
57817
57222
|
return "next" in maybe && typeof maybe.next === "function" && Symbol.asyncIterator in maybe && typeof maybe[Symbol.asyncIterator] === "function";
|
|
57818
57223
|
}
|
|
57819
|
-
var
|
|
57820
|
-
var
|
|
57224
|
+
var fallbackAsyncDisposeSymbol2 = Symbol.for("asyncDispose");
|
|
57225
|
+
var asyncDisposeSymbol2 = Symbol.asyncDispose ?? fallbackAsyncDisposeSymbol2;
|
|
57821
57226
|
|
|
57822
|
-
class
|
|
57227
|
+
class AsyncIteratorClass2 {
|
|
57823
57228
|
#isDone = false;
|
|
57824
57229
|
#isExecuteComplete = false;
|
|
57825
57230
|
#cleanup;
|
|
57826
57231
|
#next;
|
|
57827
57232
|
constructor(next, cleanup) {
|
|
57828
57233
|
this.#cleanup = cleanup;
|
|
57829
|
-
this.#next =
|
|
57234
|
+
this.#next = sequential2(async () => {
|
|
57830
57235
|
if (this.#isDone) {
|
|
57831
57236
|
return { done: true, value: undefined };
|
|
57832
57237
|
}
|
|
@@ -57850,13 +57255,13 @@ class AsyncIteratorClass3 {
|
|
|
57850
57255
|
next() {
|
|
57851
57256
|
return this.#next();
|
|
57852
57257
|
}
|
|
57853
|
-
async return(
|
|
57258
|
+
async return(value2) {
|
|
57854
57259
|
this.#isDone = true;
|
|
57855
57260
|
if (!this.#isExecuteComplete) {
|
|
57856
57261
|
this.#isExecuteComplete = true;
|
|
57857
57262
|
await this.#cleanup("return");
|
|
57858
57263
|
}
|
|
57859
|
-
return { done: true, value:
|
|
57264
|
+
return { done: true, value: value2 };
|
|
57860
57265
|
}
|
|
57861
57266
|
async throw(err) {
|
|
57862
57267
|
this.#isDone = true;
|
|
@@ -57866,7 +57271,7 @@ class AsyncIteratorClass3 {
|
|
|
57866
57271
|
}
|
|
57867
57272
|
throw err;
|
|
57868
57273
|
}
|
|
57869
|
-
async[
|
|
57274
|
+
async[asyncDisposeSymbol2]() {
|
|
57870
57275
|
this.#isDone = true;
|
|
57871
57276
|
if (!this.#isExecuteComplete) {
|
|
57872
57277
|
this.#isExecuteComplete = true;
|
|
@@ -57877,25 +57282,25 @@ class AsyncIteratorClass3 {
|
|
|
57877
57282
|
return this;
|
|
57878
57283
|
}
|
|
57879
57284
|
}
|
|
57880
|
-
function
|
|
57285
|
+
function asyncIteratorWithSpan2({ name, ...options }, iterator) {
|
|
57881
57286
|
let span;
|
|
57882
|
-
return new
|
|
57883
|
-
span ??=
|
|
57287
|
+
return new AsyncIteratorClass2(async () => {
|
|
57288
|
+
span ??= startSpan2(name);
|
|
57884
57289
|
try {
|
|
57885
|
-
const result = await
|
|
57290
|
+
const result = await runInSpanContext2(span, () => iterator.next());
|
|
57886
57291
|
span?.addEvent(result.done ? "completed" : "yielded");
|
|
57887
57292
|
return result;
|
|
57888
57293
|
} catch (err) {
|
|
57889
|
-
|
|
57294
|
+
setSpanError2(span, err, options);
|
|
57890
57295
|
throw err;
|
|
57891
57296
|
}
|
|
57892
57297
|
}, async (reason) => {
|
|
57893
57298
|
try {
|
|
57894
57299
|
if (reason !== "next") {
|
|
57895
|
-
await
|
|
57300
|
+
await runInSpanContext2(span, () => iterator.return?.());
|
|
57896
57301
|
}
|
|
57897
57302
|
} catch (err) {
|
|
57898
|
-
|
|
57303
|
+
setSpanError2(span, err, options);
|
|
57899
57304
|
throw err;
|
|
57900
57305
|
} finally {
|
|
57901
57306
|
span?.end();
|
|
@@ -57903,7 +57308,7 @@ function asyncIteratorWithSpan3({ name, ...options }, iterator) {
|
|
|
57903
57308
|
});
|
|
57904
57309
|
}
|
|
57905
57310
|
|
|
57906
|
-
class
|
|
57311
|
+
class EventPublisher2 {
|
|
57907
57312
|
#listenersMap = /* @__PURE__ */ new Map;
|
|
57908
57313
|
#maxBufferedEvents;
|
|
57909
57314
|
constructor(options = {}) {
|
|
@@ -57928,7 +57333,7 @@ class EventPublisher3 {
|
|
|
57928
57333
|
this.#listenersMap.set(event, listeners = []);
|
|
57929
57334
|
}
|
|
57930
57335
|
listeners.push(listenerOrOptions);
|
|
57931
|
-
return
|
|
57336
|
+
return once2(() => {
|
|
57932
57337
|
listeners.splice(listeners.indexOf(listenerOrOptions), 1);
|
|
57933
57338
|
if (listeners.length === 0) {
|
|
57934
57339
|
this.#listenersMap.delete(event);
|
|
@@ -57958,7 +57363,7 @@ class EventPublisher3 {
|
|
|
57958
57363
|
bufferedEvents.length = 0;
|
|
57959
57364
|
};
|
|
57960
57365
|
signal?.addEventListener("abort", abortListener, { once: true });
|
|
57961
|
-
return new
|
|
57366
|
+
return new AsyncIteratorClass2(async () => {
|
|
57962
57367
|
if (signal?.aborted) {
|
|
57963
57368
|
throw signal.reason;
|
|
57964
57369
|
}
|
|
@@ -57978,7 +57383,7 @@ class EventPublisher3 {
|
|
|
57978
57383
|
}
|
|
57979
57384
|
}
|
|
57980
57385
|
|
|
57981
|
-
class
|
|
57386
|
+
class SequentialIdGenerator2 {
|
|
57982
57387
|
index = BigInt(1);
|
|
57983
57388
|
generate() {
|
|
57984
57389
|
const id = this.index.toString(36);
|
|
@@ -57986,7 +57391,7 @@ class SequentialIdGenerator3 {
|
|
|
57986
57391
|
return id;
|
|
57987
57392
|
}
|
|
57988
57393
|
}
|
|
57989
|
-
function
|
|
57394
|
+
function intercept2(interceptors, options, main) {
|
|
57990
57395
|
const next = (options2, index) => {
|
|
57991
57396
|
const interceptor = interceptors[index];
|
|
57992
57397
|
if (!interceptor) {
|
|
@@ -57999,8 +57404,8 @@ function intercept3(interceptors, options, main) {
|
|
|
57999
57404
|
};
|
|
58000
57405
|
return next(options, 0);
|
|
58001
57406
|
}
|
|
58002
|
-
function
|
|
58003
|
-
return JSON.stringify(
|
|
57407
|
+
function stringifyJSON2(value2) {
|
|
57408
|
+
return JSON.stringify(value2);
|
|
58004
57409
|
}
|
|
58005
57410
|
function findDeepMatches(check2, payload, segments = [], maps = [], values = []) {
|
|
58006
57411
|
if (check2(payload)) {
|
|
@@ -58010,50 +57415,50 @@ function findDeepMatches(check2, payload, segments = [], maps = [], values = [])
|
|
|
58010
57415
|
payload.forEach((v, i) => {
|
|
58011
57416
|
findDeepMatches(check2, v, [...segments, i], maps, values);
|
|
58012
57417
|
});
|
|
58013
|
-
} else if (
|
|
57418
|
+
} else if (isObject3(payload)) {
|
|
58014
57419
|
for (const key in payload) {
|
|
58015
57420
|
findDeepMatches(check2, payload[key], [...segments, key], maps, values);
|
|
58016
57421
|
}
|
|
58017
57422
|
}
|
|
58018
57423
|
return { maps, values };
|
|
58019
57424
|
}
|
|
58020
|
-
function
|
|
58021
|
-
if (!
|
|
57425
|
+
function isObject3(value2) {
|
|
57426
|
+
if (!value2 || typeof value2 !== "object") {
|
|
58022
57427
|
return false;
|
|
58023
57428
|
}
|
|
58024
|
-
const proto = Object.getPrototypeOf(
|
|
57429
|
+
const proto = Object.getPrototypeOf(value2);
|
|
58025
57430
|
return proto === Object.prototype || !proto || !proto.constructor;
|
|
58026
57431
|
}
|
|
58027
|
-
function
|
|
58028
|
-
return !!
|
|
57432
|
+
function isTypescriptObject2(value2) {
|
|
57433
|
+
return !!value2 && (typeof value2 === "object" || typeof value2 === "function");
|
|
58029
57434
|
}
|
|
58030
|
-
function clone2(
|
|
58031
|
-
if (Array.isArray(
|
|
58032
|
-
return
|
|
57435
|
+
function clone2(value2) {
|
|
57436
|
+
if (Array.isArray(value2)) {
|
|
57437
|
+
return value2.map(clone2);
|
|
58033
57438
|
}
|
|
58034
|
-
if (
|
|
57439
|
+
if (isObject3(value2)) {
|
|
58035
57440
|
const result = {};
|
|
58036
|
-
for (const key in
|
|
58037
|
-
result[key] = clone2(
|
|
57441
|
+
for (const key in value2) {
|
|
57442
|
+
result[key] = clone2(value2[key]);
|
|
58038
57443
|
}
|
|
58039
|
-
for (const sym of Object.getOwnPropertySymbols(
|
|
58040
|
-
result[sym] = clone2(
|
|
57444
|
+
for (const sym of Object.getOwnPropertySymbols(value2)) {
|
|
57445
|
+
result[sym] = clone2(value2[sym]);
|
|
58041
57446
|
}
|
|
58042
57447
|
return result;
|
|
58043
57448
|
}
|
|
58044
|
-
return
|
|
57449
|
+
return value2;
|
|
58045
57450
|
}
|
|
58046
57451
|
function get2(object4, path3) {
|
|
58047
57452
|
let current = object4;
|
|
58048
57453
|
for (const key of path3) {
|
|
58049
|
-
if (!
|
|
57454
|
+
if (!isTypescriptObject2(current)) {
|
|
58050
57455
|
return;
|
|
58051
57456
|
}
|
|
58052
57457
|
current = current[key];
|
|
58053
57458
|
}
|
|
58054
57459
|
return current;
|
|
58055
57460
|
}
|
|
58056
|
-
function
|
|
57461
|
+
function value2(value22, ...args) {
|
|
58057
57462
|
if (typeof value22 === "function") {
|
|
58058
57463
|
return value22(...args);
|
|
58059
57464
|
}
|
|
@@ -58062,28 +57467,28 @@ function value3(value22, ...args) {
|
|
|
58062
57467
|
function overlayProxy(target, partial2) {
|
|
58063
57468
|
const proxy = new Proxy(typeof target === "function" ? partial2 : target, {
|
|
58064
57469
|
get(_, prop) {
|
|
58065
|
-
const targetValue = prop in partial2 ? partial2 :
|
|
57470
|
+
const targetValue = prop in partial2 ? partial2 : value2(target);
|
|
58066
57471
|
const v = Reflect.get(targetValue, prop);
|
|
58067
57472
|
return typeof v === "function" ? v.bind(targetValue) : v;
|
|
58068
57473
|
},
|
|
58069
57474
|
has(_, prop) {
|
|
58070
|
-
return Reflect.has(partial2, prop) || Reflect.has(
|
|
57475
|
+
return Reflect.has(partial2, prop) || Reflect.has(value2(target), prop);
|
|
58071
57476
|
}
|
|
58072
57477
|
});
|
|
58073
57478
|
return proxy;
|
|
58074
57479
|
}
|
|
58075
57480
|
|
|
58076
|
-
class
|
|
57481
|
+
class EventDecoderError2 extends TypeError {
|
|
58077
57482
|
}
|
|
58078
57483
|
|
|
58079
|
-
class
|
|
57484
|
+
class ErrorEvent2 extends Error {
|
|
58080
57485
|
data;
|
|
58081
57486
|
constructor(options) {
|
|
58082
57487
|
super(options?.message ?? "An error event was received", options);
|
|
58083
57488
|
this.data = options?.data;
|
|
58084
57489
|
}
|
|
58085
57490
|
}
|
|
58086
|
-
function
|
|
57491
|
+
function decodeEventMessage2(encoded) {
|
|
58087
57492
|
const lines = encoded.replace(/\n+$/, "").split(/\n/);
|
|
58088
57493
|
const message = {
|
|
58089
57494
|
data: undefined,
|
|
@@ -58117,7 +57522,7 @@ function decodeEventMessage3(encoded) {
|
|
|
58117
57522
|
return message;
|
|
58118
57523
|
}
|
|
58119
57524
|
|
|
58120
|
-
class
|
|
57525
|
+
class EventDecoder2 {
|
|
58121
57526
|
constructor(options = {}) {
|
|
58122
57527
|
this.options = options;
|
|
58123
57528
|
}
|
|
@@ -58133,7 +57538,7 @@ class EventDecoder3 {
|
|
|
58133
57538
|
const completes = this.incomplete.slice(0, lastCompleteIndex).split(/\n\n/);
|
|
58134
57539
|
this.incomplete = this.incomplete.slice(lastCompleteIndex + 2);
|
|
58135
57540
|
for (const encoded of completes) {
|
|
58136
|
-
const message =
|
|
57541
|
+
const message = decodeEventMessage2(`${encoded}
|
|
58137
57542
|
|
|
58138
57543
|
`);
|
|
58139
57544
|
if (this.options.onEvent) {
|
|
@@ -58143,17 +57548,17 @@ class EventDecoder3 {
|
|
|
58143
57548
|
}
|
|
58144
57549
|
end() {
|
|
58145
57550
|
if (this.incomplete) {
|
|
58146
|
-
throw new
|
|
57551
|
+
throw new EventDecoderError2("Event Iterator ended before complete");
|
|
58147
57552
|
}
|
|
58148
57553
|
}
|
|
58149
57554
|
}
|
|
58150
57555
|
|
|
58151
|
-
class
|
|
57556
|
+
class EventDecoderStream2 extends TransformStream {
|
|
58152
57557
|
constructor() {
|
|
58153
57558
|
let decoder;
|
|
58154
57559
|
super({
|
|
58155
57560
|
start(controller) {
|
|
58156
|
-
decoder = new
|
|
57561
|
+
decoder = new EventDecoder2({
|
|
58157
57562
|
onEvent: (event) => {
|
|
58158
57563
|
controller.enqueue(event);
|
|
58159
57564
|
}
|
|
@@ -58168,9 +57573,9 @@ class EventDecoderStream3 extends TransformStream {
|
|
|
58168
57573
|
});
|
|
58169
57574
|
}
|
|
58170
57575
|
}
|
|
58171
|
-
var
|
|
57576
|
+
var EVENT_SOURCE_META_SYMBOL2 = Symbol("ORPC_EVENT_SOURCE_META");
|
|
58172
57577
|
|
|
58173
|
-
class HibernationEventIterator extends
|
|
57578
|
+
class HibernationEventIterator extends AsyncIteratorClass2 {
|
|
58174
57579
|
hibernationCallback;
|
|
58175
57580
|
constructor(hibernationCallback) {
|
|
58176
57581
|
super(async () => {
|
|
@@ -58183,11 +57588,11 @@ class HibernationEventIterator extends AsyncIteratorClass3 {
|
|
|
58183
57588
|
this.hibernationCallback = hibernationCallback;
|
|
58184
57589
|
}
|
|
58185
57590
|
}
|
|
58186
|
-
function
|
|
57591
|
+
function mergeStandardHeaders2(a, b) {
|
|
58187
57592
|
const merged = { ...a };
|
|
58188
57593
|
for (const key in b) {
|
|
58189
57594
|
if (Array.isArray(b[key])) {
|
|
58190
|
-
merged[key] = [...
|
|
57595
|
+
merged[key] = [...toArray2(merged[key]), ...b[key]];
|
|
58191
57596
|
} else if (b[key] !== undefined) {
|
|
58192
57597
|
if (Array.isArray(merged[key])) {
|
|
58193
57598
|
merged[key] = [...merged[key], b[key]];
|
|
@@ -58227,7 +57632,7 @@ class StandardOpenAPIJsonSerializer {
|
|
|
58227
57632
|
const json2 = data2.map((v) => v === undefined ? null : this.serialize(v, hasBlobRef)[0]);
|
|
58228
57633
|
return [json2, hasBlobRef.value];
|
|
58229
57634
|
}
|
|
58230
|
-
if (
|
|
57635
|
+
if (isObject3(data2)) {
|
|
58231
57636
|
const json2 = {};
|
|
58232
57637
|
for (const k in data2) {
|
|
58233
57638
|
if (k === "toJSON" && typeof data2[k] === "function") {
|
|
@@ -58271,11 +57676,11 @@ class StandardOpenapiLinkCodec {
|
|
|
58271
57676
|
headers;
|
|
58272
57677
|
customErrorResponseBodyDecoder;
|
|
58273
57678
|
async encode(path3, input, options) {
|
|
58274
|
-
let headers = toStandardHeaders2(await
|
|
57679
|
+
let headers = toStandardHeaders2(await value2(this.headers, options, path3, input));
|
|
58275
57680
|
if (options.lastEventId !== undefined) {
|
|
58276
|
-
headers =
|
|
57681
|
+
headers = mergeStandardHeaders2(headers, { "last-event-id": options.lastEventId });
|
|
58277
57682
|
}
|
|
58278
|
-
const baseUrl = await
|
|
57683
|
+
const baseUrl = await value2(this.baseUrl, options, path3, input);
|
|
58279
57684
|
const procedure = get2(this.contract, path3);
|
|
58280
57685
|
if (!isContractProcedure(procedure)) {
|
|
58281
57686
|
throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${path3.join(".")}`);
|
|
@@ -58288,7 +57693,7 @@ class StandardOpenapiLinkCodec {
|
|
|
58288
57693
|
let httpBody = input;
|
|
58289
57694
|
const dynamicParams = getDynamicParams(httpPath);
|
|
58290
57695
|
if (dynamicParams?.length) {
|
|
58291
|
-
if (!
|
|
57696
|
+
if (!isObject3(input)) {
|
|
58292
57697
|
throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${path3.join(".")}.`);
|
|
58293
57698
|
}
|
|
58294
57699
|
const body = { ...input };
|
|
@@ -58326,11 +57731,11 @@ class StandardOpenapiLinkCodec {
|
|
|
58326
57731
|
#encodeDetailed(procedure, path3, input, options, baseUrl, headers) {
|
|
58327
57732
|
let httpPath = standardizeHTTPPath(procedure["~orpc"].route.path ?? toHttpPath(path3));
|
|
58328
57733
|
const dynamicParams = getDynamicParams(httpPath);
|
|
58329
|
-
if (!
|
|
57734
|
+
if (!isObject3(input) && input !== undefined) {
|
|
58330
57735
|
throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${path3.join(".")}.`);
|
|
58331
57736
|
}
|
|
58332
57737
|
if (dynamicParams?.length) {
|
|
58333
|
-
if (!
|
|
57738
|
+
if (!isObject3(input?.params)) {
|
|
58334
57739
|
throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${path3.join(".")}.`);
|
|
58335
57740
|
}
|
|
58336
57741
|
for (const param of dynamicParams) {
|
|
@@ -58340,10 +57745,10 @@ class StandardOpenapiLinkCodec {
|
|
|
58340
57745
|
}
|
|
58341
57746
|
let mergedHeaders = headers;
|
|
58342
57747
|
if (input?.headers !== undefined) {
|
|
58343
|
-
if (!
|
|
57748
|
+
if (!isObject3(input.headers)) {
|
|
58344
57749
|
throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${path3.join(".")}.`);
|
|
58345
57750
|
}
|
|
58346
|
-
mergedHeaders =
|
|
57751
|
+
mergedHeaders = mergeStandardHeaders2(input.headers, headers);
|
|
58347
57752
|
}
|
|
58348
57753
|
const method = fallbackContractConfig("defaultMethod", procedure["~orpc"].route.method);
|
|
58349
57754
|
const url2 = new URL(baseUrl);
|
|
@@ -58398,7 +57803,7 @@ class StandardOpenapiLinkCodec {
|
|
|
58398
57803
|
if (isORPCErrorJson(deserialized)) {
|
|
58399
57804
|
throw createORPCErrorFromJson(deserialized);
|
|
58400
57805
|
}
|
|
58401
|
-
throw new
|
|
57806
|
+
throw new ORPCError(getMalformedResponseErrorCode(response.status), {
|
|
58402
57807
|
status: response.status,
|
|
58403
57808
|
data: { ...response, body: deserialized }
|
|
58404
57809
|
});
|
|
@@ -58425,11 +57830,11 @@ class StandardOpenAPISerializer {
|
|
|
58425
57830
|
this.bracketNotation = bracketNotation;
|
|
58426
57831
|
}
|
|
58427
57832
|
serialize(data2, options = {}) {
|
|
58428
|
-
if (
|
|
57833
|
+
if (isAsyncIteratorObject2(data2) && !options.outputFormat) {
|
|
58429
57834
|
return mapEventIterator(data2, {
|
|
58430
57835
|
value: async (value22) => this.#serialize(value22, { outputFormat: "plain" }),
|
|
58431
57836
|
error: async (e) => {
|
|
58432
|
-
return new
|
|
57837
|
+
return new ErrorEvent2({
|
|
58433
57838
|
data: this.#serialize(toORPCError(e).toJSON(), { outputFormat: "plain" }),
|
|
58434
57839
|
cause: e
|
|
58435
57840
|
});
|
|
@@ -58469,11 +57874,11 @@ class StandardOpenAPISerializer {
|
|
|
58469
57874
|
if (data2 instanceof URLSearchParams || data2 instanceof FormData) {
|
|
58470
57875
|
return this.bracketNotation.deserialize(Array.from(data2.entries()));
|
|
58471
57876
|
}
|
|
58472
|
-
if (
|
|
57877
|
+
if (isAsyncIteratorObject2(data2)) {
|
|
58473
57878
|
return mapEventIterator(data2, {
|
|
58474
57879
|
value: async (value22) => value22,
|
|
58475
57880
|
error: async (e) => {
|
|
58476
|
-
if (e instanceof
|
|
57881
|
+
if (e instanceof ErrorEvent2 && isORPCErrorJson(e.data)) {
|
|
58477
57882
|
return createORPCErrorFromJson(e.data, { cause: e });
|
|
58478
57883
|
}
|
|
58479
57884
|
return e;
|
|
@@ -58547,7 +57952,7 @@ function createORPCErrorConstructorMap(errors5) {
|
|
|
58547
57952
|
return Reflect.get(target, code2);
|
|
58548
57953
|
}
|
|
58549
57954
|
const item = (...rest) => {
|
|
58550
|
-
const options =
|
|
57955
|
+
const options = resolveMaybeOptionalOptions2(rest);
|
|
58551
57956
|
const config2 = errors5[code2];
|
|
58552
57957
|
return new ORPCError(code2, {
|
|
58553
57958
|
defined: Boolean(config2),
|
|
@@ -58566,12 +57971,12 @@ function middlewareOutputFn(output) {
|
|
|
58566
57971
|
return { output, context: {} };
|
|
58567
57972
|
}
|
|
58568
57973
|
function createProcedureClient(lazyableProcedure, ...rest) {
|
|
58569
|
-
const options =
|
|
57974
|
+
const options = resolveMaybeOptionalOptions2(rest);
|
|
58570
57975
|
return async (...[input, callerOptions]) => {
|
|
58571
|
-
const path3 =
|
|
57976
|
+
const path3 = toArray2(options.path);
|
|
58572
57977
|
const { default: procedure } = await unlazy(lazyableProcedure);
|
|
58573
57978
|
const clientContext = callerOptions?.context ?? {};
|
|
58574
|
-
const context = await
|
|
57979
|
+
const context = await value2(options.context ?? {}, clientContext);
|
|
58575
57980
|
const errors5 = createORPCErrorConstructorMap(procedure["~orpc"].errorMap);
|
|
58576
57981
|
const validateError = async (e) => {
|
|
58577
57982
|
if (e instanceof ORPCError) {
|
|
@@ -58580,9 +57985,9 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
58580
57985
|
return e;
|
|
58581
57986
|
};
|
|
58582
57987
|
try {
|
|
58583
|
-
const output = await
|
|
57988
|
+
const output = await runWithSpan2({ name: "call_procedure", signal: callerOptions?.signal }, (span) => {
|
|
58584
57989
|
span?.setAttribute("procedure.path", [...path3]);
|
|
58585
|
-
return
|
|
57990
|
+
return intercept2(toArray2(options.interceptors), {
|
|
58586
57991
|
context,
|
|
58587
57992
|
input,
|
|
58588
57993
|
errors: errors5,
|
|
@@ -58592,11 +57997,11 @@ function createProcedureClient(lazyableProcedure, ...rest) {
|
|
|
58592
57997
|
lastEventId: callerOptions?.lastEventId
|
|
58593
57998
|
}, (interceptorOptions) => executeProcedureInternal(interceptorOptions.procedure, interceptorOptions));
|
|
58594
57999
|
});
|
|
58595
|
-
if (
|
|
58000
|
+
if (isAsyncIteratorObject2(output)) {
|
|
58596
58001
|
if (output instanceof HibernationEventIterator) {
|
|
58597
58002
|
return output;
|
|
58598
58003
|
}
|
|
58599
|
-
return overlayProxy(output, mapEventIterator(
|
|
58004
|
+
return overlayProxy(output, mapEventIterator(asyncIteratorWithSpan2({ name: "consume_event_iterator_output", signal: callerOptions?.signal }, output), {
|
|
58600
58005
|
value: (v) => v,
|
|
58601
58006
|
error: (e) => validateError(e)
|
|
58602
58007
|
}));
|
|
@@ -58612,7 +58017,7 @@ async function validateInput(procedure, input) {
|
|
|
58612
58017
|
if (!schema) {
|
|
58613
58018
|
return input;
|
|
58614
58019
|
}
|
|
58615
|
-
return
|
|
58020
|
+
return runWithSpan2({ name: "validate_input" }, async () => {
|
|
58616
58021
|
const result = await schema["~standard"].validate(input);
|
|
58617
58022
|
if (result.issues) {
|
|
58618
58023
|
throw new ORPCError("BAD_REQUEST", {
|
|
@@ -58635,7 +58040,7 @@ async function validateOutput(procedure, output) {
|
|
|
58635
58040
|
if (!schema) {
|
|
58636
58041
|
return output;
|
|
58637
58042
|
}
|
|
58638
|
-
return
|
|
58043
|
+
return runWithSpan2({ name: "validate_output" }, async () => {
|
|
58639
58044
|
const result = await schema["~standard"].validate(output);
|
|
58640
58045
|
if (result.issues) {
|
|
58641
58046
|
throw new ORPCError("INTERNAL_SERVER_ERROR", {
|
|
@@ -58660,7 +58065,7 @@ async function executeProcedureInternal(procedure, options) {
|
|
|
58660
58065
|
currentInput = await validateInput(procedure, currentInput);
|
|
58661
58066
|
}
|
|
58662
58067
|
const mid = middlewares[index];
|
|
58663
|
-
const output = mid ? await
|
|
58068
|
+
const output = mid ? await runWithSpan2({ name: `middleware.${mid.name}`, signal: options.signal }, async (span) => {
|
|
58664
58069
|
span?.setAttribute("middleware.index", index);
|
|
58665
58070
|
span?.setAttribute("middleware.name", mid.name);
|
|
58666
58071
|
const result = await mid({
|
|
@@ -58675,7 +58080,7 @@ async function executeProcedureInternal(procedure, options) {
|
|
|
58675
58080
|
}
|
|
58676
58081
|
}, currentInput, middlewareOutputFn);
|
|
58677
58082
|
return result.output;
|
|
58678
|
-
}) : await
|
|
58083
|
+
}) : await runWithSpan2({ name: "handler", signal: options.signal }, () => procedure["~orpc"].handler({ ...options, context, input: currentInput }));
|
|
58679
58084
|
if (index === outputValidationIndex) {
|
|
58680
58085
|
return await validateOutput(procedure, output);
|
|
58681
58086
|
}
|
|
@@ -58838,7 +58243,7 @@ function createActionableClient(client) {
|
|
|
58838
58243
|
if (error48 instanceof Error && "digest" in error48 && typeof error48.digest === "string" && error48.digest.startsWith("NEXT_")) {
|
|
58839
58244
|
throw error48;
|
|
58840
58245
|
}
|
|
58841
|
-
if (error48 instanceof Response && "options" in error48 &&
|
|
58246
|
+
if (error48 instanceof Response && "options" in error48 && isObject3(error48.options) || isObject3(error48) && error48.isNotFound === true) {
|
|
58842
58247
|
throw error48;
|
|
58843
58248
|
}
|
|
58844
58249
|
return [toORPCError(error48).toJSON(), undefined];
|
|
@@ -59150,10 +58555,10 @@ var LOGIC_KEYWORDS = [
|
|
|
59150
58555
|
"uniqueItems"
|
|
59151
58556
|
];
|
|
59152
58557
|
function isFileSchema(schema) {
|
|
59153
|
-
return
|
|
58558
|
+
return isObject3(schema) && schema.type === "string" && typeof schema.contentMediaType === "string";
|
|
59154
58559
|
}
|
|
59155
58560
|
function isObjectSchema(schema) {
|
|
59156
|
-
return
|
|
58561
|
+
return isObject3(schema) && schema.type === "object";
|
|
59157
58562
|
}
|
|
59158
58563
|
function isAnySchema(schema) {
|
|
59159
58564
|
if (schema === true) {
|
|
@@ -59179,7 +58584,7 @@ function separateObjectSchema(schema, separatedProperties) {
|
|
|
59179
58584
|
}, {});
|
|
59180
58585
|
matched.required = schema.required?.filter((key) => separatedProperties.includes(key));
|
|
59181
58586
|
matched.examples = schema.examples?.map((example) => {
|
|
59182
|
-
if (!
|
|
58587
|
+
if (!isObject3(example)) {
|
|
59183
58588
|
return example;
|
|
59184
58589
|
}
|
|
59185
58590
|
return Object.entries(example).reduce((acc, [key, value22]) => {
|
|
@@ -59195,7 +58600,7 @@ function separateObjectSchema(schema, separatedProperties) {
|
|
|
59195
58600
|
}, {});
|
|
59196
58601
|
rest.required = schema.required?.filter((key) => !separatedProperties.includes(key));
|
|
59197
58602
|
rest.examples = schema.examples?.map((example) => {
|
|
59198
|
-
if (!
|
|
58603
|
+
if (!isObject3(example)) {
|
|
59199
58604
|
return example;
|
|
59200
58605
|
}
|
|
59201
58606
|
return Object.entries(example).reduce((acc, [key, value22]) => {
|
|
@@ -59212,7 +58617,7 @@ function filterSchemaBranches(schema, check2, matches = []) {
|
|
|
59212
58617
|
matches.push(schema);
|
|
59213
58618
|
return [matches, undefined];
|
|
59214
58619
|
}
|
|
59215
|
-
if (
|
|
58620
|
+
if (isObject3(schema)) {
|
|
59216
58621
|
for (const keyword of ["anyOf", "oneOf"]) {
|
|
59217
58622
|
if (schema[keyword] && Object.keys(schema).every((k) => k === keyword || !LOGIC_KEYWORDS.includes(k))) {
|
|
59218
58623
|
const rest = schema[keyword].map((s) => filterSchemaBranches(s, check2, matches)[1]).filter((v) => !!v);
|
|
@@ -59257,7 +58662,7 @@ function expandArrayableSchema(schema) {
|
|
|
59257
58662
|
}
|
|
59258
58663
|
const items1 = arraySchema.items;
|
|
59259
58664
|
const items2 = schemas4.find((s) => s !== arraySchema);
|
|
59260
|
-
if (
|
|
58665
|
+
if (stringifyJSON2(items1) !== stringifyJSON2(items2)) {
|
|
59261
58666
|
return;
|
|
59262
58667
|
}
|
|
59263
58668
|
return [items2, arraySchema];
|
|
@@ -59301,7 +58706,7 @@ function toOpenAPIContent(schema) {
|
|
|
59301
58706
|
content["application/json"] = {
|
|
59302
58707
|
schema: toOpenAPISchema(restSchema)
|
|
59303
58708
|
};
|
|
59304
|
-
const isStillHasFileSchema = findDeepMatches((v) =>
|
|
58709
|
+
const isStillHasFileSchema = findDeepMatches((v) => isObject3(v) && isFileSchema(v), restSchema).values.length > 0;
|
|
59305
58710
|
if (isStillHasFileSchema) {
|
|
59306
58711
|
content["multipart/form-data"] = {
|
|
59307
58712
|
schema: toOpenAPISchema(restSchema)
|
|
@@ -59409,8 +58814,8 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema, doc2) {
|
|
|
59409
58814
|
return schema;
|
|
59410
58815
|
}
|
|
59411
58816
|
const unionSchemas = [
|
|
59412
|
-
...
|
|
59413
|
-
...
|
|
58817
|
+
...toArray2(schema.anyOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2))),
|
|
58818
|
+
...toArray2(schema.oneOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2)))
|
|
59414
58819
|
];
|
|
59415
58820
|
const objectUnionSchemas = [];
|
|
59416
58821
|
for (const u of unionSchemas) {
|
|
@@ -59433,7 +58838,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema, doc2) {
|
|
|
59433
58838
|
}
|
|
59434
58839
|
}
|
|
59435
58840
|
}
|
|
59436
|
-
const intersectionSchemas =
|
|
58841
|
+
const intersectionSchemas = toArray2(schema.allOf?.map((s) => simplifyComposedObjectJsonSchemasAndRefs(s, doc2)));
|
|
59437
58842
|
const objectIntersectionSchemas = [];
|
|
59438
58843
|
for (const u of intersectionSchemas) {
|
|
59439
58844
|
if (!isObjectSchema(u)) {
|
|
@@ -59470,7 +58875,7 @@ function simplifyComposedObjectJsonSchemasAndRefs(schema, doc2) {
|
|
|
59470
58875
|
const seen = /* @__PURE__ */ new Set;
|
|
59471
58876
|
const result = [];
|
|
59472
58877
|
for (const schema2 of schemas4) {
|
|
59473
|
-
const key =
|
|
58878
|
+
const key = stringifyJSON2(schema2);
|
|
59474
58879
|
if (!seen.has(key)) {
|
|
59475
58880
|
seen.add(key);
|
|
59476
58881
|
result.push(schema2);
|
|
@@ -59526,7 +58931,7 @@ class OpenAPIGenerator {
|
|
|
59526
58931
|
converter;
|
|
59527
58932
|
constructor(options = {}) {
|
|
59528
58933
|
this.serializer = new StandardOpenAPIJsonSerializer(options);
|
|
59529
|
-
this.converter = new CompositeSchemaConverter(
|
|
58934
|
+
this.converter = new CompositeSchemaConverter(toArray2(options.schemaConverters));
|
|
59530
58935
|
}
|
|
59531
58936
|
async generate(router, { customErrorResponseBodySchema, commonSchemas, filter: baseFilter, exclude, ...baseDoc } = {}) {
|
|
59532
58937
|
const filter = baseFilter ?? (({ contract, path: path3 }) => {
|
|
@@ -59540,7 +58945,7 @@ class OpenAPIGenerator {
|
|
|
59540
58945
|
const { baseSchemaConvertOptions, undefinedErrorJsonSchema } = await this.#resolveCommonSchemas(doc2, commonSchemas);
|
|
59541
58946
|
const contracts = [];
|
|
59542
58947
|
await resolveContractProcedures({ path: [], router }, (traverseOptions) => {
|
|
59543
|
-
if (!
|
|
58948
|
+
if (!value2(filter, traverseOptions)) {
|
|
59544
58949
|
return;
|
|
59545
58950
|
}
|
|
59546
58951
|
contracts.push(traverseOptions);
|
|
@@ -59615,12 +59020,12 @@ ${errors5.join(`
|
|
|
59615
59020
|
const allowedStrategies = [strategy];
|
|
59616
59021
|
if (strategy === "input") {
|
|
59617
59022
|
const [outputRequired, outputJson] = await this.converter.convert(schema, { strategy: "output" });
|
|
59618
|
-
if (outputRequired === required2 &&
|
|
59023
|
+
if (outputRequired === required2 && stringifyJSON2(outputJson) === stringifyJSON2(json2)) {
|
|
59619
59024
|
allowedStrategies.push("output");
|
|
59620
59025
|
}
|
|
59621
59026
|
} else if (strategy === "output") {
|
|
59622
59027
|
const [inputRequired, inputJson] = await this.converter.convert(schema, { strategy: "input" });
|
|
59623
|
-
if (inputRequired === required2 &&
|
|
59028
|
+
if (inputRequired === required2 && stringifyJSON2(inputJson) === stringifyJSON2(json2)) {
|
|
59624
59029
|
allowedStrategies.push("input");
|
|
59625
59030
|
}
|
|
59626
59031
|
}
|
|
@@ -59768,7 +59173,7 @@ ${errors5.join(`
|
|
|
59768
59173
|
body?: unknown
|
|
59769
59174
|
}
|
|
59770
59175
|
|
|
59771
|
-
But got: ${
|
|
59176
|
+
But got: ${stringifyJSON2(item)}
|
|
59772
59177
|
`);
|
|
59773
59178
|
const simplifiedItem = simplifyComposedObjectJsonSchemasAndRefs(item, doc2);
|
|
59774
59179
|
if (!isObjectSchema(simplifiedItem)) {
|
|
@@ -59846,7 +59251,7 @@ ${errors5.join(`
|
|
|
59846
59251
|
ref.responses ??= {};
|
|
59847
59252
|
for (const statusString in errorResponsesByStatus) {
|
|
59848
59253
|
const errorResponse = errorResponsesByStatus[statusString];
|
|
59849
|
-
const customBodySchema =
|
|
59254
|
+
const customBodySchema = value2(customErrorResponseBodySchema, errorResponse.definedErrorDefinitions, errorResponse.status);
|
|
59850
59255
|
ref.responses[statusString] = {
|
|
59851
59256
|
description: statusString,
|
|
59852
59257
|
content: toOpenAPIContent(customBodySchema ?? {
|
|
@@ -72319,7 +71724,7 @@ var dalpSerializers = [
|
|
|
72319
71724
|
];
|
|
72320
71725
|
var package_default = {
|
|
72321
71726
|
name: "@settlemint/dalp-sdk",
|
|
72322
|
-
version: "2.1.7-main.
|
|
71727
|
+
version: "2.1.7-main.22784829103",
|
|
72323
71728
|
private: false,
|
|
72324
71729
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
72325
71730
|
homepage: "https://settlemint.com",
|
|
@@ -72370,12 +71775,12 @@ var package_default = {
|
|
|
72370
71775
|
},
|
|
72371
71776
|
dependencies: {
|
|
72372
71777
|
"@orpc/client": "1.13.6",
|
|
72373
|
-
"@orpc/contract": "1.13.
|
|
71778
|
+
"@orpc/contract": "1.13.6",
|
|
72374
71779
|
"currency-codes": "2.2.0",
|
|
72375
71780
|
"date-fns": "4.1.0",
|
|
72376
71781
|
dnum: "2.17.0",
|
|
72377
71782
|
"iso-3166": "4.4.0",
|
|
72378
|
-
viem: "2.
|
|
71783
|
+
viem: "2.47.0",
|
|
72379
71784
|
zod: "4.3.6"
|
|
72380
71785
|
},
|
|
72381
71786
|
devDependencies: {
|
|
@@ -72457,7 +71862,7 @@ function createDalpClient(config3) {
|
|
|
72457
71862
|
// package.json
|
|
72458
71863
|
var package_default2 = {
|
|
72459
71864
|
name: "@settlemint/dalp-cli",
|
|
72460
|
-
version: "2.1.7-main.
|
|
71865
|
+
version: "2.1.7-main.22784829103",
|
|
72461
71866
|
private: false,
|
|
72462
71867
|
description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
|
|
72463
71868
|
homepage: "https://settlemint.com",
|
|
@@ -72503,7 +71908,7 @@ var package_default2 = {
|
|
|
72503
71908
|
"@arethetypeswrong/cli": "0.18.2",
|
|
72504
71909
|
"@tools/typescript-config": "workspace:*",
|
|
72505
71910
|
"@tools/vitest-config": "workspace:*",
|
|
72506
|
-
"@types/bun": "1.3.
|
|
71911
|
+
"@types/bun": "1.3.10",
|
|
72507
71912
|
publint: "0.3.18"
|
|
72508
71913
|
},
|
|
72509
71914
|
engines: {
|
|
@@ -72519,9 +71924,9 @@ var cliVars = exports_external.object({
|
|
|
72519
71924
|
credentials: exports_external.custom(),
|
|
72520
71925
|
orpc: exports_external.custom()
|
|
72521
71926
|
});
|
|
72522
|
-
function parseJsonOption(
|
|
71927
|
+
function parseJsonOption(value3, optionName) {
|
|
72523
71928
|
try {
|
|
72524
|
-
return JSON.parse(
|
|
71929
|
+
return JSON.parse(value3);
|
|
72525
71930
|
} catch {
|
|
72526
71931
|
throw new Error(`Invalid JSON for --${optionName}. Check that the value is valid JSON (e.g., '["item1","item2"]' or '{"key":"value"}').`);
|
|
72527
71932
|
}
|
|
@@ -73944,14 +73349,14 @@ settingsCommand.command("upsert", {
|
|
|
73944
73349
|
value: exports_external.string().describe("Setting value")
|
|
73945
73350
|
}),
|
|
73946
73351
|
run(c) {
|
|
73947
|
-
const { key, value:
|
|
73352
|
+
const { key, value: value3 } = c.options;
|
|
73948
73353
|
if (key === "BASE_CURRENCY") {
|
|
73949
|
-
return c.var.orpc.settings.upsert({ body: { key, value: baseCurrencySchema2.parse(
|
|
73354
|
+
return c.var.orpc.settings.upsert({ body: { key, value: baseCurrencySchema2.parse(value3) } });
|
|
73950
73355
|
}
|
|
73951
73356
|
if (key === "SYSTEM_ADDONS_SKIPPED") {
|
|
73952
|
-
return c.var.orpc.settings.upsert({ body: { key, value: addonsSkippedSchema.parse(
|
|
73357
|
+
return c.var.orpc.settings.upsert({ body: { key, value: addonsSkippedSchema.parse(value3) } });
|
|
73953
73358
|
}
|
|
73954
|
-
return c.var.orpc.settings.upsert({ body: { key, value:
|
|
73359
|
+
return c.var.orpc.settings.upsert({ body: { key, value: value3 } });
|
|
73955
73360
|
}
|
|
73956
73361
|
});
|
|
73957
73362
|
settingsCommand.command("delete", {
|
|
@@ -74861,15 +74266,15 @@ init_zod();
|
|
|
74861
74266
|
var ethereumAddress2 = exports_external.string().meta({
|
|
74862
74267
|
description: "A valid Ethereum address (42 characters, starting with 0x)",
|
|
74863
74268
|
examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
|
|
74864
|
-
}).min(42, "Ethereum address must be at least 42 characters long").max(42, "Ethereum address must be at most 42 characters long").regex(/^0x[a-fA-F0-9]{40}$/, "Ethereum address must start with 0x followed by 40 hexadecimal characters").transform((
|
|
74865
|
-
if (!isAddress(
|
|
74269
|
+
}).min(42, "Ethereum address must be at least 42 characters long").max(42, "Ethereum address must be at most 42 characters long").regex(/^0x[a-fA-F0-9]{40}$/, "Ethereum address must start with 0x followed by 40 hexadecimal characters").transform((value3, ctx) => {
|
|
74270
|
+
if (!isAddress(value3)) {
|
|
74866
74271
|
ctx.addIssue({
|
|
74867
74272
|
code: exports_external.ZodIssueCode.custom,
|
|
74868
74273
|
message: "Invalid Ethereum address format or checksum"
|
|
74869
74274
|
});
|
|
74870
74275
|
return exports_external.NEVER;
|
|
74871
74276
|
}
|
|
74872
|
-
return getAddress(
|
|
74277
|
+
return getAddress(value3);
|
|
74873
74278
|
});
|
|
74874
74279
|
|
|
74875
74280
|
// ../../packages/core/validation/src/account.ts
|
|
@@ -74890,7 +74295,7 @@ var ethereumHex2 = exports_external.string().meta({
|
|
|
74890
74295
|
examples: ["0x1234abcd", "0x00", "0xdeadbeef"]
|
|
74891
74296
|
}).min(2, "Hex string must be at least 2 characters long (0x)").refine(isHex, {
|
|
74892
74297
|
message: "Invalid hex format - must start with '0x' followed by hexadecimal characters"
|
|
74893
|
-
}).transform((
|
|
74298
|
+
}).transform((value3) => value3);
|
|
74894
74299
|
|
|
74895
74300
|
// ../../packages/core/validation/src/access-control-roles.ts
|
|
74896
74301
|
var roles2 = [
|
|
@@ -76269,7 +75674,7 @@ var whoamiCommand = exports_Cli.create("whoami", {
|
|
|
76269
75674
|
}
|
|
76270
75675
|
});
|
|
76271
75676
|
|
|
76272
|
-
// ../../node_modules/.bun/@better-auth+api-key@1.5.
|
|
75677
|
+
// ../../node_modules/.bun/@better-auth+api-key@1.5.4+f08f4e3310502b43/node_modules/@better-auth/api-key/dist/error-codes-vwTWW2ez.mjs
|
|
76273
75678
|
init_error_codes();
|
|
76274
75679
|
var API_KEY_ERROR_CODES = defineErrorCodes({
|
|
76275
75680
|
INVALID_METADATA_TYPE: "metadata must be an object or undefined",
|
|
@@ -76305,7 +75710,7 @@ var API_KEY_ERROR_CODES = defineErrorCodes({
|
|
|
76305
75710
|
ORGANIZATION_PLUGIN_REQUIRED: "Organization plugin is required for organization-owned API keys. Please install and configure the organization plugin."
|
|
76306
75711
|
});
|
|
76307
75712
|
|
|
76308
|
-
// ../../node_modules/.bun/@better-auth+api-key@1.5.
|
|
75713
|
+
// ../../node_modules/.bun/@better-auth+api-key@1.5.4+f08f4e3310502b43/node_modules/@better-auth/api-key/dist/client.mjs
|
|
76309
75714
|
var apiKeyClient = () => {
|
|
76310
75715
|
return {
|
|
76311
75716
|
id: "api-key",
|
|
@@ -76319,7 +75724,7 @@ var apiKeyClient = () => {
|
|
|
76319
75724
|
};
|
|
76320
75725
|
};
|
|
76321
75726
|
|
|
76322
|
-
// ../../node_modules/.bun/@better-auth+passkey@1.5.
|
|
75727
|
+
// ../../node_modules/.bun/@better-auth+passkey@1.5.4+f08f4e3310502b43/node_modules/@better-auth/passkey/dist/error-codes-Dvu2mv33.mjs
|
|
76323
75728
|
init_error_codes();
|
|
76324
75729
|
var PASSKEY_ERROR_CODES = defineErrorCodes({
|
|
76325
75730
|
CHALLENGE_NOT_FOUND: "Challenge not found",
|
|
@@ -76361,7 +75766,7 @@ function browserSupportsWebAuthn() {
|
|
|
76361
75766
|
return _browserSupportsWebAuthnInternals.stubThis(globalThis?.PublicKeyCredential !== undefined && typeof globalThis.PublicKeyCredential === "function");
|
|
76362
75767
|
}
|
|
76363
75768
|
var _browserSupportsWebAuthnInternals = {
|
|
76364
|
-
stubThis: (
|
|
75769
|
+
stubThis: (value3) => value3
|
|
76365
75770
|
};
|
|
76366
75771
|
|
|
76367
75772
|
// ../../node_modules/.bun/@simplewebauthn+browser@13.2.2/node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
|
|
@@ -76628,7 +76033,7 @@ function browserSupportsWebAuthnAutofill() {
|
|
|
76628
76033
|
return _browserSupportsWebAuthnAutofillInternals.stubThis(globalPublicKeyCredential.isConditionalMediationAvailable());
|
|
76629
76034
|
}
|
|
76630
76035
|
var _browserSupportsWebAuthnAutofillInternals = {
|
|
76631
|
-
stubThis: (
|
|
76036
|
+
stubThis: (value3) => value3
|
|
76632
76037
|
};
|
|
76633
76038
|
|
|
76634
76039
|
// ../../node_modules/.bun/@simplewebauthn+browser@13.2.2/node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
|
|
@@ -76737,7 +76142,7 @@ async function startAuthentication(options) {
|
|
|
76737
76142
|
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
76738
76143
|
};
|
|
76739
76144
|
}
|
|
76740
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76145
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
76741
76146
|
var kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
76742
76147
|
var now = () => Math.floor(Date.now() / 1000);
|
|
76743
76148
|
var WindowBroadcastChannel = class {
|
|
@@ -76785,7 +76190,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
|
76785
76190
|
return globalThis[kBroadcastChannel];
|
|
76786
76191
|
}
|
|
76787
76192
|
|
|
76788
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76193
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
76789
76194
|
var kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
76790
76195
|
var WindowFocusManager = class {
|
|
76791
76196
|
listeners = /* @__PURE__ */ new Set;
|
|
@@ -76817,7 +76222,7 @@ function getGlobalFocusManager() {
|
|
|
76817
76222
|
return globalThis[kFocusManager];
|
|
76818
76223
|
}
|
|
76819
76224
|
|
|
76820
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76225
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/online-manager.mjs
|
|
76821
76226
|
var kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
76822
76227
|
var WindowOnlineManager = class {
|
|
76823
76228
|
listeners = /* @__PURE__ */ new Set;
|
|
@@ -76851,7 +76256,7 @@ function getGlobalOnlineManager() {
|
|
|
76851
76256
|
return globalThis[kOnlineManager];
|
|
76852
76257
|
}
|
|
76853
76258
|
|
|
76854
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76259
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/parser.mjs
|
|
76855
76260
|
var PROTO_POLLUTION_PATTERNS = {
|
|
76856
76261
|
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
76857
76262
|
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
@@ -76872,8 +76277,8 @@ var ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1
|
|
|
76872
76277
|
function isValidDate(date6) {
|
|
76873
76278
|
return date6 instanceof Date && !isNaN(date6.getTime());
|
|
76874
76279
|
}
|
|
76875
|
-
function parseISODate(
|
|
76876
|
-
const match = ISO_DATE_REGEX.exec(
|
|
76280
|
+
function parseISODate(value3) {
|
|
76281
|
+
const match = ISO_DATE_REGEX.exec(value3);
|
|
76877
76282
|
if (!match)
|
|
76878
76283
|
return null;
|
|
76879
76284
|
const [, year, month, day, hour, minute, second, ms, offsetSign, offsetHour, offsetMinute] = match;
|
|
@@ -76884,11 +76289,11 @@ function parseISODate(value4) {
|
|
|
76884
76289
|
}
|
|
76885
76290
|
return isValidDate(date6) ? date6 : null;
|
|
76886
76291
|
}
|
|
76887
|
-
function betterJSONParse(
|
|
76292
|
+
function betterJSONParse(value3, options = {}) {
|
|
76888
76293
|
const { strict = false, warnings = false, reviver, parseDates = true } = options;
|
|
76889
|
-
if (typeof
|
|
76890
|
-
return
|
|
76891
|
-
const trimmed =
|
|
76294
|
+
if (typeof value3 !== "string")
|
|
76295
|
+
return value3;
|
|
76296
|
+
const trimmed = value3.trim();
|
|
76892
76297
|
if (trimmed.length > 0 && trimmed[0] === '"' && trimmed.endsWith('"') && !trimmed.slice(1, -1).includes('"'))
|
|
76893
76298
|
return trimmed.slice(1, -1);
|
|
76894
76299
|
const lowerValue = trimmed.toLowerCase();
|
|
@@ -76897,7 +76302,7 @@ function betterJSONParse(value4, options = {}) {
|
|
|
76897
76302
|
if (!JSON_SIGNATURE.test(trimmed)) {
|
|
76898
76303
|
if (strict)
|
|
76899
76304
|
throw new SyntaxError("[better-json] Invalid JSON");
|
|
76900
|
-
return
|
|
76305
|
+
return value3;
|
|
76901
76306
|
}
|
|
76902
76307
|
if (Object.entries(PROTO_POLLUTION_PATTERNS).some(([key, pattern]) => {
|
|
76903
76308
|
const matches = pattern.test(trimmed);
|
|
@@ -76907,28 +76312,28 @@ function betterJSONParse(value4, options = {}) {
|
|
|
76907
76312
|
}) && strict)
|
|
76908
76313
|
throw new Error("[better-json] Potential prototype pollution attempt detected");
|
|
76909
76314
|
try {
|
|
76910
|
-
const secureReviver = (key,
|
|
76911
|
-
if (key === "__proto__" || key === "constructor" &&
|
|
76315
|
+
const secureReviver = (key, value4) => {
|
|
76316
|
+
if (key === "__proto__" || key === "constructor" && value4 && typeof value4 === "object" && "prototype" in value4) {
|
|
76912
76317
|
if (warnings)
|
|
76913
76318
|
console.warn(`[better-json] Dropping "${key}" key to prevent prototype pollution`);
|
|
76914
76319
|
return;
|
|
76915
76320
|
}
|
|
76916
|
-
if (parseDates && typeof
|
|
76917
|
-
const date6 = parseISODate(
|
|
76321
|
+
if (parseDates && typeof value4 === "string") {
|
|
76322
|
+
const date6 = parseISODate(value4);
|
|
76918
76323
|
if (date6)
|
|
76919
76324
|
return date6;
|
|
76920
76325
|
}
|
|
76921
|
-
return reviver ? reviver(key,
|
|
76326
|
+
return reviver ? reviver(key, value4) : value4;
|
|
76922
76327
|
};
|
|
76923
76328
|
return JSON.parse(trimmed, secureReviver);
|
|
76924
76329
|
} catch (error48) {
|
|
76925
76330
|
if (strict)
|
|
76926
76331
|
throw error48;
|
|
76927
|
-
return
|
|
76332
|
+
return value3;
|
|
76928
76333
|
}
|
|
76929
76334
|
}
|
|
76930
|
-
function parseJSON(
|
|
76931
|
-
return betterJSONParse(
|
|
76335
|
+
function parseJSON(value3, options = { strict: true }) {
|
|
76336
|
+
return betterJSONParse(value3, options);
|
|
76932
76337
|
}
|
|
76933
76338
|
|
|
76934
76339
|
// ../../node_modules/.bun/nanostores@1.1.1/node_modules/nanostores/clean-stores/index.js
|
|
@@ -77076,10 +76481,10 @@ var onMount = ($store, initialize) => {
|
|
|
77076
76481
|
};
|
|
77077
76482
|
});
|
|
77078
76483
|
};
|
|
77079
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76484
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/query.mjs
|
|
77080
76485
|
var isServer = () => typeof window === "undefined";
|
|
77081
76486
|
var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
77082
|
-
const
|
|
76487
|
+
const value3 = atom({
|
|
77083
76488
|
data: null,
|
|
77084
76489
|
error: null,
|
|
77085
76490
|
isPending: true,
|
|
@@ -77089,9 +76494,9 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
77089
76494
|
const fn = async (queryParams) => {
|
|
77090
76495
|
return new Promise((resolve3) => {
|
|
77091
76496
|
const opts = typeof options === "function" ? options({
|
|
77092
|
-
data:
|
|
77093
|
-
error:
|
|
77094
|
-
isPending:
|
|
76497
|
+
data: value3.get().data,
|
|
76498
|
+
error: value3.get().error,
|
|
76499
|
+
isPending: value3.get().isPending
|
|
77095
76500
|
}) : options;
|
|
77096
76501
|
$fetch(path3, {
|
|
77097
76502
|
...opts,
|
|
@@ -77100,12 +76505,12 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
77100
76505
|
...queryParams?.query
|
|
77101
76506
|
},
|
|
77102
76507
|
async onSuccess(context) {
|
|
77103
|
-
|
|
76508
|
+
value3.set({
|
|
77104
76509
|
data: context.data,
|
|
77105
76510
|
error: null,
|
|
77106
76511
|
isPending: false,
|
|
77107
76512
|
isRefetching: false,
|
|
77108
|
-
refetch:
|
|
76513
|
+
refetch: value3.value.refetch
|
|
77109
76514
|
});
|
|
77110
76515
|
await opts?.onSuccess?.(context);
|
|
77111
76516
|
},
|
|
@@ -77115,33 +76520,33 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
77115
76520
|
const retryAttempt = request.retryAttempt || 0;
|
|
77116
76521
|
if (retryAttempts && retryAttempt < retryAttempts)
|
|
77117
76522
|
return;
|
|
77118
|
-
|
|
76523
|
+
value3.set({
|
|
77119
76524
|
error: context.error,
|
|
77120
76525
|
data: null,
|
|
77121
76526
|
isPending: false,
|
|
77122
76527
|
isRefetching: false,
|
|
77123
|
-
refetch:
|
|
76528
|
+
refetch: value3.value.refetch
|
|
77124
76529
|
});
|
|
77125
76530
|
await opts?.onError?.(context);
|
|
77126
76531
|
},
|
|
77127
76532
|
async onRequest(context) {
|
|
77128
|
-
const currentValue =
|
|
77129
|
-
|
|
76533
|
+
const currentValue = value3.get();
|
|
76534
|
+
value3.set({
|
|
77130
76535
|
isPending: currentValue.data === null,
|
|
77131
76536
|
data: currentValue.data,
|
|
77132
76537
|
error: null,
|
|
77133
76538
|
isRefetching: true,
|
|
77134
|
-
refetch:
|
|
76539
|
+
refetch: value3.value.refetch
|
|
77135
76540
|
});
|
|
77136
76541
|
await opts?.onRequest?.(context);
|
|
77137
76542
|
}
|
|
77138
76543
|
}).catch((error48) => {
|
|
77139
|
-
|
|
76544
|
+
value3.set({
|
|
77140
76545
|
error: error48,
|
|
77141
76546
|
data: null,
|
|
77142
76547
|
isPending: false,
|
|
77143
76548
|
isRefetching: false,
|
|
77144
|
-
refetch:
|
|
76549
|
+
refetch: value3.value.refetch
|
|
77145
76550
|
});
|
|
77146
76551
|
}).finally(() => {
|
|
77147
76552
|
resolve3(undefined);
|
|
@@ -77157,7 +76562,7 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
77157
76562
|
if (isMounted)
|
|
77158
76563
|
await fn();
|
|
77159
76564
|
else
|
|
77160
|
-
onMount(
|
|
76565
|
+
onMount(value3, () => {
|
|
77161
76566
|
const timeoutId = setTimeout(async () => {
|
|
77162
76567
|
if (!isMounted) {
|
|
77163
76568
|
await fn();
|
|
@@ -77165,16 +76570,16 @@ var useAuthQuery = (initializedAtom, path3, $fetch, options) => {
|
|
|
77165
76570
|
}
|
|
77166
76571
|
}, 0);
|
|
77167
76572
|
return () => {
|
|
77168
|
-
|
|
76573
|
+
value3.off();
|
|
77169
76574
|
initAtom.off();
|
|
77170
76575
|
clearTimeout(timeoutId);
|
|
77171
76576
|
};
|
|
77172
76577
|
});
|
|
77173
76578
|
});
|
|
77174
|
-
return
|
|
76579
|
+
return value3;
|
|
77175
76580
|
};
|
|
77176
76581
|
|
|
77177
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76582
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
77178
76583
|
var now2 = () => Math.floor(Date.now() / 1000);
|
|
77179
76584
|
var FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;
|
|
77180
76585
|
function createSessionRefreshManager(opts) {
|
|
@@ -77311,7 +76716,7 @@ function createSessionRefreshManager(opts) {
|
|
|
77311
76716
|
};
|
|
77312
76717
|
}
|
|
77313
76718
|
|
|
77314
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76719
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/wildcard.mjs
|
|
77315
76720
|
function escapeRegExpChar(char) {
|
|
77316
76721
|
if (char === "-" || char === "^" || char === "$" || char === "+" || char === "." || char === "(" || char === ")" || char === "|" || char === "[" || char === "]" || char === "{" || char === "}" || char === "*" || char === "?" || char === "\\")
|
|
77317
76722
|
return `\\${char}`;
|
|
@@ -77409,7 +76814,7 @@ function wildcardMatch(pattern, options) {
|
|
|
77409
76814
|
return fn;
|
|
77410
76815
|
}
|
|
77411
76816
|
|
|
77412
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76817
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/url.mjs
|
|
77413
76818
|
init_env();
|
|
77414
76819
|
init_error2();
|
|
77415
76820
|
function checkHasPath(url2) {
|
|
@@ -77509,7 +76914,7 @@ function getHost(url2) {
|
|
|
77509
76914
|
}
|
|
77510
76915
|
}
|
|
77511
76916
|
|
|
77512
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76917
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
77513
76918
|
var redirectPlugin = {
|
|
77514
76919
|
id: "redirect",
|
|
77515
76920
|
name: "Redirect",
|
|
@@ -77525,7 +76930,7 @@ var redirectPlugin = {
|
|
|
77525
76930
|
} }
|
|
77526
76931
|
};
|
|
77527
76932
|
|
|
77528
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
76933
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/session-atom.mjs
|
|
77529
76934
|
function getSessionAtom($fetch, options) {
|
|
77530
76935
|
const $signal = atom(false);
|
|
77531
76936
|
const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
|
|
@@ -77551,19 +76956,19 @@ function getSessionAtom($fetch, options) {
|
|
|
77551
76956
|
}
|
|
77552
76957
|
|
|
77553
76958
|
// ../../node_modules/.bun/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
77554
|
-
function isPlainObject4(
|
|
77555
|
-
if (
|
|
76959
|
+
function isPlainObject4(value3) {
|
|
76960
|
+
if (value3 === null || typeof value3 !== "object") {
|
|
77556
76961
|
return false;
|
|
77557
76962
|
}
|
|
77558
|
-
const prototype = Object.getPrototypeOf(
|
|
76963
|
+
const prototype = Object.getPrototypeOf(value3);
|
|
77559
76964
|
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
77560
76965
|
return false;
|
|
77561
76966
|
}
|
|
77562
|
-
if (Symbol.iterator in
|
|
76967
|
+
if (Symbol.iterator in value3) {
|
|
77563
76968
|
return false;
|
|
77564
76969
|
}
|
|
77565
|
-
if (Symbol.toStringTag in
|
|
77566
|
-
return Object.prototype.toString.call(
|
|
76970
|
+
if (Symbol.toStringTag in value3) {
|
|
76971
|
+
return Object.prototype.toString.call(value3) === "[object Module]";
|
|
77567
76972
|
}
|
|
77568
76973
|
return true;
|
|
77569
76974
|
}
|
|
@@ -77576,19 +76981,19 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
|
77576
76981
|
if (key === "__proto__" || key === "constructor") {
|
|
77577
76982
|
continue;
|
|
77578
76983
|
}
|
|
77579
|
-
const
|
|
77580
|
-
if (
|
|
76984
|
+
const value3 = baseObject[key];
|
|
76985
|
+
if (value3 === null || value3 === undefined) {
|
|
77581
76986
|
continue;
|
|
77582
76987
|
}
|
|
77583
|
-
if (merger && merger(object4, key,
|
|
76988
|
+
if (merger && merger(object4, key, value3, namespace)) {
|
|
77584
76989
|
continue;
|
|
77585
76990
|
}
|
|
77586
|
-
if (Array.isArray(
|
|
77587
|
-
object4[key] = [...
|
|
77588
|
-
} else if (isPlainObject4(
|
|
77589
|
-
object4[key] = _defu(
|
|
76991
|
+
if (Array.isArray(value3) && Array.isArray(object4[key])) {
|
|
76992
|
+
object4[key] = [...value3, ...object4[key]];
|
|
76993
|
+
} else if (isPlainObject4(value3) && isPlainObject4(object4[key])) {
|
|
76994
|
+
object4[key] = _defu(value3, object4[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
77590
76995
|
} else {
|
|
77591
|
-
object4[key] =
|
|
76996
|
+
object4[key] = value3;
|
|
77592
76997
|
}
|
|
77593
76998
|
}
|
|
77594
76999
|
return object4;
|
|
@@ -77617,7 +77022,7 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
77617
77022
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
77618
77023
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
77619
77024
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
77620
|
-
var __defNormalProp = (obj, key,
|
|
77025
|
+
var __defNormalProp = (obj, key, value3) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value: value3 }) : obj[key] = value3;
|
|
77621
77026
|
var __spreadValues = (a, b) => {
|
|
77622
77027
|
for (var prop in b || (b = {}))
|
|
77623
77028
|
if (__hasOwnProp2.call(b, prop))
|
|
@@ -77724,7 +77129,7 @@ function createRetryStrategy(options) {
|
|
|
77724
77129
|
}
|
|
77725
77130
|
var getAuthHeader = async (options) => {
|
|
77726
77131
|
const headers = {};
|
|
77727
|
-
const getValue = async (
|
|
77132
|
+
const getValue = async (value3) => typeof value3 === "function" ? await value3() : value3;
|
|
77728
77133
|
if (options == null ? undefined : options.auth) {
|
|
77729
77134
|
if (options.auth.type === "Bearer") {
|
|
77730
77135
|
const token = await getValue(options.auth.token);
|
|
@@ -77742,14 +77147,14 @@ var getAuthHeader = async (options) => {
|
|
|
77742
77147
|
}
|
|
77743
77148
|
headers["authorization"] = `Basic ${btoa(`${username}:${password}`)}`;
|
|
77744
77149
|
} else if (options.auth.type === "Custom") {
|
|
77745
|
-
const [prefix,
|
|
77150
|
+
const [prefix, value3] = await Promise.all([
|
|
77746
77151
|
getValue(options.auth.prefix),
|
|
77747
77152
|
getValue(options.auth.value)
|
|
77748
77153
|
]);
|
|
77749
|
-
if (!
|
|
77154
|
+
if (!value3) {
|
|
77750
77155
|
return headers;
|
|
77751
77156
|
}
|
|
77752
|
-
headers["authorization"] = `${prefix != null ? prefix : ""} ${
|
|
77157
|
+
headers["authorization"] = `${prefix != null ? prefix : ""} ${value3}`;
|
|
77753
77158
|
}
|
|
77754
77159
|
}
|
|
77755
77160
|
return headers;
|
|
@@ -77775,32 +77180,32 @@ function detectResponseType(request) {
|
|
|
77775
77180
|
}
|
|
77776
77181
|
return "blob";
|
|
77777
77182
|
}
|
|
77778
|
-
function isJSONParsable(
|
|
77183
|
+
function isJSONParsable(value3) {
|
|
77779
77184
|
try {
|
|
77780
|
-
JSON.parse(
|
|
77185
|
+
JSON.parse(value3);
|
|
77781
77186
|
return true;
|
|
77782
77187
|
} catch (error48) {
|
|
77783
77188
|
return false;
|
|
77784
77189
|
}
|
|
77785
77190
|
}
|
|
77786
|
-
function isJSONSerializable(
|
|
77787
|
-
if (
|
|
77191
|
+
function isJSONSerializable(value3) {
|
|
77192
|
+
if (value3 === undefined) {
|
|
77788
77193
|
return false;
|
|
77789
77194
|
}
|
|
77790
|
-
const t = typeof
|
|
77195
|
+
const t = typeof value3;
|
|
77791
77196
|
if (t === "string" || t === "number" || t === "boolean" || t === null) {
|
|
77792
77197
|
return true;
|
|
77793
77198
|
}
|
|
77794
77199
|
if (t !== "object") {
|
|
77795
77200
|
return false;
|
|
77796
77201
|
}
|
|
77797
|
-
if (Array.isArray(
|
|
77202
|
+
if (Array.isArray(value3)) {
|
|
77798
77203
|
return true;
|
|
77799
77204
|
}
|
|
77800
|
-
if (
|
|
77205
|
+
if (value3.buffer) {
|
|
77801
77206
|
return false;
|
|
77802
77207
|
}
|
|
77803
|
-
return
|
|
77208
|
+
return value3.constructor && value3.constructor.name === "Object" || typeof value3.toJSON === "function";
|
|
77804
77209
|
}
|
|
77805
77210
|
function jsonParse(text) {
|
|
77806
77211
|
try {
|
|
@@ -77809,8 +77214,8 @@ function jsonParse(text) {
|
|
|
77809
77214
|
return text;
|
|
77810
77215
|
}
|
|
77811
77216
|
}
|
|
77812
|
-
function isFunction(
|
|
77813
|
-
return typeof
|
|
77217
|
+
function isFunction(value3) {
|
|
77218
|
+
return typeof value3 === "function";
|
|
77814
77219
|
}
|
|
77815
77220
|
function getFetch(options) {
|
|
77816
77221
|
if (options == null ? undefined : options.customFetchImpl) {
|
|
@@ -77827,8 +77232,8 @@ function getFetch(options) {
|
|
|
77827
77232
|
async function getHeaders(opts) {
|
|
77828
77233
|
const headers = new Headers(opts == null ? undefined : opts.headers);
|
|
77829
77234
|
const authHeader = await getAuthHeader(opts);
|
|
77830
|
-
for (const [key,
|
|
77831
|
-
headers.set(key,
|
|
77235
|
+
for (const [key, value3] of Object.entries(authHeader || {})) {
|
|
77236
|
+
headers.set(key, value3);
|
|
77832
77237
|
}
|
|
77833
77238
|
if (!headers.has("content-type")) {
|
|
77834
77239
|
const t = detectContentType(opts == null ? undefined : opts.body);
|
|
@@ -77850,9 +77255,9 @@ function getBody(options) {
|
|
|
77850
77255
|
}
|
|
77851
77256
|
const headers = new Headers(options == null ? undefined : options.headers);
|
|
77852
77257
|
if (isJSONSerializable(options.body) && !headers.has("content-type")) {
|
|
77853
|
-
for (const [key,
|
|
77854
|
-
if (
|
|
77855
|
-
options.body[key] =
|
|
77258
|
+
for (const [key, value3] of Object.entries(options == null ? undefined : options.body)) {
|
|
77259
|
+
if (value3 instanceof Date) {
|
|
77260
|
+
options.body[key] = value3.toISOString();
|
|
77856
77261
|
}
|
|
77857
77262
|
}
|
|
77858
77263
|
return JSON.stringify(options.body);
|
|
@@ -77999,19 +77404,19 @@ function getURL2(url2, option) {
|
|
|
77999
77404
|
basePath += "/";
|
|
78000
77405
|
let [path3, urlQuery] = url2.replace(basePath, "").split("?");
|
|
78001
77406
|
const queryParams = new URLSearchParams(urlQuery);
|
|
78002
|
-
for (const [key,
|
|
78003
|
-
if (
|
|
77407
|
+
for (const [key, value3] of Object.entries(query || {})) {
|
|
77408
|
+
if (value3 == null)
|
|
78004
77409
|
continue;
|
|
78005
77410
|
let serializedValue;
|
|
78006
|
-
if (typeof
|
|
78007
|
-
serializedValue =
|
|
78008
|
-
} else if (Array.isArray(
|
|
78009
|
-
for (const val of
|
|
77411
|
+
if (typeof value3 === "string") {
|
|
77412
|
+
serializedValue = value3;
|
|
77413
|
+
} else if (Array.isArray(value3)) {
|
|
77414
|
+
for (const val of value3) {
|
|
78010
77415
|
queryParams.append(key, val);
|
|
78011
77416
|
}
|
|
78012
77417
|
continue;
|
|
78013
77418
|
} else {
|
|
78014
|
-
serializedValue = JSON.stringify(
|
|
77419
|
+
serializedValue = JSON.stringify(value3);
|
|
78015
77420
|
}
|
|
78016
77421
|
queryParams.set(key, serializedValue);
|
|
78017
77422
|
}
|
|
@@ -78019,12 +77424,12 @@ function getURL2(url2, option) {
|
|
|
78019
77424
|
if (Array.isArray(params)) {
|
|
78020
77425
|
const paramPaths = path3.split("/").filter((p) => p.startsWith(":"));
|
|
78021
77426
|
for (const [index, key] of paramPaths.entries()) {
|
|
78022
|
-
const
|
|
78023
|
-
path3 = path3.replace(key,
|
|
77427
|
+
const value3 = params[index];
|
|
77428
|
+
path3 = path3.replace(key, value3);
|
|
78024
77429
|
}
|
|
78025
77430
|
} else {
|
|
78026
|
-
for (const [key,
|
|
78027
|
-
path3 = path3.replace(`:${key}`, String(
|
|
77431
|
+
for (const [key, value3] of Object.entries(params)) {
|
|
77432
|
+
path3 = path3.replace(`:${key}`, String(value3));
|
|
78028
77433
|
}
|
|
78029
77434
|
}
|
|
78030
77435
|
}
|
|
@@ -78118,9 +77523,9 @@ var betterFetch = async (url2, options) => {
|
|
|
78118
77523
|
successContext.data = await parseStandardSchema(context.output, successContext.data);
|
|
78119
77524
|
}
|
|
78120
77525
|
}
|
|
78121
|
-
for (const
|
|
78122
|
-
if (
|
|
78123
|
-
await
|
|
77526
|
+
for (const onSuccess2 of hooks.onSuccess) {
|
|
77527
|
+
if (onSuccess2) {
|
|
77528
|
+
await onSuccess2(__spreadProps(__spreadValues({}, successContext), {
|
|
78124
77529
|
response: ((_e = options == null ? undefined : options.hookOptions) == null ? undefined : _e.cloneResponse) ? response.clone() : response
|
|
78125
77530
|
}));
|
|
78126
77531
|
}
|
|
@@ -78146,9 +77551,9 @@ var betterFetch = async (url2, options) => {
|
|
|
78146
77551
|
statusText: response.statusText
|
|
78147
77552
|
})
|
|
78148
77553
|
};
|
|
78149
|
-
for (const
|
|
78150
|
-
if (
|
|
78151
|
-
await
|
|
77554
|
+
for (const onError2 of hooks.onError) {
|
|
77555
|
+
if (onError2) {
|
|
77556
|
+
await onError2(__spreadProps(__spreadValues({}, errorContext), {
|
|
78152
77557
|
response: ((_g = options == null ? undefined : options.hookOptions) == null ? undefined : _g.cloneResponse) ? response.clone() : response
|
|
78153
77558
|
}));
|
|
78154
77559
|
}
|
|
@@ -78181,7 +77586,7 @@ var betterFetch = async (url2, options) => {
|
|
|
78181
77586
|
};
|
|
78182
77587
|
};
|
|
78183
77588
|
|
|
78184
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77589
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/config.mjs
|
|
78185
77590
|
var resolvePublicAuthUrl = (basePath) => {
|
|
78186
77591
|
if (typeof process === "undefined")
|
|
78187
77592
|
return;
|
|
@@ -78291,12 +77696,12 @@ var getClientConfig = (options, loadEnv) => {
|
|
|
78291
77696
|
};
|
|
78292
77697
|
};
|
|
78293
77698
|
|
|
78294
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78295
|
-
function isAtom(
|
|
78296
|
-
return typeof
|
|
77699
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
77700
|
+
function isAtom(value3) {
|
|
77701
|
+
return typeof value3 === "object" && value3 !== null && "get" in value3 && typeof value3.get === "function" && "lc" in value3 && typeof value3.lc === "number";
|
|
78297
77702
|
}
|
|
78298
77703
|
|
|
78299
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77704
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/proxy.mjs
|
|
78300
77705
|
function getMethod2(path3, knownPathMethods, args) {
|
|
78301
77706
|
const method = knownPathMethods[path3];
|
|
78302
77707
|
const { fetchOptions, query: _query, ...body } = args || {};
|
|
@@ -78378,13 +77783,13 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
|
|
|
78378
77783
|
return createProxy();
|
|
78379
77784
|
}
|
|
78380
77785
|
|
|
78381
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77786
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/vanilla.mjs
|
|
78382
77787
|
init_string2();
|
|
78383
77788
|
function createAuthClient(options) {
|
|
78384
77789
|
const { pluginPathMethods, pluginsActions, pluginsAtoms, $fetch, atomListeners, $store } = getClientConfig(options);
|
|
78385
77790
|
const resolvedHooks = {};
|
|
78386
|
-
for (const [key,
|
|
78387
|
-
resolvedHooks[`use${capitalizeFirstLetter(key)}`] =
|
|
77791
|
+
for (const [key, value3] of Object.entries(pluginsAtoms))
|
|
77792
|
+
resolvedHooks[`use${capitalizeFirstLetter(key)}`] = value3;
|
|
78388
77793
|
return createDynamicPathProxy({
|
|
78389
77794
|
...pluginsActions,
|
|
78390
77795
|
...resolvedHooks,
|
|
@@ -78393,7 +77798,7 @@ function createAuthClient(options) {
|
|
|
78393
77798
|
}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);
|
|
78394
77799
|
}
|
|
78395
77800
|
|
|
78396
|
-
// ../../node_modules/.bun/@better-auth+passkey@1.5.
|
|
77801
|
+
// ../../node_modules/.bun/@better-auth+passkey@1.5.4+f08f4e3310502b43/node_modules/@better-auth/passkey/dist/client.mjs
|
|
78397
77802
|
var getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
|
|
78398
77803
|
const signInPasskey = async (opts, options) => {
|
|
78399
77804
|
const response = await $fetch("/passkey/generate-authenticate-options", {
|
|
@@ -78540,7 +77945,7 @@ var passkeyClient = () => {
|
|
|
78540
77945
|
};
|
|
78541
77946
|
};
|
|
78542
77947
|
|
|
78543
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77948
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/additional-fields/client.mjs
|
|
78544
77949
|
var inferAdditionalFields = (schema) => {
|
|
78545
77950
|
return {
|
|
78546
77951
|
id: "additional-fields-client",
|
|
@@ -78548,7 +77953,7 @@ var inferAdditionalFields = (schema) => {
|
|
|
78548
77953
|
};
|
|
78549
77954
|
};
|
|
78550
77955
|
|
|
78551
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77956
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/admin/error-codes.mjs
|
|
78552
77957
|
init_error_codes();
|
|
78553
77958
|
var ADMIN_ERROR_CODES = defineErrorCodes({
|
|
78554
77959
|
FAILED_TO_CREATE_USER: "Failed to create user",
|
|
@@ -78574,7 +77979,7 @@ var ADMIN_ERROR_CODES = defineErrorCodes({
|
|
|
78574
77979
|
INVALID_ROLE_TYPE: "Invalid role type"
|
|
78575
77980
|
});
|
|
78576
77981
|
|
|
78577
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
77982
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/access/access.mjs
|
|
78578
77983
|
init_error2();
|
|
78579
77984
|
function role(statements) {
|
|
78580
77985
|
return {
|
|
@@ -78624,7 +78029,7 @@ function createAccessControl(s) {
|
|
|
78624
78029
|
};
|
|
78625
78030
|
}
|
|
78626
78031
|
|
|
78627
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78032
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/admin/access/statement.mjs
|
|
78628
78033
|
var defaultStatements = {
|
|
78629
78034
|
user: [
|
|
78630
78035
|
"create",
|
|
@@ -78672,7 +78077,7 @@ var defaultRoles = {
|
|
|
78672
78077
|
user: userAc
|
|
78673
78078
|
};
|
|
78674
78079
|
|
|
78675
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78080
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/admin/has-permission.mjs
|
|
78676
78081
|
var hasPermission = (input) => {
|
|
78677
78082
|
if (input.userId && input.options?.adminUserIds?.includes(input.userId))
|
|
78678
78083
|
return true;
|
|
@@ -78686,7 +78091,7 @@ var hasPermission = (input) => {
|
|
|
78686
78091
|
return false;
|
|
78687
78092
|
};
|
|
78688
78093
|
|
|
78689
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78094
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/admin/client.mjs
|
|
78690
78095
|
var adminClient = (options) => {
|
|
78691
78096
|
const roles3 = {
|
|
78692
78097
|
admin: adminAc,
|
|
@@ -78714,7 +78119,7 @@ var adminClient = (options) => {
|
|
|
78714
78119
|
};
|
|
78715
78120
|
};
|
|
78716
78121
|
|
|
78717
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78122
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/anonymous/error-codes.mjs
|
|
78718
78123
|
init_error_codes();
|
|
78719
78124
|
var ANONYMOUS_ERROR_CODES = defineErrorCodes({
|
|
78720
78125
|
INVALID_EMAIL_FORMAT: "Email was not generated in a valid format",
|
|
@@ -78726,7 +78131,7 @@ var ANONYMOUS_ERROR_CODES = defineErrorCodes({
|
|
|
78726
78131
|
DELETE_ANONYMOUS_USER_DISABLED: "Deleting anonymous users is disabled"
|
|
78727
78132
|
});
|
|
78728
78133
|
|
|
78729
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78134
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/client/plugins/infer-plugin.mjs
|
|
78730
78135
|
var InferServerPlugin = () => {
|
|
78731
78136
|
return {
|
|
78732
78137
|
id: "infer-server-plugin",
|
|
@@ -78734,12 +78139,12 @@ var InferServerPlugin = () => {
|
|
|
78734
78139
|
};
|
|
78735
78140
|
};
|
|
78736
78141
|
|
|
78737
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78142
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/custom-session/client.mjs
|
|
78738
78143
|
var customSessionClient = () => {
|
|
78739
78144
|
return InferServerPlugin();
|
|
78740
78145
|
};
|
|
78741
78146
|
|
|
78742
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78147
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/device-authorization/client.mjs
|
|
78743
78148
|
var deviceAuthorizationClient = () => {
|
|
78744
78149
|
return {
|
|
78745
78150
|
id: "device-authorization",
|
|
@@ -78754,7 +78159,7 @@ var deviceAuthorizationClient = () => {
|
|
|
78754
78159
|
};
|
|
78755
78160
|
};
|
|
78756
78161
|
|
|
78757
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78162
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/email-otp/error-codes.mjs
|
|
78758
78163
|
init_error_codes();
|
|
78759
78164
|
var EMAIL_OTP_ERROR_CODES = defineErrorCodes({
|
|
78760
78165
|
OTP_EXPIRED: "OTP expired",
|
|
@@ -78762,7 +78167,7 @@ var EMAIL_OTP_ERROR_CODES = defineErrorCodes({
|
|
|
78762
78167
|
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
78763
78168
|
});
|
|
78764
78169
|
|
|
78765
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78170
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/generic-oauth/error-codes.mjs
|
|
78766
78171
|
init_error_codes();
|
|
78767
78172
|
var GENERIC_OAUTH_ERROR_CODES = defineErrorCodes({
|
|
78768
78173
|
INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration",
|
|
@@ -78775,11 +78180,11 @@ var GENERIC_OAUTH_ERROR_CODES = defineErrorCodes({
|
|
|
78775
78180
|
ISSUER_MISSING: "OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."
|
|
78776
78181
|
});
|
|
78777
78182
|
|
|
78778
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78183
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/multi-session/error-codes.mjs
|
|
78779
78184
|
init_error_codes();
|
|
78780
78185
|
var MULTI_SESSION_ERROR_CODES = defineErrorCodes({ INVALID_SESSION_TOKEN: "Invalid session token" });
|
|
78781
78186
|
|
|
78782
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78187
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/organization/error-codes.mjs
|
|
78783
78188
|
init_error_codes();
|
|
78784
78189
|
var ORGANIZATION_ERROR_CODES = defineErrorCodes({
|
|
78785
78190
|
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
|
|
@@ -78841,7 +78246,7 @@ var ORGANIZATION_ERROR_CODES = defineErrorCodes({
|
|
|
78841
78246
|
ROLE_IS_ASSIGNED_TO_MEMBERS: "Cannot delete a role that is assigned to members. Please reassign the members to a different role first"
|
|
78842
78247
|
});
|
|
78843
78248
|
|
|
78844
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78249
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
|
|
78845
78250
|
var defaultStatements2 = {
|
|
78846
78251
|
organization: ["update", "delete"],
|
|
78847
78252
|
member: [
|
|
@@ -78916,7 +78321,7 @@ var defaultRoles2 = {
|
|
|
78916
78321
|
member: memberAc
|
|
78917
78322
|
};
|
|
78918
78323
|
|
|
78919
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78324
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/organization/permission.mjs
|
|
78920
78325
|
var hasPermissionFn = (input, acRoles) => {
|
|
78921
78326
|
if (!input.permissions)
|
|
78922
78327
|
return false;
|
|
@@ -78932,7 +78337,7 @@ var hasPermissionFn = (input, acRoles) => {
|
|
|
78932
78337
|
return false;
|
|
78933
78338
|
};
|
|
78934
78339
|
|
|
78935
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78340
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/organization/client.mjs
|
|
78936
78341
|
var clientSideHasPermission = (input) => {
|
|
78937
78342
|
return hasPermissionFn(input, input.options.roles || defaultRoles2);
|
|
78938
78343
|
};
|
|
@@ -79022,7 +78427,7 @@ var organizationClient = (options) => {
|
|
|
79022
78427
|
};
|
|
79023
78428
|
};
|
|
79024
78429
|
|
|
79025
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78430
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/phone-number/error-codes.mjs
|
|
79026
78431
|
init_error_codes();
|
|
79027
78432
|
var PHONE_NUMBER_ERROR_CODES = defineErrorCodes({
|
|
79028
78433
|
INVALID_PHONE_NUMBER: "Invalid phone number",
|
|
@@ -79039,7 +78444,7 @@ var PHONE_NUMBER_ERROR_CODES = defineErrorCodes({
|
|
|
79039
78444
|
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
79040
78445
|
});
|
|
79041
78446
|
|
|
79042
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78447
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/two-factor/error-code.mjs
|
|
79043
78448
|
init_error_codes();
|
|
79044
78449
|
var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
79045
78450
|
OTP_NOT_ENABLED: "OTP not enabled",
|
|
@@ -79053,7 +78458,7 @@ var TWO_FACTOR_ERROR_CODES = defineErrorCodes({
|
|
|
79053
78458
|
INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"
|
|
79054
78459
|
});
|
|
79055
78460
|
|
|
79056
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78461
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/two-factor/client.mjs
|
|
79057
78462
|
var twoFactorClient = (options) => {
|
|
79058
78463
|
return {
|
|
79059
78464
|
id: "two-factor",
|
|
@@ -79086,7 +78491,7 @@ var twoFactorClient = (options) => {
|
|
|
79086
78491
|
};
|
|
79087
78492
|
};
|
|
79088
78493
|
|
|
79089
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78494
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/plugins/username/error-codes.mjs
|
|
79090
78495
|
init_error_codes();
|
|
79091
78496
|
var USERNAME_ERROR_CODES = defineErrorCodes({
|
|
79092
78497
|
INVALID_USERNAME_OR_PASSWORD: "Invalid username or password",
|
|
@@ -79099,7 +78504,7 @@ var USERNAME_ERROR_CODES = defineErrorCodes({
|
|
|
79099
78504
|
INVALID_DISPLAY_USERNAME: "Display username is invalid"
|
|
79100
78505
|
});
|
|
79101
78506
|
|
|
79102
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
78507
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/crypto/random.mjs
|
|
79103
78508
|
init_random();
|
|
79104
78509
|
var generateRandomString = createRandomStringGenerator("a-z", "0-9", "A-Z", "-_");
|
|
79105
78510
|
|
|
@@ -79114,17 +78519,17 @@ function anumber2(n, title = "") {
|
|
|
79114
78519
|
throw new Error(`${prefix}expected integer >= 0, got ${n}`);
|
|
79115
78520
|
}
|
|
79116
78521
|
}
|
|
79117
|
-
function abytes2(
|
|
79118
|
-
const bytes = isBytes3(
|
|
79119
|
-
const len =
|
|
78522
|
+
function abytes2(value3, length, title = "") {
|
|
78523
|
+
const bytes = isBytes3(value3);
|
|
78524
|
+
const len = value3?.length;
|
|
79120
78525
|
const needsLen = length !== undefined;
|
|
79121
78526
|
if (!bytes || needsLen && len !== length) {
|
|
79122
78527
|
const prefix = title && `"${title}" `;
|
|
79123
78528
|
const ofLen = needsLen ? ` of length ${length}` : "";
|
|
79124
|
-
const got = bytes ? `length=${len}` : `type=${typeof
|
|
78529
|
+
const got = bytes ? `length=${len}` : `type=${typeof value3}`;
|
|
79125
78530
|
throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
|
|
79126
78531
|
}
|
|
79127
|
-
return
|
|
78532
|
+
return value3;
|
|
79128
78533
|
}
|
|
79129
78534
|
function ahash(h) {
|
|
79130
78535
|
if (typeof h !== "function" || typeof h.create !== "function")
|
|
@@ -79956,23 +79361,23 @@ function concat2(...buffers) {
|
|
|
79956
79361
|
}
|
|
79957
79362
|
return buf;
|
|
79958
79363
|
}
|
|
79959
|
-
function writeUInt32BE(buf,
|
|
79960
|
-
if (
|
|
79961
|
-
throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${
|
|
79364
|
+
function writeUInt32BE(buf, value3, offset) {
|
|
79365
|
+
if (value3 < 0 || value3 >= MAX_INT32) {
|
|
79366
|
+
throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value3}`);
|
|
79962
79367
|
}
|
|
79963
|
-
buf.set([
|
|
79368
|
+
buf.set([value3 >>> 24, value3 >>> 16, value3 >>> 8, value3 & 255], offset);
|
|
79964
79369
|
}
|
|
79965
|
-
function uint64be(
|
|
79966
|
-
const high = Math.floor(
|
|
79967
|
-
const low =
|
|
79370
|
+
function uint64be(value3) {
|
|
79371
|
+
const high = Math.floor(value3 / MAX_INT32);
|
|
79372
|
+
const low = value3 % MAX_INT32;
|
|
79968
79373
|
const buf = new Uint8Array(8);
|
|
79969
79374
|
writeUInt32BE(buf, high, 0);
|
|
79970
79375
|
writeUInt32BE(buf, low, 4);
|
|
79971
79376
|
return buf;
|
|
79972
79377
|
}
|
|
79973
|
-
function uint32be(
|
|
79378
|
+
function uint32be(value3) {
|
|
79974
79379
|
const buf = new Uint8Array(4);
|
|
79975
|
-
writeUInt32BE(buf,
|
|
79380
|
+
writeUInt32BE(buf, value3);
|
|
79976
79381
|
return buf;
|
|
79977
79382
|
}
|
|
79978
79383
|
function encode4(string5) {
|
|
@@ -80497,8 +79902,8 @@ function isDisjoint(...headers) {
|
|
|
80497
79902
|
}
|
|
80498
79903
|
|
|
80499
79904
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/lib/is_object.js
|
|
80500
|
-
var isObjectLike = (
|
|
80501
|
-
function
|
|
79905
|
+
var isObjectLike = (value3) => typeof value3 === "object" && value3 !== null;
|
|
79906
|
+
function isObject4(input) {
|
|
80502
79907
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
|
|
80503
79908
|
return false;
|
|
80504
79909
|
}
|
|
@@ -80796,7 +80201,7 @@ async function jwkToKey(jwk) {
|
|
|
80796
80201
|
|
|
80797
80202
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/key/import.js
|
|
80798
80203
|
async function importJWK(jwk, alg, options) {
|
|
80799
|
-
if (!
|
|
80204
|
+
if (!isObject4(jwk)) {
|
|
80800
80205
|
throw new TypeError("JWK must be an object");
|
|
80801
80206
|
}
|
|
80802
80207
|
let ext;
|
|
@@ -80925,7 +80330,7 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options)
|
|
|
80925
80330
|
case "ECDH-ES+A128KW":
|
|
80926
80331
|
case "ECDH-ES+A192KW":
|
|
80927
80332
|
case "ECDH-ES+A256KW": {
|
|
80928
|
-
if (!
|
|
80333
|
+
if (!isObject4(joseHeader.epk))
|
|
80929
80334
|
throw new JWEInvalid(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);
|
|
80930
80335
|
assertCryptoKey(key);
|
|
80931
80336
|
if (!allowed(key))
|
|
@@ -81067,7 +80472,7 @@ function validateAlgorithms(option, algorithms) {
|
|
|
81067
80472
|
}
|
|
81068
80473
|
|
|
81069
80474
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/lib/is_jwk.js
|
|
81070
|
-
var isJWK = (key) =>
|
|
80475
|
+
var isJWK = (key) => isObject4(key) && typeof key.kty === "string";
|
|
81071
80476
|
var isPrivateJWK = (key) => key.kty !== "oct" && (key.kty === "AKP" && typeof key.priv === "string" || typeof key.d === "string");
|
|
81072
80477
|
var isPublicJWK = (key) => key.kty !== "oct" && key.d === undefined && key.priv === undefined;
|
|
81073
80478
|
var isSecretJWK = (key) => key.kty === "oct" && typeof key.k === "string";
|
|
@@ -81378,10 +80783,10 @@ async function compress(input) {
|
|
|
81378
80783
|
const chunks = [];
|
|
81379
80784
|
const reader = cs.readable.getReader();
|
|
81380
80785
|
for (;; ) {
|
|
81381
|
-
const { value:
|
|
80786
|
+
const { value: value3, done } = await reader.read();
|
|
81382
80787
|
if (done)
|
|
81383
80788
|
break;
|
|
81384
|
-
chunks.push(
|
|
80789
|
+
chunks.push(value3);
|
|
81385
80790
|
}
|
|
81386
80791
|
return concat2(...chunks);
|
|
81387
80792
|
}
|
|
@@ -81395,11 +80800,11 @@ async function decompress(input, maxLength) {
|
|
|
81395
80800
|
let length = 0;
|
|
81396
80801
|
const reader = ds.readable.getReader();
|
|
81397
80802
|
for (;; ) {
|
|
81398
|
-
const { value:
|
|
80803
|
+
const { value: value3, done } = await reader.read();
|
|
81399
80804
|
if (done)
|
|
81400
80805
|
break;
|
|
81401
|
-
chunks.push(
|
|
81402
|
-
length +=
|
|
80806
|
+
chunks.push(value3);
|
|
80807
|
+
length += value3.byteLength;
|
|
81403
80808
|
if (maxLength !== Infinity && length > maxLength) {
|
|
81404
80809
|
throw new JWEInvalid("Decompressed plaintext exceeded the configured limit");
|
|
81405
80810
|
}
|
|
@@ -81409,7 +80814,7 @@ async function decompress(input, maxLength) {
|
|
|
81409
80814
|
|
|
81410
80815
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js
|
|
81411
80816
|
async function flattenedDecrypt(jwe, key, options) {
|
|
81412
|
-
if (!
|
|
80817
|
+
if (!isObject4(jwe)) {
|
|
81413
80818
|
throw new JWEInvalid("Flattened JWE must be an object");
|
|
81414
80819
|
}
|
|
81415
80820
|
if (jwe.protected === undefined && jwe.header === undefined && jwe.unprotected === undefined) {
|
|
@@ -81433,10 +80838,10 @@ async function flattenedDecrypt(jwe, key, options) {
|
|
|
81433
80838
|
if (jwe.aad !== undefined && typeof jwe.aad !== "string") {
|
|
81434
80839
|
throw new JWEInvalid("JWE AAD incorrect type");
|
|
81435
80840
|
}
|
|
81436
|
-
if (jwe.header !== undefined && !
|
|
80841
|
+
if (jwe.header !== undefined && !isObject4(jwe.header)) {
|
|
81437
80842
|
throw new JWEInvalid("JWE Shared Unprotected Header incorrect type");
|
|
81438
80843
|
}
|
|
81439
|
-
if (jwe.unprotected !== undefined && !
|
|
80844
|
+
if (jwe.unprotected !== undefined && !isObject4(jwe.unprotected)) {
|
|
81440
80845
|
throw new JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");
|
|
81441
80846
|
}
|
|
81442
80847
|
let parsedProt;
|
|
@@ -81930,7 +81335,7 @@ async function verify(alg, key, signature, data2) {
|
|
|
81930
81335
|
|
|
81931
81336
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/jws/flattened/verify.js
|
|
81932
81337
|
async function flattenedVerify(jws, key, options) {
|
|
81933
|
-
if (!
|
|
81338
|
+
if (!isObject4(jws)) {
|
|
81934
81339
|
throw new JWSInvalid("Flattened JWS must be an object");
|
|
81935
81340
|
}
|
|
81936
81341
|
if (jws.protected === undefined && jws.header === undefined) {
|
|
@@ -81945,7 +81350,7 @@ async function flattenedVerify(jws, key, options) {
|
|
|
81945
81350
|
if (typeof jws.signature !== "string") {
|
|
81946
81351
|
throw new JWSInvalid("JWS Signature missing or incorrect type");
|
|
81947
81352
|
}
|
|
81948
|
-
if (jws.header !== undefined && !
|
|
81353
|
+
if (jws.header !== undefined && !isObject4(jws.header)) {
|
|
81949
81354
|
throw new JWSInvalid("JWS Unprotected Header incorrect type");
|
|
81950
81355
|
}
|
|
81951
81356
|
let parsedProt = {};
|
|
@@ -82063,7 +81468,7 @@ function secs(str) {
|
|
|
82063
81468
|
if (!matched || matched[4] && matched[1]) {
|
|
82064
81469
|
throw new TypeError("Invalid time period format");
|
|
82065
81470
|
}
|
|
82066
|
-
const
|
|
81471
|
+
const value3 = parseFloat(matched[2]);
|
|
82067
81472
|
const unit = matched[3].toLowerCase();
|
|
82068
81473
|
let numericDate;
|
|
82069
81474
|
switch (unit) {
|
|
@@ -82072,34 +81477,34 @@ function secs(str) {
|
|
|
82072
81477
|
case "second":
|
|
82073
81478
|
case "seconds":
|
|
82074
81479
|
case "s":
|
|
82075
|
-
numericDate = Math.round(
|
|
81480
|
+
numericDate = Math.round(value3);
|
|
82076
81481
|
break;
|
|
82077
81482
|
case "minute":
|
|
82078
81483
|
case "minutes":
|
|
82079
81484
|
case "min":
|
|
82080
81485
|
case "mins":
|
|
82081
81486
|
case "m":
|
|
82082
|
-
numericDate = Math.round(
|
|
81487
|
+
numericDate = Math.round(value3 * minute);
|
|
82083
81488
|
break;
|
|
82084
81489
|
case "hour":
|
|
82085
81490
|
case "hours":
|
|
82086
81491
|
case "hr":
|
|
82087
81492
|
case "hrs":
|
|
82088
81493
|
case "h":
|
|
82089
|
-
numericDate = Math.round(
|
|
81494
|
+
numericDate = Math.round(value3 * hour);
|
|
82090
81495
|
break;
|
|
82091
81496
|
case "day":
|
|
82092
81497
|
case "days":
|
|
82093
81498
|
case "d":
|
|
82094
|
-
numericDate = Math.round(
|
|
81499
|
+
numericDate = Math.round(value3 * day);
|
|
82095
81500
|
break;
|
|
82096
81501
|
case "week":
|
|
82097
81502
|
case "weeks":
|
|
82098
81503
|
case "w":
|
|
82099
|
-
numericDate = Math.round(
|
|
81504
|
+
numericDate = Math.round(value3 * week);
|
|
82100
81505
|
break;
|
|
82101
81506
|
default:
|
|
82102
|
-
numericDate = Math.round(
|
|
81507
|
+
numericDate = Math.round(value3 * year);
|
|
82103
81508
|
break;
|
|
82104
81509
|
}
|
|
82105
81510
|
if (matched[1] === "-" || matched[4] === "ago") {
|
|
@@ -82113,11 +81518,11 @@ function validateInput2(label, input) {
|
|
|
82113
81518
|
}
|
|
82114
81519
|
return input;
|
|
82115
81520
|
}
|
|
82116
|
-
var normalizeTyp = (
|
|
82117
|
-
if (
|
|
82118
|
-
return
|
|
81521
|
+
var normalizeTyp = (value3) => {
|
|
81522
|
+
if (value3.includes("/")) {
|
|
81523
|
+
return value3.toLowerCase();
|
|
82119
81524
|
}
|
|
82120
|
-
return `application/${
|
|
81525
|
+
return `application/${value3.toLowerCase()}`;
|
|
82121
81526
|
};
|
|
82122
81527
|
var checkAudiencePresence = (audPayload, audOption) => {
|
|
82123
81528
|
if (typeof audPayload === "string") {
|
|
@@ -82133,7 +81538,7 @@ function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
|
82133
81538
|
try {
|
|
82134
81539
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
82135
81540
|
} catch {}
|
|
82136
|
-
if (!
|
|
81541
|
+
if (!isObject4(payload)) {
|
|
82137
81542
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
82138
81543
|
}
|
|
82139
81544
|
const { typ } = options;
|
|
@@ -82215,7 +81620,7 @@ function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
|
82215
81620
|
class JWTClaimsBuilder {
|
|
82216
81621
|
#payload;
|
|
82217
81622
|
constructor(payload) {
|
|
82218
|
-
if (!
|
|
81623
|
+
if (!isObject4(payload)) {
|
|
82219
81624
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
82220
81625
|
}
|
|
82221
81626
|
this.#payload = structuredClone(payload);
|
|
@@ -82226,51 +81631,51 @@ class JWTClaimsBuilder {
|
|
|
82226
81631
|
get iss() {
|
|
82227
81632
|
return this.#payload.iss;
|
|
82228
81633
|
}
|
|
82229
|
-
set iss(
|
|
82230
|
-
this.#payload.iss =
|
|
81634
|
+
set iss(value3) {
|
|
81635
|
+
this.#payload.iss = value3;
|
|
82231
81636
|
}
|
|
82232
81637
|
get sub() {
|
|
82233
81638
|
return this.#payload.sub;
|
|
82234
81639
|
}
|
|
82235
|
-
set sub(
|
|
82236
|
-
this.#payload.sub =
|
|
81640
|
+
set sub(value3) {
|
|
81641
|
+
this.#payload.sub = value3;
|
|
82237
81642
|
}
|
|
82238
81643
|
get aud() {
|
|
82239
81644
|
return this.#payload.aud;
|
|
82240
81645
|
}
|
|
82241
|
-
set aud(
|
|
82242
|
-
this.#payload.aud =
|
|
81646
|
+
set aud(value3) {
|
|
81647
|
+
this.#payload.aud = value3;
|
|
82243
81648
|
}
|
|
82244
|
-
set jti(
|
|
82245
|
-
this.#payload.jti =
|
|
81649
|
+
set jti(value3) {
|
|
81650
|
+
this.#payload.jti = value3;
|
|
82246
81651
|
}
|
|
82247
|
-
set nbf(
|
|
82248
|
-
if (typeof
|
|
82249
|
-
this.#payload.nbf = validateInput2("setNotBefore",
|
|
82250
|
-
} else if (
|
|
82251
|
-
this.#payload.nbf = validateInput2("setNotBefore", epoch2(
|
|
81652
|
+
set nbf(value3) {
|
|
81653
|
+
if (typeof value3 === "number") {
|
|
81654
|
+
this.#payload.nbf = validateInput2("setNotBefore", value3);
|
|
81655
|
+
} else if (value3 instanceof Date) {
|
|
81656
|
+
this.#payload.nbf = validateInput2("setNotBefore", epoch2(value3));
|
|
82252
81657
|
} else {
|
|
82253
|
-
this.#payload.nbf = epoch2(new Date) + secs(
|
|
81658
|
+
this.#payload.nbf = epoch2(new Date) + secs(value3);
|
|
82254
81659
|
}
|
|
82255
81660
|
}
|
|
82256
|
-
set exp(
|
|
82257
|
-
if (typeof
|
|
82258
|
-
this.#payload.exp = validateInput2("setExpirationTime",
|
|
82259
|
-
} else if (
|
|
82260
|
-
this.#payload.exp = validateInput2("setExpirationTime", epoch2(
|
|
81661
|
+
set exp(value3) {
|
|
81662
|
+
if (typeof value3 === "number") {
|
|
81663
|
+
this.#payload.exp = validateInput2("setExpirationTime", value3);
|
|
81664
|
+
} else if (value3 instanceof Date) {
|
|
81665
|
+
this.#payload.exp = validateInput2("setExpirationTime", epoch2(value3));
|
|
82261
81666
|
} else {
|
|
82262
|
-
this.#payload.exp = epoch2(new Date) + secs(
|
|
81667
|
+
this.#payload.exp = epoch2(new Date) + secs(value3);
|
|
82263
81668
|
}
|
|
82264
81669
|
}
|
|
82265
|
-
set iat(
|
|
82266
|
-
if (
|
|
81670
|
+
set iat(value3) {
|
|
81671
|
+
if (value3 === undefined) {
|
|
82267
81672
|
this.#payload.iat = epoch2(new Date);
|
|
82268
|
-
} else if (
|
|
82269
|
-
this.#payload.iat = validateInput2("setIssuedAt", epoch2(
|
|
82270
|
-
} else if (typeof
|
|
82271
|
-
this.#payload.iat = validateInput2("setIssuedAt", epoch2(new Date) + secs(
|
|
81673
|
+
} else if (value3 instanceof Date) {
|
|
81674
|
+
this.#payload.iat = validateInput2("setIssuedAt", epoch2(value3));
|
|
81675
|
+
} else if (typeof value3 === "string") {
|
|
81676
|
+
this.#payload.iat = validateInput2("setIssuedAt", epoch2(new Date) + secs(value3));
|
|
82272
81677
|
} else {
|
|
82273
|
-
this.#payload.iat = validateInput2("setIssuedAt",
|
|
81678
|
+
this.#payload.iat = validateInput2("setIssuedAt", value3);
|
|
82274
81679
|
}
|
|
82275
81680
|
}
|
|
82276
81681
|
}
|
|
@@ -82600,8 +82005,8 @@ class EncryptJWT {
|
|
|
82600
82005
|
}
|
|
82601
82006
|
}
|
|
82602
82007
|
// ../../node_modules/.bun/jose@6.2.0/node_modules/jose/dist/webapi/jwk/thumbprint.js
|
|
82603
|
-
var check2 = (
|
|
82604
|
-
if (typeof
|
|
82008
|
+
var check2 = (value3, description) => {
|
|
82009
|
+
if (typeof value3 !== "string" || !value3) {
|
|
82605
82010
|
throw new JWKInvalid(`${description} missing or invalid`);
|
|
82606
82011
|
}
|
|
82607
82012
|
};
|
|
@@ -82671,7 +82076,7 @@ function isJWKSLike(jwks) {
|
|
|
82671
82076
|
return jwks && typeof jwks === "object" && Array.isArray(jwks.keys) && jwks.keys.every(isJWKLike);
|
|
82672
82077
|
}
|
|
82673
82078
|
function isJWKLike(key) {
|
|
82674
|
-
return
|
|
82079
|
+
return isObject4(key);
|
|
82675
82080
|
}
|
|
82676
82081
|
|
|
82677
82082
|
class LocalJWKSet {
|
|
@@ -82806,7 +82211,7 @@ function isFreshJwksCache(input, cacheMaxAge) {
|
|
|
82806
82211
|
if (!("uat" in input) || typeof input.uat !== "number" || Date.now() - input.uat >= cacheMaxAge) {
|
|
82807
82212
|
return false;
|
|
82808
82213
|
}
|
|
82809
|
-
if (!("jwks" in input) || !
|
|
82214
|
+
if (!("jwks" in input) || !isObject4(input.jwks) || !Array.isArray(input.jwks.keys) || !Array.prototype.every.call(input.jwks.keys, isObject4)) {
|
|
82810
82215
|
return false;
|
|
82811
82216
|
}
|
|
82812
82217
|
return true;
|
|
@@ -82949,7 +82354,7 @@ function decodeProtectedHeader(token) {
|
|
|
82949
82354
|
throw new Error;
|
|
82950
82355
|
}
|
|
82951
82356
|
const result = JSON.parse(decoder.decode(decode3(protectedB64u)));
|
|
82952
|
-
if (!
|
|
82357
|
+
if (!isObject4(result)) {
|
|
82953
82358
|
throw new Error;
|
|
82954
82359
|
}
|
|
82955
82360
|
return result;
|
|
@@ -82980,11 +82385,11 @@ function decodeJwt(jwt2) {
|
|
|
82980
82385
|
} catch {
|
|
82981
82386
|
throw new JWTInvalid("Failed to parse the decoded payload as JSON");
|
|
82982
82387
|
}
|
|
82983
|
-
if (!
|
|
82388
|
+
if (!isObject4(result))
|
|
82984
82389
|
throw new JWTInvalid("Invalid JWT Claims Set");
|
|
82985
82390
|
return result;
|
|
82986
82391
|
}
|
|
82987
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
82392
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/crypto/jwt.mjs
|
|
82988
82393
|
async function signJWT(payload, secret, expiresIn = 3600) {
|
|
82989
82394
|
return await new SignJWT(payload).setProtectedHeader({ alg: "HS256" }).setIssuedAt().setExpirationTime(Math.floor(Date.now() / 1000) + expiresIn).sign(new TextEncoder().encode(secret));
|
|
82990
82395
|
}
|
|
@@ -83044,10 +82449,10 @@ function deriveEncryptionSecret(secret, salt) {
|
|
|
83044
82449
|
function getCurrentSecret(secret) {
|
|
83045
82450
|
if (typeof secret === "string")
|
|
83046
82451
|
return secret;
|
|
83047
|
-
const
|
|
83048
|
-
if (!
|
|
82452
|
+
const value3 = secret.keys.get(secret.currentVersion);
|
|
82453
|
+
if (!value3)
|
|
83049
82454
|
throw new Error(`Secret version ${secret.currentVersion} not found in keys`);
|
|
83050
|
-
return
|
|
82455
|
+
return value3;
|
|
83051
82456
|
}
|
|
83052
82457
|
function getAllSecrets(secret) {
|
|
83053
82458
|
if (typeof secret === "string")
|
|
@@ -83056,10 +82461,10 @@ function getAllSecrets(secret) {
|
|
|
83056
82461
|
value: secret
|
|
83057
82462
|
}];
|
|
83058
82463
|
const result = [];
|
|
83059
|
-
for (const [version3,
|
|
82464
|
+
for (const [version3, value3] of secret.keys)
|
|
83060
82465
|
result.push({
|
|
83061
82466
|
version: version3,
|
|
83062
|
-
value:
|
|
82467
|
+
value: value3
|
|
83063
82468
|
});
|
|
83064
82469
|
if (secret.legacySecret && !result.some((s) => s.value === secret.legacySecret))
|
|
83065
82470
|
result.push({
|
|
@@ -83132,7 +82537,7 @@ async function symmetricDecodeJWT(token, secret, salt) {
|
|
|
83132
82537
|
}
|
|
83133
82538
|
}
|
|
83134
82539
|
|
|
83135
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
82540
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/crypto/password.mjs
|
|
83136
82541
|
init_error2();
|
|
83137
82542
|
|
|
83138
82543
|
// ../../node_modules/.bun/@better-auth+utils@0.3.1/node_modules/@better-auth/utils/dist/hex.mjs
|
|
@@ -83209,11 +82614,11 @@ function base64Decode(data2, alphabet) {
|
|
|
83209
82614
|
for (const char of data2) {
|
|
83210
82615
|
if (char === "=")
|
|
83211
82616
|
break;
|
|
83212
|
-
const
|
|
83213
|
-
if (
|
|
82617
|
+
const value3 = decodeMap.get(char);
|
|
82618
|
+
if (value3 === undefined) {
|
|
83214
82619
|
throw new Error(`Invalid Base64 character: ${char}`);
|
|
83215
82620
|
}
|
|
83216
|
-
buffer = buffer << 6 |
|
|
82621
|
+
buffer = buffer << 6 | value3;
|
|
83217
82622
|
bitsCollected += 6;
|
|
83218
82623
|
if (bitsCollected >= 8) {
|
|
83219
82624
|
bitsCollected -= 8;
|
|
@@ -83297,17 +82702,17 @@ function anumber3(n) {
|
|
|
83297
82702
|
if (!Number.isSafeInteger(n) || n < 0)
|
|
83298
82703
|
throw new Error("positive integer expected, got " + n);
|
|
83299
82704
|
}
|
|
83300
|
-
function abytes3(
|
|
83301
|
-
const bytes = isBytes4(
|
|
83302
|
-
const len =
|
|
82705
|
+
function abytes3(value3, length, title = "") {
|
|
82706
|
+
const bytes = isBytes4(value3);
|
|
82707
|
+
const len = value3?.length;
|
|
83303
82708
|
const needsLen = length !== undefined;
|
|
83304
82709
|
if (!bytes || needsLen && len !== length) {
|
|
83305
82710
|
const prefix = title && `"${title}" `;
|
|
83306
82711
|
const ofLen = needsLen ? ` of length ${length}` : "";
|
|
83307
|
-
const got = bytes ? `length=${len}` : `type=${typeof
|
|
82712
|
+
const got = bytes ? `length=${len}` : `type=${typeof value3}`;
|
|
83308
82713
|
throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
|
|
83309
82714
|
}
|
|
83310
|
-
return
|
|
82715
|
+
return value3;
|
|
83311
82716
|
}
|
|
83312
82717
|
function aexists3(instance, checkFinished = true) {
|
|
83313
82718
|
if (instance.destroyed)
|
|
@@ -84104,7 +83509,7 @@ var _poly1305_aead = (xorStream) => (key, nonce3, AAD) => {
|
|
|
84104
83509
|
var chacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 12, tagLength: 16 }, _poly1305_aead(chacha20));
|
|
84105
83510
|
var xchacha20poly1305 = /* @__PURE__ */ wrapCipher({ blockSize: 64, nonceLength: 24, tagLength: 16 }, _poly1305_aead(xchacha20));
|
|
84106
83511
|
|
|
84107
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83512
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/crypto/index.mjs
|
|
84108
83513
|
var ENVELOPE_PREFIX = "$ba$";
|
|
84109
83514
|
function parseEnvelope(data2) {
|
|
84110
83515
|
if (!data2.startsWith(ENVELOPE_PREFIX))
|
|
@@ -84159,12 +83564,12 @@ var symmetricDecrypt = async ({ key, data: data2 }) => {
|
|
|
84159
83564
|
throw new Error("Cannot decrypt legacy bare-hex payload: no legacy secret available. Set BETTER_AUTH_SECRET for backwards compatibility.");
|
|
84160
83565
|
};
|
|
84161
83566
|
|
|
84162
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83567
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/date.mjs
|
|
84163
83568
|
var getDate = (span, unit = "ms") => {
|
|
84164
83569
|
return new Date(Date.now() + (unit === "sec" ? span * 1000 : span));
|
|
84165
83570
|
};
|
|
84166
83571
|
|
|
84167
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83572
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/index.mjs
|
|
84168
83573
|
init_get_tables();
|
|
84169
83574
|
var exports_db = {};
|
|
84170
83575
|
__export(exports_db, {
|
|
@@ -84177,7 +83582,7 @@ __export(exports_db, {
|
|
|
84177
83582
|
accountSchema: () => accountSchema
|
|
84178
83583
|
});
|
|
84179
83584
|
|
|
84180
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83585
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/shared.mjs
|
|
84181
83586
|
init_zod();
|
|
84182
83587
|
var coreSchema = object({
|
|
84183
83588
|
id: string2(),
|
|
@@ -84185,7 +83590,7 @@ var coreSchema = object({
|
|
|
84185
83590
|
updatedAt: date3().default(() => /* @__PURE__ */ new Date)
|
|
84186
83591
|
});
|
|
84187
83592
|
|
|
84188
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83593
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/account.mjs
|
|
84189
83594
|
init_zod();
|
|
84190
83595
|
var accountSchema = coreSchema.extend({
|
|
84191
83596
|
providerId: string2(),
|
|
@@ -84200,7 +83605,7 @@ var accountSchema = coreSchema.extend({
|
|
|
84200
83605
|
password: string2().nullish()
|
|
84201
83606
|
});
|
|
84202
83607
|
|
|
84203
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83608
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/rate-limit.mjs
|
|
84204
83609
|
init_zod();
|
|
84205
83610
|
var rateLimitSchema = object({
|
|
84206
83611
|
key: string2(),
|
|
@@ -84208,7 +83613,7 @@ var rateLimitSchema = object({
|
|
|
84208
83613
|
lastRequest: number2()
|
|
84209
83614
|
});
|
|
84210
83615
|
|
|
84211
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83616
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/session.mjs
|
|
84212
83617
|
init_zod();
|
|
84213
83618
|
var sessionSchema = coreSchema.extend({
|
|
84214
83619
|
userId: exports_coerce.string(),
|
|
@@ -84218,7 +83623,7 @@ var sessionSchema = coreSchema.extend({
|
|
|
84218
83623
|
userAgent: string2().nullish()
|
|
84219
83624
|
});
|
|
84220
83625
|
|
|
84221
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83626
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/user.mjs
|
|
84222
83627
|
init_zod();
|
|
84223
83628
|
var userSchema = coreSchema.extend({
|
|
84224
83629
|
email: string2().transform((val) => val.toLowerCase()),
|
|
@@ -84227,7 +83632,7 @@ var userSchema = coreSchema.extend({
|
|
|
84227
83632
|
image: string2().nullish()
|
|
84228
83633
|
});
|
|
84229
83634
|
|
|
84230
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83635
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/db/schema/verification.mjs
|
|
84231
83636
|
init_zod();
|
|
84232
83637
|
var verificationSchema = coreSchema.extend({
|
|
84233
83638
|
value: string2(),
|
|
@@ -84235,21 +83640,21 @@ var verificationSchema = coreSchema.extend({
|
|
|
84235
83640
|
identifier: string2()
|
|
84236
83641
|
});
|
|
84237
83642
|
|
|
84238
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83643
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/schema.mjs
|
|
84239
83644
|
init_error2();
|
|
84240
83645
|
|
|
84241
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
83646
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/db.mjs
|
|
84242
83647
|
function filterOutputFields(data2, additionalFields) {
|
|
84243
83648
|
if (!data2 || !additionalFields)
|
|
84244
83649
|
return data2;
|
|
84245
83650
|
const returnFiltered = Object.entries(additionalFields).filter(([, { returned }]) => returned === false).map(([key]) => key);
|
|
84246
|
-
return Object.entries(structuredClone(data2)).filter(([key]) => !returnFiltered.includes(key)).reduce((acc, [key,
|
|
83651
|
+
return Object.entries(structuredClone(data2)).filter(([key]) => !returnFiltered.includes(key)).reduce((acc, [key, value3]) => ({
|
|
84247
83652
|
...acc,
|
|
84248
|
-
[key]:
|
|
83653
|
+
[key]: value3
|
|
84249
83654
|
}), {});
|
|
84250
83655
|
}
|
|
84251
83656
|
|
|
84252
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83657
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/schema.mjs
|
|
84253
83658
|
var cache2 = /* @__PURE__ */ new WeakMap;
|
|
84254
83659
|
function getFields(options, modelName, mode) {
|
|
84255
83660
|
const cacheKey = `${modelName}:${mode}`;
|
|
@@ -84382,12 +83787,12 @@ function mergeSchema(schema, newSchema) {
|
|
|
84382
83787
|
return schema;
|
|
84383
83788
|
}
|
|
84384
83789
|
|
|
84385
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83790
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/is-promise.mjs
|
|
84386
83791
|
function isPromise(obj) {
|
|
84387
83792
|
return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
|
|
84388
83793
|
}
|
|
84389
83794
|
|
|
84390
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83795
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/cookies/session-store.mjs
|
|
84391
83796
|
init_json();
|
|
84392
83797
|
init_zod();
|
|
84393
83798
|
var ALLOWED_COOKIE_SIZE = 4096;
|
|
@@ -84415,9 +83820,9 @@ function getChunkIndex(cookieName) {
|
|
|
84415
83820
|
function readExistingChunks(cookieName, ctx) {
|
|
84416
83821
|
const chunks = {};
|
|
84417
83822
|
const cookies = parseCookiesFromContext(ctx);
|
|
84418
|
-
for (const [name,
|
|
83823
|
+
for (const [name, value3] of Object.entries(cookies))
|
|
84419
83824
|
if (name.startsWith(cookieName))
|
|
84420
|
-
chunks[name] =
|
|
83825
|
+
chunks[name] = value3;
|
|
84421
83826
|
return chunks;
|
|
84422
83827
|
}
|
|
84423
83828
|
function joinChunks(chunks) {
|
|
@@ -84435,13 +83840,13 @@ function chunkCookie(storeName, cookie, chunks, logger2) {
|
|
|
84435
83840
|
for (let i = 0;i < chunkCount; i++) {
|
|
84436
83841
|
const name = `${cookie.name}.${i}`;
|
|
84437
83842
|
const start = i * CHUNK_SIZE;
|
|
84438
|
-
const
|
|
83843
|
+
const value3 = cookie.value.substring(start, start + CHUNK_SIZE);
|
|
84439
83844
|
cookies.push({
|
|
84440
83845
|
...cookie,
|
|
84441
83846
|
name,
|
|
84442
|
-
value:
|
|
83847
|
+
value: value3
|
|
84443
83848
|
});
|
|
84444
|
-
chunks[name] =
|
|
83849
|
+
chunks[name] = value3;
|
|
84445
83850
|
}
|
|
84446
83851
|
logger2.debug(`CHUNKING_${storeName.toUpperCase()}_COOKIE`, {
|
|
84447
83852
|
message: `${storeName} cookie exceeds allowed ${ALLOWED_COOKIE_SIZE} bytes.`,
|
|
@@ -84475,14 +83880,14 @@ var storeFactory = (storeName) => (cookieName, cookieOptions, ctx) => {
|
|
|
84475
83880
|
hasChunks() {
|
|
84476
83881
|
return Object.keys(chunks).length > 0;
|
|
84477
83882
|
},
|
|
84478
|
-
chunk(
|
|
83883
|
+
chunk(value3, options) {
|
|
84479
83884
|
const cleanedChunks = getCleanCookies(chunks, cookieOptions);
|
|
84480
83885
|
for (const name in chunks)
|
|
84481
83886
|
delete chunks[name];
|
|
84482
83887
|
const cookies = cleanedChunks;
|
|
84483
83888
|
const chunked = chunkCookie(storeName, {
|
|
84484
83889
|
name: cookieName,
|
|
84485
|
-
value:
|
|
83890
|
+
value: value3,
|
|
84486
83891
|
attributes: {
|
|
84487
83892
|
...cookieOptions,
|
|
84488
83893
|
...options
|
|
@@ -84507,9 +83912,9 @@ var storeFactory = (storeName) => (cookieName, cookieOptions, ctx) => {
|
|
|
84507
83912
|
var createSessionStore = storeFactory("Session");
|
|
84508
83913
|
var createAccountStore = storeFactory("Account");
|
|
84509
83914
|
function getChunkedCookie(ctx, cookieName) {
|
|
84510
|
-
const
|
|
84511
|
-
if (
|
|
84512
|
-
return
|
|
83915
|
+
const value3 = ctx.getCookie(cookieName);
|
|
83916
|
+
if (value3)
|
|
83917
|
+
return value3;
|
|
84513
83918
|
const chunks = [];
|
|
84514
83919
|
const cookieHeader = ctx.headers?.get("cookie");
|
|
84515
83920
|
if (!cookieHeader)
|
|
@@ -84571,7 +83976,7 @@ var getSessionQuerySchema = optional(object({
|
|
|
84571
83976
|
disableRefresh: exports_coerce.boolean().meta({ description: "Disable session refresh. Useful for checking session status, without updating the session" }).optional()
|
|
84572
83977
|
}));
|
|
84573
83978
|
|
|
84574
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83979
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/time.mjs
|
|
84575
83980
|
var SEC = 1000;
|
|
84576
83981
|
var MIN = SEC * 60;
|
|
84577
83982
|
var HOUR = MIN * 60;
|
|
@@ -84580,7 +83985,7 @@ var WEEK = DAY * 7;
|
|
|
84580
83985
|
var MONTH = DAY * 30;
|
|
84581
83986
|
var YEAR = DAY * 365.25;
|
|
84582
83987
|
|
|
84583
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
83988
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/cookies/index.mjs
|
|
84584
83989
|
init_env();
|
|
84585
83990
|
init_error2();
|
|
84586
83991
|
init_json();
|
|
@@ -84636,7 +84041,7 @@ var createHMAC = (algorithm = "SHA-256", encoding = "none") => {
|
|
|
84636
84041
|
return hmac2;
|
|
84637
84042
|
};
|
|
84638
84043
|
|
|
84639
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84044
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/cookies/index.mjs
|
|
84640
84045
|
async function setCookieCache(ctx, session, dontRememberMe) {
|
|
84641
84046
|
if (!ctx.context.options.session?.cookieCache?.enabled)
|
|
84642
84047
|
return;
|
|
@@ -84735,7 +84140,7 @@ function deleteSessionCookie(ctx, skipDontRememberMe) {
|
|
|
84735
84140
|
expireCookie(ctx, ctx.context.authCookies.dontRememberToken);
|
|
84736
84141
|
}
|
|
84737
84142
|
|
|
84738
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84143
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/state.mjs
|
|
84739
84144
|
init_error2();
|
|
84740
84145
|
init_zod();
|
|
84741
84146
|
var stateDataSchema = looseObject({
|
|
@@ -84840,11 +84245,11 @@ async function parseGenericState(c, state, settings) {
|
|
|
84840
84245
|
return parsedData;
|
|
84841
84246
|
}
|
|
84842
84247
|
|
|
84843
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
84248
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/context/global.mjs
|
|
84844
84249
|
var symbol2 = Symbol.for("better-auth:global");
|
|
84845
84250
|
var bind = null;
|
|
84846
84251
|
var __context = {};
|
|
84847
|
-
var __betterAuthVersion = "1.5.
|
|
84252
|
+
var __betterAuthVersion = "1.5.4";
|
|
84848
84253
|
function __getBetterAuthGlobal() {
|
|
84849
84254
|
if (!globalThis[symbol2]) {
|
|
84850
84255
|
globalThis[symbol2] = {
|
|
@@ -84862,7 +84267,7 @@ function __getBetterAuthGlobal() {
|
|
|
84862
84267
|
return globalThis[symbol2];
|
|
84863
84268
|
}
|
|
84864
84269
|
|
|
84865
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
84270
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/async_hooks/index.mjs
|
|
84866
84271
|
var AsyncLocalStoragePromise = import("node:async_hooks").then((mod) => mod.AsyncLocalStorage).catch((err) => {
|
|
84867
84272
|
if ("AsyncLocalStorage" in globalThis)
|
|
84868
84273
|
return globalThis.AsyncLocalStorage;
|
|
@@ -84881,7 +84286,7 @@ async function getAsyncLocalStorage() {
|
|
|
84881
84286
|
return mod;
|
|
84882
84287
|
}
|
|
84883
84288
|
|
|
84884
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
84289
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/context/endpoint-context.mjs
|
|
84885
84290
|
var ensureAsyncStorage = async () => {
|
|
84886
84291
|
const betterAuthGlobal = __getBetterAuthGlobal();
|
|
84887
84292
|
if (!betterAuthGlobal.context.endpointContextAsyncStorage) {
|
|
@@ -84900,7 +84305,7 @@ async function runWithEndpointContext(context, fn) {
|
|
|
84900
84305
|
return (await ensureAsyncStorage()).run(context, fn);
|
|
84901
84306
|
}
|
|
84902
84307
|
|
|
84903
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
84308
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/context/request-state.mjs
|
|
84904
84309
|
var ensureAsyncStorage2 = async () => {
|
|
84905
84310
|
const betterAuthGlobal = __getBetterAuthGlobal();
|
|
84906
84311
|
if (!betterAuthGlobal.context.requestStateAsyncStorage) {
|
|
@@ -84930,13 +84335,13 @@ function defineRequestState(initFn) {
|
|
|
84930
84335
|
}
|
|
84931
84336
|
return store.get(ref);
|
|
84932
84337
|
},
|
|
84933
|
-
async set(
|
|
84934
|
-
(await getCurrentRequestState()).set(ref,
|
|
84338
|
+
async set(value3) {
|
|
84339
|
+
(await getCurrentRequestState()).set(ref, value3);
|
|
84935
84340
|
}
|
|
84936
84341
|
};
|
|
84937
84342
|
}
|
|
84938
84343
|
|
|
84939
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
84344
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/context/transaction.mjs
|
|
84940
84345
|
var ensureAsyncStorage3 = async () => {
|
|
84941
84346
|
const betterAuthGlobal = __getBetterAuthGlobal();
|
|
84942
84347
|
if (!betterAuthGlobal.context.adapterAsyncStorage) {
|
|
@@ -84994,10 +84399,10 @@ var queueAfterTransactionHook = async (hook) => {
|
|
|
84994
84399
|
});
|
|
84995
84400
|
};
|
|
84996
84401
|
|
|
84997
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84402
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/state/oauth.mjs
|
|
84998
84403
|
var { get: getOAuthState, set: setOAuthState } = defineRequestState(() => null);
|
|
84999
84404
|
|
|
85000
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84405
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/oauth2/state.mjs
|
|
85001
84406
|
init_error2();
|
|
85002
84407
|
async function generateState(c, link, additionalData) {
|
|
85003
84408
|
const callbackURL = c.body?.callbackURL || c.context.options.baseURL;
|
|
@@ -85044,10 +84449,10 @@ async function parseState(c) {
|
|
|
85044
84449
|
return parsedData;
|
|
85045
84450
|
}
|
|
85046
84451
|
|
|
85047
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84452
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/hide-metadata.mjs
|
|
85048
84453
|
var HIDE_METADATA = { scope: "server" };
|
|
85049
84454
|
|
|
85050
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
84455
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/is-api-error.mjs
|
|
85051
84456
|
init_error2();
|
|
85052
84457
|
|
|
85053
84458
|
// ../../node_modules/.bun/better-call@1.3.2+3c5d820c62823f0b/node_modules/better-call/dist/index.mjs
|
|
@@ -85086,47 +84491,47 @@ function isRequest(obj) {
|
|
|
85086
84491
|
}
|
|
85087
84492
|
|
|
85088
84493
|
// ../../node_modules/.bun/better-call@1.3.2+3c5d820c62823f0b/node_modules/better-call/dist/to-response.mjs
|
|
85089
|
-
function isJSONSerializable2(
|
|
85090
|
-
if (
|
|
84494
|
+
function isJSONSerializable2(value3) {
|
|
84495
|
+
if (value3 === undefined)
|
|
85091
84496
|
return false;
|
|
85092
|
-
const t = typeof
|
|
84497
|
+
const t = typeof value3;
|
|
85093
84498
|
if (t === "string" || t === "number" || t === "boolean" || t === null)
|
|
85094
84499
|
return true;
|
|
85095
84500
|
if (t !== "object")
|
|
85096
84501
|
return false;
|
|
85097
|
-
if (Array.isArray(
|
|
84502
|
+
if (Array.isArray(value3))
|
|
85098
84503
|
return true;
|
|
85099
|
-
if (
|
|
84504
|
+
if (value3.buffer)
|
|
85100
84505
|
return false;
|
|
85101
|
-
return
|
|
84506
|
+
return value3.constructor && value3.constructor.name === "Object" || typeof value3.toJSON === "function";
|
|
85102
84507
|
}
|
|
85103
84508
|
function safeStringify(obj, replacer, space) {
|
|
85104
84509
|
let id = 0;
|
|
85105
84510
|
const seen = /* @__PURE__ */ new WeakMap;
|
|
85106
|
-
const safeReplacer = (key,
|
|
85107
|
-
if (typeof
|
|
85108
|
-
return
|
|
85109
|
-
if (typeof
|
|
85110
|
-
if (seen.has(
|
|
85111
|
-
return `[Circular ref-${seen.get(
|
|
85112
|
-
seen.set(
|
|
84511
|
+
const safeReplacer = (key, value3) => {
|
|
84512
|
+
if (typeof value3 === "bigint")
|
|
84513
|
+
return value3.toString();
|
|
84514
|
+
if (typeof value3 === "object" && value3 !== null) {
|
|
84515
|
+
if (seen.has(value3))
|
|
84516
|
+
return `[Circular ref-${seen.get(value3)}]`;
|
|
84517
|
+
seen.set(value3, id++);
|
|
85113
84518
|
}
|
|
85114
84519
|
if (replacer)
|
|
85115
|
-
return replacer(key,
|
|
85116
|
-
return
|
|
84520
|
+
return replacer(key, value3);
|
|
84521
|
+
return value3;
|
|
85117
84522
|
};
|
|
85118
84523
|
return JSON.stringify(obj, safeReplacer, space);
|
|
85119
84524
|
}
|
|
85120
|
-
function isJSONResponse(
|
|
85121
|
-
if (!
|
|
84525
|
+
function isJSONResponse(value3) {
|
|
84526
|
+
if (!value3 || typeof value3 !== "object")
|
|
85122
84527
|
return false;
|
|
85123
|
-
return "_flag" in
|
|
84528
|
+
return "_flag" in value3 && value3._flag === "json";
|
|
85124
84529
|
}
|
|
85125
84530
|
function toResponse(data2, init) {
|
|
85126
84531
|
if (data2 instanceof Response) {
|
|
85127
84532
|
if (init?.headers instanceof Headers)
|
|
85128
|
-
init.headers.forEach((
|
|
85129
|
-
data2.headers.set(key,
|
|
84533
|
+
init.headers.forEach((value3, key) => {
|
|
84534
|
+
data2.headers.set(key, value3);
|
|
85130
84535
|
});
|
|
85131
84536
|
return data2;
|
|
85132
84537
|
}
|
|
@@ -85138,15 +84543,15 @@ function toResponse(data2, init) {
|
|
|
85138
84543
|
const headers2 = new Headers;
|
|
85139
84544
|
if (routerResponse?.headers) {
|
|
85140
84545
|
const headers3 = new Headers(routerResponse.headers);
|
|
85141
|
-
for (const [key,
|
|
85142
|
-
headers3.set(key,
|
|
84546
|
+
for (const [key, value3] of headers3.entries())
|
|
84547
|
+
headers3.set(key, value3);
|
|
85143
84548
|
}
|
|
85144
84549
|
if (data2.headers)
|
|
85145
|
-
for (const [key,
|
|
85146
|
-
headers2.set(key,
|
|
84550
|
+
for (const [key, value3] of new Headers(data2.headers).entries())
|
|
84551
|
+
headers2.set(key, value3);
|
|
85147
84552
|
if (init?.headers)
|
|
85148
|
-
for (const [key,
|
|
85149
|
-
headers2.set(key,
|
|
84553
|
+
for (const [key, value3] of new Headers(init.headers).entries())
|
|
84554
|
+
headers2.set(key, value3);
|
|
85150
84555
|
headers2.set("Content-Type", "application/json");
|
|
85151
84556
|
return new Response(JSON.stringify(body2), {
|
|
85152
84557
|
...routerResponse,
|
|
@@ -85203,27 +84608,27 @@ var getCryptoKey3 = async (secret) => {
|
|
|
85203
84608
|
const secretBuf = typeof secret === "string" ? new TextEncoder().encode(secret) : secret;
|
|
85204
84609
|
return await getWebcryptoSubtle().importKey("raw", secretBuf, algorithm, false, ["sign", "verify"]);
|
|
85205
84610
|
};
|
|
85206
|
-
var verifySignature = async (base64Signature,
|
|
84611
|
+
var verifySignature = async (base64Signature, value3, secret) => {
|
|
85207
84612
|
try {
|
|
85208
84613
|
const signatureBinStr = atob(base64Signature);
|
|
85209
84614
|
const signature = new Uint8Array(signatureBinStr.length);
|
|
85210
84615
|
for (let i = 0, len = signatureBinStr.length;i < len; i++)
|
|
85211
84616
|
signature[i] = signatureBinStr.charCodeAt(i);
|
|
85212
|
-
return await getWebcryptoSubtle().verify(algorithm, secret, signature, new TextEncoder().encode(
|
|
84617
|
+
return await getWebcryptoSubtle().verify(algorithm, secret, signature, new TextEncoder().encode(value3));
|
|
85213
84618
|
} catch (e) {
|
|
85214
84619
|
return false;
|
|
85215
84620
|
}
|
|
85216
84621
|
};
|
|
85217
|
-
var makeSignature = async (
|
|
84622
|
+
var makeSignature = async (value3, secret) => {
|
|
85218
84623
|
const key = await getCryptoKey3(secret);
|
|
85219
|
-
const signature = await getWebcryptoSubtle().sign(algorithm.name, key, new TextEncoder().encode(
|
|
84624
|
+
const signature = await getWebcryptoSubtle().sign(algorithm.name, key, new TextEncoder().encode(value3));
|
|
85220
84625
|
return btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
85221
84626
|
};
|
|
85222
|
-
var signCookieValue = async (
|
|
85223
|
-
const signature = await makeSignature(
|
|
85224
|
-
|
|
85225
|
-
|
|
85226
|
-
return
|
|
84627
|
+
var signCookieValue = async (value3, secret) => {
|
|
84628
|
+
const signature = await makeSignature(value3, secret);
|
|
84629
|
+
value3 = `${value3}.${signature}`;
|
|
84630
|
+
value3 = encodeURIComponent(value3);
|
|
84631
|
+
return value3;
|
|
85227
84632
|
};
|
|
85228
84633
|
|
|
85229
84634
|
// ../../node_modules/.bun/better-call@1.3.2+3c5d820c62823f0b/node_modules/better-call/dist/cookies.mjs
|
|
@@ -85265,14 +84670,14 @@ function parseCookies(str) {
|
|
|
85265
84670
|
}
|
|
85266
84671
|
return cookies;
|
|
85267
84672
|
}
|
|
85268
|
-
var _serialize = (key,
|
|
84673
|
+
var _serialize = (key, value3, opt = {}) => {
|
|
85269
84674
|
let cookie;
|
|
85270
84675
|
if (opt?.prefix === "secure")
|
|
85271
|
-
cookie = `${`__Secure-${key}`}=${
|
|
84676
|
+
cookie = `${`__Secure-${key}`}=${value3}`;
|
|
85272
84677
|
else if (opt?.prefix === "host")
|
|
85273
|
-
cookie = `${`__Host-${key}`}=${
|
|
84678
|
+
cookie = `${`__Host-${key}`}=${value3}`;
|
|
85274
84679
|
else
|
|
85275
|
-
cookie = `${key}=${
|
|
84680
|
+
cookie = `${key}=${value3}`;
|
|
85276
84681
|
if (key.startsWith("__Secure-") && !opt.secure)
|
|
85277
84682
|
opt.secure = true;
|
|
85278
84683
|
if (key.startsWith("__Host-")) {
|
|
@@ -85310,13 +84715,13 @@ var _serialize = (key, value4, opt = {}) => {
|
|
|
85310
84715
|
}
|
|
85311
84716
|
return cookie;
|
|
85312
84717
|
};
|
|
85313
|
-
var serializeCookie = (key,
|
|
85314
|
-
|
|
85315
|
-
return _serialize(key,
|
|
84718
|
+
var serializeCookie = (key, value3, opt) => {
|
|
84719
|
+
value3 = encodeURIComponent(value3);
|
|
84720
|
+
return _serialize(key, value3, opt);
|
|
85316
84721
|
};
|
|
85317
|
-
var serializeSignedCookie = async (key,
|
|
85318
|
-
|
|
85319
|
-
return _serialize(key,
|
|
84722
|
+
var serializeSignedCookie = async (key, value3, secret, opt) => {
|
|
84723
|
+
value3 = await signCookieValue(value3, secret);
|
|
84724
|
+
return _serialize(key, value3, opt);
|
|
85320
84725
|
};
|
|
85321
84726
|
|
|
85322
84727
|
// ../../node_modules/.bun/better-call@1.3.2+3c5d820c62823f0b/node_modules/better-call/dist/context.mjs
|
|
@@ -85397,8 +84802,8 @@ var createInternalContext = async (context, { options, path: path3 }) => {
|
|
|
85397
84802
|
request: context?.request,
|
|
85398
84803
|
params: "params" in context ? context.params : undefined,
|
|
85399
84804
|
method: context.method ?? (Array.isArray(options.method) ? options.method[0] : options.method === "*" ? "GET" : options.method),
|
|
85400
|
-
setHeader: (key,
|
|
85401
|
-
headers.set(key,
|
|
84805
|
+
setHeader: (key, value3) => {
|
|
84806
|
+
headers.set(key, value3);
|
|
85402
84807
|
},
|
|
85403
84808
|
getHeader: (key) => {
|
|
85404
84809
|
if (!requestHeaders)
|
|
@@ -85415,25 +84820,25 @@ var createInternalContext = async (context, { options, path: path3 }) => {
|
|
|
85415
84820
|
const finalKey = getCookieKey(key, prefix);
|
|
85416
84821
|
if (!finalKey)
|
|
85417
84822
|
return null;
|
|
85418
|
-
const
|
|
85419
|
-
if (!
|
|
84823
|
+
const value3 = parsedCookies?.get(finalKey);
|
|
84824
|
+
if (!value3)
|
|
85420
84825
|
return null;
|
|
85421
|
-
const signatureStartPos =
|
|
84826
|
+
const signatureStartPos = value3.lastIndexOf(".");
|
|
85422
84827
|
if (signatureStartPos < 1)
|
|
85423
84828
|
return null;
|
|
85424
|
-
const signedValue =
|
|
85425
|
-
const signature =
|
|
84829
|
+
const signedValue = value3.substring(0, signatureStartPos);
|
|
84830
|
+
const signature = value3.substring(signatureStartPos + 1);
|
|
85426
84831
|
if (signature.length !== 44 || !signature.endsWith("="))
|
|
85427
84832
|
return null;
|
|
85428
84833
|
return await verifySignature(signature, signedValue, await getCryptoKey3(secret)) ? signedValue : false;
|
|
85429
84834
|
},
|
|
85430
|
-
setCookie: (key,
|
|
85431
|
-
const cookie = serializeCookie(key,
|
|
84835
|
+
setCookie: (key, value3, options2) => {
|
|
84836
|
+
const cookie = serializeCookie(key, value3, options2);
|
|
85432
84837
|
headers.append("set-cookie", cookie);
|
|
85433
84838
|
return cookie;
|
|
85434
84839
|
},
|
|
85435
|
-
setSignedCookie: async (key,
|
|
85436
|
-
const cookie = await serializeSignedCookie(key,
|
|
84840
|
+
setSignedCookie: async (key, value3, secret, options2) => {
|
|
84841
|
+
const cookie = await serializeSignedCookie(key, value3, secret, options2);
|
|
85437
84842
|
headers.append("set-cookie", cookie);
|
|
85438
84843
|
return cookie;
|
|
85439
84844
|
},
|
|
@@ -85470,8 +84875,8 @@ var createInternalContext = async (context, { options, path: path3 }) => {
|
|
|
85470
84875
|
if (response.response)
|
|
85471
84876
|
Object.assign(internalContext.context, response.response);
|
|
85472
84877
|
if (response.headers)
|
|
85473
|
-
response.headers.forEach((
|
|
85474
|
-
internalContext.responseHeaders.set(key,
|
|
84878
|
+
response.headers.forEach((value3, key) => {
|
|
84879
|
+
internalContext.responseHeaders.set(key, value3);
|
|
85475
84880
|
});
|
|
85476
84881
|
}
|
|
85477
84882
|
return internalContext;
|
|
@@ -85595,12 +85000,12 @@ createMiddleware.create = (opts) => {
|
|
|
85595
85000
|
return fn;
|
|
85596
85001
|
};
|
|
85597
85002
|
|
|
85598
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85003
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/is-api-error.mjs
|
|
85599
85004
|
function isAPIError2(error48) {
|
|
85600
85005
|
return error48 instanceof APIError || error48 instanceof APIError2 || error48?.name === "APIError";
|
|
85601
85006
|
}
|
|
85602
85007
|
|
|
85603
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85008
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/auth/trusted-origins.mjs
|
|
85604
85009
|
var matchesOriginPattern = (url2, pattern, settings) => {
|
|
85605
85010
|
if (url2.startsWith("/")) {
|
|
85606
85011
|
if (settings?.allowRelativePaths)
|
|
@@ -85619,10 +85024,10 @@ var matchesOriginPattern = (url2, pattern, settings) => {
|
|
|
85619
85024
|
return protocol === "http:" || protocol === "https:" || !protocol ? pattern === getOrigin(url2) : url2.startsWith(pattern);
|
|
85620
85025
|
};
|
|
85621
85026
|
|
|
85622
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85027
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/middlewares/origin-check.mjs
|
|
85623
85028
|
init_error2();
|
|
85624
85029
|
|
|
85625
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
85030
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/url.mjs
|
|
85626
85031
|
function normalizePathname(requestUrl, basePath) {
|
|
85627
85032
|
let pathname;
|
|
85628
85033
|
try {
|
|
@@ -85639,7 +85044,7 @@ function normalizePathname(requestUrl, basePath) {
|
|
|
85639
85044
|
return pathname;
|
|
85640
85045
|
}
|
|
85641
85046
|
|
|
85642
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
85047
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/api/index.mjs
|
|
85643
85048
|
var optionsMiddleware = createMiddleware(async () => {
|
|
85644
85049
|
return {};
|
|
85645
85050
|
});
|
|
@@ -85662,7 +85067,7 @@ function createAuthEndpoint(pathOrOptions, handlerOrOptions, handlerOrNever) {
|
|
|
85662
85067
|
}, async (ctx) => runWithEndpointContext(ctx, () => handler(ctx)));
|
|
85663
85068
|
}
|
|
85664
85069
|
|
|
85665
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
85070
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/deprecate.mjs
|
|
85666
85071
|
function deprecate(fn, message2, logger2) {
|
|
85667
85072
|
let warned = false;
|
|
85668
85073
|
return function(...args) {
|
|
@@ -85674,7 +85079,7 @@ function deprecate(fn, message2, logger2) {
|
|
|
85674
85079
|
};
|
|
85675
85080
|
}
|
|
85676
85081
|
|
|
85677
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85082
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/middlewares/origin-check.mjs
|
|
85678
85083
|
function shouldSkipCSRFForBackwardCompat(ctx) {
|
|
85679
85084
|
return ctx.context.skipOriginCheck === true && ctx.context.options.advanced?.disableCSRFCheck === undefined;
|
|
85680
85085
|
}
|
|
@@ -85809,10 +85214,10 @@ async function validateFormCsrf(ctx) {
|
|
|
85809
85214
|
}
|
|
85810
85215
|
}
|
|
85811
85216
|
|
|
85812
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85217
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/get-request-ip.mjs
|
|
85813
85218
|
init_env();
|
|
85814
85219
|
|
|
85815
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
85220
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/utils/ip.mjs
|
|
85816
85221
|
init_zod();
|
|
85817
85222
|
function isValidIP2(ip) {
|
|
85818
85223
|
return ipv42().safeParse(ip).success || ipv62().safeParse(ip).success;
|
|
@@ -85886,7 +85291,7 @@ function normalizeIP(ip, options = {}) {
|
|
|
85886
85291
|
return normalizeIPv6(ip, options.ipv6Subnet || 64);
|
|
85887
85292
|
}
|
|
85888
85293
|
|
|
85889
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85294
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/get-request-ip.mjs
|
|
85890
85295
|
var LOCALHOST_IP = "127.0.0.1";
|
|
85891
85296
|
function getIp(req, options) {
|
|
85892
85297
|
if (options.advanced?.ipAddress?.disableIpTracking)
|
|
@@ -85894,9 +85299,9 @@ function getIp(req, options) {
|
|
|
85894
85299
|
const headers = "headers" in req ? req.headers : req;
|
|
85895
85300
|
const ipHeaders = options.advanced?.ipAddress?.ipAddressHeaders || ["x-forwarded-for"];
|
|
85896
85301
|
for (const key of ipHeaders) {
|
|
85897
|
-
const
|
|
85898
|
-
if (typeof
|
|
85899
|
-
const ip =
|
|
85302
|
+
const value3 = "get" in headers ? headers.get(key) : headers[key];
|
|
85303
|
+
if (typeof value3 === "string") {
|
|
85304
|
+
const ip = value3.split(",")[0].trim();
|
|
85900
85305
|
if (isValidIP2(ip))
|
|
85901
85306
|
return normalizeIP(ip, { ipv6Subnet: options.advanced?.ipAddress?.ipv6Subnet });
|
|
85902
85307
|
}
|
|
@@ -85906,13 +85311,13 @@ function getIp(req, options) {
|
|
|
85906
85311
|
return null;
|
|
85907
85312
|
}
|
|
85908
85313
|
|
|
85909
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85314
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/rate-limiter/index.mjs
|
|
85910
85315
|
init_json();
|
|
85911
85316
|
|
|
85912
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85317
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/state/should-session-refresh.mjs
|
|
85913
85318
|
var { get: getShouldSkipSessionRefresh, set: setShouldSkipSessionRefresh } = defineRequestState(() => false);
|
|
85914
85319
|
|
|
85915
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85320
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/_virtual/_rolldown/runtime.mjs
|
|
85916
85321
|
var __defProp3 = Object.defineProperty;
|
|
85917
85322
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
85918
85323
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -85946,7 +85351,7 @@ var __copyProps = (to, from2, except, desc) => {
|
|
|
85946
85351
|
};
|
|
85947
85352
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
85948
85353
|
|
|
85949
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85354
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/get-schema.mjs
|
|
85950
85355
|
function getSchema(config3) {
|
|
85951
85356
|
const tables = getAuthTables(config3);
|
|
85952
85357
|
const schema = {};
|
|
@@ -85981,15 +85386,15 @@ function getSchema(config3) {
|
|
|
85981
85386
|
return schema;
|
|
85982
85387
|
}
|
|
85983
85388
|
|
|
85984
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85389
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/field-converter.mjs
|
|
85985
85390
|
function convertToDB(fields, values) {
|
|
85986
85391
|
const result = values.id ? { id: values.id } : {};
|
|
85987
85392
|
for (const key in fields) {
|
|
85988
85393
|
const field = fields[key];
|
|
85989
|
-
const
|
|
85990
|
-
if (
|
|
85394
|
+
const value3 = values[key];
|
|
85395
|
+
if (value3 === undefined)
|
|
85991
85396
|
continue;
|
|
85992
|
-
result[field.fieldName || key] =
|
|
85397
|
+
result[field.fieldName || key] = value3;
|
|
85993
85398
|
}
|
|
85994
85399
|
return result;
|
|
85995
85400
|
}
|
|
@@ -85997,12 +85402,12 @@ function convertFromDB(fields, values) {
|
|
|
85997
85402
|
if (!values)
|
|
85998
85403
|
return null;
|
|
85999
85404
|
const result = { id: values.id };
|
|
86000
|
-
for (const [key,
|
|
86001
|
-
result[key] = values[
|
|
85405
|
+
for (const [key, value3] of Object.entries(fields))
|
|
85406
|
+
result[key] = values[value3.fieldName || key];
|
|
86002
85407
|
return result;
|
|
86003
85408
|
}
|
|
86004
85409
|
|
|
86005
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85410
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/with-hooks.mjs
|
|
86006
85411
|
function getWithHooks(adapter, ctx) {
|
|
86007
85412
|
const hooks = ctx.hooks;
|
|
86008
85413
|
async function createWithHooks(data2, model, customCreateFn) {
|
|
@@ -86175,7 +85580,7 @@ function getWithHooks(adapter, ctx) {
|
|
|
86175
85580
|
};
|
|
86176
85581
|
}
|
|
86177
85582
|
|
|
86178
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85583
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/verification-token-storage.mjs
|
|
86179
85584
|
var defaultKeyHasher = async (identifier) => {
|
|
86180
85585
|
const hash3 = await createHash2("SHA-256").digest(new TextEncoder().encode(identifier));
|
|
86181
85586
|
return base64Url.encode(new Uint8Array(hash3), { padding: false });
|
|
@@ -86203,7 +85608,7 @@ function getStorageOption(identifier, config3) {
|
|
|
86203
85608
|
return config3;
|
|
86204
85609
|
}
|
|
86205
85610
|
|
|
86206
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
85611
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/internal-adapter.mjs
|
|
86207
85612
|
init_id2();
|
|
86208
85613
|
init_json();
|
|
86209
85614
|
function getTTLSeconds(expiresAt, now4 = Date.now()) {
|
|
@@ -86880,7 +86285,7 @@ var createInternalAdapter = (adapter, ctx) => {
|
|
|
86880
86285
|
};
|
|
86881
86286
|
};
|
|
86882
86287
|
|
|
86883
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86288
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/to-zod.mjs
|
|
86884
86289
|
init_zod();
|
|
86885
86290
|
function toZodSchema({ fields, isClientSide }) {
|
|
86886
86291
|
const zodFields = Object.keys(fields).reduce((acc, key) => {
|
|
@@ -86909,7 +86314,7 @@ function toZodSchema({ fields, isClientSide }) {
|
|
|
86909
86314
|
}, {});
|
|
86910
86315
|
return object(zodFields);
|
|
86911
86316
|
}
|
|
86912
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86317
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/index.mjs
|
|
86913
86318
|
var db_exports = /* @__PURE__ */ __exportAll({
|
|
86914
86319
|
convertFromDB: () => convertFromDB,
|
|
86915
86320
|
convertToDB: () => convertToDB,
|
|
@@ -86930,7 +86335,7 @@ var db_exports = /* @__PURE__ */ __exportAll({
|
|
|
86930
86335
|
});
|
|
86931
86336
|
__reExport(db_exports, exports_db);
|
|
86932
86337
|
|
|
86933
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86338
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/session.mjs
|
|
86934
86339
|
init_error2();
|
|
86935
86340
|
init_json();
|
|
86936
86341
|
init_zod();
|
|
@@ -87349,19 +86754,19 @@ var revokeOtherSessions = createAuthEndpoint("/revoke-other-sessions", {
|
|
|
87349
86754
|
return ctx.json({ status: true });
|
|
87350
86755
|
});
|
|
87351
86756
|
|
|
87352
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86757
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/context/helpers.mjs
|
|
87353
86758
|
init_env();
|
|
87354
86759
|
async function getAwaitableValue(arr, item) {
|
|
87355
86760
|
if (!arr)
|
|
87356
86761
|
return;
|
|
87357
86762
|
for (const val of arr) {
|
|
87358
|
-
const
|
|
87359
|
-
if (
|
|
87360
|
-
return
|
|
86763
|
+
const value3 = typeof val === "function" ? await val() : val;
|
|
86764
|
+
if (value3[item.field ?? "id"] === item.value)
|
|
86765
|
+
return value3;
|
|
87361
86766
|
}
|
|
87362
86767
|
}
|
|
87363
86768
|
|
|
87364
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86769
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/oauth2/utils.mjs
|
|
87365
86770
|
function isLikelyEncrypted(token) {
|
|
87366
86771
|
if (token.startsWith("$ba$"))
|
|
87367
86772
|
return true;
|
|
@@ -87389,13 +86794,13 @@ function setTokenUtil(token, ctx) {
|
|
|
87389
86794
|
return token;
|
|
87390
86795
|
}
|
|
87391
86796
|
|
|
87392
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
86797
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/account.mjs
|
|
87393
86798
|
init_error2();
|
|
87394
86799
|
|
|
87395
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86800
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/apple.mjs
|
|
87396
86801
|
init_error2();
|
|
87397
86802
|
|
|
87398
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86803
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/oauth2/utils.mjs
|
|
87399
86804
|
function getOAuth2Tokens(data2) {
|
|
87400
86805
|
const getDate2 = (seconds) => {
|
|
87401
86806
|
const now4 = /* @__PURE__ */ new Date;
|
|
@@ -87418,7 +86823,7 @@ async function generateCodeChallenge(codeVerifier) {
|
|
|
87418
86823
|
return base64Url.encode(new Uint8Array(hash3), { padding: false });
|
|
87419
86824
|
}
|
|
87420
86825
|
|
|
87421
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86826
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.mjs
|
|
87422
86827
|
async function createAuthorizationURL({ id, options, authorizationEndpoint, state, codeVerifier, scopes, claims, redirectURI, duration: duration3, prompt, accessType, responseType, display, loginHint, hd, responseMode, additionalParams, scopeJoiner }) {
|
|
87423
86828
|
options = typeof options === "function" ? await options() : options;
|
|
87424
86829
|
const url2 = new URL(options.authorizationEndpoint || authorizationEndpoint);
|
|
@@ -87453,13 +86858,13 @@ async function createAuthorizationURL({ id, options, authorizationEndpoint, stat
|
|
|
87453
86858
|
} }));
|
|
87454
86859
|
}
|
|
87455
86860
|
if (additionalParams)
|
|
87456
|
-
Object.entries(additionalParams).forEach(([key,
|
|
87457
|
-
url2.searchParams.set(key,
|
|
86861
|
+
Object.entries(additionalParams).forEach(([key, value3]) => {
|
|
86862
|
+
url2.searchParams.set(key, value3);
|
|
87458
86863
|
});
|
|
87459
86864
|
return url2;
|
|
87460
86865
|
}
|
|
87461
86866
|
|
|
87462
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86867
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.mjs
|
|
87463
86868
|
function createRefreshAccessTokenRequest({ refreshToken, options, authentication, extraParams, resource }) {
|
|
87464
86869
|
const body = new URLSearchParams;
|
|
87465
86870
|
const headers = {
|
|
@@ -87487,8 +86892,8 @@ function createRefreshAccessTokenRequest({ refreshToken, options, authentication
|
|
|
87487
86892
|
for (const _resource of resource)
|
|
87488
86893
|
body.append("resource", _resource);
|
|
87489
86894
|
if (extraParams)
|
|
87490
|
-
for (const [key,
|
|
87491
|
-
body.set(key,
|
|
86895
|
+
for (const [key, value3] of Object.entries(extraParams))
|
|
86896
|
+
body.set(key, value3);
|
|
87492
86897
|
return {
|
|
87493
86898
|
body,
|
|
87494
86899
|
headers
|
|
@@ -87526,11 +86931,11 @@ async function refreshAccessToken({ refreshToken, options, tokenEndpoint, authen
|
|
|
87526
86931
|
return tokens;
|
|
87527
86932
|
}
|
|
87528
86933
|
|
|
87529
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86934
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/oauth2/verify.mjs
|
|
87530
86935
|
init_logger();
|
|
87531
86936
|
init_env();
|
|
87532
86937
|
|
|
87533
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
86938
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs
|
|
87534
86939
|
async function authorizationCodeRequest({ code: code2, codeVerifier, redirectURI, options, authentication, deviceId, headers, additionalParams = {}, resource }) {
|
|
87535
86940
|
options = typeof options === "function" ? await options() : options;
|
|
87536
86941
|
return createAuthorizationCodeRequest({
|
|
@@ -87573,9 +86978,9 @@ function createAuthorizationCodeRequest({ code: code2, codeVerifier, redirectURI
|
|
|
87573
86978
|
if (options.clientSecret)
|
|
87574
86979
|
body.set("client_secret", options.clientSecret);
|
|
87575
86980
|
}
|
|
87576
|
-
for (const [key,
|
|
86981
|
+
for (const [key, value3] of Object.entries(additionalParams))
|
|
87577
86982
|
if (!body.has(key))
|
|
87578
|
-
body.append(key,
|
|
86983
|
+
body.append(key, value3);
|
|
87579
86984
|
return {
|
|
87580
86985
|
body,
|
|
87581
86986
|
headers: requestHeaders
|
|
@@ -87603,7 +87008,7 @@ async function validateAuthorizationCode({ code: code2, codeVerifier, redirectUR
|
|
|
87603
87008
|
return getOAuth2Tokens(data2);
|
|
87604
87009
|
}
|
|
87605
87010
|
|
|
87606
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87011
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/apple.mjs
|
|
87607
87012
|
var apple = (options) => {
|
|
87608
87013
|
const tokenEndpoint = "https://appleid.apple.com/auth/token";
|
|
87609
87014
|
return {
|
|
@@ -87711,7 +87116,7 @@ var getApplePublicKey = async (kid) => {
|
|
|
87711
87116
|
return await importJWK(jwk, jwk.alg);
|
|
87712
87117
|
};
|
|
87713
87118
|
|
|
87714
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87119
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs
|
|
87715
87120
|
init_logger();
|
|
87716
87121
|
init_env();
|
|
87717
87122
|
init_error2();
|
|
@@ -87792,7 +87197,7 @@ var atlassian = (options) => {
|
|
|
87792
87197
|
};
|
|
87793
87198
|
};
|
|
87794
87199
|
|
|
87795
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87200
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/cognito.mjs
|
|
87796
87201
|
init_logger();
|
|
87797
87202
|
init_env();
|
|
87798
87203
|
init_error2();
|
|
@@ -87960,7 +87365,7 @@ var getCognitoPublicKey = async (kid, region, userPoolId) => {
|
|
|
87960
87365
|
}
|
|
87961
87366
|
};
|
|
87962
87367
|
|
|
87963
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87368
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/discord.mjs
|
|
87964
87369
|
var discord = (options) => {
|
|
87965
87370
|
return {
|
|
87966
87371
|
id: "discord",
|
|
@@ -88022,7 +87427,7 @@ var discord = (options) => {
|
|
|
88022
87427
|
};
|
|
88023
87428
|
};
|
|
88024
87429
|
|
|
88025
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87430
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs
|
|
88026
87431
|
var dropbox = (options) => {
|
|
88027
87432
|
const tokenEndpoint = "https://api.dropboxapi.com/oauth2/token";
|
|
88028
87433
|
return {
|
|
@@ -88094,7 +87499,7 @@ var dropbox = (options) => {
|
|
|
88094
87499
|
};
|
|
88095
87500
|
};
|
|
88096
87501
|
|
|
88097
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87502
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/facebook.mjs
|
|
88098
87503
|
var facebook = (options) => {
|
|
88099
87504
|
return {
|
|
88100
87505
|
id: "facebook",
|
|
@@ -88213,7 +87618,7 @@ var facebook = (options) => {
|
|
|
88213
87618
|
};
|
|
88214
87619
|
};
|
|
88215
87620
|
|
|
88216
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87621
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/figma.mjs
|
|
88217
87622
|
init_logger();
|
|
88218
87623
|
init_env();
|
|
88219
87624
|
init_error2();
|
|
@@ -88295,7 +87700,7 @@ var figma = (options) => {
|
|
|
88295
87700
|
};
|
|
88296
87701
|
};
|
|
88297
87702
|
|
|
88298
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87703
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/github.mjs
|
|
88299
87704
|
init_logger();
|
|
88300
87705
|
init_env();
|
|
88301
87706
|
var github = (options) => {
|
|
@@ -88387,7 +87792,7 @@ var github = (options) => {
|
|
|
88387
87792
|
};
|
|
88388
87793
|
};
|
|
88389
87794
|
|
|
88390
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87795
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs
|
|
88391
87796
|
var cleanDoubleSlashes = (input = "") => {
|
|
88392
87797
|
return input.split("://").map((str) => str.replace(/\/{2,}/g, "/")).join("://");
|
|
88393
87798
|
};
|
|
@@ -88465,7 +87870,7 @@ var gitlab = (options) => {
|
|
|
88465
87870
|
};
|
|
88466
87871
|
};
|
|
88467
87872
|
|
|
88468
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87873
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/google.mjs
|
|
88469
87874
|
init_logger();
|
|
88470
87875
|
init_env();
|
|
88471
87876
|
init_error2();
|
|
@@ -88579,7 +87984,7 @@ var getGooglePublicKey = async (kid) => {
|
|
|
88579
87984
|
return await importJWK(jwk, jwk.alg);
|
|
88580
87985
|
};
|
|
88581
87986
|
|
|
88582
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
87987
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/huggingface.mjs
|
|
88583
87988
|
var huggingface = (options) => {
|
|
88584
87989
|
return {
|
|
88585
87990
|
id: "huggingface",
|
|
@@ -88650,7 +88055,7 @@ var huggingface = (options) => {
|
|
|
88650
88055
|
};
|
|
88651
88056
|
};
|
|
88652
88057
|
|
|
88653
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88058
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/kakao.mjs
|
|
88654
88059
|
var kakao = (options) => {
|
|
88655
88060
|
return {
|
|
88656
88061
|
id: "kakao",
|
|
@@ -88718,7 +88123,7 @@ var kakao = (options) => {
|
|
|
88718
88123
|
};
|
|
88719
88124
|
};
|
|
88720
88125
|
|
|
88721
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88126
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/kick.mjs
|
|
88722
88127
|
var kick = (options) => {
|
|
88723
88128
|
return {
|
|
88724
88129
|
id: "kick",
|
|
@@ -88785,7 +88190,7 @@ var kick = (options) => {
|
|
|
88785
88190
|
};
|
|
88786
88191
|
};
|
|
88787
88192
|
|
|
88788
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88193
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/line.mjs
|
|
88789
88194
|
var line = (options) => {
|
|
88790
88195
|
const authorizationEndpoint = "https://access.line.me/oauth2/v2.1/authorize";
|
|
88791
88196
|
const tokenEndpoint = "https://api.line.me/oauth2/v2.1/token";
|
|
@@ -88891,7 +88296,7 @@ var line = (options) => {
|
|
|
88891
88296
|
};
|
|
88892
88297
|
};
|
|
88893
88298
|
|
|
88894
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88299
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/linear.mjs
|
|
88895
88300
|
var linear = (options) => {
|
|
88896
88301
|
const tokenEndpoint = "https://api.linear.app/oauth/token";
|
|
88897
88302
|
return {
|
|
@@ -88975,7 +88380,7 @@ var linear = (options) => {
|
|
|
88975
88380
|
};
|
|
88976
88381
|
};
|
|
88977
88382
|
|
|
88978
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88383
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/linkedin.mjs
|
|
88979
88384
|
var linkedin = (options) => {
|
|
88980
88385
|
const authorizationEndpoint = "https://www.linkedin.com/oauth/v2/authorization";
|
|
88981
88386
|
const tokenEndpoint = "https://www.linkedin.com/oauth/v2/accessToken";
|
|
@@ -89047,7 +88452,7 @@ var linkedin = (options) => {
|
|
|
89047
88452
|
};
|
|
89048
88453
|
};
|
|
89049
88454
|
|
|
89050
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88455
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.mjs
|
|
89051
88456
|
init_logger();
|
|
89052
88457
|
init_env();
|
|
89053
88458
|
init_error2();
|
|
@@ -89185,7 +88590,7 @@ var getMicrosoftPublicKey = async (kid, tenant, authority) => {
|
|
|
89185
88590
|
return await importJWK(jwk, jwk.alg);
|
|
89186
88591
|
};
|
|
89187
88592
|
|
|
89188
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88593
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/naver.mjs
|
|
89189
88594
|
var naver = (options) => {
|
|
89190
88595
|
return {
|
|
89191
88596
|
id: "naver",
|
|
@@ -89248,7 +88653,7 @@ var naver = (options) => {
|
|
|
89248
88653
|
};
|
|
89249
88654
|
};
|
|
89250
88655
|
|
|
89251
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88656
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/notion.mjs
|
|
89252
88657
|
var notion = (options) => {
|
|
89253
88658
|
const tokenEndpoint = "https://api.notion.com/v1/oauth/token";
|
|
89254
88659
|
return {
|
|
@@ -89320,7 +88725,7 @@ var notion = (options) => {
|
|
|
89320
88725
|
};
|
|
89321
88726
|
};
|
|
89322
88727
|
|
|
89323
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88728
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/paybin.mjs
|
|
89324
88729
|
init_logger();
|
|
89325
88730
|
init_env();
|
|
89326
88731
|
init_error2();
|
|
@@ -89402,7 +88807,7 @@ var paybin = (options) => {
|
|
|
89402
88807
|
};
|
|
89403
88808
|
};
|
|
89404
88809
|
|
|
89405
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88810
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/paypal.mjs
|
|
89406
88811
|
init_logger();
|
|
89407
88812
|
init_env();
|
|
89408
88813
|
init_error2();
|
|
@@ -89540,7 +88945,7 @@ var paypal = (options) => {
|
|
|
89540
88945
|
};
|
|
89541
88946
|
};
|
|
89542
88947
|
|
|
89543
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
88948
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/polar.mjs
|
|
89544
88949
|
var polar = (options) => {
|
|
89545
88950
|
return {
|
|
89546
88951
|
id: "polar",
|
|
@@ -89609,7 +89014,7 @@ var polar = (options) => {
|
|
|
89609
89014
|
};
|
|
89610
89015
|
};
|
|
89611
89016
|
|
|
89612
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89017
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/railway.mjs
|
|
89613
89018
|
var authorizationEndpoint = "https://backboard.railway.com/oauth/auth";
|
|
89614
89019
|
var tokenEndpoint = "https://backboard.railway.com/oauth/token";
|
|
89615
89020
|
var userinfoEndpoint = "https://backboard.railway.com/oauth/me";
|
|
@@ -89682,7 +89087,7 @@ var railway = (options) => {
|
|
|
89682
89087
|
};
|
|
89683
89088
|
};
|
|
89684
89089
|
|
|
89685
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89090
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/reddit.mjs
|
|
89686
89091
|
var reddit = (options) => {
|
|
89687
89092
|
return {
|
|
89688
89093
|
id: "reddit",
|
|
@@ -89761,7 +89166,7 @@ var reddit = (options) => {
|
|
|
89761
89166
|
};
|
|
89762
89167
|
};
|
|
89763
89168
|
|
|
89764
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89169
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/roblox.mjs
|
|
89765
89170
|
var roblox = (options) => {
|
|
89766
89171
|
return {
|
|
89767
89172
|
id: "roblox",
|
|
@@ -89817,7 +89222,7 @@ var roblox = (options) => {
|
|
|
89817
89222
|
};
|
|
89818
89223
|
};
|
|
89819
89224
|
|
|
89820
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89225
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/salesforce.mjs
|
|
89821
89226
|
init_logger();
|
|
89822
89227
|
init_env();
|
|
89823
89228
|
init_error2();
|
|
@@ -89904,7 +89309,7 @@ var salesforce = (options) => {
|
|
|
89904
89309
|
};
|
|
89905
89310
|
};
|
|
89906
89311
|
|
|
89907
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89312
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/slack.mjs
|
|
89908
89313
|
var slack = (options) => {
|
|
89909
89314
|
return {
|
|
89910
89315
|
id: "slack",
|
|
@@ -89969,7 +89374,7 @@ var slack = (options) => {
|
|
|
89969
89374
|
};
|
|
89970
89375
|
};
|
|
89971
89376
|
|
|
89972
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89377
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/spotify.mjs
|
|
89973
89378
|
var spotify = (options) => {
|
|
89974
89379
|
return {
|
|
89975
89380
|
id: "spotify",
|
|
@@ -90036,7 +89441,7 @@ var spotify = (options) => {
|
|
|
90036
89441
|
};
|
|
90037
89442
|
};
|
|
90038
89443
|
|
|
90039
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89444
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/tiktok.mjs
|
|
90040
89445
|
var tiktok = (options) => {
|
|
90041
89446
|
return {
|
|
90042
89447
|
id: "tiktok",
|
|
@@ -90095,7 +89500,7 @@ var tiktok = (options) => {
|
|
|
90095
89500
|
};
|
|
90096
89501
|
};
|
|
90097
89502
|
|
|
90098
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89503
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/twitch.mjs
|
|
90099
89504
|
init_logger();
|
|
90100
89505
|
init_env();
|
|
90101
89506
|
var twitch = (options) => {
|
|
@@ -90168,7 +89573,7 @@ var twitch = (options) => {
|
|
|
90168
89573
|
};
|
|
90169
89574
|
};
|
|
90170
89575
|
|
|
90171
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89576
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/twitter.mjs
|
|
90172
89577
|
var twitter = (options) => {
|
|
90173
89578
|
return {
|
|
90174
89579
|
id: "twitter",
|
|
@@ -90251,7 +89656,7 @@ var twitter = (options) => {
|
|
|
90251
89656
|
};
|
|
90252
89657
|
};
|
|
90253
89658
|
|
|
90254
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89659
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/vercel.mjs
|
|
90255
89660
|
init_error2();
|
|
90256
89661
|
var vercel = (options) => {
|
|
90257
89662
|
return {
|
|
@@ -90310,7 +89715,7 @@ var vercel = (options) => {
|
|
|
90310
89715
|
};
|
|
90311
89716
|
};
|
|
90312
89717
|
|
|
90313
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89718
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/vk.mjs
|
|
90314
89719
|
var vk = (options) => {
|
|
90315
89720
|
return {
|
|
90316
89721
|
id: "vk",
|
|
@@ -90391,7 +89796,7 @@ var vk = (options) => {
|
|
|
90391
89796
|
};
|
|
90392
89797
|
};
|
|
90393
89798
|
|
|
90394
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89799
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/zoom.mjs
|
|
90395
89800
|
var zoom = (userOptions) => {
|
|
90396
89801
|
const options = {
|
|
90397
89802
|
pkce: true,
|
|
@@ -90457,7 +89862,7 @@ var zoom = (userOptions) => {
|
|
|
90457
89862
|
};
|
|
90458
89863
|
};
|
|
90459
89864
|
|
|
90460
|
-
// ../../node_modules/.bun/@better-auth+core@1.5.
|
|
89865
|
+
// ../../node_modules/.bun/@better-auth+core@1.5.4+a208ebc52bd83018/node_modules/@better-auth/core/dist/social-providers/index.mjs
|
|
90461
89866
|
init_zod();
|
|
90462
89867
|
var socialProviders = {
|
|
90463
89868
|
apple,
|
|
@@ -90498,7 +89903,7 @@ var socialProviders = {
|
|
|
90498
89903
|
var socialProviderList = Object.keys(socialProviders);
|
|
90499
89904
|
var SocialProviderListEnum = _enum2(socialProviderList).or(string2());
|
|
90500
89905
|
|
|
90501
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
89906
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/account.mjs
|
|
90502
89907
|
init_zod();
|
|
90503
89908
|
var listUserAccounts = createAuthEndpoint("/list-accounts", {
|
|
90504
89909
|
method: "GET",
|
|
@@ -91014,7 +90419,7 @@ var accountInfo = createAuthEndpoint("/account-info", {
|
|
|
91014
90419
|
return ctx.json(info2);
|
|
91015
90420
|
});
|
|
91016
90421
|
|
|
91017
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
90422
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/email-verification.mjs
|
|
91018
90423
|
init_error2();
|
|
91019
90424
|
init_zod();
|
|
91020
90425
|
async function createEmailVerificationToken(secret, email3, updateTo, expiresIn = 3600, extraPayload) {
|
|
@@ -91317,7 +90722,7 @@ var verifyEmail = createAuthEndpoint("/verify-email", {
|
|
|
91317
90722
|
});
|
|
91318
90723
|
});
|
|
91319
90724
|
|
|
91320
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
90725
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/oauth2/link-account.mjs
|
|
91321
90726
|
init_env();
|
|
91322
90727
|
async function handleOAuthUserInfo(c, opts) {
|
|
91323
90728
|
const { userInfo, account: account3, callbackURL, disableSignUp, overrideUserInfo } = opts;
|
|
@@ -91370,7 +90775,7 @@ Error: `, e);
|
|
|
91370
90775
|
accessTokenExpiresAt: account3.accessTokenExpiresAt,
|
|
91371
90776
|
refreshTokenExpiresAt: account3.refreshTokenExpiresAt,
|
|
91372
90777
|
scope: account3.scope
|
|
91373
|
-
}).filter(([_,
|
|
90778
|
+
}).filter(([_, value3]) => value3 !== undefined)) : {};
|
|
91374
90779
|
if (c.context.options.account?.storeAccountCookie)
|
|
91375
90780
|
await setAccountCookie(c, {
|
|
91376
90781
|
...linkedAccount,
|
|
@@ -91462,7 +90867,7 @@ Error: `, e);
|
|
|
91462
90867
|
};
|
|
91463
90868
|
}
|
|
91464
90869
|
|
|
91465
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
90870
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/callback.mjs
|
|
91466
90871
|
init_json();
|
|
91467
90872
|
init_zod();
|
|
91468
90873
|
var schema = object({
|
|
@@ -91493,9 +90898,9 @@ var callbackOAuth = createAuthEndpoint("/callback/:id", {
|
|
|
91493
90898
|
...queryData
|
|
91494
90899
|
});
|
|
91495
90900
|
const params = new URLSearchParams;
|
|
91496
|
-
for (const [key,
|
|
91497
|
-
if (
|
|
91498
|
-
params.set(key, String(
|
|
90901
|
+
for (const [key, value3] of Object.entries(mergedData))
|
|
90902
|
+
if (value3 !== undefined && value3 !== null)
|
|
90903
|
+
params.set(key, String(value3));
|
|
91499
90904
|
const redirectURL = `${c.context.baseURL}/callback/${c.params.id}?${params.toString()}`;
|
|
91500
90905
|
throw c.redirect(redirectURL);
|
|
91501
90906
|
}
|
|
@@ -91581,7 +90986,7 @@ var callbackOAuth = createAuthEndpoint("/callback/:id", {
|
|
|
91581
90986
|
accessTokenExpiresAt: tokens.accessTokenExpiresAt,
|
|
91582
90987
|
refreshTokenExpiresAt: tokens.refreshTokenExpiresAt,
|
|
91583
90988
|
scope: tokens.scopes?.join(",")
|
|
91584
|
-
}).filter(([_,
|
|
90989
|
+
}).filter(([_, value3]) => value3 !== undefined));
|
|
91585
90990
|
await c.context.internalAdapter.updateAccount(existingAccount.id, updateData);
|
|
91586
90991
|
} else if (!await c.context.internalAdapter.createAccount({
|
|
91587
90992
|
userId: link.userId,
|
|
@@ -91641,7 +91046,7 @@ var callbackOAuth = createAuthEndpoint("/callback/:id", {
|
|
|
91641
91046
|
throw c.redirect(toRedirectTo);
|
|
91642
91047
|
});
|
|
91643
91048
|
|
|
91644
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91049
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/error.mjs
|
|
91645
91050
|
init_env();
|
|
91646
91051
|
function sanitize(input) {
|
|
91647
91052
|
return input.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/&(?!amp;|lt;|gt;|quot;|#39;|#x[0-9a-fA-F]+;|#[0-9]+;)/g, "&");
|
|
@@ -92024,7 +91429,7 @@ var error48 = createAuthEndpoint("/error", {
|
|
|
92024
91429
|
return new Response(html(c.context.options, safeCode, safeDescription), { headers: { "Content-Type": "text/html" } });
|
|
92025
91430
|
});
|
|
92026
91431
|
|
|
92027
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91432
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/ok.mjs
|
|
92028
91433
|
var ok = createAuthEndpoint("/ok", {
|
|
92029
91434
|
method: "GET",
|
|
92030
91435
|
metadata: {
|
|
@@ -92048,7 +91453,7 @@ var ok = createAuthEndpoint("/ok", {
|
|
|
92048
91453
|
return ctx.json({ ok: true });
|
|
92049
91454
|
});
|
|
92050
91455
|
|
|
92051
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91456
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/utils/password.mjs
|
|
92052
91457
|
init_error2();
|
|
92053
91458
|
async function validatePassword(ctx, data2) {
|
|
92054
91459
|
const credentialAccount = (await ctx.context.internalAdapter.findAccounts(data2.userId))?.find((account3) => account3.providerId === "credential");
|
|
@@ -92061,7 +91466,7 @@ async function validatePassword(ctx, data2) {
|
|
|
92061
91466
|
});
|
|
92062
91467
|
}
|
|
92063
91468
|
|
|
92064
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91469
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/password.mjs
|
|
92065
91470
|
init_error2();
|
|
92066
91471
|
init_id2();
|
|
92067
91472
|
init_zod();
|
|
@@ -92258,7 +91663,7 @@ var verifyPassword2 = createAuthEndpoint("/verify-password", {
|
|
|
92258
91663
|
return ctx.json({ status: true });
|
|
92259
91664
|
});
|
|
92260
91665
|
|
|
92261
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91666
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/sign-in.mjs
|
|
92262
91667
|
init_error2();
|
|
92263
91668
|
init_zod();
|
|
92264
91669
|
var socialSignInBodySchema = object({
|
|
@@ -92280,7 +91685,7 @@ var socialSignInBodySchema = object({
|
|
|
92280
91685
|
additionalData: record(string2(), any()).optional().meta({ description: "Additional data to be passed through the OAuth flow" })
|
|
92281
91686
|
});
|
|
92282
91687
|
|
|
92283
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91688
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/sign-out.mjs
|
|
92284
91689
|
var signOut = createAuthEndpoint("/sign-out", {
|
|
92285
91690
|
method: "POST",
|
|
92286
91691
|
operationId: "signOut",
|
|
@@ -92308,7 +91713,7 @@ var signOut = createAuthEndpoint("/sign-out", {
|
|
|
92308
91713
|
return ctx.json({ success: true });
|
|
92309
91714
|
});
|
|
92310
91715
|
|
|
92311
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91716
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/sign-up.mjs
|
|
92312
91717
|
init_env();
|
|
92313
91718
|
init_error2();
|
|
92314
91719
|
init_id2();
|
|
@@ -92322,12 +91727,12 @@ var signUpEmailBodySchema = object({
|
|
|
92322
91727
|
rememberMe: boolean2().optional()
|
|
92323
91728
|
}).and(record(string2(), any()));
|
|
92324
91729
|
|
|
92325
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91730
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/update-session.mjs
|
|
92326
91731
|
init_error2();
|
|
92327
91732
|
init_zod();
|
|
92328
91733
|
var updateSessionBodySchema = record(string2().meta({ description: "Field name must be a string" }), any());
|
|
92329
91734
|
|
|
92330
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
91735
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/routes/update-user.mjs
|
|
92331
91736
|
init_error2();
|
|
92332
91737
|
init_zod();
|
|
92333
91738
|
var updateUserBodySchema = record(string2().meta({ description: "Field name must be a string" }), any());
|
|
@@ -92753,51 +92158,51 @@ var changeEmail = createAuthEndpoint("/change-email", {
|
|
|
92753
92158
|
return ctx.json({ status: true });
|
|
92754
92159
|
});
|
|
92755
92160
|
|
|
92756
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92161
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/to-auth-endpoints.mjs
|
|
92757
92162
|
init_env();
|
|
92758
92163
|
init_error2();
|
|
92759
|
-
var defuReplaceArrays = createDefu((obj, key,
|
|
92760
|
-
if (Array.isArray(obj[key]) && Array.isArray(
|
|
92761
|
-
obj[key] =
|
|
92164
|
+
var defuReplaceArrays = createDefu((obj, key, value3) => {
|
|
92165
|
+
if (Array.isArray(obj[key]) && Array.isArray(value3)) {
|
|
92166
|
+
obj[key] = value3;
|
|
92762
92167
|
return true;
|
|
92763
92168
|
}
|
|
92764
92169
|
});
|
|
92765
92170
|
|
|
92766
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92171
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/api/index.mjs
|
|
92767
92172
|
init_env();
|
|
92768
92173
|
init_error2();
|
|
92769
92174
|
|
|
92770
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92175
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/adapter-base.mjs
|
|
92771
92176
|
init_env();
|
|
92772
92177
|
|
|
92773
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92178
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/adapter-kysely.mjs
|
|
92774
92179
|
init_error2();
|
|
92775
92180
|
|
|
92776
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92181
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/db/get-migration.mjs
|
|
92777
92182
|
init_env();
|
|
92778
92183
|
init_dist();
|
|
92779
92184
|
init_adapter();
|
|
92780
92185
|
|
|
92781
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92186
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/context/secret-utils.mjs
|
|
92782
92187
|
init_error2();
|
|
92783
92188
|
|
|
92784
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92189
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/context/create-context.mjs
|
|
92785
92190
|
init_env();
|
|
92786
92191
|
init_error2();
|
|
92787
92192
|
init_id2();
|
|
92788
92193
|
|
|
92789
|
-
// ../../node_modules/.bun/@better-auth+telemetry@1.5.
|
|
92194
|
+
// ../../node_modules/.bun/@better-auth+telemetry@1.5.4+9eb4f6be38aa00eb/node_modules/@better-auth/telemetry/dist/index.mjs
|
|
92790
92195
|
init_env();
|
|
92791
92196
|
init_random();
|
|
92792
92197
|
|
|
92793
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92198
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/context/init.mjs
|
|
92794
92199
|
init_error2();
|
|
92795
92200
|
init_dist();
|
|
92796
92201
|
|
|
92797
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92202
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/auth/base.mjs
|
|
92798
92203
|
init_error2();
|
|
92799
92204
|
|
|
92800
|
-
// ../../node_modules/.bun/better-auth@1.5.
|
|
92205
|
+
// ../../node_modules/.bun/better-auth@1.5.4+b1ab26d139c240dc/node_modules/better-auth/dist/index.mjs
|
|
92801
92206
|
init_env();
|
|
92802
92207
|
init_error2();
|
|
92803
92208
|
init_error_codes();
|