@contember/cli 2.2.0-alpha.3 → 2.2.0-alpha.5
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 +31 -11
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.js +32 -12
- 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 +152 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.js +152 -0
- package/dist/development/src/lib/tenant/TenantApiTransport.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +95 -26
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantConfigApplier.js +95 -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 +101 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/clients/TenantPolicyClient.js +101 -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 +31 -11
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.js +32 -12
- 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 +152 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.js +152 -0
- package/dist/production/src/lib/tenant/TenantApiTransport.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +95 -26
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantConfigApplier.js +95 -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 +101 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/clients/TenantPolicyClient.js +101 -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 +47 -0
- package/dist/types/lib/tenant/TenantApiTransport.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts +37 -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 +69 -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 +20 -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 +45 -13
- 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 +200 -0
- package/src/lib/tenant/TenantConfigApplier.ts +172 -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 +192 -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 +23 -25
- package/src/lib/transfer/DataTransferClient.ts +354 -59
- package/src/lib/transfer/stdio.ts +5 -7
- package/src/run.ts +19 -3
- 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 +275 -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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Command } from "@contember/cli-common";
|
|
1
|
+
import { Command, CliError, ExitCode } from "@contember/cli-common";
|
|
2
2
|
import { InvalidSchemaException } from "@contember/schema-migrations";
|
|
3
|
-
import prompts from "prompts";
|
|
4
3
|
import { emptySchema } from "@contember/schema-utils";
|
|
5
4
|
import { SchemaStateManager } from "@contember/migrations-client";
|
|
6
5
|
import { printValidationErrors } from "../../lib/schema/SchemaValidationPrinter.js";
|
|
6
|
+
import { promptSelect } from "../../lib/prompt/prompt.js";
|
|
7
7
|
class MigrationAmendCommand extends Command {
|
|
8
8
|
constructor(migrationsResolver, systemApiClientProvider, migrationsStatusFacade, schemaLoader, schemaVersionBuilder, migrationCreator, migrationsValidator, migrationPrinter, schemaMigrator, schemaStateManager) {
|
|
9
9
|
super();
|
|
@@ -24,16 +24,19 @@ class MigrationAmendCommand extends Command {
|
|
|
24
24
|
configuration.option("force").description("Ignore migrations order and missing migrations (dev only)");
|
|
25
25
|
configuration.option("yes").valueNone().description("Do not ask for confirmation.");
|
|
26
26
|
}
|
|
27
|
-
async execute(input) {
|
|
27
|
+
async execute(input, output) {
|
|
28
28
|
const migrationName = input.getArgument("migration");
|
|
29
29
|
const amendMigration = migrationName ? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName) : await this.migrationsResolver.findLatestSchemaMigration();
|
|
30
30
|
if (!amendMigration) {
|
|
31
|
-
throw "No migration to amend";
|
|
31
|
+
throw new CliError("No migration to amend", { code: "MIGRATION_NOT_FOUND", exitCode: ExitCode.NotFound });
|
|
32
32
|
}
|
|
33
33
|
const force = input.getOption("force");
|
|
34
34
|
const status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force });
|
|
35
35
|
if (status.migrationsToExecute.length > 0) {
|
|
36
|
-
throw
|
|
36
|
+
throw new CliError("Some migrations are not executed. Unable to amend.", {
|
|
37
|
+
code: "MIGRATIONS_NOT_EXECUTED",
|
|
38
|
+
exitCode: ExitCode.InputError
|
|
39
|
+
});
|
|
37
40
|
}
|
|
38
41
|
const schema = await this.schemaLoader.loadSchema();
|
|
39
42
|
const stateMode = await this.schemaStateManager.isStateMode();
|
|
@@ -46,15 +49,27 @@ class MigrationAmendCommand extends Command {
|
|
|
46
49
|
const stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false;
|
|
47
50
|
if (intermediateResult === null) {
|
|
48
51
|
if (stateChanged) {
|
|
52
|
+
if (!await this.shouldContinue(input, output)) {
|
|
53
|
+
throw abortedError("Migration amendment");
|
|
54
|
+
}
|
|
55
|
+
if (schemaState === void 0) {
|
|
56
|
+
throw new CliError("Schema state is unavailable", { code: "SCHEMA_STATE_UNAVAILABLE", exitCode: ExitCode.InternalError });
|
|
57
|
+
}
|
|
49
58
|
await this.schemaStateManager.writeState(schemaState);
|
|
50
|
-
console.log("Schema state updated (no model changes)");
|
|
51
59
|
} else {
|
|
52
|
-
|
|
60
|
+
output.info("Nothing to do");
|
|
53
61
|
}
|
|
62
|
+
output.data(
|
|
63
|
+
{ migration: amendMigration.name, stateUpdated: stateChanged, changed: stateChanged },
|
|
64
|
+
{ human: (value) => value.changed ? "Schema state updated (no model changes)" : "Nothing to do", quiet: (value) => value.migration }
|
|
65
|
+
);
|
|
54
66
|
return 0;
|
|
55
67
|
}
|
|
56
68
|
if (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {
|
|
57
|
-
throw "Incompatible migration format version"
|
|
69
|
+
throw new CliError("Incompatible migration format version", {
|
|
70
|
+
code: "MIGRATION_FORMAT_INCOMPATIBLE",
|
|
71
|
+
exitCode: ExitCode.InputError
|
|
72
|
+
});
|
|
58
73
|
}
|
|
59
74
|
const prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(
|
|
60
75
|
emptySchema,
|
|
@@ -76,29 +91,31 @@ class MigrationAmendCommand extends Command {
|
|
|
76
91
|
[...newMigrationResult ? [newMigrationResult.migration] : [], ...followingMigrations]
|
|
77
92
|
);
|
|
78
93
|
if (!valid) {
|
|
79
|
-
throw
|
|
94
|
+
throw new CliError("Cannot amend migration", { code: "MIGRATIONS_INVALID", exitCode: ExitCode.InputError });
|
|
80
95
|
}
|
|
81
96
|
this.migrationPrinter.printMigrationDescription(
|
|
82
97
|
intermediateResult.initialSchema,
|
|
83
98
|
intermediateResult.migration,
|
|
84
99
|
{ noSql: true }
|
|
85
100
|
);
|
|
86
|
-
|
|
87
|
-
if (!await this.shouldContinue(input)) {
|
|
88
|
-
|
|
89
|
-
return 1;
|
|
101
|
+
output.info(`Amending ${amendMigration.name}`);
|
|
102
|
+
if (!await this.shouldContinue(input, output)) {
|
|
103
|
+
throw abortedError("Migration amendment");
|
|
90
104
|
}
|
|
91
105
|
const systemClient = this.systemApiClientProvider.get();
|
|
92
106
|
await systemClient.migrate([intermediateResult.migration], force);
|
|
93
107
|
await systemClient.migrationDelete(intermediateResult.migration.version);
|
|
94
|
-
if (!newMigrationResult && await this.shouldRemove()) {
|
|
108
|
+
if (!newMigrationResult && await this.shouldRemove(input, output)) {
|
|
95
109
|
await this.migrationCreator.removeMigration(amendMigration.name);
|
|
96
110
|
await systemClient.migrationDelete(amendMigration.version);
|
|
97
111
|
if (schemaState) {
|
|
98
112
|
await this.schemaStateManager.writeState(schemaState);
|
|
99
113
|
await systemClient.migrate([], force, schemaState);
|
|
100
114
|
}
|
|
101
|
-
|
|
115
|
+
output.data(
|
|
116
|
+
{ migration: amendMigration.name, removed: true, stateUpdated: schemaState !== void 0 },
|
|
117
|
+
{ human: () => "Latest migration was removed", quiet: (value) => value.migration }
|
|
118
|
+
);
|
|
102
119
|
return 0;
|
|
103
120
|
}
|
|
104
121
|
const newMigration = {
|
|
@@ -113,23 +130,31 @@ class MigrationAmendCommand extends Command {
|
|
|
113
130
|
await this.schemaStateManager.writeState(schemaState);
|
|
114
131
|
await systemClient.migrate([], force, schemaState);
|
|
115
132
|
}
|
|
133
|
+
output.data(
|
|
134
|
+
{ migration: amendMigration.name, removed: false, stateUpdated: schemaState !== void 0 },
|
|
135
|
+
{ human: (value) => `Amended ${value.migration}`, quiet: (value) => value.migration }
|
|
136
|
+
);
|
|
116
137
|
return 0;
|
|
117
138
|
} catch (e) {
|
|
118
139
|
if (e instanceof InvalidSchemaException) {
|
|
119
|
-
printValidationErrors(e.validationErrors, e.message);
|
|
120
|
-
|
|
140
|
+
printValidationErrors(e.validationErrors, e.message, output);
|
|
141
|
+
throw new CliError(e.message, {
|
|
142
|
+
code: "SCHEMA_INVALID",
|
|
143
|
+
exitCode: ExitCode.InputError,
|
|
144
|
+
details: e.validationErrors,
|
|
145
|
+
cause: e
|
|
146
|
+
});
|
|
121
147
|
}
|
|
122
148
|
throw e;
|
|
123
149
|
}
|
|
124
150
|
}
|
|
125
|
-
async shouldContinue(input) {
|
|
151
|
+
async shouldContinue(input, output) {
|
|
126
152
|
const yes = input.getOption("yes");
|
|
127
153
|
if (yes) {
|
|
128
154
|
return true;
|
|
129
155
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
name: "action",
|
|
156
|
+
assertCanPrompt(output);
|
|
157
|
+
const action = await promptSelect(output, {
|
|
133
158
|
message: "Do you want to continue?",
|
|
134
159
|
choices: [
|
|
135
160
|
{ value: "yes", title: "Yes" },
|
|
@@ -138,10 +163,13 @@ class MigrationAmendCommand extends Command {
|
|
|
138
163
|
});
|
|
139
164
|
return action === "yes";
|
|
140
165
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
166
|
+
/** With --yes the migration is kept and emptied — removing a file that others may have already executed is not safe to assume. */
|
|
167
|
+
async shouldRemove(input, output) {
|
|
168
|
+
if (input.getOption("yes")) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
assertCanPrompt(output);
|
|
172
|
+
const action = await promptSelect(output, {
|
|
145
173
|
message: "The amendment results in a no-op migration because the changes introduced by the latest migration were reverted.\nYou can choose to remove the latest migration or to modify it so it is empty.",
|
|
146
174
|
choices: [
|
|
147
175
|
{ value: "remove", title: "Remove latest migration" },
|
|
@@ -151,6 +179,18 @@ class MigrationAmendCommand extends Command {
|
|
|
151
179
|
return action === "remove";
|
|
152
180
|
}
|
|
153
181
|
}
|
|
182
|
+
const abortedError = (operation) => new CliError(`${operation} aborted`, {
|
|
183
|
+
code: "OPERATION_ABORTED",
|
|
184
|
+
exitCode: ExitCode.InputError
|
|
185
|
+
});
|
|
186
|
+
const assertCanPrompt = (output) => {
|
|
187
|
+
if (!output.canPrompt()) {
|
|
188
|
+
throw new CliError("TTY not available. Pass --yes to confirm execution.", {
|
|
189
|
+
code: "TTY_UNAVAILABLE",
|
|
190
|
+
exitCode: ExitCode.InputError
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
};
|
|
154
194
|
export {
|
|
155
195
|
MigrationAmendCommand
|
|
156
196
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationAmendCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationAmendCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { InvalidSchemaException, SchemaMigrator } from '@contember/schema-migrations'\nimport prompts from 'prompts'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'\nimport { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade.js'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader.js'\nimport { MigrationsValidator } from '../../lib/migrations/MigrationsValidator.js'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'\nimport { SystemClientProvider } from '../../lib/SystemClientProvider.js'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\tyes?: true\n\tforce: boolean\n}\n\nexport class MigrationAmendCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly systemApiClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsStatusFacade: MigrationsStatusFacade,\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Amends latest migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('force').description('Ignore migrations order and missing migrations (dev only)')\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<number> {\n\t\tconst migrationName = input.getArgument('migration')\n\t\tconst amendMigration = migrationName\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\t\tif (!amendMigration) {\n\t\t\tthrow 'No migration to amend'\n\t\t}\n\t\tconst force = input.getOption('force')\n\t\tconst status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force })\n\t\tif (status.migrationsToExecute.length > 0) {\n\t\t\tthrow `Some migrations are not executed. Unable to amend.`\n\t\t}\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, '', {\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t})\n\n\t\t\tconst schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined\n\t\t\tconst stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false\n\n\t\t\tif (intermediateResult === null) {\n\t\t\t\tif (stateChanged) {\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState!)\n\t\t\t\t\tconsole.log('Schema state updated (no model changes)')\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Nothing to do')\n\t\t\t\t}\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {\n\t\t\t\tthrow 'Incompatible migration format version'\n\t\t\t}\n\t\t\tconst prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\t\temptySchema,\n\t\t\t\tversion => version < amendMigration.version,\n\t\t\t)\n\t\t\tconst newSchema = await this.schemaMigrator.applyModifications(\n\t\t\t\tprevSchema,\n\t\t\t\t[...amendMigration.modifications, ...intermediateResult.migration.modifications],\n\t\t\t\tamendMigration.formatVersion,\n\t\t\t)\n\t\t\tconst newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, '', {\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t})\n\t\t\tconst followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(\n\t\t\t\tit => it.version > amendMigration.version,\n\t\t\t)\n\n\t\t\tconst valid = await this.migrationsValidator.validate(\n\t\t\t\tprevSchema,\n\t\t\t\t[...(newMigrationResult ? [newMigrationResult.migration] : []), ...followingMigrations],\n\t\t\t)\n\t\t\tif (!valid) {\n\t\t\t\tthrow `Cannot amend migration`\n\t\t\t}\n\n\t\t\tthis.migrationPrinter.printMigrationDescription(\n\t\t\t\tintermediateResult.initialSchema,\n\t\t\t\tintermediateResult.migration,\n\t\t\t\t{ noSql: true },\n\t\t\t)\n\t\t\tconsole.log(`Amending ${amendMigration.name}`)\n\t\t\tif (!(await this.shouldContinue(input))) {\n\t\t\t\tconsole.log('Aborting')\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tconst systemClient = this.systemApiClientProvider.get()\n\t\t\tawait systemClient.migrate([intermediateResult.migration], force)\n\t\t\tawait systemClient.migrationDelete(intermediateResult.migration.version)\n\n\t\t\tif (!newMigrationResult && await this.shouldRemove()) {\n\t\t\t\tawait this.migrationCreator.removeMigration(amendMigration.name)\n\t\t\t\tawait systemClient.migrationDelete(amendMigration.version)\n\t\t\t\tif (schemaState) {\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t\t// migrationDelete rebuilds the server schema from migrations, dropping the\n\t\t\t\t\t// non-model state; re-apply it so the server stays in sync with the state files.\n\t\t\t\t\tawait systemClient.migrate([], force, schemaState)\n\t\t\t\t}\n\t\t\t\tconsole.log('Latest migration was removed')\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tconst newMigration = {\n\t\t\t\tname: amendMigration.name,\n\t\t\t\tversion: amendMigration.version,\n\t\t\t\tformatVersion: newMigrationResult?.migration.formatVersion ?? amendMigration.formatVersion,\n\t\t\t\tmodifications: newMigrationResult?.migration.modifications ?? [],\n\t\t\t}\n\t\t\tawait this.migrationCreator.saveMigration(newMigration)\n\t\t\tawait systemClient.migrationModify(amendMigration.version, newMigration)\n\n\t\t\tif (schemaState) {\n\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t// migrationModify rebuilds the server schema from migrations, dropping the\n\t\t\t\t// non-model state; re-apply it so the server stays in sync with the state files.\n\t\t\t\tawait systemClient.migrate([], force, schemaState)\n\t\t\t}\n\n\t\t\treturn 0\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message)\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tprivate async shouldContinue(input: Input<{}, { yes?: true }>): Promise<boolean> {\n\t\tconst yes = input.getOption('yes')\n\t\tif (yes) {\n\t\t\treturn true\n\t\t}\n\t\tconst { action } = await prompts({\n\t\t\ttype: 'select',\n\t\t\tname: 'action',\n\t\t\tmessage: 'Do you want to continue?',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'yes'\n\t}\n\n\tprivate async shouldRemove(): Promise<boolean> {\n\t\tconst { action } = await prompts({\n\t\t\ttype: 'select',\n\t\t\tname: 'action',\n\t\t\tmessage:\n\t\t\t\t'The amendment results in a no-op migration because the changes introduced by the latest migration were reverted.\\nYou can choose to remove the latest migration or to modify it so it is empty.',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'remove', title: 'Remove latest migration' },\n\t\t\t\t{ value: 'keep', title: 'Keep latest migration and make it empty' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'remove'\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,8BAA8B,QAAuB;AAAA,EACjE,YACkB,oBACA,yBACA,wBACA,cACA,sBACA,kBACA,qBACA,kBACA,gBACA,oBAChB;AACD,UAAA;AAXiB,SAAA,qBAAA;AACA,SAAA,0BAAA;AACA,SAAA,yBAAA;AACA,SAAA,eAAA;AACA,SAAA,uBAAA;AACA,SAAA,mBAAA;AACA,SAAA,sBAAA;AACA,SAAA,mBAAA;AACA,SAAA,iBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,yBAAyB;AACnD,kBAAc,SAAS,WAAW,EAAE,SAAA;AACpC,kBAAc,OAAO,OAAO,EAAE,YAAY,2DAA2D;AACrG,kBACE,OAAO,KAAK,EACZ,UAAA,EACA,YAAY,8BAA8B;AAAA,EAC7C;AAAA,EAEA,MAAgB,QAAQ,OAA8C;AACrE,UAAM,gBAAgB,MAAM,YAAY,WAAW;AACnD,UAAM,iBAAiB,gBACpB,MAAM,KAAK,mBAAmB,6BAA6B,aAAa,IACxE,MAAM,KAAK,mBAAmB,0BAAA;AACjC,QAAI,CAAC,gBAAgB;AACpB,YAAM;AAAA,IACP;AACA,UAAM,QAAQ,MAAM,UAAU,OAAO;AACrC,UAAM,SAAS,MAAM,KAAK,uBAAuB,wBAAwB,EAAE,OAAO;AAClF,QAAI,OAAO,oBAAoB,SAAS,GAAG;AAC1C,YAAM;AAAA,IACP;AAEA,UAAM,SAAS,MAAM,KAAK,aAAa,WAAA;AACvC,UAAM,YAAY,MAAM,KAAK,mBAAmB,YAAA;AAChD,QAAI;AACH,YAAM,gBAAgB,MAAM,KAAK,q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AK;AACR,aAAO;AAAA,IACR;AACA,UAAM,EAAE,WAAW,MAAM,QAAQ;AAAA,MAChC,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,QACR,EAAE,OAAO,OAAO,OAAO,MAAA;AAAA,QACvB,EAAE,OAAO,MAAM,OAAO,QAAA;AAAA,MAAQ;AAAA,IAC/B,CACA;AACD,WAAO,WAAW;AAAA,EACnB;AAAA,EAEA,MAAc,eAAiC;AAC9C,UAAM,EAAE,WAAW,MAAM,QAAQ;AAAA,MAChC,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SACC;AAAA,MACD,SAAS;AAAA,QACR,EAAE,OAAO,UAAU,OAAO,0BAAA;AAAA,QAC1B,EAAE,OAAO,QAAQ,OAAO,0CAAA;AAAA,MAA0C;AAAA,IACnE,CACA;AACD,WAAO,WAAW;AAAA,EACnB;AACD;"}
|
|
1
|
+
{"version":3,"file":"MigrationAmendCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationAmendCommand.ts"],"sourcesContent":["import { CliError, Command, CommandConfiguration, ExitCode, Input, Output } from '@contember/cli-common'\nimport { InvalidSchemaException, SchemaMigrator } from '@contember/schema-migrations'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'\nimport { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade.js'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader.js'\nimport { MigrationsValidator } from '../../lib/migrations/MigrationsValidator.js'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'\nimport { SystemClientProvider } from '../../lib/SystemClientProvider.js'\nimport { promptSelect } from '../../lib/prompt/index.js'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\tyes?: true\n\tforce: boolean\n}\n\nexport class MigrationAmendCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly systemApiClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsStatusFacade: MigrationsStatusFacade,\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Amends latest migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('force').description('Ignore migrations order and missing migrations (dev only)')\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<number> {\n\t\tconst migrationName = input.getArgument('migration')\n\t\tconst amendMigration = migrationName\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\t\tif (!amendMigration) {\n\t\t\tthrow new CliError('No migration to amend', { code: 'MIGRATION_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst force = input.getOption('force')\n\t\tconst status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force })\n\t\tif (status.migrationsToExecute.length > 0) {\n\t\t\tthrow new CliError('Some migrations are not executed. Unable to amend.', {\n\t\t\t\tcode: 'MIGRATIONS_NOT_EXECUTED',\n\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t})\n\t\t}\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\tconst stateMode = await this.schemaStateManager.isStateMode()\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, '', {\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t})\n\n\t\t\tconst schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined\n\t\t\tconst stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false\n\n\t\t\tif (intermediateResult === null) {\n\t\t\t\tif (stateChanged) {\n\t\t\t\t\tif (!(await this.shouldContinue(input, output))) {\n\t\t\t\t\t\tthrow abortedError('Migration amendment')\n\t\t\t\t\t}\n\t\t\t\t\tif (schemaState === undefined) {\n\t\t\t\t\t\tthrow new CliError('Schema state is unavailable', { code: 'SCHEMA_STATE_UNAVAILABLE', exitCode: ExitCode.InternalError })\n\t\t\t\t\t}\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t} else {\n\t\t\t\t\toutput.info('Nothing to do')\n\t\t\t\t}\n\t\t\t\toutput.data(\n\t\t\t\t\t{ migration: amendMigration.name, stateUpdated: stateChanged, changed: stateChanged },\n\t\t\t\t\t{ human: value => value.changed ? 'Schema state updated (no model changes)' : 'Nothing to do', quiet: value => value.migration },\n\t\t\t\t)\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {\n\t\t\t\tthrow new CliError('Incompatible migration format version', {\n\t\t\t\t\tcode: 'MIGRATION_FORMAT_INCOMPATIBLE',\n\t\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\t\temptySchema,\n\t\t\t\tversion => version < amendMigration.version,\n\t\t\t)\n\t\t\tconst newSchema = await this.schemaMigrator.applyModifications(\n\t\t\t\tprevSchema,\n\t\t\t\t[...amendMigration.modifications, ...intermediateResult.migration.modifications],\n\t\t\t\tamendMigration.formatVersion,\n\t\t\t)\n\t\t\tconst newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, '', {\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t})\n\t\t\tconst followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(\n\t\t\t\tit => it.version > amendMigration.version,\n\t\t\t)\n\n\t\t\tconst valid = await this.migrationsValidator.validate(\n\t\t\t\tprevSchema,\n\t\t\t\t[...(newMigrationResult ? [newMigrationResult.migration] : []), ...followingMigrations],\n\t\t\t)\n\t\t\tif (!valid) {\n\t\t\t\tthrow new CliError('Cannot amend migration', { code: 'MIGRATIONS_INVALID', exitCode: ExitCode.InputError })\n\t\t\t}\n\n\t\t\tthis.migrationPrinter.printMigrationDescription(\n\t\t\t\tintermediateResult.initialSchema,\n\t\t\t\tintermediateResult.migration,\n\t\t\t\t{ noSql: true },\n\t\t\t)\n\t\t\toutput.info(`Amending ${amendMigration.name}`)\n\t\t\tif (!(await this.shouldContinue(input, output))) {\n\t\t\t\tthrow abortedError('Migration amendment')\n\t\t\t}\n\t\t\tconst systemClient = this.systemApiClientProvider.get()\n\t\t\tawait systemClient.migrate([intermediateResult.migration], force)\n\t\t\tawait systemClient.migrationDelete(intermediateResult.migration.version)\n\n\t\t\tif (!newMigrationResult && await this.shouldRemove(input, output)) {\n\t\t\t\tawait this.migrationCreator.removeMigration(amendMigration.name)\n\t\t\t\tawait systemClient.migrationDelete(amendMigration.version)\n\t\t\t\tif (schemaState) {\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t\t// migrationDelete rebuilds the server schema from migrations, dropping the\n\t\t\t\t\t// non-model state; re-apply it so the server stays in sync with the state files.\n\t\t\t\t\tawait systemClient.migrate([], force, schemaState)\n\t\t\t\t}\n\t\t\t\toutput.data(\n\t\t\t\t\t{ migration: amendMigration.name, removed: true, stateUpdated: schemaState !== undefined },\n\t\t\t\t\t{ human: () => 'Latest migration was removed', quiet: value => value.migration },\n\t\t\t\t)\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tconst newMigration = {\n\t\t\t\tname: amendMigration.name,\n\t\t\t\tversion: amendMigration.version,\n\t\t\t\tformatVersion: newMigrationResult?.migration.formatVersion ?? amendMigration.formatVersion,\n\t\t\t\tmodifications: newMigrationResult?.migration.modifications ?? [],\n\t\t\t}\n\t\t\tawait this.migrationCreator.saveMigration(newMigration)\n\t\t\tawait systemClient.migrationModify(amendMigration.version, newMigration)\n\n\t\t\tif (schemaState) {\n\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t// migrationModify rebuilds the server schema from migrations, dropping the\n\t\t\t\t// non-model state; re-apply it so the server stays in sync with the state files.\n\t\t\t\tawait systemClient.migrate([], force, schemaState)\n\t\t\t}\n\t\t\toutput.data(\n\t\t\t\t{ migration: amendMigration.name, removed: false, stateUpdated: schemaState !== undefined },\n\t\t\t\t{ human: value => `Amended ${value.migration}`, quiet: value => value.migration },\n\t\t\t)\n\n\t\t\treturn 0\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message, output)\n\t\t\t\tthrow new CliError(e.message, {\n\t\t\t\t\tcode: 'SCHEMA_INVALID',\n\t\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t\t\tdetails: e.validationErrors,\n\t\t\t\t\tcause: e,\n\t\t\t\t})\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tprivate async shouldContinue(input: Input<{}, { yes?: true }>, output: Output): Promise<boolean> {\n\t\tconst yes = input.getOption('yes')\n\t\tif (yes) {\n\t\t\treturn true\n\t\t}\n\t\tassertCanPrompt(output)\n\t\tconst action = await promptSelect(output, {\n\t\t\tmessage: 'Do you want to continue?',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'yes'\n\t}\n\n\t/** With --yes the migration is kept and emptied — removing a file that others may have already executed is not safe to assume. */\n\tprivate async shouldRemove(input: Input<{}, { yes?: true }>, output: Output): Promise<boolean> {\n\t\tif (input.getOption('yes')) {\n\t\t\treturn false\n\t\t}\n\t\tassertCanPrompt(output)\n\t\tconst action = await promptSelect(output, {\n\t\t\tmessage:\n\t\t\t\t'The amendment results in a no-op migration because the changes introduced by the latest migration were reverted.\\nYou can choose to remove the latest migration or to modify it so it is empty.',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'remove', title: 'Remove latest migration' },\n\t\t\t\t{ value: 'keep', title: 'Keep latest migration and make it empty' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'remove'\n\t}\n}\n\nconst abortedError = (operation: string): CliError =>\n\tnew CliError(`${operation} aborted`, {\n\t\tcode: 'OPERATION_ABORTED',\n\t\texitCode: ExitCode.InputError,\n\t})\n\nconst assertCanPrompt = (output: Output): void => {\n\tif (!output.canPrompt()) {\n\t\tthrow new CliError('TTY not available. Pass --yes to confirm execution.', {\n\t\t\tcode: 'TTY_UNAVAILABLE',\n\t\t\texitCode: ExitCode.InputError,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,8BAA8B,QAAuB;AAAA,EACjE,YACkB,oBACA,yBACA,wBACA,cACA,sBACA,kBACA,qBACA,kBACA,gBACA,oBAChB;AACD,UAAA;AAXiB,SAAA,qBAAA;AACA,SAAA,0BAAA;AACA,SAAA,yBAAA;AACA,SAAA,eAAA;AACA,SAAA,uBAAA;AACA,SAAA,mBAAA;AACA,SAAA,sBAAA;AACA,SAAA,mBAAA;AACA,SAAA,iBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,yBAAyB;AACnD,kBAAc,SAAS,WAAW,EAAE,SAAA;AACpC,kBAAc,OAAO,OAAO,EAAE,YAAY,2DAA2D;AACrG,kBACE,OAAO,KAAK,EACZ,UAAA,EACA,YAAY,8BAA8B;AAAA,EA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U,SAAS;AAAA,IAAA,CACnB;AAAA,EACF;AACD;"}
|
|
@@ -11,11 +11,11 @@ class MigrationBlankCommand extends cliCommon.Command {
|
|
|
11
11
|
configuration.argument("migrationName");
|
|
12
12
|
configuration.argument("format").optional().validator((it) => !it || ["js", "ts", "json"].includes(it)).description("Migration file format (js, ts, json), default is ts.");
|
|
13
13
|
}
|
|
14
|
-
async execute(input) {
|
|
14
|
+
async execute(input, output) {
|
|
15
15
|
const migrationName = input.getArgument("migrationName");
|
|
16
16
|
const migrationFormat = input.getArgument("format") || "ts";
|
|
17
17
|
const filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat);
|
|
18
|
-
|
|
18
|
+
output.data({ path: filename }, { human: (value) => `${value.path} created`, quiet: (value) => value.path });
|
|
19
19
|
return 0;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationBlankCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationBlankCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { MigrationCreator } from '@contember/migrations-client'\n\ntype Args = {\n\tmigrationName: string\n\tformat?: string\n}\n\ntype Options = {}\n\nexport class MigrationBlankCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates new blank migration file')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.argument('format').optional().validator(it => !it || ['js', 'ts', 'json'].includes(it))\n\t\t\t.description('Migration file format (js, ts, json), default is ts.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options
|
|
1
|
+
{"version":3,"file":"MigrationBlankCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationBlankCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, Output } from '@contember/cli-common'\nimport { MigrationCreator } from '@contember/migrations-client'\n\ntype Args = {\n\tmigrationName: string\n\tformat?: string\n}\n\ntype Options = {}\n\nexport class MigrationBlankCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates new blank migration file')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.argument('format').optional().validator(it => !it || ['js', 'ts', 'json'].includes(it))\n\t\t\t.description('Migration file format (js, ts, json), default is ts.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<number> {\n\t\tconst migrationName = input.getArgument('migrationName')\n\t\tconst migrationFormat = input.getArgument('format') || 'ts'\n\t\tconst filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat)\n\t\toutput.data({ path: filename }, { human: value => `${value.path} created`, quiet: value => value.path })\n\t\treturn 0\n\t}\n}\n"],"names":["Command"],"mappings":";;;AAUO,MAAM,8BAA8BA,UAAAA,QAAuB;AAAA,EACjE,YACkB,kBAChB;AACD,UAAA;AAFiB,SAAA,mBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,kCAAkC;AAC5D,kBAAc,SAAS,eAAe;AACtC,kBAAc,SAAS,QAAQ,EAAE,WAAW,UAAU,QAAM,CAAC,MAAM,CAAC,MAAM,MAAM,MAAM,EAAE,SAAS,EAAE,CAAC,EAClG,YAAY,sDAAsD;AAAA,EACrE;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAAiC;AACrF,UAAM,gBAAgB,MAAM,YAAY,eAAe;AACvD,UAAM,kBAAkB,MAAM,YAAY,QAAQ,KAAK;AACvD,UAAM,WAAW,MAAM,KAAK,iBAAiB,yBAAyB,eAAe,eAAe;AACpG,WAAO,KAAK,EAAE,MAAM,SAAA,GAAY,EAAE,OAAO,CAAA,UAAS,GAAG,MAAM,IAAI,YAAY,OAAO,CAAA,UAAS,MAAM,MAAM;AACvG,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -9,11 +9,11 @@ class MigrationBlankCommand extends Command {
|
|
|
9
9
|
configuration.argument("migrationName");
|
|
10
10
|
configuration.argument("format").optional().validator((it) => !it || ["js", "ts", "json"].includes(it)).description("Migration file format (js, ts, json), default is ts.");
|
|
11
11
|
}
|
|
12
|
-
async execute(input) {
|
|
12
|
+
async execute(input, output) {
|
|
13
13
|
const migrationName = input.getArgument("migrationName");
|
|
14
14
|
const migrationFormat = input.getArgument("format") || "ts";
|
|
15
15
|
const filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat);
|
|
16
|
-
|
|
16
|
+
output.data({ path: filename }, { human: (value) => `${value.path} created`, quiet: (value) => value.path });
|
|
17
17
|
return 0;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationBlankCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationBlankCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { MigrationCreator } from '@contember/migrations-client'\n\ntype Args = {\n\tmigrationName: string\n\tformat?: string\n}\n\ntype Options = {}\n\nexport class MigrationBlankCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates new blank migration file')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.argument('format').optional().validator(it => !it || ['js', 'ts', 'json'].includes(it))\n\t\t\t.description('Migration file format (js, ts, json), default is ts.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options
|
|
1
|
+
{"version":3,"file":"MigrationBlankCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationBlankCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, Output } from '@contember/cli-common'\nimport { MigrationCreator } from '@contember/migrations-client'\n\ntype Args = {\n\tmigrationName: string\n\tformat?: string\n}\n\ntype Options = {}\n\nexport class MigrationBlankCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates new blank migration file')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.argument('format').optional().validator(it => !it || ['js', 'ts', 'json'].includes(it))\n\t\t\t.description('Migration file format (js, ts, json), default is ts.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<number> {\n\t\tconst migrationName = input.getArgument('migrationName')\n\t\tconst migrationFormat = input.getArgument('format') || 'ts'\n\t\tconst filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat)\n\t\toutput.data({ path: filename }, { human: value => `${value.path} created`, quiet: value => value.path })\n\t\treturn 0\n\t}\n}\n"],"names":[],"mappings":";AAUO,MAAM,8BAA8B,QAAuB;AAAA,EACjE,YACkB,kBAChB;AACD,UAAA;AAFiB,SAAA,mBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,kCAAkC;AAC5D,kBAAc,SAAS,eAAe;AACtC,kBAAc,SAAS,QAAQ,EAAE,WAAW,UAAU,QAAM,CAAC,MAAM,CAAC,MAAM,MAAM,MAAM,EAAE,SAAS,EAAE,CAAC,EAClG,YAAY,sDAAsD;AAAA,EACrE;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAAiC;AACrF,UAAM,gBAAgB,MAAM,YAAY,eAAe;AACvD,UAAM,kBAAkB,MAAM,YAAY,QAAQ,KAAK;AACvD,UAAM,WAAW,MAAM,KAAK,iBAAiB,yBAAyB,eAAe,eAAe;AACpG,WAAO,KAAK,EAAE,MAAM,SAAA,GAAY,EAAE,OAAO,CAAA,UAAS,GAAG,MAAM,IAAI,YAAY,OAAO,CAAA,UAAS,MAAM,MAAM;AACvG,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -14,16 +14,20 @@ class MigrationDescribeCommand extends cliCommon.Command {
|
|
|
14
14
|
configuration.option("sql-only").valueNone();
|
|
15
15
|
configuration.option("no-sql").valueNone();
|
|
16
16
|
}
|
|
17
|
-
async execute(input) {
|
|
17
|
+
async execute(input, output) {
|
|
18
18
|
const migrationArg = input.getArgument("migration");
|
|
19
19
|
const sqlOnly = input.getOption("sql-only");
|
|
20
20
|
const noSql = input.getOption("no-sql");
|
|
21
21
|
const migration = migrationArg ? await this.migrationsResolver.findSchemaMigrationByVersion(migrationArg) : await this.migrationsResolver.findLatestSchemaMigration();
|
|
22
22
|
if (!migration) {
|
|
23
|
-
throw "Undefined migration";
|
|
23
|
+
throw new cliCommon.CliError("Undefined migration", { code: "MIGRATION_NOT_FOUND", exitCode: cliCommon.ExitCode.NotFound });
|
|
24
24
|
}
|
|
25
25
|
const schema = await this.schemaVersionBuilder.buildSchemaUntil(migration.version);
|
|
26
|
-
this.migrationPrinter.
|
|
26
|
+
const description = this.migrationPrinter.describeMigration(schema, migration);
|
|
27
|
+
output.data(description, {
|
|
28
|
+
human: (it) => this.migrationPrinter.formatMigrationDescription(it, { sqlOnly, noSql }),
|
|
29
|
+
quiet: () => migration.version
|
|
30
|
+
});
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
exports.MigrationDescribeCommand = MigrationDescribeCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDescribeCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDescribeCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\t['sql-only']: boolean\n\t['no-sql']: boolean\n}\n\nexport class MigrationDescribeCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Describes a migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('sql-only').valueNone()\n\t\tconfiguration.option('no-sql').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options
|
|
1
|
+
{"version":3,"file":"MigrationDescribeCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDescribeCommand.ts"],"sourcesContent":["import { CliError, Command, CommandConfiguration, ExitCode, Input, Output } from '@contember/cli-common'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\t['sql-only']: boolean\n\t['no-sql']: boolean\n}\n\nexport class MigrationDescribeCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Describes a migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('sql-only').valueNone()\n\t\tconfiguration.option('no-sql').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<void> {\n\t\tconst migrationArg = input.getArgument('migration')\n\t\tconst sqlOnly = input.getOption('sql-only')\n\t\tconst noSql = input.getOption('no-sql')\n\n\t\tconst migration = migrationArg\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationArg)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\n\t\tif (!migration) {\n\t\t\tthrow new CliError('Undefined migration', { code: 'MIGRATION_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst schema = await this.schemaVersionBuilder.buildSchemaUntil(migration.version)\n\t\t// the description is what the user asked for, so it is data: structured with --json, formatted for a human otherwise\n\t\tconst description = this.migrationPrinter.describeMigration(schema, migration)\n\t\toutput.data(description, {\n\t\t\thuman: it => this.migrationPrinter.formatMigrationDescription(it, { sqlOnly, noSql }),\n\t\t\tquiet: () => migration.version,\n\t\t})\n\t}\n}\n"],"names":["Command","CliError","ExitCode"],"mappings":";;;AAaO,MAAM,iCAAiCA,UAAAA,QAAuB;AAAA,EACpE,YACkB,kBACA,sBACA,oBAChB;AACD,UAAA;AAJiB,SAAA,mBAAA;AACA,SAAA,uBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,uBAAuB;AACjD,kBAAc,SAAS,WAAW,EAAE,SAAA;AACpC,kBAAc,OAAO,UAAU,EAAE,UAAA;AACjC,kBAAc,OAAO,QAAQ,EAAE,UAAA;AAAA,EAChC;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAA+B;AACnF,UAAM,eAAe,MAAM,YAAY,WAAW;AAClD,UAAM,UAAU,MAAM,UAAU,UAAU;AAC1C,UAAM,QAAQ,MAAM,UAAU,QAAQ;AAEtC,UAAM,YAAY,eACf,MAAM,KAAK,mBAAmB,6BAA6B,YAAY,IACvE,MAAM,KAAK,mBAAmB,0BAAA;AAEjC,QAAI,CAAC,WAAW;AACf,YAAM,IAAIC,UAAAA,SAAS,uBAAuB,EAAE,MAAM,uBAAuB,UAAUC,mBAAS,UAAU;AAAA,IACvG;AACA,UAAM,SAAS,MAAM,KAAK,qBAAqB,iBAAiB,UAAU,OAAO;AAEjF,UAAM,cAAc,KAAK,iBAAiB,kBAAkB,QAAQ,SAAS;AAC7E,WAAO,KAAK,aAAa;AAAA,MACxB,OAAO,QAAM,KAAK,iBAAiB,2BAA2B,IAAI,EAAE,SAAS,OAAO;AAAA,MACpF,OAAO,MAAM,UAAU;AAAA,IAAA,CACvB;AAAA,EACF;AACD;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from "@contember/cli-common";
|
|
1
|
+
import { Command, CliError, ExitCode } from "@contember/cli-common";
|
|
2
2
|
class MigrationDescribeCommand extends Command {
|
|
3
3
|
constructor(migrationPrinter, schemaVersionBuilder, migrationsResolver) {
|
|
4
4
|
super();
|
|
@@ -12,16 +12,20 @@ class MigrationDescribeCommand extends Command {
|
|
|
12
12
|
configuration.option("sql-only").valueNone();
|
|
13
13
|
configuration.option("no-sql").valueNone();
|
|
14
14
|
}
|
|
15
|
-
async execute(input) {
|
|
15
|
+
async execute(input, output) {
|
|
16
16
|
const migrationArg = input.getArgument("migration");
|
|
17
17
|
const sqlOnly = input.getOption("sql-only");
|
|
18
18
|
const noSql = input.getOption("no-sql");
|
|
19
19
|
const migration = migrationArg ? await this.migrationsResolver.findSchemaMigrationByVersion(migrationArg) : await this.migrationsResolver.findLatestSchemaMigration();
|
|
20
20
|
if (!migration) {
|
|
21
|
-
throw "Undefined migration";
|
|
21
|
+
throw new CliError("Undefined migration", { code: "MIGRATION_NOT_FOUND", exitCode: ExitCode.NotFound });
|
|
22
22
|
}
|
|
23
23
|
const schema = await this.schemaVersionBuilder.buildSchemaUntil(migration.version);
|
|
24
|
-
this.migrationPrinter.
|
|
24
|
+
const description = this.migrationPrinter.describeMigration(schema, migration);
|
|
25
|
+
output.data(description, {
|
|
26
|
+
human: (it) => this.migrationPrinter.formatMigrationDescription(it, { sqlOnly, noSql }),
|
|
27
|
+
quiet: () => migration.version
|
|
28
|
+
});
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDescribeCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDescribeCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\t['sql-only']: boolean\n\t['no-sql']: boolean\n}\n\nexport class MigrationDescribeCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Describes a migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('sql-only').valueNone()\n\t\tconfiguration.option('no-sql').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options
|
|
1
|
+
{"version":3,"file":"MigrationDescribeCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDescribeCommand.ts"],"sourcesContent":["import { CliError, Command, CommandConfiguration, ExitCode, Input, Output } from '@contember/cli-common'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\t['sql-only']: boolean\n\t['no-sql']: boolean\n}\n\nexport class MigrationDescribeCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Describes a migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('sql-only').valueNone()\n\t\tconfiguration.option('no-sql').valueNone()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<void> {\n\t\tconst migrationArg = input.getArgument('migration')\n\t\tconst sqlOnly = input.getOption('sql-only')\n\t\tconst noSql = input.getOption('no-sql')\n\n\t\tconst migration = migrationArg\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationArg)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\n\t\tif (!migration) {\n\t\t\tthrow new CliError('Undefined migration', { code: 'MIGRATION_NOT_FOUND', exitCode: ExitCode.NotFound })\n\t\t}\n\t\tconst schema = await this.schemaVersionBuilder.buildSchemaUntil(migration.version)\n\t\t// the description is what the user asked for, so it is data: structured with --json, formatted for a human otherwise\n\t\tconst description = this.migrationPrinter.describeMigration(schema, migration)\n\t\toutput.data(description, {\n\t\t\thuman: it => this.migrationPrinter.formatMigrationDescription(it, { sqlOnly, noSql }),\n\t\t\tquiet: () => migration.version,\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";AAaO,MAAM,iCAAiC,QAAuB;AAAA,EACpE,YACkB,kBACA,sBACA,oBAChB;AACD,UAAA;AAJiB,SAAA,mBAAA;AACA,SAAA,uBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,uBAAuB;AACjD,kBAAc,SAAS,WAAW,EAAE,SAAA;AACpC,kBAAc,OAAO,UAAU,EAAE,UAAA;AACjC,kBAAc,OAAO,QAAQ,EAAE,UAAA;AAAA,EAChC;AAAA,EAEA,MAAgB,QAAQ,OAA6B,QAA+B;AACnF,UAAM,eAAe,MAAM,YAAY,WAAW;AAClD,UAAM,UAAU,MAAM,UAAU,UAAU;AAC1C,UAAM,QAAQ,MAAM,UAAU,QAAQ;AAEtC,UAAM,YAAY,eACf,MAAM,KAAK,mBAAmB,6BAA6B,YAAY,IACvE,MAAM,KAAK,mBAAmB,0BAAA;AAEjC,QAAI,CAAC,WAAW;AACf,YAAM,IAAI,SAAS,uBAAuB,EAAE,MAAM,uBAAuB,UAAU,SAAS,UAAU;AAAA,IACvG;AACA,UAAM,SAAS,MAAM,KAAK,qBAAqB,iBAAiB,UAAU,OAAO;AAEjF,UAAM,cAAc,KAAK,iBAAiB,kBAAkB,QAAQ,SAAS;AAC7E,WAAO,KAAK,aAAa;AAAA,MACxB,OAAO,QAAM,KAAK,iBAAiB,2BAA2B,IAAI,EAAE,SAAS,OAAO;AAAA,MACpF,OAAO,MAAM,UAAU;AAAA,IAAA,CACvB;AAAA,EACF;AACD;"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const cliCommon = require("@contember/cli-common");
|
|
4
4
|
const schemaMigrations = require("@contember/schema-migrations");
|
|
5
|
-
const prompts = require("prompts");
|
|
6
5
|
const migrationsClient = require("@contember/migrations-client");
|
|
7
6
|
const SchemaValidationPrinter = require("../../lib/schema/SchemaValidationPrinter.cjs");
|
|
7
|
+
const prompt = require("../../lib/prompt/prompt.cjs");
|
|
8
8
|
class MigrationDiffCommand extends cliCommon.Command {
|
|
9
9
|
constructor(schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutorFacade, schemaStateManager, migrationsResolver) {
|
|
10
10
|
super();
|
|
@@ -26,7 +26,7 @@ class MigrationDiffCommand extends cliCommon.Command {
|
|
|
26
26
|
"Drop & recreate changed views instead of updating them in-place (CREATE OR REPLACE VIEW). Use when an in-place view update fails with SQLSTATE 42P16."
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
async execute(input) {
|
|
29
|
+
async execute(input, output) {
|
|
30
30
|
const migrationName = input.getArgument("migrationName");
|
|
31
31
|
let shouldExecute = input.getOption("execute");
|
|
32
32
|
const yes = input.getOption("yes");
|
|
@@ -34,11 +34,12 @@ class MigrationDiffCommand extends cliCommon.Command {
|
|
|
34
34
|
const recreateViews = input.getOption("recreate-views") === true;
|
|
35
35
|
const schema = await this.schemaLoader.loadSchema();
|
|
36
36
|
let stateMode = await this.schemaStateManager.isStateMode();
|
|
37
|
+
let initializeStateMode = false;
|
|
37
38
|
if (!stateMode && (await this.migrationsResolver.getSchemaMigrations()).length === 0) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
await this.schemaStateManager.extractState(schema);
|
|
39
|
+
output.info("No migrations found — enabling schema state mode for this project.");
|
|
40
|
+
output.info("ACL, validation, actions and settings will be managed in the state/ directory instead of migrations.");
|
|
41
41
|
stateMode = true;
|
|
42
|
+
initializeStateMode = true;
|
|
42
43
|
}
|
|
43
44
|
try {
|
|
44
45
|
const initialSchema = await this.schemaVersionBuilder.buildSchema();
|
|
@@ -51,25 +52,54 @@ class MigrationDiffCommand extends cliCommon.Command {
|
|
|
51
52
|
const stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false;
|
|
52
53
|
if (result === null) {
|
|
53
54
|
if (stateChanged) {
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
if (!yes) {
|
|
56
|
+
if (!output.canPrompt()) {
|
|
57
|
+
throw new cliCommon.CliError("TTY not available. Pass --yes to confirm the schema state update.", {
|
|
58
|
+
code: "TTY_UNAVAILABLE",
|
|
59
|
+
exitCode: cliCommon.ExitCode.InputError
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const confirmed = await prompt.promptConfirm(output, {
|
|
63
|
+
message: "Write the schema state changes?",
|
|
64
|
+
initial: false
|
|
65
|
+
});
|
|
66
|
+
if (!confirmed) {
|
|
67
|
+
throw abortedError("Schema state update");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (schemaState === void 0) {
|
|
71
|
+
throw new cliCommon.CliError("Schema state is unavailable", { code: "SCHEMA_STATE_UNAVAILABLE", exitCode: cliCommon.ExitCode.InternalError });
|
|
72
|
+
}
|
|
73
|
+
if (initializeStateMode) {
|
|
74
|
+
await this.schemaStateManager.extractState(schema);
|
|
75
|
+
} else {
|
|
76
|
+
await this.schemaStateManager.writeState(schemaState);
|
|
77
|
+
}
|
|
56
78
|
} else {
|
|
57
|
-
|
|
79
|
+
output.info("Nothing to do");
|
|
58
80
|
}
|
|
59
81
|
if (stateChanged && shouldExecute) {
|
|
60
|
-
|
|
82
|
+
output.info("Syncing schema state to server...");
|
|
61
83
|
await this.migrationExecutorFacade.execute({
|
|
62
84
|
force: false,
|
|
63
85
|
requireConfirmation: false
|
|
64
86
|
});
|
|
65
87
|
}
|
|
88
|
+
output.data(
|
|
89
|
+
{ migration: null, stateUpdated: stateChanged, executed: stateChanged && shouldExecute === true },
|
|
90
|
+
{ human: (value) => value.stateUpdated ? "Schema state updated" : "Nothing to do", quiet: (value) => value.stateUpdated }
|
|
91
|
+
);
|
|
66
92
|
return;
|
|
67
93
|
}
|
|
68
94
|
this.migrationPrinter.printMigrationDescription(result.initialSchema, result.migration, { noSql: true });
|
|
69
95
|
if (!yes) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
if (!output.canPrompt()) {
|
|
97
|
+
throw new cliCommon.CliError("TTY not available. Pass --yes to confirm execution.", {
|
|
98
|
+
code: "TTY_UNAVAILABLE",
|
|
99
|
+
exitCode: cliCommon.ExitCode.InputError
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const action = await prompt.promptSelect(output, {
|
|
73
103
|
message: "Do you want to continue?",
|
|
74
104
|
choices: [
|
|
75
105
|
{ value: "yes", title: "Yes" },
|
|
@@ -78,8 +108,7 @@ class MigrationDiffCommand extends cliCommon.Command {
|
|
|
78
108
|
]
|
|
79
109
|
});
|
|
80
110
|
if (!action || action === "no") {
|
|
81
|
-
|
|
82
|
-
return;
|
|
111
|
+
throw abortedError("Migration creation");
|
|
83
112
|
}
|
|
84
113
|
if (action === "execute") {
|
|
85
114
|
shouldExecute = true;
|
|
@@ -87,26 +116,45 @@ class MigrationDiffCommand extends cliCommon.Command {
|
|
|
87
116
|
}
|
|
88
117
|
const filename = await this.migrationCreator.saveMigration(result.migration);
|
|
89
118
|
if (stateChanged) {
|
|
90
|
-
|
|
119
|
+
if (schemaState === void 0) {
|
|
120
|
+
throw new cliCommon.CliError("Schema state is unavailable", { code: "SCHEMA_STATE_UNAVAILABLE", exitCode: cliCommon.ExitCode.InternalError });
|
|
121
|
+
}
|
|
122
|
+
if (initializeStateMode) {
|
|
123
|
+
await this.schemaStateManager.extractState(schema);
|
|
124
|
+
} else {
|
|
125
|
+
await this.schemaStateManager.writeState(schemaState);
|
|
126
|
+
}
|
|
91
127
|
}
|
|
92
|
-
console.log(`${filename} created`);
|
|
93
128
|
if (stateChanged) {
|
|
94
|
-
|
|
129
|
+
output.info("Schema state files updated");
|
|
95
130
|
}
|
|
131
|
+
if (shouldExecute) {
|
|
132
|
+
await this.migrationExecutorFacade.execute({
|
|
133
|
+
force: false,
|
|
134
|
+
requireConfirmation: yes ? false : (migrations) => migrations.some((migration) => migration.name !== result.migration.name)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
output.data(
|
|
138
|
+
{ migration: filename, stateUpdated: stateChanged, executed: shouldExecute === true },
|
|
139
|
+
{ human: (value) => `${value.migration} created`, quiet: (value) => value.migration }
|
|
140
|
+
);
|
|
96
141
|
} catch (e) {
|
|
97
142
|
if (e instanceof schemaMigrations.InvalidSchemaException) {
|
|
98
|
-
SchemaValidationPrinter.printValidationErrors(e.validationErrors, e.message);
|
|
99
|
-
|
|
143
|
+
SchemaValidationPrinter.printValidationErrors(e.validationErrors, e.message, output);
|
|
144
|
+
throw new cliCommon.CliError(e.message, {
|
|
145
|
+
code: "SCHEMA_INVALID",
|
|
146
|
+
exitCode: cliCommon.ExitCode.InputError,
|
|
147
|
+
details: e.validationErrors,
|
|
148
|
+
cause: e
|
|
149
|
+
});
|
|
100
150
|
}
|
|
101
151
|
throw e;
|
|
102
152
|
}
|
|
103
|
-
if (shouldExecute) {
|
|
104
|
-
await this.migrationExecutorFacade.execute({
|
|
105
|
-
force: false,
|
|
106
|
-
requireConfirmation: (migrations) => migrations.length !== 1 && !yes
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
153
|
}
|
|
110
154
|
}
|
|
155
|
+
const abortedError = (operation) => new cliCommon.CliError(`${operation} aborted`, {
|
|
156
|
+
code: "OPERATION_ABORTED",
|
|
157
|
+
exitCode: cliCommon.ExitCode.InputError
|
|
158
|
+
});
|
|
111
159
|
exports.MigrationDiffCommand = MigrationDiffCommand;
|
|
112
160
|
//# sourceMappingURL=MigrationDiffCommand.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDiffCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDiffCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { InvalidSchemaException } from '@contember/schema-migrations'\nimport prompts from 'prompts'\nimport { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader.js'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'\n\ntype Args = {\n\tmigrationName: string\n}\n\ntype Options = {\n\texecute?: true\n\tyes?: true\n\t'skip-initial-schema-validation'?: true\n\t'recreate-views'?: true\n}\n\nexport class MigrationDiffCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly migrationExecutorFacade: MigrationExecutionFacade,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates schema migration diff')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.option('execute').valueNone()\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\n\t\tconfiguration.option('skip-initial-schema-validation')\n\t\tconfiguration //\n\t\t\t.option('recreate-views')\n\t\t\t.valueNone()\n\t\t\t.description(\n\t\t\t\t'Drop & recreate changed views instead of updating them in-place (CREATE OR REPLACE VIEW). Use when an in-place view update fails with SQLSTATE 42P16.',\n\t\t\t)\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst migrationName = input.getArgument('migrationName')\n\t\tlet shouldExecute = input.getOption('execute')\n\t\tconst yes = input.getOption('yes')\n\t\tconst skipInitialSchemaValidation = input.getOption('skip-initial-schema-validation') === true\n\t\tconst recreateViews = input.getOption('recreate-views') === true\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\tlet stateMode = await this.schemaStateManager.isStateMode()\n\n\t\t// New project (no migrations yet) defaults to schema state mode. To opt out, create a migration first (e.g. `migrations:blank`).\n\t\tif (!stateMode && (await this.migrationsResolver.getSchemaMigrations()).length === 0) {\n\t\t\tconsole.log('No migrations found — enabling schema state mode for this project.')\n\t\t\tconsole.log('ACL, validation, actions and settings will be managed in the state/ directory instead of migrations.')\n\t\t\tawait this.schemaStateManager.extractState(schema)\n\t\t\tstateMode = true\n\t\t}\n\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst result = await this.migrationCreator.prepareMigration(initialSchema, schema, migrationName, {\n\t\t\t\tskipInitialSchemaValidation: skipInitialSchemaValidation,\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t\trecreateViews,\n\t\t\t})\n\n\t\t\tconst schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined\n\t\t\tconst stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false\n\n\t\t\tif (result === null) {\n\t\t\t\tif (stateChanged) {\n\t\t\t\t\tconsole.log('Schema state updated (no model changes)')\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState!)\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Nothing to do')\n\t\t\t\t}\n\t\t\t\tif (stateChanged && shouldExecute) {\n\t\t\t\t\tconsole.log('Syncing schema state to server...')\n\t\t\t\t\tawait this.migrationExecutorFacade.execute({\n\t\t\t\t\t\tforce: false,\n\t\t\t\t\t\trequireConfirmation: false,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.migrationPrinter.printMigrationDescription(result.initialSchema, result.migration, { noSql: true })\n\n\t\t\tif (!yes) {\n\t\t\t\tconst { action } = await prompts({\n\t\t\t\t\ttype: 'select',\n\t\t\t\t\tname: 'action',\n\t\t\t\t\tmessage: 'Do you want to continue?',\n\t\t\t\t\tchoices: [\n\t\t\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t\t\t...(!shouldExecute ? [{ value: 'execute', title: 'Yes and execute immediately' }] : []),\n\t\t\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t\tif (!action || action === 'no') {\n\t\t\t\t\tconsole.log('Aborting')\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (action === 'execute') {\n\t\t\t\t\tshouldExecute = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst filename = await this.migrationCreator.saveMigration(result.migration)\n\t\t\tif (stateChanged) {\n\t\t\t\tawait this.schemaStateManager.writeState(schemaState!)\n\t\t\t}\n\n\t\t\tconsole.log(`${filename} created`)\n\t\t\tif (stateChanged) {\n\t\t\t\tconsole.log('Schema state files updated')\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message)\n\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\n\t\tif (shouldExecute) {\n\t\t\tawait this.migrationExecutorFacade.execute({\n\t\t\t\tforce: false,\n\t\t\t\trequireConfirmation: migrations => migrations.length !== 1 && !yes,\n\t\t\t})\n\t\t}\n\t}\n}\n"],"names":["Command","SchemaStateManager","InvalidSchemaException","printValidationErrors"],"mappings":";;;;;;;AAoBO,MAAM,6BAA6BA,UAAAA,QAAuB;AAAA,EAChE,YACkB,cACA,sBACA,kBACA,kBACA,yBACA,oBACA,oBAChB;AACD,UAAA;AARiB,SAAA,eAAA;AACA,SAAA,uBAAA;AACA,SAAA,mBAAA;AACA,SAAA,mBAAA;AACA,SAAA,0BAAA;AACA,SAAA,qBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,+BAA+B;AACzD,kBAAc,SAAS,eAAe;AACtC,kBAAc,OAAO,SAAS,EAAE,UAAA;AAChC,kBACE,OAAO,KAAK,EACZ,UAAA,EACA,YAAY,8BAA8B;AAE5C,kBAAc,OAAO,gCAAgC;AACrD,kBACE,OAAO,gBAAgB,EACvB,UAAA,EACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEH;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,gBAAgB,MAAM,YAAY,eAAe;AACvD,QAAI,gBAAgB,MAAM,UAAU,SAAS;AAC7C,UAAM,MAAM,MAAM,UAAU,KAAK;AACjC,UAAM,8BAA8B,MAAM,UAAU,gCAAgC,MAAM;AAC1F,UAAM,gBAAgB,MAAM,UAAU,gBAAgB,MAAM;AAE5D,UAAM,SAAS,MAAM,KAAK,aAAa,WAAA;AACvC,QAAI,YAAY,MAAM,KAAK,mBAAmB,YAAA;AAG9C,QAAI,CAAC,cAAc,MAAM,KAAK,mBAAmB,oBAAA,GAAuB,WAAW,GAAG;AACrF,cAAQ,IAAI,oEAAoE;AAChF,cAA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,QACD;AACA,YAAI,WAAW,WAAW;AACzB,0BAAgB;AAAA,QACjB;AAAA,MACD;AAEA,YAAM,WAAW,MAAM,KAAK,iBAAiB,cAAc,OAAO,SAAS;AAC3E,UAAI,cAAc;AACjB,cAAM,KAAK,mBAAmB,WAAW,WAAY;AAAA,MACtD;AAEA,cAAQ,IAAI,GAAG,QAAQ,UAAU;AACjC,UAAI,cAAc;AACjB,gBAAQ,IAAI,4BAA4B;AAAA,MACzC;AAAA,IACD,SAAS,GAAG;AACX,UAAI,aAAaC,iBAAAA,wBAAwB;AACxCC,gCAAAA,sBAAsB,EAAE,kBAAkB,EAAE,OAAO;AAEnD;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAEA,QAAI,eAAe;AAClB,YAAM,KAAK,wBAAwB,QAAQ;AAAA,QAC1C,OAAO;AAAA,QACP,qBAAqB,CAAA,eAAc,WAAW,WAAW,KAAK,CAAC;AAAA,MAAA,CAC/D;AAAA,IACF;AAAA,EACD;AACD;;"}
|
|
1
|
+
{"version":3,"file":"MigrationDiffCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationDiffCommand.ts"],"sourcesContent":["import { CliError, Command, CommandConfiguration, ExitCode, Input, Output } from '@contember/cli-common'\nimport { InvalidSchemaException } from '@contember/schema-migrations'\nimport { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader.js'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'\nimport { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'\nimport { promptConfirm, promptSelect } from '../../lib/prompt/index.js'\n\ntype MigrationExecutor = Pick<MigrationExecutionFacade, 'execute'>\n\ntype Args = {\n\tmigrationName: string\n}\n\ntype Options = {\n\texecute?: true\n\tyes?: true\n\t'skip-initial-schema-validation'?: true\n\t'recreate-views'?: true\n}\n\nexport class MigrationDiffCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly migrationExecutorFacade: MigrationExecutor,\n\t\tprivate readonly schemaStateManager: SchemaStateManager,\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates schema migration diff')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.option('execute').valueNone()\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\n\t\tconfiguration.option('skip-initial-schema-validation')\n\t\tconfiguration //\n\t\t\t.option('recreate-views')\n\t\t\t.valueNone()\n\t\t\t.description(\n\t\t\t\t'Drop & recreate changed views instead of updating them in-place (CREATE OR REPLACE VIEW). Use when an in-place view update fails with SQLSTATE 42P16.',\n\t\t\t)\n\t}\n\n\tprotected async execute(input: Input<Args, Options>, output: Output): Promise<void> {\n\t\tconst migrationName = input.getArgument('migrationName')\n\t\tlet shouldExecute = input.getOption('execute')\n\t\tconst yes = input.getOption('yes')\n\t\tconst skipInitialSchemaValidation = input.getOption('skip-initial-schema-validation') === true\n\t\tconst recreateViews = input.getOption('recreate-views') === true\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\tlet stateMode = await this.schemaStateManager.isStateMode()\n\t\tlet initializeStateMode = false\n\n\t\t// New project (no migrations yet) defaults to schema state mode. To opt out, create a migration first (e.g. `migrations blank`).\n\t\tif (!stateMode && (await this.migrationsResolver.getSchemaMigrations()).length === 0) {\n\t\t\toutput.info('No migrations found — enabling schema state mode for this project.')\n\t\t\toutput.info('ACL, validation, actions and settings will be managed in the state/ directory instead of migrations.')\n\t\t\tstateMode = true\n\t\t\tinitializeStateMode = true\n\t\t}\n\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst result = await this.migrationCreator.prepareMigration(initialSchema, schema, migrationName, {\n\t\t\t\tskipInitialSchemaValidation: skipInitialSchemaValidation,\n\t\t\t\tskipNonModelDiffers: stateMode,\n\t\t\t\trecreateViews,\n\t\t\t})\n\n\t\t\tconst schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined\n\t\t\tconst stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false\n\n\t\t\tif (result === null) {\n\t\t\t\tif (stateChanged) {\n\t\t\t\t\tif (!yes) {\n\t\t\t\t\t\tif (!output.canPrompt()) {\n\t\t\t\t\t\t\tthrow new CliError('TTY not available. Pass --yes to confirm the schema state update.', {\n\t\t\t\t\t\t\t\tcode: 'TTY_UNAVAILABLE',\n\t\t\t\t\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst confirmed = await promptConfirm(output, {\n\t\t\t\t\t\t\tmessage: 'Write the schema state changes?',\n\t\t\t\t\t\t\tinitial: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif (!confirmed) {\n\t\t\t\t\t\t\tthrow abortedError('Schema state update')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (schemaState === undefined) {\n\t\t\t\t\t\tthrow new CliError('Schema state is unavailable', { code: 'SCHEMA_STATE_UNAVAILABLE', exitCode: ExitCode.InternalError })\n\t\t\t\t\t}\n\t\t\t\t\tif (initializeStateMode) {\n\t\t\t\t\t\tawait this.schemaStateManager.extractState(schema)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.info('Nothing to do')\n\t\t\t\t}\n\t\t\t\tif (stateChanged && shouldExecute) {\n\t\t\t\t\toutput.info('Syncing schema state to server...')\n\t\t\t\t\tawait this.migrationExecutorFacade.execute({\n\t\t\t\t\t\tforce: false,\n\t\t\t\t\t\trequireConfirmation: false,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\toutput.data(\n\t\t\t\t\t{ migration: null, stateUpdated: stateChanged, executed: stateChanged && shouldExecute === true },\n\t\t\t\t\t{ human: value => value.stateUpdated ? 'Schema state updated' : 'Nothing to do', quiet: value => value.stateUpdated },\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.migrationPrinter.printMigrationDescription(result.initialSchema, result.migration, { noSql: true })\n\n\t\t\tif (!yes) {\n\t\t\t\tif (!output.canPrompt()) {\n\t\t\t\t\tthrow new CliError('TTY not available. Pass --yes to confirm execution.', {\n\t\t\t\t\t\tcode: 'TTY_UNAVAILABLE',\n\t\t\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tconst action = await promptSelect(output, {\n\t\t\t\t\tmessage: 'Do you want to continue?',\n\t\t\t\t\tchoices: [\n\t\t\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t\t\t...(!shouldExecute ? [{ value: 'execute', title: 'Yes and execute immediately' }] : []),\n\t\t\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t\t\t],\n\t\t\t\t})\n\t\t\t\tif (!action || action === 'no') {\n\t\t\t\t\tthrow abortedError('Migration creation')\n\t\t\t\t}\n\t\t\t\tif (action === 'execute') {\n\t\t\t\t\tshouldExecute = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst filename = await this.migrationCreator.saveMigration(result.migration)\n\t\t\tif (stateChanged) {\n\t\t\t\tif (schemaState === undefined) {\n\t\t\t\t\tthrow new CliError('Schema state is unavailable', { code: 'SCHEMA_STATE_UNAVAILABLE', exitCode: ExitCode.InternalError })\n\t\t\t\t}\n\t\t\t\tif (initializeStateMode) {\n\t\t\t\t\tawait this.schemaStateManager.extractState(schema)\n\t\t\t\t} else {\n\t\t\t\t\tawait this.schemaStateManager.writeState(schemaState)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (stateChanged) {\n\t\t\t\toutput.info('Schema state files updated')\n\t\t\t}\n\n\t\t\tif (shouldExecute) {\n\t\t\t\tawait this.migrationExecutorFacade.execute({\n\t\t\t\t\tforce: false,\n\t\t\t\t\trequireConfirmation: yes\n\t\t\t\t\t\t? false\n\t\t\t\t\t\t: migrations => migrations.some(migration => migration.name !== result.migration.name),\n\t\t\t\t})\n\t\t\t}\n\t\t\toutput.data(\n\t\t\t\t{ migration: filename, stateUpdated: stateChanged, executed: shouldExecute === true },\n\t\t\t\t{ human: value => `${value.migration} created`, quiet: value => value.migration },\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message, output)\n\t\t\t\tthrow new CliError(e.message, {\n\t\t\t\t\tcode: 'SCHEMA_INVALID',\n\t\t\t\t\texitCode: ExitCode.InputError,\n\t\t\t\t\tdetails: e.validationErrors,\n\t\t\t\t\tcause: e,\n\t\t\t\t})\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n\nconst abortedError = (operation: string): CliError =>\n\tnew CliError(`${operation} aborted`, {\n\t\tcode: 'OPERATION_ABORTED',\n\t\texitCode: ExitCode.InputError,\n\t})\n"],"names":["Command","SchemaStateManager","CliError","ExitCode","promptConfirm","promptSelect","InvalidSchemaException","printValidationErrors"],"mappings":";;;;;;;AAsBO,MAAM,6BAA6BA,UAAAA,QAAuB;AAAA,EAChE,YACkB,cACA,sBACA,kBACA,kBACA,yBACA,oBACA,oBAChB;AACD,UAAA;AARiB,SAAA,eAAA;AACA,SAAA,uBAAA;AACA,SAAA,mBAAA;AACA,SAAA,mBAAA;AACA,SAAA,0BAAA;AACA,SAAA,qBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,U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