create-croissant 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +16 -8
- package/template/.prettierignore +10 -0
- package/template/.prettierrc +11 -0
- package/template/README.md +88 -0
- package/template/apps/web/.env.example +4 -0
- package/template/apps/web/components.json +23 -0
- package/template/apps/web/drizzle.config.ts +11 -0
- package/template/apps/web/eslint.config.js +10 -0
- package/template/apps/web/node_modules/@better-auth/core/LICENSE.md +20 -0
- package/template/apps/web/node_modules/@better-auth/core/README.md +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.d.mts +278 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.mjs +30 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.mjs +20 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.mjs +33 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.mjs +29 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.mjs +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.d.mts +5 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.mjs +5 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.d.mts +27 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.mjs +47 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.d.mts +24 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.mjs +93 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.d.mts +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.mjs +754 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.mjs +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.mjs +30 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.mts +26 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.mjs +37 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.mjs +31 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.mts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.mjs +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.mjs +21 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.d.mts +525 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.mjs +24 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/types.d.mts +105 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.mjs +37 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.mjs +265 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.mjs +8 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/plugin.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.d.mts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.mjs +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.mjs +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.d.mts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.mjs +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.mjs +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.mjs +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.d.mts +21 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/type.d.mts +167 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.mjs +86 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.d.mts +32 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.mjs +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.d.mts +48 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.d.mts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.mjs +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.d.mts +19 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.mjs +27 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/index.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/index.mjs +1 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/api.mjs +42 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.d.mts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.d.mts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.mjs +3 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.mjs +53 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.d.mts +56 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.mjs +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.d.mts +44 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.mjs +41 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.mjs +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/oauth-provider.d.mts +192 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.d.mts +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.mjs +25 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.d.mts +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.d.mts +42 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.mjs +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.d.mts +117 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.mjs +101 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs +80 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.d.mts +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.mjs +161 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.d.mts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.mjs +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.d.mts +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs +72 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.mjs +117 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.d.mts +61 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.mjs +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.d.mts +102 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.mjs +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.d.mts +123 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.d.mts +97 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.mjs +108 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.d.mts +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.d.mts +1834 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.mjs +78 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.d.mts +161 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.mjs +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.d.mts +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.mjs +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.d.mts +105 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.mjs +110 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.d.mts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.mjs +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.d.mts +67 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.d.mts +174 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.mjs +135 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.d.mts +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.mjs +65 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.d.mts +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.mjs +72 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.d.mts +71 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.d.mts +129 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.mjs +140 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.d.mts +74 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.mjs +71 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.d.mts +65 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.mjs +74 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.d.mts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.mjs +80 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.mjs +57 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.mjs +87 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.d.mts +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.mjs +66 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.d.mts +63 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.mjs +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.d.mts +168 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.mjs +60 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.mjs +75 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.d.mts +126 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.mjs +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.d.mts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.mjs +58 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.d.mts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.d.mts +163 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.mjs +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/context.d.mts +277 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/cookie.d.mts +15 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/helper.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/index.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/init-options.d.mts +1358 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin-client.d.mts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin.d.mts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/secret.d.mts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.mjs +32 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.mjs +15 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.mjs +16 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.mjs +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.d.mts +147 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.mjs +291 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.mjs +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.d.mts +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.mjs +116 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.mjs +41 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.mjs +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.d.mts +20 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.mjs +31 -0
- package/template/apps/web/node_modules/@better-auth/core/package.json +187 -0
- package/template/apps/web/node_modules/@better-auth/core/src/api/index.ts +106 -0
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/index.ts +40 -0
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/pure.index.ts +46 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/endpoint-context.ts +50 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/global.ts +57 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/index.ts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/request-state.ts +91 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/transaction.ts +136 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/factory.ts +1440 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-field-name.ts +59 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-model-name.ts +51 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-attributes.ts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-name.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-id-field.ts +150 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-model-name.ts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/index.ts +567 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/types.ts +132 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/utils.ts +61 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/get-tables.ts +296 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/index.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/plugin.ts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/account.ts +47 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/rate-limit.ts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/session.ts +29 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/shared.ts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/user.ts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/verification.ts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/type.ts +333 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/color-depth.ts +172 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/env-impl.ts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/index.ts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/logger.ts +145 -0
- package/template/apps/web/node_modules/@better-auth/core/src/error/codes.ts +71 -0
- package/template/apps/web/node_modules/@better-auth/core/src/error/index.ts +35 -0
- package/template/apps/web/node_modules/@better-auth/core/src/index.ts +1 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/api.ts +64 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/attributes.ts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/index.ts +2 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/tracer.ts +95 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/client-credentials-token.ts +126 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/create-authorization-url.ts +89 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/index.ts +29 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/oauth-provider.ts +222 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/refresh-access-token.ts +157 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/utils.ts +38 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/validate-authorization-code.ts +180 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/verify.ts +221 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/apple.ts +223 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/atlassian.ts +133 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/cognito.ts +280 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/discord.ts +170 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/dropbox.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/facebook.ts +206 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/figma.ts +118 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/github.ts +184 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/gitlab.ts +155 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/google.ts +203 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/huggingface.ts +119 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/index.ts +132 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kakao.ts +179 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kick.ts +109 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/line.ts +169 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linear.ts +121 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linkedin.ts +110 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/microsoft-entra-id.ts +342 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/naver.ts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/notion.ts +108 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paybin.ts +118 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paypal.ts +263 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/polar.ts +111 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/railway.ts +100 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/reddit.ts +122 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/roblox.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/salesforce.ts +159 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/slack.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/spotify.ts +94 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/tiktok.ts +211 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitch.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitter.ts +199 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vercel.ts +87 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vk.ts +125 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/wechat.ts +213 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/zoom.ts +230 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/context.ts +415 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/cookie.ts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/helper.ts +27 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/index.ts +40 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/init-options.ts +1610 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin-client.ts +129 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin.ts +163 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/secret.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/async.ts +53 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/db.ts +20 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/deprecate.ts +21 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/error-codes.ts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/fetch-metadata.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/host.ts +401 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/id.ts +5 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/ip.ts +211 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/json.ts +56 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/string.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/url.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/LICENSE.md +20 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/README.md +17 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/dist/index.d.mts +47 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/dist/index.mjs +458 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/package.json +62 -0
- package/template/apps/web/node_modules/@better-auth/utils/README.md +384 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.cjs +104 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.cts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.mts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.ts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.mjs +101 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.cjs +80 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.cts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.mts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.ts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.mjs +77 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.cjs +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.cts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.mjs +14 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.cjs +90 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.cts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.mts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.ts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.mjs +88 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.cjs +31 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.cts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.ts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.mjs +29 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.cjs +40 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.cts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.mjs +38 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.cjs +58 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.cts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.ts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.mjs +56 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.cjs +10 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.cts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.mts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.mjs +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.cjs +90 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.cts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.ts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.mjs +88 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.cjs +36 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.mjs +33 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.cjs +47 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.mjs +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.cjs +55 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.mjs +53 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.cjs +76 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.cts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.mts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.ts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.mjs +74 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.cts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.ts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/package.json +95 -0
- package/template/apps/web/node_modules/better-call/LICENSE +21 -0
- package/template/apps/web/node_modules/better-call/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs +181 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.cts +16 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.mts +16 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs +178 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/client.cjs +23 -0
- package/template/apps/web/node_modules/better-call/dist/client.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/client.d.cts +53 -0
- package/template/apps/web/node_modules/better-call/dist/client.d.mts +53 -0
- package/template/apps/web/node_modules/better-call/dist/client.mjs +14 -0
- package/template/apps/web/node_modules/better-call/dist/client.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/context.cjs +103 -0
- package/template/apps/web/node_modules/better-call/dist/context.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/context.d.cts +341 -0
- package/template/apps/web/node_modules/better-call/dist/context.d.mts +341 -0
- package/template/apps/web/node_modules/better-call/dist/context.mjs +103 -0
- package/template/apps/web/node_modules/better-call/dist/context.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs +87 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs +84 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs +39 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs +36 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs +70 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.cts +475 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.mts +475 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs +70 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/error.cjs +141 -0
- package/template/apps/web/node_modules/better-call/dist/error.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/error.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/error.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/error.mjs +133 -0
- package/template/apps/web/node_modules/better-call/dist/error.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/helper.d.cts +12 -0
- package/template/apps/web/node_modules/better-call/dist/helper.d.mts +12 -0
- package/template/apps/web/node_modules/better-call/dist/index.cjs +28 -0
- package/template/apps/web/node_modules/better-call/dist/index.d.cts +11 -0
- package/template/apps/web/node_modules/better-call/dist/index.d.mts +11 -0
- package/template/apps/web/node_modules/better-call/dist/index.mjs +10 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs +52 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.d.cts +123 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.d.mts +123 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs +52 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/node.cjs +18 -0
- package/template/apps/web/node_modules/better-call/dist/node.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/node.d.cts +9 -0
- package/template/apps/web/node_modules/better-call/dist/node.d.mts +9 -0
- package/template/apps/web/node_modules/better-call/dist/node.mjs +15 -0
- package/template/apps/web/node_modules/better-call/dist/node.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs +191 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.d.cts +113 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.d.mts +113 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs +189 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/router.cjs +118 -0
- package/template/apps/web/node_modules/better-call/dist/router.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/router.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/router.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/router.mjs +117 -0
- package/template/apps/web/node_modules/better-call/dist/router.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.cts +59 -0
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.mts +59 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs +153 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.d.cts +12 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.d.mts +12 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs +153 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/utils.cjs +86 -0
- package/template/apps/web/node_modules/better-call/dist/utils.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/utils.mjs +82 -0
- package/template/apps/web/node_modules/better-call/dist/utils.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/validator.cjs +58 -0
- package/template/apps/web/node_modules/better-call/dist/validator.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/validator.mjs +57 -0
- package/template/apps/web/node_modules/better-call/dist/validator.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/package.json +96 -0
- package/template/apps/web/node_modules/set-cookie-parser/LICENSE +21 -0
- package/template/apps/web/node_modules/set-cookie-parser/README.md +169 -0
- package/template/apps/web/node_modules/set-cookie-parser/dist/.eslintrc.cjs +16 -0
- package/template/apps/web/node_modules/set-cookie-parser/dist/set-cookie.cjs +260 -0
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.d.ts +119 -0
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.js +265 -0
- package/template/apps/web/node_modules/set-cookie-parser/package.json +61 -0
- package/template/apps/web/package.json +44 -0
- package/template/apps/web/public/favicon.ico +0 -0
- package/template/apps/web/public/manifest.json +25 -0
- package/template/apps/web/public/robots.txt +3 -0
- package/template/apps/web/src/components/app-sidebar.tsx +183 -0
- package/template/apps/web/src/components/login-form.tsx +111 -0
- package/template/apps/web/src/components/search-form.tsx +27 -0
- package/template/apps/web/src/components/signup-form.tsx +137 -0
- package/template/apps/web/src/components/version-switcher.tsx +64 -0
- package/template/apps/web/src/hooks/use-mobile.ts +19 -0
- package/template/apps/web/src/lib/auth-client.ts +3 -0
- package/template/apps/web/src/lib/auth-utils.ts +15 -0
- package/template/apps/web/src/lib/orpc.ts +32 -0
- package/template/apps/web/src/routeTree.gen.ts +171 -0
- package/template/apps/web/src/router.tsx +20 -0
- package/template/apps/web/src/routes/__root.tsx +41 -0
- package/template/apps/web/src/routes/api/auth/$.ts +15 -0
- package/template/apps/web/src/routes/api/rpc.$.ts +34 -0
- package/template/apps/web/src/routes/dashboard.tsx +59 -0
- package/template/apps/web/src/routes/index.tsx +57 -0
- package/template/apps/web/src/routes/login.tsx +16 -0
- package/template/apps/web/src/routes/signup.tsx +16 -0
- package/template/apps/web/tsconfig.json +29 -0
- package/template/apps/web/vite.config.ts +19 -0
- package/template/docker-compose.yml +16 -0
- package/template/package.json +35 -0
- package/template/packages/auth/eslint.config.ts +3 -0
- package/template/packages/auth/package.json +24 -0
- package/template/packages/auth/src/lib/auth.ts +13 -0
- package/template/packages/auth/tsconfig.json +17 -0
- package/template/packages/auth/tsconfig.lint.json +14 -0
- package/template/packages/db/eslint.config.ts +3 -0
- package/template/packages/db/package.json +27 -0
- package/template/packages/db/src/auth-schema.ts +93 -0
- package/template/packages/db/src/index.ts +7 -0
- package/template/packages/db/src/planets-schema.ts +13 -0
- package/template/packages/db/src/schema.ts +2 -0
- package/template/packages/db/tsconfig.json +17 -0
- package/template/packages/db/tsconfig.lint.json +14 -0
- package/template/packages/orpc/eslint.config.ts +3 -0
- package/template/packages/orpc/package.json +23 -0
- package/template/packages/orpc/src/lib/router.ts +52 -0
- package/template/packages/orpc/tsconfig.json +17 -0
- package/template/packages/orpc/tsconfig.lint.json +14 -0
- package/template/packages/ui/components.json +23 -0
- package/template/packages/ui/eslint.config.ts +3 -0
- package/template/packages/ui/package.json +48 -0
- package/template/packages/ui/src/components/.gitkeep +0 -0
- package/template/packages/ui/src/components/accordion.tsx +72 -0
- package/template/packages/ui/src/components/alert-dialog.tsx +187 -0
- package/template/packages/ui/src/components/alert.tsx +77 -0
- package/template/packages/ui/src/components/aspect-ratio.tsx +22 -0
- package/template/packages/ui/src/components/avatar.tsx +107 -0
- package/template/packages/ui/src/components/badge.tsx +53 -0
- package/template/packages/ui/src/components/breadcrumb.tsx +125 -0
- package/template/packages/ui/src/components/button-group.tsx +88 -0
- package/template/packages/ui/src/components/button.tsx +59 -0
- package/template/packages/ui/src/components/calendar.tsx +229 -0
- package/template/packages/ui/src/components/card.tsx +103 -0
- package/template/packages/ui/src/components/carousel.tsx +240 -0
- package/template/packages/ui/src/components/chart.tsx +371 -0
- package/template/packages/ui/src/components/checkbox.tsx +29 -0
- package/template/packages/ui/src/components/collapsible.tsx +19 -0
- package/template/packages/ui/src/components/combobox.tsx +295 -0
- package/template/packages/ui/src/components/command.tsx +196 -0
- package/template/packages/ui/src/components/context-menu.tsx +271 -0
- package/template/packages/ui/src/components/dialog.tsx +158 -0
- package/template/packages/ui/src/components/direction.tsx +4 -0
- package/template/packages/ui/src/components/drawer.tsx +134 -0
- package/template/packages/ui/src/components/dropdown-menu.tsx +266 -0
- package/template/packages/ui/src/components/empty.tsx +105 -0
- package/template/packages/ui/src/components/field.tsx +237 -0
- package/template/packages/ui/src/components/hover-card.tsx +51 -0
- package/template/packages/ui/src/components/input-group.tsx +159 -0
- package/template/packages/ui/src/components/input-otp.tsx +85 -0
- package/template/packages/ui/src/components/input.tsx +20 -0
- package/template/packages/ui/src/components/item.tsx +202 -0
- package/template/packages/ui/src/components/kbd.tsx +26 -0
- package/template/packages/ui/src/components/label.tsx +20 -0
- package/template/packages/ui/src/components/menubar.tsx +280 -0
- package/template/packages/ui/src/components/native-select.tsx +61 -0
- package/template/packages/ui/src/components/navigation-menu.tsx +168 -0
- package/template/packages/ui/src/components/pagination.tsx +130 -0
- package/template/packages/ui/src/components/popover.tsx +88 -0
- package/template/packages/ui/src/components/progress.tsx +83 -0
- package/template/packages/ui/src/components/radio-group.tsx +36 -0
- package/template/packages/ui/src/components/resizable.tsx +50 -0
- package/template/packages/ui/src/components/scroll-area.tsx +53 -0
- package/template/packages/ui/src/components/select.tsx +201 -0
- package/template/packages/ui/src/components/separator.tsx +23 -0
- package/template/packages/ui/src/components/sheet.tsx +138 -0
- package/template/packages/ui/src/components/sidebar.tsx +726 -0
- package/template/packages/ui/src/components/skeleton.tsx +13 -0
- package/template/packages/ui/src/components/slider.tsx +52 -0
- package/template/packages/ui/src/components/sonner.tsx +50 -0
- package/template/packages/ui/src/components/spinner.tsx +10 -0
- package/template/packages/ui/src/components/switch.tsx +30 -0
- package/template/packages/ui/src/components/table.tsx +116 -0
- package/template/packages/ui/src/components/tabs.tsx +81 -0
- package/template/packages/ui/src/components/textarea.tsx +18 -0
- package/template/packages/ui/src/components/toggle-group.tsx +87 -0
- package/template/packages/ui/src/components/toggle.tsx +46 -0
- package/template/packages/ui/src/components/tooltip.tsx +64 -0
- package/template/packages/ui/src/hooks/.gitkeep +0 -0
- package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
- package/template/packages/ui/src/lib/.gitkeep +0 -0
- package/template/packages/ui/src/lib/utils.ts +7 -0
- package/template/packages/ui/src/styles/globals.css +130 -0
- package/template/packages/ui/tsconfig.json +17 -0
- package/template/packages/ui/tsconfig.lint.json +14 -0
- package/template/tsconfig.json +9 -0
- package/template/turbo.json +24 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# set-cookie-parser
|
|
2
|
+
|
|
3
|
+
[](https://github.com/nfriedly/set-cookie-parser/actions/workflows/node.js.yml)
|
|
4
|
+
[![NPM version][npm-image]][npm-url]
|
|
5
|
+
[][npm-url]
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Parses set-cookie headers into JavaScript objects
|
|
10
|
+
|
|
11
|
+
Accepts a single `set-cookie` header value, an array of `set-cookie` header values, a Node.js response object, or a `fetch()` `Response` object that may have 0 or more `set-cookie` headers.
|
|
12
|
+
|
|
13
|
+
Returns either an array of cookie objects or a map of name => cookie object with options set `{map: true}`. Each cookie object will have, at a minimum `name` and `value` properties, and may have additional properties depending on the set-cookie header:
|
|
14
|
+
|
|
15
|
+
* `name` - cookie name (string)
|
|
16
|
+
* `value` - cookie value (string)
|
|
17
|
+
* `path` - URL path to limit the scope to (string or undefined)
|
|
18
|
+
* `domain` - domain to expand the scope to (string or undefined, may begin with "." to indicate the named domain or any subdomain of it)
|
|
19
|
+
* `expires` - absolute expiration date for the cookie (Date object or undefined)
|
|
20
|
+
* `maxAge` - relative expiration time of the cookie in seconds from when the client receives it (integer or undefined)
|
|
21
|
+
* Note: when using with [express's res.cookie() method](http://expressjs.com/en/4x/api.html#res.cookie), multiply `maxAge` by 1000 to convert to milliseconds.
|
|
22
|
+
* `secure` - indicates cookie should only be sent over HTTPs (true or undefined)
|
|
23
|
+
* `httpOnly` - indicates cookie should *not* be accessible to client-side JavaScript (true or undefined)
|
|
24
|
+
* `sameSite` - indicates if cookie should be included in cross-site requests ([more info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value)) (string or undefined)
|
|
25
|
+
* Note: valid values are `"Strict"`, `"Lax"`, and `"None"`, but set-cookie-parser copies the value verbatim and does *not* perform any validation.
|
|
26
|
+
* `partitioned` - indicates cookie should be scoped to the combination of 3rd party domain + top page domain ([more info](https://developer.mozilla.org/en-US/docs/Web/Privacy/Privacy_sandbox/Partitioned_cookies)) (true or undefined)
|
|
27
|
+
|
|
28
|
+
(The output format is loosely based on the input format of https://www.npmjs.com/package/cookie)
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
$ npm install --save set-cookie-parser
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### Get array of cookie objects
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import * as http from 'node:http';
|
|
43
|
+
import { parseSetCookie } from 'set-cookie-parser';
|
|
44
|
+
// or const { parseSetCookie } = require('set-cookie-parser');
|
|
45
|
+
|
|
46
|
+
http.get('http://example.com', function(res) {
|
|
47
|
+
const cookies = parseSetCookie(res, {
|
|
48
|
+
decodeValues: true // default: true
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
cookies.forEach(console.log);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Example output:
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
[
|
|
59
|
+
{
|
|
60
|
+
name: 'bam',
|
|
61
|
+
value: 'baz'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'foo',
|
|
65
|
+
value: 'bar',
|
|
66
|
+
path: '/',
|
|
67
|
+
expires: new Date('Tue Jul 01 2025 06:01:11 GMT-0400 (EDT)'),
|
|
68
|
+
maxAge: 1000,
|
|
69
|
+
domain: '.example.com',
|
|
70
|
+
secure: true,
|
|
71
|
+
httpOnly: true,
|
|
72
|
+
sameSite: 'lax'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Get map of cookie objects
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import * as http from 'node:http';
|
|
81
|
+
import { parseSetCookie } from 'set-cookie-parser';
|
|
82
|
+
// or const { parseSetCookie } = require('set-cookie-parser');
|
|
83
|
+
|
|
84
|
+
http.get('http://example.com', function(res) {
|
|
85
|
+
const cookies = parseSetCookie(res, {
|
|
86
|
+
decodeValues: true, // default: true
|
|
87
|
+
map: true // default: false
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const desiredCookie = cookies['session'];
|
|
91
|
+
console.log(desiredCookie);
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
Example output:
|
|
95
|
+
```js
|
|
96
|
+
{
|
|
97
|
+
bam: {
|
|
98
|
+
name: 'bam',
|
|
99
|
+
value: 'baz'
|
|
100
|
+
},
|
|
101
|
+
foo: {
|
|
102
|
+
name: 'foo',
|
|
103
|
+
value: 'bar',
|
|
104
|
+
path: '/',
|
|
105
|
+
expires: new Date('Tue Jul 01 2025 06:01:11 GMT-0400 (EDT)'),
|
|
106
|
+
maxAge: 1000,
|
|
107
|
+
domain: '.example.com',
|
|
108
|
+
secure: true,
|
|
109
|
+
httpOnly: true,
|
|
110
|
+
sameSite: 'lax'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Creating a new, modified set-cookie header
|
|
116
|
+
|
|
117
|
+
This library can be used in conjunction with the [cookie](https://www.npmjs.com/package/cookie) library to modify and replace set-cookie headers:
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
import * as libCookie from 'cookie';
|
|
121
|
+
import { parseSetCookie } from 'set-cookie-parser';
|
|
122
|
+
// or const { parseSetCookie } = require('set-cookie-parser');
|
|
123
|
+
|
|
124
|
+
function modifySetCookie(res){
|
|
125
|
+
// parse the set-cookie headers with this library
|
|
126
|
+
const cookies = parseSetCookie(res);
|
|
127
|
+
|
|
128
|
+
// modify the cookies here
|
|
129
|
+
// ...
|
|
130
|
+
|
|
131
|
+
// create new set-cookie headers using the cookie library
|
|
132
|
+
res.headers['set-cookie'] = cookies.map(function(cookie) {
|
|
133
|
+
return libCookie.serialize(cookie.name, cookie.value, cookie);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
See a real-world example of this in [unblocker](https://github.com/nfriedly/node-unblocker/blob/08a89ec27274b46dcd80d0a324a59406f2bdad3d/lib/cookies.js#L67-L85)
|
|
139
|
+
|
|
140
|
+
## API
|
|
141
|
+
|
|
142
|
+
### parseSetCookie(input, [options])
|
|
143
|
+
|
|
144
|
+
Parses cookies from a string, array of strings, or a http response object.
|
|
145
|
+
Always returns an array, regardless of input format. (Unless the `map` option is set, in which case it always returns an object.)
|
|
146
|
+
|
|
147
|
+
Also accepts an optional options object. Defaults:
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
{
|
|
151
|
+
decodeValues: true, // Calls decodeURIComponent on each value - default: true
|
|
152
|
+
map: false, // Return an object instead of an array - default: false
|
|
153
|
+
silent: false, // Suppress the warning that is logged when called on a request instead of a response - default: false
|
|
154
|
+
split: 'auto', // Separate combined cookie headers. Valid options are true/false/'auto'. 'auto' splits strings but not arrays.
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## References
|
|
159
|
+
|
|
160
|
+
* [RFC 6265: HTTP State Management Mechanism](https://tools.ietf.org/html/rfc6265)
|
|
161
|
+
* [draft-ietf-httpbis-rfc6265bis-10](https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html)
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT © [Nathan Friedly](http://www.nfriedly.com/)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
[npm-image]: https://badge.fury.io/js/set-cookie-parser.svg
|
|
169
|
+
[npm-url]: https://npmjs.org/package/set-cookie-parser
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = {
|
|
3
|
+
// This isn't really meant for use in browsers, but some dependents such as nookie are.
|
|
4
|
+
// So, stick with ES5 (at least for the CJS version) to be nice. See #44
|
|
5
|
+
parserOptions: { ecmaVersion: 5 },
|
|
6
|
+
env: {
|
|
7
|
+
node: true,
|
|
8
|
+
browser: true,
|
|
9
|
+
},
|
|
10
|
+
extends: ["eslint:recommended", "plugin:prettier/recommended"],
|
|
11
|
+
rules: {
|
|
12
|
+
"prefer-const": "error",
|
|
13
|
+
strict: "error",
|
|
14
|
+
eqeqeq: "error",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// Generated automatically from lib/set-cookie.js; see build-cjs.js
|
|
2
|
+
|
|
3
|
+
var defaultParseOptions = {
|
|
4
|
+
decodeValues: true,
|
|
5
|
+
map: false,
|
|
6
|
+
silent: false,
|
|
7
|
+
split: "auto", // auto = split strings but not arrays
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function isForbiddenKey(key) {
|
|
11
|
+
return typeof key !== "string" || key in {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function createNullObj() {
|
|
15
|
+
return Object.create(null);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isNonEmptyString(str) {
|
|
19
|
+
return typeof str === "string" && !!str.trim();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function parseString(setCookieValue, options) {
|
|
23
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
24
|
+
|
|
25
|
+
var nameValuePairStr = parts.shift();
|
|
26
|
+
var parsed = parseNameValuePair(nameValuePairStr);
|
|
27
|
+
var name = parsed.name;
|
|
28
|
+
var value = parsed.value;
|
|
29
|
+
|
|
30
|
+
options = options
|
|
31
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
32
|
+
: defaultParseOptions;
|
|
33
|
+
|
|
34
|
+
if (isForbiddenKey(name)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error(
|
|
42
|
+
"set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",
|
|
43
|
+
e
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var cookie = createNullObj();
|
|
48
|
+
cookie.name = name;
|
|
49
|
+
cookie.value = value;
|
|
50
|
+
|
|
51
|
+
parts.forEach(function (part) {
|
|
52
|
+
var sides = part.split("=");
|
|
53
|
+
var key = sides.shift().trimLeft().toLowerCase();
|
|
54
|
+
if (isForbiddenKey(key)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
var value = sides.join("=");
|
|
58
|
+
if (key === "expires") {
|
|
59
|
+
cookie.expires = new Date(value);
|
|
60
|
+
} else if (key === "max-age") {
|
|
61
|
+
var n = parseInt(value, 10);
|
|
62
|
+
if (!Number.isNaN(n)) cookie.maxAge = n;
|
|
63
|
+
} else if (key === "secure") {
|
|
64
|
+
cookie.secure = true;
|
|
65
|
+
} else if (key === "httponly") {
|
|
66
|
+
cookie.httpOnly = true;
|
|
67
|
+
} else if (key === "samesite") {
|
|
68
|
+
cookie.sameSite = value;
|
|
69
|
+
} else if (key === "partitioned") {
|
|
70
|
+
cookie.partitioned = true;
|
|
71
|
+
} else if (key) {
|
|
72
|
+
cookie[key] = value;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return cookie;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function parseNameValuePair(nameValuePairStr) {
|
|
80
|
+
// Parses name-value-pair according to rfc6265bis draft
|
|
81
|
+
|
|
82
|
+
var name = "";
|
|
83
|
+
var value = "";
|
|
84
|
+
var nameValueArr = nameValuePairStr.split("=");
|
|
85
|
+
if (nameValueArr.length > 1) {
|
|
86
|
+
name = nameValueArr.shift();
|
|
87
|
+
value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
|
|
88
|
+
} else {
|
|
89
|
+
value = nameValuePairStr;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return { name: name, value: value };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function parseSetCookie(input, options) {
|
|
96
|
+
options = options
|
|
97
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
98
|
+
: defaultParseOptions;
|
|
99
|
+
|
|
100
|
+
if (!input) {
|
|
101
|
+
if (!options.map) {
|
|
102
|
+
return [];
|
|
103
|
+
} else {
|
|
104
|
+
return createNullObj();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (input.headers) {
|
|
109
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
110
|
+
// for fetch responses - they combine headers of the same type in the headers array,
|
|
111
|
+
// but getSetCookie returns an uncombined array
|
|
112
|
+
input = input.headers.getSetCookie();
|
|
113
|
+
} else if (input.headers["set-cookie"]) {
|
|
114
|
+
// fast-path for node.js (which automatically normalizes header names to lower-case)
|
|
115
|
+
input = input.headers["set-cookie"];
|
|
116
|
+
} else {
|
|
117
|
+
// slow-path for other environments - see #25
|
|
118
|
+
var sch =
|
|
119
|
+
input.headers[
|
|
120
|
+
Object.keys(input.headers).find(function (key) {
|
|
121
|
+
return key.toLowerCase() === "set-cookie";
|
|
122
|
+
})
|
|
123
|
+
];
|
|
124
|
+
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
125
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
126
|
+
console.warn(
|
|
127
|
+
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
input = sch;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var split = options.split;
|
|
135
|
+
var isArray = Array.isArray(input);
|
|
136
|
+
|
|
137
|
+
if (split === "auto") {
|
|
138
|
+
split = !isArray;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!isArray) {
|
|
142
|
+
input = [input];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
input = input.filter(isNonEmptyString);
|
|
146
|
+
|
|
147
|
+
if (split) {
|
|
148
|
+
input = input.map(splitCookiesString).flat();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!options.map) {
|
|
152
|
+
return input
|
|
153
|
+
.map(function (str) {
|
|
154
|
+
return parseString(str, options);
|
|
155
|
+
})
|
|
156
|
+
.filter(Boolean);
|
|
157
|
+
} else {
|
|
158
|
+
var cookies = createNullObj();
|
|
159
|
+
return input.reduce(function (cookies, str) {
|
|
160
|
+
var cookie = parseString(str, options);
|
|
161
|
+
if (cookie && !isForbiddenKey(cookie.name)) {
|
|
162
|
+
cookies[cookie.name] = cookie;
|
|
163
|
+
}
|
|
164
|
+
return cookies;
|
|
165
|
+
}, cookies);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/*
|
|
170
|
+
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
|
|
171
|
+
that are within a single set-cookie field-value, such as in the Expires portion.
|
|
172
|
+
|
|
173
|
+
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
|
|
174
|
+
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
|
|
175
|
+
React Native's fetch does this for *every* header, including set-cookie.
|
|
176
|
+
|
|
177
|
+
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
|
|
178
|
+
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
|
|
179
|
+
*/
|
|
180
|
+
function splitCookiesString(cookiesString) {
|
|
181
|
+
if (Array.isArray(cookiesString)) {
|
|
182
|
+
return cookiesString;
|
|
183
|
+
}
|
|
184
|
+
if (typeof cookiesString !== "string") {
|
|
185
|
+
return [];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var cookiesStrings = [];
|
|
189
|
+
var pos = 0;
|
|
190
|
+
var start;
|
|
191
|
+
var ch;
|
|
192
|
+
var lastComma;
|
|
193
|
+
var nextStart;
|
|
194
|
+
var cookiesSeparatorFound;
|
|
195
|
+
|
|
196
|
+
function skipWhitespace() {
|
|
197
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
198
|
+
pos += 1;
|
|
199
|
+
}
|
|
200
|
+
return pos < cookiesString.length;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function notSpecialChar() {
|
|
204
|
+
ch = cookiesString.charAt(pos);
|
|
205
|
+
|
|
206
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
while (pos < cookiesString.length) {
|
|
210
|
+
start = pos;
|
|
211
|
+
cookiesSeparatorFound = false;
|
|
212
|
+
|
|
213
|
+
while (skipWhitespace()) {
|
|
214
|
+
ch = cookiesString.charAt(pos);
|
|
215
|
+
if (ch === ",") {
|
|
216
|
+
// ',' is a cookie separator if we have later first '=', not ';' or ','
|
|
217
|
+
lastComma = pos;
|
|
218
|
+
pos += 1;
|
|
219
|
+
|
|
220
|
+
skipWhitespace();
|
|
221
|
+
nextStart = pos;
|
|
222
|
+
|
|
223
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
224
|
+
pos += 1;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// currently special character
|
|
228
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
229
|
+
// we found cookies separator
|
|
230
|
+
cookiesSeparatorFound = true;
|
|
231
|
+
// pos is inside the next cookie, so back up and return it.
|
|
232
|
+
pos = nextStart;
|
|
233
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
234
|
+
start = pos;
|
|
235
|
+
} else {
|
|
236
|
+
// in param ',' or param separator ';',
|
|
237
|
+
// we continue from that comma
|
|
238
|
+
pos = lastComma + 1;
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
pos += 1;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
246
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return cookiesStrings;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// named export for CJS
|
|
254
|
+
parseSetCookie.parseSetCookie = parseSetCookie;
|
|
255
|
+
// for backwards compatibility
|
|
256
|
+
parseSetCookie.parse = parseSetCookie;
|
|
257
|
+
parseSetCookie.parseString = parseString;
|
|
258
|
+
parseSetCookie.splitCookiesString = splitCookiesString;
|
|
259
|
+
|
|
260
|
+
module.exports = parseSetCookie;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export interface Cookie {
|
|
2
|
+
/** Cookie name */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Cookie value */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Cookie path */
|
|
7
|
+
path?: string;
|
|
8
|
+
/** Absolute expiration date for the cookie */
|
|
9
|
+
expires?: Date;
|
|
10
|
+
/**
|
|
11
|
+
* Relative max age of the cookie in seconds from when the client receives it.
|
|
12
|
+
* Note: when using with express's res.cookie() method, multiply maxAge by 1000 to convert to milliseconds.
|
|
13
|
+
*/
|
|
14
|
+
maxAge?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Domain for the cookie,
|
|
17
|
+
* may begin with "." to indicate the named domain or any subdomain of it
|
|
18
|
+
*/
|
|
19
|
+
domain?: string;
|
|
20
|
+
/** Indicates that this cookie should only be sent over HTTPS */
|
|
21
|
+
secure?: boolean;
|
|
22
|
+
/** Indicates that this cookie should not be accessible to client-side JavaScript */
|
|
23
|
+
httpOnly?: boolean;
|
|
24
|
+
/** Indicates a cookie ought not to be sent along with cross-site requests */
|
|
25
|
+
sameSite?: string;
|
|
26
|
+
/** Indicates the cookie should be stored using partitioned storage */
|
|
27
|
+
partitioned?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CookieMap {
|
|
31
|
+
[name: string]: Cookie;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Options {
|
|
35
|
+
/**
|
|
36
|
+
* Calls decodeURIComponent on each value.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
decodeValues?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Return an object instead of an array.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
map?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Suppress the warning that is logged when called on a request instead of a response.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
silent?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Controls whether combined cookie strings are split.
|
|
52
|
+
* - `true`: always split
|
|
53
|
+
* - `false`: never split
|
|
54
|
+
* - `"auto"`: split strings but not arrays
|
|
55
|
+
* @default "auto"
|
|
56
|
+
*/
|
|
57
|
+
split?: boolean | "auto";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Object with a `headers` property (e.g. Node.js IncomingMessage or fetch Response) */
|
|
61
|
+
type ResponseLike = {
|
|
62
|
+
headers:
|
|
63
|
+
| { getSetCookie(): string[] }
|
|
64
|
+
| { "set-cookie"?: string | readonly string[] }
|
|
65
|
+
| Record<string, string | string[] | undefined>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type SetCookieInput = string | readonly string[] | ResponseLike;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Parses set-cookie headers into objects.
|
|
72
|
+
*/
|
|
73
|
+
export function parseSetCookie(
|
|
74
|
+
input: SetCookieInput,
|
|
75
|
+
options: Options & { map: true }
|
|
76
|
+
): CookieMap;
|
|
77
|
+
export function parseSetCookie(
|
|
78
|
+
input: SetCookieInput,
|
|
79
|
+
options?: Options & { map?: false }
|
|
80
|
+
): Cookie[];
|
|
81
|
+
export function parseSetCookie(
|
|
82
|
+
input: SetCookieInput,
|
|
83
|
+
options?: Options
|
|
84
|
+
): Cookie[] | CookieMap;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Parses a single set-cookie header value string.
|
|
88
|
+
* @deprecated Use `parseSetCookie` instead.
|
|
89
|
+
*/
|
|
90
|
+
export function parseString(
|
|
91
|
+
setCookieValue: string,
|
|
92
|
+
options?: Options
|
|
93
|
+
): Cookie | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Splits a combined set-cookie header string into individual set-cookie header strings.
|
|
97
|
+
* @deprecated Use `parseSetCookie` with the `split` option instead.
|
|
98
|
+
*/
|
|
99
|
+
export function splitCookiesString(
|
|
100
|
+
input: string | readonly string[] | undefined
|
|
101
|
+
): string[];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @deprecated Renamed to `parseSetCookie`. Kept for backward compatibility.
|
|
105
|
+
*/
|
|
106
|
+
export {
|
|
107
|
+
parseSetCookie as parse,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Default export — the `parseSetCookie` function with additional properties for backward compatibility.
|
|
112
|
+
*/
|
|
113
|
+
declare const _default: typeof parseSetCookie & {
|
|
114
|
+
parseSetCookie: typeof parseSetCookie;
|
|
115
|
+
parse: typeof parseSetCookie;
|
|
116
|
+
parseString: typeof parseString;
|
|
117
|
+
splitCookiesString: typeof splitCookiesString;
|
|
118
|
+
};
|
|
119
|
+
export default _default;
|