@contember/engine-tenant-api 1.2.0 → 1.3.0-alpha.2

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 (325) hide show
  1. package/dist/src/TenantContainer.d.ts +1 -1
  2. package/dist/src/TenantContainer.d.ts.map +1 -1
  3. package/dist/src/TenantContainer.js +2 -0
  4. package/dist/src/TenantContainer.js.map +1 -1
  5. package/dist/src/bin/runMigrations.d.ts +2 -0
  6. package/dist/src/bin/runMigrations.d.ts.map +1 -0
  7. package/dist/src/bin/runMigrations.js +28 -0
  8. package/dist/src/bin/runMigrations.js.map +1 -0
  9. package/dist/src/migrations/2018-08-02-174310-init.d.ts +3 -0
  10. package/dist/src/migrations/2018-08-02-174310-init.d.ts.map +1 -0
  11. package/dist/src/migrations/2018-08-02-174310-init.js +64 -0
  12. package/dist/src/migrations/2018-08-02-174310-init.js.map +1 -0
  13. package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts +3 -0
  14. package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts.map +1 -0
  15. package/dist/src/migrations/2018-09-03-140621-identity-project.js +33 -0
  16. package/dist/src/migrations/2018-09-03-140621-identity-project.js.map +1 -0
  17. package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts +3 -0
  18. package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts.map +1 -0
  19. package/dist/src/migrations/2018-10-26-165450-setup-api-key.js +27 -0
  20. package/dist/src/migrations/2018-10-26-165450-setup-api-key.js.map +1 -0
  21. package/dist/src/migrations/2018-10-26-175155-variables.d.ts +3 -0
  22. package/dist/src/migrations/2018-10-26-175155-variables.d.ts.map +1 -0
  23. package/dist/src/migrations/2018-10-26-175155-variables.js +23 -0
  24. package/dist/src/migrations/2018-10-26-175155-variables.js.map +1 -0
  25. package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts +3 -0
  26. package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts.map +1 -0
  27. package/dist/src/migrations/2019-02-18-110949-project-slug.js +18 -0
  28. package/dist/src/migrations/2019-02-18-110949-project-slug.js.map +1 -0
  29. package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts +3 -0
  30. package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts.map +1 -0
  31. package/dist/src/migrations/2019-02-18-160155-session-expiration.js +11 -0
  32. package/dist/src/migrations/2019-02-18-160155-session-expiration.js.map +1 -0
  33. package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts +3 -0
  34. package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts.map +1 -0
  35. package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js +18 -0
  36. package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js.map +1 -0
  37. package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts +3 -0
  38. package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts.map +1 -0
  39. package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js +11 -0
  40. package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js.map +1 -0
  41. package/dist/src/migrations/2019-09-06-111000-membership.d.ts +3 -0
  42. package/dist/src/migrations/2019-09-06-111000-membership.d.ts.map +1 -0
  43. package/dist/src/migrations/2019-09-06-111000-membership.js +51 -0
  44. package/dist/src/migrations/2019-09-06-111000-membership.js.map +1 -0
  45. package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts +3 -0
  46. package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts.map +1 -0
  47. package/dist/src/migrations/2019-09-06-111001-drop-old-member.js +11 -0
  48. package/dist/src/migrations/2019-09-06-111001-drop-old-member.js.map +1 -0
  49. package/dist/src/migrations/2020-01-29-idenity-note.d.ts +3 -0
  50. package/dist/src/migrations/2020-01-29-idenity-note.d.ts.map +1 -0
  51. package/dist/src/migrations/2020-01-29-idenity-note.js +18 -0
  52. package/dist/src/migrations/2020-01-29-idenity-note.js.map +1 -0
  53. package/dist/src/migrations/2020-04-17-fix-person-index.d.ts +3 -0
  54. package/dist/src/migrations/2020-04-17-fix-person-index.d.ts.map +1 -0
  55. package/dist/src/migrations/2020-04-17-fix-person-index.js +12 -0
  56. package/dist/src/migrations/2020-04-17-fix-person-index.js.map +1 -0
  57. package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts +3 -0
  58. package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts.map +1 -0
  59. package/dist/src/migrations/2020-05-01-170000-api-key-index.js +10 -0
  60. package/dist/src/migrations/2020-05-01-170000-api-key-index.js.map +1 -0
  61. package/dist/src/migrations/2020-06-08-134000-tenant-credentials.d.ts.map +1 -1
  62. package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js +2 -50
  63. package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js.map +1 -1
  64. package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts +3 -0
  65. package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts.map +1 -0
  66. package/dist/src/migrations/2020-08-07-110000-person-otp.js +12 -0
  67. package/dist/src/migrations/2020-08-07-110000-person-otp.js.map +1 -0
  68. package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts +3 -0
  69. package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts.map +1 -0
  70. package/dist/src/migrations/2020-08-17-162200-mail-templates.js +23 -0
  71. package/dist/src/migrations/2020-08-17-162200-mail-templates.js.map +1 -0
  72. package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts +3 -0
  73. package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts.map +1 -0
  74. package/dist/src/migrations/2020-08-21-143400-person-password-reset.js +23 -0
  75. package/dist/src/migrations/2020-08-21-143400-person-password-reset.js.map +1 -0
  76. package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts +3 -0
  77. package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts.map +1 -0
  78. package/dist/src/migrations/2020-09-07-094200-identity-provider.js +17 -0
  79. package/dist/src/migrations/2020-09-07-094200-identity-provider.js.map +1 -0
  80. package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts +3 -0
  81. package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts.map +1 -0
  82. package/dist/src/migrations/2021-03-28-134000-timestamp.js +27 -0
  83. package/dist/src/migrations/2021-03-28-134000-timestamp.js.map +1 -0
  84. package/dist/src/migrations/2021-07-26-105000-project-config.d.ts +3 -0
  85. package/dist/src/migrations/2021-07-26-105000-project-config.d.ts.map +1 -0
  86. package/dist/src/migrations/2021-07-26-105000-project-config.js +12 -0
  87. package/dist/src/migrations/2021-07-26-105000-project-config.js.map +1 -0
  88. package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts +3 -0
  89. package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts.map +1 -0
  90. package/dist/src/migrations/2021-07-26-132000-project-secrets.js +24 -0
  91. package/dist/src/migrations/2021-07-26-132000-project-secrets.js.map +1 -0
  92. package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts +3 -0
  93. package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts.map +1 -0
  94. package/dist/src/migrations/2021-07-27-174000-project-alias-index.js +10 -0
  95. package/dist/src/migrations/2021-07-27-174000-project-alias-index.js.map +1 -0
  96. package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts +3 -0
  97. package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts.map +1 -0
  98. package/dist/src/migrations/2021-11-24-130000-person-password-null.js +10 -0
  99. package/dist/src/migrations/2021-11-24-130000-person-password-null.js.map +1 -0
  100. package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts +3 -0
  101. package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts.map +1 -0
  102. package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js +18 -0
  103. package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js.map +1 -0
  104. package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts +3 -0
  105. package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts.map +1 -0
  106. package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js +11 -0
  107. package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js.map +1 -0
  108. package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts +3 -0
  109. package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts.map +1 -0
  110. package/dist/src/migrations/2022-02-09-111800-fix-crypted.js +22 -0
  111. package/dist/src/migrations/2022-02-09-111800-fix-crypted.js.map +1 -0
  112. package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts +3 -0
  113. package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts.map +1 -0
  114. package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js +11 -0
  115. package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js.map +1 -0
  116. package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts +3 -0
  117. package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts.map +1 -0
  118. package/dist/src/migrations/2022-06-29-105000-person-idp.js +23 -0
  119. package/dist/src/migrations/2022-06-29-105000-person-idp.js.map +1 -0
  120. package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts +3 -0
  121. package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts.map +1 -0
  122. package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js +12 -0
  123. package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js.map +1 -0
  124. package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts +3 -0
  125. package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts.map +1 -0
  126. package/dist/src/migrations/2022-07-07-141000-person-display-name.js +13 -0
  127. package/dist/src/migrations/2022-07-07-141000-person-display-name.js.map +1 -0
  128. package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts +3 -0
  129. package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts.map +1 -0
  130. package/dist/src/migrations/2022-07-14-145000-person-login-options.js +15 -0
  131. package/dist/src/migrations/2022-07-14-145000-person-login-options.js.map +1 -0
  132. package/dist/src/migrations/2022-11-08-project-update-notification.d.ts +3 -0
  133. package/dist/src/migrations/2022-11-08-project-update-notification.d.ts.map +1 -0
  134. package/dist/src/migrations/2022-11-08-project-update-notification.js +64 -0
  135. package/dist/src/migrations/2022-11-08-project-update-notification.js.map +1 -0
  136. package/dist/src/migrations/runner.d.ts +1 -1
  137. package/dist/src/migrations/runner.d.ts.map +1 -1
  138. package/dist/src/migrations/runner.js +68 -5
  139. package/dist/src/migrations/runner.js.map +1 -1
  140. package/dist/src/migrations/snapshot-factory.d.ts +5 -0
  141. package/dist/src/migrations/snapshot-factory.d.ts.map +1 -0
  142. package/dist/src/migrations/snapshot-factory.js +18 -0
  143. package/dist/src/migrations/snapshot-factory.js.map +1 -0
  144. package/dist/src/migrations/snapshot.d.ts +4 -0
  145. package/dist/src/migrations/snapshot.d.ts.map +1 -0
  146. package/dist/src/migrations/snapshot.js +202 -0
  147. package/dist/src/migrations/snapshot.js.map +1 -0
  148. package/dist/src/migrations/tenantCredentials.d.ts +4 -0
  149. package/dist/src/migrations/tenantCredentials.d.ts.map +1 -0
  150. package/dist/src/migrations/tenantCredentials.js +57 -0
  151. package/dist/src/migrations/tenantCredentials.js.map +1 -0
  152. package/dist/src/migrations/types.d.ts +2 -0
  153. package/dist/src/migrations/types.d.ts.map +1 -1
  154. package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts +1 -0
  155. package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts.map +1 -1
  156. package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts +3 -3
  157. package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts.map +1 -1
  158. package/dist/src/model/queries/membership/ProjectMembersQuery.js +22 -10
  159. package/dist/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  160. package/dist/src/model/service/IDPSignInManager.d.ts +3 -3
  161. package/dist/src/model/service/IDPSignInManager.d.ts.map +1 -1
  162. package/dist/src/model/service/IDPSignInManager.js +13 -5
  163. package/dist/src/model/service/IDPSignInManager.js.map +1 -1
  164. package/dist/src/model/service/ProjectMemberManager.d.ts +2 -2
  165. package/dist/src/model/service/ProjectMemberManager.d.ts.map +1 -1
  166. package/dist/src/model/service/ProjectMemberManager.js +2 -2
  167. package/dist/src/model/service/ProjectMemberManager.js.map +1 -1
  168. package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts +2 -2
  169. package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts.map +1 -1
  170. package/dist/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
  171. package/dist/src/model/service/idp/IDPManager.d.ts.map +1 -1
  172. package/dist/src/model/service/idp/IDPManager.js +7 -2
  173. package/dist/src/model/service/idp/IDPManager.js.map +1 -1
  174. package/dist/src/model/service/idp/IdentityProviderHandler.d.ts +6 -9
  175. package/dist/src/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
  176. package/dist/src/model/service/idp/index.d.ts +3 -1
  177. package/dist/src/model/service/idp/index.d.ts.map +1 -1
  178. package/dist/src/model/service/idp/index.js +3 -1
  179. package/dist/src/model/service/idp/index.js.map +1 -1
  180. package/dist/src/model/service/idp/providers/AppleProvider.d.ts +29 -0
  181. package/dist/src/model/service/idp/providers/AppleProvider.d.ts.map +1 -0
  182. package/dist/src/model/service/idp/providers/AppleProvider.js +79 -0
  183. package/dist/src/model/service/idp/providers/AppleProvider.js.map +1 -0
  184. package/dist/src/model/service/idp/providers/FacebookProvider.d.ts +27 -0
  185. package/dist/src/model/service/idp/providers/FacebookProvider.d.ts.map +1 -0
  186. package/dist/src/model/service/idp/providers/FacebookProvider.js +137 -0
  187. package/dist/src/model/service/idp/providers/FacebookProvider.js.map +1 -0
  188. package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts +10 -0
  189. package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -0
  190. package/dist/src/model/service/idp/providers/OIDCHelpers.js +56 -0
  191. package/dist/src/model/service/idp/providers/OIDCHelpers.js.map +1 -0
  192. package/dist/src/model/service/idp/providers/OIDCProvider.d.ts +19 -0
  193. package/dist/src/model/service/idp/providers/OIDCProvider.d.ts.map +1 -0
  194. package/dist/src/model/service/idp/providers/OIDCProvider.js +40 -0
  195. package/dist/src/model/service/idp/providers/OIDCProvider.js.map +1 -0
  196. package/dist/src/model/service/idp/providers/OIDCTypes.d.ts +62 -0
  197. package/dist/src/model/service/idp/providers/OIDCTypes.d.ts.map +1 -0
  198. package/dist/src/model/service/idp/providers/OIDCTypes.js +56 -0
  199. package/dist/src/model/service/idp/providers/OIDCTypes.js.map +1 -0
  200. package/dist/src/model/service/idp/providers/helpers.d.ts +3 -0
  201. package/dist/src/model/service/idp/providers/helpers.d.ts.map +1 -0
  202. package/dist/src/model/service/idp/providers/helpers.js +40 -0
  203. package/dist/src/model/service/idp/providers/helpers.js.map +1 -0
  204. package/dist/src/model/utils/DatabaseContext.d.ts +1 -0
  205. package/dist/src/model/utils/DatabaseContext.d.ts.map +1 -1
  206. package/dist/src/model/utils/DatabaseContext.js +5 -0
  207. package/dist/src/model/utils/DatabaseContext.js.map +1 -1
  208. package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.d.ts.map +1 -1
  209. package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +4 -3
  210. package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  211. package/dist/src/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
  212. package/dist/src/resolvers/mutation/person/IDPMutationResolver.js +10 -3
  213. package/dist/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  214. package/dist/src/resolvers/types/ProjectTypeResolver.d.ts.map +1 -1
  215. package/dist/src/resolvers/types/ProjectTypeResolver.js +14 -6
  216. package/dist/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  217. package/dist/src/schema/index.d.ts +26 -8
  218. package/dist/src/schema/index.d.ts.map +1 -1
  219. package/dist/src/schema/index.js +1 -0
  220. package/dist/src/schema/index.js.map +1 -1
  221. package/dist/src/schema/tenant.graphql.d.ts.map +1 -1
  222. package/dist/src/schema/tenant.graphql.js +32 -6
  223. package/dist/src/schema/tenant.graphql.js.map +1 -1
  224. package/dist/src/tsconfig.tsbuildinfo +1 -1
  225. package/dist/tests/cases/integration/db/invite.test.js +2 -2
  226. package/dist/tests/cases/integration/db/unmanagedInvite.test.js +2 -2
  227. package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.d.ts +1 -1
  228. package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +1 -0
  229. package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.js +19 -9
  230. package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.js.map +1 -0
  231. package/dist/tests/src/IdPMock.d.ts +4 -4
  232. package/dist/tests/src/IdPMock.d.ts.map +1 -1
  233. package/dist/tests/src/IdPMock.js +2 -2
  234. package/dist/tests/src/IdPMock.js.map +1 -1
  235. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  236. package/package.json +14 -13
  237. package/src/TenantContainer.ts +4 -2
  238. package/src/bin/runMigrations.ts +32 -0
  239. package/src/migrations/{2018-08-02-174310-init.sql → 2018-08-02-174310-init.ts} +8 -1
  240. package/src/migrations/{2018-09-03-140621-identity-project.sql → 2018-09-03-140621-identity-project.ts} +8 -0
  241. package/src/migrations/{2018-10-26-165450-setup-api-key.sql → 2018-10-26-165450-setup-api-key.ts} +8 -0
  242. package/src/migrations/{2018-10-26-175155-variables.sql → 2018-10-26-175155-variables.ts} +7 -0
  243. package/src/migrations/{2019-02-18-110949-project-slug.sql → 2019-02-18-110949-project-slug.ts} +8 -0
  244. package/src/migrations/2019-02-18-160155-session-expiration.ts +10 -0
  245. package/src/migrations/{2019-05-03-163729-api-key-disabled-at.sql → 2019-05-03-163729-api-key-disabled-at.ts} +8 -0
  246. package/src/migrations/2019-08-14-153300-project-slug-unique.ts +10 -0
  247. package/src/migrations/{2019-09-06-111000-membership.sql → 2019-09-06-111000-membership.ts} +8 -0
  248. package/src/migrations/2019-09-06-111001-drop-old-member.ts +10 -0
  249. package/src/migrations/2020-01-29-idenity-note.ts +18 -0
  250. package/src/migrations/2020-04-17-fix-person-index.ts +12 -0
  251. package/src/migrations/2020-05-01-170000-api-key-index.ts +10 -0
  252. package/src/migrations/2020-06-08-134000-tenant-credentials.ts +3 -54
  253. package/src/migrations/2020-08-07-110000-person-otp.ts +12 -0
  254. package/src/migrations/{2020-08-17-162200-mail-templates.sql → 2020-08-17-162200-mail-templates.ts} +8 -0
  255. package/src/migrations/{2020-08-21-143400-person-password-reset.sql → 2020-08-21-143400-person-password-reset.ts} +8 -0
  256. package/src/migrations/{2020-09-07-094200-identity-provider.sql → 2020-09-07-094200-identity-provider.ts} +8 -0
  257. package/src/migrations/{2021-03-28-134000-timestamp.sql → 2021-03-28-134000-timestamp.ts} +9 -0
  258. package/src/migrations/2021-07-26-105000-project-config.ts +12 -0
  259. package/src/migrations/{2021-07-26-132000-project-secrets.sql → 2021-07-26-132000-project-secrets.ts} +8 -0
  260. package/src/migrations/2021-07-27-174000-project-alias-index.ts +10 -0
  261. package/src/migrations/2021-11-24-130000-person-password-null.ts +10 -0
  262. package/src/migrations/{2021-11-24-161500-mail-template-project-null.sql → 2021-11-24-161500-mail-template-project-null.ts} +8 -0
  263. package/src/migrations/2022-01-04-144000-person-unique-identity.ts +10 -0
  264. package/src/migrations/{2022-02-09-111800-fix-crypted.sql → 2022-02-09-111800-fix-crypted.ts} +8 -0
  265. package/src/migrations/2022-02-11-153000-idp-auto-sign-up.ts +10 -0
  266. package/src/migrations/{2022-06-29-105000-person-idp.sql → 2022-06-29-105000-person-idp.ts} +8 -0
  267. package/src/migrations/2022-07-07-135000-person-email-opt-uniq.ts +11 -0
  268. package/src/migrations/2022-07-07-141000-person-display-name.ts +13 -0
  269. package/src/migrations/{2022-07-14-145000-person-login-options.sql → 2022-07-14-145000-person-login-options.ts} +9 -0
  270. package/src/migrations/2022-11-08-project-update-notification.ts +64 -0
  271. package/src/migrations/runner.ts +72 -8
  272. package/src/migrations/snapshot-factory.ts +21 -0
  273. package/src/migrations/snapshot-template-end.txt +10 -0
  274. package/src/migrations/snapshot-template-start.txt +6 -0
  275. package/src/migrations/snapshot.ts +202 -0
  276. package/src/migrations/tenantCredentials.ts +58 -0
  277. package/src/migrations/types.ts +3 -0
  278. package/src/model/commands/idp/UpdateIdpCommand.ts +1 -0
  279. package/src/model/queries/membership/ProjectMembersQuery.ts +23 -14
  280. package/src/model/service/IDPSignInManager.ts +13 -10
  281. package/src/model/service/ProjectMemberManager.ts +3 -3
  282. package/src/model/service/idp/IDPHandlerRegistry.ts +3 -3
  283. package/src/model/service/idp/IDPManager.ts +6 -2
  284. package/src/model/service/idp/IdentityProviderHandler.ts +7 -15
  285. package/src/model/service/idp/index.ts +3 -1
  286. package/src/model/service/idp/providers/AppleProvider.ts +65 -0
  287. package/src/model/service/idp/providers/FacebookProvider.ts +125 -0
  288. package/src/model/service/idp/providers/OIDCHelpers.ts +54 -0
  289. package/src/model/service/idp/providers/OIDCProvider.ts +40 -0
  290. package/src/model/service/idp/providers/OIDCTypes.ts +61 -0
  291. package/src/model/service/idp/providers/helpers.ts +12 -0
  292. package/src/model/utils/DatabaseContext.ts +6 -0
  293. package/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts +1 -0
  294. package/src/resolvers/mutation/person/IDPMutationResolver.ts +9 -7
  295. package/src/resolvers/types/ProjectTypeResolver.ts +9 -2
  296. package/src/schema/index.ts +28 -8
  297. package/src/schema/tenant.graphql.ts +32 -6
  298. package/src/tsconfig.json +10 -30
  299. package/tests/cases/integration/db/invite.test.ts +2 -2
  300. package/tests/cases/integration/db/unmanagedInvite.test.ts +2 -2
  301. package/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.ts +17 -9
  302. package/tests/src/IdPMock.ts +4 -4
  303. package/tests/tsconfig.json +2 -6
  304. package/tsconfig.json +2 -6
  305. package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +0 -1
  306. package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.js.map +0 -1
  307. package/dist/src/model/service/idp/OIDCProvider.d.ts +0 -25
  308. package/dist/src/model/service/idp/OIDCProvider.d.ts.map +0 -1
  309. package/dist/src/model/service/idp/OIDCProvider.js +0 -108
  310. package/dist/src/model/service/idp/OIDCProvider.js.map +0 -1
  311. package/src/migrations/2019-02-18-160155-session-expiration.sql +0 -2
  312. package/src/migrations/2019-08-14-153300-project-slug-unique.sql +0 -2
  313. package/src/migrations/2019-09-06-111001-drop-old-member.sql +0 -2
  314. package/src/migrations/2020-01-29-idenity-note.sql +0 -9
  315. package/src/migrations/2020-04-17-fix-person-index.sql +0 -3
  316. package/src/migrations/2020-05-01-170000-api-key-index.sql +0 -1
  317. package/src/migrations/2020-08-07-110000-person-otp.sql +0 -3
  318. package/src/migrations/2021-07-26-105000-project-config.sql +0 -3
  319. package/src/migrations/2021-07-27-174000-project-alias-index.sql +0 -1
  320. package/src/migrations/2021-11-24-130000-person-password-null.sql +0 -1
  321. package/src/migrations/2022-01-04-144000-person-unique-identity.sql +0 -2
  322. package/src/migrations/2022-02-11-153000-idp-auto-sign-up.sql +0 -2
  323. package/src/migrations/2022-07-07-135000-person-email-opt-uniq.sql +0 -3
  324. package/src/migrations/2022-07-07-141000-person-display-name.sql +0 -4
  325. package/src/model/service/idp/OIDCProvider.ts +0 -100
