@hiai-gg/docsmint 2.0.4 → 2.1.0
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/README.md +67 -2
- package/dist/backend/index.js +22540 -2807
- package/dist/backend-account-runtime-cleanup.js +2 -1
- package/dist/backend-api-key-facade.js +2 -1
- package/dist/backend-pipeline-cancellation.js +2 -1
- package/dist/client.d.ts +33 -7
- package/dist/client.js +55 -1
- package/dist/frontend/{HiAiEditor-DDpfdQEg.js → HiAiEditor-D6ad_auS.js} +2 -2
- package/dist/frontend/{SettingsDialog-DzlYW50I.js → SettingsDialog-B8Oswuqb.js} +4 -4
- package/dist/frontend/{Sidebar-rFiVen96.js → Sidebar-BV0IDqTS.js} +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/app-shell.js +2 -2
- package/dist/frontend/{auth-client-CXR-7mIO.js → auth-client-C5EyWdAF.js} +416 -349
- package/dist/frontend/components/editor/compact-editor.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/{db-Dya0HRhS.js → db-CgTtukT4.js} +1 -1
- package/dist/frontend/{identity-BOA7Jejv.js → identity-CNhtuCJV.js} +1 -1
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/{settings-BRcYFQa_.js → settings-CHx4wBwb.js} +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/app-shell.js +2 -2
- package/dist/frontend-ssr/assets/{HiAiEditor-Bj6tiE97.js → HiAiEditor-Cj3B2Dt6.js} +2 -2
- package/dist/frontend-ssr/assets/{SettingsDialog-h4SFwpUa.js → SettingsDialog-DAT-Zxu0.js} +4 -4
- package/dist/frontend-ssr/assets/{Sidebar-BFBpsd3L.js → Sidebar-B_Ey6QNL.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-BC4hSFKF.js → auth-client-CITU3xkE.js} +308 -227
- package/dist/frontend-ssr/assets/{db-C3rFdTZa.js → db-DxRzq-kx.js} +1 -1
- package/dist/frontend-ssr/assets/{identity-DNIo1bgc.js → identity-B7ngLQzZ.js} +1 -1
- package/dist/frontend-ssr/assets/{settings-DWCpfCPj.js → settings-BRxvn30Y.js} +1 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lifecycle-runtime.js +4 -1
- package/dist/mcp-cli.js +301 -22
- package/dist/mcp-server.d.ts +92 -23
- package/dist/mcp-server.js +469 -22
- package/dist/types.d.ts +68 -1
- package/package.json +2 -2
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -1
- package/server.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
1
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/broadcast-channel.mjs
|
|
2
2
|
var e = Symbol.for("better-auth:broadcast-channel"), t = () => Math.floor(Date.now() / 1e3), n = class {
|
|
3
3
|
listeners = /* @__PURE__ */ new Set();
|
|
4
4
|
name;
|
|
@@ -132,7 +132,7 @@ var i = Symbol("clean"), a = [], o = 0, s = null, c = 4, l = globalThis.nanostor
|
|
|
132
132
|
};
|
|
133
133
|
});
|
|
134
134
|
//#endregion
|
|
135
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
135
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/equality.mjs
|
|
136
136
|
function b(e) {
|
|
137
137
|
if (typeof e != "object" || !e) return !1;
|
|
138
138
|
let t = Object.getPrototypeOf(e);
|
|
@@ -159,8 +159,8 @@ function S(e, t) {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
163
|
-
var C = Symbol.for("better-auth:focus-manager"),
|
|
162
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/focus-manager.mjs
|
|
163
|
+
var C = Symbol.for("better-auth:focus-manager"), w = class {
|
|
164
164
|
listeners = /* @__PURE__ */ new Set();
|
|
165
165
|
subscribe(e) {
|
|
166
166
|
return this.listeners.add(e), () => {
|
|
@@ -180,12 +180,12 @@ var C = Symbol.for("better-auth:focus-manager"), ee = class {
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
function
|
|
184
|
-
return globalThis[C] || (globalThis[C] = new
|
|
183
|
+
function T() {
|
|
184
|
+
return globalThis[C] || (globalThis[C] = new w()), globalThis[C];
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
188
|
-
var
|
|
187
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/online-manager.mjs
|
|
188
|
+
var E = Symbol.for("better-auth:online-manager"), ee = class {
|
|
189
189
|
listeners = /* @__PURE__ */ new Set();
|
|
190
190
|
isOnline = typeof navigator < "u" ? navigator.onLine : !0;
|
|
191
191
|
subscribe(e) {
|
|
@@ -204,17 +204,17 @@ var T = Symbol.for("better-auth:online-manager"), te = class {
|
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
function
|
|
208
|
-
return globalThis[
|
|
207
|
+
function D() {
|
|
208
|
+
return globalThis[E] || (globalThis[E] = new ee()), globalThis[E];
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
212
|
-
var
|
|
211
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/parser.mjs
|
|
212
|
+
var te = {
|
|
213
213
|
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*:/,
|
|
214
214
|
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*:/,
|
|
215
215
|
protoShort: /"__proto__"\s*:/,
|
|
216
216
|
constructorShort: /"constructor"\s*:/
|
|
217
|
-
},
|
|
217
|
+
}, ne = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/, O = {
|
|
218
218
|
true: !0,
|
|
219
219
|
false: !1,
|
|
220
220
|
null: null,
|
|
@@ -222,30 +222,30 @@ var ne = {
|
|
|
222
222
|
nan: NaN,
|
|
223
223
|
infinity: Infinity,
|
|
224
224
|
"-infinity": -Infinity
|
|
225
|
-
},
|
|
226
|
-
function
|
|
225
|
+
}, re = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;
|
|
226
|
+
function ie(e) {
|
|
227
227
|
return e instanceof Date && !isNaN(e.getTime());
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
let t =
|
|
229
|
+
function ae(e) {
|
|
230
|
+
let t = re.exec(e);
|
|
231
231
|
if (!t) return null;
|
|
232
232
|
let [, n, r, i, a, o, s, c, l, u, d] = t, f = new Date(Date.UTC(parseInt(n, 10), parseInt(r, 10) - 1, parseInt(i, 10), parseInt(a, 10), parseInt(o, 10), parseInt(s, 10), c ? parseInt(c.padEnd(3, "0"), 10) : 0));
|
|
233
233
|
if (l) {
|
|
234
234
|
let e = (parseInt(u, 10) * 60 + parseInt(d, 10)) * (l === "+" ? -1 : 1);
|
|
235
235
|
f.setUTCMinutes(f.getUTCMinutes() + e);
|
|
236
236
|
}
|
|
237
|
-
return
|
|
237
|
+
return ie(f) ? f : null;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function oe(e, t = {}) {
|
|
240
240
|
let { strict: n = !1, warnings: r = !1, reviver: i, parseDates: a = !0 } = t;
|
|
241
241
|
if (typeof e != "string") return e;
|
|
242
242
|
let o = e.trim(), s = o.toLowerCase();
|
|
243
|
-
if (s.length <= 9 && s in
|
|
244
|
-
if (!
|
|
243
|
+
if (s.length <= 9 && s in O) return O[s];
|
|
244
|
+
if (!ne.test(o)) {
|
|
245
245
|
if (n) throw SyntaxError("[better-json] Invalid JSON");
|
|
246
246
|
return e;
|
|
247
247
|
}
|
|
248
|
-
if (Object.entries(
|
|
248
|
+
if (Object.entries(te).some(([e, t]) => {
|
|
249
249
|
let n = t.test(o);
|
|
250
250
|
return n && r && console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`), n;
|
|
251
251
|
}) && n) throw Error("[better-json] Potential prototype pollution attempt detected");
|
|
@@ -256,7 +256,7 @@ function se(e, t = {}) {
|
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
if (a && typeof t == "string") {
|
|
259
|
-
let e =
|
|
259
|
+
let e = ae(t);
|
|
260
260
|
if (e) return e;
|
|
261
261
|
}
|
|
262
262
|
return i ? i(e, t) : t;
|
|
@@ -266,29 +266,36 @@ function se(e, t = {}) {
|
|
|
266
266
|
return e;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
269
|
+
function se(e, t = { strict: !0 }) {
|
|
270
|
+
return oe(e, t);
|
|
271
271
|
}
|
|
272
272
|
//#endregion
|
|
273
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
274
|
-
var
|
|
275
|
-
function
|
|
273
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/query-atom.mjs
|
|
274
|
+
var ce = Symbol.for("better-auth:auth-query");
|
|
275
|
+
function le(e) {
|
|
276
|
+
let t = /* @__PURE__ */ d(e);
|
|
277
|
+
return Object.defineProperty(t, ce, { value: !0 }), t;
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/session-refresh.mjs
|
|
281
|
+
var k = () => Math.floor(Date.now() / 1e3), ue = 5;
|
|
282
|
+
function de(e) {
|
|
276
283
|
let { fetchSession: t, shouldPollSession: n = () => !0, sessionSignal: i, options: a = {} } = e, o = a.sessionOptions?.refetchInterval ?? 0, s = a.sessionOptions?.refetchOnWindowFocus ?? !0, c = a.sessionOptions?.refetchWhenOffline ?? !1, l = {
|
|
277
284
|
isInitialized: !1,
|
|
278
285
|
lastSessionRequest: 0
|
|
279
|
-
}, u = () => c ||
|
|
286
|
+
}, u = () => c || D().isOnline, d = (e) => {
|
|
280
287
|
if (u()) {
|
|
281
288
|
if (e?.event === "storage") {
|
|
282
289
|
t();
|
|
283
290
|
return;
|
|
284
291
|
}
|
|
285
292
|
if (e?.event === "poll") {
|
|
286
|
-
l.lastSessionRequest =
|
|
293
|
+
l.lastSessionRequest = k(), t();
|
|
287
294
|
return;
|
|
288
295
|
}
|
|
289
296
|
if (e?.event === "visibilitychange") {
|
|
290
|
-
if (
|
|
291
|
-
l.lastSessionRequest =
|
|
297
|
+
if (k() - l.lastSessionRequest < ue) return;
|
|
298
|
+
l.lastSessionRequest = k(), t();
|
|
292
299
|
return;
|
|
293
300
|
}
|
|
294
301
|
t();
|
|
@@ -308,11 +315,11 @@ function ue(e) {
|
|
|
308
315
|
d({ event: "storage" });
|
|
309
316
|
});
|
|
310
317
|
}, h = () => {
|
|
311
|
-
s && (l.unsubscribeFocus =
|
|
318
|
+
s && (l.unsubscribeFocus = T().subscribe(() => {
|
|
312
319
|
d({ event: "visibilitychange" });
|
|
313
320
|
}));
|
|
314
321
|
}, g = () => {
|
|
315
|
-
l.unsubscribeOnline =
|
|
322
|
+
l.unsubscribeOnline = D().subscribe((e) => {
|
|
316
323
|
e && d({ event: "visibilitychange" });
|
|
317
324
|
});
|
|
318
325
|
}, _ = () => {
|
|
@@ -322,7 +329,7 @@ function ue(e) {
|
|
|
322
329
|
};
|
|
323
330
|
return {
|
|
324
331
|
init: () => {
|
|
325
|
-
l.isInitialized || (l.isInitialized = !0, p(), m(), h(), g(), _(), l.cleanupBroadcastSetup = r().setup(), l.cleanupFocusSetup =
|
|
332
|
+
l.isInitialized || (l.isInitialized = !0, p(), m(), h(), g(), _(), l.cleanupBroadcastSetup = r().setup(), l.cleanupFocusSetup = T().setup(), l.cleanupOnlineSetup = D().setup());
|
|
326
333
|
},
|
|
327
334
|
cleanup: () => {
|
|
328
335
|
l.isInitialized && (l.pollInterval &&= (clearInterval(l.pollInterval), void 0), l.unsubscribeBroadcast &&= (l.unsubscribeBroadcast(), void 0), l.unsubscribeFocus &&= (l.unsubscribeFocus(), void 0), l.unsubscribeOnline &&= (l.unsubscribeOnline(), void 0), l.unsubscribeSignal &&= (l.unsubscribeSignal(), void 0), l.cleanupBroadcastSetup &&= (l.cleanupBroadcastSetup(), void 0), l.cleanupFocusSetup &&= (l.cleanupFocusSetup(), void 0), l.cleanupOnlineSetup &&= (l.cleanupOnlineSetup(), void 0), l.isInitialized = !1, l.lastSessionRequest = 0);
|
|
@@ -332,75 +339,75 @@ function ue(e) {
|
|
|
332
339
|
};
|
|
333
340
|
}
|
|
334
341
|
//#endregion
|
|
335
|
-
//#region ../node_modules/.bun/@better-auth+core@1.7.
|
|
336
|
-
var
|
|
342
|
+
//#region ../node_modules/.bun/@better-auth+core@1.7.7+8ae2bbeb20d4d3e3/node_modules/@better-auth/core/dist/env/env-impl.mjs
|
|
343
|
+
var A = Object.create(null), j = (e) => globalThis.process?.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? A : globalThis), M = new Proxy(A, {
|
|
337
344
|
get(e, t) {
|
|
338
|
-
return
|
|
345
|
+
return j()[t] ?? A[t];
|
|
339
346
|
},
|
|
340
347
|
has(e, t) {
|
|
341
|
-
return t in
|
|
348
|
+
return t in j() || t in A;
|
|
342
349
|
},
|
|
343
350
|
set(e, t, n) {
|
|
344
|
-
let r =
|
|
351
|
+
let r = j(!0);
|
|
345
352
|
return r[t] = n, !0;
|
|
346
353
|
},
|
|
347
354
|
deleteProperty(e, t) {
|
|
348
355
|
if (!t) return !1;
|
|
349
|
-
let n =
|
|
356
|
+
let n = j(!0);
|
|
350
357
|
return delete n[t], !0;
|
|
351
358
|
},
|
|
352
359
|
ownKeys() {
|
|
353
|
-
let e =
|
|
360
|
+
let e = j(!0);
|
|
354
361
|
return Object.keys(e);
|
|
355
362
|
}
|
|
356
363
|
});
|
|
357
|
-
|
|
358
|
-
function
|
|
364
|
+
M.NODE_ENV;
|
|
365
|
+
function N(e, t) {
|
|
359
366
|
return typeof process < "u" && process.env ? process.env[e] ?? t : typeof Deno < "u" ? Deno.env.get(e) ?? t : typeof Bun < "u" ? Bun.env[e] ?? t : t;
|
|
360
367
|
}
|
|
361
368
|
Object.freeze({
|
|
362
369
|
get BETTER_AUTH_SECRET() {
|
|
363
|
-
return
|
|
370
|
+
return N("BETTER_AUTH_SECRET");
|
|
364
371
|
},
|
|
365
372
|
get AUTH_SECRET() {
|
|
366
|
-
return
|
|
373
|
+
return N("AUTH_SECRET");
|
|
367
374
|
},
|
|
368
375
|
get BETTER_AUTH_TELEMETRY() {
|
|
369
|
-
return
|
|
376
|
+
return N("BETTER_AUTH_TELEMETRY");
|
|
370
377
|
},
|
|
371
378
|
get BETTER_AUTH_TELEMETRY_ID() {
|
|
372
|
-
return
|
|
379
|
+
return N("BETTER_AUTH_TELEMETRY_ID");
|
|
373
380
|
},
|
|
374
381
|
get NODE_ENV() {
|
|
375
|
-
return
|
|
382
|
+
return N("NODE_ENV", "development");
|
|
376
383
|
},
|
|
377
384
|
get PACKAGE_VERSION() {
|
|
378
|
-
return
|
|
385
|
+
return N("PACKAGE_VERSION", "0.0.0");
|
|
379
386
|
},
|
|
380
387
|
get BETTER_AUTH_TELEMETRY_ENDPOINT() {
|
|
381
|
-
return
|
|
388
|
+
return N("BETTER_AUTH_TELEMETRY_ENDPOINT", "");
|
|
382
389
|
}
|
|
383
390
|
});
|
|
384
391
|
//#endregion
|
|
385
392
|
//#region ../node_modules/.bun/better-call@1.4.0+969a6d035afea0f4/node_modules/better-call/dist/error.mjs
|
|
386
|
-
function
|
|
393
|
+
function fe() {
|
|
387
394
|
let e = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
388
395
|
return e === void 0 ? Object.isExtensible(Error) : Object.prototype.hasOwnProperty.call(e, "writable") ? e.writable : e.set !== void 0;
|
|
389
396
|
}
|
|
390
|
-
function
|
|
397
|
+
function pe(e) {
|
|
391
398
|
let t = e.split("\n at ");
|
|
392
399
|
return t.length <= 1 ? e : (t.splice(1, 1), t.join("\n at "));
|
|
393
400
|
}
|
|
394
|
-
function
|
|
401
|
+
function me(e, t) {
|
|
395
402
|
class n extends e {
|
|
396
403
|
#e;
|
|
397
404
|
constructor(...e) {
|
|
398
|
-
if (
|
|
405
|
+
if (fe()) {
|
|
399
406
|
let t = Error.stackTraceLimit;
|
|
400
407
|
Error.stackTraceLimit = 0, super(...e), Error.stackTraceLimit = t;
|
|
401
408
|
} else super(...e);
|
|
402
409
|
let t = (/* @__PURE__ */ Error()).stack;
|
|
403
|
-
t && (this.#e =
|
|
410
|
+
t && (this.#e = pe(t.replace(/^Error/, this.name)));
|
|
404
411
|
}
|
|
405
412
|
get errorStack() {
|
|
406
413
|
return this.#e;
|
|
@@ -414,7 +421,7 @@ function pe(e, t) {
|
|
|
414
421
|
configurable: !0
|
|
415
422
|
}), n;
|
|
416
423
|
}
|
|
417
|
-
var
|
|
424
|
+
var he = {
|
|
418
425
|
OK: 200,
|
|
419
426
|
CREATED: 201,
|
|
420
427
|
ACCEPTED: 202,
|
|
@@ -466,48 +473,48 @@ var me = {
|
|
|
466
473
|
NOT_EXTENDED: 510,
|
|
467
474
|
NETWORK_AUTHENTICATION_REQUIRED: 511
|
|
468
475
|
};
|
|
469
|
-
|
|
476
|
+
me(class extends Error {
|
|
470
477
|
status;
|
|
471
478
|
body;
|
|
472
479
|
headers;
|
|
473
480
|
statusCode;
|
|
474
|
-
constructor(e = "INTERNAL_SERVER_ERROR", t = void 0, n = {}, r = typeof e == "number" ? e :
|
|
481
|
+
constructor(e = "INTERNAL_SERVER_ERROR", t = void 0, n = {}, r = typeof e == "number" ? e : he[e]) {
|
|
475
482
|
super(t?.message, t?.cause ? { cause: t.cause } : void 0), this.status = e, this.body = t, this.headers = n, this.statusCode = r, this.name = "APIError", this.status = e, this.headers = n, this.statusCode = r, this.body = t;
|
|
476
483
|
}
|
|
477
484
|
}, Error);
|
|
478
485
|
//#endregion
|
|
479
|
-
//#region ../node_modules/.bun/@better-auth+core@1.7.
|
|
480
|
-
var
|
|
486
|
+
//#region ../node_modules/.bun/@better-auth+core@1.7.7+8ae2bbeb20d4d3e3/node_modules/@better-auth/core/dist/error/index.mjs
|
|
487
|
+
var P = class extends Error {
|
|
481
488
|
constructor(e, t) {
|
|
482
489
|
super(e, t), this.name = "BetterAuthError", this.message = e, this.stack = "";
|
|
483
490
|
}
|
|
484
|
-
},
|
|
485
|
-
function
|
|
491
|
+
}, ge = 47;
|
|
492
|
+
function F(e) {
|
|
486
493
|
let t = e.length;
|
|
487
|
-
for (; t > 0 && e.charCodeAt(t - 1) ===
|
|
494
|
+
for (; t > 0 && e.charCodeAt(t - 1) === ge;) t--;
|
|
488
495
|
return t === e.length ? e : e.slice(0, t);
|
|
489
496
|
}
|
|
490
|
-
function
|
|
497
|
+
function _e(e) {
|
|
491
498
|
try {
|
|
492
|
-
return (
|
|
499
|
+
return (F(new URL(e).pathname) || "/") !== "/";
|
|
493
500
|
} catch {
|
|
494
|
-
throw new
|
|
501
|
+
throw new P(`Invalid base URL: ${e}. Please provide a valid base URL.`);
|
|
495
502
|
}
|
|
496
503
|
}
|
|
497
|
-
function
|
|
504
|
+
function ve(e) {
|
|
498
505
|
try {
|
|
499
506
|
let t = new URL(e);
|
|
500
|
-
if (t.protocol !== "http:" && t.protocol !== "https:") throw new
|
|
507
|
+
if (t.protocol !== "http:" && t.protocol !== "https:") throw new P(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`);
|
|
501
508
|
} catch (t) {
|
|
502
|
-
throw t instanceof
|
|
509
|
+
throw t instanceof P ? t : new P(`Invalid base URL: ${e}. Please provide a valid base URL.`, { cause: t });
|
|
503
510
|
}
|
|
504
511
|
}
|
|
505
|
-
function
|
|
506
|
-
if (
|
|
507
|
-
let n =
|
|
512
|
+
function I(e, t = "/api/auth") {
|
|
513
|
+
if (ve(e), _e(e)) return e;
|
|
514
|
+
let n = F(e);
|
|
508
515
|
return !t || t === "/" ? n : (t = t.startsWith("/") ? t : `/${t}`, `${n}${t}`);
|
|
509
516
|
}
|
|
510
|
-
function
|
|
517
|
+
function L(e, t) {
|
|
511
518
|
return !e || e.trim() === "" ? !1 : t === "proto" ? e === "http" || e === "https" : t === "host" ? [
|
|
512
519
|
/\.\./,
|
|
513
520
|
/\0/,
|
|
@@ -519,24 +526,24 @@ function I(e, t) {
|
|
|
519
526
|
/data:/i
|
|
520
527
|
].some((t) => t.test(e)) ? !1 : /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e) || /^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e) || /^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e) || /^localhost(:[0-9]{1,5})?$/i.test(e) : !1;
|
|
521
528
|
}
|
|
522
|
-
function
|
|
523
|
-
if (e) return
|
|
529
|
+
function ye(e, t, n, r, i) {
|
|
530
|
+
if (e) return I(e, t);
|
|
524
531
|
if (r !== !1) {
|
|
525
|
-
let e =
|
|
526
|
-
if (e) return
|
|
532
|
+
let e = M.BETTER_AUTH_URL || M.NEXT_PUBLIC_BETTER_AUTH_URL || M.PUBLIC_BETTER_AUTH_URL || M.NUXT_PUBLIC_BETTER_AUTH_URL || M.NUXT_PUBLIC_AUTH_URL || (M.BASE_URL === "/" ? void 0 : M.BASE_URL);
|
|
533
|
+
if (e) return I(e, t);
|
|
527
534
|
}
|
|
528
535
|
let a = n?.headers.get("x-forwarded-host"), o = n?.headers.get("x-forwarded-proto");
|
|
529
|
-
if (a && o && i &&
|
|
530
|
-
return
|
|
536
|
+
if (a && o && i && L(o, "proto") && L(a, "host")) try {
|
|
537
|
+
return I(`${o}://${a}`, t);
|
|
531
538
|
} catch {}
|
|
532
539
|
if (n) {
|
|
533
|
-
let e =
|
|
534
|
-
if (!e) throw new
|
|
535
|
-
return
|
|
540
|
+
let e = be(n.url);
|
|
541
|
+
if (!e) throw new P("Could not get origin from request. Please provide a valid base URL.");
|
|
542
|
+
return I(e, t);
|
|
536
543
|
}
|
|
537
|
-
if (typeof window < "u" && window.location) return
|
|
544
|
+
if (typeof window < "u" && window.location) return I(window.location.origin, t);
|
|
538
545
|
}
|
|
539
|
-
function
|
|
546
|
+
function be(e) {
|
|
540
547
|
try {
|
|
541
548
|
let t = new URL(e);
|
|
542
549
|
return t.origin === "null" ? null : t.origin;
|
|
@@ -545,33 +552,33 @@ function ye(e) {
|
|
|
545
552
|
}
|
|
546
553
|
}
|
|
547
554
|
//#endregion
|
|
548
|
-
//#region ../node_modules/.bun/@better-auth+core@1.7.
|
|
549
|
-
var
|
|
555
|
+
//#region ../node_modules/.bun/@better-auth+core@1.7.7+8ae2bbeb20d4d3e3/node_modules/@better-auth/core/dist/utils/url.mjs
|
|
556
|
+
var xe = [
|
|
550
557
|
"javascript:",
|
|
551
558
|
"data:",
|
|
552
559
|
"vbscript:"
|
|
553
560
|
];
|
|
554
|
-
function
|
|
561
|
+
function Se(e) {
|
|
555
562
|
let t;
|
|
556
563
|
try {
|
|
557
564
|
t = new URL(e);
|
|
558
565
|
} catch {
|
|
559
566
|
return !0;
|
|
560
567
|
}
|
|
561
|
-
return !
|
|
568
|
+
return !xe.includes(t.protocol);
|
|
562
569
|
}
|
|
563
570
|
//#endregion
|
|
564
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
565
|
-
var
|
|
571
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/fetch-plugins.mjs
|
|
572
|
+
var Ce = {
|
|
566
573
|
id: "redirect",
|
|
567
574
|
name: "Redirect",
|
|
568
575
|
hooks: { onSuccess(e) {
|
|
569
|
-
if (e.data?.url && e.data?.redirect &&
|
|
576
|
+
if (e.data?.url && e.data?.redirect && Se(e.data.url) && typeof window < "u" && window.location && window.location) try {
|
|
570
577
|
window.location.href = e.data.url;
|
|
571
578
|
} catch {}
|
|
572
579
|
} }
|
|
573
|
-
},
|
|
574
|
-
function
|
|
580
|
+
}, we = () => typeof window > "u", Te = v;
|
|
581
|
+
function Ee(e, t) {
|
|
575
582
|
if (typeof window > "u") return;
|
|
576
583
|
let n = e.get();
|
|
577
584
|
n.data === null && t !== null && e.set({
|
|
@@ -581,31 +588,31 @@ function Te(e, t) {
|
|
|
581
588
|
isPending: !1
|
|
582
589
|
});
|
|
583
590
|
}
|
|
584
|
-
function
|
|
591
|
+
function R(e) {
|
|
585
592
|
return typeof e == "object" && e && "data" in e && "error" in e ? e : {
|
|
586
593
|
data: e,
|
|
587
594
|
error: null
|
|
588
595
|
};
|
|
589
596
|
}
|
|
590
|
-
function
|
|
597
|
+
function De(e) {
|
|
591
598
|
return !e || e.session === null && e.user === null ? null : e;
|
|
592
599
|
}
|
|
593
|
-
function
|
|
600
|
+
function Oe(e, t) {
|
|
594
601
|
return x(e.data, t.data) && e.error === t.error && e.isPending === t.isPending && e.isRefetching === t.isRefetching && e.refetch === t.refetch;
|
|
595
602
|
}
|
|
596
|
-
function
|
|
603
|
+
function ke(e, t) {
|
|
597
604
|
let n = /* @__PURE__ */ d(!1), r, i = 0, a = 0;
|
|
598
605
|
n.listen(() => {
|
|
599
606
|
a++, i = 0;
|
|
600
607
|
});
|
|
601
|
-
let o = (e) => u(e), s =
|
|
608
|
+
let o = (e) => u(e), s = le({
|
|
602
609
|
data: null,
|
|
603
610
|
error: null,
|
|
604
611
|
isPending: !0,
|
|
605
612
|
isRefetching: !1,
|
|
606
613
|
refetch: o
|
|
607
614
|
});
|
|
608
|
-
S(s,
|
|
615
|
+
S(s, Oe);
|
|
609
616
|
let c = async (t, n) => {
|
|
610
617
|
let r = s.value;
|
|
611
618
|
if (s.set({
|
|
@@ -622,14 +629,14 @@ function Oe(e, t) {
|
|
|
622
629
|
signal: t
|
|
623
630
|
});
|
|
624
631
|
if (t.aborted) return "aborted";
|
|
625
|
-
let { data: i, error: a } =
|
|
632
|
+
let { data: i, error: a } = R(r), c = "fresh";
|
|
626
633
|
if (i?.needsRefresh) try {
|
|
627
634
|
let n = await e("/get-session", {
|
|
628
635
|
method: "POST",
|
|
629
636
|
signal: t
|
|
630
637
|
});
|
|
631
638
|
if (t.aborted) return "aborted";
|
|
632
|
-
({data: i, error: a} =
|
|
639
|
+
({data: i, error: a} = R(n));
|
|
633
640
|
} catch {
|
|
634
641
|
if (t.aborted) return "aborted";
|
|
635
642
|
c = "stale";
|
|
@@ -644,7 +651,7 @@ function Oe(e, t) {
|
|
|
644
651
|
refetch: o
|
|
645
652
|
}), "failed";
|
|
646
653
|
}
|
|
647
|
-
let l =
|
|
654
|
+
let l = De(i), u = s.value, d = u.data != null && l != null && x(u.data, l) ? u.data : l;
|
|
648
655
|
return s.set({
|
|
649
656
|
data: d,
|
|
650
657
|
error: null,
|
|
@@ -665,7 +672,7 @@ function Oe(e, t) {
|
|
|
665
672
|
}
|
|
666
673
|
}, l = () => {
|
|
667
674
|
let e = s.value.data?.session?.expiresAt, t = e instanceof Date ? e.getTime() : Infinity;
|
|
668
|
-
return Math.min(Date.now() +
|
|
675
|
+
return Math.min(Date.now() + Te, t);
|
|
669
676
|
}, u = (e) => {
|
|
670
677
|
i = 0, r?.cancel();
|
|
671
678
|
let t = new AbortController(), n = {
|
|
@@ -681,10 +688,10 @@ function Oe(e, t) {
|
|
|
681
688
|
}, f = () => r?.revision === a ? r.promise.then(() => void 0) : Date.now() < i ? Promise.resolve() : u(), p = () => {};
|
|
682
689
|
return y(s, () => {
|
|
683
690
|
let e;
|
|
684
|
-
|
|
691
|
+
we() || (e = setTimeout(() => {
|
|
685
692
|
f();
|
|
686
693
|
}, 0));
|
|
687
|
-
let r =
|
|
694
|
+
let r = de({
|
|
688
695
|
fetchSession: u,
|
|
689
696
|
shouldPollSession: () => s.value.data != null,
|
|
690
697
|
sessionSignal: n,
|
|
@@ -701,38 +708,29 @@ function Oe(e, t) {
|
|
|
701
708
|
}
|
|
702
709
|
//#endregion
|
|
703
710
|
//#region ../node_modules/.bun/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
704
|
-
function
|
|
711
|
+
function z(e) {
|
|
705
712
|
if (typeof e != "object" || !e) return !1;
|
|
706
713
|
let t = Object.getPrototypeOf(e);
|
|
707
714
|
return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null || Symbol.iterator in e ? !1 : Symbol.toStringTag in e ? Object.prototype.toString.call(e) === "[object Module]" : !0;
|
|
708
715
|
}
|
|
709
|
-
function
|
|
710
|
-
if (!
|
|
716
|
+
function B(e, t, n = ".", r) {
|
|
717
|
+
if (!z(t)) return B(e, {}, n, r);
|
|
711
718
|
let i = { ...t };
|
|
712
719
|
for (let t of Object.keys(e)) {
|
|
713
720
|
if (t === "__proto__" || t === "constructor") continue;
|
|
714
721
|
let a = e[t];
|
|
715
|
-
a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] :
|
|
722
|
+
a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] : z(a) && z(i[t]) ? B(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
|
|
716
723
|
}
|
|
717
724
|
return i;
|
|
718
725
|
}
|
|
719
|
-
function
|
|
720
|
-
return (...t) => t.reduce((t, n) =>
|
|
726
|
+
function Ae(e) {
|
|
727
|
+
return (...t) => t.reduce((t, n) => B(t, n, "", e), {});
|
|
721
728
|
}
|
|
722
|
-
var
|
|
723
|
-
enumerable: !0,
|
|
724
|
-
configurable: !0,
|
|
725
|
-
writable: !0,
|
|
726
|
-
value: n
|
|
727
|
-
}) : e[t] = n, H = (e, t) => {
|
|
728
|
-
for (var n in t ||= {}) Pe.call(t, n) && V(e, n, t[n]);
|
|
729
|
-
if (B) for (var n of B(t)) Fe.call(t, n) && V(e, n, t[n]);
|
|
730
|
-
return e;
|
|
731
|
-
}, U = (e, t) => Me(e, Ne(t)), Ie = class extends Error {
|
|
729
|
+
var je = Ae(), Me = class extends Error {
|
|
732
730
|
constructor(e, t, n) {
|
|
733
731
|
super(t || e.toString(), { cause: n }), this.status = e, this.statusText = t, this.error = n, Error.captureStackTrace(this, this.constructor);
|
|
734
732
|
}
|
|
735
|
-
},
|
|
733
|
+
}, Ne = async (e, t) => {
|
|
736
734
|
let n = t || {}, r = {
|
|
737
735
|
onRequest: [t?.onRequest],
|
|
738
736
|
onResponse: [t?.onResponse],
|
|
@@ -747,8 +745,8 @@ var Ae = ke(), je = Object.defineProperty, Me = Object.defineProperties, Ne = Ob
|
|
|
747
745
|
};
|
|
748
746
|
for (let i of t?.plugins || []) {
|
|
749
747
|
if (i.init) {
|
|
750
|
-
let
|
|
751
|
-
n =
|
|
748
|
+
let t = await i.init?.call(i, e.toString(), n);
|
|
749
|
+
n = t.options || n, e = t.url;
|
|
752
750
|
}
|
|
753
751
|
r.onRequest.push(i.hooks?.onRequest), r.onResponse.push(i.hooks?.onResponse), r.onSuccess.push(i.hooks?.onSuccess), r.onError.push(i.hooks?.onError), r.onRetry.push(i.hooks?.onRetry);
|
|
754
752
|
}
|
|
@@ -757,7 +755,7 @@ var Ae = ke(), je = Object.defineProperty, Me = Object.defineProperties, Ne = Ob
|
|
|
757
755
|
options: n,
|
|
758
756
|
hooks: r
|
|
759
757
|
};
|
|
760
|
-
},
|
|
758
|
+
}, V = class {
|
|
761
759
|
constructor(e) {
|
|
762
760
|
this.options = e;
|
|
763
761
|
}
|
|
@@ -767,7 +765,7 @@ var Ae = ke(), je = Object.defineProperty, Me = Object.defineProperties, Ne = Ob
|
|
|
767
765
|
getDelay() {
|
|
768
766
|
return this.options.delay;
|
|
769
767
|
}
|
|
770
|
-
},
|
|
768
|
+
}, Pe = class {
|
|
771
769
|
constructor(e) {
|
|
772
770
|
this.options = e;
|
|
773
771
|
}
|
|
@@ -778,19 +776,79 @@ var Ae = ke(), je = Object.defineProperty, Me = Object.defineProperties, Ne = Ob
|
|
|
778
776
|
return Math.min(this.options.maxDelay, this.options.baseDelay * 2 ** e);
|
|
779
777
|
}
|
|
780
778
|
};
|
|
781
|
-
function
|
|
782
|
-
if (typeof e == "number") return new
|
|
779
|
+
function Fe(e) {
|
|
780
|
+
if (typeof e == "number") return new V({
|
|
783
781
|
type: "linear",
|
|
784
782
|
attempts: e,
|
|
785
783
|
delay: 1e3
|
|
786
784
|
});
|
|
787
785
|
switch (e.type) {
|
|
788
|
-
case "linear": return new
|
|
789
|
-
case "exponential": return new
|
|
786
|
+
case "linear": return new V(e);
|
|
787
|
+
case "exponential": return new Pe(e);
|
|
790
788
|
default: throw Error("Invalid retry strategy");
|
|
791
789
|
}
|
|
792
790
|
}
|
|
793
|
-
var
|
|
791
|
+
var Ie = [
|
|
792
|
+
"get",
|
|
793
|
+
"post",
|
|
794
|
+
"put",
|
|
795
|
+
"patch",
|
|
796
|
+
"delete"
|
|
797
|
+
];
|
|
798
|
+
function H(e) {
|
|
799
|
+
if (!e.startsWith("@")) return {
|
|
800
|
+
method: void 0,
|
|
801
|
+
path: e
|
|
802
|
+
};
|
|
803
|
+
let t = e.indexOf("/"), n = e.slice(1, t === -1 ? void 0 : t);
|
|
804
|
+
return Ie.includes(n) ? {
|
|
805
|
+
method: n,
|
|
806
|
+
path: t === -1 ? e : e.slice(t + 1)
|
|
807
|
+
} : {
|
|
808
|
+
method: void 0,
|
|
809
|
+
path: e
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
var Le = (e) => e === "." || e === "..", Re = (e) => e.split(":").map((e) => encodeURIComponent(e)).join(":");
|
|
813
|
+
function ze(e, t) {
|
|
814
|
+
let n = t.get(e);
|
|
815
|
+
if (n === void 0) return Re(e);
|
|
816
|
+
if (Le(n)) throw TypeError("Path parameters cannot be reserved path segments");
|
|
817
|
+
return encodeURIComponent(n);
|
|
818
|
+
}
|
|
819
|
+
function Be(e, t) {
|
|
820
|
+
let { baseURL: n, params: r, query: i } = t || {
|
|
821
|
+
query: {},
|
|
822
|
+
params: {},
|
|
823
|
+
baseURL: ""
|
|
824
|
+
}, a = e.startsWith("http") ? e.split("/").slice(0, 3).join("/") : n || "", { path: o } = H(e);
|
|
825
|
+
o !== e && (e = `/${o}`), a.endsWith("/") || (a += "/");
|
|
826
|
+
let [s, c] = e.replace(a, "").split("?"), l = new URLSearchParams(c);
|
|
827
|
+
for (let [e, t] of Object.entries(i || {})) {
|
|
828
|
+
if (t == null) continue;
|
|
829
|
+
let n;
|
|
830
|
+
if (typeof t == "string") n = t;
|
|
831
|
+
else if (Array.isArray(t)) {
|
|
832
|
+
for (let n of t) l.append(e, n);
|
|
833
|
+
continue;
|
|
834
|
+
} else n = JSON.stringify(t);
|
|
835
|
+
l.set(e, n);
|
|
836
|
+
}
|
|
837
|
+
let u = /* @__PURE__ */ new Map();
|
|
838
|
+
if (r) {
|
|
839
|
+
if (Array.isArray(r)) {
|
|
840
|
+
let e = s.split("/").filter((e) => e.startsWith(":"));
|
|
841
|
+
for (let [t, n] of e.entries()) {
|
|
842
|
+
let e = r[t];
|
|
843
|
+
u.set(n, String(e));
|
|
844
|
+
}
|
|
845
|
+
} else for (let [e, t] of Object.entries(r)) u.set(`:${e}`, String(t));
|
|
846
|
+
}
|
|
847
|
+
s = s.split("/").map((e) => ze(e, u)).join("/"), s = s.replace(/^\/+/, "");
|
|
848
|
+
let d = l.toString();
|
|
849
|
+
return d = d.length > 0 ? `?${d}`.replace(/\+/g, "%20") : "", a.startsWith("http") ? new URL(`${s}${d}`, a) : `${a}${s}${d}`;
|
|
850
|
+
}
|
|
851
|
+
var Ve = async (e) => {
|
|
794
852
|
let t = {}, n = async (e) => typeof e == "function" ? await e() : e;
|
|
795
853
|
if (e?.auth) {
|
|
796
854
|
if (e.auth.type === "Bearer") {
|
|
@@ -808,8 +866,8 @@ var Be = async (e) => {
|
|
|
808
866
|
}
|
|
809
867
|
}
|
|
810
868
|
return t;
|
|
811
|
-
},
|
|
812
|
-
function
|
|
869
|
+
}, He = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
|
|
870
|
+
function Ue(e) {
|
|
813
871
|
let t = e.headers.get("content-type"), n = /* @__PURE__ */ new Set([
|
|
814
872
|
"image/svg",
|
|
815
873
|
"application/xml",
|
|
@@ -818,37 +876,37 @@ function He(e) {
|
|
|
818
876
|
]);
|
|
819
877
|
if (!t) return "json";
|
|
820
878
|
let r = t.split(";").shift() || "";
|
|
821
|
-
return
|
|
879
|
+
return He.test(r) ? "json" : n.has(r) || r.startsWith("text/") ? "text" : "blob";
|
|
822
880
|
}
|
|
823
|
-
function
|
|
881
|
+
function We(e) {
|
|
824
882
|
try {
|
|
825
883
|
return JSON.parse(e), !0;
|
|
826
884
|
} catch {
|
|
827
885
|
return !1;
|
|
828
886
|
}
|
|
829
887
|
}
|
|
830
|
-
function
|
|
888
|
+
function U(e) {
|
|
831
889
|
if (e === void 0) return !1;
|
|
832
890
|
let t = typeof e;
|
|
833
891
|
return t === "string" || t === "number" || t === "boolean" || t === null ? !0 : t === "object" ? Array.isArray(e) ? !0 : e.buffer ? !1 : e.constructor && e.constructor.name === "Object" || typeof e.toJSON == "function" : !1;
|
|
834
892
|
}
|
|
835
|
-
function
|
|
893
|
+
function W(e) {
|
|
836
894
|
try {
|
|
837
895
|
return JSON.parse(e);
|
|
838
896
|
} catch {
|
|
839
897
|
return e;
|
|
840
898
|
}
|
|
841
899
|
}
|
|
842
|
-
function
|
|
900
|
+
function G(e) {
|
|
843
901
|
return typeof e == "function";
|
|
844
902
|
}
|
|
845
|
-
function
|
|
903
|
+
function Ge(e) {
|
|
846
904
|
if (e?.customFetchImpl) return e.customFetchImpl;
|
|
847
|
-
if (typeof globalThis < "u" &&
|
|
848
|
-
if (typeof window < "u" &&
|
|
905
|
+
if (typeof globalThis < "u" && G(globalThis.fetch)) return globalThis.fetch;
|
|
906
|
+
if (typeof window < "u" && G(window.fetch)) return window.fetch;
|
|
849
907
|
throw Error("No fetch implementation found");
|
|
850
908
|
}
|
|
851
|
-
function
|
|
909
|
+
function K(...e) {
|
|
852
910
|
let t = {};
|
|
853
911
|
for (let n of e) if (n) {
|
|
854
912
|
if (n instanceof Headers) n.forEach((e, n) => {
|
|
@@ -861,34 +919,31 @@ function J(...e) {
|
|
|
861
919
|
}
|
|
862
920
|
return t;
|
|
863
921
|
}
|
|
864
|
-
async function
|
|
865
|
-
let t = new Headers(
|
|
922
|
+
async function Ke(e) {
|
|
923
|
+
let t = new Headers(K(e?.headers, await Ve(e)));
|
|
866
924
|
if (!t.has("content-type")) {
|
|
867
|
-
let n =
|
|
925
|
+
let n = qe(e?.body);
|
|
868
926
|
n && t.set("content-type", n);
|
|
869
927
|
}
|
|
870
928
|
return t;
|
|
871
929
|
}
|
|
872
|
-
function Ke(e) {
|
|
873
|
-
return G(e) ? "application/json" : null;
|
|
874
|
-
}
|
|
875
930
|
function qe(e) {
|
|
931
|
+
return U(e) ? "application/json" : null;
|
|
932
|
+
}
|
|
933
|
+
function Je(e) {
|
|
876
934
|
let t = e.get("content-type");
|
|
877
935
|
return t ? t.split(";")[0].trim().toLowerCase() : null;
|
|
878
936
|
}
|
|
879
|
-
function
|
|
937
|
+
function Ye(e, t) {
|
|
880
938
|
let { body: n } = e;
|
|
881
|
-
return n ? !
|
|
939
|
+
return n ? !U(n) || typeof n == "string" ? n : Je(t) === "application/x-www-form-urlencoded" ? new URLSearchParams(n).toString() : JSON.stringify(n) : null;
|
|
882
940
|
}
|
|
883
|
-
function
|
|
941
|
+
function Xe(e, t) {
|
|
884
942
|
if (t?.method) return t.method.toUpperCase();
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
return X.includes(n) ? n.toUpperCase() : t?.body ? "POST" : "GET";
|
|
888
|
-
}
|
|
889
|
-
return t?.body ? "POST" : "GET";
|
|
943
|
+
let { method: n } = H(e);
|
|
944
|
+
return n ? n.toUpperCase() : t?.body ? "POST" : "GET";
|
|
890
945
|
}
|
|
891
|
-
function
|
|
946
|
+
function Ze(e, t) {
|
|
892
947
|
let n;
|
|
893
948
|
return !e?.signal && e?.timeout && (n = setTimeout(() => t?.abort(), e?.timeout)), {
|
|
894
949
|
abortTimeout: n,
|
|
@@ -897,73 +952,199 @@ function Xe(e, t) {
|
|
|
897
952
|
}
|
|
898
953
|
};
|
|
899
954
|
}
|
|
900
|
-
var
|
|
955
|
+
var Qe = class e extends Error {
|
|
901
956
|
constructor(t, n) {
|
|
902
957
|
super(n || JSON.stringify(t, null, 2)), this.issues = t, Object.setPrototypeOf(this, e.prototype);
|
|
903
958
|
}
|
|
904
959
|
};
|
|
905
|
-
async function
|
|
960
|
+
async function q(e, t) {
|
|
906
961
|
let n = await e["~standard"].validate(t);
|
|
907
|
-
if (n.issues) throw new
|
|
962
|
+
if (n.issues) throw new Qe(n.issues);
|
|
908
963
|
return n.value;
|
|
909
964
|
}
|
|
910
|
-
|
|
911
|
-
"
|
|
912
|
-
"
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
965
|
+
function J(e) {
|
|
966
|
+
"@babel/helpers - typeof";
|
|
967
|
+
return J = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
968
|
+
return typeof e;
|
|
969
|
+
} : function(e) {
|
|
970
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
971
|
+
}, J(e);
|
|
972
|
+
}
|
|
973
|
+
function $e(e, t) {
|
|
974
|
+
if (J(e) != "object" || !e) return e;
|
|
975
|
+
var n = e[Symbol.toPrimitive];
|
|
976
|
+
if (n !== void 0) {
|
|
977
|
+
var r = n.call(e, t || "default");
|
|
978
|
+
if (J(r) != "object") return r;
|
|
979
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
980
|
+
}
|
|
981
|
+
return (t === "string" ? String : Number)(e);
|
|
982
|
+
}
|
|
983
|
+
function et(e) {
|
|
984
|
+
var t = $e(e, "string");
|
|
985
|
+
return J(t) == "symbol" ? t : t + "";
|
|
986
|
+
}
|
|
987
|
+
function tt(e, t, n) {
|
|
988
|
+
return (t = et(t)) in e ? Object.defineProperty(e, t, {
|
|
989
|
+
value: n,
|
|
990
|
+
enumerable: !0,
|
|
991
|
+
configurable: !0,
|
|
992
|
+
writable: !0
|
|
993
|
+
}) : e[t] = n, e;
|
|
994
|
+
}
|
|
995
|
+
function Y(e, t) {
|
|
996
|
+
var n = Object.keys(e);
|
|
997
|
+
if (Object.getOwnPropertySymbols) {
|
|
998
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
999
|
+
t && (r = r.filter(function(t) {
|
|
1000
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1001
|
+
})), n.push.apply(n, r);
|
|
1002
|
+
}
|
|
1003
|
+
return n;
|
|
1004
|
+
}
|
|
1005
|
+
function X(e) {
|
|
1006
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1007
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
1008
|
+
t % 2 ? Y(Object(n), !0).forEach(function(t) {
|
|
1009
|
+
tt(e, t, n[t]);
|
|
1010
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Y(Object(n)).forEach(function(t) {
|
|
1011
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
return e;
|
|
1015
|
+
}
|
|
1016
|
+
var Z = async (e, t) => {
|
|
1017
|
+
var n;
|
|
1018
|
+
let { hooks: r, url: i, options: a } = await Ne(e, t), o = Ge(a), s = new AbortController(), c = a.signal ?? s.signal, l = Be(i, a), u = await Ke(a), d = Ye(a, u), f = Xe(i, a), p = X(X({}, a), {}, {
|
|
1019
|
+
url: l,
|
|
1020
|
+
headers: u,
|
|
1021
|
+
body: d,
|
|
1022
|
+
method: f,
|
|
1023
|
+
signal: c
|
|
1024
|
+
});
|
|
1025
|
+
for (let e of r.onRequest) if (e) {
|
|
1026
|
+
let t = await e(p);
|
|
1027
|
+
typeof t == "object" && t && Object.assign(p, t);
|
|
1028
|
+
}
|
|
1029
|
+
("pipeTo" in p && typeof p.pipeTo == "function" || typeof (t == null || (n = t.body) == null ? void 0 : n.pipe) == "function") && ("duplex" in p || (p.duplex = "half"));
|
|
1030
|
+
let { clearTimeout: m } = Ze(a, s), h = await o(p.url, p);
|
|
1031
|
+
m();
|
|
1032
|
+
let g = {
|
|
1033
|
+
response: h,
|
|
1034
|
+
request: p
|
|
1035
|
+
};
|
|
1036
|
+
for (let e of r.onResponse) if (e) {
|
|
1037
|
+
var _;
|
|
1038
|
+
let n = await e(X(X({}, g), {}, { response: t != null && (_ = t.hookOptions) != null && _.cloneResponse ? h.clone() : h }));
|
|
1039
|
+
n instanceof Response ? h = n : typeof n == "object" && n && (h = n.response);
|
|
1040
|
+
}
|
|
1041
|
+
if (h.ok) {
|
|
1042
|
+
if (p.method === "HEAD") return {
|
|
1043
|
+
data: "",
|
|
1044
|
+
error: null
|
|
1045
|
+
};
|
|
1046
|
+
let e = Ue(h), n = {
|
|
1047
|
+
data: null,
|
|
1048
|
+
response: h,
|
|
1049
|
+
request: p
|
|
1050
|
+
};
|
|
1051
|
+
if (e === "json" || e === "text") {
|
|
1052
|
+
let e = await h.text();
|
|
1053
|
+
n.data = await (p.jsonParser ?? W)(e);
|
|
1054
|
+
} else n.data = await h[e]();
|
|
1055
|
+
p?.output && p.output && !p.disableValidation && (n.data = await q(p.output, n.data));
|
|
1056
|
+
for (let e of r.onSuccess) if (e) {
|
|
1057
|
+
var v;
|
|
1058
|
+
await e(X(X({}, n), {}, { response: t != null && (v = t.hookOptions) != null && v.cloneResponse ? h.clone() : h }));
|
|
1059
|
+
}
|
|
1060
|
+
return t?.throw ? n.data : {
|
|
1061
|
+
data: n.data,
|
|
1062
|
+
error: null
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
let y = t?.jsonParser ?? W, b = await h.text(), x = We(b), S = x ? await y(b) : null, C = {
|
|
1066
|
+
response: h,
|
|
1067
|
+
responseText: b,
|
|
1068
|
+
request: p,
|
|
1069
|
+
error: X(X({}, S), {}, {
|
|
1070
|
+
status: h.status,
|
|
1071
|
+
statusText: h.statusText
|
|
1072
|
+
})
|
|
1073
|
+
};
|
|
1074
|
+
for (let e of r.onError) if (e) {
|
|
1075
|
+
var w;
|
|
1076
|
+
await e(X(X({}, C), {}, { response: t != null && (w = t.hookOptions) != null && w.cloneResponse ? h.clone() : h }));
|
|
1077
|
+
}
|
|
1078
|
+
if (t?.retry) {
|
|
1079
|
+
let n = Fe(t.retry), i = t.retryAttempt ?? 0;
|
|
1080
|
+
if (await n.shouldAttemptRetry(i, h)) {
|
|
1081
|
+
for (let e of r.onRetry) e && await e(g);
|
|
1082
|
+
let a = n.getDelay(i);
|
|
1083
|
+
return await new Promise((e) => setTimeout(e, a)), await Z(e, X(X({}, t), {}, { retryAttempt: i + 1 }));
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
if (t?.throw) throw new Me(h.status, h.statusText, x ? S : b);
|
|
1087
|
+
return {
|
|
1088
|
+
data: null,
|
|
1089
|
+
error: X(X({}, S), {}, {
|
|
1090
|
+
status: h.status,
|
|
1091
|
+
statusText: h.statusText
|
|
1092
|
+
})
|
|
1093
|
+
};
|
|
1094
|
+
}, nt = (e) => ({
|
|
917
1095
|
id: "apply-schema",
|
|
918
1096
|
name: "Apply Schema",
|
|
919
1097
|
version: "1.0.0",
|
|
920
1098
|
async init(t, n) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1099
|
+
var r;
|
|
1100
|
+
let i = X(X({}, n), e.query !== void 0 && { query: X(X({}, e.query), n?.query) }), a = ((r = e.plugins) == null || (r = r.find((e) => e.schema?.config ? t.startsWith(e.schema.config.baseURL || "") || t.startsWith(e.schema.config.prefix || "") : !1)) == null ? void 0 : r.schema) || e.schema;
|
|
1101
|
+
if (a) {
|
|
1102
|
+
let r = t;
|
|
1103
|
+
a.config?.prefix && r.startsWith(a.config.prefix) && (r = r.replace(a.config.prefix, ""), a.config.baseURL && (t = t.replace(a.config.prefix, a.config.baseURL))), a.config?.baseURL && r.startsWith(a.config.baseURL) && (r = r.replace(a.config.baseURL, "")), r.startsWith("/") && r.charAt(1) === "@" && (r = r.substring(1));
|
|
1104
|
+
let o = a.schema[r];
|
|
1105
|
+
if (o) {
|
|
1106
|
+
let { method: a, path: s } = H(r);
|
|
1107
|
+
a && (t = t.slice(0, t.length - r.length) + s);
|
|
1108
|
+
let c = n?.headers;
|
|
1109
|
+
if (o.headers && !n?.disableValidation) {
|
|
1110
|
+
let e = {};
|
|
930
1111
|
if (n?.headers) {
|
|
931
|
-
if (n.headers instanceof Headers) n.headers.forEach((
|
|
932
|
-
|
|
1112
|
+
if (n.headers instanceof Headers) n.headers.forEach((t, n) => {
|
|
1113
|
+
e[n.toLowerCase()] = t;
|
|
933
1114
|
});
|
|
934
|
-
else if (typeof n.headers == "object") for (let [
|
|
1115
|
+
else if (typeof n.headers == "object") for (let [t, r] of Object.entries(n.headers)) r != null && (e[t.toLowerCase()] = r);
|
|
935
1116
|
}
|
|
936
|
-
let
|
|
937
|
-
for (let [e,
|
|
938
|
-
|
|
1117
|
+
let t = await q(o.headers, e), r = {};
|
|
1118
|
+
for (let [e, n] of Object.entries(t)) r[e.toLowerCase()] = n;
|
|
1119
|
+
c = r;
|
|
939
1120
|
}
|
|
940
|
-
let
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1121
|
+
let l = o.method ?? a;
|
|
1122
|
+
if (i = X(X(X(X({}, i), l !== void 0 && { method: l }), o.output !== void 0 && { output: o.output }), c !== void 0 && { headers: c }), !n?.disableValidation) {
|
|
1123
|
+
if (o.query && (i.query = await q(o.query, n?.query), i.query !== null && typeof i.query == "object")) {
|
|
1124
|
+
let t = X({}, e.query);
|
|
1125
|
+
for (let e of Object.keys(t)) n?.query && Object.prototype.hasOwnProperty.call(n.query, e) && (t[e] = n.query[e]);
|
|
1126
|
+
i.query = X(X({}, t), i.query);
|
|
1127
|
+
}
|
|
1128
|
+
i = X(X({}, i), {}, {
|
|
1129
|
+
body: o.input ? await q(o.input, n?.body) : n?.body,
|
|
1130
|
+
params: o.params ? await q(o.params, n?.params) : n?.params
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
return {
|
|
950
1134
|
url: t,
|
|
951
|
-
options:
|
|
1135
|
+
options: i
|
|
952
1136
|
};
|
|
953
1137
|
}
|
|
954
1138
|
}
|
|
955
|
-
return {
|
|
956
|
-
url: t,
|
|
957
|
-
options: n
|
|
958
|
-
};
|
|
1139
|
+
return X({ url: t }, (n !== void 0 || e.query !== void 0) && { options: i });
|
|
959
1140
|
}
|
|
960
|
-
}),
|
|
1141
|
+
}), rt = (e) => {
|
|
961
1142
|
async function t(t, n) {
|
|
962
|
-
let r =
|
|
963
|
-
headers:
|
|
1143
|
+
let r = X(X(X({}, e), n), {}, {
|
|
1144
|
+
headers: K(e?.headers, n?.headers),
|
|
964
1145
|
plugins: [
|
|
965
1146
|
...e?.plugins || [],
|
|
966
|
-
|
|
1147
|
+
nt(e || {}),
|
|
967
1148
|
...n?.plugins || []
|
|
968
1149
|
]
|
|
969
1150
|
});
|
|
@@ -983,120 +1164,7 @@ var X = [
|
|
|
983
1164
|
return await Z(t, r);
|
|
984
1165
|
}
|
|
985
1166
|
return t;
|
|
986
|
-
},
|
|
987
|
-
function tt(e, t) {
|
|
988
|
-
let n = e;
|
|
989
|
-
for (let [e, r] of t) n = n.replace(e, r);
|
|
990
|
-
if (et(n)) throw TypeError("Path parameters cannot be reserved path segments");
|
|
991
|
-
return encodeURIComponent(n);
|
|
992
|
-
}
|
|
993
|
-
function nt(e, t) {
|
|
994
|
-
let { baseURL: n, params: r, query: i } = t || {
|
|
995
|
-
query: {},
|
|
996
|
-
params: {},
|
|
997
|
-
baseURL: ""
|
|
998
|
-
}, a = e.startsWith("http") ? e.split("/").slice(0, 3).join("/") : n || "";
|
|
999
|
-
if (e.startsWith("@")) {
|
|
1000
|
-
let t = e.toString().split("@")[1].split("/")[0];
|
|
1001
|
-
X.includes(t) && (e = e.replace(`@${t}/`, "/"));
|
|
1002
|
-
}
|
|
1003
|
-
a.endsWith("/") || (a += "/");
|
|
1004
|
-
let [o, s] = e.replace(a, "").split("?"), c = new URLSearchParams(s);
|
|
1005
|
-
for (let [e, t] of Object.entries(i || {})) {
|
|
1006
|
-
if (t == null) continue;
|
|
1007
|
-
let n;
|
|
1008
|
-
if (typeof t == "string") n = t;
|
|
1009
|
-
else if (Array.isArray(t)) {
|
|
1010
|
-
for (let n of t) c.append(e, n);
|
|
1011
|
-
continue;
|
|
1012
|
-
} else n = JSON.stringify(t);
|
|
1013
|
-
c.set(e, n);
|
|
1014
|
-
}
|
|
1015
|
-
let l = /* @__PURE__ */ new Map();
|
|
1016
|
-
if (r) {
|
|
1017
|
-
if (Array.isArray(r)) {
|
|
1018
|
-
let e = o.split("/").filter((e) => e.startsWith(":"));
|
|
1019
|
-
for (let [t, n] of e.entries()) {
|
|
1020
|
-
let e = r[t];
|
|
1021
|
-
l.set(n, String(e));
|
|
1022
|
-
}
|
|
1023
|
-
} else for (let [e, t] of Object.entries(r)) l.set(`:${e}`, String(t));
|
|
1024
|
-
}
|
|
1025
|
-
o = o.split("/").map((e) => tt(e, l)).join("/"), o = o.replace(/^\/+/, "");
|
|
1026
|
-
let u = c.toString();
|
|
1027
|
-
return u = u.length > 0 ? `?${u}`.replace(/\+/g, "%20") : "", a.startsWith("http") ? new URL(`${o}${u}`, a) : `${a}${o}${u}`;
|
|
1028
|
-
}
|
|
1029
|
-
var Z = async (e, t) => {
|
|
1030
|
-
let { hooks: n, url: r, options: i } = await Le(e, t), a = We(i), o = new AbortController(), s = i.signal ?? o.signal, c = nt(r, i), l = await Ge(i), u = Je(i, l), d = Ye(r, i), f = U(H({}, i), {
|
|
1031
|
-
url: c,
|
|
1032
|
-
headers: l,
|
|
1033
|
-
body: u,
|
|
1034
|
-
method: d,
|
|
1035
|
-
signal: s
|
|
1036
|
-
});
|
|
1037
|
-
for (let e of n.onRequest) if (e) {
|
|
1038
|
-
let t = await e(f);
|
|
1039
|
-
typeof t == "object" && t && Object.assign(f, t);
|
|
1040
|
-
}
|
|
1041
|
-
("pipeTo" in f && typeof f.pipeTo == "function" || typeof t?.body?.pipe == "function") && ("duplex" in f || (f.duplex = "half"));
|
|
1042
|
-
let { clearTimeout: p } = Xe(i, o), m = await a(f.url, f);
|
|
1043
|
-
p();
|
|
1044
|
-
let h = {
|
|
1045
|
-
response: m,
|
|
1046
|
-
request: f
|
|
1047
|
-
};
|
|
1048
|
-
for (let e of n.onResponse) if (e) {
|
|
1049
|
-
let n = await e(U(H({}, h), { response: t?.hookOptions?.cloneResponse ? m.clone() : m }));
|
|
1050
|
-
n instanceof Response ? m = n : typeof n == "object" && n && (m = n.response);
|
|
1051
|
-
}
|
|
1052
|
-
if (m.ok) {
|
|
1053
|
-
if (f.method === "HEAD") return {
|
|
1054
|
-
data: "",
|
|
1055
|
-
error: null
|
|
1056
|
-
};
|
|
1057
|
-
let e = He(m), r = {
|
|
1058
|
-
data: null,
|
|
1059
|
-
response: m,
|
|
1060
|
-
request: f
|
|
1061
|
-
};
|
|
1062
|
-
if (e === "json" || e === "text") {
|
|
1063
|
-
let e = await m.text();
|
|
1064
|
-
r.data = await (f.jsonParser ?? K)(e);
|
|
1065
|
-
} else r.data = await m[e]();
|
|
1066
|
-
f?.output && f.output && !f.disableValidation && (r.data = await Y(f.output, r.data));
|
|
1067
|
-
for (let e of n.onSuccess) e && await e(U(H({}, r), { response: t?.hookOptions?.cloneResponse ? m.clone() : m }));
|
|
1068
|
-
return t?.throw ? r.data : {
|
|
1069
|
-
data: r.data,
|
|
1070
|
-
error: null
|
|
1071
|
-
};
|
|
1072
|
-
}
|
|
1073
|
-
let g = t?.jsonParser ?? K, _ = await m.text(), v = Ue(_), y = v ? await g(_) : null, b = {
|
|
1074
|
-
response: m,
|
|
1075
|
-
responseText: _,
|
|
1076
|
-
request: f,
|
|
1077
|
-
error: U(H({}, y), {
|
|
1078
|
-
status: m.status,
|
|
1079
|
-
statusText: m.statusText
|
|
1080
|
-
})
|
|
1081
|
-
};
|
|
1082
|
-
for (let e of n.onError) e && await e(U(H({}, b), { response: t?.hookOptions?.cloneResponse ? m.clone() : m }));
|
|
1083
|
-
if (t?.retry) {
|
|
1084
|
-
let r = ze(t.retry), i = t.retryAttempt ?? 0;
|
|
1085
|
-
if (await r.shouldAttemptRetry(i, m)) {
|
|
1086
|
-
for (let e of n.onRetry) e && await e(h);
|
|
1087
|
-
let a = r.getDelay(i);
|
|
1088
|
-
return await new Promise((e) => setTimeout(e, a)), await Z(e, U(H({}, t), { retryAttempt: i + 1 }));
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
if (t?.throw) throw new Ie(m.status, m.statusText, v ? y : _);
|
|
1092
|
-
return {
|
|
1093
|
-
data: null,
|
|
1094
|
-
error: U(H({}, y), {
|
|
1095
|
-
status: m.status,
|
|
1096
|
-
statusText: m.statusText
|
|
1097
|
-
})
|
|
1098
|
-
};
|
|
1099
|
-
}, Q = (e) => {
|
|
1167
|
+
}, it = (e) => {
|
|
1100
1168
|
if (typeof process > "u") return;
|
|
1101
1169
|
let t = e ?? "/api/auth";
|
|
1102
1170
|
if (process.env.NEXT_PUBLIC_AUTH_URL) return process.env.NEXT_PUBLIC_AUTH_URL;
|
|
@@ -1109,8 +1177,8 @@ var Z = async (e, t) => {
|
|
|
1109
1177
|
return `${new URL(`${e}${process.env.VERCEL_URL}`).origin}${t}`;
|
|
1110
1178
|
} catch {}
|
|
1111
1179
|
}
|
|
1112
|
-
},
|
|
1113
|
-
let n = "credentials" in Request.prototype, r =
|
|
1180
|
+
}, at = (e) => e === "/sign-out" || e === "/update-user" || e === "/update-session" || e === "/sign-up/email" || e === "/sign-in/email" || e === "/delete-user" || e === "/verify-email" || e === "/revoke-sessions" || e === "/revoke-session" || e === "/revoke-other-sessions" || e === "/change-email" || e === "/change-password", Q = (e, t) => {
|
|
1181
|
+
let n = "credentials" in Request.prototype, r = ye(e?.baseURL, e?.basePath, void 0, t) ?? it(e?.basePath) ?? "/api/auth", i = e?.plugins?.flatMap((e) => e.fetchPlugins).filter((e) => e !== void 0) || [], a = {
|
|
1114
1182
|
id: "lifecycle-hooks",
|
|
1115
1183
|
name: "lifecycle-hooks",
|
|
1116
1184
|
hooks: {
|
|
@@ -1119,23 +1187,23 @@ var Z = async (e, t) => {
|
|
|
1119
1187
|
onRequest: e?.fetchOptions?.onRequest,
|
|
1120
1188
|
onResponse: e?.fetchOptions?.onResponse
|
|
1121
1189
|
}
|
|
1122
|
-
}, { onSuccess: o, onError: s, onRequest: c, onResponse: l, ...u } = e?.fetchOptions || {}, d =
|
|
1190
|
+
}, { onSuccess: o, onError: s, onRequest: c, onResponse: l, ...u } = e?.fetchOptions || {}, d = rt({
|
|
1123
1191
|
baseURL: r,
|
|
1124
1192
|
...n ? { credentials: "include" } : {},
|
|
1125
1193
|
method: "GET",
|
|
1126
1194
|
jsonParser(e) {
|
|
1127
|
-
return e ?
|
|
1195
|
+
return e ? se(e, { strict: !1 }) : null;
|
|
1128
1196
|
},
|
|
1129
1197
|
customFetchImpl: fetch,
|
|
1130
1198
|
...u,
|
|
1131
1199
|
plugins: [
|
|
1132
1200
|
a,
|
|
1133
1201
|
...u.plugins || [],
|
|
1134
|
-
...e?.disableDefaultFetchPlugins ? [] : [
|
|
1202
|
+
...e?.disableDefaultFetchPlugins ? [] : [Ce],
|
|
1135
1203
|
...i
|
|
1136
1204
|
]
|
|
1137
|
-
}), { $sessionSignal: f, session: p, broadcastSessionUpdate: m } =
|
|
1138
|
-
h || e === null || (h = !0,
|
|
1205
|
+
}), { $sessionSignal: f, session: p, broadcastSessionUpdate: m } = ke(d, e), h = !1, g = (e) => {
|
|
1206
|
+
h || e === null || (h = !0, Ee(p, e));
|
|
1139
1207
|
}, _ = e?.plugins || [], v = {}, y = {
|
|
1140
1208
|
$sessionSignal: f,
|
|
1141
1209
|
session: p
|
|
@@ -1146,9 +1214,7 @@ var Z = async (e, t) => {
|
|
|
1146
1214
|
"/delete-user": "POST"
|
|
1147
1215
|
}, x = [{
|
|
1148
1216
|
signal: "$sessionSignal",
|
|
1149
|
-
matcher
|
|
1150
|
-
return e === "/sign-out" || e === "/update-user" || e === "/update-session" || e === "/sign-up/email" || e === "/sign-in/email" || e === "/delete-user" || e === "/verify-email" || e === "/revoke-sessions" || e === "/revoke-session" || e === "/revoke-other-sessions" || e === "/change-email" || e === "/change-password";
|
|
1151
|
-
},
|
|
1217
|
+
matcher: at,
|
|
1152
1218
|
callback(e) {
|
|
1153
1219
|
e === "/sign-out" ? m("signout") : (e === "/update-user" || e === "/update-session") && m("updateUser");
|
|
1154
1220
|
}
|
|
@@ -1163,7 +1229,7 @@ var Z = async (e, t) => {
|
|
|
1163
1229
|
},
|
|
1164
1230
|
atoms: y
|
|
1165
1231
|
};
|
|
1166
|
-
for (let t of _) t.getActions && (v =
|
|
1232
|
+
for (let t of _) t.getActions && (v = je(t.getActions?.(d, S, e) ?? {}, v));
|
|
1167
1233
|
return {
|
|
1168
1234
|
get baseURL() {
|
|
1169
1235
|
return r;
|
|
@@ -1173,34 +1239,35 @@ var Z = async (e, t) => {
|
|
|
1173
1239
|
pluginPathMethods: b,
|
|
1174
1240
|
atomListeners: x,
|
|
1175
1241
|
hydrateSession: g,
|
|
1242
|
+
$sessionSignal: f,
|
|
1176
1243
|
$fetch: d,
|
|
1177
1244
|
$store: S
|
|
1178
1245
|
};
|
|
1179
1246
|
};
|
|
1180
1247
|
//#endregion
|
|
1181
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
1182
|
-
function
|
|
1248
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/utils/is-atom.mjs
|
|
1249
|
+
function ot(e) {
|
|
1183
1250
|
return typeof e == "object" && !!e && "get" in e && typeof e.get == "function" && "lc" in e && typeof e.lc == "number";
|
|
1184
1251
|
}
|
|
1185
1252
|
//#endregion
|
|
1186
|
-
//#region ../node_modules/.bun/@better-auth+core@1.7.
|
|
1187
|
-
function
|
|
1253
|
+
//#region ../node_modules/.bun/@better-auth+core@1.7.7+8ae2bbeb20d4d3e3/node_modules/@better-auth/core/dist/utils/string.mjs
|
|
1254
|
+
function st(e) {
|
|
1188
1255
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1189
1256
|
}
|
|
1190
|
-
var
|
|
1191
|
-
function
|
|
1192
|
-
return e.replace(
|
|
1257
|
+
var ct = /[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu, lt = /['\u2019]/g;
|
|
1258
|
+
function ut(e) {
|
|
1259
|
+
return e.replace(lt, "").match(ct) ?? [];
|
|
1193
1260
|
}
|
|
1194
|
-
function
|
|
1195
|
-
return
|
|
1261
|
+
function dt(e) {
|
|
1262
|
+
return ut(e).map((e) => e.toLowerCase()).join("-");
|
|
1196
1263
|
}
|
|
1197
1264
|
//#endregion
|
|
1198
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
1199
|
-
function
|
|
1265
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/proxy.mjs
|
|
1266
|
+
function ft(e, t, n) {
|
|
1200
1267
|
let r = t[e], { fetchOptions: i, query: a, ...o } = n || {};
|
|
1201
1268
|
return r || (i?.method ? i.method : o && Object.keys(o).length > 0 ? "POST" : "GET");
|
|
1202
1269
|
}
|
|
1203
|
-
function
|
|
1270
|
+
function pt(e, t, n, r, i) {
|
|
1204
1271
|
function a(o = []) {
|
|
1205
1272
|
return new Proxy(function() {}, {
|
|
1206
1273
|
get(t, n) {
|
|
@@ -1211,13 +1278,13 @@ function dt(e, t, n, r, i) {
|
|
|
1211
1278
|
i = void 0;
|
|
1212
1279
|
break;
|
|
1213
1280
|
}
|
|
1214
|
-
return typeof i == "function" ||
|
|
1281
|
+
return typeof i == "function" || ot(i) ? i : a(r);
|
|
1215
1282
|
},
|
|
1216
1283
|
apply: async (e, a, s) => {
|
|
1217
|
-
let c = "/" + o.map(
|
|
1284
|
+
let c = "/" + o.map(dt).join("/"), l = s[0] || {}, u = s[1] || {}, { query: d, fetchOptions: f, ...p } = l, m = {
|
|
1218
1285
|
...u,
|
|
1219
1286
|
...f
|
|
1220
|
-
}, h =
|
|
1287
|
+
}, h = ft(c, n, l);
|
|
1221
1288
|
return await t(c, {
|
|
1222
1289
|
...m,
|
|
1223
1290
|
body: h === "GET" ? void 0 : {
|
|
@@ -1249,11 +1316,11 @@ function dt(e, t, n, r, i) {
|
|
|
1249
1316
|
return a();
|
|
1250
1317
|
}
|
|
1251
1318
|
//#endregion
|
|
1252
|
-
//#region ../node_modules/.bun/better-auth@1.7.
|
|
1253
|
-
function
|
|
1254
|
-
let { pluginPathMethods: t, pluginsActions: n, pluginsAtoms: r, hydrateSession: i, $fetch: a, atomListeners: o, $store: s } =
|
|
1255
|
-
for (let [e, t] of Object.entries(r)) c[`use${
|
|
1256
|
-
return
|
|
1319
|
+
//#region ../node_modules/.bun/better-auth@1.7.7+7ee5f890295c53f0/node_modules/better-auth/dist/client/vanilla.mjs
|
|
1320
|
+
function mt(e) {
|
|
1321
|
+
let { pluginPathMethods: t, pluginsActions: n, pluginsAtoms: r, hydrateSession: i, $fetch: a, atomListeners: o, $store: s } = Q(e), c = {};
|
|
1322
|
+
for (let [e, t] of Object.entries(r)) c[`use${st(e)}`] = t;
|
|
1323
|
+
return pt({
|
|
1257
1324
|
...n,
|
|
1258
1325
|
...c,
|
|
1259
1326
|
hydrateSession: i,
|
|
@@ -1263,6 +1330,6 @@ function ft(e) {
|
|
|
1263
1330
|
}
|
|
1264
1331
|
//#endregion
|
|
1265
1332
|
//#region src/lib/auth-client.ts
|
|
1266
|
-
var $ =
|
|
1333
|
+
var $ = mt({ baseURL: typeof window < "u" ? window.location.origin : "" }), { signIn: ht, signUp: gt, signOut: _t, getSession: vt } = $;
|
|
1267
1334
|
//#endregion
|
|
1268
|
-
export {
|
|
1335
|
+
export { vt as n, _t as r, $ as t };
|