@logto/schemas 1.18.0 → 1.20.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/alterations/1.19.0-1720253939-add-organization-branding.ts +18 -0
- package/alterations/1.19.0-1720345784-add-color-to-app-sie.ts +18 -0
- package/alterations/1.19.0-1720505152-update-custom-ui-assets.ts +20 -0
- package/alterations/1.19.0-1721483240-multiple-app-secrets.ts +77 -0
- package/alterations/1.19.0-1721645392-add-application-custom-data-column.ts +18 -0
- package/alterations/1.19.0-1722926389-argon2d-argon2id.ts +35 -0
- package/alterations/1.20.0-1723448981-personal-access-tokens.ts +35 -0
- package/alterations/1.20.0-1724229102-add-report-sub-updates-cloud-scope.ts +102 -0
- package/alterations/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.ts +18 -0
- package/alterations/1.20.0-1725971571-add-verification-record.ts +35 -0
- package/alterations-js/1.19.0-1720253939-add-organization-branding.js +14 -0
- package/alterations-js/1.19.0-1720345784-add-color-to-app-sie.js +14 -0
- package/alterations-js/1.19.0-1720505152-update-custom-ui-assets.js +16 -0
- package/alterations-js/1.19.0-1721483240-multiple-app-secrets.js +72 -0
- package/alterations-js/1.19.0-1721645392-add-application-custom-data-column.js +14 -0
- package/alterations-js/1.19.0-1722926389-argon2d-argon2id.js +30 -0
- package/alterations-js/1.20.0-1723448981-personal-access-tokens.js +30 -0
- package/alterations-js/1.20.0-1724229102-add-report-sub-updates-cloud-scope.js +59 -0
- package/alterations-js/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.js +14 -0
- package/alterations-js/1.20.0-1725971571-add-verification-record.js +30 -0
- package/lib/consts/experience.d.ts +8 -5
- package/lib/consts/experience.js +3 -0
- package/lib/consts/oidc.d.ts +48 -4
- package/lib/consts/oidc.js +32 -1
- package/lib/consts/subscriptions.d.ts +1 -0
- package/lib/consts/subscriptions.js +1 -0
- package/lib/consts/system.d.ts +2 -0
- package/lib/consts/system.js +2 -0
- package/lib/db-entries/application-secret.d.ts +28 -0
- package/lib/db-entries/application-secret.js +41 -0
- package/lib/db-entries/application-sign-in-experience.d.ts +4 -2
- package/lib/db-entries/application-sign-in-experience.js +5 -1
- package/lib/db-entries/application.d.ts +6 -2
- package/lib/db-entries/application.js +5 -1
- package/lib/db-entries/custom-types.d.ts +2 -0
- package/lib/db-entries/custom-types.js +2 -0
- package/lib/db-entries/index.d.ts +3 -0
- package/lib/db-entries/index.js +3 -0
- package/lib/db-entries/organization.d.ts +6 -2
- package/lib/db-entries/organization.js +5 -1
- package/lib/db-entries/personal-access-token.d.ts +26 -0
- package/lib/db-entries/personal-access-token.js +41 -0
- package/lib/db-entries/sign-in-experience.d.ts +4 -4
- package/lib/db-entries/sign-in-experience.js +5 -5
- package/lib/db-entries/verification-record.d.ts +26 -0
- package/lib/db-entries/verification-record.js +42 -0
- package/lib/db-entries/verification-status.d.ts +3 -1
- package/lib/db-entries/verification-status.js +4 -0
- package/lib/foundations/jsonb-types/index.d.ts +1 -0
- package/lib/foundations/jsonb-types/index.js +1 -0
- package/lib/foundations/jsonb-types/logs.d.ts +3 -0
- package/lib/foundations/jsonb-types/logs.js +1 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +37 -3
- package/lib/foundations/jsonb-types/sign-in-experience.js +19 -4
- package/lib/foundations/jsonb-types/users.d.ts +6 -6
- package/lib/foundations/jsonb-types/users.js +2 -2
- package/lib/foundations/jsonb-types/verification-records.d.ts +13 -0
- package/lib/foundations/jsonb-types/verification-records.js +14 -0
- package/lib/seeds/application.js +1 -0
- package/lib/seeds/cloud-api.d.ts +5 -1
- package/lib/seeds/cloud-api.js +5 -0
- package/lib/seeds/sign-in-experience.d.ts +1 -0
- package/lib/seeds/sign-in-experience.js +2 -2
- package/lib/types/application.d.ts +80 -122
- package/lib/types/connector.d.ts +34 -28
- package/lib/types/consent.d.ts +180 -33
- package/lib/types/cookie.d.ts +7 -1
- package/lib/types/cookie.js +3 -1
- package/lib/types/domain.d.ts +2 -10
- package/lib/types/hook.d.ts +14 -21
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/interactions.d.ts +202 -65
- package/lib/types/interactions.js +39 -23
- package/lib/types/log/interaction.d.ts +4 -3
- package/lib/types/log/interaction.js +1 -0
- package/lib/types/logto-config/index.d.ts +267 -242
- package/lib/types/logto-config/jwt-customizer.d.ts +548 -371
- package/lib/types/logto-config/jwt-customizer.js +28 -1
- package/lib/types/logto-config/oidc-provider.d.ts +6 -6
- package/lib/types/mfa.d.ts +16 -16
- package/lib/types/scope.d.ts +7 -6
- package/lib/types/sign-in-experience.d.ts +57 -120
- package/lib/types/sign-in-experience.js +1 -1
- package/lib/types/sso-connector.d.ts +14 -19
- package/lib/types/ssr.d.ts +25 -0
- package/lib/types/ssr.js +9 -0
- package/lib/types/system.d.ts +7 -3
- package/lib/types/system.js +4 -0
- package/lib/types/user-assets.d.ts +25 -5
- package/lib/types/user-assets.js +20 -1
- package/lib/types/user.d.ts +84 -120
- package/lib/utils/application.d.ts +3 -0
- package/lib/utils/application.js +7 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +9 -9
- package/tables/application_secrets.sql +17 -0
- package/tables/application_sign_in_experiences.sql +1 -1
- package/tables/applications.sql +7 -2
- package/tables/organizations.sql +2 -0
- package/tables/personal_access_tokens.sql +16 -0
- package/tables/sign_in_experiences.sql +1 -1
- package/tables/users.sql +1 -1
- package/tables/verification_records.sql +15 -0
- package/tables/verification_statuses.sql +1 -0
- package/alterations-js/1.0.0-1677208902-update-admin-console-config.d.ts +0 -3
- package/alterations-js/1.0.0-1677765137-seed-for-admin-tenant.d.ts +0 -3
- package/alterations-js/1.0.0-1677907982-allow-admin-create-multiple-tenants.d.ts +0 -3
- package/alterations-js/1.0.0-1678157950-privacy-policy-url.d.ts +0 -3
- package/alterations-js/1.0.0-1678199795-add-verification-status-table.d.ts +0 -3
- package/alterations-js/1.0.0-1678259693-remove-branding-style-config.d.ts +0 -3
- package/alterations-js/1.0.0-1678269972-use-restrictive-policies.d.ts +0 -3
- package/alterations-js/1.0.0-1678284778-restrict-internal-roles.d.ts +0 -3
- package/alterations-js/1.0.0-1678425761-m2m-app-for-tenants.d.ts +0 -3
- package/alterations-js/1.0.0-1678450233-support-custom-content.d.ts +0 -3
- package/alterations-js/1.0.0-1678716747-service-logs.d.ts +0 -3
- package/alterations-js/1.0.0-1678928481-remove-deprecated-logto-config-item.d.ts +0 -3
- package/alterations-js/1.0.0-1678953179-update-get-started-task-config.d.ts +0 -3
- package/alterations-js/1.0.0-1679209413-drop-connector-database-storage.d.ts +0 -3
- package/alterations-js/1.0.0_beta.10-1-logto-config.d.ts +0 -3
- package/alterations-js/1.0.0_beta.10-1663923211-machine-to-machine-app.d.ts +0 -3
- package/alterations-js/1.0.0_beta.10-1664265197-custom-phrases.d.ts +0 -3
- package/alterations-js/1.0.0_beta.11-1664347703-rename-language-key-to-tag.d.ts +0 -3
- package/alterations-js/1.0.0_beta.11-1664356000-add-created-at-column-to-users.d.ts +0 -3
- package/alterations-js/1.0.0_beta.11-1664462389-correct-user-created-at-column-by-user-logs.d.ts +0 -3
- package/alterations-js/1.0.0_beta.14-1665300135-sign-in-sign-up.d.ts +0 -3
- package/alterations-js/1.0.0_beta.14-1667283640-remove-forgot-password.d.ts +0 -3
- package/alterations-js/1.0.0_beta.14-1667292082-remove-sign-in-method.d.ts +0 -3
- package/alterations-js/1.0.0_beta.14-1667374974-user-suspend.d.ts +0 -3
- package/alterations-js/1.0.0_beta.14-1667900481-add-passcode-type-continue.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1668666590-support-multiple-connector-instances.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1668666600-remove-connector-enabled.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1669091623-roles-and-scopes.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1669702299-sign-up.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1671039448-add-user-name-index.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1671080370-terms-of-use.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1671336831-refactor-log-types.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1671509870-hooks.d.ts +0 -3
- package/alterations-js/1.0.0_beta.18-1672119200-align-passcode-type-with-message-type.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1672815959-user-roles.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1672820345-scope-resource-id.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1672901841-roles-and-scopes-not-null.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673001922-support-generic-passcode.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673165463-scope-name-index.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673349501-sms-sign-in-identifier-to-phone.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673465463-ac-scope-name.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673853579-ac-default-scope.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673863835-ac-scope-role.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673882867-fix-alteration-issues.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673940577-scope-description-not-null.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1673941897-application-roles.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674032095.1-dedup-resources-constraint.d.ts +0 -4
- package/alterations-js/1.0.0_rc.0-1674032095.2-oidc-model-pkey.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674032095.3-tenant-table.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674032095.4-add-id-column.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674032095.5-multi-tenancy.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674032095.6-add-tenant-id-trigger.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1674987042-drop-settings-and-create-systems.d.ts +0 -3
- package/alterations-js/1.0.0_rc.0-1675316731-update-seed-data.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1675788753-multi-tenancy-rls.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676115897-add-admin-tenant.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676185899-fix-logs-index.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676190092-migrate-admin-data.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676823841-update-sie-primary-key.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676874936-support-custom-css.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676886855-connector-database-read-write.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676906977-remove-demo-app.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1676956206-move-console-sie-to-database.d.ts +0 -3
- package/alterations-js/1.0.0_rc.1-1677059985-move-console-application-to-database.d.ts +0 -3
- package/alterations-js/1.10.1-1695647183-update-private-key-type.d.ts +0 -3
- package/alterations-js/1.10.1-1696657546-organization-tables.d.ts +0 -3
- package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.d.ts +0 -3
- package/alterations-js/1.10.1-1698646271-add-organization-created-flag.d.ts +0 -3
- package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.d.ts +0 -4
- package/alterations-js/1.10.1-1698910485-user-logto-data.d.ts +0 -3
- package/alterations-js/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.d.ts +0 -3
- package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.d.ts +0 -3
- package/alterations-js/1.12.0-1700031616-update-org-role-foreign-keys.d.ts +0 -3
- package/alterations-js/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.d.ts +0 -3
- package/alterations-js/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.d.ts +0 -3
- package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.d.ts +0 -3
- package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.d.ts +0 -3
- package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.d.ts +0 -18
- package/alterations-js/1.13.0-1702871078-protected-application-type.d.ts +0 -3
- package/alterations-js/1.13.0-1702877515-protected-app-configs.d.ts +0 -3
- package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.d.ts +0 -3
- package/alterations-js/1.13.0-1703229996-daily-token-usage.d.ts +0 -3
- package/alterations-js/1.13.0-1703230000-update-tenant-roles.d.ts +0 -11
- package/alterations-js/1.13.0-1704692973-remove-legacy-resources.d.ts +0 -3
- package/alterations-js/1.13.0-1704934999-add-magic-links-table.d.ts +0 -3
- package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.d.ts +0 -3
- package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.d.ts +0 -3
- package/alterations-js/1.13.0-1705991158-update-invitation-indices.d.ts +0 -7
- package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.d.ts +0 -3
- package/alterations-js/1.13.0-1706510290-protected-app-host-index.d.ts +0 -3
- package/alterations-js/1.13.0-1706512952-restore-get-started-page.d.ts +0 -3
- package/alterations-js/1.13.0-1706528755-remove-magic-links.d.ts +0 -3
- package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.d.ts +0 -3
- package/alterations-js/1.13.1-1707360939-grant-is-suspended-read-permission.d.ts +0 -6
- package/alterations-js/1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.d.ts +0 -3
- package/alterations-js/1.14.0-1709190131-enhance-dau-data-accuracy.d.ts +0 -3
- package/alterations-js/1.15.0-1709521416-user-password-encrypt-method.d.ts +0 -3
- package/alterations-js/1.15.0-1709528944-regenerate-dau-data.d.ts +0 -3
- package/alterations-js/1.15.0-1710223946-add-fetch-custom-jwt-cloud-scope.d.ts +0 -3
- package/alterations-js/1.15.0-1710408335-make-resource-scopes-description-nullable.d.ts +0 -3
- package/alterations-js/1.15.0-1710859622-add-oidc-standard-claim-properties.d.ts +0 -3
- package/alterations-js/1.15.0-1711607772-remove-invite-member-scope-from-tenant-member-role.d.ts +0 -3
- package/alterations-js/1.15.0-1711624564-add-read-member-scope-to-tenant-roles.d.ts +0 -3
- package/alterations-js/1.15.0-1711955211-organization-resource-scope.d.ts +0 -3
- package/alterations-js/1.15.0-1712041436-rename-organization-member-role-to-collaborator.d.ts +0 -3
- package/alterations-js/1.15.0-1712545011-fix-organization-resource-scope.d.ts +0 -8
- package/alterations-js/1.15.0-1712559358-fix-down-organization-resource-scope.d.ts +0 -8
- package/alterations-js/1.16.0-1712912361-delete-jwt-customier-with-empty-script.d.ts +0 -3
- package/alterations-js/1.16.0-1713942039-add-organization-custom-data.d.ts +0 -4
- package/alterations-js/1.16.0-1714270244-application-org-resource-scope.d.ts +0 -3
- package/alterations-js/1.17.0-1715826336-add-default-user-role-config.d.ts +0 -3
- package/alterations-js/1.17.0-1715829731-rename-data-hook-schema-update-event.d.ts +0 -3
- package/alterations-js/1.17.0-1716278409-remove-internal-role-database-policies.d.ts +0 -3
- package/alterations-js/1.17.0-1716291265-create-pre-configured-m-api-role.d.ts +0 -7
- package/alterations-js/1.17.0-1717148078-remove-service-log-reference.d.ts +0 -3
- package/alterations-js/1.18.0-1717567857-social-sign-in-linking.d.ts +0 -3
- package/alterations-js/1.18.0-1717597875-add-organization-email-domains-table.d.ts +0 -3
- package/alterations-js/1.18.0-1717818597-organization-mfa-requirement.d.ts +0 -3
- package/alterations-js/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.d.ts +0 -3
- package/alterations-js/1.18.0-1718594164-add-agree-to-terms-policy.d.ts +0 -3
- package/alterations-js/1.18.0-1718785576-organization-application-relations.d.ts +0 -3
- package/alterations-js/1.18.0-1718786576-organization-jit-sso-connectors.d.ts +0 -3
- package/alterations-js/1.18.0-1718807616-organization-role-application-relations.d.ts +0 -3
- package/alterations-js/1.18.0-1718865814-add-subject-tokens.d.ts +0 -3
- package/alterations-js/1.18.0-1719014832-organization-role-types.d.ts +0 -3
- package/alterations-js/1.18.0-1719221205-fix-functions.d.ts +0 -7
- package/alterations-js/1.18.0-1719312694-custom-ui-assets.d.ts +0 -3
- package/alterations-js/1.2.0-1681267285-fix-get-started-passwordless-status.d.ts +0 -3
- package/alterations-js/1.3.0-1683292832-update-hooks.d.ts +0 -3
- package/alterations-js/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.d.ts +0 -3
- package/alterations-js/1.5.0-1684739802-create-hook-id-index-for-logs.d.ts +0 -3
- package/alterations-js/1.5.0-1684822341-init-domains.d.ts +0 -3
- package/alterations-js/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.d.ts +0 -3
- package/alterations-js/1.5.0-1685285719-support-default-resource.d.ts +0 -3
- package/alterations-js/1.6.0-1685691718-domain-unique.d.ts +0 -3
- package/alterations-js/1.7.0-1688375200-sync-cloud-m2m-to-logto-config.d.ts +0 -3
- package/alterations-js/1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.d.ts +0 -3
- package/alterations-js/1.7.0-1688627407-daily-active-users.d.ts +0 -3
- package/alterations-js/1.8.0-1692088012-add-is-suspend-column-to-tenants-table.d.ts +0 -3
- package/alterations-js/1.8.0-1692194751-add-affiliate-scopes.d.ts +0 -3
- package/alterations-js/1.9.0-1693554904-add-possword-policy.d.ts +0 -4
- package/alterations-js/1.9.0-1694399696-add-type-col-to-roles-table.d.ts +0 -3
- package/alterations-js/1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.d.ts +0 -9
- package/alterations-js/1.9.0-1694484927-remove-deprecated-challenge-flag.d.ts +0 -3
- package/alterations-js/1.9.0-1694487524-sie-mfa.d.ts +0 -3
- package/alterations-js/1.9.0-1694509714-keep-existing-password-policy.d.ts +0 -3
- package/alterations-js/1.9.0-1694746763-user-verifications.d.ts +0 -3
- package/alterations-js/1.9.2-1694854226-init-sentinel.d.ts +0 -3
- package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.d.ts +0 -3
- package/alterations-js/utils/1704934999-tables.d.ts +0 -11
- package/alterations-js/utils/1716643968-id-generation.d.ts +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MfaFactor } from '../foundations/index.js';
|
|
2
|
+
import { MfaFactor, SignInIdentifier } from '../foundations/index.js';
|
|
3
3
|
import type { EmailVerificationCodePayload, PhoneVerificationCodePayload } from './verification-code.js';
|
|
4
4
|
/**
|
|
5
5
|
* User interaction events defined in Logto RFC 0004.
|
|
@@ -10,52 +10,38 @@ export declare enum InteractionEvent {
|
|
|
10
10
|
Register = "Register",
|
|
11
11
|
ForgotPassword = "ForgotPassword"
|
|
12
12
|
}
|
|
13
|
-
export declare enum InteractionIdentifierType {
|
|
14
|
-
Username = "username",
|
|
15
|
-
Email = "email",
|
|
16
|
-
Phone = "phone"
|
|
17
|
-
}
|
|
18
13
|
/** Identifiers that can be used to uniquely identify a user. */
|
|
19
|
-
export type InteractionIdentifier = {
|
|
20
|
-
type:
|
|
14
|
+
export type InteractionIdentifier<T extends SignInIdentifier = SignInIdentifier> = {
|
|
15
|
+
type: T;
|
|
21
16
|
value: string;
|
|
22
17
|
};
|
|
23
18
|
export declare const interactionIdentifierGuard: z.ZodObject<{
|
|
24
|
-
type: z.ZodNativeEnum<typeof
|
|
19
|
+
type: z.ZodNativeEnum<typeof SignInIdentifier>;
|
|
25
20
|
value: z.ZodString;
|
|
26
21
|
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
type:
|
|
22
|
+
type: SignInIdentifier;
|
|
28
23
|
value: string;
|
|
29
24
|
}, {
|
|
30
|
-
type:
|
|
25
|
+
type: SignInIdentifier;
|
|
31
26
|
value: string;
|
|
32
27
|
}>;
|
|
28
|
+
export type VerificationCodeSignInIdentifier = SignInIdentifier.Email | SignInIdentifier.Phone;
|
|
33
29
|
/** Currently only email and phone are supported for verification code validation. */
|
|
34
|
-
export type VerificationCodeIdentifier = {
|
|
35
|
-
type:
|
|
30
|
+
export type VerificationCodeIdentifier<T extends VerificationCodeSignInIdentifier = VerificationCodeSignInIdentifier> = {
|
|
31
|
+
type: T;
|
|
36
32
|
value: string;
|
|
37
33
|
};
|
|
38
34
|
export declare const verificationCodeIdentifierGuard: z.ZodObject<{
|
|
39
|
-
type: z.ZodEnum<[
|
|
35
|
+
type: z.ZodEnum<[SignInIdentifier.Email, SignInIdentifier.Phone]>;
|
|
40
36
|
value: z.ZodString;
|
|
41
37
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
type:
|
|
38
|
+
type: SignInIdentifier.Email | SignInIdentifier.Phone;
|
|
43
39
|
value: string;
|
|
44
40
|
}, {
|
|
45
|
-
type:
|
|
41
|
+
type: SignInIdentifier.Email | SignInIdentifier.Phone;
|
|
46
42
|
value: string;
|
|
47
43
|
}>;
|
|
48
|
-
/**
|
|
49
|
-
export declare enum VerificationType {
|
|
50
|
-
Password = "Password",
|
|
51
|
-
VerificationCode = "VerificationCode",
|
|
52
|
-
Social = "Social",
|
|
53
|
-
EnterpriseSso = "EnterpriseSso",
|
|
54
|
-
TOTP = "Totp",
|
|
55
|
-
WebAuthn = "WebAuthn",
|
|
56
|
-
BackupCode = "BackupCode"
|
|
57
|
-
}
|
|
58
|
-
/** Payload type for `POST /api/experience/verification/social/:connectorId/authorization-uri`. */
|
|
44
|
+
/** Payload type for `POST /api/experience/verification/{social|sso}/:connectorId/authorization-uri`. */
|
|
59
45
|
export type SocialAuthorizationUrlPayload = {
|
|
60
46
|
state: string;
|
|
61
47
|
redirectUri: string;
|
|
@@ -70,22 +56,22 @@ export declare const socialAuthorizationUrlPayloadGuard: z.ZodObject<{
|
|
|
70
56
|
state: string;
|
|
71
57
|
redirectUri: string;
|
|
72
58
|
}>;
|
|
73
|
-
/** Payload type for `POST /api/experience/verification/social/:connectorId/verify`. */
|
|
59
|
+
/** Payload type for `POST /api/experience/verification/{social|sso}/:connectorId/verify`. */
|
|
74
60
|
export type SocialVerificationCallbackPayload = {
|
|
75
61
|
/** The callback data from the social connector. */
|
|
76
62
|
connectorData: Record<string, unknown>;
|
|
77
|
-
/** The verification ID returned from the authorization URI. */
|
|
78
|
-
verificationId
|
|
63
|
+
/** The verification ID returned from the authorization URI. Optional for Google one tap callback */
|
|
64
|
+
verificationId?: string;
|
|
79
65
|
};
|
|
80
66
|
export declare const socialVerificationCallbackPayloadGuard: z.ZodObject<{
|
|
81
67
|
connectorData: z.ZodRecord<z.ZodString, z.ZodType<import("@withtyped/server/lib/types.js").Json, z.ZodTypeDef, import("@withtyped/server/lib/types.js").Json>>;
|
|
82
|
-
verificationId: z.ZodString
|
|
68
|
+
verificationId: z.ZodOptional<z.ZodString>;
|
|
83
69
|
}, "strip", z.ZodTypeAny, {
|
|
84
70
|
connectorData: Record<string, import("@withtyped/server/lib/types.js").Json>;
|
|
85
|
-
verificationId
|
|
71
|
+
verificationId?: string | undefined;
|
|
86
72
|
}, {
|
|
87
73
|
connectorData: Record<string, import("@withtyped/server/lib/types.js").Json>;
|
|
88
|
-
verificationId
|
|
74
|
+
verificationId?: string | undefined;
|
|
89
75
|
}>;
|
|
90
76
|
/** Payload type for `POST /api/experience/verification/password`. */
|
|
91
77
|
export type PasswordVerificationPayload = {
|
|
@@ -94,44 +80,137 @@ export type PasswordVerificationPayload = {
|
|
|
94
80
|
};
|
|
95
81
|
export declare const passwordVerificationPayloadGuard: z.ZodObject<{
|
|
96
82
|
identifier: z.ZodObject<{
|
|
97
|
-
type: z.ZodNativeEnum<typeof
|
|
83
|
+
type: z.ZodNativeEnum<typeof SignInIdentifier>;
|
|
98
84
|
value: z.ZodString;
|
|
99
85
|
}, "strip", z.ZodTypeAny, {
|
|
100
|
-
type:
|
|
86
|
+
type: SignInIdentifier;
|
|
101
87
|
value: string;
|
|
102
88
|
}, {
|
|
103
|
-
type:
|
|
89
|
+
type: SignInIdentifier;
|
|
104
90
|
value: string;
|
|
105
91
|
}>;
|
|
106
92
|
password: z.ZodString;
|
|
107
93
|
}, "strip", z.ZodTypeAny, {
|
|
108
94
|
password: string;
|
|
109
95
|
identifier: {
|
|
110
|
-
type:
|
|
96
|
+
type: SignInIdentifier;
|
|
111
97
|
value: string;
|
|
112
98
|
};
|
|
113
99
|
}, {
|
|
114
100
|
password: string;
|
|
115
101
|
identifier: {
|
|
116
|
-
type:
|
|
102
|
+
type: SignInIdentifier;
|
|
117
103
|
value: string;
|
|
118
104
|
};
|
|
119
105
|
}>;
|
|
106
|
+
/** Payload type for `POST /api/experience/verification/totp/verify`. */
|
|
107
|
+
export type TotpVerificationVerifyPayload = {
|
|
108
|
+
code: string;
|
|
109
|
+
verificationId?: string;
|
|
110
|
+
};
|
|
111
|
+
export declare const totpVerificationVerifyPayloadGuard: z.ZodObject<{
|
|
112
|
+
code: z.ZodString;
|
|
113
|
+
verificationId: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
code: string;
|
|
116
|
+
verificationId?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
code: string;
|
|
119
|
+
verificationId?: string | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
/** Payload type for `POST /api/experience/verification/backup-code/verify */
|
|
122
|
+
export type BackupCodeVerificationVerifyPayload = {
|
|
123
|
+
code: string;
|
|
124
|
+
};
|
|
125
|
+
export declare const backupCodeVerificationVerifyPayloadGuard: z.ZodObject<{
|
|
126
|
+
code: z.ZodString;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
code: string;
|
|
129
|
+
}, {
|
|
130
|
+
code: string;
|
|
131
|
+
}>;
|
|
120
132
|
/** Payload type for `POST /api/experience/identification`. */
|
|
121
133
|
export type IdentificationApiPayload = {
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
/**
|
|
135
|
+
* The ID of the verification record that is used to identify the user.
|
|
136
|
+
* Optional for the register interaction event
|
|
137
|
+
*/
|
|
138
|
+
verificationId?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Link social identity to a related user account with the same email or phone.
|
|
141
|
+
* Only applicable for social verification records and a related user account is found.
|
|
142
|
+
*/
|
|
143
|
+
linkSocialIdentity?: boolean;
|
|
124
144
|
};
|
|
125
145
|
export declare const identificationApiPayloadGuard: z.ZodObject<{
|
|
146
|
+
verificationId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
linkSocialIdentity: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
verificationId?: string | undefined;
|
|
150
|
+
linkSocialIdentity?: boolean | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
verificationId?: string | undefined;
|
|
153
|
+
linkSocialIdentity?: boolean | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
/** Payload type for `POST /api/experience`. */
|
|
156
|
+
export type CreateExperienceApiPayload = {
|
|
157
|
+
interactionEvent: InteractionEvent;
|
|
158
|
+
};
|
|
159
|
+
export declare const CreateExperienceApiPayloadGuard: z.ZodObject<{
|
|
126
160
|
interactionEvent: z.ZodNativeEnum<typeof InteractionEvent>;
|
|
127
|
-
verificationId: z.ZodString;
|
|
128
161
|
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
verificationId: string;
|
|
130
162
|
interactionEvent: InteractionEvent;
|
|
131
163
|
}, {
|
|
132
|
-
verificationId: string;
|
|
133
164
|
interactionEvent: InteractionEvent;
|
|
134
165
|
}>;
|
|
166
|
+
/** Payload type for `POST /api/experience/profile */
|
|
167
|
+
export declare const updateProfileApiPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
168
|
+
type: z.ZodLiteral<SignInIdentifier.Username>;
|
|
169
|
+
value: z.ZodString;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
type: SignInIdentifier.Username;
|
|
172
|
+
value: string;
|
|
173
|
+
}, {
|
|
174
|
+
type: SignInIdentifier.Username;
|
|
175
|
+
value: string;
|
|
176
|
+
}>, z.ZodObject<{
|
|
177
|
+
type: z.ZodLiteral<"password">;
|
|
178
|
+
value: z.ZodString;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
type: "password";
|
|
181
|
+
value: string;
|
|
182
|
+
}, {
|
|
183
|
+
type: "password";
|
|
184
|
+
value: string;
|
|
185
|
+
}>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<SignInIdentifier.Email>;
|
|
187
|
+
verificationId: z.ZodString;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
type: SignInIdentifier.Email;
|
|
190
|
+
verificationId: string;
|
|
191
|
+
}, {
|
|
192
|
+
type: SignInIdentifier.Email;
|
|
193
|
+
verificationId: string;
|
|
194
|
+
}>, z.ZodObject<{
|
|
195
|
+
type: z.ZodLiteral<SignInIdentifier.Phone>;
|
|
196
|
+
verificationId: z.ZodString;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
type: SignInIdentifier.Phone;
|
|
199
|
+
verificationId: string;
|
|
200
|
+
}, {
|
|
201
|
+
type: SignInIdentifier.Phone;
|
|
202
|
+
verificationId: string;
|
|
203
|
+
}>, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"social">;
|
|
205
|
+
verificationId: z.ZodString;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
type: "social";
|
|
208
|
+
verificationId: string;
|
|
209
|
+
}, {
|
|
210
|
+
type: "social";
|
|
211
|
+
verificationId: string;
|
|
212
|
+
}>]>;
|
|
213
|
+
export type UpdateProfileApiPayload = z.infer<typeof updateProfileApiPayloadGuard>;
|
|
135
214
|
/**
|
|
136
215
|
* Legacy interaction identifier payload guard
|
|
137
216
|
*
|
|
@@ -294,14 +373,14 @@ export declare const profileGuard: z.ZodObject<{
|
|
|
294
373
|
username?: string | undefined;
|
|
295
374
|
email?: string | undefined;
|
|
296
375
|
phone?: string | undefined;
|
|
297
|
-
connectorId?: string | undefined;
|
|
298
376
|
password?: string | undefined;
|
|
377
|
+
connectorId?: string | undefined;
|
|
299
378
|
}, {
|
|
300
379
|
username?: string | undefined;
|
|
301
380
|
email?: string | undefined;
|
|
302
381
|
phone?: string | undefined;
|
|
303
|
-
connectorId?: string | undefined;
|
|
304
382
|
password?: string | undefined;
|
|
383
|
+
connectorId?: string | undefined;
|
|
305
384
|
}>;
|
|
306
385
|
export type Profile = z.infer<typeof profileGuard>;
|
|
307
386
|
export declare enum MissingProfile {
|
|
@@ -341,17 +420,17 @@ export declare const bindWebAuthnPayloadGuard: z.ZodObject<{
|
|
|
341
420
|
}, "strip", z.ZodTypeAny, {
|
|
342
421
|
clientDataJSON: string;
|
|
343
422
|
attestationObject: string;
|
|
344
|
-
|
|
423
|
+
publicKey?: string | undefined;
|
|
345
424
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
425
|
+
authenticatorData?: string | undefined;
|
|
346
426
|
publicKeyAlgorithm?: number | undefined;
|
|
347
|
-
publicKey?: string | undefined;
|
|
348
427
|
}, {
|
|
349
428
|
clientDataJSON: string;
|
|
350
429
|
attestationObject: string;
|
|
351
|
-
|
|
430
|
+
publicKey?: string | undefined;
|
|
352
431
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
432
|
+
authenticatorData?: string | undefined;
|
|
353
433
|
publicKeyAlgorithm?: number | undefined;
|
|
354
|
-
publicKey?: string | undefined;
|
|
355
434
|
}>;
|
|
356
435
|
authenticatorAttachment: z.ZodOptional<z.ZodEnum<["cross-platform", "platform"]>>;
|
|
357
436
|
clientExtensionResults: z.ZodObject<{
|
|
@@ -384,10 +463,10 @@ export declare const bindWebAuthnPayloadGuard: z.ZodObject<{
|
|
|
384
463
|
response: {
|
|
385
464
|
clientDataJSON: string;
|
|
386
465
|
attestationObject: string;
|
|
387
|
-
|
|
466
|
+
publicKey?: string | undefined;
|
|
388
467
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
468
|
+
authenticatorData?: string | undefined;
|
|
389
469
|
publicKeyAlgorithm?: number | undefined;
|
|
390
|
-
publicKey?: string | undefined;
|
|
391
470
|
};
|
|
392
471
|
clientExtensionResults: {
|
|
393
472
|
appid?: boolean | undefined;
|
|
@@ -404,10 +483,10 @@ export declare const bindWebAuthnPayloadGuard: z.ZodObject<{
|
|
|
404
483
|
response: {
|
|
405
484
|
clientDataJSON: string;
|
|
406
485
|
attestationObject: string;
|
|
407
|
-
|
|
486
|
+
publicKey?: string | undefined;
|
|
408
487
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
488
|
+
authenticatorData?: string | undefined;
|
|
409
489
|
publicKeyAlgorithm?: number | undefined;
|
|
410
|
-
publicKey?: string | undefined;
|
|
411
490
|
};
|
|
412
491
|
clientExtensionResults: {
|
|
413
492
|
appid?: boolean | undefined;
|
|
@@ -455,17 +534,17 @@ export declare const bindMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
455
534
|
}, "strip", z.ZodTypeAny, {
|
|
456
535
|
clientDataJSON: string;
|
|
457
536
|
attestationObject: string;
|
|
458
|
-
|
|
537
|
+
publicKey?: string | undefined;
|
|
459
538
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
539
|
+
authenticatorData?: string | undefined;
|
|
460
540
|
publicKeyAlgorithm?: number | undefined;
|
|
461
|
-
publicKey?: string | undefined;
|
|
462
541
|
}, {
|
|
463
542
|
clientDataJSON: string;
|
|
464
543
|
attestationObject: string;
|
|
465
|
-
|
|
544
|
+
publicKey?: string | undefined;
|
|
466
545
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
546
|
+
authenticatorData?: string | undefined;
|
|
467
547
|
publicKeyAlgorithm?: number | undefined;
|
|
468
|
-
publicKey?: string | undefined;
|
|
469
548
|
}>;
|
|
470
549
|
authenticatorAttachment: z.ZodOptional<z.ZodEnum<["cross-platform", "platform"]>>;
|
|
471
550
|
clientExtensionResults: z.ZodObject<{
|
|
@@ -498,10 +577,10 @@ export declare const bindMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
498
577
|
response: {
|
|
499
578
|
clientDataJSON: string;
|
|
500
579
|
attestationObject: string;
|
|
501
|
-
|
|
580
|
+
publicKey?: string | undefined;
|
|
502
581
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
582
|
+
authenticatorData?: string | undefined;
|
|
503
583
|
publicKeyAlgorithm?: number | undefined;
|
|
504
|
-
publicKey?: string | undefined;
|
|
505
584
|
};
|
|
506
585
|
clientExtensionResults: {
|
|
507
586
|
appid?: boolean | undefined;
|
|
@@ -518,10 +597,10 @@ export declare const bindMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
518
597
|
response: {
|
|
519
598
|
clientDataJSON: string;
|
|
520
599
|
attestationObject: string;
|
|
521
|
-
|
|
600
|
+
publicKey?: string | undefined;
|
|
522
601
|
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
602
|
+
authenticatorData?: string | undefined;
|
|
523
603
|
publicKeyAlgorithm?: number | undefined;
|
|
524
|
-
publicKey?: string | undefined;
|
|
525
604
|
};
|
|
526
605
|
clientExtensionResults: {
|
|
527
606
|
appid?: boolean | undefined;
|
|
@@ -539,6 +618,7 @@ export declare const bindMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
539
618
|
type: MfaFactor.BackupCode;
|
|
540
619
|
}>]>;
|
|
541
620
|
export type BindMfaPayload = z.infer<typeof bindMfaPayloadGuard>;
|
|
621
|
+
/** @deprecated Legacy interaction API use only */
|
|
542
622
|
export declare const totpVerificationPayloadGuard: z.ZodObject<{
|
|
543
623
|
type: z.ZodLiteral<MfaFactor.TOTP>;
|
|
544
624
|
code: z.ZodString;
|
|
@@ -549,11 +629,39 @@ export declare const totpVerificationPayloadGuard: z.ZodObject<{
|
|
|
549
629
|
code: string;
|
|
550
630
|
type: MfaFactor.TOTP;
|
|
551
631
|
}>;
|
|
632
|
+
/** @deprecated Legacy interaction API use only */
|
|
552
633
|
export type TotpVerificationPayload = z.infer<typeof totpVerificationPayloadGuard>;
|
|
553
|
-
export declare const webAuthnVerificationPayloadGuard: z.ZodObject<{
|
|
634
|
+
export declare const webAuthnVerificationPayloadGuard: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
554
635
|
type: z.ZodLiteral<MfaFactor.WebAuthn>;
|
|
555
636
|
id: z.ZodString;
|
|
556
637
|
rawId: z.ZodString;
|
|
638
|
+
/**
|
|
639
|
+
* The response from WebAuthn API
|
|
640
|
+
*
|
|
641
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential}
|
|
642
|
+
*/
|
|
643
|
+
response: z.ZodObject<{
|
|
644
|
+
clientDataJSON: z.ZodString;
|
|
645
|
+
attestationObject: z.ZodString;
|
|
646
|
+
authenticatorData: z.ZodOptional<z.ZodString>;
|
|
647
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<["usb", "nfc", "ble", "internal", "cable", "hybrid", "smart-card"]>, "many">>;
|
|
648
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodNumber>;
|
|
649
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
650
|
+
}, "strip", z.ZodTypeAny, {
|
|
651
|
+
clientDataJSON: string;
|
|
652
|
+
attestationObject: string;
|
|
653
|
+
publicKey?: string | undefined;
|
|
654
|
+
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
655
|
+
authenticatorData?: string | undefined;
|
|
656
|
+
publicKeyAlgorithm?: number | undefined;
|
|
657
|
+
}, {
|
|
658
|
+
clientDataJSON: string;
|
|
659
|
+
attestationObject: string;
|
|
660
|
+
publicKey?: string | undefined;
|
|
661
|
+
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
662
|
+
authenticatorData?: string | undefined;
|
|
663
|
+
publicKeyAlgorithm?: number | undefined;
|
|
664
|
+
}>;
|
|
557
665
|
authenticatorAttachment: z.ZodOptional<z.ZodEnum<["cross-platform", "platform"]>>;
|
|
558
666
|
clientExtensionResults: z.ZodObject<{
|
|
559
667
|
appid: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -578,6 +686,7 @@ export declare const webAuthnVerificationPayloadGuard: z.ZodObject<{
|
|
|
578
686
|
} | undefined;
|
|
579
687
|
hmacCreateSecret?: boolean | undefined;
|
|
580
688
|
}>;
|
|
689
|
+
}, "response">, {
|
|
581
690
|
response: z.ZodObject<{
|
|
582
691
|
clientDataJSON: z.ZodString;
|
|
583
692
|
authenticatorData: z.ZodString;
|
|
@@ -594,7 +703,7 @@ export declare const webAuthnVerificationPayloadGuard: z.ZodObject<{
|
|
|
594
703
|
signature: string;
|
|
595
704
|
userHandle?: string | undefined;
|
|
596
705
|
}>;
|
|
597
|
-
}
|
|
706
|
+
}>, "strip", z.ZodTypeAny, {
|
|
598
707
|
type: MfaFactor.WebAuthn;
|
|
599
708
|
id: string;
|
|
600
709
|
rawId: string;
|
|
@@ -652,10 +761,37 @@ export declare const verifyMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
652
761
|
}, {
|
|
653
762
|
code: string;
|
|
654
763
|
type: MfaFactor.TOTP;
|
|
655
|
-
}>, z.ZodObject<{
|
|
764
|
+
}>, z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
656
765
|
type: z.ZodLiteral<MfaFactor.WebAuthn>;
|
|
657
766
|
id: z.ZodString;
|
|
658
767
|
rawId: z.ZodString;
|
|
768
|
+
/**
|
|
769
|
+
* The response from WebAuthn API
|
|
770
|
+
*
|
|
771
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential}
|
|
772
|
+
*/
|
|
773
|
+
response: z.ZodObject<{
|
|
774
|
+
clientDataJSON: z.ZodString;
|
|
775
|
+
attestationObject: z.ZodString;
|
|
776
|
+
authenticatorData: z.ZodOptional<z.ZodString>;
|
|
777
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<["usb", "nfc", "ble", "internal", "cable", "hybrid", "smart-card"]>, "many">>;
|
|
778
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodNumber>;
|
|
779
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
780
|
+
}, "strip", z.ZodTypeAny, {
|
|
781
|
+
clientDataJSON: string;
|
|
782
|
+
attestationObject: string;
|
|
783
|
+
publicKey?: string | undefined;
|
|
784
|
+
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
785
|
+
authenticatorData?: string | undefined;
|
|
786
|
+
publicKeyAlgorithm?: number | undefined;
|
|
787
|
+
}, {
|
|
788
|
+
clientDataJSON: string;
|
|
789
|
+
attestationObject: string;
|
|
790
|
+
publicKey?: string | undefined;
|
|
791
|
+
transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined;
|
|
792
|
+
authenticatorData?: string | undefined;
|
|
793
|
+
publicKeyAlgorithm?: number | undefined;
|
|
794
|
+
}>;
|
|
659
795
|
authenticatorAttachment: z.ZodOptional<z.ZodEnum<["cross-platform", "platform"]>>;
|
|
660
796
|
clientExtensionResults: z.ZodObject<{
|
|
661
797
|
appid: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -680,6 +816,7 @@ export declare const verifyMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
680
816
|
} | undefined;
|
|
681
817
|
hmacCreateSecret?: boolean | undefined;
|
|
682
818
|
}>;
|
|
819
|
+
}, "response">, {
|
|
683
820
|
response: z.ZodObject<{
|
|
684
821
|
clientDataJSON: z.ZodString;
|
|
685
822
|
authenticatorData: z.ZodString;
|
|
@@ -696,7 +833,7 @@ export declare const verifyMfaPayloadGuard: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
696
833
|
signature: string;
|
|
697
834
|
userHandle?: string | undefined;
|
|
698
835
|
}>;
|
|
699
|
-
}
|
|
836
|
+
}>, "strip", z.ZodTypeAny, {
|
|
700
837
|
type: MfaFactor.WebAuthn;
|
|
701
838
|
id: string;
|
|
702
839
|
rawId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { emailRegEx, phoneRegEx, usernameRegEx } from '@logto/core-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { MfaFactor, jsonObjectGuard, webAuthnTransportGuard } from '../foundations/index.js';
|
|
3
|
+
import { MfaFactor, SignInIdentifier, jsonObjectGuard, webAuthnTransportGuard, } from '../foundations/index.js';
|
|
4
4
|
import { emailVerificationCodePayloadGuard, phoneVerificationCodePayloadGuard, } from './verification-code.js';
|
|
5
5
|
/**
|
|
6
6
|
* User interaction events defined in Logto RFC 0004.
|
|
@@ -12,48 +12,63 @@ export var InteractionEvent;
|
|
|
12
12
|
InteractionEvent["Register"] = "Register";
|
|
13
13
|
InteractionEvent["ForgotPassword"] = "ForgotPassword";
|
|
14
14
|
})(InteractionEvent || (InteractionEvent = {}));
|
|
15
|
-
// ====== Experience API payload guards and type definitions start ======
|
|
16
|
-
export var InteractionIdentifierType;
|
|
17
|
-
(function (InteractionIdentifierType) {
|
|
18
|
-
InteractionIdentifierType["Username"] = "username";
|
|
19
|
-
InteractionIdentifierType["Email"] = "email";
|
|
20
|
-
InteractionIdentifierType["Phone"] = "phone";
|
|
21
|
-
})(InteractionIdentifierType || (InteractionIdentifierType = {}));
|
|
22
15
|
export const interactionIdentifierGuard = z.object({
|
|
23
|
-
type: z.nativeEnum(
|
|
16
|
+
type: z.nativeEnum(SignInIdentifier),
|
|
24
17
|
value: z.string(),
|
|
25
18
|
});
|
|
26
19
|
export const verificationCodeIdentifierGuard = z.object({
|
|
27
|
-
type: z.enum([
|
|
20
|
+
type: z.enum([SignInIdentifier.Email, SignInIdentifier.Phone]),
|
|
28
21
|
value: z.string(),
|
|
29
22
|
});
|
|
30
|
-
/** Logto supported interaction verification types. */
|
|
31
|
-
export var VerificationType;
|
|
32
|
-
(function (VerificationType) {
|
|
33
|
-
VerificationType["Password"] = "Password";
|
|
34
|
-
VerificationType["VerificationCode"] = "VerificationCode";
|
|
35
|
-
VerificationType["Social"] = "Social";
|
|
36
|
-
VerificationType["EnterpriseSso"] = "EnterpriseSso";
|
|
37
|
-
VerificationType["TOTP"] = "Totp";
|
|
38
|
-
VerificationType["WebAuthn"] = "WebAuthn";
|
|
39
|
-
VerificationType["BackupCode"] = "BackupCode";
|
|
40
|
-
})(VerificationType || (VerificationType = {}));
|
|
41
23
|
export const socialAuthorizationUrlPayloadGuard = z.object({
|
|
42
24
|
state: z.string(),
|
|
43
25
|
redirectUri: z.string(),
|
|
44
26
|
});
|
|
45
27
|
export const socialVerificationCallbackPayloadGuard = z.object({
|
|
46
28
|
connectorData: jsonObjectGuard,
|
|
47
|
-
verificationId: z.string(),
|
|
29
|
+
verificationId: z.string().optional(),
|
|
48
30
|
});
|
|
49
31
|
export const passwordVerificationPayloadGuard = z.object({
|
|
50
32
|
identifier: interactionIdentifierGuard,
|
|
51
33
|
password: z.string().min(1),
|
|
52
34
|
});
|
|
35
|
+
export const totpVerificationVerifyPayloadGuard = z.object({
|
|
36
|
+
code: z.string().min(1),
|
|
37
|
+
verificationId: z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
export const backupCodeVerificationVerifyPayloadGuard = z.object({
|
|
40
|
+
code: z.string().min(1),
|
|
41
|
+
});
|
|
53
42
|
export const identificationApiPayloadGuard = z.object({
|
|
43
|
+
verificationId: z.string().optional(),
|
|
44
|
+
linkSocialIdentity: z.boolean().optional(),
|
|
45
|
+
});
|
|
46
|
+
export const CreateExperienceApiPayloadGuard = z.object({
|
|
54
47
|
interactionEvent: z.nativeEnum(InteractionEvent),
|
|
55
|
-
verificationId: z.string(),
|
|
56
48
|
});
|
|
49
|
+
/** Payload type for `POST /api/experience/profile */
|
|
50
|
+
export const updateProfileApiPayloadGuard = z.discriminatedUnion('type', [
|
|
51
|
+
z.object({
|
|
52
|
+
type: z.literal(SignInIdentifier.Username),
|
|
53
|
+
value: z.string().regex(usernameRegEx),
|
|
54
|
+
}),
|
|
55
|
+
z.object({
|
|
56
|
+
type: z.literal('password'),
|
|
57
|
+
value: z.string(),
|
|
58
|
+
}),
|
|
59
|
+
z.object({
|
|
60
|
+
type: z.literal(SignInIdentifier.Email),
|
|
61
|
+
verificationId: z.string(),
|
|
62
|
+
}),
|
|
63
|
+
z.object({
|
|
64
|
+
type: z.literal(SignInIdentifier.Phone),
|
|
65
|
+
verificationId: z.string(),
|
|
66
|
+
}),
|
|
67
|
+
z.object({
|
|
68
|
+
type: z.literal('social'),
|
|
69
|
+
verificationId: z.string(),
|
|
70
|
+
}),
|
|
71
|
+
]);
|
|
57
72
|
// ====== Experience API payload guard and types definitions end ======
|
|
58
73
|
/**
|
|
59
74
|
* Legacy interaction identifier payload guard
|
|
@@ -158,6 +173,7 @@ export const bindMfaPayloadGuard = z.discriminatedUnion('type', [
|
|
|
158
173
|
bindWebAuthnPayloadGuard,
|
|
159
174
|
bindBackupCodePayloadGuard,
|
|
160
175
|
]);
|
|
176
|
+
/** @deprecated Legacy interaction API use only */
|
|
161
177
|
export const totpVerificationPayloadGuard = bindTotpPayloadGuard;
|
|
162
178
|
export const webAuthnVerificationPayloadGuard = bindWebAuthnPayloadGuard
|
|
163
179
|
.omit({ response: true })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MfaFactor } from '../../foundations/index.js';
|
|
1
|
+
import { type VerificationType, type MfaFactor } from '../../foundations/index.js';
|
|
2
2
|
import type { InteractionEvent } from '../interactions.js';
|
|
3
3
|
export type Prefix = 'Interaction';
|
|
4
4
|
export declare const prefix: Prefix;
|
|
@@ -8,7 +8,8 @@ export declare enum Field {
|
|
|
8
8
|
Identifier = "Identifier",
|
|
9
9
|
Profile = "Profile",
|
|
10
10
|
BindMfa = "BindMfa",
|
|
11
|
-
Mfa = "Mfa"
|
|
11
|
+
Mfa = "Mfa",
|
|
12
|
+
Verification = "Verification"
|
|
12
13
|
}
|
|
13
14
|
/** Method to verify the identifier */
|
|
14
15
|
export declare enum Method {
|
|
@@ -66,4 +67,4 @@ export declare enum Action {
|
|
|
66
67
|
* - When {@link Method} is `VerificationCode`, {@link Action} can be `Create` (generate and send a code) or `Submit` (verify and submit to the identifiers);
|
|
67
68
|
* - Otherwise, {@link Action} is fixed to `Submit` (other methods can be verified on submitting).
|
|
68
69
|
*/
|
|
69
|
-
export type LogKey = `${Prefix}.${Action.Create | Action.End}` | `${Prefix}.${InteractionEvent}.${Action.Update | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.Profile}.${Action.Update | Action.Create | Action.Delete}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Exclude<Method, Method.Password>}.${Action.Create | Action.Submit}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Method.Password}.${Action.Submit}` | `${Prefix}.${InteractionEvent.ForgotPassword}.${Field.Identifier}.${Method.VerificationCode}.${Action.Create | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.BindMfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent.SignIn}.${Field.Mfa}.${MfaFactor}.${Action.Submit | Action.Create}`;
|
|
70
|
+
export type LogKey = `${Prefix}.${Action.Create | Action.End}` | `${Prefix}.${InteractionEvent}.${Action.Create | Action.Update | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.Profile}.${Action.Update | Action.Create | Action.Delete}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Exclude<Method, Method.Password>}.${Action.Create | Action.Submit}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Method.Password}.${Action.Submit}` | `${Prefix}.${InteractionEvent.ForgotPassword}.${Field.Identifier}.${Method.VerificationCode}.${Action.Create | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.BindMfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent.SignIn}.${Field.Mfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent}.${Field.Verification}.${VerificationType}.${Action}` | `${Prefix}.${InteractionEvent}.${Field.Identifier}.${Action.Submit}`;
|