@logto/schemas 1.17.0 → 1.19.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.18.0-1717567857-social-sign-in-linking.ts +18 -0
- package/alterations/1.18.0-1717597875-add-organization-email-domains-table.ts +31 -0
- package/alterations/1.18.0-1717818597-organization-mfa-requirement.ts +18 -0
- package/alterations/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.ts +56 -0
- package/alterations/1.18.0-1718594164-add-agree-to-terms-policy.ts +40 -0
- package/alterations/1.18.0-1718785576-organization-application-relations.ts +37 -0
- package/alterations/1.18.0-1718786576-organization-jit-sso-connectors.ts +31 -0
- package/alterations/1.18.0-1718807616-organization-role-application-relations.ts +34 -0
- package/alterations/1.18.0-1718865814-add-subject-tokens.ts +36 -0
- package/alterations/1.18.0-1719014832-organization-role-types.ts +35 -0
- package/alterations/1.18.0-1719221205-fix-functions.ts +25 -0
- package/alterations/1.18.0-1719312694-custom-ui-assets.ts +18 -0
- 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-js/1.18.0-1717567857-social-sign-in-linking.js +14 -0
- package/alterations-js/1.18.0-1717597875-add-organization-email-domains-table.js +26 -0
- package/alterations-js/1.18.0-1717818597-organization-mfa-requirement.js +14 -0
- package/alterations-js/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.js +51 -0
- package/alterations-js/1.18.0-1718594164-add-agree-to-terms-policy.js +34 -0
- package/alterations-js/1.18.0-1718785576-organization-application-relations.js +32 -0
- package/alterations-js/1.18.0-1718786576-organization-jit-sso-connectors.js +26 -0
- package/alterations-js/1.18.0-1718807616-organization-role-application-relations.js +29 -0
- package/alterations-js/1.18.0-1718865814-add-subject-tokens.js +31 -0
- package/alterations-js/1.18.0-1719014832-organization-role-types.js +31 -0
- package/alterations-js/1.18.0-1719221205-fix-functions.js +20 -0
- package/alterations-js/1.18.0-1719312694-custom-ui-assets.js +14 -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/lib/consts/oidc.d.ts +15 -2
- package/lib/consts/oidc.js +6 -0
- package/lib/consts/subscriptions.d.ts +9 -6
- package/lib/consts/subscriptions.js +8 -5
- 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 +7 -0
- package/lib/db-entries/custom-types.js +8 -0
- package/lib/db-entries/index.d.ts +7 -0
- package/lib/db-entries/index.js +7 -0
- package/lib/db-entries/organization-application-relation.d.ts +20 -0
- package/lib/db-entries/organization-application-relation.js +29 -0
- package/lib/db-entries/organization-jit-email-domain.d.ts +24 -0
- package/lib/db-entries/organization-jit-email-domain.js +29 -0
- package/lib/db-entries/organization-jit-role.d.ts +24 -0
- package/lib/db-entries/organization-jit-role.js +29 -0
- package/lib/db-entries/organization-jit-sso-connector.d.ts +22 -0
- package/lib/db-entries/organization-jit-sso-connector.js +29 -0
- package/lib/db-entries/organization-role-application-relation.d.ts +22 -0
- package/lib/db-entries/organization-role-application-relation.js +33 -0
- package/lib/db-entries/organization-role.d.ts +6 -1
- package/lib/db-entries/organization-role.js +5 -0
- package/lib/db-entries/organization.d.ts +10 -2
- package/lib/db-entries/organization.js +9 -1
- package/lib/db-entries/sign-in-experience.d.ts +11 -3
- package/lib/db-entries/sign-in-experience.js +14 -2
- package/lib/db-entries/subject-token.d.ts +28 -0
- package/lib/db-entries/subject-token.js +50 -0
- package/lib/foundations/jsonb-types/hooks.d.ts +0 -4
- package/lib/foundations/jsonb-types/hooks.js +1 -4
- package/lib/foundations/jsonb-types/oidc-module.d.ts +33 -1
- package/lib/foundations/jsonb-types/oidc-module.js +2 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +47 -0
- package/lib/foundations/jsonb-types/sign-in-experience.js +21 -4
- package/lib/foundations/jsonb-types/users.d.ts +6 -6
- package/lib/foundations/jsonb-types/users.js +2 -2
- package/lib/seeds/application.js +1 -0
- package/lib/seeds/cloud-api.d.ts +1 -1
- package/lib/seeds/sign-in-experience.d.ts +1 -0
- package/lib/seeds/sign-in-experience.js +2 -1
- package/lib/types/application.d.ts +85 -167
- package/lib/types/connector.d.ts +723 -191
- package/lib/types/consent.d.ts +181 -42
- 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 +3 -0
- package/lib/types/index.js +3 -0
- package/lib/types/interactions.d.ts +313 -29
- package/lib/types/interactions.js +92 -9
- package/lib/types/log/interaction.d.ts +4 -3
- package/lib/types/log/interaction.js +1 -0
- package/lib/types/log/token.d.ts +2 -1
- package/lib/types/log/token.js +1 -0
- package/lib/types/logto-config/index.d.ts +277 -242
- package/lib/types/logto-config/jwt-customizer.d.ts +642 -476
- package/lib/types/logto-config/jwt-customizer.js +13 -2
- package/lib/types/logto-config/oidc-provider.d.ts +6 -6
- package/lib/types/mfa.d.ts +16 -16
- package/lib/types/oidc-config.d.ts +2 -1
- package/lib/types/oidc-config.js +1 -0
- package/lib/types/organization.d.ts +12 -3
- package/lib/types/organization.js +4 -1
- package/lib/types/role.d.ts +6 -1
- package/lib/types/role.js +6 -1
- package/lib/types/scope.d.ts +7 -6
- package/lib/types/sign-in-experience.d.ts +997 -0
- package/lib/types/sign-in-experience.js +21 -0
- 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/subject-token.d.ts +12 -0
- package/lib/types/subject-token.js +5 -0
- package/lib/types/system.d.ts +11 -7
- package/lib/types/system.js +4 -0
- package/lib/types/tenant-organization.d.ts +1 -0
- package/lib/types/tenant-organization.js +3 -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/lib/utils/zod.d.ts +1 -1
- 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 +10 -0
- package/tables/organization_application_relations.sql +14 -0
- package/tables/organization_jit_email_domains.sql +13 -0
- package/tables/organization_jit_roles.sql +14 -0
- package/tables/organization_jit_sso_connectors.sql +13 -0
- package/tables/organization_role_application_relations.sql +18 -0
- package/tables/organization_role_user_relations.sql +3 -1
- package/tables/organization_roles.sql +8 -1
- package/tables/organizations.sql +4 -0
- package/tables/sign_in_experiences.sql +5 -0
- package/tables/subject_tokens.sql +16 -0
- package/tables/users.sql +1 -1
- 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.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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { connectorMetadataGuard, googleOneTapConfigGuard, } from '@logto/connector-kit';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { SignInExperiences } from '../db-entries/index.js';
|
|
4
|
+
import { ssoConnectorMetadataGuard } from './sso-connector.js';
|
|
5
|
+
export const fullSignInExperienceGuard = SignInExperiences.guard.extend({
|
|
6
|
+
socialConnectors: connectorMetadataGuard
|
|
7
|
+
.omit({
|
|
8
|
+
description: true,
|
|
9
|
+
configTemplate: true,
|
|
10
|
+
formItems: true,
|
|
11
|
+
readme: true,
|
|
12
|
+
customData: true,
|
|
13
|
+
})
|
|
14
|
+
.array(),
|
|
15
|
+
ssoConnectors: ssoConnectorMetadataGuard.array(),
|
|
16
|
+
forgotPassword: z.object({ phone: z.boolean(), email: z.boolean() }),
|
|
17
|
+
isDevelopmentTenant: z.boolean(),
|
|
18
|
+
googleOneTap: googleOneTapConfigGuard
|
|
19
|
+
.extend({ clientId: z.string(), connectorId: z.string() })
|
|
20
|
+
.optional(),
|
|
21
|
+
});
|
|
@@ -82,10 +82,13 @@ export declare const ssoConnectorProvidersResponseGuard: z.ZodArray<z.ZodObject<
|
|
|
82
82
|
providerType: SsoProviderType;
|
|
83
83
|
}>, "many">;
|
|
84
84
|
export type SsoConnectorProvidersResponse = z.infer<typeof ssoConnectorProvidersResponseGuard>;
|
|
85
|
-
export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
86
|
-
id: z.ZodType<string, z.ZodTypeDef, string>;
|
|
85
|
+
export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
87
86
|
tenantId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
88
|
-
|
|
87
|
+
id: z.ZodType<string, z.ZodTypeDef, string>;
|
|
88
|
+
providerName: z.ZodType<string, z.ZodTypeDef, string>;
|
|
89
|
+
connectorName: z.ZodType<string, z.ZodTypeDef, string>;
|
|
90
|
+
config: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
|
|
91
|
+
domains: z.ZodType<string[], z.ZodTypeDef, string[]>;
|
|
89
92
|
branding: z.ZodType<{
|
|
90
93
|
displayName?: string | undefined;
|
|
91
94
|
logo?: string | undefined;
|
|
@@ -96,28 +99,24 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
|
96
99
|
darkLogo?: string | undefined;
|
|
97
100
|
}>;
|
|
98
101
|
syncProfile: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
createdAt: z.ZodType<number, z.ZodTypeDef, number>;
|
|
103
|
+
}, {
|
|
101
104
|
providerName: z.ZodNativeEnum<typeof SsoProviderName>;
|
|
102
|
-
|
|
105
|
+
}>, {
|
|
103
106
|
name: z.ZodString;
|
|
104
107
|
providerType: z.ZodNativeEnum<typeof SsoProviderType>;
|
|
105
108
|
providerLogo: z.ZodString;
|
|
106
109
|
providerLogoDark: z.ZodString;
|
|
107
110
|
providerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
-
}
|
|
111
|
+
}>, "strip", z.ZodTypeAny, {
|
|
109
112
|
name: string;
|
|
110
113
|
id: string;
|
|
111
114
|
tenantId: string;
|
|
112
115
|
createdAt: number;
|
|
113
|
-
branding:
|
|
114
|
-
displayName?: string | undefined;
|
|
115
|
-
logo?: string | undefined;
|
|
116
|
-
darkLogo?: string | undefined;
|
|
117
|
-
};
|
|
116
|
+
branding: import("../index.js").SsoBranding;
|
|
118
117
|
syncProfile: boolean;
|
|
119
118
|
config: import("@withtyped/server").JsonObject;
|
|
120
|
-
domains:
|
|
119
|
+
domains: import("../index.js").SsoDomains;
|
|
121
120
|
providerName: SsoProviderName;
|
|
122
121
|
connectorName: string;
|
|
123
122
|
providerType: SsoProviderType;
|
|
@@ -129,14 +128,10 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
|
129
128
|
id: string;
|
|
130
129
|
tenantId: string;
|
|
131
130
|
createdAt: number;
|
|
132
|
-
branding:
|
|
133
|
-
displayName?: string | undefined;
|
|
134
|
-
logo?: string | undefined;
|
|
135
|
-
darkLogo?: string | undefined;
|
|
136
|
-
};
|
|
131
|
+
branding: import("../index.js").SsoBranding;
|
|
137
132
|
syncProfile: boolean;
|
|
138
133
|
config: import("@withtyped/server").JsonObject;
|
|
139
|
-
domains:
|
|
134
|
+
domains: import("../index.js").SsoDomains;
|
|
140
135
|
providerName: SsoProviderName;
|
|
141
136
|
connectorName: string;
|
|
142
137
|
providerType: SsoProviderType;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type LocalePhrase } from '@logto/phrases-experience';
|
|
2
|
+
import { type FullSignInExperience } from './sign-in-experience.js';
|
|
3
|
+
/**
|
|
4
|
+
* The server-side rendering data type for **experience**.
|
|
5
|
+
*/
|
|
6
|
+
export type SsrData = {
|
|
7
|
+
signInExperience: {
|
|
8
|
+
appId?: string;
|
|
9
|
+
organizationId?: string;
|
|
10
|
+
data: FullSignInExperience;
|
|
11
|
+
};
|
|
12
|
+
phrases: {
|
|
13
|
+
lng: string;
|
|
14
|
+
data: LocalePhrase;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Variable placeholder for **experience** server-side rendering. The value should be replaced by
|
|
19
|
+
* the server.
|
|
20
|
+
*
|
|
21
|
+
* CAUTION: The value should be kept in sync with {@link file://./../../../experience/src/index.html}.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link SsrData} for the data structure to replace the placeholders.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ssrPlaceholder = "\"__LOGTO_SSR__\"";
|
package/lib/types/ssr.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variable placeholder for **experience** server-side rendering. The value should be replaced by
|
|
3
|
+
* the server.
|
|
4
|
+
*
|
|
5
|
+
* CAUTION: The value should be kept in sync with {@link file://./../../../experience/src/index.html}.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link SsrData} for the data structure to replace the placeholders.
|
|
8
|
+
*/
|
|
9
|
+
export const ssrPlaceholder = '"__LOGTO_SSR__"';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type z } from 'zod';
|
|
2
|
+
export declare const subjectTokenResponseGuard: z.ZodObject<{
|
|
3
|
+
subjectToken: z.ZodString;
|
|
4
|
+
expiresIn: z.ZodNumber;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
subjectToken: string;
|
|
7
|
+
expiresIn: number;
|
|
8
|
+
}, {
|
|
9
|
+
subjectToken: string;
|
|
10
|
+
expiresIn: number;
|
|
11
|
+
}>;
|
|
12
|
+
export type SubjectTokenResponse = z.infer<typeof subjectTokenResponseGuard>;
|
package/lib/types/system.d.ts
CHANGED
|
@@ -46,17 +46,17 @@ export declare const storageProviderDataGuard: z.ZodDiscriminatedUnion<"provider
|
|
|
46
46
|
bucket: string;
|
|
47
47
|
accessKeyId: string;
|
|
48
48
|
accessSecretKey: string;
|
|
49
|
+
region?: string | undefined;
|
|
49
50
|
publicUrl?: string | undefined;
|
|
50
51
|
endpoint?: string | undefined;
|
|
51
|
-
region?: string | undefined;
|
|
52
52
|
}, {
|
|
53
53
|
provider: StorageProvider.S3Storage;
|
|
54
54
|
bucket: string;
|
|
55
55
|
accessKeyId: string;
|
|
56
56
|
accessSecretKey: string;
|
|
57
|
+
region?: string | undefined;
|
|
57
58
|
publicUrl?: string | undefined;
|
|
58
59
|
endpoint?: string | undefined;
|
|
59
|
-
region?: string | undefined;
|
|
60
60
|
}>, z.ZodObject<{
|
|
61
61
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
62
62
|
provider: z.ZodLiteral<StorageProvider.GoogleStorage>;
|
|
@@ -78,10 +78,14 @@ export declare const storageProviderDataGuard: z.ZodDiscriminatedUnion<"provider
|
|
|
78
78
|
}>]>;
|
|
79
79
|
export type StorageProviderData = z.infer<typeof storageProviderDataGuard>;
|
|
80
80
|
export declare enum StorageProviderKey {
|
|
81
|
-
StorageProvider = "storageProvider"
|
|
81
|
+
StorageProvider = "storageProvider",
|
|
82
|
+
ExperienceBlobsProvider = "experienceBlobsProvider",
|
|
83
|
+
ExperienceZipsProvider = "experienceZipsProvider"
|
|
82
84
|
}
|
|
83
85
|
export type StorageProviderType = {
|
|
84
86
|
[StorageProviderKey.StorageProvider]: StorageProviderData;
|
|
87
|
+
[StorageProviderKey.ExperienceBlobsProvider]: StorageProviderData;
|
|
88
|
+
[StorageProviderKey.ExperienceZipsProvider]: StorageProviderData;
|
|
85
89
|
};
|
|
86
90
|
export declare const storageProviderGuard: Readonly<{
|
|
87
91
|
[key in StorageProviderKey]: ZodType<StorageProviderType[key]>;
|
|
@@ -96,17 +100,17 @@ export declare const sendgridEmailServiceConfigGuard: z.ZodObject<{
|
|
|
96
100
|
fromName: z.ZodString;
|
|
97
101
|
fromEmail: z.ZodString;
|
|
98
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
fromEmail: string;
|
|
99
104
|
provider: EmailServiceProvider;
|
|
100
105
|
apiKey: string;
|
|
101
106
|
templateId: string;
|
|
102
107
|
fromName: string;
|
|
103
|
-
fromEmail: string;
|
|
104
108
|
}, {
|
|
109
|
+
fromEmail: string;
|
|
105
110
|
provider: EmailServiceProvider;
|
|
106
111
|
apiKey: string;
|
|
107
112
|
templateId: string;
|
|
108
113
|
fromName: string;
|
|
109
|
-
fromEmail: string;
|
|
110
114
|
}>;
|
|
111
115
|
export type SendgridEmailServiceConfig = z.infer<typeof sendgridEmailServiceConfigGuard>;
|
|
112
116
|
export declare const emailServiceConfigGuard: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
@@ -116,17 +120,17 @@ export declare const emailServiceConfigGuard: z.ZodDiscriminatedUnion<"provider"
|
|
|
116
120
|
fromName: z.ZodString;
|
|
117
121
|
fromEmail: z.ZodString;
|
|
118
122
|
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
fromEmail: string;
|
|
119
124
|
provider: EmailServiceProvider;
|
|
120
125
|
apiKey: string;
|
|
121
126
|
templateId: string;
|
|
122
127
|
fromName: string;
|
|
123
|
-
fromEmail: string;
|
|
124
128
|
}, {
|
|
129
|
+
fromEmail: string;
|
|
125
130
|
provider: EmailServiceProvider;
|
|
126
131
|
apiKey: string;
|
|
127
132
|
templateId: string;
|
|
128
133
|
fromName: string;
|
|
129
|
-
fromEmail: string;
|
|
130
134
|
}>]>;
|
|
131
135
|
export type EmailServiceConfig = z.infer<typeof emailServiceConfigGuard>;
|
|
132
136
|
export declare enum EmailServiceProviderKey {
|
package/lib/types/system.js
CHANGED
|
@@ -47,9 +47,13 @@ export const storageProviderDataGuard = z.discriminatedUnion('provider', [
|
|
|
47
47
|
export var StorageProviderKey;
|
|
48
48
|
(function (StorageProviderKey) {
|
|
49
49
|
StorageProviderKey["StorageProvider"] = "storageProvider";
|
|
50
|
+
StorageProviderKey["ExperienceBlobsProvider"] = "experienceBlobsProvider";
|
|
51
|
+
StorageProviderKey["ExperienceZipsProvider"] = "experienceZipsProvider";
|
|
50
52
|
})(StorageProviderKey || (StorageProviderKey = {}));
|
|
51
53
|
export const storageProviderGuard = Object.freeze({
|
|
52
54
|
[StorageProviderKey.StorageProvider]: storageProviderDataGuard,
|
|
55
|
+
[StorageProviderKey.ExperienceBlobsProvider]: storageProviderDataGuard,
|
|
56
|
+
[StorageProviderKey.ExperienceZipsProvider]: storageProviderDataGuard,
|
|
53
57
|
});
|
|
54
58
|
// Email service provider
|
|
55
59
|
export var EmailServiceProvider;
|
|
@@ -98,6 +98,7 @@ export declare enum TenantRole {
|
|
|
98
98
|
* id: 'collaborator',
|
|
99
99
|
* name: 'collaborator',
|
|
100
100
|
* description: 'Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings.',
|
|
101
|
+
* type: RoleType.User,
|
|
101
102
|
* });
|
|
102
103
|
* ```
|
|
103
104
|
*
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This module provides utilities to manage tenant organizations.
|
|
8
8
|
*/
|
|
9
|
+
import { RoleType, } from '../db-entries/index.js';
|
|
9
10
|
import { adminTenantId } from '../seeds/tenant.js';
|
|
10
11
|
/** Given a tenant ID, return the corresponding organization ID in the admin tenant. */
|
|
11
12
|
export const getTenantOrganizationId = (tenantId) => `t-${tenantId}`;
|
|
@@ -129,6 +130,7 @@ const tenantRoleDescriptions = Object.freeze({
|
|
|
129
130
|
* id: 'collaborator',
|
|
130
131
|
* name: 'collaborator',
|
|
131
132
|
* description: 'Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings.',
|
|
133
|
+
* type: RoleType.User,
|
|
132
134
|
* });
|
|
133
135
|
* ```
|
|
134
136
|
*
|
|
@@ -139,6 +141,7 @@ export const getTenantRole = (role) => Object.freeze({
|
|
|
139
141
|
id: role,
|
|
140
142
|
name: role,
|
|
141
143
|
description: tenantRoleDescriptions[role],
|
|
144
|
+
type: RoleType.User,
|
|
142
145
|
});
|
|
143
146
|
/**
|
|
144
147
|
* The dictionary of tenant roles and their corresponding scopes.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const maxUploadFileSize: number;
|
|
3
|
-
export declare const allowUploadMimeTypes: readonly ["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp"];
|
|
4
|
-
declare const allowUploadMimeTypeGuard: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp"]>;
|
|
3
|
+
export declare const allowUploadMimeTypes: readonly ["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp", "application/zip"];
|
|
4
|
+
declare const allowUploadMimeTypeGuard: z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp", "application/zip"]>;
|
|
5
5
|
export type AllowedUploadMimeType = z.infer<typeof allowUploadMimeTypeGuard>;
|
|
6
6
|
export declare const userAssetsServiceStatusGuard: z.ZodObject<{
|
|
7
7
|
status: z.ZodUnion<[z.ZodLiteral<"ready">, z.ZodLiteral<"not_configured">]>;
|
|
8
|
-
allowUploadMimeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp"]>, "many">>;
|
|
8
|
+
allowUploadMimeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["image/jpeg", "image/png", "image/gif", "image/vnd.microsoft.icon", "image/x-icon", "image/svg+xml", "image/tiff", "image/webp", "image/bmp", "application/zip"]>, "many">>;
|
|
9
9
|
maxUploadFileSize: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
11
|
status: "ready" | "not_configured";
|
|
12
|
-
allowUploadMimeTypes?: ("image/jpeg" | "image/png" | "image/gif" | "image/vnd.microsoft.icon" | "image/x-icon" | "image/svg+xml" | "image/tiff" | "image/webp" | "image/bmp")[] | undefined;
|
|
12
|
+
allowUploadMimeTypes?: ("image/jpeg" | "image/png" | "image/gif" | "image/vnd.microsoft.icon" | "image/x-icon" | "image/svg+xml" | "image/tiff" | "image/webp" | "image/bmp" | "application/zip")[] | undefined;
|
|
13
13
|
maxUploadFileSize?: number | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
status: "ready" | "not_configured";
|
|
16
|
-
allowUploadMimeTypes?: ("image/jpeg" | "image/png" | "image/gif" | "image/vnd.microsoft.icon" | "image/x-icon" | "image/svg+xml" | "image/tiff" | "image/webp" | "image/bmp")[] | undefined;
|
|
16
|
+
allowUploadMimeTypes?: ("image/jpeg" | "image/png" | "image/gif" | "image/vnd.microsoft.icon" | "image/x-icon" | "image/svg+xml" | "image/tiff" | "image/webp" | "image/bmp" | "application/zip")[] | undefined;
|
|
17
17
|
maxUploadFileSize?: number | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export type UserAssetsServiceStatus = z.infer<typeof userAssetsServiceStatusGuard>;
|
|
@@ -25,4 +25,24 @@ export declare const userAssetsGuard: z.ZodObject<{
|
|
|
25
25
|
url: string;
|
|
26
26
|
}>;
|
|
27
27
|
export type UserAssets = z.infer<typeof userAssetsGuard>;
|
|
28
|
+
export declare const uploadFileGuard: z.ZodObject<{
|
|
29
|
+
filepath: z.ZodString;
|
|
30
|
+
mimetype: z.ZodString;
|
|
31
|
+
originalFilename: z.ZodString;
|
|
32
|
+
size: z.ZodNumber;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
filepath: string;
|
|
35
|
+
mimetype: string;
|
|
36
|
+
originalFilename: string;
|
|
37
|
+
size: number;
|
|
38
|
+
}, {
|
|
39
|
+
filepath: string;
|
|
40
|
+
mimetype: string;
|
|
41
|
+
originalFilename: string;
|
|
42
|
+
size: number;
|
|
43
|
+
}>;
|
|
44
|
+
type MimeTypeToFileExtensionMappings = {
|
|
45
|
+
[key in AllowedUploadMimeType]: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
export declare const mimeTypeToFileExtensionMappings: MimeTypeToFileExtensionMappings;
|
|
28
48
|
export {};
|
package/lib/types/user-assets.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const maxUploadFileSize =
|
|
2
|
+
export const maxUploadFileSize = 20 * 1024 * 1024; // 20 MB
|
|
3
3
|
// Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
|
|
4
4
|
export const allowUploadMimeTypes = [
|
|
5
5
|
'image/jpeg',
|
|
@@ -11,6 +11,7 @@ export const allowUploadMimeTypes = [
|
|
|
11
11
|
'image/tiff',
|
|
12
12
|
'image/webp',
|
|
13
13
|
'image/bmp',
|
|
14
|
+
'application/zip',
|
|
14
15
|
];
|
|
15
16
|
const allowUploadMimeTypeGuard = z.enum(allowUploadMimeTypes);
|
|
16
17
|
export const userAssetsServiceStatusGuard = z.object({
|
|
@@ -21,3 +22,21 @@ export const userAssetsServiceStatusGuard = z.object({
|
|
|
21
22
|
export const userAssetsGuard = z.object({
|
|
22
23
|
url: z.string(),
|
|
23
24
|
});
|
|
25
|
+
export const uploadFileGuard = z.object({
|
|
26
|
+
filepath: z.string(),
|
|
27
|
+
mimetype: z.string(),
|
|
28
|
+
originalFilename: z.string(),
|
|
29
|
+
size: z.number(),
|
|
30
|
+
});
|
|
31
|
+
export const mimeTypeToFileExtensionMappings = Object.freeze({
|
|
32
|
+
'image/jpeg': ['jpeg', 'jpg'],
|
|
33
|
+
'image/png': ['png'],
|
|
34
|
+
'image/gif': ['gif'],
|
|
35
|
+
'image/vnd.microsoft.icon': ['ico'],
|
|
36
|
+
'image/x-icon': ['ico'],
|
|
37
|
+
'image/svg+xml': ['svg'],
|
|
38
|
+
'image/tiff': ['tif', 'tiff'],
|
|
39
|
+
'image/webp': ['webp'],
|
|
40
|
+
'image/bmp': ['bmp'],
|
|
41
|
+
'application/zip': ['zip'],
|
|
42
|
+
});
|