@webiny/project-aws 6.1.0 → 6.2.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/_templates/appTemplates/api/graphql/src/index.ts +3 -6
- package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +13 -12
- package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +10 -2
- package/api.d.ts +17 -2
- package/api.js +2 -0
- package/api.js.map +1 -1
- package/extensions/ApiRoute.d.ts +16 -0
- package/extensions/ApiRoute.js +120 -0
- package/extensions/ApiRoute.js.map +1 -0
- package/extensions/OpenSearch.d.ts +3 -0
- package/extensions/OpenSearch.js +4 -1
- package/extensions/OpenSearch.js.map +1 -1
- package/extensions/RegisterRoutesPulumi.d.ts +10 -0
- package/extensions/RegisterRoutesPulumi.js +41 -0
- package/extensions/RegisterRoutesPulumi.js.map +1 -0
- package/extensions/definitions.js +2 -1
- package/extensions/definitions.js.map +1 -1
- package/extensions/index.d.ts +1 -0
- package/extensions/index.js +1 -0
- package/extensions/index.js.map +1 -1
- package/infra.d.ts +11 -2
- package/infra.js +2 -1
- package/infra.js.map +1 -1
- package/package.json +16 -15
- package/pulumi/apps/api/createApiPulumiApp.js +26 -6
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/core/CoreOpenSearch.js +28 -15
- package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
- package/pulumi/apps/core/createCorePulumiApp.js +9 -0
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +0 -2
- package/pulumi/apps/extensions/getOsConfigFromExtension.d.ts +3 -0
- package/pulumi/apps/extensions/getOsConfigFromExtension.js +14 -2
- package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
- package/pulumi/extensions/ApiCustomDomains.d.ts +9 -0
- package/pulumi/extensions/ApiCustomDomains.js +16 -0
- package/pulumi/extensions/ApiCustomDomains.js.map +1 -0
- package/pulumi/extensions/BlueGreenDeployments.d.ts +0 -2
- package/pulumi/extensions/BlueGreenDeployments.js +1 -3
- package/pulumi/extensions/BlueGreenDeployments.js.map +1 -1
- package/pulumi/extensions/OpenSearch.d.ts +3 -0
- package/pulumi/extensions/OpenSearch.js +5 -2
- package/pulumi/extensions/OpenSearch.js.map +1 -1
- package/pulumi/extensions/index.d.ts +5 -2
- package/pulumi/extensions/index.js +3 -1
- package/pulumi/extensions/index.js.map +1 -1
|
@@ -5,12 +5,11 @@ import { createApiCore } from "@webiny/api-core";
|
|
|
5
5
|
import { createApiCoreDdb } from "@webiny/api-core-ddb";
|
|
6
6
|
import dbPlugins from "@webiny/handler-db";
|
|
7
7
|
import { DynamoDbDriver } from "@webiny/db-dynamodb";
|
|
8
|
-
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
|
|
9
8
|
import { createFileManagerContext, createFileManagerGraphQL } from "@webiny/api-file-manager";
|
|
10
9
|
import { createFileManagerAco } from "@webiny/api-file-manager-aco";
|
|
11
10
|
import { createFileManagerS3, createAssetDelivery } from "@webiny/api-file-manager-s3";
|
|
12
11
|
import { createHeadlessCmsContext, createHeadlessCmsGraphQL } from "@webiny/api-headless-cms";
|
|
13
|
-
import {
|
|
12
|
+
import { registerDynamoDbStorageOperations } from "@webiny/api-headless-cms-ddb";
|
|
14
13
|
import { createHcmsTasks } from "@webiny/api-headless-cms-tasks";
|
|
15
14
|
import { createAco } from "@webiny/api-aco";
|
|
16
15
|
import { createAcoHcmsContext } from "@webiny/api-headless-cms-aco";
|
|
@@ -40,7 +39,6 @@ export const handler = createHandler({
|
|
|
40
39
|
createApiCore({
|
|
41
40
|
storageOperations: createApiCoreDdb({ documentClient })
|
|
42
41
|
}),
|
|
43
|
-
dynamoDbPlugins(),
|
|
44
42
|
graphqlPlugins({ debug }),
|
|
45
43
|
dbPlugins({
|
|
46
44
|
table: process.env.DB_TABLE,
|
|
@@ -48,9 +46,8 @@ export const handler = createHandler({
|
|
|
48
46
|
}),
|
|
49
47
|
securityPlugins(),
|
|
50
48
|
createWebsockets(),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}),
|
|
49
|
+
registerDynamoDbStorageOperations(),
|
|
50
|
+
createHeadlessCmsContext(),
|
|
54
51
|
createHeadlessCmsGraphQL(),
|
|
55
52
|
createMailerContext(),
|
|
56
53
|
createMailerGraphQL(),
|
|
@@ -5,13 +5,12 @@ import { createApiCore } from "@webiny/api-core";
|
|
|
5
5
|
import { createApiCoreDdb } from "@webiny/api-core-ddb";
|
|
6
6
|
import dbPlugins from "@webiny/handler-db";
|
|
7
7
|
import { DynamoDbDriver } from "@webiny/db-dynamodb";
|
|
8
|
-
import dynamoDbPlugins from "@webiny/db-dynamodb/plugins";
|
|
9
8
|
import { createOpenSearchContext, createOpenSearchClient } from "@webiny/api-opensearch";
|
|
10
9
|
import { createFileManagerContext, createFileManagerGraphQL } from "@webiny/api-file-manager";
|
|
11
10
|
import { createFileManagerAco } from "@webiny/api-file-manager-aco";
|
|
12
11
|
import { createAssetDelivery, createFileManagerS3 } from "@webiny/api-file-manager-s3";
|
|
13
12
|
import { createHeadlessCmsContext, createHeadlessCmsGraphQL } from "@webiny/api-headless-cms";
|
|
14
|
-
import {
|
|
13
|
+
import { registerCmsOpenSearchStorageOperations } from "@webiny/api-headless-cms-ddb-es";
|
|
15
14
|
import { createHcmsTasks } from "@webiny/api-headless-cms-tasks-ddb-es";
|
|
16
15
|
import { createAco } from "@webiny/api-aco";
|
|
17
16
|
import { createAcoHcmsContext } from "@webiny/api-headless-cms-aco";
|
|
@@ -36,16 +35,23 @@ const debug = process.env.DEBUG === "true";
|
|
|
36
35
|
|
|
37
36
|
const documentClient = getDocumentClient();
|
|
38
37
|
|
|
39
|
-
const
|
|
38
|
+
const osUsername = process.env.OPENSEARCH_USERNAME;
|
|
39
|
+
const osPassword = process.env.OPENSEARCH_PASSWORD;
|
|
40
|
+
|
|
41
|
+
const openSearchClientOptions: Parameters<typeof createOpenSearchClient>[0] = {
|
|
40
42
|
endpoint: `https://${process.env.OPENSEARCH_ENDPOINT}`
|
|
41
|
-
}
|
|
43
|
+
};
|
|
44
|
+
if (osUsername && osPassword) {
|
|
45
|
+
openSearchClientOptions.auth = { username: osUsername, password: osPassword };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const openSearchClient = createOpenSearchClient(openSearchClientOptions);
|
|
42
49
|
|
|
43
50
|
export const handler = createHandler({
|
|
44
51
|
plugins: [
|
|
45
52
|
createApiCore({
|
|
46
53
|
storageOperations: createApiCoreDdb({ documentClient })
|
|
47
54
|
}),
|
|
48
|
-
dynamoDbPlugins(),
|
|
49
55
|
graphqlPlugins({ debug }),
|
|
50
56
|
createOpenSearchContext(openSearchClient),
|
|
51
57
|
dbPlugins({
|
|
@@ -54,13 +60,8 @@ export const handler = createHandler({
|
|
|
54
60
|
}),
|
|
55
61
|
securityPlugins(),
|
|
56
62
|
createWebsockets(),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
documentClient,
|
|
60
|
-
elasticsearch: openSearchClient,
|
|
61
|
-
plugins: []
|
|
62
|
-
})
|
|
63
|
-
}),
|
|
63
|
+
registerCmsOpenSearchStorageOperations(),
|
|
64
|
+
createHeadlessCmsContext(),
|
|
64
65
|
createHeadlessCmsGraphQL(),
|
|
65
66
|
createMailerContext(),
|
|
66
67
|
createMailerGraphQL(),
|
|
@@ -2,9 +2,17 @@ import { createHandler } from "@webiny/handler-aws";
|
|
|
2
2
|
import { createOpenSearchClient, createOpenSearchContext } from "@webiny/api-opensearch";
|
|
3
3
|
import { createEventHandler } from "@webiny/api-dynamodb-to-elasticsearch";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const osUsername = process.env.OPENSEARCH_USERNAME;
|
|
6
|
+
const osPassword = process.env.OPENSEARCH_PASSWORD;
|
|
7
|
+
|
|
8
|
+
const clientOptions: Parameters<typeof createOpenSearchClient>[0] = {
|
|
6
9
|
endpoint: `https://${process.env.OPENSEARCH_ENDPOINT}`
|
|
7
|
-
}
|
|
10
|
+
};
|
|
11
|
+
if (osUsername && osPassword) {
|
|
12
|
+
clientOptions.auth = { username: osUsername, password: osPassword };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const client = createOpenSearchClient(clientOptions);
|
|
8
16
|
|
|
9
17
|
export const handler = createHandler({
|
|
10
18
|
plugins: [createOpenSearchContext(client), createEventHandler()],
|
package/api.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
export declare const Api: {
|
|
2
|
-
Extension: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
+
Extension: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
3
3
|
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
4
4
|
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
5
5
|
}, import("zod/v4/core").$strip>>;
|
|
6
|
-
|
|
6
|
+
Route: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
7
|
+
path: import("zod").ZodString;
|
|
8
|
+
method: import("zod").ZodEnum<{
|
|
9
|
+
DELETE: "DELETE";
|
|
10
|
+
GET: "GET";
|
|
11
|
+
HEAD: "HEAD";
|
|
12
|
+
PATCH: "PATCH";
|
|
13
|
+
POST: "POST";
|
|
14
|
+
PUT: "PUT";
|
|
15
|
+
OPTIONS: "OPTIONS";
|
|
16
|
+
ANY: "ANY";
|
|
17
|
+
}>;
|
|
18
|
+
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
19
|
+
routeName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
}, import("zod/v4/core").$strip>>;
|
|
21
|
+
BuildParam: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
7
22
|
paramName: import("zod").ZodString;
|
|
8
23
|
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]>;
|
|
9
24
|
}, import("zod/v4/core").$strip>>;
|
package/api.js
CHANGED
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApiExtension","BuildParam","Api","Extension"],"sources":["api.ts"],"sourcesContent":["import { ApiExtension, BuildParam } from \"@webiny/project/extensions/index.js\";\n\nexport const Api = {\n Extension: ApiExtension,\n BuildParam: BuildParam\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,UAAU,QAAQ,qCAAqC;
|
|
1
|
+
{"version":3,"names":["ApiExtension","BuildParam","ApiRoute","Api","Extension","Route"],"sources":["api.ts"],"sourcesContent":["import { ApiExtension, BuildParam } from \"@webiny/project/extensions/index.js\";\nimport { ApiRoute } from \"./extensions/ApiRoute.js\";\n\nexport const Api = {\n Extension: ApiExtension,\n Route: ApiRoute,\n BuildParam: BuildParam\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,UAAU,QAAQ,qCAAqC;AAC9E,SAASC,QAAQ;AAEjB,OAAO,MAAMC,GAAG,GAAG;EACfC,SAAS,EAAEJ,YAAY;EACvBK,KAAK,EAAEH,QAAQ;EACfD,UAAU,EAAEA;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ApiRoute: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
|
|
3
|
+
path: z.ZodString;
|
|
4
|
+
method: z.ZodEnum<{
|
|
5
|
+
DELETE: "DELETE";
|
|
6
|
+
GET: "GET";
|
|
7
|
+
HEAD: "HEAD";
|
|
8
|
+
PATCH: "PATCH";
|
|
9
|
+
POST: "POST";
|
|
10
|
+
PUT: "PUT";
|
|
11
|
+
OPTIONS: "OPTIONS";
|
|
12
|
+
ANY: "ANY";
|
|
13
|
+
}>;
|
|
14
|
+
src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
15
|
+
routeName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import crypto from "crypto";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { Node, Project } from "ts-morph";
|
|
6
|
+
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
7
|
+
import { zodSrcPath } from "@webiny/project/defineExtension/zodTypes/zodSrcPath.js";
|
|
8
|
+
import { ExtensionSrcResolver } from "@webiny/project/utils/index.js";
|
|
9
|
+
import { ApiPulumi } from "@webiny/project/extensions/index.js";
|
|
10
|
+
import { createPathResolver } from "@webiny/project";
|
|
11
|
+
const p = createPathResolver(import.meta.dirname);
|
|
12
|
+
const HTTP_METHODS = ["DELETE", "GET", "HEAD", "PATCH", "POST", "PUT", "OPTIONS", "ANY"];
|
|
13
|
+
const METHOD_HANDLER = {
|
|
14
|
+
DELETE: "onDelete",
|
|
15
|
+
GET: "onGet",
|
|
16
|
+
HEAD: "onHead",
|
|
17
|
+
PATCH: "onPatch",
|
|
18
|
+
POST: "onPost",
|
|
19
|
+
PUT: "onPut",
|
|
20
|
+
OPTIONS: "onOptions",
|
|
21
|
+
ANY: "onAll"
|
|
22
|
+
};
|
|
23
|
+
export const ApiRoute = defineExtension({
|
|
24
|
+
type: "Api/Route",
|
|
25
|
+
tags: {
|
|
26
|
+
runtimeContext: "app-build",
|
|
27
|
+
appName: "api"
|
|
28
|
+
},
|
|
29
|
+
description: "Register a custom REST route on the API Gateway + GraphQL Lambda.",
|
|
30
|
+
multiple: true,
|
|
31
|
+
paramsSchema: ({
|
|
32
|
+
project
|
|
33
|
+
}) => {
|
|
34
|
+
return z.object({
|
|
35
|
+
path: z.string().startsWith("/"),
|
|
36
|
+
method: z.enum(HTTP_METHODS),
|
|
37
|
+
// TODO: add zodSrcPath abstraction validation once Route abstraction is wired to zodSrcPath.
|
|
38
|
+
src: zodSrcPath({
|
|
39
|
+
project
|
|
40
|
+
}),
|
|
41
|
+
routeName: z.string().optional()
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
async build(params, ctx) {
|
|
45
|
+
const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
|
|
46
|
+
const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);
|
|
47
|
+
|
|
48
|
+
// Stable alias to avoid naming conflicts across multiple routes.
|
|
49
|
+
const hash = crypto.createHash("sha256").update(params.src).digest("hex");
|
|
50
|
+
const alias = `ApiRoute_${hash.slice(-10)}`;
|
|
51
|
+
const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath).replace(/\.tsx?$/, ".js");
|
|
52
|
+
const tsProject = new Project();
|
|
53
|
+
tsProject.addSourceFileAtPath(extensionsTsFilePath);
|
|
54
|
+
const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);
|
|
55
|
+
|
|
56
|
+
// Skip if the route handler is already registered.
|
|
57
|
+
if (source.getImportDeclaration(importPath)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Insert handler import after the last existing import.
|
|
62
|
+
let insertIndex = 1;
|
|
63
|
+
const importDeclarations = source.getImportDeclarations();
|
|
64
|
+
if (importDeclarations.length) {
|
|
65
|
+
insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;
|
|
66
|
+
}
|
|
67
|
+
source.insertImportDeclaration(insertIndex, {
|
|
68
|
+
defaultImport: alias,
|
|
69
|
+
moduleSpecifier: importPath
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Ensure createContextPlugin import exists.
|
|
73
|
+
const ctxPluginPath = "@webiny/api/plugins/ContextPlugin";
|
|
74
|
+
if (!source.getImportDeclaration(ctxPluginPath)) {
|
|
75
|
+
const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
|
|
76
|
+
source.insertImportDeclaration(lastIdx, {
|
|
77
|
+
namedImports: ["createContextPlugin"],
|
|
78
|
+
moduleSpecifier: ctxPluginPath
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Ensure createRoute and Route are imported from @webiny/handler.
|
|
83
|
+
const handlerImportPath = "@webiny/handler";
|
|
84
|
+
const existingHandlerImport = source.getImportDeclaration(handlerImportPath);
|
|
85
|
+
const requiredHandlerImports = ["createRoute", "Route"];
|
|
86
|
+
if (!existingHandlerImport) {
|
|
87
|
+
const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
|
|
88
|
+
source.insertImportDeclaration(lastIdx, {
|
|
89
|
+
namedImports: requiredHandlerImports,
|
|
90
|
+
moduleSpecifier: handlerImportPath
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
const present = existingHandlerImport.getNamedImports().map(i => i.getName());
|
|
94
|
+
for (const name of requiredHandlerImports) {
|
|
95
|
+
if (!present.includes(name)) {
|
|
96
|
+
existingHandlerImport.addNamedImport(name);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const onMethod = METHOD_HANDLER[params.method];
|
|
101
|
+
const routePath = params.path;
|
|
102
|
+
const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
|
|
103
|
+
|
|
104
|
+
// Register factory in DI container.
|
|
105
|
+
pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${alias});\n})`);
|
|
106
|
+
|
|
107
|
+
// Register Fastify route with hardcoded path/method.
|
|
108
|
+
// We use resolveAll(Route) + instanceof to find the correct handler when multiple
|
|
109
|
+
// Api.Route extensions are registered.
|
|
110
|
+
pluginsArray.addElement(`\ncreateRoute(({ ${onMethod}, context }) => {\n` + `\t${onMethod}("${routePath}", async (request, reply) => {\n` + `\t\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\n` + `\t\treturn instance.execute(request, reply);\n` + `\t});\n` + `})`);
|
|
111
|
+
await source.save();
|
|
112
|
+
},
|
|
113
|
+
render() {
|
|
114
|
+
return /*#__PURE__*/React.createElement(ApiPulumi, {
|
|
115
|
+
src: p("RegisterRoutesPulumi.js")
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=ApiRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","path","crypto","z","Node","Project","defineExtension","zodSrcPath","ExtensionSrcResolver","ApiPulumi","createPathResolver","p","import","meta","dirname","HTTP_METHODS","METHOD_HANDLER","DELETE","GET","HEAD","PATCH","POST","PUT","OPTIONS","ANY","ApiRoute","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","string","startsWith","method","enum","src","routeName","optional","build","params","ctx","extensionsTsFilePath","paths","workspaceFolder","join","toString","absoluteSrcFilePath","resolvePath","hash","createHash","update","digest","alias","slice","importPath","relative","replace","tsProject","addSourceFileAtPath","source","getSourceFileOrThrow","getImportDeclaration","insertIndex","importDeclarations","getImportDeclarations","length","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","ctxPluginPath","lastIdx","namedImports","handlerImportPath","existingHandlerImport","requiredHandlerImports","present","getNamedImports","map","i","getName","name","includes","addNamedImport","onMethod","routePath","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","save","render","createElement"],"sources":["ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi } from \"@webiny/project/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nconst HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\", \"ANY\"] as const;\n\nconst METHOD_HANDLER: Record<string, string> = {\n DELETE: \"onDelete\",\n GET: \"onGet\",\n HEAD: \"onHead\",\n PATCH: \"onPatch\",\n POST: \"onPost\",\n PUT: \"onPut\",\n OPTIONS: \"onOptions\",\n ANY: \"onAll\"\n};\n\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Register a custom REST route on the API Gateway + GraphQL Lambda.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // TODO: add zodSrcPath abstraction validation once Route abstraction is wired to zodSrcPath.\n src: zodSrcPath({ project }),\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Skip if the route handler is already registered.\n if (source.getImportDeclaration(importPath)) {\n return;\n }\n\n // Insert handler import after the last existing import.\n let insertIndex = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;\n }\n\n source.insertImportDeclaration(insertIndex, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n\n // Ensure createContextPlugin import exists.\n const ctxPluginPath = \"@webiny/api/plugins/ContextPlugin\";\n if (!source.getImportDeclaration(ctxPluginPath)) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: ctxPluginPath\n });\n }\n\n // Ensure createRoute and Route are imported from @webiny/handler.\n const handlerImportPath = \"@webiny/handler\";\n const existingHandlerImport = source.getImportDeclaration(handlerImportPath);\n const requiredHandlerImports = [\"createRoute\", \"Route\"];\n if (!existingHandlerImport) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: requiredHandlerImports,\n moduleSpecifier: handlerImportPath\n });\n } else {\n const present = existingHandlerImport.getNamedImports().map(i => i.getName());\n for (const name of requiredHandlerImports) {\n if (!present.includes(name)) {\n existingHandlerImport.addNamedImport(name);\n }\n }\n }\n\n const onMethod = METHOD_HANDLER[params.method];\n const routePath = params.path as `/${string}`;\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n // Register factory in DI container.\n pluginsArray.addElement(\n `\\ncreateContextPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${alias});\\n})`\n );\n\n // Register Fastify route with hardcoded path/method.\n // We use resolveAll(Route) + instanceof to find the correct handler when multiple\n // Api.Route extensions are registered.\n pluginsArray.addElement(\n `\\ncreateRoute(({ ${onMethod}, context }) => {\\n` +\n `\\t${onMethod}(\"${routePath}\", async (request, reply) => {\\n` +\n `\\t\\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\\n` +\n `\\t\\treturn instance.execute(request, reply);\\n` +\n `\\t});\\n` +\n `})`\n );\n\n await source.save();\n },\n render() {\n return <ApiPulumi src={p(\"RegisterRoutesPulumi.js\")} />;\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,IAAI,EAAEC,OAAO,QAAgC,UAAU;AAChE,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,QAAQ,wDAAwD;AACnF,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,SAAS,QAAQ,qCAAqC;AAC/D,SAASC,kBAAkB,QAAQ,iBAAiB;AAEpD,MAAMC,CAAC,GAAGD,kBAAkB,CAACE,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC;AAEjD,MAAMC,YAAY,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAU;AAEjG,MAAMC,cAAsC,GAAG;EAC3CC,MAAM,EAAE,UAAU;EAClBC,GAAG,EAAE,OAAO;EACZC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,QAAQ;EACdC,GAAG,EAAE,OAAO;EACZC,OAAO,EAAE,WAAW;EACpBC,GAAG,EAAE;AACT,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAGnB,eAAe,CAAC;EACpCoB,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAM,CAAC;EACrDC,WAAW,EAAE,mEAAmE;EAChFC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC3B,OAAO9B,CAAC,CAAC+B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,uBAAuB,CAACI,OAAO,EAAE;QACpCC,YAAY,EAAEG,sBAAsB;QACpCN,eAAe,EAAEI;MACrB,CAAC,CAAC;IACN,CAAC,MAAM;MACH,MAAMG,OAAO,GAAGF,qBAAqB,CAACG,eAAe,CAAC,CAAC,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,CAAC,CAAC;MAC7E,KAAK,MAAMC,IAAI,IAAIN,sBAAsB,EAAE;QACvC,IAAI,CAACC,OAAO,CAACM,QAAQ,CAACD,IAAI,CAAC,EAAE;UACzBP,qBAAqB,CAACS,cAAc,CAACF,IAAI,CAAC;QAC9C;MACJ;IACJ;IAEA,MAAMG,QAAQ,GAAGxE,cAAc,CAAC2B,MAAM,CAACN,MAAM,CAAC;IAC9C,MAAMoD,SAAS,GAAG9C,MAAM,CAAC1C,IAAoB;IAE7C,MAAMyF,YAAY,GAAG3B,MAAM,CAAC4B,kBAAkB,CAACC,IAAI,IAC/CxF,IAAI,CAACyF,wBAAwB,CAACD,IAAI,CACtC,CAA2B;;IAE3B;IACAF,YAAY,CAACI,UAAU,CACnB,sEAAsEtC,KAAK,QAC/E,CAAC;;IAED;IACA;IACA;IACAkC,YAAY,CAACI,UAAU,CACnB,oBAAoBN,QAAQ,qBAAqB,GAC7C,KAAKA,QAAQ,KAAKC,SAAS,kCAAkC,GAC7D,mFAAmFjC,KAAK,OAAO,GAC/F,gDAAgD,GAChD,SAAS,GACT,IACR,CAAC;IAED,MAAMO,MAAM,CAACgC,IAAI,CAAC,CAAC;EACvB,CAAC;EACDC,MAAMA,CAAA,EAAG;IACL,oBAAOhG,KAAA,CAAAiG,aAAA,CAACxF,SAAS;MAAC8B,GAAG,EAAE5B,CAAC,CAAC,yBAAyB;IAAE,CAAE,CAAC;EAC3D;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,4 +4,7 @@ export declare const OpenSearch: import("@webiny/project/defineExtension/defineE
|
|
|
4
4
|
domainName: z.ZodOptional<z.ZodString>;
|
|
5
5
|
indexPrefix: z.ZodOptional<z.ZodString>;
|
|
6
6
|
sharedIndexes: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
7
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
8
|
+
username: z.ZodOptional<z.ZodString>;
|
|
9
|
+
password: z.ZodOptional<z.ZodString>;
|
|
7
10
|
}, z.core.$strip>>;
|
package/extensions/OpenSearch.js
CHANGED
|
@@ -15,7 +15,10 @@ export const OpenSearch = defineExtension({
|
|
|
15
15
|
enabled: z.boolean().describe("Whether to enable OpenSearch.").default(false).optional(),
|
|
16
16
|
domainName: z.string().describe("The name of the Opensearch domain.").optional(),
|
|
17
17
|
indexPrefix: z.string().describe("A prefix to be added to all Opensearch indexes.").optional(),
|
|
18
|
-
sharedIndexes: z.boolean().describe("Whether to use shared indexes across all environments (true) or separate indexes per environment (false).").default(false).optional()
|
|
18
|
+
sharedIndexes: z.boolean().describe("Whether to use shared indexes across all environments (true) or separate indexes per environment (false).").default(false).optional(),
|
|
19
|
+
endpoint: z.string().describe("The endpoint of an existing OpenSearch cluster. Useful when cluster is behind a custom domain.").optional(),
|
|
20
|
+
username: z.string().describe("The username for OpenSearch authentication.").optional(),
|
|
21
|
+
password: z.string().describe("The password for OpenSearch authentication.").optional()
|
|
19
22
|
}),
|
|
20
23
|
render: props => {
|
|
21
24
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PulumiOpenSearch, props), props.enabled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatabaseSetup, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","defineExtension","OpenSearch","PulumiOpenSearch","createPathResolver","CoreBeforeDeploy","ProjectDecorator","DatabaseSetup","z","p","import","meta","dirname","type","tags","runtimeContext","description","paramsSchema","object","enabled","boolean","describe","default","optional","domainName","string","indexPrefix","sharedIndexes","render","props","createElement","Fragment","setupName","src"],"sources":["OpenSearch.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { OpenSearch as PulumiOpenSearch } from \"~/pulumi/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport {\n CoreBeforeDeploy,\n ProjectDecorator,\n DatabaseSetup\n} from \"@webiny/project/extensions/index.js\";\nimport { z } from \"zod\";\n\nconst p = createPathResolver(import.meta.dirname, \"OpenSearch\");\n\nexport const OpenSearch = defineExtension({\n type: \"Project/OpenSearch\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable and configure Opensearch integration with project-level setup.\",\n paramsSchema: z.object({\n enabled: z.boolean().describe(\"Whether to enable OpenSearch.\").default(false).optional(),\n domainName: z.string().describe(\"The name of the Opensearch domain.\").optional(),\n indexPrefix: z\n .string()\n .describe(\"A prefix to be added to all Opensearch indexes.\")\n .optional(),\n sharedIndexes: z\n .boolean()\n .describe(\n \"Whether to use shared indexes across all environments (true) or separate indexes per environment (false).\"\n )\n .default(false)\n .optional()\n }),\n render: props => {\n return (\n <>\n <PulumiOpenSearch {...props} />\n {props.enabled && (\n <>\n {/* Override database setup to indicate OpenSearch is enabled. */}\n <DatabaseSetup setupName=\"ddb+os\" />\n <ProjectDecorator src={p(\"InjectDdbEsLambdaFnHandler.js\")} />\n <ProjectDecorator src={p(\"ReplaceApiLambdaFnHandlers.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsServiceRoleBeforeCoreDeploy.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsWasDeployed.js\")} />\n </>\n )}\n </>\n );\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,IAAIC,gBAAgB;AACvC,SAASC,kBAAkB,QAAQ,iBAAiB;AACpD,SACIC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACV,qCAAqC;AAC5C,SAASC,CAAC,QAAQ,KAAK;AAEvB,MAAMC,CAAC,GAAGL,kBAAkB,CAACM,MAAM,CAACC,IAAI,CAACC,OAAO,EAAE,YAAY,CAAC;AAE/D,OAAO,MAAMV,UAAU,GAAGD,eAAe,CAAC;EACtCY,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EAAE,uEAAuE;EACpFC,YAAY,EAAET,CAAC,CAACU,MAAM,CAAC;IACnBC,OAAO,EAAEX,CAAC,CAACY,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC,+BAA+B,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC,CAACC,QAAQ,CAAC,CAAC;IACxFC,UAAU,EAAEhB,CAAC,CAACiB,MAAM,CAAC,CAAC,CAACJ,QAAQ,CAAC,oCAAoC,CAAC,CAACE,QAAQ,CAAC,CAAC;IAChFG,WAAW,EAAElB,CAAC,CACTiB,MAAM,CAAC,CAAC,CACRJ,QAAQ,CAAC,iDAAiD,CAAC,CAC3DE,QAAQ,CAAC,CAAC;IACfI,aAAa,EAAEnB,CAAC,CACXY,OAAO,CAAC,CAAC,CACTC,QAAQ,CACL,2GACJ,CAAC,CACAC,OAAO,CAAC,KAAK,CAAC,CACdC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"names":["React","defineExtension","OpenSearch","PulumiOpenSearch","createPathResolver","CoreBeforeDeploy","ProjectDecorator","DatabaseSetup","z","p","import","meta","dirname","type","tags","runtimeContext","description","paramsSchema","object","enabled","boolean","describe","default","optional","domainName","string","indexPrefix","sharedIndexes","endpoint","username","password","render","props","createElement","Fragment","setupName","src"],"sources":["OpenSearch.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { OpenSearch as PulumiOpenSearch } from \"~/pulumi/extensions/index.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport {\n CoreBeforeDeploy,\n ProjectDecorator,\n DatabaseSetup\n} from \"@webiny/project/extensions/index.js\";\nimport { z } from \"zod\";\n\nconst p = createPathResolver(import.meta.dirname, \"OpenSearch\");\n\nexport const OpenSearch = defineExtension({\n type: \"Project/OpenSearch\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable and configure Opensearch integration with project-level setup.\",\n paramsSchema: z.object({\n enabled: z.boolean().describe(\"Whether to enable OpenSearch.\").default(false).optional(),\n domainName: z.string().describe(\"The name of the Opensearch domain.\").optional(),\n indexPrefix: z\n .string()\n .describe(\"A prefix to be added to all Opensearch indexes.\")\n .optional(),\n sharedIndexes: z\n .boolean()\n .describe(\n \"Whether to use shared indexes across all environments (true) or separate indexes per environment (false).\"\n )\n .default(false)\n .optional(),\n endpoint: z\n .string()\n .describe(\n \"The endpoint of an existing OpenSearch cluster. Useful when cluster is behind a custom domain.\"\n )\n .optional(),\n username: z.string().describe(\"The username for OpenSearch authentication.\").optional(),\n password: z.string().describe(\"The password for OpenSearch authentication.\").optional()\n }),\n render: props => {\n return (\n <>\n <PulumiOpenSearch {...props} />\n {props.enabled && (\n <>\n {/* Override database setup to indicate OpenSearch is enabled. */}\n <DatabaseSetup setupName=\"ddb+os\" />\n <ProjectDecorator src={p(\"InjectDdbEsLambdaFnHandler.js\")} />\n <ProjectDecorator src={p(\"ReplaceApiLambdaFnHandlers.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsServiceRoleBeforeCoreDeploy.js\")} />\n <CoreBeforeDeploy src={p(\"EnsureOsWasDeployed.js\")} />\n </>\n )}\n </>\n );\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,IAAIC,gBAAgB;AACvC,SAASC,kBAAkB,QAAQ,iBAAiB;AACpD,SACIC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACV,qCAAqC;AAC5C,SAASC,CAAC,QAAQ,KAAK;AAEvB,MAAMC,CAAC,GAAGL,kBAAkB,CAACM,MAAM,CAACC,IAAI,CAAC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,CAAC,EAC9BA,KAAK,CAACb,OAAO,iBACVnB,KAAA,CAAAiC,aAAA,CAAAjC,KAAA,CAAAkC,QAAA,qBAEIlC,KAAA,CAAAiC,aAAA,CAAC1B,aAAa;MAAC4B,SAAS,EAAC;IAAQ,CAAE,CAAC,eACpCnC,KAAA,CAAAiC,aAAA,CAAC3B,gBAAgB;MAAC8B,GAAG,EAAE3B,CAAC,CAAC,+BAA+B;IAAE,CAAE,CAAC,eAC7DT,KAAA,CAAAiC,aAAA,CAAC3B,gBAAgB;MAAC8B,GAAG,EAAE3B,CAAC,CAAC,+BAA+B;IAAE,CAAE,CAAC,eAC7DT,KAAA,CAAAiC,aAAA,CAAC5B,gBAAgB;MAAC+B,GAAG,EAAE3B,CAAC,CAAC,wCAAwC;IAAE,CAAE,CAAC,eACtET,KAAA,CAAAiC,aAAA,CAAC5B,gBAAgB;MAAC+B,GAAG,EAAE3B,CAAC,CAAC,wBAAwB;IAAE,CAAE,CACvD,CAER,CAAC;EAEX;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApiPulumi, GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
declare class RegisterRoutesPulumiImpl implements ApiPulumi.Interface {
|
|
3
|
+
private getProjectConfigService;
|
|
4
|
+
constructor(getProjectConfigService: GetProjectConfigService.Interface);
|
|
5
|
+
execute(app: any): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const RegisterRoutesPulumi: typeof RegisterRoutesPulumiImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/index.js").IApiPulumi<unknown>>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ApiPulumi, GetProjectConfigService } from "@webiny/project/abstractions/index.js";
|
|
2
|
+
import { ApiRoute } from "./ApiRoute.js";
|
|
3
|
+
import { ApiGraphql } from "../pulumi/apps/api/ApiGraphql.js";
|
|
4
|
+
function deriveRouteName(routePath, method) {
|
|
5
|
+
// /asd/{id}/xs + POST → asd-xs-post
|
|
6
|
+
const pathPart = routePath.replace(/^\//, "").replace(/\{[^}]*\}/g, "").replace(/\/+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
7
|
+
return `${pathPart}-${method.toLowerCase()}`;
|
|
8
|
+
}
|
|
9
|
+
class RegisterRoutesPulumiImpl {
|
|
10
|
+
constructor(getProjectConfigService) {
|
|
11
|
+
this.getProjectConfigService = getProjectConfigService;
|
|
12
|
+
}
|
|
13
|
+
async execute(app) {
|
|
14
|
+
// No tags filter — finds ApiRestRoute extensions regardless of their runtimeContext.
|
|
15
|
+
const projectConfig = await this.getProjectConfigService.execute();
|
|
16
|
+
const routeExtensions = projectConfig.extensionsByType(ApiRoute);
|
|
17
|
+
if (!routeExtensions.length) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const graphqlModule = app.getModule(ApiGraphql);
|
|
21
|
+
for (const ext of routeExtensions) {
|
|
22
|
+
const {
|
|
23
|
+
path: routePath,
|
|
24
|
+
method,
|
|
25
|
+
routeName
|
|
26
|
+
} = ext.params;
|
|
27
|
+
const name = routeName ?? deriveRouteName(routePath, method);
|
|
28
|
+
graphqlModule.addRoute({
|
|
29
|
+
name,
|
|
30
|
+
path: routePath,
|
|
31
|
+
method
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const RegisterRoutesPulumi = ApiPulumi.createImplementation({
|
|
37
|
+
implementation: RegisterRoutesPulumiImpl,
|
|
38
|
+
dependencies: [GetProjectConfigService]
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=RegisterRoutesPulumi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ApiPulumi","GetProjectConfigService","ApiRoute","ApiGraphql","deriveRouteName","routePath","method","pathPart","replace","toLowerCase","RegisterRoutesPulumiImpl","constructor","getProjectConfigService","execute","app","projectConfig","routeExtensions","extensionsByType","length","graphqlModule","getModule","ext","path","routeName","params","name","addRoute","RegisterRoutesPulumi","createImplementation","implementation","dependencies"],"sources":["RegisterRoutesPulumi.ts"],"sourcesContent":["import { ApiPulumi, GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { ApiGraphql } from \"~/pulumi/apps/api/ApiGraphql.js\";\n\nfunction deriveRouteName(routePath: string, method: string): string {\n // /asd/{id}/xs + POST → asd-xs-post\n const pathPart = routePath\n .replace(/^\\//, \"\")\n .replace(/\\{[^}]*\\}/g, \"\")\n .replace(/\\/+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .toLowerCase();\n\n return `${pathPart}-${method.toLowerCase()}`;\n}\n\nclass RegisterRoutesPulumiImpl implements ApiPulumi.Interface {\n constructor(private getProjectConfigService: GetProjectConfigService.Interface) {}\n\n async execute(app: any): Promise<void> {\n // No tags filter — finds ApiRestRoute extensions regardless of their runtimeContext.\n const projectConfig = await this.getProjectConfigService.execute();\n const routeExtensions = projectConfig.extensionsByType(ApiRoute);\n\n if (!routeExtensions.length) {\n return;\n }\n\n const graphqlModule = app.getModule(ApiGraphql);\n\n for (const ext of routeExtensions) {\n const { path: routePath, method, routeName } = ext.params;\n const name = routeName ?? deriveRouteName(routePath, method);\n graphqlModule.addRoute({\n name,\n path: routePath as `/${string}`,\n method\n });\n }\n }\n}\n\nexport const RegisterRoutesPulumi = ApiPulumi.createImplementation({\n implementation: RegisterRoutesPulumiImpl,\n dependencies: [GetProjectConfigService]\n});\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,uBAAuB,QAAQ,uCAAuC;AAC1F,SAASC,QAAQ;AACjB,SAASC,UAAU;AAEnB,SAASC,eAAeA,CAACC,SAAiB,EAAEC,MAAc,EAAU;EAChE;EACA,MAAMC,QAAQ,GAAGF,SAAS,CACrBG,OAAO,CAAC,KAAK,EAAE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ambdaFunction.js";
|
|
2
|
+
import { ApiRoute } from "./ApiRoute.js";
|
|
2
3
|
import { OpenSearch } from "./OpenSearch.js";
|
|
3
|
-
const definitions = [ApiLambdaFunction.def, OpenSearch.def];
|
|
4
|
+
const definitions = [ApiLambdaFunction.def, ApiRoute.def, OpenSearch.def];
|
|
4
5
|
export default definitions;
|
|
5
6
|
|
|
6
7
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApiLambdaFunction","OpenSearch","definitions","def"],"sources":["definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { type ExtensionDefinitionModel } from \"@webiny/project/defineExtension\";\n\nconst definitions = [\n ApiLambdaFunction.def,\n OpenSearch.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,UAAU;AAGnB,MAAMC,WAAW,GAAG,
|
|
1
|
+
{"version":3,"names":["ApiLambdaFunction","ApiRoute","OpenSearch","definitions","def"],"sources":["definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { type ExtensionDefinitionModel } from \"@webiny/project/defineExtension\";\n\nconst definitions = [\n ApiLambdaFunction.def,\n ApiRoute.def,\n OpenSearch.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,QAAQ;AACjB,SAASC,UAAU;AAGnB,MAAMC,WAAW,GAAG,CAChBH,iBAAiB,CAACI,GAAG,EACrBH,QAAQ,CAACG,GAAG,EACZF,UAAU,CAACE,GAAG,CAC6B;AAE/C,eAAeD,WAAW","ignoreList":[]}
|
package/extensions/index.d.ts
CHANGED
package/extensions/index.js
CHANGED
package/extensions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./OpenSearch.js\";\nexport * from \"./AwsDefaultRegion.js\";\nexport * from \"./ProjectAws/AutoInstall.js\";\nexport * from \"./ProjectAws.js\";\nexport * from \"./ApiLambdaFunction.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./OpenSearch.js\";\nexport * from \"./AwsDefaultRegion.js\";\nexport * from \"./ProjectAws/AutoInstall.js\";\nexport * from \"./ProjectAws.js\";\nexport * from \"./ApiLambdaFunction.js\";\nexport * from \"./ApiRoute.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/infra.d.ts
CHANGED
|
@@ -24,8 +24,6 @@ export declare const Infra: {
|
|
|
24
24
|
domains: import("zod").ZodObject<{
|
|
25
25
|
api: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<import("./pulumi/apps/blueGreen/types.js").NonEmptyArray<string>, string[]>>;
|
|
26
26
|
admin: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<import("./pulumi/apps/blueGreen/types.js").NonEmptyArray<string>, string[]>>;
|
|
27
|
-
website: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<import("./pulumi/apps/blueGreen/types.js").NonEmptyArray<string>, string[]>>;
|
|
28
|
-
preview: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodTransform<import("./pulumi/apps/blueGreen/types.js").NonEmptyArray<string>, string[]>>;
|
|
29
27
|
}, import("zod/v4/core").$strip>;
|
|
30
28
|
}, import("zod/v4/core").$strip>;
|
|
31
29
|
deployments: import("zod").ZodTuple<[import("zod").ZodObject<{
|
|
@@ -43,6 +41,9 @@ export declare const Infra: {
|
|
|
43
41
|
domainName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
42
|
indexPrefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
43
|
sharedIndexes: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
44
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
username: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
47
|
}, import("zod/v4/core").$strip>>;
|
|
47
48
|
PulumiResourceNamePrefix: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
48
49
|
prefix: import("zod").ZodString;
|
|
@@ -121,6 +122,14 @@ export declare const Infra: {
|
|
|
121
122
|
Pulumi: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
122
123
|
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
123
124
|
}, import("zod/v4/core").$strip>>;
|
|
125
|
+
CustomDomains: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
126
|
+
domains: import("zod").ZodArray<import("zod").ZodString>;
|
|
127
|
+
sslMethod: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
128
|
+
"sni-only": "sni-only";
|
|
129
|
+
vip: "vip";
|
|
130
|
+
}>>;
|
|
131
|
+
certificateArn: import("zod").ZodString;
|
|
132
|
+
}, import("zod/v4/core").$strip>>;
|
|
124
133
|
StackOutputValue: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
125
134
|
key: import("zod").ZodString;
|
|
126
135
|
value: import("zod").ZodAny;
|
package/infra.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdminAfterBuild, AdminAfterDeploy, AdminBeforeBuild, AdminBeforeDeploy, AdminBeforeWatch, AdminPulumi, AdminStackOutputValue, ApiAfterBuild, ApiAfterDeploy, ApiBeforeBuild, ApiBeforeDeploy, ApiBeforeWatch, ApiPulumi, ApiStackOutputValue, CoreAfterBuild, CoreAfterDeploy, CoreBeforeBuild, CoreBeforeDeploy, CoreBeforeWatch, CorePulumi, CoreStackOutputValue, ProductionEnvironments, PulumiResourceNamePrefix } from "@webiny/project/extensions/index.js";
|
|
2
|
-
import { AdminCustomDomains, AwsTags, BlueGreenDeployments, Vpc } from "./pulumi/extensions/index.js";
|
|
2
|
+
import { AdminCustomDomains, ApiCustomDomains, AwsTags, BlueGreenDeployments, Vpc } from "./pulumi/extensions/index.js";
|
|
3
3
|
import { OpenSearch } from "./extensions/OpenSearch.js";
|
|
4
4
|
import { AwsDefaultRegion } from "./extensions/AwsDefaultRegion.js";
|
|
5
5
|
import { ApiLambdaFunction } from "./extensions/ApiLambdaFunction.js";
|
|
@@ -41,6 +41,7 @@ export const Infra = {
|
|
|
41
41
|
AfterBuild: ApiAfterBuild,
|
|
42
42
|
AfterDeploy: ApiAfterDeploy,
|
|
43
43
|
Pulumi: ApiPulumi,
|
|
44
|
+
CustomDomains: ApiCustomDomains,
|
|
44
45
|
StackOutputValue: ApiStackOutputValue,
|
|
45
46
|
LambdaFunction: ApiLambdaFunction
|
|
46
47
|
},
|
package/infra.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AdminAfterBuild","AdminAfterDeploy","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","AdminPulumi","AdminStackOutputValue","ApiAfterBuild","ApiAfterDeploy","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","ApiPulumi","ApiStackOutputValue","CoreAfterBuild","CoreAfterDeploy","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","CorePulumi","CoreStackOutputValue","ProductionEnvironments","PulumiResourceNamePrefix","AdminCustomDomains","AwsTags","BlueGreenDeployments","Vpc","OpenSearch","AwsDefaultRegion","ApiLambdaFunction","EnvVar","EnvIs","EnvIsNot","CiIs","CiIsNot","Infra","Aws","DefaultRegion","Tags","Env","Is","IsNot","Ci","Admin","BeforeBuild","BeforeDeploy","BeforeWatch","AfterBuild","AfterDeploy","Pulumi","CustomDomains","StackOutputValue","Api","LambdaFunction","Core"],"sources":["infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n AdminPulumi,\n AdminStackOutputValue,\n ApiAfterBuild,\n ApiAfterDeploy,\n ApiBeforeBuild,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n ApiPulumi,\n ApiStackOutputValue,\n CoreAfterBuild,\n CoreAfterDeploy,\n CoreBeforeBuild,\n CoreBeforeDeploy,\n CoreBeforeWatch,\n CorePulumi,\n CoreStackOutputValue,\n ProductionEnvironments,\n PulumiResourceNamePrefix\n} from \"@webiny/project/extensions/index.js\";\n\nimport {\n AdminCustomDomains,\n AwsTags,\n BlueGreenDeployments,\n Vpc\n} from \"./pulumi/extensions/index.js\";\n\nimport { OpenSearch } from \"./extensions/OpenSearch.js\";\nimport { AwsDefaultRegion } from \"./extensions/AwsDefaultRegion.js\";\nimport { ApiLambdaFunction } from \"./extensions/ApiLambdaFunction.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\nimport { EnvIs, EnvIsNot, CiIs, CiIsNot } from \"@webiny/project/extensions/infra/index.js\";\n\nexport const Infra = {\n Vpc,\n BlueGreenDeployments,\n OpenSearch,\n PulumiResourceNamePrefix,\n ProductionEnvironments,\n EnvVar,\n Aws: {\n DefaultRegion: AwsDefaultRegion,\n Tags: AwsTags\n },\n Env: {\n Is: EnvIs,\n IsNot: EnvIsNot\n },\n Ci: {\n Is: CiIs,\n IsNot: CiIsNot\n },\n Admin: {\n BeforeBuild: AdminBeforeBuild,\n BeforeDeploy: AdminBeforeDeploy,\n BeforeWatch: AdminBeforeWatch,\n AfterBuild: AdminAfterBuild,\n AfterDeploy: AdminAfterDeploy,\n Pulumi: AdminPulumi,\n CustomDomains: AdminCustomDomains,\n StackOutputValue: AdminStackOutputValue\n },\n Api: {\n BeforeBuild: ApiBeforeBuild,\n BeforeDeploy: ApiBeforeDeploy,\n BeforeWatch: ApiBeforeWatch,\n AfterBuild: ApiAfterBuild,\n AfterDeploy: ApiAfterDeploy,\n Pulumi: ApiPulumi,\n StackOutputValue: ApiStackOutputValue,\n LambdaFunction: ApiLambdaFunction\n },\n Core: {\n BeforeBuild: CoreBeforeBuild,\n BeforeDeploy: CoreBeforeDeploy,\n BeforeWatch: CoreBeforeWatch,\n AfterBuild: CoreAfterBuild,\n AfterDeploy: CoreAfterDeploy,\n Pulumi: CorePulumi,\n StackOutputValue: CoreStackOutputValue\n }\n};\n"],"mappings":"AAAA,SACIA,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB,EAChBC,WAAW,EACXC,qBAAqB,EACrBC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,mBAAmB,EACnBC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,EACVC,oBAAoB,EACpBC,sBAAsB,EACtBC,wBAAwB,QACrB,qCAAqC;AAE5C,SACIC,kBAAkB,EAClBC,OAAO,EACPC,oBAAoB,EACpBC,GAAG;AAGP,SAASC,UAAU;AACnB,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,MAAM,QAAQ,qCAAqC;AAC5D,SAASC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,QAAQ,2CAA2C;AAE1F,OAAO,MAAMC,KAAK,GAAG;EACjBT,GAAG;EACHD,oBAAoB;EACpBE,UAAU;
|
|
1
|
+
{"version":3,"names":["AdminAfterBuild","AdminAfterDeploy","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","AdminPulumi","AdminStackOutputValue","ApiAfterBuild","ApiAfterDeploy","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","ApiPulumi","ApiStackOutputValue","CoreAfterBuild","CoreAfterDeploy","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","CorePulumi","CoreStackOutputValue","ProductionEnvironments","PulumiResourceNamePrefix","AdminCustomDomains","ApiCustomDomains","AwsTags","BlueGreenDeployments","Vpc","OpenSearch","AwsDefaultRegion","ApiLambdaFunction","EnvVar","EnvIs","EnvIsNot","CiIs","CiIsNot","Infra","Aws","DefaultRegion","Tags","Env","Is","IsNot","Ci","Admin","BeforeBuild","BeforeDeploy","BeforeWatch","AfterBuild","AfterDeploy","Pulumi","CustomDomains","StackOutputValue","Api","LambdaFunction","Core"],"sources":["infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminAfterDeploy,\n AdminBeforeBuild,\n AdminBeforeDeploy,\n AdminBeforeWatch,\n AdminPulumi,\n AdminStackOutputValue,\n ApiAfterBuild,\n ApiAfterDeploy,\n ApiBeforeBuild,\n ApiBeforeDeploy,\n ApiBeforeWatch,\n ApiPulumi,\n ApiStackOutputValue,\n CoreAfterBuild,\n CoreAfterDeploy,\n CoreBeforeBuild,\n CoreBeforeDeploy,\n CoreBeforeWatch,\n CorePulumi,\n CoreStackOutputValue,\n ProductionEnvironments,\n PulumiResourceNamePrefix\n} from \"@webiny/project/extensions/index.js\";\n\nimport {\n AdminCustomDomains,\n ApiCustomDomains,\n AwsTags,\n BlueGreenDeployments,\n Vpc\n} from \"./pulumi/extensions/index.js\";\n\nimport { OpenSearch } from \"./extensions/OpenSearch.js\";\nimport { AwsDefaultRegion } from \"./extensions/AwsDefaultRegion.js\";\nimport { ApiLambdaFunction } from \"./extensions/ApiLambdaFunction.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\nimport { EnvIs, EnvIsNot, CiIs, CiIsNot } from \"@webiny/project/extensions/infra/index.js\";\n\nexport const Infra = {\n Vpc,\n BlueGreenDeployments,\n OpenSearch,\n PulumiResourceNamePrefix,\n ProductionEnvironments,\n EnvVar,\n Aws: {\n DefaultRegion: AwsDefaultRegion,\n Tags: AwsTags\n },\n Env: {\n Is: EnvIs,\n IsNot: EnvIsNot\n },\n Ci: {\n Is: CiIs,\n IsNot: CiIsNot\n },\n Admin: {\n BeforeBuild: AdminBeforeBuild,\n BeforeDeploy: AdminBeforeDeploy,\n BeforeWatch: AdminBeforeWatch,\n AfterBuild: AdminAfterBuild,\n AfterDeploy: AdminAfterDeploy,\n Pulumi: AdminPulumi,\n CustomDomains: AdminCustomDomains,\n StackOutputValue: AdminStackOutputValue\n },\n Api: {\n BeforeBuild: ApiBeforeBuild,\n BeforeDeploy: ApiBeforeDeploy,\n BeforeWatch: ApiBeforeWatch,\n AfterBuild: ApiAfterBuild,\n AfterDeploy: ApiAfterDeploy,\n Pulumi: ApiPulumi,\n CustomDomains: ApiCustomDomains,\n StackOutputValue: ApiStackOutputValue,\n LambdaFunction: ApiLambdaFunction\n },\n Core: {\n BeforeBuild: CoreBeforeBuild,\n BeforeDeploy: CoreBeforeDeploy,\n BeforeWatch: CoreBeforeWatch,\n AfterBuild: CoreAfterBuild,\n AfterDeploy: CoreAfterDeploy,\n Pulumi: CorePulumi,\n StackOutputValue: CoreStackOutputValue\n }\n};\n"],"mappings":"AAAA,SACIA,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB,EAChBC,WAAW,EACXC,qBAAqB,EACrBC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,mBAAmB,EACnBC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,EACVC,oBAAoB,EACpBC,sBAAsB,EACtBC,wBAAwB,QACrB,qCAAqC;AAE5C,SACIC,kBAAkB,EAClBC,gBAAgB,EAChBC,OAAO,EACPC,oBAAoB,EACpBC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AAW,EAAElC,eAAe;IAC5BmC,MAAM,EAAE/B,UAAU;IAClBiC,gBAAgB,EAAEhC;EACtB;AACJ,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/project-aws",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"repository": {
|
|
@@ -15,29 +15,30 @@
|
|
|
15
15
|
"directory": "dist"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@pulumi/aws": "^7.
|
|
19
|
-
"@pulumi/pulumi": "^3.
|
|
20
|
-
"@pulumi/random": "4.19.
|
|
21
|
-
"@webiny/api-headless-cms": "6.
|
|
22
|
-
"@webiny/aws-layers": "6.
|
|
23
|
-
"@webiny/aws-sdk": "6.
|
|
24
|
-
"@webiny/cli-core": "6.
|
|
25
|
-
"@webiny/project": "6.
|
|
26
|
-
"@webiny/pulumi": "6.
|
|
27
|
-
"@webiny/utils": "6.
|
|
18
|
+
"@pulumi/aws": "^7.25.0",
|
|
19
|
+
"@pulumi/pulumi": "^3.230.0",
|
|
20
|
+
"@pulumi/random": "4.19.2",
|
|
21
|
+
"@webiny/api-headless-cms": "6.2.0",
|
|
22
|
+
"@webiny/aws-layers": "6.2.0",
|
|
23
|
+
"@webiny/aws-sdk": "6.2.0",
|
|
24
|
+
"@webiny/cli-core": "6.2.0",
|
|
25
|
+
"@webiny/project": "6.2.0",
|
|
26
|
+
"@webiny/pulumi": "6.2.0",
|
|
27
|
+
"@webiny/utils": "6.2.0",
|
|
28
28
|
"chalk": "5.6.2",
|
|
29
29
|
"find-up": "8.0.0",
|
|
30
30
|
"invariant": "2.2.4",
|
|
31
|
-
"lodash": "4.
|
|
31
|
+
"lodash": "4.18.1",
|
|
32
32
|
"mime": "4.1.0",
|
|
33
|
-
"react": "18.
|
|
33
|
+
"react": "18.3.1",
|
|
34
34
|
"replace-in-path": "1.1.0",
|
|
35
|
+
"ts-morph": "28.0.0",
|
|
35
36
|
"zod": "4.3.6"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/lodash": "4.17.24",
|
|
39
40
|
"@types/ncp": "2.0.8",
|
|
40
|
-
"@webiny/build-tools": "6.
|
|
41
|
+
"@webiny/build-tools": "6.2.0",
|
|
41
42
|
"typescript": "5.9.3"
|
|
42
43
|
},
|
|
43
44
|
"adio": {
|
|
@@ -55,5 +56,5 @@
|
|
|
55
56
|
]
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3d3148358b6febbc857371930871743bec3b3939"
|
|
59
60
|
}
|