@webiny/project-aws 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
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/_templates/appTemplates/api/graphql/package.json +3 -21
- package/_templates/appTemplates/api/graphql/src/index.ts +19 -89
- package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +17 -101
- package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +15 -9
- package/abstractions/ApiGqlClient.js +1 -1
- package/abstractions/ApiGqlClient.js.map +1 -1
- package/abstractions/InvokeLambdaFunction.js +1 -1
- package/abstractions/InvokeLambdaFunction.js.map +1 -1
- package/abstractions/services/ApiStackOutputService.d.ts +14 -1
- package/abstractions/services/ApiStackOutputService.js.map +1 -1
- package/admin.d.ts +6 -0
- package/admin.js +4 -2
- package/admin.js.map +1 -1
- package/apps/createApiApp.d.ts +8 -0
- package/extensions/ApiRoute.d.ts +1 -1
- package/extensions/ApiRoute.js +16 -30
- package/extensions/ApiRoute.js.map +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -2
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
- package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
- package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
- package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
- package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
- package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +2 -3
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
- package/extensions/ProjectAws/UploadAdminAppToS3.js +1 -1
- package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
- package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
- package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
- package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
- package/extensions/ProjectAws/definitions.js +1 -3
- package/extensions/ProjectAws/definitions.js.map +1 -1
- package/extensions/ProjectAws.js +18 -4
- package/extensions/ProjectAws.js.map +1 -1
- package/extensions/RegisterRoutesPulumi.js +3 -6
- package/extensions/RegisterRoutesPulumi.js.map +1 -1
- package/extensions/definitions.js +0 -2
- package/extensions/definitions.js.map +1 -1
- package/extensions/index.d.ts +0 -1
- package/extensions/index.js +0 -1
- package/extensions/routePath.d.ts +20 -0
- package/extensions/routePath.js +13 -0
- package/extensions/routePath.js.map +1 -0
- package/features/InvokeLambdaFunction.js +1 -1
- package/features/InvokeLambdaFunction.js.map +1 -1
- package/features/Watch/AwsWatch.d.ts +17 -0
- package/features/Watch/AwsWatch.js +108 -0
- package/features/Watch/AwsWatch.js.map +1 -0
- package/features/Watch/getIotEndpoint.d.ts +2 -0
- package/features/Watch/getIotEndpoint.js +18 -0
- package/features/Watch/getIotEndpoint.js.map +1 -0
- package/features/Watch/handler/handler.zip +0 -0
- package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
- package/features/Watch/replaceLambdaFunctions.js +72 -0
- package/features/Watch/replaceLambdaFunctions.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/infra.d.ts +44 -0
- package/infra.js +18 -4
- package/infra.js.map +1 -1
- package/package.json +19 -16
- package/project.d.ts +27 -17
- package/project.js +3 -2
- package/project.js.map +1 -1
- package/pulumi/apps/admin/createAdminPulumiApp.js +4 -2
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/pulumi/apps/api/ApiCloudfront.js +105 -2
- package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
- package/pulumi/apps/api/ApiGraphqlStream.d.ts +29 -0
- package/pulumi/apps/api/ApiGraphqlStream.js +58 -0
- package/pulumi/apps/api/ApiGraphqlStream.js.map +1 -0
- package/pulumi/apps/api/ApiOutput.d.ts +6 -6
- package/pulumi/apps/api/ApiOutput.js +1 -1
- package/pulumi/apps/api/ApiOutput.js.map +1 -1
- package/pulumi/apps/api/createApiPulumiApp.d.ts +8 -0
- package/pulumi/apps/api/createApiPulumiApp.js +28 -20
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/api/index.d.ts +1 -0
- package/pulumi/apps/api/index.js +1 -0
- package/pulumi/apps/awsUtils.d.ts +1 -1
- package/pulumi/apps/awsUtils.js +2 -2
- package/pulumi/apps/awsUtils.js.map +1 -1
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
- package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
- package/pulumi/apps/blueGreen/domains/getApplicationDomains.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 +2 -2
- 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/createCorePulumiApp.js +16 -7
- package/pulumi/apps/core/createCorePulumiApp.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/react/createReactPulumiApp.js +2 -2
- package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
- package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
- package/pulumi/apps/syncSystem/SyncSystemLambda.js +1 -1
- package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
- package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
- package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
- package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
- package/pulumi/extensions/DynamoDbPitr.d.ts +4 -0
- package/pulumi/extensions/DynamoDbPitr.js +15 -0
- package/pulumi/extensions/DynamoDbPitr.js.map +1 -0
- package/pulumi/extensions/S3BucketVersioning.d.ts +4 -0
- package/pulumi/extensions/S3BucketVersioning.js +15 -0
- package/pulumi/extensions/S3BucketVersioning.js.map +1 -0
- package/pulumi/extensions/index.d.ts +9 -3
- package/pulumi/extensions/index.js +6 -2
- package/pulumi/extensions/index.js.map +1 -1
- package/pulumi/getAwsProjectSdk.d.ts +12 -0
- package/pulumi/getAwsProjectSdk.js +6 -0
- package/pulumi/getAwsProjectSdk.js.map +1 -0
- package/pulumi/getStackOutput.d.ts +7 -0
- package/pulumi/getStackOutput.js +8 -0
- package/pulumi/getStackOutput.js.map +1 -0
- 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 +4 -16
- package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
- package/registerAwsProjectFeatures.d.ts +8 -0
- package/registerAwsProjectFeatures.js +55 -0
- package/registerAwsProjectFeatures.js.map +1 -0
- package/services/GetPulumiService/GetPulumiService.d.ts +8 -0
- package/services/GetPulumiService/GetPulumiService.js +44 -0
- package/services/GetPulumiService/GetPulumiService.js.map +1 -0
- package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
- package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
- package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
- package/_templates/extensions/sqlite/api/graphql/src/index.ts +0 -90
- package/extensions/Encryption.d.ts +0 -10
- package/extensions/Encryption.js +0 -36
- package/extensions/Encryption.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi/getStackOutput.js","sources":["../../src/pulumi/getStackOutput.ts"],"sourcesContent":["import { type AppName, type IStackOutput } from \"@webiny/project\";\nimport { getAwsProjectSdk } from \"./getAwsProjectSdk.js\";\n\n/**\n * AWS-aware equivalent of `@webiny/project`'s `getStackOutput` helper: reads an app's stack output\n * via the aws-aware SDK. The base `getStackOutput` uses `getProjectSdk()`, which lacks the pulumi\n * services now that they live in project-aws → \"No registration found for GetAppStackOutput\".\n */\nexport const getStackOutput = async <TOutput extends IStackOutput = IStackOutput>(\n appName: AppName\n): Promise<TOutput | null> => {\n const sdk = await getAwsProjectSdk();\n return sdk.getAppStackOutput<TOutput>(appName);\n};\n"],"names":["getStackOutput","appName","sdk","getAwsProjectSdk"],"mappings":";AAQO,MAAMA,iBAAiB,OAC1BC;IAEA,MAAMC,MAAM,MAAMC;IAClB,OAAOD,IAAI,iBAAiB,CAAUD;AAC1C"}
|
package/pulumi/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IStackOutput } from "@webiny/project";
|
|
2
|
+
import type { IApiStackOutputPasswordPolicy } from "../abstractions/index.js";
|
|
2
3
|
export interface IDefaultStackOutput extends IStackOutput {
|
|
3
4
|
deploymentId: string;
|
|
4
5
|
region: string;
|
|
@@ -14,7 +15,7 @@ export interface IDefaultStackOutput extends IStackOutput {
|
|
|
14
15
|
cognitoUserPoolArn: string;
|
|
15
16
|
cognitoAppClientId: string;
|
|
16
17
|
cognitoUserPoolId: string;
|
|
17
|
-
cognitoUserPoolPasswordPolicy:
|
|
18
|
+
cognitoUserPoolPasswordPolicy: IApiStackOutputPasswordPolicy;
|
|
18
19
|
websocketApiUrl: string;
|
|
19
20
|
fileManagerBucketId: string;
|
|
20
21
|
fileManagerBucketArn: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import type * as aws from "@pulumi/aws";
|
|
3
|
+
import type { PulumiAppResource } from "@webiny/pulumi";
|
|
4
|
+
/**
|
|
5
|
+
* The URL a CloudFront distribution is reached on: its first custom domain (alias) if it has one,
|
|
6
|
+
* otherwise the default CloudFront domain. Same rule as the `usedUrl` stack output in
|
|
7
|
+
* `addDomainsUrlsOutputs`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDistributionUrl: (distribution: PulumiAppResource<typeof aws.cloudfront.Distribution>) => pulumi.Output<string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
|
|
2
|
+
const getDistributionUrl = (distribution)=>__rspack_external__pulumi_pulumi_f3e773ed.all([
|
|
3
|
+
distribution.output.aliases,
|
|
4
|
+
distribution.output.domainName
|
|
5
|
+
]).apply(([aliases, domainName])=>`https://${aliases?.[0] || domainName}`);
|
|
6
|
+
export { getDistributionUrl };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=getDistributionUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi/utils/getDistributionUrl.js","sources":["../../../src/pulumi/utils/getDistributionUrl.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type * as aws from \"@pulumi/aws\";\nimport type { PulumiAppResource } from \"@webiny/pulumi\";\n\n/**\n * The URL a CloudFront distribution is reached on: its first custom domain (alias) if it has one,\n * otherwise the default CloudFront domain. Same rule as the `usedUrl` stack output in\n * `addDomainsUrlsOutputs`.\n */\nexport const getDistributionUrl = (\n distribution: PulumiAppResource<typeof aws.cloudfront.Distribution>\n): pulumi.Output<string> => {\n return pulumi\n .all([distribution.output.aliases, distribution.output.domainName])\n .apply(([aliases, domainName]) => `https://${aliases?.[0] || domainName}`);\n};\n"],"names":["getDistributionUrl","distribution","pulumi","aliases","domainName"],"mappings":";AASO,MAAMA,qBAAqB,CAC9BC,eAEOC,0CAAAA,GACC,CAAC;QAACD,aAAa,MAAM,CAAC,OAAO;QAAEA,aAAa,MAAM,CAAC,UAAU;KAAC,EACjE,KAAK,CAAC,CAAC,CAACE,SAASC,WAAW,GAAK,CAAC,QAAQ,EAAED,SAAS,CAAC,EAAE,IAAIC,YAAY"}
|
package/pulumi/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./tagResources.js";
|
|
2
2
|
export * from "./addDomainsUrlsOutputs.js";
|
|
3
|
+
export * from "./getDistributionUrl.js";
|
|
3
4
|
export * from "./uploadFolderToS3.js";
|
|
4
5
|
export { withCommonLambdaEnvVariables, getCommonLambdaEnvVariables } from "./lambdaEnvVariables.js";
|
|
5
6
|
export { withServiceManifest } from "./withServiceManifest.js";
|
package/pulumi/utils/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./tagResources.js";
|
|
2
2
|
export * from "./addDomainsUrlsOutputs.js";
|
|
3
|
+
export * from "./getDistributionUrl.js";
|
|
3
4
|
export * from "./uploadFolderToS3.js";
|
|
4
5
|
export { getCommonLambdaEnvVariables, withCommonLambdaEnvVariables } from "./lambdaEnvVariables.js";
|
|
5
6
|
export { withServiceManifest } from "./withServiceManifest.js";
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
+
import { pickApiRuntimeEnvVariables } from "@webiny/project";
|
|
1
2
|
import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
|
|
2
3
|
const variablesRegistry = {};
|
|
3
4
|
if ("true" === process.env.DEBUG) variablesRegistry.NODE_OPTIONS = "--enable-source-maps";
|
|
4
5
|
let sealEnvVariables;
|
|
5
|
-
const magicPrefixes = [
|
|
6
|
-
"WEBINY_",
|
|
7
|
-
"WEBINY_API_",
|
|
8
|
-
"WEBINY_PROJECT_API_KEY",
|
|
9
|
-
"WCP_PROJECT_ENVIRONMENT",
|
|
10
|
-
"WCP_PROJECT_ENVIRONMENT_API_KEY",
|
|
11
|
-
"OKTA_",
|
|
12
|
-
"AUTH0_"
|
|
13
|
-
];
|
|
14
6
|
const variablesPromise = new Promise((resolve)=>{
|
|
15
7
|
sealEnvVariables = ()=>{
|
|
16
|
-
const baseVariables =
|
|
17
|
-
|
|
18
|
-
if (hasMagicPrefix && void 0 !== process.env[environmentVariableName]) current[environmentVariableName] = String(process.env[environmentVariableName]);
|
|
19
|
-
return current;
|
|
20
|
-
}, {
|
|
21
|
-
DEBUG: String(process.env.DEBUG),
|
|
8
|
+
const baseVariables = {
|
|
9
|
+
...pickApiRuntimeEnvVariables(),
|
|
22
10
|
PULUMI_APPS: "true"
|
|
23
|
-
}
|
|
11
|
+
};
|
|
24
12
|
resolve(Object.assign({}, baseVariables, variablesRegistry));
|
|
25
13
|
};
|
|
26
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/utils/lambdaEnvVariables.js","sources":["../../../src/pulumi/utils/lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nif (process.env.DEBUG === \"true\") {\n variablesRegistry.NODE_OPTIONS = \"--enable-source-maps\";\n}\n\nexport let sealEnvVariables: () => void;\n\nconst
|
|
1
|
+
{"version":3,"file":"pulumi/utils/lambdaEnvVariables.js","sources":["../../../src/pulumi/utils/lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport { pickApiRuntimeEnvVariables } from \"@webiny/project\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nif (process.env.DEBUG === \"true\") {\n variablesRegistry.NODE_OPTIONS = \"--enable-source-maps\";\n}\n\nexport let sealEnvVariables: () => void;\n\nconst variablesPromise = new Promise<EnvVariables>(resolve => {\n sealEnvVariables = () => {\n // The api runtime allowlist (WEBINY_/WCP_PROJECT_ENVIRONMENT/OKTA_/AUTH0_ + DEBUG) is shared\n // with the standalone hosting type — see @webiny/project's pickApiRuntimeEnvVariables.\n const baseVariables: EnvVariables = {\n ...pickApiRuntimeEnvVariables(),\n // This flag means that Lambda was deployed using the new Pulumi Apps architecture.\n PULUMI_APPS: \"true\"\n };\n\n resolve(Object.assign({}, baseVariables, variablesRegistry));\n };\n});\n\nexport function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables> {\n return pulumi.output(variablesPromise);\n}\n\nfunction setCommonLambdaEnvVariables(variables: EnvVariables) {\n Object.assign(variablesRegistry, variables);\n}\n\nexport interface SetCommonLambdaEnvVariables {\n (variables: EnvVariables): void;\n}\n\nexport interface WithCommonLambdaEnvVariables {\n /**\n * Set ENV variables that wil be assigned to all Lambda functions in the current Pulumi app.\n */\n setCommonLambdaEnvVariables: SetCommonLambdaEnvVariables;\n}\n\n/**\n * Augment the given app with `setCommonLambdaEnvVariables` functionality.\n * @param {PulumiApp} app\n */\nexport function withCommonLambdaEnvVariables<T extends PulumiApp>(\n app: T\n): T & WithCommonLambdaEnvVariables {\n app.decorateProgram<{ setCommonLambdaEnvVariables: typeof setCommonLambdaEnvVariables }>(\n async (program, app) => {\n const output = await program({\n ...app,\n setCommonLambdaEnvVariables\n });\n\n // Once the program is executed, we need to seal the variables (this will resolve the pulumi.output promise).\n app.addHandler(() => {\n sealEnvVariables();\n });\n\n return output;\n }\n );\n\n // Augment the original PulumiApp.\n return {\n ...app,\n setCommonLambdaEnvVariables\n };\n}\n"],"names":["variablesRegistry","process","sealEnvVariables","variablesPromise","Promise","resolve","baseVariables","pickApiRuntimeEnvVariables","Object","getCommonLambdaEnvVariables","pulumi","setCommonLambdaEnvVariables","variables","withCommonLambdaEnvVariables","app","program","output"],"mappings":";;AAMA,MAAMA,oBAAkC,CAAC;AAEzC,IAAIC,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK,EACjBD,kBAAkB,YAAY,GAAG;AAG9B,IAAIE;AAEX,MAAMC,mBAAmB,IAAIC,QAAsBC,CAAAA;IAC/CH,mBAAmB;QAGf,MAAMI,gBAA8B;YAChC,GAAGC,4BAA4B;YAE/B,aAAa;QACjB;QAEAF,QAAQG,OAAO,MAAM,CAAC,CAAC,GAAGF,eAAeN;IAC7C;AACJ;AAEO,SAASS;IACZ,OAAOC,0CAAAA,MAAa,CAACP;AACzB;AAEA,SAASQ,4BAA4BC,SAAuB;IACxDJ,OAAO,MAAM,CAACR,mBAAmBY;AACrC;AAiBO,SAASC,6BACZC,GAAM;IAENA,IAAI,eAAe,CACf,OAAOC,SAASD;QACZ,MAAME,SAAS,MAAMD,QAAQ;YACzB,GAAGD,GAAG;YACNH,6BAAAA;QACJ;QAGAG,IAAI,UAAU,CAAC;YACXZ;QACJ;QAEA,OAAOc;IACX;IAIJ,OAAO;QACH,GAAGF,GAAG;QACNH,6BAAAA;IACJ;AACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Container } from "@webiny/di";
|
|
2
|
+
/**
|
|
3
|
+
* Pulumi services + features only — no deploy/workspace decorators or hooks. Safe to register in the
|
|
4
|
+
* Pulumi program's own ProjectSdk container (a separate process that must resolve the name prefix,
|
|
5
|
+
* stack output, etc. without re-running the CLI's workspace builders or deploy decorators).
|
|
6
|
+
*/
|
|
7
|
+
export declare const registerAwsPulumiServices: (container: Container) => void;
|
|
8
|
+
export declare const registerAwsProjectFeatures: (container: Container) => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { deployApp, destroyApp, exportStack, getAppOutput, getAppStackOutput, getPulumiResourceNamePrefix, refreshApp, runPulumiCommand } from "@webiny/project/features/index.js";
|
|
2
|
+
import { isRemotePulumiBackendService, listAppLambdaFunctionsService, listDeployedEnvironmentsService, pulumiExportService, pulumiGetConfigPassphraseService, pulumiGetSecretsProviderService, pulumiGetStackOutputService, pulumiImportService, pulumiLoginService, pulumiSelectStackService, watchedLambdaFunctionsService } from "@webiny/project/services/index.js";
|
|
3
|
+
import { getPulumiService } from "./services/GetPulumiService/GetPulumiService.js";
|
|
4
|
+
import { adminAfterDeploy, adminBeforeDeploy, afterDeploy, apiAfterDeploy, apiBeforeDeploy, beforeDeploy, coreAfterBuild, coreAfterDeploy, coreBeforeBuild, coreBeforeDeploy, coreBeforeWatch } from "@webiny/project/features/hooks/index.js";
|
|
5
|
+
import { deployAppClearWatchedLambdaFunctions, deployAppRefreshStackOutputCache, deployAppWithHooks, deployAppWithWatchedLambdaReplacement, getPulumiServiceWithDownloadInfo } from "@webiny/project/decorators/index.js";
|
|
6
|
+
import { awsWatch } from "./features/Watch/AwsWatch.js";
|
|
7
|
+
import { BuildProjectWorkspace } from "./extensions/ProjectAws/BuildProjectWorkspace.js";
|
|
8
|
+
import { BuildAppWorkspace } from "./extensions/ProjectAws/BuildAppWorkspace.js";
|
|
9
|
+
const registerAwsPulumiServices = (container)=>{
|
|
10
|
+
container.register(getPulumiService).inSingletonScope();
|
|
11
|
+
container.register(isRemotePulumiBackendService).inSingletonScope();
|
|
12
|
+
container.register(listAppLambdaFunctionsService).inSingletonScope();
|
|
13
|
+
container.register(listDeployedEnvironmentsService).inSingletonScope();
|
|
14
|
+
container.register(watchedLambdaFunctionsService).inSingletonScope();
|
|
15
|
+
container.register(pulumiGetConfigPassphraseService).inSingletonScope();
|
|
16
|
+
container.register(pulumiGetSecretsProviderService).inSingletonScope();
|
|
17
|
+
container.register(pulumiExportService).inSingletonScope();
|
|
18
|
+
container.register(pulumiImportService).inSingletonScope();
|
|
19
|
+
container.register(pulumiGetStackOutputService).inSingletonScope();
|
|
20
|
+
container.register(pulumiLoginService).inSingletonScope();
|
|
21
|
+
container.register(pulumiSelectStackService).inSingletonScope();
|
|
22
|
+
container.register(deployApp).inSingletonScope();
|
|
23
|
+
container.register(destroyApp).inSingletonScope();
|
|
24
|
+
container.register(exportStack).inSingletonScope();
|
|
25
|
+
container.register(getAppOutput).inSingletonScope();
|
|
26
|
+
container.register(getAppStackOutput).inSingletonScope();
|
|
27
|
+
container.register(getPulumiResourceNamePrefix).inSingletonScope();
|
|
28
|
+
container.register(refreshApp).inSingletonScope();
|
|
29
|
+
container.register(runPulumiCommand).inSingletonScope();
|
|
30
|
+
};
|
|
31
|
+
const registerAwsProjectFeatures = (container)=>{
|
|
32
|
+
container.registerDecorator(BuildProjectWorkspace);
|
|
33
|
+
container.registerDecorator(BuildAppWorkspace);
|
|
34
|
+
registerAwsPulumiServices(container);
|
|
35
|
+
container.registerComposite(beforeDeploy);
|
|
36
|
+
container.registerComposite(afterDeploy);
|
|
37
|
+
container.registerComposite(coreBeforeBuild);
|
|
38
|
+
container.registerComposite(coreAfterBuild);
|
|
39
|
+
container.registerComposite(coreBeforeWatch);
|
|
40
|
+
container.registerComposite(coreBeforeDeploy);
|
|
41
|
+
container.registerComposite(coreAfterDeploy);
|
|
42
|
+
container.registerComposite(apiBeforeDeploy);
|
|
43
|
+
container.registerComposite(apiAfterDeploy);
|
|
44
|
+
container.registerComposite(adminBeforeDeploy);
|
|
45
|
+
container.registerComposite(adminAfterDeploy);
|
|
46
|
+
container.registerDecorator(deployAppWithWatchedLambdaReplacement);
|
|
47
|
+
container.registerDecorator(deployAppClearWatchedLambdaFunctions);
|
|
48
|
+
container.registerDecorator(deployAppRefreshStackOutputCache);
|
|
49
|
+
container.registerDecorator(deployAppWithHooks);
|
|
50
|
+
container.registerDecorator(getPulumiServiceWithDownloadInfo);
|
|
51
|
+
container.registerDecorator(awsWatch);
|
|
52
|
+
};
|
|
53
|
+
export { registerAwsProjectFeatures, registerAwsPulumiServices };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=registerAwsProjectFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerAwsProjectFeatures.js","sources":["../src/registerAwsProjectFeatures.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\n\n// Features\nimport {\n deployApp,\n destroyApp,\n exportStack,\n getAppOutput,\n getAppStackOutput,\n getPulumiResourceNamePrefix,\n refreshApp,\n runPulumiCommand\n} from \"@webiny/project/features/index.js\";\n\n// Services\nimport {\n watchedLambdaFunctionsService,\n isRemotePulumiBackendService,\n listAppLambdaFunctionsService,\n listDeployedEnvironmentsService,\n pulumiGetConfigPassphraseService,\n pulumiGetSecretsProviderService,\n pulumiExportService,\n pulumiImportService,\n pulumiGetStackOutputService,\n pulumiLoginService,\n pulumiSelectStackService\n} from \"@webiny/project/services/index.js\";\n\n// GetPulumiService implementation lives here since it directly imports @webiny/pulumi-sdk\nimport { getPulumiService } from \"./services/GetPulumiService/GetPulumiService.js\";\n\n// Hooks\nimport {\n beforeDeploy,\n afterDeploy,\n coreBeforeBuild,\n coreAfterBuild,\n coreBeforeWatch,\n coreBeforeDeploy,\n coreAfterDeploy,\n apiBeforeDeploy,\n apiAfterDeploy,\n adminBeforeDeploy,\n adminAfterDeploy\n} from \"@webiny/project/features/hooks/index.js\";\n\n// Decorators\nimport {\n deployAppWithWatchedLambdaReplacement,\n deployAppClearWatchedLambdaFunctions,\n deployAppRefreshStackOutputCache,\n deployAppWithHooks,\n getPulumiServiceWithDownloadInfo\n} from \"@webiny/project/decorators/index.js\";\n\nimport { awsWatch } from \"./features/Watch/AwsWatch.js\";\nimport { BuildProjectWorkspace } from \"./extensions/ProjectAws/BuildProjectWorkspace.js\";\nimport { BuildAppWorkspace } from \"./extensions/ProjectAws/BuildAppWorkspace.js\";\n\n/**\n * Pulumi services + features only — no deploy/workspace decorators or hooks. Safe to register in the\n * Pulumi program's own ProjectSdk container (a separate process that must resolve the name prefix,\n * stack output, etc. without re-running the CLI's workspace builders or deploy decorators).\n */\nexport const registerAwsPulumiServices = (container: Container): void => {\n // Pulumi/Lambda services.\n container.register(getPulumiService).inSingletonScope();\n container.register(isRemotePulumiBackendService).inSingletonScope();\n container.register(listAppLambdaFunctionsService).inSingletonScope();\n container.register(listDeployedEnvironmentsService).inSingletonScope();\n container.register(watchedLambdaFunctionsService).inSingletonScope();\n container.register(pulumiGetConfigPassphraseService).inSingletonScope();\n container.register(pulumiGetSecretsProviderService).inSingletonScope();\n container.register(pulumiExportService).inSingletonScope();\n container.register(pulumiImportService).inSingletonScope();\n container.register(pulumiGetStackOutputService).inSingletonScope();\n container.register(pulumiLoginService).inSingletonScope();\n container.register(pulumiSelectStackService).inSingletonScope();\n\n // Deploy/Pulumi features.\n container.register(deployApp).inSingletonScope();\n container.register(destroyApp).inSingletonScope();\n container.register(exportStack).inSingletonScope();\n container.register(getAppOutput).inSingletonScope();\n container.register(getAppStackOutput).inSingletonScope();\n container.register(getPulumiResourceNamePrefix).inSingletonScope();\n container.register(refreshApp).inSingletonScope();\n container.register(runPulumiCommand).inSingletonScope();\n};\n\nexport const registerAwsProjectFeatures = (container: Container): void => {\n // Workspace decorators — must be registered before workspace services execute.\n container.registerDecorator(BuildProjectWorkspace);\n container.registerDecorator(BuildAppWorkspace);\n\n // Pulumi services + features (shared with the Pulumi program).\n registerAwsPulumiServices(container);\n\n // Deploy + core hooks.\n container.registerComposite(beforeDeploy);\n container.registerComposite(afterDeploy);\n container.registerComposite(coreBeforeBuild);\n container.registerComposite(coreAfterBuild);\n container.registerComposite(coreBeforeWatch);\n container.registerComposite(coreBeforeDeploy);\n container.registerComposite(coreAfterDeploy);\n container.registerComposite(apiBeforeDeploy);\n container.registerComposite(apiAfterDeploy);\n container.registerComposite(adminBeforeDeploy);\n container.registerComposite(adminAfterDeploy);\n\n // Deploy decorators (registered before InitProjectSdkService adds watchWithHooks etc.).\n container.registerDecorator(deployAppWithWatchedLambdaReplacement);\n container.registerDecorator(deployAppClearWatchedLambdaFunctions);\n container.registerDecorator(deployAppRefreshStackOutputCache);\n container.registerDecorator(deployAppWithHooks);\n container.registerDecorator(getPulumiServiceWithDownloadInfo);\n\n // Watch decorator that adds Lambda hot-reload.\n container.registerDecorator(awsWatch);\n};\n"],"names":["registerAwsPulumiServices","container","getPulumiService","isRemotePulumiBackendService","listAppLambdaFunctionsService","listDeployedEnvironmentsService","watchedLambdaFunctionsService","pulumiGetConfigPassphraseService","pulumiGetSecretsProviderService","pulumiExportService","pulumiImportService","pulumiGetStackOutputService","pulumiLoginService","pulumiSelectStackService","deployApp","destroyApp","exportStack","getAppOutput","getAppStackOutput","getPulumiResourceNamePrefix","refreshApp","runPulumiCommand","registerAwsProjectFeatures","BuildProjectWorkspace","BuildAppWorkspace","beforeDeploy","afterDeploy","coreBeforeBuild","coreAfterBuild","coreBeforeWatch","coreBeforeDeploy","coreAfterDeploy","apiBeforeDeploy","apiAfterDeploy","adminBeforeDeploy","adminAfterDeploy","deployAppWithWatchedLambdaReplacement","deployAppClearWatchedLambdaFunctions","deployAppRefreshStackOutputCache","deployAppWithHooks","getPulumiServiceWithDownloadInfo","awsWatch"],"mappings":";;;;;;;;AAiEO,MAAMA,4BAA4B,CAACC;IAEtCA,UAAU,QAAQ,CAACC,kBAAkB,gBAAgB;IACrDD,UAAU,QAAQ,CAACE,8BAA8B,gBAAgB;IACjEF,UAAU,QAAQ,CAACG,+BAA+B,gBAAgB;IAClEH,UAAU,QAAQ,CAACI,iCAAiC,gBAAgB;IACpEJ,UAAU,QAAQ,CAACK,+BAA+B,gBAAgB;IAClEL,UAAU,QAAQ,CAACM,kCAAkC,gBAAgB;IACrEN,UAAU,QAAQ,CAACO,iCAAiC,gBAAgB;IACpEP,UAAU,QAAQ,CAACQ,qBAAqB,gBAAgB;IACxDR,UAAU,QAAQ,CAACS,qBAAqB,gBAAgB;IACxDT,UAAU,QAAQ,CAACU,6BAA6B,gBAAgB;IAChEV,UAAU,QAAQ,CAACW,oBAAoB,gBAAgB;IACvDX,UAAU,QAAQ,CAACY,0BAA0B,gBAAgB;IAG7DZ,UAAU,QAAQ,CAACa,WAAW,gBAAgB;IAC9Cb,UAAU,QAAQ,CAACc,YAAY,gBAAgB;IAC/Cd,UAAU,QAAQ,CAACe,aAAa,gBAAgB;IAChDf,UAAU,QAAQ,CAACgB,cAAc,gBAAgB;IACjDhB,UAAU,QAAQ,CAACiB,mBAAmB,gBAAgB;IACtDjB,UAAU,QAAQ,CAACkB,6BAA6B,gBAAgB;IAChElB,UAAU,QAAQ,CAACmB,YAAY,gBAAgB;IAC/CnB,UAAU,QAAQ,CAACoB,kBAAkB,gBAAgB;AACzD;AAEO,MAAMC,6BAA6B,CAACrB;IAEvCA,UAAU,iBAAiB,CAACsB;IAC5BtB,UAAU,iBAAiB,CAACuB;IAG5BxB,0BAA0BC;IAG1BA,UAAU,iBAAiB,CAACwB;IAC5BxB,UAAU,iBAAiB,CAACyB;IAC5BzB,UAAU,iBAAiB,CAAC0B;IAC5B1B,UAAU,iBAAiB,CAAC2B;IAC5B3B,UAAU,iBAAiB,CAAC4B;IAC5B5B,UAAU,iBAAiB,CAAC6B;IAC5B7B,UAAU,iBAAiB,CAAC8B;IAC5B9B,UAAU,iBAAiB,CAAC+B;IAC5B/B,UAAU,iBAAiB,CAACgC;IAC5BhC,UAAU,iBAAiB,CAACiC;IAC5BjC,UAAU,iBAAiB,CAACkC;IAG5BlC,UAAU,iBAAiB,CAACmC;IAC5BnC,UAAU,iBAAiB,CAACoC;IAC5BpC,UAAU,iBAAiB,CAACqC;IAC5BrC,UAAU,iBAAiB,CAACsC;IAC5BtC,UAAU,iBAAiB,CAACuC;IAG5BvC,UAAU,iBAAiB,CAACwC;AAChC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GetProjectService, GetPulumiService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
export declare class DefaultGetPulumiService implements GetPulumiService.Interface {
|
|
3
|
+
private readonly getProjectService;
|
|
4
|
+
private readonly projectSdkParamsService;
|
|
5
|
+
constructor(getProjectService: GetProjectService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
6
|
+
execute(params?: GetPulumiService.Params): Promise<import("@webiny/pulumi-sdk").Pulumi>;
|
|
7
|
+
}
|
|
8
|
+
export declare const getPulumiService: import("@webiny/di").Implementation<typeof DefaultGetPulumiService>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { GetProjectService, GetPulumiService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { WBY_PROJECT_SDK_CONTEXT, serializeProjectSdkContext } from "@webiny/project/utils/index.js";
|
|
4
|
+
class DefaultGetPulumiService {
|
|
5
|
+
constructor(getProjectService, projectSdkParamsService){
|
|
6
|
+
this.getProjectService = getProjectService;
|
|
7
|
+
this.projectSdkParamsService = projectSdkParamsService;
|
|
8
|
+
}
|
|
9
|
+
async execute(params = {}) {
|
|
10
|
+
const project = this.getProjectService.execute();
|
|
11
|
+
const { app, pulumiOptions = {} } = params;
|
|
12
|
+
let cwd;
|
|
13
|
+
if (app) cwd = app.paths.workspaceFolder.toString();
|
|
14
|
+
const sdkParams = this.projectSdkParamsService.get();
|
|
15
|
+
const contextEnv = {
|
|
16
|
+
[WBY_PROJECT_SDK_CONTEXT]: serializeProjectSdkContext(sdkParams)
|
|
17
|
+
};
|
|
18
|
+
const mergedExeca = {
|
|
19
|
+
...pulumiOptions.execa,
|
|
20
|
+
cwd,
|
|
21
|
+
env: {
|
|
22
|
+
...pulumiOptions.execa?.env,
|
|
23
|
+
...contextEnv
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const { Pulumi } = await import("@webiny/pulumi-sdk");
|
|
27
|
+
return Pulumi.create({
|
|
28
|
+
...pulumiOptions,
|
|
29
|
+
execa: mergedExeca,
|
|
30
|
+
pulumiFolder: project.paths.dotWebinyFolder.toString()
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const getPulumiService = createImplementation({
|
|
35
|
+
abstraction: GetPulumiService,
|
|
36
|
+
implementation: DefaultGetPulumiService,
|
|
37
|
+
dependencies: [
|
|
38
|
+
GetProjectService,
|
|
39
|
+
ProjectSdkParamsService
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
export { DefaultGetPulumiService, getPulumiService };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=GetPulumiService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/GetPulumiService/GetPulumiService.js","sources":["../../../src/services/GetPulumiService/GetPulumiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n GetProjectService,\n GetPulumiService,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport {\n serializeProjectSdkContext,\n WBY_PROJECT_SDK_CONTEXT\n} from \"@webiny/project/utils/index.js\";\n\nexport class DefaultGetPulumiService implements GetPulumiService.Interface {\n constructor(\n private readonly getProjectService: GetProjectService.Interface,\n private readonly projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: GetPulumiService.Params = {}) {\n const project = this.getProjectService.execute();\n const { app, pulumiOptions = {} } = params;\n\n let cwd;\n if (app) {\n cwd = app.paths.workspaceFolder.toString();\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const contextEnv = {\n [WBY_PROJECT_SDK_CONTEXT]: serializeProjectSdkContext(sdkParams)\n };\n\n const mergedExeca = {\n ...pulumiOptions.execa,\n cwd,\n env: {\n ...pulumiOptions.execa?.env,\n ...contextEnv\n }\n };\n\n // Loaded here rather than at the top of the file. This service is registered for every\n // command, and the Pulumi SDK is only needed by the commands that run Pulumi.\n const { Pulumi } = await import(\"@webiny/pulumi-sdk\");\n\n return Pulumi.create({\n ...pulumiOptions,\n execa: mergedExeca,\n pulumiFolder: project.paths.dotWebinyFolder.toString()\n });\n }\n}\n\nexport const getPulumiService = createImplementation({\n abstraction: GetPulumiService,\n implementation: DefaultGetPulumiService,\n dependencies: [GetProjectService, ProjectSdkParamsService]\n});\n"],"names":["DefaultGetPulumiService","getProjectService","projectSdkParamsService","params","project","app","pulumiOptions","cwd","sdkParams","contextEnv","WBY_PROJECT_SDK_CONTEXT","serializeProjectSdkContext","mergedExeca","Pulumi","getPulumiService","createImplementation","GetPulumiService","GetProjectService","ProjectSdkParamsService"],"mappings":";;;AAWO,MAAMA;IACT,YACqBC,iBAA8C,EAC9CC,uBAA0D,CAC7E;aAFmBD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IAClB;IAEH,MAAM,QAAQC,SAAkC,CAAC,CAAC,EAAE;QAChD,MAAMC,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,MAAM,EAAEC,GAAG,EAAEC,gBAAgB,CAAC,CAAC,EAAE,GAAGH;QAEpC,IAAII;QACJ,IAAIF,KACAE,MAAMF,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QAG5C,MAAMG,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,aAAa;YACf,CAACC,wBAAwB,EAAEC,2BAA2BH;QAC1D;QAEA,MAAMI,cAAc;YAChB,GAAGN,cAAc,KAAK;YACtBC;YACA,KAAK;gBACD,GAAGD,cAAc,KAAK,EAAE,GAAG;gBAC3B,GAAGG,UAAU;YACjB;QACJ;QAIA,MAAM,EAAEI,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC;QAEhC,OAAOA,OAAO,MAAM,CAAC;YACjB,GAAGP,aAAa;YAChB,OAAOM;YACP,cAAcR,QAAQ,KAAK,CAAC,eAAe,CAAC,QAAQ;QACxD;IACJ;AACJ;AAEO,MAAMU,mBAAmBC,qBAAqB;IACjD,aAAaC;IACb,gBAAgBhB;IAChB,cAAc;QAACiB;QAAmBC;KAAwB;AAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPulumiBaseTemplatesFolderPath: () => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dirname, join } from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
const getPulumiBaseTemplatesFolderPath = ()=>{
|
|
4
|
+
const templatePackage = import.meta.resolve("@webiny/project-aws-template/package.json");
|
|
5
|
+
if (!templatePackage) throw new Error("Could not find the `@webiny/project-aws-template` package. Something went terribly wrong.");
|
|
6
|
+
return join(dirname(fileURLToPath(templatePackage)), "template");
|
|
7
|
+
};
|
|
8
|
+
export { getPulumiBaseTemplatesFolderPath };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=getPulumiBaseTemplatesFolderPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils/getPulumiBaseTemplatesFolderPath.js","sources":["../../src/utils/getPulumiBaseTemplatesFolderPath.ts"],"sourcesContent":["import { dirname, join } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nexport const getPulumiBaseTemplatesFolderPath = () => {\n const templatePackage = import.meta.resolve(\"@webiny/project-aws-template/package.json\");\n\n if (!templatePackage) {\n throw new Error(\n \"Could not find the `@webiny/project-aws-template` package. Something went terribly wrong.\"\n );\n }\n\n return join(dirname(fileURLToPath(templatePackage)), \"template\");\n};\n"],"names":["getPulumiBaseTemplatesFolderPath","templatePackage","Error","join","dirname","fileURLToPath"],"mappings":";;AAGO,MAAMA,mCAAmC;IAC5C,MAAMC,kBAAkB,YAAY,OAAO,CAAC;IAE5C,IAAI,CAACA,iBACD,MAAM,IAAIC,MACN;IAIR,OAAOC,KAAKC,QAAQC,cAAcJ,mBAAmB;AACzD"}
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { authenticateUsingHttpHeader } from "@webiny/api-core/legacy/security/plugins/authenticateUsingHttpHeader.js";
|
|
2
|
-
import apiKeyAuthentication from "@webiny/api-core/legacy/security/plugins/apiKeyAuthentication.js";
|
|
3
|
-
import apiKeyAuthorization from "@webiny/api-core/legacy/security/plugins/apiKeyAuthorization.js";
|
|
4
|
-
|
|
5
|
-
export default () => [
|
|
6
|
-
// /**
|
|
7
|
-
// * Sync Admin Users with Cognito User Pool.
|
|
8
|
-
// */
|
|
9
|
-
// syncWithCognito({
|
|
10
|
-
// region: String(process.env.COGNITO_REGION),
|
|
11
|
-
// userPoolId: String(process.env.COGNITO_USER_POOL_ID)
|
|
12
|
-
// }),
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Perform authentication using the common "Authorization" HTTP header.
|
|
16
|
-
* This will fetch the value of the header, and execute the authentication process.
|
|
17
|
-
*/
|
|
18
|
-
authenticateUsingHttpHeader(),
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* API Key authenticator.
|
|
22
|
-
* API Keys are a standalone entity, and are not connected to users in any way.
|
|
23
|
-
* They identify a project, a 3rd party client, not a particular user.
|
|
24
|
-
* They are used for programmatic API access, CMS data import/export, etc.
|
|
25
|
-
*/
|
|
26
|
-
apiKeyAuthentication({ identityType: "api-key" }),
|
|
27
|
-
|
|
28
|
-
// /**
|
|
29
|
-
// * Cognito authentication plugin.
|
|
30
|
-
// * This plugin will verify the JWT token against the provided User Pool.
|
|
31
|
-
// */
|
|
32
|
-
// cognitoAuthentication({
|
|
33
|
-
// region: String(process.env.COGNITO_REGION),
|
|
34
|
-
// userPoolId: String(process.env.COGNITO_USER_POOL_ID),
|
|
35
|
-
// identityType: "admin"
|
|
36
|
-
// }),
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Authorization plugin to fetch permissions for a verified API key.
|
|
40
|
-
* The "identityType" must match the authentication plugin used to load the identity.
|
|
41
|
-
*/
|
|
42
|
-
apiKeyAuthorization({ identityType: "api-key" })
|
|
43
|
-
];
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import knexLib from "knex";
|
|
3
|
-
import { createHandler } from "@webiny/handler-aws";
|
|
4
|
-
import graphqlPlugins from "@webiny/handler-graphql";
|
|
5
|
-
import { createApiCore } from "@webiny/api-core";
|
|
6
|
-
import { createApiCoreSql, registerSQLCore } from "@webiny/api-core-sql";
|
|
7
|
-
import { createFileManagerContext } from "@webiny/api-file-manager";
|
|
8
|
-
import { createFileManagerAco } from "@webiny/api-file-manager-aco";
|
|
9
|
-
import { createAssetDelivery, createFileManagerS3 } from "@webiny/api-file-manager-s3";
|
|
10
|
-
import { createCmsExtension } from "@webiny/api-headless-cms";
|
|
11
|
-
import { registerSqlStorageOperations } from "@webiny/api-headless-cms-sql";
|
|
12
|
-
import { createAco } from "@webiny/api-aco";
|
|
13
|
-
import { registerAcoSqlStorageOperations } from "@webiny/api-aco-sql";
|
|
14
|
-
import { createAcoHcmsContext } from "@webiny/api-headless-cms-aco";
|
|
15
|
-
import securityPlugins from "./security.js";
|
|
16
|
-
import { createWebsiteBuilder } from "@webiny/api-website-builder";
|
|
17
|
-
import { createAuditLogs } from "@webiny/api-audit-logs";
|
|
18
|
-
import { registerAuditLogsSqlStorageOperations } from "@webiny/api-audit-logs-sql";
|
|
19
|
-
import { createBackgroundTasks } from "@webiny/api-background-tasks-os";
|
|
20
|
-
import { createWebsockets } from "@webiny/api-websockets";
|
|
21
|
-
import { createAwsWebsockets } from "@webiny/api-websockets-aws";
|
|
22
|
-
import { registerWebsocketsSqlStorageOperations } from "@webiny/api-websockets-sql";
|
|
23
|
-
import { createRecordLocking } from "@webiny/api-record-locking";
|
|
24
|
-
import { registerSchedulerExtension } from "@webiny/api-scheduler";
|
|
25
|
-
import { registerSchedulerServerExtension } from "@webiny/api-scheduler-server";
|
|
26
|
-
import { createHeadlessCmsScheduler } from "@webiny/api-headless-cms-scheduler";
|
|
27
|
-
import { createMailerContext, createMailerGraphQL } from "@webiny/api-mailer";
|
|
28
|
-
import { createWorkflows } from "@webiny/api-workflows";
|
|
29
|
-
import { createHeadlessCmsWorkflows } from "@webiny/api-headless-cms-workflows";
|
|
30
|
-
import { createWebsiteBuilderWorkflows } from "@webiny/api-website-builder-workflows";
|
|
31
|
-
import { createWebsiteBuilderScheduler } from "@webiny/api-website-builder-scheduler";
|
|
32
|
-
import { createWebhooks } from "@webiny/webhooks/api";
|
|
33
|
-
|
|
34
|
-
import { extensions } from "./extensions";
|
|
35
|
-
|
|
36
|
-
const debug = process.env.DEBUG === "true";
|
|
37
|
-
|
|
38
|
-
const knex = knexLib({
|
|
39
|
-
client: "better-sqlite3",
|
|
40
|
-
connection: {
|
|
41
|
-
filename: resolve(process.cwd(), "db", "webiny.db")
|
|
42
|
-
},
|
|
43
|
-
useNullAsDefault: true
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const handler = createHandler({
|
|
47
|
-
plugins: [
|
|
48
|
-
registerSQLCore({
|
|
49
|
-
knex
|
|
50
|
-
}),
|
|
51
|
-
createApiCore({
|
|
52
|
-
storageOperations: createApiCoreSql({ knex })
|
|
53
|
-
}),
|
|
54
|
-
graphqlPlugins({ debug }),
|
|
55
|
-
securityPlugins(),
|
|
56
|
-
createWebsockets(),
|
|
57
|
-
createAwsWebsockets(),
|
|
58
|
-
registerWebsocketsSqlStorageOperations({ knex }),
|
|
59
|
-
registerSqlStorageOperations({
|
|
60
|
-
knex
|
|
61
|
-
}),
|
|
62
|
-
createCmsExtension(),
|
|
63
|
-
createMailerContext(),
|
|
64
|
-
createMailerGraphQL(),
|
|
65
|
-
createWebsiteBuilder(),
|
|
66
|
-
createRecordLocking(),
|
|
67
|
-
createBackgroundTasks(),
|
|
68
|
-
createFileManagerContext(),
|
|
69
|
-
createFileManagerAco(),
|
|
70
|
-
createAssetDelivery(),
|
|
71
|
-
createFileManagerS3(),
|
|
72
|
-
registerAcoSqlStorageOperations({ knex }),
|
|
73
|
-
createAco(),
|
|
74
|
-
createWorkflows(),
|
|
75
|
-
createHeadlessCmsWorkflows(),
|
|
76
|
-
createWebsiteBuilderWorkflows(),
|
|
77
|
-
registerAuditLogsSqlStorageOperations({
|
|
78
|
-
knex
|
|
79
|
-
}),
|
|
80
|
-
createAuditLogs(),
|
|
81
|
-
createAcoHcmsContext(),
|
|
82
|
-
registerSchedulerExtension(),
|
|
83
|
-
registerSchedulerServerExtension(),
|
|
84
|
-
createHeadlessCmsScheduler(),
|
|
85
|
-
createWebsiteBuilderScheduler(),
|
|
86
|
-
createWebhooks(),
|
|
87
|
-
extensions()
|
|
88
|
-
],
|
|
89
|
-
debug
|
|
90
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const Encryption: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
|
|
3
|
-
passphrase: z.ZodString;
|
|
4
|
-
salt: z.ZodOptional<z.ZodString>;
|
|
5
|
-
algorithm: z.ZodOptional<z.ZodEnum<{
|
|
6
|
-
"aes-128-gcm": "aes-128-gcm";
|
|
7
|
-
"aes-192-gcm": "aes-192-gcm";
|
|
8
|
-
"aes-256-gcm": "aes-256-gcm";
|
|
9
|
-
}>>;
|
|
10
|
-
}, z.core.$strip>>;
|
package/extensions/Encryption.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import react from "react";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
4
|
-
import { BuildParam } from "@webiny/project/extensions/index.js";
|
|
5
|
-
const SUPPORTED_ALGORITHMS = [
|
|
6
|
-
"aes-128-gcm",
|
|
7
|
-
"aes-192-gcm",
|
|
8
|
-
"aes-256-gcm"
|
|
9
|
-
];
|
|
10
|
-
const Encryption = defineExtension({
|
|
11
|
-
type: "Infra/Encryption",
|
|
12
|
-
tags: {
|
|
13
|
-
runtimeContext: "project"
|
|
14
|
-
},
|
|
15
|
-
description: "Configure the API's EncryptionService.",
|
|
16
|
-
paramsSchema: z.object({
|
|
17
|
-
passphrase: z.string().min(1).describe("The passphrase used to derive the AES encryption key via scrypt."),
|
|
18
|
-
salt: z.string().min(1).optional().describe("Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys."),
|
|
19
|
-
algorithm: z["enum"](SUPPORTED_ALGORITHMS).optional().describe("AES-GCM algorithm. Defaults to aes-256-gcm.")
|
|
20
|
-
}),
|
|
21
|
-
render ({ passphrase, salt, algorithm }) {
|
|
22
|
-
return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(BuildParam, {
|
|
23
|
-
paramName: "EncryptionPassphrase",
|
|
24
|
-
value: passphrase
|
|
25
|
-
}), salt && /*#__PURE__*/ react.createElement(BuildParam, {
|
|
26
|
-
paramName: "EncryptionSalt",
|
|
27
|
-
value: salt
|
|
28
|
-
}), algorithm && /*#__PURE__*/ react.createElement(BuildParam, {
|
|
29
|
-
paramName: "EncryptionAlgorithm",
|
|
30
|
-
value: algorithm
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
export { Encryption };
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=Encryption.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/Encryption.js","sources":["../../src/extensions/Encryption.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { BuildParam } from \"@webiny/project/extensions/index.js\";\n\nconst SUPPORTED_ALGORITHMS = [\"aes-128-gcm\", \"aes-192-gcm\", \"aes-256-gcm\"] as const;\n\nexport const Encryption = defineExtension({\n type: \"Infra/Encryption\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure the API's EncryptionService.\",\n paramsSchema: z.object({\n passphrase: z\n .string()\n .min(1)\n .describe(\"The passphrase used to derive the AES encryption key via scrypt.\"),\n salt: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys.\"\n ),\n algorithm: z\n .enum(SUPPORTED_ALGORITHMS)\n .optional()\n .describe(\"AES-GCM algorithm. Defaults to aes-256-gcm.\")\n }),\n render({ passphrase, salt, algorithm }) {\n return (\n <>\n <BuildParam paramName=\"EncryptionPassphrase\" value={passphrase} />\n {salt && <BuildParam paramName=\"EncryptionSalt\" value={salt} />}\n {algorithm && <BuildParam paramName=\"EncryptionAlgorithm\" value={algorithm} />}\n </>\n );\n }\n});\n"],"names":["SUPPORTED_ALGORITHMS","Encryption","defineExtension","z","passphrase","salt","algorithm","BuildParam"],"mappings":";;;;AAKA,MAAMA,uBAAuB;IAAC;IAAe;IAAe;CAAc;AAEnE,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,YAAYA,EAAAA,MACD,GACN,GAAG,CAAC,GACJ,QAAQ,CAAC;QACd,MAAMA,EAAAA,MACK,GACN,GAAG,CAAC,GACJ,QAAQ,GACR,QAAQ,CACL;QAER,WAAWA,CAAC,CAADA,OACF,CAACH,sBACL,QAAQ,GACR,QAAQ,CAAC;IAClB;IACA,QAAO,EAAEI,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAE;QAClC,OAAO,WAAP,GACI,wDACI,oBAACC,YAAUA;YAAC,WAAU;YAAuB,OAAOH;YACnDC,QAAQ,WAARA,GAAQ,oBAACE,YAAUA;YAAC,WAAU;YAAiB,OAAOF;YACtDC,aAAa,WAAbA,GAAa,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAG7E;AACJ"}
|