@@ -1,56 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const database_migrations_1 = require("@contember/database-migrations");
3
+ const tenantCredentials_1 = require("./tenantCredentials");
4
4
  async function default_1(builder, args) {
5
- const credentials = await args.getCredentials();
6
- if (credentials.loginTokenHash) {
7
- const tokenHash = credentials.loginTokenHash;
8
- builder.sql(`
9
- WITH identity AS (
10
- INSERT INTO identity(id, parent_id, roles, description, created_at)
11
- VALUES (public."uuid_generate_v4"(), NULL, '["login"]'::JSONB, 'Login key', now()) RETURNING id
12
- )
13
- INSERT INTO api_key (id, token_hash, type, identity_id, disabled_at, expires_at, expiration, created_at)
14
- SELECT public."uuid_generate_v4"(), ${(0, database_migrations_1.escapeValue)(tokenHash)}, 'permanent', identity.id, NULL, NULL, NULL, now()
15
- FROM identity
16
- `);
17
- }
18
- if (!credentials.rootTokenHash) {
19
- throw 'Please specify a root token using CONTEMBER_ROOT_TOKEN env variable.';
20
- }
21
- if (credentials.rootEmail && !credentials.rootPasswordBcrypted) {
22
- throw 'Please specify a root password using CONTEMBER_ROOT_PASSWORD env variable.';
23
- }
24
- const rootEmail = credentials.rootPasswordBcrypted ? credentials.rootEmail || 'root@localhost' : null;
25
- const rootPasswordHash = credentials.rootPasswordBcrypted || null;
26
- const rootTokenHash = credentials.rootTokenHash;
27
- builder.sql(`
28
- WITH identity AS (
29
- INSERT INTO identity(id, parent_id, roles, description, created_at)
30
- VALUES (
31
- public."uuid_generate_v4"(),
32
- NULL,
33
- '["super_admin"]'::JSONB
34
- || (CASE WHEN ${(0, database_migrations_1.escapeValue)(rootEmail)} IS NOT NULL THEN '["person"]'::JSONB ELSE '[]'::JSONB END),
35
- 'Superadmin',
36
- now()
37
- ) RETURNING id
38
- ),
39
- person AS (
40
- INSERT INTO person(id, email, password_hash, identity_id)
41
- SELECT public."uuid_generate_v4"(), ${(0, database_migrations_1.escapeValue)(rootEmail)}, ${(0, database_migrations_1.escapeValue)(rootPasswordHash)}, identity.id
42
- FROM identity
43
- WHERE ${(0, database_migrations_1.escapeValue)(rootEmail)} IS NOT NULL
44
- RETURNING id
45
- ),
46
- api_key AS (
47
- INSERT INTO api_key (id, token_hash, type, identity_id, disabled_at, expires_at, expiration, created_at)
48
- SELECT public."uuid_generate_v4"(), ${(0, database_migrations_1.escapeValue)(rootTokenHash)}, 'permanent', identity.id, NULL, NULL, NULL, now()
49
- FROM identity WHERE ${(0, database_migrations_1.escapeValue)(rootTokenHash)} IS NOT NULL
50
- RETURNING id
51
- )
52
- SELECT * FROM person, api_key
53
- `);
5
+ await (0, tenantCredentials_1.createCredentials)(builder, args);
54
6
  }
