@hexclave/shared 1.0.41 → 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 +2 -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 +2 -3
- 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 +25 -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 +227 -228
- 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 +10 -10
- 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 +8 -8
- 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 +22 -24
- 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 +30 -32
- 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 +21 -22
- 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 +5 -6
- 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 +63 -65
- 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 +36 -38
- 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 +14 -16
- 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 +21 -22
- 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 +4 -4
- 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 +14 -14
- 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 +6 -6
- 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 +8 -8
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featurebase.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/featurebase.tsx"],"sourcesContent":["import { getEnvVariable } from \"./env\";\nimport { HexclaveAssertionError } from \"./errors\";\n\nexport type FeaturebaseUser = {\n userId: string,\n email: string,\n name?: string,\n profilePicture?: string,\n};\n\nexport type HexclaveAuthUser = {\n id: string,\n primaryEmail: string | null,\n displayName?: string | null,\n profileImageUrl?: string | null,\n};\n\n/**\n * Find a Featurebase user by their Hexclave user ID\n */\nasync function findFeaturebaseUserById(hexclaveAuthUserId: string, apiKey: string): Promise<FeaturebaseUser | null> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/organization/identifyUser?id=${hexclaveAuthUserId}`, {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n },\n });\n\n if (response.status === 404) {\n return null;\n }\n\n if (!response.ok) {\n throw new HexclaveAssertionError(`Failed to find Featurebase user by ID: ${response.statusText}`);\n }\n\n const data = await response.json();\n const user = data.user;\n\n if (!user) {\n throw new HexclaveAssertionError(`Featurebase API returned success but no user data for ID: ${hexclaveAuthUserId}`, { data });\n }\n\n return {\n userId: user.externalUserId || user.userId || hexclaveAuthUserId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n };\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to find Featurebase user by ID\", { cause: error });\n }\n}\n\n/**\n * Find a Featurebase user by their email address\n */\nasync function findFeaturebaseUserByEmail(email: string, apiKey: string): Promise<FeaturebaseUser | null> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/organization/identifyUser?email=${encodeURIComponent(email)}`, {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n },\n });\n\n if (response.status === 404) {\n return null;\n }\n\n if (!response.ok) {\n throw new HexclaveAssertionError(`Failed to find Featurebase user by email: ${response.statusText}`);\n }\n\n const data = await response.json();\n const user = data.user;\n\n if (!user) {\n throw new HexclaveAssertionError(`Featurebase API returned success but no user data for email: ${email}`, { data });\n }\n\n return {\n userId: user.externalUserId || user.userId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n };\n } catch (error) {\n console.error('Error finding Featurebase user by email:', error);\n return null;\n }\n}\n\n/**\n * Create a new Featurebase user using the identifyUser endpoint\n */\nasync function createFeaturebaseUser(user: FeaturebaseUser, apiKey: string): Promise<FeaturebaseUser> {\n try {\n const response = await fetch('https://do.featurebase.app/v2/organization/identifyUser', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-API-Key': apiKey,\n },\n body: JSON.stringify({\n userId: user.userId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n }),\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new HexclaveAssertionError(`Failed to create Featurebase user: ${errorData.error || response.statusText}`, { errorData });\n }\n\n // The identifyUser endpoint just returns { \"success\": true }, so we return the input data\n return user;\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to create Featurebase user\", { cause: error });\n\n }\n}\n\n/**\n * Update an existing Featurebase user (excluding email)\n */\nasync function updateFeaturebaseUser(userId: string, updates: Partial<Omit<FeaturebaseUser, 'userId' | 'email'>>, apiKey: string): Promise<FeaturebaseUser> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/users/${userId}`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n 'X-API-Key': apiKey,\n },\n body: JSON.stringify(updates),\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new HexclaveAssertionError(`Failed to update Featurebase user: ${errorData.error || response.statusText}`, { errorData });\n }\n\n const data = await response.json();\n return {\n userId: data.userId || userId,\n email: data.email,\n name: data.name,\n profilePicture: data.profilePicture,\n };\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to update Featurebase user\", { cause: error });\n }\n}\n\n/**\n * Get or create a Featurebase user based on Hexclave user data.\n * This function ensures that:\n * 1. We never change a user's email address on Featurebase\n * 2. We use Hexclave user ID as the primary identifier\n * 3. We handle email conflicts by using fallback emails\n * 4. We update profile information when needed\n */\nexport async function getOrCreateFeaturebaseUser(\n hexclaveAuthUser: HexclaveAuthUser,\n options?: { apiKey?: string }\n): Promise<{ userId: string, email: string }> {\n const apiKey = options?.apiKey || getEnvVariable(\"STACK_FEATUREBASE_API_KEY\");\n const fallbackEmail = `${hexclaveAuthUser.id}@featurebase-user.stack-auth-app.com`;\n\n // First, try to find existing user by Hexclave user ID\n const existingById = await findFeaturebaseUserById(hexclaveAuthUser.id, apiKey);\n if (existingById) {\n // Ensure the user has an email on Featurebase.\n let ensuredEmail = existingById.email;\n if (!ensuredEmail) {\n try {\n await createFeaturebaseUser({\n userId: existingById.userId,\n email: fallbackEmail,\n name: hexclaveAuthUser.displayName || undefined,\n profilePicture: hexclaveAuthUser.profileImageUrl || undefined,\n }, apiKey);\n ensuredEmail = fallbackEmail;\n } catch (e) {\n // If setting fallback email failed, keep ensuredEmail as-is (undefined) and let callers handle\n throw new HexclaveAssertionError(`Failed to set fallback email for existing Featurebase user ${existingById.userId}`, { cause: e });\n }\n }\n\n // Update profile information if needed (but not email)\n try {\n const updates: Partial<Omit<FeaturebaseUser, 'userId' | 'email'>> = {};\n\n if (hexclaveAuthUser.displayName && hexclaveAuthUser.displayName !== existingById.name) {\n updates.name = hexclaveAuthUser.displayName;\n }\n\n if (hexclaveAuthUser.profileImageUrl && hexclaveAuthUser.profileImageUrl !== existingById.profilePicture) {\n updates.profilePicture = hexclaveAuthUser.profileImageUrl;\n }\n\n if (Object.keys(updates).length > 0) {\n await updateFeaturebaseUser(existingById.userId, updates, apiKey);\n }\n } catch (error) {\n console.error('Failed to update existing Featurebase user profile:', error);\n // Continue with existing user data even if update fails\n }\n\n return {\n userId: existingById.userId,\n email: ensuredEmail,\n };\n }\n\n // No existing user found by ID, need to create one\n const candidateEmail = hexclaveAuthUser.primaryEmail ?? fallbackEmail;\n\n // Check if someone already has this email on Featurebase\n const existingByEmail = await findFeaturebaseUserByEmail(candidateEmail, apiKey);\n const safeEmail = existingByEmail ? fallbackEmail : candidateEmail;\n\n // Create new user\n const created = await createFeaturebaseUser({\n userId: hexclaveAuthUser.id,\n email: safeEmail,\n name: hexclaveAuthUser.displayName || hexclaveAuthUser.primaryEmail?.split('@')[0] || 'User',\n profilePicture: hexclaveAuthUser.profileImageUrl || undefined,\n }, apiKey);\n\n return {\n userId: created.userId,\n email: created.email,\n };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"featurebase.js","names":["HexclaveAssertionError"],"sources":["../../src/utils/featurebase.tsx"],"sourcesContent":["import { getEnvVariable } from \"./env\";\nimport { HexclaveAssertionError } from \"./errors\";\n\nexport type FeaturebaseUser = {\n userId: string,\n email: string,\n name?: string,\n profilePicture?: string,\n};\n\nexport type HexclaveAuthUser = {\n id: string,\n primaryEmail: string | null,\n displayName?: string | null,\n profileImageUrl?: string | null,\n};\n\n/**\n * Find a Featurebase user by their Hexclave user ID\n */\nasync function findFeaturebaseUserById(hexclaveAuthUserId: string, apiKey: string): Promise<FeaturebaseUser | null> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/organization/identifyUser?id=${hexclaveAuthUserId}`, {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n },\n });\n\n if (response.status === 404) {\n return null;\n }\n\n if (!response.ok) {\n throw new HexclaveAssertionError(`Failed to find Featurebase user by ID: ${response.statusText}`);\n }\n\n const data = await response.json();\n const user = data.user;\n\n if (!user) {\n throw new HexclaveAssertionError(`Featurebase API returned success but no user data for ID: ${hexclaveAuthUserId}`, { data });\n }\n\n return {\n userId: user.externalUserId || user.userId || hexclaveAuthUserId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n };\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to find Featurebase user by ID\", { cause: error });\n }\n}\n\n/**\n * Find a Featurebase user by their email address\n */\nasync function findFeaturebaseUserByEmail(email: string, apiKey: string): Promise<FeaturebaseUser | null> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/organization/identifyUser?email=${encodeURIComponent(email)}`, {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n },\n });\n\n if (response.status === 404) {\n return null;\n }\n\n if (!response.ok) {\n throw new HexclaveAssertionError(`Failed to find Featurebase user by email: ${response.statusText}`);\n }\n\n const data = await response.json();\n const user = data.user;\n\n if (!user) {\n throw new HexclaveAssertionError(`Featurebase API returned success but no user data for email: ${email}`, { data });\n }\n\n return {\n userId: user.externalUserId || user.userId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n };\n } catch (error) {\n console.error('Error finding Featurebase user by email:', error);\n return null;\n }\n}\n\n/**\n * Create a new Featurebase user using the identifyUser endpoint\n */\nasync function createFeaturebaseUser(user: FeaturebaseUser, apiKey: string): Promise<FeaturebaseUser> {\n try {\n const response = await fetch('https://do.featurebase.app/v2/organization/identifyUser', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-API-Key': apiKey,\n },\n body: JSON.stringify({\n userId: user.userId,\n email: user.email,\n name: user.name,\n profilePicture: user.profilePicture,\n }),\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new HexclaveAssertionError(`Failed to create Featurebase user: ${errorData.error || response.statusText}`, { errorData });\n }\n\n // The identifyUser endpoint just returns { \"success\": true }, so we return the input data\n return user;\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to create Featurebase user\", { cause: error });\n\n }\n}\n\n/**\n * Update an existing Featurebase user (excluding email)\n */\nasync function updateFeaturebaseUser(userId: string, updates: Partial<Omit<FeaturebaseUser, 'userId' | 'email'>>, apiKey: string): Promise<FeaturebaseUser> {\n try {\n const response = await fetch(`https://do.featurebase.app/v2/users/${userId}`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n 'X-API-Key': apiKey,\n },\n body: JSON.stringify(updates),\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n throw new HexclaveAssertionError(`Failed to update Featurebase user: ${errorData.error || response.statusText}`, { errorData });\n }\n\n const data = await response.json();\n return {\n userId: data.userId || userId,\n email: data.email,\n name: data.name,\n profilePicture: data.profilePicture,\n };\n } catch (error) {\n if (error instanceof HexclaveAssertionError) {\n throw error;\n }\n throw new HexclaveAssertionError(\"Failed to update Featurebase user\", { cause: error });\n }\n}\n\n/**\n * Get or create a Featurebase user based on Hexclave user data.\n * This function ensures that:\n * 1. We never change a user's email address on Featurebase\n * 2. We use Hexclave user ID as the primary identifier\n * 3. We handle email conflicts by using fallback emails\n * 4. We update profile information when needed\n */\nexport async function getOrCreateFeaturebaseUser(\n hexclaveAuthUser: HexclaveAuthUser,\n options?: { apiKey?: string }\n): Promise<{ userId: string, email: string }> {\n const apiKey = options?.apiKey || getEnvVariable(\"STACK_FEATUREBASE_API_KEY\");\n const fallbackEmail = `${hexclaveAuthUser.id}@featurebase-user.stack-auth-app.com`;\n\n // First, try to find existing user by Hexclave user ID\n const existingById = await findFeaturebaseUserById(hexclaveAuthUser.id, apiKey);\n if (existingById) {\n // Ensure the user has an email on Featurebase.\n let ensuredEmail = existingById.email;\n if (!ensuredEmail) {\n try {\n await createFeaturebaseUser({\n userId: existingById.userId,\n email: fallbackEmail,\n name: hexclaveAuthUser.displayName || undefined,\n profilePicture: hexclaveAuthUser.profileImageUrl || undefined,\n }, apiKey);\n ensuredEmail = fallbackEmail;\n } catch (e) {\n // If setting fallback email failed, keep ensuredEmail as-is (undefined) and let callers handle\n throw new HexclaveAssertionError(`Failed to set fallback email for existing Featurebase user ${existingById.userId}`, { cause: e });\n }\n }\n\n // Update profile information if needed (but not email)\n try {\n const updates: Partial<Omit<FeaturebaseUser, 'userId' | 'email'>> = {};\n\n if (hexclaveAuthUser.displayName && hexclaveAuthUser.displayName !== existingById.name) {\n updates.name = hexclaveAuthUser.displayName;\n }\n\n if (hexclaveAuthUser.profileImageUrl && hexclaveAuthUser.profileImageUrl !== existingById.profilePicture) {\n updates.profilePicture = hexclaveAuthUser.profileImageUrl;\n }\n\n if (Object.keys(updates).length > 0) {\n await updateFeaturebaseUser(existingById.userId, updates, apiKey);\n }\n } catch (error) {\n console.error('Failed to update existing Featurebase user profile:', error);\n // Continue with existing user data even if update fails\n }\n\n return {\n userId: existingById.userId,\n email: ensuredEmail,\n };\n }\n\n // No existing user found by ID, need to create one\n const candidateEmail = hexclaveAuthUser.primaryEmail ?? fallbackEmail;\n\n // Check if someone already has this email on Featurebase\n const existingByEmail = await findFeaturebaseUserByEmail(candidateEmail, apiKey);\n const safeEmail = existingByEmail ? fallbackEmail : candidateEmail;\n\n // Create new user\n const created = await createFeaturebaseUser({\n userId: hexclaveAuthUser.id,\n email: safeEmail,\n name: hexclaveAuthUser.displayName || hexclaveAuthUser.primaryEmail?.split('@')[0] || 'User',\n profilePicture: hexclaveAuthUser.profileImageUrl || undefined,\n }, apiKey);\n\n return {\n userId: created.userId,\n email: created.email,\n };\n}\n"],"mappings":"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"}
|
package/dist/utils/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","names":[],"sources":["../../src/utils/fs.tsx"],"mappings":";iBAGsB,IAAA,CAAK,IAAA,WAAY,OAAA;AAAA,iBAIjB,eAAA,CAAgB,CAAA,UAAW,OAAA;EAAW,kBAAA;AAAA,IAAsC,
|
|
1
|
+
{"version":3,"file":"fs.d.ts","names":[],"sources":["../../src/utils/fs.tsx"],"mappings":";iBAGsB,IAAA,CAAK,IAAA,WAAY,OAAA;AAAA,iBAIjB,eAAA,CAAgB,CAAA,UAAW,OAAA;EAAW,kBAAA;AAAA,IAAsC,OAAO;AAAA,iBAiBzF,sBAAA,CAAuB,IAAA,UAAc,OAAe"}
|
package/dist/utils/fs.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
|
|
3
3
|
let fs = require("fs");
|
|
4
|
-
fs =
|
|
4
|
+
fs = require_rolldown_runtime.__toESM(fs);
|
|
5
5
|
let path = require("path");
|
|
6
|
-
path =
|
|
7
|
-
|
|
6
|
+
path = require_rolldown_runtime.__toESM(path);
|
|
8
7
|
//#region src/utils/fs.tsx
|
|
9
8
|
async function list(path$1) {
|
|
10
9
|
return await fs.promises.readdir(path$1);
|
|
@@ -23,9 +22,9 @@ function writeFileSyncIfChanged(path$2, content) {
|
|
|
23
22
|
}
|
|
24
23
|
fs.writeFileSync(path$2, content);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
26
|
exports.list = list;
|
|
29
27
|
exports.listRecursively = listRecursively;
|
|
30
28
|
exports.writeFileSyncIfChanged = writeFileSyncIfChanged;
|
|
29
|
+
|
|
31
30
|
//# sourceMappingURL=fs.js.map
|
package/dist/utils/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","names":["hexclaveFs","path"],"sources":["../../src/utils/fs.tsx"],"sourcesContent":["import * as hexclaveFs from \"fs\";\nimport * as path from \"path\";\n\nexport async function list(path: string) {\n return await hexclaveFs.promises.readdir(path);\n}\n\nexport async function listRecursively(p: string, options: { excludeDirectories?: boolean } = {}): Promise<string[]> {\n const files = await list(p);\n return [\n ...(await Promise.all(files.map(async (fileName) => {\n const filePath = path.join(p, fileName);\n if ((await hexclaveFs.promises.stat(filePath)).isDirectory()) {\n return [\n ...(await listRecursively(filePath, options)),\n ...(options.excludeDirectories ? [] : [filePath]),\n ];\n } else {\n return [filePath];\n }\n }))).flat(),\n ];\n}\n\nexport function writeFileSyncIfChanged(path: string, content: string): void {\n if (hexclaveFs.existsSync(path)) {\n const existingContent = hexclaveFs.readFileSync(path, \"utf-8\");\n if (existingContent === content) {\n return;\n }\n }\n hexclaveFs.writeFileSync(path, content);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fs.js","names":["hexclaveFs","path"],"sources":["../../src/utils/fs.tsx"],"sourcesContent":["import * as hexclaveFs from \"fs\";\nimport * as path from \"path\";\n\nexport async function list(path: string) {\n return await hexclaveFs.promises.readdir(path);\n}\n\nexport async function listRecursively(p: string, options: { excludeDirectories?: boolean } = {}): Promise<string[]> {\n const files = await list(p);\n return [\n ...(await Promise.all(files.map(async (fileName) => {\n const filePath = path.join(p, fileName);\n if ((await hexclaveFs.promises.stat(filePath)).isDirectory()) {\n return [\n ...(await listRecursively(filePath, options)),\n ...(options.excludeDirectories ? [] : [filePath]),\n ];\n } else {\n return [filePath];\n }\n }))).flat(),\n ];\n}\n\nexport function writeFileSyncIfChanged(path: string, content: string): void {\n if (hexclaveFs.existsSync(path)) {\n const existingContent = hexclaveFs.readFileSync(path, \"utf-8\");\n if (existingContent === content) {\n return;\n }\n }\n hexclaveFs.writeFileSync(path, content);\n}\n"],"mappings":";;;;;;;AAGA,eAAsB,KAAK,QAAc;CACvC,OAAO,MAAMA,GAAW,SAAS,QAAQC,MAAI;AAC/C;AAEA,eAAsB,gBAAgB,GAAW,UAA4C,CAAC,GAAsB;CAClH,MAAM,QAAQ,MAAM,KAAK,CAAC;CAC1B,OAAO,CACL,IAAI,MAAM,QAAQ,IAAI,MAAM,IAAI,OAAO,aAAa;EAClD,MAAM,WAAW,KAAK,KAAK,GAAG,QAAQ;EACtC,KAAK,MAAMD,GAAW,SAAS,KAAK,QAAQ,EAAA,CAAG,YAAY,GACzD,OAAO,CACL,GAAI,MAAM,gBAAgB,UAAU,OAAO,GAC3C,GAAI,QAAQ,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CACjD;OAEA,OAAO,CAAC,QAAQ;CAEpB,CAAC,CAAC,EAAA,CAAG,KAAK,CACZ;AACF;AAEA,SAAgB,uBAAuB,QAAc,SAAuB;CAC1E,IAAIA,GAAW,WAAWC,MAAI;MACJD,GAAW,aAAaC,QAAM,OACpC,MAAM,SACtB;CAAA;CAGJ,GAAW,cAAcA,QAAM,OAAO;AACxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","names":[],"sources":["../../src/utils/functions.tsx"],"mappings":";iBAAgB,QAAA,
|
|
1
|
+
{"version":3,"file":"functions.d.ts","names":[],"sources":["../../src/utils/functions.tsx"],"mappings":";iBAAgB,QAAA,IAAY,CAAA,EAAG,CAAA,GAAI,CAAC;AAAA,iBAYpB,YAAA,qBAAiC,IAAA,EAAM,CAAA,GAAI,CAAC"}
|
package/dist/utils/functions.js
CHANGED
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
2
|
//#region src/utils/functions.tsx
|
|
4
3
|
function identity(t) {
|
|
5
4
|
return t;
|
|
6
5
|
}
|
|
7
|
-
(void 0)?.test("identity", ({ expect }) => {
|
|
8
|
-
expect(identity(1)).toBe(1);
|
|
9
|
-
expect(identity("test")).toBe("test");
|
|
10
|
-
expect(identity(null)).toBe(null);
|
|
11
|
-
expect(identity(void 0)).toBe(void 0);
|
|
12
|
-
const obj = { a: 1 };
|
|
13
|
-
expect(identity(obj)).toBe(obj);
|
|
14
|
-
});
|
|
15
6
|
function identityArgs(...args) {
|
|
16
7
|
return args;
|
|
17
8
|
}
|
|
18
|
-
(void 0)?.test("identityArgs", ({ expect }) => {
|
|
19
|
-
expect(identityArgs()).toEqual([]);
|
|
20
|
-
expect(identityArgs(1)).toEqual([1]);
|
|
21
|
-
expect(identityArgs(1, 2, 3)).toEqual([
|
|
22
|
-
1,
|
|
23
|
-
2,
|
|
24
|
-
3
|
|
25
|
-
]);
|
|
26
|
-
expect(identityArgs("a", "b", "c")).toEqual([
|
|
27
|
-
"a",
|
|
28
|
-
"b",
|
|
29
|
-
"c"
|
|
30
|
-
]);
|
|
31
|
-
expect(identityArgs(null, void 0)).toEqual([null, void 0]);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
9
|
//#endregion
|
|
35
10
|
exports.identity = identity;
|
|
36
11
|
exports.identityArgs = identityArgs;
|
|
12
|
+
|
|
37
13
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","names":[],"sources":["../../src/utils/functions.tsx"],"sourcesContent":["export function identity<T>(t: T): T {\n return t;\n}\nimport.meta.vitest?.test(\"identity\", ({ expect }) => {\n expect(identity(1)).toBe(1);\n expect(identity(\"test\")).toBe(\"test\");\n expect(identity(null)).toBe(null);\n expect(identity(undefined)).toBe(undefined);\n const obj = { a: 1 };\n expect(identity(obj)).toBe(obj);\n});\n\nexport function identityArgs<T extends any[]>(...args: T): T {\n return args;\n}\nimport.meta.vitest?.test(\"identityArgs\", ({ expect }) => {\n expect(identityArgs()).toEqual([]);\n expect(identityArgs(1)).toEqual([1]);\n expect(identityArgs(1, 2, 3)).toEqual([1, 2, 3]);\n expect(identityArgs(\"a\", \"b\", \"c\")).toEqual([\"a\", \"b\", \"c\"]);\n expect(identityArgs(null, undefined)).toEqual([null, undefined]);\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"functions.js","names":[],"sources":["../../src/utils/functions.tsx"],"sourcesContent":["export function identity<T>(t: T): T {\n return t;\n}\nimport.meta.vitest?.test(\"identity\", ({ expect }) => {\n expect(identity(1)).toBe(1);\n expect(identity(\"test\")).toBe(\"test\");\n expect(identity(null)).toBe(null);\n expect(identity(undefined)).toBe(undefined);\n const obj = { a: 1 };\n expect(identity(obj)).toBe(obj);\n});\n\nexport function identityArgs<T extends any[]>(...args: T): T {\n return args;\n}\nimport.meta.vitest?.test(\"identityArgs\", ({ expect }) => {\n expect(identityArgs()).toEqual([]);\n expect(identityArgs(1)).toEqual([1]);\n expect(identityArgs(1, 2, 3)).toEqual([1, 2, 3]);\n expect(identityArgs(\"a\", \"b\", \"c\")).toEqual([\"a\", \"b\", \"c\"]);\n expect(identityArgs(null, undefined)).toEqual([null, undefined]);\n});\n"],"mappings":";;AAAA,SAAgB,SAAY,GAAS;CACnC,OAAO;AACT;AAUA,SAAgB,aAA8B,GAAG,MAAY;CAC3D,OAAO;AACT"}
|
package/dist/utils/geo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo.d.ts","names":[],"sources":["../../src/utils/geo.tsx"],"mappings":";;;cAIa,aAAA,EAAa,KAAA,CAAA,YAAA;;;;;;;;GAQxB,KAAA,CAAA,SAAA;;;;;;;;;KAEU,OAAA,GAAU,KAAA,CAAI,
|
|
1
|
+
{"version":3,"file":"geo.d.ts","names":[],"sources":["../../src/utils/geo.tsx"],"mappings":";;;cAIa,aAAA,EAAa,KAAA,CAAA,YAAA;;;;;;;;GAQxB,KAAA,CAAA,SAAA;;;;;;;;;KAEU,OAAA,GAAU,KAAA,CAAI,SAAS,QAAQ,aAAA"}
|
package/dist/utils/geo.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 ___schema_fields_js = require("../schema-fields.js");
|
|
4
|
-
|
|
5
3
|
//#region src/utils/geo.tsx
|
|
6
4
|
const geoInfoSchema = (0, ___schema_fields_js.yupObject)({
|
|
7
5
|
ip: (0, ___schema_fields_js.yupString)().defined(),
|
|
@@ -12,7 +10,7 @@ const geoInfoSchema = (0, ___schema_fields_js.yupObject)({
|
|
|
12
10
|
longitude: (0, ___schema_fields_js.yupNumber)().nullable(),
|
|
13
11
|
tzIdentifier: (0, ___schema_fields_js.yupString)().nullable()
|
|
14
12
|
});
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
14
|
exports.geoInfoSchema = geoInfoSchema;
|
|
15
|
+
|
|
18
16
|
//# sourceMappingURL=geo.js.map
|
package/dist/utils/geo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo.js","names":[],"sources":["../../src/utils/geo.tsx"],"sourcesContent":["\nimport * as yup from \"yup\";\nimport { yupNumber, yupObject, yupString } from \"../schema-fields\";\n\nexport const geoInfoSchema = yupObject({\n ip: yupString().defined(),\n countryCode: yupString().nullable(),\n regionCode: yupString().nullable(),\n cityName: yupString().nullable(),\n latitude: yupNumber().nullable(),\n longitude: yupNumber().nullable(),\n tzIdentifier: yupString().nullable(),\n});\n\nexport type GeoInfo = yup.InferType<typeof geoInfoSchema>;\n\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo.js","names":[],"sources":["../../src/utils/geo.tsx"],"sourcesContent":["\nimport * as yup from \"yup\";\nimport { yupNumber, yupObject, yupString } from \"../schema-fields\";\n\nexport const geoInfoSchema = yupObject({\n ip: yupString().defined(),\n countryCode: yupString().nullable(),\n regionCode: yupString().nullable(),\n cityName: yupString().nullable(),\n latitude: yupNumber().nullable(),\n longitude: yupNumber().nullable(),\n tzIdentifier: yupString().nullable(),\n});\n\nexport type GeoInfo = yup.InferType<typeof geoInfoSchema>;\n\n"],"mappings":";;;AAIA,MAAa,iBAAA,GAAA,oBAAA,UAAA,CAA0B;CACrC,KAAA,GAAA,oBAAA,UAAA,CAAc,CAAC,CAAC,QAAQ;CACxB,cAAA,GAAA,oBAAA,UAAA,CAAuB,CAAC,CAAC,SAAS;CAClC,aAAA,GAAA,oBAAA,UAAA,CAAsB,CAAC,CAAC,SAAS;CACjC,WAAA,GAAA,oBAAA,UAAA,CAAoB,CAAC,CAAC,SAAS;CAC/B,WAAA,GAAA,oBAAA,UAAA,CAAoB,CAAC,CAAC,SAAS;CAC/B,YAAA,GAAA,oBAAA,UAAA,CAAqB,CAAC,CAAC,SAAS;CAChC,eAAA,GAAA,oBAAA,UAAA,CAAwB,CAAC,CAAC,SAAS;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","names":[],"sources":["../../src/utils/globals.tsx"],"mappings":";cAAM,SAAA;AAAA,iBAkBU,YAAA,
|
|
1
|
+
{"version":3,"file":"globals.d.ts","names":[],"sources":["../../src/utils/globals.tsx"],"mappings":";cAAM,SAAA;AAAA,iBAkBU,YAAA,IAAgB,GAAA,UAAa,IAAA,QAAY,CAAA,GAIP,CAAC;;;AAjBvC;AAaZ;iBAWgB,iBAAA,IAAqB,GAAA,UAAa,IAAA,QAAY,OAAA,CAAQ,CAAA,IAAK,OAAA,CAAQ,CAAA;AAAA,iBAYnE,SAAA,CAAU,GAAW;AAAA,iBAIrB,SAAA,CAAU,GAAA,UAAa,KAAU"}
|
package/dist/utils/globals.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
2
|
//#region src/utils/globals.tsx
|
|
4
3
|
const globalVar = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {};
|
|
5
4
|
if (typeof globalThis === "undefined") globalVar.globalThis = globalVar;
|
|
@@ -30,11 +29,11 @@ function getGlobal(key) {
|
|
|
30
29
|
function setGlobal(key, value) {
|
|
31
30
|
globalVar[hexclaveGlobalsSymbol][key] = value;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
//#endregion
|
|
35
33
|
exports.createGlobal = createGlobal;
|
|
36
34
|
exports.createGlobalAsync = createGlobalAsync;
|
|
37
35
|
exports.getGlobal = getGlobal;
|
|
38
36
|
exports.globalVar = globalVar;
|
|
39
37
|
exports.setGlobal = setGlobal;
|
|
38
|
+
|
|
40
39
|
//# sourceMappingURL=globals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.js","names":[],"sources":["../../src/utils/globals.tsx"],"sourcesContent":["const globalVar: any =\n typeof globalThis !== 'undefined' ? globalThis :\n typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window :\n typeof self !== 'undefined' ? self :\n {};\nexport {\n globalVar\n};\n\nif (typeof globalThis === 'undefined') {\n (globalVar as any).globalThis = globalVar;\n}\n\n// Hexclave rebrand: file-private symbol key, renamed outright (no cross-version compat needed).\nconst hexclaveGlobalsSymbol = Symbol.for('__hexclave-globals');\nglobalVar[hexclaveGlobalsSymbol] ??= {};\n\nexport function createGlobal<T>(key: string, init: () => T) {\n if (!globalVar[hexclaveGlobalsSymbol][key]) {\n globalVar[hexclaveGlobalsSymbol][key] = init();\n }\n return globalVar[hexclaveGlobalsSymbol][key] as T;\n}\n\n/**\n * Like createGlobal, but if the asynchronous initialization fails, the global will be reset and recomputed on the next\n * invocation.\n */\nexport function createGlobalAsync<T>(key: string, init: () => Promise<T>): Promise<T> {\n let promise: Promise<T> | null = null;\n if (!globalVar[hexclaveGlobalsSymbol][key]) {\n promise = init().catch((e) => {\n delete globalVar[hexclaveGlobalsSymbol][key];\n throw e;\n });\n globalVar[hexclaveGlobalsSymbol][key] = promise;\n }\n return promise ?? globalVar[hexclaveGlobalsSymbol][key] as Promise<T>;\n}\n\nexport function getGlobal(key: string): any {\n return globalVar[hexclaveGlobalsSymbol][key];\n}\n\nexport function setGlobal(key: string, value: any) {\n globalVar[hexclaveGlobalsSymbol][key] = value;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"globals.js","names":[],"sources":["../../src/utils/globals.tsx"],"sourcesContent":["const globalVar: any =\n typeof globalThis !== 'undefined' ? globalThis :\n typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window :\n typeof self !== 'undefined' ? self :\n {};\nexport {\n globalVar\n};\n\nif (typeof globalThis === 'undefined') {\n (globalVar as any).globalThis = globalVar;\n}\n\n// Hexclave rebrand: file-private symbol key, renamed outright (no cross-version compat needed).\nconst hexclaveGlobalsSymbol = Symbol.for('__hexclave-globals');\nglobalVar[hexclaveGlobalsSymbol] ??= {};\n\nexport function createGlobal<T>(key: string, init: () => T) {\n if (!globalVar[hexclaveGlobalsSymbol][key]) {\n globalVar[hexclaveGlobalsSymbol][key] = init();\n }\n return globalVar[hexclaveGlobalsSymbol][key] as T;\n}\n\n/**\n * Like createGlobal, but if the asynchronous initialization fails, the global will be reset and recomputed on the next\n * invocation.\n */\nexport function createGlobalAsync<T>(key: string, init: () => Promise<T>): Promise<T> {\n let promise: Promise<T> | null = null;\n if (!globalVar[hexclaveGlobalsSymbol][key]) {\n promise = init().catch((e) => {\n delete globalVar[hexclaveGlobalsSymbol][key];\n throw e;\n });\n globalVar[hexclaveGlobalsSymbol][key] = promise;\n }\n return promise ?? globalVar[hexclaveGlobalsSymbol][key] as Promise<T>;\n}\n\nexport function getGlobal(key: string): any {\n return globalVar[hexclaveGlobalsSymbol][key];\n}\n\nexport function setGlobal(key: string, value: any) {\n globalVar[hexclaveGlobalsSymbol][key] = value;\n}\n"],"mappings":";;AAAA,MAAM,YACJ,OAAO,eAAe,cAAc,aAClC,OAAO,WAAW,cAAc,SAC9B,OAAO,WAAW,cAAc,SAC9B,OAAO,SAAS,cAAc,OAC5B,CAAC;AAKX,IAAI,OAAO,eAAe,aACxB,UAAmB,aAAa;AAIlC,MAAM,wBAAwB,OAAO,IAAI,oBAAoB;AAC7D,UAAU,2BAA2B,CAAC;AAEtC,SAAgB,aAAgB,KAAa,MAAe;CAC1D,IAAI,CAAC,UAAU,sBAAsB,CAAC,MACpC,UAAU,sBAAsB,CAAC,OAAO,KAAK;CAE/C,OAAO,UAAU,sBAAsB,CAAC;AAC1C;;;;;AAMA,SAAgB,kBAAqB,KAAa,MAAoC;CACpF,IAAI,UAA6B;CACjC,IAAI,CAAC,UAAU,sBAAsB,CAAC,MAAM;EAC1C,UAAU,KAAK,CAAC,CAAC,OAAO,MAAM;GAC5B,OAAO,UAAU,sBAAsB,CAAC;GACxC,MAAM;EACR,CAAC;EACD,UAAU,sBAAsB,CAAC,OAAO;CAC1C;CACA,OAAO,WAAW,UAAU,sBAAsB,CAAC;AACrD;AAEA,SAAgB,UAAU,KAAkB;CAC1C,OAAO,UAAU,sBAAsB,CAAC;AAC1C;AAEA,SAAgB,UAAU,KAAa,OAAY;CACjD,UAAU,sBAAsB,CAAC,OAAO;AAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashes.d.ts","names":[],"sources":["../../src/utils/hashes.tsx"],"mappings":";iBAIsB,MAAA,CAAO,KAAA,EAAO,UAAA,YAAsB,OAAA,CAAQ,UAAA;AAAA,iBAK5C,YAAA,CAAa,QAAA,WAAgB,OAAA;AAAA,iBAS7B,eAAA,CAAgB,QAAA,UAAkB,IAAA,WAAe,
|
|
1
|
+
{"version":3,"file":"hashes.d.ts","names":[],"sources":["../../src/utils/hashes.tsx"],"mappings":";iBAIsB,MAAA,CAAO,KAAA,EAAO,UAAA,YAAsB,OAAA,CAAQ,UAAA;AAAA,iBAK5C,YAAA,CAAa,QAAA,WAAgB,OAAA;AAAA,iBAS7B,eAAA,CAAgB,QAAA,UAAkB,IAAA,WAAe,OAAO;AAAA,iBAWxD,mBAAA,CAAoB,IAAA,WAAY,OAAA;AAAA,iBAIhC,wBAAA,CAAyB,IAAA,WAAe,OAAO"}
|
package/dist/utils/hashes.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
|
|
3
3
|
let __errors_js = require("./errors.js");
|
|
4
4
|
let __typed_arrays_js = require("./typed-arrays.js");
|
|
5
5
|
let bcryptjs = require("bcryptjs");
|
|
6
|
-
bcryptjs =
|
|
7
|
-
|
|
6
|
+
bcryptjs = require_rolldown_runtime.__toESM(bcryptjs);
|
|
8
7
|
//#region src/utils/hashes.tsx
|
|
9
8
|
async function sha512(input) {
|
|
10
9
|
const bytes = typeof input === "string" ? new TextEncoder().encode(input) : (0, __typed_arrays_js.toArrayBufferBacked)(input);
|
|
@@ -37,11 +36,11 @@ async function getPasswordHashAlgorithm(hash) {
|
|
|
37
36
|
}
|
|
38
37
|
else return;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
40
|
exports.comparePassword = comparePassword;
|
|
43
41
|
exports.getPasswordHashAlgorithm = getPasswordHashAlgorithm;
|
|
44
42
|
exports.hashPassword = hashPassword;
|
|
45
43
|
exports.isPasswordHashValid = isPasswordHashValid;
|
|
46
44
|
exports.sha512 = sha512;
|
|
45
|
+
|
|
47
46
|
//# sourceMappingURL=hashes.js.map
|
package/dist/utils/hashes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashes.js","names":["HexclaveAssertionError","bcrypt"],"sources":["../../src/utils/hashes.tsx"],"sourcesContent":["import bcrypt from 'bcryptjs';\nimport { HexclaveAssertionError } from './errors';\nimport { toArrayBufferBacked } from './typed-arrays';\n\nexport async function sha512(input: Uint8Array | string): Promise<Uint8Array> {\n const bytes = typeof input === \"string\" ? new TextEncoder().encode(input) : toArrayBufferBacked(input);\n return new Uint8Array(await crypto.subtle.digest(\"SHA-512\", bytes));\n}\n\nexport async function hashPassword(password: string) {\n const passwordBytes = new TextEncoder().encode(password);\n if (passwordBytes.length >= 72) {\n throw new HexclaveAssertionError(`Password is too long for bcrypt`, { len: passwordBytes.length });\n }\n const salt = await bcrypt.genSalt(10);\n return await bcrypt.hash(password, salt);\n}\n\nexport async function comparePassword(password: string, hash: string): Promise<boolean> {\n switch (await getPasswordHashAlgorithm(hash)) {\n case \"bcrypt\": {\n return await bcrypt.compare(password, hash);\n }\n default: {\n return false;\n }\n }\n}\n\nexport async function isPasswordHashValid(hash: string) {\n return !!(await getPasswordHashAlgorithm(hash));\n}\n\nexport async function getPasswordHashAlgorithm(hash: string): Promise<\"bcrypt\" | undefined> {\n if (typeof hash !== \"string\") {\n throw new HexclaveAssertionError(`Passed non-string value to getPasswordHashAlgorithm`, { hash });\n }\n if (hash.match(/^\\$2[ayb]\\$.{56}$/)) {\n try {\n if (bcrypt.getRounds(hash) > 16) {\n return undefined;\n }\n await bcrypt.compare(\"any string\", hash);\n return \"bcrypt\";\n } catch (e) {\n console.warn(`Error while checking bcrypt password hash. Assuming the hash is invalid`, e);\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hashes.js","names":["HexclaveAssertionError","bcrypt"],"sources":["../../src/utils/hashes.tsx"],"sourcesContent":["import bcrypt from 'bcryptjs';\nimport { HexclaveAssertionError } from './errors';\nimport { toArrayBufferBacked } from './typed-arrays';\n\nexport async function sha512(input: Uint8Array | string): Promise<Uint8Array> {\n const bytes = typeof input === \"string\" ? new TextEncoder().encode(input) : toArrayBufferBacked(input);\n return new Uint8Array(await crypto.subtle.digest(\"SHA-512\", bytes));\n}\n\nexport async function hashPassword(password: string) {\n const passwordBytes = new TextEncoder().encode(password);\n if (passwordBytes.length >= 72) {\n throw new HexclaveAssertionError(`Password is too long for bcrypt`, { len: passwordBytes.length });\n }\n const salt = await bcrypt.genSalt(10);\n return await bcrypt.hash(password, salt);\n}\n\nexport async function comparePassword(password: string, hash: string): Promise<boolean> {\n switch (await getPasswordHashAlgorithm(hash)) {\n case \"bcrypt\": {\n return await bcrypt.compare(password, hash);\n }\n default: {\n return false;\n }\n }\n}\n\nexport async function isPasswordHashValid(hash: string) {\n return !!(await getPasswordHashAlgorithm(hash));\n}\n\nexport async function getPasswordHashAlgorithm(hash: string): Promise<\"bcrypt\" | undefined> {\n if (typeof hash !== \"string\") {\n throw new HexclaveAssertionError(`Passed non-string value to getPasswordHashAlgorithm`, { hash });\n }\n if (hash.match(/^\\$2[ayb]\\$.{56}$/)) {\n try {\n if (bcrypt.getRounds(hash) > 16) {\n return undefined;\n }\n await bcrypt.compare(\"any string\", hash);\n return \"bcrypt\";\n } catch (e) {\n console.warn(`Error while checking bcrypt password hash. Assuming the hash is invalid`, e);\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;AAIA,eAAsB,OAAO,OAAiD;CAC5E,MAAM,QAAQ,OAAO,UAAU,WAAW,IAAI,YAAY,CAAC,CAAC,OAAO,KAAK,KAAA,GAAA,kBAAA,oBAAA,CAAwB,KAAK;CACrG,OAAO,IAAI,WAAW,MAAM,OAAO,OAAO,OAAO,WAAW,KAAK,CAAC;AACpE;AAEA,eAAsB,aAAa,UAAkB;CACnD,MAAM,gBAAgB,IAAI,YAAY,CAAC,CAAC,OAAO,QAAQ;CACvD,IAAI,cAAc,UAAU,IAC1B,MAAM,IAAIA,YAAAA,uBAAuB,mCAAmC,EAAE,KAAK,cAAc,OAAO,CAAC;CAEnG,MAAM,OAAO,MAAMC,SAAAA,QAAO,QAAQ,EAAE;CACpC,OAAO,MAAMA,SAAAA,QAAO,KAAK,UAAU,IAAI;AACzC;AAEA,eAAsB,gBAAgB,UAAkB,MAAgC;CACtF,QAAQ,MAAM,yBAAyB,IAAI,GAA3C;EACE,KAAK,UACH,OAAO,MAAMA,SAAAA,QAAO,QAAQ,UAAU,IAAI;EAE5C,SACE,OAAO;CAEX;AACF;AAEA,eAAsB,oBAAoB,MAAc;CACtD,OAAO,CAAC,CAAE,MAAM,yBAAyB,IAAI;AAC/C;AAEA,eAAsB,yBAAyB,MAA6C;CAC1F,IAAI,OAAO,SAAS,UAClB,MAAM,IAAID,YAAAA,uBAAuB,uDAAuD,EAAE,KAAK,CAAC;CAElG,IAAI,KAAK,MAAM,mBAAmB,GAChC,IAAI;EACF,IAAIC,SAAAA,QAAO,UAAU,IAAI,IAAI,IAC3B;EAEF,MAAMA,SAAAA,QAAO,QAAQ,cAAc,IAAI;EACvC,OAAO;CACT,SAAS,GAAG;EACV,QAAQ,KAAK,2EAA2E,CAAC;EACzF;CACF;MAEA;AAEJ"}
|
package/dist/utils/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","names":[],"sources":["../../src/utils/html.tsx"],"mappings":";iBAEgB,UAAA,CAAW,
|
|
1
|
+
{"version":3,"file":"html.d.ts","names":[],"sources":["../../src/utils/html.tsx"],"mappings":";iBAEgB,UAAA,CAAW,MAAc;AAAA,iBA2BzB,IAAA,CAAK,OAAA,EAAS,oBAAoB,KAAK,MAAA;AAAA,iBAwBvC,UAAA,CAAW,aAAqB"}
|
package/dist/utils/html.js
CHANGED
|
@@ -1,37 +1,18 @@
|
|
|
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 __strings_js = require("./strings.js");
|
|
4
|
-
|
|
5
3
|
//#region src/utils/html.tsx
|
|
6
4
|
function escapeHtml(unsafe) {
|
|
7
5
|
return `${unsafe}`.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
8
6
|
}
|
|
9
|
-
(void 0)?.test("escapeHtml", ({ expect }) => {
|
|
10
|
-
expect(escapeHtml("")).toBe("");
|
|
11
|
-
expect(escapeHtml("hello world")).toBe("hello world");
|
|
12
|
-
expect(escapeHtml("<div>")).toBe("<div>");
|
|
13
|
-
expect(escapeHtml("a & b")).toBe("a & b");
|
|
14
|
-
expect(escapeHtml("a \"quoted\" string")).toBe("a "quoted" string");
|
|
15
|
-
expect(escapeHtml("it's a test")).toBe("it's a test");
|
|
16
|
-
expect(escapeHtml("<a href=\"test\">It's a link</a>")).toBe("<a href="test">It's a link</a>");
|
|
17
|
-
});
|
|
18
7
|
function html(strings, ...values) {
|
|
19
8
|
return (0, __strings_js.templateIdentity)(strings, ...values.map((v) => escapeHtml(`${v}`)));
|
|
20
9
|
}
|
|
21
|
-
(void 0)?.test("html", ({ expect }) => {
|
|
22
|
-
expect(html`simple string`).toBe("simple string");
|
|
23
|
-
expect(html`Hello, ${"world"}!`).toBe("Hello, world!");
|
|
24
|
-
expect(html`Count: ${42}`).toBe("Count: 42");
|
|
25
|
-
expect(html`<div>${"<script>"}</div>`).toBe("<div><script></div>");
|
|
26
|
-
expect(html`${1} + ${2} = ${"<3"}`).toBe("1 + 2 = <3");
|
|
27
|
-
expect(html`Object: ${{ toString: () => "<object>" }}`).toBe("Object: <object>");
|
|
28
|
-
});
|
|
29
10
|
function htmlToText(untrustedHtml) {
|
|
30
11
|
return new DOMParser().parseFromString(untrustedHtml, "text/html").body.textContent;
|
|
31
12
|
}
|
|
32
|
-
|
|
33
13
|
//#endregion
|
|
34
14
|
exports.escapeHtml = escapeHtml;
|
|
35
15
|
exports.html = html;
|
|
36
16
|
exports.htmlToText = htmlToText;
|
|
17
|
+
|
|
37
18
|
//# sourceMappingURL=html.js.map
|
package/dist/utils/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","names":[],"sources":["../../src/utils/html.tsx"],"sourcesContent":["import { templateIdentity } from \"./strings\";\n\nexport function escapeHtml(unsafe: string): string {\n return `${unsafe}`\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\nimport.meta.vitest?.test(\"escapeHtml\", ({ expect }) => {\n // Test with empty string\n expect(escapeHtml(\"\")).toBe(\"\");\n\n // Test with string without special characters\n expect(escapeHtml(\"hello world\")).toBe(\"hello world\");\n\n // Test with special characters\n expect(escapeHtml(\"<div>\")).toBe(\"<div>\");\n expect(escapeHtml(\"a & b\")).toBe(\"a & b\");\n expect(escapeHtml('a \"quoted\" string')).toBe(\"a "quoted" string\");\n expect(escapeHtml(\"it's a test\")).toBe(\"it's a test\");\n\n // Test with multiple special characters\n expect(escapeHtml(\"<a href=\\\"test\\\">It's a link</a>\")).toBe(\n \"<a href="test">It's a link</a>\"\n );\n});\n\nexport function html(strings: TemplateStringsArray, ...values: any[]): string {\n return templateIdentity(strings, ...values.map(v => escapeHtml(`${v}`)));\n}\nimport.meta.vitest?.test(\"html\", ({ expect }) => {\n // Test with no interpolation\n expect(html`simple string`).toBe(\"simple string\");\n\n // Test with string interpolation\n expect(html`Hello, ${\"world\"}!`).toBe(\"Hello, world!\");\n\n // Test with number interpolation\n expect(html`Count: ${42}`).toBe(\"Count: 42\");\n\n // Test with HTML special characters in interpolated values\n expect(html`<div>${\"<script>\"}</div>`).toBe(\"<div><script></div>\");\n\n // Test with multiple interpolations\n expect(html`${1} + ${2} = ${\"<3\"}`).toBe(\"1 + 2 = <3\");\n\n // Test with object interpolation\n const obj = { toString: () => \"<object>\" };\n expect(html`Object: ${obj}`).toBe(\"Object: <object>\");\n});\n\nexport function htmlToText(untrustedHtml: string): string {\n\n const doc = new DOMParser().parseFromString(untrustedHtml, 'text/html');\n\n return doc.body.textContent;\n\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.js","names":[],"sources":["../../src/utils/html.tsx"],"sourcesContent":["import { templateIdentity } from \"./strings\";\n\nexport function escapeHtml(unsafe: string): string {\n return `${unsafe}`\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\nimport.meta.vitest?.test(\"escapeHtml\", ({ expect }) => {\n // Test with empty string\n expect(escapeHtml(\"\")).toBe(\"\");\n\n // Test with string without special characters\n expect(escapeHtml(\"hello world\")).toBe(\"hello world\");\n\n // Test with special characters\n expect(escapeHtml(\"<div>\")).toBe(\"<div>\");\n expect(escapeHtml(\"a & b\")).toBe(\"a & b\");\n expect(escapeHtml('a \"quoted\" string')).toBe(\"a "quoted" string\");\n expect(escapeHtml(\"it's a test\")).toBe(\"it's a test\");\n\n // Test with multiple special characters\n expect(escapeHtml(\"<a href=\\\"test\\\">It's a link</a>\")).toBe(\n \"<a href="test">It's a link</a>\"\n );\n});\n\nexport function html(strings: TemplateStringsArray, ...values: any[]): string {\n return templateIdentity(strings, ...values.map(v => escapeHtml(`${v}`)));\n}\nimport.meta.vitest?.test(\"html\", ({ expect }) => {\n // Test with no interpolation\n expect(html`simple string`).toBe(\"simple string\");\n\n // Test with string interpolation\n expect(html`Hello, ${\"world\"}!`).toBe(\"Hello, world!\");\n\n // Test with number interpolation\n expect(html`Count: ${42}`).toBe(\"Count: 42\");\n\n // Test with HTML special characters in interpolated values\n expect(html`<div>${\"<script>\"}</div>`).toBe(\"<div><script></div>\");\n\n // Test with multiple interpolations\n expect(html`${1} + ${2} = ${\"<3\"}`).toBe(\"1 + 2 = <3\");\n\n // Test with object interpolation\n const obj = { toString: () => \"<object>\" };\n expect(html`Object: ${obj}`).toBe(\"Object: <object>\");\n});\n\nexport function htmlToText(untrustedHtml: string): string {\n\n const doc = new DOMParser().parseFromString(untrustedHtml, 'text/html');\n\n return doc.body.textContent;\n\n}\n"],"mappings":";;;AAEA,SAAgB,WAAW,QAAwB;CACjD,OAAO,GAAG,SACP,QAAQ,MAAM,OAAO,CAAC,CACtB,QAAQ,MAAM,MAAM,CAAC,CACrB,QAAQ,MAAM,MAAM,CAAC,CACrB,QAAQ,MAAM,QAAQ,CAAC,CACvB,QAAQ,MAAM,QAAQ;AAC3B;AAoBA,SAAgB,KAAK,SAA+B,GAAG,QAAuB;CAC5E,QAAA,GAAA,aAAA,iBAAA,CAAwB,SAAS,GAAG,OAAO,KAAI,MAAK,WAAW,GAAG,GAAG,CAAC,CAAC;AACzE;AAsBA,SAAgB,WAAW,eAA+B;CAIxD,OAFY,IAAI,UAAU,CAAC,CAAC,gBAAgB,eAAe,WAElD,CAAC,CAAC,KAAK;AAElB"}
|
package/dist/utils/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","names":[],"sources":["../../src/utils/http.tsx"],"mappings":";cAEa,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsCD,UAAA,gBAA0B,
|
|
1
|
+
{"version":3,"file":"http.d.ts","names":[],"sources":["../../src/utils/http.tsx"],"mappings":";cAEa,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsCD,UAAA,gBAA0B,YAAY;AAAA,iBAElC,8BAAA,CAA+B,KAAa;AAAA,iBA6B5C,8BAAA,CAA+B,EAAA,UAAY,QAAgB"}
|
package/dist/utils/http.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 __bytes_js = require("./bytes.js");
|
|
4
|
-
|
|
5
3
|
//#region src/utils/http.tsx
|
|
6
4
|
const HTTP_METHODS = {
|
|
7
5
|
"GET": {
|
|
@@ -50,30 +48,13 @@ function decodeBasicAuthorizationHeader(value) {
|
|
|
50
48
|
const split = new TextDecoder().decode((0, __bytes_js.decodeBase64)(encoded)).split(":");
|
|
51
49
|
return [split[0], split.slice(1).join(":")];
|
|
52
50
|
}
|
|
53
|
-
(void 0)?.test("decodeBasicAuthorizationHeader", ({ expect }) => {
|
|
54
|
-
const username = "user";
|
|
55
|
-
const password = "pass";
|
|
56
|
-
expect(decodeBasicAuthorizationHeader(encodeBasicAuthorizationHeader(username, password))).toEqual([username, password]);
|
|
57
|
-
const complexPassword = "pass:with:colons";
|
|
58
|
-
expect(decodeBasicAuthorizationHeader(encodeBasicAuthorizationHeader(username, complexPassword))).toEqual([username, complexPassword]);
|
|
59
|
-
expect(decodeBasicAuthorizationHeader("NotBasic dXNlcjpwYXNz")).toBe(null);
|
|
60
|
-
expect(decodeBasicAuthorizationHeader("Basic")).toBe(null);
|
|
61
|
-
expect(decodeBasicAuthorizationHeader("Basic not-base64")).toBe(null);
|
|
62
|
-
expect(decodeBasicAuthorizationHeader("Basic dXNlcjpwYXNz extra")).toBe(null);
|
|
63
|
-
});
|
|
64
51
|
function encodeBasicAuthorizationHeader(id, password) {
|
|
65
52
|
if (id.includes(":")) throw new Error("Basic authorization header id cannot contain ':'");
|
|
66
53
|
return `Basic ${(0, __bytes_js.encodeBase64)(new TextEncoder().encode(`${id}:${password}`))}`;
|
|
67
54
|
}
|
|
68
|
-
(void 0)?.test("encodeBasicAuthorizationHeader", ({ expect }) => {
|
|
69
|
-
expect(encodeBasicAuthorizationHeader("user", "pass")).toMatch(/^Basic [A-Za-z0-9+/=]+$/);
|
|
70
|
-
expect(encodeBasicAuthorizationHeader("user", "")).toMatch(/^Basic [A-Za-z0-9+/=]+$/);
|
|
71
|
-
expect(encodeBasicAuthorizationHeader("user", "p@ss!w0rd")).toMatch(/^Basic [A-Za-z0-9+/=]+$/);
|
|
72
|
-
expect(() => encodeBasicAuthorizationHeader("user:name", "pass")).toThrow();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
55
|
//#endregion
|
|
76
56
|
exports.HTTP_METHODS = HTTP_METHODS;
|
|
77
57
|
exports.decodeBasicAuthorizationHeader = decodeBasicAuthorizationHeader;
|
|
78
58
|
exports.encodeBasicAuthorizationHeader = encodeBasicAuthorizationHeader;
|
|
59
|
+
|
|
79
60
|
//# sourceMappingURL=http.js.map
|
package/dist/utils/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","names":[],"sources":["../../src/utils/http.tsx"],"sourcesContent":["import { decodeBase64, encodeBase64, isBase64 } from \"./bytes\";\n\nexport const HTTP_METHODS = {\n \"GET\": {\n safe: true,\n idempotent: true,\n },\n \"POST\": {\n safe: false,\n idempotent: false,\n },\n \"PUT\": {\n safe: false,\n idempotent: true,\n },\n \"DELETE\": {\n safe: false,\n idempotent: true,\n },\n \"PATCH\": {\n safe: false,\n idempotent: false,\n },\n \"OPTIONS\": {\n safe: true,\n idempotent: true,\n },\n \"HEAD\": {\n safe: true,\n idempotent: true,\n },\n \"TRACE\": {\n safe: true,\n idempotent: true,\n },\n \"CONNECT\": {\n safe: false,\n idempotent: false,\n },\n} as const;\nexport type HttpMethod = keyof typeof HTTP_METHODS;\n\nexport function decodeBasicAuthorizationHeader(value: string): [string, string] | null {\n const [type, encoded, ...rest] = value.split(' ');\n if (rest.length > 0) return null;\n if (!encoded) return null;\n if (type !== 'Basic') return null;\n if (!isBase64(encoded)) return null;\n const decoded = new TextDecoder().decode(decodeBase64(encoded));\n const split = decoded.split(':');\n return [split[0], split.slice(1).join(':')];\n}\nimport.meta.vitest?.test(\"decodeBasicAuthorizationHeader\", ({ expect }) => {\n // Test with valid Basic Authorization header\n const username = \"user\";\n const password = \"pass\";\n const encoded = encodeBasicAuthorizationHeader(username, password);\n expect(decodeBasicAuthorizationHeader(encoded)).toEqual([username, password]);\n\n // Test with password containing colons\n const complexPassword = \"pass:with:colons\";\n const encodedComplex = encodeBasicAuthorizationHeader(username, complexPassword);\n expect(decodeBasicAuthorizationHeader(encodedComplex)).toEqual([username, complexPassword]);\n\n // Test with invalid headers\n expect(decodeBasicAuthorizationHeader(\"NotBasic dXNlcjpwYXNz\")).toBe(null); // Wrong type\n expect(decodeBasicAuthorizationHeader(\"Basic\")).toBe(null); // Missing encoded part\n expect(decodeBasicAuthorizationHeader(\"Basic not-base64\")).toBe(null); // Not base64\n expect(decodeBasicAuthorizationHeader(\"Basic dXNlcjpwYXNz extra\")).toBe(null); // Extra parts\n});\n\nexport function encodeBasicAuthorizationHeader(id: string, password: string): string {\n if (id.includes(':')) throw new Error(\"Basic authorization header id cannot contain ':'\");\n return `Basic ${encodeBase64(new TextEncoder().encode(`${id}:${password}`))}`;\n}\nimport.meta.vitest?.test(\"encodeBasicAuthorizationHeader\", ({ expect }) => {\n // Test with simple username and password\n const encoded = encodeBasicAuthorizationHeader(\"user\", \"pass\");\n expect(encoded).toMatch(/^Basic [A-Za-z0-9+/=]+$/); // Should start with \"Basic \" followed by base64\n\n // Test with empty password\n const encodedEmptyPass = encodeBasicAuthorizationHeader(\"user\", \"\");\n expect(encodedEmptyPass).toMatch(/^Basic [A-Za-z0-9+/=]+$/);\n\n // Test with password containing special characters\n const encodedSpecialChars = encodeBasicAuthorizationHeader(\"user\", \"p@ss!w0rd\");\n expect(encodedSpecialChars).toMatch(/^Basic [A-Za-z0-9+/=]+$/);\n\n // Test with username containing colon should throw\n expect(() => encodeBasicAuthorizationHeader(\"user:name\", \"pass\")).toThrow();\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.js","names":[],"sources":["../../src/utils/http.tsx"],"sourcesContent":["import { decodeBase64, encodeBase64, isBase64 } from \"./bytes\";\n\nexport const HTTP_METHODS = {\n \"GET\": {\n safe: true,\n idempotent: true,\n },\n \"POST\": {\n safe: false,\n idempotent: false,\n },\n \"PUT\": {\n safe: false,\n idempotent: true,\n },\n \"DELETE\": {\n safe: false,\n idempotent: true,\n },\n \"PATCH\": {\n safe: false,\n idempotent: false,\n },\n \"OPTIONS\": {\n safe: true,\n idempotent: true,\n },\n \"HEAD\": {\n safe: true,\n idempotent: true,\n },\n \"TRACE\": {\n safe: true,\n idempotent: true,\n },\n \"CONNECT\": {\n safe: false,\n idempotent: false,\n },\n} as const;\nexport type HttpMethod = keyof typeof HTTP_METHODS;\n\nexport function decodeBasicAuthorizationHeader(value: string): [string, string] | null {\n const [type, encoded, ...rest] = value.split(' ');\n if (rest.length > 0) return null;\n if (!encoded) return null;\n if (type !== 'Basic') return null;\n if (!isBase64(encoded)) return null;\n const decoded = new TextDecoder().decode(decodeBase64(encoded));\n const split = decoded.split(':');\n return [split[0], split.slice(1).join(':')];\n}\nimport.meta.vitest?.test(\"decodeBasicAuthorizationHeader\", ({ expect }) => {\n // Test with valid Basic Authorization header\n const username = \"user\";\n const password = \"pass\";\n const encoded = encodeBasicAuthorizationHeader(username, password);\n expect(decodeBasicAuthorizationHeader(encoded)).toEqual([username, password]);\n\n // Test with password containing colons\n const complexPassword = \"pass:with:colons\";\n const encodedComplex = encodeBasicAuthorizationHeader(username, complexPassword);\n expect(decodeBasicAuthorizationHeader(encodedComplex)).toEqual([username, complexPassword]);\n\n // Test with invalid headers\n expect(decodeBasicAuthorizationHeader(\"NotBasic dXNlcjpwYXNz\")).toBe(null); // Wrong type\n expect(decodeBasicAuthorizationHeader(\"Basic\")).toBe(null); // Missing encoded part\n expect(decodeBasicAuthorizationHeader(\"Basic not-base64\")).toBe(null); // Not base64\n expect(decodeBasicAuthorizationHeader(\"Basic dXNlcjpwYXNz extra\")).toBe(null); // Extra parts\n});\n\nexport function encodeBasicAuthorizationHeader(id: string, password: string): string {\n if (id.includes(':')) throw new Error(\"Basic authorization header id cannot contain ':'\");\n return `Basic ${encodeBase64(new TextEncoder().encode(`${id}:${password}`))}`;\n}\nimport.meta.vitest?.test(\"encodeBasicAuthorizationHeader\", ({ expect }) => {\n // Test with simple username and password\n const encoded = encodeBasicAuthorizationHeader(\"user\", \"pass\");\n expect(encoded).toMatch(/^Basic [A-Za-z0-9+/=]+$/); // Should start with \"Basic \" followed by base64\n\n // Test with empty password\n const encodedEmptyPass = encodeBasicAuthorizationHeader(\"user\", \"\");\n expect(encodedEmptyPass).toMatch(/^Basic [A-Za-z0-9+/=]+$/);\n\n // Test with password containing special characters\n const encodedSpecialChars = encodeBasicAuthorizationHeader(\"user\", \"p@ss!w0rd\");\n expect(encodedSpecialChars).toMatch(/^Basic [A-Za-z0-9+/=]+$/);\n\n // Test with username containing colon should throw\n expect(() => encodeBasicAuthorizationHeader(\"user:name\", \"pass\")).toThrow();\n});\n"],"mappings":";;;AAEA,MAAa,eAAe;CAC1B,OAAO;EACL,MAAM;EACN,YAAY;CACd;CACA,QAAQ;EACN,MAAM;EACN,YAAY;CACd;CACA,OAAO;EACL,MAAM;EACN,YAAY;CACd;CACA,UAAU;EACR,MAAM;EACN,YAAY;CACd;CACA,SAAS;EACP,MAAM;EACN,YAAY;CACd;CACA,WAAW;EACT,MAAM;EACN,YAAY;CACd;CACA,QAAQ;EACN,MAAM;EACN,YAAY;CACd;CACA,SAAS;EACP,MAAM;EACN,YAAY;CACd;CACA,WAAW;EACT,MAAM;EACN,YAAY;CACd;AACF;AAGA,SAAgB,+BAA+B,OAAwC;CACrF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,MAAM,MAAM,GAAG;CAChD,IAAI,KAAK,SAAS,GAAG,OAAO;CAC5B,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI,SAAS,SAAS,OAAO;CAC7B,IAAI,EAAA,GAAA,WAAA,SAAA,CAAU,OAAO,GAAG,OAAO;CAE/B,MAAM,QADU,IAAI,YAAY,CAAC,CAAC,QAAA,GAAA,WAAA,aAAA,CAAoB,OAAO,CACzC,CAAC,CAAC,MAAM,GAAG;CAC/B,OAAO,CAAC,MAAM,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC5C;AAoBA,SAAgB,+BAA+B,IAAY,UAA0B;CACnF,IAAI,GAAG,SAAS,GAAG,GAAG,MAAM,IAAI,MAAM,kDAAkD;CACxF,OAAO,UAAA,GAAA,WAAA,aAAA,CAAsB,IAAI,YAAY,CAAC,CAAC,OAAO,GAAG,GAAG,GAAG,UAAU,CAAC;AAC5E"}
|
package/dist/utils/ips.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ips.d.ts","names":[],"sources":["../../src/utils/ips.tsx"],"mappings":";KAEY,WAAA;AAAA,KACA,WAAA;AAAA,iBAEI,WAAA,CAAY,
|
|
1
|
+
{"version":3,"file":"ips.d.ts","names":[],"sources":["../../src/utils/ips.tsx"],"mappings":";KAEY,WAAA;AAAA,KACA,WAAA;AAAA,iBAEI,WAAA,CAAY,EAAU;AAAA,iBAwBtB,eAAA,CAAgB,EAAA,mBAAqB,EAAA,IAAM,WAAA,GAAc,WAAW"}
|
package/dist/utils/ips.js
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.js");
|
|
3
3
|
let ip_regex = require("ip-regex");
|
|
4
|
-
ip_regex =
|
|
5
|
-
|
|
4
|
+
ip_regex = require_rolldown_runtime.__toESM(ip_regex);
|
|
6
5
|
//#region src/utils/ips.tsx
|
|
7
6
|
function isIpAddress(ip) {
|
|
8
7
|
return (0, ip_regex.default)({ exact: true }).test(ip);
|
|
9
8
|
}
|
|
10
|
-
(void 0)?.test("isIpAddress", ({ expect }) => {
|
|
11
|
-
expect(isIpAddress("192.168.1.1")).toBe(true);
|
|
12
|
-
expect(isIpAddress("127.0.0.1")).toBe(true);
|
|
13
|
-
expect(isIpAddress("0.0.0.0")).toBe(true);
|
|
14
|
-
expect(isIpAddress("255.255.255.255")).toBe(true);
|
|
15
|
-
expect(isIpAddress("::1")).toBe(true);
|
|
16
|
-
expect(isIpAddress("2001:db8::")).toBe(true);
|
|
17
|
-
expect(isIpAddress("2001:db8:85a3:8d3:1319:8a2e:370:7348")).toBe(true);
|
|
18
|
-
expect(isIpAddress("")).toBe(false);
|
|
19
|
-
expect(isIpAddress("not an ip")).toBe(false);
|
|
20
|
-
expect(isIpAddress("256.256.256.256")).toBe(false);
|
|
21
|
-
expect(isIpAddress("192.168.1")).toBe(false);
|
|
22
|
-
expect(isIpAddress("192.168.1.1.1")).toBe(false);
|
|
23
|
-
expect(isIpAddress("2001:db8::xyz")).toBe(false);
|
|
24
|
-
});
|
|
25
9
|
function assertIpAddress(ip) {
|
|
26
10
|
if (!isIpAddress(ip)) throw new Error(`Invalid IP address: ${ip}`);
|
|
27
11
|
}
|
|
28
|
-
(void 0)?.test("assertIpAddress", ({ expect }) => {
|
|
29
|
-
expect(() => assertIpAddress("192.168.1.1")).not.toThrow();
|
|
30
|
-
expect(() => assertIpAddress("::1")).not.toThrow();
|
|
31
|
-
expect(() => assertIpAddress("")).toThrow("Invalid IP address: ");
|
|
32
|
-
expect(() => assertIpAddress("not an ip")).toThrow("Invalid IP address: not an ip");
|
|
33
|
-
expect(() => assertIpAddress("256.256.256.256")).toThrow("Invalid IP address: 256.256.256.256");
|
|
34
|
-
expect(() => assertIpAddress("192.168.1")).toThrow("Invalid IP address: 192.168.1");
|
|
35
|
-
});
|
|
36
|
-
|
|
37
12
|
//#endregion
|
|
38
13
|
exports.assertIpAddress = assertIpAddress;
|
|
39
14
|
exports.isIpAddress = isIpAddress;
|
|
15
|
+
|
|
40
16
|
//# sourceMappingURL=ips.js.map
|
package/dist/utils/ips.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ips.js","names":[],"sources":["../../src/utils/ips.tsx"],"sourcesContent":["import ipRegex from \"ip-regex\";\n\nexport type Ipv4Address = `${number}.${number}.${number}.${number}`;\nexport type Ipv6Address = string;\n\nexport function isIpAddress(ip: string) {\n return ipRegex({ exact: true }).test(ip);\n}\nimport.meta.vitest?.test(\"isIpAddress\", ({ expect }) => {\n // Test valid IPv4 addresses\n expect(isIpAddress(\"192.168.1.1\")).toBe(true);\n expect(isIpAddress(\"127.0.0.1\")).toBe(true);\n expect(isIpAddress(\"0.0.0.0\")).toBe(true);\n expect(isIpAddress(\"255.255.255.255\")).toBe(true);\n\n // Test valid IPv6 addresses\n expect(isIpAddress(\"::1\")).toBe(true);\n expect(isIpAddress(\"2001:db8::\")).toBe(true);\n expect(isIpAddress(\"2001:db8:85a3:8d3:1319:8a2e:370:7348\")).toBe(true);\n\n // Test invalid IP addresses\n expect(isIpAddress(\"\")).toBe(false);\n expect(isIpAddress(\"not an ip\")).toBe(false);\n expect(isIpAddress(\"256.256.256.256\")).toBe(false);\n expect(isIpAddress(\"192.168.1\")).toBe(false);\n expect(isIpAddress(\"192.168.1.1.1\")).toBe(false);\n expect(isIpAddress(\"2001:db8::xyz\")).toBe(false);\n});\n\nexport function assertIpAddress(ip: string): asserts ip is Ipv4Address | Ipv6Address {\n if (!isIpAddress(ip)) {\n throw new Error(`Invalid IP address: ${ip}`);\n }\n}\nimport.meta.vitest?.test(\"assertIpAddress\", ({ expect }) => {\n // Test with valid IPv4 address\n expect(() => assertIpAddress(\"192.168.1.1\")).not.toThrow();\n\n // Test with valid IPv6 address\n expect(() => assertIpAddress(\"::1\")).not.toThrow();\n\n // Test with invalid IP addresses\n expect(() => assertIpAddress(\"\")).toThrow(\"Invalid IP address: \");\n expect(() => assertIpAddress(\"not an ip\")).toThrow(\"Invalid IP address: not an ip\");\n expect(() => assertIpAddress(\"256.256.256.256\")).toThrow(\"Invalid IP address: 256.256.256.256\");\n expect(() => assertIpAddress(\"192.168.1\")).toThrow(\"Invalid IP address: 192.168.1\");\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ips.js","names":[],"sources":["../../src/utils/ips.tsx"],"sourcesContent":["import ipRegex from \"ip-regex\";\n\nexport type Ipv4Address = `${number}.${number}.${number}.${number}`;\nexport type Ipv6Address = string;\n\nexport function isIpAddress(ip: string) {\n return ipRegex({ exact: true }).test(ip);\n}\nimport.meta.vitest?.test(\"isIpAddress\", ({ expect }) => {\n // Test valid IPv4 addresses\n expect(isIpAddress(\"192.168.1.1\")).toBe(true);\n expect(isIpAddress(\"127.0.0.1\")).toBe(true);\n expect(isIpAddress(\"0.0.0.0\")).toBe(true);\n expect(isIpAddress(\"255.255.255.255\")).toBe(true);\n\n // Test valid IPv6 addresses\n expect(isIpAddress(\"::1\")).toBe(true);\n expect(isIpAddress(\"2001:db8::\")).toBe(true);\n expect(isIpAddress(\"2001:db8:85a3:8d3:1319:8a2e:370:7348\")).toBe(true);\n\n // Test invalid IP addresses\n expect(isIpAddress(\"\")).toBe(false);\n expect(isIpAddress(\"not an ip\")).toBe(false);\n expect(isIpAddress(\"256.256.256.256\")).toBe(false);\n expect(isIpAddress(\"192.168.1\")).toBe(false);\n expect(isIpAddress(\"192.168.1.1.1\")).toBe(false);\n expect(isIpAddress(\"2001:db8::xyz\")).toBe(false);\n});\n\nexport function assertIpAddress(ip: string): asserts ip is Ipv4Address | Ipv6Address {\n if (!isIpAddress(ip)) {\n throw new Error(`Invalid IP address: ${ip}`);\n }\n}\nimport.meta.vitest?.test(\"assertIpAddress\", ({ expect }) => {\n // Test with valid IPv4 address\n expect(() => assertIpAddress(\"192.168.1.1\")).not.toThrow();\n\n // Test with valid IPv6 address\n expect(() => assertIpAddress(\"::1\")).not.toThrow();\n\n // Test with invalid IP addresses\n expect(() => assertIpAddress(\"\")).toThrow(\"Invalid IP address: \");\n expect(() => assertIpAddress(\"not an ip\")).toThrow(\"Invalid IP address: not an ip\");\n expect(() => assertIpAddress(\"256.256.256.256\")).toThrow(\"Invalid IP address: 256.256.256.256\");\n expect(() => assertIpAddress(\"192.168.1\")).toThrow(\"Invalid IP address: 192.168.1\");\n});\n"],"mappings":";;;;;AAKA,SAAgB,YAAY,IAAY;CACtC,QAAA,GAAA,SAAA,QAAA,CAAe,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;AACzC;AAsBA,SAAgB,gBAAgB,IAAqD;CACnF,IAAI,CAAC,YAAY,EAAE,GACjB,MAAM,IAAI,MAAM,uBAAuB,IAAI;AAE/C"}
|
package/dist/utils/json.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/utils/json.d.ts
|
|
4
|
-
type Json = null | boolean | number | string | Json[] | {
|
|
5
|
-
[key: string]: Json;
|
|
6
|
-
};
|
|
7
|
-
type ReadonlyJson = null | boolean | number | string | readonly ReadonlyJson[] | {
|
|
8
|
-
readonly [key: string]: ReadonlyJson;
|
|
9
|
-
};
|
|
10
|
-
declare function isJsonSerializable(value: unknown): value is Json;
|
|
11
|
-
declare function parseJson(json: string): Result<Json>;
|
|
12
|
-
declare function stringifyJson(json: Json): Result<string>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Json, ReadonlyJson, isJsonSerializable, parseJson, stringifyJson };
|
|
15
|
-
//# sourceMappingURL=json.d.ts.map
|
|
1
|
+
import { a as stringifyJson, i as parseJson, n as ReadonlyJson, r as isJsonSerializable, t as Json } from "../json-a1QIXu5z.js";
|
|
2
|
+
export { Json, ReadonlyJson, isJsonSerializable, parseJson, stringifyJson };
|