@logto/schemas 1.14.0 → 1.16.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.
Files changed (357) hide show
  1. package/alterations/1.0.0-1677208902-update-admin-console-config.ts +2 -2
  2. package/alterations/1.0.0-1677765137-seed-for-admin-tenant.ts +2 -2
  3. package/alterations/1.0.0-1677907982-allow-admin-create-multiple-tenants.ts +1 -1
  4. package/alterations/1.0.0-1678157950-privacy-policy-url.ts +1 -1
  5. package/alterations/1.0.0-1678199795-add-verification-status-table.ts +2 -2
  6. package/alterations/1.0.0-1678259693-remove-branding-style-config.ts +2 -2
  7. package/alterations/1.0.0-1678269972-use-restrictive-policies.ts +2 -2
  8. package/alterations/1.0.0-1678284778-restrict-internal-roles.ts +1 -1
  9. package/alterations/1.0.0-1678425761-m2m-app-for-tenants.ts +1 -1
  10. package/alterations/1.0.0-1678450233-support-custom-content.ts +1 -1
  11. package/alterations/1.0.0-1678716747-service-logs.ts +2 -2
  12. package/alterations/1.0.0-1678928481-remove-deprecated-logto-config-item.ts +2 -2
  13. package/alterations/1.0.0-1678953179-update-get-started-task-config.ts +2 -2
  14. package/alterations/1.0.0-1679209413-drop-connector-database-storage.ts +1 -1
  15. package/alterations/1.0.0_beta.10-1-logto-config.ts +1 -1
  16. package/alterations/1.0.0_beta.10-1663923211-machine-to-machine-app.ts +1 -1
  17. package/alterations/1.0.0_beta.10-1664265197-custom-phrases.ts +1 -1
  18. package/alterations/1.0.0_beta.11-1664347703-rename-language-key-to-tag.ts +1 -1
  19. package/alterations/1.0.0_beta.11-1664356000-add-created-at-column-to-users.ts +1 -1
  20. package/alterations/1.0.0_beta.11-1664462389-correct-user-created-at-column-by-user-logs.ts +1 -1
  21. package/alterations/1.0.0_beta.14-1665300135-sign-in-sign-up.ts +1 -1
  22. package/alterations/1.0.0_beta.14-1667283640-remove-forgot-password.ts +1 -1
  23. package/alterations/1.0.0_beta.14-1667292082-remove-sign-in-method.ts +1 -1
  24. package/alterations/1.0.0_beta.14-1667374974-user-suspend.ts +1 -1
  25. package/alterations/1.0.0_beta.14-1667900481-add-passcode-type-continue.ts +1 -1
  26. package/alterations/1.0.0_beta.18-1668666590-support-multiple-connector-instances.ts +1 -1
  27. package/alterations/1.0.0_beta.18-1668666600-remove-connector-enabled.ts +1 -1
  28. package/alterations/1.0.0_beta.18-1669091623-roles-and-scopes.ts +1 -1
  29. package/alterations/1.0.0_beta.18-1669702299-sign-up.ts +2 -2
  30. package/alterations/1.0.0_beta.18-1671039448-add-user-name-index.ts +1 -1
  31. package/alterations/1.0.0_beta.18-1671080370-terms-of-use.ts +2 -2
  32. package/alterations/1.0.0_beta.18-1671336831-refactor-log-types.ts +1 -1
  33. package/alterations/1.0.0_beta.18-1671509870-hooks.ts +1 -1
  34. package/alterations/1.0.0_beta.18-1672119200-align-passcode-type-with-message-type.ts +1 -1
  35. package/alterations/1.0.0_rc.0-1672815959-user-roles.ts +1 -1
  36. package/alterations/1.0.0_rc.0-1672820345-scope-resource-id.ts +1 -1
  37. package/alterations/1.0.0_rc.0-1672901841-roles-and-scopes-not-null.ts +1 -1
  38. package/alterations/1.0.0_rc.0-1673001922-support-generic-passcode.ts +1 -1
  39. package/alterations/1.0.0_rc.0-1673165463-scope-name-index.ts +1 -1
  40. package/alterations/1.0.0_rc.0-1673349501-sms-sign-in-identifier-to-phone.ts +1 -1
  41. package/alterations/1.0.0_rc.0-1673465463-ac-scope-name.ts +1 -1
  42. package/alterations/1.0.0_rc.0-1673853579-ac-default-scope.ts +1 -1
  43. package/alterations/1.0.0_rc.0-1673863835-ac-scope-role.ts +1 -1
  44. package/alterations/1.0.0_rc.0-1673882867-fix-alteration-issues.ts +1 -1
  45. package/alterations/1.0.0_rc.0-1673940577-scope-description-not-null.ts +1 -1
  46. package/alterations/1.0.0_rc.0-1673941897-application-roles.ts +1 -1
  47. package/alterations/1.0.0_rc.0-1674032095.1-dedup-resources-constraint.ts +1 -1
  48. package/alterations/1.0.0_rc.0-1674032095.2-oidc-model-pkey.ts +1 -1
  49. package/alterations/1.0.0_rc.0-1674032095.3-tenant-table.ts +1 -1
  50. package/alterations/1.0.0_rc.0-1674032095.4-add-id-column.ts +1 -1
  51. package/alterations/1.0.0_rc.0-1674032095.5-multi-tenancy.ts +6 -7
  52. package/alterations/1.0.0_rc.0-1674032095.6-add-tenant-id-trigger.ts +1 -1
  53. package/alterations/1.0.0_rc.0-1674987042-drop-settings-and-create-systems.ts +1 -1
  54. package/alterations/1.0.0_rc.0-1675316731-update-seed-data.ts +1 -1
  55. package/alterations/1.0.0_rc.1-1675788753-multi-tenancy-rls.ts +3 -4
  56. package/alterations/1.0.0_rc.1-1676115897-add-admin-tenant.ts +3 -4
  57. package/alterations/1.0.0_rc.1-1676185899-fix-logs-index.ts +1 -1
  58. package/alterations/1.0.0_rc.1-1676190092-migrate-admin-data.ts +2 -2
  59. package/alterations/1.0.0_rc.1-1676823841-update-sie-primary-key.ts +1 -1
  60. package/alterations/1.0.0_rc.1-1676874936-support-custom-css.ts +1 -1
  61. package/alterations/1.0.0_rc.1-1676886855-connector-database-read-write.ts +1 -1
  62. package/alterations/1.0.0_rc.1-1676906977-remove-demo-app.ts +1 -1
  63. package/alterations/1.0.0_rc.1-1676956206-move-console-sie-to-database.ts +1 -1
  64. package/alterations/1.0.0_rc.1-1677059985-move-console-application-to-database.ts +1 -1
  65. package/alterations/1.10.1-1695647183-update-private-key-type.ts +2 -2
  66. package/alterations/1.10.1-1696657546-organization-tables.ts +1 -1
  67. package/alterations/1.10.1-1697683802-add-sso-connectors-table.ts +1 -1
  68. package/alterations/1.10.1-1698646271-add-organization-created-flag.ts +2 -2
  69. package/alterations/1.10.1-1698820410-add-user-sso-identities-table.ts +1 -1
  70. package/alterations/1.10.1-1698910485-user-logto-data.ts +1 -1
  71. package/alterations/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts +1 -1
  72. package/alterations/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts +1 -1
  73. package/alterations/1.12.0-1700031616-update-org-role-foreign-keys.ts +1 -1
  74. package/alterations/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.ts +1 -1
  75. package/alterations/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.ts +1 -1
  76. package/alterations/1.13.0-1702274830-add-new-third-party-column-to-applications-table.ts +1 -1
  77. package/alterations/1.13.0-1702372401-add-application-permissions-tables.ts +1 -1
  78. package/alterations/1.13.0-1702544178-sync-tenant-orgs.ts +1 -1
  79. package/alterations/1.13.0-1702871078-protected-application-type.ts +1 -1
  80. package/alterations/1.13.0-1702877515-protected-app-configs.ts +1 -1
  81. package/alterations/1.13.0-1702978120-application-sign-in-experience-table.ts +1 -1
  82. package/alterations/1.13.0-1703229996-daily-token-usage.ts +1 -1
  83. package/alterations/1.13.0-1703230000-update-tenant-roles.ts +1 -1
  84. package/alterations/1.13.0-1704692973-remove-legacy-resources.ts +1 -1
  85. package/alterations/1.13.0-1704934999-add-magic-links-table.ts +1 -1
  86. package/alterations/1.13.0-1704935001-add-organization-invitation-tables.ts +1 -1
  87. package/alterations/1.13.0-1705288654-add-application-user-consent-organizations-table.ts +1 -1
  88. package/alterations/1.13.0-1705991158-update-invitation-indices.ts +1 -1
  89. package/alterations/1.13.0-1706449174-update-organization-invitation-column.ts +1 -1
  90. package/alterations/1.13.0-1706510290-protected-app-host-index.ts +1 -1
  91. package/alterations/1.13.0-1706512952-restore-get-started-page.ts +1 -1
  92. package/alterations/1.13.0-1706528755-remove-magic-links.ts +1 -1
  93. package/alterations/1.13.0-1706585206-protected-app-custom-domain-unique.ts +1 -1
  94. package/alterations/1.13.1-1707360939-grant-is-suspended-read-permission.ts +1 -1
  95. package/alterations/1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.ts +1 -1
  96. package/alterations/1.14.0-1709190131-enhance-dau-data-accuracy.ts +1 -1
  97. package/alterations/1.15.0-1709521416-user-password-encrypt-method.ts +36 -0
  98. package/alterations/1.15.0-1709528944-regenerate-dau-data.ts +49 -0
  99. package/alterations/1.15.0-1710223946-add-fetch-custom-jwt-cloud-scope.ts +92 -0
  100. package/alterations/1.15.0-1710408335-make-resource-scopes-description-nullable.ts +22 -0
  101. package/alterations/1.15.0-1710859622-add-oidc-standard-claim-properties.ts +38 -0
  102. package/alterations/1.15.0-1711607772-remove-invite-member-scope-from-tenant-member-role.ts +20 -0
  103. package/alterations/1.15.0-1711624564-add-read-member-scope-to-tenant-roles.ts +25 -0
  104. package/alterations/1.15.0-1711955211-organization-resource-scope.ts +39 -0
  105. package/alterations/1.15.0-1712041436-rename-organization-member-role-to-collaborator.ts +28 -0
  106. package/alterations/1.15.0-1712545011-fix-organization-resource-scope.ts +43 -0
  107. package/alterations/1.15.0-1712559358-fix-down-organization-resource-scope.ts +46 -0
  108. package/alterations/1.16.0-1712912361-delete-jwt-customier-with-empty-script.ts +23 -0
  109. package/alterations/1.16.0-1713942039-add-organization-custom-data.ts +25 -0
  110. package/alterations/1.16.0-1714270244-application-org-resource-scope.ts +32 -0
  111. package/alterations/1.2.0-1681267285-fix-get-started-passwordless-status.ts +1 -1
  112. package/alterations/1.3.0-1683292832-update-hooks.ts +1 -1
  113. package/alterations/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.ts +1 -1
  114. package/alterations/1.5.0-1684739802-create-hook-id-index-for-logs.ts +1 -1
  115. package/alterations/1.5.0-1684822341-init-domains.ts +2 -2
  116. package/alterations/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.ts +1 -1
  117. package/alterations/1.5.0-1685285719-support-default-resource.ts +1 -1
  118. package/alterations/1.6.0-1685691718-domain-unique.ts +1 -1
  119. package/alterations/1.7.0-1688375200-sync-cloud-m2m-to-logto-config.ts +1 -1
  120. package/alterations/1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.ts +1 -1
  121. package/alterations/1.7.0-1688627407-daily-active-users.ts +1 -1
  122. package/alterations/1.8.0-1692088012-add-is-suspend-column-to-tenants-table.ts +1 -1
  123. package/alterations/1.8.0-1692194751-add-affiliate-scopes.ts +1 -1
  124. package/alterations/1.9.0-1693554904-add-possword-policy.ts +1 -1
  125. package/alterations/1.9.0-1694399696-add-type-col-to-roles-table.ts +1 -1
  126. package/alterations/1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.ts +1 -1
  127. package/alterations/1.9.0-1694484927-remove-deprecated-challenge-flag.ts +2 -2
  128. package/alterations/1.9.0-1694487524-sie-mfa.ts +1 -1
  129. package/alterations/1.9.0-1694509714-keep-existing-password-policy.ts +1 -1
  130. package/alterations/1.9.0-1694746763-user-verifications.ts +1 -1
  131. package/alterations/1.9.2-1694854226-init-sentinel.ts +1 -1
  132. package/alterations/1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts +1 -1
  133. package/alterations/utils/1704934999-tables.ts +1 -1
  134. package/alterations-js/1.0.0-1677208902-update-admin-console-config.js +1 -1
  135. package/alterations-js/1.0.0-1677765137-seed-for-admin-tenant.js +1 -1
  136. package/alterations-js/1.0.0-1677907982-allow-admin-create-multiple-tenants.js +1 -1
  137. package/alterations-js/1.0.0-1678157950-privacy-policy-url.js +1 -1
  138. package/alterations-js/1.0.0-1678199795-add-verification-status-table.js +1 -1
  139. package/alterations-js/1.0.0-1678259693-remove-branding-style-config.js +1 -1
  140. package/alterations-js/1.0.0-1678269972-use-restrictive-policies.js +1 -1
  141. package/alterations-js/1.0.0-1678284778-restrict-internal-roles.js +1 -1
  142. package/alterations-js/1.0.0-1678425761-m2m-app-for-tenants.js +1 -1
  143. package/alterations-js/1.0.0-1678450233-support-custom-content.js +1 -1
  144. package/alterations-js/1.0.0-1678716747-service-logs.js +1 -1
  145. package/alterations-js/1.0.0-1678928481-remove-deprecated-logto-config-item.js +1 -1
  146. package/alterations-js/1.0.0-1678953179-update-get-started-task-config.js +1 -1
  147. package/alterations-js/1.0.0-1679209413-drop-connector-database-storage.js +1 -1
  148. package/alterations-js/1.0.0_beta.10-1-logto-config.js +1 -1
  149. package/alterations-js/1.0.0_beta.10-1663923211-machine-to-machine-app.js +1 -1
  150. package/alterations-js/1.0.0_beta.10-1664265197-custom-phrases.js +1 -1
  151. package/alterations-js/1.0.0_beta.11-1664347703-rename-language-key-to-tag.js +1 -1
  152. package/alterations-js/1.0.0_beta.11-1664356000-add-created-at-column-to-users.js +1 -1
  153. package/alterations-js/1.0.0_beta.11-1664462389-correct-user-created-at-column-by-user-logs.js +1 -1
  154. package/alterations-js/1.0.0_beta.14-1665300135-sign-in-sign-up.js +1 -1
  155. package/alterations-js/1.0.0_beta.14-1667283640-remove-forgot-password.js +1 -1
  156. package/alterations-js/1.0.0_beta.14-1667292082-remove-sign-in-method.js +1 -1
  157. package/alterations-js/1.0.0_beta.14-1667374974-user-suspend.js +1 -1
  158. package/alterations-js/1.0.0_beta.14-1667900481-add-passcode-type-continue.js +1 -1
  159. package/alterations-js/1.0.0_beta.18-1668666590-support-multiple-connector-instances.js +1 -1
  160. package/alterations-js/1.0.0_beta.18-1668666600-remove-connector-enabled.js +1 -1
  161. package/alterations-js/1.0.0_beta.18-1669091623-roles-and-scopes.js +1 -1
  162. package/alterations-js/1.0.0_beta.18-1669702299-sign-up.js +1 -1
  163. package/alterations-js/1.0.0_beta.18-1671039448-add-user-name-index.js +1 -1
  164. package/alterations-js/1.0.0_beta.18-1671080370-terms-of-use.js +1 -1
  165. package/alterations-js/1.0.0_beta.18-1671336831-refactor-log-types.js +1 -1
  166. package/alterations-js/1.0.0_beta.18-1671509870-hooks.js +1 -1
  167. package/alterations-js/1.0.0_beta.18-1672119200-align-passcode-type-with-message-type.js +1 -1
  168. package/alterations-js/1.0.0_rc.0-1672815959-user-roles.js +1 -1
  169. package/alterations-js/1.0.0_rc.0-1672820345-scope-resource-id.js +1 -1
  170. package/alterations-js/1.0.0_rc.0-1672901841-roles-and-scopes-not-null.js +1 -1
  171. package/alterations-js/1.0.0_rc.0-1673001922-support-generic-passcode.js +1 -1
  172. package/alterations-js/1.0.0_rc.0-1673165463-scope-name-index.js +1 -1
  173. package/alterations-js/1.0.0_rc.0-1673349501-sms-sign-in-identifier-to-phone.js +1 -1
  174. package/alterations-js/1.0.0_rc.0-1673465463-ac-scope-name.js +1 -1
  175. package/alterations-js/1.0.0_rc.0-1673853579-ac-default-scope.js +1 -1
  176. package/alterations-js/1.0.0_rc.0-1673863835-ac-scope-role.js +1 -1
  177. package/alterations-js/1.0.0_rc.0-1673882867-fix-alteration-issues.js +1 -1
  178. package/alterations-js/1.0.0_rc.0-1673940577-scope-description-not-null.js +1 -1
  179. package/alterations-js/1.0.0_rc.0-1673941897-application-roles.js +1 -1
  180. package/alterations-js/1.0.0_rc.0-1674032095.1-dedup-resources-constraint.js +1 -1
  181. package/alterations-js/1.0.0_rc.0-1674032095.2-oidc-model-pkey.js +1 -1
  182. package/alterations-js/1.0.0_rc.0-1674032095.3-tenant-table.js +1 -1
  183. package/alterations-js/1.0.0_rc.0-1674032095.4-add-id-column.js +1 -1
  184. package/alterations-js/1.0.0_rc.0-1674032095.5-multi-tenancy.js +6 -7
  185. package/alterations-js/1.0.0_rc.0-1674032095.6-add-tenant-id-trigger.js +1 -1
  186. package/alterations-js/1.0.0_rc.0-1674987042-drop-settings-and-create-systems.js +1 -1
  187. package/alterations-js/1.0.0_rc.0-1675316731-update-seed-data.js +1 -1
  188. package/alterations-js/1.0.0_rc.1-1675788753-multi-tenancy-rls.js +2 -3
  189. package/alterations-js/1.0.0_rc.1-1676115897-add-admin-tenant.js +2 -3
  190. package/alterations-js/1.0.0_rc.1-1676185899-fix-logs-index.js +1 -1
  191. package/alterations-js/1.0.0_rc.1-1676190092-migrate-admin-data.js +1 -1
  192. package/alterations-js/1.0.0_rc.1-1676823841-update-sie-primary-key.js +1 -1
  193. package/alterations-js/1.0.0_rc.1-1676874936-support-custom-css.js +1 -1
  194. package/alterations-js/1.0.0_rc.1-1676886855-connector-database-read-write.js +1 -1
  195. package/alterations-js/1.0.0_rc.1-1676906977-remove-demo-app.js +1 -1
  196. package/alterations-js/1.0.0_rc.1-1676956206-move-console-sie-to-database.js +1 -1
  197. package/alterations-js/1.0.0_rc.1-1677059985-move-console-application-to-database.js +1 -1
  198. package/alterations-js/1.10.1-1695647183-update-private-key-type.js +1 -1
  199. package/alterations-js/1.10.1-1696657546-organization-tables.js +1 -1
  200. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.js +1 -1
  201. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.js +1 -1
  202. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.js +1 -1
  203. package/alterations-js/1.10.1-1698910485-user-logto-data.js +1 -1
  204. package/alterations-js/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.js +1 -1
  205. package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.js +1 -1
  206. package/alterations-js/1.12.0-1700031616-update-org-role-foreign-keys.js +1 -1
  207. package/alterations-js/1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.js +1 -1
  208. package/alterations-js/1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.js +1 -1
  209. package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.js +1 -1
  210. package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.js +1 -1
  211. package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.js +1 -1
  212. package/alterations-js/1.13.0-1702871078-protected-application-type.js +1 -1
  213. package/alterations-js/1.13.0-1702877515-protected-app-configs.js +1 -1
  214. package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.js +1 -1
  215. package/alterations-js/1.13.0-1703229996-daily-token-usage.js +1 -1
  216. package/alterations-js/1.13.0-1703230000-update-tenant-roles.js +1 -1
  217. package/alterations-js/1.13.0-1704692973-remove-legacy-resources.js +1 -1
  218. package/alterations-js/1.13.0-1704934999-add-magic-links-table.js +1 -1
  219. package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.js +1 -1
  220. package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.js +1 -1
  221. package/alterations-js/1.13.0-1705991158-update-invitation-indices.js +1 -1
  222. package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.js +1 -1
  223. package/alterations-js/1.13.0-1706510290-protected-app-host-index.js +1 -1
  224. package/alterations-js/1.13.0-1706512952-restore-get-started-page.js +1 -1
  225. package/alterations-js/1.13.0-1706528755-remove-magic-links.js +1 -1
  226. package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.js +1 -1
  227. package/alterations-js/1.13.1-1707360939-grant-is-suspended-read-permission.js +1 -1
  228. package/alterations-js/1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.js +1 -1
  229. package/alterations-js/1.14.0-1709190131-enhance-dau-data-accuracy.js +1 -1
  230. package/alterations-js/1.15.0-1709521416-user-password-encrypt-method.d.ts +3 -0
  231. package/alterations-js/1.15.0-1709521416-user-password-encrypt-method.js +31 -0
  232. package/alterations-js/1.15.0-1709528944-regenerate-dau-data.d.ts +3 -0
  233. package/alterations-js/1.15.0-1709528944-regenerate-dau-data.js +34 -0
  234. package/alterations-js/1.15.0-1710223946-add-fetch-custom-jwt-cloud-scope.d.ts +3 -0
  235. package/alterations-js/1.15.0-1710223946-add-fetch-custom-jwt-cloud-scope.js +52 -0
  236. package/alterations-js/1.15.0-1710408335-make-resource-scopes-description-nullable.d.ts +3 -0
  237. package/alterations-js/1.15.0-1710408335-make-resource-scopes-description-nullable.js +18 -0
  238. package/alterations-js/1.15.0-1710859622-add-oidc-standard-claim-properties.d.ts +3 -0
  239. package/alterations-js/1.15.0-1710859622-add-oidc-standard-claim-properties.js +34 -0
  240. package/alterations-js/1.15.0-1711607772-remove-invite-member-scope-from-tenant-member-role.d.ts +3 -0
  241. package/alterations-js/1.15.0-1711607772-remove-invite-member-scope-from-tenant-member-role.js +16 -0
  242. package/alterations-js/1.15.0-1711624564-add-read-member-scope-to-tenant-roles.d.ts +3 -0
  243. package/alterations-js/1.15.0-1711624564-add-read-member-scope-to-tenant-roles.js +21 -0
  244. package/alterations-js/1.15.0-1711955211-organization-resource-scope.d.ts +3 -0
  245. package/alterations-js/1.15.0-1711955211-organization-resource-scope.js +32 -0
  246. package/alterations-js/1.15.0-1712041436-rename-organization-member-role-to-collaborator.d.ts +3 -0
  247. package/alterations-js/1.15.0-1712041436-rename-organization-member-role-to-collaborator.js +24 -0
  248. package/alterations-js/1.15.0-1712545011-fix-organization-resource-scope.d.ts +8 -0
  249. package/alterations-js/1.15.0-1712545011-fix-organization-resource-scope.js +35 -0
  250. package/alterations-js/1.15.0-1712559358-fix-down-organization-resource-scope.d.ts +8 -0
  251. package/alterations-js/1.15.0-1712559358-fix-down-organization-resource-scope.js +38 -0
  252. package/alterations-js/1.16.0-1712912361-delete-jwt-customier-with-empty-script.d.ts +3 -0
  253. package/alterations-js/1.16.0-1712912361-delete-jwt-customier-with-empty-script.js +17 -0
  254. package/alterations-js/1.16.0-1713942039-add-organization-custom-data.d.ts +4 -0
  255. package/alterations-js/1.16.0-1713942039-add-organization-custom-data.js +17 -0
  256. package/alterations-js/1.16.0-1714270244-application-org-resource-scope.d.ts +3 -0
  257. package/alterations-js/1.16.0-1714270244-application-org-resource-scope.js +27 -0
  258. package/alterations-js/1.2.0-1681267285-fix-get-started-passwordless-status.js +1 -1
  259. package/alterations-js/1.3.0-1683292832-update-hooks.js +1 -1
  260. package/alterations-js/1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.js +1 -1
  261. package/alterations-js/1.5.0-1684739802-create-hook-id-index-for-logs.js +1 -1
  262. package/alterations-js/1.5.0-1684822341-init-domains.js +1 -1
  263. package/alterations-js/1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.js +1 -1
  264. package/alterations-js/1.5.0-1685285719-support-default-resource.js +1 -1
  265. package/alterations-js/1.6.0-1685691718-domain-unique.js +1 -1
  266. package/alterations-js/1.7.0-1688375200-sync-cloud-m2m-to-logto-config.js +1 -1
  267. package/alterations-js/1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.js +1 -1
  268. package/alterations-js/1.7.0-1688627407-daily-active-users.js +1 -1
  269. package/alterations-js/1.8.0-1692088012-add-is-suspend-column-to-tenants-table.js +1 -1
  270. package/alterations-js/1.8.0-1692194751-add-affiliate-scopes.js +1 -1
  271. package/alterations-js/1.9.0-1693554904-add-possword-policy.js +1 -1
  272. package/alterations-js/1.9.0-1694399696-add-type-col-to-roles-table.js +1 -1
  273. package/alterations-js/1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.js +1 -1
  274. package/alterations-js/1.9.0-1694484927-remove-deprecated-challenge-flag.js +1 -1
  275. package/alterations-js/1.9.0-1694487524-sie-mfa.js +1 -1
  276. package/alterations-js/1.9.0-1694509714-keep-existing-password-policy.js +1 -1
  277. package/alterations-js/1.9.0-1694746763-user-verifications.js +1 -1
  278. package/alterations-js/1.9.2-1694854226-init-sentinel.js +1 -1
  279. package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.js +1 -1
  280. package/alterations-js/utils/1704934999-tables.d.ts +1 -1
  281. package/alterations-js/utils/1704934999-tables.js +1 -1
  282. package/lib/consts/experience.d.ts +8 -0
  283. package/lib/consts/experience.js +9 -0
  284. package/lib/consts/index.d.ts +1 -0
  285. package/lib/consts/index.js +1 -0
  286. package/lib/consts/oidc.d.ts +48 -0
  287. package/lib/consts/oidc.js +44 -0
  288. package/lib/consts/subscriptions.d.ts +23 -0
  289. package/lib/consts/subscriptions.js +23 -0
  290. package/lib/db-entries/application-user-consent-organization-resource-scope.d.ts +24 -0
  291. package/lib/db-entries/application-user-consent-organization-resource-scope.js +29 -0
  292. package/lib/db-entries/custom-types.d.ts +5 -1
  293. package/lib/db-entries/custom-types.js +4 -0
  294. package/lib/db-entries/index.d.ts +2 -0
  295. package/lib/db-entries/index.js +2 -0
  296. package/lib/db-entries/organization-role-resource-scope-relation.d.ts +20 -0
  297. package/lib/db-entries/organization-role-resource-scope-relation.js +29 -0
  298. package/lib/db-entries/organization.d.ts +6 -2
  299. package/lib/db-entries/organization.js +5 -0
  300. package/lib/db-entries/scope.d.ts +2 -2
  301. package/lib/db-entries/scope.js +2 -2
  302. package/lib/db-entries/user.d.ts +10 -2
  303. package/lib/db-entries/user.js +9 -1
  304. package/lib/foundations/jsonb-types/hooks.d.ts +71 -3
  305. package/lib/foundations/jsonb-types/hooks.js +98 -7
  306. package/lib/foundations/jsonb-types/index.d.ts +1 -5
  307. package/lib/foundations/jsonb-types/index.js +1 -7
  308. package/lib/foundations/jsonb-types/users.d.ts +103 -6
  309. package/lib/foundations/jsonb-types/users.js +26 -1
  310. package/lib/seeds/cloud-api.d.ts +6 -3
  311. package/lib/seeds/cloud-api.js +6 -2
  312. package/lib/types/alteration.d.ts +1 -1
  313. package/lib/types/application.d.ts +88 -7
  314. package/lib/types/application.js +7 -4
  315. package/lib/types/consent.d.ts +307 -38
  316. package/lib/types/consent.js +11 -7
  317. package/lib/types/hook.d.ts +6 -20
  318. package/lib/types/index.d.ts +2 -1
  319. package/lib/types/index.js +2 -1
  320. package/lib/types/log/index.d.ts +4 -1
  321. package/lib/types/log/index.js +1 -0
  322. package/lib/types/log/jwt-customizer.d.ts +8 -0
  323. package/lib/types/log/jwt-customizer.js +7 -0
  324. package/lib/types/logto-config/index.d.ts +1098 -0
  325. package/lib/types/{logto-config.js → logto-config/index.js} +25 -0
  326. package/lib/types/logto-config/jwt-customizer.d.ts +1726 -0
  327. package/lib/types/logto-config/jwt-customizer.js +92 -0
  328. package/lib/types/logto-config/jwt-customizer.test.d.ts +1 -0
  329. package/lib/types/logto-config/jwt-customizer.test.js +78 -0
  330. package/lib/types/logto-config/oidc-provider.d.ts +67 -0
  331. package/lib/types/logto-config/oidc-provider.js +33 -0
  332. package/lib/types/onboarding.d.ts +144 -0
  333. package/lib/types/onboarding.js +75 -0
  334. package/lib/types/organization.d.ts +17 -5
  335. package/lib/types/organization.js +10 -0
  336. package/lib/types/scope.d.ts +3 -3
  337. package/lib/types/service-log.d.ts +2 -1
  338. package/lib/types/service-log.js +1 -0
  339. package/lib/types/sso-connector.d.ts +16 -2
  340. package/lib/types/sso-connector.js +17 -4
  341. package/lib/types/system.d.ts +30 -3
  342. package/lib/types/system.js +16 -0
  343. package/lib/types/tenant-organization.d.ts +10 -6
  344. package/lib/types/tenant-organization.js +19 -9
  345. package/lib/types/user.d.ts +231 -192
  346. package/lib/types/user.js +5 -1
  347. package/lib/utils/domain.test.js +1 -0
  348. package/lib/utils/zod.d.ts +4 -0
  349. package/lib/utils/zod.js +1 -0
  350. package/package.json +17 -19
  351. package/tables/_functions.sql +8 -0
  352. package/tables/application_user_consent_organization_resource_scopes.sql +18 -0
  353. package/tables/organization_role_resource_scope_relations.sql +12 -0
  354. package/tables/organizations.sql +2 -0
  355. package/tables/scopes.sql +1 -1
  356. package/tables/users.sql +10 -1
  357. package/lib/types/logto-config.d.ts +0 -154
