@webiny/project 6.4.5 → 6.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ProjectSdk.d.ts +6 -5
- package/ProjectSdk.js +10 -6
- package/ProjectSdk.js.map +1 -1
- package/abstractions/features/DeployApp.d.ts +2 -2
- package/abstractions/features/DeployApp.js.map +1 -1
- package/abstractions/features/DestroyApp.d.ts +4 -4
- package/abstractions/features/DestroyApp.js.map +1 -1
- package/abstractions/features/GetAppOutput.d.ts +2 -2
- package/abstractions/features/GetAppOutput.js.map +1 -1
- package/abstractions/features/RefreshApp.d.ts +2 -2
- package/abstractions/features/RefreshApp.js.map +1 -1
- package/abstractions/features/RunPulumiCommand.d.ts +2 -2
- package/abstractions/features/RunPulumiCommand.js.map +1 -1
- package/abstractions/features/Serve.d.ts +27 -0
- package/abstractions/features/Serve.js +5 -0
- package/abstractions/features/Serve.js.map +1 -0
- package/abstractions/features/Watch.d.ts +8 -0
- package/abstractions/features/Watch.js.map +1 -1
- package/abstractions/features/index.d.ts +1 -0
- package/abstractions/features/index.js +1 -0
- package/abstractions/services/index.d.ts +0 -1
- package/abstractions/services/index.js +0 -1
- package/createProjectSdkContainer.d.ts +1 -1
- package/createProjectSdkContainer.js +6 -33
- package/createProjectSdkContainer.js.map +1 -1
- package/decorators/index.d.ts +0 -1
- package/decorators/index.js +0 -1
- package/extensions/AdminApiUrl.d.ts +10 -0
- package/extensions/AdminApiUrl.js +21 -0
- package/extensions/AdminApiUrl.js.map +1 -0
- package/extensions/AdminWebsocketsUrl.d.ts +12 -0
- package/extensions/AdminWebsocketsUrl.js +21 -0
- package/extensions/AdminWebsocketsUrl.js.map +1 -0
- package/extensions/ApiBuildParam.js +2 -2
- package/extensions/ApiBuildParam.js.map +1 -1
- package/extensions/ApiExtension.js +2 -2
- package/extensions/ApiExtension.js.map +1 -1
- package/extensions/Project.js +1 -17
- package/extensions/Project.js.map +1 -1
- package/extensions/index.d.ts +30 -9
- package/extensions/index.js +10 -2
- package/extensions/index.js.map +1 -1
- package/extensions/infra/Encryption.d.ts +10 -0
- package/extensions/infra/Encryption.js +36 -0
- package/extensions/infra/Encryption.js.map +1 -0
- package/extensions/infra/Hashing.d.ts +5 -0
- package/extensions/infra/Hashing.js +27 -0
- package/extensions/infra/Hashing.js.map +1 -0
- package/features/DestroyApp/DestroyApp.d.ts +1 -1
- package/features/GetAppOutput/GetAppOutput.d.ts +1 -1
- package/features/RefreshApp/RefreshApp.d.ts +1 -1
- package/features/RunPulumiCommand/RunPulumiCommand.d.ts +1 -1
- package/features/Serve/Serve.d.ts +10 -0
- package/features/Serve/Serve.js +15 -0
- package/features/Serve/Serve.js.map +1 -0
- package/features/Serve/index.d.ts +1 -0
- package/features/Serve/index.js +1 -0
- package/features/Watch/Watch.d.ts +3 -16
- package/features/Watch/Watch.js +4 -86
- package/features/Watch/Watch.js.map +1 -1
- package/features/Watch/watchers/ServersWatcher.d.ts +36 -0
- package/features/Watch/watchers/ServersWatcher.js +38 -0
- package/features/Watch/watchers/ServersWatcher.js.map +1 -0
- package/features/index.d.ts +1 -0
- package/features/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +16 -19
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.d.ts +2 -3
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js +11 -44
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js.map +1 -1
- package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js +4 -6
- package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js.map +1 -1
- package/services/GetProjectConfigService/renderConfigWorker.js +2 -8
- package/services/GetProjectConfigService/renderConfigWorker.js.map +1 -1
- package/services/InitProjectSdkService/InitProjectSdkService.js +1 -7
- package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
- package/services/ProjectInfoService/GetPulumiVersionService.js +3 -3
- package/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
- package/services/PulumiExportService/PulumiExportService.js.map +1 -1
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +11 -3
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +64 -7
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -1
- package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -1
- package/services/index.d.ts +0 -2
- package/services/index.js +0 -2
- package/utils/apiRuntimeEnv.d.ts +20 -0
- package/utils/apiRuntimeEnv.js +51 -0
- package/utils/apiRuntimeEnv.js.map +1 -0
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
- package/abstractions/services/StackOutputCacheService.d.ts +0 -10
- package/abstractions/services/StackOutputCacheService.js +0 -5
- package/abstractions/services/StackOutputCacheService.js.map +0 -1
- package/decorators/DestroyAppClearStackOutputCache.d.ts +0 -25
- package/decorators/DestroyAppClearStackOutputCache.js +0 -29
- package/decorators/DestroyAppClearStackOutputCache.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeWatch.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeWatch.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeWatch.js.map +0 -1
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.d.ts +0 -11
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js +0 -31
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js.map +0 -1
- package/extensions/Project/EnsureTelemetryEnabledForOss.d.ts +0 -13
- package/extensions/Project/EnsureTelemetryEnabledForOss.js +0 -34
- package/extensions/Project/EnsureTelemetryEnabledForOss.js.map +0 -1
- package/extensions/Project/TelemetryNoLongerNewUser.d.ts +0 -8
- package/extensions/Project/TelemetryNoLongerNewUser.js +0 -14
- package/extensions/Project/TelemetryNoLongerNewUser.js.map +0 -1
- package/extensions/Project/ValidateEncryptionBeforeDeploy.d.ts +0 -12
- package/extensions/Project/ValidateEncryptionBeforeDeploy.js +0 -31
- package/extensions/Project/ValidateEncryptionBeforeDeploy.js.map +0 -1
- package/extensions/Project/ValidateProductionPulumiState.d.ts +0 -12
- package/extensions/Project/ValidateProductionPulumiState.js +0 -33
- package/extensions/Project/ValidateProductionPulumiState.js.map +0 -1
- package/features/Watch/getIotEndpoint.d.ts +0 -2
- package/features/Watch/getIotEndpoint.js +0 -18
- package/features/Watch/getIotEndpoint.js.map +0 -1
- package/features/Watch/replaceLambdaFunctions.d.ts +0 -19
- package/features/Watch/replaceLambdaFunctions.js +0 -72
- package/features/Watch/replaceLambdaFunctions.js.map +0 -1
- package/services/GetPulumiService/GetPulumiService.d.ts +0 -9
- package/services/GetPulumiService/GetPulumiService.js +0 -44
- package/services/GetPulumiService/GetPulumiService.js.map +0 -1
- package/services/GetPulumiService/index.d.ts +0 -1
- package/services/GetPulumiService/index.js +0 -1
- package/services/StackOutputCacheService/StackOutputCacheService.d.ts +0 -18
- package/services/StackOutputCacheService/StackOutputCacheService.js +0 -89
- package/services/StackOutputCacheService/StackOutputCacheService.js.map +0 -1
- package/services/StackOutputCacheService/index.d.ts +0 -1
- package/services/StackOutputCacheService/index.js +0 -1
- package/utils/getTemplatesFolderPath.d.ts +0 -1
- package/utils/getTemplatesFolderPath.js +0 -11
- package/utils/getTemplatesFolderPath.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as
|
|
4
|
+
* `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL
|
|
5
|
+
* from the API URL (same origin, http -> ws), which is what the self-hosted server hosting type needs by
|
|
6
|
+
* default. Set it only when WebSockets are served from a different origin than the API. Because the
|
|
7
|
+
* config is evaluated at build time, the value can come from any env var the user chooses, e.g.
|
|
8
|
+
* `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AdminWebsocketsUrl: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
|
|
11
|
+
url: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineExtension } from "../defineExtension/index.js";
|
|
4
|
+
import { EnvVar } from "./EnvVar.js";
|
|
5
|
+
const AdminWebsocketsUrl = defineExtension({
|
|
6
|
+
type: "Admin/WebsocketsUrl",
|
|
7
|
+
tags: {
|
|
8
|
+
runtimeContext: "project"
|
|
9
|
+
},
|
|
10
|
+
description: "Set a dedicated WebSocket URL for the Admin app.",
|
|
11
|
+
paramsSchema: z.object({
|
|
12
|
+
url: z.string().describe("The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002")
|
|
13
|
+
}),
|
|
14
|
+
render: (props)=>/*#__PURE__*/ react.createElement(EnvVar, {
|
|
15
|
+
varName: "WEBINY_ADMIN_WS_API_URL",
|
|
16
|
+
value: props.url
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
export { AdminWebsocketsUrl };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=AdminWebsocketsUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws), which is what the self-hosted server hosting type needs by\n * default. Set it only when WebSockets are served from a different origin than the API. Because the\n * config is evaluated at build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\"The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002\")\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAaO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CAAC;IAClB;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
|
|
@@ -77,8 +77,8 @@ export default BuildParam.createImplementation({
|
|
|
77
77
|
index = last.getChildIndex() + 1;
|
|
78
78
|
}
|
|
79
79
|
const contextPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
80
|
+
const existingRegisterExtensionPluginImport = source.getImportDeclaration(contextPluginImportPath);
|
|
81
|
+
if (!existingRegisterExtensionPluginImport) source.insertImportDeclaration(index, {
|
|
82
82
|
namedImports: [
|
|
83
83
|
"createRegisterExtensionPlugin"
|
|
84
84
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ApiBuildParam.js","sources":["../../src/extensions/ApiBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.string(), z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Check if file already exists.\n if (fs.existsSync(filePath)) {\n // File exists, just ensure it's imported in extensions.ts\n } else {\n // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/api/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now update extensions.ts to import and register this BuildParam.\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Calculate import path relative to extensions.ts.\n let importPath = path\n .relative(path.dirname(extensionsTsFilePath), filePath)\n .replace(/\\.tsx?$/, \".js\");\n\n // Ensure the path starts with ./\n if (!importPath.startsWith(\".\")) {\n importPath = \"./\" + importPath;\n }\n\n // Check if import already exists.\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for the BuildParam implementation.\n source.insertImportDeclaration(index, {\n defaultImport: className,\n moduleSpecifier: importPath\n });\n\n // Add the registration to the plugins array.\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${className});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const contextPluginImportPath = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const
|
|
1
|
+
{"version":3,"file":"extensions/ApiBuildParam.js","sources":["../../src/extensions/ApiBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.string(), z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Check if file already exists.\n if (fs.existsSync(filePath)) {\n // File exists, just ensure it's imported in extensions.ts\n } else {\n // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/api/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now update extensions.ts to import and register this BuildParam.\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Calculate import path relative to extensions.ts.\n let importPath = path\n .relative(path.dirname(extensionsTsFilePath), filePath)\n .replace(/\\.tsx?$/, \".js\");\n\n // Ensure the path starts with ./\n if (!importPath.startsWith(\".\")) {\n importPath = \"./\" + importPath;\n }\n\n // Check if import already exists.\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for the BuildParam implementation.\n source.insertImportDeclaration(index, {\n defaultImport: className,\n moduleSpecifier: importPath\n });\n\n // Add the registration to the plugins array.\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${className});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const contextPluginImportPath = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingRegisterExtensionPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"names":["BuildParam","defineExtension","z","params","ctx","extensionsTsFilePath","buildParamsDir","paramName","value","valueStr","JSON","hash","crypto","className","fileName","filePath","path","fs","fileContent","project","Project","source","importPath","existingImportDeclaration","index","importDeclarations","last","pluginsArray","node","Node","contextPluginImportPath","existingRegisterExtensionPluginImport"],"mappings":";;;;;;AAOO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,IACHC,EAAE,MAAM,CAAC;YACZ,WAAWA,EAAE,MAAM;YACnB,OAAOA,EAAE,KAAK,CAAC;gBACXA,EAAE,MAAM;gBACRA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG;gBAC1BA,EAAE,KAAK,CAACA,EAAE,GAAG;gBACbA,EAAE,MAAM;gBACRA,EAAE,OAAO;aACZ;QACL;IAEJ,MAAM,OAAMC,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAME,iBAAiBF,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACnD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,eACtC,QAAQ;QAEb,MAAM,EAAEG,SAAS,EAAEC,KAAK,EAAE,GAAGL;QAG7B,MAAMM,WAAWC,KAAK,SAAS,CAACF,OAAO,MAAM;QAG7C,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACL,WAAW,MAAM,CAAC;QAClE,MAAMM,YAAY,CAAC,WAAW,EAAEF,KAAK,KAAK,CAAC,MAAM;QACjD,MAAMG,WAAW,GAAGD,UAAU,GAAG,CAAC;QAClC,MAAME,WAAWC,KAAK,IAAI,CAACV,gBAAgBQ;QAG3C,IAAI,CAACG,GAAG,UAAU,CAACX,iBACfW,GAAG,SAAS,CAACX,gBAAgB;YAAE,WAAW;QAAK;QAInD,IAAIW,GAAG,UAAU,CAACF;aAEX;YAEH,MAAMG,cAAc,CAAC;;MAE3B,EAAEL,UAAU;WACP,EAAEN,UAAU;YACX,EAAEE,SAAS;;;;oBAIH,EAAEI,UAAU;;;AAGhC,CAAC;YACWI,GAAG,aAAa,CAACF,UAAUG,aAAa;QAC5C;QAGA,MAAMC,UAAU,IAAIC;QACpBD,QAAQ,mBAAmB,CAACd;QAE5B,MAAMgB,SAASF,QAAQ,oBAAoB,CAACd;QAG5C,IAAIiB,aAAaN,KAAAA,QACJ,CAACA,KAAK,OAAO,CAACX,uBAAuBU,UAC7C,OAAO,CAAC,WAAW;QAGxB,IAAI,CAACO,WAAW,UAAU,CAAC,MACvBA,aAAa,OAAOA;QAIxB,MAAMC,4BAA4BF,OAAO,oBAAoB,CAACC;QAC9D,IAAIC,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;QACvD,IAAII,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGAL,OAAO,uBAAuB,CAACG,OAAO;YAClC,eAAeX;YACf,iBAAiBS;QACrB;QAGA,MAAMK,eAAeN,OAAO,kBAAkB,CAACO,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,6EAA6E,EAAEd,UAAU,MAAM,CAAC;QAGrG;YACI,IAAIW,QAAQ;YAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;YACvD,IAAII,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAEA,MAAMI,0BAA0B;YAChC,MAAMC,wCACFV,OAAO,oBAAoB,CAACS;YAChC,IAAI,CAACC,uCACDV,OAAO,uBAAuB,CAACG,OAAO;gBAClC,cAAc;oBAAC;iBAAgC;gBAC/C,iBAAiBM;YACrB;QAER;QAEA,MAAMT,OAAO,IAAI;IACrB;AACJ"}
|
|
@@ -65,8 +65,8 @@ const ApiExtension = defineExtension({
|
|
|
65
65
|
index = last.getChildIndex() + 1;
|
|
66
66
|
}
|
|
67
67
|
const registerExtensionPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
68
|
+
const existingRegisterExtensionPluginImport = source.getImportDeclaration(registerExtensionPluginImportPath);
|
|
69
|
+
if (!existingRegisterExtensionPluginImport) source.insertImportDeclaration(index, {
|
|
70
70
|
namedImports: [
|
|
71
71
|
"createRegisterExtensionPlugin"
|
|
72
72
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/ApiExtension.js","sources":["../../src/extensions/ApiExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const ApiExtension = defineExtension({\n type: \"Api/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add any API extension.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name is always the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Alias name is \"ApiExtension_\" + hash of the file path. This way we\n // avoid potential naming conflicts and keep the identifier constant.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;\n\n // Calculate import path relative to `extensions.ts` file.\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Check if the file has a default export using AST parsing.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n // Support both default and named exports.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: exportNameAlias,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: exportNameAlias }],\n moduleSpecifier: importPath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${exportNameAlias});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const registerExtensionPluginImportPath =\n \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const
|
|
1
|
+
{"version":3,"file":"extensions/ApiExtension.js","sources":["../../src/extensions/ApiExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const ApiExtension = defineExtension({\n type: \"Api/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add any API extension.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name is always the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Alias name is \"ApiExtension_\" + hash of the file path. This way we\n // avoid potential naming conflicts and keep the identifier constant.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;\n\n // Calculate import path relative to `extensions.ts` file.\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Check if the file has a default export using AST parsing.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n // Support both default and named exports.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: exportNameAlias,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: exportNameAlias }],\n moduleSpecifier: importPath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${exportNameAlias});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const registerExtensionPluginImportPath =\n \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport = source.getImportDeclaration(\n registerExtensionPluginImportPath\n );\n if (!existingRegisterExtensionPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: registerExtensionPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"names":["ApiExtension","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","extensionFilePath","absoluteExtensionFilePath","ExtensionSrcResolver","extensionFileName","path","exportName","hash","crypto","exportNameAlias","importPath","Project","source","existingImportDeclaration","index","importDeclarations","last","extensionProject","extensionSource","hasDefaultExport","undefined","pluginsArray","node","Node","registerExtensionPluginImportPath","existingRegisterExtensionPluginImport"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,YAAYC,EAAE,MAAM,GAAG,QAAQ;QACnC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAM,EAAE,KAAKE,iBAAiB,EAAE,GAAGH;QAGnC,MAAMI,4BAA4BC,qBAAqB,WAAW,CAC9DF,mBACAF,IAAI,OAAO;QAGf,MAAMK,oBAAoBC,KAAK,QAAQ,CAACH;QAGxC,MAAMI,aAAaR,OAAO,UAAU,IAAIO,KAAK,KAAK,CAACD,mBAAmB,IAAI;QAI1E,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACP,mBAAmB,MAAM,CAAC;QAC1E,MAAMQ,kBAAkB,CAAC,aAAa,EAAEF,KAAK,KAAK,CAAC,MAAM;QAGzD,MAAMG,aAAaL,KAAAA,QACN,CAACA,KAAK,OAAO,CAACL,uBAAuBE,2BAC7C,OAAO,CAAC,WAAW;QAExB,MAAMP,UAAU,IAAIgB;QACpBhB,QAAQ,mBAAmB,CAACK;QAE5B,MAAMY,SAASjB,QAAQ,oBAAoB,CAACK;QAE5C,MAAMa,4BAA4BD,OAAO,oBAAoB,CAACF;QAC9D,IAAIG,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;QACvD,IAAIG,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGA,MAAMC,mBAAmB,IAAIN;QAC7BM,iBAAiB,mBAAmB,CAACf;QACrC,MAAMgB,kBAAkBD,iBAAiB,oBAAoB,CAACf;QAC9D,MAAMiB,mBAAmBD,AAA6CE,WAA7CF,gBAAgB,sBAAsB;QAG/D,IAAIC,kBACAP,OAAO,uBAAuB,CAACE,OAAO;YAClC,eAAeL;YACf,iBAAiBC;QACrB;aAEAE,OAAO,uBAAuB,CAACE,OAAO;YAClC,cAAc;gBAAC;oBAAE,MAAMR;oBAAY,OAAOG;gBAAgB;aAAE;YAC5D,iBAAiBC;QACrB;QAGJ,MAAMW,eAAeT,OAAO,kBAAkB,CAACU,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,6EAA6E,EAAEZ,gBAAgB,MAAM,CAAC;QAG3G;YACI,IAAIK,QAAQ;YAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;YACvD,IAAIG,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAEA,MAAMQ,oCACF;YACJ,MAAMC,wCAAwCb,OAAO,oBAAoB,CACrEY;YAEJ,IAAI,CAACC,uCACDb,OAAO,uBAAuB,CAACE,OAAO;gBAClC,cAAc;oBAAC;iBAAgC;gBAC/C,iBAAiBU;YACrB;QAER;QAEA,MAAMZ,OAAO,IAAI;IACrB;AACJ"}
|
package/extensions/Project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { createPathResolver } from "../utils/createPathResolver.js";
|
|
3
|
-
import {
|
|
3
|
+
import { AdminBeforeBuild, AdminBeforeWatch, ApiAfterBuild, ApiBeforeWatch } from "./index.js";
|
|
4
4
|
const p = createPathResolver(import.meta.dirname, "Project");
|
|
5
5
|
const Project = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(AdminBeforeBuild, {
|
|
6
6
|
src: p("SetAdminAppEnvVarsBeforeBuild.js")
|
|
@@ -10,24 +10,8 @@ const Project = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#_
|
|
|
10
10
|
src: p("ShowConfigChangeInfoBeforeAdminWatch.js")
|
|
11
11
|
}), /*#__PURE__*/ react.createElement(ApiAfterBuild, {
|
|
12
12
|
src: p("WcpInjectTelemetryClientAfterBuild.js")
|
|
13
|
-
}), /*#__PURE__*/ react.createElement(ApiBeforeDeploy, {
|
|
14
|
-
src: p("EnsureCoreDeployedBeforeApiDeploy.js")
|
|
15
|
-
}), /*#__PURE__*/ react.createElement(ApiBeforeWatch, {
|
|
16
|
-
src: p("EnsureApiDeployedBeforeWatch.js")
|
|
17
13
|
}), /*#__PURE__*/ react.createElement(ApiBeforeWatch, {
|
|
18
14
|
src: p("ShowConfigChangeInfoBeforeApiWatch.js")
|
|
19
|
-
}), /*#__PURE__*/ react.createElement(AdminBeforeBuild, {
|
|
20
|
-
src: p("EnsureApiDeployedBeforeAdminBuild.js")
|
|
21
|
-
}), /*#__PURE__*/ react.createElement(AdminBeforeWatch, {
|
|
22
|
-
src: p("EnsureApiDeployedBeforeAdminWatch.js")
|
|
23
|
-
}), /*#__PURE__*/ react.createElement(AdminAfterDeploy, {
|
|
24
|
-
src: p("TelemetryNoLongerNewUser.js")
|
|
25
|
-
}), /*#__PURE__*/ react.createElement(BeforeDeploy, {
|
|
26
|
-
src: p("EnsureTelemetryEnabledForOss.js")
|
|
27
|
-
}), /*#__PURE__*/ react.createElement(BeforeDeploy, {
|
|
28
|
-
src: p("ValidateEncryptionBeforeDeploy.js")
|
|
29
|
-
}), /*#__PURE__*/ react.createElement(CoreBeforeDeploy, {
|
|
30
|
-
src: p("ValidateProductionPulumiState.js")
|
|
31
15
|
}));
|
|
32
16
|
export { Project };
|
|
33
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/Project.js","sources":["../../src/extensions/Project.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPathResolver } from \"~/utils/createPathResolver.js\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"extensions/Project.js","sources":["../../src/extensions/Project.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPathResolver } from \"~/utils/createPathResolver.js\";\nimport {\n AdminBeforeBuild,\n AdminBeforeWatch,\n ApiAfterBuild,\n ApiBeforeWatch\n} from \"~/extensions/index.js\";\n\nconst p = createPathResolver(import.meta.dirname, \"Project\");\n\nexport const Project = () => {\n return (\n <>\n <AdminBeforeBuild src={p(\"SetAdminAppEnvVarsBeforeBuild.js\")} />\n <AdminBeforeWatch src={p(\"SetAdminAppEnvVarsBeforeWatch.js\")} />\n <AdminBeforeWatch src={p(\"ShowConfigChangeInfoBeforeAdminWatch.js\")} />\n <ApiAfterBuild src={p(\"WcpInjectTelemetryClientAfterBuild.js\")} />\n <ApiBeforeWatch src={p(\"ShowConfigChangeInfoBeforeApiWatch.js\")} />\n </>\n );\n};\n"],"names":["p","createPathResolver","Project","AdminBeforeBuild","AdminBeforeWatch","ApiAfterBuild","ApiBeforeWatch"],"mappings":";;;AASA,MAAMA,IAAIC,mBAAmB,YAAY,OAAO,EAAE;AAE3C,MAAMC,UAAU,IACZ,WAAP,GACI,wDACI,oBAACC,kBAAgBA;QAAC,KAAKH,EAAE;sBACzB,oBAACI,kBAAgBA;QAAC,KAAKJ,EAAE;sBACzB,oBAACI,kBAAgBA;QAAC,KAAKJ,EAAE;sBACzB,oBAACK,eAAaA;QAAC,KAAKL,EAAE;sBACtB,oBAACM,gBAAcA;QAAC,KAAKN,EAAE"}
|
package/extensions/index.d.ts
CHANGED
|
@@ -8,9 +8,13 @@ import { DatabaseSetup } from "./DatabaseSetup.js";
|
|
|
8
8
|
import { FeatureFlags } from "./FeatureFlags.js";
|
|
9
9
|
import { BuildParam } from "./ApiBuildParam.js";
|
|
10
10
|
import { AdminBuildParam } from "./AdminBuildParam.js";
|
|
11
|
+
import { AdminApiUrl } from "./AdminApiUrl.js";
|
|
12
|
+
import { AdminWebsocketsUrl } from "./AdminWebsocketsUrl.js";
|
|
11
13
|
import { AdminExtension } from "./AdminExtension.js";
|
|
12
14
|
import { ApiExtension } from "./ApiExtension.js";
|
|
13
15
|
import { ApiMaxBundleSize } from "./ApiMaxBundleSize.js";
|
|
16
|
+
import { Encryption } from "./infra/Encryption.js";
|
|
17
|
+
import { Hashing } from "./infra/Hashing.js";
|
|
14
18
|
import { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, AfterBuild, AfterDeploy, BeforeDeploy, BeforeWatch, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, BeforeBuild, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch } from "./hooks/index.js";
|
|
15
19
|
import { ProductionEnvironments, PulumiResourceNamePrefix, CoreStackOutputValue, ApiStackOutputValue, AdminStackOutputValue } from "./pulumi/index.js";
|
|
16
20
|
export { Telemetry };
|
|
@@ -23,9 +27,13 @@ export { FeatureFlags };
|
|
|
23
27
|
export { DatabaseSetup };
|
|
24
28
|
export { BuildParam };
|
|
25
29
|
export { AdminBuildParam };
|
|
30
|
+
export { AdminApiUrl };
|
|
31
|
+
export { AdminWebsocketsUrl };
|
|
26
32
|
export { AdminExtension };
|
|
27
33
|
export { ApiExtension };
|
|
28
34
|
export { ApiMaxBundleSize };
|
|
35
|
+
export { Encryption };
|
|
36
|
+
export { Hashing };
|
|
29
37
|
export { BeforeBuild };
|
|
30
38
|
export { BeforeDeploy };
|
|
31
39
|
export { BeforeWatch };
|
|
@@ -52,16 +60,25 @@ export { CoreStackOutputValue };
|
|
|
52
60
|
export { ApiStackOutputValue };
|
|
53
61
|
export { AdminStackOutputValue };
|
|
54
62
|
export declare const definitions: (import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
55
|
-
|
|
56
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
57
|
-
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
63
|
+
environments: import("zod").ZodArray<import("zod").ZodString>;
|
|
58
64
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
59
|
-
|
|
65
|
+
paramName: import("zod").ZodString;
|
|
66
|
+
value: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny>, import("zod").ZodNumber, import("zod").ZodBoolean]>;
|
|
60
67
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
61
68
|
id: import("zod").ZodString;
|
|
62
69
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
63
70
|
varName: import("zod").ZodString;
|
|
64
71
|
value: import("zod").ZodString;
|
|
72
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
73
|
+
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
74
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
75
|
+
url: import("zod").ZodString;
|
|
76
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
77
|
+
size: import("zod").ZodNumber;
|
|
78
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
79
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
80
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
81
|
+
src: import("zod").ZodString;
|
|
65
82
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
66
83
|
features: import("zod").ZodObject<{
|
|
67
84
|
multiTenancy: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -92,8 +109,6 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
92
109
|
}, import("zod/v4/core").$strip>;
|
|
93
110
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
94
111
|
prefix: import("zod").ZodString;
|
|
95
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
96
|
-
environments: import("zod").ZodArray<import("zod").ZodString>;
|
|
97
112
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
98
113
|
key: import("zod").ZodString;
|
|
99
114
|
value: import("zod").ZodAny;
|
|
@@ -104,10 +119,16 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
104
119
|
"ddb+os": "ddb+os";
|
|
105
120
|
}>;
|
|
106
121
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
passphrase: import("zod").ZodString;
|
|
123
|
+
salt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
124
|
+
algorithm: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
125
|
+
"aes-128-gcm": "aes-128-gcm";
|
|
126
|
+
"aes-192-gcm": "aes-192-gcm";
|
|
127
|
+
"aes-256-gcm": "aes-256-gcm";
|
|
128
|
+
}>>;
|
|
109
129
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
110
|
-
|
|
130
|
+
pepper: import("zod").ZodOptional<import("zod").ZodString>;
|
|
131
|
+
cost: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
111
132
|
}, import("zod/v4/core").$strip>>)[];
|
|
112
133
|
export { Project } from "./Project.js";
|
|
113
134
|
export * from "../defineExtension/index.js";
|
package/extensions/index.js
CHANGED
|
@@ -8,9 +8,13 @@ import { DatabaseSetup } from "./DatabaseSetup.js";
|
|
|
8
8
|
import { FeatureFlags } from "./FeatureFlags.js";
|
|
9
9
|
import { BuildParam } from "./ApiBuildParam.js";
|
|
10
10
|
import { AdminBuildParam } from "./AdminBuildParam.js";
|
|
11
|
+
import { AdminApiUrl } from "./AdminApiUrl.js";
|
|
12
|
+
import { AdminWebsocketsUrl } from "./AdminWebsocketsUrl.js";
|
|
11
13
|
import { AdminExtension } from "./AdminExtension.js";
|
|
12
14
|
import { ApiExtension } from "./ApiExtension.js";
|
|
13
15
|
import { ApiMaxBundleSize } from "./ApiMaxBundleSize.js";
|
|
16
|
+
import { Encryption } from "./infra/Encryption.js";
|
|
17
|
+
import { Hashing } from "./infra/Hashing.js";
|
|
14
18
|
import { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, AfterBuild, AfterDeploy, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, BeforeBuild, BeforeDeploy, BeforeWatch, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch } from "./hooks/index.js";
|
|
15
19
|
import { AdminStackOutputValue, ApiStackOutputValue, CoreStackOutputValue, ProductionEnvironments, PulumiResourceNamePrefix } from "./pulumi/index.js";
|
|
16
20
|
export * from "../defineExtension/index.js";
|
|
@@ -50,11 +54,15 @@ const definitions = [
|
|
|
50
54
|
DatabaseSetup.def,
|
|
51
55
|
BuildParam.def,
|
|
52
56
|
AdminBuildParam.def,
|
|
57
|
+
AdminApiUrl.def,
|
|
58
|
+
AdminWebsocketsUrl.def,
|
|
53
59
|
AdminExtension.def,
|
|
54
60
|
ApiExtension.def,
|
|
55
|
-
ApiMaxBundleSize.def
|
|
61
|
+
ApiMaxBundleSize.def,
|
|
62
|
+
Encryption.def,
|
|
63
|
+
Hashing.def
|
|
56
64
|
];
|
|
57
65
|
export { Project } from "./Project.js";
|
|
58
|
-
export { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, AdminBuildParam, AdminExtension, AdminStackOutputValue, AfterBuild, AfterDeploy, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, ApiExtension, ApiMaxBundleSize, ApiStackOutputValue, BeforeBuild, BeforeDeploy, BeforeWatch, BuildParam, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch, CoreStackOutputValue, DatabaseSetup, EnvVar, ExtensionDefinitions, FeatureFlags, ProductionEnvironments, ProjectDecorator, ProjectId, ProjectImplementation, PulumiResourceNamePrefix, Telemetry, definitions };
|
|
66
|
+
export { AdminAfterBuild, AdminAfterDeploy, AdminApiUrl, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, AdminBuildParam, AdminExtension, AdminStackOutputValue, AdminWebsocketsUrl, AfterBuild, AfterDeploy, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, ApiExtension, ApiMaxBundleSize, ApiStackOutputValue, BeforeBuild, BeforeDeploy, BeforeWatch, BuildParam, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch, CoreStackOutputValue, DatabaseSetup, Encryption, EnvVar, ExtensionDefinitions, FeatureFlags, Hashing, ProductionEnvironments, ProjectDecorator, ProjectId, ProjectImplementation, PulumiResourceNamePrefix, Telemetry, definitions };
|
|
59
67
|
|
|
60
68
|
//# sourceMappingURL=index.js.map
|
package/extensions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { ApiMaxBundleSize } from \"./ApiMaxBundleSize.js\";\n\n// Hooks.\nimport {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n AfterBuild,\n AfterDeploy,\n BeforeDeploy,\n BeforeWatch,\n ApiAfterBuild,\n ApiAfterDeploy,\n ApiBeforeBuild,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n BeforeBuild,\n CoreAfterBuild,\n CoreAfterDeploy,\n CoreBeforeBuild,\n CoreBeforeDeploy,\n CoreBeforeWatch\n} from \"./hooks/index.js\";\n\n// Pulumi (non-app-specific).\nimport {\n ProductionEnvironments,\n PulumiResourceNamePrefix,\n CoreStackOutputValue,\n ApiStackOutputValue,\n AdminStackOutputValue\n} from \"./pulumi/index.js\";\n\n// Exports.\nexport { Telemetry };\nexport { ProjectId };\nexport { ProjectDecorator };\nexport { ProjectImplementation };\nexport { ExtensionDefinitions };\nexport { EnvVar };\nexport { FeatureFlags };\nexport { DatabaseSetup };\nexport { BuildParam };\nexport { AdminBuildParam };\nexport { AdminExtension };\nexport { ApiExtension };\nexport { ApiMaxBundleSize };\n\n// Hooks.\nexport { BeforeBuild };\nexport { BeforeDeploy };\nexport { BeforeWatch };\nexport { AfterBuild };\nexport { AfterDeploy };\nexport { AdminBeforeBuild };\nexport { AdminBeforeDeploy };\nexport { AdminBeforeWatch };\nexport { AdminAfterBuild };\nexport { AdminAfterDeploy };\nexport { ApiBeforeBuild };\nexport { ApiBeforeDeploy };\nexport { ApiBeforeWatch };\nexport { ApiAfterBuild };\nexport { ApiAfterDeploy };\nexport { CoreBeforeBuild };\nexport { CoreBeforeDeploy };\nexport { CoreBeforeWatch };\nexport { CoreAfterBuild };\nexport { CoreAfterDeploy };\n\n// Pulumi (non-app-specific).\nexport { PulumiResourceNamePrefix };\nexport { ProductionEnvironments };\nexport { CoreStackOutputValue };\nexport { ApiStackOutputValue };\nexport { AdminStackOutputValue };\n\n// Definitions (used internally). 👇\nexport const definitions = [\n Telemetry.def,\n ProjectId.def,\n ProjectDecorator.def,\n ProjectImplementation.def,\n ExtensionDefinitions.def,\n EnvVar.def,\n FeatureFlags.def,\n\n // Hooks.\n AdminAfterBuild.def,\n AdminAfterDeploy.def,\n BeforeBuild.def,\n BeforeDeploy.def,\n BeforeWatch.def,\n AfterBuild.def,\n AfterDeploy.def,\n AdminBeforeBuild.def,\n AdminBeforeDeploy.def,\n AdminBeforeWatch.def,\n ApiAfterBuild.def,\n ApiAfterDeploy.def,\n ApiBeforeBuild.def,\n ApiBeforeDeploy.def,\n ApiBeforeWatch.def,\n CoreAfterBuild.def,\n CoreAfterDeploy.def,\n CoreBeforeBuild.def,\n CoreBeforeDeploy.def,\n CoreBeforeWatch.def,\n\n // Pulumi (non-app-specific).\n PulumiResourceNamePrefix.def,\n ProductionEnvironments.def,\n CoreStackOutputValue.def,\n ApiStackOutputValue.def,\n AdminStackOutputValue.def,\n DatabaseSetup.def,\n BuildParam.def,\n AdminBuildParam.def,\n AdminExtension.def,\n ApiExtension.def,\n ApiMaxBundleSize.def\n];\n\nexport { Project } from \"./Project.js\";\n\nexport * from \"../defineExtension/index.js\";\n"],"names":["definitions","Telemetry","ProjectId","ProjectDecorator","ProjectImplementation","ExtensionDefinitions","EnvVar","FeatureFlags","AdminAfterBuild","AdminAfterDeploy","BeforeBuild","BeforeDeploy","BeforeWatch","AfterBuild","AfterDeploy","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","ApiAfterBuild","ApiAfterDeploy","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","CoreAfterBuild","CoreAfterDeploy","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","PulumiResourceNamePrefix","ProductionEnvironments","CoreStackOutputValue","ApiStackOutputValue","AdminStackOutputValue","DatabaseSetup","BuildParam","AdminBuildParam","AdminExtension","ApiExtension","ApiMaxBundleSize"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminApiUrl } from \"./AdminApiUrl.js\";\nimport { AdminWebsocketsUrl } from \"./AdminWebsocketsUrl.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { ApiMaxBundleSize } from \"./ApiMaxBundleSize.js\";\nimport { Encryption } from \"./infra/Encryption.js\";\nimport { Hashing } from \"./infra/Hashing.js\";\n\n// Hooks.\nimport {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n AfterBuild,\n AfterDeploy,\n BeforeDeploy,\n BeforeWatch,\n ApiAfterBuild,\n ApiAfterDeploy,\n ApiBeforeBuild,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n BeforeBuild,\n CoreAfterBuild,\n CoreAfterDeploy,\n CoreBeforeBuild,\n CoreBeforeDeploy,\n CoreBeforeWatch\n} from \"./hooks/index.js\";\n\n// Pulumi (non-app-specific).\nimport {\n ProductionEnvironments,\n PulumiResourceNamePrefix,\n CoreStackOutputValue,\n ApiStackOutputValue,\n AdminStackOutputValue\n} from \"./pulumi/index.js\";\n\n// Exports.\nexport { Telemetry };\nexport { ProjectId };\nexport { ProjectDecorator };\nexport { ProjectImplementation };\nexport { ExtensionDefinitions };\nexport { EnvVar };\nexport { FeatureFlags };\nexport { DatabaseSetup };\nexport { BuildParam };\nexport { AdminBuildParam };\nexport { AdminApiUrl };\nexport { AdminWebsocketsUrl };\nexport { AdminExtension };\nexport { ApiExtension };\nexport { ApiMaxBundleSize };\nexport { Encryption };\nexport { Hashing };\n\n// Hooks.\nexport { BeforeBuild };\nexport { BeforeDeploy };\nexport { BeforeWatch };\nexport { AfterBuild };\nexport { AfterDeploy };\nexport { AdminBeforeBuild };\nexport { AdminBeforeDeploy };\nexport { AdminBeforeWatch };\nexport { AdminAfterBuild };\nexport { AdminAfterDeploy };\nexport { ApiBeforeBuild };\nexport { ApiBeforeDeploy };\nexport { ApiBeforeWatch };\nexport { ApiAfterBuild };\nexport { ApiAfterDeploy };\nexport { CoreBeforeBuild };\nexport { CoreBeforeDeploy };\nexport { CoreBeforeWatch };\nexport { CoreAfterBuild };\nexport { CoreAfterDeploy };\n\n// Pulumi (non-app-specific).\nexport { PulumiResourceNamePrefix };\nexport { ProductionEnvironments };\nexport { CoreStackOutputValue };\nexport { ApiStackOutputValue };\nexport { AdminStackOutputValue };\n\n// Definitions (used internally). 👇\nexport const definitions = [\n Telemetry.def,\n ProjectId.def,\n ProjectDecorator.def,\n ProjectImplementation.def,\n ExtensionDefinitions.def,\n EnvVar.def,\n FeatureFlags.def,\n\n // Hooks.\n AdminAfterBuild.def,\n AdminAfterDeploy.def,\n BeforeBuild.def,\n BeforeDeploy.def,\n BeforeWatch.def,\n AfterBuild.def,\n AfterDeploy.def,\n AdminBeforeBuild.def,\n AdminBeforeDeploy.def,\n AdminBeforeWatch.def,\n ApiAfterBuild.def,\n ApiAfterDeploy.def,\n ApiBeforeBuild.def,\n ApiBeforeDeploy.def,\n ApiBeforeWatch.def,\n CoreAfterBuild.def,\n CoreAfterDeploy.def,\n CoreBeforeBuild.def,\n CoreBeforeDeploy.def,\n CoreBeforeWatch.def,\n\n // Pulumi (non-app-specific).\n PulumiResourceNamePrefix.def,\n ProductionEnvironments.def,\n CoreStackOutputValue.def,\n ApiStackOutputValue.def,\n AdminStackOutputValue.def,\n DatabaseSetup.def,\n BuildParam.def,\n AdminBuildParam.def,\n AdminApiUrl.def,\n AdminWebsocketsUrl.def,\n AdminExtension.def,\n ApiExtension.def,\n ApiMaxBundleSize.def,\n Encryption.def,\n Hashing.def\n];\n\nexport { Project } from \"./Project.js\";\n\nexport * from \"../defineExtension/index.js\";\n"],"names":["definitions","Telemetry","ProjectId","ProjectDecorator","ProjectImplementation","ExtensionDefinitions","EnvVar","FeatureFlags","AdminAfterBuild","AdminAfterDeploy","BeforeBuild","BeforeDeploy","BeforeWatch","AfterBuild","AfterDeploy","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","ApiAfterBuild","ApiAfterDeploy","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","CoreAfterBuild","CoreAfterDeploy","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","PulumiResourceNamePrefix","ProductionEnvironments","CoreStackOutputValue","ApiStackOutputValue","AdminStackOutputValue","DatabaseSetup","BuildParam","AdminBuildParam","AdminApiUrl","AdminWebsocketsUrl","AdminExtension","ApiExtension","ApiMaxBundleSize","Encryption","Hashing"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoGO,MAAMA,cAAc;IACvBC,UAAU,GAAG;IACbC,UAAU,GAAG;IACbC,iBAAiB,GAAG;IACpBC,sBAAsB,GAAG;IACzBC,qBAAqB,GAAG;IACxBC,OAAO,GAAG;IACVC,aAAa,GAAG;IAGhBC,gBAAgB,GAAG;IACnBC,iBAAiB,GAAG;IACpBC,YAAY,GAAG;IACfC,aAAa,GAAG;IAChBC,YAAY,GAAG;IACfC,WAAW,GAAG;IACdC,YAAY,GAAG;IACfC,iBAAiB,GAAG;IACpBC,kBAAkB,GAAG;IACrBC,iBAAiB,GAAG;IACpBC,cAAc,GAAG;IACjBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,gBAAgB,GAAG;IACnBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,gBAAgB,GAAG;IACnBC,gBAAgB,GAAG;IACnBC,iBAAiB,GAAG;IACpBC,gBAAgB,GAAG;IAGnBC,yBAAyB,GAAG;IAC5BC,uBAAuB,GAAG;IAC1BC,qBAAqB,GAAG;IACxBC,oBAAoB,GAAG;IACvBC,sBAAsB,GAAG;IACzBC,cAAc,GAAG;IACjBC,WAAW,GAAG;IACdC,gBAAgB,GAAG;IACnBC,YAAY,GAAG;IACfC,mBAAmB,GAAG;IACtBC,eAAe,GAAG;IAClBC,aAAa,GAAG;IAChBC,iBAAiB,GAAG;IACpBC,WAAW,GAAG;IACdC,QAAQ,GAAG;CACd"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Encryption: import("~/defineExtension/index.js").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>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineExtension } from "../../defineExtension/index.js";
|
|
4
|
+
import { BuildParam } from "../ApiBuildParam.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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/infra/Encryption.js","sources":["../../../src/extensions/infra/Encryption.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineExtension } from "../../defineExtension/index.js";
|
|
4
|
+
import { BuildParam } from "../ApiBuildParam.js";
|
|
5
|
+
const Hashing = defineExtension({
|
|
6
|
+
type: "Infra/Hashing",
|
|
7
|
+
tags: {
|
|
8
|
+
runtimeContext: "project"
|
|
9
|
+
},
|
|
10
|
+
description: "Configure the API's hashing service (scrypt).",
|
|
11
|
+
paramsSchema: z.object({
|
|
12
|
+
pepper: z.string().min(1).optional().describe("Server-side secret folded into every hash (a 'pepper'). It is NOT stored with the hash, so a stolen database alone cannot be brute-forced without it. Changing it invalidates existing hashes."),
|
|
13
|
+
cost: z.number().int().positive().optional().describe("scrypt CPU/memory cost parameter N (a power of two). Defaults to 16384.")
|
|
14
|
+
}),
|
|
15
|
+
render ({ pepper, cost }) {
|
|
16
|
+
return /*#__PURE__*/ react.createElement(react.Fragment, null, pepper && /*#__PURE__*/ react.createElement(BuildParam, {
|
|
17
|
+
paramName: "HashingPepper",
|
|
18
|
+
value: pepper
|
|
19
|
+
}), cost && /*#__PURE__*/ react.createElement(BuildParam, {
|
|
20
|
+
paramName: "HashingCost",
|
|
21
|
+
value: cost
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export { Hashing };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=Hashing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions/infra/Hashing.js","sources":["../../../src/extensions/infra/Hashing.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nexport const Hashing = defineExtension({\n type: \"Infra/Hashing\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure the API's hashing service (scrypt).\",\n paramsSchema: z.object({\n pepper: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Server-side secret folded into every hash (a 'pepper'). It is NOT stored with the \" +\n \"hash, so a stolen database alone cannot be brute-forced without it. Changing it \" +\n \"invalidates existing hashes.\"\n ),\n cost: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\"scrypt CPU/memory cost parameter N (a power of two). Defaults to 16384.\")\n }),\n render({ pepper, cost }) {\n return (\n <>\n {pepper && <BuildParam paramName=\"HashingPepper\" value={pepper} />}\n {cost && <BuildParam paramName=\"HashingCost\" value={cost} />}\n </>\n );\n }\n});\n"],"names":["Hashing","defineExtension","z","pepper","cost","BuildParam"],"mappings":";;;;AAKO,MAAMA,UAAUC,gBAAgB;IACnC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,QAAQA,EAAAA,MACG,GACN,GAAG,CAAC,GACJ,QAAQ,GACR,QAAQ,CACL;QAIR,MAAMA,EAAAA,MACK,GACN,GAAG,GACH,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;IAClB;IACA,QAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE;QACnB,OAAO,WAAP,GACI,0CACKD,UAAU,WAAVA,GAAU,oBAACE,YAAUA;YAAC,WAAU;YAAgB,OAAOF;YACvDC,QAAQ,WAARA,GAAQ,oBAACC,YAAUA;YAAC,WAAU;YAAc,OAAOD;;IAGhE;AACJ"}
|
|
@@ -8,7 +8,7 @@ export declare class DefaultDestroyApp implements DestroyApp.Interface {
|
|
|
8
8
|
private projectSdkParamsService;
|
|
9
9
|
constructor(getApp: GetApp.Interface, buildAppWorkspaceService: BuildAppWorkspaceService.Interface, getProject: GetProject.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, getPulumiService: GetPulumiService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
10
10
|
execute(params: DestroyApp.Params): Promise<{
|
|
11
|
-
pulumiProcess: import("
|
|
11
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi").PulumiProcess;
|
|
12
12
|
}>;
|
|
13
13
|
}
|
|
14
14
|
export declare const destroyApp: import("@webiny/di").Implementation<typeof DefaultDestroyApp>;
|
|
@@ -6,7 +6,7 @@ export declare class DefaultGetAppOutput implements GetAppOutput.Interface {
|
|
|
6
6
|
private getPulumiService;
|
|
7
7
|
constructor(getApp: GetApp.Interface, buildAppWorkspaceService: BuildAppWorkspaceService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, getPulumiService: GetPulumiService.Interface);
|
|
8
8
|
execute(params: GetAppOutput.Params): Promise<{
|
|
9
|
-
pulumiProcess: import("
|
|
9
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi").PulumiProcess;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
12
|
export declare const getAppOutput: import("@webiny/di").Implementation<typeof DefaultGetAppOutput>;
|
|
@@ -7,7 +7,7 @@ export declare class DefaultRefreshApp implements RefreshApp.Interface {
|
|
|
7
7
|
private projectSdkParamsService;
|
|
8
8
|
constructor(getApp: GetApp.Interface, getProject: GetProject.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, getPulumiService: GetPulumiService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
9
9
|
execute(params: RefreshApp.Params): Promise<{
|
|
10
|
-
pulumiProcess: import("
|
|
10
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi").PulumiProcess;
|
|
11
11
|
}>;
|
|
12
12
|
}
|
|
13
13
|
export declare const refreshApp: import("@webiny/di").Implementation<typeof DefaultRefreshApp>;
|
|
@@ -7,7 +7,7 @@ export declare class DefaultRunPulumiCommand implements RunPulumiCommand.Interfa
|
|
|
7
7
|
private projectSdkParamsService;
|
|
8
8
|
constructor(getApp: GetApp.Interface, getProject: GetProject.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, getPulumiService: GetPulumiService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
9
9
|
execute(params: RunPulumiCommand.Params): Promise<{
|
|
10
|
-
pulumiProcess: import("
|
|
10
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi").PulumiProcess;
|
|
11
11
|
}>;
|
|
12
12
|
}
|
|
13
13
|
export declare const runPulumiCommand: import("@webiny/di").Implementation<typeof DefaultRunPulumiCommand>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Serve } from "../../abstractions/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base (hosting-agnostic) Serve implementation. There is no cloud-agnostic notion of "serving" a
|
|
4
|
+
* built app — the AWS hosting type deploys, it doesn't serve locally — so this default refuses. Hosting types
|
|
5
|
+
* that DO support serving (e.g. the self-hosted server hosting type) replace this implementation.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultServe implements Serve.Interface {
|
|
8
|
+
execute(): Promise<Serve.Result>;
|
|
9
|
+
}
|
|
10
|
+
export declare const serve: import("@webiny/di").Implementation<typeof DefaultServe>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { Serve } from "../../abstractions/index.js";
|
|
3
|
+
class DefaultServe {
|
|
4
|
+
async execute() {
|
|
5
|
+
throw new Error('The "serve" command is not supported in this project hosting type.');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const serve = createImplementation({
|
|
9
|
+
abstraction: Serve,
|
|
10
|
+
implementation: DefaultServe,
|
|
11
|
+
dependencies: []
|
|
12
|
+
});
|
|
13
|
+
export { DefaultServe, serve };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=Serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/Serve/Serve.js","sources":["../../../src/features/Serve/Serve.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { Serve } from \"~/abstractions/index.js\";\n\n/**\n * Base (hosting-agnostic) Serve implementation. There is no cloud-agnostic notion of \"serving\" a\n * built app — the AWS hosting type deploys, it doesn't serve locally — so this default refuses. Hosting types\n * that DO support serving (e.g. the self-hosted server hosting type) replace this implementation.\n */\nexport class DefaultServe implements Serve.Interface {\n async execute(): Promise<Serve.Result> {\n throw new Error(`The \"serve\" command is not supported in this project hosting type.`);\n }\n}\n\nexport const serve = createImplementation({\n abstraction: Serve,\n implementation: DefaultServe,\n dependencies: []\n});\n"],"names":["DefaultServe","Error","serve","createImplementation","Serve"],"mappings":";;AAQO,MAAMA;IACT,MAAM,UAAiC;QACnC,MAAM,IAAIC,MAAM;IACpB;AACJ;AAEO,MAAMC,QAAQC,qBAAqB;IACtC,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Serve.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Serve.js";
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import { BuildAppWorkspaceService,
|
|
2
|
-
import { PackagesWatcher } from "./watchers/PackagesWatcher.js";
|
|
3
|
-
import { WebinyConfigWatcher } from "../../features/Watch/watchers/WebinyConfigWatcher.js";
|
|
1
|
+
import { BuildAppWorkspaceService, GetApp, GetProductionEnvironments, GetProject, GetProjectConfigService, ListPackagesService, LoggerService, ProjectSdkParamsService, ValidateProjectConfigService, Watch } from "../../abstractions/index.js";
|
|
4
2
|
export declare class DefaultWatch implements Watch.Interface {
|
|
5
3
|
private getApp;
|
|
6
4
|
private logger;
|
|
7
|
-
private listAppLambdaFunctionsService;
|
|
8
5
|
private listPackagesService;
|
|
9
6
|
private getProject;
|
|
10
7
|
private getProjectConfigService;
|
|
11
8
|
private validateProjectConfigService;
|
|
12
9
|
private getProductionEnvironments;
|
|
13
|
-
private ui;
|
|
14
|
-
private pulumiGetStackOutputService;
|
|
15
|
-
private pulumiExportService;
|
|
16
|
-
private watchedLambdaFunctionsService;
|
|
17
10
|
private buildAppWorkspaceService;
|
|
18
11
|
private projectSdkParamsService;
|
|
19
|
-
constructor(getApp: GetApp.Interface, logger: LoggerService.Interface,
|
|
20
|
-
execute(params: Watch.Params): Promise<
|
|
21
|
-
packagesWatcher: PackagesWatcher;
|
|
22
|
-
webinyConfigWatcher?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
packagesWatcher: PackagesWatcher;
|
|
25
|
-
webinyConfigWatcher: WebinyConfigWatcher;
|
|
26
|
-
}>;
|
|
12
|
+
constructor(getApp: GetApp.Interface, logger: LoggerService.Interface, listPackagesService: ListPackagesService.Interface, getProject: GetProject.Interface, getProjectConfigService: GetProjectConfigService.Interface, validateProjectConfigService: ValidateProjectConfigService.Interface, getProductionEnvironments: GetProductionEnvironments.Interface, buildAppWorkspaceService: BuildAppWorkspaceService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
13
|
+
execute(params: Watch.Params): Promise<Watch.Result>;
|
|
27
14
|
}
|
|
28
15
|
export declare const watch: import("@webiny/di").Implementation<typeof DefaultWatch>;
|