@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.3
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/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-CrdoiM5n.js} +2 -2
- package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-DEyR1_-G.js} +2 -2
- package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-DIbLpRdP.js} +1 -1
- package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-4xFsERIc.js} +2 -2
- package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-Cd6S9GUZ.js} +2 -2
- package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-DzuG1Xr1.js} +2 -2
- package/dist/assets/assets/channel-COZTDQXE.js +2 -0
- package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-DrBwvfNq.js} +2 -2
- package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T-DlfNcIyc.js} +2 -2
- package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-DXGkEHkM.js} +2 -2
- package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-rD7UlM9u.js} +2 -2
- package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-C_-VOauT.js} +2 -2
- package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-BV_PaseC.js} +2 -2
- package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-CrpsawGO.js} +2 -2
- package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-XphIzF5k.js} +2 -2
- package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-aLsECrt8.js} +2 -2
- package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-wBMoUMdH.js} +2 -2
- package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-Be1bFElE.js} +2 -2
- package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK--6jHfIF3.js} +2 -2
- package/dist/assets/assets/chunk-XXDRQBXY-B5qpdvL2.js +2 -0
- package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-DeFSeVs9.js} +2 -2
- package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-LU20lIUK.js} +2 -2
- package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-DHg-SKdr.js} +2 -2
- package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-3YhPkwCC.js} +2 -2
- package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-BbtQldWb.js} +2 -2
- package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-B3ytCWWf.js} +1 -1
- package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-D1bBbxZq.js} +2 -2
- package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-BfUqj6lc.js} +2 -2
- package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-Df088WJQ.js} +2 -2
- package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-BKD41Tzm.js} +2 -2
- package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-xXPliCIa.js} +2 -2
- package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-BqphqvCz.js} +2 -2
- package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-DYB9A-fq.js} +2 -2
- package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-CFDOm4HQ.js} +2 -2
- package/dist/assets/assets/{dist-h6SOnP8-.js → dist-32WBtSST.js} +2 -2
- package/dist/assets/assets/{dist-BabjcJ3j.js → dist-CFCITuXX.js} +2 -2
- package/dist/assets/assets/{dist-XIZum9n5.js → dist-CW-VIiMc.js} +2 -2
- package/dist/assets/assets/{dist-1-mhYUBH.js → dist-CZEUnb9K.js} +2 -2
- package/dist/assets/assets/{dist-B3JXhDWV.js → dist-Cm3w42b9.js} +2 -2
- package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-CnE-1DAx.js} +2 -2
- package/dist/assets/assets/{dist-Izr2SB3q.js → dist-CtRw0X6v.js} +2 -2
- package/dist/assets/assets/{dist-gfbb4ygy.js → dist-DBLdG0d3.js} +2 -2
- package/dist/assets/assets/{dist-DvgCCshF.js → dist-Q0r1aAmg.js} +2 -2
- package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-B3_c2PA2.js} +2 -2
- package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-finM-fki.js} +2 -2
- package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-DcUcej90.js} +2 -2
- package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-C1grv7Mr.js} +1 -1
- package/dist/assets/assets/flowDiagram-IUGLLWBU-KhN8NxvM.js +1 -0
- package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-CR_3csYO.js} +2 -2
- package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-LWyRJEP6.js} +1 -1
- package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-Cv1hHPyw.js} +2 -2
- package/dist/assets/assets/index-C9HC2YsS.js +155 -0
- package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-C_GrOjp3.js} +1 -1
- package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-D_I4R8K0.js} +2 -2
- package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-B0ejFQpo.js} +2 -2
- package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-DXOdyS81.js} +2 -2
- package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-BWisQtKX.js} +2 -2
- package/dist/assets/assets/{line-BsXJZn93.js → line-B1Uzdmw5.js} +2 -2
- package/dist/assets/assets/{linear-BHYaD5T0.js → linear-DybNECz2.js} +2 -2
- package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-CvT3V6mf.js} +4 -4
- package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-klehpHNB.js} +5 -5
- package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-DlVByYRq.js} +2 -2
- package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CyG432PV.js} +1 -1
- package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-DE_MbH8y.js} +2 -2
- package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-BwnLEKCH.js} +1 -1
- package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-Cm2NxTfT.js} +2 -2
- package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-B93FG-6N.js} +2 -2
- package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-B0FBAfdW.js} +1 -1
- package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-B7BUR_ru.js} +1 -1
- package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CU2Rx91Y.js} +1 -1
- package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-B84656rV.js} +1 -1
- package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-DimsEw55.js} +1 -1
- package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-D0fz3OAg.js} +2 -2
- package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-BuWqdug0.js} +2 -2
- package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-B4OVJlyN.js} +2 -2
- package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-Cspw_La5.js} +2 -2
- package/dist/assets/assets/{src-gihY33R9.js → src-BIQMvDC7.js} +2 -2
- package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-XwTopHIl.js} +2 -2
- package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-CbWnlSnl.js} +2 -2
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-BQ6QhI0Z.js +9 -0
- package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-B9RTbrj0.js} +2 -2
- package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-BLze-qR3.js} +1 -1
- package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-_AVBjluw.js} +1 -1
- package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-FvKgpSH5.js} +2 -2
- package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-BMWwvqE5.js} +2 -2
- package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-BNPEZiix.js} +1 -1
- package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-BvVulcGr.js} +2 -2
- package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-B4NM0eot.js} +2 -2
- package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-C0yCeT3Q.js} +2 -2
- package/dist/assets/bundle-asset-policy.json +1 -1
- package/dist/assets/index.html +1 -1
- package/dist/worker.js +216 -142
- package/package.json +22 -22
- package/dist/assets/assets/channel-CMrEzemr.js +0 -2
- package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
- package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
- package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
- package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
package/dist/worker.js
CHANGED
|
@@ -60855,10 +60855,24 @@ var PoOwnerObject = class extends DurableObject {
|
|
|
60855
60855
|
/** Purges the session's own object first, so a failed purge leaves the row for a retry. */
|
|
60856
60856
|
async deleteSession(workspaceId, sessionId) {
|
|
60857
60857
|
if (!this.getSession(workspaceId, sessionId)) return false;
|
|
60858
|
-
await this
|
|
60858
|
+
await this.#purge(workspaceId, sessionId);
|
|
60859
60859
|
this.ctx.storage.sql.exec("DELETE FROM owner_sessions_list WHERE workspace=? AND id=?", workspaceId, sessionId);
|
|
60860
60860
|
return true;
|
|
60861
60861
|
}
|
|
60862
|
+
/**
|
|
60863
|
+
* Purges every session's object before dropping the rows, so a failed purge leaves the workspace for a retry.
|
|
60864
|
+
* The Default workspace comes back empty the next time the object starts.
|
|
60865
|
+
*/
|
|
60866
|
+
async deleteWorkspace(workspaceId) {
|
|
60867
|
+
if (!this.hasWorkspace(workspaceId)) return false;
|
|
60868
|
+
for (const session of this.listSessions(workspaceId)) await this.#purge(workspaceId, session.id);
|
|
60869
|
+
this.ctx.storage.sql.exec("DELETE FROM owner_sessions_list WHERE workspace=?", workspaceId);
|
|
60870
|
+
this.ctx.storage.sql.exec("DELETE FROM owner_workspaces WHERE id=?", workspaceId);
|
|
60871
|
+
return true;
|
|
60872
|
+
}
|
|
60873
|
+
#purge(workspaceId, sessionId) {
|
|
60874
|
+
return this.env.PO_SESSIONS.get(this.env.PO_SESSIONS.idFromName(`${workspaceId}/${sessionId}`)).purgeOwnerSession(workspaceId, sessionId);
|
|
60875
|
+
}
|
|
60862
60876
|
now() {
|
|
60863
60877
|
return Date.now();
|
|
60864
60878
|
}
|
|
@@ -60883,6 +60897,12 @@ const CLOUD_PROXY_PREFIX = "/hosts/cloud";
|
|
|
60883
60897
|
const MIN_OWNER_TOKEN_LENGTH = 32;
|
|
60884
60898
|
const MAX_SIGN_IN_BODY = 4096;
|
|
60885
60899
|
const OWNER_API = /^\/api\/workspaces(?:\/([^/]+)\/sessions(?:\/([^/]+)(\/ws)?)?)?$/;
|
|
60900
|
+
const WORKSPACE_API = /^\/api\/workspaces\/([^/]+)(?:\/(history|removed))?$/;
|
|
60901
|
+
const RESTART_API = /^\/api\/workspaces\/[^/]+\/sessions\/[^/]+\/restart$/;
|
|
60902
|
+
const GENERAL_SESSION_API = "/api/sessions";
|
|
60903
|
+
/** po-core's machine API mount (providers page, model list) and the profile plugin's launch list. */
|
|
60904
|
+
const PROVIDER_API = "/api/plugins/po";
|
|
60905
|
+
const LAUNCH_PROFILES_API = /^\/api\/workspaces\/[^/]+\/plugins\/profile\/launch-profiles$/;
|
|
60886
60906
|
const ID = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
60887
60907
|
const digest$4 = (value) => createHash("sha256").update(value).digest();
|
|
60888
60908
|
const tokenMatches = (presented, token) => timingSafeEqual(digest$4(presented), digest$4(token));
|
|
@@ -60890,6 +60910,8 @@ const plain = (status, text, headers) => new Response(text, {
|
|
|
60890
60910
|
status,
|
|
60891
60911
|
headers
|
|
60892
60912
|
});
|
|
60913
|
+
/** The `{ error }` body po-web's hub client shows to the person. */
|
|
60914
|
+
const apiError = (status, error) => Response.json({ error }, { status });
|
|
60893
60915
|
function ownerStub(env) {
|
|
60894
60916
|
return env.PO_OWNER.get(env.PO_OWNER.idFromName("owner"));
|
|
60895
60917
|
}
|
|
@@ -61006,44 +61028,74 @@ function forwardSessionSocket(request, env, workspaceId, sessionId) {
|
|
|
61006
61028
|
]) forwarded.headers.delete(header);
|
|
61007
61029
|
return env.PO_SESSIONS.get(env.PO_SESSIONS.idFromName(`${workspaceId}/${sessionId}`)).fetch(forwarded);
|
|
61008
61030
|
}
|
|
61031
|
+
const workspaceView = (entry) => ({
|
|
61032
|
+
...entry,
|
|
61033
|
+
root: "/workspace",
|
|
61034
|
+
sessions: []
|
|
61035
|
+
});
|
|
61036
|
+
/** The "+" menu's plain session. A Worker session has no folder of its own, so it joins the first workspace. */
|
|
61037
|
+
async function generalSession(request, owner) {
|
|
61038
|
+
if (request.method !== "POST") return apiError(405, "method not allowed");
|
|
61039
|
+
const input = await optionalName(request);
|
|
61040
|
+
if (!input) return apiError(400, "sessions accept an optional name");
|
|
61041
|
+
const [first] = await owner.listWorkspaces();
|
|
61042
|
+
const created = first && await owner.createSession(first.id, input.name);
|
|
61043
|
+
if (!created) return apiError(429, "This Worker has reached its session limit.");
|
|
61044
|
+
return Response.json({
|
|
61045
|
+
sessionId: created.id,
|
|
61046
|
+
workspace: workspaceView(first),
|
|
61047
|
+
session: sessionSummary(created, first.id)
|
|
61048
|
+
}, { status: 201 });
|
|
61049
|
+
}
|
|
61050
|
+
/** One workspace: GET reads it, DELETE removes it with its sessions. History and removed lists are empty. */
|
|
61051
|
+
async function oneWorkspace(request, owner, workspaceId, list) {
|
|
61052
|
+
if (!ID.test(workspaceId)) return apiError(404, "not found");
|
|
61053
|
+
if (list) {
|
|
61054
|
+
if (request.method !== "GET") return apiError(405, "method not allowed");
|
|
61055
|
+
return await owner.hasWorkspace(workspaceId) ? Response.json({ sessions: [] }) : apiError(404, "not found");
|
|
61056
|
+
}
|
|
61057
|
+
if (request.method === "DELETE") return await owner.deleteWorkspace(workspaceId) ? new Response(null, { status: 204 }) : apiError(404, "not found");
|
|
61058
|
+
if (request.method !== "GET") return apiError(405, "Workspaces on this Worker cannot be changed yet.");
|
|
61059
|
+
const row = (await owner.listWorkspaces()).find((entry) => entry.id === workspaceId);
|
|
61060
|
+
return row ? Response.json({ workspace: workspaceView(row) }) : apiError(404, "not found");
|
|
61061
|
+
}
|
|
61009
61062
|
/** Workspace and session REST in the shape po-web's cloud hub reads, plus listed session sockets. */
|
|
61010
61063
|
async function ownerApi(request, env, path) {
|
|
61064
|
+
const owner = ownerStub(env);
|
|
61065
|
+
if (path === GENERAL_SESSION_API) return generalSession(request, owner);
|
|
61066
|
+
if (RESTART_API.test(path)) return apiError(501, "Sessions on this Worker cannot be restarted. Reload the page to reconnect.");
|
|
61067
|
+
const one = WORKSPACE_API.exec(path);
|
|
61068
|
+
if (one) return oneWorkspace(request, owner, decodeURIComponent(one[1]), one[2]);
|
|
61011
61069
|
const match = OWNER_API.exec(path);
|
|
61012
61070
|
if (!match) return void 0;
|
|
61013
61071
|
const workspaceId = match[1] === void 0 ? void 0 : decodeURIComponent(match[1]);
|
|
61014
61072
|
const sessionId = match[2] === void 0 ? void 0 : decodeURIComponent(match[2]);
|
|
61015
|
-
if (workspaceId !== void 0 && !ID.test(workspaceId) || sessionId !== void 0 && !ID.test(sessionId)) return
|
|
61016
|
-
const owner = ownerStub(env);
|
|
61017
|
-
const workspace = (entry) => ({
|
|
61018
|
-
...entry,
|
|
61019
|
-
root: "/workspace",
|
|
61020
|
-
sessions: []
|
|
61021
|
-
});
|
|
61073
|
+
if (workspaceId !== void 0 && !ID.test(workspaceId) || sessionId !== void 0 && !ID.test(sessionId)) return apiError(404, "not found");
|
|
61022
61074
|
if (workspaceId === void 0) {
|
|
61023
|
-
if (request.method === "GET") return Response.json({ workspaces: (await owner.listWorkspaces()).map(
|
|
61024
|
-
if (request.method !== "POST") return
|
|
61075
|
+
if (request.method === "GET") return Response.json({ workspaces: (await owner.listWorkspaces()).map(workspaceView) });
|
|
61076
|
+
if (request.method !== "POST") return apiError(405, "method not allowed");
|
|
61025
61077
|
const input = await optionalName(request);
|
|
61026
|
-
if (!input) return
|
|
61078
|
+
if (!input) return apiError(400, "workspaces accept an optional name");
|
|
61027
61079
|
const created = await owner.createWorkspace(input.name);
|
|
61028
|
-
return created ? Response.json({ workspace:
|
|
61080
|
+
return created ? Response.json({ workspace: workspaceView(created) }, { status: 201 }) : apiError(429, "This Worker has reached its workspace limit.");
|
|
61029
61081
|
}
|
|
61030
61082
|
if (sessionId === void 0) {
|
|
61031
|
-
if (!await owner.hasWorkspace(workspaceId)) return
|
|
61083
|
+
if (!await owner.hasWorkspace(workspaceId)) return apiError(404, "not found");
|
|
61032
61084
|
if (request.method === "GET") return Response.json({ sessions: (await owner.listSessions(workspaceId)).map((row) => sessionSummary(row, workspaceId)) });
|
|
61033
|
-
if (request.method !== "POST") return
|
|
61085
|
+
if (request.method !== "POST") return apiError(405, "method not allowed");
|
|
61034
61086
|
const input = await optionalName(request);
|
|
61035
|
-
if (!input) return
|
|
61087
|
+
if (!input) return apiError(400, "sessions accept an optional name");
|
|
61036
61088
|
const created = await owner.createSession(workspaceId, input.name);
|
|
61037
|
-
return created ? Response.json({ sessionId: created.id }, { status: 201 }) :
|
|
61089
|
+
return created ? Response.json({ sessionId: created.id }, { status: 201 }) : apiError(429, "This Worker has reached its session limit.");
|
|
61038
61090
|
}
|
|
61039
61091
|
if (match[3]) {
|
|
61040
|
-
if (!await owner.getSession(workspaceId, sessionId)) return
|
|
61092
|
+
if (!await owner.getSession(workspaceId, sessionId)) return apiError(404, "not found");
|
|
61041
61093
|
return forwardSessionSocket(request, env, workspaceId, sessionId);
|
|
61042
61094
|
}
|
|
61043
|
-
if (request.method === "DELETE") return await owner.deleteSession(workspaceId, sessionId) ? new Response(null, { status: 204 }) :
|
|
61044
|
-
if (request.method !== "GET") return
|
|
61095
|
+
if (request.method === "DELETE") return await owner.deleteSession(workspaceId, sessionId) ? new Response(null, { status: 204 }) : apiError(404, "not found");
|
|
61096
|
+
if (request.method !== "GET") return apiError(405, "method not allowed");
|
|
61045
61097
|
const row = await owner.getSession(workspaceId, sessionId);
|
|
61046
|
-
return row ? Response.json(sessionSummary(row, workspaceId)) :
|
|
61098
|
+
return row ? Response.json(sessionSummary(row, workspaceId)) : apiError(404, "not found");
|
|
61047
61099
|
}
|
|
61048
61100
|
/** REST for a bearer caller. Its socket route stays the Worker's original one. */
|
|
61049
61101
|
function bearerOwnerApi(request, env, url) {
|
|
@@ -61110,11 +61162,33 @@ async function bundleRoute(request, env, url) {
|
|
|
61110
61162
|
}
|
|
61111
61163
|
/**
|
|
61112
61164
|
* Self-host v1 runs no web plugins: the plugin routes and compositions answer as a hub with none would, so a
|
|
61113
|
-
* shell or service worker that asks gets a well-formed empty answer rather than a page.
|
|
61165
|
+
* shell or service worker that asks gets a well-formed empty answer rather than a page. The providers page
|
|
61166
|
+
* reads the one provider the Worker's variables set; it changes only with `wrangler secret put`.
|
|
61114
61167
|
*/
|
|
61115
|
-
function pluginRoute(request, path) {
|
|
61168
|
+
function pluginRoute(request, env, path) {
|
|
61116
61169
|
if (path === "/api/compositions" && request.method === "GET") return Response.json({ workspaces: [] });
|
|
61117
61170
|
if (path.startsWith("/api/web-plugins/")) return Response.json({ error: "Plugin generation not found." }, { status: 404 });
|
|
61171
|
+
if (LAUNCH_PROFILES_API.test(path) && request.method === "GET") return Response.json({
|
|
61172
|
+
profiles: [],
|
|
61173
|
+
readiness: "ready"
|
|
61174
|
+
});
|
|
61175
|
+
const provider = env.PO_DEFAULT_PROVIDER;
|
|
61176
|
+
const ready = Boolean(provider && env.PO_DEFAULT_MODEL && env.PO_PROVIDER_BASE_URL && env.PO_PROVIDER_API_KEY);
|
|
61177
|
+
if (path === `${PROVIDER_API}/providers` && request.method === "GET") return Response.json({ providers: provider ? [{
|
|
61178
|
+
id: provider,
|
|
61179
|
+
name: provider,
|
|
61180
|
+
methods: [],
|
|
61181
|
+
...ready ? { authenticated: {
|
|
61182
|
+
type: "api_key",
|
|
61183
|
+
source: "PO_PROVIDER_API_KEY"
|
|
61184
|
+
} } : {}
|
|
61185
|
+
}] : [] });
|
|
61186
|
+
if (path === `${PROVIDER_API}/models` && request.method === "GET") return Response.json({ models: ready ? [{
|
|
61187
|
+
value: `${provider}/${env.PO_DEFAULT_MODEL}`,
|
|
61188
|
+
label: env.PO_DEFAULT_MODEL,
|
|
61189
|
+
group: provider
|
|
61190
|
+
}] : [] });
|
|
61191
|
+
if (path.startsWith(`${PROVIDER_API}/`)) return apiError(400, "Providers on this Worker are set with wrangler secret put, not from this page.");
|
|
61118
61192
|
}
|
|
61119
61193
|
/** Marks the shell for po-web. Every other asset passes through untouched. */
|
|
61120
61194
|
async function shellAsset(request, env, url) {
|
|
@@ -61146,7 +61220,7 @@ async function ownerRequest(request, env, url, token) {
|
|
|
61146
61220
|
const refused = originRefusal(request, env, url);
|
|
61147
61221
|
if (refused) return refused;
|
|
61148
61222
|
const path = url.pathname.startsWith(`${CLOUD_PROXY_PREFIX}/api/`) ? url.pathname.slice(12) : url.pathname;
|
|
61149
|
-
const api = await ownerApi(request, env, path) ?? pluginRoute(request, path);
|
|
61223
|
+
const api = await ownerApi(request, env, path) ?? pluginRoute(request, env, path);
|
|
61150
61224
|
if (api) return api;
|
|
61151
61225
|
if (path.startsWith("/api/") || path.startsWith(`${CLOUD_PROXY_PREFIX}/`)) return plain(404, "not found");
|
|
61152
61226
|
return await bundleRoute(request, env, url) ?? shellAsset(request, env, url);
|
|
@@ -64700,91 +64774,91 @@ var virtual_po_capabilities_default = {
|
|
|
64700
64774
|
"packages": [
|
|
64701
64775
|
{
|
|
64702
64776
|
"name": "@agimon-ai/po-approval",
|
|
64703
|
-
"version": "0.0.0-alpha.
|
|
64777
|
+
"version": "0.0.0-alpha.103",
|
|
64704
64778
|
"contractFingerprint": "2fe2af06dfdf1ea281408f3a86b7599e2409044cac334bcd4060f55dac3d6953",
|
|
64705
64779
|
"operations": []
|
|
64706
64780
|
},
|
|
64707
64781
|
{
|
|
64708
64782
|
"name": "@agimon-ai/po-artifact",
|
|
64709
|
-
"version": "0.0.0-alpha.
|
|
64783
|
+
"version": "0.0.0-alpha.102",
|
|
64710
64784
|
"contractFingerprint": "594fd017f549087206fa296d5b98fe89cccf0942a71674bfbb8dadac4d13cb38",
|
|
64711
64785
|
"operations": []
|
|
64712
64786
|
},
|
|
64713
64787
|
{
|
|
64714
64788
|
"name": "@agimon-ai/po-autostop",
|
|
64715
|
-
"version": "0.0.0-alpha.
|
|
64789
|
+
"version": "0.0.0-alpha.103",
|
|
64716
64790
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64717
64791
|
"operations": []
|
|
64718
64792
|
},
|
|
64719
64793
|
{
|
|
64720
64794
|
"name": "@agimon-ai/po-cache",
|
|
64721
|
-
"version": "0.0.0-alpha.
|
|
64795
|
+
"version": "0.0.0-alpha.103",
|
|
64722
64796
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64723
64797
|
"operations": []
|
|
64724
64798
|
},
|
|
64725
64799
|
{
|
|
64726
64800
|
"name": "@agimon-ai/po-codemode",
|
|
64727
|
-
"version": "0.0.1-alpha.
|
|
64801
|
+
"version": "0.0.1-alpha.76",
|
|
64728
64802
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64729
64803
|
"operations": []
|
|
64730
64804
|
},
|
|
64731
64805
|
{
|
|
64732
64806
|
"name": "@agimon-ai/po-config",
|
|
64733
|
-
"version": "0.0.0-alpha.
|
|
64807
|
+
"version": "0.0.0-alpha.103",
|
|
64734
64808
|
"contractFingerprint": "305bb8372fccda962a3c7bb747e009f767af4a5b9ae904cfd827e9c402caad42",
|
|
64735
64809
|
"operations": []
|
|
64736
64810
|
},
|
|
64737
64811
|
{
|
|
64738
64812
|
"name": "@agimon-ai/po-domain",
|
|
64739
|
-
"version": "0.0.0-alpha.
|
|
64813
|
+
"version": "0.0.0-alpha.103",
|
|
64740
64814
|
"contractFingerprint": "714ad0c508af5784df5529c71aea4ebeba1e9b434906e7769d46716ff1b10da7",
|
|
64741
64815
|
"operations": []
|
|
64742
64816
|
},
|
|
64743
64817
|
{
|
|
64744
64818
|
"name": "@agimon-ai/po-major-mode",
|
|
64745
|
-
"version": "0.0.0-alpha.
|
|
64819
|
+
"version": "0.0.0-alpha.103",
|
|
64746
64820
|
"contractFingerprint": "d7c10b6c5f808271f9cd1a3ec6803cb0f0f282f1a3ec390643c2b2fee1a081cd",
|
|
64747
64821
|
"operations": []
|
|
64748
64822
|
},
|
|
64749
64823
|
{
|
|
64750
64824
|
"name": "@agimon-ai/po-mcp",
|
|
64751
|
-
"version": "0.0.0-alpha.
|
|
64825
|
+
"version": "0.0.0-alpha.103",
|
|
64752
64826
|
"contractFingerprint": "545021df543fd4f5172489477a33452578862a8eb83ee3628032cb18c36f7a29",
|
|
64753
64827
|
"operations": []
|
|
64754
64828
|
},
|
|
64755
64829
|
{
|
|
64756
64830
|
"name": "@agimon-ai/po-minor-mode",
|
|
64757
|
-
"version": "0.0.0-alpha.
|
|
64831
|
+
"version": "0.0.0-alpha.103",
|
|
64758
64832
|
"contractFingerprint": "9d4d7a4b9c338333a720b9f7fc083970d95b6d4f8be11b5f2920b40b7198c002",
|
|
64759
64833
|
"operations": []
|
|
64760
64834
|
},
|
|
64761
64835
|
{
|
|
64762
64836
|
"name": "@agimon-ai/po-notification",
|
|
64763
|
-
"version": "0.0.0-alpha.
|
|
64837
|
+
"version": "0.0.0-alpha.103",
|
|
64764
64838
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64765
64839
|
"operations": []
|
|
64766
64840
|
},
|
|
64767
64841
|
{
|
|
64768
64842
|
"name": "@agimon-ai/po-profile",
|
|
64769
|
-
"version": "0.0.0-alpha.
|
|
64843
|
+
"version": "0.0.0-alpha.103",
|
|
64770
64844
|
"contractFingerprint": "53f20be6c3e331c19eccd416e278d5c7741374acb5be785fe21ad07d69a5ec7f",
|
|
64771
64845
|
"operations": []
|
|
64772
64846
|
},
|
|
64773
64847
|
{
|
|
64774
64848
|
"name": "@agimon-ai/po-session",
|
|
64775
|
-
"version": "0.0.0-alpha.
|
|
64849
|
+
"version": "0.0.0-alpha.103",
|
|
64776
64850
|
"contractFingerprint": "23e1825133c5d10030161590d858cdd4636159973d94ea747500bbf3cd3e60c0",
|
|
64777
64851
|
"operations": []
|
|
64778
64852
|
},
|
|
64779
64853
|
{
|
|
64780
64854
|
"name": "@agimon-ai/po-skill",
|
|
64781
|
-
"version": "0.0.0-alpha.
|
|
64855
|
+
"version": "0.0.0-alpha.103",
|
|
64782
64856
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64783
64857
|
"operations": []
|
|
64784
64858
|
},
|
|
64785
64859
|
{
|
|
64786
64860
|
"name": "@agimon-ai/po-ui",
|
|
64787
|
-
"version": "0.0.0-alpha.
|
|
64861
|
+
"version": "0.0.0-alpha.103",
|
|
64788
64862
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
64789
64863
|
"operations": []
|
|
64790
64864
|
}
|
|
@@ -70552,7 +70626,7 @@ function runtimeSchemaCheckFor(adapter) {
|
|
|
70552
70626
|
return registration?.runtimeEnabled ? registration.check : void 0;
|
|
70553
70627
|
}
|
|
70554
70628
|
//#endregion
|
|
70555
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
70629
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/get-schema.mjs
|
|
70556
70630
|
function getSchema(config) {
|
|
70557
70631
|
return buildSchema(config).schema;
|
|
70558
70632
|
}
|
|
@@ -70643,7 +70717,7 @@ function filterOutputFields$1(data, additionalFields) {
|
|
|
70643
70717
|
}), {});
|
|
70644
70718
|
}
|
|
70645
70719
|
//#endregion
|
|
70646
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
70720
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/schema.mjs
|
|
70647
70721
|
const cache$1 = /* @__PURE__ */ new WeakMap();
|
|
70648
70722
|
function getFields(options, modelName, mode) {
|
|
70649
70723
|
const cacheKey = `${modelName}:${mode}`;
|
|
@@ -71038,7 +71112,7 @@ const queueAfterTransactionHook = async (hook, options) => {
|
|
|
71038
71112
|
store.pendingHooks.push(executeHook);
|
|
71039
71113
|
};
|
|
71040
71114
|
//#endregion
|
|
71041
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
71115
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/with-hooks.mjs
|
|
71042
71116
|
function getWithHooks(adapter, ctx) {
|
|
71043
71117
|
const withSpan = createWithSpan(ctx.options);
|
|
71044
71118
|
const hooksEntries = ctx.hooks;
|
|
@@ -71290,12 +71364,12 @@ function getWithHooks(adapter, ctx) {
|
|
|
71290
71364
|
};
|
|
71291
71365
|
}
|
|
71292
71366
|
//#endregion
|
|
71293
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
71367
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/date.mjs
|
|
71294
71368
|
const getDate = (span, unit = "ms") => {
|
|
71295
71369
|
return new Date(Date.now() + (unit === "sec" ? span * 1e3 : span));
|
|
71296
71370
|
};
|
|
71297
71371
|
//#endregion
|
|
71298
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
71372
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/validate-user-info.mjs
|
|
71299
71373
|
function assertValidUserInfoSource(source) {
|
|
71300
71374
|
if (!source?.method) throw new APIError("FORBIDDEN", {
|
|
71301
71375
|
code: "validation_source_missing",
|
|
@@ -71358,7 +71432,7 @@ function createHash$1(algorithm, encoding) {
|
|
|
71358
71432
|
} };
|
|
71359
71433
|
}
|
|
71360
71434
|
//#endregion
|
|
71361
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
71435
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/verification-token-storage.mjs
|
|
71362
71436
|
const defaultKeyHasher$2 = async (identifier) => {
|
|
71363
71437
|
const hash = await createHash$1("SHA-256").digest(new TextEncoder().encode(identifier));
|
|
71364
71438
|
return base64Url.encode(new Uint8Array(hash), { padding: false });
|
|
@@ -71609,7 +71683,7 @@ function createRateLimitKey(ip, path) {
|
|
|
71609
71683
|
return `${ip}|${path}`;
|
|
71610
71684
|
}
|
|
71611
71685
|
//#endregion
|
|
71612
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
71686
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/internal-adapter.mjs
|
|
71613
71687
|
function getTTLSeconds(expiresAt, now = Date.now()) {
|
|
71614
71688
|
const expiresMs = typeof expiresAt === "number" ? expiresAt : expiresAt.getTime();
|
|
71615
71689
|
return Math.max(Math.floor((expiresMs - now) / 1e3), 0);
|
|
@@ -72564,7 +72638,7 @@ const createInternalAdapter = (adapter, ctx) => {
|
|
|
72564
72638
|
};
|
|
72565
72639
|
};
|
|
72566
72640
|
//#endregion
|
|
72567
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
72641
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/revoke-unproven-account-access.mjs
|
|
72568
72642
|
const cleanupLockExpiresInMs = 5e3;
|
|
72569
72643
|
const cleanupLockWaitMs = 2e3;
|
|
72570
72644
|
const cleanupLockPollMs = 250;
|
|
@@ -72620,7 +72694,7 @@ async function revokeUnprovenAccountAccess(ctx, userId) {
|
|
|
72620
72694
|
}
|
|
72621
72695
|
}
|
|
72622
72696
|
//#endregion
|
|
72623
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
72697
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/to-zod.mjs
|
|
72624
72698
|
/**
|
|
72625
72699
|
* Static lookup keeps `zod` tree-shakeable. `z[field.type]()` forces bundlers
|
|
72626
72700
|
* to retain every `zod` export, including all locales.
|
|
@@ -75654,7 +75728,7 @@ async function generateKeyPair(alg, options) {
|
|
|
75654
75728
|
return crypto.subtle.generateKey(algorithm, options?.extractable ?? false, [...entry.usages[1], ...entry.usages[0]]);
|
|
75655
75729
|
}
|
|
75656
75730
|
//#endregion
|
|
75657
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
75731
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/jwt.mjs
|
|
75658
75732
|
async function signJWT$1(payload, secret, expiresIn = 3600) {
|
|
75659
75733
|
return await new SignJWT(payload).setProtectedHeader({ alg: "HS256" }).setIssuedAt().setExpirationTime(Math.floor(Date.now() / 1e3) + expiresIn).sign(new TextEncoder().encode(secret));
|
|
75660
75734
|
}
|
|
@@ -75791,7 +75865,7 @@ async function symmetricDecodeJWT(token, secret, salt) {
|
|
|
75791
75865
|
}
|
|
75792
75866
|
}
|
|
75793
75867
|
//#endregion
|
|
75794
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
75868
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/buffer.mjs
|
|
75795
75869
|
/**
|
|
75796
75870
|
* Compare two buffers in constant time.
|
|
75797
75871
|
*/
|
|
@@ -75836,7 +75910,7 @@ async function verifyPassword$2(hash, password) {
|
|
|
75836
75910
|
return (await generateKey(password, salt)).toString("hex") === key;
|
|
75837
75911
|
}
|
|
75838
75912
|
//#endregion
|
|
75839
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
75913
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/password.mjs
|
|
75840
75914
|
/**
|
|
75841
75915
|
* `@better-auth/utils/password` uses the "node" export condition in package.json
|
|
75842
75916
|
* to automatically pick the right implementation:
|
|
@@ -75848,7 +75922,7 @@ const verifyPassword$1 = async ({ hash, password }) => {
|
|
|
75848
75922
|
return verifyPassword$2(hash, password);
|
|
75849
75923
|
};
|
|
75850
75924
|
//#endregion
|
|
75851
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
75925
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/random.mjs
|
|
75852
75926
|
const generateRandomString = createRandomStringGenerator("a-z", "0-9", "A-Z", "-_");
|
|
75853
75927
|
//#endregion
|
|
75854
75928
|
//#region ../../../node_modules/.pnpm/@noble+ciphers@2.4.0/node_modules/@noble/ciphers/utils.js
|
|
@@ -77216,7 +77290,7 @@ const xchacha20poly1305 = /* @__PURE__ */ wrapCipher({
|
|
|
77216
77290
|
withAAD: true
|
|
77217
77291
|
}, /* @__PURE__ */ _poly1305_aead(xchacha20));
|
|
77218
77292
|
//#endregion
|
|
77219
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
77293
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/index.mjs
|
|
77220
77294
|
const ENVELOPE_PREFIX = "$ba$";
|
|
77221
77295
|
function parseEnvelope(data) {
|
|
77222
77296
|
if (!data.startsWith(ENVELOPE_PREFIX)) return null;
|
|
@@ -77529,7 +77603,7 @@ async function createIssuerRoster(database, issuer, wrap, now, membership) {
|
|
|
77529
77603
|
};
|
|
77530
77604
|
}
|
|
77531
77605
|
//#endregion
|
|
77532
|
-
//#region ../../../node_modules/.pnpm/@better-auth+expo@1.7.
|
|
77606
|
+
//#region ../../../node_modules/.pnpm/@better-auth+expo@1.7.12_33ca9fbfcfccbdca113b1991f52753d5/node_modules/@better-auth/expo/dist/version-C2EcINLO.js
|
|
77533
77607
|
const PACKAGE_VERSION$3 = "1.7.12";
|
|
77534
77608
|
//#endregion
|
|
77535
77609
|
//#region ../../../node_modules/.pnpm/@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-fetch+fetch@1.3.2_@openteleme_338ecedaca1e403fccc378badfe90a5e/node_modules/@better-auth/core/dist/async_hooks/index.mjs
|
|
@@ -79039,7 +79113,7 @@ function withServerOnly$1(options) {
|
|
|
79039
79113
|
*/
|
|
79040
79114
|
createAuthEndpoint$1.serverOnly = (options, handler) => createAuthEndpoint$1(withServerOnly$1(options), handler);
|
|
79041
79115
|
//#endregion
|
|
79042
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79116
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/wildcard.mjs
|
|
79043
79117
|
/**
|
|
79044
79118
|
* Escapes a character if it has a special meaning in regular expressions
|
|
79045
79119
|
* and returns the character as is if it doesn't
|
|
@@ -79144,7 +79218,7 @@ function wildcardMatch(pattern, options) {
|
|
|
79144
79218
|
return fn;
|
|
79145
79219
|
}
|
|
79146
79220
|
//#endregion
|
|
79147
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79221
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/url.mjs
|
|
79148
79222
|
const SLASH_CHAR_CODE = "/".charCodeAt(0);
|
|
79149
79223
|
/**
|
|
79150
79224
|
* Minimal loopback check for dev scheme inference only. Reachable from
|
|
@@ -79378,7 +79452,7 @@ function resolveBaseURL(config, basePath, source, loadEnv, trustedProxyHeaders)
|
|
|
79378
79452
|
return getBaseURL(void 0, basePath, request, loadEnv, trustedProxyHeaders);
|
|
79379
79453
|
}
|
|
79380
79454
|
//#endregion
|
|
79381
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79455
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/context/store-capabilities.mjs
|
|
79382
79456
|
function hasServerSessionStore(options) {
|
|
79383
79457
|
return !!options.database || !!options.secondaryStorage;
|
|
79384
79458
|
}
|
|
@@ -79389,12 +79463,12 @@ function shouldBindAccountCookieToSessionUser(options) {
|
|
|
79389
79463
|
return hasServerAccountStore(options);
|
|
79390
79464
|
}
|
|
79391
79465
|
//#endregion
|
|
79392
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79466
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/is-promise.mjs
|
|
79393
79467
|
function isPromise(obj) {
|
|
79394
79468
|
return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
|
|
79395
79469
|
}
|
|
79396
79470
|
//#endregion
|
|
79397
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79471
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/time.mjs
|
|
79398
79472
|
const SEC = 1e3;
|
|
79399
79473
|
const MIN = SEC * 60;
|
|
79400
79474
|
const HOUR = MIN * 60;
|
|
@@ -79475,7 +79549,7 @@ function sec(value) {
|
|
|
79475
79549
|
return Math.round(parse$3(value) / 1e3);
|
|
79476
79550
|
}
|
|
79477
79551
|
//#endregion
|
|
79478
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79552
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/cookies/cache.mjs
|
|
79479
79553
|
const cookieCachePayloadSchema = looseObject({
|
|
79480
79554
|
session: sessionSchema.loose(),
|
|
79481
79555
|
user: userSchema.loose(),
|
|
@@ -79503,7 +79577,7 @@ function parseCompactCookieCache(value) {
|
|
|
79503
79577
|
return result.success ? result.data : null;
|
|
79504
79578
|
}
|
|
79505
79579
|
//#endregion
|
|
79506
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79580
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/cookies/cookie-utils.mjs
|
|
79507
79581
|
function tryDecode$1(str) {
|
|
79508
79582
|
if (str.indexOf("%") === -1) return str;
|
|
79509
79583
|
try {
|
|
@@ -79605,7 +79679,7 @@ function parseCookies(cookie) {
|
|
|
79605
79679
|
return cookieMap;
|
|
79606
79680
|
}
|
|
79607
79681
|
//#endregion
|
|
79608
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79682
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/cookies/jwt.mjs
|
|
79609
79683
|
const SESSION_COOKIE_JWT_TYPE = "better-auth.session-cache+jwt";
|
|
79610
79684
|
const SESSION_COOKIE_JWT_AUDIENCE = "better-auth:session-cache";
|
|
79611
79685
|
function getSessionCookieJwtVerifyOptions(options) {
|
|
@@ -79626,7 +79700,7 @@ function parseSessionCookieJwtPayload(payload) {
|
|
|
79626
79700
|
};
|
|
79627
79701
|
}
|
|
79628
79702
|
//#endregion
|
|
79629
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79703
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/cookies/session-store.mjs
|
|
79630
79704
|
/**
|
|
79631
79705
|
* Per-cookie byte ceiling.
|
|
79632
79706
|
* Safari's ~4093 floor is the lowest among browsers.
|
|
@@ -79841,7 +79915,7 @@ const createHMAC = (algorithm = "SHA-256", encoding = "none") => {
|
|
|
79841
79915
|
return hmac;
|
|
79842
79916
|
};
|
|
79843
79917
|
//#endregion
|
|
79844
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
79918
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/cookies/index.mjs
|
|
79845
79919
|
function createCookieGetter(options) {
|
|
79846
79920
|
const baseURLString = typeof options.baseURL === "string" ? options.baseURL : void 0;
|
|
79847
79921
|
const dynamicProtocol = typeof options.baseURL === "object" && options.baseURL !== null ? options.baseURL.protocol : void 0;
|
|
@@ -80079,7 +80153,7 @@ function deleteSessionCookie(ctx, skipDontRememberMe) {
|
|
|
80079
80153
|
if (!skipDontRememberMe) expireCookie(ctx, ctx.context.authCookies.dontRememberToken);
|
|
80080
80154
|
}
|
|
80081
80155
|
//#endregion
|
|
80082
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80156
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/crypto/purpose.mjs
|
|
80083
80157
|
const salt = utf8ToBytes$1("better-auth:oauth-encryption:v1");
|
|
80084
80158
|
function deriveSecret(secret, purpose) {
|
|
80085
80159
|
return bytesToHex$1(hkdf(sha256$1, utf8ToBytes$1(secret), salt, utf8ToBytes$1(`better-auth:${purpose}:v1`), 32));
|
|
@@ -80094,7 +80168,7 @@ function derivePurposeKey(secret, purpose) {
|
|
|
80094
80168
|
};
|
|
80095
80169
|
}
|
|
80096
80170
|
//#endregion
|
|
80097
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80171
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/state.mjs
|
|
80098
80172
|
const stateDataSchema = looseObject({
|
|
80099
80173
|
callbackURL: string$1(),
|
|
80100
80174
|
codeVerifier: string$1(),
|
|
@@ -80290,7 +80364,7 @@ function appendQueryParams$1(input, params) {
|
|
|
80290
80364
|
return relative ? parsedURL.href.slice(parsedURL.origin.length) : parsedURL.href;
|
|
80291
80365
|
}
|
|
80292
80366
|
//#endregion
|
|
80293
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80367
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/errors.mjs
|
|
80294
80368
|
/**
|
|
80295
80369
|
* Error codes used in OAuth callback redirects (`?error=<code>`). These are
|
|
80296
80370
|
* URL-safe strings, not API error objects. Some also serve as the OAuth seam's
|
|
@@ -80337,7 +80411,7 @@ function missingEmailLogMessage(providerId, options) {
|
|
|
80337
80411
|
return `${options?.source === "generic" ? `Generic OAuth provider "${providerId}"` : `Provider "${providerId}"`} did not return an email${options?.source === "id_token" ? " in the id token" : ""}. Either request the provider's email scope, or create a placeholder via \`mapProfileToUser\`. See ${HANDLING_DOCS_URL}`;
|
|
80338
80412
|
}
|
|
80339
80413
|
//#endregion
|
|
80340
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80414
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/state/oauth.mjs
|
|
80341
80415
|
const { get: getRawOAuthState, set: setOAuthState } = defineRequestState(() => null);
|
|
80342
80416
|
/**
|
|
80343
80417
|
* @internal Read accumulated server context to embed during state generation.
|
|
@@ -80361,7 +80435,7 @@ const addOAuthServerContext = async (values) => {
|
|
|
80361
80435
|
});
|
|
80362
80436
|
};
|
|
80363
80437
|
//#endregion
|
|
80364
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80438
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/state.mjs
|
|
80365
80439
|
/**
|
|
80366
80440
|
* Mint the OIDC `nonce` for the redirect flow, or `undefined` when the provider
|
|
80367
80441
|
* does not require ID-token nonce binding. Every redirect entrypoint (social
|
|
@@ -80422,7 +80496,7 @@ async function parseState(c) {
|
|
|
80422
80496
|
return parsedData;
|
|
80423
80497
|
}
|
|
80424
80498
|
//#endregion
|
|
80425
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80499
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/hide-metadata.mjs
|
|
80426
80500
|
const HIDE_METADATA = { scope: "server" };
|
|
80427
80501
|
//#endregion
|
|
80428
80502
|
//#region ../../../node_modules/.pnpm/@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-fetch+fetch@1.3.2_@openteleme_ea9505522ecf88b80b3c861dd51758be/node_modules/@better-auth/core/dist/utils/is-api-error.mjs
|
|
@@ -80534,7 +80608,7 @@ function withServerOnly(options) {
|
|
|
80534
80608
|
*/
|
|
80535
80609
|
createAuthEndpoint.serverOnly = (options, handler) => createAuthEndpoint(withServerOnly(options), handler);
|
|
80536
80610
|
//#endregion
|
|
80537
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80611
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/middlewares/authorization.mjs
|
|
80538
80612
|
/**
|
|
80539
80613
|
* Middleware that verifies the authenticated user owns a resource.
|
|
80540
80614
|
* Must be used after sessionMiddleware in the `use` array.
|
|
@@ -80574,7 +80648,7 @@ function requireResourceOwnership(config) {
|
|
|
80574
80648
|
});
|
|
80575
80649
|
}
|
|
80576
80650
|
//#endregion
|
|
80577
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80651
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/auth/trusted-origins.mjs
|
|
80578
80652
|
const CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f-\u009f]/;
|
|
80579
80653
|
const RELATIVE_URL_PARSER_ORIGIN = "https://better-auth.invalid";
|
|
80580
80654
|
const ENCODED_PATH_SEPARATOR_PATTERN = /%2[fF]|%5[cC]/;
|
|
@@ -80692,7 +80766,7 @@ function deprecate(fn, message, logger) {
|
|
|
80692
80766
|
};
|
|
80693
80767
|
}
|
|
80694
80768
|
//#endregion
|
|
80695
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80769
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/middlewares/origin-check.mjs
|
|
80696
80770
|
/**
|
|
80697
80771
|
* Checks if CSRF should be skipped for backward compatibility.
|
|
80698
80772
|
* Previously, disableOriginCheck also disabled CSRF checks.
|
|
@@ -80840,7 +80914,7 @@ async function validateFormCsrf(ctx) {
|
|
|
80840
80914
|
if (headers.get("origin") || headers.get("referer")) return await validateOrigin(ctx, true);
|
|
80841
80915
|
}
|
|
80842
80916
|
//#endregion
|
|
80843
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
80917
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/rate-limiter/index.mjs
|
|
80844
80918
|
const memory = /* @__PURE__ */ new Map();
|
|
80845
80919
|
const MEMORY_STORE_MAX_ENTRIES = 1e5;
|
|
80846
80920
|
function pruneMemoryStore() {
|
|
@@ -81156,7 +81230,7 @@ function getDefaultSpecialRules() {
|
|
|
81156
81230
|
}];
|
|
81157
81231
|
}
|
|
81158
81232
|
//#endregion
|
|
81159
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
81233
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/state/should-session-refresh.mjs
|
|
81160
81234
|
/**
|
|
81161
81235
|
* State for skipping session refresh
|
|
81162
81236
|
*
|
|
@@ -81167,7 +81241,7 @@ function getDefaultSpecialRules() {
|
|
|
81167
81241
|
*/
|
|
81168
81242
|
const { get: getShouldSkipSessionRefresh, set: setShouldSkipSessionRefresh } = defineRequestState(() => false);
|
|
81169
81243
|
//#endregion
|
|
81170
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
81244
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/session.mjs
|
|
81171
81245
|
const getSession = () => createAuthEndpoint("/get-session", {
|
|
81172
81246
|
method: ["GET", "POST"],
|
|
81173
81247
|
operationId: "getSession",
|
|
@@ -81911,7 +81985,7 @@ function isLoopbackHost(host) {
|
|
|
81911
81985
|
return kind === "loopback" || kind === "localhost";
|
|
81912
81986
|
}
|
|
81913
81987
|
//#endregion
|
|
81914
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
81988
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/context/helpers.mjs
|
|
81915
81989
|
async function runPluginInit(context) {
|
|
81916
81990
|
let options = context.options;
|
|
81917
81991
|
const plugins = options.plugins || [];
|
|
@@ -82060,7 +82134,7 @@ async function getTrustedProviders(options, request) {
|
|
|
82060
82134
|
return (await trustedProviders(request) ?? []).filter((v) => Boolean(v));
|
|
82061
82135
|
}
|
|
82062
82136
|
//#endregion
|
|
82063
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
82137
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/account-key.mjs
|
|
82064
82138
|
/**
|
|
82065
82139
|
* Exposes a provider-declared profile as the raw claim record used by
|
|
82066
82140
|
* provisioning hooks. Provider profile interfaces are object-shaped but do
|
|
@@ -82101,7 +82175,7 @@ async function resolveOAuthAccountKeyForAPI(provider, tokens, profile) {
|
|
|
82101
82175
|
}
|
|
82102
82176
|
}
|
|
82103
82177
|
//#endregion
|
|
82104
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
82178
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/utils.mjs
|
|
82105
82179
|
/**
|
|
82106
82180
|
* Check if a string looks like encrypted data
|
|
82107
82181
|
*/
|
|
@@ -82132,7 +82206,7 @@ function getOAuthCallbackPath(provider) {
|
|
|
82132
82206
|
return provider.callbackPath.startsWith("/") ? provider.callbackPath : `/${provider.callbackPath}`;
|
|
82133
82207
|
}
|
|
82134
82208
|
//#endregion
|
|
82135
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
82209
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/request.mjs
|
|
82136
82210
|
function safeCloneRequest(request) {
|
|
82137
82211
|
if (!request) return;
|
|
82138
82212
|
try {
|
|
@@ -82154,7 +82228,7 @@ function safeCloneRequest(request) {
|
|
|
82154
82228
|
}
|
|
82155
82229
|
}
|
|
82156
82230
|
//#endregion
|
|
82157
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
82231
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/email-verification.mjs
|
|
82158
82232
|
async function createEmailVerificationToken(secret, email, updateTo, expiresIn = 3600, extraPayload) {
|
|
82159
82233
|
return await signJWT$1({
|
|
82160
82234
|
email: email.toLowerCase(),
|
|
@@ -83548,7 +83622,7 @@ async function verifyProviderIdToken(provider, token, nonce, ctx) {
|
|
|
83548
83622
|
}
|
|
83549
83623
|
}
|
|
83550
83624
|
//#endregion
|
|
83551
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
83625
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/link-account.mjs
|
|
83552
83626
|
function linkOAuthAccountFailure(code, message) {
|
|
83553
83627
|
return {
|
|
83554
83628
|
linked: false,
|
|
@@ -86902,7 +86976,7 @@ const socialProviders = {
|
|
|
86902
86976
|
const socialProviderList = Object.keys(socialProviders);
|
|
86903
86977
|
const SocialProviderListEnum = _enum(socialProviderList).or(string$1());
|
|
86904
86978
|
//#endregion
|
|
86905
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
86979
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/account.mjs
|
|
86906
86980
|
function parseStoredScopes(scope) {
|
|
86907
86981
|
if (!scope) return [];
|
|
86908
86982
|
return scope.split(",").map((s) => s.trim()).filter(Boolean);
|
|
@@ -87505,7 +87579,7 @@ const accountInfo = createAuthEndpoint("/account-info", {
|
|
|
87505
87579
|
});
|
|
87506
87580
|
});
|
|
87507
87581
|
//#endregion
|
|
87508
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
87582
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/oauth2/callback.mjs
|
|
87509
87583
|
/**
|
|
87510
87584
|
* Turns a provider callback into a verified identity. It checks that the
|
|
87511
87585
|
* callback answers this authorization request, exchanges the code, and
|
|
@@ -87568,7 +87642,7 @@ async function exchangeOAuthCallback(ctx, provider, callback) {
|
|
|
87568
87642
|
};
|
|
87569
87643
|
}
|
|
87570
87644
|
//#endregion
|
|
87571
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
87645
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/callback.mjs
|
|
87572
87646
|
const schema$2 = object({
|
|
87573
87647
|
code: string$1().optional(),
|
|
87574
87648
|
error: string$1().optional(),
|
|
@@ -87727,7 +87801,7 @@ const callbackOAuth = createAuthEndpoint("/callback/:id", {
|
|
|
87727
87801
|
throw c.redirect(toRedirectTo);
|
|
87728
87802
|
});
|
|
87729
87803
|
//#endregion
|
|
87730
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
87804
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/error.mjs
|
|
87731
87805
|
function sanitize(input) {
|
|
87732
87806
|
return input.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/&(?!amp;|lt;|gt;|quot;|#39;|#x[0-9a-fA-F]+;|#[0-9]+;)/g, "&");
|
|
87733
87807
|
}
|
|
@@ -88109,7 +88183,7 @@ const error = createAuthEndpoint("/error", {
|
|
|
88109
88183
|
return new Response(html(c.context.options, safeCode, safeDescription), { headers: { "Content-Type": "text/html" } });
|
|
88110
88184
|
});
|
|
88111
88185
|
//#endregion
|
|
88112
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88186
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/ok.mjs
|
|
88113
88187
|
const ok = createAuthEndpoint("/ok", {
|
|
88114
88188
|
method: "GET",
|
|
88115
88189
|
metadata: {
|
|
@@ -88133,7 +88207,7 @@ const ok = createAuthEndpoint("/ok", {
|
|
|
88133
88207
|
return ctx.json({ ok: true });
|
|
88134
88208
|
});
|
|
88135
88209
|
//#endregion
|
|
88136
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88210
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/password.mjs
|
|
88137
88211
|
function assertPasswordNotTooShort(ctx, password) {
|
|
88138
88212
|
if (password.length < ctx.context.password.config.minPasswordLength) {
|
|
88139
88213
|
ctx.context.logger.warn("Password is too short");
|
|
@@ -88203,7 +88277,7 @@ async function checkPassword(userId, c) {
|
|
|
88203
88277
|
return true;
|
|
88204
88278
|
}
|
|
88205
88279
|
//#endregion
|
|
88206
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88280
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/password.mjs
|
|
88207
88281
|
function redirectError(ctx, callbackURL, query) {
|
|
88208
88282
|
const url = callbackURL ? new URL(callbackURL, ctx.baseURL) : new URL(`${ctx.baseURL}/error`);
|
|
88209
88283
|
if (query) Object.entries(query).forEach(([k, v]) => url.searchParams.set(k, v));
|
|
@@ -88392,7 +88466,7 @@ password: string$1().meta({ description: "The password to verify" }) }),
|
|
|
88392
88466
|
return ctx.json({ status: true });
|
|
88393
88467
|
});
|
|
88394
88468
|
//#endregion
|
|
88395
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88469
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/sign-in.mjs
|
|
88396
88470
|
const socialSignInBodySchema = object({
|
|
88397
88471
|
/**
|
|
88398
88472
|
* Callback URL to redirect to after the user
|
|
@@ -88744,7 +88818,7 @@ const signInEmail = () => createAuthEndpoint("/sign-in/email", {
|
|
|
88744
88818
|
});
|
|
88745
88819
|
});
|
|
88746
88820
|
//#endregion
|
|
88747
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88821
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/sign-out.mjs
|
|
88748
88822
|
const signOutBodySchema = object({
|
|
88749
88823
|
callbackURL: string$1().meta({ description: "The URL to redirect to after provider logout" }).optional(),
|
|
88750
88824
|
disableRedirect: boolean$1().meta({ description: "Return the provider logout URL without redirecting" }).optional(),
|
|
@@ -88836,7 +88910,7 @@ const signOut = createAuthEndpoint("/sign-out", {
|
|
|
88836
88910
|
return ctx.json(signOutResponse());
|
|
88837
88911
|
});
|
|
88838
88912
|
//#endregion
|
|
88839
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
88913
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/sign-up.mjs
|
|
88840
88914
|
const signUpEmailBodySchema = object({
|
|
88841
88915
|
name: string$1(),
|
|
88842
88916
|
email: email(),
|
|
@@ -89090,7 +89164,7 @@ const signUpEmail = () => createAuthEndpoint("/sign-up/email", {
|
|
|
89090
89164
|
});
|
|
89091
89165
|
});
|
|
89092
89166
|
//#endregion
|
|
89093
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
89167
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/update-session.mjs
|
|
89094
89168
|
const updateSessionBodySchema = record$6(string$1().meta({ description: "Field name must be a string" }), any());
|
|
89095
89169
|
const updateSession = () => createAuthEndpoint("/update-session", {
|
|
89096
89170
|
method: "POST",
|
|
@@ -89140,7 +89214,7 @@ const updateSession = () => createAuthEndpoint("/update-session", {
|
|
|
89140
89214
|
return ctx.json({ session: parseSessionOutput(ctx.context.options, newSession) });
|
|
89141
89215
|
});
|
|
89142
89216
|
//#endregion
|
|
89143
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
89217
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/routes/update-user.mjs
|
|
89144
89218
|
const updateUserBodySchema = record$6(string$1().meta({ description: "Field name must be a string" }), any());
|
|
89145
89219
|
const updateUser = () => createAuthEndpoint("/update-user", {
|
|
89146
89220
|
method: "POST",
|
|
@@ -89642,7 +89716,7 @@ const changeEmail = createAuthEndpoint("/change-email", {
|
|
|
89642
89716
|
return ctx.json({ status: true });
|
|
89643
89717
|
});
|
|
89644
89718
|
//#endregion
|
|
89645
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
89719
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/dispatch.mjs
|
|
89646
89720
|
const defuReplaceArrays = createDefu((obj, key, value) => {
|
|
89647
89721
|
if (Array.isArray(obj[key]) && Array.isArray(value)) {
|
|
89648
89722
|
obj[key] = value;
|
|
@@ -89908,7 +89982,7 @@ async function dispatchAuthEndpoint(endpoint, input) {
|
|
|
89908
89982
|
}));
|
|
89909
89983
|
}
|
|
89910
89984
|
//#endregion
|
|
89911
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
89985
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/to-auth-endpoints.mjs
|
|
89912
89986
|
/**
|
|
89913
89987
|
* Resolves the per-call `AuthContext` for endpoints with a dynamic `baseURL`.
|
|
89914
89988
|
*
|
|
@@ -89962,7 +90036,7 @@ function toAuthEndpoints(endpoints, ctx) {
|
|
|
89962
90036
|
return api;
|
|
89963
90037
|
}
|
|
89964
90038
|
//#endregion
|
|
89965
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90039
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/api/index.mjs
|
|
89966
90040
|
function checkEndpointConflicts(options, logger) {
|
|
89967
90041
|
const endpointRegistry = /* @__PURE__ */ new Map();
|
|
89968
90042
|
options.plugins?.forEach((plugin) => {
|
|
@@ -90158,7 +90232,7 @@ const router = (ctx, options) => {
|
|
|
90158
90232
|
});
|
|
90159
90233
|
};
|
|
90160
90234
|
//#endregion
|
|
90161
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90235
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/adapter-base.mjs
|
|
90162
90236
|
async function getBaseAdapter(options, handleDirectDatabase) {
|
|
90163
90237
|
let adapter;
|
|
90164
90238
|
if (!options.database) {
|
|
@@ -90180,7 +90254,7 @@ async function getBaseAdapter(options, handleDirectDatabase) {
|
|
|
90180
90254
|
return adapter;
|
|
90181
90255
|
}
|
|
90182
90256
|
//#endregion
|
|
90183
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90257
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/adapter-kysely.mjs
|
|
90184
90258
|
async function getAdapter(options) {
|
|
90185
90259
|
return getBaseAdapter(options, async (opts) => {
|
|
90186
90260
|
const { createKyselyAdapter, kyselyAdapter } = await import("./kysely-adapter-D51abb3q.js");
|
|
@@ -90194,7 +90268,7 @@ async function getAdapter(options) {
|
|
|
90194
90268
|
});
|
|
90195
90269
|
}
|
|
90196
90270
|
//#endregion
|
|
90197
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90271
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/db/get-migration.mjs
|
|
90198
90272
|
const map = {
|
|
90199
90273
|
postgres: {
|
|
90200
90274
|
string: [
|
|
@@ -90868,10 +90942,10 @@ async function getMigrations(config, { throwOnUnsafe = true } = {}) {
|
|
|
90868
90942
|
};
|
|
90869
90943
|
}
|
|
90870
90944
|
//#endregion
|
|
90871
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90945
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/constants.mjs
|
|
90872
90946
|
const DEFAULT_SECRET = "better-auth-secret-12345678901234567890";
|
|
90873
90947
|
//#endregion
|
|
90874
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
90948
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/context/secret-utils.mjs
|
|
90875
90949
|
/**
|
|
90876
90950
|
* Estimates the entropy of a string in bits.
|
|
90877
90951
|
* This is a simple approximation that helps detect low-entropy secrets.
|
|
@@ -91287,7 +91361,7 @@ async function createTelemetry(options, context) {
|
|
|
91287
91361
|
} };
|
|
91288
91362
|
}
|
|
91289
91363
|
//#endregion
|
|
91290
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
91364
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/context/create-context.mjs
|
|
91291
91365
|
/**
|
|
91292
91366
|
* Estimates the entropy of a string in bits.
|
|
91293
91367
|
* This is a simple approximation that helps detect low-entropy secrets.
|
|
@@ -91500,7 +91574,7 @@ Most of the features of Better Auth will not work correctly.`);
|
|
|
91500
91574
|
return ctx;
|
|
91501
91575
|
}
|
|
91502
91576
|
//#endregion
|
|
91503
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
91577
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/context/init.mjs
|
|
91504
91578
|
const init = async (options) => {
|
|
91505
91579
|
const adapter = await getAdapter(options);
|
|
91506
91580
|
const getDatabaseType = (database) => getKyselyDatabaseType(database) || "unknown";
|
|
@@ -91513,7 +91587,7 @@ const init = async (options) => {
|
|
|
91513
91587
|
return ctx;
|
|
91514
91588
|
};
|
|
91515
91589
|
//#endregion
|
|
91516
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
91590
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/auth/base.mjs
|
|
91517
91591
|
const createBetterAuth = (options, initFn) => {
|
|
91518
91592
|
const authContext = initFn(options).then((ctx) => {
|
|
91519
91593
|
const validateSchema = ctx.options.advanced?.database?.validateSchema;
|
|
@@ -91572,7 +91646,7 @@ const createBetterAuth = (options, initFn) => {
|
|
|
91572
91646
|
};
|
|
91573
91647
|
};
|
|
91574
91648
|
//#endregion
|
|
91575
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
91649
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/auth/full.mjs
|
|
91576
91650
|
/**
|
|
91577
91651
|
* Better Auth initializer for full mode (with Kysely)
|
|
91578
91652
|
*
|
|
@@ -91598,7 +91672,7 @@ const betterAuth = (options) => {
|
|
|
91598
91672
|
return createBetterAuth(options, init);
|
|
91599
91673
|
};
|
|
91600
91674
|
//#endregion
|
|
91601
|
-
//#region ../../../node_modules/.pnpm/@better-auth+expo@1.7.
|
|
91675
|
+
//#region ../../../node_modules/.pnpm/@better-auth+expo@1.7.12_33ca9fbfcfccbdca113b1991f52753d5/node_modules/@better-auth/expo/dist/index.js
|
|
91602
91676
|
const expoAuthorizationProxy = createAuthEndpoint("/expo-authorization-proxy", {
|
|
91603
91677
|
method: "GET",
|
|
91604
91678
|
query: object({
|
|
@@ -91680,7 +91754,7 @@ const expo = (options) => {
|
|
|
91680
91754
|
};
|
|
91681
91755
|
};
|
|
91682
91756
|
//#endregion
|
|
91683
|
-
//#region ../../../node_modules/.pnpm/@better-auth+passkey@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-
|
|
91757
|
+
//#region ../../../node_modules/.pnpm/@better-auth+passkey@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-f_a07bbc5ef7aa0a57b0b46bffb791bb5a/node_modules/@better-auth/passkey/dist/version-DAM-NEJL.mjs
|
|
91684
91758
|
const PASSKEY_ERROR_CODES = defineErrorCodes({
|
|
91685
91759
|
CHALLENGE_NOT_FOUND: "Challenge not found",
|
|
91686
91760
|
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: "You are not allowed to register this passkey",
|
|
@@ -107072,7 +107146,7 @@ async function verifyAuthenticationResponse(options) {
|
|
|
107072
107146
|
};
|
|
107073
107147
|
}
|
|
107074
107148
|
//#endregion
|
|
107075
|
-
//#region ../../../node_modules/.pnpm/@better-auth+passkey@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-
|
|
107149
|
+
//#region ../../../node_modules/.pnpm/@better-auth+passkey@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-f_a07bbc5ef7aa0a57b0b46bffb791bb5a/node_modules/@better-auth/passkey/dist/index.mjs
|
|
107076
107150
|
function getRpID(options, baseURL) {
|
|
107077
107151
|
return options.rpID || (baseURL ? new URL(baseURL).hostname : "localhost");
|
|
107078
107152
|
}
|
|
@@ -107801,7 +107875,7 @@ const passkey = (options) => {
|
|
|
107801
107875
|
};
|
|
107802
107876
|
};
|
|
107803
107877
|
//#endregion
|
|
107804
|
-
//#region ../../../node_modules/.pnpm/@better-auth+sso@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-
|
|
107878
|
+
//#region ../../../node_modules/.pnpm/@better-auth+sso@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-fetch_b9626103a7db2d1d9eeddba112e9e320/node_modules/@better-auth/sso/dist/version-CQ9boRTM.mjs
|
|
107805
107879
|
const PACKAGE_VERSION$1 = "1.7.12";
|
|
107806
107880
|
const regexName = /* @__PURE__ */ new RegExp("^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
|
|
107807
107881
|
function getAllMatches(string, regex) {
|
|
@@ -163274,7 +163348,7 @@ function appendQueryParams(input, params) {
|
|
|
163274
163348
|
return relative ? parsedURL.href.slice(parsedURL.origin.length) : parsedURL.href;
|
|
163275
163349
|
}
|
|
163276
163350
|
//#endregion
|
|
163277
|
-
//#region ../../../node_modules/.pnpm/@better-auth+sso@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-
|
|
163351
|
+
//#region ../../../node_modules/.pnpm/@better-auth+sso@1.7.12_@better-auth+core@1.7.12_@better-auth+utils@0.5.0_@better-fetch_b9626103a7db2d1d9eeddba112e9e320/node_modules/@better-auth/sso/dist/index.mjs
|
|
163278
163352
|
/**
|
|
163279
163353
|
* SAML Constants
|
|
163280
163354
|
*
|
|
@@ -167794,7 +167868,7 @@ function sso(options) {
|
|
|
167794
167868
|
};
|
|
167795
167869
|
}
|
|
167796
167870
|
//#endregion
|
|
167797
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167871
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/access/access.mjs
|
|
167798
167872
|
function unknownResourceResponse(requestedResource) {
|
|
167799
167873
|
return {
|
|
167800
167874
|
success: false,
|
|
@@ -167870,10 +167944,10 @@ function createAccessControl(s) {
|
|
|
167870
167944
|
};
|
|
167871
167945
|
}
|
|
167872
167946
|
//#endregion
|
|
167873
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167947
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/version.mjs
|
|
167874
167948
|
const PACKAGE_VERSION = "1.7.12";
|
|
167875
167949
|
//#endregion
|
|
167876
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167950
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/plugin-helper.mjs
|
|
167877
167951
|
const getEndpointResponse = async (ctx) => {
|
|
167878
167952
|
const returned = ctx.context.returned;
|
|
167879
167953
|
if (!returned) return null;
|
|
@@ -167885,14 +167959,14 @@ const getEndpointResponse = async (ctx) => {
|
|
|
167885
167959
|
return returned;
|
|
167886
167960
|
};
|
|
167887
167961
|
//#endregion
|
|
167888
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167962
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/email-otp/error-codes.mjs
|
|
167889
167963
|
const EMAIL_OTP_ERROR_CODES = defineErrorCodes$1({
|
|
167890
167964
|
OTP_EXPIRED: "OTP expired",
|
|
167891
167965
|
INVALID_OTP: "Invalid OTP",
|
|
167892
167966
|
TOO_MANY_ATTEMPTS: "Too many attempts"
|
|
167893
167967
|
});
|
|
167894
167968
|
//#endregion
|
|
167895
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167969
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/email-otp/utils.mjs
|
|
167896
167970
|
function toOTPIdentifier(type, email) {
|
|
167897
167971
|
return `${type}-otp-${email}`;
|
|
167898
167972
|
}
|
|
@@ -167906,7 +167980,7 @@ function splitAtLastColon(input) {
|
|
|
167906
167980
|
return [input.slice(0, idx), input.slice(idx + 1)];
|
|
167907
167981
|
}
|
|
167908
167982
|
//#endregion
|
|
167909
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
167983
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/email-otp/otp-token.mjs
|
|
167910
167984
|
async function storeOTP(ctx, opts, otp) {
|
|
167911
167985
|
if (opts.storeOTP === "encrypted") return await symmetricEncrypt({
|
|
167912
167986
|
key: ctx.context.secretConfig,
|
|
@@ -167956,7 +168030,7 @@ async function tryReuseOTP(ctx, opts, identifier) {
|
|
|
167956
168030
|
return plainOtp;
|
|
167957
168031
|
}
|
|
167958
168032
|
//#endregion
|
|
167959
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
168033
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/email-otp/routes.mjs
|
|
167960
168034
|
const types = [
|
|
167961
168035
|
"email-verification",
|
|
167962
168036
|
"sign-in",
|
|
@@ -168730,7 +168804,7 @@ async function atomicVerifyOTP(ctx, opts, identifier, providedOTP) {
|
|
|
168730
168804
|
}
|
|
168731
168805
|
}
|
|
168732
168806
|
//#endregion
|
|
168733
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
168807
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/email-otp/index.mjs
|
|
168734
168808
|
const defaultOTPGenerator = (options) => generateRandomString(options.otpLength ?? 6, "0-9");
|
|
168735
168809
|
const emailOTP = (options) => {
|
|
168736
168810
|
const opts = {
|
|
@@ -168865,7 +168939,7 @@ const emailOTP = (options) => {
|
|
|
168865
168939
|
};
|
|
168866
168940
|
};
|
|
168867
168941
|
//#endregion
|
|
168868
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
168942
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/adapter.mjs
|
|
168869
168943
|
/**
|
|
168870
168944
|
* Algorithm for new keys, and for stored keys saved before the `alg` column
|
|
168871
168945
|
* existed.
|
|
@@ -168938,7 +169012,7 @@ const getJwksAdapter = (baseAdapter, options) => {
|
|
|
168938
169012
|
};
|
|
168939
169013
|
};
|
|
168940
169014
|
//#endregion
|
|
168941
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169015
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/utils.mjs
|
|
168942
169016
|
/**
|
|
168943
169017
|
* Converts an expirationTime to ISO seconds expiration time (the format of JWT exp)
|
|
168944
169018
|
*
|
|
@@ -168997,7 +169071,7 @@ async function createJwk(ctx, options) {
|
|
|
168997
169071
|
return await getJwksAdapter(ctx.context.adapter, options).createJwk(ctx, jwk);
|
|
168998
169072
|
}
|
|
168999
169073
|
//#endregion
|
|
169000
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169074
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/sign.mjs
|
|
169001
169075
|
/**
|
|
169002
169076
|
* Resolves the JWKS signing key, decrypts it, and imports it
|
|
169003
169077
|
* for use with jose's SignJWT. Returns null when signing is
|
|
@@ -169122,7 +169196,7 @@ async function getJwtToken(ctx, options) {
|
|
|
169122
169196
|
});
|
|
169123
169197
|
}
|
|
169124
169198
|
//#endregion
|
|
169125
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169199
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/verify.mjs
|
|
169126
169200
|
/**
|
|
169127
169201
|
* Verify a JWT token using the JWKS public keys
|
|
169128
169202
|
* Returns the payload if valid, null otherwise
|
|
@@ -169168,7 +169242,7 @@ async function verifyJWT(token, options) {
|
|
|
169168
169242
|
}
|
|
169169
169243
|
}
|
|
169170
169244
|
//#endregion
|
|
169171
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169245
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/cookie-cache.mjs
|
|
169172
169246
|
function getCookieCacheJwtIssuer(ctx) {
|
|
169173
169247
|
const baseURL = ctx.context.options.baseURL;
|
|
169174
169248
|
return typeof baseURL === "string" ? baseURL || "better-auth:session-cache" : ctx.context.baseURL || "better-auth:session-cache";
|
|
@@ -169234,7 +169308,7 @@ function createCookieCacheSigner(options) {
|
|
|
169234
169308
|
};
|
|
169235
169309
|
}
|
|
169236
169310
|
//#endregion
|
|
169237
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169311
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/schema.mjs
|
|
169238
169312
|
const schema = { jwks: { fields: {
|
|
169239
169313
|
publicKey: {
|
|
169240
169314
|
type: "string",
|
|
@@ -169262,7 +169336,7 @@ const schema = { jwks: { fields: {
|
|
|
169262
169336
|
}
|
|
169263
169337
|
} } };
|
|
169264
169338
|
//#endregion
|
|
169265
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169339
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/jwt/index.mjs
|
|
169266
169340
|
const signJWTBodySchema = object({
|
|
169267
169341
|
payload: record$6(string$1(), any()),
|
|
169268
169342
|
overrideOptions: record$6(string$1(), any()).optional()
|
|
@@ -169462,13 +169536,13 @@ const jwt = (options) => {
|
|
|
169462
169536
|
};
|
|
169463
169537
|
};
|
|
169464
169538
|
//#endregion
|
|
169465
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169539
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/magic-link/utils.mjs
|
|
169466
169540
|
const defaultKeyHasher = async (otp) => {
|
|
169467
169541
|
const hash = await createHash$1("SHA-256").digest(new TextEncoder().encode(otp));
|
|
169468
169542
|
return base64Url.encode(new Uint8Array(hash), { padding: false });
|
|
169469
169543
|
};
|
|
169470
169544
|
//#endregion
|
|
169471
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169545
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/magic-link/index.mjs
|
|
169472
169546
|
const signInMagicLinkBodySchema = object({
|
|
169473
169547
|
email: email().meta({ description: "Email address to send the magic link" }),
|
|
169474
169548
|
name: string$1().meta({ description: "User display name. Only used if the user is registering for the first time. Eg: \"my-name\"" }).optional(),
|
|
@@ -169678,7 +169752,7 @@ const magicLink = (options) => {
|
|
|
169678
169752
|
};
|
|
169679
169753
|
};
|
|
169680
169754
|
//#endregion
|
|
169681
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169755
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/client/parser.mjs
|
|
169682
169756
|
const PROTO_POLLUTION_PATTERNS = {
|
|
169683
169757
|
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*:/,
|
|
169684
169758
|
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*:/,
|
|
@@ -169747,7 +169821,7 @@ function parseJSON(value, options = { strict: true }) {
|
|
|
169747
169821
|
return betterJSONParse(value, options);
|
|
169748
169822
|
}
|
|
169749
169823
|
//#endregion
|
|
169750
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
169824
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/adapter.mjs
|
|
169751
169825
|
async function computeTeamMembershipKey(data) {
|
|
169752
169826
|
const digest = await createHash$1("SHA-256").digest(new TextEncoder().encode(JSON.stringify([data.teamId, data.userId])));
|
|
169753
169827
|
return base64Url.encode(new Uint8Array(digest), { padding: false });
|
|
@@ -170552,7 +170626,7 @@ const getOrgAdapter = (context, options) => {
|
|
|
170552
170626
|
};
|
|
170553
170627
|
};
|
|
170554
170628
|
//#endregion
|
|
170555
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170629
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
|
|
170556
170630
|
const defaultStatements = {
|
|
170557
170631
|
organization: ["update", "delete"],
|
|
170558
170632
|
member: [
|
|
@@ -170627,7 +170701,7 @@ const defaultRoles$1 = {
|
|
|
170627
170701
|
member: memberAc
|
|
170628
170702
|
};
|
|
170629
170703
|
//#endregion
|
|
170630
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170704
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/permission.mjs
|
|
170631
170705
|
const hasPermissionFn = (input, acRoles) => {
|
|
170632
170706
|
if (!input.permissions) return false;
|
|
170633
170707
|
const roles = input.role.split(",");
|
|
@@ -170640,7 +170714,7 @@ const hasPermissionFn = (input, acRoles) => {
|
|
|
170640
170714
|
};
|
|
170641
170715
|
const cacheAllRoles = /* @__PURE__ */ new Map();
|
|
170642
170716
|
//#endregion
|
|
170643
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170717
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/has-permission.mjs
|
|
170644
170718
|
const rolePermissionsSchema = record$6(string$1(), array(string$1()));
|
|
170645
170719
|
const hasPermission = async (input, ctx) => {
|
|
170646
170720
|
let acRoles = { ...input.options.roles || defaultRoles$1 };
|
|
@@ -170669,7 +170743,7 @@ const hasPermission = async (input, ctx) => {
|
|
|
170669
170743
|
return hasPermissionFn(input, acRoles);
|
|
170670
170744
|
};
|
|
170671
170745
|
//#endregion
|
|
170672
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170746
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/error-codes.mjs
|
|
170673
170747
|
const ORGANIZATION_ERROR_CODES = defineErrorCodes$1({
|
|
170674
170748
|
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
|
|
170675
170749
|
YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations",
|
|
@@ -170732,7 +170806,7 @@ const ORGANIZATION_ERROR_CODES = defineErrorCodes$1({
|
|
|
170732
170806
|
INVALID_TEAM_ID: "Team id contains a reserved character"
|
|
170733
170807
|
});
|
|
170734
170808
|
//#endregion
|
|
170735
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170809
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/utils/shim.mjs
|
|
170736
170810
|
const shimContext = (originalObject, newContext) => {
|
|
170737
170811
|
const shimmedObj = {};
|
|
170738
170812
|
for (const [key, value] of Object.entries(originalObject)) {
|
|
@@ -170753,7 +170827,7 @@ const shimContext = (originalObject, newContext) => {
|
|
|
170753
170827
|
return shimmedObj;
|
|
170754
170828
|
};
|
|
170755
170829
|
//#endregion
|
|
170756
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170830
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/call.mjs
|
|
170757
170831
|
const orgMiddleware = createAuthMiddleware(async () => {
|
|
170758
170832
|
return {};
|
|
170759
170833
|
});
|
|
@@ -170765,7 +170839,7 @@ const orgSessionMiddleware = createAuthMiddleware({ use: [sessionMiddleware] },
|
|
|
170765
170839
|
return { session: ctx.context.session };
|
|
170766
170840
|
});
|
|
170767
170841
|
//#endregion
|
|
170768
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
170842
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/routes/crud-access-control.mjs
|
|
170769
170843
|
const normalizeRoleName = (role) => role.toLowerCase();
|
|
170770
170844
|
const DEFAULT_MAXIMUM_ROLES_PER_ORGANIZATION = Number.POSITIVE_INFINITY;
|
|
170771
170845
|
const getAdditionalFields = (options, shouldBePartial = false) => {
|
|
@@ -171431,7 +171505,7 @@ async function checkIfRoleNameIsTakenByRoleInDB({ organizationId, role, ctx }) {
|
|
|
171431
171505
|
}
|
|
171432
171506
|
}
|
|
171433
171507
|
//#endregion
|
|
171434
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
171508
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/routes/crud-invites.mjs
|
|
171435
171509
|
const baseInvitationSchema = object({
|
|
171436
171510
|
email: string$1().meta({ description: "The email address of the user to invite" }),
|
|
171437
171511
|
role: union$1([string$1().meta({ description: "The role to assign to the user" }), array(string$1().meta({ description: "The roles to assign to the user" }))]).meta({ description: "The role(s) to assign to the user. It can be `admin`, `member`, owner. Eg: \"member\"" }),
|
|
@@ -172018,7 +172092,7 @@ const listUserInvitations = (options) => createAuthEndpoint("/organization/list-
|
|
|
172018
172092
|
return ctx.json(pendingInvitations);
|
|
172019
172093
|
});
|
|
172020
172094
|
//#endregion
|
|
172021
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
172095
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/routes/crud-members.mjs
|
|
172022
172096
|
const baseMemberSchema = object({
|
|
172023
172097
|
userId: string().meta({ description: "The user Id which represents the user to be added as a member. If `null` is provided, then it's expected to provide session headers. Eg: \"user-id\"" }),
|
|
172024
172098
|
role: union$1([string$1(), array(string$1())]).meta({ description: "The role(s) to assign to the new member. Eg: [\"admin\", \"sale\"]" }),
|
|
@@ -172523,7 +172597,7 @@ const getActiveMemberRole = (options) => createAuthEndpoint("/organization/get-a
|
|
|
172523
172597
|
return ctx.json({ role: member.role });
|
|
172524
172598
|
});
|
|
172525
172599
|
//#endregion
|
|
172526
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
172600
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/routes/crud-org.mjs
|
|
172527
172601
|
const baseOrganizationSchema = object({
|
|
172528
172602
|
name: string$1().min(1).meta({ description: "The name of the organization" }),
|
|
172529
172603
|
slug: string$1().min(1).meta({ description: "The slug of the organization" }),
|
|
@@ -172967,7 +173041,7 @@ const listOrganizations = (options) => createAuthEndpoint("/organization/list",
|
|
|
172967
173041
|
return ctx.json(organizations);
|
|
172968
173042
|
});
|
|
172969
173043
|
//#endregion
|
|
172970
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
173044
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/schema.mjs
|
|
172971
173045
|
const roleSchema = string$1();
|
|
172972
173046
|
const invitationStatus = _enum([
|
|
172973
173047
|
"pending",
|
|
@@ -173029,7 +173103,7 @@ const defaultRoles = [
|
|
|
173029
173103
|
];
|
|
173030
173104
|
union$1([_enum(defaultRoles), array(_enum(defaultRoles))]);
|
|
173031
173105
|
//#endregion
|
|
173032
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
173106
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/routes/crud-team.mjs
|
|
173033
173107
|
const teamBaseSchema = object({
|
|
173034
173108
|
name: string$1().meta({ description: "The name of the team. Eg: \"my-team\"" }),
|
|
173035
173109
|
organizationId: string$1().meta({ description: "The organization ID which the team will be created in. Defaults to the active organization. Eg: \"organization-id\"" }).optional()
|
|
@@ -173782,7 +173856,7 @@ const removeTeamMember = (options) => createAuthEndpoint("/organization/remove-t
|
|
|
173782
173856
|
return ctx.json({ message: "Team member removed successfully." });
|
|
173783
173857
|
});
|
|
173784
173858
|
//#endregion
|
|
173785
|
-
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.
|
|
173859
|
+
//#region ../../../node_modules/.pnpm/better-auth@1.7.12_@opentelemetry+api@1.9.1_drizzle-orm@0.45.4_@cloudflare+workers-type_e5a32620e03b1f1eddfe97806668c9ed/node_modules/better-auth/dist/plugins/organization/organization.mjs
|
|
173786
173860
|
function parseRoles(roles) {
|
|
173787
173861
|
return Array.isArray(roles) ? roles.join(",") : roles;
|
|
173788
173862
|
}
|