@@ -0,0 +1,92 @@
1
+ import { jsonObjectGuard } from '@logto/connector-kit';
2
+ import { z } from 'zod';
3
+ import { Organizations, Roles, UserSsoIdentities } from '../../db-entries/index.js';
4
+ import { mfaFactorsGuard } from '../../foundations/index.js';
5
+ import { scopeResponseGuard } from '../scope.js';
6
+ import { userInfoGuard } from '../user.js';
7
+ import { accessTokenPayloadGuard, clientCredentialsPayloadGuard } from './oidc-provider.js';
8
+ export const jwtCustomizerGuard = z.object({
9
+ script: z.string(),
10
+ environmentVariables: z.record(z.string()).optional(),
11
+ contextSample: jsonObjectGuard.optional(),
12
+ });
13
+ export var LogtoJwtTokenKeyType;
14
+ (function (LogtoJwtTokenKeyType) {
15
+ LogtoJwtTokenKeyType["AccessToken"] = "access-token";
16
+ LogtoJwtTokenKeyType["ClientCredentials"] = "client-credentials";
17
+ })(LogtoJwtTokenKeyType || (LogtoJwtTokenKeyType = {}));
18
+ export const jwtCustomizerUserContextGuard = userInfoGuard.extend({
19
+ ssoIdentities: UserSsoIdentities.guard
20
+ .pick({ issuer: true, identityId: true, detail: true })
21
+ .array(),
22
+ mfaVerificationFactors: mfaFactorsGuard,
23
+ roles: Roles.guard
24
+ .pick({ id: true, name: true, description: true })
25
+ .extend({
26
+ scopes: scopeResponseGuard
27
+ .pick({ id: true, name: true, description: true, resourceId: true, resource: true })
28
+ .array(),
29
+ })
30
+ .array(),
31
+ organizations: Organizations.guard.pick({ id: true, name: true, description: true }).array(),
32
+ organizationRoles: z
33
+ .object({
34
+ organizationId: z.string(),
35
+ roleId: z.string(),
36
+ roleName: z.string(),
37
+ })
38
+ .array(),
39
+ });
40
+ export const accessTokenJwtCustomizerGuard = jwtCustomizerGuard
41
+ .extend({
42
+ // Use partial token guard since users customization may not rely on all fields.
43
+ tokenSample: accessTokenPayloadGuard.partial().optional(),
44
+ contextSample: z.object({ user: jwtCustomizerUserContextGuard.partial() }).optional(),
45
+ })
46
+ .strict();
47
+ export const clientCredentialsJwtCustomizerGuard = jwtCustomizerGuard
48
+ .extend({
49
+ // Use partial token guard since users customization may not rely on all fields.
50
+ tokenSample: clientCredentialsPayloadGuard.partial().optional(),
51
+ })
52
+ .strict();
53
+ /**
54
+ * This guard is for the core JWT customizer testing API request body guard.
55
+ * Unlike the DB guard
56
+ *
57
+ * - rename the `tokenSample` to `token` and is required for testing.
58
+ * - rename the `contextSample` to `context` and is required for AccessToken testing.
59
+ */
60
+ export const jwtCustomizerTestRequestBodyGuard = z.discriminatedUnion('tokenType', [
61
+ z.object({
62
+ tokenType: z.literal(LogtoJwtTokenKeyType.AccessToken),
63
+ ...accessTokenJwtCustomizerGuard.pick({ environmentVariables: true, script: true }).shape,
64
+ token: accessTokenJwtCustomizerGuard.required().shape.tokenSample,
65
+ context: accessTokenJwtCustomizerGuard.required().shape.contextSample,
66
+ }),
67
+ z.object({
68
+ tokenType: z.literal(LogtoJwtTokenKeyType.ClientCredentials),
69
+ ...clientCredentialsJwtCustomizerGuard.pick({ environmentVariables: true, script: true }).shape,
70
+ token: clientCredentialsJwtCustomizerGuard.required().shape.tokenSample,
71
+ }),
72
+ ]);
73
+ /**
74
+ * This guard is for cloud API use (request body guard).
75
+ * Since the cloud API will be use by both testing and production, should keep the fields as general as possible.
76
+ * The response guard for the cloud API is `jsonObjectGuard` since it extends the `token` with extra claims.
77
+ */
78
+ const commonJwtCustomizerGuard = jwtCustomizerGuard
79
+ .pick({ script: true, environmentVariables: true })
80
+ .required({ script: true })
81
+ .extend({
82
+ token: jsonObjectGuard,
83
+ });
84
+ export const customJwtFetcherGuard = z.discriminatedUnion('tokenType', [
85
+ commonJwtCustomizerGuard.extend({
86
+ tokenType: z.literal(LogtoJwtTokenKeyType.AccessToken),
87
+ context: jsonObjectGuard,
88
+ }),
89
+ commonJwtCustomizerGuard.extend({
90
+ tokenType: z.literal(LogtoJwtTokenKeyType.ClientCredentials),
91
+ }),
92
+ ]);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,78 @@
1
+ import { pick } from '@silverhand/essentials';
2
+ import { describe, expect, it } from 'vitest';
3
+ import { accessTokenJwtCustomizerGuard, clientCredentialsJwtCustomizerGuard, } from './jwt-customizer.js';
4
+ const allFields = ['script', 'environmentVariables', 'contextSample', 'tokenSample'];
5
+ const requiredFields = ['script'];
6
+ const optionalFields = ['environmentVariables', 'contextSample', 'tokenSample'];
7
+ const testClientCredentialsTokenPayload = {
8
+ script: '',
9
+ environmentVariables: {},
10
+ contextSample: {},
11
+ tokenSample: {},
12
+ };
13
+ const testAccessTokenPayload = {
14
+ ...testClientCredentialsTokenPayload,
15
+ contextSample: {
16
+ user: {
17
+ id: '123',
18
+ username: 'foo',
19
+ primaryEmail: 'foo@logto.io',
20
+ primaryPhone: '+1234567890',
21
+ name: 'Foo Bar',
22
+ avatar: 'https://example.com/avatar.png',
23
+ customData: {},
24
+ identities: {},
25
+ profile: {},
26
+ applicationId: 'my-app',
27
+ ssoIdentities: [],
28
+ mfaVerificationFactors: [],
29
+ roles: [],
30
+ organizations: [],
31
+ organizationRoles: [],
32
+ },
33
+ },
34
+ };
35
+ describe('test token sample guard', () => {
36
+ it.each(optionalFields)('should pass guard with any of the optionalFields not specified', (droppedField) => {
37
+ const resultAccessToken = accessTokenJwtCustomizerGuard.safeParse(pick(testAccessTokenPayload, ...allFields.filter((field) => field !== droppedField)));
38
+ if (!resultAccessToken.success) {
39
+ console.log('resultAccessToken.error', resultAccessToken.error);
40
+ }
41
+ expect(resultAccessToken.success).toBe(true);
42
+ const resultClientCredentials = clientCredentialsJwtCustomizerGuard.safeParse(pick(testClientCredentialsTokenPayload, ...allFields.filter((field) => field !== droppedField)));
43
+ if (!resultClientCredentials.success) {
44
+ console.log('resultClientCredentials.error', resultClientCredentials.error);
45
+ }
46
+ expect(resultClientCredentials.success).toBe(true);
47
+ });
48
+ it.each(requiredFields)('should throw when required field is not specified', (droppedField) => {
49
+ const resultAccessToken = accessTokenJwtCustomizerGuard.safeParse(pick(testAccessTokenPayload, ...allFields.filter((field) => field !== droppedField)));
50
+ expect(resultAccessToken.success).toBe(false);
51
+ const resultClientCredentials = clientCredentialsJwtCustomizerGuard.safeParse(pick(testClientCredentialsTokenPayload, ...allFields.filter((field) => field !== droppedField)));
52
+ expect(resultClientCredentials.success).toBe(false);
53
+ });
54
+ it.each(allFields)('should pass partial guard with any of the field not specified', (droppedField) => {
55
+ const resultAccessToken = accessTokenJwtCustomizerGuard
56
+ .partial()
57
+ .safeParse(pick(testAccessTokenPayload, ...allFields.filter((field) => field !== droppedField)));
58
+ expect(resultAccessToken.success).toBe(true);
59
+ const resultClientCredentials = clientCredentialsJwtCustomizerGuard
60
+ .partial()
61
+ .safeParse(pick(testClientCredentialsTokenPayload, ...allFields.filter((field) => field !== droppedField)));
62
+ expect(resultClientCredentials.success).toBe(true);
63
+ });
64
+ it('should throw when unwanted fields presented (access token)', () => {
65
+ const result = accessTokenJwtCustomizerGuard.safeParse({
66
+ ...testAccessTokenPayload,
67
+ abc: 'abc',
68
+ });
69
+ expect(result.success).toBe(false);
70
+ });
71
+ it('should throw when unwanted fields presented (client credentials token)', () => {
72
+ const result = clientCredentialsJwtCustomizerGuard.safeParse({
73
+ ...testClientCredentialsTokenPayload,
74
+ abc: 'abc',
75
+ });
76
+ expect(result.success).toBe(false);
77
+ });
78
+ });
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Manually implement zod guards of some node OIDC provider types.
3
+ *
4
+ * Please note that we defined `accessTokenPayloadGuard` and `clientCredentialsPayloadGuard` in this file, they are used to make the user-defined token
5
+ * sample to be aligned with the real token payload given by the OIDC provider in a real use case.
6
+ *
7
+ * Only keep the least necessary fields in the guards to align with the raw token payload that can be used for `extraTokenClaims` method.
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const accessTokenPayloadGuard: z.ZodObject<{
11
+ accountId: z.ZodString;
12
+ expiresWithSession: z.ZodOptional<z.ZodBoolean>;
13
+ grantId: z.ZodString;
14
+ gty: z.ZodString;
15
+ sessionUid: z.ZodOptional<z.ZodString>;
16
+ sid: z.ZodOptional<z.ZodString>;
17
+ kind: z.ZodLiteral<"AccessToken">;
18
+ jti: z.ZodString;
19
+ aud: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
20
+ scope: z.ZodOptional<z.ZodString>;
21
+ clientId: z.ZodOptional<z.ZodString>;
22
+ }, "strict", z.ZodTypeAny, {
23
+ grantId: string;
24
+ accountId: string;
25
+ gty: string;
26
+ kind: "AccessToken";
27
+ jti: string;
28
+ aud: (string | string[]) & (string | string[] | undefined);
29
+ expiresWithSession?: boolean | undefined;
30
+ sessionUid?: string | undefined;
31
+ sid?: string | undefined;
32
+ scope?: string | undefined;
33
+ clientId?: string | undefined;
34
+ }, {
35
+ grantId: string;
36
+ accountId: string;
37
+ gty: string;
38
+ kind: "AccessToken";
39
+ jti: string;
40
+ aud: (string | string[]) & (string | string[] | undefined);
41
+ expiresWithSession?: boolean | undefined;
42
+ sessionUid?: string | undefined;
43
+ sid?: string | undefined;
44
+ scope?: string | undefined;
45
+ clientId?: string | undefined;
46
+ }>;
47
+ export type AccessTokenPayload = z.infer<typeof accessTokenPayloadGuard>;
48
+ export declare const clientCredentialsPayloadGuard: z.ZodObject<{
49
+ kind: z.ZodLiteral<"ClientCredentials">;
50
+ jti: z.ZodString;
51
+ aud: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
52
+ scope: z.ZodOptional<z.ZodString>;
53
+ clientId: z.ZodOptional<z.ZodString>;
54
+ }, "strict", z.ZodTypeAny, {
55
+ kind: "ClientCredentials";
56
+ jti: string;
57
+ aud: (string | string[]) & (string | string[] | undefined);
58
+ scope?: string | undefined;
59
+ clientId?: string | undefined;
60
+ }, {
61
+ kind: "ClientCredentials";
62
+ jti: string;
63
+ aud: (string | string[]) & (string | string[] | undefined);
64
+ scope?: string | undefined;
65
+ clientId?: string | undefined;
66
+ }>;
67
+ export type ClientCredentialsPayload = z.infer<typeof clientCredentialsPayloadGuard>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Manually implement zod guards of some node OIDC provider types.
3
+ *
4
+ * Please note that we defined `accessTokenPayloadGuard` and `clientCredentialsPayloadGuard` in this file, they are used to make the user-defined token
5
+ * sample to be aligned with the real token payload given by the OIDC provider in a real use case.
6
+ *
7
+ * Only keep the least necessary fields in the guards to align with the raw token payload that can be used for `extraTokenClaims` method.
8
+ */
9
+ import { z } from 'zod';
10
+ const baseTokenPayloadGuardObject = {
11
+ jti: z.string(),
12
+ aud: z.union([z.string(), z.string().array()]),
13
+ scope: z.string().optional(),
14
+ clientId: z.string().optional(),
15
+ };
16
+ export const accessTokenPayloadGuard = z
17
+ .object({
18
+ ...baseTokenPayloadGuardObject,
19
+ accountId: z.string(),
20
+ expiresWithSession: z.boolean().optional(),
21
+ grantId: z.string(),
22
+ gty: z.string(),
23
+ sessionUid: z.string().optional(),
24
+ sid: z.string().optional(),
25
+ kind: z.literal('AccessToken'),
26
+ })
27
+ .strict();
28
+ export const clientCredentialsPayloadGuard = z
29
+ .object({
30
+ ...baseTokenPayloadGuardObject,
31
+ kind: z.literal('ClientCredentials'),
32
+ })
33
+ .strict();
@@ -0,0 +1,144 @@
1
+ import { z } from 'zod';
2
+ export declare const userOnboardingDataKey = "onboarding";
3
+ export declare enum Project {
4
+ Personal = "personal",
5
+ Company = "company"
6
+ }
7
+ /** @deprecated Open-source options was for cloud preview use, no longer needed. Use default `Cloud` value for placeholder. */
8
+ declare enum DeploymentType {
9
+ OpenSource = "open-source",
10
+ Cloud = "cloud"
11
+ }
12
+ /** @deprecated */
13
+ export declare enum Title {
14
+ Developer = "developer",
15
+ TeamLead = "team-lead",
16
+ Ceo = "ceo",
17
+ Cto = "cto",
18
+ Product = "product",
19
+ Others = "others"
20
+ }
21
+ /** @deprecated */
22
+ export declare enum CompanySize {
23
+ Scale1 = "1",
24
+ Scale2 = "2-49",
25
+ Scale3 = "50-199",
26
+ Scale4 = "200-999",
27
+ Scale5 = "1000+"
28
+ }
29
+ /** @deprecated */
30
+ export declare enum Reason {
31
+ Passwordless = "passwordless",
32
+ Efficiency = "efficiency",
33
+ AccessControl = "access-control",
34
+ MultiTenancy = "multi-tenancy",
35
+ Enterprise = "enterprise",
36
+ Others = "others"
37
+ }
38
+ export declare enum Stage {
39
+ NewProduct = "new-product",
40
+ ExistingProduct = "existing-product",
41
+ TargetEnterpriseReady = "target-enterprise-ready"
42
+ }
43
+ export declare enum AdditionalFeatures {
44
+ CustomizeUiAndFlow = "customize-ui-and-flow",
45
+ Compliance = "compliance",
46
+ ExportUserDataFromLogto = "export-user-data-from-logto",
47
+ BudgetControl = "budget-control",
48
+ BringOwnAuth = "bring-own-auth",
49
+ Others = "others"
50
+ }
51
+ declare const questionnaireGuard: z.ZodObject<{
52
+ project: z.ZodOptional<z.ZodNativeEnum<typeof Project>>;
53
+ /** @deprecated Open-source options was for cloud preview use, no longer needed. Use default `Cloud` value for placeholder. */
54
+ deploymentType: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof DeploymentType>>>;
55
+ /** @deprecated */
56
+ titles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Title>, "many">>;
57
+ companyName: z.ZodOptional<z.ZodString>;
58
+ /** @deprecated */
59
+ companySize: z.ZodOptional<z.ZodNativeEnum<typeof CompanySize>>;
60
+ /** @deprecated */
61
+ reasons: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Reason>, "many">>;
62
+ stage: z.ZodOptional<z.ZodNativeEnum<typeof Stage>>;
63
+ additionalFeatures: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof AdditionalFeatures>, "many">>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ deploymentType: DeploymentType;
66
+ project?: Project | undefined;
67
+ titles?: Title[] | undefined;
68
+ companyName?: string | undefined;
69
+ companySize?: CompanySize | undefined;
70
+ reasons?: Reason[] | undefined;
71
+ stage?: Stage | undefined;
72
+ additionalFeatures?: AdditionalFeatures[] | undefined;
73
+ }, {
74
+ project?: Project | undefined;
75
+ deploymentType?: DeploymentType | undefined;
76
+ titles?: Title[] | undefined;
77
+ companyName?: string | undefined;
78
+ companySize?: CompanySize | undefined;
79
+ reasons?: Reason[] | undefined;
80
+ stage?: Stage | undefined;
81
+ additionalFeatures?: AdditionalFeatures[] | undefined;
82
+ }>;
83
+ export type Questionnaire = z.infer<typeof questionnaireGuard>;
84
+ export declare const userOnboardingDataGuard: z.ZodObject<{
85
+ questionnaire: z.ZodOptional<z.ZodObject<{
86
+ project: z.ZodOptional<z.ZodNativeEnum<typeof Project>>;
87
+ /** @deprecated Open-source options was for cloud preview use, no longer needed. Use default `Cloud` value for placeholder. */
88
+ deploymentType: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof DeploymentType>>>;
89
+ /** @deprecated */
90
+ titles: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Title>, "many">>;
91
+ companyName: z.ZodOptional<z.ZodString>;
92
+ /** @deprecated */
93
+ companySize: z.ZodOptional<z.ZodNativeEnum<typeof CompanySize>>;
94
+ /** @deprecated */
95
+ reasons: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Reason>, "many">>;
96
+ stage: z.ZodOptional<z.ZodNativeEnum<typeof Stage>>;
97
+ additionalFeatures: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof AdditionalFeatures>, "many">>;
98
+ }, "strip", z.ZodTypeAny, {
99
+ deploymentType: DeploymentType;
100
+ project?: Project | undefined;
101
+ titles?: Title[] | undefined;
102
+ companyName?: string | undefined;
103
+ companySize?: CompanySize | undefined;
104
+ reasons?: Reason[] | undefined;
105
+ stage?: Stage | undefined;
106
+ additionalFeatures?: AdditionalFeatures[] | undefined;
107
+ }, {
108
+ project?: Project | undefined;
109
+ deploymentType?: DeploymentType | undefined;
110
+ titles?: Title[] | undefined;
111
+ companyName?: string | undefined;
112
+ companySize?: CompanySize | undefined;
113
+ reasons?: Reason[] | undefined;
114
+ stage?: Stage | undefined;
115
+ additionalFeatures?: AdditionalFeatures[] | undefined;
116
+ }>>;
117
+ isOnboardingDone: z.ZodOptional<z.ZodBoolean>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ questionnaire?: {
120
+ deploymentType: DeploymentType;
121
+ project?: Project | undefined;
122
+ titles?: Title[] | undefined;
123
+ companyName?: string | undefined;
124
+ companySize?: CompanySize | undefined;
125
+ reasons?: Reason[] | undefined;
126
+ stage?: Stage | undefined;
127
+ additionalFeatures?: AdditionalFeatures[] | undefined;
128
+ } | undefined;
129
+ isOnboardingDone?: boolean | undefined;
130
+ }, {
131
+ questionnaire?: {
132
+ project?: Project | undefined;
133
+ deploymentType?: DeploymentType | undefined;
134
+ titles?: Title[] | undefined;
135
+ companyName?: string | undefined;
136
+ companySize?: CompanySize | undefined;
137
+ reasons?: Reason[] | undefined;
138
+ stage?: Stage | undefined;
139
+ additionalFeatures?: AdditionalFeatures[] | undefined;
140
+ } | undefined;
141
+ isOnboardingDone?: boolean | undefined;
142
+ }>;
143
+ export type UserOnboardingData = z.infer<typeof userOnboardingDataGuard>;
144
+ export {};
@@ -0,0 +1,75 @@
1
+ import { z } from 'zod';
2
+ export const userOnboardingDataKey = 'onboarding';
3
+ export var Project;
4
+ (function (Project) {
5
+ Project["Personal"] = "personal";
6
+ Project["Company"] = "company";
7
+ })(Project || (Project = {}));
8
+ /** @deprecated Open-source options was for cloud preview use, no longer needed. Use default `Cloud` value for placeholder. */
9
+ var DeploymentType;
10
+ (function (DeploymentType) {
11
+ DeploymentType["OpenSource"] = "open-source";
12
+ DeploymentType["Cloud"] = "cloud";
13
+ })(DeploymentType || (DeploymentType = {}));
14
+ /** @deprecated */
15
+ export var Title;
16
+ (function (Title) {
17
+ Title["Developer"] = "developer";
18
+ Title["TeamLead"] = "team-lead";
19
+ Title["Ceo"] = "ceo";
20
+ Title["Cto"] = "cto";
21
+ Title["Product"] = "product";
22
+ Title["Others"] = "others";
23
+ })(Title || (Title = {}));
24
+ /** @deprecated */
25
+ export var CompanySize;
26
+ (function (CompanySize) {
27
+ CompanySize["Scale1"] = "1";
28
+ CompanySize["Scale2"] = "2-49";
29
+ CompanySize["Scale3"] = "50-199";
30
+ CompanySize["Scale4"] = "200-999";
31
+ CompanySize["Scale5"] = "1000+";
32
+ })(CompanySize || (CompanySize = {}));
33
+ /** @deprecated */
34
+ export var Reason;
35
+ (function (Reason) {
36
+ Reason["Passwordless"] = "passwordless";
37
+ Reason["Efficiency"] = "efficiency";
38
+ Reason["AccessControl"] = "access-control";
39
+ Reason["MultiTenancy"] = "multi-tenancy";
40
+ Reason["Enterprise"] = "enterprise";
41
+ Reason["Others"] = "others";
42
+ })(Reason || (Reason = {}));
43
+ export var Stage;
44
+ (function (Stage) {
45
+ Stage["NewProduct"] = "new-product";
46
+ Stage["ExistingProduct"] = "existing-product";
47
+ Stage["TargetEnterpriseReady"] = "target-enterprise-ready";
48
+ })(Stage || (Stage = {}));
49
+ export var AdditionalFeatures;
50
+ (function (AdditionalFeatures) {
51
+ AdditionalFeatures["CustomizeUiAndFlow"] = "customize-ui-and-flow";
52
+ AdditionalFeatures["Compliance"] = "compliance";
53
+ AdditionalFeatures["ExportUserDataFromLogto"] = "export-user-data-from-logto";
54
+ AdditionalFeatures["BudgetControl"] = "budget-control";
55
+ AdditionalFeatures["BringOwnAuth"] = "bring-own-auth";
56
+ AdditionalFeatures["Others"] = "others";
57
+ })(AdditionalFeatures || (AdditionalFeatures = {}));
58
+ const questionnaireGuard = z.object({
59
+ project: z.nativeEnum(Project).optional(),
60
+ /** @deprecated Open-source options was for cloud preview use, no longer needed. Use default `Cloud` value for placeholder. */
61
+ deploymentType: z.nativeEnum(DeploymentType).optional().default(DeploymentType.Cloud),
62
+ /** @deprecated */
63
+ titles: z.array(z.nativeEnum(Title)).optional(),
64
+ companyName: z.string().optional(),
65
+ /** @deprecated */
66
+ companySize: z.nativeEnum(CompanySize).optional(),
67
+ /** @deprecated */
68
+ reasons: z.array(z.nativeEnum(Reason)).optional(),
69
+ stage: z.nativeEnum(Stage).optional(),
70
+ additionalFeatures: z.array(z.nativeEnum(AdditionalFeatures)).optional(),
71
+ });
72
+ export const userOnboardingDataGuard = z.object({
73
+ questionnaire: questionnaireGuard.optional(),
74
+ isOnboardingDone: z.boolean().optional(),
75
+ });
@@ -1,5 +1,5 @@
1
- import { z } from 'zod';
2
1
  import { type OrganizationRole, type Organization, type OrganizationInvitation } from '../db-entries/index.js';
