@webiny/project 6.6.0-alpha.1 → 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/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/components/FeatureFlag.d.ts +9 -4
- package/components/FeatureFlag.js +6 -7
- package/components/FeatureFlag.js.map +1 -1
- package/createProjectSdkContainer.js +23 -12
- package/createProjectSdkContainer.js.map +1 -1
- package/decorators/GetFeatureFlagsWithLicense.js +1 -0
- package/decorators/GetFeatureFlagsWithLicense.js.map +1 -1
- package/decorators/index.d.ts +0 -6
- package/decorators/index.js +0 -6
- package/defineExtension/createExtensionReactComponent.js +9 -1
- package/defineExtension/createExtensionReactComponent.js.map +1 -1
- package/defineExtension/types.d.ts +7 -2
- 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/AdminApiUrl.js +2 -1
- package/extensions/AdminApiUrl.js.map +1 -1
- package/extensions/AdminBuildParam.js +5 -5
- package/extensions/AdminBuildParam.js.map +1 -1
- package/extensions/AdminExtension.d.ts +1 -1
- package/extensions/AdminExtension.js +6 -5
- package/extensions/AdminExtension.js.map +1 -1
- package/extensions/AdminWebsocketsUrl.d.ts +1 -1
- package/extensions/AdminWebsocketsUrl.js +2 -1
- package/extensions/AdminWebsocketsUrl.js.map +1 -1
- package/extensions/ApiBuildParam.js +11 -10
- package/extensions/ApiBuildParam.js.map +1 -1
- package/extensions/ApiExtension.d.ts +1 -1
- package/extensions/ApiExtension.js +8 -5
- package/extensions/ApiExtension.js.map +1 -1
- package/extensions/BugReporter.d.ts +6 -0
- package/extensions/BugReporter.js +34 -0
- package/extensions/BugReporter.js.map +1 -0
- package/extensions/DatabaseSetup.js +2 -1
- package/extensions/DatabaseSetup.js.map +1 -1
- package/extensions/EnvVar.js +2 -1
- package/extensions/EnvVar.js.map +1 -1
- package/extensions/ExtensionDefinitions.js +2 -1
- package/extensions/ExtensionDefinitions.js.map +1 -1
- package/extensions/FeatureFlags.d.ts +7 -1
- package/extensions/FeatureFlags.js +12 -2
- package/extensions/FeatureFlags.js.map +1 -1
- package/extensions/{pulumi/ProductionEnvironments.js → ProductionEnvironments.js} +4 -3
- package/extensions/ProductionEnvironments.js.map +1 -0
- package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
- package/extensions/Project/showConfigChangeNotice.d.ts +1 -1
- package/extensions/Project/showConfigChangeNotice.js.map +1 -1
- package/extensions/ProjectDecorator.js +2 -1
- package/extensions/ProjectDecorator.js.map +1 -1
- package/extensions/ProjectId.js +2 -1
- package/extensions/ProjectId.js.map +1 -1
- package/extensions/ProjectImplementation.js +2 -1
- package/extensions/ProjectImplementation.js.map +1 -1
- package/extensions/Telemetry.js +2 -1
- package/extensions/Telemetry.js.map +1 -1
- package/extensions/api/BackgroundTasks.d.ts +4 -0
- package/extensions/api/BackgroundTasks.js +25 -0
- package/extensions/api/BackgroundTasks.js.map +1 -0
- package/extensions/api/Cms/ModelFieldCompression.d.ts +4 -0
- package/extensions/api/Cms/ModelFieldCompression.js +25 -0
- package/extensions/api/Cms/ModelFieldCompression.js.map +1 -0
- package/extensions/api/Mailer/Smtp.d.ts +8 -0
- package/extensions/api/Mailer/Smtp.js +22 -0
- package/extensions/api/Mailer/Smtp.js.map +1 -0
- package/extensions/api/Mailer/Smtp.test.js +127 -0
- package/extensions/api/Mailer/Smtp.test.js.map +1 -0
- package/extensions/api/Mailer/SmtpParamsSchema.d.ts +9 -0
- package/extensions/api/Mailer/SmtpParamsSchema.js +17 -0
- package/extensions/api/Mailer/SmtpParamsSchema.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 +20 -0
- package/extensions/api/Route/routePath.js +10 -0
- package/extensions/api/Route/routePath.js.map +1 -0
- package/extensions/api/index.d.ts +5 -0
- package/extensions/api/index.js +5 -0
- package/extensions/hasDefaultExport.d.ts +2 -0
- package/extensions/hasDefaultExport.js +17 -0
- package/extensions/hasDefaultExport.js.map +1 -0
- package/extensions/hooks/AdminAfterBuild.js +2 -1
- package/extensions/hooks/AdminAfterBuild.js.map +1 -1
- package/extensions/hooks/AdminBeforeBuild.js +2 -1
- package/extensions/hooks/AdminBeforeBuild.js.map +1 -1
- package/extensions/hooks/AdminBeforeWatch.js +2 -1
- package/extensions/hooks/AdminBeforeWatch.js.map +1 -1
- package/extensions/hooks/AfterBuild.js +2 -1
- package/extensions/hooks/AfterBuild.js.map +1 -1
- package/extensions/hooks/ApiAfterBuild.js +2 -1
- package/extensions/hooks/ApiAfterBuild.js.map +1 -1
- package/extensions/hooks/ApiBeforeBuild.js +2 -1
- package/extensions/hooks/ApiBeforeBuild.js.map +1 -1
- package/extensions/hooks/ApiBeforeWatch.js +2 -1
- package/extensions/hooks/ApiBeforeWatch.js.map +1 -1
- package/extensions/hooks/BeforeBuild.js +2 -1
- package/extensions/hooks/BeforeBuild.js.map +1 -1
- package/extensions/hooks/BeforeWatch.js +2 -1
- package/extensions/hooks/BeforeWatch.js.map +1 -1
- package/extensions/hooks/CoreAfterBuild.js +2 -1
- package/extensions/hooks/CoreAfterBuild.js.map +1 -1
- package/extensions/hooks/CoreBeforeBuild.js +2 -1
- package/extensions/hooks/CoreBeforeBuild.js.map +1 -1
- package/extensions/hooks/CoreBeforeWatch.js +2 -1
- package/extensions/hooks/CoreBeforeWatch.js.map +1 -1
- package/extensions/hooks/index.d.ts +0 -8
- package/extensions/hooks/index.js +0 -8
- package/extensions/hosting/assertHostingType.d.ts +13 -0
- package/extensions/hosting/assertHostingType.js +12 -0
- package/extensions/hosting/assertHostingType.js.map +1 -0
- package/extensions/hosting/extensionImplementations.d.ts +13 -0
- package/extensions/hosting/extensionImplementations.js +4 -0
- package/extensions/hosting/extensionImplementations.js.map +1 -0
- package/extensions/hosting/getExtensionImplementation.d.ts +1 -0
- package/extensions/hosting/getExtensionImplementation.js +9 -0
- package/extensions/hosting/getExtensionImplementation.js.map +1 -0
- package/extensions/hosting/hostingType.d.ts +2 -0
- package/extensions/hosting/hostingType.js +0 -0
- package/extensions/hosting/index.d.ts +4 -0
- package/extensions/hosting/index.js +4 -0
- package/extensions/hosting/registerExtensionImplementation.d.ts +12 -0
- package/extensions/hosting/registerExtensionImplementation.js +13 -0
- package/extensions/hosting/registerExtensionImplementation.js.map +1 -0
- package/extensions/index.d.ts +26 -39
- package/extensions/index.js +10 -21
- package/extensions/index.js.map +1 -1
- package/extensions/infra/Env.js +5 -0
- package/extensions/infra/Env.js.map +1 -1
- package/features/GetProductionEnvironments/GetProductionEnvironments.js +1 -1
- package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
- package/features/Serve/Serve.d.ts +1 -1
- package/features/Serve/Serve.js.map +1 -1
- package/features/Watch/watchers/worker.js +3 -0
- package/features/Watch/watchers/worker.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 +29 -34
- package/services/GetAppService/GetAppService.js +1 -3
- package/services/GetAppService/GetAppService.js.map +1 -1
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.d.ts +15 -0
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js +23 -0
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js.map +1 -0
- package/services/GetProjectConfigService/EnvContext.d.ts +3 -2
- package/services/GetProjectConfigService/EnvContext.js +4 -6
- package/services/GetProjectConfigService/EnvContext.js.map +1 -1
- package/services/GetProjectConfigService/GetProjectConfigService.js +14 -11
- package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
- package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js +1 -0
- package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js.map +1 -1
- package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
- package/services/GetProjectConfigService/getRenderCacheKey.d.ts +1 -0
- package/services/GetProjectConfigService/getRenderCacheKey.js +13 -0
- package/services/GetProjectConfigService/getRenderCacheKey.js.map +1 -0
- package/services/GetProjectConfigService/nullRenderer.d.ts +4 -0
- package/services/GetProjectConfigService/nullRenderer.js +83 -0
- package/services/GetProjectConfigService/nullRenderer.js.map +1 -0
- package/services/GetProjectConfigService/renderConfig.d.ts +3 -12
- package/services/GetProjectConfigService/renderConfig.js +10 -35
- package/services/GetProjectConfigService/renderConfig.js.map +1 -1
- package/services/GetProjectConfigService/renderExtensions.d.ts +8 -0
- package/services/GetProjectConfigService/renderExtensions.js +52 -0
- package/services/GetProjectConfigService/renderExtensions.js.map +1 -0
- 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 +22 -19
- package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
- package/services/InitProjectSdkService/applyWcpEnvVars.js +27 -9
- package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
- package/services/InitProjectSdkService/registerHooks.js +4 -16
- package/services/InitProjectSdkService/registerHooks.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/ValidateProjectConfigService/ValidateProjectConfigService.js +10 -7
- package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
- package/services/WcpService/GetProjectEnvironment.js +16 -5
- package/services/WcpService/GetProjectEnvironment.js.map +1 -1
- package/services/WcpService/WcpGqlClient.js +2 -2
- package/services/WcpService/WcpGqlClient.js.map +1 -1
- package/services/WcpService/fetchProjectEnvironmentByApiKey.d.ts +8 -0
- package/services/WcpService/fetchProjectEnvironmentByApiKey.js +21 -0
- package/services/WcpService/fetchProjectEnvironmentByApiKey.js.map +1 -0
- package/services/index.d.ts +0 -12
- package/services/index.js +0 -12
- package/utils/ExtensionSrcResolver.js +2 -2
- package/utils/ExtensionSrcResolver.js.map +1 -1
- package/utils/apiRuntimeEnv.d.ts +2 -2
- package/utils/apiRuntimeEnv.js.map +1 -1
- 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/utils/trace/TraceRecorder.d.ts +17 -0
- package/utils/trace/TraceRecorder.js +51 -0
- package/utils/trace/TraceRecorder.js.map +1 -0
- package/utils/trace/formatTraceReport.d.ts +2 -0
- package/utils/trace/formatTraceReport.js +53 -0
- package/utils/trace/formatTraceReport.js.map +1 -0
- package/utils/trace/index.d.ts +6 -0
- package/utils/trace/index.js +6 -0
- package/utils/trace/isTraceRequested.d.ts +1 -0
- package/utils/trace/isTraceRequested.js +12 -0
- package/utils/trace/isTraceRequested.js.map +1 -0
- package/utils/trace/startTrace.d.ts +1 -0
- package/utils/trace/startTrace.js +19 -0
- package/utils/trace/startTrace.js.map +1 -0
- package/utils/trace/trace.d.ts +1 -0
- package/utils/trace/trace.js +13 -0
- package/utils/trace/trace.js.map +1 -0
- package/utils/trace/traceAsync.d.ts +1 -0
- package/utils/trace/traceAsync.js +13 -0
- package/utils/trace/traceAsync.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 -21
- 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/ApiMaxBundleSize.d.ts +0 -4
- package/extensions/ApiMaxBundleSize.js +0 -23
- package/extensions/ApiMaxBundleSize.js.map +0 -1
- package/extensions/hooks/AdminAfterDeploy.d.ts +0 -4
- package/extensions/hooks/AdminAfterDeploy.js +0 -22
- package/extensions/hooks/AdminAfterDeploy.js.map +0 -1
- package/extensions/hooks/AdminBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/AdminBeforeDeploy.js +0 -22
- package/extensions/hooks/AdminBeforeDeploy.js.map +0 -1
- package/extensions/hooks/AfterDeploy.d.ts +0 -4
- package/extensions/hooks/AfterDeploy.js +0 -21
- package/extensions/hooks/AfterDeploy.js.map +0 -1
- package/extensions/hooks/ApiAfterDeploy.d.ts +0 -4
- package/extensions/hooks/ApiAfterDeploy.js +0 -22
- package/extensions/hooks/ApiAfterDeploy.js.map +0 -1
- package/extensions/hooks/ApiBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/ApiBeforeDeploy.js +0 -22
- package/extensions/hooks/ApiBeforeDeploy.js.map +0 -1
- package/extensions/hooks/BeforeDeploy.d.ts +0 -4
- package/extensions/hooks/BeforeDeploy.js +0 -21
- package/extensions/hooks/BeforeDeploy.js.map +0 -1
- package/extensions/hooks/CoreAfterDeploy.d.ts +0 -4
- package/extensions/hooks/CoreAfterDeploy.js +0 -22
- package/extensions/hooks/CoreAfterDeploy.js.map +0 -1
- package/extensions/hooks/CoreBeforeDeploy.d.ts +0 -4
- package/extensions/hooks/CoreBeforeDeploy.js +0 -22
- package/extensions/hooks/CoreBeforeDeploy.js.map +0 -1
- package/extensions/infra/Encryption.d.ts +0 -10
- package/extensions/infra/Encryption.js +0 -36
- package/extensions/infra/Encryption.js.map +0 -1
- package/extensions/infra/Hashing.d.ts +0 -5
- package/extensions/infra/Hashing.js +0 -27
- package/extensions/infra/Hashing.js.map +0 -1
- package/extensions/pulumi/AdminStackOutputValue.d.ts +0 -5
- package/extensions/pulumi/AdminStackOutputValue.js +0 -18
- package/extensions/pulumi/AdminStackOutputValue.js.map +0 -1
- package/extensions/pulumi/ApiStackOutputValue.d.ts +0 -5
- package/extensions/pulumi/ApiStackOutputValue.js +0 -18
- package/extensions/pulumi/ApiStackOutputValue.js.map +0 -1
- package/extensions/pulumi/CoreStackOutputValue.d.ts +0 -5
- package/extensions/pulumi/CoreStackOutputValue.js +0 -18
- package/extensions/pulumi/CoreStackOutputValue.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 -15
- package/extensions/pulumi/PulumiResourceNamePrefix.js.map +0 -1
- package/extensions/pulumi/index.d.ts +0 -5
- package/extensions/pulumi/index.js +0 -5
- 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.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/rslib-runtime.js +0 -14
- package/rslib-runtime.js.map +0 -1
- package/services/GetProjectConfigService/renderConfigWorker.d.ts +0 -1
- package/services/GetProjectConfigService/renderConfigWorker.js +0 -64
- package/services/GetProjectConfigService/renderConfigWorker.js.map +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/{features/Watch/localInvocationWorker.d.ts → extensions/api/Mailer/Smtp.test.d.ts} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Smtp: import("~/defineExtension/index.js").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
+
host: import("zod").ZodString;
|
|
3
|
+
port: import("zod").ZodNumber;
|
|
4
|
+
user: import("zod").ZodString;
|
|
5
|
+
password: import("zod").ZodString;
|
|
6
|
+
from: import("zod").ZodString;
|
|
7
|
+
replyTo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
}, import("zod/v4/core").$strip>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { defineExtension } from "../../../defineExtension/index.js";
|
|
3
|
+
import { BuildParam } from "../../ApiBuildParam.js";
|
|
4
|
+
import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
|
|
5
|
+
const Smtp = defineExtension({
|
|
6
|
+
type: "Api/Mailer/Smtp",
|
|
7
|
+
tags: {
|
|
8
|
+
runtimeContext: "project",
|
|
9
|
+
hosting: "all"
|
|
10
|
+
},
|
|
11
|
+
description: "Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.",
|
|
12
|
+
paramsSchema: SmtpParamsSchema,
|
|
13
|
+
render (params) {
|
|
14
|
+
return /*#__PURE__*/ react.createElement(BuildParam, {
|
|
15
|
+
paramName: "Mailer.SmtpSettings",
|
|
16
|
+
value: params
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export { Smtp };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=Smtp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/api/Mailer/Smtp.js","sources":["../../../../src/extensions/api/Mailer/Smtp.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\nimport { SmtpParamsSchema } from \"./SmtpParamsSchema.js\";\n\nexport const Smtp = defineExtension({\n type: \"Api/Mailer/Smtp\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.\",\n paramsSchema: SmtpParamsSchema,\n render(params) {\n return <BuildParam paramName=\"Mailer.SmtpSettings\" value={params} />;\n }\n});\n"],"names":["Smtp","defineExtension","SmtpParamsSchema","params","BuildParam"],"mappings":";;;;AAKO,MAAMA,OAAOC,gBAAgB;IAChC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJ,cAAcC;IACd,QAAOC,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAC9D;AACJ"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
|
|
3
|
+
const validParams = {
|
|
4
|
+
host: "smtp.example.com",
|
|
5
|
+
port: 587,
|
|
6
|
+
user: "smtp-user",
|
|
7
|
+
password: "secret",
|
|
8
|
+
from: "Webiny <test@webiny.com>",
|
|
9
|
+
replyTo: "No-reply <no-reply@webiny.com>"
|
|
10
|
+
};
|
|
11
|
+
describe("Smtp paramsSchema", ()=>{
|
|
12
|
+
describe("valid inputs", ()=>{
|
|
13
|
+
it("accepts a complete valid config", async ()=>{
|
|
14
|
+
const result = await SmtpParamsSchema.safeParseAsync(validParams);
|
|
15
|
+
expect(result.success).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
it("accepts config without replyTo (it is optional)", async ()=>{
|
|
18
|
+
const { replyTo: _, ...params } = validParams;
|
|
19
|
+
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
20
|
+
expect(result.success).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
it("accepts bare addr-spec for from and replyTo", async ()=>{
|
|
23
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
24
|
+
...validParams,
|
|
25
|
+
from: "test@webiny.com",
|
|
26
|
+
replyTo: "no-reply@webiny.com"
|
|
27
|
+
});
|
|
28
|
+
expect(result.success).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe("react-properties serialization bug", ()=>{
|
|
32
|
+
it("password={} reproduces the 'expected string, received object' error", async ()=>{
|
|
33
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
34
|
+
...validParams,
|
|
35
|
+
password: {}
|
|
36
|
+
});
|
|
37
|
+
expect(result.success).toBe(false);
|
|
38
|
+
const issue = result.error?.issues[0];
|
|
39
|
+
expect(issue?.code).toBe("invalid_type");
|
|
40
|
+
expect(issue?.path).toEqual([
|
|
41
|
+
"password"
|
|
42
|
+
]);
|
|
43
|
+
expect(issue?.message).toBe("Invalid input: expected string, received object");
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe("required string fields", ()=>{
|
|
47
|
+
it("rejects missing host", async ()=>{
|
|
48
|
+
const { host: _, ...params } = validParams;
|
|
49
|
+
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
50
|
+
expect(result.success).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
it("rejects empty host", async ()=>{
|
|
53
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
54
|
+
...validParams,
|
|
55
|
+
host: ""
|
|
56
|
+
});
|
|
57
|
+
expect(result.success).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it("rejects missing user", async ()=>{
|
|
60
|
+
const { user: _, ...params } = validParams;
|
|
61
|
+
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
62
|
+
expect(result.success).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
it("rejects empty user", async ()=>{
|
|
65
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
66
|
+
...validParams,
|
|
67
|
+
user: ""
|
|
68
|
+
});
|
|
69
|
+
expect(result.success).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
it("rejects missing password", async ()=>{
|
|
72
|
+
const { password: _, ...params } = validParams;
|
|
73
|
+
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
74
|
+
expect(result.success).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
it("rejects empty password", async ()=>{
|
|
77
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
78
|
+
...validParams,
|
|
79
|
+
password: ""
|
|
80
|
+
});
|
|
81
|
+
expect(result.success).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
describe("port validation", ()=>{
|
|
85
|
+
it("rejects port 0", async ()=>{
|
|
86
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
87
|
+
...validParams,
|
|
88
|
+
port: 0
|
|
89
|
+
});
|
|
90
|
+
expect(result.success).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
it("rejects negative port", async ()=>{
|
|
93
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
94
|
+
...validParams,
|
|
95
|
+
port: -1
|
|
96
|
+
});
|
|
97
|
+
expect(result.success).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
it("rejects fractional port", async ()=>{
|
|
100
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
101
|
+
...validParams,
|
|
102
|
+
port: 587.5
|
|
103
|
+
});
|
|
104
|
+
expect(result.success).toBe(false);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
describe("email address validation", ()=>{
|
|
108
|
+
it("rejects invalid from address", async ()=>{
|
|
109
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
110
|
+
...validParams,
|
|
111
|
+
from: "not-an-email"
|
|
112
|
+
});
|
|
113
|
+
expect(result.success).toBe(false);
|
|
114
|
+
expect(result.error?.issues[0].message).toBe("Invalid email address.");
|
|
115
|
+
});
|
|
116
|
+
it("rejects invalid replyTo address", async ()=>{
|
|
117
|
+
const result = await SmtpParamsSchema.safeParseAsync({
|
|
118
|
+
...validParams,
|
|
119
|
+
replyTo: "not-an-email"
|
|
120
|
+
});
|
|
121
|
+
expect(result.success).toBe(false);
|
|
122
|
+
expect(result.error?.issues[0].message).toBe("Invalid email address.");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=Smtp.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/api/Mailer/Smtp.test.js","sources":["../../../../src/extensions/api/Mailer/Smtp.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { SmtpParamsSchema as schema } from \"./SmtpParamsSchema.js\";\n\nconst validParams = {\n host: \"smtp.example.com\",\n port: 587,\n user: \"smtp-user\",\n password: \"secret\",\n from: \"Webiny <test@webiny.com>\",\n replyTo: \"No-reply <no-reply@webiny.com>\"\n};\n\ndescribe(\"Smtp paramsSchema\", () => {\n describe(\"valid inputs\", () => {\n it(\"accepts a complete valid config\", async () => {\n const result = await schema.safeParseAsync(validParams);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts config without replyTo (it is optional)\", async () => {\n const { replyTo: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts bare addr-spec for from and replyTo\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n from: \"test@webiny.com\",\n replyTo: \"no-reply@webiny.com\"\n });\n expect(result.success).toBe(true);\n });\n });\n\n describe(\"react-properties serialization bug\", () => {\n // When process.env.SMTP_PASSWORD is undefined at build time,\n // react-properties' buildRoots treats value===undefined as \"no value, build from\n // children\". The password Property has no children, so buildRoots returns {}.\n // Zod then validates {} against z.string() → \"expected string, received object\".\n it(\"password={} reproduces the 'expected string, received object' error\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: {} });\n expect(result.success).toBe(false);\n const issue = result.error?.issues[0];\n expect(issue?.code).toBe(\"invalid_type\");\n expect(issue?.path).toEqual([\"password\"]);\n expect(issue?.message).toBe(\"Invalid input: expected string, received object\");\n });\n });\n\n describe(\"required string fields\", () => {\n it(\"rejects missing host\", async () => {\n const { host: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty host\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, host: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing user\", async () => {\n const { user: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty user\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, user: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing password\", async () => {\n const { password: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty password\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: \"\" });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"port validation\", () => {\n it(\"rejects port 0\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 0 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects negative port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: -1 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects fractional port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 587.5 });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"email address validation\", () => {\n it(\"rejects invalid from address\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, from: \"not-an-email\" });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n\n it(\"rejects invalid replyTo address\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n replyTo: \"not-an-email\"\n });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n });\n});\n"],"names":["validParams","describe","it","result","schema","expect","_","params","issue"],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import email_addresses from "email-addresses";
|
|
3
|
+
const isMailboxAddress = (value)=>null !== email_addresses.parseOneAddress(value);
|
|
4
|
+
const mailboxAddress = z.string().refine(isMailboxAddress, {
|
|
5
|
+
message: "Invalid email address."
|
|
6
|
+
});
|
|
7
|
+
const SmtpParamsSchema = z.object({
|
|
8
|
+
host: z.string().min(1).describe("SMTP server hostname."),
|
|
9
|
+
port: z.number().int().positive().describe("SMTP server port."),
|
|
10
|
+
user: z.string().min(1).describe("SMTP authentication username."),
|
|
11
|
+
password: z.string().min(1).describe("SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code."),
|
|
12
|
+
from: mailboxAddress.describe("Default 'from' address."),
|
|
13
|
+
replyTo: mailboxAddress.optional().describe("Default 'reply-to' address.")
|
|
14
|
+
});
|
|
15
|
+
export { SmtpParamsSchema };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=SmtpParamsSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/api/Mailer/SmtpParamsSchema.js","sources":["../../../../src/extensions/api/Mailer/SmtpParamsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport emailAddresses from \"email-addresses\";\n\n// Accept both addr-spec (\"foo@bar.com\") and name-addr (\"Foo <foo@bar.com>\") forms.\nconst isMailboxAddress = (value: string): boolean => {\n return emailAddresses.parseOneAddress(value) !== null;\n};\n\nconst mailboxAddress = z.string().refine(isMailboxAddress, { message: \"Invalid email address.\" });\n\nexport const SmtpParamsSchema = z.object({\n host: z.string().min(1).describe(\"SMTP server hostname.\"),\n port: z.number().int().positive().describe(\"SMTP server port.\"),\n user: z.string().min(1).describe(\"SMTP authentication username.\"),\n password: z\n .string()\n .min(1)\n .describe(\n \"SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code.\"\n ),\n from: mailboxAddress.describe(\"Default 'from' address.\"),\n replyTo: mailboxAddress.optional().describe(\"Default 'reply-to' address.\")\n});\n"],"names":["isMailboxAddress","value","emailAddresses","mailboxAddress","z","SmtpParamsSchema"],"mappings":";;AAIA,MAAMA,mBAAmB,CAACC,QACfC,AAA0C,SAA1CA,gBAAAA,eAA8B,CAACD;AAG1C,MAAME,iBAAiBC,EAAE,MAAM,GAAG,MAAM,CAACJ,kBAAkB;IAAE,SAAS;AAAyB;AAExF,MAAMK,mBAAmBD,EAAE,MAAM,CAAC;IACrC,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,MAAMA,EAAE,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,UAAUA,EAAAA,MACC,GACN,GAAG,CAAC,GACJ,QAAQ,CACL;IAER,MAAMD,eAAe,QAAQ,CAAC;IAC9B,SAASA,eAAe,QAAQ,GAAG,QAAQ,CAAC;AAChD"}
|
|
@@ -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":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.
|
|
7
|
+
*
|
|
8
|
+
* Wildcards are left alone. `HttpRouter` matches a trailing `/*`, API Gateway spells the same thing
|
|
9
|
+
* `{proxy+}`, and translating between them changes what the route captures — so a wildcard route
|
|
10
|
+
* has to be written for the target it's aimed at.
|
|
11
|
+
*/
|
|
12
|
+
/** `/orders/{orderId}` → `/orders/:orderId`. Already-colon segments pass through. */
|
|
13
|
+
export declare function toRouterPath(path: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* `/asd/{id}/xs` + POST → `asd-xs-post`. Handles either parameter syntax.
|
|
16
|
+
*
|
|
17
|
+
* Used for BOTH the Pulumi resource name and the route's DI name, so the name a decorator matches
|
|
18
|
+
* on is the same one that shows up in infrastructure.
|
|
19
|
+
*/
|
|
20
|
+
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.\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":"AAaO,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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Node, SyntaxKind } from "ts-morph";
|
|
2
|
+
const hasDefaultExport = (source)=>source.getStatements().some((statement)=>{
|
|
3
|
+
if (Node.isExportAssignment(statement)) return !statement.isExportEquals();
|
|
4
|
+
if (Node.isModifierable(statement)) return statement.hasModifier(SyntaxKind.DefaultKeyword);
|
|
5
|
+
if (Node.isExportDeclaration(statement)) return statement.getNamedExports().some((namedExport)=>{
|
|
6
|
+
const exportedAs = namedExport.getAliasNode() ?? namedExport.getNameNode();
|
|
7
|
+
return "default" === getExportedName(exportedAs);
|
|
8
|
+
});
|
|
9
|
+
return false;
|
|
10
|
+
});
|
|
11
|
+
const getExportedName = (node)=>{
|
|
12
|
+
if (Node.isStringLiteral(node)) return node.getLiteralValue();
|
|
13
|
+
return node.getText();
|
|
14
|
+
};
|
|
15
|
+
export { hasDefaultExport };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=hasDefaultExport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/hasDefaultExport.js","sources":["../../src/extensions/hasDefaultExport.ts"],"sourcesContent":["import { Node } from \"ts-morph\";\nimport { SyntaxKind } from \"ts-morph\";\nimport { type SourceFile } from \"ts-morph\";\n\n/*\n * Tells whether a file has a default export by reading its syntax alone.\n *\n * ts-morph's `getDefaultExportSymbol()` gives the same answer, but it asks the type checker, and the\n * checker first loads the TypeScript lib files and every module the file imports. For an admin\n * extension that means React and the admin app's types, so each call took between 0.1s and 2.5s.\n * `webiny watch` makes one call per extension, one after another, which added up to 17s of the\n * startup on a project with 39 extensions.\n *\n * The checker isn't needed here. A default export is always written out in the file itself, as one\n * of the forms below, since `export * from` never re-exports `default`.\n */\nexport const hasDefaultExport = (source: SourceFile): boolean => {\n return source.getStatements().some(statement => {\n // export default something;\n if (Node.isExportAssignment(statement)) {\n return !statement.isExportEquals();\n }\n\n // export default function Extension() {} and export default class Extension {}\n if (Node.isModifierable(statement)) {\n return statement.hasModifier(SyntaxKind.DefaultKeyword);\n }\n\n // export { Extension as default } and export { default } from \"./Extension.js\"\n if (Node.isExportDeclaration(statement)) {\n return statement.getNamedExports().some(namedExport => {\n const exportedAs = namedExport.getAliasNode() ?? namedExport.getNameNode();\n return getExportedName(exportedAs) === \"default\";\n });\n }\n\n return false;\n });\n};\n\n/*\n * An exported name can also be written as a string, as in `export { Extension as \"default\" }`.\n * Its text then includes the quotes, so strings are compared by their value instead.\n */\nconst getExportedName = (node: Node): string => {\n if (Node.isStringLiteral(node)) {\n return node.getLiteralValue();\n }\n\n return node.getText();\n};\n"],"names":["hasDefaultExport","source","statement","Node","SyntaxKind","namedExport","exportedAs","getExportedName","node"],"mappings":";AAgBO,MAAMA,mBAAmB,CAACC,SACtBA,OAAO,aAAa,GAAG,IAAI,CAACC,CAAAA;QAE/B,IAAIC,KAAK,kBAAkB,CAACD,YACxB,OAAO,CAACA,UAAU,cAAc;QAIpC,IAAIC,KAAK,cAAc,CAACD,YACpB,OAAOA,UAAU,WAAW,CAACE,WAAW,cAAc;QAI1D,IAAID,KAAK,mBAAmB,CAACD,YACzB,OAAOA,UAAU,eAAe,GAAG,IAAI,CAACG,CAAAA;YACpC,MAAMC,aAAaD,YAAY,YAAY,MAAMA,YAAY,WAAW;YACxE,OAAOE,AAAgC,cAAhCA,gBAAgBD;QAC3B;QAGJ,OAAO;IACX;AAOJ,MAAMC,kBAAkB,CAACC;IACrB,IAAIL,KAAK,eAAe,CAACK,OACrB,OAAOA,KAAK,eAAe;IAG/B,OAAOA,KAAK,OAAO;AACvB"}
|
|
@@ -6,7 +6,8 @@ const AdminAfterBuild_AdminAfterBuild = defineExtension({
|
|
|
6
6
|
type: "Admin/AfterBuild",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "admin"
|
|
9
|
+
application: "admin",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed after the ADMIN build process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/AdminAfterBuild.js","sources":["../../../src/extensions/hooks/AdminAfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminAfterBuild as AdminAfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminAfterBuild = defineExtension({\n type: \"Admin/AfterBuild\",\n tags: { runtimeContext: \"project\", application: \"admin\" },\n description: \"Add custom logic to be executed after the ADMIN build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminAfterBuildAbstraction })\n });\n }\n});\n"],"names":["AdminAfterBuild","defineExtension","project","z","zodSrcPath","AdminAfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,kCAAkBC,gBAAgB;IAC3C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/AdminAfterBuild.js","sources":["../../../src/extensions/hooks/AdminAfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminAfterBuild as AdminAfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminAfterBuild = defineExtension({\n type: \"Admin/AfterBuild\",\n tags: { runtimeContext: \"project\", application: \"admin\", hosting: \"all\" },\n description: \"Add custom logic to be executed after the ADMIN build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminAfterBuildAbstraction })\n });\n }\n});\n"],"names":["AdminAfterBuild","defineExtension","project","z","zodSrcPath","AdminAfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,kCAAkBC,gBAAgB;IAC3C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAS,SAAS;IAAM;IACxE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAA2B;QACvE;AAER"}
|
|
@@ -6,7 +6,8 @@ const AdminBeforeBuild_AdminBeforeBuild = defineExtension({
|
|
|
6
6
|
type: "Admin/BeforeBuild",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "admin"
|
|
9
|
+
application: "admin",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed before the ADMIN build process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/AdminBeforeBuild.js","sources":["../../../src/extensions/hooks/AdminBeforeBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminBeforeBuild as AdminBeforeBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminBeforeBuild = defineExtension({\n type: \"Admin/BeforeBuild\",\n tags: { runtimeContext: \"project\", application: \"admin\" },\n description: \"Add custom logic to be executed before the ADMIN build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminBeforeBuildAbstraction })\n });\n }\n});\n"],"names":["AdminBeforeBuild","defineExtension","project","z","zodSrcPath","AdminBeforeBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,oCAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/AdminBeforeBuild.js","sources":["../../../src/extensions/hooks/AdminBeforeBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminBeforeBuild as AdminBeforeBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminBeforeBuild = defineExtension({\n type: \"Admin/BeforeBuild\",\n tags: { runtimeContext: \"project\", application: \"admin\", hosting: \"all\" },\n description: \"Add custom logic to be executed before the ADMIN build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminBeforeBuildAbstraction })\n });\n }\n});\n"],"names":["AdminBeforeBuild","defineExtension","project","z","zodSrcPath","AdminBeforeBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,oCAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAS,SAAS;IAAM;IACxE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAA4B;QACxE;AAER"}
|
|
@@ -6,7 +6,8 @@ const AdminBeforeWatch_AdminBeforeWatch = defineExtension({
|
|
|
6
6
|
type: "Admin/BeforeWatch",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "admin"
|
|
9
|
+
application: "admin",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed before the Admin watch process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/AdminBeforeWatch.js","sources":["../../../src/extensions/hooks/AdminBeforeWatch.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminBeforeWatch as AdminBeforeWatchAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminBeforeWatch = defineExtension({\n type: \"Admin/BeforeWatch\",\n tags: { runtimeContext: \"project\", application: \"admin\" },\n description: \"Add custom logic to be executed before the Admin watch process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminBeforeWatchAbstraction })\n });\n }\n});\n"],"names":["AdminBeforeWatch","defineExtension","project","z","zodSrcPath","AdminBeforeWatchAbstraction"],"mappings":";;;;AAKO,MAAMA,oCAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/AdminBeforeWatch.js","sources":["../../../src/extensions/hooks/AdminBeforeWatch.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AdminBeforeWatch as AdminBeforeWatchAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AdminBeforeWatch = defineExtension({\n type: \"Admin/BeforeWatch\",\n tags: { runtimeContext: \"project\", application: \"admin\", hosting: \"all\" },\n description: \"Add custom logic to be executed before the Admin watch process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AdminBeforeWatchAbstraction })\n });\n }\n});\n"],"names":["AdminBeforeWatch","defineExtension","project","z","zodSrcPath","AdminBeforeWatchAbstraction"],"mappings":";;;;AAKO,MAAMA,oCAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAS,SAAS;IAAM;IACxE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAA4B;QACxE;AAER"}
|
|
@@ -5,7 +5,8 @@ import { z } from "zod";
|
|
|
5
5
|
const AfterBuild_AfterBuild = defineExtension({
|
|
6
6
|
type: "Project/AfterBuild",
|
|
7
7
|
tags: {
|
|
8
|
-
runtimeContext: "project"
|
|
8
|
+
runtimeContext: "project",
|
|
9
|
+
hosting: "all"
|
|
9
10
|
},
|
|
10
11
|
description: "Add custom logic to be executed after the PROJECT build process.",
|
|
11
12
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/AfterBuild.js","sources":["../../../src/extensions/hooks/AfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AfterBuild as AfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AfterBuild = defineExtension({\n type: \"Project/AfterBuild\",\n tags: { runtimeContext: \"project\" },\n description: \"Add custom logic to be executed after the PROJECT build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AfterBuildAbstraction })\n });\n }\n});\n"],"names":["AfterBuild","defineExtension","project","z","zodSrcPath","AfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,wBAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/AfterBuild.js","sources":["../../../src/extensions/hooks/AfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { AfterBuild as AfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const AfterBuild = defineExtension({\n type: \"Project/AfterBuild\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Add custom logic to be executed after the PROJECT build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: AfterBuildAbstraction })\n });\n }\n});\n"],"names":["AfterBuild","defineExtension","project","z","zodSrcPath","AfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,wBAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAAsB;QAClE;AAER"}
|
|
@@ -6,7 +6,8 @@ const ApiAfterBuild_ApiAfterBuild = defineExtension({
|
|
|
6
6
|
type: "Api/AfterBuild",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "api"
|
|
9
|
+
application: "api",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed after the API build process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/ApiAfterBuild.js","sources":["../../../src/extensions/hooks/ApiAfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiAfterBuild as ApiAfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiAfterBuild = defineExtension({\n type: \"Api/AfterBuild\",\n tags: { runtimeContext: \"project\", application: \"api\" },\n description: \"Add custom logic to be executed after the API build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiAfterBuildAbstraction })\n });\n }\n});\n"],"names":["ApiAfterBuild","defineExtension","project","z","zodSrcPath","ApiAfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,8BAAgBC,gBAAgB;IACzC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;IAAM;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/ApiAfterBuild.js","sources":["../../../src/extensions/hooks/ApiAfterBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiAfterBuild as ApiAfterBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiAfterBuild = defineExtension({\n type: \"Api/AfterBuild\",\n tags: { runtimeContext: \"project\", application: \"api\", hosting: \"all\" },\n description: \"Add custom logic to be executed after the API build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiAfterBuildAbstraction })\n });\n }\n});\n"],"names":["ApiAfterBuild","defineExtension","project","z","zodSrcPath","ApiAfterBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,8BAAgBC,gBAAgB;IACzC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAO,SAAS;IAAM;IACtE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAAyB;QACrE;AAER"}
|
|
@@ -6,7 +6,8 @@ const ApiBeforeBuild_ApiBeforeBuild = defineExtension({
|
|
|
6
6
|
type: "Api/BeforeBuild",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "api"
|
|
9
|
+
application: "api",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed before the API build process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/ApiBeforeBuild.js","sources":["../../../src/extensions/hooks/ApiBeforeBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiBeforeBuild as ApiBeforeBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiBeforeBuild = defineExtension({\n type: \"Api/BeforeBuild\",\n tags: { runtimeContext: \"project\", application: \"api\" },\n description: \"Add custom logic to be executed before the API build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiBeforeBuildAbstraction })\n });\n }\n});\n"],"names":["ApiBeforeBuild","defineExtension","project","z","zodSrcPath","ApiBeforeBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,gCAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;IAAM;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/ApiBeforeBuild.js","sources":["../../../src/extensions/hooks/ApiBeforeBuild.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiBeforeBuild as ApiBeforeBuildAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiBeforeBuild = defineExtension({\n type: \"Api/BeforeBuild\",\n tags: { runtimeContext: \"project\", application: \"api\", hosting: \"all\" },\n description: \"Add custom logic to be executed before the API build process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiBeforeBuildAbstraction })\n });\n }\n});\n"],"names":["ApiBeforeBuild","defineExtension","project","z","zodSrcPath","ApiBeforeBuildAbstraction"],"mappings":";;;;AAKO,MAAMA,gCAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAO,SAAS;IAAM;IACtE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAA0B;QACtE;AAER"}
|
|
@@ -6,7 +6,8 @@ const ApiBeforeWatch_ApiBeforeWatch = defineExtension({
|
|
|
6
6
|
type: "Api/BeforeWatch",
|
|
7
7
|
tags: {
|
|
8
8
|
runtimeContext: "project",
|
|
9
|
-
application: "api"
|
|
9
|
+
application: "api",
|
|
10
|
+
hosting: "all"
|
|
10
11
|
},
|
|
11
12
|
description: "Add custom logic to be executed before the API watch process.",
|
|
12
13
|
multiple: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/hooks/ApiBeforeWatch.js","sources":["../../../src/extensions/hooks/ApiBeforeWatch.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiBeforeWatch as ApiBeforeWatchAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiBeforeWatch = defineExtension({\n type: \"Api/BeforeWatch\",\n tags: { runtimeContext: \"project\", application: \"api\" },\n description: \"Add custom logic to be executed before the API watch process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiBeforeWatchAbstraction })\n });\n }\n});\n"],"names":["ApiBeforeWatch","defineExtension","project","z","zodSrcPath","ApiBeforeWatchAbstraction"],"mappings":";;;;AAKO,MAAMA,gCAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;IAAM;
|
|
1
|
+
{"version":3,"file":"extensions/hooks/ApiBeforeWatch.js","sources":["../../../src/extensions/hooks/ApiBeforeWatch.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ApiBeforeWatch as ApiBeforeWatchAbstraction } from \"~/abstractions/index.js\";\nimport { z } from \"zod\";\n\nexport const ApiBeforeWatch = defineExtension({\n type: \"Api/BeforeWatch\",\n tags: { runtimeContext: \"project\", application: \"api\", hosting: \"all\" },\n description: \"Add custom logic to be executed before the API watch process.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project, abstraction: ApiBeforeWatchAbstraction })\n });\n }\n});\n"],"names":["ApiBeforeWatch","defineExtension","project","z","zodSrcPath","ApiBeforeWatchAbstraction"],"mappings":";;;;AAKO,MAAMA,gCAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,aAAa;QAAO,SAAS;IAAM;IACtE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;gBAAS,aAAaG;YAA0B;QACtE;AAER"}
|