55
7
  exports.default = default_1;
56
8
  //# sourceMappingURL=2020-06-08-134000-tenant-credentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"2020-06-08-134000-tenant-credentials.js","sourceRoot":"","sources":["../../../src/migrations/2020-06-08-134000-tenant-credentials.ts"],"names":[],"mappings":";;AAAA,wEAA8E;AAG/D,KAAK,oBAAW,OAAyB,EAAE,IAAyB;IAClF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAA;IAC/C,IAAI,WAAW,CAAC,cAAc,EAAE;QAC/B,MAAM,SAAS,GAAG,WAAW,CAAC,cAAc,CAAA;QAC5C,OAAO,CAAC,GAAG,CAAC;;;;;;yCAM2B,IAAA,iCAAW,EAAC,SAAS,CAAC;;IAE3D,CAAC,CAAA;KACH;IAED,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;QAC/B,MAAM,sEAAsE,CAAA;KAC5E;IAED,IAAI,WAAW,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE;QAC/D,MAAM,4EAA4E,CAAA;KAClF;IACD,MAAM,SAAS,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,IAAI,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAA;IACrG,MAAM,gBAAgB,GAAG,WAAW,CAAC,oBAAoB,IAAI,IAAI,CAAA;IAEjE,MAAM,aAAa,GAAG,WAAW,CAAC,aAAa,CAAA;IAE/C,OAAO,CAAC,GAAG,CAAC;;;;;;;uBAOU,IAAA,iCAAW,EAAC,SAAS,CAAC;;;;;;;0CAOH,IAAA,iCAAW,EAAC,SAAS,CAAC,KAAK,IAAA,iCAAW,EAAC,gBAAgB,CAAC;;YAEtF,IAAA,iCAAW,EAAC,SAAS,CAAC;;;;;0CAKQ,IAAA,iCAAW,EAAC,aAAa,CAAC;0BAC1C,IAAA,iCAAW,EAAC,aAAa,CAAC;;;;GAIjD,CAAC,CAAA;AACJ,CAAC;AAtDD,4BAsDC"}