2
+ import { type ToZodObject } from '../utils/zod.js';
3
3
  import { type UserInfo, type FeaturedUser } from './user.js';
4
4
  /**
5
5
  * The simplified organization scope entity that is returned for some endpoints.
@@ -8,10 +8,22 @@ export type OrganizationScopeEntity = {
8
8
  id: string;
9
9
  name: string;
10
10
  };
11
+ /**
12
+ * The simplified resource scope entity that is returned for some endpoints.
13
+ */
14
+ export type ResourceScopeEntity = {
15
+ id: string;
16
+ name: string;
17
+ resource: {
18
+ id: string;
19
+ name: string;
20
+ };
21
+ };
11
22
  export type OrganizationRoleWithScopes = OrganizationRole & {
12
23
  scopes: OrganizationScopeEntity[];
24
+ resourceScopes: ResourceScopeEntity[];
13
25
  };
14
- export declare const organizationRoleWithScopesGuard: z.ZodType<OrganizationRoleWithScopes>;
26
+ export declare const organizationRoleWithScopesGuard: ToZodObject<OrganizationRoleWithScopes>;
15
27
  /**
16
28
  * The simplified organization role entity that is returned in the `roles` field
17
29
  * of the organization.
@@ -28,7 +40,7 @@ export type OrganizationWithRoles = Organization & {
28
40
  /** The roles of the current member of the organization. */
