@webiny/project-aws 6.6.0-alpha.10 → 6.6.0-alpha.11
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/AwsProjectSdk.d.ts +38 -0
- package/AwsProjectSdk.js +61 -0
- package/AwsProjectSdk.js.map +1 -0
- package/abstractions/features/DestroyApp.d.ts +18 -0
- package/abstractions/features/DestroyApp.js +5 -0
- package/abstractions/features/DestroyApp.js.map +1 -0
- package/abstractions/features/ExportStack.d.ts +18 -0
- package/abstractions/features/ExportStack.js +5 -0
- package/abstractions/features/ExportStack.js.map +1 -0
- package/abstractions/features/GetAppOutput.d.ts +18 -0
- package/abstractions/features/GetAppOutput.js +5 -0
- package/abstractions/features/GetAppOutput.js.map +1 -0
- package/abstractions/features/GetAppStackOutput.d.ts +18 -0
- package/abstractions/features/GetAppStackOutput.js +5 -0
- package/abstractions/features/GetAppStackOutput.js.map +1 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +7 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.js +5 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -0
- package/abstractions/features/RefreshApp.d.ts +18 -0
- package/abstractions/features/RefreshApp.js +5 -0
- package/abstractions/features/RefreshApp.js.map +1 -0
- package/abstractions/features/RunPulumiCommand.d.ts +19 -0
- package/abstractions/features/RunPulumiCommand.js +5 -0
- package/abstractions/features/RunPulumiCommand.js.map +1 -0
- package/abstractions/index.d.ts +21 -0
- package/abstractions/index.js +21 -0
- package/abstractions/pulumiTypes.d.ts +3 -0
- package/abstractions/services/GetPulumiService.d.ts +20 -0
- package/abstractions/services/GetPulumiService.js +5 -0
- package/abstractions/services/GetPulumiService.js.map +1 -0
- package/abstractions/services/GetPulumiVersionService.d.ts +12 -0
- package/abstractions/services/GetPulumiVersionService.js +5 -0
- package/abstractions/services/GetPulumiVersionService.js.map +1 -0
- package/abstractions/services/IsRemotePulumiBackendService.d.ts +7 -0
- package/abstractions/services/IsRemotePulumiBackendService.js +5 -0
- package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -0
- package/abstractions/services/ListAppLambdaFunctionsService.d.ts +23 -0
- package/abstractions/services/ListAppLambdaFunctionsService.js +5 -0
- package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -0
- package/abstractions/services/ListDeployedEnvironmentsService.d.ts +12 -0
- package/abstractions/services/ListDeployedEnvironmentsService.js +5 -0
- package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -0
- package/abstractions/services/PulumiExportService.d.ts +13 -0
- package/abstractions/services/PulumiExportService.js +6 -0
- package/abstractions/services/PulumiExportService.js.map +1 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +7 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.js +5 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -0
- package/abstractions/services/PulumiGetSecretsProviderService.d.ts +7 -0
- package/abstractions/services/PulumiGetSecretsProviderService.js +5 -0
- package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -0
- package/abstractions/services/PulumiGetStackOutputService.d.ts +13 -0
- package/abstractions/services/PulumiGetStackOutputService.js +5 -0
- package/abstractions/services/PulumiGetStackOutputService.js.map +1 -0
- package/abstractions/services/PulumiImportService.d.ts +8 -0
- package/abstractions/services/PulumiImportService.js +5 -0
- package/abstractions/services/PulumiImportService.js.map +1 -0
- package/abstractions/services/PulumiLoginService.d.ts +19 -0
- package/abstractions/services/PulumiLoginService.js +5 -0
- package/abstractions/services/PulumiLoginService.js.map +1 -0
- package/abstractions/services/PulumiSelectStackService.d.ts +10 -0
- package/abstractions/services/PulumiSelectStackService.js +5 -0
- package/abstractions/services/PulumiSelectStackService.js.map +1 -0
- package/abstractions/services/StackOutputCacheService.d.ts +10 -0
- package/abstractions/services/StackOutputCacheService.js +5 -0
- package/abstractions/services/StackOutputCacheService.js.map +1 -0
- package/abstractions/services/WatchedLambdaFunctionsService.d.ts +28 -0
- package/abstractions/services/WatchedLambdaFunctionsService.js +5 -0
- package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -0
- package/api.d.ts +1 -15
- package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +20 -0
- package/decorators/DeployAppClearWatchedLambdaFunctions.js +35 -0
- package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -0
- package/decorators/DeployAppRefreshStackOutputCache.d.ts +20 -0
- package/decorators/DeployAppRefreshStackOutputCache.js +34 -0
- package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -0
- package/decorators/DeployAppWithHooks.d.ts +25 -0
- package/decorators/DeployAppWithHooks.js +58 -0
- package/decorators/DeployAppWithHooks.js.map +1 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +20 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.js +42 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -0
- package/decorators/DestroyAppClearStackOutputCache.d.ts +28 -0
- package/decorators/DestroyAppClearStackOutputCache.js +31 -0
- package/decorators/DestroyAppClearStackOutputCache.js.map +1 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +13 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.js +28 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -0
- package/decorators/ProjectInfoWithPulumi.d.ts +34 -0
- package/decorators/ProjectInfoWithPulumi.js +36 -0
- package/decorators/ProjectInfoWithPulumi.js.map +1 -0
- package/extensions/ApiRoute.d.ts +7 -16
- package/extensions/ApiRoute.js +4 -66
- package/extensions/ApiRoute.js.map +1 -1
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +3 -2
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +2 -1
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
- package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +2 -2
- package/extensions/OpenSearch/EnsureOsWasDeployed.js +1 -2
- package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
- package/extensions/OpenSearch.js +2 -2
- package/extensions/OpenSearch.js.map +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +2 -2
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +2 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +3 -2
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +2 -1
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +5 -2
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +3 -1
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.d.ts +3 -2
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +2 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +4 -2
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +3 -1
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +6 -2
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +2 -1
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -1
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +2 -2
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +1 -1
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -1
- package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +4 -2
- package/extensions/ProjectAws/UploadAdminAppToS3.js +2 -2
- package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +5 -2
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +2 -1
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +5 -2
- package/extensions/ProjectAws/ValidateProductionPulumiState.js +3 -1
- package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -1
- package/extensions/ProjectAws/definitions.js +5 -1
- package/extensions/ProjectAws/definitions.js.map +1 -1
- package/extensions/ProjectAws.js +2 -1
- package/extensions/ProjectAws.js.map +1 -1
- package/extensions/RegisterRoutesPulumi.js +2 -2
- package/extensions/RegisterRoutesPulumi.js.map +1 -1
- package/extensions/definitions.js +0 -2
- package/extensions/definitions.js.map +1 -1
- package/extensions/registerExtensionImplementations.js +2 -1
- package/extensions/registerExtensionImplementations.js.map +1 -1
- package/extensions/toApiGatewayPath.d.ts +2 -0
- package/extensions/toApiGatewayPath.js +6 -0
- package/extensions/toApiGatewayPath.js.map +1 -0
- package/features/DeployApp/DeployApp.d.ts +22 -0
- package/features/DeployApp/DeployApp.js +91 -0
- package/features/DeployApp/DeployApp.js.map +1 -0
- package/features/DeployApp/index.d.ts +1 -0
- package/features/DeployApp/index.js +1 -0
- package/features/DestroyApp/DestroyApp.d.ts +20 -0
- package/features/DestroyApp/DestroyApp.js +70 -0
- package/features/DestroyApp/DestroyApp.js.map +1 -0
- package/features/DestroyApp/index.d.ts +1 -0
- package/features/DestroyApp/index.js +1 -0
- package/features/ExportStack/ExportStack.d.ts +12 -0
- package/features/ExportStack/ExportStack.js +28 -0
- package/features/ExportStack/ExportStack.js.map +1 -0
- package/features/ExportStack/index.d.ts +1 -0
- package/features/ExportStack/index.js +1 -0
- package/features/GetAppOutput/GetAppOutput.d.ts +16 -0
- package/features/GetAppOutput/GetAppOutput.js +55 -0
- package/features/GetAppOutput/GetAppOutput.js.map +1 -0
- package/features/GetAppOutput/index.d.ts +1 -0
- package/features/GetAppOutput/index.js +1 -0
- package/features/GetAppStackOutput/GetAppStackOutput.d.ts +13 -0
- package/features/GetAppStackOutput/GetAppStackOutput.js +28 -0
- package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -0
- package/features/GetAppStackOutput/index.d.ts +1 -0
- package/features/GetAppStackOutput/index.js +1 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +8 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +26 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -0
- package/features/GetPulumiResourceNamePrefix/index.d.ts +1 -0
- package/features/GetPulumiResourceNamePrefix/index.js +1 -0
- package/features/InvokeLambdaFunction.d.ts +1 -1
- package/features/InvokeLambdaFunction.js +1 -1
- package/features/InvokeLambdaFunction.js.map +1 -1
- package/features/RefreshApp/RefreshApp.d.ts +18 -0
- package/features/RefreshApp/RefreshApp.js +68 -0
- package/features/RefreshApp/RefreshApp.js.map +1 -0
- package/features/RefreshApp/index.d.ts +1 -0
- package/features/RefreshApp/index.js +1 -0
- package/features/RunPulumiCommand/RunPulumiCommand.d.ts +18 -0
- package/features/RunPulumiCommand/RunPulumiCommand.js +65 -0
- package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -0
- package/features/RunPulumiCommand/index.d.ts +1 -0
- package/features/RunPulumiCommand/index.js +1 -0
- package/features/Watch/AwsWatch.d.ts +9 -1
- package/features/Watch/AwsWatch.js +6 -2
- package/features/Watch/AwsWatch.js.map +1 -1
- package/features/Watch/getIotEndpoint.d.ts +2 -2
- package/features/Watch/getIotEndpoint.js.map +1 -1
- package/features/Watch/initInvocationForwarding.d.ts +9 -0
- package/features/Watch/initInvocationForwarding.js +91 -0
- package/features/Watch/initInvocationForwarding.js.map +1 -0
- package/features/Watch/localInvocationWorker.d.ts +1 -0
- package/features/Watch/localInvocationWorker.js +31 -0
- package/features/Watch/localInvocationWorker.js.map +1 -0
- package/features/Watch/replaceLambdaFunctions.d.ts +7 -3
- package/features/Watch/replaceLambdaFunctions.js.map +1 -1
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.d.ts +7 -0
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js +25 -0
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js.map +1 -0
- package/features/hooks/AdminAfterDeploy/index.d.ts +1 -0
- package/features/hooks/AdminAfterDeploy/index.js +1 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +7 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +25 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -0
- package/features/hooks/AdminBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/AdminBeforeDeploy/index.js +1 -0
- package/features/hooks/AfterDeploy/AfterDeploy.d.ts +7 -0
- package/features/hooks/AfterDeploy/AfterDeploy.js +25 -0
- package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -0
- package/features/hooks/AfterDeploy/index.d.ts +1 -0
- package/features/hooks/AfterDeploy/index.js +1 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.d.ts +7 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js +25 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js.map +1 -0
- package/features/hooks/ApiAfterDeploy/index.d.ts +1 -0
- package/features/hooks/ApiAfterDeploy/index.js +1 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +7 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +25 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -0
- package/features/hooks/ApiBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/ApiBeforeDeploy/index.js +1 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +7 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.js +25 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -0
- package/features/hooks/BeforeDeploy/index.d.ts +1 -0
- package/features/hooks/BeforeDeploy/index.js +1 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.d.ts +7 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js +25 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js.map +1 -0
- package/features/hooks/CoreAfterDeploy/index.d.ts +1 -0
- package/features/hooks/CoreAfterDeploy/index.js +1 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +7 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +25 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -0
- package/features/hooks/CoreBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/CoreBeforeDeploy/index.js +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/infra.js +2 -2
- package/infra.js.map +1 -1
- package/package.json +15 -12
- package/pulumi/apps/blueGreen/types.d.ts +2 -2
- package/pulumi/apps/syncSystem/types.d.ts +2 -2
- package/pulumi/getAwsProjectSdk.d.ts +2 -12
- package/pulumi/getAwsProjectSdk.js +2 -3
- package/pulumi/getAwsProjectSdk.js.map +1 -1
- package/pulumi/getStackOutput.d.ts +4 -5
- package/pulumi/getStackOutput.js.map +1 -1
- package/pulumi/types.d.ts +2 -2
- package/registerAwsProjectFeatures.js +38 -9
- package/registerAwsProjectFeatures.js.map +1 -1
- package/services/AdminStackOutputService.d.ts +1 -1
- package/services/AdminStackOutputService.js +1 -1
- package/services/AdminStackOutputService.js.map +1 -1
- package/services/ApiStackOutputService.d.ts +1 -1
- package/services/ApiStackOutputService.js +1 -1
- package/services/ApiStackOutputService.js.map +1 -1
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.d.ts +10 -0
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js +30 -0
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js.map +1 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.d.ts +9 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js +24 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js.map +1 -0
- package/services/CoreStackOutputService.d.ts +1 -1
- package/services/CoreStackOutputService.js +1 -1
- package/services/CoreStackOutputService.js.map +1 -1
- package/services/GetPulumiService/GetPulumiService.d.ts +3 -1
- package/services/GetPulumiService/GetPulumiService.js +2 -1
- package/services/GetPulumiService/GetPulumiService.js.map +1 -1
- package/services/GetPulumiVersionService/GetPulumiVersionService.d.ts +5 -0
- package/services/GetPulumiVersionService/GetPulumiVersionService.js +46 -0
- package/services/GetPulumiVersionService/GetPulumiVersionService.js.map +1 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +14 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +15 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -0
- package/services/IsRemotePulumiBackendService/index.d.ts +1 -0
- package/services/IsRemotePulumiBackendService/index.js +1 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +20 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +63 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -0
- package/services/ListAppLambdaFunctionsService/index.d.ts +1 -0
- package/services/ListAppLambdaFunctionsService/index.js +1 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +8 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +31 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -0
- package/services/ListDeployedEnvironmentsService/index.d.ts +1 -0
- package/services/ListDeployedEnvironmentsService/index.js +1 -0
- package/services/PulumiExportService/PulumiExportService.d.ts +16 -0
- package/services/PulumiExportService/PulumiExportService.js +54 -0
- package/services/PulumiExportService/PulumiExportService.js.map +1 -0
- package/services/PulumiExportService/index.d.ts +1 -0
- package/services/PulumiExportService/index.js +1 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +5 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +15 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -0
- package/services/PulumiGetConfigPassphraseService/index.d.ts +1 -0
- package/services/PulumiGetConfigPassphraseService/index.js +1 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +5 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +15 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -0
- package/services/PulumiGetSecretsProviderService/index.d.ts +1 -0
- package/services/PulumiGetSecretsProviderService/index.js +1 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +16 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +69 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -0
- package/services/PulumiGetStackOutputService/index.d.ts +1 -0
- package/services/PulumiGetStackOutputService/index.js +1 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +1 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.js +22 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -0
- package/services/PulumiImportService/PulumiImportService.d.ts +13 -0
- package/services/PulumiImportService/PulumiImportService.js +64 -0
- package/services/PulumiImportService/PulumiImportService.js.map +1 -0
- package/services/PulumiImportService/index.d.ts +1 -0
- package/services/PulumiImportService/index.js +1 -0
- package/services/PulumiLoginService/PulumiLoginService.d.ts +13 -0
- package/services/PulumiLoginService/PulumiLoginService.js +59 -0
- package/services/PulumiLoginService/PulumiLoginService.js.map +1 -0
- package/services/PulumiLoginService/index.d.ts +1 -0
- package/services/PulumiLoginService/index.js +1 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +20 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.js +106 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -0
- package/services/PulumiSelectStackService/index.d.ts +1 -0
- package/services/PulumiSelectStackService/index.js +1 -0
- package/services/StackOutputCacheService/StackOutputCacheService.d.ts +21 -0
- package/services/StackOutputCacheService/StackOutputCacheService.js +90 -0
- package/services/StackOutputCacheService/StackOutputCacheService.js.map +1 -0
- package/services/StackOutputCacheService/index.d.ts +1 -0
- package/services/StackOutputCacheService/index.js +1 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +14 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +55 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -0
- package/services/WatchedLambdaFunctionsService/index.d.ts +1 -0
- package/services/WatchedLambdaFunctionsService/index.js +1 -0
- package/utils/withPulumiConfigPassphrase.d.ts +1 -0
- package/utils/withPulumiConfigPassphrase.js +7 -0
- package/utils/withPulumiConfigPassphrase.js.map +1 -0
- package/extensions/routePath.d.ts +0 -20
- package/extensions/routePath.js +0 -13
- package/extensions/routePath.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators/GetPulumiServiceWithDownloadInfo.js","sources":["../../src/decorators/GetPulumiServiceWithDownloadInfo.ts"],"sourcesContent":["import { GetProjectService } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/index.js\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\n\nexport class GetPulumiServiceWithDownloadInfo implements GetPulumiService.Interface {\n constructor(\n private getProjectService: GetProjectService.Interface,\n private ui: UiService.Interface,\n private decoratee: GetPulumiService.Interface\n ) {}\n\n async execute(params: GetPulumiService.Params = {}) {\n const project = this.getProjectService.execute();\n const pulumiCliPath = project.paths.dotWebinyFolder.join(\"pulumi-cli\");\n\n if (!pulumiCliPath.existsSync()) {\n this.ui.info(\"Looks like this is your first time using Pulumi CLI. Downloading...\");\n\n // New line b/c after the Pulumi CLI download, plugins are next.\n this.ui.emptyLine();\n }\n\n return this.decoratee.execute(params);\n }\n}\n\nexport const getPulumiServiceWithDownloadInfo = GetPulumiService.createDecorator({\n decorator: GetPulumiServiceWithDownloadInfo,\n dependencies: [GetProjectService, UiService]\n});\n"],"names":["GetPulumiServiceWithDownloadInfo","getProjectService","ui","decoratee","params","project","pulumiCliPath","getPulumiServiceWithDownloadInfo","GetPulumiService","GetProjectService","UiService"],"mappings":";;AAIO,MAAMA;IACT,YACYC,iBAA8C,EAC9CC,EAAuB,EACvBC,SAAqC,CAC/C;aAHUF,iBAAiB,GAAjBA;aACAC,EAAE,GAAFA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,SAAkC,CAAC,CAAC,EAAE;QAChD,MAAMC,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,MAAMC,gBAAgBD,QAAQ,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC;QAEzD,IAAI,CAACC,cAAc,UAAU,IAAI;YAC7B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;YAGb,IAAI,CAAC,EAAE,CAAC,SAAS;QACrB;QAEA,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACF;IAClC;AACJ;AAEO,MAAMG,mCAAmCC,iBAAiB,eAAe,CAAC;IAC7E,WAAWR;IACX,cAAc;QAACS;QAAmBC;KAAU;AAChD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ProjectInfoService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { GetPulumiVersionService } from "../abstractions/services/GetPulumiVersionService.js";
|
|
3
|
+
/**
|
|
4
|
+
* Adds the Pulumi section to `webiny about`: the installed Pulumi packages and how Pulumi secrets
|
|
5
|
+
* are configured.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProjectInfoWithPulumi implements ProjectInfoService.Interface {
|
|
8
|
+
private getPulumiVersion;
|
|
9
|
+
private decoratee;
|
|
10
|
+
constructor(getPulumiVersion: GetPulumiVersionService.Interface, decoratee: ProjectInfoService.Interface);
|
|
11
|
+
execute(): Promise<{
|
|
12
|
+
webiny: {
|
|
13
|
+
debugEnabled: boolean;
|
|
14
|
+
featureFlags: Record<string, boolean>;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
wcp: {
|
|
18
|
+
projectId: string;
|
|
19
|
+
usingProjectEnvironmentApiKey: boolean;
|
|
20
|
+
};
|
|
21
|
+
host: {
|
|
22
|
+
os: string;
|
|
23
|
+
nodeJs: string;
|
|
24
|
+
npm: string;
|
|
25
|
+
npx: string;
|
|
26
|
+
yarn: string;
|
|
27
|
+
isCI: boolean;
|
|
28
|
+
};
|
|
29
|
+
sections: import("@webiny/project/abstractions/services/ProjectInfoService/ProjectInfoService").IProjectInfoSection[];
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export declare const projectInfoWithPulumi: typeof ProjectInfoWithPulumi & {
|
|
33
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/services/ProjectInfoService/ProjectInfoService").IProjectInfoService>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ProjectInfoService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { GetPulumiVersionService } from "../abstractions/services/GetPulumiVersionService.js";
|
|
3
|
+
class ProjectInfoWithPulumi {
|
|
4
|
+
constructor(getPulumiVersion, decoratee){
|
|
5
|
+
this.getPulumiVersion = getPulumiVersion;
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
}
|
|
8
|
+
async execute() {
|
|
9
|
+
const info = await this.decoratee.execute();
|
|
10
|
+
const [pulumiVersion, pulumiAwsVersion] = this.getPulumiVersion.execute();
|
|
11
|
+
return {
|
|
12
|
+
...info,
|
|
13
|
+
sections: [
|
|
14
|
+
...info.sections,
|
|
15
|
+
{
|
|
16
|
+
name: "Pulumi",
|
|
17
|
+
data: {
|
|
18
|
+
"@pulumi/pulumi": pulumiVersion,
|
|
19
|
+
"@pulumi/aws": pulumiAwsVersion,
|
|
20
|
+
"Secrets Provider": process.env.PULUMI_SECRETS_PROVIDER || "",
|
|
21
|
+
"Using Password": process.env.PULUMI_CONFIG_PASSPHRASE ? "Yes" : "No"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const projectInfoWithPulumi = ProjectInfoService.createDecorator({
|
|
29
|
+
decorator: ProjectInfoWithPulumi,
|
|
30
|
+
dependencies: [
|
|
31
|
+
GetPulumiVersionService
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { ProjectInfoWithPulumi, projectInfoWithPulumi };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=ProjectInfoWithPulumi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators/ProjectInfoWithPulumi.js","sources":["../../src/decorators/ProjectInfoWithPulumi.ts"],"sourcesContent":["import { ProjectInfoService } from \"@webiny/project/abstractions/index.js\";\nimport { GetPulumiVersionService } from \"~/abstractions/services/GetPulumiVersionService.js\";\n\n/**\n * Adds the Pulumi section to `webiny about`: the installed Pulumi packages and how Pulumi secrets\n * are configured.\n */\nexport class ProjectInfoWithPulumi implements ProjectInfoService.Interface {\n constructor(\n private getPulumiVersion: GetPulumiVersionService.Interface,\n private decoratee: ProjectInfoService.Interface\n ) {}\n\n async execute() {\n const info = await this.decoratee.execute();\n const [pulumiVersion, pulumiAwsVersion] = this.getPulumiVersion.execute();\n\n return {\n ...info,\n sections: [\n ...info.sections,\n {\n name: \"Pulumi\",\n data: {\n \"@pulumi/pulumi\": pulumiVersion,\n \"@pulumi/aws\": pulumiAwsVersion,\n \"Secrets Provider\": process.env.PULUMI_SECRETS_PROVIDER || \"\",\n \"Using Password\": process.env.PULUMI_CONFIG_PASSPHRASE ? \"Yes\" : \"No\"\n }\n }\n ]\n };\n }\n}\n\nexport const projectInfoWithPulumi = ProjectInfoService.createDecorator({\n decorator: ProjectInfoWithPulumi,\n dependencies: [GetPulumiVersionService]\n});\n"],"names":["ProjectInfoWithPulumi","getPulumiVersion","decoratee","info","pulumiVersion","pulumiAwsVersion","process","projectInfoWithPulumi","ProjectInfoService","GetPulumiVersionService"],"mappings":";;AAOO,MAAMA;IACT,YACYC,gBAAmD,EACnDC,SAAuC,CACjD;aAFUD,gBAAgB,GAAhBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QACzC,MAAM,CAACC,eAAeC,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO;QAEvE,OAAO;YACH,GAAGF,IAAI;YACP,UAAU;mBACHA,KAAK,QAAQ;gBAChB;oBACI,MAAM;oBACN,MAAM;wBACF,kBAAkBC;wBAClB,eAAeC;wBACf,oBAAoBC,QAAQ,GAAG,CAAC,uBAAuB,IAAI;wBAC3D,kBAAkBA,QAAQ,GAAG,CAAC,wBAAwB,GAAG,QAAQ;oBACrE;gBACJ;aACH;QACL;IACJ;AACJ;AAEO,MAAMC,wBAAwBC,mBAAmB,eAAe,CAAC;IACpE,WAAWR;IACX,cAAc;QAACS;KAAwB;AAC3C"}
|
package/extensions/ApiRoute.d.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
HEAD: "HEAD";
|
|
9
|
-
OPTIONS: "OPTIONS";
|
|
10
|
-
PATCH: "PATCH";
|
|
11
|
-
POST: "POST";
|
|
12
|
-
PUT: "PUT";
|
|
13
|
-
}>;
|
|
14
|
-
src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
15
|
-
routeName: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>>;
|
|
1
|
+
/**
|
|
2
|
+
* What `Api.Route` renders in an AWS project, registered in `registerExtensionImplementations.ts`.
|
|
3
|
+
* It only adds the API Gateway route (`RegisterRoutesPulumi`). Validating the props and writing the
|
|
4
|
+
* route into `extensions.ts` stay with the shared definition in `@webiny/project`, which is the one
|
|
5
|
+
* the project config resolves `Api/Route` to, so there is no schema or build step here.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ApiRoute: import("@webiny/project/extensions").ExtensionComponent<import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>;
|
package/extensions/ApiRoute.js
CHANGED
|
@@ -1,84 +1,22 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import crypto_0 from "crypto";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { Node, Project } from "ts-morph";
|
|
6
2
|
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { ExtensionSrcResolver } from "@webiny/project/utils/index.js";
|
|
3
|
+
import { ApiRoute } from "@webiny/project/extensions/api/index.js";
|
|
9
4
|
import { ApiPulumi } from "../pulumi/extensions/ApiPulumi.js";
|
|
10
5
|
import { createPathResolver } from "@webiny/project";
|
|
11
|
-
import { HTTP_METHODS } from "@webiny/project-extensions-aws/extensions/ApiRoute.js";
|
|
12
|
-
import { deriveRouteName, toRouterPath } from "./routePath.js";
|
|
13
6
|
const p = createPathResolver(import.meta.dirname);
|
|
14
|
-
const
|
|
15
|
-
type:
|
|
7
|
+
const ApiRoute_ApiRoute = defineExtension({
|
|
8
|
+
type: ApiRoute.def.type,
|
|
16
9
|
tags: {
|
|
17
10
|
runtimeContext: "app-build",
|
|
18
|
-
appName: "api",
|
|
19
11
|
hosting: "aws"
|
|
20
12
|
},
|
|
21
|
-
description: "Register a custom REST route on the API Gateway + GraphQL Lambda.",
|
|
22
13
|
multiple: true,
|
|
23
|
-
paramsSchema: ({ project })=>z.object({
|
|
24
|
-
path: z.string().startsWith("/"),
|
|
25
|
-
method: z["enum"](HTTP_METHODS),
|
|
26
|
-
src: zodSrcPath({
|
|
27
|
-
project
|
|
28
|
-
}),
|
|
29
|
-
routeName: z.string().optional()
|
|
30
|
-
}),
|
|
31
|
-
async build (params, ctx) {
|
|
32
|
-
const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
|
|
33
|
-
const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);
|
|
34
|
-
const hash = crypto_0.createHash("sha256").update(params.src).digest("hex");
|
|
35
|
-
const alias = `ApiRoute_${hash.slice(-10)}`;
|
|
36
|
-
const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath).replace(/\.tsx?$/, ".js");
|
|
37
|
-
const tsProject = new Project();
|
|
38
|
-
tsProject.addSourceFileAtPath(extensionsTsFilePath);
|
|
39
|
-
const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);
|
|
40
|
-
if (source.getImportDeclaration(importPath)) return;
|
|
41
|
-
let insertIndex = 1;
|
|
42
|
-
const importDeclarations = source.getImportDeclarations();
|
|
43
|
-
if (importDeclarations.length) insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;
|
|
44
|
-
source.insertImportDeclaration(insertIndex, {
|
|
45
|
-
defaultImport: alias,
|
|
46
|
-
moduleSpecifier: importPath
|
|
47
|
-
});
|
|
48
|
-
const registerExtensionPluginPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
49
|
-
const existingRegisterExtensionPluginImport = source.getImportDeclaration(registerExtensionPluginPath);
|
|
50
|
-
if (existingRegisterExtensionPluginImport && !existingRegisterExtensionPluginImport.getNamedImports().some((i)=>"createRegisterExtensionPlugin" === i.getName())) existingRegisterExtensionPluginImport.addNamedImport("createRegisterExtensionPlugin");
|
|
51
|
-
else if (!existingRegisterExtensionPluginImport) {
|
|
52
|
-
const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
|
|
53
|
-
source.insertImportDeclaration(lastIdx, {
|
|
54
|
-
namedImports: [
|
|
55
|
-
"createRegisterExtensionPlugin"
|
|
56
|
-
],
|
|
57
|
-
moduleSpecifier: registerExtensionPluginPath
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const eventHandlerCorePath = "@webiny/event-handler-core";
|
|
61
|
-
if (!source.getImportDeclaration(eventHandlerCorePath)) {
|
|
62
|
-
const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
|
|
63
|
-
source.insertImportDeclaration(lastIdx, {
|
|
64
|
-
namedImports: [
|
|
65
|
-
"createHttpRouteDefinition"
|
|
66
|
-
],
|
|
67
|
-
moduleSpecifier: eventHandlerCorePath
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
|
|
71
|
-
const routerPath = toRouterPath(params.path);
|
|
72
|
-
const routeName = params.routeName ?? deriveRouteName(params.path, params.method);
|
|
73
|
-
pluginsArray.addElement(`\ncreateRegisterExtensionPlugin(ctx => {\n\tctx.container.register(\n\t\tcreateHttpRouteDefinition({\n\t\t\tname: "${routeName}",\n\t\t\tmethod: "${params.method}",\n\t\t\tpath: "${routerPath}",\n\t\t\thandler: ${alias}\n\t\t})\n\t);\n})`);
|
|
74
|
-
await source.save();
|
|
75
|
-
},
|
|
76
14
|
render () {
|
|
77
15
|
return /*#__PURE__*/ react.createElement(ApiPulumi, {
|
|
78
16
|
src: p("RegisterRoutesPulumi.js")
|
|
79
17
|
});
|
|
80
18
|
}
|
|
81
19
|
});
|
|
82
|
-
export { ApiRoute };
|
|
20
|
+
export { ApiRoute_ApiRoute as ApiRoute };
|
|
83
21
|
|
|
84
22
|
//# sourceMappingURL=ApiRoute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ApiRoute.js","sources":["../../src/extensions/ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"extensions/ApiRoute.js","sources":["../../src/extensions/ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { ApiRoute as SharedApiRoute } from \"@webiny/project/extensions/api/index.js\";\nimport { ApiPulumi } from \"~/pulumi/extensions/ApiPulumi.js\";\nimport { createPathResolver } from \"@webiny/project\";\n\nconst p = createPathResolver(import.meta.dirname);\n\n/**\n * What `Api.Route` renders in an AWS project, registered in `registerExtensionImplementations.ts`.\n * It only adds the API Gateway route (`RegisterRoutesPulumi`). Validating the props and writing the\n * route into `extensions.ts` stay with the shared definition in `@webiny/project`, which is the one\n * the project config resolves `Api/Route` to, so there is no schema or build step here.\n */\nexport const ApiRoute = defineExtension({\n type: SharedApiRoute.def.type,\n tags: { runtimeContext: \"app-build\", hosting: \"aws\" },\n multiple: true,\n render() {\n return <ApiPulumi src={p(\"RegisterRoutesPulumi.js\")} />;\n }\n});\n"],"names":["p","createPathResolver","ApiRoute","defineExtension","SharedApiRoute","ApiPulumi"],"mappings":";;;;;AAMA,MAAMA,IAAIC,mBAAmB,YAAY,OAAO;AAQzC,MAAMC,oBAAWC,gBAAgB;IACpC,MAAMC,SAAAA,GAAAA,CAAAA,IAAuB;IAC7B,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,UAAU;IACV;QACI,OAAO,WAAP,GAAO,oBAACC,WAASA;YAAC,KAAKL,EAAE;;IAC7B;AACJ"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { CoreBeforeDeploy
|
|
1
|
+
import { CoreBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { UiService } from "@webiny/project/abstractions/index.js";
|
|
2
3
|
declare class EnsureOsServiceRoleBeforeCoreDeployImpl implements CoreBeforeDeploy.Interface {
|
|
3
4
|
private uiService;
|
|
4
5
|
constructor(uiService: UiService.Interface);
|
|
5
6
|
execute(): Promise<void>;
|
|
6
7
|
}
|
|
7
8
|
export declare const EnsureOsServiceRoleBeforeCoreDeploy: typeof EnsureOsServiceRoleBeforeCoreDeployImpl & {
|
|
8
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").ICoreBeforeDeploy>;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CoreBeforeDeploy
|
|
1
|
+
import { CoreBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { UiService } from "@webiny/project/abstractions/index.js";
|
|
2
3
|
import { GracefulError } from "@webiny/project";
|
|
3
4
|
import { IAM } from "@webiny/aws-sdk/client-iam/index.js";
|
|
4
5
|
const NO_SUCH_ENTITY_IAM_ERROR = "NoSuchEntity";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js","sources":["../../../src/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.ts"],"sourcesContent":["import { CoreBeforeDeploy
|
|
1
|
+
{"version":3,"file":"extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js","sources":["../../../src/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.ts"],"sourcesContent":["import { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { IAM } from \"@webiny/aws-sdk/client-iam/index.js\";\n\nconst NO_SUCH_ENTITY_IAM_ERROR = \"NoSuchEntity\";\n\nclass EnsureOsServiceRoleBeforeCoreDeployImpl implements CoreBeforeDeploy.Interface {\n constructor(private uiService: UiService.Interface) {}\n\n async execute() {\n const iam = new IAM();\n try {\n await iam.getRole({ RoleName: \"AWSServiceRoleForAmazonOpenSearchService\" });\n // Role exists, proceed silently\n } catch (err) {\n // We've seen cases where the `iam.getRole` call fails because of an issue\n // other than not being able to retrieve the service role.\n if (err.Error?.Code !== NO_SUCH_ENTITY_IAM_ERROR) {\n throw GracefulError.from(\n new Error(\"Failed to retrieve Amazon OpenSearch service role.\"),\n [\n \"An unexpected error occurred while checking for the %s service role:\",\n \"%s\",\n \"\",\n \"Please check your AWS IAM permissions and try again.\"\n ].join(\"\\n\"),\n \"AWSServiceRoleForAmazonOpenSearchService\",\n err.message\n );\n }\n\n // Role doesn't exist, try to create it\n try {\n await iam.createServiceLinkedRole({\n AWSServiceName: \"opensearchservice.amazonaws.com\"\n });\n // Created successfully, proceed silently\n } catch (err) {\n throw GracefulError.from(\n new Error(\"Failed to create Amazon OpenSearch service role.\"),\n [\n \"Could not create the required %s service role:\",\n \"%s\",\n \"\",\n \"Your options:\",\n \"• Ensure your AWS account has the necessary IAM permissions to create service-linked roles.\",\n \"• Manually create the service role using the AWS console or CLI.\",\n \"• Contact your AWS administrator for assistance.\"\n ].join(\"\\n\"),\n \"AWSServiceRoleForAmazonOpenSearchService\",\n err.message\n );\n }\n }\n }\n}\n\nexport const EnsureOsServiceRoleBeforeCoreDeploy = CoreBeforeDeploy.createImplementation({\n implementation: EnsureOsServiceRoleBeforeCoreDeployImpl,\n dependencies: [UiService]\n});\n"],"names":["NO_SUCH_ENTITY_IAM_ERROR","EnsureOsServiceRoleBeforeCoreDeployImpl","uiService","iam","IAM","err","GracefulError","Error","EnsureOsServiceRoleBeforeCoreDeploy","CoreBeforeDeploy","UiService"],"mappings":";;;;AAKA,MAAMA,2BAA2B;AAEjC,MAAMC;IACF,YAAoBC,SAA8B,CAAE;aAAhCA,SAAS,GAATA;IAAiC;IAErD,MAAM,UAAU;QACZ,MAAMC,MAAM,IAAIC;QAChB,IAAI;YACA,MAAMD,IAAI,OAAO,CAAC;gBAAE,UAAU;YAA2C;QAE7E,EAAE,OAAOE,KAAK;YAGV,IAAIA,IAAI,KAAK,EAAE,SAASL,0BACpB,MAAMM,cAAc,IAAI,CACpB,IAAIC,MAAM,uDACV,oIAMA,4CACAF,IAAI,OAAO;YAKnB,IAAI;gBACA,MAAMF,IAAI,uBAAuB,CAAC;oBAC9B,gBAAgB;gBACpB;YAEJ,EAAE,OAAOE,KAAK;gBACV,MAAMC,cAAc,IAAI,CACpB,IAAIC,MAAM,qDACV,wRASA,4CACAF,IAAI,OAAO;YAEnB;QACJ;IACJ;AACJ;AAEO,MAAMG,sCAAsCC,iBAAiB,oBAAoB,CAAC;IACrF,gBAAgBR;IAChB,cAAc;QAACS;KAAU;AAC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoreBeforeDeploy } from "@webiny/project/abstractions/index.js";
|
|
1
|
+
import { CoreBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
2
|
import { CoreStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
3
3
|
declare class EnsureOsWasDeployedImpl implements CoreBeforeDeploy.Interface {
|
|
4
4
|
private coreStackOutputService;
|
|
@@ -6,6 +6,6 @@ declare class EnsureOsWasDeployedImpl implements CoreBeforeDeploy.Interface {
|
|
|
6
6
|
execute(): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const EnsureOsWasDeployed: typeof EnsureOsWasDeployedImpl & {
|
|
9
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").ICoreBeforeDeploy>;
|
|
10
10
|
};
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CoreBeforeDeploy } from "@webiny/project/abstractions/index.js";
|
|
1
|
+
import { CoreBeforeDeploy, CoreStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
2
|
import { GracefulError } from "@webiny/project";
|
|
3
|
-
import { CoreStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
4
3
|
class EnsureOsWasDeployedImpl {
|
|
5
4
|
constructor(coreStackOutputService){
|
|
6
5
|
this.coreStackOutputService = coreStackOutputService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/OpenSearch/EnsureOsWasDeployed.js","sources":["../../../src/extensions/OpenSearch/EnsureOsWasDeployed.ts"],"sourcesContent":["import { CoreBeforeDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nclass EnsureOsWasDeployedImpl implements CoreBeforeDeploy.Interface {\n constructor(private coreStackOutputService: CoreStackOutputService.Interface) {}\n\n async execute() {\n // Get the stack output from the core application\n // CoreStackOutputService automatically uses env/variant/region from ProjectSdkParamsService\n const output = await this.coreStackOutputService.execute();\n\n // If there's no output, Core hasn't been deployed yet, so we can proceed.\n if (!output?.databaseSetup) {\n return;\n }\n\n // Check if `databaseSetup` matches 'ddb+os'\n // If it matches, Core was deployed with OpenSearch and we can proceed.\n const hasDatabaseSetup = output.databaseSetup === \"ddb+os\";\n if (hasDatabaseSetup) {\n return;\n }\n\n // Core was previously deployed without OpenSearch or with a different setup\n throw GracefulError.from(\n new Error(\n \"Cannot deploy with OpenSearch enabled. The Core application was previously deployed with a different database setup.\"\n ),\n [\n \"Once a deployment method is chosen (%s or %s), you cannot switch between them.\",\n \"\",\n \"Your options:\",\n \"• If you want to use %s, you need to destroy and redeploy the entire project from scratch.\",\n \"• If you want to continue without %s, disable it in your %s config file.\",\n \"\",\n \"Learn more: https://webiny.link/deploy-diff-db-setup\"\n ].join(\"\\n\"),\n \"DynamoDB-only\",\n \"DynamoDB+OpenSearch\",\n \"OpenSearch\",\n \"OpenSearch\",\n \"webiny.config.tsx\"\n );\n }\n}\n\nexport const EnsureOsWasDeployed = CoreBeforeDeploy.createImplementation({\n implementation: EnsureOsWasDeployedImpl,\n dependencies: [CoreStackOutputService]\n});\n"],"names":["EnsureOsWasDeployedImpl","coreStackOutputService","output","hasDatabaseSetup","GracefulError","Error","EnsureOsWasDeployed","CoreBeforeDeploy","CoreStackOutputService"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensions/OpenSearch/EnsureOsWasDeployed.js","sources":["../../../src/extensions/OpenSearch/EnsureOsWasDeployed.ts"],"sourcesContent":["import { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nclass EnsureOsWasDeployedImpl implements CoreBeforeDeploy.Interface {\n constructor(private coreStackOutputService: CoreStackOutputService.Interface) {}\n\n async execute() {\n // Get the stack output from the core application\n // CoreStackOutputService automatically uses env/variant/region from ProjectSdkParamsService\n const output = await this.coreStackOutputService.execute();\n\n // If there's no output, Core hasn't been deployed yet, so we can proceed.\n if (!output?.databaseSetup) {\n return;\n }\n\n // Check if `databaseSetup` matches 'ddb+os'\n // If it matches, Core was deployed with OpenSearch and we can proceed.\n const hasDatabaseSetup = output.databaseSetup === \"ddb+os\";\n if (hasDatabaseSetup) {\n return;\n }\n\n // Core was previously deployed without OpenSearch or with a different setup\n throw GracefulError.from(\n new Error(\n \"Cannot deploy with OpenSearch enabled. The Core application was previously deployed with a different database setup.\"\n ),\n [\n \"Once a deployment method is chosen (%s or %s), you cannot switch between them.\",\n \"\",\n \"Your options:\",\n \"• If you want to use %s, you need to destroy and redeploy the entire project from scratch.\",\n \"• If you want to continue without %s, disable it in your %s config file.\",\n \"\",\n \"Learn more: https://webiny.link/deploy-diff-db-setup\"\n ].join(\"\\n\"),\n \"DynamoDB-only\",\n \"DynamoDB+OpenSearch\",\n \"OpenSearch\",\n \"OpenSearch\",\n \"webiny.config.tsx\"\n );\n }\n}\n\nexport const EnsureOsWasDeployed = CoreBeforeDeploy.createImplementation({\n implementation: EnsureOsWasDeployedImpl,\n dependencies: [CoreStackOutputService]\n});\n"],"names":["EnsureOsWasDeployedImpl","coreStackOutputService","output","hasDatabaseSetup","GracefulError","Error","EnsureOsWasDeployed","CoreBeforeDeploy","CoreStackOutputService"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,sBAAwD,CAAE;aAA1DA,sBAAsB,GAAtBA;IAA2D;IAE/E,MAAM,UAAU;QAGZ,MAAMC,SAAS,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO;QAGxD,IAAI,CAACA,QAAQ,eACT;QAKJ,MAAMC,mBAAmBD,AAAyB,aAAzBA,OAAO,aAAa;QAC7C,IAAIC,kBACA;QAIJ,MAAMC,cAAc,IAAI,CACpB,IAAIC,MACA,yHAEJ,iUASA,iBACA,uBACA,cACA,cACA;IAER;AACJ;AAEO,MAAMC,sBAAsBC,iBAAiB,oBAAoB,CAAC;IACrE,gBAAgBP;IAChB,cAAc;QAACQ;KAAuB;AAC1C"}
|
package/extensions/OpenSearch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
3
|
-
import { PulumiOpenSearch, openSearchParamsSchema } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
3
|
+
import { CoreBeforeDeploy, PulumiOpenSearch, openSearchParamsSchema } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
4
4
|
import { createPathResolver } from "@webiny/project";
|
|
5
|
-
import {
|
|
5
|
+
import { DatabaseSetup, ProjectDecorator } from "@webiny/project/extensions/index.js";
|
|
6
6
|
const p = createPathResolver(import.meta.dirname, "OpenSearch");
|
|
7
7
|
const OpenSearch = defineExtension({
|
|
8
8
|
type: "Project/OpenSearch",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/OpenSearch.js","sources":["../../src/extensions/OpenSearch.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { openSearchParamsSchema } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { PulumiOpenSearch } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport {\
|
|
1
|
+
{"version":3,"file":"extensions/OpenSearch.js","sources":["../../src/extensions/OpenSearch.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { openSearchParamsSchema } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { PulumiOpenSearch } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport { ProjectDecorator } from \"@webiny/project/extensions/index.js\";\nimport { DatabaseSetup } from \"@webiny/project/extensions/index.js\";\nimport { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\n\nconst p = createPathResolver(import.meta.dirname, \"OpenSearch\");\n\nexport const OpenSearch = defineExtension({\n type: \"Project/OpenSearch\",\n tags: { runtimeContext: \"project\", hosting: \"aws\" },\n description: \"Enable and configure Opensearch integration with project-level setup.\",\n paramsSchema: openSearchParamsSchema,\n render: props => {\n return (\n <>\n <PulumiOpenSearch {...props} />\n {props.enabled && (\n <>\n {/* Override database setup to indicate OpenSearch is enabled. */}\n <DatabaseSetup setupName=\"ddb+os\" />\n <ProjectDecorator src={p(\"InjectDdbEsLambdaFnHandler.js\")} />\n <ProjectDecorator src={p(\"ReplaceApiLambdaFnHandlers.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsServiceRoleBeforeCoreDeploy.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsWasDeployed.js\")} />\n </>\n )}\n </>\n );\n }\n});\n"],"names":["p","createPathResolver","OpenSearch","defineExtension","openSearchParamsSchema","props","PulumiOpenSearch","DatabaseSetup","ProjectDecorator","CoreBeforeDeploy"],"mappings":";;;;;AASA,MAAMA,IAAIC,mBAAmB,YAAY,OAAO,EAAE;AAE3C,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC;IACd,QAAQC,CAAAA,QACG,WAAP,GACI,wDACI,oBAACC,kBAAqBD,QACrBA,MAAM,OAAO,IAAI,WAAJ,GACV,wDAEI,oBAACE,eAAaA;YAAC,WAAU;0BACzB,oBAACC,kBAAgBA;YAAC,KAAKR,EAAE;0BACzB,oBAACQ,kBAAgBA;YAAC,KAAKR,EAAE;0BACzB,oBAACS,kBAAgBA;YAAC,KAAKT,EAAE;0BACzB,oBAACS,kBAAgBA;YAAC,KAAKT,EAAE;;AAMjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiAfterDeploy } from "@webiny/project/abstractions/index.js";
|
|
1
|
+
import { ApiAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
2
|
import { UiService } from "@webiny/project/abstractions/services/UiService.js";
|
|
3
3
|
import { LoggerService } from "@webiny/project/abstractions/services/LoggerService.js";
|
|
4
4
|
import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
@@ -12,6 +12,6 @@ declare class AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface
|
|
|
12
12
|
execute(params: ApiAfterDeploy.Params): Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
export declare const AutoInstallAfterApiDeploy: typeof AutoInstallAfterApiDeployImpl & {
|
|
15
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/
|
|
15
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").IApiAfterDeploy>;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ApiAfterDeploy
|
|
1
|
+
import { ApiAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
2
|
import { UiService } from "@webiny/project/abstractions/services/UiService.js";
|
|
3
3
|
import { LoggerService } from "@webiny/project/abstractions/services/LoggerService.js";
|
|
4
|
+
import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
4
5
|
import { ApiGqlClient } from "@webiny/project-extensions-aws/abstractions/ApiGqlClient.js";
|
|
5
6
|
const IS_INSTALLED_QUERY = `
|
|
6
7
|
query IsSystemInstalled {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js","sources":["../../../../src/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.ts"],"sourcesContent":["import { ApiAfterDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/services/UiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/services/LoggerService.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiGqlClient } from \"@webiny/project-extensions-aws/abstractions/ApiGqlClient.js\";\n\nconst IS_INSTALLED_QUERY = `\n query IsSystemInstalled {\n system {\n isSystemInstalled {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\nconst INSTALL_MUTATION = `\n mutation InstallSystem($installationInput: JSON!) {\n system {\n installSystem(installationInput: $installationInput) {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\ninterface IsInstalledResponse {\n system: {\n isSystemInstalled: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\ninterface InstallResponse {\n system: {\n installSystem: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\nclass AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface {\n constructor(\n private apiGqlClient: ApiGqlClient.Interface,\n private ui: UiService.Interface,\n private getProjectConfig: GetProjectConfigService.Interface,\n private logger: LoggerService.Interface\n ) {}\n\n async execute(params: ApiAfterDeploy.Params): Promise<void> {\n if (params.preview) {\n // Skip auto-install on preview deployments\n return;\n }\n\n const projectConfig = await this.getProjectConfig.execute();\n const adminAutoInstallExtensions = projectConfig.extensionsByType(\"Project/AutoInstall\");\n\n if (adminAutoInstallExtensions.length === 0) {\n return;\n }\n\n const config = adminAutoInstallExtensions[0].params;\n\n // Check if system is already installed\n this.ui.info(\"Checking if system is already installed...\");\n\n try {\n const isInstalledResponse = await this.apiGqlClient.query<IsInstalledResponse>({\n query: IS_INSTALLED_QUERY\n });\n\n if (isInstalledResponse.data?.system.isSystemInstalled.data === true) {\n this.ui.info(\"System is already installed, skipping auto-install.\");\n return;\n }\n } catch (error: any) {\n this.logger.error(\"Failed to check installation status\", { error });\n this.ui.warning(`Could not check installation status: ${error.message}`);\n return;\n }\n\n this.ui.info(\"Auto-installing...\");\n /**\n * Type Error introduced with Zod v4. V3 had any type.\n */\n // @ts-expect-error\n const adminUser = config.adminUser || {\n firstName: \"John\",\n lastName: \"Smith\",\n email: \"admin@webiny.com\",\n password: \"12345678\"\n };\n\n const variables = {\n installationInput: [\n {\n app: \"Cognito\",\n data: adminUser\n }\n ]\n };\n\n const installResponse = await this.apiGqlClient.mutation<InstallResponse>({\n mutation: INSTALL_MUTATION,\n variables\n });\n\n if (installResponse.data?.system.installSystem.error) {\n const { message, code } = installResponse.data.system.installSystem.error;\n this.logger.error(\"Installation failed\", { message, code });\n this.ui.error(`Installation failed: ${message} (${code})`);\n throw new Error(message);\n }\n\n this.ui.success(\"System installed successfully!\");\n this.ui.info(\"Admin credentials:\");\n this.ui.info(` Email: ${adminUser.email}`);\n this.ui.info(` Password: ${adminUser.password}`);\n }\n}\n\nexport const AutoInstallAfterApiDeploy = ApiAfterDeploy.createImplementation({\n implementation: AutoInstallAfterApiDeployImpl,\n dependencies: [ApiGqlClient, UiService, GetProjectConfigService, LoggerService]\n});\n"],"names":["IS_INSTALLED_QUERY","INSTALL_MUTATION","AutoInstallAfterApiDeployImpl","apiGqlClient","ui","getProjectConfig","logger","params","projectConfig","adminAutoInstallExtensions","config","isInstalledResponse","error","adminUser","variables","installResponse","message","code","Error","AutoInstallAfterApiDeploy","ApiAfterDeploy","ApiGqlClient","UiService","GetProjectConfigService","LoggerService"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js","sources":["../../../../src/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.ts"],"sourcesContent":["import { ApiAfterDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/services/UiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/services/LoggerService.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiGqlClient } from \"@webiny/project-extensions-aws/abstractions/ApiGqlClient.js\";\n\nconst IS_INSTALLED_QUERY = `\n query IsSystemInstalled {\n system {\n isSystemInstalled {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\nconst INSTALL_MUTATION = `\n mutation InstallSystem($installationInput: JSON!) {\n system {\n installSystem(installationInput: $installationInput) {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\ninterface IsInstalledResponse {\n system: {\n isSystemInstalled: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\ninterface InstallResponse {\n system: {\n installSystem: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\nclass AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface {\n constructor(\n private apiGqlClient: ApiGqlClient.Interface,\n private ui: UiService.Interface,\n private getProjectConfig: GetProjectConfigService.Interface,\n private logger: LoggerService.Interface\n ) {}\n\n async execute(params: ApiAfterDeploy.Params): Promise<void> {\n if (params.preview) {\n // Skip auto-install on preview deployments\n return;\n }\n\n const projectConfig = await this.getProjectConfig.execute();\n const adminAutoInstallExtensions = projectConfig.extensionsByType(\"Project/AutoInstall\");\n\n if (adminAutoInstallExtensions.length === 0) {\n return;\n }\n\n const config = adminAutoInstallExtensions[0].params;\n\n // Check if system is already installed\n this.ui.info(\"Checking if system is already installed...\");\n\n try {\n const isInstalledResponse = await this.apiGqlClient.query<IsInstalledResponse>({\n query: IS_INSTALLED_QUERY\n });\n\n if (isInstalledResponse.data?.system.isSystemInstalled.data === true) {\n this.ui.info(\"System is already installed, skipping auto-install.\");\n return;\n }\n } catch (error: any) {\n this.logger.error(\"Failed to check installation status\", { error });\n this.ui.warning(`Could not check installation status: ${error.message}`);\n return;\n }\n\n this.ui.info(\"Auto-installing...\");\n /**\n * Type Error introduced with Zod v4. V3 had any type.\n */\n // @ts-expect-error\n const adminUser = config.adminUser || {\n firstName: \"John\",\n lastName: \"Smith\",\n email: \"admin@webiny.com\",\n password: \"12345678\"\n };\n\n const variables = {\n installationInput: [\n {\n app: \"Cognito\",\n data: adminUser\n }\n ]\n };\n\n const installResponse = await this.apiGqlClient.mutation<InstallResponse>({\n mutation: INSTALL_MUTATION,\n variables\n });\n\n if (installResponse.data?.system.installSystem.error) {\n const { message, code } = installResponse.data.system.installSystem.error;\n this.logger.error(\"Installation failed\", { message, code });\n this.ui.error(`Installation failed: ${message} (${code})`);\n throw new Error(message);\n }\n\n this.ui.success(\"System installed successfully!\");\n this.ui.info(\"Admin credentials:\");\n this.ui.info(` Email: ${adminUser.email}`);\n this.ui.info(` Password: ${adminUser.password}`);\n }\n}\n\nexport const AutoInstallAfterApiDeploy = ApiAfterDeploy.createImplementation({\n implementation: AutoInstallAfterApiDeployImpl,\n dependencies: [ApiGqlClient, UiService, GetProjectConfigService, LoggerService]\n});\n"],"names":["IS_INSTALLED_QUERY","INSTALL_MUTATION","AutoInstallAfterApiDeployImpl","apiGqlClient","ui","getProjectConfig","logger","params","projectConfig","adminAutoInstallExtensions","config","isInstalledResponse","error","adminUser","variables","installResponse","message","code","Error","AutoInstallAfterApiDeploy","ApiAfterDeploy","ApiGqlClient","UiService","GetProjectConfigService","LoggerService"],"mappings":";;;;;AAMA,MAAMA,qBAAqB,CAAC;;;;;;;;;;;;AAY5B,CAAC;AAED,MAAMC,mBAAmB,CAAC;;;;;;;;;;;;AAY1B,CAAC;AA0BD,MAAMC;IACF,YACYC,YAAoC,EACpCC,EAAuB,EACvBC,gBAAmD,EACnDC,MAA+B,CACzC;aAJUH,YAAY,GAAZA;aACAC,EAAE,GAAFA;aACAC,gBAAgB,GAAhBA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,MAA6B,EAAiB;QACxD,IAAIA,OAAO,OAAO,EAEd;QAGJ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACzD,MAAMC,6BAA6BD,cAAc,gBAAgB,CAAC;QAElE,IAAIC,AAAsC,MAAtCA,2BAA2B,MAAM,EACjC;QAGJ,MAAMC,SAASD,0BAA0B,CAAC,EAAE,CAAC,MAAM;QAGnD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAEb,IAAI;YACA,MAAME,sBAAsB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAsB;gBAC3E,OAAOX;YACX;YAEA,IAAIW,oBAAoB,IAAI,EAAE,OAAO,kBAAkB,SAAS,MAAM,YAClE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAGrB,EAAE,OAAOC,OAAY;YACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC;gBAAEA;YAAM;YACjE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,qCAAqC,EAAEA,MAAM,OAAO,EAAE;YACvE;QACJ;QAEA,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAKb,MAAMC,YAAYH,OAAO,SAAS,IAAI;YAClC,WAAW;YACX,UAAU;YACV,OAAO;YACP,UAAU;QACd;QAEA,MAAMI,YAAY;YACd,mBAAmB;gBACf;oBACI,KAAK;oBACL,MAAMD;gBACV;aACH;QACL;QAEA,MAAME,kBAAkB,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAkB;YACtE,UAAUd;YACVa;QACJ;QAEA,IAAIC,gBAAgB,IAAI,EAAE,OAAO,cAAc,OAAO;YAClD,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGF,gBAAgB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK;YACzE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB;gBAAEC;gBAASC;YAAK;YACzD,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAED,QAAQ,EAAE,EAAEC,KAAK,CAAC,CAAC;YACzD,MAAM,IAAIC,MAAMF;QACpB;QAEA,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QACb,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAEH,UAAU,KAAK,EAAE;QACzC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAEA,UAAU,QAAQ,EAAE;IACnD;AACJ;AAEO,MAAMM,4BAA4BC,eAAe,oBAAoB,CAAC;IACzE,gBAAgBlB;IAChB,cAAc;QAACmB;QAAcC;QAAWC;QAAyBC;KAAc;AACnF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { BeforeDeploy
|
|
1
|
+
import { BeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
2
3
|
declare class PrintDeploymentInfoAfterDeployImpl implements BeforeDeploy.Interface {
|
|
3
4
|
private projectSdkParamsService;
|
|
4
5
|
constructor(projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
5
6
|
execute(params: BeforeDeploy.Params): Promise<void>;
|
|
6
7
|
}
|
|
7
8
|
export declare const EnsureVariantBeforeDeploy: typeof PrintDeploymentInfoAfterDeployImpl & {
|
|
8
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").IBeforeDeploy>;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BeforeDeploy
|
|
1
|
+
import { BeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
2
3
|
class PrintDeploymentInfoAfterDeployImpl {
|
|
3
4
|
constructor(projectSdkParamsService){
|
|
4
5
|
this.projectSdkParamsService = projectSdkParamsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js","sources":["../../../../src/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.ts"],"sourcesContent":["import { BeforeDeploy
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js","sources":["../../../../src/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.ts"],"sourcesContent":["import { BeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\n\nclass PrintDeploymentInfoAfterDeployImpl implements BeforeDeploy.Interface {\n constructor(private projectSdkParamsService: ProjectSdkParamsService.Interface) {}\n\n async execute(params: BeforeDeploy.Params) {\n if (params.app !== \"blueGreen\") {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const { env, variant } = sdkParams;\n\n if (!variant?.length) {\n return;\n }\n const message = `Cannot deploy Blue / Green system environment (${env}) with a variant (${variant}).`;\n throw new Error(message);\n }\n}\n\nexport const EnsureVariantBeforeDeploy = BeforeDeploy.createImplementation({\n implementation: PrintDeploymentInfoAfterDeployImpl,\n dependencies: [ProjectSdkParamsService]\n});\n"],"names":["PrintDeploymentInfoAfterDeployImpl","projectSdkParamsService","params","sdkParams","env","variant","message","Error","EnsureVariantBeforeDeploy","BeforeDeploy","ProjectSdkParamsService"],"mappings":";;AAGA,MAAMA;IACF,YAAoBC,uBAA0D,CAAE;aAA5DA,uBAAuB,GAAvBA;IAA6D;IAEjF,MAAM,QAAQC,MAA2B,EAAE;QACvC,IAAIA,AAAe,gBAAfA,OAAO,GAAG,EACV;QAGJ,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAE,GAAGF;QAEzB,IAAI,CAACE,SAAS,QACV;QAEJ,MAAMC,UAAU,CAAC,+CAA+C,EAAEF,IAAI,kBAAkB,EAAEC,QAAQ,EAAE,CAAC;QACrG,MAAM,IAAIE,MAAMD;IACpB;AACJ;AAEO,MAAME,4BAA4BC,aAAa,oBAAoB,CAAC;IACvE,gBAAgBT;IAChB,cAAc;QAACU;KAAwB;AAC3C"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { AfterDeploy
|
|
1
|
+
import { AfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { GetAppStackOutput } from "../../../abstractions/features/GetAppStackOutput.js";
|
|
3
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { UiService } from "@webiny/project/abstractions/index.js";
|
|
2
5
|
export interface IEnvironment {
|
|
3
6
|
name: string;
|
|
4
7
|
env: string;
|
|
@@ -15,6 +18,6 @@ declare class PrintDeploymentInfoAfterDeployImpl implements AfterDeploy.Interfac
|
|
|
15
18
|
execute(params: AfterDeploy.Params): Promise<void>;
|
|
16
19
|
}
|
|
17
20
|
export declare const PrintDeploymentInfoAfterDeploy: typeof PrintDeploymentInfoAfterDeployImpl & {
|
|
18
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/
|
|
21
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").IAfterDeploy>;
|
|
19
22
|
};
|
|
20
23
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AfterDeploy
|
|
1
|
+
import { AfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
2
|
+
import { GetAppStackOutput } from "../../../abstractions/features/GetAppStackOutput.js";
|
|
3
|
+
import { ProjectSdkParamsService, UiService } from "@webiny/project/abstractions/index.js";
|
|
2
4
|
import chalk from "chalk";
|
|
3
5
|
class PrintDeploymentInfoAfterDeployImpl {
|
|
4
6
|
constructor(ui, getAppStackOutput, projectSdkParamsService){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js","sources":["../../../../src/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js","sources":["../../../../src/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.ts"],"sourcesContent":["import { AfterDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { GetAppStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/index.js\";\nimport { IBlueGreenStackOutput } from \"~/pulumi/apps/blueGreen/types.js\";\nimport chalk from \"chalk\";\n\nexport interface IEnvironment {\n name: string;\n env: string;\n variant: string | undefined;\n domains: {\n [key: string]: string;\n };\n}\n\nclass PrintDeploymentInfoAfterDeployImpl implements AfterDeploy.Interface {\n constructor(\n private ui: UiService.Interface,\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AfterDeploy.Params) {\n if (params.app !== \"blueGreen\") {\n return;\n }\n\n const { blue, green } = chalk;\n\n const bg = await this.getAppStackOutput.execute<IBlueGreenStackOutput>(\"blueGreen\");\n\n if (!bg) {\n this.ui.info(\n \"Blue / Green deployment info could not be printed because the Blue / Green app is not deployed.\"\n );\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n\n const domains = Array.isArray(bg.domains) ? bg.domains : [];\n\n const environments = (bg.environments || []).reduce<IEnvironment[]>((items, item) => {\n const index = items.findIndex(i => i.name === item.name);\n if (index >= 0) {\n items[index].domains[item.type] = item.target;\n\n return items;\n }\n\n items.push({\n name: item.name,\n env: item.env,\n variant: item.variant,\n domains: {\n [item.type]: item.target\n }\n });\n\n return items;\n }, []);\n\n const output = [\n \"\",\n green(`Blue / Green Router`),\n `‣ Environment name: ${blue(sdkParams.env)}`,\n `‣ CloudFront domain: ${bg.distributionDomain}`,\n `‣ CloudFront URL: ${bg.distributionUrl}`,\n \"\",\n `‣ Domains attached: `,\n ...domains.map(domain => ` - https://${domain}`),\n \"\",\n `‣ Environments: `,\n ...environments.map(item => {\n const envVariant = `env: ${item.env}${\n item.variant ? ` / variant: ${item.variant}` : \"\"\n }`;\n return [\n ` - ${blue(item.name)} (${envVariant})`,\n ...Object.keys(item.domains).map(type => {\n return ` - ${type}: https://${item.domains[type]}`;\n })\n ].join(\"\\n\");\n }),\n \"\"\n ];\n console.log(output.join(\"\\n\"));\n }\n}\n\nexport const PrintDeploymentInfoAfterDeploy = AfterDeploy.createImplementation({\n implementation: PrintDeploymentInfoAfterDeployImpl,\n dependencies: [UiService, GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["PrintDeploymentInfoAfterDeployImpl","ui","getAppStackOutput","projectSdkParamsService","params","blue","green","chalk","bg","sdkParams","domains","Array","environments","items","item","index","i","output","domain","envVariant","Object","type","console","PrintDeploymentInfoAfterDeploy","AfterDeploy","UiService","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;;;AAgBA,MAAMA;IACF,YACYC,EAAuB,EACvBC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAHUF,EAAE,GAAFA;aACAC,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA0B,EAAE;QACtC,IAAIA,AAAe,gBAAfA,OAAO,GAAG,EACV;QAGJ,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGC;QAExB,MAAMC,KAAK,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAwB;QAEvE,IAAI,CAACA,IAAI,YACL,IAAI,CAAC,EAAE,CAAC,IAAI,CACR;QAKR,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAElD,MAAMC,UAAUC,MAAM,OAAO,CAACH,GAAG,OAAO,IAAIA,GAAG,OAAO,GAAG,EAAE;QAE3D,MAAMI,eAAgBJ,AAAAA,CAAAA,GAAG,YAAY,IAAI,EAAC,EAAG,MAAM,CAAiB,CAACK,OAAOC;YACxE,MAAMC,QAAQF,MAAM,SAAS,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKF,KAAK,IAAI;YACvD,IAAIC,SAAS,GAAG;gBACZF,KAAK,CAACE,MAAM,CAAC,OAAO,CAACD,KAAK,IAAI,CAAC,GAAGA,KAAK,MAAM;gBAE7C,OAAOD;YACX;YAEAA,MAAM,IAAI,CAAC;gBACP,MAAMC,KAAK,IAAI;gBACf,KAAKA,KAAK,GAAG;gBACb,SAASA,KAAK,OAAO;gBACrB,SAAS;oBACL,CAACA,KAAK,IAAI,CAAC,EAAEA,KAAK,MAAM;gBAC5B;YACJ;YAEA,OAAOD;QACX,GAAG,EAAE;QAEL,MAAMI,SAAS;YACX;YACAX,MAAM;YACN,CAAC,oBAAoB,EAAED,KAAKI,UAAU,GAAG,GAAG;YAC5C,CAAC,qBAAqB,EAAED,GAAG,kBAAkB,EAAE;YAC/C,CAAC,kBAAkB,EAAEA,GAAG,eAAe,EAAE;YACzC;YACA;eACGE,QAAQ,GAAG,CAACQ,CAAAA,SAAU,CAAC,YAAY,EAAEA,QAAQ;YAChD;YACA;eACGN,aAAa,GAAG,CAACE,CAAAA;gBAChB,MAAMK,aAAa,CAAC,KAAK,EAAEL,KAAK,GAAG,GAC/BA,KAAK,OAAO,GAAG,CAAC,YAAY,EAAEA,KAAK,OAAO,EAAE,GAAG,IACjD;gBACF,OAAO;oBACH,CAAC,IAAI,EAAET,KAAKS,KAAK,IAAI,EAAE,EAAE,EAAEK,WAAW,CAAC,CAAC;uBACrCC,OAAO,IAAI,CAACN,KAAK,OAAO,EAAE,GAAG,CAACO,CAAAA,OACtB,CAAC,MAAM,EAAEA,KAAK,UAAU,EAAEP,KAAK,OAAO,CAACO,KAAK,EAAE;iBAE5D,CAAC,IAAI,CAAC;YACX;YACA;SACH;QACDC,QAAQ,GAAG,CAACL,OAAO,IAAI,CAAC;IAC5B;AACJ;AAEO,MAAMM,iCAAiCC,YAAY,oBAAoB,CAAC;IAC3E,gBAAgBxB;IAChB,cAAc;QAACyB;QAAWC;QAAmBC;KAAwB;AACzE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AdminBeforeBuild
|
|
1
|
+
import { AdminBeforeBuild } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
|
|
2
4
|
declare class EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {
|
|
3
5
|
private getAppStackOutput;
|
|
4
6
|
private projectSdkParamsService;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AdminBeforeBuild,
|
|
1
|
+
import { AdminBeforeBuild, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
|
|
2
3
|
import { GracefulError } from "@webiny/project";
|
|
3
4
|
const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
|
|
4
5
|
class EnsureApiDeployedBeforeAdminBuildImpl {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.ts"],"sourcesContent":["import { AdminBeforeBuild } from \"@webiny/project/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { GetAppStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeBuild.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(\"Cannot build Admin before deploying API.\");\n const message = [\n `Before building %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminBuild = AdminBeforeBuild.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminBuildImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminBuildImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminBuild","AdminBeforeBuild","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;;AAKA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AdminBeforeWatch
|
|
1
|
+
import { AdminBeforeWatch } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
|
|
2
4
|
declare class EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {
|
|
3
5
|
private getAppStackOutput;
|
|
4
6
|
private projectSdkParamsService;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AdminBeforeWatch,
|
|
1
|
+
import { AdminBeforeWatch, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
|
|
2
3
|
import { GracefulError } from "@webiny/project";
|
|
3
4
|
const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
|
|
4
5
|
class EnsureApiDeployedBeforeAdminWatchImpl {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.ts"],"sourcesContent":["import { AdminBeforeWatch } from \"@webiny/project/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { GetAppStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeWatch.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(`Cannot watch Admin before deploying API.`);\n const message = [\n `Before watching %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminWatch = AdminBeforeWatch.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminWatchImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminWatchImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminWatch","AdminBeforeWatch","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;;AAKA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
|