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