@webiny/project 6.0.0-rc.0 → 6.0.0-rc.2

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.
Files changed (47) hide show
  1. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +12 -7
  2. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -1
  3. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +3 -2
  4. package/decorators/DeployAppClearWatchedLambdaFunctions.js +11 -5
  5. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -1
  6. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +3 -2
  7. package/decorators/DeployAppWithWatchedLambdaReplacement.js +16 -7
  8. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -1
  9. package/defineExtension/createExtensionReactComponent.js +2 -6
  10. package/defineExtension/createExtensionReactComponent.js.map +1 -1
  11. package/defineExtension/index.d.ts +0 -1
  12. package/defineExtension/index.js +0 -1
  13. package/defineExtension/index.js.map +1 -1
  14. package/exports/extensions.d.ts +1 -0
  15. package/exports/extensions.js +1 -0
  16. package/exports/extensions.js.map +1 -1
  17. package/extensions/AdminBuildParam.d.ts +11 -0
  18. package/extensions/AdminBuildParam.js +184 -0
  19. package/extensions/AdminBuildParam.js.map +1 -0
  20. package/extensions/AdminExtension.d.ts +11 -0
  21. package/extensions/AdminExtension.js +99 -0
  22. package/extensions/AdminExtension.js.map +1 -0
  23. package/extensions/ApiBuildParam.d.ts +11 -0
  24. package/extensions/ApiBuildParam.js +119 -0
  25. package/extensions/ApiBuildParam.js.map +1 -0
  26. package/extensions/ApiExtension.d.ts +11 -0
  27. package/{defineExtension/defineApiExtension.js → extensions/ApiExtension.js} +13 -15
  28. package/extensions/ApiExtension.js.map +1 -0
  29. package/extensions/FeatureFlags.d.ts +85 -0
  30. package/extensions/FeatureFlags.js +42 -0
  31. package/extensions/FeatureFlags.js.map +1 -0
  32. package/extensions/index.d.ts +102 -0
  33. package/extensions/index.js +12 -2
  34. package/extensions/index.js.map +1 -1
  35. package/features/Watch/Watch.js +1 -0
  36. package/features/Watch/Watch.js.map +1 -1
  37. package/features/Watch/replaceLambdaFunctions.d.ts +2 -1
  38. package/features/Watch/replaceLambdaFunctions.js +5 -1
  39. package/features/Watch/replaceLambdaFunctions.js.map +1 -1
  40. package/package.json +13 -13
  41. package/services/SetProjectIdService/SetProjectIdService.js +28 -18
  42. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  43. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +4 -4
  44. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +26 -20
  45. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -1
  46. package/defineExtension/defineApiExtension.d.ts +0 -17
  47. package/defineExtension/defineApiExtension.js.map +0 -1
