@contember/cli 2.2.0-alpha.1 → 2.2.0-alpha.10
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/CLAUDE.md +35 -41
- package/dist/development/run.cjs +12 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +12 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs +30 -15
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js +31 -16
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs +21 -41
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js +22 -42
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs +15 -13
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js +15 -13
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs +28 -16
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js +29 -17
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs +51 -22
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js +52 -23
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs +28 -16
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js +29 -17
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs +56 -29
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +57 -30
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +64 -24
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +65 -25
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs +2 -2
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.js +2 -2
- package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs +7 -3
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js +8 -4
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +73 -25
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +74 -26
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +7 -2
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +7 -2
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs +11 -4
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js +11 -4
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs +24 -4
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js +25 -5
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs +39 -8
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js +40 -9
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +5 -5
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js +5 -5
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +6 -7
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js +6 -7
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -1
- package/dist/development/src/commands/misc/CommandsCommand.cjs +58 -0
- package/dist/development/src/commands/misc/CommandsCommand.cjs.map +1 -0
- package/dist/development/src/commands/misc/CommandsCommand.js +58 -0
- package/dist/development/src/commands/misc/CommandsCommand.js.map +1 -0
- package/dist/development/src/commands/misc/VersionCommand.cjs +2 -3
- package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/development/src/commands/misc/VersionCommand.js +2 -3
- package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +12 -12
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js +13 -13
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs +17 -15
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js +18 -16
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs +40 -12
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.js +42 -14
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs +32 -12
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.js +33 -13
- package/dist/development/src/commands/tenant/TenantApplyCommand.js.map +1 -1
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyCreateCommand.cjs +68 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyCreateCommand.js +68 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyCreateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyDisableCommand.cjs +31 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyDisableCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyDisableCommand.js +31 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyDisableCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyListCommand.cjs +55 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyListCommand.js +55 -0
- package/dist/development/src/commands/tenant/apikey/TenantApiKeyListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberAddCommand.cjs +36 -0
- package/dist/development/src/commands/tenant/member/TenantMemberAddCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberAddCommand.js +36 -0
- package/dist/development/src/commands/tenant/member/TenantMemberAddCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteCommand.cjs +62 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteCommand.js +62 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.cjs +102 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.js +102 -0
- package/dist/development/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberListCommand.cjs +73 -0
- package/dist/development/src/commands/tenant/member/TenantMemberListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberListCommand.js +73 -0
- package/dist/development/src/commands/tenant/member/TenantMemberListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberRemoveCommand.cjs +35 -0
- package/dist/development/src/commands/tenant/member/TenantMemberRemoveCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberRemoveCommand.js +35 -0
- package/dist/development/src/commands/tenant/member/TenantMemberRemoveCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberUpdateCommand.cjs +45 -0
- package/dist/development/src/commands/tenant/member/TenantMemberUpdateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/TenantMemberUpdateCommand.js +45 -0
- package/dist/development/src/commands/tenant/member/TenantMemberUpdateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/member/memberOptions.cjs +16 -0
- package/dist/development/src/commands/tenant/member/memberOptions.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/memberOptions.js +16 -0
- package/dist/development/src/commands/tenant/member/memberOptions.js.map +1 -0
- package/dist/development/src/commands/tenant/member/membershipInput.cjs +109 -0
- package/dist/development/src/commands/tenant/member/membershipInput.cjs.map +1 -0
- package/dist/development/src/commands/tenant/member/membershipInput.js +109 -0
- package/dist/development/src/commands/tenant/member/membershipInput.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleAddCommand.cjs +27 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleAddCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleAddCommand.js +27 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleAddCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.cjs +34 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.js +34 -0
- package/dist/development/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonCreateCommand.cjs +79 -0
- package/dist/development/src/commands/tenant/person/TenantPersonCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonCreateCommand.js +79 -0
- package/dist/development/src/commands/tenant/person/TenantPersonCreateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonDisableCommand.cjs +29 -0
- package/dist/development/src/commands/tenant/person/TenantPersonDisableCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonDisableCommand.js +29 -0
- package/dist/development/src/commands/tenant/person/TenantPersonDisableCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonListCommand.cjs +53 -0
- package/dist/development/src/commands/tenant/person/TenantPersonListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonListCommand.js +53 -0
- package/dist/development/src/commands/tenant/person/TenantPersonListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetMfaCommand.cjs +37 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetMfaCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetMfaCommand.js +37 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetMfaCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.cjs +47 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.js +47 -0
- package/dist/development/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSetPasswordCommand.cjs +46 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSetPasswordCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSetPasswordCommand.js +46 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSetPasswordCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonShowCommand.cjs +55 -0
- package/dist/development/src/commands/tenant/person/TenantPersonShowCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonShowCommand.js +55 -0
- package/dist/development/src/commands/tenant/person/TenantPersonShowCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSignOutCommand.cjs +38 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSignOutCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSignOutCommand.js +38 -0
- package/dist/development/src/commands/tenant/person/TenantPersonSignOutCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonUpdateCommand.cjs +36 -0
- package/dist/development/src/commands/tenant/person/TenantPersonUpdateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantPersonUpdateCommand.js +36 -0
- package/dist/development/src/commands/tenant/person/TenantPersonUpdateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantSessionCreateCommand.cjs +65 -0
- package/dist/development/src/commands/tenant/person/TenantSessionCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/TenantSessionCreateCommand.js +65 -0
- package/dist/development/src/commands/tenant/person/TenantSessionCreateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/person/personInput.cjs +77 -0
- package/dist/development/src/commands/tenant/person/personInput.cjs.map +1 -0
- package/dist/development/src/commands/tenant/person/personInput.js +77 -0
- package/dist/development/src/commands/tenant/person/personInput.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantAuthLogCommand.cjs +96 -0
- package/dist/development/src/commands/tenant/policy/TenantAuthLogCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantAuthLogCommand.js +96 -0
- package/dist/development/src/commands/tenant/policy/TenantAuthLogCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateAddCommand.cjs +59 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateAddCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateAddCommand.js +59 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateAddCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateListCommand.cjs +41 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateListCommand.js +41 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.cjs +42 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.js +42 -0
- package/dist/development/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyCreateCommand.cjs +36 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyCreateCommand.js +36 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyCreateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyDeleteCommand.cjs +31 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyDeleteCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyDeleteCommand.js +31 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyDeleteCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyListCommand.cjs +33 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyListCommand.js +33 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyUpdateCommand.cjs +38 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyUpdateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyUpdateCommand.js +38 -0
- package/dist/development/src/commands/tenant/policy/TenantPolicyUpdateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/policy/policyInput.cjs +167 -0
- package/dist/development/src/commands/tenant/policy/policyInput.cjs.map +1 -0
- package/dist/development/src/commands/tenant/policy/policyInput.js +167 -0
- package/dist/development/src/commands/tenant/policy/policyInput.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantConfigShowCommand.cjs +24 -0
- package/dist/development/src/commands/tenant/project/TenantConfigShowCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantConfigShowCommand.js +24 -0
- package/dist/development/src/commands/tenant/project/TenantConfigShowCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantIdpListCommand.cjs +22 -0
- package/dist/development/src/commands/tenant/project/TenantIdpListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantIdpListCommand.js +22 -0
- package/dist/development/src/commands/tenant/project/TenantIdpListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectCreateCommand.cjs +53 -0
- package/dist/development/src/commands/tenant/project/TenantProjectCreateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectCreateCommand.js +53 -0
- package/dist/development/src/commands/tenant/project/TenantProjectCreateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectListCommand.cjs +22 -0
- package/dist/development/src/commands/tenant/project/TenantProjectListCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectListCommand.js +22 -0
- package/dist/development/src/commands/tenant/project/TenantProjectListCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectSecretSetCommand.cjs +50 -0
- package/dist/development/src/commands/tenant/project/TenantProjectSecretSetCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectSecretSetCommand.js +50 -0
- package/dist/development/src/commands/tenant/project/TenantProjectSecretSetCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectShowCommand.cjs +23 -0
- package/dist/development/src/commands/tenant/project/TenantProjectShowCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectShowCommand.js +23 -0
- package/dist/development/src/commands/tenant/project/TenantProjectShowCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectUpdateCommand.cjs +53 -0
- package/dist/development/src/commands/tenant/project/TenantProjectUpdateCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantProjectUpdateCommand.js +53 -0
- package/dist/development/src/commands/tenant/project/TenantProjectUpdateCommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantWhoAmICommand.cjs +18 -0
- package/dist/development/src/commands/tenant/project/TenantWhoAmICommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/TenantWhoAmICommand.js +18 -0
- package/dist/development/src/commands/tenant/project/TenantWhoAmICommand.js.map +1 -0
- package/dist/development/src/commands/tenant/project/jsonConfigOption.cjs +26 -0
- package/dist/development/src/commands/tenant/project/jsonConfigOption.cjs.map +1 -0
- package/dist/development/src/commands/tenant/project/jsonConfigOption.js +26 -0
- package/dist/development/src/commands/tenant/project/jsonConfigOption.js.map +1 -0
- package/dist/development/src/commands/tenant/tenantOutput.cjs +35 -0
- package/dist/development/src/commands/tenant/tenantOutput.cjs.map +1 -0
- package/dist/development/src/commands/tenant/tenantOutput.js +35 -0
- package/dist/development/src/commands/tenant/tenantOutput.js.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs +35 -20
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js +38 -23
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs +70 -27
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js +72 -29
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs +79 -29
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js +81 -31
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/utils.cjs +12 -10
- package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/development/src/commands/transfer/utils.js +12 -10
- package/dist/development/src/commands/transfer/utils.js.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +87 -32
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js +89 -34
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/development/src/dic.cjs +152 -47
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +152 -47
- package/dist/development/src/dic.js.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.cjs +55 -2
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.js +55 -2
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.cjs +28 -5
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.js +28 -5
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/development/src/lib/actions/ActionsClient.cjs +18 -6
- package/dist/development/src/lib/actions/ActionsClient.cjs.map +1 -1
- package/dist/development/src/lib/actions/ActionsClient.js +18 -6
- package/dist/development/src/lib/actions/ActionsClient.js.map +1 -1
- package/dist/development/src/lib/actions/resolveActionsClient.cjs +13 -0
- package/dist/development/src/lib/actions/resolveActionsClient.cjs.map +1 -0
- package/dist/development/src/lib/actions/resolveActionsClient.js +13 -0
- package/dist/development/src/lib/actions/resolveActionsClient.js.map +1 -0
- package/dist/development/src/lib/actions/runActionMutationBatch.cjs +44 -0
- package/dist/development/src/lib/actions/runActionMutationBatch.cjs.map +1 -0
- package/dist/development/src/lib/actions/runActionMutationBatch.js +44 -0
- package/dist/development/src/lib/actions/runActionMutationBatch.js.map +1 -0
- package/dist/development/src/lib/admin/AdminClient.cjs +31 -11
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js +31 -11
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs +5 -3
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js +5 -3
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/errors/TransportError.cjs +204 -0
- package/dist/development/src/lib/errors/TransportError.cjs.map +1 -0
- package/dist/development/src/lib/errors/TransportError.js +204 -0
- package/dist/development/src/lib/errors/TransportError.js.map +1 -0
- package/dist/development/src/lib/maskToken.cjs +7 -1
- package/dist/development/src/lib/maskToken.cjs.map +1 -1
- package/dist/development/src/lib/maskToken.js +7 -1
- package/dist/development/src/lib/maskToken.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +97 -50
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +97 -50
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs +80 -64
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js +81 -65
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +2 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +2 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs +14 -10
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js +14 -10
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +12 -4
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +12 -4
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs +5 -3
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js +5 -3
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs +5 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js +5 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/development/src/lib/prompt/prompt.cjs +13 -0
- package/dist/development/src/lib/prompt/prompt.cjs.map +1 -0
- package/dist/development/src/lib/prompt/prompt.internal.cjs +21 -0
- package/dist/development/src/lib/prompt/prompt.internal.cjs.map +1 -0
- package/dist/development/src/lib/prompt/prompt.internal.js +21 -0
- package/dist/development/src/lib/prompt/prompt.internal.js.map +1 -0
- package/dist/development/src/lib/prompt/prompt.js +13 -0
- package/dist/development/src/lib/prompt/prompt.js.map +1 -0
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs +2 -2
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.js +2 -2
- package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs +4 -4
- package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js +4 -4
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantApiTransport.cjs +160 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.js +160 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +110 -26
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantConfigApplier.js +110 -26
- package/dist/development/src/lib/tenant/TenantConfigApplier.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantConnectionProvider.cjs +20 -0
- package/dist/development/src/lib/tenant/TenantConnectionProvider.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConnectionProvider.js +20 -0
- package/dist/development/src/lib/tenant/TenantConnectionProvider.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConnectionResolver.cjs +30 -0
- package/dist/development/src/lib/tenant/TenantConnectionResolver.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConnectionResolver.js +30 -0
- package/dist/development/src/lib/tenant/TenantConnectionResolver.js.map +1 -0
- package/dist/development/src/lib/tenant/authPolicy.cjs +10 -0
- package/dist/development/src/lib/tenant/authPolicy.cjs.map +1 -0
- package/dist/development/src/lib/tenant/authPolicy.js +10 -0
- package/dist/development/src/lib/tenant/authPolicy.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantApiKeyClient.cjs +101 -0
- package/dist/development/src/lib/tenant/clients/TenantApiKeyClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantApiKeyClient.js +101 -0
- package/dist/development/src/lib/tenant/clients/TenantApiKeyClient.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantMemberClient.cjs +96 -0
- package/dist/development/src/lib/tenant/clients/TenantMemberClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantMemberClient.js +96 -0
- package/dist/development/src/lib/tenant/clients/TenantMemberClient.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantPersonClient.cjs +162 -0
- package/dist/development/src/lib/tenant/clients/TenantPersonClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantPersonClient.js +162 -0
- package/dist/development/src/lib/tenant/clients/TenantPersonClient.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.cjs +135 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.js +135 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.cjs +209 -0
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.js +209 -0
- package/dist/development/src/lib/tenant/clients/TenantProjectClient.js.map +1 -0
- package/dist/development/src/lib/tenant/clients/index.cjs +21 -0
- package/dist/development/src/lib/tenant/clients/index.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/index.js +21 -0
- package/dist/development/src/lib/tenant/clients/index.js.map +1 -0
- package/dist/development/src/lib/tenant/confirmation.cjs +23 -0
- package/dist/development/src/lib/tenant/confirmation.cjs.map +1 -0
- package/dist/development/src/lib/tenant/confirmation.js +23 -0
- package/dist/development/src/lib/tenant/confirmation.js.map +1 -0
- package/dist/development/src/lib/tenant/input/pagination.cjs +24 -0
- package/dist/development/src/lib/tenant/input/pagination.cjs.map +1 -0
- package/dist/development/src/lib/tenant/input/pagination.js +24 -0
- package/dist/development/src/lib/tenant/input/pagination.js.map +1 -0
- package/dist/development/src/lib/tenant/input/value.cjs +71 -0
- package/dist/development/src/lib/tenant/input/value.cjs.map +1 -0
- package/dist/development/src/lib/tenant/input/value.js +71 -0
- package/dist/development/src/lib/tenant/input/value.js.map +1 -0
- package/dist/development/src/lib/tenant/stdin.cjs +13 -0
- package/dist/development/src/lib/tenant/stdin.cjs.map +1 -0
- package/dist/development/src/lib/tenant/stdin.js +13 -0
- package/dist/development/src/lib/tenant/stdin.js.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs.map +1 -1
- package/dist/development/src/lib/tenant/tenantConfig.js.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.cjs +290 -54
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js +292 -56
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/transfer/stdio.cjs +3 -8
- package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/development/src/lib/transfer/stdio.js +3 -8
- package/dist/development/src/lib/transfer/stdio.js.map +1 -1
- package/dist/production/run.cjs +12 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +12 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs +30 -15
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js +31 -16
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs +21 -41
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js +22 -42
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs +15 -13
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js +15 -13
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs +28 -16
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js +29 -17
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs +51 -22
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js +52 -23
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs +28 -16
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js +29 -17
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +56 -29
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +57 -30
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +64 -24
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +65 -25
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs +2 -2
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.js +2 -2
- package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs +7 -3
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js +8 -4
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +73 -25
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +74 -26
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +7 -2
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +7 -2
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs +11 -4
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js +11 -4
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs +24 -4
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js +25 -5
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs +39 -8
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js +40 -9
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +5 -5
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js +5 -5
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +6 -7
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js +6 -7
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -1
- package/dist/production/src/commands/misc/CommandsCommand.cjs +58 -0
- package/dist/production/src/commands/misc/CommandsCommand.cjs.map +1 -0
- package/dist/production/src/commands/misc/CommandsCommand.js +58 -0
- package/dist/production/src/commands/misc/CommandsCommand.js.map +1 -0
- package/dist/production/src/commands/misc/VersionCommand.cjs +2 -3
- package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/production/src/commands/misc/VersionCommand.js +2 -3
- package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +12 -12
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js +13 -13
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs +17 -15
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js +18 -16
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs +40 -12
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.js +42 -14
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs +32 -12
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.js +33 -13
- package/dist/production/src/commands/tenant/TenantApplyCommand.js.map +1 -1
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyCreateCommand.cjs +68 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyCreateCommand.js +68 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyCreateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyDisableCommand.cjs +31 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyDisableCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyDisableCommand.js +31 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyDisableCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyListCommand.cjs +55 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyListCommand.js +55 -0
- package/dist/production/src/commands/tenant/apikey/TenantApiKeyListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberAddCommand.cjs +36 -0
- package/dist/production/src/commands/tenant/member/TenantMemberAddCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberAddCommand.js +36 -0
- package/dist/production/src/commands/tenant/member/TenantMemberAddCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteCommand.cjs +62 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteCommand.js +62 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.cjs +102 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.js +102 -0
- package/dist/production/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberListCommand.cjs +73 -0
- package/dist/production/src/commands/tenant/member/TenantMemberListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberListCommand.js +73 -0
- package/dist/production/src/commands/tenant/member/TenantMemberListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberRemoveCommand.cjs +35 -0
- package/dist/production/src/commands/tenant/member/TenantMemberRemoveCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberRemoveCommand.js +35 -0
- package/dist/production/src/commands/tenant/member/TenantMemberRemoveCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberUpdateCommand.cjs +45 -0
- package/dist/production/src/commands/tenant/member/TenantMemberUpdateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/TenantMemberUpdateCommand.js +45 -0
- package/dist/production/src/commands/tenant/member/TenantMemberUpdateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/member/memberOptions.cjs +16 -0
- package/dist/production/src/commands/tenant/member/memberOptions.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/memberOptions.js +16 -0
- package/dist/production/src/commands/tenant/member/memberOptions.js.map +1 -0
- package/dist/production/src/commands/tenant/member/membershipInput.cjs +109 -0
- package/dist/production/src/commands/tenant/member/membershipInput.cjs.map +1 -0
- package/dist/production/src/commands/tenant/member/membershipInput.js +109 -0
- package/dist/production/src/commands/tenant/member/membershipInput.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleAddCommand.cjs +27 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleAddCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleAddCommand.js +27 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleAddCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.cjs +34 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.js +34 -0
- package/dist/production/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonCreateCommand.cjs +79 -0
- package/dist/production/src/commands/tenant/person/TenantPersonCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonCreateCommand.js +79 -0
- package/dist/production/src/commands/tenant/person/TenantPersonCreateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonDisableCommand.cjs +29 -0
- package/dist/production/src/commands/tenant/person/TenantPersonDisableCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonDisableCommand.js +29 -0
- package/dist/production/src/commands/tenant/person/TenantPersonDisableCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonListCommand.cjs +53 -0
- package/dist/production/src/commands/tenant/person/TenantPersonListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonListCommand.js +53 -0
- package/dist/production/src/commands/tenant/person/TenantPersonListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetMfaCommand.cjs +37 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetMfaCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetMfaCommand.js +37 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetMfaCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.cjs +47 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.js +47 -0
- package/dist/production/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSetPasswordCommand.cjs +46 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSetPasswordCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSetPasswordCommand.js +46 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSetPasswordCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonShowCommand.cjs +55 -0
- package/dist/production/src/commands/tenant/person/TenantPersonShowCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonShowCommand.js +55 -0
- package/dist/production/src/commands/tenant/person/TenantPersonShowCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSignOutCommand.cjs +38 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSignOutCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSignOutCommand.js +38 -0
- package/dist/production/src/commands/tenant/person/TenantPersonSignOutCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonUpdateCommand.cjs +36 -0
- package/dist/production/src/commands/tenant/person/TenantPersonUpdateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantPersonUpdateCommand.js +36 -0
- package/dist/production/src/commands/tenant/person/TenantPersonUpdateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantSessionCreateCommand.cjs +65 -0
- package/dist/production/src/commands/tenant/person/TenantSessionCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/TenantSessionCreateCommand.js +65 -0
- package/dist/production/src/commands/tenant/person/TenantSessionCreateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/person/personInput.cjs +77 -0
- package/dist/production/src/commands/tenant/person/personInput.cjs.map +1 -0
- package/dist/production/src/commands/tenant/person/personInput.js +77 -0
- package/dist/production/src/commands/tenant/person/personInput.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantAuthLogCommand.cjs +96 -0
- package/dist/production/src/commands/tenant/policy/TenantAuthLogCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantAuthLogCommand.js +96 -0
- package/dist/production/src/commands/tenant/policy/TenantAuthLogCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateAddCommand.cjs +59 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateAddCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateAddCommand.js +59 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateAddCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateListCommand.cjs +41 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateListCommand.js +41 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.cjs +42 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.js +42 -0
- package/dist/production/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyCreateCommand.cjs +36 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyCreateCommand.js +36 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyCreateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyDeleteCommand.cjs +31 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyDeleteCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyDeleteCommand.js +31 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyDeleteCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyListCommand.cjs +33 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyListCommand.js +33 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyUpdateCommand.cjs +38 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyUpdateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyUpdateCommand.js +38 -0
- package/dist/production/src/commands/tenant/policy/TenantPolicyUpdateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/policy/policyInput.cjs +167 -0
- package/dist/production/src/commands/tenant/policy/policyInput.cjs.map +1 -0
- package/dist/production/src/commands/tenant/policy/policyInput.js +167 -0
- package/dist/production/src/commands/tenant/policy/policyInput.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantConfigShowCommand.cjs +24 -0
- package/dist/production/src/commands/tenant/project/TenantConfigShowCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantConfigShowCommand.js +24 -0
- package/dist/production/src/commands/tenant/project/TenantConfigShowCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantIdpListCommand.cjs +22 -0
- package/dist/production/src/commands/tenant/project/TenantIdpListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantIdpListCommand.js +22 -0
- package/dist/production/src/commands/tenant/project/TenantIdpListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectCreateCommand.cjs +53 -0
- package/dist/production/src/commands/tenant/project/TenantProjectCreateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectCreateCommand.js +53 -0
- package/dist/production/src/commands/tenant/project/TenantProjectCreateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectListCommand.cjs +22 -0
- package/dist/production/src/commands/tenant/project/TenantProjectListCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectListCommand.js +22 -0
- package/dist/production/src/commands/tenant/project/TenantProjectListCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectSecretSetCommand.cjs +50 -0
- package/dist/production/src/commands/tenant/project/TenantProjectSecretSetCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectSecretSetCommand.js +50 -0
- package/dist/production/src/commands/tenant/project/TenantProjectSecretSetCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectShowCommand.cjs +23 -0
- package/dist/production/src/commands/tenant/project/TenantProjectShowCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectShowCommand.js +23 -0
- package/dist/production/src/commands/tenant/project/TenantProjectShowCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectUpdateCommand.cjs +53 -0
- package/dist/production/src/commands/tenant/project/TenantProjectUpdateCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantProjectUpdateCommand.js +53 -0
- package/dist/production/src/commands/tenant/project/TenantProjectUpdateCommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantWhoAmICommand.cjs +18 -0
- package/dist/production/src/commands/tenant/project/TenantWhoAmICommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/TenantWhoAmICommand.js +18 -0
- package/dist/production/src/commands/tenant/project/TenantWhoAmICommand.js.map +1 -0
- package/dist/production/src/commands/tenant/project/jsonConfigOption.cjs +26 -0
- package/dist/production/src/commands/tenant/project/jsonConfigOption.cjs.map +1 -0
- package/dist/production/src/commands/tenant/project/jsonConfigOption.js +26 -0
- package/dist/production/src/commands/tenant/project/jsonConfigOption.js.map +1 -0
- package/dist/production/src/commands/tenant/tenantOutput.cjs +35 -0
- package/dist/production/src/commands/tenant/tenantOutput.cjs.map +1 -0
- package/dist/production/src/commands/tenant/tenantOutput.js +35 -0
- package/dist/production/src/commands/tenant/tenantOutput.js.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs +35 -20
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js +38 -23
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs +70 -27
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js +72 -29
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs +79 -29
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js +81 -31
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/utils.cjs +12 -10
- package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/production/src/commands/transfer/utils.js +12 -10
- package/dist/production/src/commands/transfer/utils.js.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +87 -32
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js +89 -34
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/production/src/dic.cjs +152 -47
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +152 -47
- package/dist/production/src/dic.js.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.cjs +55 -2
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.js +55 -2
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.cjs +28 -5
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.js +28 -5
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/production/src/lib/actions/ActionsClient.cjs +18 -6
- package/dist/production/src/lib/actions/ActionsClient.cjs.map +1 -1
- package/dist/production/src/lib/actions/ActionsClient.js +18 -6
- package/dist/production/src/lib/actions/ActionsClient.js.map +1 -1
- package/dist/production/src/lib/actions/resolveActionsClient.cjs +13 -0
- package/dist/production/src/lib/actions/resolveActionsClient.cjs.map +1 -0
- package/dist/production/src/lib/actions/resolveActionsClient.js +13 -0
- package/dist/production/src/lib/actions/resolveActionsClient.js.map +1 -0
- package/dist/production/src/lib/actions/runActionMutationBatch.cjs +44 -0
- package/dist/production/src/lib/actions/runActionMutationBatch.cjs.map +1 -0
- package/dist/production/src/lib/actions/runActionMutationBatch.js +44 -0
- package/dist/production/src/lib/actions/runActionMutationBatch.js.map +1 -0
- package/dist/production/src/lib/admin/AdminClient.cjs +31 -11
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js +31 -11
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs +5 -3
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js +5 -3
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/errors/TransportError.cjs +204 -0
- package/dist/production/src/lib/errors/TransportError.cjs.map +1 -0
- package/dist/production/src/lib/errors/TransportError.js +204 -0
- package/dist/production/src/lib/errors/TransportError.js.map +1 -0
- package/dist/production/src/lib/maskToken.cjs +7 -1
- package/dist/production/src/lib/maskToken.cjs.map +1 -1
- package/dist/production/src/lib/maskToken.js +7 -1
- package/dist/production/src/lib/maskToken.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +97 -50
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +97 -50
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs +80 -64
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js +81 -65
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +2 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +2 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs +14 -10
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js +14 -10
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +12 -4
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +12 -4
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs +5 -3
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js +5 -3
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs +5 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js +5 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/production/src/lib/prompt/prompt.cjs +13 -0
- package/dist/production/src/lib/prompt/prompt.cjs.map +1 -0
- package/dist/production/src/lib/prompt/prompt.internal.cjs +21 -0
- package/dist/production/src/lib/prompt/prompt.internal.cjs.map +1 -0
- package/dist/production/src/lib/prompt/prompt.internal.js +21 -0
- package/dist/production/src/lib/prompt/prompt.internal.js.map +1 -0
- package/dist/production/src/lib/prompt/prompt.js +13 -0
- package/dist/production/src/lib/prompt/prompt.js.map +1 -0
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs +2 -2
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.js +2 -2
- package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs +4 -4
- package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js +4 -4
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantApiTransport.cjs +160 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.js +160 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +110 -26
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantConfigApplier.js +110 -26
- package/dist/production/src/lib/tenant/TenantConfigApplier.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantConnectionProvider.cjs +20 -0
- package/dist/production/src/lib/tenant/TenantConnectionProvider.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConnectionProvider.js +20 -0
- package/dist/production/src/lib/tenant/TenantConnectionProvider.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConnectionResolver.cjs +30 -0
- package/dist/production/src/lib/tenant/TenantConnectionResolver.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConnectionResolver.js +30 -0
- package/dist/production/src/lib/tenant/TenantConnectionResolver.js.map +1 -0
- package/dist/production/src/lib/tenant/authPolicy.cjs +10 -0
- package/dist/production/src/lib/tenant/authPolicy.cjs.map +1 -0
- package/dist/production/src/lib/tenant/authPolicy.js +10 -0
- package/dist/production/src/lib/tenant/authPolicy.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantApiKeyClient.cjs +101 -0
- package/dist/production/src/lib/tenant/clients/TenantApiKeyClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantApiKeyClient.js +101 -0
- package/dist/production/src/lib/tenant/clients/TenantApiKeyClient.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantMemberClient.cjs +96 -0
- package/dist/production/src/lib/tenant/clients/TenantMemberClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantMemberClient.js +96 -0
- package/dist/production/src/lib/tenant/clients/TenantMemberClient.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantPersonClient.cjs +162 -0
- package/dist/production/src/lib/tenant/clients/TenantPersonClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantPersonClient.js +162 -0
- package/dist/production/src/lib/tenant/clients/TenantPersonClient.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.cjs +135 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.js +135 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.cjs +209 -0
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.js +209 -0
- package/dist/production/src/lib/tenant/clients/TenantProjectClient.js.map +1 -0
- package/dist/production/src/lib/tenant/clients/index.cjs +21 -0
- package/dist/production/src/lib/tenant/clients/index.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/index.js +21 -0
- package/dist/production/src/lib/tenant/clients/index.js.map +1 -0
- package/dist/production/src/lib/tenant/confirmation.cjs +23 -0
- package/dist/production/src/lib/tenant/confirmation.cjs.map +1 -0
- package/dist/production/src/lib/tenant/confirmation.js +23 -0
- package/dist/production/src/lib/tenant/confirmation.js.map +1 -0
- package/dist/production/src/lib/tenant/input/pagination.cjs +24 -0
- package/dist/production/src/lib/tenant/input/pagination.cjs.map +1 -0
- package/dist/production/src/lib/tenant/input/pagination.js +24 -0
- package/dist/production/src/lib/tenant/input/pagination.js.map +1 -0
- package/dist/production/src/lib/tenant/input/value.cjs +71 -0
- package/dist/production/src/lib/tenant/input/value.cjs.map +1 -0
- package/dist/production/src/lib/tenant/input/value.js +71 -0
- package/dist/production/src/lib/tenant/input/value.js.map +1 -0
- package/dist/production/src/lib/tenant/stdin.cjs +13 -0
- package/dist/production/src/lib/tenant/stdin.cjs.map +1 -0
- package/dist/production/src/lib/tenant/stdin.js +13 -0
- package/dist/production/src/lib/tenant/stdin.js.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs.map +1 -1
- package/dist/production/src/lib/tenant/tenantConfig.js.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.cjs +290 -54
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js +292 -56
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/transfer/stdio.cjs +3 -8
- package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/production/src/lib/transfer/stdio.js +3 -8
- package/dist/production/src/lib/transfer/stdio.js.map +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +6 -4
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +5 -4
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +5 -3
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +6 -4
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +5 -3
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +6 -4
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts +11 -3
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +3 -2
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationBlankCommand.d.ts +2 -2
- package/dist/types/commands/migrations/MigrationBlankCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +2 -2
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +4 -3
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +4 -3
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts +2 -2
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +4 -3
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts +5 -3
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +9 -3
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts +2 -2
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts.map +1 -1
- package/dist/types/commands/misc/CommandsCommand.d.ts +13 -0
- package/dist/types/commands/misc/CommandsCommand.d.ts.map +1 -0
- package/dist/types/commands/misc/VersionCommand.d.ts +11 -4
- package/dist/types/commands/misc/VersionCommand.d.ts.map +1 -1
- package/dist/types/commands/misc/index.d.ts +1 -0
- package/dist/types/commands/misc/index.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +5 -3
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +2 -2
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectValidateCommand.d.ts +3 -3
- package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts +10 -3
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts.map +1 -1
- package/dist/types/commands/tenant/apikey/TenantApiKeyCreateCommand.d.ts +22 -0
- package/dist/types/commands/tenant/apikey/TenantApiKeyCreateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/apikey/TenantApiKeyDisableCommand.d.ts +17 -0
- package/dist/types/commands/tenant/apikey/TenantApiKeyDisableCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/apikey/TenantApiKeyListCommand.d.ts +15 -0
- package/dist/types/commands/tenant/apikey/TenantApiKeyListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/apikey/index.d.ts +4 -0
- package/dist/types/commands/tenant/apikey/index.d.ts.map +1 -0
- package/dist/types/commands/tenant/index.d.ts +5 -0
- package/dist/types/commands/tenant/index.d.ts.map +1 -1
- package/dist/types/commands/tenant/member/TenantMemberAddCommand.d.ts +19 -0
- package/dist/types/commands/tenant/member/TenantMemberAddCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/TenantMemberInviteCommand.d.ts +28 -0
- package/dist/types/commands/tenant/member/TenantMemberInviteCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/TenantMemberInviteUnmanagedCommand.d.ts +36 -0
- package/dist/types/commands/tenant/member/TenantMemberInviteUnmanagedCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/TenantMemberListCommand.d.ts +21 -0
- package/dist/types/commands/tenant/member/TenantMemberListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/TenantMemberRemoveCommand.d.ts +17 -0
- package/dist/types/commands/tenant/member/TenantMemberRemoveCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/TenantMemberUpdateCommand.d.ts +20 -0
- package/dist/types/commands/tenant/member/TenantMemberUpdateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/index.d.ts +7 -0
- package/dist/types/commands/tenant/member/index.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/memberOptions.d.ts +16 -0
- package/dist/types/commands/tenant/member/memberOptions.d.ts.map +1 -0
- package/dist/types/commands/tenant/member/membershipInput.d.ts +44 -0
- package/dist/types/commands/tenant/member/membershipInput.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantIdentityRoleAddCommand.d.ts +15 -0
- package/dist/types/commands/tenant/person/TenantIdentityRoleAddCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantIdentityRoleRemoveCommand.d.ts +17 -0
- package/dist/types/commands/tenant/person/TenantIdentityRoleRemoveCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonCreateCommand.d.ts +25 -0
- package/dist/types/commands/tenant/person/TenantPersonCreateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonDisableCommand.d.ts +16 -0
- package/dist/types/commands/tenant/person/TenantPersonDisableCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonListCommand.d.ts +18 -0
- package/dist/types/commands/tenant/person/TenantPersonListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonResetMfaCommand.d.ts +16 -0
- package/dist/types/commands/tenant/person/TenantPersonResetMfaCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonResetPasswordRequestCommand.d.ts +21 -0
- package/dist/types/commands/tenant/person/TenantPersonResetPasswordRequestCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonSetPasswordCommand.d.ts +20 -0
- package/dist/types/commands/tenant/person/TenantPersonSetPasswordCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonShowCommand.d.ts +14 -0
- package/dist/types/commands/tenant/person/TenantPersonShowCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonSignOutCommand.d.ts +17 -0
- package/dist/types/commands/tenant/person/TenantPersonSignOutCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantPersonUpdateCommand.d.ts +17 -0
- package/dist/types/commands/tenant/person/TenantPersonUpdateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/TenantSessionCreateCommand.d.ts +18 -0
- package/dist/types/commands/tenant/person/TenantSessionCreateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/index.d.ts +13 -0
- package/dist/types/commands/tenant/person/index.d.ts.map +1 -0
- package/dist/types/commands/tenant/person/personInput.d.ts +37 -0
- package/dist/types/commands/tenant/person/personInput.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantAuthLogCommand.d.ts +35 -0
- package/dist/types/commands/tenant/policy/TenantAuthLogCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateAddCommand.d.ts +30 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateAddCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateListCommand.d.ts +12 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateRemoveCommand.d.ts +19 -0
- package/dist/types/commands/tenant/policy/TenantMailTemplateRemoveCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantPolicyCreateCommand.d.ts +17 -0
- package/dist/types/commands/tenant/policy/TenantPolicyCreateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantPolicyDeleteCommand.d.ts +16 -0
- package/dist/types/commands/tenant/policy/TenantPolicyDeleteCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantPolicyListCommand.d.ts +12 -0
- package/dist/types/commands/tenant/policy/TenantPolicyListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/TenantPolicyUpdateCommand.d.ts +19 -0
- package/dist/types/commands/tenant/policy/TenantPolicyUpdateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/index.d.ts +9 -0
- package/dist/types/commands/tenant/policy/index.d.ts.map +1 -0
- package/dist/types/commands/tenant/policy/policyInput.d.ts +41 -0
- package/dist/types/commands/tenant/policy/policyInput.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantConfigShowCommand.d.ts +12 -0
- package/dist/types/commands/tenant/project/TenantConfigShowCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantIdpListCommand.d.ts +12 -0
- package/dist/types/commands/tenant/project/TenantIdpListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantProjectCreateCommand.d.ts +22 -0
- package/dist/types/commands/tenant/project/TenantProjectCreateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantProjectListCommand.d.ts +12 -0
- package/dist/types/commands/tenant/project/TenantProjectListCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantProjectSecretSetCommand.d.ts +21 -0
- package/dist/types/commands/tenant/project/TenantProjectSecretSetCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantProjectShowCommand.d.ts +14 -0
- package/dist/types/commands/tenant/project/TenantProjectShowCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantProjectUpdateCommand.d.ts +21 -0
- package/dist/types/commands/tenant/project/TenantProjectUpdateCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/TenantWhoAmICommand.d.ts +12 -0
- package/dist/types/commands/tenant/project/TenantWhoAmICommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/index.d.ts +9 -0
- package/dist/types/commands/tenant/project/index.d.ts.map +1 -0
- package/dist/types/commands/tenant/project/jsonConfigOption.d.ts +9 -0
- package/dist/types/commands/tenant/project/jsonConfigOption.d.ts.map +1 -0
- package/dist/types/commands/tenant/tenantOutput.d.ts +7 -0
- package/dist/types/commands/tenant/tenantOutput.d.ts.map +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts +8 -2
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ImportCommand.d.ts +15 -3
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts +14 -2
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/utils.d.ts +2 -2
- package/dist/types/commands/transfer/utils.d.ts.map +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +27 -4
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/types/dic.d.ts +93 -6
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/lib/SystemClientProvider.d.ts +4 -1
- package/dist/types/lib/SystemClientProvider.d.ts.map +1 -1
- package/dist/types/lib/TenantClientProvider.d.ts +14 -5
- package/dist/types/lib/TenantClientProvider.d.ts.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/actions/ActionsClient.d.ts +17 -8
- package/dist/types/lib/actions/ActionsClient.d.ts.map +1 -1
- package/dist/types/lib/actions/resolveActionsClient.d.ts +7 -0
- package/dist/types/lib/actions/resolveActionsClient.d.ts.map +1 -0
- package/dist/types/lib/actions/runActionMutationBatch.d.ts +23 -0
- package/dist/types/lib/actions/runActionMutationBatch.d.ts.map +1 -0
- package/dist/types/lib/admin/AdminClient.d.ts +1 -0
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts +3 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/dsn.d.ts.map +1 -1
- package/dist/types/lib/errors/TransportError.d.ts +29 -0
- package/dist/types/lib/errors/TransportError.d.ts.map +1 -0
- package/dist/types/lib/errors/index.d.ts +2 -0
- package/dist/types/lib/errors/index.d.ts.map +1 -0
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/fs/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -1
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
- package/dist/types/lib/maskToken.d.ts +1 -0
- package/dist/types/lib/maskToken.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +8 -3
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationPrinter.d.ts +28 -2
- package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts +6 -3
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +13 -2
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationsValidator.d.ts +3 -1
- package/dist/types/lib/migrations/MigrationsValidator.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProject.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityLink.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/SinglePermission.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/utils.d.ts.map +1 -1
- package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
- package/dist/types/lib/prompt/index.d.ts +2 -0
- package/dist/types/lib/prompt/index.d.ts.map +1 -0
- package/dist/types/lib/prompt/prompt.d.ts +6 -0
- package/dist/types/lib/prompt/prompt.d.ts.map +1 -0
- package/dist/types/lib/prompt/prompt.internal.d.ts +37 -0
- package/dist/types/lib/prompt/prompt.internal.d.ts.map +1 -0
- package/dist/types/lib/prompt/prompt.test.d.ts +2 -0
- package/dist/types/lib/prompt/prompt.test.d.ts.map +1 -0
- package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaValidationHelper.d.ts +2 -1
- package/dist/types/lib/schema/SchemaValidationHelper.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts +2 -1
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -1
- package/dist/types/lib/schema/collectReferences.d.ts.map +1 -1
- package/dist/types/lib/stream.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantApiTransport.d.ts +49 -0
- package/dist/types/lib/tenant/TenantApiTransport.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts +38 -3
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantConnection.d.ts +8 -0
- package/dist/types/lib/tenant/TenantConnection.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConnectionProvider.d.ts +8 -0
- package/dist/types/lib/tenant/TenantConnectionProvider.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConnectionResolver.d.ts +8 -0
- package/dist/types/lib/tenant/TenantConnectionResolver.d.ts.map +1 -0
- package/dist/types/lib/tenant/authPolicy.d.ts +17 -0
- package/dist/types/lib/tenant/authPolicy.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/TenantApiKeyClient.d.ts +56 -0
- package/dist/types/lib/tenant/clients/TenantApiKeyClient.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/TenantMemberClient.d.ts +68 -0
- package/dist/types/lib/tenant/clients/TenantMemberClient.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/TenantPersonClient.d.ts +97 -0
- package/dist/types/lib/tenant/clients/TenantPersonClient.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/TenantPolicyClient.d.ts +75 -0
- package/dist/types/lib/tenant/clients/TenantPolicyClient.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/TenantProjectClient.d.ts +162 -0
- package/dist/types/lib/tenant/clients/TenantProjectClient.d.ts.map +1 -0
- package/dist/types/lib/tenant/clients/index.d.ts +21 -0
- package/dist/types/lib/tenant/clients/index.d.ts.map +1 -0
- package/dist/types/lib/tenant/confirmation.d.ts +14 -0
- package/dist/types/lib/tenant/confirmation.d.ts.map +1 -0
- package/dist/types/lib/tenant/input/index.d.ts +3 -0
- package/dist/types/lib/tenant/input/index.d.ts.map +1 -0
- package/dist/types/lib/tenant/input/pagination.d.ts +7 -0
- package/dist/types/lib/tenant/input/pagination.d.ts.map +1 -0
- package/dist/types/lib/tenant/input/value.d.ts +45 -0
- package/dist/types/lib/tenant/input/value.d.ts.map +1 -0
- package/dist/types/lib/tenant/stdin.d.ts +8 -0
- package/dist/types/lib/tenant/stdin.d.ts.map +1 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts +96 -22
- package/dist/types/lib/tenant/tenantConfig.d.ts.map +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts +8 -2
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/lib/transfer/stdio.d.ts +3 -1
- package/dist/types/lib/transfer/stdio.d.ts.map +1 -1
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/commands/actions/ActionsGetEventCommand.ts +38 -16
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +24 -43
- package/src/commands/actions/ActionsListVariablesCommand.ts +15 -13
- package/src/commands/actions/ActionsRetryEventCommand.ts +36 -18
- package/src/commands/actions/ActionsSetVariablesCommand.ts +56 -28
- package/src/commands/actions/ActionsStopEventCommand.ts +36 -18
- package/src/commands/deploy/DeployCommand.ts +69 -30
- package/src/commands/migrations/MigrationAmendCommand.ts +69 -26
- package/src/commands/migrations/MigrationBlankCommand.ts +3 -3
- package/src/commands/migrations/MigrationDescribeCommand.ts +9 -4
- package/src/commands/migrations/MigrationDiffCommand.ts +83 -31
- package/src/commands/migrations/MigrationExecuteCommand.ts +11 -4
- package/src/commands/migrations/MigrationInitStateCommand.ts +18 -5
- package/src/commands/migrations/MigrationRebaseCommand.ts +28 -6
- package/src/commands/migrations/MigrationSnapshotCommand.ts +45 -10
- package/src/commands/migrations/MigrationStatusCommand.ts +20 -12
- package/src/commands/migrations/MigrationVerifySnapshotCommand.ts +7 -8
- package/src/commands/misc/CommandsCommand.ts +74 -0
- package/src/commands/misc/VersionCommand.ts +13 -6
- package/src/commands/misc/index.ts +1 -0
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +12 -13
- package/src/commands/project/ProjectPrintSchemaCommand.ts +19 -17
- package/src/commands/project/ProjectValidateCommand.ts +52 -18
- package/src/commands/tenant/TenantApplyCommand.ts +46 -14
- package/src/commands/tenant/apikey/TenantApiKeyCreateCommand.ts +102 -0
- package/src/commands/tenant/apikey/TenantApiKeyDisableCommand.ts +47 -0
- package/src/commands/tenant/apikey/TenantApiKeyListCommand.ts +64 -0
- package/src/commands/tenant/apikey/index.ts +4 -0
- package/src/commands/tenant/index.ts +5 -0
- package/src/commands/tenant/member/TenantMemberAddCommand.ts +48 -0
- package/src/commands/tenant/member/TenantMemberInviteCommand.ts +88 -0
- package/src/commands/tenant/member/TenantMemberInviteUnmanagedCommand.ts +135 -0
- package/src/commands/tenant/member/TenantMemberListCommand.ts +94 -0
- package/src/commands/tenant/member/TenantMemberRemoveCommand.ts +48 -0
- package/src/commands/tenant/member/TenantMemberUpdateCommand.ts +58 -0
- package/src/commands/tenant/member/index.ts +9 -0
- package/src/commands/tenant/member/memberOptions.ts +29 -0
- package/src/commands/tenant/member/membershipInput.ts +155 -0
- package/src/commands/tenant/person/TenantIdentityRoleAddCommand.ts +44 -0
- package/src/commands/tenant/person/TenantIdentityRoleRemoveCommand.ts +54 -0
- package/src/commands/tenant/person/TenantPersonCreateCommand.ts +98 -0
- package/src/commands/tenant/person/TenantPersonDisableCommand.ts +46 -0
- package/src/commands/tenant/person/TenantPersonListCommand.ts +68 -0
- package/src/commands/tenant/person/TenantPersonResetMfaCommand.ts +59 -0
- package/src/commands/tenant/person/TenantPersonResetPasswordRequestCommand.ts +67 -0
- package/src/commands/tenant/person/TenantPersonSetPasswordCommand.ts +66 -0
- package/src/commands/tenant/person/TenantPersonShowCommand.ts +70 -0
- package/src/commands/tenant/person/TenantPersonSignOutCommand.ts +60 -0
- package/src/commands/tenant/person/TenantPersonUpdateCommand.ts +55 -0
- package/src/commands/tenant/person/TenantSessionCreateCommand.ts +79 -0
- package/src/commands/tenant/person/index.ts +15 -0
- package/src/commands/tenant/person/personInput.ts +112 -0
- package/src/commands/tenant/policy/TenantAuthLogCommand.ts +141 -0
- package/src/commands/tenant/policy/TenantMailTemplateAddCommand.ts +92 -0
- package/src/commands/tenant/policy/TenantMailTemplateListCommand.ts +50 -0
- package/src/commands/tenant/policy/TenantMailTemplateRemoveCommand.ts +63 -0
- package/src/commands/tenant/policy/TenantPolicyCreateCommand.ts +46 -0
- package/src/commands/tenant/policy/TenantPolicyDeleteCommand.ts +42 -0
- package/src/commands/tenant/policy/TenantPolicyListCommand.ts +39 -0
- package/src/commands/tenant/policy/TenantPolicyUpdateCommand.ts +51 -0
- package/src/commands/tenant/policy/index.ts +9 -0
- package/src/commands/tenant/policy/policyInput.ts +210 -0
- package/src/commands/tenant/project/TenantConfigShowCommand.ts +28 -0
- package/src/commands/tenant/project/TenantIdpListCommand.ts +27 -0
- package/src/commands/tenant/project/TenantProjectCreateCommand.ts +67 -0
- package/src/commands/tenant/project/TenantProjectListCommand.ts +27 -0
- package/src/commands/tenant/project/TenantProjectSecretSetCommand.ts +63 -0
- package/src/commands/tenant/project/TenantProjectShowCommand.ts +29 -0
- package/src/commands/tenant/project/TenantProjectUpdateCommand.ts +66 -0
- package/src/commands/tenant/project/TenantWhoAmICommand.ts +22 -0
- package/src/commands/tenant/project/index.ts +9 -0
- package/src/commands/tenant/project/jsonConfigOption.ts +33 -0
- package/src/commands/tenant/tenantOutput.ts +35 -0
- package/src/commands/transfer/ExportCommand.ts +46 -29
- package/src/commands/transfer/ImportCommand.ts +87 -34
- package/src/commands/transfer/TransferCommand.ts +94 -34
- package/src/commands/transfer/utils.ts +12 -11
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +135 -36
- package/src/dic.ts +198 -47
- package/src/lib/SystemClientProvider.ts +75 -1
- package/src/lib/TenantClientProvider.ts +44 -6
- package/src/lib/actions/ActionsClient.ts +38 -14
- package/src/lib/actions/resolveActionsClient.ts +15 -0
- package/src/lib/actions/runActionMutationBatch.ts +69 -0
- package/src/lib/admin/AdminClient.ts +39 -12
- package/src/lib/admin/AdminDeployer.ts +4 -2
- package/src/lib/errors/TransportError.ts +260 -0
- package/src/lib/errors/index.ts +1 -0
- package/src/lib/maskToken.ts +9 -1
- package/src/lib/migrations/MigrationExecutionFacade.ts +117 -59
- package/src/lib/migrations/MigrationPrinter.ts +100 -64
- package/src/lib/migrations/MigrationRebaseFacade.ts +2 -1
- package/src/lib/migrations/MigrationSnapshotFacade.ts +15 -10
- package/src/lib/migrations/MigrationsStatusFacade.ts +17 -3
- package/src/lib/migrations/MigrationsValidator.ts +4 -2
- package/src/lib/project/RemoteProjectProvider.ts +6 -1
- package/src/lib/prompt/index.ts +1 -0
- package/src/lib/prompt/prompt.internal.ts +69 -0
- package/src/lib/prompt/prompt.test.ts +100 -0
- package/src/lib/prompt/prompt.ts +23 -0
- package/src/lib/schema/SchemaValidationHelper.ts +8 -2
- package/src/lib/schema/SchemaValidationPrinter.ts +5 -4
- package/src/lib/tenant/TenantApiTransport.ts +209 -0
- package/src/lib/tenant/TenantConfigApplier.ts +198 -29
- package/src/lib/tenant/TenantConnection.ts +8 -0
- package/src/lib/tenant/TenantConnectionProvider.ts +21 -0
- package/src/lib/tenant/TenantConnectionResolver.ts +31 -0
- package/src/lib/tenant/authPolicy.ts +20 -0
- package/src/lib/tenant/clients/README.md +84 -0
- package/src/lib/tenant/clients/TenantApiKeyClient.ts +182 -0
- package/src/lib/tenant/clients/TenantMemberClient.ts +199 -0
- package/src/lib/tenant/clients/TenantPersonClient.ts +306 -0
- package/src/lib/tenant/clients/TenantPolicyClient.ts +244 -0
- package/src/lib/tenant/clients/TenantProjectClient.ts +425 -0
- package/src/lib/tenant/clients/index.ts +29 -0
- package/src/lib/tenant/confirmation.ts +32 -0
- package/src/lib/tenant/input/index.ts +2 -0
- package/src/lib/tenant/input/pagination.ts +39 -0
- package/src/lib/tenant/input/value.ts +149 -0
- package/src/lib/tenant/stdin.ts +16 -0
- package/src/lib/tenant/tenantConfig.ts +146 -25
- package/src/lib/transfer/DataTransferClient.ts +354 -59
- package/src/lib/transfer/stdio.ts +5 -7
- package/src/run.ts +19 -3
- package/tenant.config.example.ts +28 -0
- package/tests/cases/unit/MigrationAmendCommand.test.ts +17 -2
- package/tests/cases/unit/MigrationDiffCommand.test.ts +182 -0
- package/tests/cases/unit/MigrationExecuteCommand.test.ts +58 -0
- package/tests/cases/unit/MigrationExecutionFacade.test.ts +341 -54
- package/tests/cases/unit/MigrationInitStateCommand.test.ts +72 -0
- package/tests/cases/unit/MigrationRebaseCommand.test.ts +59 -0
- package/tests/cases/unit/MigrationSnapshotFacade.test.ts +75 -13
- package/tests/cases/unit/MigrationStatusCommand.test.ts +197 -0
- package/tests/cases/unit/MigrationsValidator.test.ts +61 -0
- package/tests/cases/unit/actions.test.ts +802 -0
- package/tests/cases/unit/cli-process.test.ts +266 -0
- package/tests/cases/unit/command-registry.test.ts +214 -0
- package/tests/cases/unit/deploy.test.ts +505 -0
- package/tests/cases/unit/migration-transport.test.ts +156 -0
- package/tests/cases/unit/project.test.ts +223 -0
- package/tests/cases/unit/structured-output.test.ts +189 -0
- package/tests/cases/unit/tenant-apikey.test.ts +645 -0
- package/tests/cases/unit/tenant-apply-command.test.ts +247 -0
- package/tests/cases/unit/tenant-clients.test.ts +130 -0
- package/tests/cases/unit/tenant-connection.test.ts +91 -0
- package/tests/cases/unit/tenant-input.test.ts +275 -0
- package/tests/cases/unit/tenant-member.test.ts +683 -0
- package/tests/cases/unit/tenant-person.test.ts +857 -0
- package/tests/cases/unit/tenant-policy.test.ts +799 -0
- package/tests/cases/unit/tenant-project.test.ts +634 -0
- package/tests/cases/unit/tenant-transport.test.ts +322 -0
- package/tests/cases/unit/transfer.test.ts +714 -0
- package/tests/cases/unit/transport-errors.test.ts +78 -0
- package/tests/cases/unit/workspace-update-api.test.ts +152 -0
- package/tests/tenantConfigApplier.test.ts +434 -38
- package/dist/development/src/lib/tenant/TenantClient.cjs +0 -104
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +0 -1
- package/dist/development/src/lib/tenant/TenantClient.js +0 -104
- package/dist/development/src/lib/tenant/TenantClient.js.map +0 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs +0 -104
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +0 -1
- package/dist/production/src/lib/tenant/TenantClient.js +0 -104
- package/dist/production/src/lib/tenant/TenantClient.js.map +0 -1
- package/dist/types/lib/tenant/TenantClient.d.ts +0 -24
- package/dist/types/lib/tenant/TenantClient.d.ts.map +0 -1
- package/src/lib/tenant/TenantClient.ts +0 -149
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const schemaUtils = require("@contember/schema-utils");
|
|
4
4
|
const migrationsClient = require("@contember/migrations-client");
|
|
5
|
+
const cliCommon = require("@contember/cli-common");
|
|
5
6
|
class MigrationSnapshotFacade {
|
|
6
|
-
constructor(migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager) {
|
|
7
|
+
constructor(migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager, output = new cliCommon.Output()) {
|
|
7
8
|
this.migrationsResolver = migrationsResolver;
|
|
8
9
|
this.schemaVersionBuilder = schemaVersionBuilder;
|
|
9
10
|
this.schemaDiffer = schemaDiffer;
|
|
10
11
|
this.schemaMigrator = schemaMigrator;
|
|
11
12
|
this.schemaStateManager = schemaStateManager;
|
|
12
13
|
this.snapshotManager = snapshotManager;
|
|
14
|
+
this.output = output;
|
|
13
15
|
}
|
|
14
|
-
/**
|
|
15
|
-
async
|
|
16
|
+
/** Builds a snapshot in memory without changing the filesystem. */
|
|
17
|
+
async prepare() {
|
|
16
18
|
const files = await this.migrationsResolver.getMigrationFiles();
|
|
17
19
|
if (files.length === 0) {
|
|
18
|
-
throw "No migrations to snapshot";
|
|
20
|
+
throw new cliCommon.CliError("No migrations to snapshot", { code: "MIGRATIONS_NOT_FOUND", exitCode: cliCommon.ExitCode.NotFound });
|
|
19
21
|
}
|
|
20
22
|
const stateMode = await this.schemaStateManager.isStateMode();
|
|
21
23
|
const version = files[files.length - 1].version;
|
|
@@ -45,9 +47,11 @@ class MigrationSnapshotFacade {
|
|
|
45
47
|
covers,
|
|
46
48
|
contentMigrations
|
|
47
49
|
};
|
|
48
|
-
await this.snapshotManager.write(snapshot);
|
|
49
50
|
return snapshot;
|
|
50
51
|
}
|
|
52
|
+
async write(snapshot) {
|
|
53
|
+
await this.snapshotManager.write(snapshot);
|
|
54
|
+
}
|
|
51
55
|
/**
|
|
52
56
|
* Returns the snapshot when it can safely bootstrap the current project, else null.
|
|
53
57
|
* The snapshot is only usable on an empty project (no executed migrations) and only when
|
|
@@ -64,7 +68,7 @@ class MigrationSnapshotFacade {
|
|
|
64
68
|
const snapshot = await this.snapshotManager.read();
|
|
65
69
|
const stale = await this.findStaleness(snapshot);
|
|
66
70
|
if (stale) {
|
|
67
|
-
|
|
71
|
+
this.output.warn(`Ignoring snapshot: ${stale}. Run "migrations snapshot" to regenerate it.`);
|
|
68
72
|
return null;
|
|
69
73
|
}
|
|
70
74
|
return snapshot;
|
|
@@ -77,7 +81,7 @@ class MigrationSnapshotFacade {
|
|
|
77
81
|
for (const covered of snapshot.covers) {
|
|
78
82
|
const file = byVersion.get(covered.version);
|
|
79
83
|
if (!file) {
|
|
80
|
-
throw `Snapshot covers missing migration ${covered.name}
|
|
84
|
+
throw new cliCommon.CliError(`Snapshot covers missing migration ${covered.name}`, { code: "SNAPSHOT_COVER_MISSING", exitCode: cliCommon.ExitCode.NotFound });
|
|
81
85
|
}
|
|
82
86
|
covers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()));
|
|
83
87
|
}
|
|
@@ -90,12 +94,12 @@ class MigrationSnapshotFacade {
|
|
|
90
94
|
/** Offline check that the snapshot still equals a full replay of all migrations. */
|
|
91
95
|
async verify() {
|
|
92
96
|
if (!await this.snapshotManager.exists()) {
|
|
93
|
-
throw 'No snapshot found. Run "migrations
|
|
97
|
+
throw new cliCommon.CliError('No snapshot found. Run "migrations snapshot" first.', { code: "SNAPSHOT_NOT_FOUND", exitCode: cliCommon.ExitCode.NotFound });
|
|
94
98
|
}
|
|
95
99
|
const snapshot = await this.snapshotManager.read();
|
|
96
100
|
const stale = await this.findStaleness(snapshot);
|
|
97
101
|
if (stale) {
|
|
98
|
-
return { ok: false, message: `Snapshot is stale: ${stale}. Run "migrations
|
|
102
|
+
return { ok: false, message: `Snapshot is stale: ${stale}. Run "migrations snapshot" to regenerate it.` };
|
|
99
103
|
}
|
|
100
104
|
const stateMode = await this.schemaStateManager.isStateMode();
|
|
101
105
|
const replaySchema = await this.schemaVersionBuilder.buildSchema();
|
|
@@ -117,7 +121,7 @@ class MigrationSnapshotFacade {
|
|
|
117
121
|
}
|
|
118
122
|
return {
|
|
119
123
|
ok: false,
|
|
120
|
-
message: 'Snapshot does not match a full replay of all migrations. Run "migrations
|
|
124
|
+
message: 'Snapshot does not match a full replay of all migrations. Run "migrations snapshot" to regenerate it.'
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
127
|
async findStaleness(snapshot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationSnapshotFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationSnapshotFacade.ts"],"sourcesContent":["import { compareArraysIgnoreOrder, deepCompare, emptySchema } from '@contember/schema-utils'\nimport {\n\tcalculateMigrationChecksum,\n\tCoveredMigration,\n\tExecutedMigrationInfo,\n\tisSchemaMigration,\n\tMigrationContent,\n\tMigrationsResolver,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotFile,\n\tSnapshotInput,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\n\nexport class MigrationSnapshotFacade {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly schemaDiffer: SchemaDiffer,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly snapshotManager: SnapshotManager,\n\t) {\n\t}\n\n\t/** Collapses all migrations into a single schema snapshot and writes snapshot.json. */\n\tasync create(): Promise<SnapshotFile> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tif (files.length === 0) {\n\t\t\tthrow 'No migrations to snapshot'\n\t\t}\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst version = files[files.length - 1].version\n\n\t\t// Replay all schema migrations into a single schema. In state mode the non-model parts\n\t\t// (acl/validation/actions/settings) live in state/ and are skipped here; otherwise they\n\t\t// are part of the migration history and must be included in the collapsed modifications.\n\t\tconst collapsedSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(emptySchema, () => true)\n\t\tconst modifications = this.schemaDiffer.diffSchemas(emptySchema, collapsedSchema, {\n\t\t\tskipNonModelDiffers: stateMode,\n\t\t})\n\n\t\tconst covers: CoveredMigration[] = []\n\t\tconst contentMigrations: string[] = []\n\t\tfor (const file of files) {\n\t\t\tconst content = await file.getContent()\n\t\t\tconst schema = isSchemaMigration(content)\n\t\t\tcovers.push({\n\t\t\t\tversion: file.version,\n\t\t\t\tname: file.name,\n\t\t\t\ttype: schema ? 'schema' : 'content',\n\t\t\t\tchecksum: schema ? calculateMigrationChecksum(content) : null,\n\t\t\t})\n\t\t\tif (!schema) {\n\t\t\t\tcontentMigrations.push(file.version)\n\t\t\t}\n\t\t}\n\n\t\tconst snapshot: SnapshotFile = {\n\t\t\tversion,\n\t\t\tstateMode,\n\t\t\tsnapshot: { formatVersion: VERSION_LATEST, modifications },\n\t\t\tcovers,\n\t\t\tcontentMigrations,\n\t\t}\n\t\tawait this.snapshotManager.write(snapshot)\n\t\treturn snapshot\n\t}\n\n\t/**\n\t * Returns the snapshot when it can safely bootstrap the current project, else null.\n\t * The snapshot is only usable on an empty project (no executed migrations) and only when\n\t * none of the covered migration files have changed. A present-but-stale snapshot is skipped\n\t * with a warning, falling back to a full replay.\n\t */\n\tasync getUsableSnapshot(executedMigrations: ExecutedMigrationInfo[]): Promise<SnapshotFile | null> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\treturn null\n\t\t}\n\t\tif (executedMigrations.length > 0) {\n\t\t\treturn null\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\tconsole.warn(`Ignoring snapshot: ${stale}. Run \"migrations:snapshot\" to regenerate it.`)\n\t\t\treturn null\n\t\t}\n\t\treturn snapshot\n\t}\n\n\t/** Maps a snapshot to the GraphQL SnapshotInput; covered migrations are sent as Migration inputs. */\n\tasync buildSnapshotInput(snapshot: SnapshotFile): Promise<SnapshotInput> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tconst covers: unknown[] = []\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\tthrow `Snapshot covers missing migration ${covered.name}`\n\t\t\t}\n\t\t\tcovers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()))\n\t\t}\n\t\treturn {\n\t\t\tformatVersion: snapshot.snapshot.formatVersion,\n\t\t\tmodifications: snapshot.snapshot.modifications,\n\t\t\tcovers,\n\t\t}\n\t}\n\n\t/** Offline check that the snapshot still equals a full replay of all migrations. */\n\tasync verify(): Promise<{ ok: boolean; message: string }> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\tthrow 'No snapshot found. Run \"migrations:snapshot\" first.'\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\treturn { ok: false, message: `Snapshot is stale: ${stale}. Run \"migrations:snapshot\" to regenerate it.` }\n\t\t}\n\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst replaySchema = await this.schemaVersionBuilder.buildSchema()\n\t\tlet snapshotSchema = this.schemaMigrator.applyModifications(emptySchema, snapshot.snapshot.modifications, snapshot.snapshot.formatVersion)\n\t\tif (stateMode) {\n\t\t\tsnapshotSchema = { ...snapshotSchema, ...await this.schemaStateManager.readState() }\n\t\t}\n\n\t\t// Compare with the same order-insensitive equality that SchemaDiffer uses for its own\n\t\t// round-trip check. The collapsed differ emits fields/constraints in a fixed order that may\n\t\t// differ from a replay of an interleaved history (e.g. a column added to an entity that\n\t\t// already has a relation), so a raw checksum (JSON.stringify) would report false mismatches\n\t\t// on schemas that are in fact deeply equal.\n\t\tconst differences = deepCompare(replaySchema, snapshotSchema, [], path => {\n\t\t\tif (path[0] === 'model' && path[1] === 'entities' && (path[3] === 'unique' || path[3] === 'index')) {\n\t\t\t\treturn (a, b) => compareArraysIgnoreOrder(a, b, path)\n\t\t\t}\n\t\t\treturn null\n\t\t})\n\t\tif (differences.length === 0) {\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tmessage: `Snapshot is up to date (covers ${snapshot.covers.length} migrations up to ${snapshot.version}).`,\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tok: false,\n\t\t\tmessage: 'Snapshot does not match a full replay of all migrations. Run \"migrations:snapshot\" to regenerate it.',\n\t\t}\n\t}\n\n\tprivate async findStaleness(snapshot: SnapshotFile): Promise<string | null> {\n\t\t// The collapsed snapshot is built differently per mode (state mode omits the non-model parts,\n\t\t// see create()), and on bootstrap the non-model overlay is driven by the *current* mode. A mode\n\t\t// switch since the snapshot was created (e.g. migrations:init-state) leaves the covers untouched\n\t\t// and would otherwise pass unnoticed, so treat it as stale and fall back to a full replay.\n\t\tif (snapshot.stateMode !== await this.schemaStateManager.isStateMode()) {\n\t\t\treturn `schema state mode changed since the snapshot was created`\n\t\t}\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\treturn `covered migration ${covered.name} is missing`\n\t\t\t}\n\t\t\tconst content = await file.getContent()\n\t\t\tconst currentType = isSchemaMigration(content) ? 'schema' : 'content'\n\t\t\t// A covered migration that flipped type (e.g. a content migration manually rewritten into a\n\t\t\t// schema one) is not reflected in the collapsed modifications, so the snapshot no longer\n\t\t\t// equals a replay. Schema covers also verify the checksum; content covers carry none (their\n\t\t\t// data is never reproduced), so the type check is the only identity they get.\n\t\t\tif (currentType !== covered.type) {\n\t\t\t\treturn `covered migration ${covered.name} changed type`\n\t\t\t}\n\t\t\tif (covered.type === 'schema') {\n\t\t\t\tconst checksum = isSchemaMigration(content) ? calculateMigrationChecksum(content) : null\n\t\t\t\tif (checksum !== covered.checksum) {\n\t\t\t\t\treturn `covered migration ${covered.name} has changed`\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Detect a migration added within the covered range (version <= snapshot.version) that the\n\t\t// snapshot does not know about — e.g. a teammate's migration with an earlier timestamp merged\n\t\t// after the snapshot was generated. Without this, bootstrapping would record the covers up to\n\t\t// snapshot.version and the subsequent normal replay would fail with MUST_FOLLOW_LATEST on the\n\t\t// in-range migration, leaving the database half-bootstrapped. Treat it as stale and fall back.\n\t\tconst coveredVersions = new Set(snapshot.covers.map(it => it.version))\n\t\tfor (const file of files) {\n\t\t\tif (file.version <= snapshot.version && !coveredVersions.has(file.version)) {\n\t\t\t\treturn `migration ${file.name} is within the covered range but not part of the snapshot`\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n\nconst migrationContentToInput = (version: string, name: string, content: MigrationContent) => {\n\tif (isSchemaMigration(content)) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tname,\n\t\t\ttype: 'SCHEMA',\n\t\t\tschemaMigration: {\n\t\t\t\tformatVersion: content.formatVersion,\n\t\t\t\tmodifications: content.modifications,\n\t\t\t\tskippedErrors: content.skippedErrors,\n\t\t\t},\n\t\t}\n\t}\n\t// Content migrations are only recorded as executed (no data is replayed), so the queries are irrelevant.\n\treturn { version, name, type: 'CONTENT', contentMigration: [] }\n}\n"],"names":["emptySchema","isSchemaMigration","calculateMigrationChecksum","VERSION_LATEST","deepCompare","compareArraysIgnoreOrder"],"mappings":";;;;AAkBO,MAAM,wBAAwB;AAAA,EACpC,YACkB,oBACA,sBACA,cACA,gBACA,oBACA,iBAChB;AANgB,SAAA,qBAAA;AACA,SAAA,uBAAA;AACA,SAAA,eAAA;AACA,SAAA,iBAAA;AACA,SAAA,qBAAA;AACA,SAAA,kBAAA;AAAA,EAElB;AAAA;AAAA,EAGA,MAAM,SAAgC;AACrC,UAAM,QAAQ,MAAM,KAAK,mBAAmB,kBAAA;AAC5C,QAAI,MAAM,WAAW,GAAG;AACvB,YAAM;AAAA,IACP;AACA,UAAM,YAAY,MAAM,KAAK,mBAAmB,YAAA;AACh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AW,SAAS,WAAW,CAAC,gBAAgB,IAAI,KAAK,OAAO,GAAG;AAC3E,eAAO,aAAa,KAAK,IAAI;AAAA,MAC9B;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;AAEA,MAAM,0BAA0B,CAAC,SAAiB,MAAc,YAA8B;AAC7F,MAAID,iBAAAA,kBAAkB,OAAO,GAAG;AAC/B,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN,iBAAiB;AAAA,QAChB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,MAAA;AAAA,IACxB;AAAA,EAEF;AAEA,SAAO,EAAE,SAAS,MAAM,MAAM,WAAW,kBAAkB,GAAC;AAC7D;;"}
|
|
1
|
+
{"version":3,"file":"MigrationSnapshotFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationSnapshotFacade.ts"],"sourcesContent":["import { compareArraysIgnoreOrder, deepCompare, emptySchema } from '@contember/schema-utils'\nimport {\n\tcalculateMigrationChecksum,\n\tCoveredMigration,\n\tExecutedMigrationInfo,\n\tisSchemaMigration,\n\tMigrationContent,\n\tMigrationsResolver,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotFile,\n\tSnapshotInput,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { CliError, ExitCode, Output } from '@contember/cli-common'\n\nexport class MigrationSnapshotFacade {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly schemaDiffer: SchemaDiffer,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly snapshotManager: SnapshotManager,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\t/** Builds a snapshot in memory without changing the filesystem. */\n\tasync prepare(): Promise<SnapshotFile> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tif (files.length === 0) {\n\t\t\tthrow new CliError('No migrations to snapshot', { code: 'MIGRATIONS_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst version = files[files.length - 1].version\n\n\t\t// Replay all schema migrations into a single schema. In state mode the non-model parts\n\t\t// (acl/validation/actions/settings) live in state/ and are skipped here; otherwise they\n\t\t// are part of the migration history and must be included in the collapsed modifications.\n\t\tconst collapsedSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(emptySchema, () => true)\n\t\tconst modifications = this.schemaDiffer.diffSchemas(emptySchema, collapsedSchema, {\n\t\t\tskipNonModelDiffers: stateMode,\n\t\t})\n\n\t\tconst covers: CoveredMigration[] = []\n\t\tconst contentMigrations: string[] = []\n\t\tfor (const file of files) {\n\t\t\tconst content = await file.getContent()\n\t\t\tconst schema = isSchemaMigration(content)\n\t\t\tcovers.push({\n\t\t\t\tversion: file.version,\n\t\t\t\tname: file.name,\n\t\t\t\ttype: schema ? 'schema' : 'content',\n\t\t\t\tchecksum: schema ? calculateMigrationChecksum(content) : null,\n\t\t\t})\n\t\t\tif (!schema) {\n\t\t\t\tcontentMigrations.push(file.version)\n\t\t\t}\n\t\t}\n\n\t\tconst snapshot: SnapshotFile = {\n\t\t\tversion,\n\t\t\tstateMode,\n\t\t\tsnapshot: { formatVersion: VERSION_LATEST, modifications },\n\t\t\tcovers,\n\t\t\tcontentMigrations,\n\t\t}\n\t\treturn snapshot\n\t}\n\n\tasync write(snapshot: SnapshotFile): Promise<void> {\n\t\tawait this.snapshotManager.write(snapshot)\n\t}\n\n\t/**\n\t * Returns the snapshot when it can safely bootstrap the current project, else null.\n\t * The snapshot is only usable on an empty project (no executed migrations) and only when\n\t * none of the covered migration files have changed. A present-but-stale snapshot is skipped\n\t * with a warning, falling back to a full replay.\n\t */\n\tasync getUsableSnapshot(executedMigrations: ExecutedMigrationInfo[]): Promise<SnapshotFile | null> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\treturn null\n\t\t}\n\t\tif (executedMigrations.length > 0) {\n\t\t\treturn null\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\tthis.output.warn(`Ignoring snapshot: ${stale}. Run \"migrations snapshot\" to regenerate it.`)\n\t\t\treturn null\n\t\t}\n\t\treturn snapshot\n\t}\n\n\t/** Maps a snapshot to the GraphQL SnapshotInput; covered migrations are sent as Migration inputs. */\n\tasync buildSnapshotInput(snapshot: SnapshotFile): Promise<SnapshotInput> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tconst covers: unknown[] = []\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\tthrow new CliError(`Snapshot covers missing migration ${covered.name}`, { code: 'SNAPSHOT_COVER_MISSING', exitCode: ExitCode.NotFound })\n\t\t\t}\n\t\t\tcovers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()))\n\t\t}\n\t\treturn {\n\t\t\tformatVersion: snapshot.snapshot.formatVersion,\n\t\t\tmodifications: snapshot.snapshot.modifications,\n\t\t\tcovers,\n\t\t}\n\t}\n\n\t/** Offline check that the snapshot still equals a full replay of all migrations. */\n\tasync verify(): Promise<{ ok: boolean; message: string }> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\tthrow new CliError('No snapshot found. Run \"migrations snapshot\" first.', { code: 'SNAPSHOT_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\treturn { ok: false, message: `Snapshot is stale: ${stale}. Run \"migrations snapshot\" to regenerate it.` }\n\t\t}\n\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst replaySchema = await this.schemaVersionBuilder.buildSchema()\n\t\tlet snapshotSchema = this.schemaMigrator.applyModifications(emptySchema, snapshot.snapshot.modifications, snapshot.snapshot.formatVersion)\n\t\tif (stateMode) {\n\t\t\tsnapshotSchema = { ...snapshotSchema, ...await this.schemaStateManager.readState() }\n\t\t}\n\n\t\t// Compare with the same order-insensitive equality that SchemaDiffer uses for its own\n\t\t// round-trip check. The collapsed differ emits fields/constraints in a fixed order that may\n\t\t// differ from a replay of an interleaved history (e.g. a column added to an entity that\n\t\t// already has a relation), so a raw checksum (JSON.stringify) would report false mismatches\n\t\t// on schemas that are in fact deeply equal.\n\t\tconst differences = deepCompare(replaySchema, snapshotSchema, [], path => {\n\t\t\tif (path[0] === 'model' && path[1] === 'entities' && (path[3] === 'unique' || path[3] === 'index')) {\n\t\t\t\treturn (a, b) => compareArraysIgnoreOrder(a, b, path)\n\t\t\t}\n\t\t\treturn null\n\t\t})\n\t\tif (differences.length === 0) {\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tmessage: `Snapshot is up to date (covers ${snapshot.covers.length} migrations up to ${snapshot.version}).`,\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tok: false,\n\t\t\tmessage: 'Snapshot does not match a full replay of all migrations. Run \"migrations snapshot\" to regenerate it.',\n\t\t}\n\t}\n\n\tprivate async findStaleness(snapshot: SnapshotFile): Promise<string | null> {\n\t\t// The collapsed snapshot is built differently per mode (state mode omits the non-model parts,\n\t\t// see create()), and on bootstrap the non-model overlay is driven by the *current* mode. A mode\n\t\t// switch since the snapshot was created (e.g. migrations init-state) leaves the covers untouched\n\t\t// and would otherwise pass unnoticed, so treat it as stale and fall back to a full replay.\n\t\tif (snapshot.stateMode !== await this.schemaStateManager.isStateMode()) {\n\t\t\treturn `schema state mode changed since the snapshot was created`\n\t\t}\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\treturn `covered migration ${covered.name} is missing`\n\t\t\t}\n\t\t\tconst content = await file.getContent()\n\t\t\tconst currentType = isSchemaMigration(content) ? 'schema' : 'content'\n\t\t\t// A covered migration that flipped type (e.g. a content migration manually rewritten into a\n\t\t\t// schema one) is not reflected in the collapsed modifications, so the snapshot no longer\n\t\t\t// equals a replay. Schema covers also verify the checksum; content covers carry none (their\n\t\t\t// data is never reproduced), so the type check is the only identity they get.\n\t\t\tif (currentType !== covered.type) {\n\t\t\t\treturn `covered migration ${covered.name} changed type`\n\t\t\t}\n\t\t\tif (covered.type === 'schema') {\n\t\t\t\tconst checksum = isSchemaMigration(content) ? calculateMigrationChecksum(content) : null\n\t\t\t\tif (checksum !== covered.checksum) {\n\t\t\t\t\treturn `covered migration ${covered.name} has changed`\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Detect a migration added within the covered range (version <= snapshot.version) that the\n\t\t// snapshot does not know about — e.g. a teammate's migration with an earlier timestamp merged\n\t\t// after the snapshot was generated. Without this, bootstrapping would record the covers up to\n\t\t// snapshot.version and the subsequent normal replay would fail with MUST_FOLLOW_LATEST on the\n\t\t// in-range migration, leaving the database half-bootstrapped. Treat it as stale and fall back.\n\t\tconst coveredVersions = new Set(snapshot.covers.map(it => it.version))\n\t\tfor (const file of files) {\n\t\t\tif (file.version <= snapshot.version && !coveredVersions.has(file.version)) {\n\t\t\t\treturn `migration ${file.name} is within the covered range but not part of the snapshot`\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n\nconst migrationContentToInput = (version: string, name: string, content: MigrationContent) => {\n\tif (isSchemaMigration(content)) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tname,\n\t\t\ttype: 'SCHEMA',\n\t\t\tschemaMigration: {\n\t\t\t\tformatVersion: content.formatVersion,\n\t\t\t\tmodifications: content.modifications,\n\t\t\t\tskippedErrors: content.skippedErrors,\n\t\t\t},\n\t\t}\n\t}\n\t// Content migrations are only recorded as executed (no data is replayed), so the queries are irrelevant.\n\treturn { version, name, type: 'CONTENT', contentMigration: [] }\n}\n"],"names":["Output","CliError","ExitCode","emptySchema","isSchemaMigration","calculateMigrationChecksum","VERSION_LATEST","deepCompare","compareArraysIgnoreOrder"],"mappings":";;;;;AAmBO,MAAM,wBAAwB;AAAA,EACpC,YACkB,oBACA,sBACA,cACA,gBACA,oBACA,iBACA,SAAiB,IAAIA,UAAAA,UACrC;AAPgB,SAAA,qBAAA;AACA,SAAA,uBAAA;AACA,SAAA,eAAA;AACA,SAAA,iBAAA;AACA,SAAA,qBAAA;AACA,SAAA,kBAAA;AACA,SAAA,SAAA;AAAA,EAElB;AAAA;AAAA,EAGA,MAAM,UAAiC;AACtC,UAAM,QAAQ,MAAM,KAAK,mBAAmB,kBAAA;AAC5C,QAAI,MAAM,WAAW,GAAG;AACvB,YAAM,IAAIC,UAAAA,SAAS,6BAA6B,EAAE,MAAM,wBAAwB,UAAUC,mBAAS,UAAU;AAAA,IAC9G;AACA,UAAM,YAAY,MAAM,KAAK,mBAAmB,YAAA;AAChD,UAAM,UAAU,MAAM,MAAM,SAAS,CAAC,EAAE;AAKxC,UAAM,kBAAkB,MAAM,KAAK,qBAAqB,oBAAoBC,YAAAA,aAAa,MAAM,IAAI;AACnG,UAAM,gBAAgB,KAAK,aAAa,YAAYA,YAAAA,aAAa,iBAAiB;AAAA,MACjF,qBAAqB;AAAA,IAAA,CACrB;AAED,UAAM,SAA6B,CAAA;AACnC,UAAM,oBAA8B,CAAA;AACpC,eAAW,QAAQ,OAAO;AACzB,YAAM,UAAU,MAAM,KAAK,WAAA;AAC3B,YAAM,SAASC,iBAAAA,kBAAkB,OAAO;AACxC,aAAO,KAAK;AAAA,QACX,SAAS,KAAK;AAAA,QACd,MAAM,KAAK;AAAA,QACX,MAAM,SAAS,WAAW;AAAA,QAC1B,U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MACN,iBAAiB;AAAA,QAChB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,MAAA;AAAA,IACxB;AAAA,EAEF;AAEA,SAAO,EAAE,SAAS,MAAM,MAAM,WAAW,kBAAkB,GAAC;AAC7D;;"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { emptySchema, deepCompare, compareArraysIgnoreOrder } from "@contember/schema-utils";
|
|
2
2
|
import { isSchemaMigration, calculateMigrationChecksum, VERSION_LATEST } from "@contember/migrations-client";
|
|
3
|
+
import { Output, CliError, ExitCode } from "@contember/cli-common";
|
|
3
4
|
class MigrationSnapshotFacade {
|
|
4
|
-
constructor(migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager) {
|
|
5
|
+
constructor(migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager, output = new Output()) {
|
|
5
6
|
this.migrationsResolver = migrationsResolver;
|
|
6
7
|
this.schemaVersionBuilder = schemaVersionBuilder;
|
|
7
8
|
this.schemaDiffer = schemaDiffer;
|
|
8
9
|
this.schemaMigrator = schemaMigrator;
|
|
9
10
|
this.schemaStateManager = schemaStateManager;
|
|
10
11
|
this.snapshotManager = snapshotManager;
|
|
12
|
+
this.output = output;
|
|
11
13
|
}
|
|
12
|
-
/**
|
|
13
|
-
async
|
|
14
|
+
/** Builds a snapshot in memory without changing the filesystem. */
|
|
15
|
+
async prepare() {
|
|
14
16
|
const files = await this.migrationsResolver.getMigrationFiles();
|
|
15
17
|
if (files.length === 0) {
|
|
16
|
-
throw "No migrations to snapshot";
|
|
18
|
+
throw new CliError("No migrations to snapshot", { code: "MIGRATIONS_NOT_FOUND", exitCode: ExitCode.NotFound });
|
|
17
19
|
}
|
|
18
20
|
const stateMode = await this.schemaStateManager.isStateMode();
|
|
19
21
|
const version = files[files.length - 1].version;
|
|
@@ -43,9 +45,11 @@ class MigrationSnapshotFacade {
|
|
|
43
45
|
covers,
|
|
44
46
|
contentMigrations
|
|
45
47
|
};
|
|
46
|
-
await this.snapshotManager.write(snapshot);
|
|
47
48
|
return snapshot;
|
|
48
49
|
}
|
|
50
|
+
async write(snapshot) {
|
|
51
|
+
await this.snapshotManager.write(snapshot);
|
|
52
|
+
}
|
|
49
53
|
/**
|
|
50
54
|
* Returns the snapshot when it can safely bootstrap the current project, else null.
|
|
51
55
|
* The snapshot is only usable on an empty project (no executed migrations) and only when
|
|
@@ -62,7 +66,7 @@ class MigrationSnapshotFacade {
|
|
|
62
66
|
const snapshot = await this.snapshotManager.read();
|
|
63
67
|
const stale = await this.findStaleness(snapshot);
|
|
64
68
|
if (stale) {
|
|
65
|
-
|
|
69
|
+
this.output.warn(`Ignoring snapshot: ${stale}. Run "migrations snapshot" to regenerate it.`);
|
|
66
70
|
return null;
|
|
67
71
|
}
|
|
68
72
|
return snapshot;
|
|
@@ -75,7 +79,7 @@ class MigrationSnapshotFacade {
|
|
|
75
79
|
for (const covered of snapshot.covers) {
|
|
76
80
|
const file = byVersion.get(covered.version);
|
|
77
81
|
if (!file) {
|
|
78
|
-
throw `Snapshot covers missing migration ${covered.name}
|
|
82
|
+
throw new CliError(`Snapshot covers missing migration ${covered.name}`, { code: "SNAPSHOT_COVER_MISSING", exitCode: ExitCode.NotFound });
|
|
79
83
|
}
|
|
80
84
|
covers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()));
|
|
81
85
|
}
|
|
@@ -88,12 +92,12 @@ class MigrationSnapshotFacade {
|
|
|
88
92
|
/** Offline check that the snapshot still equals a full replay of all migrations. */
|
|
89
93
|
async verify() {
|
|
90
94
|
if (!await this.snapshotManager.exists()) {
|
|
91
|
-
throw 'No snapshot found. Run "migrations
|
|
95
|
+
throw new CliError('No snapshot found. Run "migrations snapshot" first.', { code: "SNAPSHOT_NOT_FOUND", exitCode: ExitCode.NotFound });
|
|
92
96
|
}
|
|
93
97
|
const snapshot = await this.snapshotManager.read();
|
|
94
98
|
const stale = await this.findStaleness(snapshot);
|
|
95
99
|
if (stale) {
|
|
96
|
-
return { ok: false, message: `Snapshot is stale: ${stale}. Run "migrations
|
|
100
|
+
return { ok: false, message: `Snapshot is stale: ${stale}. Run "migrations snapshot" to regenerate it.` };
|
|
97
101
|
}
|
|
98
102
|
const stateMode = await this.schemaStateManager.isStateMode();
|
|
99
103
|
const replaySchema = await this.schemaVersionBuilder.buildSchema();
|
|
@@ -115,7 +119,7 @@ class MigrationSnapshotFacade {
|
|
|
115
119
|
}
|
|
116
120
|
return {
|
|
117
121
|
ok: false,
|
|
118
|
-
message: 'Snapshot does not match a full replay of all migrations. Run "migrations
|
|
122
|
+
message: 'Snapshot does not match a full replay of all migrations. Run "migrations snapshot" to regenerate it.'
|
|
119
123
|
};
|
|
120
124
|
}
|
|
121
125
|
async findStaleness(snapshot) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationSnapshotFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationSnapshotFacade.ts"],"sourcesContent":["import { compareArraysIgnoreOrder, deepCompare, emptySchema } from '@contember/schema-utils'\nimport {\n\tcalculateMigrationChecksum,\n\tCoveredMigration,\n\tExecutedMigrationInfo,\n\tisSchemaMigration,\n\tMigrationContent,\n\tMigrationsResolver,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotFile,\n\tSnapshotInput,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\n\nexport class MigrationSnapshotFacade {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly schemaDiffer: SchemaDiffer,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly snapshotManager: SnapshotManager,\n\t) {\n\t}\n\n\t/** Collapses all migrations into a single schema snapshot and writes snapshot.json. */\n\tasync create(): Promise<SnapshotFile> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tif (files.length === 0) {\n\t\t\tthrow 'No migrations to snapshot'\n\t\t}\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst version = files[files.length - 1].version\n\n\t\t// Replay all schema migrations into a single schema. In state mode the non-model parts\n\t\t// (acl/validation/actions/settings) live in state/ and are skipped here; otherwise they\n\t\t// are part of the migration history and must be included in the collapsed modifications.\n\t\tconst collapsedSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(emptySchema, () => true)\n\t\tconst modifications = this.schemaDiffer.diffSchemas(emptySchema, collapsedSchema, {\n\t\t\tskipNonModelDiffers: stateMode,\n\t\t})\n\n\t\tconst covers: CoveredMigration[] = []\n\t\tconst contentMigrations: string[] = []\n\t\tfor (const file of files) {\n\t\t\tconst content = await file.getContent()\n\t\t\tconst schema = isSchemaMigration(content)\n\t\t\tcovers.push({\n\t\t\t\tversion: file.version,\n\t\t\t\tname: file.name,\n\t\t\t\ttype: schema ? 'schema' : 'content',\n\t\t\t\tchecksum: schema ? calculateMigrationChecksum(content) : null,\n\t\t\t})\n\t\t\tif (!schema) {\n\t\t\t\tcontentMigrations.push(file.version)\n\t\t\t}\n\t\t}\n\n\t\tconst snapshot: SnapshotFile = {\n\t\t\tversion,\n\t\t\tstateMode,\n\t\t\tsnapshot: { formatVersion: VERSION_LATEST, modifications },\n\t\t\tcovers,\n\t\t\tcontentMigrations,\n\t\t}\n\t\tawait this.snapshotManager.write(snapshot)\n\t\treturn snapshot\n\t}\n\n\t/**\n\t * Returns the snapshot when it can safely bootstrap the current project, else null.\n\t * The snapshot is only usable on an empty project (no executed migrations) and only when\n\t * none of the covered migration files have changed. A present-but-stale snapshot is skipped\n\t * with a warning, falling back to a full replay.\n\t */\n\tasync getUsableSnapshot(executedMigrations: ExecutedMigrationInfo[]): Promise<SnapshotFile | null> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\treturn null\n\t\t}\n\t\tif (executedMigrations.length > 0) {\n\t\t\treturn null\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\tconsole.warn(`Ignoring snapshot: ${stale}. Run \"migrations:snapshot\" to regenerate it.`)\n\t\t\treturn null\n\t\t}\n\t\treturn snapshot\n\t}\n\n\t/** Maps a snapshot to the GraphQL SnapshotInput; covered migrations are sent as Migration inputs. */\n\tasync buildSnapshotInput(snapshot: SnapshotFile): Promise<SnapshotInput> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tconst covers: unknown[] = []\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\tthrow `Snapshot covers missing migration ${covered.name}`\n\t\t\t}\n\t\t\tcovers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()))\n\t\t}\n\t\treturn {\n\t\t\tformatVersion: snapshot.snapshot.formatVersion,\n\t\t\tmodifications: snapshot.snapshot.modifications,\n\t\t\tcovers,\n\t\t}\n\t}\n\n\t/** Offline check that the snapshot still equals a full replay of all migrations. */\n\tasync verify(): Promise<{ ok: boolean; message: string }> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\tthrow 'No snapshot found. Run \"migrations:snapshot\" first.'\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\treturn { ok: false, message: `Snapshot is stale: ${stale}. Run \"migrations:snapshot\" to regenerate it.` }\n\t\t}\n\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst replaySchema = await this.schemaVersionBuilder.buildSchema()\n\t\tlet snapshotSchema = this.schemaMigrator.applyModifications(emptySchema, snapshot.snapshot.modifications, snapshot.snapshot.formatVersion)\n\t\tif (stateMode) {\n\t\t\tsnapshotSchema = { ...snapshotSchema, ...await this.schemaStateManager.readState() }\n\t\t}\n\n\t\t// Compare with the same order-insensitive equality that SchemaDiffer uses for its own\n\t\t// round-trip check. The collapsed differ emits fields/constraints in a fixed order that may\n\t\t// differ from a replay of an interleaved history (e.g. a column added to an entity that\n\t\t// already has a relation), so a raw checksum (JSON.stringify) would report false mismatches\n\t\t// on schemas that are in fact deeply equal.\n\t\tconst differences = deepCompare(replaySchema, snapshotSchema, [], path => {\n\t\t\tif (path[0] === 'model' && path[1] === 'entities' && (path[3] === 'unique' || path[3] === 'index')) {\n\t\t\t\treturn (a, b) => compareArraysIgnoreOrder(a, b, path)\n\t\t\t}\n\t\t\treturn null\n\t\t})\n\t\tif (differences.length === 0) {\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tmessage: `Snapshot is up to date (covers ${snapshot.covers.length} migrations up to ${snapshot.version}).`,\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tok: false,\n\t\t\tmessage: 'Snapshot does not match a full replay of all migrations. Run \"migrations:snapshot\" to regenerate it.',\n\t\t}\n\t}\n\n\tprivate async findStaleness(snapshot: SnapshotFile): Promise<string | null> {\n\t\t// The collapsed snapshot is built differently per mode (state mode omits the non-model parts,\n\t\t// see create()), and on bootstrap the non-model overlay is driven by the *current* mode. A mode\n\t\t// switch since the snapshot was created (e.g. migrations:init-state) leaves the covers untouched\n\t\t// and would otherwise pass unnoticed, so treat it as stale and fall back to a full replay.\n\t\tif (snapshot.stateMode !== await this.schemaStateManager.isStateMode()) {\n\t\t\treturn `schema state mode changed since the snapshot was created`\n\t\t}\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\treturn `covered migration ${covered.name} is missing`\n\t\t\t}\n\t\t\tconst content = await file.getContent()\n\t\t\tconst currentType = isSchemaMigration(content) ? 'schema' : 'content'\n\t\t\t// A covered migration that flipped type (e.g. a content migration manually rewritten into a\n\t\t\t// schema one) is not reflected in the collapsed modifications, so the snapshot no longer\n\t\t\t// equals a replay. Schema covers also verify the checksum; content covers carry none (their\n\t\t\t// data is never reproduced), so the type check is the only identity they get.\n\t\t\tif (currentType !== covered.type) {\n\t\t\t\treturn `covered migration ${covered.name} changed type`\n\t\t\t}\n\t\t\tif (covered.type === 'schema') {\n\t\t\t\tconst checksum = isSchemaMigration(content) ? calculateMigrationChecksum(content) : null\n\t\t\t\tif (checksum !== covered.checksum) {\n\t\t\t\t\treturn `covered migration ${covered.name} has changed`\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Detect a migration added within the covered range (version <= snapshot.version) that the\n\t\t// snapshot does not know about — e.g. a teammate's migration with an earlier timestamp merged\n\t\t// after the snapshot was generated. Without this, bootstrapping would record the covers up to\n\t\t// snapshot.version and the subsequent normal replay would fail with MUST_FOLLOW_LATEST on the\n\t\t// in-range migration, leaving the database half-bootstrapped. Treat it as stale and fall back.\n\t\tconst coveredVersions = new Set(snapshot.covers.map(it => it.version))\n\t\tfor (const file of files) {\n\t\t\tif (file.version <= snapshot.version && !coveredVersions.has(file.version)) {\n\t\t\t\treturn `migration ${file.name} is within the covered range but not part of the snapshot`\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n\nconst migrationContentToInput = (version: string, name: string, content: MigrationContent) => {\n\tif (isSchemaMigration(content)) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tname,\n\t\t\ttype: 'SCHEMA',\n\t\t\tschemaMigration: {\n\t\t\t\tformatVersion: content.formatVersion,\n\t\t\t\tmodifications: content.modifications,\n\t\t\t\tskippedErrors: content.skippedErrors,\n\t\t\t},\n\t\t}\n\t}\n\t// Content migrations are only recorded as executed (no data is replayed), so the queries are irrelevant.\n\treturn { version, name, type: 'CONTENT', contentMigration: [] }\n}\n"],"names":[],"mappings":";;AAkBO,M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AM,WAAW,kBAAkB,OAAO,IAAI,2BAA2B,OAAO,IAAI;AACpF,YAAI,aAAa,QAAQ,UAAU;AAClC,iBAAO,qBAAqB,QAAQ,IAAI;AAAA,QACzC;AAAA,MACD;AAAA,IACD;AAMA,UAAM,kBAAkB,IAAI,IAAI,SAAS,OAAO,IAAI,CAAA,OAAM,GAAG,OAAO,CAAC;AACrE,eAAW,QAAQ,OAAO;AACzB,UAAI,KAAK,WAAW,SAAS,WAAW,CAAC,gBAAgB,IAAI,KAAK,OAAO,GAAG;AAC3E,eAAO,aAAa,KAAK,IAAI;AAAA,MAC9B;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;AAEA,MAAM,0BAA0B,CAAC,SAAiB,MAAc,YAA8B;AAC7F,MAAI,kBAAkB,OAAO,GAAG;AAC/B,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN,iBAAiB;AAAA,QAChB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,MAAA;AAAA,IACxB;AAAA,EAEF;AAEA,SAAO,EAAE,SAAS,MAAM,MAAM,WAAW,kBAAkB,GAAC;AAC7D;"}
|
|
1
|
+
{"version":3,"file":"MigrationSnapshotFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationSnapshotFacade.ts"],"sourcesContent":["import { compareArraysIgnoreOrder, deepCompare, emptySchema } from '@contember/schema-utils'\nimport {\n\tcalculateMigrationChecksum,\n\tCoveredMigration,\n\tExecutedMigrationInfo,\n\tisSchemaMigration,\n\tMigrationContent,\n\tMigrationsResolver,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotFile,\n\tSnapshotInput,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { CliError, ExitCode, Output } from '@contember/cli-common'\n\nexport class MigrationSnapshotFacade {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly schemaDiffer: SchemaDiffer,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly snapshotManager: SnapshotManager,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\t/** Builds a snapshot in memory without changing the filesystem. */\n\tasync prepare(): Promise<SnapshotFile> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tif (files.length === 0) {\n\t\t\tthrow new CliError('No migrations to snapshot', { code: 'MIGRATIONS_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst version = files[files.length - 1].version\n\n\t\t// Replay all schema migrations into a single schema. In state mode the non-model parts\n\t\t// (acl/validation/actions/settings) live in state/ and are skipped here; otherwise they\n\t\t// are part of the migration history and must be included in the collapsed modifications.\n\t\tconst collapsedSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(emptySchema, () => true)\n\t\tconst modifications = this.schemaDiffer.diffSchemas(emptySchema, collapsedSchema, {\n\t\t\tskipNonModelDiffers: stateMode,\n\t\t})\n\n\t\tconst covers: CoveredMigration[] = []\n\t\tconst contentMigrations: string[] = []\n\t\tfor (const file of files) {\n\t\t\tconst content = await file.getContent()\n\t\t\tconst schema = isSchemaMigration(content)\n\t\t\tcovers.push({\n\t\t\t\tversion: file.version,\n\t\t\t\tname: file.name,\n\t\t\t\ttype: schema ? 'schema' : 'content',\n\t\t\t\tchecksum: schema ? calculateMigrationChecksum(content) : null,\n\t\t\t})\n\t\t\tif (!schema) {\n\t\t\t\tcontentMigrations.push(file.version)\n\t\t\t}\n\t\t}\n\n\t\tconst snapshot: SnapshotFile = {\n\t\t\tversion,\n\t\t\tstateMode,\n\t\t\tsnapshot: { formatVersion: VERSION_LATEST, modifications },\n\t\t\tcovers,\n\t\t\tcontentMigrations,\n\t\t}\n\t\treturn snapshot\n\t}\n\n\tasync write(snapshot: SnapshotFile): Promise<void> {\n\t\tawait this.snapshotManager.write(snapshot)\n\t}\n\n\t/**\n\t * Returns the snapshot when it can safely bootstrap the current project, else null.\n\t * The snapshot is only usable on an empty project (no executed migrations) and only when\n\t * none of the covered migration files have changed. A present-but-stale snapshot is skipped\n\t * with a warning, falling back to a full replay.\n\t */\n\tasync getUsableSnapshot(executedMigrations: ExecutedMigrationInfo[]): Promise<SnapshotFile | null> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\treturn null\n\t\t}\n\t\tif (executedMigrations.length > 0) {\n\t\t\treturn null\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\tthis.output.warn(`Ignoring snapshot: ${stale}. Run \"migrations snapshot\" to regenerate it.`)\n\t\t\treturn null\n\t\t}\n\t\treturn snapshot\n\t}\n\n\t/** Maps a snapshot to the GraphQL SnapshotInput; covered migrations are sent as Migration inputs. */\n\tasync buildSnapshotInput(snapshot: SnapshotFile): Promise<SnapshotInput> {\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tconst covers: unknown[] = []\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\tthrow new CliError(`Snapshot covers missing migration ${covered.name}`, { code: 'SNAPSHOT_COVER_MISSING', exitCode: ExitCode.NotFound })\n\t\t\t}\n\t\t\tcovers.push(migrationContentToInput(covered.version, covered.name, await file.getContent()))\n\t\t}\n\t\treturn {\n\t\t\tformatVersion: snapshot.snapshot.formatVersion,\n\t\t\tmodifications: snapshot.snapshot.modifications,\n\t\t\tcovers,\n\t\t}\n\t}\n\n\t/** Offline check that the snapshot still equals a full replay of all migrations. */\n\tasync verify(): Promise<{ ok: boolean; message: string }> {\n\t\tif (!(await this.snapshotManager.exists())) {\n\t\t\tthrow new CliError('No snapshot found. Run \"migrations snapshot\" first.', { code: 'SNAPSHOT_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst snapshot = await this.snapshotManager.read()\n\n\t\tconst stale = await this.findStaleness(snapshot)\n\t\tif (stale) {\n\t\t\treturn { ok: false, message: `Snapshot is stale: ${stale}. Run \"migrations snapshot\" to regenerate it.` }\n\t\t}\n\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\tconst replaySchema = await this.schemaVersionBuilder.buildSchema()\n\t\tlet snapshotSchema = this.schemaMigrator.applyModifications(emptySchema, snapshot.snapshot.modifications, snapshot.snapshot.formatVersion)\n\t\tif (stateMode) {\n\t\t\tsnapshotSchema = { ...snapshotSchema, ...await this.schemaStateManager.readState() }\n\t\t}\n\n\t\t// Compare with the same order-insensitive equality that SchemaDiffer uses for its own\n\t\t// round-trip check. The collapsed differ emits fields/constraints in a fixed order that may\n\t\t// differ from a replay of an interleaved history (e.g. a column added to an entity that\n\t\t// already has a relation), so a raw checksum (JSON.stringify) would report false mismatches\n\t\t// on schemas that are in fact deeply equal.\n\t\tconst differences = deepCompare(replaySchema, snapshotSchema, [], path => {\n\t\t\tif (path[0] === 'model' && path[1] === 'entities' && (path[3] === 'unique' || path[3] === 'index')) {\n\t\t\t\treturn (a, b) => compareArraysIgnoreOrder(a, b, path)\n\t\t\t}\n\t\t\treturn null\n\t\t})\n\t\tif (differences.length === 0) {\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tmessage: `Snapshot is up to date (covers ${snapshot.covers.length} migrations up to ${snapshot.version}).`,\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tok: false,\n\t\t\tmessage: 'Snapshot does not match a full replay of all migrations. Run \"migrations snapshot\" to regenerate it.',\n\t\t}\n\t}\n\n\tprivate async findStaleness(snapshot: SnapshotFile): Promise<string | null> {\n\t\t// The collapsed snapshot is built differently per mode (state mode omits the non-model parts,\n\t\t// see create()), and on bootstrap the non-model overlay is driven by the *current* mode. A mode\n\t\t// switch since the snapshot was created (e.g. migrations init-state) leaves the covers untouched\n\t\t// and would otherwise pass unnoticed, so treat it as stale and fall back to a full replay.\n\t\tif (snapshot.stateMode !== await this.schemaStateManager.isStateMode()) {\n\t\t\treturn `schema state mode changed since the snapshot was created`\n\t\t}\n\t\tconst files = await this.migrationsResolver.getMigrationFiles()\n\t\tconst byVersion = new Map(files.map(it => [it.version, it]))\n\t\tfor (const covered of snapshot.covers) {\n\t\t\tconst file = byVersion.get(covered.version)\n\t\t\tif (!file) {\n\t\t\t\treturn `covered migration ${covered.name} is missing`\n\t\t\t}\n\t\t\tconst content = await file.getContent()\n\t\t\tconst currentType = isSchemaMigration(content) ? 'schema' : 'content'\n\t\t\t// A covered migration that flipped type (e.g. a content migration manually rewritten into a\n\t\t\t// schema one) is not reflected in the collapsed modifications, so the snapshot no longer\n\t\t\t// equals a replay. Schema covers also verify the checksum; content covers carry none (their\n\t\t\t// data is never reproduced), so the type check is the only identity they get.\n\t\t\tif (currentType !== covered.type) {\n\t\t\t\treturn `covered migration ${covered.name} changed type`\n\t\t\t}\n\t\t\tif (covered.type === 'schema') {\n\t\t\t\tconst checksum = isSchemaMigration(content) ? calculateMigrationChecksum(content) : null\n\t\t\t\tif (checksum !== covered.checksum) {\n\t\t\t\t\treturn `covered migration ${covered.name} has changed`\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Detect a migration added within the covered range (version <= snapshot.version) that the\n\t\t// snapshot does not know about — e.g. a teammate's migration with an earlier timestamp merged\n\t\t// after the snapshot was generated. Without this, bootstrapping would record the covers up to\n\t\t// snapshot.version and the subsequent normal replay would fail with MUST_FOLLOW_LATEST on the\n\t\t// in-range migration, leaving the database half-bootstrapped. Treat it as stale and fall back.\n\t\tconst coveredVersions = new Set(snapshot.covers.map(it => it.version))\n\t\tfor (const file of files) {\n\t\t\tif (file.version <= snapshot.version && !coveredVersions.has(file.version)) {\n\t\t\t\treturn `migration ${file.name} is within the covered range but not part of the snapshot`\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n\nconst migrationContentToInput = (version: string, name: string, content: MigrationContent) => {\n\tif (isSchemaMigration(content)) {\n\t\treturn {\n\t\t\tversion,\n\t\t\tname,\n\t\t\ttype: 'SCHEMA',\n\t\t\tschemaMigration: {\n\t\t\t\tformatVersion: content.formatVersion,\n\t\t\t\tmodifications: content.modifications,\n\t\t\t\tskippedErrors: content.skippedErrors,\n\t\t\t},\n\t\t}\n\t}\n\t// Content migrations are only recorded as executed (no data is replayed), so the queries are irrelevant.\n\treturn { version, name, type: 'CONTENT', contentMigration: [] }\n}\n"],"names":[],"mappings":";;;AAmBO,MAAM,wBAAwB;AAAA,EACpC,YACkB,oBACA,sBACA,cACA,gBACA,oBACA,iBACA,SAAiB,IAAI,UACrC;AAPgB,SAAA,qBAAA;AACA,SAAA,uBAAA;AACA,SAAA,eAAA;AACA,SAAA,iBAAA;AACA,SAAA,qBAAA;AACA,SAAA,kBAAA;AACA,SAAA,SAAA;AAAA,EAElB;AAAA;AAAA,EAGA,MAAM,UAAiC;AACtC,UAAM,QAAQ,MAAM,KAAK,mBAAmB,kBAAA;AAC5C,QAAI,MAAM,WAAW,GAAG;AACvB,YAAM,IAAI,SAAS,6BAA6B,EAAE,MAAM,wBAAwB,UAAU,SAAS,UAAU;AAAA,IAC9G;AACA,UAAM,YAAY,MAAM,KAAK,mBAAmB,YAAA;AAChD,UAAM,UAAU,MAAM,MAAM,SAAS,CAAC,EAAE;AAKxC,UAAM,kBAAkB,MAAM,KAAK,qBAAqB,oBAAoB,aAAa,MAAM,IAAI;AACnG,UAAM,gBAAgB,KAAK,aAAa,YAAY,aAAa,iBAAiB;AAAA,MACjF,qBAAqB;AAAA,IAAA,CACrB;AAED,UAAM,SAA6B,CAAA;AACnC,UAAM,oBAA8B,CAAA;AACpC,eAAW,QAAQ,OAAO;AACzB,YAAM,UAAU,MAAM,KAAK,WAAA;AAC3B,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AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN,iBAAiB;AAAA,QAChB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,QACvB,eAAe,QAAQ;AAAA,MAAA;AAAA,IACxB;AAAA,EAEF;AAEA,SAAO,EAAE,SAAS,MAAM,MAAM,WAAW,kBAAkB,GAAC;AAC7D;"}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cliCommon = require("@contember/cli-common");
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
7
|
class MigrationsStatusFacade {
|
|
7
|
-
constructor(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter) {
|
|
8
|
+
constructor(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter, output = new cliCommon.Output()) {
|
|
8
9
|
this.systemClientProvider = systemClientProvider;
|
|
9
10
|
this.migrationsResolver = migrationsResolver;
|
|
10
11
|
this.migrationsStatusResolver = migrationsStatusResolver;
|
|
11
12
|
this.migrationPrinter = migrationPrinter;
|
|
13
|
+
this.output = output;
|
|
14
|
+
__publicField(this, "getLocalMigrationFiles", () => this.migrationsResolver.getMigrationFiles());
|
|
12
15
|
__publicField(this, "resolveMigrationsStatus", async ({ force, allowError }) => {
|
|
13
16
|
const executedMigrations = await this.systemClientProvider.get().listExecutedMigrations();
|
|
17
|
+
return await this.resolveMigrationsStatusFromExecuted(executedMigrations, { force, allowError });
|
|
18
|
+
});
|
|
19
|
+
__publicField(this, "resolveMigrationsStatusFromExecuted", async (executedMigrations, { force, allowError }) => {
|
|
14
20
|
const localMigrations = await this.migrationsResolver.getMigrationFiles();
|
|
15
21
|
const status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force);
|
|
16
22
|
if (status.errorMigrations.length > 0 && !allowError) {
|
|
17
|
-
|
|
23
|
+
for (const line of this.migrationPrinter.formatStatusTable(status.errorMigrations).split("\n")) {
|
|
24
|
+
this.output.info(line);
|
|
25
|
+
}
|
|
18
26
|
if (!force) {
|
|
19
|
-
throw
|
|
27
|
+
throw new cliCommon.CliError("Cannot execute migrations", { code: "MIGRATIONS_BROKEN", exitCode: cliCommon.ExitCode.InputError });
|
|
20
28
|
}
|
|
21
29
|
}
|
|
22
30
|
return status;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationsStatusFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'\nimport { SystemClientProvider } from '../SystemClientProvider.js'\nimport { MigrationPrinter } from './MigrationPrinter.js'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t) {\n\t}\n\n\tpublic resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0 && !allowError) {\n\t\t\
|
|
1
|
+
{"version":3,"file":"MigrationsStatusFacade.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { ExecutedMigrationInfo, MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'\nimport { SystemClientProvider } from '../SystemClientProvider.js'\nimport { MigrationPrinter } from './MigrationPrinter.js'\nimport { CliError, ExitCode, Output } from '@contember/cli-common'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\tpublic getLocalMigrationFiles = () => this.migrationsResolver.getMigrationFiles()\n\n\tpublic resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\treturn await this.resolveMigrationsStatusFromExecuted(executedMigrations, { force, allowError })\n\t}\n\n\tpublic resolveMigrationsStatusFromExecuted = async (\n\t\texecutedMigrations: ExecutedMigrationInfo[],\n\t\t{ force, allowError }: { force?: boolean; allowError?: boolean },\n\t) => {\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0 && !allowError) {\n\t\t\t// diagnostic context for the failure below, so it goes to stderr unstyled\n\t\t\tfor (const line of this.migrationPrinter.formatStatusTable(status.errorMigrations).split('\\n')) {\n\t\t\t\tthis.output.info(line)\n\t\t\t}\n\t\t\tif (!force) {\n\t\t\t\tthrow new CliError('Cannot execute migrations', { code: 'MIGRATIONS_BROKEN', exitCode: ExitCode.InputError })\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":["Output","CliError","ExitCode"],"mappings":";;;;;;AAKO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BACA,kBACA,SAAiB,IAAIA,UAAAA,UACrC;AALgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AACA,SAAA,mBAAA;AACA,SAAA,SAAA;AAIlB,kBAAA,MAAO,0BAAyB,MAAM,KAAK,mBAAmB,mBAAkB;AAEhF,kBAAA,MAAO,2BAA0B,OAAO,EAAE,OAAO,iBAA4D;AAC5G,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM,uBAAA;AACjE,aAAO,MAAM,KAAK,oCAAoC,oBAAoB,EAAE,OAAO,YAAY;AAAA,IAChG,CAAA;AAEA,kBAAA,MAAO,uCAAsC,OAC5C,oBACA,EAAE,OAAO,iBACL;AACJ,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAA;AACtD,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AACjH,UAAI,OAAO,gBAAgB,SAAS,KAAK,CAAC,YAAY;AAErD,mBAAW,QAAQ,KAAK,iBAAiB,kBAAkB,OAAO,eAAe,EAAE,MAAM,IAAI,GAAG;AAC/F,eAAK,OAAO,KAAK,IAAI;AAAA,QACtB;AACA,YAAI,CAAC,OAAO;AACX,gBAAM,IAAIC,UAAAA,SAAS,6BAA6B,EAAE,MAAM,qBAAqB,UAAUC,mBAAS,YAAY;AAAA,QAC7G;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EA1BA;AA2BD;;"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
import { Output, CliError, ExitCode } from "@contember/cli-common";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
5
|
class MigrationsStatusFacade {
|
|
5
|
-
constructor(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter) {
|
|
6
|
+
constructor(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter, output = new Output()) {
|
|
6
7
|
this.systemClientProvider = systemClientProvider;
|
|
7
8
|
this.migrationsResolver = migrationsResolver;
|
|
8
9
|
this.migrationsStatusResolver = migrationsStatusResolver;
|
|
9
10
|
this.migrationPrinter = migrationPrinter;
|
|
11
|
+
this.output = output;
|
|
12
|
+
__publicField(this, "getLocalMigrationFiles", () => this.migrationsResolver.getMigrationFiles());
|
|
10
13
|
__publicField(this, "resolveMigrationsStatus", async ({ force, allowError }) => {
|
|
11
14
|
const executedMigrations = await this.systemClientProvider.get().listExecutedMigrations();
|
|
15
|
+
return await this.resolveMigrationsStatusFromExecuted(executedMigrations, { force, allowError });
|
|
16
|
+
});
|
|
17
|
+
__publicField(this, "resolveMigrationsStatusFromExecuted", async (executedMigrations, { force, allowError }) => {
|
|
12
18
|
const localMigrations = await this.migrationsResolver.getMigrationFiles();
|
|
13
19
|
const status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force);
|
|
14
20
|
if (status.errorMigrations.length > 0 && !allowError) {
|
|
15
|
-
|
|
21
|
+
for (const line of this.migrationPrinter.formatStatusTable(status.errorMigrations).split("\n")) {
|
|
22
|
+
this.output.info(line);
|
|
23
|
+
}
|
|
16
24
|
if (!force) {
|
|
17
|
-
throw
|
|
25
|
+
throw new CliError("Cannot execute migrations", { code: "MIGRATIONS_BROKEN", exitCode: ExitCode.InputError });
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
28
|
return status;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationsStatusFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'\nimport { SystemClientProvider } from '../SystemClientProvider.js'\nimport { MigrationPrinter } from './MigrationPrinter.js'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t) {\n\t}\n\n\tpublic resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0 && !allowError) {\n\t\t\
|
|
1
|
+
{"version":3,"file":"MigrationsStatusFacade.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsStatusFacade.ts"],"sourcesContent":["import { ExecutedMigrationInfo, MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'\nimport { SystemClientProvider } from '../SystemClientProvider.js'\nimport { MigrationPrinter } from './MigrationPrinter.js'\nimport { CliError, ExitCode, Output } from '@contember/cli-common'\n\nexport class MigrationsStatusFacade {\n\tconstructor(\n\t\tprivate readonly systemClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly migrationsStatusResolver: MigrationsStatusResolver,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\tpublic getLocalMigrationFiles = () => this.migrationsResolver.getMigrationFiles()\n\n\tpublic resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {\n\t\tconst executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()\n\t\treturn await this.resolveMigrationsStatusFromExecuted(executedMigrations, { force, allowError })\n\t}\n\n\tpublic resolveMigrationsStatusFromExecuted = async (\n\t\texecutedMigrations: ExecutedMigrationInfo[],\n\t\t{ force, allowError }: { force?: boolean; allowError?: boolean },\n\t) => {\n\t\tconst localMigrations = await this.migrationsResolver.getMigrationFiles()\n\t\tconst status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)\n\t\tif (status.errorMigrations.length > 0 && !allowError) {\n\t\t\t// diagnostic context for the failure below, so it goes to stderr unstyled\n\t\t\tfor (const line of this.migrationPrinter.formatStatusTable(status.errorMigrations).split('\\n')) {\n\t\t\t\tthis.output.info(line)\n\t\t\t}\n\t\t\tif (!force) {\n\t\t\t\tthrow new CliError('Cannot execute migrations', { code: 'MIGRATIONS_BROKEN', exitCode: ExitCode.InputError })\n\t\t\t}\n\t\t}\n\n\t\treturn status\n\t}\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,uBAAuB;AAAA,EACnC,YACkB,sBACA,oBACA,0BACA,kBACA,SAAiB,IAAI,UACrC;AALgB,SAAA,uBAAA;AACA,SAAA,qBAAA;AACA,SAAA,2BAAA;AACA,SAAA,mBAAA;AACA,SAAA,SAAA;AAIlB,kBAAA,MAAO,0BAAyB,MAAM,KAAK,mBAAmB,mBAAkB;AAEhF,kBAAA,MAAO,2BAA0B,OAAO,EAAE,OAAO,iBAA4D;AAC5G,YAAM,qBAAqB,MAAM,KAAK,qBAAqB,IAAA,EAAM,uBAAA;AACjE,aAAO,MAAM,KAAK,oCAAoC,oBAAoB,EAAE,OAAO,YAAY;AAAA,IAChG,CAAA;AAEA,kBAAA,MAAO,uCAAsC,OAC5C,oBACA,EAAE,OAAO,iBACL;AACJ,YAAM,kBAAkB,MAAM,KAAK,mBAAmB,kBAAA;AACtD,YAAM,SAAS,MAAM,KAAK,yBAAyB,oBAAoB,oBAAoB,iBAAiB,KAAK;AACjH,UAAI,OAAO,gBAAgB,SAAS,KAAK,CAAC,YAAY;AAErD,mBAAW,QAAQ,KAAK,iBAAiB,kBAAkB,OAAO,eAAe,EAAE,MAAM,IAAI,GAAG;AAC/F,eAAK,OAAO,KAAK,IAAI;AAAA,QACtB;AACA,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI,SAAS,6BAA6B,EAAE,MAAM,qBAAqB,UAAU,SAAS,YAAY;AAAA,QAC7G;AAAA,MACD;AAEA,aAAO;AAAA,IACR,CAAA;AAAA,EA1BA;AA2BD;"}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const schemaMigrations = require("@contember/schema-migrations");
|
|
4
4
|
const SchemaValidationHelper = require("../schema/SchemaValidationHelper.cjs");
|
|
5
|
+
const cliCommon = require("@contember/cli-common");
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
8
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
8
9
|
class MigrationsValidator {
|
|
9
|
-
constructor(describer, migrator) {
|
|
10
|
+
constructor(describer, migrator, output = new cliCommon.Output()) {
|
|
10
11
|
this.describer = describer;
|
|
11
12
|
this.migrator = migrator;
|
|
13
|
+
this.output = output;
|
|
12
14
|
__publicField(this, "validate", (initialSchema, migrations) => {
|
|
13
15
|
let migratedSchema = initialSchema;
|
|
14
16
|
let projectValid = true;
|
|
@@ -19,7 +21,7 @@ class MigrationsValidator {
|
|
|
19
21
|
migratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion);
|
|
20
22
|
} catch (e) {
|
|
21
23
|
if (e instanceof schemaMigrations.SchemaUpdateError) {
|
|
22
|
-
|
|
24
|
+
this.output.error(`Migration ${migration.name} has failed`);
|
|
23
25
|
}
|
|
24
26
|
throw e;
|
|
25
27
|
}
|
|
@@ -28,7 +30,7 @@ class MigrationsValidator {
|
|
|
28
30
|
...skippedErrors.filter((it) => it.skipUntil && schemaMigrations.MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),
|
|
29
31
|
...migration.skippedErrors ?? []
|
|
30
32
|
];
|
|
31
|
-
projectValid = SchemaValidationHelper.validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors) && projectValid;
|
|
33
|
+
projectValid = SchemaValidationHelper.validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors, this.output) && projectValid;
|
|
32
34
|
}
|
|
33
35
|
return projectValid;
|
|
34
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationsValidator.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper.js'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"MigrationsValidator.cjs","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper.js'\nimport { Output } from '@contember/cli-common'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tthis.output.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors, this.output)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":["Output","SchemaUpdateError","MigrationVersionHelper","validateSchemaAndPrintErrors"],"mappings":";;;;;;;;AAOO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UACA,SAAiB,IAAIA,UAAAA,UACrC;AAHgB,SAAA,YAAA;AACA,SAAA,WAAA;AACA,SAAA,SAAA;AAIlB,kBAAA,MAAA,YAAW,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAA;AACpD,iBAAW,aAAa,YAAY;AACnC,YAAI;AAEH,eAAK,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,QACnH,SAAS,GAAG;AACX,cAAI,aAAaC,iBAAAA,mBAAmB;AACnC,iBAAK,OAAO,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UAC3D;AACA,gBAAM;AAAA,QACP;AACA,cAAM,eAAe,aAAa,UAAU,IAAI;AAChD,wBAAgB;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAaC,wCAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAA;AAAA,QAAC;AAEhC,uBAAeC,uBAAAA,6BAA6B,gBAAgB,cAAc,eAAe,KAAK,MAAM,KAChG;AAAA,MACL;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA3BA;AA4BD;;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SchemaUpdateError, MigrationVersionHelper } from "@contember/schema-migrations";
|
|
2
2
|
import { validateSchemaAndPrintErrors } from "../schema/SchemaValidationHelper.js";
|
|
3
|
+
import { Output } from "@contember/cli-common";
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
6
7
|
class MigrationsValidator {
|
|
7
|
-
constructor(describer, migrator) {
|
|
8
|
+
constructor(describer, migrator, output = new Output()) {
|
|
8
9
|
this.describer = describer;
|
|
9
10
|
this.migrator = migrator;
|
|
11
|
+
this.output = output;
|
|
10
12
|
__publicField(this, "validate", (initialSchema, migrations) => {
|
|
11
13
|
let migratedSchema = initialSchema;
|
|
12
14
|
let projectValid = true;
|
|
@@ -17,7 +19,7 @@ class MigrationsValidator {
|
|
|
17
19
|
migratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion);
|
|
18
20
|
} catch (e) {
|
|
19
21
|
if (e instanceof SchemaUpdateError) {
|
|
20
|
-
|
|
22
|
+
this.output.error(`Migration ${migration.name} has failed`);
|
|
21
23
|
}
|
|
22
24
|
throw e;
|
|
23
25
|
}
|
|
@@ -26,7 +28,7 @@ class MigrationsValidator {
|
|
|
26
28
|
...skippedErrors.filter((it) => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),
|
|
27
29
|
...migration.skippedErrors ?? []
|
|
28
30
|
];
|
|
29
|
-
projectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors) && projectValid;
|
|
31
|
+
projectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors, this.output) && projectValid;
|
|
30
32
|
}
|
|
31
33
|
return projectValid;
|
|
32
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationsValidator.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper.js'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"MigrationsValidator.js","sources":["../../../../../../packages/cli/src/lib/migrations/MigrationsValidator.ts"],"sourcesContent":["import { Migration } from '@contember/migrations-client'\nimport { Schema } from '@contember/schema'\nimport { SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { MigrationDescriber, MigrationVersionHelper, SchemaMigrator, SchemaUpdateError } from '@contember/schema-migrations'\nimport { validateSchemaAndPrintErrors } from '../schema/SchemaValidationHelper.js'\nimport { Output } from '@contember/cli-common'\n\nexport class MigrationsValidator {\n\tconstructor(\n\t\tprivate readonly describer: MigrationDescriber,\n\t\tprivate readonly migrator: SchemaMigrator,\n\t\tprivate readonly output: Output = new Output(),\n\t) {\n\t}\n\n\tvalidate = (initialSchema: Schema, migrations: Migration[]): boolean => {\n\t\tlet migratedSchema = initialSchema\n\t\tlet projectValid = true\n\t\tlet skippedErrors: SchemaValidatorSkippedErrors[] = []\n\t\tfor (const migration of migrations) {\n\t\t\ttry {\n\t\t\t\t// just a check that it does not fail\n\t\t\t\tthis.describer.describeModifications(migratedSchema, migration)\n\n\t\t\t\tmigratedSchema = this.migrator.applyModifications(migratedSchema, migration.modifications, migration.formatVersion)\n\t\t\t} catch (e) {\n\t\t\t\tif (e instanceof SchemaUpdateError) {\n\t\t\t\t\tthis.output.error(`Migration ${migration.name} has failed`)\n\t\t\t\t}\n\t\t\t\tthrow e\n\t\t\t}\n\t\t\tconst errorMessage = `Migration ${migration.name} produces invalid schema:`\n\t\t\tskippedErrors = [\n\t\t\t\t...skippedErrors.filter(it => it.skipUntil && MigrationVersionHelper.extractVersion(it.skipUntil) >= migration.version),\n\t\t\t\t...migration.skippedErrors ?? [],\n\t\t\t]\n\t\t\tprojectValid = validateSchemaAndPrintErrors(migratedSchema, errorMessage, skippedErrors, this.output)\n\t\t\t\t&& projectValid\n\t\t}\n\t\treturn projectValid\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,oBAAoB;AAAA,EAChC,YACkB,WACA,UACA,SAAiB,IAAI,UACrC;AAHgB,SAAA,YAAA;AACA,SAAA,WAAA;AACA,SAAA,SAAA;AAIlB,kBAAA,MAAA,YAAW,CAAC,eAAuB,eAAqC;AACvE,UAAI,iBAAiB;AACrB,UAAI,eAAe;AACnB,UAAI,gBAAgD,CAAA;AACpD,iBAAW,aAAa,YAAY;AACnC,YAAI;AAEH,eAAK,UAAU,sBAAsB,gBAAgB,SAAS;AAE9D,2BAAiB,KAAK,SAAS,mBAAmB,gBAAgB,UAAU,eAAe,UAAU,aAAa;AAAA,QACnH,SAAS,GAAG;AACX,cAAI,aAAa,mBAAmB;AACnC,iBAAK,OAAO,MAAM,aAAa,UAAU,IAAI,aAAa;AAAA,UAC3D;AACA,gBAAM;AAAA,QACP;AACA,cAAM,eAAe,aAAa,UAAU,IAAI;AAChD,wBAAgB;AAAA,UACf,GAAG,cAAc,OAAO,CAAA,OAAM,GAAG,aAAa,uBAAuB,eAAe,GAAG,SAAS,KAAK,UAAU,OAAO;AAAA,UACtH,GAAG,UAAU,iBAAiB,CAAA;AAAA,QAAC;AAEhC,uBAAe,6BAA6B,gBAAgB,cAAc,eAAe,KAAK,MAAM,KAChG;AAAA,MACL;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EA3BA;AA4BD;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cliCommon = require("@contember/cli-common");
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
@@ -12,7 +13,10 @@ class RemoteProjectProvider {
|
|
|
12
13
|
}
|
|
13
14
|
get() {
|
|
14
15
|
if (!this._remoteProject) {
|
|
15
|
-
throw new
|
|
16
|
+
throw new cliCommon.CliError("Project not defined. Set CONTEMBER_DSN, or CONTEMBER_API_URL, CONTEMBER_API_TOKEN and CONTEMBER_PROJECT_NAME.", {
|
|
17
|
+
code: "PROJECT_NOT_DEFINED",
|
|
18
|
+
exitCode: cliCommon.ExitCode.InputError
|
|
19
|
+
});
|
|
16
20
|
}
|
|
17
21
|
return this._remoteProject;
|
|
18
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteProjectProvider.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject.js'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new
|
|
1
|
+
{"version":3,"file":"RemoteProjectProvider.cjs","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { CliError, ExitCode } from '@contember/cli-common'\nimport { RemoteProject } from './RemoteProject.js'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\t// the container leaves this unset when the env resolves to no project — a user mistake, not a bug\n\t\t\tthrow new CliError('Project not defined. Set CONTEMBER_DSN, or CONTEMBER_API_URL, CONTEMBER_API_TOKEN and CONTEMBER_PROJECT_NAME.', {\n\t\t\t\tcode: 'PROJECT_NOT_DEFINED',\n\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t})\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":["CliError","ExitCode"],"mappings":";;;;;;AAGO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACN,kBAAA,MAAQ,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEO,MAAqB;AAC3B,QAAI,CAAC,KAAK,gBAAgB;AAEzB,YAAM,IAAIA,UAAAA,SAAS,iHAAiH;AAAA,QACnI,MAAM;AAAA,QACN,UAAUC,UAAAA,SAAS;AAAA,MAAA,CACnB;AAAA,IACF;AACA,WAAO,KAAK;AAAA,EACb;AACD;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CliError, ExitCode } from "@contember/cli-common";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
@@ -10,7 +11,10 @@ class RemoteProjectProvider {
|
|
|
10
11
|
}
|
|
11
12
|
get() {
|
|
12
13
|
if (!this._remoteProject) {
|
|
13
|
-
throw new
|
|
14
|
+
throw new CliError("Project not defined. Set CONTEMBER_DSN, or CONTEMBER_API_URL, CONTEMBER_API_TOKEN and CONTEMBER_PROJECT_NAME.", {
|
|
15
|
+
code: "PROJECT_NOT_DEFINED",
|
|
16
|
+
exitCode: ExitCode.InputError
|
|
17
|
+
});
|
|
14
18
|
}
|
|
15
19
|
return this._remoteProject;
|
|
16
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteProjectProvider.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { RemoteProject } from './RemoteProject.js'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\tthrow new
|
|
1
|
+
{"version":3,"file":"RemoteProjectProvider.js","sources":["../../../../../../packages/cli/src/lib/project/RemoteProjectProvider.ts"],"sourcesContent":["import { CliError, ExitCode } from '@contember/cli-common'\nimport { RemoteProject } from './RemoteProject.js'\n\nexport class RemoteProjectProvider {\n\tprivate _remoteProject: RemoteProject | undefined = undefined\n\n\tpublic setRemoteProject(remoteProject: RemoteProject) {\n\t\tthis._remoteProject = remoteProject\n\t}\n\n\tpublic get(): RemoteProject {\n\t\tif (!this._remoteProject) {\n\t\t\t// the container leaves this unset when the env resolves to no project — a user mistake, not a bug\n\t\t\tthrow new CliError('Project not defined. Set CONTEMBER_DSN, or CONTEMBER_API_URL, CONTEMBER_API_TOKEN and CONTEMBER_PROJECT_NAME.', {\n\t\t\t\tcode: 'PROJECT_NOT_DEFINED',\n\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t})\n\t\t}\n\t\treturn this._remoteProject\n\t}\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,sBAAsB;AAAA,EAA5B,cAAA;AACN,kBAAA,MAAQ,gBAAA;AAAA,EAAA;AAAA,EAED,iBAAiB,eAA8B;AACrD,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEO,MAAqB;AAC3B,QAAI,CAAC,KAAK,gBAAgB;AAEzB,YAAM,IAAI,SAAS,iHAAiH;AAAA,QACnI,MAAM;AAAA,QACN,UAAU,SAAS;AAAA,MAAA,CACnB;AAAA,IACF;AACA,WAAO,KAAK;AAAA,EACb;AACD;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const prompts = require("prompts");
|
|
4
|
+
const prompt_internal = require("./prompt.internal.cjs");
|
|
5
|
+
const runPrompt = async (question) => {
|
|
6
|
+
const answer = await prompts(question);
|
|
7
|
+
return answer;
|
|
8
|
+
};
|
|
9
|
+
const promptConfirm = (output, options) => prompt_internal.promptConfirmWithRunner(output, options, runPrompt);
|
|
10
|
+
const promptSelect = (output, options) => prompt_internal.promptSelectWithRunner(output, options, runPrompt);
|
|
11
|
+
exports.promptConfirm = promptConfirm;
|
|
12
|
+
exports.promptSelect = promptSelect;
|
|
13
|
+
//# sourceMappingURL=prompt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.cjs","sources":["../../../../../../packages/cli/src/lib/prompt/prompt.ts"],"sourcesContent":["import { Output } from '@contember/cli-common'\nimport prompts from 'prompts'\nimport {\n\ttype ConfirmPromptOptions,\n\ttype PromptAnswer,\n\tpromptConfirmWithRunner,\n\ttype PromptQuestion,\n\tpromptSelectWithRunner,\n\ttype SelectPromptChoice,\n\ttype SelectPromptOptions,\n} from './prompt.internal.js'\n\nexport type { ConfirmPromptOptions, SelectPromptChoice, SelectPromptOptions } from './prompt.internal.js'\n\nconst runPrompt = async <Q extends PromptQuestion>(question: Q): Promise<PromptAnswer> => {\n\tconst answer: { value?: unknown } = await prompts(question)\n\treturn answer\n}\n\nexport const promptConfirm = (output: Output, options: ConfirmPromptOptions): Promise<boolean> => promptConfirmWithRunner(output, options, runPrompt)\n\nexport const promptSelect = <const T extends string>(output: Output, options: SelectPromptOptions<T>): Promise<T | undefined> =>\n\tpromptSelectWithRunner(output, options, runPrompt)\n"],"names":["promptConfirmWithRunner","promptSelectWithRunner"],"mappings":";;;;AAcA,MAAM,YAAY,OAAiC,aAAuC;AACzF,QAAM,SAA8B,MAAM,QAAQ,QAAQ;AAC1D,SAAO;AACR;AAEO,MAAM,gBAAgB,CAAC,QAAgB,YAAoDA,gBAAAA,wBAAwB,QAAQ,SAAS,SAAS;AAE7I,MAAM,eAAe,CAAyB,QAAgB,YACpEC,gBAAAA,uBAAuB,QAAQ,SAAS,SAAS;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const answerName = "value";
|
|
4
|
+
const promptConfirmWithRunner = async (output, options, runner) => {
|
|
5
|
+
const question = options.initial === void 0 ? { type: "confirm", name: answerName, message: options.message, stdout: output.promptOutput } : { type: "confirm", name: answerName, message: options.message, initial: options.initial, stdout: output.promptOutput };
|
|
6
|
+
const answer = await runner(question);
|
|
7
|
+
return answer.value === true;
|
|
8
|
+
};
|
|
9
|
+
const promptSelectWithRunner = async (output, options, runner) => {
|
|
10
|
+
const answer = await runner({
|
|
11
|
+
type: "select",
|
|
12
|
+
name: answerName,
|
|
13
|
+
message: options.message,
|
|
14
|
+
choices: options.choices.map((choice) => ({ title: choice.title, value: choice.value })),
|
|
15
|
+
stdout: output.promptOutput
|
|
16
|
+
});
|
|
17
|
+
return options.choices.find((choice) => choice.value === answer.value)?.value;
|
|
18
|
+
};
|
|
19
|
+
exports.promptConfirmWithRunner = promptConfirmWithRunner;
|
|
20
|
+
exports.promptSelectWithRunner = promptSelectWithRunner;
|
|
21
|
+
//# sourceMappingURL=prompt.internal.cjs.map
|