29
41
  organizationRoles: OrganizationRoleEntity[];
30
42
  };
31
- export declare const organizationWithOrganizationRolesGuard: z.ZodType<OrganizationWithRoles>;
43
+ export declare const organizationWithOrganizationRolesGuard: ToZodObject<OrganizationWithRoles>;
32
44
  /**
33
45
  * The user entity with the `organizationRoles` field that contains the roles of
34
46
  * the user in a specific organization.
@@ -37,7 +49,7 @@ export type UserWithOrganizationRoles = UserInfo & {
37
49
  /** The roles of the user in a specific organization. */
38
50
  organizationRoles: OrganizationRoleEntity[];
39
51
  };
40
- export declare const userWithOrganizationRolesGuard: z.ZodType<UserWithOrganizationRoles>;
52
+ export declare const userWithOrganizationRolesGuard: ToZodObject<UserWithOrganizationRoles>;
41
53
  /**
42
54
  * The organization entity with optional `usersCount` and `featuredUsers` fields.
43
55
  * They are useful for displaying the organization list in the frontend.
@@ -54,4 +66,4 @@ export type OrganizationWithFeatured = Organization & {
54
66
  export type OrganizationInvitationEntity = OrganizationInvitation & {
55
67
  organizationRoles: OrganizationRoleEntity[];
56
68
  };
57
- export declare const organizationInvitationEntityGuard: z.ZodType<OrganizationInvitationEntity>;
69
+ export declare const organizationInvitationEntityGuard: ToZodObject<OrganizationInvitationEntity>;
@@ -8,6 +8,16 @@ export const organizationRoleWithScopesGuard = OrganizationRoles.guard.extend({
8
8
  name: z.string(),
9
9
  })
10
10
  .array(),
11
+ resourceScopes: z
12
+ .object({
13
+ id: z.string(),
14
+ name: z.string(),
15
+ resource: z.object({
16
+ id: z.string(),
17
+ name: z.string(),
18
+ }),
19
+ })
20
+ .array(),
11
21
  });
12
22
  const organizationRoleEntityGuard = z.object({
13
23
  id: z.string(),
@@ -4,7 +4,7 @@ export declare const scopeResponseGuard: z.ZodObject<{
4
4
  id: z.ZodType<string, z.ZodTypeDef, string>;
5
5
  tenantId: z.ZodType<string, z.ZodTypeDef, string>;
6
6
  createdAt: z.ZodType<number, z.ZodTypeDef, number>;
7
- description: z.ZodType<string, z.ZodTypeDef, string>;
7
+ description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
8
8
  resourceId: z.ZodType<string, z.ZodTypeDef, string>;
9
9
  resource: import("../index.js").Guard<import("../db-entries/resource.js").Resource>;
10
10
  }, "strip", z.ZodTypeAny, {
@@ -12,7 +12,7 @@ export declare const scopeResponseGuard: z.ZodObject<{
12
12
  id: string;
13
13
  tenantId: string;
14
14
  createdAt: number;
15
- description: string;
15
+ description: string | null;
16
16
  resource: import("../db-entries/resource.js").Resource;
17
17
  resourceId: string;
18
18
  }, {
@@ -20,7 +20,7 @@ export declare const scopeResponseGuard: z.ZodObject<{
20
20
  id: string;
21
21
  tenantId: string;
22
22
  createdAt: number;
23
- description: string;
23
+ description: string | null;
24
24
  resource: import("../db-entries/resource.js").Resource;
25
25
  resourceId: string;
26
26
  }>;
@@ -1,4 +1,5 @@
1
1
  export declare enum ServiceLogType {
2
2
  SendEmail = "sendEmail",
3
- SendSms = "sendSms"
3
+ SendSms = "sendSms",
4
+ FetchCustomJwt = "fetchCustomJwt"
4
5
  }
@@ -2,4 +2,5 @@ export var ServiceLogType;
2
2
  (function (ServiceLogType) {
3
3
  ServiceLogType["SendEmail"] = "sendEmail";
4
4
  ServiceLogType["SendSms"] = "sendSms";
5
+ ServiceLogType["FetchCustomJwt"] = "fetchCustomJwt";
5
6
  })(ServiceLogType || (ServiceLogType = {}));