@hexclave/shared 1.0.40 → 1.0.42
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/admin-interface-Y9EZqwD6.d.ts +379 -0
- package/dist/admin-interface-Y9EZqwD6.d.ts.map +1 -0
- package/dist/admin-metrics-bsOkw4YQ.d.ts +807 -0
- package/dist/admin-metrics-bsOkw4YQ.d.ts.map +1 -0
- package/dist/ai/image-limits.d.ts.map +1 -1
- package/dist/ai/image-limits.js +6 -7
- package/dist/ai/image-limits.js.map +1 -1
- package/dist/ai/llms/llms.d.ts.map +1 -1
- package/dist/ai/llms/llms.js +2 -4
- package/dist/ai/llms/llms.js.map +1 -1
- package/dist/ai/unified-prompts/reminders.js +3 -6
- package/dist/ai/unified-prompts/reminders.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +3 -5
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +5 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js +1 -2
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +3 -6
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt.js +2 -4
- package/dist/ai/unified-prompts/skill-site-prompt.js.map +1 -1
- package/dist/analytics-IjkAsefy.d.ts +14 -0
- package/dist/analytics-IjkAsefy.d.ts.map +1 -0
- package/dist/apps/apps-config.d.ts.map +1 -1
- package/dist/apps/apps-config.js +2 -3
- package/dist/apps/apps-config.js.map +1 -1
- package/dist/apps/apps-ui.d.ts +1 -2
- package/dist/apps/apps-ui.d.ts.map +1 -1
- package/dist/apps/apps-ui.js +4 -5
- package/dist/apps/apps-ui.js.map +1 -1
- package/dist/client-interface-iIw4nU5k.d.ts +447 -0
- package/dist/client-interface-iIw4nU5k.d.ts.map +1 -0
- package/dist/config/db-sync-mappings.js +2 -3
- package/dist/config/db-sync-mappings.js.map +1 -1
- package/dist/config/format.d.ts +2 -61
- package/dist/config/format.js +2 -192
- package/dist/config/format.js.map +1 -1
- package/dist/config/migrate-catalogs-to-product-lines.d.ts.map +1 -1
- package/dist/config/migrate-catalogs-to-product-lines.js +2 -196
- package/dist/config/migrate-catalogs-to-product-lines.js.map +1 -1
- package/dist/config/schema-fuzzer.test.js +18 -172
- package/dist/config/schema-fuzzer.test.js.map +1 -1
- package/dist/config/schema.d.ts +2 -2328
- package/dist/config/schema.js +6 -351
- package/dist/config/schema.js.map +1 -1
- package/dist/config-authoring.d.ts +1 -1
- package/dist/config-authoring.d.ts.map +1 -1
- package/dist/config-authoring.js +2 -3
- package/dist/config-authoring.js.map +1 -1
- package/dist/config-authoring.test.js +1 -3
- package/dist/config-authoring.test.js.map +1 -1
- package/dist/config-eval.d.ts.map +1 -1
- package/dist/config-eval.js +4 -46
- package/dist/config-eval.js.map +1 -1
- package/dist/config-rendering.d.ts.map +1 -1
- package/dist/config-rendering.js +2 -48
- package/dist/config-rendering.js.map +1 -1
- package/dist/connected-accounts-D5CKe50A.d.ts +67 -0
- package/dist/connected-accounts-D5CKe50A.d.ts.map +1 -0
- package/dist/contact-channels-DW8yQxlc.d.ts +180 -0
- package/dist/contact-channels-DW8yQxlc.d.ts.map +1 -0
- package/dist/country-codes-CRWDroBE.d.ts +11 -0
- package/dist/country-codes-CRWDroBE.d.ts.map +1 -0
- package/dist/crud-CqmEW9s6.d.ts +98 -0
- package/dist/crud-CqmEW9s6.d.ts.map +1 -0
- package/dist/crud.d.ts +2 -98
- package/dist/crud.js +3 -71
- package/dist/crud.js.map +1 -1
- package/dist/currency-constants-Cq_q8twn.d.ts +45 -0
- package/dist/currency-constants-Cq_q8twn.d.ts.map +1 -0
- package/dist/current-user-BBoN3hsn.d.ts +284 -0
- package/dist/current-user-BBoN3hsn.d.ts.map +1 -0
- package/dist/dates-B6ne9iOR.d.ts +23 -0
- package/dist/dates-B6ne9iOR.d.ts.map +1 -0
- package/dist/email-outbox-B1wmVPRG.d.ts +1464 -0
- package/dist/{interface/crud/email-outbox.d.ts.map → email-outbox-B1wmVPRG.d.ts.map} +1 -1
- package/dist/emails-Ba4yEaCS.d.ts +40 -0
- package/dist/emails-Ba4yEaCS.d.ts.map +1 -0
- package/dist/errors-Cl-RUyed.d.ts +238 -0
- package/dist/errors-Cl-RUyed.d.ts.map +1 -0
- package/dist/esm/ai/image-limits.d.ts.map +1 -1
- package/dist/esm/ai/image-limits.js +5 -5
- package/dist/esm/ai/image-limits.js.map +1 -1
- package/dist/esm/ai/llms/llms.d.ts +1 -1
- package/dist/esm/ai/llms/llms.d.ts.map +1 -1
- package/dist/esm/ai/llms/llms.js +1 -2
- package/dist/esm/ai/llms/llms.js.map +1 -1
- package/dist/esm/ai/unified-prompts/reminders.js +1 -2
- package/dist/esm/ai/unified-prompts/reminders.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +26 -28
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +2 -3
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt.js +1 -2
- package/dist/esm/ai/unified-prompts/skill-site-prompt.js.map +1 -1
- package/dist/esm/apps/apps-config.d.ts.map +1 -1
- package/dist/esm/apps/apps-config.js +1 -1
- package/dist/esm/apps/apps-config.js.map +1 -1
- package/dist/esm/apps/apps-ui.d.ts +2 -3
- package/dist/esm/apps/apps-ui.d.ts.map +1 -1
- package/dist/esm/apps/apps-ui.js +2 -3
- package/dist/esm/apps/apps-ui.js.map +1 -1
- package/dist/esm/config/db-sync-mappings.js +1 -1
- package/dist/esm/config/db-sync-mappings.js.map +1 -1
- package/dist/esm/config/format.d.ts +1 -1
- package/dist/esm/config/format.d.ts.map +1 -1
- package/dist/esm/config/format.js +1 -190
- package/dist/esm/config/format.js.map +1 -1
- package/dist/esm/config/migrate-catalogs-to-product-lines.d.ts.map +1 -1
- package/dist/esm/config/migrate-catalogs-to-product-lines.js +1 -194
- package/dist/esm/config/migrate-catalogs-to-product-lines.js.map +1 -1
- package/dist/esm/config/schema-fuzzer.test.js +20 -173
- package/dist/esm/config/schema-fuzzer.test.js.map +1 -1
- package/dist/esm/config/schema.d.ts +81 -82
- package/dist/esm/config/schema.d.ts.map +1 -1
- package/dist/esm/config/schema.js +2 -347
- package/dist/esm/config/schema.js.map +1 -1
- package/dist/esm/config-authoring.d.ts +1 -1
- package/dist/esm/config-authoring.d.ts.map +1 -1
- package/dist/esm/config-authoring.js +1 -1
- package/dist/esm/config-authoring.js.map +1 -1
- package/dist/esm/config-authoring.test.js +2 -3
- package/dist/esm/config-authoring.test.js.map +1 -1
- package/dist/esm/config-eval.d.ts +1 -1
- package/dist/esm/config-eval.d.ts.map +1 -1
- package/dist/esm/config-eval.js +1 -43
- package/dist/esm/config-eval.js.map +1 -1
- package/dist/esm/config-rendering.d.ts.map +1 -1
- package/dist/esm/config-rendering.js +1 -46
- package/dist/esm/config-rendering.js.map +1 -1
- package/dist/esm/crud.d.ts +1 -1
- package/dist/esm/crud.d.ts.map +1 -1
- package/dist/esm/crud.js +2 -69
- package/dist/esm/crud.js.map +1 -1
- package/dist/esm/helpers/emails.js +1 -2
- package/dist/esm/helpers/emails.js.map +1 -1
- package/dist/esm/helpers/init-prompt.d.ts.map +1 -1
- package/dist/esm/helpers/init-prompt.js +1 -2
- package/dist/esm/helpers/init-prompt.js.map +1 -1
- package/dist/esm/helpers/password.d.ts +1 -1
- package/dist/esm/helpers/password.d.ts.map +1 -1
- package/dist/esm/helpers/password.js +1 -2
- package/dist/esm/helpers/password.js.map +1 -1
- package/dist/esm/helpers/production-mode.d.ts +1 -1
- package/dist/esm/helpers/production-mode.d.ts.map +1 -1
- package/dist/esm/helpers/production-mode.js +1 -2
- package/dist/esm/helpers/production-mode.js.map +1 -1
- package/dist/esm/helpers/support-sla.d.ts.map +1 -1
- package/dist/esm/helpers/support-sla.js +1 -1
- package/dist/esm/helpers/support-sla.js.map +1 -1
- package/dist/esm/helpers/support-sla.test.js +2 -3
- package/dist/esm/helpers/support-sla.test.js.map +1 -1
- package/dist/esm/helpers/vault/client-side.d.ts.map +1 -1
- package/dist/esm/helpers/vault/client-side.js +1 -20
- package/dist/esm/helpers/vault/client-side.js.map +1 -1
- package/dist/esm/helpers/vault/server-side.js +1 -2
- package/dist/esm/helpers/vault/server-side.js.map +1 -1
- package/dist/esm/hooks/use-async-callback.d.ts.map +1 -1
- package/dist/esm/hooks/use-async-callback.js +1 -2
- package/dist/esm/hooks/use-async-callback.js.map +1 -1
- package/dist/esm/hooks/use-async-external-store.d.ts +1 -1
- package/dist/esm/hooks/use-async-external-store.d.ts.map +1 -1
- package/dist/esm/hooks/use-async-external-store.js +1 -2
- package/dist/esm/hooks/use-async-external-store.js.map +1 -1
- package/dist/esm/hooks/use-hash.js +1 -2
- package/dist/esm/hooks/use-hash.js.map +1 -1
- package/dist/esm/hooks/use-hover.d.ts.map +1 -1
- package/dist/esm/hooks/use-hover.js +1 -2
- package/dist/esm/hooks/use-hover.js.map +1 -1
- package/dist/esm/hooks/use-strict-memo.d.ts.map +1 -1
- package/dist/esm/hooks/use-strict-memo.js +1 -70
- package/dist/esm/hooks/use-strict-memo.js.map +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +1 -2
- package/dist/esm/interface/admin-interface.d.ts +19 -19
- package/dist/esm/interface/admin-interface.d.ts.map +1 -1
- package/dist/esm/interface/admin-interface.js +2 -3
- package/dist/esm/interface/admin-interface.js.map +1 -1
- package/dist/esm/interface/admin-metrics.d.ts +2 -2
- package/dist/esm/interface/admin-metrics.d.ts.map +1 -1
- package/dist/esm/interface/admin-metrics.js +1 -2
- package/dist/esm/interface/admin-metrics.js.map +1 -1
- package/dist/esm/interface/client-interface.d.ts +22 -22
- package/dist/esm/interface/client-interface.d.ts.map +1 -1
- package/dist/esm/interface/client-interface.js +32 -16
- package/dist/esm/interface/client-interface.js.map +1 -1
- package/dist/esm/interface/client-interface.test.js +84 -13
- package/dist/esm/interface/client-interface.test.js.map +1 -1
- package/dist/esm/interface/conversations.d.ts +11 -11
- package/dist/esm/interface/conversations.d.ts.map +1 -1
- package/dist/esm/interface/conversations.js +1 -2
- package/dist/esm/interface/conversations.js.map +1 -1
- package/dist/esm/interface/crud/analytics.d.ts.map +1 -1
- package/dist/esm/interface/crud/analytics.js +1 -1
- package/dist/esm/interface/crud/connected-accounts.d.ts +15 -17
- package/dist/esm/interface/crud/connected-accounts.d.ts.map +1 -1
- package/dist/esm/interface/crud/connected-accounts.js +1 -2
- package/dist/esm/interface/crud/connected-accounts.js.map +1 -1
- package/dist/esm/interface/crud/contact-channels.d.ts +24 -26
- package/dist/esm/interface/crud/contact-channels.d.ts.map +1 -1
- package/dist/esm/interface/crud/contact-channels.js +1 -2
- package/dist/esm/interface/crud/contact-channels.js.map +1 -1
- package/dist/esm/interface/crud/current-user.d.ts +11 -13
- package/dist/esm/interface/crud/current-user.d.ts.map +1 -1
- package/dist/esm/interface/crud/current-user.js +25 -29
- package/dist/esm/interface/crud/current-user.js.map +1 -1
- package/dist/esm/interface/crud/email-outbox.d.ts +10 -12
- package/dist/esm/interface/crud/email-outbox.d.ts.map +1 -1
- package/dist/esm/interface/crud/email-outbox.js +1 -2
- package/dist/esm/interface/crud/email-outbox.js.map +1 -1
- package/dist/esm/interface/crud/email-templates.d.ts +16 -18
- package/dist/esm/interface/crud/email-templates.d.ts.map +1 -1
- package/dist/esm/interface/crud/email-templates.js +1 -2
- package/dist/esm/interface/crud/email-templates.js.map +1 -1
- package/dist/esm/interface/crud/emails.d.ts +6 -8
- package/dist/esm/interface/crud/emails.d.ts.map +1 -1
- package/dist/esm/interface/crud/emails.js +1 -2
- package/dist/esm/interface/crud/emails.js.map +1 -1
- package/dist/esm/interface/crud/internal-api-keys.d.ts +16 -18
- package/dist/esm/interface/crud/internal-api-keys.d.ts.map +1 -1
- package/dist/esm/interface/crud/internal-api-keys.js +1 -2
- package/dist/esm/interface/crud/internal-api-keys.js.map +1 -1
- package/dist/esm/interface/crud/invoices.d.ts.map +1 -1
- package/dist/esm/interface/crud/invoices.js +1 -2
- package/dist/esm/interface/crud/invoices.js.map +1 -1
- package/dist/esm/interface/crud/items.d.ts +6 -8
- package/dist/esm/interface/crud/items.d.ts.map +1 -1
- package/dist/esm/interface/crud/items.js +12 -16
- package/dist/esm/interface/crud/items.js.map +1 -1
- package/dist/esm/interface/crud/notification-preferences.d.ts +6 -8
- package/dist/esm/interface/crud/notification-preferences.d.ts.map +1 -1
- package/dist/esm/interface/crud/notification-preferences.js +8 -12
- package/dist/esm/interface/crud/notification-preferences.js.map +1 -1
- package/dist/esm/interface/crud/oauth-providers.d.ts +24 -26
- package/dist/esm/interface/crud/oauth-providers.d.ts.map +1 -1
- package/dist/esm/interface/crud/oauth-providers.js +1 -2
- package/dist/esm/interface/crud/oauth-providers.js.map +1 -1
- package/dist/esm/interface/crud/products.d.ts +16 -17
- package/dist/esm/interface/crud/products.d.ts.map +1 -1
- package/dist/esm/interface/crud/products.js +3 -2
- package/dist/esm/interface/crud/products.js.map +1 -1
- package/dist/esm/interface/crud/project-api-keys.d.ts +3 -4
- package/dist/esm/interface/crud/project-api-keys.d.ts.map +1 -1
- package/dist/esm/interface/crud/project-api-keys.js +1 -2
- package/dist/esm/interface/crud/project-api-keys.js.map +1 -1
- package/dist/esm/interface/crud/project-permissions.d.ts +29 -31
- package/dist/esm/interface/crud/project-permissions.d.ts.map +1 -1
- package/dist/esm/interface/crud/project-permissions.js +1 -2
- package/dist/esm/interface/crud/project-permissions.js.map +1 -1
- package/dist/esm/interface/crud/projects.d.ts +28 -30
- package/dist/esm/interface/crud/projects.d.ts.map +1 -1
- package/dist/esm/interface/crud/projects.js +3 -2
- package/dist/esm/interface/crud/projects.js.map +1 -1
- package/dist/esm/interface/crud/session-replays.d.ts.map +1 -1
- package/dist/esm/interface/crud/session-replays.js +1 -1
- package/dist/esm/interface/crud/sessions.d.ts +15 -17
- package/dist/esm/interface/crud/sessions.d.ts.map +1 -1
- package/dist/esm/interface/crud/sessions.js +1 -2
- package/dist/esm/interface/crud/sessions.js.map +1 -1
- package/dist/esm/interface/crud/sign-up-rules.d.ts.map +1 -1
- package/dist/esm/interface/crud/sign-up-rules.js +1 -1
- package/dist/esm/interface/crud/svix-token.d.ts +8 -10
- package/dist/esm/interface/crud/svix-token.d.ts.map +1 -1
- package/dist/esm/interface/crud/svix-token.js +1 -2
- package/dist/esm/interface/crud/svix-token.js.map +1 -1
- package/dist/esm/interface/crud/team-invitation-details.d.ts +6 -8
- package/dist/esm/interface/crud/team-invitation-details.d.ts.map +1 -1
- package/dist/esm/interface/crud/team-invitation-details.js +1 -2
- package/dist/esm/interface/crud/team-invitation-details.js.map +1 -1
- package/dist/esm/interface/crud/team-invitation.d.ts +7 -9
- package/dist/esm/interface/crud/team-invitation.d.ts.map +1 -1
- package/dist/esm/interface/crud/team-invitation.js +1 -2
- package/dist/esm/interface/crud/team-invitation.js.map +1 -1
- package/dist/esm/interface/crud/team-member-profiles.d.ts +14 -16
- package/dist/esm/interface/crud/team-member-profiles.d.ts.map +1 -1
- package/dist/esm/interface/crud/team-member-profiles.js +1 -2
- package/dist/esm/interface/crud/team-member-profiles.js.map +1 -1
- package/dist/esm/interface/crud/team-memberships.d.ts +14 -16
- package/dist/esm/interface/crud/team-memberships.d.ts.map +1 -1
- package/dist/esm/interface/crud/team-memberships.js +1 -2
- package/dist/esm/interface/crud/team-memberships.js.map +1 -1
- package/dist/esm/interface/crud/team-permissions.d.ts +29 -31
- package/dist/esm/interface/crud/team-permissions.d.ts.map +1 -1
- package/dist/esm/interface/crud/team-permissions.js +1 -2
- package/dist/esm/interface/crud/team-permissions.js.map +1 -1
- package/dist/esm/interface/crud/teams.d.ts +36 -38
- package/dist/esm/interface/crud/teams.d.ts.map +1 -1
- package/dist/esm/interface/crud/teams.js +2 -4
- package/dist/esm/interface/crud/teams.js.map +1 -1
- package/dist/esm/interface/crud/transactions.d.ts +12 -14
- package/dist/esm/interface/crud/transactions.d.ts.map +1 -1
- package/dist/esm/interface/crud/transactions.js +7 -13
- package/dist/esm/interface/crud/transactions.js.map +1 -1
- package/dist/esm/interface/crud/users.d.ts +5 -6
- package/dist/esm/interface/crud/users.d.ts.map +1 -1
- package/dist/esm/interface/crud/users.js +9 -5
- package/dist/esm/interface/crud/users.js.map +1 -1
- package/dist/esm/interface/handler-urls.d.ts +1 -1
- package/dist/esm/interface/handler-urls.d.ts.map +1 -1
- package/dist/esm/interface/handler-urls.js +1 -2
- package/dist/esm/interface/page-component-versions.d.ts +1 -1
- package/dist/esm/interface/page-component-versions.d.ts.map +1 -1
- package/dist/esm/interface/page-component-versions.js +1 -2
- package/dist/esm/interface/page-component-versions.js.map +1 -1
- package/dist/esm/interface/plan-usage.d.ts +1 -1
- package/dist/esm/interface/plan-usage.d.ts.map +1 -1
- package/dist/esm/interface/plan-usage.js +1 -2
- package/dist/esm/interface/plan-usage.js.map +1 -1
- package/dist/esm/interface/server-interface.d.ts +19 -19
- package/dist/esm/interface/server-interface.d.ts.map +1 -1
- package/dist/esm/interface/server-interface.js +2 -3
- package/dist/esm/interface/server-interface.js.map +1 -1
- package/dist/esm/interface/webhooks.d.ts.map +1 -1
- package/dist/esm/interface/webhooks.js +1 -2
- package/dist/esm/interface/webhooks.js.map +1 -1
- package/dist/esm/known-errors.d.ts +2 -2
- package/dist/esm/known-errors.d.ts.map +1 -1
- package/dist/esm/known-errors.js +10 -21
- package/dist/esm/known-errors.js.map +1 -1
- package/dist/esm/payments/payment-methods.d.ts.map +1 -1
- package/dist/esm/payments/payment-methods.js +1 -1
- package/dist/esm/payments/payment-methods.js.map +1 -1
- package/dist/esm/payments/stripe-limits.d.ts.map +1 -1
- package/dist/esm/payments/stripe-limits.js +1 -1
- package/dist/esm/payments/stripe-limits.js.map +1 -1
- package/dist/esm/plans.d.ts.map +1 -1
- package/dist/esm/plans.js +1 -1
- package/dist/esm/plans.js.map +1 -1
- package/dist/esm/schema-fields.d.ts +3 -3
- package/dist/esm/schema-fields.d.ts.map +1 -1
- package/dist/esm/schema-fields.js +3 -64
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/sessions.d.ts +1 -1
- package/dist/esm/sessions.d.ts.map +1 -1
- package/dist/esm/sessions.js +1 -2
- package/dist/esm/sessions.js.map +1 -1
- package/dist/esm/sessions.test.js +2 -3
- package/dist/esm/sessions.test.js.map +1 -1
- package/dist/esm/utils/analytics-clickmap-overlay.d.ts.map +1 -1
- package/dist/esm/utils/analytics-clickmap-overlay.js +1 -1
- package/dist/esm/utils/api-keys.d.ts.map +1 -1
- package/dist/esm/utils/api-keys.js +1 -2
- package/dist/esm/utils/api-keys.js.map +1 -1
- package/dist/esm/utils/arrays.d.ts.map +1 -1
- package/dist/esm/utils/arrays.js +1 -470
- package/dist/esm/utils/arrays.js.map +1 -1
- package/dist/esm/utils/auth-methods.d.ts.map +1 -1
- package/dist/esm/utils/auth-methods.js +1 -1
- package/dist/esm/utils/auth-methods.js.map +1 -1
- package/dist/esm/utils/base64.d.ts.map +1 -1
- package/dist/esm/utils/base64.js +1 -10
- package/dist/esm/utils/base64.js.map +1 -1
- package/dist/esm/utils/booleans.d.ts.map +1 -1
- package/dist/esm/utils/booleans.js +1 -25
- package/dist/esm/utils/booleans.js.map +1 -1
- package/dist/esm/utils/browser-compat.d.ts.map +1 -1
- package/dist/esm/utils/browser-compat.js +1 -1
- package/dist/esm/utils/browser-compat.js.map +1 -1
- package/dist/esm/utils/bytes.d.ts.map +1 -1
- package/dist/esm/utils/bytes.js +3 -198
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/caches.d.ts +1 -1
- package/dist/esm/utils/caches.d.ts.map +1 -1
- package/dist/esm/utils/caches.js +1 -27
- package/dist/esm/utils/caches.js.map +1 -1
- package/dist/esm/utils/cel-fields.d.ts.map +1 -1
- package/dist/esm/utils/cel-fields.js +1 -2
- package/dist/esm/utils/cel-fields.js.map +1 -1
- package/dist/esm/utils/cloud-hosts.d.ts.map +1 -1
- package/dist/esm/utils/cloud-hosts.js +1 -27
- package/dist/esm/utils/cloud-hosts.js.map +1 -1
- package/dist/esm/utils/compile-time.d.ts.map +1 -1
- package/dist/esm/utils/compile-time.js +1 -1
- package/dist/esm/utils/compile-time.js.map +1 -1
- package/dist/esm/utils/country-codes.d.ts.map +1 -1
- package/dist/esm/utils/country-codes.js +1 -16
- package/dist/esm/utils/country-codes.js.map +1 -1
- package/dist/esm/utils/crypto.d.ts.map +1 -1
- package/dist/esm/utils/crypto.js +3 -113
- package/dist/esm/utils/crypto.js.map +1 -1
- package/dist/esm/utils/currencies.d.ts +1 -1
- package/dist/esm/utils/currencies.d.ts.map +1 -1
- package/dist/esm/utils/currencies.js +2 -37
- package/dist/esm/utils/currencies.js.map +1 -1
- package/dist/esm/utils/currency-constants.d.ts.map +1 -1
- package/dist/esm/utils/currency-constants.js +1 -1
- package/dist/esm/utils/currency-constants.js.map +1 -1
- package/dist/esm/utils/dates.d.ts.map +1 -1
- package/dist/esm/utils/dates.js +1 -44
- package/dist/esm/utils/dates.js.map +1 -1
- package/dist/esm/utils/dev-env-state-path.d.ts.map +1 -1
- package/dist/esm/utils/dev-env-state-path.js +1 -2
- package/dist/esm/utils/dev-env-state-path.js.map +1 -1
- package/dist/esm/utils/dev-tool.d.ts.map +1 -1
- package/dist/esm/utils/dev-tool.js +1 -1
- package/dist/esm/utils/dom.d.ts.map +1 -1
- package/dist/esm/utils/dom.js +1 -1
- package/dist/esm/utils/dom.js.map +1 -1
- package/dist/esm/utils/elements-chain.d.ts.map +1 -1
- package/dist/esm/utils/elements-chain.js +5 -50
- package/dist/esm/utils/elements-chain.js.map +1 -1
- package/dist/esm/utils/env.d.ts.map +1 -1
- package/dist/esm/utils/env.js +1 -2
- package/dist/esm/utils/env.js.map +1 -1
- package/dist/esm/utils/env.test.js +2 -3
- package/dist/esm/utils/env.test.js.map +1 -1
- package/dist/esm/utils/errors.d.ts +1 -1
- package/dist/esm/utils/errors.d.ts.map +1 -1
- package/dist/esm/utils/errors.js +1 -2
- package/dist/esm/utils/errors.js.map +1 -1
- package/dist/esm/utils/esbuild.d.ts +1 -1
- package/dist/esm/utils/esbuild.d.ts.map +1 -1
- package/dist/esm/utils/esbuild.js +2 -3
- package/dist/esm/utils/esbuild.js.map +1 -1
- package/dist/esm/utils/featurebase.d.ts.map +1 -1
- package/dist/esm/utils/featurebase.js +1 -2
- package/dist/esm/utils/featurebase.js.map +1 -1
- package/dist/esm/utils/fs.d.ts.map +1 -1
- package/dist/esm/utils/fs.js +1 -2
- package/dist/esm/utils/fs.js.map +1 -1
- package/dist/esm/utils/functions.d.ts.map +1 -1
- package/dist/esm/utils/functions.js +1 -24
- package/dist/esm/utils/functions.js.map +1 -1
- package/dist/esm/utils/geo.d.ts.map +1 -1
- package/dist/esm/utils/geo.js +1 -2
- package/dist/esm/utils/geo.js.map +1 -1
- package/dist/esm/utils/globals.d.ts.map +1 -1
- package/dist/esm/utils/globals.js +1 -1
- package/dist/esm/utils/globals.js.map +1 -1
- package/dist/esm/utils/hashes.d.ts.map +1 -1
- package/dist/esm/utils/hashes.js +1 -2
- package/dist/esm/utils/hashes.js.map +1 -1
- package/dist/esm/utils/html.d.ts.map +1 -1
- package/dist/esm/utils/html.js +1 -19
- package/dist/esm/utils/html.js.map +1 -1
- package/dist/esm/utils/http.d.ts.map +1 -1
- package/dist/esm/utils/http.js +1 -19
- package/dist/esm/utils/http.js.map +1 -1
- package/dist/esm/utils/ips.d.ts.map +1 -1
- package/dist/esm/utils/ips.js +1 -25
- package/dist/esm/utils/ips.js.map +1 -1
- package/dist/esm/utils/json.d.ts +1 -1
- package/dist/esm/utils/json.d.ts.map +1 -1
- package/dist/esm/utils/json.js +1 -155
- package/dist/esm/utils/json.js.map +1 -1
- package/dist/esm/utils/jsx-editable-transpiler.d.ts.map +1 -1
- package/dist/esm/utils/jsx-editable-transpiler.js +1 -2
- package/dist/esm/utils/jsx-editable-transpiler.js.map +1 -1
- package/dist/esm/utils/jsx-editable-transpiler.test.js +2 -3
- package/dist/esm/utils/jsx-editable-transpiler.test.js.map +1 -1
- package/dist/esm/utils/jwt.d.ts.map +1 -1
- package/dist/esm/utils/jwt.js +1 -2
- package/dist/esm/utils/jwt.js.map +1 -1
- package/dist/esm/utils/locks.d.ts.map +1 -1
- package/dist/esm/utils/locks.js +1 -2
- package/dist/esm/utils/locks.js.map +1 -1
- package/dist/esm/utils/maps.d.ts.map +1 -1
- package/dist/esm/utils/maps.js +1 -111
- package/dist/esm/utils/maps.js.map +1 -1
- package/dist/esm/utils/math.d.ts.map +1 -1
- package/dist/esm/utils/math.js +1 -11
- package/dist/esm/utils/math.js.map +1 -1
- package/dist/esm/utils/monkey-patch.d.ts.map +1 -1
- package/dist/esm/utils/monkey-patch.js +2 -3
- package/dist/esm/utils/monkey-patch.js.map +1 -1
- package/dist/esm/utils/node-http.js +1 -2
- package/dist/esm/utils/node-http.js.map +1 -1
- package/dist/esm/utils/numbers.d.ts.map +1 -1
- package/dist/esm/utils/numbers.js +1 -45
- package/dist/esm/utils/numbers.js.map +1 -1
- package/dist/esm/utils/oauth.d.ts.map +1 -1
- package/dist/esm/utils/oauth.js +1 -1
- package/dist/esm/utils/oauth.js.map +1 -1
- package/dist/esm/utils/objects.d.ts.map +1 -1
- package/dist/esm/utils/objects.js +1 -622
- package/dist/esm/utils/objects.js.map +1 -1
- package/dist/esm/utils/paginated-lists.d.ts.map +1 -1
- package/dist/esm/utils/paginated-lists.js +1 -2
- package/dist/esm/utils/paginated-lists.js.map +1 -1
- package/dist/esm/utils/paginated-lists.test.js +2 -3
- package/dist/esm/utils/paginated-lists.test.js.map +1 -1
- package/dist/esm/utils/passkey.d.ts +1 -1
- package/dist/esm/utils/passkey.js +1 -1
- package/dist/esm/utils/promises.d.ts +1 -1
- package/dist/esm/utils/promises.d.ts.map +1 -1
- package/dist/esm/utils/promises.js +2 -161
- package/dist/esm/utils/promises.js.map +1 -1
- package/dist/esm/utils/proxies.d.ts.map +1 -1
- package/dist/esm/utils/proxies.js +1 -37
- package/dist/esm/utils/proxies.js.map +1 -1
- package/dist/esm/utils/react.d.ts.map +1 -1
- package/dist/esm/utils/react.js +1 -41
- package/dist/esm/utils/react.js.map +1 -1
- package/dist/esm/utils/redirect-urls.d.ts.map +1 -1
- package/dist/esm/utils/redirect-urls.js +2 -92
- package/dist/esm/utils/redirect-urls.js.map +1 -1
- package/dist/esm/utils/regex.js +1 -1
- package/dist/esm/utils/regex.js.map +1 -1
- package/dist/esm/utils/results.d.ts.map +1 -1
- package/dist/esm/utils/results.js +1 -213
- package/dist/esm/utils/results.js.map +1 -1
- package/dist/esm/utils/sentry.js +1 -1
- package/dist/esm/utils/sentry.js.map +1 -1
- package/dist/esm/utils/stores.d.ts +3 -3
- package/dist/esm/utils/stores.d.ts.map +1 -1
- package/dist/esm/utils/stores.js +1 -2
- package/dist/esm/utils/stores.js.map +1 -1
- package/dist/esm/utils/strings.d.ts.map +1 -1
- package/dist/esm/utils/strings.js +1 -251
- package/dist/esm/utils/strings.js.map +1 -1
- package/dist/esm/utils/strings.nicify.test.js +2 -3
- package/dist/esm/utils/strings.nicify.test.js.map +1 -1
- package/dist/esm/utils/telemetry.d.ts.map +1 -1
- package/dist/esm/utils/telemetry.js +1 -2
- package/dist/esm/utils/telemetry.js.map +1 -1
- package/dist/esm/utils/turnstile-browser.d.ts +1 -1
- package/dist/esm/utils/turnstile-browser.d.ts.map +1 -1
- package/dist/esm/utils/turnstile-browser.js +1 -2
- package/dist/esm/utils/turnstile-browser.js.map +1 -1
- package/dist/esm/utils/turnstile-flow.d.ts +1 -1
- package/dist/esm/utils/turnstile-flow.d.ts.map +1 -1
- package/dist/esm/utils/turnstile-flow.js +1 -2
- package/dist/esm/utils/turnstile-flow.js.map +1 -1
- package/dist/esm/utils/turnstile-flow.test.js +2 -3
- package/dist/esm/utils/turnstile-flow.test.js.map +1 -1
- package/dist/esm/utils/turnstile.d.ts.map +1 -1
- package/dist/esm/utils/turnstile.js +1 -1
- package/dist/esm/utils/turnstile.js.map +1 -1
- package/dist/esm/utils/typed-arrays.js +1 -2
- package/dist/esm/utils/typed-arrays.js.map +1 -1
- package/dist/esm/utils/types.d.ts +1 -1
- package/dist/esm/utils/types.d.ts.map +1 -1
- package/dist/esm/utils/types.js +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/unicode.d.ts.map +1 -1
- package/dist/esm/utils/unicode.js +1 -13
- package/dist/esm/utils/unicode.js.map +1 -1
- package/dist/esm/utils/urls.d.ts.map +1 -1
- package/dist/esm/utils/urls.js +1 -151
- package/dist/esm/utils/urls.js.map +1 -1
- package/dist/esm/utils/uuids.d.ts.map +1 -1
- package/dist/esm/utils/uuids.js +2 -26
- package/dist/esm/utils/uuids.js.map +1 -1
- package/dist/format-4JG1MGv5.d.ts +61 -0
- package/dist/format-4JG1MGv5.d.ts.map +1 -0
- package/dist/handler-urls-BHt3v8Ai.d.ts +70 -0
- package/dist/handler-urls-BHt3v8Ai.d.ts.map +1 -0
- package/dist/helpers/emails.js +2 -4
- package/dist/helpers/emails.js.map +1 -1
- package/dist/helpers/init-prompt.d.ts.map +1 -1
- package/dist/helpers/init-prompt.js +2 -4
- package/dist/helpers/init-prompt.js.map +1 -1
- package/dist/helpers/password.d.ts +1 -1
- package/dist/helpers/password.d.ts.map +1 -1
- package/dist/helpers/password.js +2 -4
- package/dist/helpers/password.js.map +1 -1
- package/dist/helpers/production-mode.d.ts +1 -1
- package/dist/helpers/production-mode.d.ts.map +1 -1
- package/dist/helpers/production-mode.js +2 -4
- package/dist/helpers/production-mode.js.map +1 -1
- package/dist/helpers/support-sla.d.ts.map +1 -1
- package/dist/helpers/support-sla.js +2 -3
- package/dist/helpers/support-sla.js.map +1 -1
- package/dist/helpers/support-sla.test.js +1 -3
- package/dist/helpers/support-sla.test.js.map +1 -1
- package/dist/helpers/vault/client-side.d.ts.map +1 -1
- package/dist/helpers/vault/client-side.js +2 -22
- package/dist/helpers/vault/client-side.js.map +1 -1
- package/dist/helpers/vault/server-side.js +2 -4
- package/dist/helpers/vault/server-side.js.map +1 -1
- package/dist/hooks/use-async-callback.d.ts.map +1 -1
- package/dist/hooks/use-async-callback.js +4 -5
- package/dist/hooks/use-async-callback.js.map +1 -1
- package/dist/hooks/use-async-external-store.d.ts +1 -1
- package/dist/hooks/use-async-external-store.d.ts.map +1 -1
- package/dist/hooks/use-async-external-store.js +2 -4
- package/dist/hooks/use-async-external-store.js.map +1 -1
- package/dist/hooks/use-hash.js +2 -4
- package/dist/hooks/use-hash.js.map +1 -1
- package/dist/hooks/use-hover.d.ts.map +1 -1
- package/dist/hooks/use-hover.js +2 -4
- package/dist/hooks/use-hover.js.map +1 -1
- package/dist/hooks/use-strict-memo.d.ts.map +1 -1
- package/dist/hooks/use-strict-memo.js +2 -72
- package/dist/hooks/use-strict-memo.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +27 -29
- package/dist/interface/admin-interface.d.ts +3 -379
- package/dist/interface/admin-interface.js +3 -5
- package/dist/interface/admin-interface.js.map +1 -1
- package/dist/interface/admin-metrics.d.ts +2 -807
- package/dist/interface/admin-metrics.js +2 -4
- package/dist/interface/admin-metrics.js.map +1 -1
- package/dist/interface/client-interface.d.ts +2 -447
- package/dist/interface/client-interface.js +33 -18
- package/dist/interface/client-interface.js.map +1 -1
- package/dist/interface/client-interface.test.js +83 -13
- package/dist/interface/client-interface.test.js.map +1 -1
- package/dist/interface/conversations.d.ts +11 -11
- package/dist/interface/conversations.d.ts.map +1 -1
- package/dist/interface/conversations.js +2 -4
- package/dist/interface/conversations.js.map +1 -1
- package/dist/interface/crud/analytics.d.ts +2 -14
- package/dist/interface/crud/connected-accounts.d.ts +2 -68
- package/dist/interface/crud/connected-accounts.js +2 -4
- package/dist/interface/crud/connected-accounts.js.map +1 -1
- package/dist/interface/crud/contact-channels.d.ts +2 -181
- package/dist/interface/crud/contact-channels.js +2 -4
- package/dist/interface/crud/contact-channels.js.map +1 -1
- package/dist/interface/crud/current-user.d.ts +2 -285
- package/dist/interface/crud/current-user.js +2 -4
- package/dist/interface/crud/current-user.js.map +1 -1
- package/dist/interface/crud/email-outbox.d.ts +2 -1465
- package/dist/interface/crud/email-outbox.js +4 -5
- package/dist/interface/crud/email-outbox.js.map +1 -1
- package/dist/interface/crud/email-templates.d.ts +15 -16
- package/dist/interface/crud/email-templates.d.ts.map +1 -1
- package/dist/interface/crud/email-templates.js +2 -4
- package/dist/interface/crud/email-templates.js.map +1 -1
- package/dist/interface/crud/emails.d.ts +2 -41
- package/dist/interface/crud/emails.js +4 -5
- package/dist/interface/crud/emails.js.map +1 -1
- package/dist/interface/crud/internal-api-keys.d.ts +2 -140
- package/dist/interface/crud/internal-api-keys.js +2 -4
- package/dist/interface/crud/internal-api-keys.js.map +1 -1
- package/dist/interface/crud/invoices.d.ts +2 -43
- package/dist/interface/crud/invoices.js +2 -4
- package/dist/interface/crud/invoices.js.map +1 -1
- package/dist/interface/crud/items.d.ts +2 -30
- package/dist/interface/crud/items.js +2 -4
- package/dist/interface/crud/items.js.map +1 -1
- package/dist/interface/crud/notification-preferences.d.ts +2 -38
- package/dist/interface/crud/notification-preferences.js +2 -4
- package/dist/interface/crud/notification-preferences.js.map +1 -1
- package/dist/interface/crud/oauth-providers.d.ts +2 -186
- package/dist/interface/crud/oauth-providers.js +2 -4
- package/dist/interface/crud/oauth-providers.js.map +1 -1
- package/dist/interface/crud/products.d.ts +2 -182
- package/dist/interface/crud/products.js +4 -4
- package/dist/interface/crud/products.js.map +1 -1
- package/dist/interface/crud/project-api-keys.d.ts +2 -203
- package/dist/interface/crud/project-api-keys.js +2 -4
- package/dist/interface/crud/project-api-keys.js.map +1 -1
- package/dist/interface/crud/project-permissions.d.ts +2 -161
- package/dist/interface/crud/project-permissions.js +4 -5
- package/dist/interface/crud/project-permissions.js.map +1 -1
- package/dist/interface/crud/projects.d.ts +2 -901
- package/dist/interface/crud/projects.js +6 -5
- package/dist/interface/crud/projects.js.map +1 -1
- package/dist/interface/crud/session-replays.d.ts +2 -83
- package/dist/interface/crud/sessions.d.ts +2 -150
- package/dist/interface/crud/sessions.js +2 -4
- package/dist/interface/crud/sessions.js.map +1 -1
- package/dist/interface/crud/sign-up-rules.d.ts.map +1 -1
- package/dist/interface/crud/svix-token.d.ts +2 -31
- package/dist/interface/crud/svix-token.js +2 -4
- package/dist/interface/crud/svix-token.js.map +1 -1
- package/dist/interface/crud/team-invitation-details.d.ts +5 -6
- package/dist/interface/crud/team-invitation-details.d.ts.map +1 -1
- package/dist/interface/crud/team-invitation-details.js +4 -5
- package/dist/interface/crud/team-invitation-details.js.map +1 -1
- package/dist/interface/crud/team-invitation.d.ts +2 -54
- package/dist/interface/crud/team-invitation.js +4 -5
- package/dist/interface/crud/team-invitation.js.map +1 -1
- package/dist/interface/crud/team-member-profiles.d.ts +2 -286
- package/dist/interface/crud/team-member-profiles.js +4 -5
- package/dist/interface/crud/team-member-profiles.js.map +1 -1
- package/dist/interface/crud/team-memberships.d.ts +2 -75
- package/dist/interface/crud/team-memberships.js +2 -4
- package/dist/interface/crud/team-memberships.js.map +1 -1
- package/dist/interface/crud/team-permissions.d.ts +2 -169
- package/dist/interface/crud/team-permissions.js +4 -5
- package/dist/interface/crud/team-permissions.js.map +1 -1
- package/dist/interface/crud/teams.d.ts +2 -299
- package/dist/interface/crud/teams.js +5 -7
- package/dist/interface/crud/teams.js.map +1 -1
- package/dist/interface/crud/transactions.d.ts +2 -183
- package/dist/interface/crud/transactions.js +2 -4
- package/dist/interface/crud/transactions.js.map +1 -1
- package/dist/interface/crud/users.d.ts +2 -653
- package/dist/interface/crud/users.js +12 -8
- package/dist/interface/crud/users.js.map +1 -1
- package/dist/interface/handler-urls.d.ts +2 -51
- package/dist/interface/handler-urls.js +12 -14
- package/dist/interface/page-component-versions.d.ts +2 -25
- package/dist/interface/page-component-versions.js +2 -4
- package/dist/interface/page-component-versions.js.map +1 -1
- package/dist/interface/plan-usage.d.ts +2 -57
- package/dist/interface/plan-usage.js +2 -4
- package/dist/interface/plan-usage.js.map +1 -1
- package/dist/interface/server-interface.d.ts +2 -257
- package/dist/interface/server-interface.js +3 -5
- package/dist/interface/server-interface.js.map +1 -1
- package/dist/interface/webhooks.d.ts +2 -326
- package/dist/interface/webhooks.js +2 -4
- package/dist/interface/webhooks.js.map +1 -1
- package/dist/internal-api-keys-D8IYDodH.d.ts +139 -0
- package/dist/internal-api-keys-D8IYDodH.d.ts.map +1 -0
- package/dist/invoices-CHo9YKbI.d.ts +43 -0
- package/dist/invoices-CHo9YKbI.d.ts.map +1 -0
- package/dist/items-DlLSlVUD.d.ts +29 -0
- package/dist/items-DlLSlVUD.d.ts.map +1 -0
- package/dist/json-a1QIXu5z.d.ts +15 -0
- package/dist/json-a1QIXu5z.d.ts.map +1 -0
- package/dist/known-errors-Bm4a61wL.d.ts +575 -0
- package/dist/known-errors-Bm4a61wL.d.ts.map +1 -0
- package/dist/known-errors.d.ts +2 -575
- package/dist/known-errors.js +11 -23
- package/dist/known-errors.js.map +1 -1
- package/dist/notification-preferences-Bmzr_EOY.d.ts +37 -0
- package/dist/notification-preferences-Bmzr_EOY.d.ts.map +1 -0
- package/dist/oauth-providers-BMkKSSlA.d.ts +185 -0
- package/dist/oauth-providers-BMkKSSlA.d.ts.map +1 -0
- package/dist/objects-DkCkeBWE.d.ts +59 -0
- package/dist/objects-DkCkeBWE.d.ts.map +1 -0
- package/dist/passkey-CKg87UH-.d.ts +2 -0
- package/dist/payments/payment-methods.d.ts.map +1 -1
- package/dist/payments/payment-methods.js +2 -3
- package/dist/payments/payment-methods.js.map +1 -1
- package/dist/payments/stripe-limits.d.ts.map +1 -1
- package/dist/payments/stripe-limits.js +2 -3
- package/dist/payments/stripe-limits.js.map +1 -1
- package/dist/plan-usage-DfDoj5K4.d.ts +57 -0
- package/dist/plan-usage-DfDoj5K4.d.ts.map +1 -0
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +2 -3
- package/dist/plans.js.map +1 -1
- package/dist/products-Bs74ld-v.d.ts +182 -0
- package/dist/products-Bs74ld-v.d.ts.map +1 -0
- package/dist/project-api-keys--7V5X_UW.d.ts +203 -0
- package/dist/project-api-keys--7V5X_UW.d.ts.map +1 -0
- package/dist/project-permissions-kdi675F-.d.ts +160 -0
- package/dist/project-permissions-kdi675F-.d.ts.map +1 -0
- package/dist/projects-CFTNXRfG.d.ts +900 -0
- package/dist/projects-CFTNXRfG.d.ts.map +1 -0
- package/dist/results-DP3BzoL6.d.ts +70 -0
- package/dist/results-DP3BzoL6.d.ts.map +1 -0
- package/dist/{chunk-BE-pF4vm.js → rolldown-runtime-D6vf50IK.js} +12 -18
- package/dist/schema-CJwkGkdf.d.ts +2328 -0
- package/dist/schema-CJwkGkdf.d.ts.map +1 -0
- package/dist/schema-fields-DqGQ4kF7.d.ts +517 -0
- package/dist/schema-fields-DqGQ4kF7.d.ts.map +1 -0
- package/dist/schema-fields.d.ts +3 -518
- package/dist/schema-fields.js +21 -82
- package/dist/schema-fields.js.map +1 -1
- package/dist/server-interface-CgpxsLT_.d.ts +257 -0
- package/dist/server-interface-CgpxsLT_.d.ts.map +1 -0
- package/dist/session-replays-CXqhDpZq.d.ts +83 -0
- package/dist/session-replays-CXqhDpZq.d.ts.map +1 -0
- package/dist/sessions-B7Ko2Ldr.d.ts +149 -0
- package/dist/sessions-B7Ko2Ldr.d.ts.map +1 -0
- package/dist/sessions-d8qtvBUB.d.ts +175 -0
- package/dist/sessions-d8qtvBUB.d.ts.map +1 -0
- package/dist/sessions.d.ts +2 -175
- package/dist/sessions.js +4 -5
- package/dist/sessions.js.map +1 -1
- package/dist/sessions.test.js +1 -3
- package/dist/sessions.test.js.map +1 -1
- package/dist/strings-DWgkUybS.d.ts +76 -0
- package/dist/strings-DWgkUybS.d.ts.map +1 -0
- package/dist/svix-token-BsMrLGvy.d.ts +30 -0
- package/dist/svix-token-BsMrLGvy.d.ts.map +1 -0
- package/dist/team-invitation-Cyqt9oWw.d.ts +53 -0
- package/dist/team-invitation-Cyqt9oWw.d.ts.map +1 -0
- package/dist/team-member-profiles-BoDEqx-0.d.ts +285 -0
- package/dist/team-member-profiles-BoDEqx-0.d.ts.map +1 -0
- package/dist/team-memberships-DZHk2A5b.d.ts +74 -0
- package/dist/team-memberships-DZHk2A5b.d.ts.map +1 -0
- package/dist/team-permissions-DqOpaOWh.d.ts +168 -0
- package/dist/team-permissions-DqOpaOWh.d.ts.map +1 -0
- package/dist/teams-CQMcBnjM.d.ts +298 -0
- package/dist/teams-CQMcBnjM.d.ts.map +1 -0
- package/dist/transactions-DhnbvGH5.d.ts +182 -0
- package/dist/transactions-DhnbvGH5.d.ts.map +1 -0
- package/dist/types-DfTcxNtM.d.ts +77 -0
- package/dist/types-DfTcxNtM.d.ts.map +1 -0
- package/dist/users-DHNRwoSz.d.ts +653 -0
- package/dist/users-DHNRwoSz.d.ts.map +1 -0
- package/dist/utils/analytics-clickmap-overlay.d.ts.map +1 -1
- package/dist/utils/analytics-clickmap-overlay.js +2 -3
- package/dist/utils/analytics-clickmap-overlay.js.map +1 -1
- package/dist/utils/api-keys.d.ts.map +1 -1
- package/dist/utils/api-keys.js +4 -5
- package/dist/utils/api-keys.js.map +1 -1
- package/dist/utils/arrays.d.ts.map +1 -1
- package/dist/utils/arrays.js +2 -472
- package/dist/utils/arrays.js.map +1 -1
- package/dist/utils/auth-methods.d.ts.map +1 -1
- package/dist/utils/auth-methods.js +2 -3
- package/dist/utils/auth-methods.js.map +1 -1
- package/dist/utils/base64.d.ts.map +1 -1
- package/dist/utils/base64.js +2 -12
- package/dist/utils/base64.js.map +1 -1
- package/dist/utils/booleans.d.ts.map +1 -1
- package/dist/utils/booleans.js +2 -27
- package/dist/utils/booleans.js.map +1 -1
- package/dist/utils/browser-compat.d.ts.map +1 -1
- package/dist/utils/browser-compat.js +2 -3
- package/dist/utils/browser-compat.js.map +1 -1
- package/dist/utils/bytes.d.ts.map +1 -1
- package/dist/utils/bytes.js +4 -200
- package/dist/utils/bytes.js.map +1 -1
- package/dist/utils/caches.d.ts.map +1 -1
- package/dist/utils/caches.js +2 -29
- package/dist/utils/caches.js.map +1 -1
- package/dist/utils/cel-fields.d.ts.map +1 -1
- package/dist/utils/cel-fields.js +2 -4
- package/dist/utils/cel-fields.js.map +1 -1
- package/dist/utils/cloud-hosts.d.ts.map +1 -1
- package/dist/utils/cloud-hosts.js +2 -29
- package/dist/utils/cloud-hosts.js.map +1 -1
- package/dist/utils/compile-time.d.ts.map +1 -1
- package/dist/utils/compile-time.js +2 -3
- package/dist/utils/compile-time.js.map +1 -1
- package/dist/utils/country-codes.d.ts +2 -11
- package/dist/utils/country-codes.js +2 -18
- package/dist/utils/country-codes.js.map +1 -1
- package/dist/utils/crypto.d.ts.map +1 -1
- package/dist/utils/crypto.js +4 -115
- package/dist/utils/crypto.js.map +1 -1
- package/dist/utils/currencies.d.ts +1 -1
- package/dist/utils/currencies.d.ts.map +1 -1
- package/dist/utils/currencies.js +3 -39
- package/dist/utils/currencies.js.map +1 -1
- package/dist/utils/currency-constants.d.ts +2 -45
- package/dist/utils/currency-constants.js +2 -3
- package/dist/utils/currency-constants.js.map +1 -1
- package/dist/utils/dates.d.ts +2 -23
- package/dist/utils/dates.js +2 -46
- package/dist/utils/dates.js.map +1 -1
- package/dist/utils/dev-env-state-path.d.ts.map +1 -1
- package/dist/utils/dev-env-state-path.js +2 -4
- package/dist/utils/dev-env-state-path.js.map +1 -1
- package/dist/utils/dev-tool.d.ts.map +1 -1
- package/dist/utils/dev-tool.js +2 -3
- package/dist/utils/dev-tool.js.map +1 -1
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/dom.js +2 -3
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/elements-chain.d.ts.map +1 -1
- package/dist/utils/elements-chain.js +6 -52
- package/dist/utils/elements-chain.js.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +2 -4
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/env.test.js +1 -3
- package/dist/utils/env.test.js.map +1 -1
- package/dist/utils/errors.d.ts +2 -238
- package/dist/utils/errors.js +2 -4
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/esbuild.d.ts +1 -1
- package/dist/utils/esbuild.d.ts.map +1 -1
- package/dist/utils/esbuild.js +5 -6
- package/dist/utils/esbuild.js.map +1 -1
- package/dist/utils/featurebase.d.ts.map +1 -1
- package/dist/utils/featurebase.js +2 -4
- package/dist/utils/featurebase.js.map +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +5 -6
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/functions.d.ts.map +1 -1
- package/dist/utils/functions.js +2 -26
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/geo.d.ts.map +1 -1
- package/dist/utils/geo.js +2 -4
- package/dist/utils/geo.js.map +1 -1
- package/dist/utils/globals.d.ts.map +1 -1
- package/dist/utils/globals.js +2 -3
- package/dist/utils/globals.js.map +1 -1
- package/dist/utils/hashes.d.ts.map +1 -1
- package/dist/utils/hashes.js +4 -5
- package/dist/utils/hashes.js.map +1 -1
- package/dist/utils/html.d.ts.map +1 -1
- package/dist/utils/html.js +2 -21
- package/dist/utils/html.js.map +1 -1
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/http.js +2 -21
- package/dist/utils/http.js.map +1 -1
- package/dist/utils/ips.d.ts.map +1 -1
- package/dist/utils/ips.js +4 -28
- package/dist/utils/ips.js.map +1 -1
- package/dist/utils/json.d.ts +2 -15
- package/dist/utils/json.js +2 -157
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/jsx-editable-transpiler.d.ts.map +1 -1
- package/dist/utils/jsx-editable-transpiler.js +7 -8
- package/dist/utils/jsx-editable-transpiler.js.map +1 -1
- package/dist/utils/jsx-editable-transpiler.test.js +1 -3
- package/dist/utils/jsx-editable-transpiler.test.js.map +1 -1
- package/dist/utils/jwt.d.ts.map +1 -1
- package/dist/utils/jwt.js +6 -7
- package/dist/utils/jwt.js.map +1 -1
- package/dist/utils/locks.d.ts.map +1 -1
- package/dist/utils/locks.js +2 -4
- package/dist/utils/locks.js.map +1 -1
- package/dist/utils/maps.d.ts.map +1 -1
- package/dist/utils/maps.js +2 -113
- package/dist/utils/maps.js.map +1 -1
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/math.js +2 -13
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/monkey-patch.d.ts.map +1 -1
- package/dist/utils/monkey-patch.js +3 -5
- package/dist/utils/monkey-patch.js.map +1 -1
- package/dist/utils/node-http.js +2 -4
- package/dist/utils/node-http.js.map +1 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/numbers.js +2 -47
- package/dist/utils/numbers.js.map +1 -1
- package/dist/utils/oauth.d.ts.map +1 -1
- package/dist/utils/oauth.js +2 -3
- package/dist/utils/oauth.js.map +1 -1
- package/dist/utils/objects.d.ts +2 -59
- package/dist/utils/objects.js +2 -624
- package/dist/utils/objects.js.map +1 -1
- package/dist/utils/paginated-lists.d.ts.map +1 -1
- package/dist/utils/paginated-lists.js +2 -4
- package/dist/utils/paginated-lists.js.map +1 -1
- package/dist/utils/paginated-lists.test.js +1 -3
- package/dist/utils/paginated-lists.test.js.map +1 -1
- package/dist/utils/passkey.d.ts +2 -2
- package/dist/utils/promises.d.ts +1 -1
- package/dist/utils/promises.d.ts.map +1 -1
- package/dist/utils/promises.js +3 -163
- package/dist/utils/promises.js.map +1 -1
- package/dist/utils/proxies.d.ts.map +1 -1
- package/dist/utils/proxies.js +2 -39
- package/dist/utils/proxies.js.map +1 -1
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/react.js +4 -44
- package/dist/utils/react.js.map +1 -1
- package/dist/utils/redirect-urls.d.ts.map +1 -1
- package/dist/utils/redirect-urls.js +3 -94
- package/dist/utils/redirect-urls.js.map +1 -1
- package/dist/utils/regex.js +2 -3
- package/dist/utils/regex.js.map +1 -1
- package/dist/utils/results.d.ts +2 -70
- package/dist/utils/results.js +2 -215
- package/dist/utils/results.js.map +1 -1
- package/dist/utils/sentry.js +2 -3
- package/dist/utils/sentry.js.map +1 -1
- package/dist/utils/stores.d.ts +1 -1
- package/dist/utils/stores.d.ts.map +1 -1
- package/dist/utils/stores.js +2 -4
- package/dist/utils/stores.js.map +1 -1
- package/dist/utils/strings.d.ts +2 -76
- package/dist/utils/strings.js +2 -253
- package/dist/utils/strings.js.map +1 -1
- package/dist/utils/strings.nicify.test.js +1 -3
- package/dist/utils/strings.nicify.test.js.map +1 -1
- package/dist/utils/telemetry.d.ts.map +1 -1
- package/dist/utils/telemetry.js +2 -4
- package/dist/utils/telemetry.js.map +1 -1
- package/dist/utils/turnstile-browser.d.ts.map +1 -1
- package/dist/utils/turnstile-browser.js +2 -4
- package/dist/utils/turnstile-browser.js.map +1 -1
- package/dist/utils/turnstile-flow.d.ts.map +1 -1
- package/dist/utils/turnstile-flow.js +2 -4
- package/dist/utils/turnstile-flow.js.map +1 -1
- package/dist/utils/turnstile-flow.test.js +1 -3
- package/dist/utils/turnstile-flow.test.js.map +1 -1
- package/dist/utils/turnstile.d.ts.map +1 -1
- package/dist/utils/turnstile.js +2 -3
- package/dist/utils/turnstile.js.map +1 -1
- package/dist/utils/typed-arrays.js +2 -4
- package/dist/utils/typed-arrays.js.map +1 -1
- package/dist/utils/types.d.ts +2 -77
- package/dist/utils/types.js +2 -3
- package/dist/utils/types.js.map +1 -1
- package/dist/utils/unicode.d.ts.map +1 -1
- package/dist/utils/unicode.js +2 -15
- package/dist/utils/unicode.js.map +1 -1
- package/dist/utils/urls.d.ts.map +1 -1
- package/dist/utils/urls.js +2 -153
- package/dist/utils/urls.js.map +1 -1
- package/dist/utils/uuids.d.ts.map +1 -1
- package/dist/utils/uuids.js +3 -28
- package/dist/utils/uuids.js.map +1 -1
- package/dist/webhooks-8Ts1Clcb.d.ts +326 -0
- package/dist/webhooks-8Ts1Clcb.d.ts.map +1 -0
- package/package.json +2 -8
- package/src/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.ts +1 -0
- package/src/interface/client-interface.test.ts +77 -12
- package/src/interface/client-interface.ts +9 -9
- package/dist/config/format.d.ts.map +0 -1
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/crud.d.ts.map +0 -1
- package/dist/interface/admin-interface.d.ts.map +0 -1
- package/dist/interface/admin-metrics.d.ts.map +0 -1
- package/dist/interface/client-interface.d.ts.map +0 -1
- package/dist/interface/crud/analytics.d.ts.map +0 -1
- package/dist/interface/crud/connected-accounts.d.ts.map +0 -1
- package/dist/interface/crud/contact-channels.d.ts.map +0 -1
- package/dist/interface/crud/current-user.d.ts.map +0 -1
- package/dist/interface/crud/emails.d.ts.map +0 -1
- package/dist/interface/crud/internal-api-keys.d.ts.map +0 -1
- package/dist/interface/crud/invoices.d.ts.map +0 -1
- package/dist/interface/crud/items.d.ts.map +0 -1
- package/dist/interface/crud/notification-preferences.d.ts.map +0 -1
- package/dist/interface/crud/oauth-providers.d.ts.map +0 -1
- package/dist/interface/crud/products.d.ts.map +0 -1
- package/dist/interface/crud/project-api-keys.d.ts.map +0 -1
- package/dist/interface/crud/project-permissions.d.ts.map +0 -1
- package/dist/interface/crud/projects.d.ts.map +0 -1
- package/dist/interface/crud/session-replays.d.ts.map +0 -1
- package/dist/interface/crud/sessions.d.ts.map +0 -1
- package/dist/interface/crud/svix-token.d.ts.map +0 -1
- package/dist/interface/crud/team-invitation.d.ts.map +0 -1
- package/dist/interface/crud/team-member-profiles.d.ts.map +0 -1
- package/dist/interface/crud/team-memberships.d.ts.map +0 -1
- package/dist/interface/crud/team-permissions.d.ts.map +0 -1
- package/dist/interface/crud/teams.d.ts.map +0 -1
- package/dist/interface/crud/transactions.d.ts.map +0 -1
- package/dist/interface/crud/users.d.ts.map +0 -1
- package/dist/interface/handler-urls.d.ts.map +0 -1
- package/dist/interface/page-component-versions.d.ts.map +0 -1
- package/dist/interface/plan-usage.d.ts.map +0 -1
- package/dist/interface/server-interface.d.ts.map +0 -1
- package/dist/interface/webhooks.d.ts.map +0 -1
- package/dist/known-errors.d.ts.map +0 -1
- package/dist/schema-fields.d.ts.map +0 -1
- package/dist/sessions.d.ts.map +0 -1
- package/dist/utils/country-codes.d.ts.map +0 -1
- package/dist/utils/currency-constants.d.ts.map +0 -1
- package/dist/utils/dates.d.ts.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/objects.d.ts.map +0 -1
- package/dist/utils/results.d.ts.map +0 -1
- package/dist/utils/strings.d.ts.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
package/dist/esm/utils/urls.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { generateSecureRandomString } from "./crypto.js";
|
|
2
2
|
import { templateIdentity } from "./strings.js";
|
|
3
|
-
|
|
4
3
|
//#region src/utils/urls.tsx
|
|
5
4
|
function createUrlIfValid(...args) {
|
|
6
5
|
try {
|
|
@@ -9,41 +8,15 @@ function createUrlIfValid(...args) {
|
|
|
9
8
|
return null;
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
(void 0)?.test("createUrlIfValid", ({ expect }) => {
|
|
13
|
-
expect(createUrlIfValid("https://example.com")).toBeInstanceOf(URL);
|
|
14
|
-
expect(createUrlIfValid("https://example.com/path?query=value#hash")).toBeInstanceOf(URL);
|
|
15
|
-
expect(createUrlIfValid("/path", "https://example.com")).toBeInstanceOf(URL);
|
|
16
|
-
expect(createUrlIfValid("")).toBeNull();
|
|
17
|
-
expect(createUrlIfValid("not a url")).toBeNull();
|
|
18
|
-
expect(createUrlIfValid("http://")).toBeNull();
|
|
19
|
-
});
|
|
20
11
|
function isValidUrl(url) {
|
|
21
12
|
return !!createUrlIfValid(url);
|
|
22
13
|
}
|
|
23
|
-
(void 0)?.test("isValidUrl", ({ expect }) => {
|
|
24
|
-
expect(isValidUrl("https://example.com")).toBe(true);
|
|
25
|
-
expect(isValidUrl("http://localhost:3000")).toBe(true);
|
|
26
|
-
expect(isValidUrl("ftp://example.com")).toBe(true);
|
|
27
|
-
expect(isValidUrl("")).toBe(false);
|
|
28
|
-
expect(isValidUrl("not a url")).toBe(false);
|
|
29
|
-
expect(isValidUrl("http://")).toBe(false);
|
|
30
|
-
});
|
|
31
14
|
function isValidHostname(hostname) {
|
|
32
15
|
if (!hostname || hostname.startsWith(".") || hostname.endsWith(".") || hostname.includes("..")) return false;
|
|
33
16
|
const url = createUrlIfValid(`https://${hostname}`);
|
|
34
17
|
if (!url) return false;
|
|
35
18
|
return url.hostname === hostname;
|
|
36
19
|
}
|
|
37
|
-
(void 0)?.test("isValidHostname", ({ expect }) => {
|
|
38
|
-
expect(isValidHostname("example.com")).toBe(true);
|
|
39
|
-
expect(isValidHostname("localhost")).toBe(true);
|
|
40
|
-
expect(isValidHostname("sub.domain.example.com")).toBe(true);
|
|
41
|
-
expect(isValidHostname("127.0.0.1")).toBe(true);
|
|
42
|
-
expect(isValidHostname("")).toBe(false);
|
|
43
|
-
expect(isValidHostname("example.com/path")).toBe(false);
|
|
44
|
-
expect(isValidHostname("https://example.com")).toBe(false);
|
|
45
|
-
expect(isValidHostname("example com")).toBe(false);
|
|
46
|
-
});
|
|
47
20
|
function isValidHostnameWithWildcards(hostname) {
|
|
48
21
|
if (!hostname) return false;
|
|
49
22
|
if (!hostname.includes("*")) return isValidHostname(hostname);
|
|
@@ -61,25 +34,6 @@ function isValidHostnameWithWildcards(hostname) {
|
|
|
61
34
|
}
|
|
62
35
|
return true;
|
|
63
36
|
}
|
|
64
|
-
(void 0)?.test("isValidHostnameWithWildcards", ({ expect }) => {
|
|
65
|
-
expect(isValidHostnameWithWildcards("example.com")).toBe(true);
|
|
66
|
-
expect(isValidHostnameWithWildcards("localhost")).toBe(true);
|
|
67
|
-
expect(isValidHostnameWithWildcards("sub.domain.example.com")).toBe(true);
|
|
68
|
-
expect(isValidHostnameWithWildcards("*.example.com")).toBe(true);
|
|
69
|
-
expect(isValidHostnameWithWildcards("a-*.example.com")).toBe(true);
|
|
70
|
-
expect(isValidHostnameWithWildcards("*.*.org")).toBe(true);
|
|
71
|
-
expect(isValidHostnameWithWildcards("**.example.com")).toBe(true);
|
|
72
|
-
expect(isValidHostnameWithWildcards("sub.**.com")).toBe(true);
|
|
73
|
-
expect(isValidHostnameWithWildcards("*-api.*.com")).toBe(true);
|
|
74
|
-
expect(isValidHostnameWithWildcards("")).toBe(false);
|
|
75
|
-
expect(isValidHostnameWithWildcards("example.com/path")).toBe(false);
|
|
76
|
-
expect(isValidHostnameWithWildcards("https://example.com")).toBe(false);
|
|
77
|
-
expect(isValidHostnameWithWildcards("example com")).toBe(false);
|
|
78
|
-
expect(isValidHostnameWithWildcards(".example.com")).toBe(false);
|
|
79
|
-
expect(isValidHostnameWithWildcards("example.com.")).toBe(false);
|
|
80
|
-
expect(isValidHostnameWithWildcards("example..com")).toBe(false);
|
|
81
|
-
expect(isValidHostnameWithWildcards("*.example..com")).toBe(false);
|
|
82
|
-
});
|
|
83
37
|
function matchHostnamePattern(pattern, hostname) {
|
|
84
38
|
if (!pattern.includes("*")) return pattern === hostname;
|
|
85
39
|
let regexPattern = pattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -94,23 +48,6 @@ function matchHostnamePattern(pattern, hostname) {
|
|
|
94
48
|
return false;
|
|
95
49
|
}
|
|
96
50
|
}
|
|
97
|
-
(void 0)?.test("matchHostnamePattern", ({ expect }) => {
|
|
98
|
-
expect(matchHostnamePattern("example.com", "example.com")).toBe(true);
|
|
99
|
-
expect(matchHostnamePattern("example.com", "other.com")).toBe(false);
|
|
100
|
-
expect(matchHostnamePattern("*.example.com", "api.example.com")).toBe(true);
|
|
101
|
-
expect(matchHostnamePattern("*.example.com", "www.example.com")).toBe(true);
|
|
102
|
-
expect(matchHostnamePattern("*.example.com", "example.com")).toBe(false);
|
|
103
|
-
expect(matchHostnamePattern("*.example.com", "api.v2.example.com")).toBe(false);
|
|
104
|
-
expect(matchHostnamePattern("**.example.com", "api.example.com")).toBe(true);
|
|
105
|
-
expect(matchHostnamePattern("**.example.com", "api.v2.example.com")).toBe(true);
|
|
106
|
-
expect(matchHostnamePattern("**.example.com", "a.b.c.example.com")).toBe(true);
|
|
107
|
-
expect(matchHostnamePattern("**.example.com", "example.com")).toBe(false);
|
|
108
|
-
expect(matchHostnamePattern("api-*.example.com", "api-v1.example.com")).toBe(true);
|
|
109
|
-
expect(matchHostnamePattern("api-*.example.com", "api-v2.example.com")).toBe(true);
|
|
110
|
-
expect(matchHostnamePattern("api-*.example.com", "api.example.com")).toBe(false);
|
|
111
|
-
expect(matchHostnamePattern("*.*.org", "mail.example.org")).toBe(true);
|
|
112
|
-
expect(matchHostnamePattern("*.*.org", "example.org")).toBe(false);
|
|
113
|
-
});
|
|
114
51
|
function getHardcodedFallbackUrls(primaryBaseUrl) {
|
|
115
52
|
if (primaryBaseUrl === "https://api.stack-auth.com") return ["https://api1.stack-auth.com", "https://api2.stack-auth.com"];
|
|
116
53
|
if (primaryBaseUrl === "https://api.dev.stack-auth.com") return ["https://api1.dev.stack-auth.com", "https://api2.dev.stack-auth.com"];
|
|
@@ -131,21 +68,6 @@ function isLocalhost(urlOrString) {
|
|
|
131
68
|
if (url.hostname === "[::1]" || url.hostname === "::1") return true;
|
|
132
69
|
return false;
|
|
133
70
|
}
|
|
134
|
-
(void 0)?.test("isLocalhost", ({ expect }) => {
|
|
135
|
-
expect(isLocalhost("http://localhost")).toBe(true);
|
|
136
|
-
expect(isLocalhost("https://localhost:8080")).toBe(true);
|
|
137
|
-
expect(isLocalhost("http://sub.localhost")).toBe(true);
|
|
138
|
-
expect(isLocalhost("http://127.0.0.1")).toBe(true);
|
|
139
|
-
expect(isLocalhost("http://127.1.2.3")).toBe(true);
|
|
140
|
-
expect(isLocalhost("http://[::1]")).toBe(true);
|
|
141
|
-
expect(isLocalhost("https://example.com")).toBe(false);
|
|
142
|
-
expect(isLocalhost("http://192.168.1.1")).toBe(false);
|
|
143
|
-
expect(isLocalhost("http://10.0.0.1")).toBe(false);
|
|
144
|
-
expect(isLocalhost(new URL("http://localhost"))).toBe(true);
|
|
145
|
-
expect(isLocalhost(new URL("https://example.com"))).toBe(false);
|
|
146
|
-
expect(isLocalhost("not a url")).toBe(false);
|
|
147
|
-
expect(isLocalhost("")).toBe(false);
|
|
148
|
-
});
|
|
149
71
|
function isRelative(url) {
|
|
150
72
|
const randomDomain = `${generateSecureRandomString()}.stack-auth.example.com`;
|
|
151
73
|
const u = createUrlIfValid(url, `https://${randomDomain}`);
|
|
@@ -154,29 +76,9 @@ function isRelative(url) {
|
|
|
154
76
|
if (u.protocol !== "https:") return false;
|
|
155
77
|
return true;
|
|
156
78
|
}
|
|
157
|
-
(void 0)?.test("isRelative", ({ expect }) => {
|
|
158
|
-
expect(isRelative("/")).toBe(true);
|
|
159
|
-
expect(isRelative("/path")).toBe(true);
|
|
160
|
-
expect(isRelative("/path?query=value#hash")).toBe(true);
|
|
161
|
-
expect(isRelative("https://example.com")).toBe(false);
|
|
162
|
-
expect(isRelative("http://example.com")).toBe(false);
|
|
163
|
-
expect(isRelative("//example.com")).toBe(false);
|
|
164
|
-
expect(isRelative("")).toBe(true);
|
|
165
|
-
expect(isRelative("not a url")).toBe(true);
|
|
166
|
-
});
|
|
167
79
|
function getRelativePart(url) {
|
|
168
80
|
return url.pathname + url.search + url.hash;
|
|
169
81
|
}
|
|
170
|
-
(void 0)?.test("getRelativePart", ({ expect }) => {
|
|
171
|
-
expect(getRelativePart(new URL("https://example.com"))).toBe("/");
|
|
172
|
-
expect(getRelativePart(new URL("https://example.com/path"))).toBe("/path");
|
|
173
|
-
expect(getRelativePart(new URL("https://example.com/path?query=value"))).toBe("/path?query=value");
|
|
174
|
-
expect(getRelativePart(new URL("https://example.com/path#hash"))).toBe("/path#hash");
|
|
175
|
-
expect(getRelativePart(new URL("https://example.com/path?query=value#hash"))).toBe("/path?query=value#hash");
|
|
176
|
-
const url1 = new URL("https://example.com/path?query=value#hash");
|
|
177
|
-
const url2 = new URL("https://different.com/path?query=value#hash");
|
|
178
|
-
expect(getRelativePart(url1)).toBe(getRelativePart(url2));
|
|
179
|
-
});
|
|
180
82
|
/**
|
|
181
83
|
* A template literal tag that returns a URL.
|
|
182
84
|
*
|
|
@@ -185,21 +87,6 @@ function getRelativePart(url) {
|
|
|
185
87
|
function url(strings, ...values) {
|
|
186
88
|
return new URL(urlString(strings, ...values));
|
|
187
89
|
}
|
|
188
|
-
(void 0)?.test("url", ({ expect }) => {
|
|
189
|
-
expect(url`https://example.com`).toBeInstanceOf(URL);
|
|
190
|
-
expect(url`https://example.com`.href).toBe("https://example.com/");
|
|
191
|
-
expect(url`https://example.com/${"path"}`).toBeInstanceOf(URL);
|
|
192
|
-
expect(url`https://example.com/${"path"}`.pathname).toBe("/path");
|
|
193
|
-
expect(url`https://example.com/${42}`).toBeInstanceOf(URL);
|
|
194
|
-
expect(url`https://example.com/${42}`.pathname).toBe("/42");
|
|
195
|
-
expect(url`https://example.com/${true}`).toBeInstanceOf(URL);
|
|
196
|
-
expect(url`https://example.com/${true}`.pathname).toBe("/true");
|
|
197
|
-
expect(url`https://example.com/${"path with spaces"}`).toBeInstanceOf(URL);
|
|
198
|
-
expect(url`https://example.com/${"path with spaces"}`.pathname).toBe("/path%20with%20spaces");
|
|
199
|
-
expect(url`https://example.com/${"path"}?query=${"value"}`).toBeInstanceOf(URL);
|
|
200
|
-
expect(url`https://example.com/${"path"}?query=${"value"}`.pathname).toBe("/path");
|
|
201
|
-
expect(url`https://example.com/${"path"}?query=${"value"}`.search).toBe("?query=value");
|
|
202
|
-
});
|
|
203
90
|
/**
|
|
204
91
|
* A template literal tag that returns a URL string.
|
|
205
92
|
*
|
|
@@ -208,52 +95,15 @@ function url(strings, ...values) {
|
|
|
208
95
|
function urlString(strings, ...values) {
|
|
209
96
|
return templateIdentity(strings, ...values.map(encodeURIComponent));
|
|
210
97
|
}
|
|
211
|
-
(void 0)?.test("urlString", ({ expect }) => {
|
|
212
|
-
expect(urlString`https://example.com`).toBe("https://example.com");
|
|
213
|
-
expect(urlString`https://example.com/${"path"}`).toBe("https://example.com/path");
|
|
214
|
-
expect(urlString`https://example.com/${42}`).toBe("https://example.com/42");
|
|
215
|
-
expect(urlString`https://example.com/${true}`).toBe("https://example.com/true");
|
|
216
|
-
expect(urlString`https://example.com/${"path with spaces"}`).toBe("https://example.com/path%20with%20spaces");
|
|
217
|
-
expect(urlString`https://example.com/${"?&="}`).toBe("https://example.com/%3F%26%3D");
|
|
218
|
-
expect(urlString`https://example.com/${"path"}?query=${"value"}`).toBe("https://example.com/path?query=value");
|
|
219
|
-
expect(urlString`https://example.com/${"path"}?query=${"value with spaces"}`).toBe("https://example.com/path?query=value%20with%20spaces");
|
|
220
|
-
});
|
|
221
98
|
function isChildUrl(parentUrl, maybeChildUrl) {
|
|
222
99
|
return parentUrl.origin === maybeChildUrl.origin && isChildPath(parentUrl.pathname, maybeChildUrl.pathname) && [...parentUrl.searchParams].every(([key, value]) => maybeChildUrl.searchParams.get(key) === value) && (!parentUrl.hash || parentUrl.hash === maybeChildUrl.hash);
|
|
223
100
|
}
|
|
224
|
-
(void 0)?.test("isChildUrl", ({ expect }) => {
|
|
225
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://abc.com/"))).toBe(true);
|
|
226
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://abc.com/path"))).toBe(true);
|
|
227
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://abc.com/path?query=value"))).toBe(true);
|
|
228
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://abc.com/path?query=value#hash"))).toBe(true);
|
|
229
|
-
expect(isChildUrl(new URL("https://abc.com"), new URL("https://example.com"))).toBe(false);
|
|
230
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://example.com/path"))).toBe(false);
|
|
231
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://example.com/path?query=value"))).toBe(false);
|
|
232
|
-
expect(isChildUrl(new URL("https://abc.com/"), new URL("https://example.com/path?query=value#hash"))).toBe(false);
|
|
233
|
-
expect(isChildUrl(new URL("https://example.com"), new URL("https://abc.com/path?query=value#hash"))).toBe(false);
|
|
234
|
-
expect(isChildUrl(new URL("https://example.com?query=value123"), new URL("https://example.com/path?query=value#hash"))).toBe(false);
|
|
235
|
-
});
|
|
236
101
|
function isChildPath(parentPath, maybeChildPath) {
|
|
237
102
|
parentPath = parentPath.endsWith("/") ? parentPath : parentPath + "/";
|
|
238
103
|
maybeChildPath = maybeChildPath.endsWith("/") ? maybeChildPath : maybeChildPath + "/";
|
|
239
104
|
return maybeChildPath.startsWith(parentPath);
|
|
240
105
|
}
|
|
241
|
-
(void 0)?.test("isSubPath", ({ expect }) => {
|
|
242
|
-
expect(isChildPath("/", "/")).toBe(true);
|
|
243
|
-
expect(isChildPath("/", "/path")).toBe(true);
|
|
244
|
-
expect(isChildPath("/path", "/")).toBe(false);
|
|
245
|
-
expect(isChildPath("/path", "/path")).toBe(true);
|
|
246
|
-
expect(isChildPath("/path/", "/path")).toBe(true);
|
|
247
|
-
expect(isChildPath("/path", "/path/")).toBe(true);
|
|
248
|
-
expect(isChildPath("/path/", "/path/")).toBe(true);
|
|
249
|
-
expect(isChildPath("/path", "/path/abc")).toBe(true);
|
|
250
|
-
expect(isChildPath("/path/", "/path/abc")).toBe(true);
|
|
251
|
-
expect(isChildPath("/path", "/path-abc")).toBe(false);
|
|
252
|
-
expect(isChildPath("/path", "/path-abc/")).toBe(false);
|
|
253
|
-
expect(isChildPath("/path/", "/path-abc")).toBe(false);
|
|
254
|
-
expect(isChildPath("/path/", "/path-abc/")).toBe(false);
|
|
255
|
-
});
|
|
256
|
-
|
|
257
106
|
//#endregion
|
|
258
107
|
export { createUrlIfValid, getDefaultApiUrls, getHardcodedFallbackUrls, getRelativePart, isChildPath, isChildUrl, isLocalhost, isRelative, isValidHostname, isValidHostnameWithWildcards, isValidUrl, matchHostnamePattern, url, urlString };
|
|
108
|
+
|
|
259
109
|
//# sourceMappingURL=urls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","names":[],"sources":["../../../src/utils/urls.tsx"],"sourcesContent":["import { generateSecureRandomString } from \"./crypto\";\nimport { templateIdentity } from \"./strings\";\n\nexport function createUrlIfValid(...args: ConstructorParameters<typeof URL>) {\n try {\n return new URL(...args);\n } catch (e) {\n return null;\n }\n}\nimport.meta.vitest?.test(\"createUrlIfValid\", ({ expect }) => {\n // Test with valid URLs\n expect(createUrlIfValid(\"https://example.com\")).toBeInstanceOf(URL);\n expect(createUrlIfValid(\"https://example.com/path?query=value#hash\")).toBeInstanceOf(URL);\n expect(createUrlIfValid(\"/path\", \"https://example.com\")).toBeInstanceOf(URL);\n\n // Test with invalid URLs\n expect(createUrlIfValid(\"\")).toBeNull();\n expect(createUrlIfValid(\"not a url\")).toBeNull();\n expect(createUrlIfValid(\"http://\")).toBeNull();\n});\n\nexport function isValidUrl(url: string) {\n return !!createUrlIfValid(url);\n}\nimport.meta.vitest?.test(\"isValidUrl\", ({ expect }) => {\n // Test with valid URLs\n expect(isValidUrl(\"https://example.com\")).toBe(true);\n expect(isValidUrl(\"http://localhost:3000\")).toBe(true);\n expect(isValidUrl(\"ftp://example.com\")).toBe(true);\n\n // Test with invalid URLs\n expect(isValidUrl(\"\")).toBe(false);\n expect(isValidUrl(\"not a url\")).toBe(false);\n expect(isValidUrl(\"http://\")).toBe(false);\n});\n\nexport function isValidHostname(hostname: string) {\n // Basic validation\n if (!hostname || hostname.startsWith('.') || hostname.endsWith('.') || hostname.includes('..')) {\n return false;\n }\n\n const url = createUrlIfValid(`https://${hostname}`);\n if (!url) return false;\n return url.hostname === hostname;\n}\nimport.meta.vitest?.test(\"isValidHostname\", ({ expect }) => {\n // Test with valid hostnames\n expect(isValidHostname(\"example.com\")).toBe(true);\n expect(isValidHostname(\"localhost\")).toBe(true);\n expect(isValidHostname(\"sub.domain.example.com\")).toBe(true);\n expect(isValidHostname(\"127.0.0.1\")).toBe(true);\n\n // Test with invalid hostnames\n expect(isValidHostname(\"\")).toBe(false);\n expect(isValidHostname(\"example.com/path\")).toBe(false);\n expect(isValidHostname(\"https://example.com\")).toBe(false);\n expect(isValidHostname(\"example com\")).toBe(false);\n});\n\nexport function isValidHostnameWithWildcards(hostname: string) {\n // Empty hostnames are invalid\n if (!hostname) return false;\n\n // Check if it contains wildcards\n const hasWildcard = hostname.includes('*');\n\n if (!hasWildcard) {\n // If no wildcards, validate as a normal hostname\n return isValidHostname(hostname);\n }\n\n // Basic validation checks that apply even with wildcards\n // - Hostname cannot start or end with a dot\n if (hostname.startsWith('.') || hostname.endsWith('.')) {\n return false;\n }\n\n // - No consecutive dots\n if (hostname.includes('..')) {\n return false;\n }\n\n // For wildcard validation, check that non-wildcard parts contain valid characters\n // Replace wildcards with a valid placeholder to check the rest\n const testHostname = hostname.replace(/\\*+/g, 'wildcard');\n\n // Check if the resulting string would be a valid hostname\n if (!/^[a-zA-Z0-9.-]+$/.test(testHostname)) {\n return false;\n }\n\n // Additional check: ensure the pattern makes sense\n // Check each segment between wildcards\n const segments = hostname.split(/\\*+/);\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (segment === '') continue; // Empty segments are OK (consecutive wildcards)\n\n // First segment can't start with dot\n if (i === 0 && segment.startsWith('.')) {\n return false;\n }\n\n // Last segment can't end with dot\n if (i === segments.length - 1 && segment.endsWith('.')) {\n return false;\n }\n\n // No segment should have consecutive dots\n if (segment.includes('..')) {\n return false;\n }\n }\n\n return true;\n}\nimport.meta.vitest?.test(\"isValidHostnameWithWildcards\", ({ expect }) => {\n // Test with valid regular hostnames\n expect(isValidHostnameWithWildcards(\"example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"localhost\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"sub.domain.example.com\")).toBe(true);\n\n // Test with valid wildcard hostnames\n expect(isValidHostnameWithWildcards(\"*.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"a-*.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"*.*.org\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"**.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"sub.**.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"*-api.*.com\")).toBe(true);\n\n // Test with invalid hostnames\n expect(isValidHostnameWithWildcards(\"\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example.com/path\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"https://example.com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\".example.com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example.com.\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example..com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"*.example..com\")).toBe(false);\n});\n\nexport function matchHostnamePattern(pattern: string, hostname: string): boolean {\n // If no wildcards, it's an exact match\n if (!pattern.includes('*')) {\n return pattern === hostname;\n }\n\n // Convert the pattern to a regex\n // First, escape all regex special characters except *\n let regexPattern = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n // Use a placeholder for ** to handle it separately from single *\n const doubleWildcardPlaceholder = '\\x00DOUBLE_WILDCARD\\x00';\n regexPattern = regexPattern.replace(/\\*\\*/g, doubleWildcardPlaceholder);\n\n // Replace single * with a pattern that matches anything except dots\n regexPattern = regexPattern.replace(/\\*/g, '[^.]*');\n\n // Replace the double wildcard placeholder with a pattern that matches anything including dots\n regexPattern = regexPattern.replace(new RegExp(doubleWildcardPlaceholder, 'g'), '.*');\n\n // Anchor the pattern to match the entire hostname\n regexPattern = '^' + regexPattern + '$';\n\n try {\n const regex = new RegExp(regexPattern);\n return regex.test(hostname);\n } catch {\n return false;\n }\n}\nimport.meta.vitest?.test(\"matchHostnamePattern\", ({ expect }) => {\n // Test exact matches\n expect(matchHostnamePattern(\"example.com\", \"example.com\")).toBe(true);\n expect(matchHostnamePattern(\"example.com\", \"other.com\")).toBe(false);\n\n // Test single wildcard matches\n expect(matchHostnamePattern(\"*.example.com\", \"api.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"*.example.com\", \"www.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"*.example.com\", \"example.com\")).toBe(false);\n expect(matchHostnamePattern(\"*.example.com\", \"api.v2.example.com\")).toBe(false);\n\n // Test double wildcard matches\n expect(matchHostnamePattern(\"**.example.com\", \"api.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"api.v2.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"a.b.c.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"example.com\")).toBe(false);\n\n // Test complex patterns\n expect(matchHostnamePattern(\"api-*.example.com\", \"api-v1.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"api-*.example.com\", \"api-v2.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"api-*.example.com\", \"api.example.com\")).toBe(false);\n expect(matchHostnamePattern(\"*.*.org\", \"mail.example.org\")).toBe(true);\n expect(matchHostnamePattern(\"*.*.org\", \"example.org\")).toBe(false);\n});\n\nexport function getHardcodedFallbackUrls(primaryBaseUrl: string): string[] {\n // `defaultBaseUrl` in `@stackframe/*` SDK builds is `https://api.stack-auth.com`\n // (see `packages/template/src/lib/hexclave-app/apps/implementations/common.ts`).\n // The `@hexclave/*` mirror packages will get this rewritten to the hexclave\n // hostname by `scripts/rewrite-packages-to-hexclave.ts` in a follow-up PR; both\n // branches below stay listed so either build resolves its own fallback set.\n if (primaryBaseUrl === \"https://api.stack-auth.com\") {\n return [\"https://api1.stack-auth.com\", \"https://api2.stack-auth.com\"];\n }\n if (primaryBaseUrl === \"https://api.dev.stack-auth.com\") {\n return [\"https://api1.dev.stack-auth.com\", \"https://api2.dev.stack-auth.com\"];\n }\n if (primaryBaseUrl === \"https://api.hexclave.com\") {\n return [\"https://api1.hexclave.com\", \"https://api2.hexclave.com\"];\n }\n if (primaryBaseUrl === \"https://api.dev.hexclave.com\") {\n return [\"https://api1.dev.hexclave.com\", \"https://api2.dev.hexclave.com\"];\n }\n const localhostMatch = primaryBaseUrl.match(/^http:\\/\\/localhost:(\\d+)02$/);\n if (localhostMatch) {\n return [`http://localhost:${localhostMatch[1]}10`];\n }\n return [];\n}\n\nexport function getDefaultApiUrls(primaryBaseUrl: string): string[] {\n return [primaryBaseUrl, ...getHardcodedFallbackUrls(primaryBaseUrl)];\n}\n\nexport function isLocalhost(urlOrString: string | URL) {\n const url = createUrlIfValid(urlOrString);\n if (!url) return false;\n if (url.hostname === \"localhost\" || url.hostname.endsWith(\".localhost\")) return true;\n if (url.hostname.match(/^127\\.\\d+\\.\\d+\\.\\d+$/)) return true;\n if (url.hostname === \"[::1]\" || url.hostname === \"::1\") return true;\n return false;\n}\nimport.meta.vitest?.test(\"isLocalhost\", ({ expect }) => {\n // Test with localhost URLs\n expect(isLocalhost(\"http://localhost\")).toBe(true);\n expect(isLocalhost(\"https://localhost:8080\")).toBe(true);\n expect(isLocalhost(\"http://sub.localhost\")).toBe(true);\n expect(isLocalhost(\"http://127.0.0.1\")).toBe(true);\n expect(isLocalhost(\"http://127.1.2.3\")).toBe(true);\n expect(isLocalhost(\"http://[::1]\")).toBe(true);\n\n // Test with non-localhost URLs\n expect(isLocalhost(\"https://example.com\")).toBe(false);\n expect(isLocalhost(\"http://192.168.1.1\")).toBe(false);\n expect(isLocalhost(\"http://10.0.0.1\")).toBe(false);\n\n // Test with URL objects\n expect(isLocalhost(new URL(\"http://localhost\"))).toBe(true);\n expect(isLocalhost(new URL(\"https://example.com\"))).toBe(false);\n\n // Test with invalid URLs\n expect(isLocalhost(\"not a url\")).toBe(false);\n expect(isLocalhost(\"\")).toBe(false);\n});\n\nexport function isRelative(url: string) {\n const randomDomain = `${generateSecureRandomString()}.stack-auth.example.com`;\n const u = createUrlIfValid(url, `https://${randomDomain}`);\n if (!u) return false;\n if (u.host !== randomDomain) return false;\n if (u.protocol !== \"https:\") return false;\n return true;\n}\nimport.meta.vitest?.test(\"isRelative\", ({ expect }) => {\n // We can't easily mock generateSecureRandomString in this context\n // but we can still test the function's behavior\n\n // Test with relative URLs\n expect(isRelative(\"/\")).toBe(true);\n expect(isRelative(\"/path\")).toBe(true);\n expect(isRelative(\"/path?query=value#hash\")).toBe(true);\n\n // Test with absolute URLs\n expect(isRelative(\"https://example.com\")).toBe(false);\n expect(isRelative(\"http://example.com\")).toBe(false);\n expect(isRelative(\"//example.com\")).toBe(false);\n\n // Note: The implementation treats empty strings and invalid URLs as relative\n // This is because they can be resolved against a base URL\n expect(isRelative(\"\")).toBe(true);\n expect(isRelative(\"not a url\")).toBe(true);\n});\n\nexport function getRelativePart(url: URL) {\n return url.pathname + url.search + url.hash;\n}\nimport.meta.vitest?.test(\"getRelativePart\", ({ expect }) => {\n // Test with various URLs\n expect(getRelativePart(new URL(\"https://example.com\"))).toBe(\"/\");\n expect(getRelativePart(new URL(\"https://example.com/path\"))).toBe(\"/path\");\n expect(getRelativePart(new URL(\"https://example.com/path?query=value\"))).toBe(\"/path?query=value\");\n expect(getRelativePart(new URL(\"https://example.com/path#hash\"))).toBe(\"/path#hash\");\n expect(getRelativePart(new URL(\"https://example.com/path?query=value#hash\"))).toBe(\"/path?query=value#hash\");\n\n // Test with different domains but same paths\n const url1 = new URL(\"https://example.com/path?query=value#hash\");\n const url2 = new URL(\"https://different.com/path?query=value#hash\");\n expect(getRelativePart(url1)).toBe(getRelativePart(url2));\n});\n\n/**\n * A template literal tag that returns a URL.\n *\n * Any values passed are encoded.\n */\nexport function url(strings: TemplateStringsArray | readonly string[], ...values: (string | number | boolean)[]): URL {\n return new URL(urlString(strings, ...values));\n}\nimport.meta.vitest?.test(\"url\", ({ expect }) => {\n // Test with no interpolation\n expect(url`https://example.com`).toBeInstanceOf(URL);\n expect(url`https://example.com`.href).toBe(\"https://example.com/\");\n\n // Test with string interpolation\n expect(url`https://example.com/${\"path\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path\"}`.pathname).toBe(\"/path\");\n\n // Test with number interpolation\n expect(url`https://example.com/${42}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${42}`.pathname).toBe(\"/42\");\n\n // Test with boolean interpolation\n expect(url`https://example.com/${true}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${true}`.pathname).toBe(\"/true\");\n\n // Test with special characters in interpolation\n expect(url`https://example.com/${\"path with spaces\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path with spaces\"}`.pathname).toBe(\"/path%20with%20spaces\");\n\n // Test with multiple interpolations\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`.pathname).toBe(\"/path\");\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`.search).toBe(\"?query=value\");\n});\n\n\n/**\n * A template literal tag that returns a URL string.\n *\n * Any values passed are encoded.\n */\nexport function urlString(strings: TemplateStringsArray | readonly string[], ...values: (string | number | boolean)[]): string {\n return templateIdentity(strings, ...values.map(encodeURIComponent));\n}\nimport.meta.vitest?.test(\"urlString\", ({ expect }) => {\n // Test with no interpolation\n expect(urlString`https://example.com`).toBe(\"https://example.com\");\n\n // Test with string interpolation\n expect(urlString`https://example.com/${\"path\"}`).toBe(\"https://example.com/path\");\n\n // Test with number interpolation\n expect(urlString`https://example.com/${42}`).toBe(\"https://example.com/42\");\n\n // Test with boolean interpolation\n expect(urlString`https://example.com/${true}`).toBe(\"https://example.com/true\");\n\n // Test with special characters in interpolation\n expect(urlString`https://example.com/${\"path with spaces\"}`).toBe(\"https://example.com/path%20with%20spaces\");\n expect(urlString`https://example.com/${\"?&=\"}`).toBe(\"https://example.com/%3F%26%3D\");\n\n // Test with multiple interpolations\n expect(urlString`https://example.com/${\"path\"}?query=${\"value\"}`).toBe(\"https://example.com/path?query=value\");\n expect(urlString`https://example.com/${\"path\"}?query=${\"value with spaces\"}`).toBe(\"https://example.com/path?query=value%20with%20spaces\");\n});\n\nexport function isChildUrl(parentUrl: URL, maybeChildUrl: URL) {\n return parentUrl.origin === maybeChildUrl.origin\n && isChildPath(parentUrl.pathname, maybeChildUrl.pathname)\n && [...parentUrl.searchParams].every(([key, value]) => maybeChildUrl.searchParams.get(key) === value)\n && (!parentUrl.hash || parentUrl.hash === maybeChildUrl.hash);\n}\nimport.meta.vitest?.test(\"isChildUrl\", ({ expect }) => {\n // true\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path?query=value\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path?query=value#hash\"))).toBe(true);\n\n // false\n expect(isChildUrl(new URL(\"https://abc.com\"), new URL(\"https://example.com\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path?query=value\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path?query=value#hash\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://example.com\"), new URL(\"https://abc.com/path?query=value#hash\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://example.com?query=value123\"), new URL(\"https://example.com/path?query=value#hash\"))).toBe(false);\n});\n\nexport function isChildPath(parentPath: string, maybeChildPath: string) {\n parentPath = parentPath.endsWith(\"/\") ? parentPath : parentPath + \"/\";\n maybeChildPath = maybeChildPath.endsWith(\"/\") ? maybeChildPath : maybeChildPath + \"/\";\n return maybeChildPath.startsWith(parentPath);\n}\nimport.meta.vitest?.test(\"isSubPath\", ({ expect }) => {\n expect(isChildPath(\"/\", \"/\")).toBe(true);\n expect(isChildPath(\"/\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path\", \"/\")).toBe(false);\n expect(isChildPath(\"/path\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path/\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path/\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path/abc\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path/abc\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path-abc\")).toBe(false);\n expect(isChildPath(\"/path\", \"/path-abc/\")).toBe(false);\n expect(isChildPath(\"/path/\", \"/path-abc\")).toBe(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} from \"./crypto\";\nimport { templateIdentity } from \"./strings\";\n\nexport function createUrlIfValid(...args: ConstructorParameters<typeof URL>) {\n try {\n return new URL(...args);\n } catch (e) {\n return null;\n }\n}\nimport.meta.vitest?.test(\"createUrlIfValid\", ({ expect }) => {\n // Test with valid URLs\n expect(createUrlIfValid(\"https://example.com\")).toBeInstanceOf(URL);\n expect(createUrlIfValid(\"https://example.com/path?query=value#hash\")).toBeInstanceOf(URL);\n expect(createUrlIfValid(\"/path\", \"https://example.com\")).toBeInstanceOf(URL);\n\n // Test with invalid URLs\n expect(createUrlIfValid(\"\")).toBeNull();\n expect(createUrlIfValid(\"not a url\")).toBeNull();\n expect(createUrlIfValid(\"http://\")).toBeNull();\n});\n\nexport function isValidUrl(url: string) {\n return !!createUrlIfValid(url);\n}\nimport.meta.vitest?.test(\"isValidUrl\", ({ expect }) => {\n // Test with valid URLs\n expect(isValidUrl(\"https://example.com\")).toBe(true);\n expect(isValidUrl(\"http://localhost:3000\")).toBe(true);\n expect(isValidUrl(\"ftp://example.com\")).toBe(true);\n\n // Test with invalid URLs\n expect(isValidUrl(\"\")).toBe(false);\n expect(isValidUrl(\"not a url\")).toBe(false);\n expect(isValidUrl(\"http://\")).toBe(false);\n});\n\nexport function isValidHostname(hostname: string) {\n // Basic validation\n if (!hostname || hostname.startsWith('.') || hostname.endsWith('.') || hostname.includes('..')) {\n return false;\n }\n\n const url = createUrlIfValid(`https://${hostname}`);\n if (!url) return false;\n return url.hostname === hostname;\n}\nimport.meta.vitest?.test(\"isValidHostname\", ({ expect }) => {\n // Test with valid hostnames\n expect(isValidHostname(\"example.com\")).toBe(true);\n expect(isValidHostname(\"localhost\")).toBe(true);\n expect(isValidHostname(\"sub.domain.example.com\")).toBe(true);\n expect(isValidHostname(\"127.0.0.1\")).toBe(true);\n\n // Test with invalid hostnames\n expect(isValidHostname(\"\")).toBe(false);\n expect(isValidHostname(\"example.com/path\")).toBe(false);\n expect(isValidHostname(\"https://example.com\")).toBe(false);\n expect(isValidHostname(\"example com\")).toBe(false);\n});\n\nexport function isValidHostnameWithWildcards(hostname: string) {\n // Empty hostnames are invalid\n if (!hostname) return false;\n\n // Check if it contains wildcards\n const hasWildcard = hostname.includes('*');\n\n if (!hasWildcard) {\n // If no wildcards, validate as a normal hostname\n return isValidHostname(hostname);\n }\n\n // Basic validation checks that apply even with wildcards\n // - Hostname cannot start or end with a dot\n if (hostname.startsWith('.') || hostname.endsWith('.')) {\n return false;\n }\n\n // - No consecutive dots\n if (hostname.includes('..')) {\n return false;\n }\n\n // For wildcard validation, check that non-wildcard parts contain valid characters\n // Replace wildcards with a valid placeholder to check the rest\n const testHostname = hostname.replace(/\\*+/g, 'wildcard');\n\n // Check if the resulting string would be a valid hostname\n if (!/^[a-zA-Z0-9.-]+$/.test(testHostname)) {\n return false;\n }\n\n // Additional check: ensure the pattern makes sense\n // Check each segment between wildcards\n const segments = hostname.split(/\\*+/);\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (segment === '') continue; // Empty segments are OK (consecutive wildcards)\n\n // First segment can't start with dot\n if (i === 0 && segment.startsWith('.')) {\n return false;\n }\n\n // Last segment can't end with dot\n if (i === segments.length - 1 && segment.endsWith('.')) {\n return false;\n }\n\n // No segment should have consecutive dots\n if (segment.includes('..')) {\n return false;\n }\n }\n\n return true;\n}\nimport.meta.vitest?.test(\"isValidHostnameWithWildcards\", ({ expect }) => {\n // Test with valid regular hostnames\n expect(isValidHostnameWithWildcards(\"example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"localhost\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"sub.domain.example.com\")).toBe(true);\n\n // Test with valid wildcard hostnames\n expect(isValidHostnameWithWildcards(\"*.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"a-*.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"*.*.org\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"**.example.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"sub.**.com\")).toBe(true);\n expect(isValidHostnameWithWildcards(\"*-api.*.com\")).toBe(true);\n\n // Test with invalid hostnames\n expect(isValidHostnameWithWildcards(\"\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example.com/path\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"https://example.com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\".example.com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example.com.\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"example..com\")).toBe(false);\n expect(isValidHostnameWithWildcards(\"*.example..com\")).toBe(false);\n});\n\nexport function matchHostnamePattern(pattern: string, hostname: string): boolean {\n // If no wildcards, it's an exact match\n if (!pattern.includes('*')) {\n return pattern === hostname;\n }\n\n // Convert the pattern to a regex\n // First, escape all regex special characters except *\n let regexPattern = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n // Use a placeholder for ** to handle it separately from single *\n const doubleWildcardPlaceholder = '\\x00DOUBLE_WILDCARD\\x00';\n regexPattern = regexPattern.replace(/\\*\\*/g, doubleWildcardPlaceholder);\n\n // Replace single * with a pattern that matches anything except dots\n regexPattern = regexPattern.replace(/\\*/g, '[^.]*');\n\n // Replace the double wildcard placeholder with a pattern that matches anything including dots\n regexPattern = regexPattern.replace(new RegExp(doubleWildcardPlaceholder, 'g'), '.*');\n\n // Anchor the pattern to match the entire hostname\n regexPattern = '^' + regexPattern + '$';\n\n try {\n const regex = new RegExp(regexPattern);\n return regex.test(hostname);\n } catch {\n return false;\n }\n}\nimport.meta.vitest?.test(\"matchHostnamePattern\", ({ expect }) => {\n // Test exact matches\n expect(matchHostnamePattern(\"example.com\", \"example.com\")).toBe(true);\n expect(matchHostnamePattern(\"example.com\", \"other.com\")).toBe(false);\n\n // Test single wildcard matches\n expect(matchHostnamePattern(\"*.example.com\", \"api.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"*.example.com\", \"www.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"*.example.com\", \"example.com\")).toBe(false);\n expect(matchHostnamePattern(\"*.example.com\", \"api.v2.example.com\")).toBe(false);\n\n // Test double wildcard matches\n expect(matchHostnamePattern(\"**.example.com\", \"api.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"api.v2.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"a.b.c.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"**.example.com\", \"example.com\")).toBe(false);\n\n // Test complex patterns\n expect(matchHostnamePattern(\"api-*.example.com\", \"api-v1.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"api-*.example.com\", \"api-v2.example.com\")).toBe(true);\n expect(matchHostnamePattern(\"api-*.example.com\", \"api.example.com\")).toBe(false);\n expect(matchHostnamePattern(\"*.*.org\", \"mail.example.org\")).toBe(true);\n expect(matchHostnamePattern(\"*.*.org\", \"example.org\")).toBe(false);\n});\n\nexport function getHardcodedFallbackUrls(primaryBaseUrl: string): string[] {\n // `defaultBaseUrl` in `@stackframe/*` SDK builds is `https://api.stack-auth.com`\n // (see `packages/template/src/lib/hexclave-app/apps/implementations/common.ts`).\n // The `@hexclave/*` mirror packages will get this rewritten to the hexclave\n // hostname by `scripts/rewrite-packages-to-hexclave.ts` in a follow-up PR; both\n // branches below stay listed so either build resolves its own fallback set.\n if (primaryBaseUrl === \"https://api.stack-auth.com\") {\n return [\"https://api1.stack-auth.com\", \"https://api2.stack-auth.com\"];\n }\n if (primaryBaseUrl === \"https://api.dev.stack-auth.com\") {\n return [\"https://api1.dev.stack-auth.com\", \"https://api2.dev.stack-auth.com\"];\n }\n if (primaryBaseUrl === \"https://api.hexclave.com\") {\n return [\"https://api1.hexclave.com\", \"https://api2.hexclave.com\"];\n }\n if (primaryBaseUrl === \"https://api.dev.hexclave.com\") {\n return [\"https://api1.dev.hexclave.com\", \"https://api2.dev.hexclave.com\"];\n }\n const localhostMatch = primaryBaseUrl.match(/^http:\\/\\/localhost:(\\d+)02$/);\n if (localhostMatch) {\n return [`http://localhost:${localhostMatch[1]}10`];\n }\n return [];\n}\n\nexport function getDefaultApiUrls(primaryBaseUrl: string): string[] {\n return [primaryBaseUrl, ...getHardcodedFallbackUrls(primaryBaseUrl)];\n}\n\nexport function isLocalhost(urlOrString: string | URL) {\n const url = createUrlIfValid(urlOrString);\n if (!url) return false;\n if (url.hostname === \"localhost\" || url.hostname.endsWith(\".localhost\")) return true;\n if (url.hostname.match(/^127\\.\\d+\\.\\d+\\.\\d+$/)) return true;\n if (url.hostname === \"[::1]\" || url.hostname === \"::1\") return true;\n return false;\n}\nimport.meta.vitest?.test(\"isLocalhost\", ({ expect }) => {\n // Test with localhost URLs\n expect(isLocalhost(\"http://localhost\")).toBe(true);\n expect(isLocalhost(\"https://localhost:8080\")).toBe(true);\n expect(isLocalhost(\"http://sub.localhost\")).toBe(true);\n expect(isLocalhost(\"http://127.0.0.1\")).toBe(true);\n expect(isLocalhost(\"http://127.1.2.3\")).toBe(true);\n expect(isLocalhost(\"http://[::1]\")).toBe(true);\n\n // Test with non-localhost URLs\n expect(isLocalhost(\"https://example.com\")).toBe(false);\n expect(isLocalhost(\"http://192.168.1.1\")).toBe(false);\n expect(isLocalhost(\"http://10.0.0.1\")).toBe(false);\n\n // Test with URL objects\n expect(isLocalhost(new URL(\"http://localhost\"))).toBe(true);\n expect(isLocalhost(new URL(\"https://example.com\"))).toBe(false);\n\n // Test with invalid URLs\n expect(isLocalhost(\"not a url\")).toBe(false);\n expect(isLocalhost(\"\")).toBe(false);\n});\n\nexport function isRelative(url: string) {\n const randomDomain = `${generateSecureRandomString()}.stack-auth.example.com`;\n const u = createUrlIfValid(url, `https://${randomDomain}`);\n if (!u) return false;\n if (u.host !== randomDomain) return false;\n if (u.protocol !== \"https:\") return false;\n return true;\n}\nimport.meta.vitest?.test(\"isRelative\", ({ expect }) => {\n // We can't easily mock generateSecureRandomString in this context\n // but we can still test the function's behavior\n\n // Test with relative URLs\n expect(isRelative(\"/\")).toBe(true);\n expect(isRelative(\"/path\")).toBe(true);\n expect(isRelative(\"/path?query=value#hash\")).toBe(true);\n\n // Test with absolute URLs\n expect(isRelative(\"https://example.com\")).toBe(false);\n expect(isRelative(\"http://example.com\")).toBe(false);\n expect(isRelative(\"//example.com\")).toBe(false);\n\n // Note: The implementation treats empty strings and invalid URLs as relative\n // This is because they can be resolved against a base URL\n expect(isRelative(\"\")).toBe(true);\n expect(isRelative(\"not a url\")).toBe(true);\n});\n\nexport function getRelativePart(url: URL) {\n return url.pathname + url.search + url.hash;\n}\nimport.meta.vitest?.test(\"getRelativePart\", ({ expect }) => {\n // Test with various URLs\n expect(getRelativePart(new URL(\"https://example.com\"))).toBe(\"/\");\n expect(getRelativePart(new URL(\"https://example.com/path\"))).toBe(\"/path\");\n expect(getRelativePart(new URL(\"https://example.com/path?query=value\"))).toBe(\"/path?query=value\");\n expect(getRelativePart(new URL(\"https://example.com/path#hash\"))).toBe(\"/path#hash\");\n expect(getRelativePart(new URL(\"https://example.com/path?query=value#hash\"))).toBe(\"/path?query=value#hash\");\n\n // Test with different domains but same paths\n const url1 = new URL(\"https://example.com/path?query=value#hash\");\n const url2 = new URL(\"https://different.com/path?query=value#hash\");\n expect(getRelativePart(url1)).toBe(getRelativePart(url2));\n});\n\n/**\n * A template literal tag that returns a URL.\n *\n * Any values passed are encoded.\n */\nexport function url(strings: TemplateStringsArray | readonly string[], ...values: (string | number | boolean)[]): URL {\n return new URL(urlString(strings, ...values));\n}\nimport.meta.vitest?.test(\"url\", ({ expect }) => {\n // Test with no interpolation\n expect(url`https://example.com`).toBeInstanceOf(URL);\n expect(url`https://example.com`.href).toBe(\"https://example.com/\");\n\n // Test with string interpolation\n expect(url`https://example.com/${\"path\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path\"}`.pathname).toBe(\"/path\");\n\n // Test with number interpolation\n expect(url`https://example.com/${42}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${42}`.pathname).toBe(\"/42\");\n\n // Test with boolean interpolation\n expect(url`https://example.com/${true}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${true}`.pathname).toBe(\"/true\");\n\n // Test with special characters in interpolation\n expect(url`https://example.com/${\"path with spaces\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path with spaces\"}`.pathname).toBe(\"/path%20with%20spaces\");\n\n // Test with multiple interpolations\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`).toBeInstanceOf(URL);\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`.pathname).toBe(\"/path\");\n expect(url`https://example.com/${\"path\"}?query=${\"value\"}`.search).toBe(\"?query=value\");\n});\n\n\n/**\n * A template literal tag that returns a URL string.\n *\n * Any values passed are encoded.\n */\nexport function urlString(strings: TemplateStringsArray | readonly string[], ...values: (string | number | boolean)[]): string {\n return templateIdentity(strings, ...values.map(encodeURIComponent));\n}\nimport.meta.vitest?.test(\"urlString\", ({ expect }) => {\n // Test with no interpolation\n expect(urlString`https://example.com`).toBe(\"https://example.com\");\n\n // Test with string interpolation\n expect(urlString`https://example.com/${\"path\"}`).toBe(\"https://example.com/path\");\n\n // Test with number interpolation\n expect(urlString`https://example.com/${42}`).toBe(\"https://example.com/42\");\n\n // Test with boolean interpolation\n expect(urlString`https://example.com/${true}`).toBe(\"https://example.com/true\");\n\n // Test with special characters in interpolation\n expect(urlString`https://example.com/${\"path with spaces\"}`).toBe(\"https://example.com/path%20with%20spaces\");\n expect(urlString`https://example.com/${\"?&=\"}`).toBe(\"https://example.com/%3F%26%3D\");\n\n // Test with multiple interpolations\n expect(urlString`https://example.com/${\"path\"}?query=${\"value\"}`).toBe(\"https://example.com/path?query=value\");\n expect(urlString`https://example.com/${\"path\"}?query=${\"value with spaces\"}`).toBe(\"https://example.com/path?query=value%20with%20spaces\");\n});\n\nexport function isChildUrl(parentUrl: URL, maybeChildUrl: URL) {\n return parentUrl.origin === maybeChildUrl.origin\n && isChildPath(parentUrl.pathname, maybeChildUrl.pathname)\n && [...parentUrl.searchParams].every(([key, value]) => maybeChildUrl.searchParams.get(key) === value)\n && (!parentUrl.hash || parentUrl.hash === maybeChildUrl.hash);\n}\nimport.meta.vitest?.test(\"isChildUrl\", ({ expect }) => {\n // true\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path?query=value\"))).toBe(true);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://abc.com/path?query=value#hash\"))).toBe(true);\n\n // false\n expect(isChildUrl(new URL(\"https://abc.com\"), new URL(\"https://example.com\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path?query=value\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://abc.com/\"), new URL(\"https://example.com/path?query=value#hash\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://example.com\"), new URL(\"https://abc.com/path?query=value#hash\"))).toBe(false);\n expect(isChildUrl(new URL(\"https://example.com?query=value123\"), new URL(\"https://example.com/path?query=value#hash\"))).toBe(false);\n});\n\nexport function isChildPath(parentPath: string, maybeChildPath: string) {\n parentPath = parentPath.endsWith(\"/\") ? parentPath : parentPath + \"/\";\n maybeChildPath = maybeChildPath.endsWith(\"/\") ? maybeChildPath : maybeChildPath + \"/\";\n return maybeChildPath.startsWith(parentPath);\n}\nimport.meta.vitest?.test(\"isSubPath\", ({ expect }) => {\n expect(isChildPath(\"/\", \"/\")).toBe(true);\n expect(isChildPath(\"/\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path\", \"/\")).toBe(false);\n expect(isChildPath(\"/path\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path/\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path/\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path/abc\")).toBe(true);\n expect(isChildPath(\"/path/\", \"/path/abc\")).toBe(true);\n expect(isChildPath(\"/path\", \"/path-abc\")).toBe(false);\n expect(isChildPath(\"/path\", \"/path-abc/\")).toBe(false);\n expect(isChildPath(\"/path/\", \"/path-abc\")).toBe(false);\n expect(isChildPath(\"/path/\", \"/path-abc/\")).toBe(false);\n});\n"],"mappings":";;;AAGA,SAAgB,iBAAiB,GAAG,MAAyC;CAC3E,IAAI;EACF,OAAO,IAAI,IAAI,GAAG,IAAI;CACxB,SAAS,GAAG;EACV,OAAO;CACT;AACF;AAaA,SAAgB,WAAW,KAAa;CACtC,OAAO,CAAC,CAAC,iBAAiB,GAAG;AAC/B;AAaA,SAAgB,gBAAgB,UAAkB;CAEhD,IAAI,CAAC,YAAY,SAAS,WAAW,GAAG,KAAK,SAAS,SAAS,GAAG,KAAK,SAAS,SAAS,IAAI,GAC3F,OAAO;CAGT,MAAM,MAAM,iBAAiB,WAAW,UAAU;CAClD,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO,IAAI,aAAa;AAC1B;AAeA,SAAgB,6BAA6B,UAAkB;CAE7D,IAAI,CAAC,UAAU,OAAO;CAKtB,IAAI,CAFgB,SAAS,SAAS,GAEvB,GAEb,OAAO,gBAAgB,QAAQ;CAKjC,IAAI,SAAS,WAAW,GAAG,KAAK,SAAS,SAAS,GAAG,GACnD,OAAO;CAIT,IAAI,SAAS,SAAS,IAAI,GACxB,OAAO;CAKT,MAAM,eAAe,SAAS,QAAQ,QAAQ,UAAU;CAGxD,IAAI,CAAC,mBAAmB,KAAK,YAAY,GACvC,OAAO;CAKT,MAAM,WAAW,SAAS,MAAM,KAAK;CACrC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,UAAU,SAAS;EACzB,IAAI,YAAY,IAAI;EAGpB,IAAI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.ts","names":[],"sources":["../../../src/utils/uuids.tsx"],"mappings":";iBAEgB,YAAA;AAAA,iBAsBA,MAAA,CAAO,GAAW"}
|
package/dist/esm/utils/uuids.js
CHANGED
|
@@ -1,36 +1,12 @@
|
|
|
1
1
|
import { generateRandomValues } from "./crypto.js";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/uuids.tsx
|
|
4
3
|
function generateUuid() {
|
|
5
|
-
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ generateRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16));
|
|
4
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ generateRandomValues(/* @__PURE__ */ new Uint8Array(1))[0] & 15 >> +c / 4).toString(16));
|
|
6
5
|
}
|
|
7
|
-
(void 0)?.test("generateUuid", ({ expect }) => {
|
|
8
|
-
const uuid = generateUuid();
|
|
9
|
-
expect(uuid).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
|
|
10
|
-
const uuid2 = generateUuid();
|
|
11
|
-
expect(uuid).not.toBe(uuid2);
|
|
12
|
-
expect(uuid.charAt(14)).toBe("4");
|
|
13
|
-
expect("89ab").toContain(uuid.charAt(19));
|
|
14
|
-
});
|
|
15
6
|
function isUuid(str) {
|
|
16
7
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(str);
|
|
17
8
|
}
|
|
18
|
-
(void 0)?.test("isUuid", ({ expect }) => {
|
|
19
|
-
expect(isUuid("123e4567-e89b-42d3-a456-426614174000")).toBe(true);
|
|
20
|
-
expect(isUuid("123e4567-e89b-42d3-8456-426614174000")).toBe(true);
|
|
21
|
-
expect(isUuid("123e4567-e89b-42d3-9456-426614174000")).toBe(true);
|
|
22
|
-
expect(isUuid("123e4567-e89b-42d3-a456-426614174000")).toBe(true);
|
|
23
|
-
expect(isUuid("123e4567-e89b-42d3-b456-426614174000")).toBe(true);
|
|
24
|
-
expect(isUuid("")).toBe(false);
|
|
25
|
-
expect(isUuid("not-a-uuid")).toBe(false);
|
|
26
|
-
expect(isUuid("123e4567-e89b-12d3-a456-426614174000")).toBe(false);
|
|
27
|
-
expect(isUuid("123e4567-e89b-42d3-c456-426614174000")).toBe(false);
|
|
28
|
-
expect(isUuid("123e4567-e89b-42d3-a456-42661417400")).toBe(false);
|
|
29
|
-
expect(isUuid("123e4567-e89b-42d3-a456-4266141740000")).toBe(false);
|
|
30
|
-
expect(isUuid("123e4567-e89b-42d3-a456_426614174000")).toBe(false);
|
|
31
|
-
expect(isUuid("123E4567-E89B-42D3-A456-426614174000")).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
9
|
//#endregion
|
|
35
10
|
export { generateUuid, isUuid };
|
|
11
|
+
|
|
36
12
|
//# sourceMappingURL=uuids.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuids.js","names":[],"sources":["../../../src/utils/uuids.tsx"],"sourcesContent":["import { generateRandomValues } from \"./crypto\";\n\nexport function generateUuid() {\n // crypto.randomUuid is not supported in all browsers, so this is a polyfill\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ generateRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n}\nimport.meta.vitest?.test(\"generateUuid\", ({ expect }) => {\n // Test that the function returns a valid UUID\n const uuid = generateUuid();\n expect(uuid).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);\n\n // Test that multiple calls generate different UUIDs\n const uuid2 = generateUuid();\n expect(uuid).not.toBe(uuid2);\n\n // Test that the UUID is version 4 (random)\n expect(uuid.charAt(14)).toBe('4');\n\n // Test that the UUID has the correct variant (8, 9, a, or b in position 19)\n expect('89ab').toContain(uuid.charAt(19));\n});\n\nexport function isUuid(str: string) {\n return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(str);\n}\nimport.meta.vitest?.test(\"isUuid\", ({ expect }) => {\n // Test with valid UUIDs\n expect(isUuid(\"123e4567-e89b-42d3-a456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-8456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-9456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-a456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-b456-426614174000\")).toBe(true);\n\n // Test with invalid UUIDs\n expect(isUuid(\"\")).toBe(false);\n expect(isUuid(\"not-a-uuid\")).toBe(false);\n expect(isUuid(\"123e4567-e89b-12d3-a456-426614174000\")).toBe(false); // Wrong version (not 4)\n expect(isUuid(\"123e4567-e89b-42d3-c456-426614174000\")).toBe(false); // Wrong variant (not 8, 9, a, or b)\n expect(isUuid(\"123e4567-e89b-42d3-a456-42661417400\")).toBe(false); // Too short\n expect(isUuid(\"123e4567-e89b-42d3-a456-4266141740000\")).toBe(false); // Too long\n expect(isUuid(\"123e4567-e89b-42d3-a456_426614174000\")).toBe(false); // Wrong format (underscore instead of dash)\n\n // Test with uppercase letters (should fail as UUID should be lowercase)\n expect(isUuid(\"123E4567-E89B-42D3-A456-426614174000\")).toBe(false);\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"uuids.js","names":[],"sources":["../../../src/utils/uuids.tsx"],"sourcesContent":["import { generateRandomValues } from \"./crypto\";\n\nexport function generateUuid() {\n // crypto.randomUuid is not supported in all browsers, so this is a polyfill\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ generateRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n}\nimport.meta.vitest?.test(\"generateUuid\", ({ expect }) => {\n // Test that the function returns a valid UUID\n const uuid = generateUuid();\n expect(uuid).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);\n\n // Test that multiple calls generate different UUIDs\n const uuid2 = generateUuid();\n expect(uuid).not.toBe(uuid2);\n\n // Test that the UUID is version 4 (random)\n expect(uuid.charAt(14)).toBe('4');\n\n // Test that the UUID has the correct variant (8, 9, a, or b in position 19)\n expect('89ab').toContain(uuid.charAt(19));\n});\n\nexport function isUuid(str: string) {\n return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(str);\n}\nimport.meta.vitest?.test(\"isUuid\", ({ expect }) => {\n // Test with valid UUIDs\n expect(isUuid(\"123e4567-e89b-42d3-a456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-8456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-9456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-a456-426614174000\")).toBe(true);\n expect(isUuid(\"123e4567-e89b-42d3-b456-426614174000\")).toBe(true);\n\n // Test with invalid UUIDs\n expect(isUuid(\"\")).toBe(false);\n expect(isUuid(\"not-a-uuid\")).toBe(false);\n expect(isUuid(\"123e4567-e89b-12d3-a456-426614174000\")).toBe(false); // Wrong version (not 4)\n expect(isUuid(\"123e4567-e89b-42d3-c456-426614174000\")).toBe(false); // Wrong variant (not 8, 9, a, or b)\n expect(isUuid(\"123e4567-e89b-42d3-a456-42661417400\")).toBe(false); // Too short\n expect(isUuid(\"123e4567-e89b-42d3-a456-4266141740000\")).toBe(false); // Too long\n expect(isUuid(\"123e4567-e89b-42d3-a456_426614174000\")).toBe(false); // Wrong format (underscore instead of dash)\n\n // Test with uppercase letters (should fail as UUID should be lowercase)\n expect(isUuid(\"123E4567-E89B-42D3-A456-426614174000\")).toBe(false);\n});\n"],"mappings":";;AAEA,SAAgB,eAAe;CAE7B,OAAO,uCAAuC,QAAQ,WAAU,OAC7D,CAAC,IAAI,qCAAqB,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,EAAA,CAAG,SAAS,EAAE,CAC9E;AACF;AAiBA,SAAgB,OAAO,KAAa;CAClC,OAAO,wEAAwE,KAAK,GAAG;AACzF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { h as OptionalKeys, v as RequiredKeys } from "./types-DfTcxNtM.js";
|
|
2
|
+
|
|
3
|
+
//#region src/config/format.d.ts
|
|
4
|
+
type ConfigValue = string | number | boolean | null | ConfigValue[] | Config;
|
|
5
|
+
type Config = {
|
|
6
|
+
[keyOrDotNotation: string]: ConfigValue | undefined;
|
|
7
|
+
};
|
|
8
|
+
type NormalizedConfigValue = string | number | boolean | NormalizedConfig | NormalizedConfigValue[];
|
|
9
|
+
type NormalizedConfig = {
|
|
10
|
+
[key: string]: NormalizedConfigValue | undefined;
|
|
11
|
+
};
|
|
12
|
+
type _NormalizesTo<N> = N extends readonly any[] ? { [K in keyof N]: _NormalizesTo<N[K]> } : N extends object ? (Config & { [K in OptionalKeys<N>]?: _NormalizesTo<N[K]> | null } & { [K in RequiredKeys<N>]: undefined extends N[K] ? _NormalizesTo<N[K]> | null : _NormalizesTo<N[K]> } & { [K in `${string}.${string}`]: ConfigValue }) : N;
|
|
13
|
+
type NormalizesTo<N extends NormalizedConfig> = _NormalizesTo<N>;
|
|
14
|
+
/**
|
|
15
|
+
* Note that a config can both be valid and not normalizable.
|
|
16
|
+
*/
|
|
17
|
+
declare function isValidConfig(c: unknown): c is Config;
|
|
18
|
+
declare function getInvalidConfigReason(c: unknown, options?: {
|
|
19
|
+
configName?: string;
|
|
20
|
+
}): string | undefined;
|
|
21
|
+
declare function assertValidConfig(c: unknown): void;
|
|
22
|
+
declare function override(c1: Config, ...configs: Config[]): Config;
|
|
23
|
+
/**
|
|
24
|
+
* Removes keys from a config override, using the same nested key logic as the `override` function.
|
|
25
|
+
* Resetting key "a.b" also resets "a.b.c" (and any other descendants).
|
|
26
|
+
* Handles both flat dot-notation keys and nested object keys.
|
|
27
|
+
*/
|
|
28
|
+
declare function removeKeysFromConfig(config: Config, keysToRemove: string[]): Config;
|
|
29
|
+
type NormalizeOptions = {
|
|
30
|
+
/**
|
|
31
|
+
* What to do if a dot notation is used on a value that is not an object.
|
|
32
|
+
*
|
|
33
|
+
* - "throw" (default): Throw an error.
|
|
34
|
+
* - "ignore": Ignore the dot notation field.
|
|
35
|
+
*/
|
|
36
|
+
onDotIntoNonObject?: "throw" | "ignore";
|
|
37
|
+
/**
|
|
38
|
+
* What to do if a dot notation is used on a value that is null.
|
|
39
|
+
*
|
|
40
|
+
* - "like-non-object" (default): Treat it like a non-object. See `onDotIntoNonObject`.
|
|
41
|
+
* - "throw": Throw an error.
|
|
42
|
+
* - "ignore": Ignore the dot notation field.
|
|
43
|
+
* - "empty-object": Set the value to an empty object.
|
|
44
|
+
*/
|
|
45
|
+
onDotIntoNull?: "like-non-object" | "throw" | "ignore" | "empty-object";
|
|
46
|
+
/**
|
|
47
|
+
* If provided, keys that are silently dropped during normalization (when a dot-notation key
|
|
48
|
+
* references a parent that doesn't exist or is not an object and the behavior is "ignore")
|
|
49
|
+
* will be pushed to this array.
|
|
50
|
+
*/
|
|
51
|
+
droppedKeys?: string[];
|
|
52
|
+
};
|
|
53
|
+
declare class NormalizationError extends Error {
|
|
54
|
+
constructor(...args: ConstructorParameters<typeof Error>);
|
|
55
|
+
}
|
|
56
|
+
declare function isNormalized(c: Config): c is NormalizedConfig;
|
|
57
|
+
declare function assertNormalized(c: Config): asserts c is NormalizedConfig;
|
|
58
|
+
declare function normalize(c: Config, options?: NormalizeOptions): NormalizedConfig;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { NormalizedConfigValue as a, assertNormalized as c, isNormalized as d, isValidConfig as f, removeKeysFromConfig as h, NormalizedConfig as i, assertValidConfig as l, override as m, ConfigValue as n, NormalizesTo as o, normalize as p, NormalizationError as r, _NormalizesTo as s, Config as t, getInvalidConfigReason as u };
|
|
61
|
+
//# sourceMappingURL=format-4JG1MGv5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-4JG1MGv5.d.ts","names":[],"sources":["../src/config/format.ts"],"mappings":";;;KAQY,WAAA,sCAAiD,WAAA,KAAgB,MAAM;AAAA,KACvE,MAAA;EAAA,CACT,gBAAA,WAA2B,WAAW;AAAA;AAAA,KAG7B,qBAAA,+BAAoD,gBAAA,GAAmB,qBAAqB;AAAA,KAC5F,gBAAA;EAAA,CACT,GAAA,WAAc,qBAAqB;AAAA;AAAA,KAG1B,aAAA,MAAmB,CAAA,wCACb,CAAA,GAAI,aAAA,CAAc,CAAA,CAAE,CAAA,OAClC,CAAA,mBACE,MAAA,WACQ,YAAA,CAAa,CAAA,KAAM,aAAA,CAAc,CAAA,CAAE,CAAA,sBACnC,YAAA,CAAa,CAAA,sBAAuB,CAAA,CAAE,CAAA,IAAK,aAAA,CAAc,CAAA,CAAE,CAAA,YAAa,aAAA,CAAc,CAAA,CAAE,CAAA,uCAChE,WAAA,MAChC,CAAA;AAAA,KACM,YAAA,WAAuB,gBAAA,IAAoB,aAAA,CAAc,CAAA;;;;iBAKrD,aAAA,CAAc,CAAA,YAAa,CAAA,IAAK,MAAM;AAAA,iBAItC,sBAAA,CAAuB,CAAA,WAAY,OAAA;EAAW,UAAA;AAAA;AAAA,iBA8C9C,iBAAA,CAAkB,CAAU;AAAA,iBAK5B,QAAA,CAAS,EAAA,EAAI,MAAA,KAAW,OAAA,EAAS,MAAA,KAAQ,MAAA;;;;;;iBA0BzC,oBAAA,CAAqB,MAAA,EAAQ,MAAA,EAAQ,YAAA,aAAyB,MAAM;AAAA,KAgH/E,gBAAA;EA1M0C;;;;;;EAiN7C,kBAAA;EAhNqE;;;;;;;;EAyNrE,aAAA;EAvNK;;;;;EA6NL,WAAA;AAAA;AAAA,cAGW,kBAAA,SAA2B,KAAA;iBACvB,IAAA,EAAM,qBAAA,QAA6B,KAAA;AAAA;AAAA,iBAMpC,YAAA,CAAa,CAAA,EAAG,MAAA,GAAS,CAAA,IAAK,gBAAgB;AAAA,iBAU9C,gBAAA,CAAiB,CAAA,EAAG,MAAA,WAAiB,CAAA,IAAK,gBAAgB;AAAA,iBAK1D,SAAA,CAAU,CAAA,EAAG,MAAA,EAAQ,OAAA,GAAS,gBAAA,GAAwB,gBAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/interface/page-component-versions.d.ts
|
|
2
|
+
type PageVersionEntry = {
|
|
3
|
+
minSdkVersion: `${number}.${number}.${number}`;
|
|
4
|
+
upgradePrompt: string;
|
|
5
|
+
changelog: string;
|
|
6
|
+
};
|
|
7
|
+
type PageVersions = Record<number, PageVersionEntry> & {
|
|
8
|
+
1: PageVersionEntry;
|
|
9
|
+
};
|
|
10
|
+
type PageComponentKey = Exclude<keyof HandlerPageUrls, "handler">;
|
|
11
|
+
type CustomPagePrompt = {
|
|
12
|
+
title: string;
|
|
13
|
+
fullPrompt: string;
|
|
14
|
+
versions: PageVersions;
|
|
15
|
+
};
|
|
16
|
+
declare function getCustomPagePrompts(): Record<PageComponentKey, CustomPagePrompt>;
|
|
17
|
+
declare function getLatestPageVersions(): Record<string, {
|
|
18
|
+
version: number;
|
|
19
|
+
changelogs: Record<number, string>;
|
|
20
|
+
}>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/interface/handler-urls.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Plain string URLs are deprecated. Use `{ type: "custom", url: "...", version: 0 }` instead.
|
|
25
|
+
*/
|
|
26
|
+
type DeprecatedStringUrl = string;
|
|
27
|
+
type HandlerPageUrls = Record<"handler" | "signIn" | "signUp" | "signOut" | "emailVerification" | "passwordReset" | "forgotPassword" | "oauthCallback" | "magicLinkCallback" | "accountSettings" | "teamInvitation" | "cliAuthConfirm" | "mfa" | "error" | "onboarding", DeprecatedStringUrl | {
|
|
28
|
+
type: "custom";
|
|
29
|
+
url: string;
|
|
30
|
+
version: number;
|
|
31
|
+
} | {
|
|
32
|
+
type: "hosted" | "handler-component";
|
|
33
|
+
}>;
|
|
34
|
+
type HandlerRedirectUrls = Record<"afterSignIn" | "afterSignUp" | "afterSignOut" | "home", string>;
|
|
35
|
+
type HandlerUrls = HandlerPageUrls & HandlerRedirectUrls;
|
|
36
|
+
type HandlerUrlTarget = HandlerUrls[keyof HandlerUrls];
|
|
37
|
+
/**
|
|
38
|
+
* The default handler URL target, applied to any key not explicitly set.
|
|
39
|
+
*
|
|
40
|
+
* - `{ type: "handler-component" }` — render the page inside the local `StackHandler` component (current default, may change in the next breaking version).
|
|
41
|
+
* - `{ type: "hosted" }` — redirect to Stack's hosted auth pages.
|
|
42
|
+
*/
|
|
43
|
+
type DefaultHandlerUrlTarget = {
|
|
44
|
+
type: "hosted" | "handler-component";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for where each auth page/redirect lives.
|
|
48
|
+
*
|
|
49
|
+
* **`default`** — fallback target for every key not set individually:
|
|
50
|
+
* - `{ type: "handler-component" }` — use the local `StackHandler` (current default, may change in the next breaking version).
|
|
51
|
+
* - `{ type: "hosted" }` — use Stack's hosted auth pages.
|
|
52
|
+
*
|
|
53
|
+
* **Page keys** (`signIn`, `signUp`, `signOut`, `emailVerification`, `passwordReset`,
|
|
54
|
+
* `forgotPassword`, `oauthCallback`, `magicLinkCallback`, `accountSettings`,
|
|
55
|
+
* `teamInvitation`, `cliAuthConfirm`, `mfa`, `error`, `onboarding`, `handler`):
|
|
56
|
+
* - A URL string (e.g. `"/my-sign-in"`) — custom path.
|
|
57
|
+
* - `{ type: "custom", url: "...", version: 0 }` — custom URL with version tracking.
|
|
58
|
+
* - `{ type: "hosted" }` — Stack's hosted page.
|
|
59
|
+
* - `{ type: "handler-component" }` — local `StackHandler`.
|
|
60
|
+
*
|
|
61
|
+
* **Redirect keys** (`afterSignIn`, `afterSignUp`, `afterSignOut`, `home`):
|
|
62
|
+
* - A URL string (e.g. `"/dashboard"`) — where to redirect after the action.
|
|
63
|
+
*/
|
|
64
|
+
type HandlerUrlOptions = Partial<HandlerUrls> & {
|
|
65
|
+
default?: DefaultHandlerUrlTarget;
|
|
66
|
+
};
|
|
67
|
+
type ResolvedHandlerUrls = { [K in keyof HandlerUrls]: string };
|
|
68
|
+
//#endregion
|
|
69
|
+
export { HandlerUrlTarget as a, CustomPagePrompt as c, PageVersions as d, getCustomPagePrompts as f, HandlerUrlOptions as i, PageComponentKey as l, HandlerPageUrls as n, HandlerUrls as o, getLatestPageVersions as p, HandlerRedirectUrls as r, ResolvedHandlerUrls as s, DefaultHandlerUrlTarget as t, PageVersionEntry as u };
|
|
70
|
+
//# sourceMappingURL=handler-urls-BHt3v8Ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler-urls-BHt3v8Ai.d.ts","names":[],"sources":["../src/interface/page-component-versions.ts","../src/interface/handler-urls.ts"],"mappings":";KAmBY,gBAAA;EACV,aAAA;EACA,aAAA;EACA,SAAA;AAAA;AAAA,KAGU,YAAA,GAAe,MAAA,SAAe,gBAAA;EAAsB,CAAA,EAAG,gBAAA;AAAA;AAAA,KAEvD,gBAAA,GAAmB,OAAO,OAAO,eAAA;AAAA,KAEjC,gBAAA;EACV,KAAA;EACA,UAAA;EACA,QAAA,EAAU,YAAY;AAAA;AAAA,iBAySR,oBAAA,IAAwB,MAAA,CAAO,gBAAA,EAAkB,gBAAA;AAAA,iBA81CjD,qBAAA,IAAyB,MAAM;EAAW,OAAA;EAAiB,UAAA,EAAY,MAAA;AAAA;;;;AAppDvF;;KChBK,mBAAA;AAAA,KAEO,eAAA,GAAkB,MAAM,4OAgBlC,mBAAA;EAAwB,IAAA;EAAgB,GAAA;EAAa,OAAA;AAAA;EAAsB,IAAA;AAAA;AAAA,KAGjE,mBAAA,GAAsB,MAAM;AAAA,KAQ5B,WAAA,GAAc,eAAA,GAAkB,mBAAmB;AAAA,KACnD,gBAAA,GAAmB,WAAA,OAAkB,WAAW;;;;;;;KAQhD,uBAAA;EAA4B,IAAI;AAAA;ADhBuC;AAEnF;;;;AAA4D;AAE5D;;;;;;;;;AAGwB;AAySxB;;AAhTmF,KCoCvE,iBAAA,GAAoB,OAAA,CAAQ,WAAA;EAAiB,OAAA,GAAU,uBAAA;AAAA;AAAA,KACvD,mBAAA,iBACE,WAAW"}
|
package/dist/helpers/emails.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_chunk = require('../chunk-BE-pF4vm.js');
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
2
|
let ___utils_strings_js = require("../utils/strings.js");
|
|
4
|
-
|
|
5
3
|
//#region src/helpers/emails.ts
|
|
6
4
|
const defaultNewTemplateSource = ___utils_strings_js.deindent`
|
|
7
5
|
import { type } from "arktype"
|
|
@@ -239,7 +237,6 @@ const DEFAULT_TEMPLATE_IDS = {
|
|
|
239
237
|
payment_receipt: EMAIL_TEMPLATE_PAYMENT_RECEIPT_ID,
|
|
240
238
|
payment_failed: EMAIL_TEMPLATE_PAYMENT_FAILED_ID
|
|
241
239
|
};
|
|
242
|
-
|
|
243
240
|
//#endregion
|
|
244
241
|
exports.DEFAULT_EMAIL_TEMPLATES = DEFAULT_EMAIL_TEMPLATES;
|
|
245
242
|
exports.DEFAULT_EMAIL_THEMES = DEFAULT_EMAIL_THEMES;
|
|
@@ -249,4 +246,5 @@ exports.LightEmailTheme = LightEmailTheme;
|
|
|
249
246
|
exports.defaultNewTemplateSource = defaultNewTemplateSource;
|
|
250
247
|
exports.emptyEmailTheme = emptyEmailTheme;
|
|
251
248
|
exports.previewTemplateSource = previewTemplateSource;
|
|
249
|
+
|
|
252
250
|
//# sourceMappingURL=emails.js.map
|