@tempoxyz/id 0.0.0-pr-187.sha-eed04d3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/dist/App.d.ts +20 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +26 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/client/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/ccip-Cq1mMiVl.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/client/assets/index-B7YJVP00.css +1 -0
- package/dist/app/client/assets/index-UXTxXCLk.js +55 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/db/auth.d.ts +3207 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +330 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +932 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +171 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +489 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/Pilat-Bold-C1t1eIrF.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Book-CbS8ofT8.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Demi-CADSbPAt.woff2 +0 -0
- package/dist/app/server/assets/Pilat-Regular-Bx8vzE7q.woff2 +0 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-DjQNeRZp.js +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js +31 -0
- package/dist/app/server/assets/authorize-C95F-9E1-CbESJKGU.js.map +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/call-UQamaCKN.js +32 -0
- package/dist/app/server/assets/call-UQamaCKN.js.map +1 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js +2 -0
- package/dist/app/server/assets/ccip-CbNKFO4n.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-CS900nSP.css +1 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js +10 -0
- package/dist/app/server/assets/cookie-Cce9CrIP.js.map +1 -0
- package/dist/app/server/assets/core-B1HCXUmx.js +56 -0
- package/dist/app/server/assets/core-B1HCXUmx.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-BJJ9PwCi.js.map +1 -0
- package/dist/app/server/assets/dist-BxSwugSY.js +1 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js +2 -0
- package/dist/app/server/assets/dist-CZGFhmQd.js.map +1 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js +15 -0
- package/dist/app/server/assets/dist-Dg3PQqiW.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-2tSPDT2b.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js +5 -0
- package/dist/app/server/assets/factory-ipHlJXZY.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js +6 -0
- package/dist/app/server/assets/get-id-field-B0x109VU.js.map +1 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-xpSuLpBt.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-8Uq5s5Pt.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-MkHAI9Jk.js +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/rolldown-runtime-B0Z9INg1.js +1 -0
- package/dist/app/server/assets/router-CcbyBCI4.css +1 -0
- package/dist/app/server/assets/router-xjZtEeaI.js +7 -0
- package/dist/app/server/assets/router-xjZtEeaI.js.map +1 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js +9 -0
- package/dist/app/server/assets/schema-check-Cf7QOZZD.js.map +1 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js +2 -0
- package/dist/app/server/assets/schemas-C2lCYmR5.js.map +1 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js +2 -0
- package/dist/app/server/assets/secp256k1-buM5g4AL.js.map +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js +2 -0
- package/dist/app/server/assets/standard-json-Cg1N07hM.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-xt1mWc9f.js.map +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-NSoY2xTp.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-CJwWeOUE.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-CV38yPnQ.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-BvlnBE2L.js.map +1 -0
- package/dist/app/server/index.js +574 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +38 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +62 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +36 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +14 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +27 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +20 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +88 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +49 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +85 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +178 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +29 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +39 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +35 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +41 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +89 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +14 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +9 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +16 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +76 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +9 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +17 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +12 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +13 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +18 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +11 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +15 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +16 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +15 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +101 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +90 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +161 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +113 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +170 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +227 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +85 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +83 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +39 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +34 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Provider.d.ts +16 -0
- package/dist/client/Provider.d.ts.map +1 -0
- package/dist/client/Provider.js +12 -0
- package/dist/client/Provider.js.map +1 -0
- package/dist/client/Step.d.ts +21 -0
- package/dist/client/Step.d.ts.map +1 -0
- package/dist/client/Step.js +16 -0
- package/dist/client/Step.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +40 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +16 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +25 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +34 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +53 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +79 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +84 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +63 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +115 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +105 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +88 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +60 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/provider.d.ts +49 -0
- package/dist/client/actions/provider.d.ts.map +1 -0
- package/dist/client/actions/provider.js +34 -0
- package/dist/client/actions/provider.js.map +1 -0
- package/dist/client/actions/realm.d.ts +24 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +15 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +153 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +236 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +14 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +106 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +129 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +33 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +46 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +9 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +58 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +45 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +20 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3051 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +472 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4058 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +137 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +532 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +326 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Device.d.ts +371 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +271 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +57 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +609 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +679 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1456 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1030 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +65 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +35 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +49 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +101 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +33 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +56 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +19 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +57 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +146 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +65 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +528 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +658 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +105 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +224 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +190 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +148 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +281 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +477 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +115 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +197 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +51 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +103 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Wallet.d.ts +37 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +43 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/worker.d.ts +12 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +12 -0
- package/dist/worker.js.map +1 -0
- package/package.json +82 -0
- package/src/Api.ts +151 -0
- package/src/App.ts +56 -0
- package/src/api/account.ts +311 -0
- package/src/api/authenticate.ts +1290 -0
- package/src/api/authorize.ts +1030 -0
- package/src/api/device.ts +874 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +335 -0
- package/src/api/lib/Auth.ts +134 -0
- package/src/api/lib/Consent.ts +339 -0
- package/src/api/lib/Cors.ts +107 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +265 -0
- package/src/api/lib/FirstAccount.ts +90 -0
- package/src/api/lib/KeySigner.ts +393 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +34 -0
- package/src/api/lib/SignInConsent.ts +316 -0
- package/src/api/oauth.ts +1282 -0
- package/src/api/provider.ts +441 -0
- package/src/app/components/Button.tsx +128 -0
- package/src/app/components/CodeInput.tsx +186 -0
- package/src/app/components/ErrorMessage.tsx +66 -0
- package/src/app/components/Grant.tsx +323 -0
- package/src/app/components/Input.tsx +48 -0
- package/src/app/components/Tooltip.tsx +45 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/crons/cleanup.ts +42 -0
- package/src/app/db/auth.ts +416 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/_journal.json +83 -0
- package/src/app/db/schema.ts +218 -0
- package/src/app/env.ts +49 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Loader.ts +24 -0
- package/src/app/package.json +8 -0
- package/src/app/routeTree.gen.ts +198 -0
- package/src/app/router.tsx +48 -0
- package/src/app/routes/[_].flows.tsx +3001 -0
- package/src/app/routes/__root.tsx +91 -0
- package/src/app/routes/authorize.tsx +197 -0
- package/src/app/routes/choose-account.tsx +111 -0
- package/src/app/routes/deposit.tsx +105 -0
- package/src/app/routes/device.tsx +227 -0
- package/src/app/routes/index.tsx +115 -0
- package/src/app/routes/login.tsx +506 -0
- package/src/app/screens/Account.tsx +347 -0
- package/src/app/screens/Approval.tsx +276 -0
- package/src/app/screens/ChooseAccount.tsx +240 -0
- package/src/app/screens/Deposit.tsx +762 -0
- package/src/app/screens/DeviceApproval.tsx +480 -0
- package/src/app/screens/SignIn.tsx +362 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +204 -0
- package/src/app/vite.config.ts +95 -0
- package/src/app/void.config.ts +29 -0
- package/src/app/zyzz.config.ts +274 -0
- package/src/cli/Admin.ts +73 -0
- package/src/cli/Apps.ts +29 -0
- package/src/cli/Cli.ts +42 -0
- package/src/cli/Project.ts +117 -0
- package/src/cli/Realms.ts +50 -0
- package/src/cli/Session.ts +239 -0
- package/src/cli/User.ts +45 -0
- package/src/cli/V1.ts +57 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +101 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +86 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +16 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +168 -0
- package/src/client/Auth.ts +285 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +410 -0
- package/src/client/Key.ts +140 -0
- package/src/client/Pending.ts +46 -0
- package/src/client/Permissions.ts +39 -0
- package/src/client/Provider.ts +18 -0
- package/src/client/Step.ts +24 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +42 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +57 -0
- package/src/client/actions/device.ts +151 -0
- package/src/client/actions/email.ts +141 -0
- package/src/client/actions/oauth.ts +182 -0
- package/src/client/actions/passkey.ts +141 -0
- package/src/client/actions/provider.ts +70 -0
- package/src/client/actions/realm.ts +36 -0
- package/src/client/actions/redirect.ts +408 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +15 -0
- package/src/client/internal/api.ts +224 -0
- package/src/client/internal/headless.ts +77 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +71 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client.ts +19 -0
- package/src/index.ts +6 -0
- package/src/internal/Apps.ts +718 -0
- package/src/internal/Auth.ts +203 -0
- package/src/internal/Authorize.ts +424 -0
- package/src/internal/Balance.ts +168 -0
- package/src/internal/BodyLimit.ts +36 -0
- package/src/internal/Chain.ts +16 -0
- package/src/internal/Device.ts +469 -0
- package/src/internal/Env.ts +58 -0
- package/src/internal/ErrorResponse.ts +854 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1339 -0
- package/src/internal/Limits.ts +39 -0
- package/src/internal/Log.ts +178 -0
- package/src/internal/LogLine.ts +87 -0
- package/src/internal/Logout.ts +336 -0
- package/src/internal/Migrations.ts +86 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +211 -0
- package/src/internal/Passkey.ts +1052 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +402 -0
- package/src/internal/Provider.ts +125 -0
- package/src/internal/RateLimit.ts +259 -0
- package/src/internal/Realm.ts +768 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +168 -0
- package/src/internal/SigningKey.ts +286 -0
- package/src/internal/TempoAccount.ts +342 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +158 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Wallet.ts +62 -0
- package/src/internal/owners/Passkey.ts +72 -0
- package/src/internal/owners/Privy.ts +81 -0
- package/src/internal/owners/Secp256k1.ts +143 -0
- package/src/types/app.d.ts +19 -0
- package/src/worker.ts +11 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** The health probe, which reports the Worker version that responded. @module */
|
|
2
|
+
import { Hono } from 'hono'
|
|
3
|
+
import * as z from 'zod'
|
|
4
|
+
import type { Env } from '../internal/Env.js'
|
|
5
|
+
import * as OpenApi from '../internal/OpenApi.js'
|
|
6
|
+
|
|
7
|
+
/** The Worker version that Cloudflare's version metadata binding reports. */
|
|
8
|
+
type Version = {
|
|
9
|
+
/** The version's ID, as `wrangler deploy` prints it. */
|
|
10
|
+
id: string
|
|
11
|
+
/** The version's tag, or empty when it has none. */
|
|
12
|
+
tag: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Void types `c.env` from this global interface. `void.config.ts` declares the binding.
|
|
16
|
+
declare global {
|
|
17
|
+
interface VoidGeneratedEnvBindings {
|
|
18
|
+
/** The Worker version that serves the request. */
|
|
19
|
+
readonly CF_VERSION_METADATA: Version
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
namespace schema {
|
|
24
|
+
export namespace health {
|
|
25
|
+
export const response = z.object({
|
|
26
|
+
ok: z.literal(true).meta({ description: 'Always `true`.' }),
|
|
27
|
+
version: z
|
|
28
|
+
.object({
|
|
29
|
+
id: z.string().meta({
|
|
30
|
+
description: "The version's ID, as `wrangler deploy` prints it.",
|
|
31
|
+
examples: ['a5f3c2e1-7b4d-4e8a-9c6f-2d1b0e3a4c5f'],
|
|
32
|
+
}),
|
|
33
|
+
tag: z.string().meta({
|
|
34
|
+
description: "The version's tag, or empty when it has none.",
|
|
35
|
+
examples: ['v1.4.0'],
|
|
36
|
+
}),
|
|
37
|
+
})
|
|
38
|
+
.meta({
|
|
39
|
+
description: 'The deployed Worker version that served the request.',
|
|
40
|
+
}),
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The health probe. */
|
|
46
|
+
export const health = new Hono<
|
|
47
|
+
Env & {
|
|
48
|
+
/** The bindings the probe reads. */
|
|
49
|
+
Bindings: Pick<VoidGeneratedEnvBindings, 'CF_VERSION_METADATA'>
|
|
50
|
+
}
|
|
51
|
+
>()
|
|
52
|
+
// Infrastructure probes call an unversioned path, which no app calls. It returns the version that
|
|
53
|
+
// served the request, so a deploy can be verified by its ID or tag.
|
|
54
|
+
.get(
|
|
55
|
+
'/health',
|
|
56
|
+
OpenApi.describeRoute({
|
|
57
|
+
description:
|
|
58
|
+
'Responds while the Worker is up, with the version that served the request.',
|
|
59
|
+
responses: OpenApi.responses({
|
|
60
|
+
success: {
|
|
61
|
+
description: 'The Worker is up.',
|
|
62
|
+
schema: schema.health.response,
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
tags: ['Health'],
|
|
66
|
+
}),
|
|
67
|
+
(c) => {
|
|
68
|
+
const { id, tag } = c.env.CF_VERSION_METADATA
|
|
69
|
+
c.header('cache-control', 'no-store')
|
|
70
|
+
return c.json({ ok: true as const, version: { id, tag } }, 200)
|
|
71
|
+
},
|
|
72
|
+
)
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The account step: a user with more than one Tempo Account in an app's realms selects the one the
|
|
3
|
+
* app uses. The `__Host-tempo-id-account` cookie holds the selection for each app, by client ID,
|
|
4
|
+
* with the ID of the session that made it. The cookie's `__Host-` prefix pins it to Tempo ID's
|
|
5
|
+
* host. A selection counts only within that session, and only while it names one of the signed-in
|
|
6
|
+
* user's accounts in the app's realms, so every sign-out and session expiry ends it.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from 'hono'
|
|
10
|
+
import { env } from 'void/env'
|
|
11
|
+
import { parse, serialize } from 'hono/utils/cookie'
|
|
12
|
+
import { z } from 'zod'
|
|
13
|
+
import type { Env } from '../../internal/Env.js'
|
|
14
|
+
import * as Log from '../../internal/Log.js'
|
|
15
|
+
import * as Realm from '../../internal/Realm.js'
|
|
16
|
+
import * as TempoAccount from '../../internal/TempoAccount.js'
|
|
17
|
+
import * as Timing from '../../internal/Timing.js'
|
|
18
|
+
import { db } from './Database.js'
|
|
19
|
+
|
|
20
|
+
/** The selection cookie. */
|
|
21
|
+
export const cookie = '__Host-tempo-id-account'
|
|
22
|
+
|
|
23
|
+
/** How many apps' selections the cookie keeps. A selection for another app drops the oldest. */
|
|
24
|
+
const limit = 16
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* How long the cookie lasts, in seconds: 400 days, the most that browsers keep a cookie. The
|
|
28
|
+
* session's ID bounds each selection, so a session that Better Auth extends keeps its selections.
|
|
29
|
+
*/
|
|
30
|
+
const maxAge = 400 * 24 * 60 * 60
|
|
31
|
+
|
|
32
|
+
namespace schema {
|
|
33
|
+
export const value = z.object({
|
|
34
|
+
apps: z.record(z.string(), z.string()),
|
|
35
|
+
session: z.string(),
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns the Tempo Accounts that the user holds in the realms of the app with `clientId`, oldest
|
|
41
|
+
* first. The step creates no account, so a user with none receives an empty list.
|
|
42
|
+
*/
|
|
43
|
+
export async function accounts(
|
|
44
|
+
c: Timing.measure.Context,
|
|
45
|
+
options: accounts.Options,
|
|
46
|
+
) {
|
|
47
|
+
const owned = await Timing.measure(c, held(c, options), 'AccountStep.held')
|
|
48
|
+
return owned.map(TempoAccount.serialize)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace accounts {
|
|
52
|
+
export type Options = {
|
|
53
|
+
/** The app's client ID. */
|
|
54
|
+
clientId: string
|
|
55
|
+
/** The user's ID. */
|
|
56
|
+
userId: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The refusals `accounts` throws, which `ErrorResponse.handle` responds with: Privy's failures. */
|
|
60
|
+
export const errors = TempoAccount.held.errors
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Returns the `Set-Cookie` value that clears every app's selection, as sign-out does. */
|
|
64
|
+
export function clear() {
|
|
65
|
+
return serialize(cookie, '', {
|
|
66
|
+
httpOnly: true,
|
|
67
|
+
maxAge: 0,
|
|
68
|
+
path: '/',
|
|
69
|
+
sameSite: 'Lax',
|
|
70
|
+
secure: true,
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns the keys that own the Tempo Accounts that the user holds in the realms of the app with
|
|
76
|
+
* `clientId`, as {@link held} does, and creates an account in the first realm for a user with
|
|
77
|
+
* none, as `POST /v1/account` does through `TempoAccount.create`.
|
|
78
|
+
*/
|
|
79
|
+
export async function create(
|
|
80
|
+
c: Timing.measure.Context,
|
|
81
|
+
options: create.Options,
|
|
82
|
+
) {
|
|
83
|
+
const reached = await Timing.measure(
|
|
84
|
+
c,
|
|
85
|
+
realms(c, options),
|
|
86
|
+
'AccountStep.realms',
|
|
87
|
+
)
|
|
88
|
+
return await Timing.measure(
|
|
89
|
+
c,
|
|
90
|
+
TempoAccount.create(c, {
|
|
91
|
+
db,
|
|
92
|
+
env,
|
|
93
|
+
realms: reached,
|
|
94
|
+
userId: options.userId,
|
|
95
|
+
}),
|
|
96
|
+
'TempoAccount.create',
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export namespace create {
|
|
101
|
+
export type Options = accounts.Options
|
|
102
|
+
|
|
103
|
+
/** The refusals `create` throws, which `ErrorResponse.handle` responds with: Privy's failures. */
|
|
104
|
+
export const errors = TempoAccount.create.errors
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns whether {@link create} can create a first account for a user of the app with `clientId`
|
|
109
|
+
* who holds none: the first of the app's realms has a Privy app, or holds secp256k1 owners.
|
|
110
|
+
*/
|
|
111
|
+
export async function creates(
|
|
112
|
+
c: Timing.measure.Context,
|
|
113
|
+
options: creates.Options,
|
|
114
|
+
) {
|
|
115
|
+
const reached = await Timing.measure(
|
|
116
|
+
c,
|
|
117
|
+
realms(c, options),
|
|
118
|
+
'AccountStep.realms',
|
|
119
|
+
)
|
|
120
|
+
const first = reached[0]
|
|
121
|
+
return first !== undefined && (first.privy !== undefined || first.secp256k1)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export declare namespace creates {
|
|
125
|
+
type Options = {
|
|
126
|
+
/** The app's client ID. */
|
|
127
|
+
clientId: string
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Returns whether the authorization of the app with `clientId` needs the account step: the user
|
|
133
|
+
* holds more than one account in the app's realms, and the `Cookie` header selects none of them
|
|
134
|
+
* for the session. The read counts against the user's `ACCOUNT_LIMIT`, as `GET /v1/account` does.
|
|
135
|
+
* When the limit is spent, or the accounts cannot be read, such as during a Privy outage, it
|
|
136
|
+
* returns `false`, so the authorization continues without the step.
|
|
137
|
+
*/
|
|
138
|
+
export async function due(c: Context<Env>, options: due.Options) {
|
|
139
|
+
// Each read can call every realm's Privy app, whose quota every user shares. The limiter is
|
|
140
|
+
// called directly, so an authorization that skips the step carries no refusal headers.
|
|
141
|
+
const outcome = await Timing.measure(
|
|
142
|
+
c,
|
|
143
|
+
c.env.ACCOUNT_LIMIT.limit({ key: options.userId }),
|
|
144
|
+
'ratelimit.limit',
|
|
145
|
+
)
|
|
146
|
+
if (!outcome.success) return false
|
|
147
|
+
|
|
148
|
+
const list = await Timing.measure(
|
|
149
|
+
c,
|
|
150
|
+
accounts(c, options),
|
|
151
|
+
'AccountStep.accounts',
|
|
152
|
+
).catch((error: unknown) => {
|
|
153
|
+
Log.warn(c, {
|
|
154
|
+
error,
|
|
155
|
+
fields: { clientId: options.clientId },
|
|
156
|
+
message:
|
|
157
|
+
'The account step skipped an authorization whose accounts failed to load.',
|
|
158
|
+
})
|
|
159
|
+
return []
|
|
160
|
+
})
|
|
161
|
+
if (list.length <= 1) return false
|
|
162
|
+
return !find(list, selected(options))
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare namespace due {
|
|
166
|
+
type Options = {
|
|
167
|
+
/** The app's client ID. */
|
|
168
|
+
clientId: string
|
|
169
|
+
/** The request's `Cookie` header, if any. */
|
|
170
|
+
cookie: string | null | undefined
|
|
171
|
+
/** The ID of the signed-in session. */
|
|
172
|
+
sessionId: string
|
|
173
|
+
/** The user's ID. */
|
|
174
|
+
userId: string
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Returns the account in `list` at `address`, ignoring case, or `undefined`. */
|
|
179
|
+
export function find(
|
|
180
|
+
list: readonly TempoAccount.TempoAccount[],
|
|
181
|
+
address: string | undefined,
|
|
182
|
+
) {
|
|
183
|
+
if (!address) return undefined
|
|
184
|
+
return list.find(
|
|
185
|
+
(account) => account.address.toLowerCase() === address.toLowerCase(),
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Returns the keys that own the Tempo Accounts that the user holds in the realms of the app with
|
|
191
|
+
* `clientId`, oldest first, as {@link accounts} lists them. It creates no account. A Privy owner
|
|
192
|
+
* can sign for its account.
|
|
193
|
+
*/
|
|
194
|
+
export async function held(c: Timing.measure.Context, options: held.Options) {
|
|
195
|
+
const reached = await Timing.measure(
|
|
196
|
+
c,
|
|
197
|
+
realms(c, options),
|
|
198
|
+
'AccountStep.realms',
|
|
199
|
+
)
|
|
200
|
+
return await Timing.measure(
|
|
201
|
+
c,
|
|
202
|
+
TempoAccount.held(c, {
|
|
203
|
+
db,
|
|
204
|
+
env,
|
|
205
|
+
realms: reached,
|
|
206
|
+
userId: options.userId,
|
|
207
|
+
}),
|
|
208
|
+
'TempoAccount.held',
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export namespace held {
|
|
213
|
+
export type Options = accounts.Options
|
|
214
|
+
|
|
215
|
+
/** The refusals `held` throws, which `ErrorResponse.handle` responds with: Privy's failures. */
|
|
216
|
+
export const errors = TempoAccount.held.errors
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Returns `list` with the account that the `Cookie` header selects for the app with `clientId`
|
|
221
|
+
* within the session first, and the others in their order. Without a selection in `list`, it
|
|
222
|
+
* returns `list` as it is.
|
|
223
|
+
*/
|
|
224
|
+
export function order(
|
|
225
|
+
list: readonly TempoAccount.TempoAccount[],
|
|
226
|
+
options: selected.Options,
|
|
227
|
+
) {
|
|
228
|
+
const account = find(list, selected(options))
|
|
229
|
+
if (!account) return list
|
|
230
|
+
return [account, ...list.filter((entry) => entry !== account)]
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Returns the `Cookie` header with the selection of `account` for the app with `clientId`, and the
|
|
235
|
+
* `Set-Cookie` value that stores it. The session's earlier selections stay, up to {@link limit}
|
|
236
|
+
* apps, and another session's selections drop.
|
|
237
|
+
*/
|
|
238
|
+
export function select(options: select.Options) {
|
|
239
|
+
const pairs = (options.cookie ?? '')
|
|
240
|
+
.split(';')
|
|
241
|
+
.map((pair) => pair.trim())
|
|
242
|
+
.filter((pair) => pair && !pair.startsWith(`${cookie}=`))
|
|
243
|
+
const { [options.clientId]: _, ...rest } = read(options)
|
|
244
|
+
const value = JSON.stringify({
|
|
245
|
+
apps: {
|
|
246
|
+
...Object.fromEntries(Object.entries(rest).slice(1 - limit)),
|
|
247
|
+
[options.clientId]: options.account,
|
|
248
|
+
},
|
|
249
|
+
session: options.sessionId,
|
|
250
|
+
})
|
|
251
|
+
return {
|
|
252
|
+
header: [...pairs, `${cookie}=${encodeURIComponent(value)}`].join('; '),
|
|
253
|
+
setCookie: serialize(cookie, value, {
|
|
254
|
+
httpOnly: true,
|
|
255
|
+
maxAge,
|
|
256
|
+
path: '/',
|
|
257
|
+
sameSite: 'Lax',
|
|
258
|
+
secure: true,
|
|
259
|
+
}),
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare namespace select {
|
|
264
|
+
type Options = {
|
|
265
|
+
/** The selected account's address. */
|
|
266
|
+
account: string
|
|
267
|
+
/** The app's client ID. */
|
|
268
|
+
clientId: string
|
|
269
|
+
/** The request's `Cookie` header, if any. */
|
|
270
|
+
cookie: string | null | undefined
|
|
271
|
+
/** The ID of the signed-in session. */
|
|
272
|
+
sessionId: string
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Returns the address that the `Cookie` header selects for the app with `clientId` within the
|
|
278
|
+
* session, if any.
|
|
279
|
+
*/
|
|
280
|
+
export function selected(options: selected.Options) {
|
|
281
|
+
const apps = read(options)
|
|
282
|
+
return Object.hasOwn(apps, options.clientId)
|
|
283
|
+
? apps[options.clientId]
|
|
284
|
+
: undefined
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export declare namespace selected {
|
|
288
|
+
type Options = {
|
|
289
|
+
/** The app's client ID. */
|
|
290
|
+
clientId: string
|
|
291
|
+
/** The request's `Cookie` header, if any. */
|
|
292
|
+
cookie: string | null | undefined
|
|
293
|
+
/** The ID of the signed-in session. */
|
|
294
|
+
sessionId: string
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Reads the session's selections, by client ID. A missing or unreadable cookie, or one from another
|
|
300
|
+
* session, holds none.
|
|
301
|
+
*/
|
|
302
|
+
function read(
|
|
303
|
+
options: Pick<selected.Options, 'cookie' | 'sessionId'>,
|
|
304
|
+
): Record<string, string> {
|
|
305
|
+
const value = parse(options.cookie ?? '', cookie)[cookie]
|
|
306
|
+
if (!value) return {}
|
|
307
|
+
try {
|
|
308
|
+
const parsed = schema.value.safeParse(JSON.parse(value))
|
|
309
|
+
if (!parsed.success || parsed.data.session !== options.sessionId) return {}
|
|
310
|
+
return parsed.data.apps
|
|
311
|
+
} catch {
|
|
312
|
+
return {}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Returns the realms of the app with `clientId`, in order, with their default relying parties. */
|
|
317
|
+
async function realms(c: Timing.measure.Context, options: realms.Options) {
|
|
318
|
+
const stored = await Timing.measure(
|
|
319
|
+
c,
|
|
320
|
+
Realm.forApp(db, { clientId: options.clientId }),
|
|
321
|
+
'Realm.forApp',
|
|
322
|
+
)
|
|
323
|
+
return await Timing.measure(
|
|
324
|
+
c,
|
|
325
|
+
Realm.withDefaults(db, { origin: env.URL, realms: stored }),
|
|
326
|
+
'Realm.withDefaults',
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare namespace realms {
|
|
331
|
+
type Options = {
|
|
332
|
+
/** The app's client ID. */
|
|
333
|
+
clientId: string
|
|
334
|
+
}
|
|
335
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the request's Better Auth instance from Void's database, env, and email, and sets it on
|
|
3
|
+
* `c.var.auth` for the routes and pages.
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { betterAuth } from 'better-auth'
|
|
7
|
+
import type { Context } from 'hono'
|
|
8
|
+
import { createMiddleware } from 'hono/factory'
|
|
9
|
+
import { db } from 'void/db'
|
|
10
|
+
import { sendEmail } from 'void/email'
|
|
11
|
+
import { env } from 'void/env'
|
|
12
|
+
import * as core_Auth from '../../internal/Auth.js'
|
|
13
|
+
import type { Env } from '../../internal/Env.js'
|
|
14
|
+
import * as ErrorResponse from '../../internal/ErrorResponse.js'
|
|
15
|
+
import * as PendingKey from '../../internal/PendingKey.js'
|
|
16
|
+
import * as TestInbox from '../../internal/TestInbox.js'
|
|
17
|
+
import * as Timing from '../../internal/Timing.js'
|
|
18
|
+
import * as AccountStep from './AccountStep.js'
|
|
19
|
+
import * as Database from './Database.js'
|
|
20
|
+
|
|
21
|
+
/** The email service does not deliver to the address, such as one outside the verified destinations. */
|
|
22
|
+
export class UndeliverableError extends Error {
|
|
23
|
+
override readonly name = 'Auth.UndeliverableError'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sets `c.var.auth`. The instance lives for one request, since its background sends join that
|
|
28
|
+
* request's `waitUntil`.
|
|
29
|
+
*/
|
|
30
|
+
export const middleware = createMiddleware<Env>(async (c, next) => {
|
|
31
|
+
c.set('auth', create(c))
|
|
32
|
+
await next()
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
/** Returns a Better Auth instance for the request `c`. */
|
|
36
|
+
export function create(c: Context<Env>): core_Auth.Instance {
|
|
37
|
+
return betterAuth(
|
|
38
|
+
core_Auth.options({
|
|
39
|
+
// A request that already chose the account, such as `POST /v1/authorize`, needs no account step.
|
|
40
|
+
accountStep: (options) =>
|
|
41
|
+
c.var.accountChosen
|
|
42
|
+
? Promise.resolve(false)
|
|
43
|
+
: Timing.measure(
|
|
44
|
+
c,
|
|
45
|
+
AccountStep.due(c, {
|
|
46
|
+
clientId: options.clientId,
|
|
47
|
+
cookie: options.headers.get('cookie'),
|
|
48
|
+
sessionId: options.sessionId,
|
|
49
|
+
userId: options.userId,
|
|
50
|
+
}),
|
|
51
|
+
'AccountStep.due',
|
|
52
|
+
),
|
|
53
|
+
baseURL: env.URL,
|
|
54
|
+
db,
|
|
55
|
+
google: google(),
|
|
56
|
+
pendingKey: (options) =>
|
|
57
|
+
Timing.measure(
|
|
58
|
+
c,
|
|
59
|
+
PendingKey.take(Database.db, options),
|
|
60
|
+
'PendingKey.take',
|
|
61
|
+
),
|
|
62
|
+
secret: env.SECRET,
|
|
63
|
+
sendCode: (options) => sendCode(c, options),
|
|
64
|
+
waitUntil: (promise) => c.executionCtx.waitUntil(promise),
|
|
65
|
+
}),
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Returns Google's OAuth client from the env, or nothing when the deployment sets none. */
|
|
70
|
+
export function google() {
|
|
71
|
+
const { GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET } = env
|
|
72
|
+
if (!GOOGLE_CLIENT_ID || !GOOGLE_CLIENT_SECRET) return undefined
|
|
73
|
+
return { clientId: GOOGLE_CLIENT_ID, clientSecret: GOOGLE_CLIENT_SECRET }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Emails a sign-in code to an address, and resolves once the email service accepts it. An address
|
|
78
|
+
* under `TEST_EMAIL_DOMAIN` goes to the `TEST_INBOX` binding instead, when the deployment sets both,
|
|
79
|
+
* as a preview does.
|
|
80
|
+
*
|
|
81
|
+
* @throws {ErrorResponse.RateLimitedError} When the email service's rate limit or quota refuses the
|
|
82
|
+
* message.
|
|
83
|
+
* @throws {UndeliverableError} When the email service does not deliver to the address.
|
|
84
|
+
* @throws {Error} When the email service or the test inbox refuses the message for another reason.
|
|
85
|
+
*/
|
|
86
|
+
export async function sendCode(c: Context<Env>, options: sendCode.Options) {
|
|
87
|
+
const message = {
|
|
88
|
+
subject: 'Your Tempo ID sign-in code',
|
|
89
|
+
text: `Your sign-in code is ${options.code}. It expires in 10 minutes.`,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const inbox = c.env.TEST_INBOX
|
|
93
|
+
if (
|
|
94
|
+
inbox &&
|
|
95
|
+
TestInbox.matches({ domain: env.TEST_EMAIL_DOMAIN, email: options.email })
|
|
96
|
+
) {
|
|
97
|
+
await Timing.measure(
|
|
98
|
+
c,
|
|
99
|
+
inbox.capture({ ...message, to: [{ email: options.email }] }),
|
|
100
|
+
'inbox.capture',
|
|
101
|
+
)
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const result = await Timing.measure(
|
|
106
|
+
c,
|
|
107
|
+
sendEmail({ ...message, to: options.email }),
|
|
108
|
+
'email.send',
|
|
109
|
+
)
|
|
110
|
+
if (result.ok) return
|
|
111
|
+
|
|
112
|
+
const code = 'error' in result ? result.error.code : undefined
|
|
113
|
+
if (code === 'QUOTA_EXCEEDED') throw new ErrorResponse.RateLimitedError()
|
|
114
|
+
// The message names no address, which can hold personal data.
|
|
115
|
+
if (code === 'UNVERIFIED_DESTINATION')
|
|
116
|
+
throw new UndeliverableError(
|
|
117
|
+
'The email service does not deliver to the address.',
|
|
118
|
+
)
|
|
119
|
+
throw new Error(`Sending the sign-in code failed: ${code ?? 'delivery'}.`)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export declare namespace sendCode {
|
|
123
|
+
type Options = {
|
|
124
|
+
/** The 6-digit code. */
|
|
125
|
+
code: string
|
|
126
|
+
/** The address to email. */
|
|
127
|
+
email: string
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace sendCode {
|
|
132
|
+
/** The refusal `sendCode` throws. */
|
|
133
|
+
export const errors = [ErrorResponse.RateLimitedError] as const
|
|
134
|
+
}
|