@tempoxyz/id 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -2
- 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-11GtFGrq.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 +79 -3
- 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,441 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sign-in with an OAuth provider, such as Google: the providers Tempo ID offers, the redirect to a
|
|
3
|
+
* provider, and the provider's callback, which Better Auth's social sign-in serves.
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { isAPIError } from 'better-auth/api'
|
|
7
|
+
import { Hono } from 'hono'
|
|
8
|
+
import { deleteCookie, getCookie, setCookie } from 'hono/cookie'
|
|
9
|
+
import { serialize } from 'hono/utils/cookie'
|
|
10
|
+
import { env } from 'void/env'
|
|
11
|
+
import * as z from 'zod'
|
|
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 Log from '../internal/Log.js'
|
|
16
|
+
import * as OpenApi from '../internal/OpenApi.js'
|
|
17
|
+
import * as Provider from '../internal/Provider.js'
|
|
18
|
+
import * as RateLimit from '../internal/RateLimit.js'
|
|
19
|
+
import * as SignInGrant from '../internal/SignInGrant.js'
|
|
20
|
+
import * as Timing from '../internal/Timing.js'
|
|
21
|
+
import * as Auth from './lib/Auth.js'
|
|
22
|
+
import { db } from './lib/Database.js'
|
|
23
|
+
import * as FirstAccount from './lib/FirstAccount.js'
|
|
24
|
+
import * as SignInConsent from './lib/SignInConsent.js'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The cookie that marks the app's authorization request whose provider sign-in the sign-in page
|
|
28
|
+
* started. The `__Host-` prefix pins it to the host that set it with `Path=/`.
|
|
29
|
+
*/
|
|
30
|
+
const grantCookie = 'tempo-id-grant'
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The cookie that names the app whose authorization the provider sign-in continues, so the callback
|
|
34
|
+
* creates the user's first account in that app's realm. Better Auth keeps `oauth_query` in its own
|
|
35
|
+
* state, which the callback cannot read. The `__Host-` prefix pins it to the host that set it.
|
|
36
|
+
*/
|
|
37
|
+
const appCookie = 'tempo-id-sign-in-app'
|
|
38
|
+
|
|
39
|
+
/** How long the provider sign-in has to return before its grant lapses, in seconds. */
|
|
40
|
+
const grantLifetime = 10 * 60
|
|
41
|
+
|
|
42
|
+
namespace schema {
|
|
43
|
+
export namespace providers {
|
|
44
|
+
export const response = z.object({
|
|
45
|
+
providers: z
|
|
46
|
+
.array(
|
|
47
|
+
z
|
|
48
|
+
.object({
|
|
49
|
+
id: z.enum(['google']).meta({
|
|
50
|
+
description:
|
|
51
|
+
"The provider's ID, which `GET /v1/auth/oauth/{provider}` takes.",
|
|
52
|
+
examples: ['google'],
|
|
53
|
+
}),
|
|
54
|
+
name: z.string().meta({
|
|
55
|
+
description: 'The name to show, such as `Google`.',
|
|
56
|
+
examples: ['Google'],
|
|
57
|
+
}),
|
|
58
|
+
})
|
|
59
|
+
.meta({ description: 'One provider Tempo ID offers.' }),
|
|
60
|
+
)
|
|
61
|
+
.readonly()
|
|
62
|
+
.meta({
|
|
63
|
+
description:
|
|
64
|
+
'The providers Tempo ID offers, in the order a page shows them. Empty when the deployment configures none.',
|
|
65
|
+
}),
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export namespace signIn {
|
|
70
|
+
export const param = z.object({
|
|
71
|
+
provider: z
|
|
72
|
+
.string()
|
|
73
|
+
.min(1)
|
|
74
|
+
.max(64)
|
|
75
|
+
.meta({
|
|
76
|
+
description: 'The ID of the provider, from `GET /v1/auth/providers`.',
|
|
77
|
+
examples: ['google'],
|
|
78
|
+
}),
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
export const query = z.object({
|
|
82
|
+
client_id: z
|
|
83
|
+
.string()
|
|
84
|
+
.min(1)
|
|
85
|
+
.max(255)
|
|
86
|
+
.optional()
|
|
87
|
+
.meta({
|
|
88
|
+
description:
|
|
89
|
+
"The app's client ID. A `return_to` on an origin of the app's redirect URIs requires it.",
|
|
90
|
+
examples: ['client_01JZ8Q6W3N1R5B4V7C2X9K0M3T'],
|
|
91
|
+
}),
|
|
92
|
+
oauth_query: z
|
|
93
|
+
.string()
|
|
94
|
+
.min(1)
|
|
95
|
+
.max(8192)
|
|
96
|
+
.optional()
|
|
97
|
+
.meta({
|
|
98
|
+
description:
|
|
99
|
+
"The signed authorization request in the sign-in page's query. The callback continues it, and redirects to the app.",
|
|
100
|
+
examples: [
|
|
101
|
+
'client_id=tempo-cli&response_type=code&exp=1767225600&sig=4mLx2Wq9cH8t',
|
|
102
|
+
],
|
|
103
|
+
}),
|
|
104
|
+
return_to: z
|
|
105
|
+
.string()
|
|
106
|
+
.min(1)
|
|
107
|
+
// Holds the sign-in page's path with the whole `oauth_query`, which `/login` passes back.
|
|
108
|
+
.max(8448)
|
|
109
|
+
// A path resolves against Tempo ID's origin, so any origin parses it the same way.
|
|
110
|
+
.refine((value) => URL.canParse(value, 'https://id.invalid'), {
|
|
111
|
+
message: 'Set an absolute URL, or a path on Tempo ID',
|
|
112
|
+
})
|
|
113
|
+
.optional()
|
|
114
|
+
.meta({
|
|
115
|
+
description:
|
|
116
|
+
"The page that the browser returns to, signed in, on Tempo ID's origin or an origin of the app's redirect URIs. Defaults to the account page. A failed sign-in returns there with `error=access_denied`.",
|
|
117
|
+
examples: ['https://app.example.com/welcome'],
|
|
118
|
+
}),
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export namespace failed {
|
|
123
|
+
export const param = signIn.param
|
|
124
|
+
|
|
125
|
+
export const query = signIn.query.pick({
|
|
126
|
+
client_id: true,
|
|
127
|
+
return_to: true,
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace callback {
|
|
132
|
+
export const param = signIn.param
|
|
133
|
+
|
|
134
|
+
export const query = z.object({
|
|
135
|
+
code: z
|
|
136
|
+
.string()
|
|
137
|
+
.optional()
|
|
138
|
+
.meta({
|
|
139
|
+
description: "The provider's authorization code.",
|
|
140
|
+
examples: ['4/0AVMBsJh7c2X9K0M3T'],
|
|
141
|
+
}),
|
|
142
|
+
error: z
|
|
143
|
+
.string()
|
|
144
|
+
.optional()
|
|
145
|
+
.meta({
|
|
146
|
+
description: "The provider's error code, for a refused sign-in.",
|
|
147
|
+
examples: ['access_denied'],
|
|
148
|
+
}),
|
|
149
|
+
state: z
|
|
150
|
+
.string()
|
|
151
|
+
.optional()
|
|
152
|
+
.meta({
|
|
153
|
+
description: 'The state that the redirect to the provider sent.',
|
|
154
|
+
examples: ['Qm7rXcJ2bWv9Tk4LsN8pHd3F'],
|
|
155
|
+
}),
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** The provider sign-in routes. */
|
|
161
|
+
export const provider = new Hono<Env>()
|
|
162
|
+
.get(
|
|
163
|
+
'/v1/auth/providers',
|
|
164
|
+
OpenApi.describeRoute({
|
|
165
|
+
description:
|
|
166
|
+
'Lists the OAuth providers Tempo ID offers, for an app that shows its own sign-in buttons.',
|
|
167
|
+
responses: OpenApi.responses({
|
|
168
|
+
success: {
|
|
169
|
+
description: 'The providers.',
|
|
170
|
+
schema: schema.providers.response,
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
tags: ['Authenticate'],
|
|
174
|
+
}),
|
|
175
|
+
(c) => c.json({ providers: Provider.list({ google: Auth.google() }) }, 200),
|
|
176
|
+
)
|
|
177
|
+
.get(
|
|
178
|
+
'/v1/auth/oauth/:provider',
|
|
179
|
+
OpenApi.describeRoute({
|
|
180
|
+
description:
|
|
181
|
+
"Redirects the browser to the provider. The provider returns it to `/callback/{provider}`, which sets the session cookie, then continues `oauth_query` or redirects to `return_to`. The callback grants the key of `oauth_query` only when Tempo ID's own sign-in page sent the browser here.",
|
|
182
|
+
responses: {
|
|
183
|
+
302: { description: 'Redirects the browser to the provider.' },
|
|
184
|
+
...OpenApi.errors([
|
|
185
|
+
...OpenApi.validate.errors,
|
|
186
|
+
...Provider.returnTo.errors,
|
|
187
|
+
...RateLimit.check.errors,
|
|
188
|
+
core_Auth.AuthorizationExpiredError,
|
|
189
|
+
Provider.UnknownError,
|
|
190
|
+
]),
|
|
191
|
+
},
|
|
192
|
+
tags: ['Authenticate'],
|
|
193
|
+
}),
|
|
194
|
+
OpenApi.validate('param', schema.signIn.param),
|
|
195
|
+
OpenApi.validate('query', schema.signIn.query),
|
|
196
|
+
async (c) => {
|
|
197
|
+
const query = c.req.valid('query')
|
|
198
|
+
const offered = Provider.list({ google: Auth.google() }).find(
|
|
199
|
+
(entry) => entry.id === c.req.valid('param').provider,
|
|
200
|
+
)
|
|
201
|
+
if (!offered)
|
|
202
|
+
return ErrorResponse.json(
|
|
203
|
+
c,
|
|
204
|
+
new Provider.UnknownError({
|
|
205
|
+
provider: c.req.valid('param').provider,
|
|
206
|
+
}),
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
// Each redirect stores its state in a `verification` row until the callback spends it. Any site
|
|
210
|
+
// can send a browser here with a GET, so the redirects count on their own key, and spend none
|
|
211
|
+
// of the address's quota for email and passkey sign-in.
|
|
212
|
+
const ip = RateLimit.ip(c)
|
|
213
|
+
const refused = await Timing.measure(
|
|
214
|
+
c,
|
|
215
|
+
RateLimit.check(c, {
|
|
216
|
+
limits: [
|
|
217
|
+
{
|
|
218
|
+
binding: 'SIGN_IN_IP_LIMIT',
|
|
219
|
+
key: ip ? `provider:${ip}` : undefined,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
}),
|
|
223
|
+
'RateLimit.check',
|
|
224
|
+
)
|
|
225
|
+
if (refused) return refused
|
|
226
|
+
|
|
227
|
+
const returnTo = await Timing.measure(
|
|
228
|
+
c,
|
|
229
|
+
Provider.returnTo(db, {
|
|
230
|
+
clientId: query.client_id,
|
|
231
|
+
own: new URL(env.URL).origin,
|
|
232
|
+
returnTo: query.return_to ?? '/',
|
|
233
|
+
}),
|
|
234
|
+
'Provider.returnTo',
|
|
235
|
+
)
|
|
236
|
+
if (returnTo instanceof ErrorResponse.ResponseError)
|
|
237
|
+
return ErrorResponse.json(c, returnTo)
|
|
238
|
+
|
|
239
|
+
const failed = new URL(`/v1/auth/oauth/${offered.id}/failed`, env.URL)
|
|
240
|
+
// The failed route checks the page again, so it takes the page as sent, which its length limit
|
|
241
|
+
// holds. The resolved URL is longer by Tempo ID's origin.
|
|
242
|
+
failed.searchParams.set('return_to', query.return_to ?? '/')
|
|
243
|
+
if (query.client_id) failed.searchParams.set('client_id', query.client_id)
|
|
244
|
+
|
|
245
|
+
const result = await Timing.measure(
|
|
246
|
+
c,
|
|
247
|
+
c.var.auth.api.signInSocial({
|
|
248
|
+
body: {
|
|
249
|
+
callbackURL: returnTo,
|
|
250
|
+
disableRedirect: true,
|
|
251
|
+
// Better Auth's codes can reveal whether an account exists, so its errors pass through
|
|
252
|
+
// the `failed` route, which returns one code.
|
|
253
|
+
errorCallbackURL: failed.href,
|
|
254
|
+
provider: offered.id,
|
|
255
|
+
...(query.oauth_query ? { oauth_query: query.oauth_query } : {}),
|
|
256
|
+
},
|
|
257
|
+
headers: new Headers(c.req.raw.headers),
|
|
258
|
+
returnHeaders: true,
|
|
259
|
+
}),
|
|
260
|
+
'auth.signInSocial',
|
|
261
|
+
).catch((error: unknown) => {
|
|
262
|
+
if (isAPIError(error) && error.body?.error === 'invalid_signature')
|
|
263
|
+
return new core_Auth.AuthorizationExpiredError()
|
|
264
|
+
throw error
|
|
265
|
+
})
|
|
266
|
+
if (result instanceof ErrorResponse.ResponseError)
|
|
267
|
+
return ErrorResponse.json(c, result)
|
|
268
|
+
|
|
269
|
+
for (const cookie of result.headers.getSetCookie())
|
|
270
|
+
c.header('set-cookie', cookie, { append: true })
|
|
271
|
+
// Any site can send a browser here, so the callback grants the request's key only for a start
|
|
272
|
+
// from Tempo ID's own page, which shows the key. The browser sets `sec-fetch-site`, and no page
|
|
273
|
+
// can forge it.
|
|
274
|
+
if (query.oauth_query && c.req.header('sec-fetch-site') === 'same-origin')
|
|
275
|
+
setCookie(
|
|
276
|
+
c,
|
|
277
|
+
grantCookie,
|
|
278
|
+
SignInGrant.identity(new URLSearchParams(query.oauth_query)),
|
|
279
|
+
{
|
|
280
|
+
httpOnly: true,
|
|
281
|
+
maxAge: grantLifetime,
|
|
282
|
+
path: '/',
|
|
283
|
+
prefix: 'host',
|
|
284
|
+
sameSite: 'Lax',
|
|
285
|
+
secure: true,
|
|
286
|
+
},
|
|
287
|
+
)
|
|
288
|
+
else
|
|
289
|
+
deleteCookie(c, grantCookie, {
|
|
290
|
+
path: '/',
|
|
291
|
+
prefix: 'host',
|
|
292
|
+
secure: true,
|
|
293
|
+
})
|
|
294
|
+
// Better Auth checked the signature of `oauth_query` above, so its client ID is the app's.
|
|
295
|
+
const app = query.oauth_query
|
|
296
|
+
? new URLSearchParams(query.oauth_query).get('client_id')
|
|
297
|
+
: null
|
|
298
|
+
if (app)
|
|
299
|
+
setCookie(c, appCookie, app, {
|
|
300
|
+
httpOnly: true,
|
|
301
|
+
maxAge: grantLifetime,
|
|
302
|
+
path: '/',
|
|
303
|
+
prefix: 'host',
|
|
304
|
+
sameSite: 'Lax',
|
|
305
|
+
secure: true,
|
|
306
|
+
})
|
|
307
|
+
else
|
|
308
|
+
deleteCookie(c, appCookie, { path: '/', prefix: 'host', secure: true })
|
|
309
|
+
c.header('cache-control', 'private, no-store')
|
|
310
|
+
return c.redirect(result.response.url ?? '/', 302)
|
|
311
|
+
},
|
|
312
|
+
)
|
|
313
|
+
.get(
|
|
314
|
+
'/v1/auth/oauth/:provider/failed',
|
|
315
|
+
OpenApi.describeRoute({
|
|
316
|
+
description:
|
|
317
|
+
'Redirects the browser from a failed provider sign-in to `return_to`, with `error=access_denied`. The code is the same for every cause, so it reveals neither the cause nor whether an account exists.',
|
|
318
|
+
responses: {
|
|
319
|
+
302: { description: 'Redirects the browser to `return_to`.' },
|
|
320
|
+
...OpenApi.errors([
|
|
321
|
+
...OpenApi.validate.errors,
|
|
322
|
+
...Provider.returnTo.errors,
|
|
323
|
+
]),
|
|
324
|
+
},
|
|
325
|
+
tags: ['Authenticate'],
|
|
326
|
+
}),
|
|
327
|
+
OpenApi.validate('param', schema.failed.param),
|
|
328
|
+
OpenApi.validate('query', schema.failed.query),
|
|
329
|
+
async (c) => {
|
|
330
|
+
const query = c.req.valid('query')
|
|
331
|
+
// Anyone can send a browser here, so the page is checked again.
|
|
332
|
+
const returnTo = await Timing.measure(
|
|
333
|
+
c,
|
|
334
|
+
Provider.returnTo(db, {
|
|
335
|
+
clientId: query.client_id,
|
|
336
|
+
own: new URL(env.URL).origin,
|
|
337
|
+
returnTo: query.return_to ?? '/login',
|
|
338
|
+
}),
|
|
339
|
+
'Provider.returnTo',
|
|
340
|
+
)
|
|
341
|
+
if (returnTo instanceof ErrorResponse.ResponseError)
|
|
342
|
+
return ErrorResponse.json(c, returnTo)
|
|
343
|
+
|
|
344
|
+
const url = new URL(returnTo)
|
|
345
|
+
url.searchParams.set('error', 'access_denied')
|
|
346
|
+
return c.redirect(url.href, 302)
|
|
347
|
+
},
|
|
348
|
+
)
|
|
349
|
+
.get(
|
|
350
|
+
'/callback/:provider',
|
|
351
|
+
OpenApi.describeRoute({
|
|
352
|
+
description:
|
|
353
|
+
"Receives the provider's redirect, sets the session cookie, and redirects the browser to `return_to`, or continues the app's authorization. For a user with no Tempo Account in the realm of the sign-in, it creates one, as `POST /v1/auth/code/verify` does. Every failure redirects to the failed route or to the sign-in page.",
|
|
354
|
+
responses: {
|
|
355
|
+
302: {
|
|
356
|
+
description:
|
|
357
|
+
"Redirects the browser to `return_to`, to the app's redirect URI, or to the failed route.",
|
|
358
|
+
},
|
|
359
|
+
...OpenApi.errors([]),
|
|
360
|
+
},
|
|
361
|
+
tags: ['Authenticate'],
|
|
362
|
+
}),
|
|
363
|
+
OpenApi.input('param', schema.callback.param),
|
|
364
|
+
OpenApi.input('query', schema.callback.query),
|
|
365
|
+
async (c) => {
|
|
366
|
+
const response = await Timing.measure(
|
|
367
|
+
c,
|
|
368
|
+
c.var.auth.handler(c.req.raw),
|
|
369
|
+
'auth.handler',
|
|
370
|
+
)
|
|
371
|
+
const location = response.headers.get('location')
|
|
372
|
+
if (response.status !== 302 || !location) return response
|
|
373
|
+
|
|
374
|
+
// A sign-in sets the session cookie on the response, so the session names its user. A failed
|
|
375
|
+
// sign-in sets none. Each start sets or clears the app's cookie, so it names this sign-in's app.
|
|
376
|
+
const cookie = response.headers
|
|
377
|
+
.getSetCookie()
|
|
378
|
+
.map((entry) => entry.split(';', 1)[0])
|
|
379
|
+
.join('; ')
|
|
380
|
+
// A failed read skips the creation, so the sign-in still returns Better Auth's redirect.
|
|
381
|
+
const session = cookie
|
|
382
|
+
? await Timing.measure(
|
|
383
|
+
c,
|
|
384
|
+
c.var.auth.api.getSession({ headers: new Headers({ cookie }) }),
|
|
385
|
+
'auth.getSession',
|
|
386
|
+
).catch((error: unknown) => {
|
|
387
|
+
Log.warn(c, {
|
|
388
|
+
error,
|
|
389
|
+
message:
|
|
390
|
+
'The provider sign-in created no first account, since its session failed to load.',
|
|
391
|
+
})
|
|
392
|
+
return null
|
|
393
|
+
})
|
|
394
|
+
: null
|
|
395
|
+
if (session)
|
|
396
|
+
await Timing.measure(
|
|
397
|
+
c,
|
|
398
|
+
FirstAccount.create(c, {
|
|
399
|
+
clientId: getCookie(c, appCookie, 'host') ?? null,
|
|
400
|
+
userId: session.user.id,
|
|
401
|
+
}),
|
|
402
|
+
'FirstAccount.create',
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
// Only a sign-in that the sign-in page started, for this request, grants its key. Any other
|
|
406
|
+
// keeps Better Auth's redirect to the approval page, which shows the key.
|
|
407
|
+
const started = getCookie(c, grantCookie, 'host')
|
|
408
|
+
const continued = URL.parse(location, env.URL)
|
|
409
|
+
const redirect =
|
|
410
|
+
started &&
|
|
411
|
+
continued &&
|
|
412
|
+
SignInGrant.identity(continued.searchParams) === started
|
|
413
|
+
? await Timing.measure(
|
|
414
|
+
c,
|
|
415
|
+
SignInConsent.afterSignIn(c, {
|
|
416
|
+
redirect: location,
|
|
417
|
+
setCookie: response.headers.getSetCookie(),
|
|
418
|
+
}),
|
|
419
|
+
'SignInConsent.afterSignIn',
|
|
420
|
+
)
|
|
421
|
+
: location
|
|
422
|
+
if (!started && redirect === location) return response
|
|
423
|
+
|
|
424
|
+
// The handler's headers are immutable, so the redirect goes on a copy that keeps its cookies.
|
|
425
|
+
const headers = new Headers(response.headers)
|
|
426
|
+
headers.set('location', redirect)
|
|
427
|
+
// The grant applies once, so the callback clears its cookie.
|
|
428
|
+
if (started)
|
|
429
|
+
headers.append(
|
|
430
|
+
'set-cookie',
|
|
431
|
+
serialize(`__Host-${grantCookie}`, '', {
|
|
432
|
+
httpOnly: true,
|
|
433
|
+
maxAge: 0,
|
|
434
|
+
path: '/',
|
|
435
|
+
sameSite: 'Lax',
|
|
436
|
+
secure: true,
|
|
437
|
+
}),
|
|
438
|
+
)
|
|
439
|
+
return new Response(null, { headers, status: 302 })
|
|
440
|
+
},
|
|
441
|
+
)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** Renders a button as a `<button>` or, given `to`, a router link styled as one. @module */
|
|
2
|
+
import { Link, type LinkComponentProps } from '@tanstack/react-router'
|
|
3
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react'
|
|
4
|
+
import type { Props } from 'zyzz'
|
|
5
|
+
import Spinner from '~icons/lucide/loader-circle'
|
|
6
|
+
import type { FileRouteTypes } from '../routeTree.gen.js'
|
|
7
|
+
import { style, variants } from '../zyzz.config.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A button in the `default`, `secondary`, or `tertiary` variant and the `medium` or `large`
|
|
11
|
+
* size. `loading` disables a `<button>` and shows a spinner in place of `prefix`.
|
|
12
|
+
*/
|
|
13
|
+
export function Button(props: Button.Props): ReactNode {
|
|
14
|
+
const { children, loading, prefix, size, variant, ...rest } = props
|
|
15
|
+
const selection = styles.button({ size, variant })
|
|
16
|
+
const content = (
|
|
17
|
+
<>
|
|
18
|
+
{loading ? <Spinner {...styles.spinner()} aria-hidden /> : prefix}
|
|
19
|
+
<span {...styles.label()}>{children}</span>
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if ('to' in rest)
|
|
24
|
+
return (
|
|
25
|
+
<Link {...rest} {...selection}>
|
|
26
|
+
{content}
|
|
27
|
+
</Link>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
{...rest}
|
|
34
|
+
{...selection}
|
|
35
|
+
aria-busy={loading || undefined}
|
|
36
|
+
disabled={rest.disabled || loading}
|
|
37
|
+
>
|
|
38
|
+
{content}
|
|
39
|
+
</button>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare namespace Button {
|
|
44
|
+
/** The variant, size, and content, with a `<button>`'s attributes, or a link's when `to` is set. */
|
|
45
|
+
type Props = Props.Variants<typeof styles.button> & {
|
|
46
|
+
/** Button content, usually its label. */
|
|
47
|
+
children: ReactNode
|
|
48
|
+
/** Disables a `<button>` and replaces `prefix` with a spinner while an action runs. */
|
|
49
|
+
loading?: boolean | undefined
|
|
50
|
+
/** An icon shown before the label. */
|
|
51
|
+
prefix?: ReactNode | undefined
|
|
52
|
+
} & (
|
|
53
|
+
| Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'prefix'>
|
|
54
|
+
| (Omit<LinkComponentProps, 'children' | 'prefix' | 'to'> & {
|
|
55
|
+
/** The page that the link opens. Renders a router link instead of a `<button>`. */
|
|
56
|
+
to: FileRouteTypes['to']
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
namespace styles {
|
|
62
|
+
export const button = variants({
|
|
63
|
+
base: {
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
border: '1px solid',
|
|
66
|
+
borderColor: 'transparent',
|
|
67
|
+
borderRadius: 'full',
|
|
68
|
+
cursor: 'pointer',
|
|
69
|
+
display: 'inline-flex',
|
|
70
|
+
gap: 2,
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
outline: 'none',
|
|
73
|
+
textDecoration: 'none',
|
|
74
|
+
transitionDuration: '150ms',
|
|
75
|
+
transitionProperty: 'background-color, border-color, color',
|
|
76
|
+
transitionTimingFunction: 'in-out',
|
|
77
|
+
userSelect: 'none',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
':disabled': { cursor: 'not-allowed' },
|
|
80
|
+
// The focus ring: a 2px gap, then 2px of blue.
|
|
81
|
+
':focus-visible': {
|
|
82
|
+
outline: '2px solid',
|
|
83
|
+
outlineColor: 'blue.700',
|
|
84
|
+
outlineOffset: '2px',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
defaultVariants: { size: 'large', variant: 'default' },
|
|
88
|
+
variants: {
|
|
89
|
+
size: {
|
|
90
|
+
large: { height: 12, paddingInline: 6, typography: 'button.16' },
|
|
91
|
+
medium: { height: 9, paddingInline: 4, typography: 'button.14' },
|
|
92
|
+
},
|
|
93
|
+
// A disabled button keeps its fill and dims its label. A loading one keeps its label, since
|
|
94
|
+
// the spinner shows its state.
|
|
95
|
+
variant: {
|
|
96
|
+
default: {
|
|
97
|
+
backgroundColor: 'foreground',
|
|
98
|
+
backgroundImage: 'sheen',
|
|
99
|
+
color: 'background.surface',
|
|
100
|
+
':disabled:not([aria-busy="true"])': { color: 'gray.700' },
|
|
101
|
+
':hover:not(:disabled)': { backgroundColor: 'gray.950' },
|
|
102
|
+
},
|
|
103
|
+
secondary: {
|
|
104
|
+
backgroundColor: 'background.surface',
|
|
105
|
+
borderColor: 'gray.400',
|
|
106
|
+
color: 'foreground',
|
|
107
|
+
':disabled:not([aria-busy="true"])': { color: 'gray.700' },
|
|
108
|
+
':hover:not(:disabled)': { backgroundColor: 'gray.100' },
|
|
109
|
+
},
|
|
110
|
+
tertiary: {
|
|
111
|
+
backgroundColor: 'transparent',
|
|
112
|
+
color: 'foreground',
|
|
113
|
+
':disabled:not([aria-busy="true"])': { color: 'gray.700' },
|
|
114
|
+
':hover:not(:disabled)': { backgroundColor: 'gray.100' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
export const label = style({ overflow: 'hidden', textOverflow: 'ellipsis' })
|
|
121
|
+
|
|
122
|
+
export const spinner = style({
|
|
123
|
+
flexShrink: 0,
|
|
124
|
+
height: 4,
|
|
125
|
+
width: 4,
|
|
126
|
+
'@media (prefers-reduced-motion: no-preference)': { animation: 'spin' },
|
|
127
|
+
})
|
|
128
|
+
}
|