@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,679 @@
|
|
|
1
|
+
import { HTTPException } from 'hono/http-exception';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import * as Log from './Log.js';
|
|
4
|
+
/** The page that explains each `reason`, for `error_uri`. */
|
|
5
|
+
const docs = 'https://github.com/tempoxyz/auth/blob/main/docs/errors.md';
|
|
6
|
+
/**
|
|
7
|
+
* Every refusal Tempo ID returns, by `reason`: its OAuth `error` code, its HTTP status, and what it
|
|
8
|
+
* means. `docs/errors.md` explains each one.
|
|
9
|
+
*/
|
|
10
|
+
export const reasons = {
|
|
11
|
+
already_decided: {
|
|
12
|
+
description: 'The user code was already approved or denied.',
|
|
13
|
+
error: 'invalid_request',
|
|
14
|
+
status: 409,
|
|
15
|
+
},
|
|
16
|
+
approval_pending: {
|
|
17
|
+
description: 'The user has not decided the device code yet.',
|
|
18
|
+
error: 'authorization_pending',
|
|
19
|
+
status: 400,
|
|
20
|
+
},
|
|
21
|
+
authorization_expired: {
|
|
22
|
+
description: "The app's authorization request that sign-in or the approval page continues is forged or expired.",
|
|
23
|
+
error: 'invalid_request',
|
|
24
|
+
status: 400,
|
|
25
|
+
},
|
|
26
|
+
body_too_large: {
|
|
27
|
+
description: 'The request body exceeds 64 KiB.',
|
|
28
|
+
error: 'invalid_request',
|
|
29
|
+
status: 413,
|
|
30
|
+
},
|
|
31
|
+
challenge_not_permitted: {
|
|
32
|
+
description: 'A request carries a challenge, and its app lacks the `tempo-id:sign` scope.',
|
|
33
|
+
error: 'unauthorized_client',
|
|
34
|
+
status: 403,
|
|
35
|
+
},
|
|
36
|
+
cross_site_request: {
|
|
37
|
+
description: 'A form or body-less write came from another site.',
|
|
38
|
+
error: 'access_denied',
|
|
39
|
+
status: 403,
|
|
40
|
+
},
|
|
41
|
+
device_code_expired: {
|
|
42
|
+
description: 'The device code is unknown, expired, or already redeemed.',
|
|
43
|
+
error: 'expired_token',
|
|
44
|
+
status: 400,
|
|
45
|
+
},
|
|
46
|
+
duplicate_limit: {
|
|
47
|
+
description: 'Two limits name the same token.',
|
|
48
|
+
error: 'invalid_authorization_details',
|
|
49
|
+
status: 400,
|
|
50
|
+
},
|
|
51
|
+
duplicate_scope: {
|
|
52
|
+
description: 'Two scopes name the same call on one token.',
|
|
53
|
+
error: 'invalid_authorization_details',
|
|
54
|
+
status: 400,
|
|
55
|
+
},
|
|
56
|
+
empty_limits: {
|
|
57
|
+
description: '`limits` is an empty list.',
|
|
58
|
+
error: 'invalid_authorization_details',
|
|
59
|
+
status: 400,
|
|
60
|
+
},
|
|
61
|
+
empty_scopes: {
|
|
62
|
+
description: '`scopes` is an empty list.',
|
|
63
|
+
error: 'invalid_authorization_details',
|
|
64
|
+
status: 400,
|
|
65
|
+
},
|
|
66
|
+
expiry_exceeds_maximum: {
|
|
67
|
+
description: 'A headless key lasts longer than a year.',
|
|
68
|
+
error: 'invalid_authorization_details',
|
|
69
|
+
status: 403,
|
|
70
|
+
},
|
|
71
|
+
expiry_passed: {
|
|
72
|
+
description: 'The key expiry has passed.',
|
|
73
|
+
error: 'invalid_authorization_details',
|
|
74
|
+
status: 400,
|
|
75
|
+
},
|
|
76
|
+
foreign_account: {
|
|
77
|
+
description: "The request names a Tempo Account that is not the user's in the app's realms.",
|
|
78
|
+
error: 'access_denied',
|
|
79
|
+
status: 403,
|
|
80
|
+
},
|
|
81
|
+
invalid_chain: {
|
|
82
|
+
description: 'The key chain ID is 0.',
|
|
83
|
+
error: 'invalid_authorization_details',
|
|
84
|
+
status: 400,
|
|
85
|
+
},
|
|
86
|
+
invalid_code: {
|
|
87
|
+
description: 'The emailed code is wrong or expired.',
|
|
88
|
+
error: 'invalid_grant',
|
|
89
|
+
status: 401,
|
|
90
|
+
},
|
|
91
|
+
invalid_expiry: {
|
|
92
|
+
description: 'The key expiry is 0, which never expires.',
|
|
93
|
+
error: 'invalid_authorization_details',
|
|
94
|
+
status: 400,
|
|
95
|
+
},
|
|
96
|
+
invalid_field: {
|
|
97
|
+
description: 'A field is missing or malformed.',
|
|
98
|
+
error: 'invalid_request',
|
|
99
|
+
status: 400,
|
|
100
|
+
},
|
|
101
|
+
invalid_id_token_hint: {
|
|
102
|
+
description: 'The ID token hint is not an ID token that Tempo ID signed for the app.',
|
|
103
|
+
error: 'invalid_request',
|
|
104
|
+
status: 400,
|
|
105
|
+
},
|
|
106
|
+
invalid_origin: {
|
|
107
|
+
description: 'A headless request came from an origin its redirect URI does not allow.',
|
|
108
|
+
error: 'unauthorized_client',
|
|
109
|
+
status: 403,
|
|
110
|
+
},
|
|
111
|
+
invalid_period: {
|
|
112
|
+
description: "A limit's `period` is not a whole number of seconds.",
|
|
113
|
+
error: 'invalid_authorization_details',
|
|
114
|
+
status: 400,
|
|
115
|
+
},
|
|
116
|
+
invalid_public_key: {
|
|
117
|
+
description: 'The key public key is not a valid point.',
|
|
118
|
+
error: 'invalid_authorization_details',
|
|
119
|
+
status: 400,
|
|
120
|
+
},
|
|
121
|
+
invalid_recipients: {
|
|
122
|
+
description: "A scope's `recipients` names the zero address, or one address twice.",
|
|
123
|
+
error: 'invalid_authorization_details',
|
|
124
|
+
status: 400,
|
|
125
|
+
},
|
|
126
|
+
limit_exceeds_maximum: {
|
|
127
|
+
description: 'A headless key limit exceeds the token’s ceiling.',
|
|
128
|
+
error: 'invalid_authorization_details',
|
|
129
|
+
status: 403,
|
|
130
|
+
},
|
|
131
|
+
logout_not_permitted: {
|
|
132
|
+
description: 'The app that the ID token hint names may not end the session at the end-session endpoint.',
|
|
133
|
+
error: 'unauthorized_client',
|
|
134
|
+
status: 403,
|
|
135
|
+
},
|
|
136
|
+
malformed_body: {
|
|
137
|
+
description: 'The request body is not valid JSON.',
|
|
138
|
+
error: 'invalid_request',
|
|
139
|
+
status: 400,
|
|
140
|
+
},
|
|
141
|
+
missing_key: {
|
|
142
|
+
description: 'The key authorization names no key.',
|
|
143
|
+
error: 'invalid_authorization_details',
|
|
144
|
+
status: 400,
|
|
145
|
+
},
|
|
146
|
+
missing_recipients: {
|
|
147
|
+
description: 'An `approve` scope names no spenders.',
|
|
148
|
+
error: 'invalid_authorization_details',
|
|
149
|
+
status: 400,
|
|
150
|
+
},
|
|
151
|
+
passkey_link_expired: {
|
|
152
|
+
description: "The email step's link to a wallet.tempo passkey expired, or the browser holds no link for it.",
|
|
153
|
+
error: 'invalid_request',
|
|
154
|
+
status: 400,
|
|
155
|
+
},
|
|
156
|
+
passkey_not_permitted: {
|
|
157
|
+
description: 'A passkey sign-in names an app, or reaches a realm, that holds no passkeys for Tempo ID.',
|
|
158
|
+
error: 'unauthorized_client',
|
|
159
|
+
status: 403,
|
|
160
|
+
},
|
|
161
|
+
polling_too_fast: {
|
|
162
|
+
description: 'The device polled before its interval passed.',
|
|
163
|
+
error: 'slow_down',
|
|
164
|
+
status: 400,
|
|
165
|
+
},
|
|
166
|
+
post_logout_redirect_not_permitted: {
|
|
167
|
+
description: 'The post-logout redirect URI is not one of the post-logout redirect URIs the app registered.',
|
|
168
|
+
error: 'invalid_request',
|
|
169
|
+
status: 400,
|
|
170
|
+
},
|
|
171
|
+
rate_limited: {
|
|
172
|
+
description: 'Tempo ID, or a service it depends on, is rate limiting the request.',
|
|
173
|
+
error: 'temporarily_unavailable',
|
|
174
|
+
status: 429,
|
|
175
|
+
},
|
|
176
|
+
rejected: {
|
|
177
|
+
description: 'The issuer refused the authorization request.',
|
|
178
|
+
error: 'invalid_request',
|
|
179
|
+
status: 400,
|
|
180
|
+
},
|
|
181
|
+
request_denied: {
|
|
182
|
+
description: 'The user denied the device code.',
|
|
183
|
+
error: 'access_denied',
|
|
184
|
+
status: 400,
|
|
185
|
+
},
|
|
186
|
+
return_to_not_permitted: {
|
|
187
|
+
description: "The page that a provider sign-in returns to is on neither Tempo ID's origin nor the app's.",
|
|
188
|
+
error: 'invalid_request',
|
|
189
|
+
status: 400,
|
|
190
|
+
},
|
|
191
|
+
scope_without_limit: {
|
|
192
|
+
description: 'A scope calls a token no limit names.',
|
|
193
|
+
error: 'invalid_authorization_details',
|
|
194
|
+
status: 400,
|
|
195
|
+
},
|
|
196
|
+
session_changed: {
|
|
197
|
+
description: 'The signed-in session differs from the one that the approval page showed.',
|
|
198
|
+
error: 'invalid_request',
|
|
199
|
+
status: 409,
|
|
200
|
+
},
|
|
201
|
+
session_required: {
|
|
202
|
+
description: 'The request needs a signed-in session.',
|
|
203
|
+
error: 'login_required',
|
|
204
|
+
status: 401,
|
|
205
|
+
},
|
|
206
|
+
unexpected: {
|
|
207
|
+
description: 'An unexpected failure.',
|
|
208
|
+
error: 'server_error',
|
|
209
|
+
status: 500,
|
|
210
|
+
},
|
|
211
|
+
unknown_code: {
|
|
212
|
+
description: 'The user code is wrong or expired.',
|
|
213
|
+
error: 'invalid_request',
|
|
214
|
+
status: 404,
|
|
215
|
+
},
|
|
216
|
+
unknown_endpoint: {
|
|
217
|
+
description: 'No API endpoint matches this method and path.',
|
|
218
|
+
error: 'invalid_request',
|
|
219
|
+
status: 404,
|
|
220
|
+
},
|
|
221
|
+
unknown_provider: {
|
|
222
|
+
description: 'The sign-in names a provider that Tempo ID does not offer.',
|
|
223
|
+
error: 'invalid_request',
|
|
224
|
+
status: 404,
|
|
225
|
+
},
|
|
226
|
+
unsupported_call: {
|
|
227
|
+
description: 'A scope calls a function a key may not call.',
|
|
228
|
+
error: 'invalid_authorization_details',
|
|
229
|
+
status: 400,
|
|
230
|
+
},
|
|
231
|
+
unsupported_token: {
|
|
232
|
+
description: 'A limit names a token that is not supported on the chain.',
|
|
233
|
+
error: 'invalid_authorization_details',
|
|
234
|
+
status: 400,
|
|
235
|
+
},
|
|
236
|
+
upstream_unavailable: {
|
|
237
|
+
description: 'A service Tempo ID depends on failed or did not respond.',
|
|
238
|
+
error: 'temporarily_unavailable',
|
|
239
|
+
status: 503,
|
|
240
|
+
},
|
|
241
|
+
webauthn_rejected: {
|
|
242
|
+
description: 'A passkey ceremony failed: its challenge is unknown, spent, or expired, or its response does not verify.',
|
|
243
|
+
error: 'access_denied',
|
|
244
|
+
status: 401,
|
|
245
|
+
},
|
|
246
|
+
webauthn_required: {
|
|
247
|
+
description: 'A request without a page names a Tempo Account whose passkey signs only on a Tempo ID page.',
|
|
248
|
+
error: 'interaction_required',
|
|
249
|
+
status: 403,
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* A refusal, which a function returns or throws. `json` responds with a returned one, and `handle`
|
|
254
|
+
* with a thrown one. Each refusal is a subclass that {@link define} makes, so its reason is written
|
|
255
|
+
* once.
|
|
256
|
+
*/
|
|
257
|
+
export class ResponseError extends HTTPException {
|
|
258
|
+
name = 'ErrorResponse.ResponseError';
|
|
259
|
+
/** The error response the refusal sends. */
|
|
260
|
+
response;
|
|
261
|
+
constructor(response) {
|
|
262
|
+
const status = reasons[response.reason].status;
|
|
263
|
+
super(status, { res: Response.json(response, { status }) });
|
|
264
|
+
this.response = response;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Returns the base class of `reason`'s refusals, whose static `reason` is `reason`. The module that
|
|
269
|
+
* returns or throws a refusal declares it as a subclass, such as
|
|
270
|
+
* `class InvalidCodeError extends ErrorResponse.define('invalid_code') {}`, and lists the class in
|
|
271
|
+
* its `fn.errors`.
|
|
272
|
+
*/
|
|
273
|
+
export function define(reason) {
|
|
274
|
+
return class extends ResponseError {
|
|
275
|
+
static reason = reason;
|
|
276
|
+
constructor(options) {
|
|
277
|
+
super(from({ ...options, reason }));
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A form or body-less write came from another site, which `csrf()` refuses, or a cross-site read of
|
|
283
|
+
* `GET /v1/account`.
|
|
284
|
+
*/
|
|
285
|
+
export class CrossSiteRequestError extends define('cross_site_request') {
|
|
286
|
+
name = 'ErrorResponse.CrossSiteRequestError';
|
|
287
|
+
constructor() {
|
|
288
|
+
super({
|
|
289
|
+
error_description: 'Cross-site request refused. Send JSON from an allowed origin.',
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/** The body is not valid JSON, which Hono's body validator refuses. */
|
|
294
|
+
export class MalformedBodyError extends define('malformed_body') {
|
|
295
|
+
name = 'ErrorResponse.MalformedBodyError';
|
|
296
|
+
constructor() {
|
|
297
|
+
super({
|
|
298
|
+
error_description: 'Malformed request body. Send a JSON object with `Content-Type: application/json`.',
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/** A service Tempo ID depends on, such as Privy, is rate limiting it. */
|
|
303
|
+
export class RateLimitedError extends define('rate_limited') {
|
|
304
|
+
name = 'ErrorResponse.RateLimitedError';
|
|
305
|
+
/** The wait in seconds that the service requested, which `handle` sends as `Retry-After`. */
|
|
306
|
+
retryAfter;
|
|
307
|
+
constructor(options = {}) {
|
|
308
|
+
const { retryAfter } = options;
|
|
309
|
+
super({
|
|
310
|
+
error_description: `Rate limited by an upstream service. Retry ${retryAfter ? `after ${retryAfter} seconds` : 'later'}.`,
|
|
311
|
+
...(retryAfter ? { meta: { retryAfter } } : {}),
|
|
312
|
+
});
|
|
313
|
+
this.retryAfter = retryAfter;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/** An unexpected failure, which `handle` logs. */
|
|
317
|
+
export class UnexpectedError extends define('unexpected') {
|
|
318
|
+
name = 'ErrorResponse.UnexpectedError';
|
|
319
|
+
constructor() {
|
|
320
|
+
super({ error_description: 'Unexpected error. Try again.' });
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/** No API route matches the method and path. */
|
|
324
|
+
export class UnknownEndpointError extends define('unknown_endpoint') {
|
|
325
|
+
name = 'ErrorResponse.UnknownEndpointError';
|
|
326
|
+
constructor() {
|
|
327
|
+
// The path is the caller's, and may carry a misplaced credential, so it is not echoed.
|
|
328
|
+
super({
|
|
329
|
+
error_description: 'Unknown endpoint. Check the method and path against the API reference at /openapi.json.',
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** A service Tempo ID depends on, such as Privy, failed or did not respond. */
|
|
334
|
+
export class UpstreamUnavailableError extends define('upstream_unavailable') {
|
|
335
|
+
name = 'ErrorResponse.UpstreamUnavailableError';
|
|
336
|
+
constructor() {
|
|
337
|
+
super({
|
|
338
|
+
error_description: 'An upstream service is unavailable. Retry later.',
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/** Zod schemas for every error response, which the OpenAPI document reads. */
|
|
343
|
+
export var schema;
|
|
344
|
+
(function (schema) {
|
|
345
|
+
/** The members every error response has. */
|
|
346
|
+
schema.base = z.object({
|
|
347
|
+
error: z.string().meta({
|
|
348
|
+
description: 'The OAuth error code (RFC 6749, OIDC Core, RFC 8628, RFC 9396), which `reason` determines.',
|
|
349
|
+
}),
|
|
350
|
+
error_description: z.string().meta({
|
|
351
|
+
description: 'What went wrong and how to fix it, for people. Its wording may change.',
|
|
352
|
+
}),
|
|
353
|
+
error_uri: z.url().meta({
|
|
354
|
+
description: 'The errors page, at the refusal’s `reason`.',
|
|
355
|
+
}),
|
|
356
|
+
field: z.string().optional().meta({
|
|
357
|
+
description: 'Extension: the request field at fault, as a dotted path.',
|
|
358
|
+
}),
|
|
359
|
+
meta: z
|
|
360
|
+
.record(z.string(), z.union([z.number(), z.string()]))
|
|
361
|
+
.readonly()
|
|
362
|
+
.optional()
|
|
363
|
+
.meta({
|
|
364
|
+
description: 'Extension: the values the refusal compared. Base units are decimal strings.',
|
|
365
|
+
}),
|
|
366
|
+
reason: z.string().meta({
|
|
367
|
+
description: 'Extension: a stable name for the refusal, to branch on.',
|
|
368
|
+
}),
|
|
369
|
+
request_id: z.string().optional().meta({
|
|
370
|
+
description: 'Extension: the request ID, which `X-Request-Id` also carries. The Worker adds it to every error response.',
|
|
371
|
+
}),
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* Each reason's example `error_description`, and its `field` when the refusal names one. The
|
|
375
|
+
* OpenAPI document shows them, so they hold no real account, app, or origin.
|
|
376
|
+
*/
|
|
377
|
+
const examples = {
|
|
378
|
+
already_decided: {
|
|
379
|
+
error_description: 'Code already approved or denied.',
|
|
380
|
+
field: 'code',
|
|
381
|
+
},
|
|
382
|
+
approval_pending: {
|
|
383
|
+
error_description: 'Approval pending. Poll again after `interval` seconds.',
|
|
384
|
+
},
|
|
385
|
+
authorization_expired: {
|
|
386
|
+
error_description: 'Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.',
|
|
387
|
+
field: 'oauth_query',
|
|
388
|
+
},
|
|
389
|
+
body_too_large: {
|
|
390
|
+
error_description: 'Invalid request body: exceeds the 65536-byte maximum. Send a body of 65536 bytes or fewer.',
|
|
391
|
+
},
|
|
392
|
+
challenge_not_permitted: {
|
|
393
|
+
error_description: 'Challenge not permitted: the app lacks the `tempo-id:sign` scope. Remove `challenge`, or grant the app the scope.',
|
|
394
|
+
field: 'challenge',
|
|
395
|
+
},
|
|
396
|
+
cross_site_request: {
|
|
397
|
+
error_description: 'Cross-site request refused. Send JSON from an allowed origin.',
|
|
398
|
+
},
|
|
399
|
+
device_code_expired: {
|
|
400
|
+
error_description: 'Device code expired. Request a new code.',
|
|
401
|
+
},
|
|
402
|
+
duplicate_limit: {
|
|
403
|
+
error_description: 'Duplicate limit for 0x20c0000000000000000000000000000000000001. Limit each token once.',
|
|
404
|
+
field: 'key_authorization.limits.1.token',
|
|
405
|
+
},
|
|
406
|
+
duplicate_scope: {
|
|
407
|
+
error_description: 'Duplicate scope for 0xa9059cbb on OUSD. Name each call on a token once.',
|
|
408
|
+
field: 'key_authorization.scopes.1.selector',
|
|
409
|
+
},
|
|
410
|
+
empty_limits: {
|
|
411
|
+
error_description: 'Empty `limits`. Name at least one token, or omit `limits`.',
|
|
412
|
+
field: 'key_authorization.limits',
|
|
413
|
+
},
|
|
414
|
+
empty_scopes: {
|
|
415
|
+
error_description: 'Empty `scopes`. Name at least one call, or omit `scopes`.',
|
|
416
|
+
field: 'key_authorization.scopes',
|
|
417
|
+
},
|
|
418
|
+
expiry_exceeds_maximum: {
|
|
419
|
+
error_description: 'Invalid `expiry`: Sat, 01 Jan 2028 00:00:00 GMT exceeds the one-year maximum. Use an earlier expiry, or authorize through a redirect or device grant.',
|
|
420
|
+
field: 'key_authorization.expiry',
|
|
421
|
+
},
|
|
422
|
+
expiry_passed: {
|
|
423
|
+
error_description: 'Invalid `expiry`: Wed, 01 Jan 2025 00:00:00 GMT has passed. Use a future Unix time.',
|
|
424
|
+
field: 'key_authorization.expiry',
|
|
425
|
+
},
|
|
426
|
+
foreign_account: {
|
|
427
|
+
error_description: "Access denied to Tempo Account 0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c. Name one of the user's accounts in the app's realms.",
|
|
428
|
+
field: 'account',
|
|
429
|
+
},
|
|
430
|
+
invalid_chain: {
|
|
431
|
+
error_description: 'Invalid `chainId`: 0. Use a Tempo chain ID, such as 4217.',
|
|
432
|
+
field: 'key_authorization.chainId',
|
|
433
|
+
},
|
|
434
|
+
invalid_code: {
|
|
435
|
+
error_description: 'Invalid or expired code. Request a new one.',
|
|
436
|
+
field: 'code',
|
|
437
|
+
},
|
|
438
|
+
invalid_expiry: {
|
|
439
|
+
error_description: 'Invalid `expiry`: 0 never expires. Use a future Unix time.',
|
|
440
|
+
field: 'key_authorization.expiry',
|
|
441
|
+
},
|
|
442
|
+
invalid_field: {
|
|
443
|
+
error_description: 'Invalid request. `email`: Invalid email address.',
|
|
444
|
+
field: 'email',
|
|
445
|
+
},
|
|
446
|
+
invalid_id_token_hint: {
|
|
447
|
+
error_description: 'Invalid id_token_hint: it is not an ID token that this issuer signed for the app. Send the ID token that the app received at sign-in.',
|
|
448
|
+
field: 'id_token_hint',
|
|
449
|
+
},
|
|
450
|
+
invalid_origin: {
|
|
451
|
+
error_description: 'Invalid `Origin`: https://other.example.com. Requests for this redirect URI must come from https://app.example.com.',
|
|
452
|
+
field: 'Origin',
|
|
453
|
+
},
|
|
454
|
+
invalid_period: {
|
|
455
|
+
error_description: 'Invalid `period` on the OUSD limit: 1.5. Use a whole number of seconds, or 0 for a one-time limit.',
|
|
456
|
+
field: 'key_authorization.limits.0.period',
|
|
457
|
+
},
|
|
458
|
+
invalid_public_key: {
|
|
459
|
+
error_description: 'Invalid `publicKey`. Provide an uncompressed public key, or `address`.',
|
|
460
|
+
field: 'key_authorization.publicKey',
|
|
461
|
+
},
|
|
462
|
+
invalid_recipients: {
|
|
463
|
+
error_description: 'Invalid recipient 0x0000000000000000000000000000000000000000 for 0x095ea7b3 on OUSD. Name each recipient once, and never the zero address.',
|
|
464
|
+
field: 'key_authorization.scopes.0.recipients.0',
|
|
465
|
+
},
|
|
466
|
+
limit_exceeds_maximum: {
|
|
467
|
+
error_description: 'Invalid OUSD limit: 5000 exceeds the 1000 maximum. Lower the limit, or authorize through a redirect or device grant.',
|
|
468
|
+
field: 'key_authorization.limits.0.limit',
|
|
469
|
+
},
|
|
470
|
+
logout_not_permitted: {
|
|
471
|
+
error_description: 'Logout not permitted: the app client_01JZ8Q6W3N1R5B4V7C2X9K0M3T may not end the session. Register the app for logout, then retry.',
|
|
472
|
+
},
|
|
473
|
+
malformed_body: {
|
|
474
|
+
error_description: 'Malformed request body. Send a JSON object with `Content-Type: application/json`.',
|
|
475
|
+
},
|
|
476
|
+
missing_key: {
|
|
477
|
+
error_description: 'Missing `address` or `publicKey`. Provide the access key.',
|
|
478
|
+
field: 'key_authorization.address',
|
|
479
|
+
},
|
|
480
|
+
missing_recipients: {
|
|
481
|
+
error_description: 'Missing `recipients` for `approve` on OUSD. Name the allowed spenders.',
|
|
482
|
+
field: 'key_authorization.scopes.0.recipients',
|
|
483
|
+
},
|
|
484
|
+
passkey_link_expired: {
|
|
485
|
+
error_description: 'Expired passkey sign-in: the link from the passkey step is no longer valid. Enter the code again to sign in with email only, or sign in with the passkey again.',
|
|
486
|
+
field: 'link',
|
|
487
|
+
},
|
|
488
|
+
passkey_not_permitted: {
|
|
489
|
+
error_description: 'Passkey not permitted: the app client_01JZ8Q6W3N1R5B4V7C2X9K0M3T holds no passkeys. Sign in with an emailed code.',
|
|
490
|
+
},
|
|
491
|
+
polling_too_fast: {
|
|
492
|
+
error_description: 'Polling too fast. Add 5 seconds to `interval`.',
|
|
493
|
+
},
|
|
494
|
+
post_logout_redirect_not_permitted: {
|
|
495
|
+
error_description: 'Invalid post_logout_redirect_uri: https://app.example/elsewhere is not registered for the app. Use one of its post-logout redirect URIs, or leave it out.',
|
|
496
|
+
field: 'post_logout_redirect_uri',
|
|
497
|
+
},
|
|
498
|
+
rate_limited: {
|
|
499
|
+
error_description: 'Too many requests. Retry after 30 seconds.',
|
|
500
|
+
},
|
|
501
|
+
rejected: {
|
|
502
|
+
error_description: "Authorization request rejected. Check `client_id`, `redirect_uri`, and `scope` against the app's registration.",
|
|
503
|
+
},
|
|
504
|
+
request_denied: { error_description: 'The user denied the request.' },
|
|
505
|
+
return_to_not_permitted: {
|
|
506
|
+
error_description: "Invalid return_to: https://example.org is not an origin of the app's redirect URIs. Return to a page on one of them, and pass the app's client_id.",
|
|
507
|
+
field: 'return_to',
|
|
508
|
+
},
|
|
509
|
+
scope_without_limit: {
|
|
510
|
+
error_description: 'Scope on 0x20c0000000000000000000000000000000000002 has no limit. Add a limit for it, or remove the scope.',
|
|
511
|
+
field: 'key_authorization.scopes.0.address',
|
|
512
|
+
},
|
|
513
|
+
session_changed: {
|
|
514
|
+
error_description: 'Changed session: the signed-in account differs from the one that this page showed. Reload the page, and check the account before the decision.',
|
|
515
|
+
field: 'session_id',
|
|
516
|
+
},
|
|
517
|
+
session_required: { error_description: 'Sign in first.' },
|
|
518
|
+
unexpected: { error_description: 'Unexpected error. Try again.' },
|
|
519
|
+
unknown_code: {
|
|
520
|
+
error_description: 'Invalid or expired code. Check the code in the terminal.',
|
|
521
|
+
field: 'code',
|
|
522
|
+
},
|
|
523
|
+
unknown_endpoint: {
|
|
524
|
+
error_description: 'Unknown endpoint. Check the method and path against the API reference at /openapi.json.',
|
|
525
|
+
},
|
|
526
|
+
unknown_provider: {
|
|
527
|
+
error_description: 'Unknown provider: github is not offered. Request GET /v1/auth/providers for the providers offered.',
|
|
528
|
+
field: 'provider',
|
|
529
|
+
},
|
|
530
|
+
unsupported_call: {
|
|
531
|
+
error_description: 'Unsupported call on OUSD: any function. Use `transfer`, `transferWithMemo`, or `approve`.',
|
|
532
|
+
field: 'key_authorization.scopes.0.selector',
|
|
533
|
+
},
|
|
534
|
+
unsupported_token: {
|
|
535
|
+
error_description: 'Unsupported token on chain 4217: 0x20c00000000000000000000000000000000000ff. Use a supported token, such as OUSD.',
|
|
536
|
+
field: 'key_authorization.limits.0.token',
|
|
537
|
+
},
|
|
538
|
+
upstream_unavailable: {
|
|
539
|
+
error_description: 'An upstream service is unavailable. Retry later.',
|
|
540
|
+
},
|
|
541
|
+
webauthn_rejected: {
|
|
542
|
+
error_description: 'Passkey rejected. Request new options, then try again with the same passkey or another one.',
|
|
543
|
+
},
|
|
544
|
+
webauthn_required: {
|
|
545
|
+
error_description: 'Passkey required: Tempo Account 0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c signs key authorizations only with its passkey, on a Tempo ID page. Authorize through a redirect, popup, or device grant, or name another account.',
|
|
546
|
+
field: 'key_authorization.account',
|
|
547
|
+
},
|
|
548
|
+
};
|
|
549
|
+
/** Each reason's schema, which the OpenAPI document lists as a component. */
|
|
550
|
+
const byReason = new Map(Object.entries(reasons).map(([reason, definition]) => {
|
|
551
|
+
const example = examples[reason];
|
|
552
|
+
const extended = schema.base.extend({
|
|
553
|
+
error: z.literal(definition.error).meta(schema.base.shape.error.meta()),
|
|
554
|
+
error_description: schema.base.shape.error_description.meta({
|
|
555
|
+
...schema.base.shape.error_description.meta(),
|
|
556
|
+
examples: [example.error_description],
|
|
557
|
+
}),
|
|
558
|
+
error_uri: schema.base.shape.error_uri.meta({
|
|
559
|
+
...schema.base.shape.error_uri.meta(),
|
|
560
|
+
examples: [`${docs}#${reason}`],
|
|
561
|
+
}),
|
|
562
|
+
reason: z.literal(reason).meta(schema.base.shape.reason.meta()),
|
|
563
|
+
request_id: schema.base.shape.request_id.meta({
|
|
564
|
+
...schema.base.shape.request_id.meta(),
|
|
565
|
+
examples: ['8f1c2a3b4d5e6f70-SJC'],
|
|
566
|
+
}),
|
|
567
|
+
});
|
|
568
|
+
// A refusal that names no field never sends one, so its component leaves `field` out.
|
|
569
|
+
const documented = example.field
|
|
570
|
+
? extended.extend({
|
|
571
|
+
field: schema.base.shape.field.meta({
|
|
572
|
+
...schema.base.shape.field.meta(),
|
|
573
|
+
examples: [example.field],
|
|
574
|
+
}),
|
|
575
|
+
})
|
|
576
|
+
: extended.omit({ field: true });
|
|
577
|
+
return [
|
|
578
|
+
reason,
|
|
579
|
+
documented.meta({
|
|
580
|
+
description: `\`${definition.error}\` (${definition.status}): ${definition.description}`,
|
|
581
|
+
id: `ErrorResponse.${reason}`,
|
|
582
|
+
}),
|
|
583
|
+
];
|
|
584
|
+
}));
|
|
585
|
+
/** The schema of `reason`'s error response. */
|
|
586
|
+
function of(reason) {
|
|
587
|
+
return byReason.get(reason);
|
|
588
|
+
}
|
|
589
|
+
schema.of = of;
|
|
590
|
+
})(schema || (schema = {}));
|
|
591
|
+
/**
|
|
592
|
+
* Instantiates an {@link ErrorResponse}, filling `error` from `reason`'s definition and
|
|
593
|
+
* `error_uri` with `reason`'s section of the errors page.
|
|
594
|
+
*/
|
|
595
|
+
export function from(value) {
|
|
596
|
+
const { error_description, field, meta, reason } = value;
|
|
597
|
+
return {
|
|
598
|
+
error: reasons[reason].error,
|
|
599
|
+
error_description,
|
|
600
|
+
error_uri: `${docs}#${reason}`,
|
|
601
|
+
...(field ? { field } : {}),
|
|
602
|
+
...(meta ? { meta } : {}),
|
|
603
|
+
reason,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Returns the refusal for an upstream service's failure, from the error its SDK threw or the
|
|
608
|
+
* response it sent. The refusal is `rate_limited` for a 429, and `upstream_unavailable` for a 408,
|
|
609
|
+
* a 5xx, a timeout, or a request that received no response. Returns `undefined` for anything else,
|
|
610
|
+
* such as an error Tempo ID throws itself.
|
|
611
|
+
*/
|
|
612
|
+
export function fromUpstream(failure) {
|
|
613
|
+
if (failure instanceof HTTPException)
|
|
614
|
+
return undefined;
|
|
615
|
+
// SDKs such as Privy's carry the service's HTTP status on the errors they throw.
|
|
616
|
+
const status = 'status' in failure ? failure.status : undefined;
|
|
617
|
+
if (status === 429) {
|
|
618
|
+
const retryAfter = (() => {
|
|
619
|
+
if (failure instanceof Response) {
|
|
620
|
+
// Only the delay-seconds form of `Retry-After` is read. An HTTP date is left out.
|
|
621
|
+
const seconds = Number(failure.headers.get('retry-after'));
|
|
622
|
+
return Number.isInteger(seconds) && seconds > 0 ? seconds : undefined;
|
|
623
|
+
}
|
|
624
|
+
return 'retryAfter' in failure && typeof failure.retryAfter === 'number'
|
|
625
|
+
? failure.retryAfter
|
|
626
|
+
: undefined;
|
|
627
|
+
})();
|
|
628
|
+
return new RateLimitedError({ retryAfter });
|
|
629
|
+
}
|
|
630
|
+
// An SDK error whose `status` is present but `undefined` received no response, such as Privy's
|
|
631
|
+
// `APIConnectionTimeoutError` for a timeout or `APIConnectionError` for a dropped connection.
|
|
632
|
+
const unanswered = 'status' in failure && status === undefined;
|
|
633
|
+
if ((typeof status === 'number' && (status === 408 || status >= 500)) ||
|
|
634
|
+
unanswered ||
|
|
635
|
+
(failure instanceof Error && failure.name === 'TimeoutError'))
|
|
636
|
+
return new UpstreamUnavailableError();
|
|
637
|
+
return undefined;
|
|
638
|
+
}
|
|
639
|
+
(function (fromUpstream) {
|
|
640
|
+
/** The refusals `fromUpstream` returns for an upstream service's failure. */
|
|
641
|
+
fromUpstream.errors = [RateLimitedError, UpstreamUnavailableError];
|
|
642
|
+
})(fromUpstream || (fromUpstream = {}));
|
|
643
|
+
/**
|
|
644
|
+
* Maps any error a handler or middleware throws to its documented response:
|
|
645
|
+
*
|
|
646
|
+
* - A {@link ResponseError} maps to its own response.
|
|
647
|
+
* - Hono's malformed body refusal maps to `malformed_body`.
|
|
648
|
+
* - The CSRF check's refusal maps to `cross_site_request`.
|
|
649
|
+
* - An upstream service's failure maps to `rate_limited` or `upstream_unavailable`, and logs a
|
|
650
|
+
* warning.
|
|
651
|
+
* - Anything else maps to `unexpected`, and logs the error.
|
|
652
|
+
*/
|
|
653
|
+
export function handle(error, c) {
|
|
654
|
+
if (error instanceof ResponseError)
|
|
655
|
+
return json(c, error);
|
|
656
|
+
// Hono's body validator refuses unreadable JSON with a bare 400, and `csrf()` with a bare 403.
|
|
657
|
+
if (error instanceof HTTPException && error.status === 400)
|
|
658
|
+
return json(c, new MalformedBodyError());
|
|
659
|
+
if (error instanceof HTTPException && error.status === 403)
|
|
660
|
+
return json(c, new CrossSiteRequestError());
|
|
661
|
+
const upstream = fromUpstream(error);
|
|
662
|
+
if (upstream) {
|
|
663
|
+
Log.warn(c, { error, message: 'An upstream service refused a request.' });
|
|
664
|
+
return json(c, upstream);
|
|
665
|
+
}
|
|
666
|
+
Log.error(c, { error, message: 'The API failed a request.' });
|
|
667
|
+
return json(c, new UnexpectedError());
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Returns the response for `error`, at the status its `reason` determines. A `rate_limited` refusal
|
|
671
|
+
* that carries the service's wait also sends it as `Retry-After`.
|
|
672
|
+
*/
|
|
673
|
+
export function json(c, error) {
|
|
674
|
+
const { response } = error;
|
|
675
|
+
if (error instanceof RateLimitedError && error.retryAfter)
|
|
676
|
+
c.header('retry-after', String(error.retryAfter));
|
|
677
|
+
return c.json(response, reasons[response.reason].status);
|
|
678
|
+
}
|
|
679
|
+
//# sourceMappingURL=ErrorResponse.js.map
|