@webiny/project-aws 6.6.0-alpha.1 → 6.6.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstractions/pulumiTypes.d.ts +15 -0
- package/abstractions/pulumiTypes.js +0 -0
- package/api.js +1 -3
- package/api.js.map +1 -1
- package/exports/infra/admin.d.ts +1 -3
- package/exports/infra/admin.js +0 -3
- package/exports/infra/api.d.ts +1 -3
- package/exports/infra/api.js +0 -3
- package/exports/infra/core.d.ts +1 -2
- package/exports/infra/core.js +0 -2
- package/extensions/ApiLambdaFunction.js +3 -2
- package/extensions/ApiLambdaFunction.js.map +1 -1
- package/extensions/ApiRoute.js +6 -12
- package/extensions/ApiRoute.js.map +1 -1
- package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +2 -2
- package/extensions/OpenSearch/EnsureOsWasDeployed.js +1 -1
- package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
- package/extensions/OpenSearch.d.ts +9 -10
- package/extensions/OpenSearch.js +7 -15
- package/extensions/OpenSearch.js.map +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
- package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +2 -2
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js +1 -1
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
- package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +1 -1
- package/extensions/ProjectAws/UploadAdminAppToS3.js +2 -2
- package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
- package/extensions/ProjectAws/definitions.js +1 -1
- package/extensions/ProjectAws/definitions.js.map +1 -1
- package/extensions/ProjectAws.d.ts +1 -0
- package/extensions/ProjectAws.js +1 -0
- package/extensions/ProjectAws.js.map +1 -1
- package/extensions/RegisterRoutesPulumi.d.ts +2 -2
- package/extensions/RegisterRoutesPulumi.js +2 -2
- package/extensions/RegisterRoutesPulumi.js.map +1 -1
- package/extensions/definitions.js +1 -3
- package/extensions/definitions.js.map +1 -1
- package/extensions/index.d.ts +2 -3
- package/extensions/index.js +2 -3
- package/extensions/registerExtensionImplementations.js +10 -0
- package/extensions/registerExtensionImplementations.js.map +1 -0
- package/features/ApiGqlClient.d.ts +4 -4
- package/features/ApiGqlClient.js +3 -3
- package/features/ApiGqlClient.js.map +1 -1
- package/features/InvokeLambdaFunction.d.ts +2 -2
- package/features/InvokeLambdaFunction.js +2 -2
- package/features/InvokeLambdaFunction.js.map +1 -1
- package/features/Watch/AwsWatch.js +3 -3
- package/features/Watch/AwsWatch.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/infra.d.ts +49 -2
- package/infra.js +16 -4
- package/infra.js.map +1 -1
- package/package.json +22 -22
- package/project.d.ts +12 -1
- package/project.js +3 -2
- package/project.js.map +1 -1
- package/pulumi/apps/admin/createAdminPulumiApp.js +7 -4
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/pulumi/apps/api/ApiCloudfront.js +2 -1
- package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
- package/pulumi/apps/api/ApiOutput.d.ts +6 -6
- package/pulumi/apps/api/createApiPulumiApp.js +9 -7
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/awsUtils.js +1 -1
- package/pulumi/apps/awsUtils.js.map +1 -1
- package/pulumi/apps/blueGreen/domains/resolveDomains.js +1 -1
- package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
- package/pulumi/apps/blueGreen/types.d.ts +0 -3
- package/pulumi/apps/common/CoreOutput.d.ts +2 -1
- package/pulumi/apps/common/CoreOutput.js.map +1 -1
- package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
- package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
- package/pulumi/apps/core/CoreDynamo.js +3 -0
- package/pulumi/apps/core/CoreDynamo.js.map +1 -1
- package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
- package/pulumi/apps/core/CoreFileManager.js +11 -1
- package/pulumi/apps/core/CoreFileManager.js.map +1 -1
- package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
- package/pulumi/apps/core/CoreOpenSearch.js +3 -0
- package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js +12 -2
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
- package/pulumi/apps/core/createCorePulumiApp.js +16 -7
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
- package/pulumi/apps/customDomain.d.ts +10 -0
- package/pulumi/apps/customDomain.js +5 -1
- package/pulumi/apps/customDomain.js.map +1 -1
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js +1 -1
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +2 -2
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +1 -1
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getOsConfigFromExtension.js +2 -2
- package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js +1 -1
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
- package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
- package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
- package/pulumi/apps/extensions/isVpcEnabled.d.ts +14 -0
- package/pulumi/apps/extensions/isVpcEnabled.js +8 -0
- package/pulumi/apps/extensions/isVpcEnabled.js.map +1 -0
- package/pulumi/extensions/AdminPulumi.js +3 -2
- package/pulumi/extensions/AdminPulumi.js.map +1 -1
- package/pulumi/extensions/ApiPulumi.js +3 -2
- package/pulumi/extensions/ApiPulumi.js.map +1 -1
- package/pulumi/extensions/CorePulumi.js +3 -2
- package/pulumi/extensions/CorePulumi.js.map +1 -1
- package/pulumi/extensions/index.d.ts +53 -22
- package/pulumi/extensions/index.js +12 -9
- package/pulumi/extensions/index.js.map +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.d.ts +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.js +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.d.ts +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.js +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.d.ts +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.js +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -1
- package/pulumi/features/DefaultSetAdminCustomDomains.d.ts +1 -1
- package/pulumi/features/DefaultSetAdminCustomDomains.js.map +1 -1
- package/pulumi/features/DefaultSetApiCustomDomains.d.ts +1 -1
- package/pulumi/features/DefaultSetApiCustomDomains.js.map +1 -1
- package/pulumi/types.d.ts +2 -1
- package/pulumi/utils/getDistributionUrl.d.ts +9 -0
- package/pulumi/utils/getDistributionUrl.js +8 -0
- package/pulumi/utils/getDistributionUrl.js.map +1 -0
- package/pulumi/utils/index.d.ts +1 -0
- package/pulumi/utils/index.js +1 -0
- package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
- package/services/AdminStackOutputService.d.ts +2 -2
- package/services/AdminStackOutputService.js +1 -1
- package/services/AdminStackOutputService.js.map +1 -1
- package/services/ApiStackOutputService.d.ts +2 -2
- package/services/ApiStackOutputService.js +1 -1
- package/services/ApiStackOutputService.js.map +1 -1
- package/services/CoreStackOutputService.d.ts +2 -2
- package/services/CoreStackOutputService.js +1 -1
- package/services/CoreStackOutputService.js.map +1 -1
- package/services/GetPulumiService/GetPulumiService.d.ts +1 -2
- package/services/GetPulumiService/GetPulumiService.js +1 -1
- package/services/GetPulumiService/GetPulumiService.js.map +1 -1
- package/abstractions/ApiGqlClient.d.ts +0 -23
- package/abstractions/ApiGqlClient.js +0 -5
- package/abstractions/ApiGqlClient.js.map +0 -1
- package/abstractions/InvokeLambdaFunction.d.ts +0 -18
- package/abstractions/InvokeLambdaFunction.js +0 -5
- package/abstractions/InvokeLambdaFunction.js.map +0 -1
- package/abstractions/features/pulumi/AdminPulumi.d.ts +0 -9
- package/abstractions/features/pulumi/AdminPulumi.js +0 -5
- package/abstractions/features/pulumi/AdminPulumi.js.map +0 -1
- package/abstractions/features/pulumi/ApiPulumi.d.ts +0 -9
- package/abstractions/features/pulumi/ApiPulumi.js +0 -5
- package/abstractions/features/pulumi/ApiPulumi.js.map +0 -1
- package/abstractions/features/pulumi/CorePulumi.d.ts +0 -9
- package/abstractions/features/pulumi/CorePulumi.js +0 -5
- package/abstractions/features/pulumi/CorePulumi.js.map +0 -1
- package/abstractions/features/pulumi/SetAdminCustomDomains.d.ts +0 -9
- package/abstractions/features/pulumi/SetAdminCustomDomains.js +0 -5
- package/abstractions/features/pulumi/SetAdminCustomDomains.js.map +0 -1
- package/abstractions/features/pulumi/SetApiCustomDomains.d.ts +0 -9
- package/abstractions/features/pulumi/SetApiCustomDomains.js +0 -5
- package/abstractions/features/pulumi/SetApiCustomDomains.js.map +0 -1
- package/abstractions/features/pulumi/index.d.ts +0 -5
- package/abstractions/features/pulumi/index.js +0 -5
- package/abstractions/index.d.ts +0 -6
- package/abstractions/index.js +0 -6
- package/abstractions/services/AdminStackOutputService.d.ts +0 -13
- package/abstractions/services/AdminStackOutputService.js +0 -5
- package/abstractions/services/AdminStackOutputService.js.map +0 -1
- package/abstractions/services/ApiStackOutputService.d.ts +0 -29
- package/abstractions/services/ApiStackOutputService.js +0 -5
- package/abstractions/services/ApiStackOutputService.js.map +0 -1
- package/abstractions/services/CoreStackOutputService.d.ts +0 -16
- package/abstractions/services/CoreStackOutputService.js +0 -5
- package/abstractions/services/CoreStackOutputService.js.map +0 -1
- package/exports/extensions.d.ts +0 -5
- package/exports/extensions.js +0 -5
- package/exports/infra.d.ts +0 -1
- package/exports/infra.js +0 -1
- package/extensions/AwsDefaultRegion.d.ts +0 -4
- package/extensions/AwsDefaultRegion.js +0 -23
- package/extensions/AwsDefaultRegion.js.map +0 -1
- package/extensions/BackgroundTasks.d.ts +0 -4
- package/extensions/BackgroundTasks.js +0 -24
- package/extensions/BackgroundTasks.js.map +0 -1
- package/extensions/Cms/ModelFieldCompression.d.ts +0 -4
- package/extensions/Cms/ModelFieldCompression.js +0 -24
- package/extensions/Cms/ModelFieldCompression.js.map +0 -1
- package/extensions/Mailer/Smtp.d.ts +0 -8
- package/extensions/Mailer/Smtp.js +0 -21
- package/extensions/Mailer/Smtp.js.map +0 -1
- package/extensions/Mailer/Smtp.test.js +0 -127
- package/extensions/Mailer/Smtp.test.js.map +0 -1
- package/extensions/Mailer/SmtpParamsSchema.d.ts +0 -9
- package/extensions/Mailer/SmtpParamsSchema.js +0 -17
- package/extensions/Mailer/SmtpParamsSchema.js.map +0 -1
- package/extensions/ProjectAws/AutoInstall.d.ts +0 -9
- package/extensions/ProjectAws/AutoInstall.js +0 -20
- package/extensions/ProjectAws/AutoInstall.js.map +0 -1
- package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
- package/pulumi/extensions/AdminCustomDomains.js +0 -20
- package/pulumi/extensions/AdminCustomDomains.js.map +0 -1
- package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
- package/pulumi/extensions/ApiCustomDomains.js +0 -20
- package/pulumi/extensions/ApiCustomDomains.js.map +0 -1
- package/pulumi/extensions/AwsTags.d.ts +0 -4
- package/pulumi/extensions/AwsTags.js +0 -16
- package/pulumi/extensions/AwsTags.js.map +0 -1
- package/pulumi/extensions/BlueGreenDeployments.d.ts +0 -34
- package/pulumi/extensions/BlueGreenDeployments.js +0 -38
- package/pulumi/extensions/BlueGreenDeployments.js.map +0 -1
- package/pulumi/extensions/OpenSearch.d.ts +0 -10
- package/pulumi/extensions/OpenSearch.js +0 -21
- package/pulumi/extensions/OpenSearch.js.map +0 -1
- package/pulumi/extensions/Vpc.d.ts +0 -15
- package/pulumi/extensions/Vpc.js +0 -26
- package/pulumi/extensions/Vpc.js.map +0 -1
- /package/extensions/{Mailer/Smtp.test.d.ts → registerExtensionImplementations.d.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AdminAfterDeploy, GetApp, UiService } from "@webiny/project/abstractions/index.js";
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
import {
|
|
4
|
-
import { AdminStackOutputService } from "../../abstractions/index.js";
|
|
3
|
+
import { AdminStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
5
4
|
class UploadAdminAppToS3Impl {
|
|
6
5
|
constructor(ui, getApp, adminStackOutputService){
|
|
7
6
|
this.ui = ui;
|
|
@@ -18,6 +17,7 @@ class UploadAdminAppToS3Impl {
|
|
|
18
17
|
const start = new Date().getTime();
|
|
19
18
|
const appOutput = await this.adminStackOutputService.execute();
|
|
20
19
|
if (!appOutput) throw new Error("Missing app stack output.");
|
|
20
|
+
const { uploadFolderToS3 } = await import("../../pulumi/utils/uploadFolderToS3.js");
|
|
21
21
|
await uploadFolderToS3({
|
|
22
22
|
path: buildFolderPath,
|
|
23
23
|
bucket: appOutput.appStorage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/UploadAdminAppToS3.js","sources":["../../../src/extensions/ProjectAws/UploadAdminAppToS3.ts"],"sourcesContent":["import { AdminAfterDeploy, GetApp, UiService } from \"@webiny/project/abstractions/index.js\";\nimport fs from \"fs\";\nimport {
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/UploadAdminAppToS3.js","sources":["../../../src/extensions/ProjectAws/UploadAdminAppToS3.ts"],"sourcesContent":["import { AdminAfterDeploy, GetApp, UiService } from \"@webiny/project/abstractions/index.js\";\nimport fs from \"fs\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\nimport { AdminStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nclass UploadAdminAppToS3Impl implements AdminAfterDeploy.Interface {\n constructor(\n private ui: UiService.Interface,\n private getApp: GetApp.Interface,\n private adminStackOutputService: AdminStackOutputService.Interface\n ) {}\n\n async execute(params: AdminAfterDeploy.Params) {\n // No need to upload the app if we're doing a preview.\n if (params.preview) {\n return;\n }\n\n const ui = this.ui;\n ui.info(\"Uploading React application...\");\n\n const app = this.getApp.execute(params.app);\n\n const buildFolderPath = app.paths.workspaceFolder.join(\"build\").toString();\n if (!fs.existsSync(buildFolderPath)) {\n throw new Error(\"Cannot continue, build folder not found.\");\n }\n\n const start = new Date().getTime();\n const appOutput = await this.adminStackOutputService.execute<IDefaultStackOutput>();\n if (!appOutput) {\n throw new Error(\"Missing app stack output.\");\n }\n\n // Imported here rather than at the top of the file. Every CLI command imports this hook when\n // the project SDK registers its extensions, even `webiny --help`, and a top-level import used\n // to come through the `~/pulumi` barrel, which loads all of Pulumi and the AWS SDK: about\n // 2,700 modules. The upload is the only thing that needs it, so the upload pays for it.\n const { uploadFolderToS3 } = await import(\"~/pulumi/utils/uploadFolderToS3.js\");\n\n await uploadFolderToS3({\n path: buildFolderPath,\n bucket: appOutput.appStorage,\n acl: \"private\",\n cacheControl: [\n {\n pattern: /index\\.html/,\n value: \"no-cache, no-store, must-revalidate\"\n },\n {\n pattern: /robots\\.txt/,\n value: \"no-cache, no-store, must-revalidate\"\n },\n {\n pattern: /.*/,\n value: \"max-age=31536000\"\n }\n ],\n onFileUploadSuccess: ({ paths }) => {\n ui.success(paths.relative);\n },\n onFileUploadError: ({ paths, error }) => {\n ui.error(\"Failed to upload %s\", paths.relative);\n ui.text(error.message);\n },\n onFileUploadSkip: ({ paths }) => {\n ui.info(`Skipping %s, already exists.`, paths.relative);\n }\n });\n\n const duration = (new Date().getTime() - start) / 1000;\n\n ui.success(`React application successfully uploaded in %ss.`, duration);\n }\n}\n\nexport const UploadAdminAppToS3 = AdminAfterDeploy.createImplementation({\n implementation: UploadAdminAppToS3Impl,\n dependencies: [UiService, GetApp, AdminStackOutputService]\n});\n"],"names":["UploadAdminAppToS3Impl","ui","getApp","adminStackOutputService","params","app","buildFolderPath","fs","Error","start","Date","appOutput","uploadFolderToS3","paths","error","duration","UploadAdminAppToS3","AdminAfterDeploy","UiService","GetApp","AdminStackOutputService"],"mappings":";;;AAKA,MAAMA;IACF,YACYC,EAAuB,EACvBC,MAAwB,EACxBC,uBAA0D,CACpE;aAHUF,EAAE,GAAFA;aACAC,MAAM,GAANA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,OAAO,OAAO,EACd;QAGJ,MAAMH,KAAK,IAAI,CAAC,EAAE;QAClBA,GAAG,IAAI,CAAC;QAER,MAAMI,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAACD,OAAO,GAAG;QAE1C,MAAME,kBAAkBD,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,QAAQ;QACxE,IAAI,CAACE,GAAG,UAAU,CAACD,kBACf,MAAM,IAAIE,MAAM;QAGpB,MAAMC,QAAQ,IAAIC,OAAO,OAAO;QAChC,MAAMC,YAAY,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAC5D,IAAI,CAACA,WACD,MAAM,IAAIH,MAAM;QAOpB,MAAM,EAAEI,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC;QAE1C,MAAMA,iBAAiB;YACnB,MAAMN;YACN,QAAQK,UAAU,UAAU;YAC5B,KAAK;YACL,cAAc;gBACV;oBACI,SAAS;oBACT,OAAO;gBACX;gBACA;oBACI,SAAS;oBACT,OAAO;gBACX;gBACA;oBACI,SAAS;oBACT,OAAO;gBACX;aACH;YACD,qBAAqB,CAAC,EAAEE,KAAK,EAAE;gBAC3BZ,GAAG,OAAO,CAACY,MAAM,QAAQ;YAC7B;YACA,mBAAmB,CAAC,EAAEA,KAAK,EAAEC,KAAK,EAAE;gBAChCb,GAAG,KAAK,CAAC,uBAAuBY,MAAM,QAAQ;gBAC9CZ,GAAG,IAAI,CAACa,MAAM,OAAO;YACzB;YACA,kBAAkB,CAAC,EAAED,KAAK,EAAE;gBACxBZ,GAAG,IAAI,CAAC,gCAAgCY,MAAM,QAAQ;YAC1D;QACJ;QAEA,MAAME,WAAY,KAAIL,OAAO,OAAO,KAAKD,KAAI,IAAK;QAElDR,GAAG,OAAO,CAAC,mDAAmDc;IAClE;AACJ;AAEO,MAAMC,qBAAqBC,iBAAiB,oBAAoB,CAAC;IACpE,gBAAgBjB;IAChB,cAAc;QAACkB;QAAWC;QAAQC;KAAwB;AAC9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definitions } from "@webiny/project/extensions/index.js";
|
|
2
2
|
import { definitions as index_js_definitions } from "@webiny/cli-core/extensions/index.js";
|
|
3
3
|
import { definitions as extensions_index_js_definitions } from "../../pulumi/extensions/index.js";
|
|
4
|
-
import { AutoInstall } from "
|
|
4
|
+
import { AutoInstall } from "@webiny/project-extensions-aws/extensions/AutoInstall.js";
|
|
5
5
|
const definitions_definitions = [
|
|
6
6
|
...index_js_definitions,
|
|
7
7
|
...definitions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws/definitions.js","sources":["../../../src/extensions/ProjectAws/definitions.ts"],"sourcesContent":["import {\n definitions as projectDefinitions,\n type ExtensionDefinitionModel\n} from \"@webiny/project/extensions/index.js\";\nimport { definitions as cliDefinitions } from \"@webiny/cli-core/extensions/index.js\";\nimport { definitions as projectAws } from \"~/pulumi/extensions/index.js\";\nimport { AutoInstall } from \"
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws/definitions.js","sources":["../../../src/extensions/ProjectAws/definitions.ts"],"sourcesContent":["import {\n definitions as projectDefinitions,\n type ExtensionDefinitionModel\n} from \"@webiny/project/extensions/index.js\";\nimport { definitions as cliDefinitions } from \"@webiny/cli-core/extensions/index.js\";\nimport { definitions as projectAws } from \"~/pulumi/extensions/index.js\";\nimport { AutoInstall } from \"@webiny/project-extensions-aws/extensions/AutoInstall.js\";\n\nconst definitions = [\n ...cliDefinitions,\n ...projectDefinitions,\n ...projectAws,\n AutoInstall.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"names":["definitions","cliDefinitions","projectDefinitions","projectAws","AutoInstall"],"mappings":";;;;AAQA,MAAMA,0BAAc;OACbC;OACAC;OACAC;IACHC,YAAY,GAAG;CAClB;AAED,+BAAeJ"}
|
package/extensions/ProjectAws.js
CHANGED
|
@@ -3,6 +3,7 @@ import { AdminAfterDeploy, AdminBeforeBuild, AdminBeforeWatch, AfterDeploy, ApiA
|
|
|
3
3
|
import { createPathResolver } from "@webiny/project";
|
|
4
4
|
import { CliCommand } from "@webiny/cli-core/extensions/index.js";
|
|
5
5
|
import { CorePulumi } from "../pulumi/extensions/CorePulumi.js";
|
|
6
|
+
import "./registerExtensionImplementations.js";
|
|
6
7
|
const p = createPathResolver(import.meta.dirname);
|
|
7
8
|
const ProjectAws = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Project, null), /*#__PURE__*/ react.createElement(DatabaseSetup, {
|
|
8
9
|
setupName: "ddb"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ProjectAws.js","sources":["../../src/extensions/ProjectAws.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeWatch,\n AfterDeploy,\n ApiAfterDeploy,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n BeforeDeploy,\n CoreBeforeDeploy,\n DatabaseSetup,\n ExtensionDefinitions,\n Project,\n ProjectImplementation\n} from \"@webiny/project/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport { CliCommand } from \"@webiny/cli-core/extensions/index.js\";\nimport { CorePulumi } from \"~/pulumi/extensions/CorePulumi.js\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nexport const ProjectAws = () => {\n return (\n <>\n <Project />\n\n {/* Database Setup - default to DynamoDB only */}\n <DatabaseSetup setupName=\"ddb\" />\n\n {/* Set database setup output value in Core stack */}\n <CorePulumi src={p(\"ProjectAws/SetDatabaseSetupOutput.js\")} />\n\n {/* Stack Output Services */}\n <ProjectImplementation src={p(\"ProjectAws/CoreStackOutputService.js\")} singleton />\n <ProjectImplementation src={p(\"ProjectAws/ApiStackOutputService.js\")} singleton />\n <ProjectImplementation src={p(\"ProjectAws/AdminStackOutputService.js\")} singleton />\n\n <ProjectImplementation src={p(\"../features/InvokeLambdaFunction.js\")} singleton />\n <ProjectImplementation src={p(\"../features/ApiGqlClient.js\")} singleton />\n\n <AdminAfterDeploy src={p(\"ProjectAws/UploadAdminAppToS3.js\")} />\n\n <ApiAfterDeploy src={p(\"ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js\")} />\n <ExtensionDefinitions src={p(\"definitions.js\")} />\n <ExtensionDefinitions src={p(\"ProjectAws/definitions.js\")} />\n\n {/* Admin env vars */}\n <AdminBeforeBuild src={p(\"ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js\")} />\n <AdminBeforeWatch src={p(\"ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js\")} />\n\n {/* Deployment gates — AWS-only (there is no Pulumi stack output to check off-AWS) */}\n <ApiBeforeWatch src={p(\"ProjectAws/EnsureApiDeployedBeforeWatch.js\")} />\n <AdminBeforeBuild src={p(\"ProjectAws/EnsureApiDeployedBeforeAdminBuild.js\")} />\n <AdminBeforeWatch src={p(\"ProjectAws/EnsureApiDeployedBeforeAdminWatch.js\")} />\n <ApiBeforeDeploy src={p(\"ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js\")} />\n <CoreBeforeDeploy src={p(\"ProjectAws/ValidateProductionPulumiState.js\")} />\n\n {/* Deploy-time hooks —
|
|
1
|
+
{"version":3,"file":"extensions/ProjectAws.js","sources":["../../src/extensions/ProjectAws.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeWatch,\n AfterDeploy,\n ApiAfterDeploy,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n BeforeDeploy,\n CoreBeforeDeploy,\n DatabaseSetup,\n ExtensionDefinitions,\n Project,\n ProjectImplementation\n} from \"@webiny/project/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport { CliCommand } from \"@webiny/cli-core/extensions/index.js\";\nimport { CorePulumi } from \"~/pulumi/extensions/CorePulumi.js\";\nimport \"./registerExtensionImplementations.js\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nexport const ProjectAws = () => {\n return (\n <>\n <Project />\n\n {/* Database Setup - default to DynamoDB only */}\n <DatabaseSetup setupName=\"ddb\" />\n\n {/* Set database setup output value in Core stack */}\n <CorePulumi src={p(\"ProjectAws/SetDatabaseSetupOutput.js\")} />\n\n {/* Stack Output Services */}\n <ProjectImplementation src={p(\"ProjectAws/CoreStackOutputService.js\")} singleton />\n <ProjectImplementation src={p(\"ProjectAws/ApiStackOutputService.js\")} singleton />\n <ProjectImplementation src={p(\"ProjectAws/AdminStackOutputService.js\")} singleton />\n\n <ProjectImplementation src={p(\"../features/InvokeLambdaFunction.js\")} singleton />\n <ProjectImplementation src={p(\"../features/ApiGqlClient.js\")} singleton />\n\n <AdminAfterDeploy src={p(\"ProjectAws/UploadAdminAppToS3.js\")} />\n\n <ApiAfterDeploy src={p(\"ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js\")} />\n <ExtensionDefinitions src={p(\"definitions.js\")} />\n <ExtensionDefinitions src={p(\"ProjectAws/definitions.js\")} />\n\n {/* Admin env vars */}\n <AdminBeforeBuild src={p(\"ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js\")} />\n <AdminBeforeWatch src={p(\"ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js\")} />\n\n {/* Deployment gates — AWS-only (there is no Pulumi stack output to check off-AWS) */}\n <ApiBeforeWatch src={p(\"ProjectAws/EnsureApiDeployedBeforeWatch.js\")} />\n <AdminBeforeBuild src={p(\"ProjectAws/EnsureApiDeployedBeforeAdminBuild.js\")} />\n <AdminBeforeWatch src={p(\"ProjectAws/EnsureApiDeployedBeforeAdminWatch.js\")} />\n <ApiBeforeDeploy src={p(\"ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js\")} />\n <CoreBeforeDeploy src={p(\"ProjectAws/ValidateProductionPulumiState.js\")} />\n\n {/* Deploy-time hooks — standalone hosting type has no deploy command, so these are AWS-only */}\n <BeforeDeploy src={p(\"ProjectAws/EnsureTelemetryEnabledForOss.js\")} />\n <BeforeDeploy src={p(\"ProjectAws/ValidateEncryptionBeforeDeploy.js\")} />\n <AdminAfterDeploy src={p(\"ProjectAws/TelemetryNoLongerNewUser.js\")} />\n\n {/* AWS credentials check */}\n <BeforeDeploy src={p(\"ProjectAws/EnsureAwsCredentialsBeforeDeploy.js\")} />\n\n {/* Blue-green */}\n <CliCommand src={p(\"ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js\")} />\n <BeforeDeploy src={p(\"ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js\")} />\n <AfterDeploy\n src={p(\"ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js\")}\n />\n </>\n );\n};\n"],"names":["p","createPathResolver","ProjectAws","Project","DatabaseSetup","CorePulumi","ProjectImplementation","AdminAfterDeploy","ApiAfterDeploy","ExtensionDefinitions","AdminBeforeBuild","AdminBeforeWatch","ApiBeforeWatch","ApiBeforeDeploy","CoreBeforeDeploy","BeforeDeploy","CliCommand","AfterDeploy"],"mappings":";;;;;;AAqBA,MAAMA,IAAIC,mBAAmB,YAAY,OAAO;AAEzC,MAAMC,aAAa,IACf,WAAP,GACI,wDACI,oBAACC,SAAOA,OAAAA,WAAAA,GAGR,oBAACC,eAAaA;QAAC,WAAU;sBAGzB,oBAACC,YAAUA;QAAC,KAAKL,EAAE;sBAGnB,oBAACM,uBAAqBA;QAAC,KAAKN,EAAE;QAAyC;sBACvE,oBAACM,uBAAqBA;QAAC,KAAKN,EAAE;QAAwC;sBACtE,oBAACM,uBAAqBA;QAAC,KAAKN,EAAE;QAA0C;sBAExE,oBAACM,uBAAqBA;QAAC,KAAKN,EAAE;QAAwC;sBACtE,oBAACM,uBAAqBA;QAAC,KAAKN,EAAE;QAAgC;sBAE9D,oBAACO,kBAAgBA;QAAC,KAAKP,EAAE;sBAEzB,oBAACQ,gBAAcA;QAAC,KAAKR,EAAE;sBACvB,oBAACS,sBAAoBA;QAAC,KAAKT,EAAE;sBAC7B,oBAACS,sBAAoBA;QAAC,KAAKT,EAAE;sBAG7B,oBAACU,kBAAgBA;QAAC,KAAKV,EAAE;sBACzB,oBAACW,kBAAgBA;QAAC,KAAKX,EAAE;sBAGzB,oBAACY,gBAAcA;QAAC,KAAKZ,EAAE;sBACvB,oBAACU,kBAAgBA;QAAC,KAAKV,EAAE;sBACzB,oBAACW,kBAAgBA;QAAC,KAAKX,EAAE;sBACzB,oBAACa,iBAAeA;QAAC,KAAKb,EAAE;sBACxB,oBAACc,kBAAgBA;QAAC,KAAKd,EAAE;sBAGzB,oBAACe,cAAYA;QAAC,KAAKf,EAAE;sBACrB,oBAACe,cAAYA;QAAC,KAAKf,EAAE;sBACrB,oBAACO,kBAAgBA;QAAC,KAAKP,EAAE;sBAGzB,oBAACe,cAAYA;QAAC,KAAKf,EAAE;sBAGrB,oBAACgB,YAAUA;QAAC,KAAKhB,EAAE;sBACnB,oBAACe,cAAYA;QAAC,KAAKf,EAAE;sBACrB,oBAACiB,aAAWA;QACR,KAAKjB,EAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
2
|
-
import { ApiPulumi } from "
|
|
2
|
+
import { ApiPulumi } from "@webiny/project-extensions-aws/abstractions/features/pulumi/index.js";
|
|
3
3
|
import type { ApiPulumiApp } from "../pulumi/apps/api/createApiPulumiApp.js";
|
|
4
4
|
declare class RegisterRoutesPulumiImpl implements ApiPulumi.Interface {
|
|
5
5
|
private getProjectConfigService;
|
|
@@ -7,6 +7,6 @@ declare class RegisterRoutesPulumiImpl implements ApiPulumi.Interface {
|
|
|
7
7
|
execute(app: ApiPulumiApp): Promise<void>;
|
|
8
8
|
}
|
|
9
9
|
export declare const RegisterRoutesPulumi: typeof RegisterRoutesPulumiImpl & {
|
|
10
|
-
__abstraction: import("@webiny/di").Abstraction<import("
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/index.js").IApiPulumi>;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
2
|
-
import { ApiPulumi } from "
|
|
2
|
+
import { ApiPulumi } from "@webiny/project-extensions-aws/abstractions/features/pulumi/index.js";
|
|
3
3
|
import { ApiRoute } from "./ApiRoute.js";
|
|
4
|
-
import { ApiGraphql } from "../pulumi/apps/api/ApiGraphql.js";
|
|
5
4
|
import { deriveRouteName, toApiGatewayPath } from "./routePath.js";
|
|
6
5
|
class RegisterRoutesPulumiImpl {
|
|
7
6
|
constructor(getProjectConfigService){
|
|
@@ -11,6 +10,7 @@ class RegisterRoutesPulumiImpl {
|
|
|
11
10
|
const projectConfig = await this.getProjectConfigService.execute();
|
|
12
11
|
const routeExtensions = projectConfig.extensionsByType(ApiRoute);
|
|
13
12
|
if (!routeExtensions.length) return;
|
|
13
|
+
const { ApiGraphql } = await import("../pulumi/apps/api/ApiGraphql.js");
|
|
14
14
|
const graphqlModule = app.getModule(ApiGraphql);
|
|
15
15
|
for (const ext of routeExtensions){
|
|
16
16
|
const { path: routePath, method, routeName } = ext.params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/RegisterRoutesPulumi.js","sources":["../../src/extensions/RegisterRoutesPulumi.ts"],"sourcesContent":["import { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiPulumi } from \"
|
|
1
|
+
{"version":3,"file":"extensions/RegisterRoutesPulumi.js","sources":["../../src/extensions/RegisterRoutesPulumi.ts"],"sourcesContent":["import { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiPulumi } from \"@webiny/project-extensions-aws/abstractions/features/pulumi/index.js\";\nimport type { ApiPulumiApp } from \"~/pulumi/apps/api/createApiPulumiApp.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { deriveRouteName, toApiGatewayPath } from \"./routePath.js\";\n\nclass RegisterRoutesPulumiImpl implements ApiPulumi.Interface {\n constructor(private getProjectConfigService: GetProjectConfigService.Interface) {}\n\n async execute(app: ApiPulumiApp): Promise<void> {\n // No tags filter — finds ApiRestRoute extensions regardless of their runtimeContext.\n const projectConfig = await this.getProjectConfigService.execute();\n const routeExtensions = projectConfig.extensionsByType(ApiRoute);\n\n if (!routeExtensions.length) {\n return;\n }\n\n // Imported here rather than at the top of the file. Every CLI command imports this extension\n // when the project SDK registers it, even `webiny --help`, and `ApiGraphql` pulls in all of\n // Pulumi and the AWS SDK: about 2,700 modules. By the time `execute` runs we are inside a\n // Pulumi program that has already loaded all of that, so importing it here costs nothing.\n const { ApiGraphql } = await import(\"~/pulumi/apps/api/ApiGraphql.js\");\n\n const graphqlModule = app.getModule(ApiGraphql);\n\n for (const ext of routeExtensions) {\n const { path: routePath, method, routeName } = ext.params;\n const name = routeName ?? deriveRouteName(routePath, method);\n graphqlModule.addRoute({\n name,\n // The prop accepts `:id` too; API Gateway only understands `{id}`.\n path: toApiGatewayPath(routePath) as `/${string}`,\n method\n });\n }\n }\n}\n\nexport const RegisterRoutesPulumi = ApiPulumi.createImplementation({\n implementation: RegisterRoutesPulumiImpl,\n dependencies: [GetProjectConfigService]\n});\n"],"names":["RegisterRoutesPulumiImpl","getProjectConfigService","app","projectConfig","routeExtensions","ApiRoute","ApiGraphql","graphqlModule","ext","routePath","method","routeName","name","deriveRouteName","toApiGatewayPath","RegisterRoutesPulumi","ApiPulumi","GetProjectConfigService"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,uBAA0D,CAAE;aAA5DA,uBAAuB,GAAvBA;IAA6D;IAEjF,MAAM,QAAQC,GAAiB,EAAiB;QAE5C,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAChE,MAAMC,kBAAkBD,cAAc,gBAAgB,CAACE;QAEvD,IAAI,CAACD,gBAAgB,MAAM,EACvB;QAOJ,MAAM,EAAEE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC;QAEpC,MAAMC,gBAAgBL,IAAI,SAAS,CAACI;QAEpC,KAAK,MAAME,OAAOJ,gBAAiB;YAC/B,MAAM,EAAE,MAAMK,SAAS,EAAEC,MAAM,EAAEC,SAAS,EAAE,GAAGH,IAAI,MAAM;YACzD,MAAMI,OAAOD,aAAaE,gBAAgBJ,WAAWC;YACrDH,cAAc,QAAQ,CAAC;gBACnBK;gBAEA,MAAME,iBAAiBL;gBACvBC;YACJ;QACJ;IACJ;AACJ;AAEO,MAAMK,uBAAuBC,UAAU,oBAAoB,CAAC;IAC/D,gBAAgBhB;IAChB,cAAc;QAACiB;KAAwB;AAC3C"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ApiLambdaFunction } from "./ApiLambdaFunction.js";
|
|
2
2
|
import { ApiRoute } from "./ApiRoute.js";
|
|
3
3
|
import { OpenSearch } from "./OpenSearch.js";
|
|
4
|
-
import { Smtp } from "./Mailer/Smtp.js";
|
|
5
4
|
const definitions = [
|
|
6
5
|
ApiLambdaFunction.def,
|
|
7
6
|
ApiRoute.def,
|
|
8
|
-
OpenSearch.def
|
|
9
|
-
Smtp.def
|
|
7
|
+
OpenSearch.def
|
|
10
8
|
];
|
|
11
9
|
const extensions_definitions = definitions;
|
|
12
10
|
export default extensions_definitions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/definitions.js","sources":["../../src/extensions/definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"extensions/definitions.js","sources":["../../src/extensions/definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { type ExtensionDefinitionModel } from \"@webiny/project/defineExtension\";\n\nconst definitions = [\n ApiLambdaFunction.def,\n ApiRoute.def,\n OpenSearch.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"names":["definitions","ApiLambdaFunction","ApiRoute","OpenSearch"],"mappings":";;;AAKA,MAAMA,cAAc;IAChBC,kBAAkB,GAAG;IACrBC,SAAS,GAAG;IACZC,WAAW,GAAG;CACjB;AAED,+BAAeH"}
|
package/extensions/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./OpenSearch.js";
|
|
2
|
-
export
|
|
3
|
-
export * from "./ProjectAws/AutoInstall.js";
|
|
2
|
+
export { AwsDefaultRegion, AutoInstall } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
4
3
|
export * from "./ProjectAws.js";
|
|
5
4
|
export * from "./ApiLambdaFunction.js";
|
|
6
5
|
export * from "./ApiRoute.js";
|
|
7
|
-
export { Smtp as MailerSmtp } from "
|
|
6
|
+
export { Smtp as MailerSmtp } from "@webiny/project/extensions/api/index.js";
|
package/extensions/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./OpenSearch.js";
|
|
2
|
-
export * from "./AwsDefaultRegion.js";
|
|
3
|
-
export * from "./ProjectAws/AutoInstall.js";
|
|
4
2
|
export * from "./ProjectAws.js";
|
|
5
3
|
export * from "./ApiLambdaFunction.js";
|
|
6
4
|
export * from "./ApiRoute.js";
|
|
7
|
-
export {
|
|
5
|
+
export { AutoInstall, AwsDefaultRegion } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
6
|
+
export { Smtp as MailerSmtp } from "@webiny/project/extensions/api/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { registerExtensionImplementation } from "@webiny/project/extensions/hosting/index.js";
|
|
2
|
+
import { ApiLambdaFunction, ApiRoute, OpenSearch } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
3
|
+
import { ApiLambdaFunction as external_ApiLambdaFunction_js_ApiLambdaFunction } from "./ApiLambdaFunction.js";
|
|
4
|
+
import { ApiRoute as external_ApiRoute_js_ApiRoute } from "./ApiRoute.js";
|
|
5
|
+
import { OpenSearch as external_OpenSearch_js_OpenSearch } from "./OpenSearch.js";
|
|
6
|
+
registerExtensionImplementation("aws", OpenSearch, external_OpenSearch_js_OpenSearch);
|
|
7
|
+
registerExtensionImplementation("aws", ApiRoute, external_ApiRoute_js_ApiRoute);
|
|
8
|
+
registerExtensionImplementation("aws", ApiLambdaFunction, external_ApiLambdaFunction_js_ApiLambdaFunction);
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=registerExtensionImplementations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/registerExtensionImplementations.js","sources":["../../src/extensions/registerExtensionImplementations.ts"],"sourcesContent":["import { registerExtensionImplementation } from \"@webiny/project/extensions/hosting/index.js\";\nimport { ApiLambdaFunction as ApiLambdaFunctionSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiRoute as ApiRouteSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { OpenSearch as OpenSearchSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\n\n/*\n * The shared namespaces in `@webiny/extensions` (exported through `webiny/extensions`) only hold\n * specs of these extensions, because what they render depends on code from this package. Running\n * this module makes the shared `Infra.OpenSearch`, `Api.Route` and `Infra.Api.LambdaFunction`\n * render the full components below. `ProjectAws.tsx` imports it, so it runs before any project\n * config renders.\n */\nregisterExtensionImplementation(\"aws\", OpenSearchSpec, OpenSearch);\nregisterExtensionImplementation(\"aws\", ApiRouteSpec, ApiRoute);\nregisterExtensionImplementation(\"aws\", ApiLambdaFunctionSpec, ApiLambdaFunction);\n"],"names":["registerExtensionImplementation","OpenSearchSpec","OpenSearch","ApiRouteSpec","ApiRoute","ApiLambdaFunctionSpec","ApiLambdaFunction"],"mappings":";;;;;AAeAA,gCAAgC,OAAOC,YAAgBC;AACvDF,gCAAgC,OAAOG,UAAcC;AACrDJ,gCAAgC,OAAOK,mBAAuBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApiGqlClient as ApiGqlClientAbstraction } from "
|
|
2
|
-
import { ApiStackOutputService } from "
|
|
3
|
-
import { InvokeLambdaFunction } from "
|
|
1
|
+
import { ApiGqlClient as ApiGqlClientAbstraction } from "@webiny/project-extensions-aws/abstractions/ApiGqlClient.js";
|
|
2
|
+
import { ApiStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
3
|
+
import { InvokeLambdaFunction } from "@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js";
|
|
4
4
|
declare class ApiGqlClientImpl implements ApiGqlClientAbstraction.Interface {
|
|
5
5
|
private apiStackOutputService;
|
|
6
6
|
private invokeLambdaFunction;
|
|
@@ -16,6 +16,6 @@ declare class ApiGqlClientImpl implements ApiGqlClientAbstraction.Interface {
|
|
|
16
16
|
private executeGraphQL;
|
|
17
17
|
}
|
|
18
18
|
export declare const ApiGqlClient: typeof ApiGqlClientImpl & {
|
|
19
|
-
__abstraction: import("@webiny/di").Abstraction<import("
|
|
19
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions/ApiGqlClient.js").IApiGqlClient>;
|
|
20
20
|
};
|
|
21
21
|
export {};
|
package/features/ApiGqlClient.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApiGqlClient } from "
|
|
2
|
-
import { ApiStackOutputService } from "
|
|
3
|
-
import { InvokeLambdaFunction } from "
|
|
1
|
+
import { ApiGqlClient } from "@webiny/project-extensions-aws/abstractions/ApiGqlClient.js";
|
|
2
|
+
import { ApiStackOutputService } from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
3
|
+
import { InvokeLambdaFunction } from "@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js";
|
|
4
4
|
class ApiGqlClientImpl {
|
|
5
5
|
constructor(apiStackOutputService, invokeLambdaFunction){
|
|
6
6
|
this.apiStackOutputService = apiStackOutputService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/ApiGqlClient.js","sources":["../../src/features/ApiGqlClient.ts"],"sourcesContent":["import { ApiGqlClient as ApiGqlClientAbstraction } from \"
|
|
1
|
+
{"version":3,"file":"features/ApiGqlClient.js","sources":["../../src/features/ApiGqlClient.ts"],"sourcesContent":["import { ApiGqlClient as ApiGqlClientAbstraction } from \"@webiny/project-extensions-aws/abstractions/ApiGqlClient.js\";\nimport { ApiStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { InvokeLambdaFunction } from \"@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js\";\n\nclass ApiGqlClientImpl implements ApiGqlClientAbstraction.Interface {\n constructor(\n private apiStackOutputService: ApiStackOutputService.Interface,\n private invokeLambdaFunction: InvokeLambdaFunction.Interface\n ) {}\n\n async query<T = any>(params: {\n query: string;\n variables?: Record<string, any>;\n }): Promise<ApiGqlClientAbstraction.Response<T>> {\n return this.executeGraphQL({\n query: params.query,\n variables: params.variables\n });\n }\n\n async mutation<T = any>(params: {\n mutation: string;\n variables?: Record<string, any>;\n }): Promise<ApiGqlClientAbstraction.Response<T>> {\n return this.executeGraphQL({\n query: params.mutation,\n variables: params.variables\n });\n }\n\n private async executeGraphQL(params: {\n query: string;\n variables?: Record<string, any>;\n }): Promise<ApiGqlClientAbstraction.Response> {\n // Get GraphQL Lambda function name from API stack output\n const stackOutput = await this.apiStackOutputService.execute<{\n graphqlLambdaName: string;\n }>();\n\n if (!stackOutput) {\n throw new Error(\"Could not retrieve API stack output for GraphQL client.\");\n }\n\n const { graphqlLambdaName } = stackOutput;\n\n // Invoke Lambda with API Gateway event format\n const result = await this.invokeLambdaFunction.execute({\n functionName: graphqlLambdaName,\n payload: {\n path: \"/graphql\",\n httpMethod: \"POST\",\n headers: {\n \"x-tenant\": \"root\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n query: params.query,\n variables: params.variables\n })\n }\n });\n\n // Parse Lambda response (API Gateway format)\n const lambdaResponse = result.payload;\n const graphqlResponse = JSON.parse(lambdaResponse.body);\n\n return graphqlResponse;\n }\n}\n\nexport const ApiGqlClient = ApiGqlClientAbstraction.createImplementation({\n implementation: ApiGqlClientImpl,\n dependencies: [ApiStackOutputService, InvokeLambdaFunction]\n});\n"],"names":["ApiGqlClientImpl","apiStackOutputService","invokeLambdaFunction","params","stackOutput","Error","graphqlLambdaName","result","JSON","lambdaResponse","graphqlResponse","ApiGqlClient","ApiGqlClientAbstraction","ApiStackOutputService","InvokeLambdaFunction"],"mappings":";;;AAIA,MAAMA;IACF,YACYC,qBAAsD,EACtDC,oBAAoD,CAC9D;aAFUD,qBAAqB,GAArBA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,MAAeC,MAGpB,EAAgD;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC;YACvB,OAAOA,OAAO,KAAK;YACnB,WAAWA,OAAO,SAAS;QAC/B;IACJ;IAEA,MAAM,SAAkBA,MAGvB,EAAgD;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC;YACvB,OAAOA,OAAO,QAAQ;YACtB,WAAWA,OAAO,SAAS;QAC/B;IACJ;IAEA,MAAc,eAAeA,MAG5B,EAA6C;QAE1C,MAAMC,cAAc,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO;QAI5D,IAAI,CAACA,aACD,MAAM,IAAIC,MAAM;QAGpB,MAAM,EAAEC,iBAAiB,EAAE,GAAGF;QAG9B,MAAMG,SAAS,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;YACnD,cAAcD;YACd,SAAS;gBACL,MAAM;gBACN,YAAY;gBACZ,SAAS;oBACL,YAAY;oBACZ,gBAAgB;gBACpB;gBACA,MAAME,KAAK,SAAS,CAAC;oBACjB,OAAOL,OAAO,KAAK;oBACnB,WAAWA,OAAO,SAAS;gBAC/B;YACJ;QACJ;QAGA,MAAMM,iBAAiBF,OAAO,OAAO;QACrC,MAAMG,kBAAkBF,KAAK,KAAK,CAACC,eAAe,IAAI;QAEtD,OAAOC;IACX;AACJ;AAEO,MAAMC,4BAAeC,aAAAA,oBAA4C,CAAC;IACrE,gBAAgBZ;IAChB,cAAc;QAACa;QAAuBC;KAAqB;AAC/D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GetAppStackOutput } from "@webiny/project/abstractions/index.js";
|
|
2
|
-
import { InvokeLambdaFunction as InvokeLambdaFunctionAbstraction } from "
|
|
2
|
+
import { InvokeLambdaFunction as InvokeLambdaFunctionAbstraction } from "@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js";
|
|
3
3
|
export declare class InvokeLambdaFunctionImpl implements InvokeLambdaFunctionAbstraction.Interface {
|
|
4
4
|
private getAppStackOutput;
|
|
5
5
|
constructor(getAppStackOutput: GetAppStackOutput.Interface);
|
|
6
6
|
execute<T = any>(params: InvokeLambdaFunctionAbstraction.Params): Promise<InvokeLambdaFunctionAbstraction.Result<T>>;
|
|
7
7
|
}
|
|
8
8
|
export declare const InvokeLambdaFunction: typeof InvokeLambdaFunctionImpl & {
|
|
9
|
-
__abstraction: import("@webiny/di").Abstraction<import("
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-extensions-aws/abstractions").IInvokeLambdaFunction>;
|
|
10
10
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { InvokeCommand, LambdaClient } from "@webiny/aws-sdk/client-lambda/index.js";
|
|
2
1
|
import { GetAppStackOutput } from "@webiny/project/abstractions/index.js";
|
|
3
|
-
import { InvokeLambdaFunction } from "
|
|
2
|
+
import { InvokeLambdaFunction } from "@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js";
|
|
4
3
|
class InvokeLambdaFunctionImpl {
|
|
5
4
|
constructor(getAppStackOutput){
|
|
6
5
|
this.getAppStackOutput = getAppStackOutput;
|
|
@@ -8,6 +7,7 @@ class InvokeLambdaFunctionImpl {
|
|
|
8
7
|
async execute(params) {
|
|
9
8
|
const stackOutput = await this.getAppStackOutput.execute("api");
|
|
10
9
|
if (!stackOutput) throw new Error("Could not retrieve API stack output for Lambda invocation.");
|
|
10
|
+
const { LambdaClient, InvokeCommand } = await import("@webiny/aws-sdk/client-lambda/index.js");
|
|
11
11
|
const { region } = stackOutput;
|
|
12
12
|
const lambdaClient = new LambdaClient({
|
|
13
13
|
region
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/InvokeLambdaFunction.js","sources":["../../src/features/InvokeLambdaFunction.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"features/InvokeLambdaFunction.js","sources":["../../src/features/InvokeLambdaFunction.ts"],"sourcesContent":["import { GetAppStackOutput } from \"@webiny/project/abstractions/index.js\";\nimport { InvokeLambdaFunction as InvokeLambdaFunctionAbstraction } from \"@webiny/project-extensions-aws/abstractions/InvokeLambdaFunction.js\";\nimport { IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport class InvokeLambdaFunctionImpl implements InvokeLambdaFunctionAbstraction.Interface {\n constructor(private getAppStackOutput: GetAppStackOutput.Interface) {}\n\n async execute<T = any>(\n params: InvokeLambdaFunctionAbstraction.Params\n ): Promise<InvokeLambdaFunctionAbstraction.Result<T>> {\n // Get region from stack output\n const stackOutput = await this.getAppStackOutput.execute<IDefaultStackOutput>(\"api\");\n\n if (!stackOutput) {\n throw new Error(\"Could not retrieve API stack output for Lambda invocation.\");\n }\n\n // Loaded here rather than at the top of the file. Validating the project config imports this\n // file on every command, and only an actual invocation needs the Lambda client.\n const { LambdaClient, InvokeCommand } =\n await import(\"@webiny/aws-sdk/client-lambda/index.js\");\n\n const { region } = stackOutput;\n const lambdaClient = new LambdaClient({ region });\n\n const response = await lambdaClient.send(\n new InvokeCommand({\n FunctionName: params.functionName,\n InvocationType: params.invocationType || \"RequestResponse\",\n Payload: JSON.stringify(params.payload)\n })\n );\n\n const decoder = new TextDecoder(\"utf-8\");\n const payload = JSON.parse(decoder.decode(response.Payload));\n\n return {\n statusCode: response.StatusCode,\n payload\n };\n }\n}\n\nexport const InvokeLambdaFunction = InvokeLambdaFunctionAbstraction.createImplementation({\n implementation: InvokeLambdaFunctionImpl,\n dependencies: [GetAppStackOutput]\n});\n"],"names":["InvokeLambdaFunctionImpl","getAppStackOutput","params","stackOutput","Error","LambdaClient","InvokeCommand","region","lambdaClient","response","JSON","decoder","TextDecoder","payload","InvokeLambdaFunction","InvokeLambdaFunctionAbstraction","GetAppStackOutput"],"mappings":";;AAIO,MAAMA;IACT,YAAoBC,iBAA8C,CAAE;aAAhDA,iBAAiB,GAAjBA;IAAiD;IAErE,MAAM,QACFC,MAA8C,EACI;QAElD,MAAMC,cAAc,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAsB;QAE9E,IAAI,CAACA,aACD,MAAM,IAAIC,MAAM;QAKpB,MAAM,EAAEC,YAAY,EAAEC,aAAa,EAAE,GACjC,MAAM,MAAM,CAAC;QAEjB,MAAM,EAAEC,MAAM,EAAE,GAAGJ;QACnB,MAAMK,eAAe,IAAIH,aAAa;YAAEE;QAAO;QAE/C,MAAME,WAAW,MAAMD,aAAa,IAAI,CACpC,IAAIF,cAAc;YACd,cAAcJ,OAAO,YAAY;YACjC,gBAAgBA,OAAO,cAAc,IAAI;YACzC,SAASQ,KAAK,SAAS,CAACR,OAAO,OAAO;QAC1C;QAGJ,MAAMS,UAAU,IAAIC,YAAY;QAChC,MAAMC,UAAUH,KAAK,KAAK,CAACC,QAAQ,MAAM,CAACF,SAAS,OAAO;QAE1D,OAAO;YACH,YAAYA,SAAS,UAAU;YAC/BI;QACJ;IACJ;AACJ;AAEO,MAAMC,4CAAuBC,qBAAAA,oBAAoD,CAAC;IACrF,gBAAgBf;IAChB,cAAc;QAACgB;KAAkB;AACrC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { GetApp, ListAppLambdaFunctionsService, LoggerService, ProjectSdkParamsService, PulumiExportService, PulumiGetStackOutputService, UiService, Watch, WatchedLambdaFunctionsService } from "@webiny/project/abstractions/index.js";
|
|
2
2
|
import chalk from "chalk";
|
|
3
|
-
import { getIotEndpoint } from "./getIotEndpoint.js";
|
|
4
|
-
import { replaceLambdaFunctions } from "./replaceLambdaFunctions.js";
|
|
5
|
-
import { initInvocationForwarding } from "@webiny/project/features/Watch/initInvocationForwarding.js";
|
|
6
3
|
class AwsWatch {
|
|
7
4
|
constructor(getApp, logger, listAppLambdaFunctionsService, ui, pulumiGetStackOutputService, pulumiExportService, watchedLambdaFunctionsService, projectSdkParamsService, decoratee){
|
|
8
5
|
this.getApp = getApp;
|
|
@@ -52,6 +49,9 @@ class AwsWatch {
|
|
|
52
49
|
if (!coreStackOutput) throw new Error(`You must deploy the ${chalk.bold("core")} app before you can start a watch session. To do that, run: ${chalk.bold(`yarn webiny deploy core --env ${sdkParams.env}`)}`);
|
|
53
50
|
const deploymentId = coreStackOutput?.deploymentId;
|
|
54
51
|
const iotEndpointTopic = `webiny-watch-${deploymentId}`;
|
|
52
|
+
const { getIotEndpoint } = await import("./getIotEndpoint.js");
|
|
53
|
+
const { replaceLambdaFunctions } = await import("./replaceLambdaFunctions.js");
|
|
54
|
+
const { initInvocationForwarding } = await import("@webiny/project/features/Watch/initInvocationForwarding.js");
|
|
55
55
|
const iotEndpoint = await getIotEndpoint(coreStackOutput);
|
|
56
56
|
const sessionId = new Date().getTime();
|
|
57
57
|
const increaseTimeout = params.increaseTimeout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/Watch/AwsWatch.js","sources":["../../../src/features/Watch/AwsWatch.ts"],"sourcesContent":["import {\n GetApp,\n ListAppLambdaFunctionsService,\n LoggerService,\n ProjectSdkParamsService,\n PulumiExportService,\n PulumiGetStackOutputService,\n UiService,\n Watch,\n WatchedLambdaFunctionsService\n} from \"@webiny/project/abstractions/index.js\";\nimport chalk from \"chalk\";\nimport type inspectorType from \"inspector\";\nimport { type ICoreStackOutput } from \"@webiny/project/abstractions/features/GetAppStackOutput.js\";\nimport { getIotEndpoint } from \"./getIotEndpoint.js\";\nimport { replaceLambdaFunctions } from \"./replaceLambdaFunctions.js\";\nimport { initInvocationForwarding } from \"@webiny/project/features/Watch/initInvocationForwarding.js\";\n\nexport class AwsWatch implements Watch.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private listAppLambdaFunctionsService: ListAppLambdaFunctionsService.Interface,\n private ui: UiService.Interface,\n private pulumiGetStackOutputService: PulumiGetStackOutputService.Interface,\n private pulumiExportService: PulumiExportService.Interface,\n private watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: Watch.Interface\n ) {}\n\n async execute(params: Watch.Params): Promise<Watch.Result> {\n // Validate Lambda-specific params before the base runs workspace build.\n if (\"app\" in params && params.increaseTimeout && params.increaseTimeout > 900) {\n throw new Error(\n `When increasing the timeout, the maximum value that can be passed is 900 seconds (15 minutes).`\n );\n }\n\n const result = await this.decoratee.execute(params);\n\n // No Lambda machinery for package-only watch.\n if (!(\"app\" in params)) {\n return result;\n }\n\n const app = this.getApp.execute(params.app);\n const sdkParams = this.projectSdkParamsService.get();\n const ui = this.ui;\n const logger = this.logger;\n\n const functionsWhitelist = Array.isArray(params.function)\n ? params.function\n : ([params.function].filter(Boolean) as string[]);\n\n const functionsList = await this.listAppLambdaFunctionsService.execute(app, {\n whitelist: functionsWhitelist\n });\n\n const deployCommand = `yarn webiny deploy ${app.name} --env ${sdkParams.env}`;\n const learnMoreLink = \"https://webiny.link/local-aws-lambda-development\";\n const troubleshootingLink = learnMoreLink + \"#troubleshooting\";\n\n if (functionsList.meta.count === 0) {\n if (functionsList.meta.totalCount > 0) {\n ui.info(\n [\n \"No AWS Lambda functions will be invoked locally. If this is unexpected, you can try the following:\",\n \" ‣ stop the current development session\",\n \" ‣ redeploy the %s application by running %s command\",\n \" ‣ start a new %s session by rerunning %s command\",\n \"\",\n \"Learn more: %s\"\n ].join(\"\\n\"),\n app.name,\n deployCommand,\n \"webiny watch\",\n \"webiny watch\",\n troubleshootingLink\n );\n }\n return result;\n }\n\n ui.info(`Local AWS Lambda development session started.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n\n logger.debug(\n \"The events for following AWS Lambda functions will be forwarded locally: \",\n functionsList.list.map(fn => fn.name)\n );\n\n ui.emptyLine();\n const { default: exitHook } = await import(/* webpackChunkName: \"exit-hook\" */ \"exit-hook\");\n\n exitHook(() => {\n console.log();\n console.log();\n\n ui.info(`Terminating local AWS Lambda development session.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app?.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n });\n\n const coreApp = this.getApp.execute(\"core\");\n const coreStackOutput =\n await this.pulumiGetStackOutputService.execute<ICoreStackOutput>(coreApp);\n\n if (!coreStackOutput) {\n throw new Error(\n `You must deploy the ${chalk.bold(\n \"core\"\n )} app before you can start a watch session. To do that, run: ${chalk.bold(\n `yarn webiny deploy core --env ${sdkParams.env}`\n )}`\n );\n }\n\n const deploymentId = coreStackOutput?.deploymentId;\n const iotEndpointTopic = `webiny-watch-${deploymentId}`;\n const iotEndpoint = await getIotEndpoint(coreStackOutput);\n\n const sessionId = new Date().getTime();\n const increaseTimeout = params.increaseTimeout;\n const localExecutionHandshakeTimeout = params.increaseHandshakeTimeout || 5;\n\n replaceLambdaFunctions({\n app,\n deploymentId,\n dependencies: {\n uiService: ui,\n loggerService: logger,\n pulumiExportService: this.pulumiExportService,\n watchedLambdaFunctionsService: this.watchedLambdaFunctionsService\n },\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout\n });\n\n let inspector: typeof inspectorType | undefined = undefined;\n if (params.inspect) {\n inspector = await import(\"inspector\");\n inspector!.open(9229, \"127.0.0.1\");\n ui.emptyLine();\n\n exitHook(() => {\n inspector!.close();\n });\n }\n\n initInvocationForwarding({\n iotEndpoint,\n iotEndpointTopic,\n functionsList,\n sessionId\n });\n\n return result;\n }\n}\n\nexport const awsWatch = Watch.createDecorator({\n decorator: AwsWatch,\n dependencies: [\n GetApp,\n LoggerService,\n ListAppLambdaFunctionsService,\n UiService,\n PulumiGetStackOutputService,\n PulumiExportService,\n WatchedLambdaFunctionsService,\n ProjectSdkParamsService\n ]\n});\n"],"names":["AwsWatch","getApp","logger","listAppLambdaFunctionsService","ui","pulumiGetStackOutputService","pulumiExportService","watchedLambdaFunctionsService","projectSdkParamsService","decoratee","params","Error","result","app","sdkParams","functionsWhitelist","Array","Boolean","functionsList","deployCommand","learnMoreLink","troubleshootingLink","fn","exitHook","console","coreApp","coreStackOutput","chalk","deploymentId","iotEndpointTopic","iotEndpoint","getIotEndpoint","sessionId","Date","increaseTimeout","localExecutionHandshakeTimeout","replaceLambdaFunctions","inspector","initInvocationForwarding","awsWatch","Watch","GetApp","LoggerService","ListAppLambdaFunctionsService","UiService","PulumiGetStackOutputService","PulumiExportService","WatchedLambdaFunctionsService","ProjectSdkParamsService"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"features/Watch/AwsWatch.js","sources":["../../../src/features/Watch/AwsWatch.ts"],"sourcesContent":["import {\n GetApp,\n ListAppLambdaFunctionsService,\n LoggerService,\n ProjectSdkParamsService,\n PulumiExportService,\n PulumiGetStackOutputService,\n UiService,\n Watch,\n WatchedLambdaFunctionsService\n} from \"@webiny/project/abstractions/index.js\";\nimport chalk from \"chalk\";\nimport type inspectorType from \"inspector\";\nimport { type ICoreStackOutput } from \"@webiny/project/abstractions/features/GetAppStackOutput.js\";\n\nexport class AwsWatch implements Watch.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private listAppLambdaFunctionsService: ListAppLambdaFunctionsService.Interface,\n private ui: UiService.Interface,\n private pulumiGetStackOutputService: PulumiGetStackOutputService.Interface,\n private pulumiExportService: PulumiExportService.Interface,\n private watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: Watch.Interface\n ) {}\n\n async execute(params: Watch.Params): Promise<Watch.Result> {\n // Validate Lambda-specific params before the base runs workspace build.\n if (\"app\" in params && params.increaseTimeout && params.increaseTimeout > 900) {\n throw new Error(\n `When increasing the timeout, the maximum value that can be passed is 900 seconds (15 minutes).`\n );\n }\n\n const result = await this.decoratee.execute(params);\n\n // No Lambda machinery for package-only watch.\n if (!(\"app\" in params)) {\n return result;\n }\n\n const app = this.getApp.execute(params.app);\n const sdkParams = this.projectSdkParamsService.get();\n const ui = this.ui;\n const logger = this.logger;\n\n const functionsWhitelist = Array.isArray(params.function)\n ? params.function\n : ([params.function].filter(Boolean) as string[]);\n\n const functionsList = await this.listAppLambdaFunctionsService.execute(app, {\n whitelist: functionsWhitelist\n });\n\n const deployCommand = `yarn webiny deploy ${app.name} --env ${sdkParams.env}`;\n const learnMoreLink = \"https://webiny.link/local-aws-lambda-development\";\n const troubleshootingLink = learnMoreLink + \"#troubleshooting\";\n\n if (functionsList.meta.count === 0) {\n if (functionsList.meta.totalCount > 0) {\n ui.info(\n [\n \"No AWS Lambda functions will be invoked locally. If this is unexpected, you can try the following:\",\n \" ‣ stop the current development session\",\n \" ‣ redeploy the %s application by running %s command\",\n \" ‣ start a new %s session by rerunning %s command\",\n \"\",\n \"Learn more: %s\"\n ].join(\"\\n\"),\n app.name,\n deployCommand,\n \"webiny watch\",\n \"webiny watch\",\n troubleshootingLink\n );\n }\n return result;\n }\n\n ui.info(`Local AWS Lambda development session started.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n\n logger.debug(\n \"The events for following AWS Lambda functions will be forwarded locally: \",\n functionsList.list.map(fn => fn.name)\n );\n\n ui.emptyLine();\n const { default: exitHook } = await import(/* webpackChunkName: \"exit-hook\" */ \"exit-hook\");\n\n exitHook(() => {\n console.log();\n console.log();\n\n ui.info(`Terminating local AWS Lambda development session.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app?.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n });\n\n const coreApp = this.getApp.execute(\"core\");\n const coreStackOutput =\n await this.pulumiGetStackOutputService.execute<ICoreStackOutput>(coreApp);\n\n if (!coreStackOutput) {\n throw new Error(\n `You must deploy the ${chalk.bold(\n \"core\"\n )} app before you can start a watch session. To do that, run: ${chalk.bold(\n `yarn webiny deploy core --env ${sdkParams.env}`\n )}`\n );\n }\n\n const deploymentId = coreStackOutput?.deploymentId;\n const iotEndpointTopic = `webiny-watch-${deploymentId}`;\n // Loaded here rather than at the top of the file. This decorator is registered for every\n // command, and these pull in the AWS IoT and Lambda clients and mqtt, which only a watch\n // session needs.\n const { getIotEndpoint } = await import(\"./getIotEndpoint.js\");\n const { replaceLambdaFunctions } = await import(\"./replaceLambdaFunctions.js\");\n const { initInvocationForwarding } =\n await import(\"@webiny/project/features/Watch/initInvocationForwarding.js\");\n\n const iotEndpoint = await getIotEndpoint(coreStackOutput);\n\n const sessionId = new Date().getTime();\n const increaseTimeout = params.increaseTimeout;\n const localExecutionHandshakeTimeout = params.increaseHandshakeTimeout || 5;\n\n replaceLambdaFunctions({\n app,\n deploymentId,\n dependencies: {\n uiService: ui,\n loggerService: logger,\n pulumiExportService: this.pulumiExportService,\n watchedLambdaFunctionsService: this.watchedLambdaFunctionsService\n },\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout\n });\n\n let inspector: typeof inspectorType | undefined = undefined;\n if (params.inspect) {\n inspector = await import(\"inspector\");\n inspector!.open(9229, \"127.0.0.1\");\n ui.emptyLine();\n\n exitHook(() => {\n inspector!.close();\n });\n }\n\n initInvocationForwarding({\n iotEndpoint,\n iotEndpointTopic,\n functionsList,\n sessionId\n });\n\n return result;\n }\n}\n\nexport const awsWatch = Watch.createDecorator({\n decorator: AwsWatch,\n dependencies: [\n GetApp,\n LoggerService,\n ListAppLambdaFunctionsService,\n UiService,\n PulumiGetStackOutputService,\n PulumiExportService,\n WatchedLambdaFunctionsService,\n ProjectSdkParamsService\n ]\n});\n"],"names":["AwsWatch","getApp","logger","listAppLambdaFunctionsService","ui","pulumiGetStackOutputService","pulumiExportService","watchedLambdaFunctionsService","projectSdkParamsService","decoratee","params","Error","result","app","sdkParams","functionsWhitelist","Array","Boolean","functionsList","deployCommand","learnMoreLink","troubleshootingLink","fn","exitHook","console","coreApp","coreStackOutput","chalk","deploymentId","iotEndpointTopic","getIotEndpoint","replaceLambdaFunctions","initInvocationForwarding","iotEndpoint","sessionId","Date","increaseTimeout","localExecutionHandshakeTimeout","inspector","awsWatch","Watch","GetApp","LoggerService","ListAppLambdaFunctionsService","UiService","PulumiGetStackOutputService","PulumiExportService","WatchedLambdaFunctionsService","ProjectSdkParamsService"],"mappings":"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"}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import "./abstractions/pulumiTypes.js";
|
|
1
2
|
export * from "./api.js";
|
|
2
3
|
export * from "./admin.js";
|
|
3
4
|
export * from "./cli.js";
|
|
4
5
|
export * from "./infra.js";
|
|
5
6
|
export * from "./project.js";
|
|
6
|
-
export * from "
|
|
7
|
+
export * from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
7
8
|
export * from "./registerAwsProjectFeatures.js";
|
package/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import "./abstractions/pulumiTypes.js";
|
|
1
2
|
export * from "./api.js";
|
|
2
3
|
export * from "./admin.js";
|
|
3
4
|
export * from "./cli.js";
|
|
4
5
|
export * from "./infra.js";
|
|
5
6
|
export * from "./project.js";
|
|
6
|
-
export * from "
|
|
7
|
+
export * from "@webiny/project-extensions-aws/abstractions/index.js";
|
|
7
8
|
export * from "./registerAwsProjectFeatures.js";
|
package/infra.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ export declare const Infra: {
|
|
|
48
48
|
vip: "vip";
|
|
49
49
|
}>;
|
|
50
50
|
domains: import("zod").ZodObject<{
|
|
51
|
-
api: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<
|
|
52
|
-
admin: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<
|
|
51
|
+
api: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<[string, ...string[]], string[]>>;
|
|
52
|
+
admin: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<[string, ...string[]], string[]>>;
|
|
53
53
|
}, import("zod/v4/core").$strip>;
|
|
54
54
|
}, import("zod/v4/core").$strip>;
|
|
55
55
|
deployments: import("zod").ZodTuple<[import("zod").ZodObject<{
|
|
@@ -81,6 +81,16 @@ export declare const Infra: {
|
|
|
81
81
|
varName: import("zod").ZodString;
|
|
82
82
|
value: import("zod").ZodString;
|
|
83
83
|
}, import("zod/v4/core").$strip>>;
|
|
84
|
+
DynamoDb: {
|
|
85
|
+
Pitr: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
86
|
+
enabled: import("zod").ZodBoolean;
|
|
87
|
+
}, import("zod/v4/core").$strip>>;
|
|
88
|
+
};
|
|
89
|
+
S3Bucket: {
|
|
90
|
+
Versioning: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
91
|
+
enabled: import("zod").ZodBoolean;
|
|
92
|
+
}, import("zod/v4/core").$strip>>;
|
|
93
|
+
};
|
|
84
94
|
Aws: {
|
|
85
95
|
DefaultRegion: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
86
96
|
name: import("zod").ZodString;
|
|
@@ -130,6 +140,15 @@ export declare const Infra: {
|
|
|
130
140
|
vip: "vip";
|
|
131
141
|
}>>;
|
|
132
142
|
certificateArn: import("zod").ZodString;
|
|
143
|
+
minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
144
|
+
SSLv3: "SSLv3";
|
|
145
|
+
TLSv1: "TLSv1";
|
|
146
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
147
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
148
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
149
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
150
|
+
TLSv1_2016: "TLSv1_2016";
|
|
151
|
+
}>>;
|
|
133
152
|
}, import("zod/v4/core").$strip>>;
|
|
134
153
|
StackOutputValue: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
135
154
|
key: import("zod").ZodString;
|
|
@@ -162,6 +181,15 @@ export declare const Infra: {
|
|
|
162
181
|
vip: "vip";
|
|
163
182
|
}>>;
|
|
164
183
|
certificateArn: import("zod").ZodString;
|
|
184
|
+
minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
185
|
+
SSLv3: "SSLv3";
|
|
186
|
+
TLSv1: "TLSv1";
|
|
187
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
188
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
189
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
190
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
191
|
+
TLSv1_2016: "TLSv1_2016";
|
|
192
|
+
}>>;
|
|
165
193
|
}, import("zod/v4/core").$strip>>;
|
|
166
194
|
StackOutputValue: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
167
195
|
key: import("zod").ZodString;
|
|
@@ -198,5 +226,24 @@ export declare const Infra: {
|
|
|
198
226
|
key: import("zod").ZodString;
|
|
199
227
|
value: import("zod").ZodAny;
|
|
200
228
|
}, import("zod/v4/core").$strip>>;
|
|
229
|
+
DynamoDb: {
|
|
230
|
+
Pitr: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
231
|
+
enabled: import("zod").ZodBoolean;
|
|
232
|
+
}, import("zod/v4/core").$strip>>;
|
|
233
|
+
};
|
|
234
|
+
OpenSearch: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
235
|
+
enabled: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
236
|
+
domainName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
237
|
+
indexPrefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
238
|
+
sharedIndexes: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
239
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
240
|
+
username: import("zod").ZodOptional<import("zod").ZodString>;
|
|
241
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
242
|
+
}, import("zod/v4/core").$strip>>;
|
|
243
|
+
S3Bucket: {
|
|
244
|
+
Versioning: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
245
|
+
enabled: import("zod").ZodBoolean;
|
|
246
|
+
}, import("zod/v4/core").$strip>>;
|
|
247
|
+
};
|
|
201
248
|
};
|
|
202
249
|
};
|
package/infra.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch,
|
|
2
|
-
import { AdminCustomDomains, AdminPulumi, ApiCustomDomains, ApiPulumi, AwsTags, BlueGreenDeployments, CorePulumi, Vpc } from "./pulumi/extensions/index.js";
|
|
1
|
+
import { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch, EnvVar, ProductionEnvironments, PulumiResourceNamePrefix } from "@webiny/project/extensions/index.js";
|
|
2
|
+
import { AdminCustomDomains, AdminPulumi, ApiCustomDomains, ApiPulumi, AwsTags, BlueGreenDeployments, CorePulumi, DynamoDbPitr, S3BucketVersioning, Vpc } from "./pulumi/extensions/index.js";
|
|
3
3
|
import { OpenSearch } from "./extensions/OpenSearch.js";
|
|
4
|
-
import {
|
|
4
|
+
import { AdminStackOutputValue, ApiMaxBundleSize, ApiStackOutputValue, CoreStackOutputValue, Encryption, Hashing } from "@webiny/project-extensions-aws/extensions/index.js";
|
|
5
|
+
import { AwsDefaultRegion } from "@webiny/project-extensions-aws/extensions/AwsDefaultRegion.js";
|
|
5
6
|
import { ApiLambdaFunction } from "./extensions/ApiLambdaFunction.js";
|
|
6
7
|
import { CiIs, CiIsNot, EnvIs, EnvIsNot, EnvIsNotProd, EnvIsProd, useEnv } from "@webiny/project/extensions/infra/index.js";
|
|
8
|
+
const DynamoDb = {
|
|
9
|
+
Pitr: DynamoDbPitr
|
|
10
|
+
};
|
|
11
|
+
const S3Bucket = {
|
|
12
|
+
Versioning: S3BucketVersioning
|
|
13
|
+
};
|
|
7
14
|
const Infra = {
|
|
8
15
|
Crypto: {
|
|
9
16
|
Encryption: Encryption,
|
|
@@ -16,6 +23,8 @@ const Infra = {
|
|
|
16
23
|
PulumiResourceNamePrefix: PulumiResourceNamePrefix,
|
|
17
24
|
ProductionEnvironments: ProductionEnvironments,
|
|
18
25
|
EnvVar: EnvVar,
|
|
26
|
+
DynamoDb: DynamoDb,
|
|
27
|
+
S3Bucket: S3Bucket,
|
|
19
28
|
Aws: {
|
|
20
29
|
DefaultRegion: AwsDefaultRegion,
|
|
21
30
|
Tags: AwsTags
|
|
@@ -60,7 +69,10 @@ const Infra = {
|
|
|
60
69
|
AfterBuild: CoreAfterBuild,
|
|
61
70
|
AfterDeploy: CoreAfterDeploy,
|
|
62
71
|
Pulumi: CorePulumi,
|
|
63
|
-
StackOutputValue: CoreStackOutputValue
|
|
72
|
+
StackOutputValue: CoreStackOutputValue,
|
|
73
|
+
DynamoDb: DynamoDb,
|
|
74
|
+
OpenSearch: OpenSearch,
|
|
75
|
+
S3Bucket: S3Bucket
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
export { Infra, useEnv };
|
package/infra.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infra.js","sources":["../src/infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n
|
|
1
|
+
{"version":3,"file":"infra.js","sources":["../src/infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n ApiAfterBuild,\n ApiAfterDeploy,\n ApiBeforeBuild,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n CoreAfterBuild,\n CoreAfterDeploy,\n CoreBeforeBuild,\n CoreBeforeDeploy,\n CoreBeforeWatch,\n ProductionEnvironments,\n PulumiResourceNamePrefix\n} from \"@webiny/project/extensions/index.js\";\n\nimport { CorePulumi, ApiPulumi, AdminPulumi } from \"./pulumi/extensions/index.js\";\n\nimport {\n AdminCustomDomains,\n ApiCustomDomains,\n AwsTags,\n BlueGreenDeployments,\n DynamoDbPitr,\n S3BucketVersioning,\n Vpc\n} from \"./pulumi/extensions/index.js\";\n\nimport { OpenSearch } from \"./extensions/OpenSearch.js\";\nimport { AdminStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AwsDefaultRegion } from \"@webiny/project-extensions-aws/extensions/AwsDefaultRegion.js\";\nimport { ApiLambdaFunction } from \"./extensions/ApiLambdaFunction.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\nimport { Encryption } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { Hashing } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiMaxBundleSize } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport {\n EnvIs,\n EnvIsNot,\n EnvIsProd,\n EnvIsNotProd,\n useEnv,\n CiIs,\n CiIsNot\n} from \"@webiny/project/extensions/infra/index.js\";\n\nexport { useEnv };\n\n// Core app resources. Exposed under Infra.Core, and top-level for backward compatibility.\nconst DynamoDb = {\n Pitr: DynamoDbPitr\n};\n\nconst S3Bucket = {\n Versioning: S3BucketVersioning\n};\n\nexport const Infra = {\n // Grouped crypto config surface.\n Crypto: {\n Encryption,\n Hashing\n },\n // Kept top-level for backward compatibility (prefer Infra.Crypto.Encryption going forward).\n Encryption,\n Vpc,\n BlueGreenDeployments,\n // Kept top-level for backward compatibility (prefer Infra.Core.OpenSearch going forward).\n OpenSearch,\n PulumiResourceNamePrefix,\n ProductionEnvironments,\n EnvVar,\n // Kept top-level for backward compatibility (prefer Infra.Core.DynamoDb and Infra.Core.S3Bucket).\n DynamoDb,\n S3Bucket,\n Aws: {\n DefaultRegion: AwsDefaultRegion,\n Tags: AwsTags\n },\n Env: {\n useEnv,\n Is: EnvIs,\n IsNot: EnvIsNot,\n IsProd: EnvIsProd,\n IsNotProd: EnvIsNotProd\n },\n Ci: {\n Is: CiIs,\n IsNot: CiIsNot\n },\n Admin: {\n BeforeBuild: AdminBeforeBuild,\n BeforeDeploy: AdminBeforeDeploy,\n BeforeWatch: AdminBeforeWatch,\n AfterBuild: AdminAfterBuild,\n AfterDeploy: AdminAfterDeploy,\n Pulumi: AdminPulumi,\n CustomDomains: AdminCustomDomains,\n StackOutputValue: AdminStackOutputValue\n },\n Api: {\n BeforeBuild: ApiBeforeBuild,\n BeforeDeploy: ApiBeforeDeploy,\n BeforeWatch: ApiBeforeWatch,\n AfterBuild: ApiAfterBuild,\n AfterDeploy: ApiAfterDeploy,\n Pulumi: ApiPulumi,\n CustomDomains: ApiCustomDomains,\n StackOutputValue: ApiStackOutputValue,\n LambdaFunction: ApiLambdaFunction,\n MaxBundleSize: ApiMaxBundleSize\n },\n Core: {\n BeforeBuild: CoreBeforeBuild,\n BeforeDeploy: CoreBeforeDeploy,\n BeforeWatch: CoreBeforeWatch,\n AfterBuild: CoreAfterBuild,\n AfterDeploy: CoreAfterDeploy,\n Pulumi: CorePulumi,\n StackOutputValue: CoreStackOutputValue,\n DynamoDb,\n OpenSearch,\n S3Bucket\n }\n};\n"],"names":["DynamoDb","DynamoDbPitr","S3Bucket","S3BucketVersioning","Infra","Encryption","Hashing","Vpc","BlueGreenDeployments","OpenSearch","PulumiResourceNamePrefix","ProductionEnvironments","EnvVar","AwsDefaultRegion","AwsTags","useEnv","EnvIs","EnvIsNot","EnvIsProd","EnvIsNotProd","CiIs","CiIsNot","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","AdminAfterBuild","AdminAfterDeploy","AdminPulumi","AdminCustomDomains","AdminStackOutputValue","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","ApiAfterBuild","ApiAfterDeploy","ApiPulumi","ApiCustomDomains","ApiStackOutputValue","ApiLambdaFunction","ApiMaxBundleSize","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","CoreAfterBuild","CoreAfterDeploy","CorePulumi","CoreStackOutputValue"],"mappings":";;;;;;;AAuDA,MAAMA,WAAW;IACb,MAAMC;AACV;AAEA,MAAMC,WAAW;IACb,YAAYC;AAChB;AAEO,MAAMC,QAAQ;IAEjB,QAAQ;QACJC,YAAUA;QACVC,SAAOA;IACX;IAEAD,YAAUA;IACVE,KAAGA;IACHC,sBAAoBA;IAEpBC,YAAUA;IACVC,0BAAwBA;IACxBC,wBAAsBA;IACtBC,QAAMA;IAENZ,UAAAA;IACAE,UAAAA;IACA,KAAK;QACD,eAAeW;QACf,MAAMC;IACV;IACA,KAAK;QACDC,QAAMA;QACN,IAAIC;QACJ,OAAOC;QACP,QAAQC;QACR,WAAWC;IACf;IACA,IAAI;QACA,IAAIC;QACJ,OAAOC;IACX;IACA,OAAO;QACH,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;IACtB;IACA,KAAK;QACD,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;QAClB,gBAAgBC;QAChB,eAAeC;IACnB;IACA,MAAM;QACF,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,kBAAkBC;QAClB9C,UAAAA;QACAS,YAAUA;QACVP,UAAAA;IACJ;AACJ"}
|