@webiny/project 6.6.0-alpha.10 → 6.6.0-alpha.12
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/ProjectSdk.d.ts +8 -19
- package/ProjectSdk.js +1 -28
- package/ProjectSdk.js.map +1 -1
- package/abstractions/features/hooks/index.d.ts +0 -8
- package/abstractions/features/hooks/index.js +0 -8
- package/abstractions/features/index.d.ts +0 -8
- package/abstractions/features/index.js +0 -8
- package/abstractions/models/IAppModel.d.ts +0 -2
- package/abstractions/models/IProjectModel.d.ts +0 -2
- package/abstractions/services/InitHostingSdkService.d.ts +21 -0
- package/abstractions/services/InitHostingSdkService.js +5 -0
- package/abstractions/services/InitHostingSdkService.js.map +1 -0
- package/abstractions/services/ProjectInfoService/ProjectInfoService.d.ts +6 -6
- package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
- package/abstractions/services/ProjectInfoService/index.d.ts +0 -1
- package/abstractions/services/ProjectInfoService/index.js +0 -1
- package/abstractions/services/index.d.ts +1 -13
- package/abstractions/services/index.js +1 -13
- package/createProjectSdkContainer.js +1 -3
- package/createProjectSdkContainer.js.map +1 -1
- package/decorators/index.d.ts +0 -6
- package/decorators/index.js +0 -6
- package/defineExtension/types.d.ts +1 -1
- package/exports/infra/admin.d.ts +0 -2
- package/exports/infra/admin.js +0 -2
- package/exports/infra/api.d.ts +0 -2
- package/exports/infra/api.js +0 -2
- package/exports/infra/core.d.ts +0 -2
- package/exports/infra/core.js +0 -2
- package/exports/infra.d.ts +0 -2
- package/exports/infra.js +0 -2
- package/extensions/AdminWebsocketsUrl.d.ts +5 -3
- package/extensions/AdminWebsocketsUrl.js +1 -1
- package/extensions/AdminWebsocketsUrl.js.map +1 -1
- package/extensions/DatabaseSetup.d.ts +1 -0
- package/extensions/DatabaseSetup.js +4 -3
- package/extensions/DatabaseSetup.js.map +1 -1
- package/extensions/{pulumi/ProductionEnvironments.js → ProductionEnvironments.js} +2 -2
- package/extensions/ProductionEnvironments.js.map +1 -0
- package/extensions/api/Route/ApiRoute.d.ts +23 -0
- package/extensions/api/Route/ApiRoute.js +92 -0
- package/extensions/api/Route/ApiRoute.js.map +1 -0
- package/extensions/api/Route/index.d.ts +2 -0
- package/extensions/api/Route/index.js +2 -0
- package/extensions/api/Route/routePath.d.ts +21 -0
- package/extensions/api/Route/routePath.js +10 -0
- package/extensions/api/Route/routePath.js.map +1 -0
- package/extensions/api/index.d.ts +1 -0
- package/extensions/api/index.js +1 -0
- package/extensions/hooks/index.d.ts +0 -8
- package/extensions/hooks/index.js +0 -8
- package/extensions/hosting/extensionImplementations.d.ts +5 -4
- package/extensions/hosting/extensionImplementations.js.map +1 -1
- package/extensions/index.d.ts +7 -17
- package/extensions/index.js +5 -13
- package/extensions/index.js.map +1 -1
- package/features/GetProductionEnvironments/GetProductionEnvironments.js +1 -1
- package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
- package/features/hooks/index.d.ts +0 -8
- package/features/hooks/index.js +0 -8
- package/features/index.d.ts +0 -8
- package/features/index.js +0 -8
- package/index.d.ts +0 -4
- package/index.js +1 -5
- package/index.js.map +1 -1
- package/models/AppModel.js +1 -2
- package/models/AppModel.js.map +1 -1
- package/models/ProjectModel.js +0 -2
- package/models/ProjectModel.js.map +1 -1
- package/package.json +8 -14
- package/services/GetAppService/GetAppService.js +1 -3
- package/services/GetAppService/GetAppService.js.map +1 -1
- package/services/GetProjectService/GetProjectService.js +0 -2
- package/services/GetProjectService/GetProjectService.js.map +1 -1
- package/services/InitProjectSdkService/InitProjectSdkService.d.ts +6 -2
- package/services/InitProjectSdkService/InitProjectSdkService.js +18 -12
- package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
- package/services/InitProjectSdkService/registerHooks.js +4 -16
- package/services/InitProjectSdkService/registerHooks.js.map +1 -1
- package/services/InstallExtensionService/updateWebinyConfig.js +9 -23
- package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
- package/services/ProjectInfoService/ProjectInfoService.d.ts +7 -3
- package/services/ProjectInfoService/ProjectInfoService.js +3 -11
- package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
- package/services/ProjectInfoService/index.d.ts +0 -1
- package/services/ProjectInfoService/index.js +0 -1
- package/services/SetProjectIdService/SetProjectIdService.js +2 -7
- package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
- package/services/index.d.ts +0 -12
- package/services/index.js +0 -12
- package/utils/ensureNamedImport.d.ts +12 -0
- package/utils/ensureNamedImport.js +27 -0
- package/utils/ensureNamedImport.js.map +1 -0
- package/utils/env/index.d.ts +0 -1
- package/utils/env/index.js +0 -1
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/registerSrcExtensions.d.ts +13 -0
- package/utils/registerSrcExtensions.js +10 -0
- package/utils/registerSrcExtensions.js.map +1 -0
- package/abstractions/features/DeployApp.d.ts +0 -20
- package/abstractions/features/DeployApp.js +0 -5
- package/abstractions/features/DeployApp.js.map +0 -1
- package/abstractions/features/DestroyApp.d.ts +0 -18
- package/abstractions/features/DestroyApp.js +0 -5
- package/abstractions/features/DestroyApp.js.map +0 -1
- package/abstractions/features/ExportStack.d.ts +0 -18
- package/abstractions/features/ExportStack.js +0 -5
- package/abstractions/features/ExportStack.js.map +0 -1
- package/abstractions/features/GetAppOutput.d.ts +0 -18
- package/abstractions/features/GetAppOutput.js +0 -5
- package/abstractions/features/GetAppOutput.js.map +0 -1
- package/abstractions/features/GetAppStackOutput.d.ts +0 -22
- package/abstractions/features/GetAppStackOutput.js +0 -5
- package/abstractions/features/GetAppStackOutput.js.map +0 -1
- package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +0 -7
- package/abstractions/features/GetPulumiResourceNamePrefix.js +0 -5
- package/abstractions/features/GetPulumiResourceNamePrefix.js.map +0 -1
- package/abstractions/features/RefreshApp.d.ts +0 -18
- package/abstractions/features/RefreshApp.js +0 -5
- package/abstractions/features/RefreshApp.js.map +0 -1
- package/abstractions/features/RunPulumiCommand.d.ts +0 -19
- package/abstractions/features/RunPulumiCommand.js +0 -5
- package/abstractions/features/RunPulumiCommand.js.map +0 -1
- package/abstractions/features/hooks/AdminAfterDeploy.d.ts +0 -9
- package/abstractions/features/hooks/AdminAfterDeploy.js +0 -5
- package/abstractions/features/hooks/AdminAfterDeploy.js.map +0 -1
- package/abstractions/features/hooks/AdminBeforeDeploy.d.ts +0 -9
- package/abstractions/features/hooks/AdminBeforeDeploy.js +0 -5
- package/abstractions/features/hooks/AdminBeforeDeploy.js.map +0 -1
- package/abstractions/features/hooks/AfterDeploy.d.ts +0 -9
- package/abstractions/features/hooks/AfterDeploy.js +0 -5
- package/abstractions/features/hooks/AfterDeploy.js.map +0 -1
- package/abstractions/features/hooks/ApiAfterDeploy.d.ts +0 -9
- package/abstractions/features/hooks/ApiAfterDeploy.js +0 -5
- package/abstractions/features/hooks/ApiAfterDeploy.js.map +0 -1
- package/abstractions/features/hooks/ApiBeforeDeploy.d.ts +0 -9
- package/abstractions/features/hooks/ApiBeforeDeploy.js +0 -5
- package/abstractions/features/hooks/ApiBeforeDeploy.js.map +0 -1
- package/abstractions/features/hooks/BeforeDeploy.d.ts +0 -9
- package/abstractions/features/hooks/BeforeDeploy.js +0 -5
- package/abstractions/features/hooks/BeforeDeploy.js.map +0 -1
- package/abstractions/features/hooks/CoreAfterDeploy.d.ts +0 -9
- package/abstractions/features/hooks/CoreAfterDeploy.js +0 -5
- package/abstractions/features/hooks/CoreAfterDeploy.js.map +0 -1
- package/abstractions/features/hooks/CoreBeforeDeploy.d.ts +0 -9
- package/abstractions/features/hooks/CoreBeforeDeploy.js +0 -5
- package/abstractions/features/hooks/CoreBeforeDeploy.js.map +0 -1
- package/abstractions/services/GetPulumiService.d.ts +0 -14
- package/abstractions/services/GetPulumiService.js +0 -5
- package/abstractions/services/GetPulumiService.js.map +0 -1
- package/abstractions/services/IsRemotePulumiBackendService.d.ts +0 -7
- package/abstractions/services/IsRemotePulumiBackendService.js +0 -5
- package/abstractions/services/IsRemotePulumiBackendService.js.map +0 -1
- package/abstractions/services/ListAppLambdaFunctionsService.d.ts +0 -23
- package/abstractions/services/ListAppLambdaFunctionsService.js +0 -5
- package/abstractions/services/ListAppLambdaFunctionsService.js.map +0 -1
- package/abstractions/services/ListDeployedEnvironmentsService.d.ts +0 -12
- package/abstractions/services/ListDeployedEnvironmentsService.js +0 -5
- package/abstractions/services/ListDeployedEnvironmentsService.js.map +0 -1
- package/abstractions/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -12
- package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +0 -5
- package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
- package/abstractions/services/PulumiExportService.d.ts +0 -13
- package/abstractions/services/PulumiExportService.js +0 -6
- package/abstractions/services/PulumiExportService.js.map +0 -1
- package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +0 -7
- package/abstractions/services/PulumiGetConfigPassphraseService.js +0 -5
- package/abstractions/services/PulumiGetConfigPassphraseService.js.map +0 -1
- package/abstractions/services/PulumiGetSecretsProviderService.d.ts +0 -7
- package/abstractions/services/PulumiGetSecretsProviderService.js +0 -5
- package/abstractions/services/PulumiGetSecretsProviderService.js.map +0 -1
- package/abstractions/services/PulumiGetStackOutputService.d.ts +0 -13
- package/abstractions/services/PulumiGetStackOutputService.js +0 -5
- package/abstractions/services/PulumiGetStackOutputService.js.map +0 -1
- package/abstractions/services/PulumiImportService.d.ts +0 -8
- package/abstractions/services/PulumiImportService.js +0 -5
- package/abstractions/services/PulumiImportService.js.map +0 -1
- package/abstractions/services/PulumiLoginService.d.ts +0 -16
- package/abstractions/services/PulumiLoginService.js +0 -5
- package/abstractions/services/PulumiLoginService.js.map +0 -1
- package/abstractions/services/PulumiSelectStackService.d.ts +0 -10
- package/abstractions/services/PulumiSelectStackService.js +0 -5
- package/abstractions/services/PulumiSelectStackService.js.map +0 -1
- package/abstractions/services/StackOutputCacheService.d.ts +0 -10
- package/abstractions/services/StackOutputCacheService.js +0 -5
- package/abstractions/services/StackOutputCacheService.js.map +0 -1
- package/abstractions/services/WatchedLambdaFunctionsService.d.ts +0 -28
- package/abstractions/services/WatchedLambdaFunctionsService.js +0 -5
- package/abstractions/services/WatchedLambdaFunctionsService.js.map +0 -1
- package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +0 -17
- package/decorators/DeployAppClearWatchedLambdaFunctions.js +0 -32
- package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +0 -1
- package/decorators/DeployAppRefreshStackOutputCache.d.ts +0 -17
- package/decorators/DeployAppRefreshStackOutputCache.js +0 -32
- package/decorators/DeployAppRefreshStackOutputCache.js.map +0 -1
- package/decorators/DeployAppWithHooks.d.ts +0 -17
- package/decorators/DeployAppWithHooks.js +0 -58
- package/decorators/DeployAppWithHooks.js.map +0 -1
- package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +0 -17
- package/decorators/DeployAppWithWatchedLambdaReplacement.js +0 -39
- package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +0 -1
- package/decorators/DestroyAppClearStackOutputCache.d.ts +0 -25
- package/decorators/DestroyAppClearStackOutputCache.js +0 -29
- package/decorators/DestroyAppClearStackOutputCache.js.map +0 -1
- package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +0 -11
- package/decorators/GetPulumiServiceWithDownloadInfo.js +0 -27
- package/decorators/GetPulumiServiceWithDownloadInfo.js.map +0 -1
- package/extensions/hooks/AdminAfterDeploy.d.ts +0 -4
- package/extensions/hooks/AdminAfterDeploy.js +0 -23
- package/extensions/hooks/AdminAfterDeploy.js.map +0 -1
- package/extensions/hooks/AdminBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/AdminBeforeDeploy.js +0 -23
- package/extensions/hooks/AdminBeforeDeploy.js.map +0 -1
- package/extensions/hooks/AfterDeploy.d.ts +0 -4
- package/extensions/hooks/AfterDeploy.js +0 -22
- package/extensions/hooks/AfterDeploy.js.map +0 -1
- package/extensions/hooks/ApiAfterDeploy.d.ts +0 -4
- package/extensions/hooks/ApiAfterDeploy.js +0 -23
- package/extensions/hooks/ApiAfterDeploy.js.map +0 -1
- package/extensions/hooks/ApiBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/ApiBeforeDeploy.js +0 -23
- package/extensions/hooks/ApiBeforeDeploy.js.map +0 -1
- package/extensions/hooks/BeforeDeploy.d.ts +0 -4
- package/extensions/hooks/BeforeDeploy.js +0 -22
- package/extensions/hooks/BeforeDeploy.js.map +0 -1
- package/extensions/hooks/CoreAfterDeploy.d.ts +0 -4
- package/extensions/hooks/CoreAfterDeploy.js +0 -23
- package/extensions/hooks/CoreAfterDeploy.js.map +0 -1
- package/extensions/hooks/CoreBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/CoreBeforeDeploy.js +0 -23
- package/extensions/hooks/CoreBeforeDeploy.js.map +0 -1
- package/extensions/pulumi/ProductionEnvironments.js.map +0 -1
- package/extensions/pulumi/PulumiResourceNamePrefix.d.ts +0 -4
- package/extensions/pulumi/PulumiResourceNamePrefix.js +0 -16
- package/extensions/pulumi/PulumiResourceNamePrefix.js.map +0 -1
- package/extensions/pulumi/index.d.ts +0 -2
- package/extensions/pulumi/index.js +0 -2
- package/features/DeployApp/DeployApp.d.ts +0 -14
- package/features/DeployApp/DeployApp.js +0 -86
- package/features/DeployApp/DeployApp.js.map +0 -1
- package/features/DeployApp/index.d.ts +0 -1
- package/features/DeployApp/index.js +0 -1
- package/features/DestroyApp/DestroyApp.d.ts +0 -14
- package/features/DestroyApp/DestroyApp.js +0 -66
- package/features/DestroyApp/DestroyApp.js.map +0 -1
- package/features/DestroyApp/index.d.ts +0 -1
- package/features/DestroyApp/index.js +0 -1
- package/features/ExportStack/ExportStack.d.ts +0 -9
- package/features/ExportStack/ExportStack.js +0 -26
- package/features/ExportStack/ExportStack.js.map +0 -1
- package/features/ExportStack/index.d.ts +0 -1
- package/features/ExportStack/index.js +0 -1
- package/features/GetAppOutput/GetAppOutput.d.ts +0 -12
- package/features/GetAppOutput/GetAppOutput.js +0 -51
- package/features/GetAppOutput/GetAppOutput.js.map +0 -1
- package/features/GetAppOutput/index.d.ts +0 -1
- package/features/GetAppOutput/index.js +0 -1
- package/features/GetAppStackOutput/GetAppStackOutput.d.ts +0 -10
- package/features/GetAppStackOutput/GetAppStackOutput.js +0 -26
- package/features/GetAppStackOutput/GetAppStackOutput.js.map +0 -1
- package/features/GetAppStackOutput/index.d.ts +0 -1
- package/features/GetAppStackOutput/index.js +0 -1
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +0 -7
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +0 -25
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +0 -1
- package/features/GetPulumiResourceNamePrefix/index.d.ts +0 -1
- package/features/GetPulumiResourceNamePrefix/index.js +0 -1
- package/features/RefreshApp/RefreshApp.d.ts +0 -13
- package/features/RefreshApp/RefreshApp.js +0 -64
- package/features/RefreshApp/RefreshApp.js.map +0 -1
- package/features/RefreshApp/index.d.ts +0 -1
- package/features/RefreshApp/index.js +0 -1
- package/features/RunPulumiCommand/RunPulumiCommand.d.ts +0 -13
- package/features/RunPulumiCommand/RunPulumiCommand.js +0 -61
- package/features/RunPulumiCommand/RunPulumiCommand.js.map +0 -1
- package/features/RunPulumiCommand/index.d.ts +0 -1
- package/features/RunPulumiCommand/index.js +0 -1
- package/features/Watch/handler/handler.zip +0 -0
- package/features/Watch/initInvocationForwarding.d.ts +0 -9
- package/features/Watch/initInvocationForwarding.js +0 -91
- package/features/Watch/initInvocationForwarding.js.map +0 -1
- package/features/Watch/localInvocationWorker.d.ts +0 -1
- package/features/Watch/localInvocationWorker.js +0 -31
- package/features/Watch/localInvocationWorker.js.map +0 -1
- package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.d.ts +0 -7
- package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +0 -25
- package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +0 -1
- package/features/hooks/AdminAfterDeploy/index.d.ts +0 -1
- package/features/hooks/AdminAfterDeploy/index.js +0 -1
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +0 -7
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +0 -25
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +0 -1
- package/features/hooks/AdminBeforeDeploy/index.d.ts +0 -1
- package/features/hooks/AdminBeforeDeploy/index.js +0 -1
- package/features/hooks/AfterDeploy/AfterDeploy.d.ts +0 -7
- package/features/hooks/AfterDeploy/AfterDeploy.js +0 -25
- package/features/hooks/AfterDeploy/AfterDeploy.js.map +0 -1
- package/features/hooks/AfterDeploy/index.d.ts +0 -1
- package/features/hooks/AfterDeploy/index.js +0 -1
- package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.d.ts +0 -7
- package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +0 -25
- package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +0 -1
- package/features/hooks/ApiAfterDeploy/index.d.ts +0 -1
- package/features/hooks/ApiAfterDeploy/index.js +0 -1
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +0 -7
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +0 -25
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +0 -1
- package/features/hooks/ApiBeforeDeploy/index.d.ts +0 -1
- package/features/hooks/ApiBeforeDeploy/index.js +0 -1
- package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +0 -7
- package/features/hooks/BeforeDeploy/BeforeDeploy.js +0 -25
- package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +0 -1
- package/features/hooks/BeforeDeploy/index.d.ts +0 -1
- package/features/hooks/BeforeDeploy/index.js +0 -1
- package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.d.ts +0 -7
- package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +0 -25
- package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +0 -1
- package/features/hooks/CoreAfterDeploy/index.d.ts +0 -1
- package/features/hooks/CoreAfterDeploy/index.js +0 -1
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +0 -7
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +0 -25
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +0 -1
- package/features/hooks/CoreBeforeDeploy/index.d.ts +0 -1
- package/features/hooks/CoreBeforeDeploy/index.js +0 -1
- package/services/InitProjectSdkService/registerPulumiExtensions.d.ts +0 -4
- package/services/InitProjectSdkService/registerPulumiExtensions.js +0 -16
- package/services/InitProjectSdkService/registerPulumiExtensions.js.map +0 -1
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +0 -14
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +0 -15
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +0 -1
- package/services/IsRemotePulumiBackendService/index.d.ts +0 -1
- package/services/IsRemotePulumiBackendService/index.js +0 -1
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +0 -18
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +0 -61
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +0 -1
- package/services/ListAppLambdaFunctionsService/index.d.ts +0 -1
- package/services/ListAppLambdaFunctionsService/index.js +0 -1
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +0 -7
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +0 -30
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +0 -1
- package/services/ListDeployedEnvironmentsService/index.d.ts +0 -1
- package/services/ListDeployedEnvironmentsService/index.js +0 -1
- package/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -5
- package/services/ProjectInfoService/GetPulumiVersionService.js +0 -46
- package/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
- package/services/PulumiExportService/PulumiExportService.d.ts +0 -13
- package/services/PulumiExportService/PulumiExportService.js +0 -50
- package/services/PulumiExportService/PulumiExportService.js.map +0 -1
- package/services/PulumiExportService/index.d.ts +0 -1
- package/services/PulumiExportService/index.js +0 -1
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +0 -5
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +0 -15
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +0 -1
- package/services/PulumiGetConfigPassphraseService/index.d.ts +0 -1
- package/services/PulumiGetConfigPassphraseService/index.js +0 -1
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +0 -5
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +0 -15
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +0 -1
- package/services/PulumiGetSecretsProviderService/index.d.ts +0 -1
- package/services/PulumiGetSecretsProviderService/index.js +0 -1
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +0 -12
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +0 -64
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +0 -1
- package/services/PulumiGetStackOutputService/index.d.ts +0 -1
- package/services/PulumiGetStackOutputService/index.js +0 -1
- package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +0 -1
- package/services/PulumiGetStackOutputService/mapStackOutput.js +0 -22
- package/services/PulumiGetStackOutputService/mapStackOutput.js.map +0 -1
- package/services/PulumiImportService/PulumiImportService.d.ts +0 -10
- package/services/PulumiImportService/PulumiImportService.js +0 -60
- package/services/PulumiImportService/PulumiImportService.js.map +0 -1
- package/services/PulumiImportService/index.d.ts +0 -1
- package/services/PulumiImportService/index.js +0 -1
- package/services/PulumiLoginService/PulumiLoginService.d.ts +0 -10
- package/services/PulumiLoginService/PulumiLoginService.js +0 -54
- package/services/PulumiLoginService/PulumiLoginService.js.map +0 -1
- package/services/PulumiLoginService/index.d.ts +0 -1
- package/services/PulumiLoginService/index.js +0 -1
- package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +0 -15
- package/services/PulumiSelectStackService/PulumiSelectStackService.js +0 -102
- package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +0 -1
- package/services/PulumiSelectStackService/index.d.ts +0 -1
- package/services/PulumiSelectStackService/index.js +0 -1
- package/services/StackOutputCacheService/StackOutputCacheService.d.ts +0 -18
- package/services/StackOutputCacheService/StackOutputCacheService.js +0 -89
- package/services/StackOutputCacheService/StackOutputCacheService.js.map +0 -1
- package/services/StackOutputCacheService/index.d.ts +0 -1
- package/services/StackOutputCacheService/index.js +0 -1
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +0 -13
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +0 -54
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +0 -1
- package/services/WatchedLambdaFunctionsService/index.d.ts +0 -1
- package/services/WatchedLambdaFunctionsService/index.js +0 -1
- package/utils/env/withPulumiConfigPassphrase.d.ts +0 -1
- package/utils/env/withPulumiConfigPassphrase.js +0 -7
- package/utils/env/withPulumiConfigPassphrase.js.map +0 -1
- /package/extensions/{pulumi/ProductionEnvironments.d.ts → ProductionEnvironments.d.ts} +0 -0
package/exports/infra.d.ts
CHANGED
|
@@ -2,7 +2,5 @@ export { LoggerService as Logger } from "../abstractions/services/LoggerService.
|
|
|
2
2
|
export { UiService as Ui } from "../abstractions/services/UiService.js";
|
|
3
3
|
export { AfterBuild as AfterBuildHook } from "../abstractions/features/hooks/AfterBuild.js";
|
|
4
4
|
export { BeforeBuild as BeforeBuildHook } from "../abstractions/features/hooks/BeforeBuild.js";
|
|
5
|
-
export { AfterDeploy as AfterDeployHook } from "../abstractions/features/hooks/AfterDeploy.js";
|
|
6
|
-
export { BeforeDeploy as BeforeDeployHook } from "../abstractions/features/hooks/BeforeDeploy.js";
|
|
7
5
|
export { BeforeWatch as BeforeWatchHook } from "../abstractions/features/hooks/BeforeWatch.js";
|
|
8
6
|
export { EnvVar } from "../extensions/EnvVar.js";
|
package/exports/infra.js
CHANGED
|
@@ -2,7 +2,5 @@ export { LoggerService as Logger } from "../abstractions/services/LoggerService.
|
|
|
2
2
|
export { UiService as Ui } from "../abstractions/services/UiService.js";
|
|
3
3
|
export { AfterBuild as AfterBuildHook } from "../abstractions/features/hooks/AfterBuild.js";
|
|
4
4
|
export { BeforeBuild as BeforeBuildHook } from "../abstractions/features/hooks/BeforeBuild.js";
|
|
5
|
-
export { AfterDeploy as AfterDeployHook } from "../abstractions/features/hooks/AfterDeploy.js";
|
|
6
|
-
export { BeforeDeploy as BeforeDeployHook } from "../abstractions/features/hooks/BeforeDeploy.js";
|
|
7
5
|
export { BeforeWatch as BeforeWatchHook } from "../abstractions/features/hooks/BeforeWatch.js";
|
|
8
6
|
export { EnvVar } from "../extensions/EnvVar.js";
|
|
@@ -2,9 +2,11 @@ import { z } from "zod";
|
|
|
2
2
|
/**
|
|
3
3
|
* Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as
|
|
4
4
|
* `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL
|
|
5
|
-
* from the API URL (same origin, http -> ws
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* from the API URL (same origin, http -> ws, plus the `/ws` path the standalone server takes
|
|
6
|
+
* upgrades on), which is what the standalone hosting type needs by default. Set it only when that
|
|
7
|
+
* derivation lands in the wrong place: WebSockets on a different origin, or a proxy that rewrites
|
|
8
|
+
* the path. The value is the full socket URL and is used as is. Because the config is evaluated at
|
|
9
|
+
* build time, the value can come from any env var the user chooses, e.g.
|
|
8
10
|
* `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.
|
|
9
11
|
*/
|
|
10
12
|
export declare const AdminWebsocketsUrl: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
|
|
@@ -10,7 +10,7 @@ const AdminWebsocketsUrl = defineExtension({
|
|
|
10
10
|
},
|
|
11
11
|
description: "Set a dedicated WebSocket URL for the Admin app.",
|
|
12
12
|
paramsSchema: z.object({
|
|
13
|
-
url: z.string().describe("The WebSocket
|
|
13
|
+
url: z.string().describe("The full WebSocket URL, e.g. wss://ws.example.com/ws or ws://localhost:3002/ws")
|
|
14
14
|
}),
|
|
15
15
|
render: (props)=>/*#__PURE__*/ react.createElement(EnvVar, {
|
|
16
16
|
varName: "WEBINY_ADMIN_WS_API_URL",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws), which is what the standalone hosting type needs by
|
|
1
|
+
{"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws, plus the `/ws` path the standalone server takes\n * upgrades on), which is what the standalone hosting type needs by default. Set it only when that\n * derivation lands in the wrong place: WebSockets on a different origin, or a proxy that rewrites\n * the path. The value is the full socket URL and is used as is. Because the config is evaluated at\n * build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\n \"The full WebSocket URL, e.g. wss://ws.example.com/ws or ws://localhost:3002/ws\"\n )\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAeO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CACL;IAEZ;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
|
|
@@ -6,13 +6,14 @@ const DatabaseSetup = defineExtension({
|
|
|
6
6
|
runtimeContext: "project",
|
|
7
7
|
hosting: "all"
|
|
8
8
|
},
|
|
9
|
-
description: "Define the database setup configuration (ddb, ddb+es,
|
|
9
|
+
description: "Define the database setup configuration (ddb, ddb+es, ddb+os or pg).",
|
|
10
10
|
paramsSchema: z.object({
|
|
11
11
|
setupName: z["enum"]([
|
|
12
12
|
"ddb",
|
|
13
13
|
"ddb+es",
|
|
14
|
-
"ddb+os"
|
|
15
|
-
|
|
14
|
+
"ddb+os",
|
|
15
|
+
"pg"
|
|
16
|
+
]).describe("The database setup type: ddb (DynamoDB only), ddb+es (DynamoDB + ElasticSearch), ddb+os (DynamoDB + OpenSearch), or pg (PostgreSQL)")
|
|
16
17
|
})
|
|
17
18
|
});
|
|
18
19
|
export { DatabaseSetup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/DatabaseSetup.js","sources":["../../src/extensions/DatabaseSetup.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const DatabaseSetup = defineExtension({\n type: \"Project/DatabaseSetup\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Define the database setup configuration (ddb, ddb+es,
|
|
1
|
+
{"version":3,"file":"extensions/DatabaseSetup.js","sources":["../../src/extensions/DatabaseSetup.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const DatabaseSetup = defineExtension({\n type: \"Project/DatabaseSetup\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Define the database setup configuration (ddb, ddb+es, ddb+os or pg).\",\n paramsSchema: z.object({\n setupName: z\n .enum([\"ddb\", \"ddb+es\", \"ddb+os\", \"pg\"])\n .describe(\n \"The database setup type: ddb (DynamoDB only), ddb+es (DynamoDB + ElasticSearch), ddb+os (DynamoDB + OpenSearch), or pg (PostgreSQL)\"\n )\n })\n});\n"],"names":["DatabaseSetup","defineExtension","z"],"mappings":";;AAGO,MAAMA,gBAAgBC,gBAAgB;IACzC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,WAAWA,CAAC,CAADA,OACF,CAAC;YAAC;YAAO;YAAU;YAAU;SAAK,EACtC,QAAQ,CACL;IAEZ;AACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import react, { useEffect } from "react";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { defineExtension } from "
|
|
4
|
-
import { useRegisterProductionEnvironments } from "
|
|
3
|
+
import { defineExtension } from "../defineExtension/index.js";
|
|
4
|
+
import { useRegisterProductionEnvironments } from "../services/GetProjectConfigService/ProductionEnvironmentsContext.js";
|
|
5
5
|
const Registrar = ({ environments })=>{
|
|
6
6
|
const setProdEnvs = useRegisterProductionEnvironments();
|
|
7
7
|
useEffect(()=>{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/ProductionEnvironments.js","sources":["../../src/extensions/ProductionEnvironments.ts"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { useRegisterProductionEnvironments } from \"~/services/GetProjectConfigService/ProductionEnvironmentsContext.js\";\n\ninterface RegistrarProps {\n environments: string[];\n}\n\nconst Registrar: React.FC<RegistrarProps> = ({ environments }) => {\n const setProdEnvs = useRegisterProductionEnvironments();\n useEffect(() => {\n if (setProdEnvs) {\n setProdEnvs(environments);\n }\n }, []);\n return null;\n};\n\nexport const ProductionEnvironments = defineExtension({\n type: \"Infra/ProductionEnvironments\",\n tags: { runtimeContext: \"project\", hosting: \"aws\" },\n description: \"Provide names for environments that are considered production environments.\",\n paramsSchema: z.object({\n environments: z.array(\n z.string().superRefine((value, ctx) => {\n if (!value) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Environment name cannot be empty.\"\n });\n return;\n }\n\n // Must allow only letters, numbers, dashes, and underscores.\n if (!/^[a-zA-Z0-9-_]+$/.test(value)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"Environment name can only contain letters, numbers, dashes, and underscores.\"\n });\n }\n })\n )\n }),\n render: props => React.createElement(Registrar, { environments: props.environments })\n});\n"],"names":["Registrar","environments","setProdEnvs","useRegisterProductionEnvironments","useEffect","ProductionEnvironments","defineExtension","z","value","ctx","props","React"],"mappings":";;;;AASA,MAAMA,YAAsC,CAAC,EAAEC,YAAY,EAAE;IACzD,MAAMC,cAAcC;IACpBC,UAAU;QACN,IAAIF,aACAA,YAAYD;IAEpB,GAAG,EAAE;IACL,OAAO;AACX;AAEO,MAAMI,yBAAyBC,gBAAgB;IAClD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,cAAcA,EAAE,KAAK,CACjBA,EAAE,MAAM,GAAG,WAAW,CAAC,CAACC,OAAOC;YAC3B,IAAI,CAACD,OAAO,YACRC,IAAI,QAAQ,CAAC;gBACT,MAAMF,EAAE,YAAY,CAAC,MAAM;gBAC3B,SAAS;YACb;YAKJ,IAAI,CAAC,mBAAmB,IAAI,CAACC,QACzBC,IAAI,QAAQ,CAAC;gBACT,MAAMF,EAAE,YAAY,CAAC,MAAM;gBAC3B,SACI;YACR;QAER;IAER;IACA,QAAQG,CAAAA,QAASC,MAAAA,aAAmB,CAACX,WAAW;YAAE,cAAcU,MAAM,YAAY;QAAC;AACvF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const HTTP_METHODS: readonly ["DELETE", "GET", "HEAD", "PATCH", "POST", "PUT", "OPTIONS"];
|
|
3
|
+
/**
|
|
4
|
+
* Registers a custom HTTP route with the API's DI router, for every hosting type. The build step
|
|
5
|
+
* adds the route's handler and an `HttpRouteDefinition` to `apps/api/graphql/src/extensions.ts`.
|
|
6
|
+
* That is all a standalone project needs, because its HTTP server hands every request to the
|
|
7
|
+
* router. `@webiny/project-aws` registers its own implementation, which also adds the route to API
|
|
8
|
+
* Gateway.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ApiRoute: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
|
|
11
|
+
path: z.ZodString;
|
|
12
|
+
method: z.ZodEnum<{
|
|
13
|
+
DELETE: "DELETE";
|
|
14
|
+
GET: "GET";
|
|
15
|
+
HEAD: "HEAD";
|
|
16
|
+
OPTIONS: "OPTIONS";
|
|
17
|
+
PATCH: "PATCH";
|
|
18
|
+
POST: "POST";
|
|
19
|
+
PUT: "PUT";
|
|
20
|
+
}>;
|
|
21
|
+
src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
22
|
+
routeName: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import crypto_0 from "crypto";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { Node, Project } from "ts-morph";
|
|
5
|
+
import { defineExtension, zodSrcPath } from "../../../defineExtension/index.js";
|
|
6
|
+
import { ExtensionSrcResolver } from "../../../index.js";
|
|
7
|
+
import { deriveRouteName, toRouterPath } from "./routePath.js";
|
|
8
|
+
const HTTP_METHODS = [
|
|
9
|
+
"DELETE",
|
|
10
|
+
"GET",
|
|
11
|
+
"HEAD",
|
|
12
|
+
"PATCH",
|
|
13
|
+
"POST",
|
|
14
|
+
"PUT",
|
|
15
|
+
"OPTIONS"
|
|
16
|
+
];
|
|
17
|
+
const REGISTER_EXTENSION_PLUGIN_PATH = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
18
|
+
const EVENT_HANDLER_CORE_PATH = "@webiny/event-handler-core";
|
|
19
|
+
const getImportInsertIndex = (source)=>{
|
|
20
|
+
const importDeclarations = source.getImportDeclarations();
|
|
21
|
+
const lastImport = importDeclarations[importDeclarations.length - 1];
|
|
22
|
+
if (!lastImport) return 1;
|
|
23
|
+
return lastImport.getChildIndex() + 1;
|
|
24
|
+
};
|
|
25
|
+
const ensureNamedImport = (source, moduleSpecifier, name)=>{
|
|
26
|
+
const existing = source.getImportDeclaration(moduleSpecifier);
|
|
27
|
+
if (existing) {
|
|
28
|
+
const namedImports = existing.getNamedImports();
|
|
29
|
+
if (!namedImports.some((i)=>i.getName() === name)) existing.addNamedImport(name);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const index = getImportInsertIndex(source);
|
|
33
|
+
source.insertImportDeclaration(index, {
|
|
34
|
+
namedImports: [
|
|
35
|
+
name
|
|
36
|
+
],
|
|
37
|
+
moduleSpecifier
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const ApiRoute = defineExtension({
|
|
41
|
+
type: "Api/Route",
|
|
42
|
+
tags: {
|
|
43
|
+
runtimeContext: "app-build",
|
|
44
|
+
appName: "api",
|
|
45
|
+
hosting: "all"
|
|
46
|
+
},
|
|
47
|
+
description: "Register a custom HTTP route on the API.",
|
|
48
|
+
multiple: true,
|
|
49
|
+
paramsSchema: ({ project })=>z.object({
|
|
50
|
+
path: z.string().startsWith("/"),
|
|
51
|
+
method: z["enum"](HTTP_METHODS),
|
|
52
|
+
src: zodSrcPath({
|
|
53
|
+
project
|
|
54
|
+
}),
|
|
55
|
+
routeName: z.string().optional()
|
|
56
|
+
}),
|
|
57
|
+
async build (params, ctx) {
|
|
58
|
+
const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
|
|
59
|
+
const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);
|
|
60
|
+
const hash = crypto_0.createHash("sha256").update(params.src).digest("hex");
|
|
61
|
+
const alias = `ApiRoute_${hash.slice(-10)}`;
|
|
62
|
+
const extensionsTsFolder = path.dirname(extensionsTsFilePath);
|
|
63
|
+
const importPath = path.relative(extensionsTsFolder, absoluteSrcFilePath).replace(/\.tsx?$/, ".js");
|
|
64
|
+
const tsProject = new Project();
|
|
65
|
+
tsProject.addSourceFileAtPath(extensionsTsFilePath);
|
|
66
|
+
const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);
|
|
67
|
+
const routerPath = toRouterPath(params.path);
|
|
68
|
+
const routeName = params.routeName ?? deriveRouteName(params.path, params.method);
|
|
69
|
+
const nameProperty = `name: ${JSON.stringify(routeName)},`;
|
|
70
|
+
const registration = `\ncreateRegisterExtensionPlugin(ctx => {\n\tctx.container.register(\n\t\tcreateHttpRouteDefinition({\n\t\t\t${nameProperty}\n\t\t\tmethod: ${JSON.stringify(params.method)},\n\t\t\tpath: ${JSON.stringify(routerPath)},\n\t\t\thandler: ${alias}\n\t\t})\n\t);\n})`;
|
|
71
|
+
const sourceText = source.getFullText();
|
|
72
|
+
const compactSource = sourceText.replace(/\s+/g, "");
|
|
73
|
+
const compactRegistration = registration.replace(/\s+/g, "");
|
|
74
|
+
if (compactSource.includes(compactRegistration)) return;
|
|
75
|
+
if (sourceText.includes(nameProperty)) throw new Error(`Two "Api.Route" entries resolve to the route name "${routeName}". A derived name leaves out path parameters, so "/orders" and "/orders/{id}" collide; set "routeName" on one of them.`);
|
|
76
|
+
if (!source.getImportDeclaration(importPath)) {
|
|
77
|
+
const index = getImportInsertIndex(source);
|
|
78
|
+
source.insertImportDeclaration(index, {
|
|
79
|
+
defaultImport: alias,
|
|
80
|
+
moduleSpecifier: importPath
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
ensureNamedImport(source, REGISTER_EXTENSION_PLUGIN_PATH, "createRegisterExtensionPlugin");
|
|
84
|
+
ensureNamedImport(source, EVENT_HANDLER_CORE_PATH, "createHttpRouteDefinition");
|
|
85
|
+
const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
|
|
86
|
+
pluginsArray.addElement(registration);
|
|
87
|
+
await source.save();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export { ApiRoute, HTTP_METHODS };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=ApiRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/api/Route/ApiRoute.js","sources":["../../../../src/extensions/api/Route/ApiRoute.ts"],"sourcesContent":["import path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node } from \"ts-morph\";\nimport { Project } from \"ts-morph\";\nimport { type ArrayLiteralExpression } from \"ts-morph\";\nimport { type SourceFile } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { deriveRouteName } from \"./routePath.js\";\nimport { toRouterPath } from \"./routePath.js\";\n\n/*\n * The methods the DI router can match. It compares a definition's method to the request's exactly,\n * so a catch-all such as API Gateway's `ANY` would register a route no request can reach.\n */\nexport const HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\"] as const;\n\nconst REGISTER_EXTENSION_PLUGIN_PATH = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\nconst EVENT_HANDLER_CORE_PATH = \"@webiny/event-handler-core\";\n\n// Right after the last import, or at the top of a file that has none.\nconst getImportInsertIndex = (source: SourceFile) => {\n const importDeclarations = source.getImportDeclarations();\n const lastImport = importDeclarations[importDeclarations.length - 1];\n if (!lastImport) {\n return 1;\n }\n return lastImport.getChildIndex() + 1;\n};\n\n/*\n * Adds `name` to the named imports from `moduleSpecifier`, adding the import declaration after the\n * last import when there is none. An existing import from the same module may name other things,\n * e.g. BuildParam imports `createRegisterBuildParamPlugin` from the RegisterExtensionPlugin path.\n */\nconst ensureNamedImport = (source: SourceFile, moduleSpecifier: string, name: string) => {\n const existing = source.getImportDeclaration(moduleSpecifier);\n if (existing) {\n const namedImports = existing.getNamedImports();\n if (!namedImports.some(i => i.getName() === name)) {\n existing.addNamedImport(name);\n }\n return;\n }\n\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n namedImports: [name],\n moduleSpecifier\n });\n};\n\n/**\n * Registers a custom HTTP route with the API's DI router, for every hosting type. The build step\n * adds the route's handler and an `HttpRouteDefinition` to `apps/api/graphql/src/extensions.ts`.\n * That is all a standalone project needs, because its HTTP server hands every request to the\n * router. `@webiny/project-aws` registers its own implementation, which also adds the route to API\n * Gateway.\n */\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\", hosting: \"all\" },\n description: \"Register a custom HTTP route on the API.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n // Path parameters may be written `{orderId}` (API Gateway) or `:orderId` (the DI\n // router). Both are accepted and converted per consumer, see `routePath.ts`.\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // The `src` file must default-export a route HANDLER, the result of\n // `HttpRouteHandler.createImplementation` from `@webiny/event-handler-core`. It does\n // NOT declare its own method/path: the `HttpRouteDefinition` the router matches on is\n // generated below from the props here, so the route the gateway forwards to and the\n // route the router matches cannot drift apart.\n src: zodSrcPath({ project }),\n // Doubles as the route's DI name, so a decorator on HttpRouteDefinition can pick this\n // route out by it. Derived from path + method when omitted, same as the Pulumi name.\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const extensionsTsFolder = path.dirname(extensionsTsFilePath);\n const importPath = path\n .relative(extensionsTsFolder, absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Register an HttpRouteDefinition built from the props above. The router matches on\n // definitions and only then builds the handler, so registering the handler alone would\n // leave the route unreachable: the request reaches the API and dispatch finds nothing. The\n // path is converted to the router's `:param` syntax.\n const routerPath = toRouterPath(params.path);\n const routeName = params.routeName ?? deriveRouteName(params.path, params.method);\n const nameProperty = `name: ${JSON.stringify(routeName)},`;\n const registration = `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tctx.container.register(\\n\\t\\tcreateHttpRouteDefinition({\\n\\t\\t\\t${nameProperty}\\n\\t\\t\\tmethod: ${JSON.stringify(params.method)},\\n\\t\\t\\tpath: ${JSON.stringify(routerPath)},\\n\\t\\t\\thandler: ${alias}\\n\\t\\t})\\n\\t);\\n})`;\n\n /*\n * The workspace is regenerated before every build and watch, so a registration already in\n * the file comes from another `<Api.Route>` in the same config. The same route twice is\n * skipped. Two routes with one name would be two DI definitions a decorator can't tell\n * apart, and on AWS two API Gateway resources with one Pulumi name, so the build stops.\n */\n const sourceText = source.getFullText();\n // Whitespace is ignored: ts-morph re-indents an element when it inserts it.\n const compactSource = sourceText.replace(/\\s+/g, \"\");\n const compactRegistration = registration.replace(/\\s+/g, \"\");\n if (compactSource.includes(compactRegistration)) {\n return;\n }\n if (sourceText.includes(nameProperty)) {\n throw new Error(\n `Two \"Api.Route\" entries resolve to the route name \"${routeName}\". A derived name leaves out path parameters, so \"/orders\" and \"/orders/{id}\" collide; set \"routeName\" on one of them.`\n );\n }\n\n // One handler file may back several routes, so its import is added only once.\n if (!source.getImportDeclaration(importPath)) {\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n }\n\n ensureNamedImport(source, REGISTER_EXTENSION_PLUGIN_PATH, \"createRegisterExtensionPlugin\");\n ensureNamedImport(source, EVENT_HANDLER_CORE_PATH, \"createHttpRouteDefinition\");\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(registration);\n\n await source.save();\n }\n});\n"],"names":["HTTP_METHODS","REGISTER_EXTENSION_PLUGIN_PATH","EVENT_HANDLER_CORE_PATH","getImportInsertIndex","source","importDeclarations","lastImport","ensureNamedImport","moduleSpecifier","name","existing","namedImports","i","index","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","extensionsTsFolder","path","importPath","tsProject","Project","routerPath","toRouterPath","routeName","deriveRouteName","nameProperty","JSON","registration","sourceText","compactSource","compactRegistration","Error","pluginsArray","node","Node"],"mappings":";;;;;;;AAiBO,MAAMA,eAAe;IAAC;IAAU;IAAO;IAAQ;IAAS;IAAQ;IAAO;CAAU;AAExF,MAAMC,iCAAiC;AACvC,MAAMC,0BAA0B;AAGhC,MAAMC,uBAAuB,CAACC;IAC1B,MAAMC,qBAAqBD,OAAO,qBAAqB;IACvD,MAAME,aAAaD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;IACpE,IAAI,CAACC,YACD,OAAO;IAEX,OAAOA,WAAW,aAAa,KAAK;AACxC;AAOA,MAAMC,oBAAoB,CAACH,QAAoBI,iBAAyBC;IACpE,MAAMC,WAAWN,OAAO,oBAAoB,CAACI;IAC7C,IAAIE,UAAU;QACV,MAAMC,eAAeD,SAAS,eAAe;QAC7C,IAAI,CAACC,aAAa,IAAI,CAACC,CAAAA,IAAKA,EAAE,OAAO,OAAOH,OACxCC,SAAS,cAAc,CAACD;QAE5B;IACJ;IAEA,MAAMI,QAAQV,qBAAqBC;IACnCA,OAAO,uBAAuB,CAACS,OAAO;QAClC,cAAc;YAACJ;SAAK;QACpBD;IACJ;AACJ;AASO,MAAMM,WAAWC,gBAAgB;IACpC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;QAAO,SAAS;IAAM;IACpE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YAGZ,MAAMA,EAAE,MAAM,GAAG,UAAU,CAAC;YAC5B,QAAQA,CAAC,CAADA,OAAM,CAACjB;YAMf,KAAKkB,WAAW;gBAAEF;YAAQ;YAG1B,WAAWC,EAAE,MAAM,GAAG,QAAQ;QAClC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAME,sBAAsBC,qBAAqB,WAAW,CAACJ,OAAO,GAAG,EAAEC,IAAI,OAAO;QAGpF,MAAMI,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACN,OAAO,GAAG,EAAE,MAAM,CAAC;QACnE,MAAMO,QAAQ,CAAC,SAAS,EAAEF,KAAK,KAAK,CAAC,MAAM;QAE3C,MAAMG,qBAAqBC,KAAK,OAAO,CAACP;QACxC,MAAMQ,aAAaD,KAAAA,QACN,CAACD,oBAAoBL,qBAC7B,OAAO,CAAC,WAAW;QAExB,MAAMQ,YAAY,IAAIC;QACtBD,UAAU,mBAAmB,CAACT;QAC9B,MAAMjB,SAAS0B,UAAU,oBAAoB,CAACT;QAM9C,MAAMW,aAAaC,aAAad,OAAO,IAAI;QAC3C,MAAMe,YAAYf,OAAO,SAAS,IAAIgB,gBAAgBhB,OAAO,IAAI,EAAEA,OAAO,MAAM;QAChF,MAAMiB,eAAe,CAAC,MAAM,EAAEC,KAAK,SAAS,CAACH,WAAW,CAAC,CAAC;QAC1D,MAAMI,eAAe,CAAC,4GAA4G,EAAEF,aAAa,gBAAgB,EAAEC,KAAK,SAAS,CAAClB,OAAO,MAAM,EAAE,eAAe,EAAEkB,KAAK,SAAS,CAACL,YAAY,kBAAkB,EAAEN,MAAM,kBAAkB,CAAC;QAQ1R,MAAMa,aAAanC,OAAO,WAAW;QAErC,MAAMoC,gBAAgBD,WAAW,OAAO,CAAC,QAAQ;QACjD,MAAME,sBAAsBH,aAAa,OAAO,CAAC,QAAQ;QACzD,IAAIE,cAAc,QAAQ,CAACC,sBACvB;QAEJ,IAAIF,WAAW,QAAQ,CAACH,eACpB,MAAM,IAAIM,MACN,CAAC,mDAAmD,EAAER,UAAU,sHAAsH,CAAC;QAK/L,IAAI,CAAC9B,OAAO,oBAAoB,CAACyB,aAAa;YAC1C,MAAMhB,QAAQV,qBAAqBC;YACnCA,OAAO,uBAAuB,CAACS,OAAO;gBAClC,eAAea;gBACf,iBAAiBG;YACrB;QACJ;QAEAtB,kBAAkBH,QAAQH,gCAAgC;QAC1DM,kBAAkBH,QAAQF,yBAAyB;QAEnD,MAAMyC,eAAevC,OAAO,kBAAkB,CAACwC,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CAACL;QAExB,MAAMlC,OAAO,IAAI;IACrB;AACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `path` prop on `<Api.Route>` feeds two consumers that spell path parameters differently:
|
|
3
|
+
* API Gateway wants `{orderId}`, the DI `HttpRouter` wants `:orderId`. Rather than pick a winner and
|
|
4
|
+
* break whichever projects already used the other, accept both and convert per consumer. The API
|
|
5
|
+
* Gateway conversion lives in `@webiny/project-aws` (`toApiGatewayPath.ts`), the only package that
|
|
6
|
+
* creates API Gateway routes, next to the CloudFront one (`toCloudFrontPathPattern.ts`) that routes a
|
|
7
|
+
* path to the web function.
|
|
8
|
+
*
|
|
9
|
+
* Wildcards are left alone. `HttpRouter` matches a trailing `/*`, API Gateway spells the same thing
|
|
10
|
+
* `{proxy+}`, and translating between them changes what the route captures — so a wildcard route
|
|
11
|
+
* has to be written for the target it's aimed at.
|
|
12
|
+
*/
|
|
13
|
+
/** `/orders/{orderId}` → `/orders/:orderId`. Already-colon segments pass through. */
|
|
14
|
+
export declare function toRouterPath(path: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* `/asd/{id}/xs` + POST → `asd-xs-post`. Handles either parameter syntax.
|
|
17
|
+
*
|
|
18
|
+
* Used for BOTH the Pulumi resource name and the route's DI name, so the name a decorator matches
|
|
19
|
+
* on is the same one that shows up in infrastructure.
|
|
20
|
+
*/
|
|
21
|
+
export declare function deriveRouteName(routePath: string, method: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function toRouterPath(path) {
|
|
2
|
+
return path.replace(/\{([^}]+)\}/g, (_match, name)=>`:${name}`);
|
|
3
|
+
}
|
|
4
|
+
function deriveRouteName(routePath, method) {
|
|
5
|
+
const pathPart = routePath.replace(/^\//, "").replace(/\{[^}]*\}/g, "").replace(/(^|\/):[^/]+/g, "$1").replace(/\/+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
6
|
+
return `${pathPart}-${method.toLowerCase()}`;
|
|
7
|
+
}
|
|
8
|
+
export { deriveRouteName, toRouterPath };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=routePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/api/Route/routePath.js","sources":["../../../../src/extensions/api/Route/routePath.ts"],"sourcesContent":["/**\n * The `path` prop on `<Api.Route>` feeds two consumers that spell path parameters differently:\n * API Gateway wants `{orderId}`, the DI `HttpRouter` wants `:orderId`. Rather than pick a winner and\n * break whichever projects already used the other, accept both and convert per consumer. The API\n * Gateway conversion lives in `@webiny/project-aws` (`toApiGatewayPath.ts`), the only package that\n * creates API Gateway routes, next to the CloudFront one (`toCloudFrontPathPattern.ts`) that routes a\n * path to the web function.\n *\n * Wildcards are left alone. `HttpRouter` matches a trailing `/*`, API Gateway spells the same thing\n * `{proxy+}`, and translating between them changes what the route captures — so a wildcard route\n * has to be written for the target it's aimed at.\n */\n\n/** `/orders/{orderId}` → `/orders/:orderId`. Already-colon segments pass through. */\nexport function toRouterPath(path: string): string {\n return path.replace(/\\{([^}]+)\\}/g, (_match, name: string) => {\n return `:${name}`;\n });\n}\n\n/**\n * `/asd/{id}/xs` + POST → `asd-xs-post`. Handles either parameter syntax.\n *\n * Used for BOTH the Pulumi resource name and the route's DI name, so the name a decorator matches\n * on is the same one that shows up in infrastructure.\n */\nexport function deriveRouteName(routePath: string, method: string): string {\n // /asd/{id}/xs + POST → asd-xs-post. Strips parameters in either syntax.\n const pathPart = routePath\n .replace(/^\\//, \"\")\n .replace(/\\{[^}]*\\}/g, \"\")\n .replace(/(^|\\/):[^/]+/g, \"$1\")\n .replace(/\\/+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .toLowerCase();\n\n return `${pathPart}-${method.toLowerCase()}`;\n}\n"],"names":["toRouterPath","path","_match","name","deriveRouteName","routePath","method","pathPart"],"mappings":"AAcO,SAASA,aAAaC,IAAY;IACrC,OAAOA,KAAK,OAAO,CAAC,gBAAgB,CAACC,QAAQC,OAClC,CAAC,CAAC,EAAEA,MAAM;AAEzB;AAQO,SAASC,gBAAgBC,SAAiB,EAAEC,MAAc;IAE7D,MAAMC,WAAWF,UACZ,OAAO,CAAC,OAAO,IACf,OAAO,CAAC,cAAc,IACtB,OAAO,CAAC,iBAAiB,MACzB,OAAO,CAAC,QAAQ,KAChB,OAAO,CAAC,YAAY,IACpB,WAAW;IAEhB,OAAO,GAAGE,SAAS,CAAC,EAAED,OAAO,WAAW,IAAI;AAChD"}
|
package/extensions/api/index.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
export * from "./AdminAfterBuild.js";
|
|
2
|
-
export * from "./AdminAfterDeploy.js";
|
|
3
2
|
export * from "./AdminBeforeBuild.js";
|
|
4
|
-
export * from "./AdminBeforeDeploy.js";
|
|
5
3
|
export * from "./AdminBeforeWatch.js";
|
|
6
4
|
export * from "./AfterBuild.js";
|
|
7
|
-
export * from "./AfterDeploy.js";
|
|
8
5
|
export * from "./ApiAfterBuild.js";
|
|
9
|
-
export * from "./ApiAfterDeploy.js";
|
|
10
6
|
export * from "./ApiBeforeBuild.js";
|
|
11
|
-
export * from "./ApiBeforeDeploy.js";
|
|
12
7
|
export * from "./ApiBeforeWatch.js";
|
|
13
8
|
export * from "./BeforeBuild.js";
|
|
14
|
-
export * from "./BeforeDeploy.js";
|
|
15
9
|
export * from "./BeforeWatch.js";
|
|
16
10
|
export * from "./CoreAfterBuild.js";
|
|
17
|
-
export * from "./CoreAfterDeploy.js";
|
|
18
11
|
export * from "./CoreBeforeBuild.js";
|
|
19
|
-
export * from "./CoreBeforeDeploy.js";
|
|
20
12
|
export * from "./CoreBeforeWatch.js";
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
export * from "./AdminAfterBuild.js";
|
|
2
|
-
export * from "./AdminAfterDeploy.js";
|
|
3
2
|
export * from "./AdminBeforeBuild.js";
|
|
4
|
-
export * from "./AdminBeforeDeploy.js";
|
|
5
3
|
export * from "./AdminBeforeWatch.js";
|
|
6
4
|
export * from "./AfterBuild.js";
|
|
7
|
-
export * from "./AfterDeploy.js";
|
|
8
5
|
export * from "./ApiAfterBuild.js";
|
|
9
|
-
export * from "./ApiAfterDeploy.js";
|
|
10
6
|
export * from "./ApiBeforeBuild.js";
|
|
11
|
-
export * from "./ApiBeforeDeploy.js";
|
|
12
7
|
export * from "./ApiBeforeWatch.js";
|
|
13
8
|
export * from "./BeforeBuild.js";
|
|
14
|
-
export * from "./BeforeDeploy.js";
|
|
15
9
|
export * from "./BeforeWatch.js";
|
|
16
10
|
export * from "./CoreAfterBuild.js";
|
|
17
|
-
export * from "./CoreAfterDeploy.js";
|
|
18
11
|
export * from "./CoreBeforeBuild.js";
|
|
19
|
-
export * from "./CoreBeforeDeploy.js";
|
|
20
12
|
export * from "./CoreBeforeWatch.js";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Some extensions need code from a hosting package when they render. For example,
|
|
4
|
-
* `Infra.OpenSearch` renders
|
|
5
|
-
* namespaces can't depend on. The hosting package registers its component for the extension
|
|
6
|
-
* (`registerExtensionImplementation`), and every component created with `defineExtension` for
|
|
7
|
-
* type renders the registered one in projects of that hosting type
|
|
4
|
+
* `Infra.OpenSearch` renders infrastructure hooks that live in `@webiny/project-aws`, which the
|
|
5
|
+
* shared namespaces can't depend on. The hosting package registers its component for the extension
|
|
6
|
+
* type (`registerExtensionImplementation`), and every component created with `defineExtension` for
|
|
7
|
+
* that type renders the registered one in projects of that hosting type
|
|
8
|
+
* (`getExtensionImplementation`).
|
|
8
9
|
*
|
|
9
10
|
* Keyed by hosting type and extension type: a type can have a registered implementation in one
|
|
10
11
|
* hosting type and none in the other, e.g. `Project/OpenSearch` in AWS only.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hosting/extensionImplementations.js","sources":["../../../src/extensions/hosting/extensionImplementations.ts"],"sourcesContent":["import type React from \"react\";\n\n/**\n * Some extensions need code from a hosting package when they render. For example,\n * `Infra.OpenSearch` renders
|
|
1
|
+
{"version":3,"file":"extensions/hosting/extensionImplementations.js","sources":["../../../src/extensions/hosting/extensionImplementations.ts"],"sourcesContent":["import type React from \"react\";\n\n/**\n * Some extensions need code from a hosting package when they render. For example,\n * `Infra.OpenSearch` renders infrastructure hooks that live in `@webiny/project-aws`, which the\n * shared namespaces can't depend on. The hosting package registers its component for the extension\n * type (`registerExtensionImplementation`), and every component created with `defineExtension` for\n * that type renders the registered one in projects of that hosting type\n * (`getExtensionImplementation`).\n *\n * Keyed by hosting type and extension type: a type can have a registered implementation in one\n * hosting type and none in the other, e.g. `Project/OpenSearch` in AWS only.\n */\nexport const extensionImplementations = new Map<string, React.ComponentType<any>>();\n"],"names":["extensionImplementations","Map"],"mappings":"AAaO,MAAMA,2BAA2B,IAAIC"}
|
package/extensions/index.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import { AdminApiUrl } from "./AdminApiUrl.js";
|
|
|
13
13
|
import { AdminWebsocketsUrl } from "./AdminWebsocketsUrl.js";
|
|
14
14
|
import { AdminExtension } from "./AdminExtension.js";
|
|
15
15
|
import { ApiExtension } from "./ApiExtension.js";
|
|
16
|
-
import { AdminAfterBuild,
|
|
17
|
-
import { ProductionEnvironments
|
|
16
|
+
import { AdminAfterBuild, AdminBeforeBuild, AdminBeforeWatch, AfterBuild, BeforeWatch, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, BeforeBuild, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch } from "./hooks/index.js";
|
|
17
|
+
import { ProductionEnvironments } from "./ProductionEnvironments.js";
|
|
18
18
|
export { Telemetry };
|
|
19
19
|
export { ProjectId };
|
|
20
20
|
export { ProjectDecorator };
|
|
@@ -31,33 +31,20 @@ export { AdminWebsocketsUrl };
|
|
|
31
31
|
export { AdminExtension };
|
|
32
32
|
export { ApiExtension };
|
|
33
33
|
export { BeforeBuild };
|
|
34
|
-
export { BeforeDeploy };
|
|
35
34
|
export { BeforeWatch };
|
|
36
35
|
export { AfterBuild };
|
|
37
|
-
export { AfterDeploy };
|
|
38
36
|
export { AdminBeforeBuild };
|
|
39
|
-
export { AdminBeforeDeploy };
|
|
40
37
|
export { AdminBeforeWatch };
|
|
41
38
|
export { AdminAfterBuild };
|
|
42
|
-
export { AdminAfterDeploy };
|
|
43
39
|
export { ApiBeforeBuild };
|
|
44
|
-
export { ApiBeforeDeploy };
|
|
45
40
|
export { ApiBeforeWatch };
|
|
46
41
|
export { ApiAfterBuild };
|
|
47
|
-
export { ApiAfterDeploy };
|
|
48
42
|
export { CoreBeforeBuild };
|
|
49
|
-
export { CoreBeforeDeploy };
|
|
50
43
|
export { CoreBeforeWatch };
|
|
51
44
|
export { CoreAfterBuild };
|
|
52
|
-
export { CoreAfterDeploy };
|
|
53
|
-
export { PulumiResourceNamePrefix };
|
|
54
45
|
export { ProductionEnvironments };
|
|
55
46
|
export declare const definitions: (import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
56
|
-
prefix: import("zod").ZodString;
|
|
57
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
58
47
|
environments: import("zod").ZodArray<import("zod").ZodString>;
|
|
59
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
60
|
-
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
61
48
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
62
49
|
paramName: import("zod").ZodString;
|
|
63
50
|
value: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny>, import("zod").ZodNumber, import("zod").ZodBoolean]>;
|
|
@@ -106,9 +93,13 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
106
93
|
id: import("zod").ZodString;
|
|
107
94
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
108
95
|
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
96
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
97
|
+
url: import("zod").ZodString;
|
|
109
98
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
110
99
|
varName: import("zod").ZodString;
|
|
111
100
|
value: import("zod").ZodString;
|
|
101
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
102
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
112
103
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
113
104
|
token: import("zod").ZodOptional<import("zod").ZodString>;
|
|
114
105
|
repository: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -118,9 +109,8 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
118
109
|
ddb: "ddb";
|
|
119
110
|
"ddb+es": "ddb+es";
|
|
120
111
|
"ddb+os": "ddb+os";
|
|
112
|
+
pg: "pg";
|
|
121
113
|
}>;
|
|
122
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
123
|
-
url: import("zod").ZodString;
|
|
124
114
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
125
115
|
retentionDays: import("zod").ZodNumber;
|
|
126
116
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
package/extensions/index.js
CHANGED
|
@@ -13,9 +13,9 @@ import { AdminApiUrl } from "./AdminApiUrl.js";
|
|
|
13
13
|
import { AdminWebsocketsUrl } from "./AdminWebsocketsUrl.js";
|
|
14
14
|
import { AdminExtension } from "./AdminExtension.js";
|
|
15
15
|
import { ApiExtension } from "./ApiExtension.js";
|
|
16
|
-
import { BackgroundTasks, ModelFieldCompression, Smtp } from "./api/index.js";
|
|
17
|
-
import { AdminAfterBuild,
|
|
18
|
-
import { ProductionEnvironments
|
|
16
|
+
import { ApiRoute, BackgroundTasks, ModelFieldCompression, Smtp } from "./api/index.js";
|
|
17
|
+
import { AdminAfterBuild, AdminBeforeBuild, AdminBeforeWatch, AfterBuild, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, BeforeBuild, BeforeWatch, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch } from "./hooks/index.js";
|
|
18
|
+
import { ProductionEnvironments } from "./ProductionEnvironments.js";
|
|
19
19
|
export * from "../defineExtension/index.js";
|
|
20
20
|
const definitions = [
|
|
21
21
|
Telemetry.def,
|
|
@@ -27,26 +27,17 @@ const definitions = [
|
|
|
27
27
|
FeatureFlags.def,
|
|
28
28
|
BugReporter.def,
|
|
29
29
|
AdminAfterBuild.def,
|
|
30
|
-
AdminAfterDeploy.def,
|
|
31
30
|
BeforeBuild.def,
|
|
32
|
-
BeforeDeploy.def,
|
|
33
31
|
BeforeWatch.def,
|
|
34
32
|
AfterBuild.def,
|
|
35
|
-
AfterDeploy.def,
|
|
36
33
|
AdminBeforeBuild.def,
|
|
37
|
-
AdminBeforeDeploy.def,
|
|
38
34
|
AdminBeforeWatch.def,
|
|
39
35
|
ApiAfterBuild.def,
|
|
40
|
-
ApiAfterDeploy.def,
|
|
41
36
|
ApiBeforeBuild.def,
|
|
42
|
-
ApiBeforeDeploy.def,
|
|
43
37
|
ApiBeforeWatch.def,
|
|
44
38
|
CoreAfterBuild.def,
|
|
45
|
-
CoreAfterDeploy.def,
|
|
46
39
|
CoreBeforeBuild.def,
|
|
47
|
-
CoreBeforeDeploy.def,
|
|
48
40
|
CoreBeforeWatch.def,
|
|
49
|
-
PulumiResourceNamePrefix.def,
|
|
50
41
|
ProductionEnvironments.def,
|
|
51
42
|
DatabaseSetup.def,
|
|
52
43
|
BuildParam.def,
|
|
@@ -55,11 +46,12 @@ const definitions = [
|
|
|
55
46
|
AdminWebsocketsUrl.def,
|
|
56
47
|
AdminExtension.def,
|
|
57
48
|
ApiExtension.def,
|
|
49
|
+
ApiRoute.def,
|
|
58
50
|
BackgroundTasks.def,
|
|
59
51
|
ModelFieldCompression.def,
|
|
60
52
|
Smtp.def
|
|
61
53
|
];
|
|
62
54
|
export { Project } from "./Project.js";
|
|
63
|
-
export { AdminAfterBuild,
|
|
55
|
+
export { AdminAfterBuild, AdminApiUrl, AdminBeforeBuild, AdminBeforeWatch, AdminBuildParam, AdminExtension, AdminWebsocketsUrl, AfterBuild, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, ApiExtension, BeforeBuild, BeforeWatch, BugReporter, BuildParam, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch, DatabaseSetup, EnvVar, ExtensionDefinitions, FeatureFlags, ProductionEnvironments, ProjectDecorator, ProjectId, ProjectImplementation, Telemetry, definitions };
|
|
64
56
|
|
|
65
57
|
//# sourceMappingURL=index.js.map
|
package/extensions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BugReporter } from \"./BugReporter.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminApiUrl } from \"./AdminApiUrl.js\";\nimport { AdminWebsocketsUrl } from \"./AdminWebsocketsUrl.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { BackgroundTasks } from \"./api/index.js\";\nimport { ModelFieldCompression } from \"./api/index.js\";\nimport { Smtp } from \"./api/index.js\";\n\n// Hooks.\nimport {\n AdminAfterBuild,\n
|
|
1
|
+
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BugReporter } from \"./BugReporter.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminApiUrl } from \"./AdminApiUrl.js\";\nimport { AdminWebsocketsUrl } from \"./AdminWebsocketsUrl.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { ApiRoute } from \"./api/index.js\";\nimport { BackgroundTasks } from \"./api/index.js\";\nimport { ModelFieldCompression } from \"./api/index.js\";\nimport { Smtp } from \"./api/index.js\";\n\n// Hooks.\nimport {\n AdminAfterBuild,\n AdminBeforeBuild,\n AdminBeforeWatch,\n AfterBuild,\n BeforeWatch,\n ApiAfterBuild,\n ApiBeforeBuild,\n ApiBeforeWatch,\n BeforeBuild,\n CoreAfterBuild,\n CoreBeforeBuild,\n CoreBeforeWatch\n} from \"./hooks/index.js\";\n\nimport { ProductionEnvironments } from \"./ProductionEnvironments.js\";\n\n// Exports.\nexport { Telemetry };\nexport { ProjectId };\nexport { ProjectDecorator };\nexport { ProjectImplementation };\nexport { ExtensionDefinitions };\nexport { EnvVar };\nexport { FeatureFlags };\nexport { BugReporter };\nexport { DatabaseSetup };\nexport { BuildParam };\nexport { AdminBuildParam };\nexport { AdminApiUrl };\nexport { AdminWebsocketsUrl };\nexport { AdminExtension };\nexport { ApiExtension };\n\n// Hooks.\nexport { BeforeBuild };\nexport { BeforeWatch };\nexport { AfterBuild };\nexport { AdminBeforeBuild };\nexport { AdminBeforeWatch };\nexport { AdminAfterBuild };\nexport { ApiBeforeBuild };\nexport { ApiBeforeWatch };\nexport { ApiAfterBuild };\nexport { CoreBeforeBuild };\nexport { CoreBeforeWatch };\nexport { CoreAfterBuild };\n\nexport { ProductionEnvironments };\n\n// Definitions (used internally). 👇\nexport const definitions = [\n Telemetry.def,\n ProjectId.def,\n ProjectDecorator.def,\n ProjectImplementation.def,\n ExtensionDefinitions.def,\n EnvVar.def,\n FeatureFlags.def,\n BugReporter.def,\n\n // Hooks.\n AdminAfterBuild.def,\n BeforeBuild.def,\n BeforeWatch.def,\n AfterBuild.def,\n AdminBeforeBuild.def,\n AdminBeforeWatch.def,\n ApiAfterBuild.def,\n ApiBeforeBuild.def,\n ApiBeforeWatch.def,\n CoreAfterBuild.def,\n CoreBeforeBuild.def,\n CoreBeforeWatch.def,\n\n ProductionEnvironments.def,\n DatabaseSetup.def,\n BuildParam.def,\n AdminBuildParam.def,\n AdminApiUrl.def,\n AdminWebsocketsUrl.def,\n AdminExtension.def,\n ApiExtension.def,\n ApiRoute.def,\n\n // Api settings that apply to every hosting type.\n BackgroundTasks.def,\n ModelFieldCompression.def,\n Smtp.def\n];\n\nexport { Project } from \"./Project.js\";\n\nexport * from \"../defineExtension/index.js\";\n"],"names":["definitions","Telemetry","ProjectId","ProjectDecorator","ProjectImplementation","ExtensionDefinitions","EnvVar","FeatureFlags","BugReporter","AdminAfterBuild","BeforeBuild","BeforeWatch","AfterBuild","AdminBeforeBuild","AdminBeforeWatch","ApiAfterBuild","ApiBeforeBuild","ApiBeforeWatch","CoreAfterBuild","CoreBeforeBuild","CoreBeforeWatch","ProductionEnvironments","DatabaseSetup","BuildParam","AdminBuildParam","AdminApiUrl","AdminWebsocketsUrl","AdminExtension","ApiExtension","ApiRoute","BackgroundTasks","ModelFieldCompression","Smtp"],"mappings":";;;;;;;;;;;;;;;;;;;AAwEO,MAAMA,cAAc;IACvBC,UAAU,GAAG;IACbC,UAAU,GAAG;IACbC,iBAAiB,GAAG;IACpBC,sBAAsB,GAAG;IACzBC,qBAAqB,GAAG;IACxBC,OAAO,GAAG;IACVC,aAAa,GAAG;IAChBC,YAAY,GAAG;IAGfC,gBAAgB,GAAG;IACnBC,YAAY,GAAG;IACfC,YAAY,GAAG;IACfC,WAAW,GAAG;IACdC,iBAAiB,GAAG;IACpBC,iBAAiB,GAAG;IACpBC,cAAc,GAAG;IACjBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,gBAAgB,GAAG;IACnBC,gBAAgB,GAAG;IAEnBC,uBAAuB,GAAG;IAC1BC,cAAc,GAAG;IACjBC,WAAW,GAAG;IACdC,gBAAgB,GAAG;IACnBC,YAAY,GAAG;IACfC,mBAAmB,GAAG;IACtBC,eAAe,GAAG;IAClBC,aAAa,GAAG;IAChBC,SAAS,GAAG;IAGZC,gBAAgB,GAAG;IACnBC,sBAAsB,GAAG;IACzBC,KAAK,GAAG;CACX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { GetProductionEnvironments, GetProjectConfigService } from "../../abstractions/index.js";
|
|
3
|
-
import { ProductionEnvironments } from "../../extensions/
|
|
3
|
+
import { ProductionEnvironments } from "../../extensions/ProductionEnvironments.js";
|
|
4
4
|
class DefaultGetProductionEnvironments {
|
|
5
5
|
constructor(getProjectConfigService){
|
|
6
6
|
this.getProjectConfigService = getProjectConfigService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/GetProductionEnvironments/GetProductionEnvironments.js","sources":["../../../src/features/GetProductionEnvironments/GetProductionEnvironments.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetProductionEnvironments, GetProjectConfigService } from \"~/abstractions/index.js\";\nimport { ProductionEnvironments as ProductionEnvironmentsExtension } from \"~/extensions/
|
|
1
|
+
{"version":3,"file":"features/GetProductionEnvironments/GetProductionEnvironments.js","sources":["../../../src/features/GetProductionEnvironments/GetProductionEnvironments.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetProductionEnvironments, GetProjectConfigService } from \"~/abstractions/index.js\";\nimport { ProductionEnvironments as ProductionEnvironmentsExtension } from \"~/extensions/ProductionEnvironments.js\";\n\nexport class DefaultGetProductionEnvironments implements GetProductionEnvironments.Interface {\n constructor(private getProjectConfigService: GetProjectConfigService.Interface) {}\n\n async execute() {\n const projectConfig = await this.getProjectConfigService.execute();\n\n let productionEnvironments = [\"prod\", \"production\"];\n const [productionEnvironmentsExt] = projectConfig.extensionsByType(\n ProductionEnvironmentsExtension\n );\n\n if (productionEnvironmentsExt) {\n productionEnvironments = [\n ...productionEnvironments,\n ...productionEnvironmentsExt.params.environments\n ];\n }\n\n // Ensure uniqueness.\n return Array.from(new Set(productionEnvironments)).sort();\n }\n}\n\nexport const getProductionEnvironments = createImplementation({\n abstraction: GetProductionEnvironments,\n implementation: DefaultGetProductionEnvironments,\n dependencies: [GetProjectConfigService]\n});\n"],"names":["DefaultGetProductionEnvironments","getProjectConfigService","projectConfig","productionEnvironments","productionEnvironmentsExt","ProductionEnvironmentsExtension","Array","Set","getProductionEnvironments","createImplementation","GetProductionEnvironments","GetProjectConfigService"],"mappings":";;;AAIO,MAAMA;IACT,YAAoBC,uBAA0D,CAAE;aAA5DA,uBAAuB,GAAvBA;IAA6D;IAEjF,MAAM,UAAU;QACZ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAEhE,IAAIC,yBAAyB;YAAC;YAAQ;SAAa;QACnD,MAAM,CAACC,0BAA0B,GAAGF,cAAc,gBAAgB,CAC9DG;QAGJ,IAAID,2BACAD,yBAAyB;eAClBA;eACAC,0BAA0B,MAAM,CAAC,YAAY;SACnD;QAIL,OAAOE,MAAM,IAAI,CAAC,IAAIC,IAAIJ,yBAAyB,IAAI;IAC3D;AACJ;AAEO,MAAMK,4BAA4BC,qBAAqB;IAC1D,aAAaC;IACb,gBAAgBV;IAChB,cAAc;QAACW;KAAwB;AAC3C"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
export * from "./AdminAfterBuild/index.js";
|
|
2
|
-
export * from "./AdminAfterDeploy/index.js";
|
|
3
2
|
export * from "./AdminBeforeBuild/index.js";
|
|
4
|
-
export * from "./AdminBeforeDeploy/index.js";
|
|
5
3
|
export * from "./AdminBeforeWatch/index.js";
|
|
6
4
|
export * from "./AfterBuild/index.js";
|
|
7
|
-
export * from "./AfterDeploy/index.js";
|
|
8
|
-
export * from "./BeforeDeploy/index.js";
|
|
9
5
|
export * from "./ApiAfterBuild/index.js";
|
|
10
|
-
export * from "./ApiAfterDeploy/index.js";
|
|
11
6
|
export * from "./ApiBeforeBuild/index.js";
|
|
12
|
-
export * from "./ApiBeforeDeploy/index.js";
|
|
13
7
|
export * from "./ApiBeforeWatch/index.js";
|
|
14
8
|
export * from "./BeforeBuild/index.js";
|
|
15
9
|
export * from "./BeforeWatch/index.js";
|
|
16
10
|
export * from "./CoreAfterBuild/index.js";
|
|
17
|
-
export * from "./CoreAfterDeploy/index.js";
|
|
18
11
|
export * from "./CoreBeforeBuild/index.js";
|
|
19
|
-
export * from "./CoreBeforeDeploy/index.js";
|
|
20
12
|
export * from "./CoreBeforeWatch/index.js";
|