@contember/engine-tenant-api 1.2.1 → 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.
- package/dist/src/TenantContainer.d.ts +1 -1
- package/dist/src/TenantContainer.d.ts.map +1 -1
- package/dist/src/TenantContainer.js +2 -0
- package/dist/src/TenantContainer.js.map +1 -1
- package/dist/src/bin/runMigrations.d.ts +2 -0
- package/dist/src/bin/runMigrations.d.ts.map +1 -0
- package/dist/src/bin/runMigrations.js +28 -0
- package/dist/src/bin/runMigrations.js.map +1 -0
- package/dist/src/migrations/2018-08-02-174310-init.d.ts +3 -0
- package/dist/src/migrations/2018-08-02-174310-init.d.ts.map +1 -0
- package/dist/src/migrations/2018-08-02-174310-init.js +64 -0
- package/dist/src/migrations/2018-08-02-174310-init.js.map +1 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts +3 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts.map +1 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.js +33 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.js.map +1 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts +3 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts.map +1 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.js +27 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.js.map +1 -0
- package/dist/src/migrations/2018-10-26-175155-variables.d.ts +3 -0
- package/dist/src/migrations/2018-10-26-175155-variables.d.ts.map +1 -0
- package/dist/src/migrations/2018-10-26-175155-variables.js +23 -0
- package/dist/src/migrations/2018-10-26-175155-variables.js.map +1 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts +3 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts.map +1 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.js +18 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.js.map +1 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts +3 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts.map +1 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.js +11 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.js.map +1 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts +3 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts.map +1 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js +18 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js.map +1 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts +3 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts.map +1 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js +11 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js.map +1 -0
- package/dist/src/migrations/2019-09-06-111000-membership.d.ts +3 -0
- package/dist/src/migrations/2019-09-06-111000-membership.d.ts.map +1 -0
- package/dist/src/migrations/2019-09-06-111000-membership.js +51 -0
- package/dist/src/migrations/2019-09-06-111000-membership.js.map +1 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts +3 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts.map +1 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.js +11 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.js.map +1 -0
- package/dist/src/migrations/2020-01-29-idenity-note.d.ts +3 -0
- package/dist/src/migrations/2020-01-29-idenity-note.d.ts.map +1 -0
- package/dist/src/migrations/2020-01-29-idenity-note.js +18 -0
- package/dist/src/migrations/2020-01-29-idenity-note.js.map +1 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.d.ts +3 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.d.ts.map +1 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.js +12 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.js.map +1 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts +3 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts.map +1 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.js +10 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.js.map +1 -0
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.d.ts.map +1 -1
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js +2 -50
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js.map +1 -1
- package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts +3 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.js +12 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.js.map +1 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts +3 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.js +23 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.js.map +1 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts +3 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.js +23 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.js.map +1 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts +3 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts.map +1 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.js +17 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.js.map +1 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts +3 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts.map +1 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.js +27 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.js.map +1 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.d.ts +3 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.js +12 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.js.map +1 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts +3 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.js +24 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.js.map +1 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts +3 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.js +10 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.js.map +1 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts +3 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts.map +1 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.js +10 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.js.map +1 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts +3 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts.map +1 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js +18 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js.map +1 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts +3 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts.map +1 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js +11 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js.map +1 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts +3 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts.map +1 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.js +22 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.js.map +1 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts +3 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts.map +1 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js +11 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js.map +1 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts +3 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts.map +1 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.js +23 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.js.map +1 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts +3 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js +12 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js.map +1 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts +3 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.js +13 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.js.map +1 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts +3 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.js +15 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.js.map +1 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.d.ts +3 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.d.ts.map +1 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.js +64 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.js.map +1 -0
- package/dist/src/migrations/runner.d.ts +1 -1
- package/dist/src/migrations/runner.d.ts.map +1 -1
- package/dist/src/migrations/runner.js +68 -5
- package/dist/src/migrations/runner.js.map +1 -1
- package/dist/src/migrations/snapshot-factory.d.ts +5 -0
- package/dist/src/migrations/snapshot-factory.d.ts.map +1 -0
- package/dist/src/migrations/snapshot-factory.js +18 -0
- package/dist/src/migrations/snapshot-factory.js.map +1 -0
- package/dist/src/migrations/snapshot.d.ts +4 -0
- package/dist/src/migrations/snapshot.d.ts.map +1 -0
- package/dist/src/migrations/snapshot.js +202 -0
- package/dist/src/migrations/snapshot.js.map +1 -0
- package/dist/src/migrations/tenantCredentials.d.ts +4 -0
- package/dist/src/migrations/tenantCredentials.d.ts.map +1 -0
- package/dist/src/migrations/tenantCredentials.js +57 -0
- package/dist/src/migrations/tenantCredentials.js.map +1 -0
- package/dist/src/migrations/types.d.ts +2 -0
- package/dist/src/migrations/types.d.ts.map +1 -1
- package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts +1 -0
- package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts.map +1 -1
- package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts +3 -3
- package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts.map +1 -1
- package/dist/src/model/queries/membership/ProjectMembersQuery.js +22 -10
- package/dist/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
- package/dist/src/model/service/IDPSignInManager.d.ts +3 -3
- package/dist/src/model/service/IDPSignInManager.d.ts.map +1 -1
- package/dist/src/model/service/IDPSignInManager.js +13 -5
- package/dist/src/model/service/IDPSignInManager.js.map +1 -1
- package/dist/src/model/service/ProjectMemberManager.d.ts +2 -2
- package/dist/src/model/service/ProjectMemberManager.d.ts.map +1 -1
- package/dist/src/model/service/ProjectMemberManager.js +2 -2
- package/dist/src/model/service/ProjectMemberManager.js.map +1 -1
- package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts +2 -2
- package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts.map +1 -1
- package/dist/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
- package/dist/src/model/service/idp/IDPManager.d.ts.map +1 -1
- package/dist/src/model/service/idp/IDPManager.js +7 -2
- package/dist/src/model/service/idp/IDPManager.js.map +1 -1
- package/dist/src/model/service/idp/IdentityProviderHandler.d.ts +6 -9
- package/dist/src/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
- package/dist/src/model/service/idp/index.d.ts +3 -1
- package/dist/src/model/service/idp/index.d.ts.map +1 -1
- package/dist/src/model/service/idp/index.js +3 -1
- package/dist/src/model/service/idp/index.js.map +1 -1
- package/dist/src/model/service/idp/providers/AppleProvider.d.ts +29 -0
- package/dist/src/model/service/idp/providers/AppleProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/AppleProvider.js +79 -0
- package/dist/src/model/service/idp/providers/AppleProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.d.ts +27 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.js +137 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts +10 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.js +56 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.d.ts +19 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.js +40 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.d.ts +62 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.js +56 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.js.map +1 -0
- package/dist/src/model/service/idp/providers/helpers.d.ts +3 -0
- package/dist/src/model/service/idp/providers/helpers.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/helpers.js +40 -0
- package/dist/src/model/service/idp/providers/helpers.js.map +1 -0
- package/dist/src/model/utils/DatabaseContext.d.ts +1 -0
- package/dist/src/model/utils/DatabaseContext.d.ts.map +1 -1
- package/dist/src/model/utils/DatabaseContext.js +5 -0
- package/dist/src/model/utils/DatabaseContext.js.map +1 -1
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.d.ts.map +1 -1
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +4 -3
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.js +10 -3
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
- package/dist/src/resolvers/types/ProjectTypeResolver.d.ts.map +1 -1
- package/dist/src/resolvers/types/ProjectTypeResolver.js +14 -6
- package/dist/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
- package/dist/src/schema/index.d.ts +26 -8
- package/dist/src/schema/index.d.ts.map +1 -1
- package/dist/src/schema/index.js +1 -0
- package/dist/src/schema/index.js.map +1 -1
- package/dist/src/schema/tenant.graphql.d.ts.map +1 -1
- package/dist/src/schema/tenant.graphql.js +32 -6
- package/dist/src/schema/tenant.graphql.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/cases/integration/db/invite.test.js +2 -2
- package/dist/tests/cases/integration/db/unmanagedInvite.test.js +2 -2
- package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.d.ts +1 -1
- package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +1 -0
- package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.js +19 -9
- package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.js.map +1 -0
- package/dist/tests/src/IdPMock.d.ts +4 -4
- package/dist/tests/src/IdPMock.d.ts.map +1 -1
- package/dist/tests/src/IdPMock.js +2 -2
- package/dist/tests/src/IdPMock.js.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/src/TenantContainer.ts +4 -2
- package/src/bin/runMigrations.ts +32 -0
- package/src/migrations/{2018-08-02-174310-init.sql → 2018-08-02-174310-init.ts} +8 -1
- package/src/migrations/{2018-09-03-140621-identity-project.sql → 2018-09-03-140621-identity-project.ts} +8 -0
- package/src/migrations/{2018-10-26-165450-setup-api-key.sql → 2018-10-26-165450-setup-api-key.ts} +8 -0
- package/src/migrations/{2018-10-26-175155-variables.sql → 2018-10-26-175155-variables.ts} +7 -0
- package/src/migrations/{2019-02-18-110949-project-slug.sql → 2019-02-18-110949-project-slug.ts} +8 -0
- package/src/migrations/2019-02-18-160155-session-expiration.ts +10 -0
- package/src/migrations/{2019-05-03-163729-api-key-disabled-at.sql → 2019-05-03-163729-api-key-disabled-at.ts} +8 -0
- package/src/migrations/2019-08-14-153300-project-slug-unique.ts +10 -0
- package/src/migrations/{2019-09-06-111000-membership.sql → 2019-09-06-111000-membership.ts} +8 -0
- package/src/migrations/2019-09-06-111001-drop-old-member.ts +10 -0
- package/src/migrations/2020-01-29-idenity-note.ts +18 -0
- package/src/migrations/2020-04-17-fix-person-index.ts +12 -0
- package/src/migrations/2020-05-01-170000-api-key-index.ts +10 -0
- package/src/migrations/2020-06-08-134000-tenant-credentials.ts +3 -54
- package/src/migrations/2020-08-07-110000-person-otp.ts +12 -0
- package/src/migrations/{2020-08-17-162200-mail-templates.sql → 2020-08-17-162200-mail-templates.ts} +8 -0
- package/src/migrations/{2020-08-21-143400-person-password-reset.sql → 2020-08-21-143400-person-password-reset.ts} +8 -0
- package/src/migrations/{2020-09-07-094200-identity-provider.sql → 2020-09-07-094200-identity-provider.ts} +8 -0
- package/src/migrations/{2021-03-28-134000-timestamp.sql → 2021-03-28-134000-timestamp.ts} +9 -0
- package/src/migrations/2021-07-26-105000-project-config.ts +12 -0
- package/src/migrations/{2021-07-26-132000-project-secrets.sql → 2021-07-26-132000-project-secrets.ts} +8 -0
- package/src/migrations/2021-07-27-174000-project-alias-index.ts +10 -0
- package/src/migrations/2021-11-24-130000-person-password-null.ts +10 -0
- package/src/migrations/{2021-11-24-161500-mail-template-project-null.sql → 2021-11-24-161500-mail-template-project-null.ts} +8 -0
- package/src/migrations/2022-01-04-144000-person-unique-identity.ts +10 -0
- package/src/migrations/{2022-02-09-111800-fix-crypted.sql → 2022-02-09-111800-fix-crypted.ts} +8 -0
- package/src/migrations/2022-02-11-153000-idp-auto-sign-up.ts +10 -0
- package/src/migrations/{2022-06-29-105000-person-idp.sql → 2022-06-29-105000-person-idp.ts} +8 -0
- package/src/migrations/2022-07-07-135000-person-email-opt-uniq.ts +11 -0
- package/src/migrations/2022-07-07-141000-person-display-name.ts +13 -0
- package/src/migrations/{2022-07-14-145000-person-login-options.sql → 2022-07-14-145000-person-login-options.ts} +9 -0
- package/src/migrations/2022-11-08-project-update-notification.ts +64 -0
- package/src/migrations/runner.ts +72 -8
- package/src/migrations/snapshot-factory.ts +21 -0
- package/src/migrations/snapshot-template-end.txt +10 -0
- package/src/migrations/snapshot-template-start.txt +6 -0
- package/src/migrations/snapshot.ts +202 -0
- package/src/migrations/tenantCredentials.ts +58 -0
- package/src/migrations/types.ts +3 -0
- package/src/model/commands/idp/UpdateIdpCommand.ts +1 -0
- package/src/model/queries/membership/ProjectMembersQuery.ts +23 -14
- package/src/model/service/IDPSignInManager.ts +13 -10
- package/src/model/service/ProjectMemberManager.ts +3 -3
- package/src/model/service/idp/IDPHandlerRegistry.ts +3 -3
- package/src/model/service/idp/IDPManager.ts +6 -2
- package/src/model/service/idp/IdentityProviderHandler.ts +7 -15
- package/src/model/service/idp/index.ts +3 -1
- package/src/model/service/idp/providers/AppleProvider.ts +65 -0
- package/src/model/service/idp/providers/FacebookProvider.ts +125 -0
- package/src/model/service/idp/providers/OIDCHelpers.ts +54 -0
- package/src/model/service/idp/providers/OIDCProvider.ts +40 -0
- package/src/model/service/idp/providers/OIDCTypes.ts +61 -0
- package/src/model/service/idp/providers/helpers.ts +12 -0
- package/src/model/utils/DatabaseContext.ts +6 -0
- package/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts +1 -0
- package/src/resolvers/mutation/person/IDPMutationResolver.ts +9 -7
- package/src/resolvers/types/ProjectTypeResolver.ts +9 -2
- package/src/schema/index.ts +28 -8
- package/src/schema/tenant.graphql.ts +32 -6
- package/src/tsconfig.json +10 -30
- package/tests/cases/integration/db/invite.test.ts +2 -2
- package/tests/cases/integration/db/unmanagedInvite.test.ts +2 -2
- package/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.ts +17 -9
- package/tests/src/IdPMock.ts +4 -4
- package/tests/tsconfig.json +2 -6
- package/tsconfig.json +2 -6
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +0 -1
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.js.map +0 -1
- package/dist/src/model/service/idp/OIDCProvider.d.ts +0 -25
- package/dist/src/model/service/idp/OIDCProvider.d.ts.map +0 -1
- package/dist/src/model/service/idp/OIDCProvider.js +0 -108
- package/dist/src/model/service/idp/OIDCProvider.js.map +0 -1
- package/src/migrations/2019-02-18-160155-session-expiration.sql +0 -2
- package/src/migrations/2019-08-14-153300-project-slug-unique.sql +0 -2
- package/src/migrations/2019-09-06-111001-drop-old-member.sql +0 -2
- package/src/migrations/2020-01-29-idenity-note.sql +0 -9
- package/src/migrations/2020-04-17-fix-person-index.sql +0 -3
- package/src/migrations/2020-05-01-170000-api-key-index.sql +0 -1
- package/src/migrations/2020-08-07-110000-person-otp.sql +0 -3
- package/src/migrations/2021-07-26-105000-project-config.sql +0 -3
- package/src/migrations/2021-07-27-174000-project-alias-index.sql +0 -1
- package/src/migrations/2021-11-24-130000-person-password-null.sql +0 -1
- package/src/migrations/2022-01-04-144000-person-unique-identity.sql +0 -2
- package/src/migrations/2022-02-11-153000-idp-auto-sign-up.sql +0 -2
- package/src/migrations/2022-07-07-135000-person-email-opt-uniq.sql +0 -3
- package/src/migrations/2022-07-07-141000-person-display-name.sql +0 -4
- package/src/model/service/idp/OIDCProvider.ts +0 -100
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-tenant-api",
|
|
3
|
-
"version": "1.2
|
|
3
|
+
"version": "1.3.0-alpha.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -9,25 +9,26 @@
|
|
|
9
9
|
"test": "vitest --no-threads"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@contember/authorization": "^1.2
|
|
13
|
-
"@contember/config-loader": "^1.2
|
|
14
|
-
"@contember/database": "^1.2
|
|
15
|
-
"@contember/database-migrations": "^1.2
|
|
16
|
-
"@contember/dic": "^1.2
|
|
17
|
-
"@contember/
|
|
18
|
-
"@contember/
|
|
19
|
-
"@contember/
|
|
20
|
-
"@contember/schema": "^1.2
|
|
21
|
-
"@contember/
|
|
12
|
+
"@contember/authorization": "^1.3.0-alpha.2",
|
|
13
|
+
"@contember/config-loader": "^1.3.0-alpha.2",
|
|
14
|
+
"@contember/database": "^1.3.0-alpha.2",
|
|
15
|
+
"@contember/database-migrations": "^1.3.0-alpha.2",
|
|
16
|
+
"@contember/dic": "^1.3.0-alpha.2",
|
|
17
|
+
"@contember/graphql-utils": "^1.3.0-alpha.2",
|
|
18
|
+
"@contember/logger": "^1.3.0-alpha.2",
|
|
19
|
+
"@contember/schema": "^1.3.0-alpha.2",
|
|
20
|
+
"@contember/schema-utils": "^1.3.0-alpha.2",
|
|
21
|
+
"@contember/typesafe": "^1.3.0-alpha.2",
|
|
22
22
|
"@graphql-tools/utils": "^8.6.13",
|
|
23
23
|
"graphql-tag": "^2.12.5",
|
|
24
|
+
"jose": "^4.10",
|
|
24
25
|
"mustache": "^4.0.0",
|
|
25
26
|
"nodemailer": "^6.4.2",
|
|
26
|
-
"openid-client": "^
|
|
27
|
+
"openid-client": "^5.3.1",
|
|
27
28
|
"otpauth": "^7.0.6"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@contember/database-tester": "^1.2
|
|
31
|
+
"@contember/database-tester": "^1.3.0-alpha.2",
|
|
31
32
|
"@graphql-codegen/cli": "^2.6.2",
|
|
32
33
|
"@graphql-codegen/typescript": "^2.5.1",
|
|
33
34
|
"@graphql-codegen/typescript-operations": "^2.4.2",
|
package/src/TenantContainer.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Builder } from '@contember/dic'
|
|
|
4
4
|
import {
|
|
5
5
|
AclSchemaAccessNodeFactory,
|
|
6
6
|
ApiKeyManager,
|
|
7
|
-
ApiKeyService,
|
|
7
|
+
ApiKeyService, AppleProvider,
|
|
8
8
|
DatabaseContext,
|
|
9
|
-
DatabaseContextFactory,
|
|
9
|
+
DatabaseContextFactory, FacebookProvider,
|
|
10
10
|
Identity,
|
|
11
11
|
IdentityFactory,
|
|
12
12
|
IDPHandlerRegistry,
|
|
@@ -158,6 +158,8 @@ export class TenantContainerFactory {
|
|
|
158
158
|
.addService('idpRegistry', () => {
|
|
159
159
|
const idpRegistry = new IDPHandlerRegistry()
|
|
160
160
|
idpRegistry.registerHandler('oidc', new OIDCProvider())
|
|
161
|
+
idpRegistry.registerHandler('facebook', new FacebookProvider())
|
|
162
|
+
idpRegistry.registerHandler('apple', new AppleProvider())
|
|
161
163
|
return idpRegistry
|
|
162
164
|
})
|
|
163
165
|
.addService('idpSignInManager', ({ apiKeyManager, idpRegistry }) =>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TenantMigrationsRunner } from '../migrations'
|
|
2
|
+
import { createLogger, PrettyPrintLoggerHandler } from '@contember/logger'
|
|
3
|
+
|
|
4
|
+
let uuidNum = 0
|
|
5
|
+
const dummyUuid = () => '123e4567-e89b-12d3-a456-' + (uuidNum++).toString().padStart(12, '0')
|
|
6
|
+
|
|
7
|
+
;(async () => {
|
|
8
|
+
const migrationsRunner = new TenantMigrationsRunner(
|
|
9
|
+
{
|
|
10
|
+
database: process.env.PGDATABASE as string,
|
|
11
|
+
host: process.env.PGHOST as string,
|
|
12
|
+
password: process.env.PGPASSWORD as string,
|
|
13
|
+
user: process.env.PGUSER as string,
|
|
14
|
+
port: process.env.PGPORT ? Number(process.env.PGPORT) : 5432,
|
|
15
|
+
},
|
|
16
|
+
'tenant',
|
|
17
|
+
{
|
|
18
|
+
rootToken: '0',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
bcrypt: () => {
|
|
22
|
+
throw new Error()
|
|
23
|
+
},
|
|
24
|
+
uuid: dummyUuid,
|
|
25
|
+
},
|
|
26
|
+
)
|
|
27
|
+
await migrationsRunner.run(createLogger(new PrettyPrintLoggerHandler(process.stderr)))
|
|
28
|
+
})().catch(e => {
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.error(e)
|
|
31
|
+
process.exit(1)
|
|
32
|
+
})
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE "identity" (
|
|
2
5
|
"id" uuid NOT NULL,
|
|
3
6
|
"parent_id" uuid,
|
|
@@ -53,4 +56,8 @@ CREATE TABLE "project_member" (
|
|
|
53
56
|
);
|
|
54
57
|
|
|
55
58
|
CREATE UNIQUE INDEX project_member_project_id_person_id ON "project_member" ("project_id", "person_id");
|
|
56
|
-
CREATE INDEX "project_member_person_id" ON "project_member" ("person_id")
|
|
59
|
+
CREATE INDEX "project_member_person_id" ON "project_member" ("person_id");`
|
|
60
|
+
|
|
61
|
+
export default async function (builder: MigrationBuilder) {
|
|
62
|
+
builder.sql(sql)
|
|
63
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE "project_member"
|
|
2
5
|
ADD COLUMN "identity_id" UUID DEFAULT NULL,
|
|
3
6
|
ADD COLUMN "roles" jsonb NOT NULL DEFAULT '[]' :: jsonb;
|
|
@@ -22,3 +25,8 @@ ALTER TABLE "project_member"
|
|
|
22
25
|
ALTER "roles" DROP DEFAULT,
|
|
23
26
|
ALTER "identity_id" DROP DEFAULT,
|
|
24
27
|
ALTER "identity_id" SET NOT NULL;
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
export default async function (builder: MigrationBuilder) {
|
|
31
|
+
builder.sql(sql)
|
|
32
|
+
}
|
package/src/migrations/{2018-10-26-165450-setup-api-key.sql → 2018-10-26-165450-setup-api-key.ts}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
DO
|
|
2
5
|
$BLOCK$
|
|
3
6
|
BEGIN
|
|
@@ -16,3 +19,8 @@ $BLOCK$
|
|
|
16
19
|
END IF;
|
|
17
20
|
END
|
|
18
21
|
$BLOCK$;
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export default async function (builder: MigrationBuilder) {
|
|
25
|
+
builder.sql(sql)
|
|
26
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE "project_member_variable" (
|
|
2
5
|
"id" uuid NOT NULL,
|
|
3
6
|
"project_id" uuid NOT NULL,
|
|
@@ -12,3 +15,7 @@ CREATE TABLE "project_member_variable" (
|
|
|
12
15
|
ON DELETE CASCADE,
|
|
13
16
|
CONSTRAINT project_member_variable_unique UNIQUE ("project_id", "identity_id", "variable")
|
|
14
17
|
);
|
|
18
|
+
`
|
|
19
|
+
export default async function (builder: MigrationBuilder) {
|
|
20
|
+
builder.sql(sql)
|
|
21
|
+
}
|
package/src/migrations/{2019-02-18-110949-project-slug.sql → 2019-02-18-110949-project-slug.ts}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE "project"
|
|
2
5
|
ADD COLUMN slug TEXT DEFAULT NULL;
|
|
3
6
|
|
|
@@ -7,3 +10,8 @@ SET slug = name;
|
|
|
7
10
|
ALTER TABLE "project"
|
|
8
11
|
ALTER slug DROP DEFAULT,
|
|
9
12
|
ALTER slug SET NOT NULL;
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export default async function (builder: MigrationBuilder) {
|
|
16
|
+
builder.sql(sql)
|
|
17
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE "api_key"
|
|
2
5
|
ADD COLUMN "disabled_at" TIMESTAMP;
|
|
3
6
|
|
|
@@ -7,3 +10,8 @@ WHERE "enabled" = FALSE;
|
|
|
7
10
|
|
|
8
11
|
ALTER TABLE "api_key"
|
|
9
12
|
DROP COLUMN "enabled";
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export default async function (builder: MigrationBuilder) {
|
|
16
|
+
builder.sql(sql)
|
|
17
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE project_membership (
|
|
2
5
|
id UUID NOT NULL PRIMARY KEY,
|
|
3
6
|
project_id UUID NOT NULL,
|
|
@@ -40,3 +43,8 @@ INSERT
|
|
|
40
43
|
INTO project_membership_variable(id, membership_id, variable, value)
|
|
41
44
|
SELECT public.uuid_generate_v4(), data.id, data.variable, data.value
|
|
42
45
|
FROM data;
|
|
46
|
+
`
|
|
47
|
+
|
|
48
|
+
export default async function (builder: MigrationBuilder) {
|
|
49
|
+
builder.sql(sql)
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
4
|
+
ALTER TABLE identity
|
|
5
|
+
ADD COLUMN description TEXT,
|
|
6
|
+
ADD COLUMN created_at TIMESTAMP;
|
|
7
|
+
|
|
8
|
+
UPDATE identity
|
|
9
|
+
SET created_at = NOW();
|
|
10
|
+
|
|
11
|
+
ALTER TABLE identity
|
|
12
|
+
ALTER created_at SET NOT NULL;
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export default async function (builder: MigrationBuilder) {
|
|
16
|
+
builder.sql(sql)
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
4
|
+
DROP INDEX "person_identity_id";
|
|
5
|
+
|
|
6
|
+
CREATE INDEX "person_identity_id" ON "person" USING btree ("identity_id");
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
export default async function (builder: MigrationBuilder) {
|
|
10
|
+
builder.sql(sql)
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -1,58 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
2
|
import { TenantMigrationArgs } from './types'
|
|
3
|
+
import { createCredentials } from './tenantCredentials'
|
|
3
4
|
|
|
4
5
|
export default async function (builder: MigrationBuilder, args: TenantMigrationArgs) {
|
|
5
|
-
|
|
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"(), ${escapeValue(tokenHash)}, 'permanent', identity.id, NULL, NULL, NULL, now()
|
|
15
|
-
FROM identity
|
|
16
|
-
`)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!credentials.rootTokenHash) {
|
|
20
|
-
throw 'Please specify a root token using CONTEMBER_ROOT_TOKEN env variable.'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (credentials.rootEmail && !credentials.rootPasswordBcrypted) {
|
|
24
|
-
throw 'Please specify a root password using CONTEMBER_ROOT_PASSWORD env variable.'
|
|
25
|
-
}
|
|
26
|
-
const rootEmail = credentials.rootPasswordBcrypted ? credentials.rootEmail || 'root@localhost' : null
|
|
27
|
-
const rootPasswordHash = credentials.rootPasswordBcrypted || null
|
|
28
|
-
|
|
29
|
-
const rootTokenHash = credentials.rootTokenHash
|
|
30
|
-
|
|
31
|
-
builder.sql(`
|
|
32
|
-
WITH identity AS (
|
|
33
|
-
INSERT INTO identity(id, parent_id, roles, description, created_at)
|
|
34
|
-
VALUES (
|
|
35
|
-
public."uuid_generate_v4"(),
|
|
36
|
-
NULL,
|
|
37
|
-
'["super_admin"]'::JSONB
|
|
38
|
-
|| (CASE WHEN ${escapeValue(rootEmail)} IS NOT NULL THEN '["person"]'::JSONB ELSE '[]'::JSONB END),
|
|
39
|
-
'Superadmin',
|
|
40
|
-
now()
|
|
41
|
-
) RETURNING id
|
|
42
|
-
),
|
|
43
|
-
person AS (
|
|
44
|
-
INSERT INTO person(id, email, password_hash, identity_id)
|
|
45
|
-
SELECT public."uuid_generate_v4"(), ${escapeValue(rootEmail)}, ${escapeValue(rootPasswordHash)}, identity.id
|
|
46
|
-
FROM identity
|
|
47
|
-
WHERE ${escapeValue(rootEmail)} IS NOT NULL
|
|
48
|
-
RETURNING id
|
|
49
|
-
),
|
|
50
|
-
api_key AS (
|
|
51
|
-
INSERT INTO api_key (id, token_hash, type, identity_id, disabled_at, expires_at, expiration, created_at)
|
|
52
|
-
SELECT public."uuid_generate_v4"(), ${escapeValue(rootTokenHash)}, 'permanent', identity.id, NULL, NULL, NULL, now()
|
|
53
|
-
FROM identity WHERE ${escapeValue(rootTokenHash)} IS NOT NULL
|
|
54
|
-
RETURNING id
|
|
55
|
-
)
|
|
56
|
-
SELECT * FROM person, api_key
|
|
57
|
-
`)
|
|
6
|
+
await createCredentials(builder, args)
|
|
58
7
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
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
|
+
|
|
9
|
+
export default async function (builder: MigrationBuilder) {
|
|
10
|
+
builder.sql(sql)
|
|
11
|
+
}
|
|
12
|
+
|
package/src/migrations/{2020-08-17-162200-mail-templates.sql → 2020-08-17-162200-mail-templates.ts}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE mail_template (
|
|
2
5
|
id UUID NOT NULL PRIMARY KEY,
|
|
3
6
|
project_id UUID NOT NULL,
|
|
@@ -12,3 +15,8 @@ CREATE TABLE mail_template (
|
|
|
12
15
|
CREATE UNIQUE INDEX mail_template_identifier ON mail_template(project_id, mail_type, variant);
|
|
13
16
|
CREATE INDEX mail_template_project_index
|
|
14
17
|
ON mail_template(project_id);
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export default async function (builder: MigrationBuilder) {
|
|
21
|
+
builder.sql(sql)
|
|
22
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE person_password_reset (
|
|
2
5
|
id UUID NOT NULL,
|
|
3
6
|
token_hash TEXT NOT NULL,
|
|
@@ -12,4 +15,9 @@ CREATE TABLE person_password_reset (
|
|
|
12
15
|
|
|
13
16
|
CREATE UNIQUE INDEX person_password_reset_token
|
|
14
17
|
ON person_password_reset(token_hash);
|
|
18
|
+
`
|
|
19
|
+
|
|
15
20
|
|
|
21
|
+
export default async function (builder: MigrationBuilder) {
|
|
22
|
+
builder.sql(sql)
|
|
23
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE identity_provider (
|
|
2
5
|
id UUID NOT NULL,
|
|
3
6
|
slug TEXT UNIQUE NOT NULL,
|
|
@@ -6,3 +9,8 @@ CREATE TABLE identity_provider (
|
|
|
6
9
|
disabled_at TIMESTAMP DEFAULT NULL,
|
|
7
10
|
CONSTRAINT identity_provider_id PRIMARY KEY ("id")
|
|
8
11
|
);
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export default async function (builder: MigrationBuilder) {
|
|
15
|
+
builder.sql(sql)
|
|
16
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE identity_provider
|
|
2
5
|
ALTER disabled_at TYPE TIMESTAMPTZ;
|
|
3
6
|
|
|
@@ -16,4 +19,10 @@ ALTER TABLE person_password_reset
|
|
|
16
19
|
ALTER expires_at TYPE TIMESTAMPTZ,
|
|
17
20
|
ALTER created_at TYPE TIMESTAMPTZ,
|
|
18
21
|
ALTER used_at TYPE TIMESTAMPTZ;
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
export default async function (builder: MigrationBuilder) {
|
|
25
|
+
builder.sql(sql)
|
|
26
|
+
}
|
|
27
|
+
|
|
19
28
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
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
|
+
|
|
9
|
+
export default async function (builder: MigrationBuilder) {
|
|
10
|
+
builder.sql(sql)
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE project_secret
|
|
2
5
|
(
|
|
3
6
|
id UUID NOT NULL PRIMARY KEY,
|
|
@@ -13,3 +16,8 @@ CREATE TABLE project_secret
|
|
|
13
16
|
CREATE UNIQUE INDEX project_secret_unique ON project_secret (project_id, key);
|
|
14
17
|
CREATE INDEX project_secret_project_index
|
|
15
18
|
ON project_secret (project_id);
|
|
19
|
+
`
|
|
20
|
+
|
|
21
|
+
export default async function (builder: MigrationBuilder) {
|
|
22
|
+
builder.sql(sql)
|
|
23
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE "mail_template" ALTER COLUMN "project_id" DROP NOT NULL;
|
|
2
5
|
|
|
3
6
|
DROP INDEX mail_template_identifier;
|
|
@@ -7,3 +10,8 @@ CREATE UNIQUE INDEX mail_template_identifier
|
|
|
7
10
|
|
|
8
11
|
CREATE UNIQUE INDEX mail_template_identifier_global
|
|
9
12
|
ON mail_template (mail_type, variant) WHERE project_id IS NULL;
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export default async function (builder: MigrationBuilder) {
|
|
16
|
+
builder.sql(sql)
|
|
17
|
+
}
|
package/src/migrations/{2022-02-09-111800-fix-crypted.sql → 2022-02-09-111800-fix-crypted.ts}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE project_secret
|
|
2
5
|
ADD COLUMN value BYTEA,
|
|
3
6
|
ADD COLUMN version SMALLINT;
|
|
@@ -11,3 +14,8 @@ ALTER TABLE project_secret
|
|
|
11
14
|
ALTER version SET NOT NULL,
|
|
12
15
|
DROP value_encrypted,
|
|
13
16
|
DROP iv;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export default async function (builder: MigrationBuilder) {
|
|
20
|
+
builder.sql(sql)
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
4
|
+
ALTER TABLE identity_provider
|
|
5
|
+
ADD COLUMN auto_sign_up BOOLEAN NOT NULL DEFAULT FALSE;
|
|
6
|
+
`
|
|
7
|
+
|
|
8
|
+
export default async function (builder: MigrationBuilder) {
|
|
9
|
+
builder.sql(sql)
|
|
10
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
CREATE TABLE person_identity_provider
|
|
2
5
|
(
|
|
3
6
|
id UUID NOT NULL PRIMARY KEY,
|
|
@@ -12,3 +15,8 @@ CREATE TABLE person_identity_provider
|
|
|
12
15
|
CREATE INDEX person_identity_provider_person_id ON person_identity_provider (person_id);
|
|
13
16
|
CREATE UNIQUE INDEX person_identity_provider_identifier
|
|
14
17
|
ON person_identity_provider (identity_provider_id, external_identifier);
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export default async function (builder: MigrationBuilder) {
|
|
21
|
+
builder.sql(sql)
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
4
|
+
ALTER TABLE person
|
|
5
|
+
ALTER email DROP NOT NULL,
|
|
6
|
+
ADD CONSTRAINT email_unique UNIQUE (email);
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
export default async function (builder: MigrationBuilder) {
|
|
10
|
+
builder.sql(sql)
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
4
|
+
ALTER TABLE person
|
|
5
|
+
ADD name TEXT;
|
|
6
|
+
UPDATE person
|
|
7
|
+
SET name = SPLIT_PART(email, '@', 1);
|
|
8
|
+
`
|
|
9
|
+
|
|
10
|
+
export default async function (builder: MigrationBuilder) {
|
|
11
|
+
builder.sql(sql)
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { MigrationBuilder } from '@contember/database-migrations'
|
|
2
|
+
|
|
3
|
+
const sql = `
|
|
1
4
|
ALTER TABLE person
|
|
2
5
|
ADD idp_only BOOLEAN NOT NULL DEFAULT FALSE,
|
|
3
6
|
ADD CONSTRAINT idp_only_no_email CHECK ( idp_only = FALSE OR (idp_only = TRUE AND email IS NULL));
|
|
4
7
|
|
|
5
8
|
ALTER TABLE identity_provider
|
|
6
9
|
ADD exclusive BOOLEAN DEFAULT FALSE;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export default async function (builder: MigrationBuilder) {
|
|
13
|
+
builder.sql(sql)
|
|
14
|
+
}
|
|
15
|
+
|