@hexclave/shared 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/dist/ai/image-limits.d.ts +24 -0
- package/dist/ai/image-limits.d.ts.map +1 -0
- package/dist/ai/image-limits.js +61 -0
- package/dist/ai/image-limits.js.map +1 -0
- package/dist/ai/unified-prompts/reminders.d.ts +5 -0
- package/dist/ai/unified-prompts/reminders.d.ts.map +1 -0
- package/dist/ai/unified-prompts/reminders.js +33 -0
- package/dist/ai/unified-prompts/reminders.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts +11 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +851 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +64 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +12 -0
- package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt.d.ts +5 -0
- package/dist/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -0
- package/dist/ai/unified-prompts/skill-site-prompt.js +75 -0
- package/dist/ai/unified-prompts/skill-site-prompt.js.map +1 -0
- package/dist/apps/apps-config.d.ts +168 -0
- package/dist/apps/apps-config.d.ts.map +1 -0
- package/dist/apps/apps-config.js +157 -0
- package/dist/apps/apps-config.js.map +1 -0
- package/dist/apps/apps-ui.d.ts +45 -0
- package/dist/apps/apps-ui.d.ts.map +1 -0
- package/dist/apps/apps-ui.js +109 -0
- package/dist/apps/apps-ui.js.map +1 -0
- package/dist/chunk-BE-pF4vm.js +34 -0
- package/dist/config/db-sync-mappings.d.ts +193 -0
- package/dist/config/db-sync-mappings.d.ts.map +1 -0
- package/dist/config/db-sync-mappings.js +2255 -0
- package/dist/config/db-sync-mappings.js.map +1 -0
- package/dist/config/format.d.ts +61 -0
- package/dist/config/format.d.ts.map +1 -0
- package/dist/config/format.js +337 -0
- package/dist/config/format.js.map +1 -0
- package/dist/config/migrate-catalogs-to-product-lines.d.ts +14 -0
- package/dist/config/migrate-catalogs-to-product-lines.d.ts.map +1 -0
- package/dist/config/migrate-catalogs-to-product-lines.js +379 -0
- package/dist/config/migrate-catalogs-to-product-lines.js.map +1 -0
- package/dist/config/schema-fuzzer.test.d.ts +1 -0
- package/dist/config/schema-fuzzer.test.js +401 -0
- package/dist/config/schema-fuzzer.test.js.map +1 -0
- package/dist/config/schema.d.ts +2315 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +1085 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config-authoring.d.ts +12 -0
- package/dist/config-authoring.d.ts.map +1 -0
- package/dist/config-authoring.js +12 -0
- package/dist/config-authoring.js.map +1 -0
- package/dist/config-authoring.test.d.ts +1 -0
- package/dist/config-authoring.test.js +29 -0
- package/dist/config-authoring.test.js.map +1 -0
- package/dist/config-rendering.d.ts +17 -0
- package/dist/config-rendering.d.ts.map +1 -0
- package/dist/config-rendering.js +114 -0
- package/dist/config-rendering.js.map +1 -0
- package/dist/crud.d.ts +98 -0
- package/dist/crud.d.ts.map +1 -0
- package/dist/crud.js +129 -0
- package/dist/crud.js.map +1 -0
- package/dist/esm/ai/image-limits.d.ts +24 -0
- package/dist/esm/ai/image-limits.d.ts.map +1 -0
- package/dist/esm/ai/image-limits.js +53 -0
- package/dist/esm/ai/image-limits.js.map +1 -0
- package/dist/esm/ai/unified-prompts/reminders.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/reminders.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/reminders.js +31 -0
- package/dist/esm/ai/unified-prompts/reminders.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts +11 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +843 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +61 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +10 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt.d.ts +5 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt.js +73 -0
- package/dist/esm/ai/unified-prompts/skill-site-prompt.js.map +1 -0
- package/dist/esm/apps/apps-config.d.ts +168 -0
- package/dist/esm/apps/apps-config.d.ts.map +1 -0
- package/dist/esm/apps/apps-config.js +154 -0
- package/dist/esm/apps/apps-config.js.map +1 -0
- package/dist/esm/apps/apps-ui.d.ts +45 -0
- package/dist/esm/apps/apps-ui.d.ts.map +1 -0
- package/dist/esm/apps/apps-ui.js +104 -0
- package/dist/esm/apps/apps-ui.js.map +1 -0
- package/dist/esm/config/db-sync-mappings.d.ts +193 -0
- package/dist/esm/config/db-sync-mappings.d.ts.map +1 -0
- package/dist/esm/config/db-sync-mappings.js +2253 -0
- package/dist/esm/config/db-sync-mappings.js.map +1 -0
- package/dist/esm/config/format.d.ts +61 -0
- package/dist/esm/config/format.d.ts.map +1 -0
- package/dist/esm/config/format.js +327 -0
- package/dist/esm/config/format.js.map +1 -0
- package/dist/esm/config/migrate-catalogs-to-product-lines.d.ts +14 -0
- package/dist/esm/config/migrate-catalogs-to-product-lines.d.ts.map +1 -0
- package/dist/esm/config/migrate-catalogs-to-product-lines.js +377 -0
- package/dist/esm/config/migrate-catalogs-to-product-lines.js.map +1 -0
- package/dist/esm/config/schema-fuzzer.test.d.ts +1 -0
- package/dist/esm/config/schema-fuzzer.test.js +401 -0
- package/dist/esm/config/schema-fuzzer.test.js.map +1 -0
- package/dist/esm/config/schema.d.ts +2315 -0
- package/dist/esm/config/schema.d.ts.map +1 -0
- package/dist/esm/config/schema.js +1065 -0
- package/dist/esm/config/schema.js.map +1 -0
- package/dist/esm/config-authoring.d.ts +12 -0
- package/dist/esm/config-authoring.d.ts.map +1 -0
- package/dist/esm/config-authoring.js +9 -0
- package/dist/esm/config-authoring.js.map +1 -0
- package/dist/esm/config-authoring.test.d.ts +1 -0
- package/dist/esm/config-authoring.test.js +29 -0
- package/dist/esm/config-authoring.test.js.map +1 -0
- package/dist/esm/config-rendering.d.ts +17 -0
- package/dist/esm/config-rendering.d.ts.map +1 -0
- package/dist/esm/config-rendering.js +108 -0
- package/dist/esm/config-rendering.js.map +1 -0
- package/dist/esm/crud.d.ts +98 -0
- package/dist/esm/crud.d.ts.map +1 -0
- package/dist/esm/crud.js +127 -0
- package/dist/esm/crud.js.map +1 -0
- package/dist/esm/global.d.ts +1 -0
- package/dist/esm/helpers/emails.d.ts +69 -0
- package/dist/esm/helpers/emails.d.ts.map +1 -0
- package/dist/esm/helpers/emails.js +243 -0
- package/dist/esm/helpers/emails.js.map +1 -0
- package/dist/esm/helpers/init-prompt.d.ts +5 -0
- package/dist/esm/helpers/init-prompt.d.ts.map +1 -0
- package/dist/esm/helpers/init-prompt.js +40 -0
- package/dist/esm/helpers/init-prompt.js.map +1 -0
- package/dist/esm/helpers/password.d.ts +7 -0
- package/dist/esm/helpers/password.d.ts.map +1 -0
- package/dist/esm/helpers/password.js +13 -0
- package/dist/esm/helpers/password.js.map +1 -0
- package/dist/esm/helpers/production-mode.d.ts +11 -0
- package/dist/esm/helpers/production-mode.d.ts.map +1 -0
- package/dist/esm/helpers/production-mode.js +46 -0
- package/dist/esm/helpers/production-mode.js.map +1 -0
- package/dist/esm/helpers/support-sla.d.ts +48 -0
- package/dist/esm/helpers/support-sla.d.ts.map +1 -0
- package/dist/esm/helpers/support-sla.js +65 -0
- package/dist/esm/helpers/support-sla.js.map +1 -0
- package/dist/esm/helpers/support-sla.test.d.ts +1 -0
- package/dist/esm/helpers/support-sla.test.js +102 -0
- package/dist/esm/helpers/support-sla.test.js.map +1 -0
- package/dist/esm/helpers/vault/client-side.d.ts +16 -0
- package/dist/esm/helpers/vault/client-side.d.ts.map +1 -0
- package/dist/esm/helpers/vault/client-side.js +69 -0
- package/dist/esm/helpers/vault/client-side.js.map +1 -0
- package/dist/esm/helpers/vault/server-side.d.ts +9 -0
- package/dist/esm/helpers/vault/server-side.d.ts.map +1 -0
- package/dist/esm/helpers/vault/server-side.js +123 -0
- package/dist/esm/helpers/vault/server-side.js.map +1 -0
- package/dist/esm/hooks/use-async-callback.d.ts +8 -0
- package/dist/esm/hooks/use-async-callback.d.ts.map +1 -0
- package/dist/esm/hooks/use-async-callback.js +38 -0
- package/dist/esm/hooks/use-async-callback.js.map +1 -0
- package/dist/esm/hooks/use-async-external-store.d.ts +9 -0
- package/dist/esm/hooks/use-async-external-store.d.ts.map +1 -0
- package/dist/esm/hooks/use-async-external-store.js +20 -0
- package/dist/esm/hooks/use-async-external-store.js.map +1 -0
- package/dist/esm/hooks/use-hash.d.ts +5 -0
- package/dist/esm/hooks/use-hash.d.ts.map +1 -0
- package/dist/esm/hooks/use-hash.js +15 -0
- package/dist/esm/hooks/use-hash.js.map +1 -0
- package/dist/esm/hooks/use-hover.d.ts +8 -0
- package/dist/esm/hooks/use-hover.d.ts.map +1 -0
- package/dist/esm/hooks/use-hover.js +59 -0
- package/dist/esm/hooks/use-hover.js.map +1 -0
- package/dist/esm/hooks/use-strict-memo.d.ts +10 -0
- package/dist/esm/hooks/use-strict-memo.d.ts.map +1 -0
- package/dist/esm/hooks/use-strict-memo.js +119 -0
- package/dist/esm/hooks/use-strict-memo.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/interface/admin-interface.d.ts +308 -0
- package/dist/esm/interface/admin-interface.d.ts.map +1 -0
- package/dist/esm/interface/admin-interface.js +463 -0
- package/dist/esm/interface/admin-interface.js.map +1 -0
- package/dist/esm/interface/admin-metrics.d.ts +597 -0
- package/dist/esm/interface/admin-metrics.d.ts.map +1 -0
- package/dist/esm/interface/admin-metrics.js +134 -0
- package/dist/esm/interface/admin-metrics.js.map +1 -0
- package/dist/esm/interface/client-interface.d.ts +447 -0
- package/dist/esm/interface/client-interface.d.ts.map +1 -0
- package/dist/esm/interface/client-interface.js +1946 -0
- package/dist/esm/interface/client-interface.js.map +1 -0
- package/dist/esm/interface/client-interface.test.d.ts +1 -0
- package/dist/esm/interface/client-interface.test.js +559 -0
- package/dist/esm/interface/client-interface.test.js.map +1 -0
- package/dist/esm/interface/conversations.d.ts +314 -0
- package/dist/esm/interface/conversations.d.ts.map +1 -0
- package/dist/esm/interface/conversations.js +108 -0
- package/dist/esm/interface/conversations.js.map +1 -0
- package/dist/esm/interface/crud/analytics.d.ts +14 -0
- package/dist/esm/interface/crud/analytics.d.ts.map +1 -0
- package/dist/esm/interface/crud/analytics.js +1 -0
- package/dist/esm/interface/crud/connected-accounts.d.ts +69 -0
- package/dist/esm/interface/crud/connected-accounts.d.ts.map +1 -0
- package/dist/esm/interface/crud/connected-accounts.js +35 -0
- package/dist/esm/interface/crud/connected-accounts.js.map +1 -0
- package/dist/esm/interface/crud/contact-channels.d.ts +182 -0
- package/dist/esm/interface/crud/contact-channels.d.ts.map +1 -0
- package/dist/esm/interface/crud/contact-channels.js +68 -0
- package/dist/esm/interface/crud/contact-channels.js.map +1 -0
- package/dist/esm/interface/crud/current-user.d.ts +286 -0
- package/dist/esm/interface/crud/current-user.d.ts.map +1 -0
- package/dist/esm/interface/crud/current-user.js +69 -0
- package/dist/esm/interface/crud/current-user.js.map +1 -0
- package/dist/esm/interface/crud/email-outbox.d.ts +1466 -0
- package/dist/esm/interface/crud/email-outbox.d.ts.map +1 -0
- package/dist/esm/interface/crud/email-outbox.js +190 -0
- package/dist/esm/interface/crud/email-outbox.js.map +1 -0
- package/dist/esm/interface/crud/email-templates.d.ts +86 -0
- package/dist/esm/interface/crud/email-templates.d.ts.map +1 -0
- package/dist/esm/interface/crud/email-templates.js +46 -0
- package/dist/esm/interface/crud/email-templates.js.map +1 -0
- package/dist/esm/interface/crud/emails.d.ts +42 -0
- package/dist/esm/interface/crud/emails.d.ts.map +1 -0
- package/dist/esm/interface/crud/emails.js +19 -0
- package/dist/esm/interface/crud/emails.js.map +1 -0
- package/dist/esm/interface/crud/internal-api-keys.d.ts +141 -0
- package/dist/esm/interface/crud/internal-api-keys.d.ts.map +1 -0
- package/dist/esm/interface/crud/internal-api-keys.js +49 -0
- package/dist/esm/interface/crud/internal-api-keys.js.map +1 -0
- package/dist/esm/interface/crud/invoices.d.ts +43 -0
- package/dist/esm/interface/crud/invoices.d.ts.map +1 -0
- package/dist/esm/interface/crud/invoices.js +25 -0
- package/dist/esm/interface/crud/invoices.js.map +1 -0
- package/dist/esm/interface/crud/items.d.ts +31 -0
- package/dist/esm/interface/crud/items.d.ts.map +1 -0
- package/dist/esm/interface/crud/items.js +23 -0
- package/dist/esm/interface/crud/items.js.map +1 -0
- package/dist/esm/interface/crud/notification-preferences.d.ts +39 -0
- package/dist/esm/interface/crud/notification-preferences.d.ts.map +1 -0
- package/dist/esm/interface/crud/notification-preferences.js +31 -0
- package/dist/esm/interface/crud/notification-preferences.js.map +1 -0
- package/dist/esm/interface/crud/oauth-providers.d.ts +187 -0
- package/dist/esm/interface/crud/oauth-providers.d.ts.map +1 -0
- package/dist/esm/interface/crud/oauth-providers.js +75 -0
- package/dist/esm/interface/crud/oauth-providers.js.map +1 -0
- package/dist/esm/interface/crud/products.d.ts +182 -0
- package/dist/esm/interface/crud/products.d.ts.map +1 -0
- package/dist/esm/interface/crud/products.js +29 -0
- package/dist/esm/interface/crud/products.js.map +1 -0
- package/dist/esm/interface/crud/project-api-keys.d.ts +204 -0
- package/dist/esm/interface/crud/project-api-keys.d.ts.map +1 -0
- package/dist/esm/interface/crud/project-api-keys.js +72 -0
- package/dist/esm/interface/crud/project-api-keys.js.map +1 -0
- package/dist/esm/interface/crud/project-permissions.d.ts +162 -0
- package/dist/esm/interface/crud/project-permissions.d.ts.map +1 -0
- package/dist/esm/interface/crud/project-permissions.js +104 -0
- package/dist/esm/interface/crud/project-permissions.js.map +1 -0
- package/dist/esm/interface/crud/projects.d.ts +852 -0
- package/dist/esm/interface/crud/projects.d.ts.map +1 -0
- package/dist/esm/interface/crud/projects.js +193 -0
- package/dist/esm/interface/crud/projects.js.map +1 -0
- package/dist/esm/interface/crud/session-replays.d.ts +83 -0
- package/dist/esm/interface/crud/session-replays.d.ts.map +1 -0
- package/dist/esm/interface/crud/session-replays.js +1 -0
- package/dist/esm/interface/crud/sessions.d.ts +151 -0
- package/dist/esm/interface/crud/sessions.d.ts.map +1 -0
- package/dist/esm/interface/crud/sessions.js +56 -0
- package/dist/esm/interface/crud/sessions.js.map +1 -0
- package/dist/esm/interface/crud/sign-up-rules.d.ts +15 -0
- package/dist/esm/interface/crud/sign-up-rules.d.ts.map +1 -0
- package/dist/esm/interface/crud/sign-up-rules.js +1 -0
- package/dist/esm/interface/crud/svix-token.d.ts +32 -0
- package/dist/esm/interface/crud/svix-token.d.ts.map +1 -0
- package/dist/esm/interface/crud/svix-token.js +18 -0
- package/dist/esm/interface/crud/svix-token.js.map +1 -0
- package/dist/esm/interface/crud/team-invitation-details.d.ts +32 -0
- package/dist/esm/interface/crud/team-invitation-details.d.ts.map +1 -0
- package/dist/esm/interface/crud/team-invitation-details.js +21 -0
- package/dist/esm/interface/crud/team-invitation-details.js.map +1 -0
- package/dist/esm/interface/crud/team-invitation.d.ts +55 -0
- package/dist/esm/interface/crud/team-invitation.d.ts.map +1 -0
- package/dist/esm/interface/crud/team-invitation.js +37 -0
- package/dist/esm/interface/crud/team-invitation.js.map +1 -0
- package/dist/esm/interface/crud/team-member-profiles.d.ts +287 -0
- package/dist/esm/interface/crud/team-member-profiles.d.ts.map +1 -0
- package/dist/esm/interface/crud/team-member-profiles.js +58 -0
- package/dist/esm/interface/crud/team-member-profiles.js.map +1 -0
- package/dist/esm/interface/crud/team-memberships.d.ts +76 -0
- package/dist/esm/interface/crud/team-memberships.d.ts.map +1 -0
- package/dist/esm/interface/crud/team-memberships.js +54 -0
- package/dist/esm/interface/crud/team-memberships.js.map +1 -0
- package/dist/esm/interface/crud/team-permissions.d.ts +170 -0
- package/dist/esm/interface/crud/team-permissions.d.ts.map +1 -0
- package/dist/esm/interface/crud/team-permissions.js +105 -0
- package/dist/esm/interface/crud/team-permissions.js.map +1 -0
- package/dist/esm/interface/crud/teams.d.ts +300 -0
- package/dist/esm/interface/crud/teams.d.ts.map +1 -0
- package/dist/esm/interface/crud/teams.js +129 -0
- package/dist/esm/interface/crud/teams.js.map +1 -0
- package/dist/esm/interface/crud/transactions.d.ts +183 -0
- package/dist/esm/interface/crud/transactions.d.ts.map +1 -0
- package/dist/esm/interface/crud/transactions.js +85 -0
- package/dist/esm/interface/crud/transactions.js.map +1 -0
- package/dist/esm/interface/crud/users.d.ts +654 -0
- package/dist/esm/interface/crud/users.d.ts.map +1 -0
- package/dist/esm/interface/crud/users.js +181 -0
- package/dist/esm/interface/crud/users.js.map +1 -0
- package/dist/esm/interface/handler-urls.d.ts +51 -0
- package/dist/esm/interface/handler-urls.d.ts.map +1 -0
- package/dist/esm/interface/handler-urls.js +3 -0
- package/dist/esm/interface/page-component-versions.d.ts +25 -0
- package/dist/esm/interface/page-component-versions.d.ts.map +1 -0
- package/dist/esm/interface/page-component-versions.js +1661 -0
- package/dist/esm/interface/page-component-versions.js.map +1 -0
- package/dist/esm/interface/server-interface.d.ts +255 -0
- package/dist/esm/interface/server-interface.d.ts.map +1 -0
- package/dist/esm/interface/server-interface.js +459 -0
- package/dist/esm/interface/server-interface.js.map +1 -0
- package/dist/esm/interface/webhooks.d.ts +326 -0
- package/dist/esm/interface/webhooks.d.ts.map +1 -0
- package/dist/esm/interface/webhooks.js +22 -0
- package/dist/esm/interface/webhooks.js.map +1 -0
- package/dist/esm/known-errors.d.ts +575 -0
- package/dist/esm/known-errors.d.ts.map +1 -0
- package/dist/esm/known-errors.js +791 -0
- package/dist/esm/known-errors.js.map +1 -0
- package/dist/esm/local-emulator.d.ts +6 -0
- package/dist/esm/local-emulator.d.ts.map +1 -0
- package/dist/esm/local-emulator.js +7 -0
- package/dist/esm/local-emulator.js.map +1 -0
- package/dist/esm/payments/payment-methods.d.ts +64 -0
- package/dist/esm/payments/payment-methods.d.ts.map +1 -0
- package/dist/esm/payments/payment-methods.js +205 -0
- package/dist/esm/payments/payment-methods.js.map +1 -0
- package/dist/esm/payments/stripe-limits.d.ts +17 -0
- package/dist/esm/payments/stripe-limits.d.ts.map +1 -0
- package/dist/esm/payments/stripe-limits.js +17 -0
- package/dist/esm/payments/stripe-limits.js.map +1 -0
- package/dist/esm/plans.d.ts +72 -0
- package/dist/esm/plans.d.ts.map +1 -0
- package/dist/esm/plans.js +81 -0
- package/dist/esm/plans.js.map +1 -0
- package/dist/esm/schema-fields.d.ts +472 -0
- package/dist/esm/schema-fields.d.ts.map +1 -0
- package/dist/esm/schema-fields.js +1009 -0
- package/dist/esm/schema-fields.js.map +1 -0
- package/dist/esm/sessions.d.ts +165 -0
- package/dist/esm/sessions.d.ts.map +1 -0
- package/dist/esm/sessions.js +226 -0
- package/dist/esm/sessions.js.map +1 -0
- package/dist/esm/stack-config-file.d.ts +15 -0
- package/dist/esm/stack-config-file.d.ts.map +1 -0
- package/dist/esm/stack-config-file.js +76 -0
- package/dist/esm/stack-config-file.js.map +1 -0
- package/dist/esm/utils/api-keys.d.ts +26 -0
- package/dist/esm/utils/api-keys.d.ts.map +1 -0
- package/dist/esm/utils/api-keys.js +77 -0
- package/dist/esm/utils/api-keys.js.map +1 -0
- package/dist/esm/utils/arrays.d.ts +25 -0
- package/dist/esm/utils/arrays.d.ts.map +1 -0
- package/dist/esm/utils/arrays.js +552 -0
- package/dist/esm/utils/arrays.js.map +1 -0
- package/dist/esm/utils/auth-methods.d.ts +6 -0
- package/dist/esm/utils/auth-methods.d.ts.map +1 -0
- package/dist/esm/utils/auth-methods.js +11 -0
- package/dist/esm/utils/auth-methods.js.map +1 -0
- package/dist/esm/utils/base64.d.ts +6 -0
- package/dist/esm/utils/base64.d.ts.map +1 -0
- package/dist/esm/utils/base64.js +25 -0
- package/dist/esm/utils/base64.js.map +1 -0
- package/dist/esm/utils/booleans.d.ts +8 -0
- package/dist/esm/utils/booleans.d.ts.map +1 -0
- package/dist/esm/utils/booleans.js +35 -0
- package/dist/esm/utils/booleans.js.map +1 -0
- package/dist/esm/utils/browser-compat.d.ts +10 -0
- package/dist/esm/utils/browser-compat.d.ts.map +1 -0
- package/dist/esm/utils/browser-compat.js +21 -0
- package/dist/esm/utils/browser-compat.js.map +1 -0
- package/dist/esm/utils/bytes.d.ts +17 -0
- package/dist/esm/utils/bytes.d.ts.map +1 -0
- package/dist/esm/utils/bytes.js +290 -0
- package/dist/esm/utils/bytes.js.map +1 -0
- package/dist/esm/utils/caches.d.ts +102 -0
- package/dist/esm/utils/caches.d.ts.map +1 -0
- package/dist/esm/utils/caches.js +185 -0
- package/dist/esm/utils/caches.js.map +1 -0
- package/dist/esm/utils/cel-fields.d.ts +23 -0
- package/dist/esm/utils/cel-fields.d.ts.map +1 -0
- package/dist/esm/utils/cel-fields.js +99 -0
- package/dist/esm/utils/cel-fields.js.map +1 -0
- package/dist/esm/utils/compile-time.d.ts +10 -0
- package/dist/esm/utils/compile-time.d.ts.map +1 -0
- package/dist/esm/utils/compile-time.js +14 -0
- package/dist/esm/utils/compile-time.js.map +1 -0
- package/dist/esm/utils/country-codes.d.ts +11 -0
- package/dist/esm/utils/country-codes.d.ts.map +1 -0
- package/dist/esm/utils/country-codes.js +36 -0
- package/dist/esm/utils/country-codes.js.map +1 -0
- package/dist/esm/utils/crypto.d.ts +48 -0
- package/dist/esm/utils/crypto.d.ts.map +1 -0
- package/dist/esm/utils/crypto.js +208 -0
- package/dist/esm/utils/crypto.js.map +1 -0
- package/dist/esm/utils/currencies.d.ts +8 -0
- package/dist/esm/utils/currencies.d.ts.map +1 -0
- package/dist/esm/utils/currencies.js +50 -0
- package/dist/esm/utils/currencies.js.map +1 -0
- package/dist/esm/utils/currency-constants.d.ts +39 -0
- package/dist/esm/utils/currency-constants.d.ts.map +1 -0
- package/dist/esm/utils/currency-constants.js +42 -0
- package/dist/esm/utils/currency-constants.js.map +1 -0
- package/dist/esm/utils/dates.d.ts +23 -0
- package/dist/esm/utils/dates.d.ts.map +1 -0
- package/dist/esm/utils/dates.js +167 -0
- package/dist/esm/utils/dates.js.map +1 -0
- package/dist/esm/utils/dev-env-state-path.d.ts +6 -0
- package/dist/esm/utils/dev-env-state-path.d.ts.map +1 -0
- package/dist/esm/utils/dev-env-state-path.js +15 -0
- package/dist/esm/utils/dev-env-state-path.js.map +1 -0
- package/dist/esm/utils/dom.d.ts +5 -0
- package/dist/esm/utils/dom.d.ts.map +1 -0
- package/dist/esm/utils/dom.js +11 -0
- package/dist/esm/utils/dom.js.map +1 -0
- package/dist/esm/utils/env.d.ts +25 -0
- package/dist/esm/utils/env.d.ts.map +1 -0
- package/dist/esm/utils/env.js +78 -0
- package/dist/esm/utils/env.js.map +1 -0
- package/dist/esm/utils/errors.d.ts +231 -0
- package/dist/esm/utils/errors.d.ts.map +1 -0
- package/dist/esm/utils/errors.js +385 -0
- package/dist/esm/utils/errors.js.map +1 -0
- package/dist/esm/utils/esbuild.d.ts +16 -0
- package/dist/esm/utils/esbuild.d.ts.map +1 -0
- package/dist/esm/utils/esbuild.js +182 -0
- package/dist/esm/utils/esbuild.js.map +1 -0
- package/dist/esm/utils/featurebase.d.ts +30 -0
- package/dist/esm/utils/featurebase.d.ts.map +1 -0
- package/dist/esm/utils/featurebase.js +166 -0
- package/dist/esm/utils/featurebase.js.map +1 -0
- package/dist/esm/utils/fs.d.ts +9 -0
- package/dist/esm/utils/fs.d.ts.map +1 -0
- package/dist/esm/utils/fs.js +25 -0
- package/dist/esm/utils/fs.js.map +1 -0
- package/dist/esm/utils/functions.d.ts +6 -0
- package/dist/esm/utils/functions.d.ts.map +1 -0
- package/dist/esm/utils/functions.js +34 -0
- package/dist/esm/utils/functions.js.map +1 -0
- package/dist/esm/utils/geo.d.ts +24 -0
- package/dist/esm/utils/geo.d.ts.map +1 -0
- package/dist/esm/utils/geo.js +16 -0
- package/dist/esm/utils/geo.js.map +1 -0
- package/dist/esm/utils/globals.d.ts +13 -0
- package/dist/esm/utils/globals.d.ts.map +1 -0
- package/dist/esm/utils/globals.js +34 -0
- package/dist/esm/utils/globals.js.map +1 -0
- package/dist/esm/utils/hashes.d.ts +9 -0
- package/dist/esm/utils/hashes.d.ts.map +1 -0
- package/dist/esm/utils/hashes.js +40 -0
- package/dist/esm/utils/hashes.js.map +1 -0
- package/dist/esm/utils/html.d.ts +7 -0
- package/dist/esm/utils/html.d.ts.map +1 -0
- package/dist/esm/utils/html.js +33 -0
- package/dist/esm/utils/html.js.map +1 -0
- package/dist/esm/utils/http.d.ts +45 -0
- package/dist/esm/utils/http.d.ts.map +1 -0
- package/dist/esm/utils/http.js +75 -0
- package/dist/esm/utils/http.js.map +1 -0
- package/dist/esm/utils/ips.d.ts +8 -0
- package/dist/esm/utils/ips.d.ts.map +1 -0
- package/dist/esm/utils/ips.js +36 -0
- package/dist/esm/utils/ips.js.map +1 -0
- package/dist/esm/utils/json.d.ts +15 -0
- package/dist/esm/utils/json.d.ts.map +1 -0
- package/dist/esm/utils/json.js +178 -0
- package/dist/esm/utils/json.js.map +1 -0
- package/dist/esm/utils/jsx-editable-transpiler.d.ts +68 -0
- package/dist/esm/utils/jsx-editable-transpiler.d.ts.map +1 -0
- package/dist/esm/utils/jsx-editable-transpiler.js +216 -0
- package/dist/esm/utils/jsx-editable-transpiler.js.map +1 -0
- package/dist/esm/utils/jsx-editable-transpiler.test.d.ts +1 -0
- package/dist/esm/utils/jsx-editable-transpiler.test.js +122 -0
- package/dist/esm/utils/jsx-editable-transpiler.test.js.map +1 -0
- package/dist/esm/utils/jwt.d.ts +79 -0
- package/dist/esm/utils/jwt.d.ts.map +1 -0
- package/dist/esm/utils/jwt.js +102 -0
- package/dist/esm/utils/jwt.js.map +1 -0
- package/dist/esm/utils/locks.d.ts +17 -0
- package/dist/esm/utils/locks.d.ts.map +1 -0
- package/dist/esm/utils/locks.js +54 -0
- package/dist/esm/utils/locks.js.map +1 -0
- package/dist/esm/utils/maps.d.ts +61 -0
- package/dist/esm/utils/maps.d.ts.map +1 -0
- package/dist/esm/utils/maps.js +297 -0
- package/dist/esm/utils/maps.js.map +1 -0
- package/dist/esm/utils/math.d.ts +8 -0
- package/dist/esm/utils/math.d.ts.map +1 -0
- package/dist/esm/utils/math.js +21 -0
- package/dist/esm/utils/math.js.map +1 -0
- package/dist/esm/utils/monkey-patch.d.ts +7 -0
- package/dist/esm/utils/monkey-patch.d.ts.map +1 -0
- package/dist/esm/utils/monkey-patch.js +21 -0
- package/dist/esm/utils/monkey-patch.js.map +1 -0
- package/dist/esm/utils/node-http.d.ts +17 -0
- package/dist/esm/utils/node-http.d.ts.map +1 -0
- package/dist/esm/utils/node-http.js +38 -0
- package/dist/esm/utils/node-http.js.map +1 -0
- package/dist/esm/utils/numbers.d.ts +7 -0
- package/dist/esm/utils/numbers.d.ts.map +1 -0
- package/dist/esm/utils/numbers.js +75 -0
- package/dist/esm/utils/numbers.js.map +1 -0
- package/dist/esm/utils/oauth.d.ts +11 -0
- package/dist/esm/utils/oauth.d.ts.map +1 -0
- package/dist/esm/utils/oauth.js +27 -0
- package/dist/esm/utils/oauth.js.map +1 -0
- package/dist/esm/utils/objects.d.ts +59 -0
- package/dist/esm/utils/objects.d.ts.map +1 -0
- package/dist/esm/utils/objects.js +818 -0
- package/dist/esm/utils/objects.js.map +1 -0
- package/dist/esm/utils/paginated-lists.d.ts +442 -0
- package/dist/esm/utils/paginated-lists.d.ts.map +1 -0
- package/dist/esm/utils/paginated-lists.js +411 -0
- package/dist/esm/utils/paginated-lists.js.map +1 -0
- package/dist/esm/utils/paginated-lists.test.d.ts +1 -0
- package/dist/esm/utils/paginated-lists.test.js +1304 -0
- package/dist/esm/utils/paginated-lists.test.js.map +1 -0
- package/dist/esm/utils/passkey.d.ts +2 -0
- package/dist/esm/utils/passkey.js +1 -0
- package/dist/esm/utils/promises.d.ts +80 -0
- package/dist/esm/utils/promises.d.ts.map +1 -0
- package/dist/esm/utils/promises.js +333 -0
- package/dist/esm/utils/promises.js.map +1 -0
- package/dist/esm/utils/proxies.d.ts +13 -0
- package/dist/esm/utils/proxies.d.ts.map +1 -0
- package/dist/esm/utils/proxies.js +197 -0
- package/dist/esm/utils/proxies.js.map +1 -0
- package/dist/esm/utils/react.d.ts +61 -0
- package/dist/esm/utils/react.d.ts.map +1 -0
- package/dist/esm/utils/react.js +229 -0
- package/dist/esm/utils/react.js.map +1 -0
- package/dist/esm/utils/redirect-urls.d.ts +30 -0
- package/dist/esm/utils/redirect-urls.d.ts.map +1 -0
- package/dist/esm/utils/redirect-urls.js +215 -0
- package/dist/esm/utils/redirect-urls.js.map +1 -0
- package/dist/esm/utils/regex.d.ts +5 -0
- package/dist/esm/utils/regex.d.ts.map +1 -0
- package/dist/esm/utils/regex.js +13 -0
- package/dist/esm/utils/regex.js.map +1 -0
- package/dist/esm/utils/results.d.ts +70 -0
- package/dist/esm/utils/results.d.ts.map +1 -0
- package/dist/esm/utils/results.js +339 -0
- package/dist/esm/utils/results.js.map +1 -0
- package/dist/esm/utils/sentry.d.ts +13 -0
- package/dist/esm/utils/sentry.d.ts.map +1 -0
- package/dist/esm/utils/sentry.js +14 -0
- package/dist/esm/utils/sentry.js.map +1 -0
- package/dist/esm/utils/stores.d.ts +104 -0
- package/dist/esm/utils/stores.d.ts.map +1 -0
- package/dist/esm/utils/stores.js +175 -0
- package/dist/esm/utils/stores.js.map +1 -0
- package/dist/esm/utils/strings.d.ts +76 -0
- package/dist/esm/utils/strings.d.ts.map +1 -0
- package/dist/esm/utils/strings.js +530 -0
- package/dist/esm/utils/strings.js.map +1 -0
- package/dist/esm/utils/strings.nicify.test.d.ts +1 -0
- package/dist/esm/utils/strings.nicify.test.js +243 -0
- package/dist/esm/utils/strings.nicify.test.js.map +1 -0
- package/dist/esm/utils/telemetry.d.ts +15 -0
- package/dist/esm/utils/telemetry.d.ts.map +1 -0
- package/dist/esm/utils/telemetry.js +31 -0
- package/dist/esm/utils/telemetry.js.map +1 -0
- package/dist/esm/utils/turnstile-browser.d.ts +32 -0
- package/dist/esm/utils/turnstile-browser.d.ts.map +1 -0
- package/dist/esm/utils/turnstile-browser.js +61 -0
- package/dist/esm/utils/turnstile-browser.js.map +1 -0
- package/dist/esm/utils/turnstile-flow.d.ts +29 -0
- package/dist/esm/utils/turnstile-flow.d.ts.map +1 -0
- package/dist/esm/utils/turnstile-flow.js +219 -0
- package/dist/esm/utils/turnstile-flow.js.map +1 -0
- package/dist/esm/utils/turnstile-flow.test.d.ts +1 -0
- package/dist/esm/utils/turnstile-flow.test.js +75 -0
- package/dist/esm/utils/turnstile-flow.test.js.map +1 -0
- package/dist/esm/utils/turnstile.d.ts +17 -0
- package/dist/esm/utils/turnstile.d.ts.map +1 -0
- package/dist/esm/utils/turnstile.js +25 -0
- package/dist/esm/utils/turnstile.js.map +1 -0
- package/dist/esm/utils/typed-arrays.d.ts +14 -0
- package/dist/esm/utils/typed-arrays.d.ts.map +1 -0
- package/dist/esm/utils/typed-arrays.js +20 -0
- package/dist/esm/utils/typed-arrays.js.map +1 -0
- package/dist/esm/utils/types.d.ts +77 -0
- package/dist/esm/utils/types.d.ts.map +1 -0
- package/dist/esm/utils/types.js +55 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/dist/esm/utils/unicode.d.ts +5 -0
- package/dist/esm/utils/unicode.d.ts.map +1 -0
- package/dist/esm/utils/unicode.js +24 -0
- package/dist/esm/utils/unicode.js.map +1 -0
- package/dist/esm/utils/urls.d.ts +28 -0
- package/dist/esm/utils/urls.d.ts.map +1 -0
- package/dist/esm/utils/urls.js +259 -0
- package/dist/esm/utils/urls.js.map +1 -0
- package/dist/esm/utils/uuids.d.ts +6 -0
- package/dist/esm/utils/uuids.d.ts.map +1 -0
- package/dist/esm/utils/uuids.js +36 -0
- package/dist/esm/utils/uuids.js.map +1 -0
- package/dist/global.d.d.ts +0 -0
- package/dist/global.d.ts +1 -0
- package/dist/helpers/emails.d.ts +69 -0
- package/dist/helpers/emails.d.ts.map +1 -0
- package/dist/helpers/emails.js +252 -0
- package/dist/helpers/emails.js.map +1 -0
- package/dist/helpers/init-prompt.d.ts +5 -0
- package/dist/helpers/init-prompt.d.ts.map +1 -0
- package/dist/helpers/init-prompt.js +42 -0
- package/dist/helpers/init-prompt.js.map +1 -0
- package/dist/helpers/password.d.ts +6 -0
- package/dist/helpers/password.d.ts.map +1 -0
- package/dist/helpers/password.js +15 -0
- package/dist/helpers/password.js.map +1 -0
- package/dist/helpers/production-mode.d.ts +11 -0
- package/dist/helpers/production-mode.d.ts.map +1 -0
- package/dist/helpers/production-mode.js +48 -0
- package/dist/helpers/production-mode.js.map +1 -0
- package/dist/helpers/support-sla.d.ts +48 -0
- package/dist/helpers/support-sla.d.ts.map +1 -0
- package/dist/helpers/support-sla.js +72 -0
- package/dist/helpers/support-sla.js.map +1 -0
- package/dist/helpers/support-sla.test.d.ts +1 -0
- package/dist/helpers/support-sla.test.js +102 -0
- package/dist/helpers/support-sla.test.js.map +1 -0
- package/dist/helpers/vault/client-side.d.ts +16 -0
- package/dist/helpers/vault/client-side.d.ts.map +1 -0
- package/dist/helpers/vault/client-side.js +73 -0
- package/dist/helpers/vault/client-side.js.map +1 -0
- package/dist/helpers/vault/server-side.d.ts +9 -0
- package/dist/helpers/vault/server-side.d.ts.map +1 -0
- package/dist/helpers/vault/server-side.js +126 -0
- package/dist/helpers/vault/server-side.js.map +1 -0
- package/dist/hooks/use-async-callback.d.ts +8 -0
- package/dist/hooks/use-async-callback.d.ts.map +1 -0
- package/dist/hooks/use-async-callback.js +42 -0
- package/dist/hooks/use-async-callback.js.map +1 -0
- package/dist/hooks/use-async-external-store.d.ts +9 -0
- package/dist/hooks/use-async-external-store.d.ts.map +1 -0
- package/dist/hooks/use-async-external-store.js +22 -0
- package/dist/hooks/use-async-external-store.js.map +1 -0
- package/dist/hooks/use-hash.d.ts +5 -0
- package/dist/hooks/use-hash.d.ts.map +1 -0
- package/dist/hooks/use-hash.js +17 -0
- package/dist/hooks/use-hash.js.map +1 -0
- package/dist/hooks/use-hover.d.ts +8 -0
- package/dist/hooks/use-hover.d.ts.map +1 -0
- package/dist/hooks/use-hover.js +61 -0
- package/dist/hooks/use-hover.js.map +1 -0
- package/dist/hooks/use-strict-memo.d.ts +10 -0
- package/dist/hooks/use-strict-memo.d.ts.map +1 -0
- package/dist/hooks/use-strict-memo.js +121 -0
- package/dist/hooks/use-strict-memo.js.map +1 -0
- package/dist/index-D9ysacya.d.ts +153 -0
- package/dist/index-D9ysacya.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +37 -0
- package/dist/interface/admin-interface.d.ts +308 -0
- package/dist/interface/admin-interface.d.ts.map +1 -0
- package/dist/interface/admin-interface.js +465 -0
- package/dist/interface/admin-interface.js.map +1 -0
- package/dist/interface/admin-metrics.d.ts +597 -0
- package/dist/interface/admin-metrics.d.ts.map +1 -0
- package/dist/interface/admin-metrics.js +153 -0
- package/dist/interface/admin-metrics.js.map +1 -0
- package/dist/interface/client-interface.d.ts +447 -0
- package/dist/interface/client-interface.d.ts.map +1 -0
- package/dist/interface/client-interface.js +1948 -0
- package/dist/interface/client-interface.js.map +1 -0
- package/dist/interface/client-interface.test.d.ts +1 -0
- package/dist/interface/client-interface.test.js +559 -0
- package/dist/interface/client-interface.test.js.map +1 -0
- package/dist/interface/conversations.d.ts +314 -0
- package/dist/interface/conversations.d.ts.map +1 -0
- package/dist/interface/conversations.js +121 -0
- package/dist/interface/conversations.js.map +1 -0
- package/dist/interface/crud/analytics.d.ts +14 -0
- package/dist/interface/crud/analytics.d.ts.map +1 -0
- package/dist/interface/crud/analytics.js +0 -0
- package/dist/interface/crud/connected-accounts.d.ts +68 -0
- package/dist/interface/crud/connected-accounts.d.ts.map +1 -0
- package/dist/interface/crud/connected-accounts.js +41 -0
- package/dist/interface/crud/connected-accounts.js.map +1 -0
- package/dist/interface/crud/contact-channels.d.ts +181 -0
- package/dist/interface/crud/contact-channels.d.ts.map +1 -0
- package/dist/interface/crud/contact-channels.js +76 -0
- package/dist/interface/crud/contact-channels.js.map +1 -0
- package/dist/interface/crud/current-user.d.ts +285 -0
- package/dist/interface/crud/current-user.d.ts.map +1 -0
- package/dist/interface/crud/current-user.js +71 -0
- package/dist/interface/crud/current-user.js.map +1 -0
- package/dist/interface/crud/email-outbox.d.ts +1465 -0
- package/dist/interface/crud/email-outbox.d.ts.map +1 -0
- package/dist/interface/crud/email-outbox.js +195 -0
- package/dist/interface/crud/email-outbox.js.map +1 -0
- package/dist/interface/crud/email-templates.d.ts +85 -0
- package/dist/interface/crud/email-templates.d.ts.map +1 -0
- package/dist/interface/crud/email-templates.js +53 -0
- package/dist/interface/crud/email-templates.js.map +1 -0
- package/dist/interface/crud/emails.d.ts +41 -0
- package/dist/interface/crud/emails.d.ts.map +1 -0
- package/dist/interface/crud/emails.js +23 -0
- package/dist/interface/crud/emails.js.map +1 -0
- package/dist/interface/crud/internal-api-keys.d.ts +140 -0
- package/dist/interface/crud/internal-api-keys.d.ts.map +1 -0
- package/dist/interface/crud/internal-api-keys.js +56 -0
- package/dist/interface/crud/internal-api-keys.js.map +1 -0
- package/dist/interface/crud/invoices.d.ts +43 -0
- package/dist/interface/crud/invoices.d.ts.map +1 -0
- package/dist/interface/crud/invoices.js +28 -0
- package/dist/interface/crud/invoices.js.map +1 -0
- package/dist/interface/crud/items.d.ts +30 -0
- package/dist/interface/crud/items.d.ts.map +1 -0
- package/dist/interface/crud/items.js +25 -0
- package/dist/interface/crud/items.js.map +1 -0
- package/dist/interface/crud/notification-preferences.d.ts +38 -0
- package/dist/interface/crud/notification-preferences.d.ts.map +1 -0
- package/dist/interface/crud/notification-preferences.js +33 -0
- package/dist/interface/crud/notification-preferences.js.map +1 -0
- package/dist/interface/crud/oauth-providers.d.ts +186 -0
- package/dist/interface/crud/oauth-providers.d.ts.map +1 -0
- package/dist/interface/crud/oauth-providers.js +83 -0
- package/dist/interface/crud/oauth-providers.js.map +1 -0
- package/dist/interface/crud/products.d.ts +182 -0
- package/dist/interface/crud/products.d.ts.map +1 -0
- package/dist/interface/crud/products.js +32 -0
- package/dist/interface/crud/products.js.map +1 -0
- package/dist/interface/crud/project-api-keys.d.ts +203 -0
- package/dist/interface/crud/project-api-keys.d.ts.map +1 -0
- package/dist/interface/crud/project-api-keys.js +79 -0
- package/dist/interface/crud/project-api-keys.js.map +1 -0
- package/dist/interface/crud/project-permissions.d.ts +161 -0
- package/dist/interface/crud/project-permissions.d.ts.map +1 -0
- package/dist/interface/crud/project-permissions.js +116 -0
- package/dist/interface/crud/project-permissions.js.map +1 -0
- package/dist/interface/crud/projects.d.ts +851 -0
- package/dist/interface/crud/projects.d.ts.map +1 -0
- package/dist/interface/crud/projects.js +204 -0
- package/dist/interface/crud/projects.js.map +1 -0
- package/dist/interface/crud/session-replays.d.ts +83 -0
- package/dist/interface/crud/session-replays.d.ts.map +1 -0
- package/dist/interface/crud/session-replays.js +0 -0
- package/dist/interface/crud/sessions.d.ts +150 -0
- package/dist/interface/crud/sessions.d.ts.map +1 -0
- package/dist/interface/crud/sessions.js +62 -0
- package/dist/interface/crud/sessions.js.map +1 -0
- package/dist/interface/crud/sign-up-rules.d.ts +15 -0
- package/dist/interface/crud/sign-up-rules.d.ts.map +1 -0
- package/dist/interface/crud/sign-up-rules.js +0 -0
- package/dist/interface/crud/svix-token.d.ts +31 -0
- package/dist/interface/crud/svix-token.d.ts.map +1 -0
- package/dist/interface/crud/svix-token.js +22 -0
- package/dist/interface/crud/svix-token.js.map +1 -0
- package/dist/interface/crud/team-invitation-details.d.ts +31 -0
- package/dist/interface/crud/team-invitation-details.d.ts.map +1 -0
- package/dist/interface/crud/team-invitation-details.js +24 -0
- package/dist/interface/crud/team-invitation-details.js.map +1 -0
- package/dist/interface/crud/team-invitation.d.ts +54 -0
- package/dist/interface/crud/team-invitation.d.ts.map +1 -0
- package/dist/interface/crud/team-invitation.js +40 -0
- package/dist/interface/crud/team-invitation.js.map +1 -0
- package/dist/interface/crud/team-member-profiles.d.ts +286 -0
- package/dist/interface/crud/team-member-profiles.d.ts.map +1 -0
- package/dist/interface/crud/team-member-profiles.js +63 -0
- package/dist/interface/crud/team-member-profiles.js.map +1 -0
- package/dist/interface/crud/team-memberships.d.ts +75 -0
- package/dist/interface/crud/team-memberships.d.ts.map +1 -0
- package/dist/interface/crud/team-memberships.js +61 -0
- package/dist/interface/crud/team-memberships.js.map +1 -0
- package/dist/interface/crud/team-permissions.d.ts +169 -0
- package/dist/interface/crud/team-permissions.d.ts.map +1 -0
- package/dist/interface/crud/team-permissions.js +117 -0
- package/dist/interface/crud/team-permissions.js.map +1 -0
- package/dist/interface/crud/teams.d.ts +299 -0
- package/dist/interface/crud/teams.d.ts.map +1 -0
- package/dist/interface/crud/teams.js +142 -0
- package/dist/interface/crud/teams.js.map +1 -0
- package/dist/interface/crud/transactions.d.ts +183 -0
- package/dist/interface/crud/transactions.d.ts.map +1 -0
- package/dist/interface/crud/transactions.js +89 -0
- package/dist/interface/crud/transactions.js.map +1 -0
- package/dist/interface/crud/users.d.ts +653 -0
- package/dist/interface/crud/users.d.ts.map +1 -0
- package/dist/interface/crud/users.js +193 -0
- package/dist/interface/crud/users.js.map +1 -0
- package/dist/interface/handler-urls.d.ts +51 -0
- package/dist/interface/handler-urls.d.ts.map +1 -0
- package/dist/interface/handler-urls.js +16 -0
- package/dist/interface/page-component-versions.d.ts +25 -0
- package/dist/interface/page-component-versions.d.ts.map +1 -0
- package/dist/interface/page-component-versions.js +1664 -0
- package/dist/interface/page-component-versions.js.map +1 -0
- package/dist/interface/server-interface.d.ts +255 -0
- package/dist/interface/server-interface.d.ts.map +1 -0
- package/dist/interface/server-interface.js +461 -0
- package/dist/interface/server-interface.js.map +1 -0
- package/dist/interface/webhooks.d.ts +326 -0
- package/dist/interface/webhooks.d.ts.map +1 -0
- package/dist/interface/webhooks.js +24 -0
- package/dist/interface/webhooks.js.map +1 -0
- package/dist/known-errors.d.ts +575 -0
- package/dist/known-errors.d.ts.map +1 -0
- package/dist/known-errors.js +794 -0
- package/dist/known-errors.js.map +1 -0
- package/dist/local-emulator.d.ts +6 -0
- package/dist/local-emulator.d.ts.map +1 -0
- package/dist/local-emulator.js +10 -0
- package/dist/local-emulator.js.map +1 -0
- package/dist/payments/payment-methods.d.ts +64 -0
- package/dist/payments/payment-methods.d.ts.map +1 -0
- package/dist/payments/payment-methods.js +216 -0
- package/dist/payments/payment-methods.js.map +1 -0
- package/dist/payments/stripe-limits.d.ts +17 -0
- package/dist/payments/stripe-limits.d.ts.map +1 -0
- package/dist/payments/stripe-limits.js +20 -0
- package/dist/payments/stripe-limits.js.map +1 -0
- package/dist/plans.d.ts +72 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +88 -0
- package/dist/plans.js.map +1 -0
- package/dist/schema-fields.d.ts +472 -0
- package/dist/schema-fields.d.ts.map +1 -0
- package/dist/schema-fields.js +1188 -0
- package/dist/schema-fields.js.map +1 -0
- package/dist/sessions.d.ts +165 -0
- package/dist/sessions.d.ts.map +1 -0
- package/dist/sessions.js +231 -0
- package/dist/sessions.js.map +1 -0
- package/dist/stack-config-file.d.ts +15 -0
- package/dist/stack-config-file.d.ts.map +1 -0
- package/dist/stack-config-file.js +82 -0
- package/dist/stack-config-file.js.map +1 -0
- package/dist/utils/api-keys.d.ts +26 -0
- package/dist/utils/api-keys.d.ts.map +1 -0
- package/dist/utils/api-keys.js +82 -0
- package/dist/utils/api-keys.js.map +1 -0
- package/dist/utils/arrays.d.ts +25 -0
- package/dist/utils/arrays.d.ts.map +1 -0
- package/dist/utils/arrays.js +569 -0
- package/dist/utils/arrays.js.map +1 -0
- package/dist/utils/auth-methods.d.ts +6 -0
- package/dist/utils/auth-methods.d.ts.map +1 -0
- package/dist/utils/auth-methods.js +13 -0
- package/dist/utils/auth-methods.js.map +1 -0
- package/dist/utils/base64.d.ts +6 -0
- package/dist/utils/base64.d.ts.map +1 -0
- package/dist/utils/base64.js +28 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/booleans.d.ts +8 -0
- package/dist/utils/booleans.d.ts.map +1 -0
- package/dist/utils/booleans.js +38 -0
- package/dist/utils/booleans.js.map +1 -0
- package/dist/utils/browser-compat.d.ts +10 -0
- package/dist/utils/browser-compat.d.ts.map +1 -0
- package/dist/utils/browser-compat.js +23 -0
- package/dist/utils/browser-compat.js.map +1 -0
- package/dist/utils/bytes.d.ts +17 -0
- package/dist/utils/bytes.d.ts.map +1 -0
- package/dist/utils/bytes.js +304 -0
- package/dist/utils/bytes.js.map +1 -0
- package/dist/utils/caches.d.ts +102 -0
- package/dist/utils/caches.d.ts.map +1 -0
- package/dist/utils/caches.js +188 -0
- package/dist/utils/caches.js.map +1 -0
- package/dist/utils/cel-fields.d.ts +23 -0
- package/dist/utils/cel-fields.d.ts.map +1 -0
- package/dist/utils/cel-fields.js +108 -0
- package/dist/utils/cel-fields.js.map +1 -0
- package/dist/utils/compile-time.d.ts +10 -0
- package/dist/utils/compile-time.d.ts.map +1 -0
- package/dist/utils/compile-time.js +16 -0
- package/dist/utils/compile-time.js.map +1 -0
- package/dist/utils/country-codes.d.ts +11 -0
- package/dist/utils/country-codes.d.ts.map +1 -0
- package/dist/utils/country-codes.js +40 -0
- package/dist/utils/country-codes.js.map +1 -0
- package/dist/utils/crypto.d.ts +48 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +215 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/currencies.d.ts +8 -0
- package/dist/utils/currencies.d.ts.map +1 -0
- package/dist/utils/currencies.js +52 -0
- package/dist/utils/currencies.js.map +1 -0
- package/dist/utils/currency-constants.d.ts +39 -0
- package/dist/utils/currency-constants.d.ts.map +1 -0
- package/dist/utils/currency-constants.js +44 -0
- package/dist/utils/currency-constants.js.map +1 -0
- package/dist/utils/dates.d.ts +23 -0
- package/dist/utils/dates.d.ts.map +1 -0
- package/dist/utils/dates.js +176 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/dev-env-state-path.d.ts +6 -0
- package/dist/utils/dev-env-state-path.d.ts.map +1 -0
- package/dist/utils/dev-env-state-path.js +18 -0
- package/dist/utils/dev-env-state-path.js.map +1 -0
- package/dist/utils/dom.d.ts +5 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/dist/utils/dom.js +13 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/env.d.ts +25 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +85 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +231 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +393 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/esbuild.d.ts +16 -0
- package/dist/utils/esbuild.d.ts.map +1 -0
- package/dist/utils/esbuild.js +186 -0
- package/dist/utils/esbuild.js.map +1 -0
- package/dist/utils/featurebase.d.ts +30 -0
- package/dist/utils/featurebase.d.ts.map +1 -0
- package/dist/utils/featurebase.js +168 -0
- package/dist/utils/featurebase.js.map +1 -0
- package/dist/utils/fs.d.ts +9 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +31 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/functions.d.ts +6 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/dist/utils/functions.js +37 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/geo.d.ts +24 -0
- package/dist/utils/geo.d.ts.map +1 -0
- package/dist/utils/geo.js +18 -0
- package/dist/utils/geo.js.map +1 -0
- package/dist/utils/globals.d.ts +13 -0
- package/dist/utils/globals.d.ts.map +1 -0
- package/dist/utils/globals.js +40 -0
- package/dist/utils/globals.js.map +1 -0
- package/dist/utils/hashes.d.ts +9 -0
- package/dist/utils/hashes.d.ts.map +1 -0
- package/dist/utils/hashes.js +47 -0
- package/dist/utils/hashes.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +37 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/http.d.ts +45 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/http.js +79 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/utils/ips.d.ts +8 -0
- package/dist/utils/ips.d.ts.map +1 -0
- package/dist/utils/ips.js +40 -0
- package/dist/utils/ips.js.map +1 -0
- package/dist/utils/json.d.ts +15 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +182 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/jsx-editable-transpiler.d.ts +68 -0
- package/dist/utils/jsx-editable-transpiler.d.ts.map +1 -0
- package/dist/utils/jsx-editable-transpiler.js +223 -0
- package/dist/utils/jsx-editable-transpiler.js.map +1 -0
- package/dist/utils/jsx-editable-transpiler.test.d.ts +1 -0
- package/dist/utils/jsx-editable-transpiler.test.js +122 -0
- package/dist/utils/jsx-editable-transpiler.test.js.map +1 -0
- package/dist/utils/jwt.d.ts +79 -0
- package/dist/utils/jwt.d.ts.map +1 -0
- package/dist/utils/jwt.js +112 -0
- package/dist/utils/jwt.js.map +1 -0
- package/dist/utils/locks.d.ts +17 -0
- package/dist/utils/locks.d.ts.map +1 -0
- package/dist/utils/locks.js +56 -0
- package/dist/utils/locks.js.map +1 -0
- package/dist/utils/maps.d.ts +61 -0
- package/dist/utils/maps.d.ts.map +1 -0
- package/dist/utils/maps.js +302 -0
- package/dist/utils/maps.js.map +1 -0
- package/dist/utils/math.d.ts +8 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/math.js +23 -0
- package/dist/utils/math.js.map +1 -0
- package/dist/utils/monkey-patch.d.ts +7 -0
- package/dist/utils/monkey-patch.d.ts.map +1 -0
- package/dist/utils/monkey-patch.js +25 -0
- package/dist/utils/monkey-patch.js.map +1 -0
- package/dist/utils/node-http.d.ts +17 -0
- package/dist/utils/node-http.d.ts.map +1 -0
- package/dist/utils/node-http.js +40 -0
- package/dist/utils/node-http.js.map +1 -0
- package/dist/utils/numbers.d.ts +7 -0
- package/dist/utils/numbers.d.ts.map +1 -0
- package/dist/utils/numbers.js +79 -0
- package/dist/utils/numbers.js.map +1 -0
- package/dist/utils/oauth.d.ts +11 -0
- package/dist/utils/oauth.d.ts.map +1 -0
- package/dist/utils/oauth.js +32 -0
- package/dist/utils/oauth.js.map +1 -0
- package/dist/utils/objects.d.ts +59 -0
- package/dist/utils/objects.d.ts.map +1 -0
- package/dist/utils/objects.js +846 -0
- package/dist/utils/objects.js.map +1 -0
- package/dist/utils/paginated-lists.d.ts +442 -0
- package/dist/utils/paginated-lists.d.ts.map +1 -0
- package/dist/utils/paginated-lists.js +414 -0
- package/dist/utils/paginated-lists.js.map +1 -0
- package/dist/utils/paginated-lists.test.d.ts +1 -0
- package/dist/utils/paginated-lists.test.js +1304 -0
- package/dist/utils/paginated-lists.test.js.map +1 -0
- package/dist/utils/passkey.d.ts +2 -0
- package/dist/utils/passkey.js +0 -0
- package/dist/utils/promises.d.ts +80 -0
- package/dist/utils/promises.d.ts.map +1 -0
- package/dist/utils/promises.js +349 -0
- package/dist/utils/promises.js.map +1 -0
- package/dist/utils/proxies.d.ts +13 -0
- package/dist/utils/proxies.d.ts.map +1 -0
- package/dist/utils/proxies.js +201 -0
- package/dist/utils/proxies.js.map +1 -0
- package/dist/utils/react.d.ts +61 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/dist/utils/react.js +243 -0
- package/dist/utils/react.js.map +1 -0
- package/dist/utils/redirect-urls.d.ts +30 -0
- package/dist/utils/redirect-urls.d.ts.map +1 -0
- package/dist/utils/redirect-urls.js +222 -0
- package/dist/utils/redirect-urls.js.map +1 -0
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.d.ts.map +1 -0
- package/dist/utils/regex.js +15 -0
- package/dist/utils/regex.js.map +1 -0
- package/dist/utils/results.d.ts +70 -0
- package/dist/utils/results.d.ts.map +1 -0
- package/dist/utils/results.js +342 -0
- package/dist/utils/results.js.map +1 -0
- package/dist/utils/sentry.d.ts +13 -0
- package/dist/utils/sentry.d.ts.map +1 -0
- package/dist/utils/sentry.js +16 -0
- package/dist/utils/sentry.js.map +1 -0
- package/dist/utils/stores.d.ts +104 -0
- package/dist/utils/stores.d.ts.map +1 -0
- package/dist/utils/stores.js +179 -0
- package/dist/utils/stores.js.map +1 -0
- package/dist/utils/strings.d.ts +76 -0
- package/dist/utils/strings.d.ts.map +1 -0
- package/dist/utils/strings.js +549 -0
- package/dist/utils/strings.js.map +1 -0
- package/dist/utils/strings.nicify.test.d.ts +1 -0
- package/dist/utils/strings.nicify.test.js +243 -0
- package/dist/utils/strings.nicify.test.js.map +1 -0
- package/dist/utils/telemetry.d.ts +15 -0
- package/dist/utils/telemetry.d.ts.map +1 -0
- package/dist/utils/telemetry.js +35 -0
- package/dist/utils/telemetry.js.map +1 -0
- package/dist/utils/turnstile-browser.d.ts +32 -0
- package/dist/utils/turnstile-browser.d.ts.map +1 -0
- package/dist/utils/turnstile-browser.js +65 -0
- package/dist/utils/turnstile-browser.js.map +1 -0
- package/dist/utils/turnstile-flow.d.ts +29 -0
- package/dist/utils/turnstile-flow.d.ts.map +1 -0
- package/dist/utils/turnstile-flow.js +225 -0
- package/dist/utils/turnstile-flow.js.map +1 -0
- package/dist/utils/turnstile-flow.test.d.ts +1 -0
- package/dist/utils/turnstile-flow.test.js +75 -0
- package/dist/utils/turnstile-flow.test.js.map +1 -0
- package/dist/utils/turnstile.d.ts +17 -0
- package/dist/utils/turnstile.d.ts.map +1 -0
- package/dist/utils/turnstile.js +31 -0
- package/dist/utils/turnstile.js.map +1 -0
- package/dist/utils/typed-arrays.d.ts +14 -0
- package/dist/utils/typed-arrays.d.ts.map +1 -0
- package/dist/utils/typed-arrays.js +22 -0
- package/dist/utils/typed-arrays.js.map +1 -0
- package/dist/utils/types.d.ts +77 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +59 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/unicode.d.ts +5 -0
- package/dist/utils/unicode.d.ts.map +1 -0
- package/dist/utils/unicode.js +26 -0
- package/dist/utils/unicode.js.map +1 -0
- package/dist/utils/urls.d.ts +28 -0
- package/dist/utils/urls.d.ts.map +1 -0
- package/dist/utils/urls.js +274 -0
- package/dist/utils/urls.js.map +1 -0
- package/dist/utils/uuids.d.ts +6 -0
- package/dist/utils/uuids.d.ts.map +1 -0
- package/dist/utils/uuids.js +39 -0
- package/dist/utils/uuids.js.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KnownErrors } from "..";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/password.d.ts
|
|
4
|
+
declare function getPasswordError(password: string): KnownErrors["PasswordRequirementsNotMet"] | undefined;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { getPasswordError };
|
|
7
|
+
//# sourceMappingURL=password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.d.ts","names":[],"sources":["../../../src/helpers/password.ts"],"mappings":";;;iBAKgB,gBAAA,CAAiB,QAAA,WAAmB,WAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { KnownErrors } from "../index.js";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/password.ts
|
|
4
|
+
const minLength = 8;
|
|
5
|
+
const maxLength = 70;
|
|
6
|
+
function getPasswordError(password) {
|
|
7
|
+
if (password.length < minLength) return new KnownErrors.PasswordTooShort(minLength);
|
|
8
|
+
if (password.length > maxLength) return new KnownErrors.PasswordTooLong(maxLength);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getPasswordError };
|
|
13
|
+
//# sourceMappingURL=password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.js","names":[],"sources":["../../../src/helpers/password.ts"],"sourcesContent":["import { KnownErrors } from \"..\";\n\nconst minLength = 8;\nconst maxLength = 70;\n\nexport function getPasswordError(password: string): KnownErrors[\"PasswordRequirementsNotMet\"] | undefined {\n if (password.length < minLength) {\n return new KnownErrors.PasswordTooShort(minLength);\n }\n\n if (password.length > maxLength) {\n return new KnownErrors.PasswordTooLong(maxLength);\n }\n\n return undefined;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;AAClB,MAAM,YAAY;AAElB,SAAgB,iBAAiB,UAAyE;AACxG,KAAI,SAAS,SAAS,UACpB,QAAO,IAAI,YAAY,iBAAiB,UAAU;AAGpD,KAAI,SAAS,SAAS,UACpB,QAAO,IAAI,YAAY,gBAAgB,UAAU"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProjectsCrud } from "../interface/crud/projects";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/production-mode.d.ts
|
|
4
|
+
type ProductionModeError = {
|
|
5
|
+
message: string;
|
|
6
|
+
relativeFixUrl: `/${string}`;
|
|
7
|
+
};
|
|
8
|
+
declare function getProductionModeErrors(project: ProjectsCrud["Admin"]["Read"]): ProductionModeError[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ProductionModeError, getProductionModeErrors };
|
|
11
|
+
//# sourceMappingURL=production-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-mode.d.ts","names":[],"sources":["../../../src/helpers/production-mode.ts"],"mappings":";;;KAIY,mBAAA;EACV,OAAA;EACA,cAAA;AAAA;AAAA,iBAGc,uBAAA,CAAwB,OAAA,EAAS,YAAA,oBAAgC,mBAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HexclaveAssertionError, captureError } from "../utils/errors.js";
|
|
2
|
+
import { isLocalhost } from "../utils/urls.js";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/production-mode.ts
|
|
5
|
+
function getProductionModeErrors(project) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
const domainsFixUrl = `/projects/${project.id}/domains`;
|
|
8
|
+
if (project.config.allow_localhost) errors.push({
|
|
9
|
+
message: "Localhost is not allowed in production mode, turn off 'Allow localhost' in project settings",
|
|
10
|
+
relativeFixUrl: domainsFixUrl
|
|
11
|
+
});
|
|
12
|
+
for (const { domain } of project.config.domains) {
|
|
13
|
+
let url;
|
|
14
|
+
try {
|
|
15
|
+
const normalizedDomain = domain.replace(/\*+/g, "wildcard-placeholder");
|
|
16
|
+
url = new URL(normalizedDomain);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
captureError("production-mode-domain-not-valid", new HexclaveAssertionError("Domain was somehow not a valid URL; we should've caught this when setting the domain in the first place", {
|
|
19
|
+
domain,
|
|
20
|
+
projectId: project
|
|
21
|
+
}));
|
|
22
|
+
errors.push({
|
|
23
|
+
message: "Trusted domain is not a valid URL: " + domain,
|
|
24
|
+
relativeFixUrl: domainsFixUrl
|
|
25
|
+
});
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (isLocalhost(url)) errors.push({
|
|
29
|
+
message: "Localhost domains are not allowed to be trusted in production mode: " + domain,
|
|
30
|
+
relativeFixUrl: domainsFixUrl
|
|
31
|
+
});
|
|
32
|
+
else if (url.hostname.match(/^\d+(\.\d+)*$/)) errors.push({
|
|
33
|
+
message: "Direct IPs are not valid for trusted domains in production mode: " + domain,
|
|
34
|
+
relativeFixUrl: domainsFixUrl
|
|
35
|
+
});
|
|
36
|
+
else if (url.protocol !== "https:") errors.push({
|
|
37
|
+
message: "Trusted domains should be HTTPS: " + domain,
|
|
38
|
+
relativeFixUrl: domainsFixUrl
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return errors;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { getProductionModeErrors };
|
|
46
|
+
//# sourceMappingURL=production-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production-mode.js","names":[],"sources":["../../../src/helpers/production-mode.ts"],"sourcesContent":["import { ProjectsCrud } from \"../interface/crud/projects\";\nimport { HexclaveAssertionError, captureError } from \"../utils/errors\";\nimport { isLocalhost } from \"../utils/urls\";\n\nexport type ProductionModeError = {\n message: string,\n relativeFixUrl: `/${string}`,\n};\n\nexport function getProductionModeErrors(project: ProjectsCrud[\"Admin\"][\"Read\"]): ProductionModeError[] {\n const errors: ProductionModeError[] = [];\n const domainsFixUrl = `/projects/${project.id}/domains` as const;\n\n if (project.config.allow_localhost) {\n errors.push({\n message: \"Localhost is not allowed in production mode, turn off 'Allow localhost' in project settings\",\n relativeFixUrl: domainsFixUrl,\n });\n }\n\n for (const { domain } of project.config.domains) {\n let url;\n try {\n // For wildcard domains, replace wildcards with a valid placeholder to validate the URL structure\n const normalizedDomain = domain.replace(/\\*+/g, 'wildcard-placeholder');\n url = new URL(normalizedDomain);\n } catch (e) {\n captureError(\"production-mode-domain-not-valid\", new HexclaveAssertionError(\"Domain was somehow not a valid URL; we should've caught this when setting the domain in the first place\", {\n domain,\n projectId: project\n }));\n errors.push({\n message: \"Trusted domain is not a valid URL: \" + domain,\n relativeFixUrl: domainsFixUrl,\n });\n continue;\n }\n\n if (isLocalhost(url)) {\n errors.push({\n message: \"Localhost domains are not allowed to be trusted in production mode: \" + domain,\n relativeFixUrl: domainsFixUrl,\n });\n } else if (url.hostname.match(/^\\d+(\\.\\d+)*$/)) {\n errors.push({\n message: \"Direct IPs are not valid for trusted domains in production mode: \" + domain,\n relativeFixUrl: domainsFixUrl,\n });\n } else if (url.protocol !== \"https:\") {\n errors.push({\n message: \"Trusted domains should be HTTPS: \" + domain,\n relativeFixUrl: domainsFixUrl,\n });\n }\n }\n\n return errors;\n}\n"],"mappings":";;;;AASA,SAAgB,wBAAwB,SAA+D;CACrG,MAAM,SAAgC,EAAE;CACxC,MAAM,gBAAgB,aAAa,QAAQ,GAAG;AAE9C,KAAI,QAAQ,OAAO,gBACjB,QAAO,KAAK;EACV,SAAS;EACT,gBAAgB;EACjB,CAAC;AAGJ,MAAK,MAAM,EAAE,YAAY,QAAQ,OAAO,SAAS;EAC/C,IAAI;AACJ,MAAI;GAEF,MAAM,mBAAmB,OAAO,QAAQ,QAAQ,uBAAuB;AACvE,SAAM,IAAI,IAAI,iBAAiB;WACxB,GAAG;AACV,gBAAa,oCAAoC,IAAI,uBAAuB,2GAA2G;IACrL;IACA,WAAW;IACZ,CAAC,CAAC;AACH,UAAO,KAAK;IACV,SAAS,wCAAwC;IACjD,gBAAgB;IACjB,CAAC;AACF;;AAGF,MAAI,YAAY,IAAI,CAClB,QAAO,KAAK;GACV,SAAS,yEAAyE;GAClF,gBAAgB;GACjB,CAAC;WACO,IAAI,SAAS,MAAM,gBAAgB,CAC5C,QAAO,KAAK;GACV,SAAS,sEAAsE;GAC/E,gBAAgB;GACjB,CAAC;WACO,IAAI,aAAa,SAC1B,QAAO,KAAK;GACV,SAAS,sCAAsC;GAC/C,gBAAgB;GACjB,CAAC;;AAIN,QAAO"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/helpers/support-sla.d.ts
|
|
2
|
+
type SupportSlaConfig = {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
firstResponseMinutes: number | null;
|
|
5
|
+
nextResponseMinutes: number | null;
|
|
6
|
+
};
|
|
7
|
+
declare const DEFAULT_SUPPORT_SLA: SupportSlaConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the target first-response due timestamp for a new conversation,
|
|
10
|
+
* or `null` if SLA tracking is off or no target is set.
|
|
11
|
+
*/
|
|
12
|
+
declare function computeFirstResponseDueAt(now: Date, sla: SupportSlaConfig): Date | null;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the target next-response due timestamp when a conversation has been
|
|
15
|
+
* re-opened by a user reply, or `null` if SLA tracking is off or no target
|
|
16
|
+
* is set.
|
|
17
|
+
*/
|
|
18
|
+
declare function computeNextResponseDueAt(now: Date, sla: SupportSlaConfig): Date | null;
|
|
19
|
+
type SlaUrgency = "ok" | "warning" | "urgent" | "overdue";
|
|
20
|
+
/**
|
|
21
|
+
* How soon (in milliseconds) before a due timestamp we switch into the
|
|
22
|
+
* "urgent" state. Within this window the due timestamp should be rendered
|
|
23
|
+
* with a strong alert treatment.
|
|
24
|
+
*/
|
|
25
|
+
declare const SLA_URGENT_THRESHOLD_MS: number;
|
|
26
|
+
/**
|
|
27
|
+
* How soon (in milliseconds) before a due timestamp we switch into the
|
|
28
|
+
* "warning" state. Within this window the due timestamp should be rendered
|
|
29
|
+
* with a subtle alert treatment so agents can notice it without being
|
|
30
|
+
* distracted.
|
|
31
|
+
*/
|
|
32
|
+
declare const SLA_WARNING_THRESHOLD_MS: number;
|
|
33
|
+
/**
|
|
34
|
+
* Classifies how close a due timestamp is to `now` so we can subtly alert
|
|
35
|
+
* agents as it approaches (and after it passes).
|
|
36
|
+
*
|
|
37
|
+
* If `windowStartedAt` is provided, thresholds scale with the total SLA
|
|
38
|
+
* window length - so a 5-minute SLA doesn't read as "urgent" from t=0 - and
|
|
39
|
+
* are capped by the fixed wall-clock thresholds so a 24-hour SLA doesn't
|
|
40
|
+
* sit in "warning" for 12 hours. If `windowStartedAt` isn't known, we fall
|
|
41
|
+
* back to the fixed wall-clock thresholds.
|
|
42
|
+
*/
|
|
43
|
+
declare function computeSlaUrgency(dueAt: Date, now: Date, options?: {
|
|
44
|
+
windowStartedAt?: Date | null;
|
|
45
|
+
}): SlaUrgency;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { DEFAULT_SUPPORT_SLA, SLA_URGENT_THRESHOLD_MS, SLA_WARNING_THRESHOLD_MS, SlaUrgency, SupportSlaConfig, computeFirstResponseDueAt, computeNextResponseDueAt, computeSlaUrgency };
|
|
48
|
+
//# sourceMappingURL=support-sla.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support-sla.d.ts","names":[],"sources":["../../../src/helpers/support-sla.ts"],"mappings":";KAAY,gBAAA;EACV,OAAA;EACA,oBAAA;EACA,mBAAA;AAAA;AAAA,cAGW,mBAAA,EAAqB,gBAAA;;;;;iBAelB,yBAAA,CACd,GAAA,EAAK,IAAA,EACL,GAAA,EAAK,gBAAA,GACJ,IAAA;;;;;AAHH;iBAagB,wBAAA,CACd,GAAA,EAAK,IAAA,EACL,GAAA,EAAK,gBAAA,GACJ,IAAA;AAAA,KAKS,UAAA;;;;;;cAOC,uBAAA;;;;;;;cAQA,wBAAA;;;;;;;;;;;iBAYG,iBAAA,CACd,KAAA,EAAO,IAAA,EACP,GAAA,EAAK,IAAA,EACL,OAAA;EAAY,eAAA,GAAkB,IAAA;AAAA,IAC7B,UAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region src/helpers/support-sla.ts
|
|
2
|
+
const DEFAULT_SUPPORT_SLA = {
|
|
3
|
+
enabled: false,
|
|
4
|
+
firstResponseMinutes: null,
|
|
5
|
+
nextResponseMinutes: null
|
|
6
|
+
};
|
|
7
|
+
function addMinutesOrNull(now, minutes) {
|
|
8
|
+
if (minutes == null || !Number.isFinite(minutes) || minutes <= 0) return null;
|
|
9
|
+
return new Date(now.getTime() + minutes * 6e4);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the target first-response due timestamp for a new conversation,
|
|
13
|
+
* or `null` if SLA tracking is off or no target is set.
|
|
14
|
+
*/
|
|
15
|
+
function computeFirstResponseDueAt(now, sla) {
|
|
16
|
+
if (!sla.enabled) return null;
|
|
17
|
+
return addMinutesOrNull(now, sla.firstResponseMinutes);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the target next-response due timestamp when a conversation has been
|
|
21
|
+
* re-opened by a user reply, or `null` if SLA tracking is off or no target
|
|
22
|
+
* is set.
|
|
23
|
+
*/
|
|
24
|
+
function computeNextResponseDueAt(now, sla) {
|
|
25
|
+
if (!sla.enabled) return null;
|
|
26
|
+
return addMinutesOrNull(now, sla.nextResponseMinutes);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* How soon (in milliseconds) before a due timestamp we switch into the
|
|
30
|
+
* "urgent" state. Within this window the due timestamp should be rendered
|
|
31
|
+
* with a strong alert treatment.
|
|
32
|
+
*/
|
|
33
|
+
const SLA_URGENT_THRESHOLD_MS = 900 * 1e3;
|
|
34
|
+
/**
|
|
35
|
+
* How soon (in milliseconds) before a due timestamp we switch into the
|
|
36
|
+
* "warning" state. Within this window the due timestamp should be rendered
|
|
37
|
+
* with a subtle alert treatment so agents can notice it without being
|
|
38
|
+
* distracted.
|
|
39
|
+
*/
|
|
40
|
+
const SLA_WARNING_THRESHOLD_MS = 3600 * 1e3;
|
|
41
|
+
/**
|
|
42
|
+
* Classifies how close a due timestamp is to `now` so we can subtly alert
|
|
43
|
+
* agents as it approaches (and after it passes).
|
|
44
|
+
*
|
|
45
|
+
* If `windowStartedAt` is provided, thresholds scale with the total SLA
|
|
46
|
+
* window length - so a 5-minute SLA doesn't read as "urgent" from t=0 - and
|
|
47
|
+
* are capped by the fixed wall-clock thresholds so a 24-hour SLA doesn't
|
|
48
|
+
* sit in "warning" for 12 hours. If `windowStartedAt` isn't known, we fall
|
|
49
|
+
* back to the fixed wall-clock thresholds.
|
|
50
|
+
*/
|
|
51
|
+
function computeSlaUrgency(dueAt, now, options) {
|
|
52
|
+
const remainingMs = dueAt.getTime() - now.getTime();
|
|
53
|
+
if (remainingMs <= 0) return "overdue";
|
|
54
|
+
const windowStartedAt = options?.windowStartedAt ?? null;
|
|
55
|
+
const totalWindowMs = windowStartedAt != null ? Math.max(1, dueAt.getTime() - windowStartedAt.getTime()) : null;
|
|
56
|
+
const urgentThresholdMs = totalWindowMs != null ? Math.min(totalWindowMs * .25, SLA_URGENT_THRESHOLD_MS) : SLA_URGENT_THRESHOLD_MS;
|
|
57
|
+
const warningThresholdMs = totalWindowMs != null ? Math.min(totalWindowMs * .5, SLA_WARNING_THRESHOLD_MS) : SLA_WARNING_THRESHOLD_MS;
|
|
58
|
+
if (remainingMs <= urgentThresholdMs) return "urgent";
|
|
59
|
+
if (remainingMs <= warningThresholdMs) return "warning";
|
|
60
|
+
return "ok";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { DEFAULT_SUPPORT_SLA, SLA_URGENT_THRESHOLD_MS, SLA_WARNING_THRESHOLD_MS, computeFirstResponseDueAt, computeNextResponseDueAt, computeSlaUrgency };
|
|
65
|
+
//# sourceMappingURL=support-sla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support-sla.js","names":[],"sources":["../../../src/helpers/support-sla.ts"],"sourcesContent":["export type SupportSlaConfig = {\n enabled: boolean,\n firstResponseMinutes: number | null,\n nextResponseMinutes: number | null,\n};\n\nexport const DEFAULT_SUPPORT_SLA: SupportSlaConfig = {\n enabled: false,\n firstResponseMinutes: null,\n nextResponseMinutes: null,\n};\n\nfunction addMinutesOrNull(now: Date, minutes: number | null): Date | null {\n if (minutes == null || !Number.isFinite(minutes) || minutes <= 0) return null;\n return new Date(now.getTime() + minutes * 60_000);\n}\n\n/**\n * Returns the target first-response due timestamp for a new conversation,\n * or `null` if SLA tracking is off or no target is set.\n */\nexport function computeFirstResponseDueAt(\n now: Date,\n sla: SupportSlaConfig,\n): Date | null {\n if (!sla.enabled) return null;\n return addMinutesOrNull(now, sla.firstResponseMinutes);\n}\n\n/**\n * Returns the target next-response due timestamp when a conversation has been\n * re-opened by a user reply, or `null` if SLA tracking is off or no target\n * is set.\n */\nexport function computeNextResponseDueAt(\n now: Date,\n sla: SupportSlaConfig,\n): Date | null {\n if (!sla.enabled) return null;\n return addMinutesOrNull(now, sla.nextResponseMinutes);\n}\n\nexport type SlaUrgency = \"ok\" | \"warning\" | \"urgent\" | \"overdue\";\n\n/**\n * How soon (in milliseconds) before a due timestamp we switch into the\n * \"urgent\" state. Within this window the due timestamp should be rendered\n * with a strong alert treatment.\n */\nexport const SLA_URGENT_THRESHOLD_MS = 15 * 60 * 1000;\n\n/**\n * How soon (in milliseconds) before a due timestamp we switch into the\n * \"warning\" state. Within this window the due timestamp should be rendered\n * with a subtle alert treatment so agents can notice it without being\n * distracted.\n */\nexport const SLA_WARNING_THRESHOLD_MS = 60 * 60 * 1000;\n\n/**\n * Classifies how close a due timestamp is to `now` so we can subtly alert\n * agents as it approaches (and after it passes).\n *\n * If `windowStartedAt` is provided, thresholds scale with the total SLA\n * window length - so a 5-minute SLA doesn't read as \"urgent\" from t=0 - and\n * are capped by the fixed wall-clock thresholds so a 24-hour SLA doesn't\n * sit in \"warning\" for 12 hours. If `windowStartedAt` isn't known, we fall\n * back to the fixed wall-clock thresholds.\n */\nexport function computeSlaUrgency(\n dueAt: Date,\n now: Date,\n options?: { windowStartedAt?: Date | null },\n): SlaUrgency {\n const remainingMs = dueAt.getTime() - now.getTime();\n if (remainingMs <= 0) return \"overdue\";\n\n const windowStartedAt = options?.windowStartedAt ?? null;\n const totalWindowMs = windowStartedAt != null\n ? Math.max(1, dueAt.getTime() - windowStartedAt.getTime())\n : null;\n\n const urgentThresholdMs = totalWindowMs != null\n ? Math.min(totalWindowMs * 0.25, SLA_URGENT_THRESHOLD_MS)\n : SLA_URGENT_THRESHOLD_MS;\n const warningThresholdMs = totalWindowMs != null\n ? Math.min(totalWindowMs * 0.5, SLA_WARNING_THRESHOLD_MS)\n : SLA_WARNING_THRESHOLD_MS;\n\n if (remainingMs <= urgentThresholdMs) return \"urgent\";\n if (remainingMs <= warningThresholdMs) return \"warning\";\n return \"ok\";\n}\n"],"mappings":";AAMA,MAAa,sBAAwC;CACnD,SAAS;CACT,sBAAsB;CACtB,qBAAqB;CACtB;AAED,SAAS,iBAAiB,KAAW,SAAqC;AACxE,KAAI,WAAW,QAAQ,CAAC,OAAO,SAAS,QAAQ,IAAI,WAAW,EAAG,QAAO;AACzE,QAAO,IAAI,KAAK,IAAI,SAAS,GAAG,UAAU,IAAO;;;;;;AAOnD,SAAgB,0BACd,KACA,KACa;AACb,KAAI,CAAC,IAAI,QAAS,QAAO;AACzB,QAAO,iBAAiB,KAAK,IAAI,qBAAqB;;;;;;;AAQxD,SAAgB,yBACd,KACA,KACa;AACb,KAAI,CAAC,IAAI,QAAS,QAAO;AACzB,QAAO,iBAAiB,KAAK,IAAI,oBAAoB;;;;;;;AAUvD,MAAa,0BAA0B,MAAU;;;;;;;AAQjD,MAAa,2BAA2B,OAAU;;;;;;;;;;;AAYlD,SAAgB,kBACd,OACA,KACA,SACY;CACZ,MAAM,cAAc,MAAM,SAAS,GAAG,IAAI,SAAS;AACnD,KAAI,eAAe,EAAG,QAAO;CAE7B,MAAM,kBAAkB,SAAS,mBAAmB;CACpD,MAAM,gBAAgB,mBAAmB,OACrC,KAAK,IAAI,GAAG,MAAM,SAAS,GAAG,gBAAgB,SAAS,CAAC,GACxD;CAEJ,MAAM,oBAAoB,iBAAiB,OACvC,KAAK,IAAI,gBAAgB,KAAM,wBAAwB,GACvD;CACJ,MAAM,qBAAqB,iBAAiB,OACxC,KAAK,IAAI,gBAAgB,IAAK,yBAAyB,GACvD;AAEJ,KAAI,eAAe,kBAAmB,QAAO;AAC7C,KAAI,eAAe,mBAAoB,QAAO;AAC9C,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { SLA_URGENT_THRESHOLD_MS, SLA_WARNING_THRESHOLD_MS, computeFirstResponseDueAt, computeNextResponseDueAt, computeSlaUrgency } from "./support-sla.js";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/support-sla.test.ts
|
|
5
|
+
const enabledSla = {
|
|
6
|
+
enabled: true,
|
|
7
|
+
firstResponseMinutes: 60,
|
|
8
|
+
nextResponseMinutes: 120
|
|
9
|
+
};
|
|
10
|
+
describe("computeFirstResponseDueAt", () => {
|
|
11
|
+
const now = /* @__PURE__ */ new Date("2026-04-22T12:00:00.000Z");
|
|
12
|
+
it("returns null when SLA is disabled", () => {
|
|
13
|
+
expect(computeFirstResponseDueAt(now, {
|
|
14
|
+
...enabledSla,
|
|
15
|
+
enabled: false
|
|
16
|
+
})).toBeNull();
|
|
17
|
+
});
|
|
18
|
+
it("returns null when no target is set", () => {
|
|
19
|
+
expect(computeFirstResponseDueAt(now, {
|
|
20
|
+
...enabledSla,
|
|
21
|
+
firstResponseMinutes: null
|
|
22
|
+
})).toBeNull();
|
|
23
|
+
});
|
|
24
|
+
it("adds the configured minutes to now", () => {
|
|
25
|
+
const due = computeFirstResponseDueAt(now, enabledSla);
|
|
26
|
+
expect(due).not.toBeNull();
|
|
27
|
+
expect(due.toISOString()).toBe("2026-04-22T13:00:00.000Z");
|
|
28
|
+
});
|
|
29
|
+
it("returns null when the configured value is non-positive", () => {
|
|
30
|
+
expect(computeFirstResponseDueAt(now, {
|
|
31
|
+
...enabledSla,
|
|
32
|
+
firstResponseMinutes: 0
|
|
33
|
+
})).toBeNull();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe("computeNextResponseDueAt", () => {
|
|
37
|
+
const now = /* @__PURE__ */ new Date("2026-04-22T12:00:00.000Z");
|
|
38
|
+
it("returns null when SLA is disabled", () => {
|
|
39
|
+
expect(computeNextResponseDueAt(now, {
|
|
40
|
+
...enabledSla,
|
|
41
|
+
enabled: false
|
|
42
|
+
})).toBeNull();
|
|
43
|
+
});
|
|
44
|
+
it("returns null when no target is set", () => {
|
|
45
|
+
expect(computeNextResponseDueAt(now, {
|
|
46
|
+
...enabledSla,
|
|
47
|
+
nextResponseMinutes: null
|
|
48
|
+
})).toBeNull();
|
|
49
|
+
});
|
|
50
|
+
it("adds the configured next-response minutes to now", () => {
|
|
51
|
+
expect(computeNextResponseDueAt(now, enabledSla).toISOString()).toBe("2026-04-22T14:00:00.000Z");
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe("computeSlaUrgency", () => {
|
|
55
|
+
const now = /* @__PURE__ */ new Date("2026-04-22T12:00:00.000Z");
|
|
56
|
+
it("returns 'overdue' when the due timestamp is in the past", () => {
|
|
57
|
+
expect(computeSlaUrgency(/* @__PURE__ */ new Date(now.getTime() - 1), now)).toBe("overdue");
|
|
58
|
+
expect(computeSlaUrgency(/* @__PURE__ */ new Date(now.getTime() - 6e4), now)).toBe("overdue");
|
|
59
|
+
});
|
|
60
|
+
it("returns 'overdue' when the due timestamp is exactly now", () => {
|
|
61
|
+
expect(computeSlaUrgency(now, now)).toBe("overdue");
|
|
62
|
+
});
|
|
63
|
+
it("returns 'urgent' within the urgent threshold", () => {
|
|
64
|
+
expect(computeSlaUrgency(new Date(now.getTime() + 6e4), now)).toBe("urgent");
|
|
65
|
+
expect(computeSlaUrgency(new Date(now.getTime() + SLA_URGENT_THRESHOLD_MS), now)).toBe("urgent");
|
|
66
|
+
});
|
|
67
|
+
it("returns 'warning' within the warning threshold", () => {
|
|
68
|
+
expect(computeSlaUrgency(new Date(now.getTime() + SLA_URGENT_THRESHOLD_MS + 6e4), now)).toBe("warning");
|
|
69
|
+
expect(computeSlaUrgency(new Date(now.getTime() + SLA_WARNING_THRESHOLD_MS), now)).toBe("warning");
|
|
70
|
+
});
|
|
71
|
+
it("returns 'ok' when comfortably before the warning threshold", () => {
|
|
72
|
+
expect(computeSlaUrgency(new Date(now.getTime() + SLA_WARNING_THRESHOLD_MS + 6e4), now)).toBe("ok");
|
|
73
|
+
expect(computeSlaUrgency(new Date(now.getTime() + 1440 * 60 * 1e3), now)).toBe("ok");
|
|
74
|
+
});
|
|
75
|
+
describe("with a windowStartedAt", () => {
|
|
76
|
+
it("scales thresholds down for short SLA windows so t=0 is not immediately urgent", () => {
|
|
77
|
+
const windowStartedAt = now;
|
|
78
|
+
const dueAt = new Date(now.getTime() + 5 * 6e4);
|
|
79
|
+
expect(computeSlaUrgency(dueAt, now, { windowStartedAt })).toBe("ok");
|
|
80
|
+
expect(computeSlaUrgency(dueAt, new Date(now.getTime() + 2 * 6e4), { windowStartedAt })).toBe("ok");
|
|
81
|
+
expect(computeSlaUrgency(dueAt, new Date(now.getTime() + 3 * 6e4), { windowStartedAt })).toBe("warning");
|
|
82
|
+
expect(computeSlaUrgency(dueAt, new Date(now.getTime() + 4 * 6e4), { windowStartedAt })).toBe("urgent");
|
|
83
|
+
});
|
|
84
|
+
it("caps thresholds at the fixed wall-clock windows for long SLAs", () => {
|
|
85
|
+
const windowStartedAt = now;
|
|
86
|
+
const dueAt = new Date(now.getTime() + 1440 * 60 * 1e3);
|
|
87
|
+
expect(computeSlaUrgency(dueAt, /* @__PURE__ */ new Date(dueAt.getTime() - 7200 * 1e3), { windowStartedAt })).toBe("ok");
|
|
88
|
+
expect(computeSlaUrgency(dueAt, /* @__PURE__ */ new Date(dueAt.getTime() - 45 * 6e4), { windowStartedAt })).toBe("warning");
|
|
89
|
+
expect(computeSlaUrgency(dueAt, /* @__PURE__ */ new Date(dueAt.getTime() - 10 * 6e4), { windowStartedAt })).toBe("urgent");
|
|
90
|
+
});
|
|
91
|
+
it("falls back to fixed thresholds when windowStartedAt is nullish", () => {
|
|
92
|
+
const dueAt = new Date(now.getTime() + 30 * 6e4);
|
|
93
|
+
expect(computeSlaUrgency(dueAt, now)).toBe("warning");
|
|
94
|
+
expect(computeSlaUrgency(dueAt, now, { windowStartedAt: null })).toBe("warning");
|
|
95
|
+
expect(computeSlaUrgency(dueAt, now, { windowStartedAt: void 0 })).toBe("warning");
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { };
|
|
102
|
+
//# sourceMappingURL=support-sla.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"support-sla.test.js","names":[],"sources":["../../../src/helpers/support-sla.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n computeFirstResponseDueAt,\n computeNextResponseDueAt,\n computeSlaUrgency,\n SLA_URGENT_THRESHOLD_MS,\n SLA_WARNING_THRESHOLD_MS,\n type SupportSlaConfig,\n} from \"./support-sla\";\n\nconst enabledSla: SupportSlaConfig = {\n enabled: true,\n firstResponseMinutes: 60,\n nextResponseMinutes: 120,\n};\n\ndescribe(\"computeFirstResponseDueAt\", () => {\n const now = new Date(\"2026-04-22T12:00:00.000Z\");\n\n it(\"returns null when SLA is disabled\", () => {\n expect(computeFirstResponseDueAt(now, { ...enabledSla, enabled: false })).toBeNull();\n });\n\n it(\"returns null when no target is set\", () => {\n expect(computeFirstResponseDueAt(now, { ...enabledSla, firstResponseMinutes: null })).toBeNull();\n });\n\n it(\"adds the configured minutes to now\", () => {\n const due = computeFirstResponseDueAt(now, enabledSla);\n expect(due).not.toBeNull();\n expect(due!.toISOString()).toBe(\"2026-04-22T13:00:00.000Z\");\n });\n\n it(\"returns null when the configured value is non-positive\", () => {\n expect(computeFirstResponseDueAt(now, { ...enabledSla, firstResponseMinutes: 0 })).toBeNull();\n });\n});\n\ndescribe(\"computeNextResponseDueAt\", () => {\n const now = new Date(\"2026-04-22T12:00:00.000Z\");\n\n it(\"returns null when SLA is disabled\", () => {\n expect(computeNextResponseDueAt(now, { ...enabledSla, enabled: false })).toBeNull();\n });\n\n it(\"returns null when no target is set\", () => {\n expect(computeNextResponseDueAt(now, { ...enabledSla, nextResponseMinutes: null })).toBeNull();\n });\n\n it(\"adds the configured next-response minutes to now\", () => {\n const due = computeNextResponseDueAt(now, enabledSla);\n expect(due!.toISOString()).toBe(\"2026-04-22T14:00:00.000Z\");\n });\n});\n\ndescribe(\"computeSlaUrgency\", () => {\n const now = new Date(\"2026-04-22T12:00:00.000Z\");\n\n it(\"returns 'overdue' when the due timestamp is in the past\", () => {\n expect(computeSlaUrgency(new Date(now.getTime() - 1), now)).toBe(\"overdue\");\n expect(computeSlaUrgency(new Date(now.getTime() - 60_000), now)).toBe(\"overdue\");\n });\n\n it(\"returns 'overdue' when the due timestamp is exactly now\", () => {\n expect(computeSlaUrgency(now, now)).toBe(\"overdue\");\n });\n\n it(\"returns 'urgent' within the urgent threshold\", () => {\n expect(computeSlaUrgency(new Date(now.getTime() + 60_000), now)).toBe(\"urgent\");\n expect(computeSlaUrgency(new Date(now.getTime() + SLA_URGENT_THRESHOLD_MS), now)).toBe(\"urgent\");\n });\n\n it(\"returns 'warning' within the warning threshold\", () => {\n expect(computeSlaUrgency(new Date(now.getTime() + SLA_URGENT_THRESHOLD_MS + 60_000), now)).toBe(\"warning\");\n expect(computeSlaUrgency(new Date(now.getTime() + SLA_WARNING_THRESHOLD_MS), now)).toBe(\"warning\");\n });\n\n it(\"returns 'ok' when comfortably before the warning threshold\", () => {\n expect(computeSlaUrgency(new Date(now.getTime() + SLA_WARNING_THRESHOLD_MS + 60_000), now)).toBe(\"ok\");\n expect(computeSlaUrgency(new Date(now.getTime() + 24 * 60 * 60 * 1000), now)).toBe(\"ok\");\n });\n\n describe(\"with a windowStartedAt\", () => {\n it(\"scales thresholds down for short SLA windows so t=0 is not immediately urgent\", () => {\n // 5-minute SLA window: due 5 min after it started.\n const windowStartedAt = now;\n const dueAt = new Date(now.getTime() + 5 * 60_000);\n // Right at the start, 5 min remaining — should be 'ok' (>50% of window remaining).\n expect(computeSlaUrgency(dueAt, now, { windowStartedAt })).toBe(\"ok\");\n // At t+2min (3 min remaining, 60% of window remaining) — still 'ok'.\n const twoMinLater = new Date(now.getTime() + 2 * 60_000);\n expect(computeSlaUrgency(dueAt, twoMinLater, { windowStartedAt })).toBe(\"ok\");\n // At t+3min (2 min remaining, 40% of window) — 'warning'.\n const threeMinLater = new Date(now.getTime() + 3 * 60_000);\n expect(computeSlaUrgency(dueAt, threeMinLater, { windowStartedAt })).toBe(\"warning\");\n // At t+4min (1 min remaining, 20% of window) — 'urgent'.\n const fourMinLater = new Date(now.getTime() + 4 * 60_000);\n expect(computeSlaUrgency(dueAt, fourMinLater, { windowStartedAt })).toBe(\"urgent\");\n });\n\n it(\"caps thresholds at the fixed wall-clock windows for long SLAs\", () => {\n // 24-hour SLA window.\n const windowStartedAt = now;\n const dueAt = new Date(now.getTime() + 24 * 60 * 60 * 1000);\n // 2 hours remaining (long past the 50% mark of the 24h window) — should\n // still be 'ok' because the warning cap is 60 min.\n const tMinusTwoHours = new Date(dueAt.getTime() - 2 * 60 * 60 * 1000);\n expect(computeSlaUrgency(dueAt, tMinusTwoHours, { windowStartedAt })).toBe(\"ok\");\n // 45 minutes remaining — 'warning' (inside the 60-min cap).\n const tMinus45Min = new Date(dueAt.getTime() - 45 * 60_000);\n expect(computeSlaUrgency(dueAt, tMinus45Min, { windowStartedAt })).toBe(\"warning\");\n // 10 minutes remaining — 'urgent' (inside the 15-min cap).\n const tMinus10Min = new Date(dueAt.getTime() - 10 * 60_000);\n expect(computeSlaUrgency(dueAt, tMinus10Min, { windowStartedAt })).toBe(\"urgent\");\n });\n\n it(\"falls back to fixed thresholds when windowStartedAt is nullish\", () => {\n const dueAt = new Date(now.getTime() + 30 * 60_000);\n expect(computeSlaUrgency(dueAt, now)).toBe(\"warning\");\n expect(computeSlaUrgency(dueAt, now, { windowStartedAt: null })).toBe(\"warning\");\n expect(computeSlaUrgency(dueAt, now, { windowStartedAt: undefined })).toBe(\"warning\");\n });\n });\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/helpers/vault/client-side.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Use to hash the key so the server cannot infer it.
|
|
4
|
+
*/
|
|
5
|
+
declare function hashKey(secret: string, key: string): Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Use to encrypt the value so that the server cannot read the value without knowing the key.
|
|
8
|
+
*/
|
|
9
|
+
declare function encryptValue(secret: string, key: string, value: string): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Use to decrypt the value. See encryptValue.
|
|
12
|
+
*/
|
|
13
|
+
declare function decryptValue(secret: string, key: string, encryptedValue: string): Promise<string>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { decryptValue, encryptValue, hashKey };
|
|
16
|
+
//# sourceMappingURL=client-side.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-side.d.ts","names":[],"sources":["../../../../src/helpers/vault/client-side.ts"],"mappings":";;AAoBA;;iBAAsB,OAAA,CAAQ,MAAA,UAAgB,GAAA,WAAW,OAAA;;;;iBAWnC,YAAA,CAAa,MAAA,UAAgB,GAAA,UAAa,KAAA,WAAa,OAAA;;;AAA7E;iBAcsB,YAAA,CAAa,MAAA,UAAgB,GAAA,UAAa,cAAA,WAAsB,OAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { decodeBase64, encodeBase64 } from "../../utils/bytes.js";
|
|
2
|
+
import { decrypt, encrypt, hash, iteratedHash } from "../../utils/crypto.js";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/vault/client-side.ts
|
|
5
|
+
const hashPurpose = "stack-data-vault-client-side-encryption-key-hash";
|
|
6
|
+
const encryptionSecretPurpose = "stack-data-vault-client-side-encryption-value-encryption-key-hash";
|
|
7
|
+
const encryptionValuePurpose = "stack-data-vault-client-side-encryption-value-encryption-value-encryption";
|
|
8
|
+
async function getDerivedKey(secret, key) {
|
|
9
|
+
return await iteratedHash({
|
|
10
|
+
purpose: encryptionSecretPurpose,
|
|
11
|
+
extra: secret,
|
|
12
|
+
value: key,
|
|
13
|
+
iterations: 1e5
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Use to hash the key so the server cannot infer it.
|
|
18
|
+
*/
|
|
19
|
+
async function hashKey(secret, key) {
|
|
20
|
+
return encodeBase64(await hash({
|
|
21
|
+
purpose: hashPurpose,
|
|
22
|
+
extra: secret,
|
|
23
|
+
value: await getDerivedKey(secret, key)
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Use to encrypt the value so that the server cannot read the value without knowing the key.
|
|
28
|
+
*/
|
|
29
|
+
async function encryptValue(secret, key, value) {
|
|
30
|
+
return encodeBase64(await encrypt({
|
|
31
|
+
purpose: encryptionValuePurpose,
|
|
32
|
+
secret: await getDerivedKey(secret, key),
|
|
33
|
+
value: new TextEncoder().encode(value)
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Use to decrypt the value. See encryptValue.
|
|
38
|
+
*/
|
|
39
|
+
async function decryptValue(secret, key, encryptedValue) {
|
|
40
|
+
const bytesResult = await decrypt({
|
|
41
|
+
purpose: encryptionValuePurpose,
|
|
42
|
+
secret: await getDerivedKey(secret, key),
|
|
43
|
+
cipher: decodeBase64(encryptedValue)
|
|
44
|
+
});
|
|
45
|
+
if (bytesResult.status === "error") throw new Error("Data vault client-side decryption failed. Are you sure you're using the correct secret?", { cause: bytesResult.error });
|
|
46
|
+
return new TextDecoder().decode(bytesResult.data);
|
|
47
|
+
}
|
|
48
|
+
(void 0)?.describe("encryptValue & decryptValue", () => {
|
|
49
|
+
(void 0)?.it("should encrypt and decrypt a value", async ({ expect }) => {
|
|
50
|
+
const secret = "test-secret";
|
|
51
|
+
const value = "test-value";
|
|
52
|
+
expect(await decryptValue(secret, "key", await encryptValue(secret, "key", value))).toEqual(value);
|
|
53
|
+
});
|
|
54
|
+
(void 0)?.it("should not decrypt a value with a different secret", async ({ expect }) => {
|
|
55
|
+
await expect(decryptValue("different-secret", "key", await encryptValue("test-secret", "key", "test-value"))).rejects.toThrow();
|
|
56
|
+
});
|
|
57
|
+
(void 0)?.it("should not decrypt a value with a different key", async ({ expect }) => {
|
|
58
|
+
const secret = "test-secret";
|
|
59
|
+
await expect(decryptValue(secret, "different-key", await encryptValue(secret, "key", "test-value"))).rejects.toThrow();
|
|
60
|
+
});
|
|
61
|
+
(void 0)?.it("should not decrypt a value if the cipher was tampered with", async ({ expect }) => {
|
|
62
|
+
const secret = "test-secret";
|
|
63
|
+
await expect(decryptValue(secret, "key", await encryptValue(secret, "key", "test-value") + "7")).rejects.toThrow();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { decryptValue, encryptValue, hashKey };
|
|
69
|
+
//# sourceMappingURL=client-side.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-side.js","names":[],"sources":["../../../../src/helpers/vault/client-side.ts"],"sourcesContent":["import { decodeBase64, encodeBase64 } from \"../../utils/bytes\";\nimport { decrypt, encrypt, hash, iteratedHash } from \"../../utils/crypto\";\n\nconst hashPurpose = \"stack-data-vault-client-side-encryption-key-hash\";\nconst encryptionSecretPurpose = \"stack-data-vault-client-side-encryption-value-encryption-key-hash\";\nconst encryptionValuePurpose = \"stack-data-vault-client-side-encryption-value-encryption-value-encryption\";\n\n\nasync function getDerivedKey(secret: string, key: string) {\n return await iteratedHash({\n purpose: encryptionSecretPurpose,\n extra: secret,\n value: key,\n iterations: 100_000,\n });\n}\n\n/**\n * Use to hash the key so the server cannot infer it.\n */\nexport async function hashKey(secret: string, key: string) {\n return encodeBase64(await hash({\n purpose: hashPurpose,\n extra: secret,\n value: await getDerivedKey(secret, key),\n }));\n}\n\n/**\n * Use to encrypt the value so that the server cannot read the value without knowing the key.\n */\nexport async function encryptValue(secret: string, key: string, value: string) {\n const valueEncryptionDerivedKey = await getDerivedKey(secret, key);\n\n const bytes = await encrypt({\n purpose: encryptionValuePurpose,\n secret: valueEncryptionDerivedKey,\n value: new TextEncoder().encode(value)\n });\n return encodeBase64(bytes);\n}\n\n/**\n * Use to decrypt the value. See encryptValue.\n */\nexport async function decryptValue(secret: string, key: string, encryptedValue: string) {\n const valueEncryptionDerivedKey = await getDerivedKey(secret, key);\n\n const bytesResult = await decrypt({\n purpose: encryptionValuePurpose,\n secret: valueEncryptionDerivedKey,\n cipher: decodeBase64(encryptedValue),\n });\n if (bytesResult.status === \"error\") throw new Error(\"Data vault client-side decryption failed. Are you sure you're using the correct secret?\", { cause: bytesResult.error });\n return new TextDecoder().decode(bytesResult.data);\n}\n\n\nimport.meta.vitest?.describe(\"encryptValue & decryptValue\", () => {\n import.meta.vitest?.it(\"should encrypt and decrypt a value\", async ({ expect }) => {\n const secret = \"test-secret\";\n const value = \"test-value\";\n const encrypted = await encryptValue(secret, \"key\", value);\n const decrypted = await decryptValue(secret, \"key\", encrypted);\n expect(decrypted).toEqual(value);\n });\n\n import.meta.vitest?.it(\"should not decrypt a value with a different secret\", async ({ expect }) => {\n const secret = \"test-secret\";\n const value = \"test-value\";\n const encrypted = await encryptValue(secret, \"key\", value);\n await expect(decryptValue(\"different-secret\", \"key\", encrypted)).rejects.toThrow();\n });\n\n import.meta.vitest?.it(\"should not decrypt a value with a different key\", async ({ expect }) => {\n const secret = \"test-secret\";\n const value = \"test-value\";\n const encrypted = await encryptValue(secret, \"key\", value);\n await expect(decryptValue(secret, \"different-key\", encrypted)).rejects.toThrow();\n });\n\n import.meta.vitest?.it(\"should not decrypt a value if the cipher was tampered with\", async ({ expect }) => {\n const secret = \"test-secret\";\n const value = \"test-value\";\n const encrypted = await encryptValue(secret, \"key\", value);\n const tampered = encrypted + \"7\";\n await expect(decryptValue(secret, \"key\", tampered)).rejects.toThrow();\n });\n});\n"],"mappings":";;;;AAGA,MAAM,cAAc;AACpB,MAAM,0BAA0B;AAChC,MAAM,yBAAyB;AAG/B,eAAe,cAAc,QAAgB,KAAa;AACxD,QAAO,MAAM,aAAa;EACxB,SAAS;EACT,OAAO;EACP,OAAO;EACP,YAAY;EACb,CAAC;;;;;AAMJ,eAAsB,QAAQ,QAAgB,KAAa;AACzD,QAAO,aAAa,MAAM,KAAK;EAC7B,SAAS;EACT,OAAO;EACP,OAAO,MAAM,cAAc,QAAQ,IAAI;EACxC,CAAC,CAAC;;;;;AAML,eAAsB,aAAa,QAAgB,KAAa,OAAe;AAQ7E,QAAO,aALO,MAAM,QAAQ;EAC1B,SAAS;EACT,QAJgC,MAAM,cAAc,QAAQ,IAAI;EAKhE,OAAO,IAAI,aAAa,CAAC,OAAO,MAAK;EACtC,CAAC,CACwB;;;;;AAM5B,eAAsB,aAAa,QAAgB,KAAa,gBAAwB;CAGtF,MAAM,cAAc,MAAM,QAAQ;EAChC,SAAS;EACT,QAJgC,MAAM,cAAc,QAAQ,IAAI;EAKhE,QAAQ,aAAa,eAAe;EACrC,CAAC;AACF,KAAI,YAAY,WAAW,QAAS,OAAM,IAAI,MAAM,2FAA2F,EAAE,OAAO,YAAY,OAAO,CAAC;AAC5K,QAAO,IAAI,aAAa,CAAC,OAAO,YAAY,KAAK;;CAInD,SAAW,SAAS,qCAAqC;AACvD,WAAW,GAAC,sCAAwC,OAAO,EAAE,aAAS;EACpE,MAAM,SAAS;EACf,MAAM,QAAQ;AAGd,SADkB,MAAM,aAAa,QAAQ,OAD3B,MAAM,aAAa,QAAQ,OAAO,MAAM,CACI,CAC7C,CAAC,QAAQ,MAAM;GAChC;AAEF,WAAW,GAAC,sDAAwD,OAAO,EAAE,aAAS;AAIpF,QAAM,OAAO,aAAa,oBAAoB,OAD5B,MAAM,aAFT,eAE8B,OAD/B,aAC4C,CACK,CAAC,CAAC,QAAQ,SAAS;GAClF;AAEF,WAAW,GAAC,mDAA8C,OAAc,EAAE,aAAS;EACjF,MAAM,SAAS;AAGf,QAAM,OAAO,aAAa,QAAQ,iBADhB,MAAM,aAAa,QAAQ,OAD/B,aAC4C,CACG,CAAC,CAAC,QAAQ,SAAS;GAChF;AAEF,WAAW,GAAC,8DAAyD,OAAc,EAAE,aAAS;EAC5F,MAAM,SAAS;AAIf,QAAM,OAAO,aAAa,QAAQ,OAFhB,MAAM,aAAa,QAAQ,OAD/B,aAC4C,GAC7B,IACqB,CAAC,CAAC,QAAQ,SAAS;GACrE;EACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/helpers/vault/server-side.d.ts
|
|
2
|
+
declare function encryptWithKms(value: string): Promise<{
|
|
3
|
+
edkBase64: string;
|
|
4
|
+
ciphertextBase64: string;
|
|
5
|
+
}>;
|
|
6
|
+
declare function decryptWithKms(encrypted: Awaited<ReturnType<typeof encryptWithKms>>): Promise<string>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { decryptWithKms, encryptWithKms };
|
|
9
|
+
//# sourceMappingURL=server-side.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-side.d.ts","names":[],"sources":["../../../../src/helpers/vault/server-side.ts"],"mappings":";iBAyHsB,cAAA,CAAe,KAAA,WAAa,OAAA;;;;iBAc5B,cAAA,CAAe,SAAA,EAAW,OAAA,CAAQ,UAAA,QAAkB,cAAA,KAAgB,OAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { decodeBase64, encodeBase64 } from "../../utils/bytes.js";
|
|
2
|
+
import { decrypt, encrypt } from "../../utils/crypto.js";
|
|
3
|
+
import { CreateAliasCommand, CreateKeyCommand, DecryptCommand, DescribeKeyCommand, GenerateDataKeyCommand, KMSClient } from "@aws-sdk/client-kms";
|
|
4
|
+
import { getEnvVariable } from "../../utils/env.js";
|
|
5
|
+
import { Result } from "../../utils/results.js";
|
|
6
|
+
|
|
7
|
+
//#region src/helpers/vault/server-side.ts
|
|
8
|
+
async function getAwsCredentials() {
|
|
9
|
+
const vercelRoleArn = getEnvVariable("STACK_AWS_VERCEL_OIDC_ROLE_ARN", "");
|
|
10
|
+
if (vercelRoleArn) {
|
|
11
|
+
const { awsCredentialsProvider } = await import("@vercel/functions/oidc");
|
|
12
|
+
return awsCredentialsProvider({ roleArn: vercelRoleArn });
|
|
13
|
+
}
|
|
14
|
+
const gcpWifRoleArn = getEnvVariable("STACK_AWS_GCP_WIF_ROLE_ARN", "");
|
|
15
|
+
if (gcpWifRoleArn) {
|
|
16
|
+
const { fromWebToken } = await import("@aws-sdk/credential-provider-web-identity");
|
|
17
|
+
const audience = getEnvVariable("STACK_AWS_GCP_WIF_AUDIENCE", "sts.amazonaws.com");
|
|
18
|
+
return async () => {
|
|
19
|
+
return await fromWebToken({
|
|
20
|
+
roleArn: gcpWifRoleArn,
|
|
21
|
+
roleSessionName: "stack-backend-cloudrun",
|
|
22
|
+
webIdentityToken: await fetchGcpIdToken(audience)
|
|
23
|
+
})();
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
accessKeyId: getEnvVariable("STACK_AWS_ACCESS_KEY_ID"),
|
|
28
|
+
secretAccessKey: getEnvVariable("STACK_AWS_SECRET_ACCESS_KEY")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fetches a GCP ID token from the metadata server (available on Cloud Run, GCE, GKE).
|
|
33
|
+
* The token is a Google-signed JWT with the specified audience, suitable for
|
|
34
|
+
* AWS STS AssumeRoleWithWebIdentity.
|
|
35
|
+
*/
|
|
36
|
+
async function fetchGcpIdToken(audience) {
|
|
37
|
+
const metadataUrl = `http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=${encodeURIComponent(audience)}`;
|
|
38
|
+
const response = await fetch(metadataUrl, { headers: { "Metadata-Flavor": "Google" } });
|
|
39
|
+
if (!response.ok) throw new Error(`Failed to fetch GCP ID token: ${response.status} ${await response.text()}`);
|
|
40
|
+
return await response.text();
|
|
41
|
+
}
|
|
42
|
+
let kmsClientCache;
|
|
43
|
+
async function getKmsClient() {
|
|
44
|
+
if (!kmsClientCache) kmsClientCache = new KMSClient({
|
|
45
|
+
region: getEnvVariable("STACK_AWS_REGION"),
|
|
46
|
+
endpoint: getEnvVariable("STACK_AWS_KMS_ENDPOINT"),
|
|
47
|
+
credentials: await getAwsCredentials()
|
|
48
|
+
});
|
|
49
|
+
return kmsClientCache;
|
|
50
|
+
}
|
|
51
|
+
async function getOrCreateKekId() {
|
|
52
|
+
const id = "alias/stack-data-vault-server-side-kek";
|
|
53
|
+
const kms = await getKmsClient();
|
|
54
|
+
try {
|
|
55
|
+
const describeResult = await kms.send(new DescribeKeyCommand({ KeyId: id }));
|
|
56
|
+
if (describeResult.KeyMetadata?.KeyId) return describeResult.KeyMetadata.KeyId;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
if (e instanceof Error && e.name !== "NotFoundException") throw e;
|
|
59
|
+
}
|
|
60
|
+
const { KeyMetadata } = await kms.send(new CreateKeyCommand({
|
|
61
|
+
KeyUsage: "ENCRYPT_DECRYPT",
|
|
62
|
+
Description: "DataVault KEK"
|
|
63
|
+
}));
|
|
64
|
+
await kms.send(new CreateAliasCommand({
|
|
65
|
+
AliasName: id,
|
|
66
|
+
TargetKeyId: KeyMetadata.KeyId
|
|
67
|
+
}));
|
|
68
|
+
return id;
|
|
69
|
+
}
|
|
70
|
+
async function genDEK() {
|
|
71
|
+
const kekId = await getOrCreateKekId();
|
|
72
|
+
const out = await (await getKmsClient()).send(new GenerateDataKeyCommand({
|
|
73
|
+
KeyId: kekId,
|
|
74
|
+
KeySpec: "AES_256"
|
|
75
|
+
}));
|
|
76
|
+
if (!out.Plaintext || !out.CiphertextBlob) throw new Error("GenerateDataKey failed");
|
|
77
|
+
return {
|
|
78
|
+
dekBytes: out.Plaintext,
|
|
79
|
+
edkBytes: out.CiphertextBlob
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async function unwrapDEK(edk_b64) {
|
|
83
|
+
const edkBytes = decodeBase64(edk_b64);
|
|
84
|
+
const out = await (await getKmsClient()).send(new DecryptCommand({ CiphertextBlob: edkBytes }));
|
|
85
|
+
if (!out.Plaintext) throw new Error("KMS Decrypt failed");
|
|
86
|
+
return {
|
|
87
|
+
dekBytes: out.Plaintext,
|
|
88
|
+
edkBytes
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async function encryptWithKms(value) {
|
|
92
|
+
const { dekBytes, edkBytes } = await genDEK();
|
|
93
|
+
try {
|
|
94
|
+
const ciphertext = await encrypt({
|
|
95
|
+
purpose: "stack-data-vault-server-side-encryption",
|
|
96
|
+
secret: dekBytes,
|
|
97
|
+
value: new TextEncoder().encode(value)
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
edkBase64: encodeBase64(edkBytes),
|
|
101
|
+
ciphertextBase64: encodeBase64(ciphertext)
|
|
102
|
+
};
|
|
103
|
+
} finally {
|
|
104
|
+
dekBytes.fill(0);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function decryptWithKms(encrypted) {
|
|
108
|
+
const { dekBytes } = await unwrapDEK(encrypted.edkBase64);
|
|
109
|
+
try {
|
|
110
|
+
const value = Result.orThrow(await decrypt({
|
|
111
|
+
purpose: "stack-data-vault-server-side-encryption",
|
|
112
|
+
secret: dekBytes,
|
|
113
|
+
cipher: decodeBase64(encrypted.ciphertextBase64)
|
|
114
|
+
}));
|
|
115
|
+
return new TextDecoder().decode(value);
|
|
116
|
+
} finally {
|
|
117
|
+
dekBytes.fill(0);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
export { decryptWithKms, encryptWithKms };
|
|
123
|
+
//# sourceMappingURL=server-side.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-side.js","names":[],"sources":["../../../../src/helpers/vault/server-side.ts"],"sourcesContent":["import {\n CreateAliasCommand,\n CreateKeyCommand,\n DecryptCommand,\n DescribeKeyCommand,\n GenerateDataKeyCommand,\n KMSClient\n} from \"@aws-sdk/client-kms\";\nimport { decodeBase64, encodeBase64 } from \"../../utils/bytes\";\nimport { decrypt, encrypt } from \"../../utils/crypto\";\nimport { getEnvVariable } from \"../../utils/env\";\nimport { Result } from \"../../utils/results\";\n\n\nasync function getAwsCredentials() {\n // 1. Vercel OIDC: Vercel injects an OIDC token that can be exchanged for AWS credentials\n const vercelRoleArn = getEnvVariable(\"STACK_AWS_VERCEL_OIDC_ROLE_ARN\", \"\");\n if (vercelRoleArn) {\n const { awsCredentialsProvider } = await import(\"@vercel/functions/oidc\");\n return awsCredentialsProvider({ roleArn: vercelRoleArn });\n }\n\n // 2. GCP Workload Identity Federation: Cloud Run gets a GCP ID token from the metadata server,\n // then exchanges it for temporary AWS credentials via STS AssumeRoleWithWebIdentity.\n // Requires:\n // - An OIDC identity provider in AWS IAM (issuer: https://accounts.google.com)\n // - An IAM role with a trust policy allowing the GCP service account\n // - STACK_AWS_GCP_WIF_ROLE_ARN set to that role's ARN\n // - STACK_AWS_GCP_WIF_AUDIENCE set to the audience configured in the AWS OIDC provider\n const gcpWifRoleArn = getEnvVariable(\"STACK_AWS_GCP_WIF_ROLE_ARN\", \"\");\n if (gcpWifRoleArn) {\n const { fromWebToken } = await import(\"@aws-sdk/credential-provider-web-identity\");\n const audience = getEnvVariable(\"STACK_AWS_GCP_WIF_AUDIENCE\", \"sts.amazonaws.com\");\n // Return a provider that fetches a fresh GCP ID token on each invocation.\n // GCP metadata tokens expire after ~1h, so we can't bake a single token into the closure.\n return async () => {\n return await fromWebToken({\n roleArn: gcpWifRoleArn,\n roleSessionName: \"stack-backend-cloudrun\",\n webIdentityToken: await fetchGcpIdToken(audience),\n })();\n };\n }\n\n // 3. Static credentials: fallback for self-hosted / local development\n return {\n accessKeyId: getEnvVariable(\"STACK_AWS_ACCESS_KEY_ID\"),\n secretAccessKey: getEnvVariable(\"STACK_AWS_SECRET_ACCESS_KEY\"),\n };\n}\n\n/**\n * Fetches a GCP ID token from the metadata server (available on Cloud Run, GCE, GKE).\n * The token is a Google-signed JWT with the specified audience, suitable for\n * AWS STS AssumeRoleWithWebIdentity.\n */\nasync function fetchGcpIdToken(audience: string): Promise<string> {\n const metadataUrl = `http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=${encodeURIComponent(audience)}`;\n const response = await fetch(metadataUrl, {\n headers: { \"Metadata-Flavor\": \"Google\" },\n });\n if (!response.ok) {\n throw new Error(`Failed to fetch GCP ID token: ${response.status} ${await response.text()}`);\n }\n return await response.text();\n}\n\nlet kmsClientCache: KMSClient | undefined;\n\nasync function getKmsClient() {\n if (!kmsClientCache) {\n kmsClientCache = new KMSClient({\n region: getEnvVariable(\"STACK_AWS_REGION\"),\n endpoint: getEnvVariable(\"STACK_AWS_KMS_ENDPOINT\"),\n credentials: await getAwsCredentials(),\n });\n }\n return kmsClientCache;\n}\n\nasync function getOrCreateKekId(): Promise<string> {\n const id = \"alias/stack-data-vault-server-side-kek\";\n const kms = await getKmsClient();\n try {\n const describeResult = await kms.send(new DescribeKeyCommand({ KeyId: id }));\n if (describeResult.KeyMetadata?.KeyId) return describeResult.KeyMetadata.KeyId;\n } catch (e) {\n if (e instanceof Error && e.name !== \"NotFoundException\") {\n throw e;\n }\n }\n const { KeyMetadata } = await kms.send(new CreateKeyCommand({\n KeyUsage: \"ENCRYPT_DECRYPT\",\n Description: \"DataVault KEK\"\n }));\n await kms.send(new CreateAliasCommand({ AliasName: id, TargetKeyId: KeyMetadata!.KeyId! }));\n return id;\n}\n\nasync function genDEK() {\n const kekId = await getOrCreateKekId();\n const kms = await getKmsClient();\n const out = await kms.send(new GenerateDataKeyCommand({ KeyId: kekId, KeySpec: \"AES_256\" }));\n if (!out.Plaintext || !out.CiphertextBlob) throw new Error(\"GenerateDataKey failed\");\n return {\n dekBytes: out.Plaintext,\n edkBytes: out.CiphertextBlob,\n };\n}\n\nasync function unwrapDEK(edk_b64: string) {\n const edkBytes = decodeBase64(edk_b64);\n const kms = await getKmsClient();\n const out = await kms.send(new DecryptCommand({ CiphertextBlob: edkBytes }));\n if (!out.Plaintext) throw new Error(\"KMS Decrypt failed\");\n return {\n dekBytes: out.Plaintext,\n edkBytes,\n };\n}\n\nexport async function encryptWithKms(value: string) {\n const { dekBytes, edkBytes } = await genDEK();\n try {\n const ciphertext = await encrypt({\n purpose: \"stack-data-vault-server-side-encryption\",\n secret: dekBytes,\n value: new TextEncoder().encode(value),\n });\n return { edkBase64: encodeBase64(edkBytes), ciphertextBase64: encodeBase64(ciphertext) };\n } finally {\n dekBytes.fill(0);\n }\n}\n\nexport async function decryptWithKms(encrypted: Awaited<ReturnType<typeof encryptWithKms>>) {\n const { dekBytes } = await unwrapDEK(encrypted.edkBase64);\n try {\n const value = Result.orThrow(await decrypt({\n purpose: \"stack-data-vault-server-side-encryption\",\n secret: dekBytes,\n cipher: decodeBase64(encrypted.ciphertextBase64),\n }));\n return new TextDecoder().decode(value);\n } finally {\n dekBytes.fill(0);\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/use-async-callback.d.ts
|
|
4
|
+
declare function useAsyncCallback<A extends any[], R>(callback: (...args: A) => Promise<R>, deps: React.DependencyList): [cb: (...args: A) => Promise<R>, loading: boolean, error: unknown | undefined];
|
|
5
|
+
declare function useAsyncCallbackWithLoggedError<A extends any[], R>(callback: (...args: A) => Promise<R>, deps: React.DependencyList): [cb: (...args: A) => Promise<R>, loading: boolean];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useAsyncCallback, useAsyncCallbackWithLoggedError };
|
|
8
|
+
//# sourceMappingURL=use-async-callback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-async-callback.d.ts","names":[],"sources":["../../../src/hooks/use-async-callback.tsx"],"mappings":";;;iBAGgB,gBAAA,oBAAA,CACd,QAAA,MAAc,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,CAAA,GAClC,IAAA,EAAM,KAAA,CAAM,cAAA,IACV,EAAA,MAAQ,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,CAAA,GAAI,OAAA,WAAkB,KAAA;AAAA,iBAsBtC,+BAAA,oBAAA,CACd,QAAA,MAAc,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,CAAA,GAClC,IAAA,EAAM,KAAA,CAAM,cAAA,IACV,EAAA,MAAQ,IAAA,EAAM,CAAA,KAAM,OAAA,CAAQ,CAAA,GAAI,OAAA"}
|