@@ -0,0 +1,99 @@
1
+ import { defineExtension, zodSrcPath } from "./index.js";
2
+ import { ExtensionSrcResolver } from "@webiny/project";
3
+ import { z } from "zod";
4
+ import path from "path";
5
+ import { Node, Project } from "ts-morph";
6
+ import crypto from "crypto";
7
+ export const AdminExtension = defineExtension({
8
+ type: "Admin/Extension",
9
+ tags: {
10
+ runtimeContext: "app-build",
11
+ appName: "admin"
12
+ },
13
+ description: "Extend the Admin application with custom functionality.",
14
+ multiple: true,
15
+ paramsSchema: ({
16
+ project
17
+ }) => {
18
+ return z.object({
19
+ src: zodSrcPath({
20
+ project
21
+ }),
22
+ exportName: z.string().optional()
23
+ });
24
+ },
25
+ async build(params, ctx) {
26
+ const extensionsTsxFilePath = ctx.project.paths.workspaceFolder.join("apps", "admin", "src", "Extensions.tsx").toString();
27
+ const {
28
+ src: extensionFilePath
29
+ } = params;
30
+
31
+ // Resolve to absolute path for file operations.
32
+ const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
33
+ const extensionFileName = path.basename(absoluteExtensionFilePath);
34
+
35
+ // Export name can be customized or defaults to the file name without extension.
36
+ const exportName = params.exportName ?? path.parse(extensionFileName).name;
37
+
38
+ // Generate a constant hash-based component name to avoid using timestamps.
39
+ const hash = crypto.createHash("sha256").update(extensionFilePath).digest("hex");
40
+ const componentName = `AdminExtension_${hash.slice(-10)}`;
41
+ const project = new Project();
42
+ const importPath = path.relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
43
+ project.addSourceFileAtPath(extensionsTsxFilePath);
44
+ const source = project.getSourceFileOrThrow(extensionsTsxFilePath);
45
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
46
+ if (existingImportDeclaration) {
47
+ return;
48
+ }
49
+
50
+ // Check if the extension file has a default export or named export.
51
+ const extensionProject = new Project();
52
+ extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
53
+ const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
54
+ const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;
55
+ let index = 1;
56
+ const importDeclarations = source.getImportDeclarations();
57
+ if (importDeclarations.length) {
58
+ const last = importDeclarations[importDeclarations.length - 1];
59
+ index = last.getChildIndex() + 1;
60
+ }
61
+
62
+ // Import as default export if available, otherwise import named export.
63
+ if (hasDefaultExport) {
64
+ source.insertImportDeclaration(index, {
65
+ defaultImport: componentName,
66
+ moduleSpecifier: importPath
67
+ });
68
+ } else {
69
+ source.insertImportDeclaration(index, {
70
+ namedImports: [{
71
+ name: exportName,
72
+ alias: componentName
73
+ }],
74
+ moduleSpecifier: importPath
75
+ });
76
+ }
77
+ const extensionsIdentifier = source.getFirstDescendant(node => {
78
+ if (!Node.isIdentifier(node)) {
79
+ return false;
80
+ }
81
+ return node.getText() === "Extensions";
82
+ });
83
+ if (!extensionsIdentifier) {
84
+ throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change the name of the component?`);
85
+ }
86
+ const extensionsArrowFn = extensionsIdentifier.getNextSibling(node => Node.isArrowFunction(node));
87
+ if (!extensionsArrowFn) {
88
+ throw new Error(`Could not find the "Extensions" React component in "${extensionsTsxFilePath}". Did you maybe change its definition? It should be an arrow function.`);
89
+ }
90
+ const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {
91
+ return Node.isJsxFragment(node);
92
+ });
93
+ const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment.getFullText().replace("<>", "").replace("</>", "").trim();
94
+ extensionsArrowFnFragment.replaceWithText(`<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`);
95
+ await source.save();
96
+ }
97
+ });
98
+
99
+ //# sourceMappingURL=AdminExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["defineExtension","zodSrcPath","ExtensionSrcResolver","z","path","Node","Project","crypto","AdminExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsxFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","resolvePath","extensionFileName","basename","parse","name","hash","createHash","update","digest","componentName","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","extensionsArrowFnFragmentChildrenText","getFullText","trim","replaceWithText","save"],"sources":["AdminExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Extend the Admin application with custom functionality.\",\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 extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\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 can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\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 // Import as default export if available, otherwise import named export.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n extensionsArrowFnFragment.replaceWithText(\n `<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`\n );\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU;AACpC,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,CAAC,QAAQ,KAAK;AACvB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAA2BC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAC1D,OAAOC,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,cAAc,GAAGR,eAAe,CAAC;EAC1CS,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAQ,CAAC;EACvDC,WAAW,EAAE,yDAAyD;EACtEC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC3B,OAAOb,CAAC,CAACc,MAAM,CAAC;MACZC,GAAG,EAAEjB,UAAU,CAAC;QAAEe;MAAQ,CAAC,CAAC;MAC5BG,UAAU,EAAEh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F,IAAI,CAACJ,oBAAoB,EAAE;MACvB,MAAM,IAAIK,KAAK,CACX,uDAAuDhD,qBAAqB,oDAChF,CAAC;IACL;IAEA,MAAMiD,iBAAiB,GAAGN,oBAAoB,CAACO,cAAc,CAACL,IAAI,IAC9DjE,IAAI,CAACuE,eAAe,CAACN,IAAI,CAC7B,CAAC;IACD,IAAI,CAACI,iBAAiB,EAAE;MACpB,MAAM,IAAID,KAAK,CACX,uDAAuDhD,qBAAqB,yEAChF,CAAC;IACL;IAEA,MAAMoD,yBAAyB,GAAGH,iBAAiB,CAACL,kBAAkB,CAACC,IAAI,IAAI;MAC3E,OAAOjE,IAAI,CAACyE,aAAa,CAACR,IAAI,CAAC;IACnC,CAAC,CAAgB;IAEjB,MAAMS,qCAAqC,GAAGF,yBAAyB,CAClEG,WAAW,CAAC,CAAC,CACblC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CACjBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAClBmC,IAAI,CAAC,CAAC;IAEXJ,yBAAyB,CAACK,eAAe,CACrC,MAAMzC,aAAa,KAAKsC,qCAAqC,KACjE,CAAC;IAED,MAAM/B,MAAM,CAACmC,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const BuildParam: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ paramName: z.ZodString;
4
+ value: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">, z.ZodNumber, z.ZodBoolean]>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ value: string | number | boolean | any[] | Record<string, any>;
7
+ paramName: string;
8
+ }, {
9
+ value: string | number | boolean | any[] | Record<string, any>;
10
+ paramName: string;
11
+ }>>;
@@ -0,0 +1,119 @@
1
+ import { z } from "zod";
2
+ import { Node, Project } from "ts-morph";
3
+ import { defineExtension } from "../defineExtension/index.js";
4
+ import crypto from "crypto";
5
+ import path from "path";
6
+ import fs from "fs";
7
+ export const BuildParam = defineExtension({
8
+ type: "Api/BuildParam",
9
+ tags: {
10
+ runtimeContext: "app-build",
11
+ appName: "api"
12
+ },
13
+ description: "Add build-time parameter to API app.",
14
+ multiple: true,
15
+ paramsSchema: () => {
16
+ return z.object({
17
+ paramName: z.string(),
18
+ value: z.union([z.string(), z.record(z.any()), z.array(z.any()), z.number(), z.boolean()])
19
+ });
20
+ },
21
+ async build(params, ctx) {
22
+ const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
23
+ const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
24
+ const {
25
+ paramName,
26
+ value
27
+ } = params;
28
+
29
+ // Serialize value to a TypeScript literal.
30
+ const valueStr = JSON.stringify(value, null, 4);
31
+
32
+ // Generate a unique class name based on the paramName.
33
+ const hash = crypto.createHash("sha256").update(paramName).digest("hex");
34
+ const className = `BuildParam_${hash.slice(-10)}`;
35
+ const fileName = `${className}.ts`;
36
+ const filePath = path.join(buildParamsDir, fileName);
37
+
38
+ // Ensure buildParams directory exists.
39
+ if (!fs.existsSync(buildParamsDir)) {
40
+ fs.mkdirSync(buildParamsDir, {
41
+ recursive: true
42
+ });
43
+ }
44
+
45
+ // Check if file already exists.
46
+ if (fs.existsSync(filePath)) {
47
+ // File exists, just ensure it's imported in extensions.ts
48
+ } else {
49
+ // Create the BuildParam implementation file.
50
+ const fileContent = `import { BuildParam } from "webiny/api/buildParams";
51
+
52
+ class ${className} implements BuildParam.Interface {
53
+ key = "${paramName}";
54
+ value = ${valueStr};
55
+ }
56
+
57
+ export default BuildParam.createImplementation({
58
+ implementation: ${className},
59
+ dependencies: []
60
+ });
61
+ `;
62
+ fs.writeFileSync(filePath, fileContent, "utf8");
63
+ }
64
+
65
+ // Now update extensions.ts to import and register this BuildParam.
66
+ const project = new Project();
67
+ project.addSourceFileAtPath(extensionsTsFilePath);
68
+ const source = project.getSourceFileOrThrow(extensionsTsFilePath);
69
+
70
+ // Calculate import path relative to extensions.ts.
71
+ let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
72
+
73
+ // Ensure the path starts with ./
74
+ if (!importPath.startsWith(".")) {
75
+ importPath = "./" + importPath;
76
+ }
77
+
78
+ // Check if import already exists.
79
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
80
+ if (existingImportDeclaration) {
81
+ return;
82
+ }
83
+ let index = 1;
84
+ const importDeclarations = source.getImportDeclarations();
85
+ if (importDeclarations.length) {
86
+ const last = importDeclarations[importDeclarations.length - 1];
87
+ index = last.getChildIndex() + 1;
88
+ }
89
+
90
+ // Add import for the BuildParam implementation.
91
+ source.insertImportDeclaration(index, {
92
+ defaultImport: className,
93
+ moduleSpecifier: importPath
94
+ });
95
+
96
+ // Add the registration to the plugins array.
97
+ const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
98
+ pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
99
+ {
100
+ let index = 1;
101
+ const importDeclarations = source.getImportDeclarations();
102
+ if (importDeclarations.length) {
103
+ const last = importDeclarations[importDeclarations.length - 1];
104
+ index = last.getChildIndex() + 1;
105
+ }
106
+ const contextPluginImportPath = "@webiny/api/plugins/ContextPlugin";
107
+ const existingContextPluginImport = source.getImportDeclaration(contextPluginImportPath);
108
+ if (!existingContextPluginImport) {
109
+ source.insertImportDeclaration(index, {
110
+ namedImports: ["createContextPlugin"],
111
+ moduleSpecifier: contextPluginImportPath
112
+ });
113
+ }
114
+ }
115
+ await source.save();
116
+ }
117
+ });
118
+
119
+ //# sourceMappingURL=ApiBuildParam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["z","Node","Project","defineExtension","crypto","path","fs","BuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","ctx","extensionsTsFilePath","project","paths","workspaceFolder","join","toString","buildParamsDir","valueStr","JSON","stringify","hash","createHash","update","digest","className","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent","writeFileSync","addSourceFileAtPath","source","getSourceFileOrThrow","importPath","relative","dirname","replace","startsWith","existingImportDeclaration","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","contextPluginImportPath","existingContextPluginImport","namedImports","save"],"sources":["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.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/buildParams\";\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 `\\ncreateContextPlugin(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/api/plugins/ContextPlugin\";\n const existingContextPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingContextPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,IAAI,EAAEC,OAAO,QAAgC,UAAU;AAChE,SAASC,eAAe;AACxB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AAEnB,OAAO,MAAMC,UAAU,GAAGJ,eAAe,CAAC;EACtCK,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAM,CAAC;EACrDC,WAAW,EAAE,sCAAsC;EACnDC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAOd,CAAC,CAACe,MAAM,CAAC;MACZC,SAAS,EAAEhB,CAAC,CAACiB,MAAM,CAAC,CAAC;MACrBC,KAAK,EAAElB,CAAC,CAACmB,KAAK,CAAC,CACXnB,CAAC,CAACiB,MAAM,CAAC,CAAC,EACVjB,CAAC,CAACoB,MAAM,CAACpB,CAAC,CAACqB,GAAG,CAAC,CAAC,CAAC,EACjBrB,CAAC,CAACsB,KAAK,CAACtB,CAAC,CAACqB,GAAG,CAAC,CAAC,CAAC,EAChBrB,CAAC,CAACuB,MAAM,CAAC,CAAC,EACVvB,CAAC,CAACwB,OAAO,CAAC,CAAC,CACd;IACL,CAAC,CAAC;EACN,CAAC;EACD,MAAMC,KAAKA,CAACC,MAAM,EAAEC,GAAG,EAAE;IACrB,MAAMC,oBAAoB,GAAGD,GAAG,CAACE,OAAO,CAACC,KAAK,CAACC,eAAe,CACzDC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,CAAC,CACtDC,QAAQ,CAAC,CAAC;IAEf,MAAMC,cAAc,GAAGP,GAAG,CAACE,OAAO,CAACC,KAAK,CAACC,eAA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AAG,CAAC,CAAC;QAC9DH,KAAK,GAAGI,IAAI,CAACC,aAAa,CAAC,CAAC,GAAG,CAAC;MACpC;MAEA,MAAMS,uBAAuB,GAAG,mCAAmC;MACnE,MAAMC,2BAA2B,GAC7BxB,MAAM,CAACQ,oBAAoB,CAACe,uBAAuB,CAAC;MACxD,IAAI,CAACC,2BAA2B,EAAE;QAC9BxB,MAAM,CAACe,uBAAuB,CAACN,KAAK,EAAE;UAClCgB,YAAY,EAAE,CAAC,qBAAqB,CAAC;UACrCR,eAAe,EAAEM;QACrB,CAAC,CAAC;MACN;IACJ;IAEA,MAAMvB,MAAM,CAAC0B,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const ApiExtension: import("~/extensions/index.js").ExtensionComponent<z.ZodObject<{
3
+ src: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
4
+ exportName: z.ZodOptional<z.ZodString>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ src: string;
7
+ exportName?: string | undefined;
8
+ }, {
9
+ src: string;
10
+ exportName?: string | undefined;
11
+ }>>;
@@ -1,25 +1,23 @@
1
+ import { defineExtension, zodSrcPath } from "./index.js";
2
+ import { ExtensionSrcResolver } from "@webiny/project";
1
3
  import { z } from "zod";
2
- import { Node, Project } from "ts-morph";
3
- import { defineExtension } from "./index.js";
4
- import { zodSrcPath } from "./zodTypes/zodSrcPath.js";
5
- import { ExtensionSrcResolver } from "../utils/index.js";
6
4
  import path from "path";
5
+ import { Node, Project } from "ts-morph";
7
6
  import crypto from "crypto";
8
- export const defineApiExtension = params => defineExtension({
9
- type: params.type,
7
+ export const ApiExtension = defineExtension({
8
+ type: "Api/Extension",
10
9
  tags: {
11
10
  runtimeContext: "app-build",
12
11
  appName: "api"
13
12
  },
14
- description: params.description,
13
+ description: "Add any API extension.",
15
14
  multiple: true,
16
15
  paramsSchema: ({
17
16
  project
18
17
  }) => {
19
18
  return z.object({
20
19
  src: zodSrcPath({
21
- project,
22
- abstraction: params.abstraction
20
+ project
23
21
  }),
24
22
  exportName: z.string().optional()
25
23
  });
@@ -30,19 +28,19 @@ export const defineApiExtension = params => defineExtension({
30
28
  src: extensionFilePath
31
29
  } = params;
32
30
 
33
- // Resolve to absolute path for file operations
31
+ // Resolve to absolute path for file operations.
34
32
  const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
35
33
  const extensionFileName = path.basename(absoluteExtensionFilePath);
36
34
 
37
- // 1. Export name is always the file name without extension.
35
+ // Export name is always the file name without extension.
38
36
  const exportName = params.exportName ?? path.parse(extensionFileName).name;
39
37
 
40
- // 2. Alias name is "ApiExtension_" + hash of the file path. This way we
41
- // avoid potential naming conflicts and keep the identifier constant.
38
+ // Alias name is "ApiExtension_" + hash of the file path. This way we
39
+ // avoid potential naming conflicts and keep the identifier constant.
42
40
  const hash = crypto.createHash("sha256").update(extensionFilePath).digest("hex");
43
41
  const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;
44
42
 
45
- // 3. Calculate import path relative to `extensions.ts` file.
43
+ // Calculate import path relative to `extensions.ts` file.
46
44
  const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
47
45
  const project = new Project();
48
46
  project.addSourceFileAtPath(extensionsTsFilePath);
@@ -101,4 +99,4 @@ export const defineApiExtension = params => defineExtension({
101
99
  }
102
100
  });
103
101
 
104
- //# sourceMappingURL=defineApiExtension.js.map
102
+ //# sourceMappingURL=ApiExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["defineExtension","zodSrcPath","ExtensionSrcResolver","z","path","Node","Project","crypto","ApiExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","resolvePath","extensionFileName","basename","parse","name","hash","createHash","update","digest","exportNameAlias","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","contextPluginImportPath","existingContextPluginImport","save"],"sources":["ApiExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project\";\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 `\\ncreateContextPlugin(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 contextPluginImportPath = \"@webiny/api/plugins/ContextPlugin\";\n const existingContextPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingContextPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU;AACpC,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,CAAC,QAAQ,KAAK;AACvB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,IAAI,EAAEC,OAAO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,CAAC,MAAM;MACHK,MAAM,CAACe,uBAAuB,CAACX,KAAK,EAAE;QAClCc,YAAY,EAAE,CAAC;UAAE9B,IAAI,EAAEjB,UAAU;UAAEgD,KAAK,EAAE1B;QAAgB,CAAC,CAAC;QAC5DwB,eAAe,EAAEtB;MACrB,CAAC,CAAC;IACN;IAEA,MAAMyB,YAAY,GAAGpB,MAAM,CAACqB,kBAAkB,CAACC,IAAI,IAC/CjE,IAAI,CAACkE,wBAAwB,CAACD,IAAI,CACtC,CAA2B;IAE3BF,YAAY,CAACI,UAAU,CACnB,sEAAsE/B,eAAe,QACzF,CAAC;IAED;MACI,IAAIW,KAAK,GAAG,CAAC;MAEb,MAAMC,kBAAkB,GAAGL,MAAM,CAACM,qBAAqB,CAAC,CAAC;MACzD,IAAID,kBAAkB,CAACE,MAAM,EAAE;QAC3B,MAAMC,IAAI,GAAGH,kBAAkB,CAACA,kBAAkB,CAACE,MAAM,GAAG,CAAC,CAAC;QAC9DH,KAAK,GAAGI,IAAI,CAACC,aAAa,CAAC,CAAC,GAAG,CAAC;MACpC;MAEA,MAAMgB,uBAAuB,GAAG,mCAAmC;MACnE,MAAMC,2BAA2B,GAC7B1B,MAAM,CAACG,oBAAoB,CAACsB,uBAAuB,CAAC;MACxD,IAAI,CAACC,2BAA2B,EAAE;QAC9B1B,MAAM,CAACe,uBAAuB,CAACX,KAAK,EAAE;UAClCc,YAAY,EAAE,CAAC,qBAAqB,CAAC;UACrCD,eAAe,EAAEQ;QACrB,CAAC,CAAC;MACN;IACJ;IAEA,MAAMzB,MAAM,CAAC2B,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ import { z } from "zod";
2
+ export declare const FeatureFlags: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ features: z.ZodObject<{
4
+ multiTenancy: z.ZodOptional<z.ZodBoolean>;
5
+ advancedPublishingWorkflow: z.ZodOptional<z.ZodBoolean>;
6
+ advancedAccessControlLayer: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
7
+ teams: z.ZodOptional<z.ZodBoolean>;
8
+ privateFiles: z.ZodOptional<z.ZodBoolean>;
9
+ folderLevelPermissions: z.ZodOptional<z.ZodBoolean>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ teams?: boolean | undefined;
12
+ privateFiles?: boolean | undefined;
13
+ folderLevelPermissions?: boolean | undefined;
14
+ }, {
15
+ teams?: boolean | undefined;
16
+ privateFiles?: boolean | undefined;
17
+ folderLevelPermissions?: boolean | undefined;
18
+ }>]>>;
19
+ auditLogs: z.ZodOptional<z.ZodBoolean>;
20
+ recordLocking: z.ZodOptional<z.ZodBoolean>;
21
+ fileManager: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
22
+ threatDetection: z.ZodOptional<z.ZodBoolean>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ threatDetection?: boolean | undefined;
25
+ }, {
26
+ threatDetection?: boolean | undefined;
27
+ }>]>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ multiTenancy?: boolean | undefined;
30
+ advancedPublishingWorkflow?: boolean | undefined;
31
+ advancedAccessControlLayer?: boolean | {
32
+ teams?: boolean | undefined;
33
+ privateFiles?: boolean | undefined;
34
+ folderLevelPermissions?: boolean | undefined;
35
+ } | undefined;
36
+ auditLogs?: boolean | undefined;
37
+ recordLocking?: boolean | undefined;
38
+ fileManager?: boolean | {
39
+ threatDetection?: boolean | undefined;
40
+ } | undefined;
41
+ }, {
42
+ multiTenancy?: boolean | undefined;
43
+ advancedPublishingWorkflow?: boolean | undefined;
44
+ advancedAccessControlLayer?: boolean | {
45
+ teams?: boolean | undefined;
46
+ privateFiles?: boolean | undefined;
47
+ folderLevelPermissions?: boolean | undefined;
48
+ } | undefined;
49
+ auditLogs?: boolean | undefined;
50
+ recordLocking?: boolean | undefined;
51
+ fileManager?: boolean | {
52
+ threatDetection?: boolean | undefined;
53
+ } | undefined;
54
+ }>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ features: {
57
+ multiTenancy?: boolean | undefined;
58
+ advancedPublishingWorkflow?: boolean | undefined;
59
+ advancedAccessControlLayer?: boolean | {
60
+ teams?: boolean | undefined;
61
+ privateFiles?: boolean | undefined;
62
+ folderLevelPermissions?: boolean | undefined;
63
+ } | undefined;
64
+ auditLogs?: boolean | undefined;
65
+ recordLocking?: boolean | undefined;
66
+ fileManager?: boolean | {
67
+ threatDetection?: boolean | undefined;
68
+ } | undefined;
69
+ };
70
+ }, {
71
+ features: {
72
+ multiTenancy?: boolean | undefined;
73
+ advancedPublishingWorkflow?: boolean | undefined;
74
+ advancedAccessControlLayer?: boolean | {
75
+ teams?: boolean | undefined;
76
+ privateFiles?: boolean | undefined;
77
+ folderLevelPermissions?: boolean | undefined;
78
+ } | undefined;
79
+ auditLogs?: boolean | undefined;
80
+ recordLocking?: boolean | undefined;
81
+ fileManager?: boolean | {
82
+ threatDetection?: boolean | undefined;
83
+ } | undefined;
84
+ };
85
+ }>>;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { z } from "zod";
3
+ import { BuildParam } from "./ApiBuildParam.js";
4
+ import { AdminBuildParam } from "./AdminBuildParam.js";
5
+ import { defineExtension } from "../defineExtension/index.js";
6
+ export const FeatureFlags = defineExtension({
7
+ type: "FeatureFlags",
8
+ tags: {
9
+ runtimeContext: "project"
10
+ },
11
+ description: "Enable or disable WCP features.",
12
+ paramsSchema: z.object({
13
+ // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/index.ts`.
14
+ features: z.object({
15
+ multiTenancy: z.boolean().optional(),
16
+ advancedPublishingWorkflow: z.boolean().optional(),
17
+ advancedAccessControlLayer: z.union([z.boolean(), z.object({
18
+ teams: z.boolean().optional(),
19
+ privateFiles: z.boolean().optional(),
20
+ folderLevelPermissions: z.boolean().optional()
21
+ })]).optional(),
22
+ auditLogs: z.boolean().optional(),
23
+ recordLocking: z.boolean().optional(),
24
+ fileManager: z.union([z.boolean(), z.object({
25
+ threatDetection: z.boolean().optional()
26
+ })]).optional()
27
+ })
28
+ }),
29
+ render: ({
30
+ features = {}
31
+ }) => {
32
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BuildParam, {
33
+ paramName: "FeatureFlags",
34
+ value: features
35
+ }), /*#__PURE__*/React.createElement(AdminBuildParam, {
36
+ paramName: "FeatureFlags",
37
+ value: features
38
+ }));
39
+ }
40
+ });
41
+
42
+ //# sourceMappingURL=FeatureFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","z","BuildParam","AdminBuildParam","defineExtension","FeatureFlags","type","tags","runtimeContext","description","paramsSchema","object","features","multiTenancy","boolean","optional","advancedPublishingWorkflow","advancedAccessControlLayer","union","teams","privateFiles","folderLevelPermissions","auditLogs","recordLocking","fileManager","threatDetection","render","createElement","Fragment","paramName","value"],"sources":["FeatureFlags.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\n\nexport const FeatureFlags = defineExtension({\n type: \"FeatureFlags\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable or disable WCP features.\",\n paramsSchema: z.object({\n // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/index.ts`.\n features: z.object({\n multiTenancy: z.boolean().optional(),\n advancedPublishingWorkflow: z.boolean().optional(),\n advancedAccessControlLayer: z\n .union([\n z.boolean(),\n z.object({\n teams: z.boolean().optional(),\n privateFiles: z.boolean().optional(),\n folderLevelPermissions: z.boolean().optional()\n })\n ])\n .optional(),\n auditLogs: z.boolean().optional(),\n recordLocking: z.boolean().optional(),\n fileManager: z\n .union([\n z.boolean(),\n z.object({\n threatDetection: z.boolean().optional()\n })\n ])\n .optional()\n })\n }),\n render: ({ features = {} }) => {\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value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CAACU,MAAM,CAAC;QACLc,eAAe,EAAExB,CAAC,CAACa,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC;MAC1C,CAAC,CAAC,CACL,CAAC,CACDA,QAAQ,CAAC;IAClB,CAAC;EACL,CAAC,CAAC;EACFW,MAAM,EAAEA,CAAC;IAAEd,QAAQ,GAAG,CAAC;EAAE,CAAC,KAAK;IAC3B,oBACIZ,KAAA,CAAA2B,aAAA,CAAA3B,KAAA,CAAA4B,QAAA,qBACI5B,KAAA,CAAA2B,aAAA,CAACzB,UAAU;MAAC2B,SAAS,EAAC,cAAc;MAACC,KAAK,EAAElB;IAAS,CAAE,CAAC,eACxDZ,KAAA,CAAA2B,aAAA,CAACxB,eAAe;MAAC0B,SAAS,EAAC,cAAc;MAACC,KAAK,EAAElB;IAAS,CAAE,CAC9D,CAAC;EAEX;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -5,6 +5,11 @@ import { ProjectId } from "./ProjectId.js";
5
5
  import { Telemetry } from "./Telemetry.js";
6
6
  import { EnvVar } from "./EnvVar.js";
7
7
  import { DatabaseSetup } from "./DatabaseSetup.js";
8
+ import { FeatureFlags } from "./FeatureFlags.js";
9
+ import { BuildParam } from "./ApiBuildParam.js";
10
+ import { AdminBuildParam } from "./AdminBuildParam.js";
11
+ import { AdminExtension } from "./AdminExtension.js";
12
+ import { ApiExtension } from "./ApiExtension.js";
8
13
  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";
9
14
  import { AdminPulumi, ApiPulumi, CorePulumi, ProductionEnvironments, PulumiResourceNamePrefix, CoreStackOutputValue, ApiStackOutputValue, AdminStackOutputValue } from "./pulumi/index.js";
10
15
  export { Telemetry };
@@ -13,7 +18,12 @@ export { ProjectDecorator };
13
18
  export { ProjectImplementation };
14
19
  export { ExtensionDefinitions };
15
20
  export { EnvVar };
21
+ export { FeatureFlags };
16
22
  export { DatabaseSetup };
23
+ export { BuildParam };
24
+ export { AdminBuildParam };
25
+ export { AdminExtension };
26
+ export { ApiExtension };
17
27
  export { BeforeBuild };
18
28
  export { BeforeDeploy };
19
29
  export { BeforeWatch };
@@ -75,6 +85,89 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
75
85
  }, {
76
86
  value: string;
77
87
  varName: string;
88
+ }>> | import("../defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
89
+ features: import("zod").ZodObject<{
90
+ multiTenancy: import("zod").ZodOptional<import("zod").ZodBoolean>;
91
+ advancedPublishingWorkflow: import("zod").ZodOptional<import("zod").ZodBoolean>;
92
+ advancedAccessControlLayer: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodObject<{
93
+ teams: import("zod").ZodOptional<import("zod").ZodBoolean>;
94
+ privateFiles: import("zod").ZodOptional<import("zod").ZodBoolean>;
95
+ folderLevelPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
96
+ }, "strip", import("zod").ZodTypeAny, {
97
+ teams?: boolean | undefined;
98
+ privateFiles?: boolean | undefined;
99
+ folderLevelPermissions?: boolean | undefined;
100
+ }, {
101
+ teams?: boolean | undefined;
102
+ privateFiles?: boolean | undefined;
103
+ folderLevelPermissions?: boolean | undefined;
104
+ }>]>>;
105
+ auditLogs: import("zod").ZodOptional<import("zod").ZodBoolean>;
106
+ recordLocking: import("zod").ZodOptional<import("zod").ZodBoolean>;
107
+ fileManager: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodObject<{
108
+ threatDetection: import("zod").ZodOptional<import("zod").ZodBoolean>;
109
+ }, "strip", import("zod").ZodTypeAny, {
110
+ threatDetection?: boolean | undefined;
111
+ }, {
112
+ threatDetection?: boolean | undefined;
113
+ }>]>>;
114
+ }, "strip", import("zod").ZodTypeAny, {
115
+ multiTenancy?: boolean | undefined;
116
+ advancedPublishingWorkflow?: boolean | undefined;
117
+ advancedAccessControlLayer?: boolean | {
118
+ teams?: boolean | undefined;
119
+ privateFiles?: boolean | undefined;
120
+ folderLevelPermissions?: boolean | undefined;
121
+ } | undefined;
122
+ auditLogs?: boolean | undefined;
123
+ recordLocking?: boolean | undefined;
124
+ fileManager?: boolean | {
125
+ threatDetection?: boolean | undefined;
126
+ } | undefined;
127
+ }, {
128
+ multiTenancy?: boolean | undefined;
129
+ advancedPublishingWorkflow?: boolean | undefined;
130
+ advancedAccessControlLayer?: boolean | {
131
+ teams?: boolean | undefined;
132
+ privateFiles?: boolean | undefined;
133
+ folderLevelPermissions?: boolean | undefined;
134
+ } | undefined;
135
+ auditLogs?: boolean | undefined;
136
+ recordLocking?: boolean | undefined;
137
+ fileManager?: boolean | {
138
+ threatDetection?: boolean | undefined;
139
+ } | undefined;
140
+ }>;
141
+ }, "strip", import("zod").ZodTypeAny, {
142
+ features: {
143
+ multiTenancy?: boolean | undefined;
144
+ advancedPublishingWorkflow?: boolean | undefined;
145
+ advancedAccessControlLayer?: boolean | {
146
+ teams?: boolean | undefined;
147
+ privateFiles?: boolean | undefined;
148
+ folderLevelPermissions?: boolean | undefined;
149
+ } | undefined;
150
+ auditLogs?: boolean | undefined;
151
+ recordLocking?: boolean | undefined;
152
+ fileManager?: boolean | {
153
+ threatDetection?: boolean | undefined;
154
+ } | undefined;
155
+ };
156
+ }, {
157
+ features: {
158
+ multiTenancy?: boolean | undefined;
159
+ advancedPublishingWorkflow?: boolean | undefined;
160
+ advancedAccessControlLayer?: boolean | {
161
+ teams?: boolean | undefined;
162
+ privateFiles?: boolean | undefined;
163
+ folderLevelPermissions?: boolean | undefined;
164
+ } | undefined;
165
+ auditLogs?: boolean | undefined;
166
+ recordLocking?: boolean | undefined;
167
+ fileManager?: boolean | {
168
+ threatDetection?: boolean | undefined;
169
+ } | undefined;
170
+ };
78
171
  }>> | import("../defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
79
172
  prefix: import("zod").ZodString;
80
173
  }, "strip", import("zod").ZodTypeAny, {
@@ -102,6 +195,15 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
102
195
  setupName: "ddb" | "ddb+es" | "ddb+os";
103
196
  }, {
104
197
  setupName: "ddb" | "ddb+es" | "ddb+os";
198
+ }>> | import("../defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
199
+ paramName: import("zod").ZodString;
200
+ value: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny, "many">, import("zod").ZodNumber, import("zod").ZodBoolean]>;
201
+ }, "strip", import("zod").ZodTypeAny, {
202
+ value: string | number | boolean | any[] | Record<string, any>;
203
+ paramName: string;
204
+ }, {
205
+ value: string | number | boolean | any[] | Record<string, any>;
206
+ paramName: string;
105
207
  }>>)[];
106
208
  export { Project } from "./Project.js";
107
209
  export * from "../defineExtension/index.js";