1
+ {"version":3,"file":"2020-06-08-134000-tenant-credentials.js","sourceRoot":"","sources":["../../../src/migrations/2020-06-08-134000-tenant-credentials.ts"],"names":[],"mappings":";;AAEA,2DAAuD;AAExC,KAAK,oBAAW,OAAyB,EAAE,IAAyB;IAClF,MAAM,IAAA,qCAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACvC,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2020-08-07-110000-person-otp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-07-110000-person-otp.d.ts","sourceRoot":"","sources":["../../../src/migrations/2020-08-07-110000-person-otp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAQjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE "person"
5
+ ADD COLUMN otp_uri TEXT DEFAULT NULL,
6
+ ADD COLUMN otp_activated_at TIMESTAMP DEFAULT NULL
7
+ `;
8
+ async function default_1(builder) {
9
+ builder.sql(sql);
10
+ }
11
+ exports.default = default_1;
12
+ //# sourceMappingURL=2020-08-07-110000-person-otp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-07-110000-person-otp.js","sourceRoot":"","sources":["../../../src/migrations/2020-08-07-110000-person-otp.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;CAIX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2020-08-17-162200-mail-templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-17-162200-mail-templates.d.ts","sourceRoot":"","sources":["../../../src/migrations/2020-08-17-162200-mail-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAmBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE TABLE mail_template (
5
+ id UUID NOT NULL PRIMARY KEY,
6
+ project_id UUID NOT NULL,
7
+ mail_type TEXT NOT NULL,
8
+ variant TEXT NOT NULL,
9
+ subject TEXT NOT NULL,
10
+ content TEXT NOT NULL,
11
+ use_layout BOOL NOT NULL,
12
+ CONSTRAINT mail_template_project FOREIGN KEY (project_id) REFERENCES project(id) ON DELETE CASCADE
13
+ );
14
+
15
+ CREATE UNIQUE INDEX mail_template_identifier ON mail_template(project_id, mail_type, variant);
16
+ CREATE INDEX mail_template_project_index
17
+ ON mail_template(project_id);
18
+ `;
19
+ async function default_1(builder) {
20
+ builder.sql(sql);
21
+ }
22
+ exports.default = default_1;
23
+ //# sourceMappingURL=2020-08-17-162200-mail-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-17-162200-mail-templates.js","sourceRoot":"","sources":["../../../src/migrations/2020-08-17-162200-mail-templates.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;CAeX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2020-08-21-143400-person-password-reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-21-143400-person-password-reset.d.ts","sourceRoot":"","sources":["../../../src/migrations/2020-08-21-143400-person-password-reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAoBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE TABLE person_password_reset (
5
+ id UUID NOT NULL,
6
+ token_hash TEXT NOT NULL,
7
+ person_id UUID NOT NULL,
8
+ expires_at TIMESTAMP NOT NULL,
9
+ created_at TIMESTAMP NOT NULL,
10
+ used_at TIMESTAMP,
11
+ CONSTRAINT person_password_reset_id PRIMARY KEY ("id"),
12
+ CONSTRAINT person_password_reset_person FOREIGN KEY ("person_id")
13
+ REFERENCES person("id") ON DELETE CASCADE
14
+ );
15
+
16
+ CREATE UNIQUE INDEX person_password_reset_token
17
+ ON person_password_reset(token_hash);
18
+ `;
19
+ async function default_1(builder) {
20
+ builder.sql(sql);
21
+ }
22
+ exports.default = default_1;
23
+ //# sourceMappingURL=2020-08-21-143400-person-password-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-08-21-143400-person-password-reset.js","sourceRoot":"","sources":["../../../src/migrations/2020-08-21-143400-person-password-reset.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;CAeX,CAAA;AAGc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2020-09-07-094200-identity-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-09-07-094200-identity-provider.d.ts","sourceRoot":"","sources":["../../../src/migrations/2020-09-07-094200-identity-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAajE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE TABLE identity_provider (
5
+ id UUID NOT NULL,
6
+ slug TEXT UNIQUE NOT NULL,
7
+ type TEXT NOT NULL,
8
+ configuration JSONB NOT NULL,
9
+ disabled_at TIMESTAMP DEFAULT NULL,
10
+ CONSTRAINT identity_provider_id PRIMARY KEY ("id")
11
+ );
12
+ `;
13
+ async function default_1(builder) {
14
+ builder.sql(sql);
15
+ }
16
+ exports.default = default_1;
17
+ //# sourceMappingURL=2020-09-07-094200-identity-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2020-09-07-094200-identity-provider.js","sourceRoot":"","sources":["../../../src/migrations/2020-09-07-094200-identity-provider.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;CASX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-03-28-134000-timestamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-03-28-134000-timestamp.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-03-28-134000-timestamp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAuBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE identity_provider
5
+ ALTER disabled_at TYPE TIMESTAMPTZ;
6
+
7
+ ALTER TABLE api_key
8
+ ALTER disabled_at TYPE TIMESTAMPTZ,
9
+ ALTER created_at TYPE TIMESTAMPTZ,
10
+ ALTER expires_at TYPE TIMESTAMPTZ;
11
+
12
+ ALTER TABLE identity
13
+ ALTER created_at TYPE TIMESTAMPTZ;
14
+
15
+ ALTER TABLE person
16
+ ALTER otp_activated_at TYPE TIMESTAMPTZ;
17
+
18
+ ALTER TABLE person_password_reset
19
+ ALTER expires_at TYPE TIMESTAMPTZ,
20
+ ALTER created_at TYPE TIMESTAMPTZ,
21
+ ALTER used_at TYPE TIMESTAMPTZ;
22
+ `;
23
+ async function default_1(builder) {
24
+ builder.sql(sql);
25
+ }
26
+ exports.default = default_1;
27
+ //# sourceMappingURL=2021-03-28-134000-timestamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-03-28-134000-timestamp.js","sourceRoot":"","sources":["../../../src/migrations/2021-03-28-134000-timestamp.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;CAmBX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-07-26-105000-project-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-26-105000-project-config.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-07-26-105000-project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAQjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE project
5
+ ADD COLUMN config JSONB NOT NULL DEFAULT '{}'::JSONB,
6
+ add column updated_at timestamptz not null DEFAULT now();
7
+ `;
8
+ async function default_1(builder) {
9
+ builder.sql(sql);
10
+ }
11
+ exports.default = default_1;
12
+ //# sourceMappingURL=2021-07-26-105000-project-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-26-105000-project-config.js","sourceRoot":"","sources":["../../../src/migrations/2021-07-26-105000-project-config.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;CAIX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-07-26-132000-project-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-26-132000-project-secrets.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-07-26-132000-project-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAoBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE TABLE project_secret
5
+ (
6
+ id UUID NOT NULL PRIMARY KEY,
7
+ project_id UUID NOT NULL,
8
+ key TEXT NOT NULL,
9
+ value_encrypted TEXT NOT NULL,
10
+ iv TEXT NOT NULL,
11
+ created_at TIMESTAMPTZ NOT NULL,
12
+ updated_at TIMESTAMPTZ NOT NULL,
13
+ CONSTRAINT project_secret_project FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE
14
+ );
15
+
16
+ CREATE UNIQUE INDEX project_secret_unique ON project_secret (project_id, key);
17
+ CREATE INDEX project_secret_project_index
18
+ ON project_secret (project_id);
19
+ `;
20
+ async function default_1(builder) {
21
+ builder.sql(sql);
22
+ }
23
+ exports.default = default_1;
24
+ //# sourceMappingURL=2021-07-26-132000-project-secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-26-132000-project-secrets.js","sourceRoot":"","sources":["../../../src/migrations/2021-07-26-132000-project-secrets.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;CAgBX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-07-27-174000-project-alias-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-27-174000-project-alias-index.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-07-27-174000-project-alias-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAMjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE INDEX project_alias ON project USING gin ((config -> 'alias'));
5
+ `;
6
+ async function default_1(builder) {
7
+ builder.sql(sql);
8
+ }
9
+ exports.default = default_1;
10
+ //# sourceMappingURL=2021-07-27-174000-project-alias-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-07-27-174000-project-alias-index.js","sourceRoot":"","sources":["../../../src/migrations/2021-07-27-174000-project-alias-index.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;CAEX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-11-24-130000-person-password-null.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-11-24-130000-person-password-null.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-11-24-130000-person-password-null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAMjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE person ALTER COLUMN password_hash DROP NOT NULL;
5
+ `;
6
+ async function default_1(builder) {
7
+ builder.sql(sql);
8
+ }
9
+ exports.default = default_1;
10
+ //# sourceMappingURL=2021-11-24-130000-person-password-null.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-11-24-130000-person-password-null.js","sourceRoot":"","sources":["../../../src/migrations/2021-11-24-130000-person-password-null.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;CAEX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2021-11-24-161500-mail-template-project-null.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-11-24-161500-mail-template-project-null.d.ts","sourceRoot":"","sources":["../../../src/migrations/2021-11-24-161500-mail-template-project-null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAcjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE "mail_template" ALTER COLUMN "project_id" DROP NOT NULL;
5
+
6
+ DROP INDEX mail_template_identifier;
7
+
8
+ CREATE UNIQUE INDEX mail_template_identifier
9
+ ON mail_template (project_id, mail_type, variant) WHERE project_id IS NOT NULL;
10
+
11
+ CREATE UNIQUE INDEX mail_template_identifier_global
12
+ ON mail_template (mail_type, variant) WHERE project_id IS NULL;
13
+ `;
14
+ async function default_1(builder) {
15
+ builder.sql(sql);
16
+ }
17
+ exports.default = default_1;
18
+ //# sourceMappingURL=2021-11-24-161500-mail-template-project-null.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2021-11-24-161500-mail-template-project-null.js","sourceRoot":"","sources":["../../../src/migrations/2021-11-24-161500-mail-template-project-null.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;CAUX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-01-04-144000-person-unique-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-01-04-144000-person-unique-identity.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-01-04-144000-person-unique-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAOjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE person
5
+ ADD UNIQUE (identity_id);
6
+ `;
7
+ async function default_1(builder) {
8
+ builder.sql(sql);
9
+ }
10
+ exports.default = default_1;
11
+ //# sourceMappingURL=2022-01-04-144000-person-unique-identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-01-04-144000-person-unique-identity.js","sourceRoot":"","sources":["../../../src/migrations/2022-01-04-144000-person-unique-identity.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;CAGX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-02-09-111800-fix-crypted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-02-09-111800-fix-crypted.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-02-09-111800-fix-crypted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAkBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE project_secret
5
+ ADD COLUMN value BYTEA,
6
+ ADD COLUMN version SMALLINT;
7
+
8
+ UPDATE project_secret SET
9
+ value = DECODE(value_encrypted, 'base64') || DECODE(iv, 'base64'),
10
+ version = 1;
11
+
12
+ ALTER TABLE project_secret
13
+ ALTER value SET NOT NULL,
14
+ ALTER version SET NOT NULL,
15
+ DROP value_encrypted,
16
+ DROP iv;
17
+ `;
18
+ async function default_1(builder) {
19
+ builder.sql(sql);
20
+ }
21
+ exports.default = default_1;
22
+ //# sourceMappingURL=2022-02-09-111800-fix-crypted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-02-09-111800-fix-crypted.js","sourceRoot":"","sources":["../../../src/migrations/2022-02-09-111800-fix-crypted.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;CAcX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-02-11-153000-idp-auto-sign-up.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-02-11-153000-idp-auto-sign-up.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-02-11-153000-idp-auto-sign-up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAOjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE identity_provider
5
+ ADD COLUMN auto_sign_up BOOLEAN NOT NULL DEFAULT FALSE;
6
+ `;
7
+ async function default_1(builder) {
8
+ builder.sql(sql);
9
+ }
10
+ exports.default = default_1;
11
+ //# sourceMappingURL=2022-02-11-153000-idp-auto-sign-up.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-02-11-153000-idp-auto-sign-up.js","sourceRoot":"","sources":["../../../src/migrations/2022-02-11-153000-idp-auto-sign-up.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;CAGX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-06-29-105000-person-idp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-06-29-105000-person-idp.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-06-29-105000-person-idp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAmBjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ CREATE TABLE person_identity_provider
5
+ (
6
+ id UUID NOT NULL PRIMARY KEY,
7
+ person_id UUID NOT NULL,
8
+ identity_provider_id UUID NOT NULL,
9
+ created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
10
+ external_identifier TEXT NOT NULL,
11
+ CONSTRAINT person_identity_provider_person FOREIGN KEY (person_id) REFERENCES person (id) ON DELETE CASCADE,
12
+ CONSTRAINT person_identity_provider_idp FOREIGN KEY (identity_provider_id) REFERENCES identity_provider (id) ON DELETE CASCADE
13
+ );
14
+
15
+ CREATE INDEX person_identity_provider_person_id ON person_identity_provider (person_id);
16
+ CREATE UNIQUE INDEX person_identity_provider_identifier
17
+ ON person_identity_provider (identity_provider_id, external_identifier);
18
+ `;
19
+ async function default_1(builder) {
20
+ builder.sql(sql);
21
+ }
22
+ exports.default = default_1;
23
+ //# sourceMappingURL=2022-06-29-105000-person-idp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-06-29-105000-person-idp.js","sourceRoot":"","sources":["../../../src/migrations/2022-06-29-105000-person-idp.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;CAeX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-07-07-135000-person-email-opt-uniq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-07-135000-person-email-opt-uniq.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-07-07-135000-person-email-opt-uniq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAQjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE person
5
+ ALTER email DROP NOT NULL,
6
+ ADD CONSTRAINT email_unique UNIQUE (email);
7
+ `;
8
+ async function default_1(builder) {
9
+ builder.sql(sql);
10
+ }
11
+ exports.default = default_1;
12
+ //# sourceMappingURL=2022-07-07-135000-person-email-opt-uniq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-07-135000-person-email-opt-uniq.js","sourceRoot":"","sources":["../../../src/migrations/2022-07-07-135000-person-email-opt-uniq.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;CAIX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-07-07-141000-person-display-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-07-141000-person-display-name.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-07-07-141000-person-display-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AASjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE person
5
+ ADD name TEXT;
6
+ UPDATE person
7
+ SET name = SPLIT_PART(email, '@', 1);
8
+ `;
9
+ async function default_1(builder) {
10
+ builder.sql(sql);
11
+ }
12
+ exports.default = default_1;
13
+ //# sourceMappingURL=2022-07-07-141000-person-display-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-07-141000-person-display-name.js","sourceRoot":"","sources":["../../../src/migrations/2022-07-07-141000-person-display-name.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;CAKX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-07-14-145000-person-login-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-14-145000-person-login-options.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-07-14-145000-person-login-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAWjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sql = `
4
+ ALTER TABLE person
5
+ ADD idp_only BOOLEAN NOT NULL DEFAULT FALSE,
6
+ ADD CONSTRAINT idp_only_no_email CHECK ( idp_only = FALSE OR (idp_only = TRUE AND email IS NULL));
7
+
8
+ ALTER TABLE identity_provider
9
+ ADD exclusive BOOLEAN DEFAULT FALSE;
10
+ `;
11
+ async function default_1(builder) {
12
+ builder.sql(sql);
13
+ }
14
+ exports.default = default_1;
15
+ //# sourceMappingURL=2022-07-14-145000-person-login-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-07-14-145000-person-login-options.js","sourceRoot":"","sources":["../../../src/migrations/2022-07-14-145000-person-login-options.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAAG;;;;;;;CAOX,CAAA;AAEc,KAAK,oBAAW,OAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,3 @@
1
+ import { MigrationBuilder } from '@contember/database-migrations';
2
+ export default function (builder: MigrationBuilder): Promise<void>;
3
+ //# sourceMappingURL=2022-11-08-project-update-notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2022-11-08-project-update-notification.d.ts","sourceRoot":"","sources":["../../../src/migrations/2022-11-08-project-update-notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AA4DjE,yBAA+B,OAAO,EAAE,gBAAgB,iBAEvD"}