@webiny/project 0.0.0-unstable.dbdf5d6258 → 0.0.0-unstable.e2758ee1cf

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 (65) hide show
  1. package/ProjectSdk.d.ts +1 -0
  2. package/ProjectSdk.js +4 -1
  3. package/ProjectSdk.js.map +1 -1
  4. package/abstractions/features/GetFeatureFlags.d.ts +8 -0
  5. package/abstractions/features/GetFeatureFlags.js +4 -0
  6. package/abstractions/features/GetFeatureFlags.js.map +1 -0
  7. package/abstractions/features/index.d.ts +1 -0
  8. package/abstractions/features/index.js +1 -0
  9. package/abstractions/features/index.js.map +1 -1
  10. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +12 -7
  11. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -1
  12. package/components/Wcp.d.ts +2 -0
  13. package/components/Wcp.js +8 -1
  14. package/components/Wcp.js.map +1 -1
  15. package/createProjectSdkContainer.js +4 -1
  16. package/createProjectSdkContainer.js.map +1 -1
  17. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +3 -2
  18. package/decorators/DeployAppClearWatchedLambdaFunctions.js +11 -5
  19. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -1
  20. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +3 -2
  21. package/decorators/DeployAppWithWatchedLambdaReplacement.js +16 -7
  22. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -1
  23. package/decorators/GetFeatureFlagsWithLicense.d.ts +13 -0
  24. package/decorators/GetFeatureFlagsWithLicense.js +71 -0
  25. package/decorators/GetFeatureFlagsWithLicense.js.map +1 -0
  26. package/decorators/index.d.ts +1 -0
  27. package/decorators/index.js +1 -0
  28. package/decorators/index.js.map +1 -1
  29. package/exports/infra/index.d.ts +1 -1
  30. package/exports/infra/index.js +1 -1
  31. package/exports/infra/index.js.map +1 -1
  32. package/extensions/AdminBuildParam.js +1 -1
  33. package/extensions/AdminBuildParam.js.map +1 -1
  34. package/extensions/ApiBuildParam.js +1 -1
  35. package/extensions/ApiBuildParam.js.map +1 -1
  36. package/extensions/FeatureFlags.d.ts +13 -6
  37. package/extensions/FeatureFlags.js +5 -4
  38. package/extensions/FeatureFlags.js.map +1 -1
  39. package/extensions/index.d.ts +13 -6
  40. package/features/GetFeatureFlags/GetFeatureFlags.d.ts +10 -0
  41. package/features/GetFeatureFlags/GetFeatureFlags.js +29 -0
  42. package/features/GetFeatureFlags/GetFeatureFlags.js.map +1 -0
  43. package/features/GetFeatureFlags/index.d.ts +1 -0
  44. package/features/GetFeatureFlags/index.js +3 -0
  45. package/features/GetFeatureFlags/index.js.map +1 -0
  46. package/features/Watch/Watch.js +1 -0
  47. package/features/Watch/Watch.js.map +1 -1
  48. package/features/Watch/replaceLambdaFunctions.d.ts +2 -1
  49. package/features/Watch/replaceLambdaFunctions.js +5 -1
  50. package/features/Watch/replaceLambdaFunctions.js.map +1 -1
  51. package/features/index.d.ts +1 -0
  52. package/features/index.js +1 -0
  53. package/features/index.js.map +1 -1
  54. package/package.json +12 -11
  55. package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +1 -0
  56. package/services/GetProjectConfigService/WcpProjectLicenseContext.js +2 -1
  57. package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
  58. package/services/SetProjectIdService/SetProjectIdService.js +28 -18
  59. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  60. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +4 -4
  61. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +26 -20
  62. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -1
  63. package/exports/extensions.d.ts +0 -2
  64. package/exports/extensions.js +0 -4
  65. package/exports/extensions.js.map +0 -1
@@ -0,0 +1,71 @@
1
+ import { License } from "@webiny/wcp";
2
+ import { FeatureFlags } from "@webiny/feature-flags";
3
+ import { GetFeatureFlags } from "../abstractions/index.js";
4
+
5
+ /* Returns the user's value when the license permits it, otherwise false.
6
+ * This preserves an explicit user false (opt-out), while blocking features
7
+ * the license doesn't cover. */
8
+ function applyLicenseFlag(userValue, licenseAllows) {
9
+ return licenseAllows ? userValue : false;
10
+ }
11
+ class GetFeatureFlagsWithLicenseDecorator {
12
+ constructor(decoratee) {
13
+ this.decoratee = decoratee;
14
+ }
15
+ async execute() {
16
+ const userFlags = await this.decoratee.execute();
17
+ const license = this.getLicenseFromEnv();
18
+ // toDto() returns a structuredClone, so we can safely mutate it in applyLicense.
19
+ return FeatureFlags.fromDto(this.applyLicense(userFlags.toDto(), license));
20
+ }
21
+ getLicenseFromEnv() {
22
+ const licenseEnv = process.env.WCP_PROJECT_LICENSE;
23
+ if (!licenseEnv) {
24
+ return License.fromLicenseDto(null);
25
+ }
26
+ try {
27
+ const licenseDto = JSON.parse(licenseEnv);
28
+ return License.fromLicenseDto(licenseDto);
29
+ } catch {
30
+ return License.fromLicenseDto(null);
31
+ }
32
+ }
33
+
34
+ /* For each licensable flag: final = user_value && license_allows.
35
+ * If the user disables a feature they have access to, we respect false.
36
+ * If the user enables a feature the license doesn't allow, we force false.
37
+ * fileManager (base) is always allowed; only threatDetection is restricted. */
38
+ applyLicense(featureFlagsDto, license) {
39
+ featureFlagsDto.multiTenancy = applyLicenseFlag(featureFlagsDto.multiTenancy, license.canUseFeature("multiTenancy"));
40
+ featureFlagsDto.advancedPublishingWorkflow = applyLicenseFlag(featureFlagsDto.advancedPublishingWorkflow, license.canUseWorkflows());
41
+
42
+ // advancedAccessControlLayer.
43
+ if (featureFlagsDto.advancedAccessControlLayer !== false) {
44
+ if (!license.canUseAacl()) {
45
+ // License doesn't allow AACL at all.
46
+ featureFlagsDto.advancedAccessControlLayer = false;
47
+ } else if (typeof featureFlagsDto.advancedAccessControlLayer === "object") {
48
+ // License allows AACL; constrain sub-options.
49
+ const aacl = featureFlagsDto.advancedAccessControlLayer;
50
+ aacl.teams = applyLicenseFlag(aacl.teams, license.canUseTeams());
51
+ aacl.privateFiles = applyLicenseFlag(aacl.privateFiles, license.canUsePrivateFiles());
52
+ aacl.folderLevelPermissions = applyLicenseFlag(aacl.folderLevelPermissions, license.canUseFolderLevelPermissions());
53
+ }
54
+ }
55
+ featureFlagsDto.auditLogs = applyLicenseFlag(featureFlagsDto.auditLogs, license.canUseAuditLogs());
56
+ featureFlagsDto.recordLocking = applyLicenseFlag(featureFlagsDto.recordLocking, license.canUseRecordLocking());
57
+
58
+ // fileManager is always enabled; only restrict threatDetection via license.
59
+ if (!featureFlagsDto.fileManager) {
60
+ featureFlagsDto.fileManager = {};
61
+ }
62
+ featureFlagsDto.fileManager.threatDetection = applyLicenseFlag(featureFlagsDto.fileManager.threatDetection, license.canUseFileManagerThreatDetection());
63
+ return featureFlagsDto;
64
+ }
65
+ }
66
+ export const getFeatureFlagsWithLicense = GetFeatureFlags.createDecorator({
67
+ decorator: GetFeatureFlagsWithLicenseDecorator,
68
+ dependencies: []
69
+ });
70
+
71
+ //# sourceMappingURL=GetFeatureFlagsWithLicense.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["License","FeatureFlags","GetFeatureFlags","applyLicenseFlag","userValue","licenseAllows","GetFeatureFlagsWithLicenseDecorator","constructor","decoratee","execute","userFlags","license","getLicenseFromEnv","fromDto","applyLicense","toDto","licenseEnv","process","env","WCP_PROJECT_LICENSE","fromLicenseDto","licenseDto","JSON","parse","featureFlagsDto","multiTenancy","canUseFeature","advancedPublishingWorkflow","canUseWorkflows","advancedAccessControlLayer","canUseAacl","aacl","teams","canUseTeams","privateFiles","canUsePrivateFiles","folderLevelPermissions","canUseFolderLevelPermissions","auditLogs","canUseAuditLogs","recordLocking","canUseRecordLocking","fileManager","threatDetection","canUseFileManagerThreatDetection","getFeatureFlagsWithLicense","createDecorator","decorator","dependencies"],"sources":["GetFeatureFlagsWithLicense.ts"],"sourcesContent":["import { License } from \"@webiny/wcp\";\nimport type { ILicense, DecryptedWcpProjectLicense } from \"@webiny/wcp/types.js\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport type { IFeatureFlagsDto, IAaclFeatureFlags } from \"@webiny/feature-flags\";\nimport { GetFeatureFlags } from \"~/abstractions/index.js\";\n\n/* Returns the user's value when the license permits it, otherwise false.\n * This preserves an explicit user false (opt-out), while blocking features\n * the license doesn't cover. */\nfunction applyLicenseFlag<T extends boolean | undefined>(\n userValue: T,\n licenseAllows: boolean\n): T | false {\n return licenseAllows ? userValue : false;\n}\n\nclass GetFeatureFlagsWithLicenseDecorator implements GetFeatureFlags.Interface {\n constructor(private decoratee: GetFeatureFlags.Interface) {}\n\n async execute(): Promise<FeatureFlags> {\n const userFlags = await this.decoratee.execute();\n const license = this.getLicenseFromEnv();\n // toDto() returns a structuredClone, so we can safely mutate it in applyLicense.\n return FeatureFlags.fromDto(this.applyLicense(userFlags.toDto(), license));\n }\n\n private getLicenseFromEnv(): ILicense {\n const licenseEnv = process.env.WCP_PROJECT_LICENSE;\n if (!licenseEnv) {\n return License.fromLicenseDto(null);\n }\n\n try {\n const licenseDto = JSON.parse(licenseEnv) as DecryptedWcpProjectLicense;\n return License.fromLicenseDto(licenseDto);\n } catch {\n return License.fromLicenseDto(null);\n }\n }\n\n /* For each licensable flag: final = user_value && license_allows.\n * If the user disables a feature they have access to, we respect false.\n * If the user enables a feature the license doesn't allow, we force false.\n * fileManager (base) is always allowed; only threatDetection is restricted. */\n private applyLicense(featureFlagsDto: IFeatureFlagsDto, license: ILicense): IFeatureFlagsDto {\n featureFlagsDto.multiTenancy = applyLicenseFlag(\n featureFlagsDto.multiTenancy,\n license.canUseFeature(\"multiTenancy\")\n );\n\n featureFlagsDto.advancedPublishingWorkflow = applyLicenseFlag(\n featureFlagsDto.advancedPublishingWorkflow,\n license.canUseWorkflows()\n );\n\n // advancedAccessControlLayer.\n if (featureFlagsDto.advancedAccessControlLayer !== false) {\n if (!license.canUseAacl()) {\n // License doesn't allow AACL at all.\n featureFlagsDto.advancedAccessControlLayer = false;\n } else if (typeof featureFlagsDto.advancedAccessControlLayer === \"object\") {\n // License allows AACL; constrain sub-options.\n const aacl = featureFlagsDto.advancedAccessControlLayer as IAaclFeatureFlags;\n aacl.teams = applyLicenseFlag(aacl.teams, license.canUseTeams());\n aacl.privateFiles = applyLicenseFlag(\n aacl.privateFiles,\n license.canUsePrivateFiles()\n );\n aacl.folderLevelPermissions = applyLicenseFlag(\n aacl.folderLevelPermissions,\n license.canUseFolderLevelPermissions()\n );\n }\n }\n\n featureFlagsDto.auditLogs = applyLicenseFlag(\n featureFlagsDto.auditLogs,\n license.canUseAuditLogs()\n );\n featureFlagsDto.recordLocking = applyLicenseFlag(\n featureFlagsDto.recordLocking,\n license.canUseRecordLocking()\n );\n\n // fileManager is always enabled; only restrict threatDetection via license.\n if (!featureFlagsDto.fileManager) {\n featureFlagsDto.fileManager = {};\n }\n featureFlagsDto.fileManager.threatDetection = applyLicenseFlag(\n featureFlagsDto.fileManager.threatDetection,\n license.canUseFileManagerThreatDetection()\n );\n\n return featureFlagsDto;\n }\n}\n\nexport const getFeatureFlagsWithLicense = GetFeatureFlags.createDecorator({\n decorator: GetFeatureFlagsWithLicenseDecorator,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,YAAY,QAAQ,uBAAuB;AAEpD,SAASC,eAAe;;AAExB;AACA;AACA;AACA,SAASC,gBAAgBA,CACrBC,SAAY,EACZC,aAAsB,EACb;EACT,OAAOA,aAAa,GAAGD,SAAS,GAAG,KAAK;AAC5C;AAEA,MAAME,mCAAmC,CAAsC;EAC3EC,WAAWA,CAASC,SAAoC,EAAE;IAAA,KAAtCA,SAAoC,GAApCA,SAAoC;EAAG;EAE3D,MAAMC,OAAOA,CAAA,EAA0B;IACnC,MAAMC,SAAS,GAAG,MAAM,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC,CAAC;IAChD,MAAME,OAAO,GAAG,IAAI,CAACC,iBAAiB,CAAC,CAAC;I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EF,IAAI,CAACG,YAAY,GAAG/B,gBAAgB,CAChC4B,IAAI,CAACG,YAAY,EACjBvB,OAAO,CAACwB,kBAAkB,CAAC,CAC/B,CAAC;QACDJ,IAAI,CAACK,sBAAsB,GAAGjC,gBAAgB,CAC1C4B,IAAI,CAACK,sBAAsB,EAC3BzB,OAAO,CAAC0B,4BAA4B,CAAC,CACzC,CAAC;MACL;IACJ;IAEAb,eAAe,CAACc,SAAS,GAAGnC,gBAAgB,CACxCqB,eAAe,CAACc,SAAS,EACzB3B,OAAO,CAAC4B,eAAe,CAAC,CAC5B,CAAC;IACDf,eAAe,CAACgB,aAAa,GAAGrC,gBAAgB,CAC5CqB,eAAe,CAACgB,aAAa,EAC7B7B,OAAO,CAAC8B,mBAAmB,CAAC,CAChC,CAAC;;IAED;IACA,IAAI,CAACjB,eAAe,CAACkB,WAAW,EAAE;MAC9BlB,eAAe,CAACkB,WAAW,GAAG,CAAC,CAAC;IACpC;IACAlB,eAAe,CAACkB,WAAW,CAACC,eAAe,GAAGxC,gBAAgB,CAC1DqB,eAAe,CAACkB,WAAW,CAACC,eAAe,EAC3ChC,OAAO,CAACiC,gCAAgC,CAAC,CAC7C,CAAC;IAED,OAAOpB,eAAe;EAC1B;AACJ;AAEA,OAAO,MAAMqB,0BAA0B,GAAG3C,eAAe,CAAC4C,eAAe,CAAC;EACtEC,SAAS,EAAEzC,mCAAmC;EAC9C0C,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -5,3 +5,4 @@ export * from "./DeployAppWithHooks.js";
5
5
  export * from "./DeployAppWithWatchedLambdaReplacement.js";
6
6
  export * from "./WatchWithHooks.js";
7
7
  export * from "./GetPulumiServiceWithDownloadInfo.js";
8
+ export * from "./GetFeatureFlagsWithLicense.js";
@@ -5,5 +5,6 @@ export * from "./DeployAppWithHooks.js";
5
5
  export * from "./DeployAppWithWatchedLambdaReplacement.js";
6
6
  export * from "./WatchWithHooks.js";
7
7
  export * from "./GetPulumiServiceWithDownloadInfo.js";
8
+ export * from "./GetFeatureFlagsWithLicense.js";
8
9
 
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./BuildAppWithHooks.js\";\nexport * from \"./DeployAppClearWatchedLambdaFunctions.js\";\nexport * from \"./DeployAppRefreshStackOutputCache.js\";\nexport * from \"./DeployAppWithHooks.js\";\nexport * from \"./DeployAppWithWatchedLambdaReplacement.js\";\nexport * from \"./WatchWithHooks.js\";\nexport * from \"./GetPulumiServiceWithDownloadInfo.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./BuildAppWithHooks.js\";\nexport * from \"./DeployAppClearWatchedLambdaFunctions.js\";\nexport * from \"./DeployAppRefreshStackOutputCache.js\";\nexport * from \"./DeployAppWithHooks.js\";\nexport * from \"./DeployAppWithWatchedLambdaReplacement.js\";\nexport * from \"./WatchWithHooks.js\";\nexport * from \"./GetPulumiServiceWithDownloadInfo.js\";\nexport * from \"./GetFeatureFlagsWithLicense.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -5,4 +5,4 @@ export { BeforeBuild as BeforeBuildHook } from "../../abstractions/features/hook
5
5
  export { AfterDeploy as AfterDeployHook } from "../../abstractions/features/hooks/AfterDeploy.js";
6
6
  export { BeforeDeploy as BeforeDeployHook } from "../../abstractions/features/hooks/BeforeDeploy.js";
7
7
  export { BeforeWatch as BeforeWatchHook } from "../../abstractions/features/hooks/BeforeWatch.js";
8
- export { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
8
+ export { EnvVar } from "../../extensions/EnvVar.js";
@@ -5,6 +5,6 @@ export { BeforeBuild as BeforeBuildHook } from "../../abstractions/features/hook
5
5
  export { AfterDeploy as AfterDeployHook } from "../../abstractions/features/hooks/AfterDeploy.js";
6
6
  export { BeforeDeploy as BeforeDeployHook } from "../../abstractions/features/hooks/BeforeDeploy.js";
7
7
  export { BeforeWatch as BeforeWatchHook } from "../../abstractions/features/hooks/BeforeWatch.js";
8
- export { GetAppStackOutput } from "../../abstractions/features/GetAppStackOutput.js";
8
+ export { EnvVar } from "../../extensions/EnvVar.js";
9
9
 
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LoggerService","Logger","UiService","Ui","AfterBuild","AfterBuildHook","BeforeBuild","BeforeBuildHook","AfterDeploy","AfterDeployHook","BeforeDeploy","BeforeDeployHook","BeforeWatch","BeforeWatchHook","GetAppStackOutput"],"sources":["index.ts"],"sourcesContent":["export { LoggerService as Logger } from \"~/abstractions/services/LoggerService.js\";\nexport { UiService as Ui } from \"~/abstractions/services/UiService.js\";\nexport { AfterBuild as AfterBuildHook } from \"~/abstractions/features/hooks/AfterBuild.js\";\nexport { BeforeBuild as BeforeBuildHook } from \"~/abstractions/features/hooks/BeforeBuild.js\";\nexport { AfterDeploy as AfterDeployHook } from \"~/abstractions/features/hooks/AfterDeploy.js\";\nexport { BeforeDeploy as BeforeDeployHook } from \"~/abstractions/features/hooks/BeforeDeploy.js\";\nexport { BeforeWatch as BeforeWatchHook } from \"~/abstractions/features/hooks/BeforeWatch.js\";\nexport { GetAppStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\n"],"mappings":"AAAA,SAASA,aAAa,IAAIC,MAAM;AAChC,SAASC,SAAS,IAAIC,EAAE;AACxB,SAASC,UAAU,IAAIC,cAAc;AACrC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,YAAY,IAAIC,gBAAgB;AACzC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["LoggerService","Logger","UiService","Ui","AfterBuild","AfterBuildHook","BeforeBuild","BeforeBuildHook","AfterDeploy","AfterDeployHook","BeforeDeploy","BeforeDeployHook","BeforeWatch","BeforeWatchHook","EnvVar"],"sources":["index.ts"],"sourcesContent":["export { LoggerService as Logger } from \"~/abstractions/services/LoggerService.js\";\nexport { UiService as Ui } from \"~/abstractions/services/UiService.js\";\nexport { AfterBuild as AfterBuildHook } from \"~/abstractions/features/hooks/AfterBuild.js\";\nexport { BeforeBuild as BeforeBuildHook } from \"~/abstractions/features/hooks/BeforeBuild.js\";\nexport { AfterDeploy as AfterDeployHook } from \"~/abstractions/features/hooks/AfterDeploy.js\";\nexport { BeforeDeploy as BeforeDeployHook } from \"~/abstractions/features/hooks/BeforeDeploy.js\";\nexport { BeforeWatch as BeforeWatchHook } from \"~/abstractions/features/hooks/BeforeWatch.js\";\nexport { EnvVar } from \"~/extensions/EnvVar.js\";\n"],"mappings":"AAAA,SAASA,aAAa,IAAIC,MAAM;AAChC,SAASC,SAAS,IAAIC,EAAE;AACxB,SAASC,UAAU,IAAIC,cAAc;AACrC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,YAAY,IAAIC,gBAAgB;AACzC,SAASC,WAAW,IAAIC,eAAe;AACvC,SAASC,MAAM","ignoreList":[]}
@@ -161,7 +161,7 @@ export const AdminBuildParam = defineExtension({
161
161
  // Check if file already exists.
162
162
  if (!fs.existsSync(filePath)) {
163
163
  // Create the BuildParam implementation file.
164
- const fileContent = `import { BuildParam } from "webiny/admin/buildParams";
164
+ const fileContent = `import { BuildParam } from "webiny/admin/build-params";
165
165
 
166
166
  class ${className} implements BuildParam.Interface {
167
167
  key = "${paramName}";
@@ -1 +1 @@
1
- {"version":3,"names":["z","defineExtension","crypto","path","fs","Node","Project","generateBuildParamsFeature","buildParamsDir","ctx","featureFilePath","join","files","readdirSync","filter","f","startsWith","endsWith","imports","map","file","className","parse","name","registrations","featureContent","writeFileSync","updateExtensionsTsx","extensionsTsxFilePath","project","paths","workspaceFolder","toString","addSourceFileAtPath","source","getSourceFileOrThrow","buildParamsFeatureImport","existingFeatureImport","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","namedImports","moduleSpecifier","buildParamsFeatureImportPath","existingBuildParamsImport","getNamedImports","hasBuildParamsFeature","some","ni","getName","addNamedImport","registerFeatureImportPath","existingRegisterFeatureImport","hasRegisterFeature","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","currentContent","getFullText","replace","trim","includes","newContent","replaceWithText","save","AdminBuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","valueStr","JSON","stringify","hash","createHash","update","digest","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent"],"sources":["AdminBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { Node, Project } from \"ts-morph\";\n\nasync function generateBuildParamsFeature(buildParamsDir: string, ctx: any) {\n const featureFilePath = path.join(buildParamsDir, \"feature.ts\");\n\n // Get all BuildParam_*.ts files.\n const files = fs\n .readdirSync(buildParamsDir)\n .filter(f => f.startsWith(\"BuildParam_\") && f.endsWith(\".ts\") && f !== \"feature.ts\");\n\n // Generate imports and registrations.\n const imports = files\n .map(file => {\n const className = path.parse(file).name;\n return `import ${className} from \"./${className}.js\";`;\n })\n .join(\"\\n\");\n\n const registrations = files\n .map(file => {\n const className = path.parse(file).name;\n return ` container.register(${className});`;\n })\n .join(\"\\n\");\n\n const featureContent = `import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\n${imports}\n\nexport const BuildParamsInternalFeature = createFeature({\n name: \"BuildParamsInternal\",\n register(container: Container) {\n${registrations}\n }\n});\n`;\n\n fs.writeFileSync(featureFilePath, featureContent, \"utf8\");\n\n // Now we need to update Extensions.tsx to use RegisterFeature with this feature.\n await updateExtensionsTsx(ctx);\n}\n\nasync function updateExtensionsTsx(ctx: any) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n // Check if we already have the imports.\n const buildParamsFeatureImport = \"./buildParams/feature.js\";\n const existingFeatureImport = source.getImportDeclaration(buildParamsFeatureImport);\n\n if (!existingFeatureImport) {\n let index = 1;\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 BuildParamsInternalFeature.\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsInternalFeature\"],\n moduleSpecifier: buildParamsFeatureImport\n });\n\n // Add import for BuildParamsFeature.\n const buildParamsFeatureImportPath = \"@webiny/app-admin\";\n const existingBuildParamsImport = source.getImportDeclaration(buildParamsFeatureImportPath);\n\n if (!existingBuildParamsImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsFeature\"],\n moduleSpecifier: buildParamsFeatureImportPath\n });\n } else {\n // Add to existing import if BuildParamsFeature not already there.\n const namedImports = existingBuildParamsImport.getNamedImports();\n const hasBuildParamsFeature = namedImports.some(\n ni => ni.getName() === \"BuildParamsFeature\"\n );\n if (!hasBuildParamsFeature) {\n existingBuildParamsImport.addNamedImport(\"BuildParamsFeature\");\n }\n }\n\n // Add import for RegisterFeature if not present.\n const registerFeatureImportPath = \"@webiny/app-admin\";\n const existingRegisterFeatureImport =\n source.getImportDeclaration(registerFeatureImportPath);\n\n if (existingRegisterFeatureImport) {\n const namedImports = existingRegisterFeatureImport.getNamedImports();\n const hasRegisterFeature = namedImports.some(ni => ni.getName() === \"RegisterFeature\");\n if (!hasRegisterFeature) {\n existingRegisterFeatureImport.addNamedImport(\"RegisterFeature\");\n }\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [\"RegisterFeature\"],\n moduleSpecifier: registerFeatureImportPath\n });\n }\n }\n\n // Now add <RegisterFeature> components to the Extensions component.\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\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}\".`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n\n if (!extensionsArrowFn) {\n throw new Error(`Could not find the \"Extensions\" React component arrow function.`);\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n });\n\n if (!extensionsArrowFnFragment) {\n throw new Error(`Could not find JSX fragment in Extensions component.`);\n }\n\n const currentContent = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n // Check if we already have the RegisterFeature components.\n if (!currentContent.includes(\"BuildParamsFeature\")) {\n const newContent = `<><RegisterFeature feature={BuildParamsFeature} /><RegisterFeature feature={BuildParamsInternalFeature} />${currentContent}</>`;\n extensionsArrowFnFragment.replaceWithText(newContent);\n }\n\n await source.save();\n}\n\nexport const AdminBuildParam = defineExtension({\n type: \"Admin/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Add build-time parameter to Admin 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 buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"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 // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/admin/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 we need to generate/update the feature file that imports all BuildParams.\n await generateBuildParamsFeature(buildParamsDir, ctx);\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe;AACxB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAExC,eAAeC,0BAA0BA,CAACC,cAAsB,EAAEC,GAAQ,EAAE;EACxE,MAAMC,eAAe,GAAGP,IAAI,CAACQ,IAAI,CAACH,cAAc,EAAE,YAAY,CAAC;;EAE/D;EACA,MAAMI,KAAK,GAAGR,EAAE,CACXS,WAAW,CAACL,cAAc,CAAC,CAC3BM,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,UAAU,CAAC,aAAa,CAAC,IAAID,CAAC,CAACE,QAAQ,CAAC,KAAK,CAAC,IAAIF,CAAC,KAAK,YAAY,CAAC;;EAExF;EACA,MAAMG,OAAO,GAAGN,KAAK,CAChBO,GAAG,CAACC,IAAI,IAAI;IACT,MAAMC,SAAS,GAAGlB,IAAI,CAACmB,KAAK,CAACF,IAAI,CAAC,CAACG,IAAI;IACvC,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,CAAC,CAACiB,MAAM,CAAC,KAAK,CAAC;IACxE,MAAMnF,SAAS,GAAG,cAAcgF,IAAI,CAACI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE;IACjD,MAAMC,QAAQ,GAAG,GAAGrF,SAAS,KAAK;IAClC,MAAMsF,QAAQ,GAAGxG,IAAI,CAACQ,IAAI,CAACH,cAAc,EAAEkG,QAAQ,CAAC;;IAEpD;IACA,IAAI,CAACtG,EAAE,CAACwG,UAAU,CAACpG,cAAc,CAAC,EAAE;MAChCJ,EAAE,CAACyG,SAAS,CAACrG,cAAc,EAAE;QAAEsG,SAAS,EAAE;MAAK,CAAC,CAAC;IACrD;;IAEA;IACA,IAAI,CAAC1G,EAAE,CAACwG,UAAU,CAACD,QAAQ,CAAC,EAAE;MAC1B;MACA,MAAMI,WAAW,GAAG;AAChC;AACA,QAAQ1F,SAAS;AACjB,aAAakE,SAAS;AACtB,cAAcW,QAAQ;AACtB;AACA;AACA;AACA,sBAAsB7E,SAAS;AAC/B;AACA;AACA,CAAC;MACWjB,EAAE,CAACsB,aAAa,CAACiF,QAAQ,EAAEI,WAAW,EAAE,MAAM,CAAC;IACnD;;IAEA;IACA,MAAMxG,0BAA0B,CAACC,cAAc,EAAEC,GAAG,CAAC;EACzD;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["z","defineExtension","crypto","path","fs","Node","Project","generateBuildParamsFeature","buildParamsDir","ctx","featureFilePath","join","files","readdirSync","filter","f","startsWith","endsWith","imports","map","file","className","parse","name","registrations","featureContent","writeFileSync","updateExtensionsTsx","extensionsTsxFilePath","project","paths","workspaceFolder","toString","addSourceFileAtPath","source","getSourceFileOrThrow","buildParamsFeatureImport","existingFeatureImport","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","namedImports","moduleSpecifier","buildParamsFeatureImportPath","existingBuildParamsImport","getNamedImports","hasBuildParamsFeature","some","ni","getName","addNamedImport","registerFeatureImportPath","existingRegisterFeatureImport","hasRegisterFeature","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","currentContent","getFullText","replace","trim","includes","newContent","replaceWithText","save","AdminBuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","valueStr","JSON","stringify","hash","createHash","update","digest","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent"],"sources":["AdminBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { Node, Project } from \"ts-morph\";\n\nasync function generateBuildParamsFeature(buildParamsDir: string, ctx: any) {\n const featureFilePath = path.join(buildParamsDir, \"feature.ts\");\n\n // Get all BuildParam_*.ts files.\n const files = fs\n .readdirSync(buildParamsDir)\n .filter(f => f.startsWith(\"BuildParam_\") && f.endsWith(\".ts\") && f !== \"feature.ts\");\n\n // Generate imports and registrations.\n const imports = files\n .map(file => {\n const className = path.parse(file).name;\n return `import ${className} from \"./${className}.js\";`;\n })\n .join(\"\\n\");\n\n const registrations = files\n .map(file => {\n const className = path.parse(file).name;\n return ` container.register(${className});`;\n })\n .join(\"\\n\");\n\n const featureContent = `import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\n${imports}\n\nexport const BuildParamsInternalFeature = createFeature({\n name: \"BuildParamsInternal\",\n register(container: Container) {\n${registrations}\n }\n});\n`;\n\n fs.writeFileSync(featureFilePath, featureContent, \"utf8\");\n\n // Now we need to update Extensions.tsx to use RegisterFeature with this feature.\n await updateExtensionsTsx(ctx);\n}\n\nasync function updateExtensionsTsx(ctx: any) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n // Check if we already have the imports.\n const buildParamsFeatureImport = \"./buildParams/feature.js\";\n const existingFeatureImport = source.getImportDeclaration(buildParamsFeatureImport);\n\n if (!existingFeatureImport) {\n let index = 1;\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 BuildParamsInternalFeature.\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsInternalFeature\"],\n moduleSpecifier: buildParamsFeatureImport\n });\n\n // Add import for BuildParamsFeature.\n const buildParamsFeatureImportPath = \"@webiny/app-admin\";\n const existingBuildParamsImport = source.getImportDeclaration(buildParamsFeatureImportPath);\n\n if (!existingBuildParamsImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"BuildParamsFeature\"],\n moduleSpecifier: buildParamsFeatureImportPath\n });\n } else {\n // Add to existing import if BuildParamsFeature not already there.\n const namedImports = existingBuildParamsImport.getNamedImports();\n const hasBuildParamsFeature = namedImports.some(\n ni => ni.getName() === \"BuildParamsFeature\"\n );\n if (!hasBuildParamsFeature) {\n existingBuildParamsImport.addNamedImport(\"BuildParamsFeature\");\n }\n }\n\n // Add import for RegisterFeature if not present.\n const registerFeatureImportPath = \"@webiny/app-admin\";\n const existingRegisterFeatureImport =\n source.getImportDeclaration(registerFeatureImportPath);\n\n if (existingRegisterFeatureImport) {\n const namedImports = existingRegisterFeatureImport.getNamedImports();\n const hasRegisterFeature = namedImports.some(ni => ni.getName() === \"RegisterFeature\");\n if (!hasRegisterFeature) {\n existingRegisterFeatureImport.addNamedImport(\"RegisterFeature\");\n }\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [\"RegisterFeature\"],\n moduleSpecifier: registerFeatureImportPath\n });\n }\n }\n\n // Now add <RegisterFeature> components to the Extensions component.\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\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}\".`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n\n if (!extensionsArrowFn) {\n throw new Error(`Could not find the \"Extensions\" React component arrow function.`);\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n });\n\n if (!extensionsArrowFnFragment) {\n throw new Error(`Could not find JSX fragment in Extensions component.`);\n }\n\n const currentContent = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n // Check if we already have the RegisterFeature components.\n if (!currentContent.includes(\"BuildParamsFeature\")) {\n const newContent = `<><RegisterFeature feature={BuildParamsFeature} /><RegisterFeature feature={BuildParamsInternalFeature} />${currentContent}</>`;\n extensionsArrowFnFragment.replaceWithText(newContent);\n }\n\n await source.save();\n}\n\nexport const AdminBuildParam = defineExtension({\n type: \"Admin/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Add build-time parameter to Admin 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 buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"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 // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/admin/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now we need to generate/update the feature file that imports all BuildParams.\n await generateBuildParamsFeature(buildParamsDir, ctx);\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe;AACxB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAExC,eAAeC,0BAA0BA,CAACC,cAAsB,EAAEC,GAAQ,EAAE;EACxE,MAAMC,eAAe,GAAGP,IAAI,CAACQ,IAAI,CAACH,cAAc,EAAE,YAAY,CAAC;;EAE/D;EACA,MAAMI,KAAK,GAAGR,EAAE,CACXS,WAAW,CAACL,cAAc,CAAC,CAC3BM,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,UAAU,CAAC,aAAa,CAAC,IAAID,CAAC,CAACE,QAAQ,CAAC,KAAK,CAAC,IAAIF,CAAC,KAAK,YAAY,CAAC;;EAExF;EACA,MAAMG,OAAO,GAAGN,KAAK,CAChBO,GAAG,CAACC,IAAI,IAAI;IACT,MAAMC,SAAS,GAAGlB,IAAI,CAACmB,KAAK,CAACF,IAAI,CAAC,CAACG,IAAI;IACvC,OAAO,UAAUF,SAAS,YAAYA,SAAS,OAAO;EAC1D,CAAC,CAAC,CACDV,IAAI,CAAC,IAAI,CAAC;EAEf,MAAMa,aAAa,GAAGZ,KAAK,CACtBO,GAAG,CAACC,IAAI,IAAI;IACT,MAAMC,SAAS,GAAGlB,IAAI,C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Q,GAAGxG,IAAI,CAACQ,IAAI,CAACH,cAAc,EAAEkG,QAAQ,CAAC;;IAEpD;IACA,IAAI,CAACtG,EAAE,CAACwG,UAAU,CAACpG,cAAc,CAAC,EAAE;MAChCJ,EAAE,CAACyG,SAAS,CAACrG,cAAc,EAAE;QAAEsG,SAAS,EAAE;MAAK,CAAC,CAAC;IACrD;;IAEA;IACA,IAAI,CAAC1G,EAAE,CAACwG,UAAU,CAACD,QAAQ,CAAC,EAAE;MAC1B;MACA,MAAMI,WAAW,GAAG;AAChC;AACA,QAAQ1F,SAAS;AACjB,aAAakE,SAAS;AACtB,cAAcW,QAAQ;AACtB;AACA;AACA;AACA,sBAAsB7E,SAAS;AAC/B;AACA;AACA,CAAC;MACWjB,EAAE,CAACsB,aAAa,CAACiF,QAAQ,EAAEI,WAAW,EAAE,MAAM,CAAC;IACnD;;IAEA;IACA,MAAMxG,0BAA0B,CAACC,cAAc,EAAEC,GAAG,CAAC;EACzD;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -47,7 +47,7 @@ export const BuildParam = defineExtension({
47
47
  // File exists, just ensure it's imported in extensions.ts
48
48
  } else {
49
49
  // Create the BuildParam implementation file.
50
- const fileContent = `import { BuildParam } from "webiny/api/buildParams";
50
+ const fileContent = `import { BuildParam } from "webiny/api/build-params";
51
51
 
52
52
  class ${className} implements BuildParam.Interface {
53
53
  key = "${paramName}";
@@ -1 +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,OAAO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uB,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":[]}
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/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now update extensions.ts to import and register this BuildParam.\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Calculate import path relative to extensions.ts.\n let importPath = path\n .relative(path.dirname(extensionsTsFilePath), filePath)\n .replace(/\\.tsx?$/, \".js\");\n\n // Ensure the path starts with ./\n if (!importPath.startsWith(\".\")) {\n importPath = \"./\" + importPath;\n }\n\n // Check if import already exists.\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for the BuildParam implementation.\n source.insertImportDeclaration(index, {\n defaultImport: className,\n moduleSpecifier: importPath\n });\n\n // Add the registration to the plugins array.\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\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;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wBAAwB,CAACD,IAAI,CACtC,CAA2B;IAE3BF,YAAY,CAACI,UAAU,CACnB,sEAAsEhC,SAAS,QACnF,CAAC;IAED;MACI,IAAImB,KAAK,GAAG,CAAC;MAEb,MAAMC,kBAAkB,GAAGV,MAAM,CAACW,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,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":[]}
@@ -7,24 +7,27 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
7
7
  teams: z.ZodOptional<z.ZodBoolean>;
8
8
  privateFiles: z.ZodOptional<z.ZodBoolean>;
9
9
  folderLevelPermissions: z.ZodOptional<z.ZodBoolean>;
10
+ hcmsFieldPermissions: z.ZodOptional<z.ZodBoolean>;
10
11
  }, "strip", z.ZodTypeAny, {
11
12
  teams?: boolean | undefined;
12
13
  privateFiles?: boolean | undefined;
13
14
  folderLevelPermissions?: boolean | undefined;
15
+ hcmsFieldPermissions?: boolean | undefined;
14
16
  }, {
15
17
  teams?: boolean | undefined;
16
18
  privateFiles?: boolean | undefined;
17
19
  folderLevelPermissions?: boolean | undefined;
20
+ hcmsFieldPermissions?: boolean | undefined;
18
21
  }>]>>;
19
22
  auditLogs: z.ZodOptional<z.ZodBoolean>;
20
23
  recordLocking: z.ZodOptional<z.ZodBoolean>;
21
- fileManager: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
24
+ fileManager: z.ZodOptional<z.ZodObject<{
22
25
  threatDetection: z.ZodOptional<z.ZodBoolean>;
23
26
  }, "strip", z.ZodTypeAny, {
24
27
  threatDetection?: boolean | undefined;
25
28
  }, {
26
29
  threatDetection?: boolean | undefined;
27
- }>]>>;
30
+ }>>;
28
31
  }, "strip", z.ZodTypeAny, {
29
32
  multiTenancy?: boolean | undefined;
30
33
  advancedPublishingWorkflow?: boolean | undefined;
@@ -32,10 +35,11 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
32
35
  teams?: boolean | undefined;
33
36
  privateFiles?: boolean | undefined;
34
37
  folderLevelPermissions?: boolean | undefined;
38
+ hcmsFieldPermissions?: boolean | undefined;
35
39
  } | undefined;
36
40
  auditLogs?: boolean | undefined;
37
41
  recordLocking?: boolean | undefined;
38
- fileManager?: boolean | {
42
+ fileManager?: {
39
43
  threatDetection?: boolean | undefined;
40
44
  } | undefined;
41
45
  }, {
@@ -45,10 +49,11 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
45
49
  teams?: boolean | undefined;
46
50
  privateFiles?: boolean | undefined;
47
51
  folderLevelPermissions?: boolean | undefined;
52
+ hcmsFieldPermissions?: boolean | undefined;
48
53
  } | undefined;
49
54
  auditLogs?: boolean | undefined;
50
55
  recordLocking?: boolean | undefined;
51
- fileManager?: boolean | {
56
+ fileManager?: {
52
57
  threatDetection?: boolean | undefined;
53
58
  } | undefined;
54
59
  }>;
@@ -60,10 +65,11 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
60
65
  teams?: boolean | undefined;
61
66
  privateFiles?: boolean | undefined;
62
67
  folderLevelPermissions?: boolean | undefined;
68
+ hcmsFieldPermissions?: boolean | undefined;
63
69
  } | undefined;
64
70
  auditLogs?: boolean | undefined;
65
71
  recordLocking?: boolean | undefined;
66
- fileManager?: boolean | {
72
+ fileManager?: {
67
73
  threatDetection?: boolean | undefined;
68
74
  } | undefined;
69
75
  };
@@ -75,10 +81,11 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
75
81
  teams?: boolean | undefined;
76
82
  privateFiles?: boolean | undefined;
77
83
  folderLevelPermissions?: boolean | undefined;
84
+ hcmsFieldPermissions?: boolean | undefined;
78
85
  } | undefined;
79
86
  auditLogs?: boolean | undefined;
80
87
  recordLocking?: boolean | undefined;
81
- fileManager?: boolean | {
88
+ fileManager?: {
82
89
  threatDetection?: boolean | undefined;
83
90
  } | undefined;
84
91
  };
@@ -10,20 +10,21 @@ export const FeatureFlags = defineExtension({
10
10
  },
11
11
  description: "Enable or disable WCP features.",
12
12
  paramsSchema: z.object({
13
- // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/index.ts`.
13
+ // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/types.ts`.
14
14
  features: z.object({
15
15
  multiTenancy: z.boolean().optional(),
16
16
  advancedPublishingWorkflow: z.boolean().optional(),
17
17
  advancedAccessControlLayer: z.union([z.boolean(), z.object({
18
18
  teams: z.boolean().optional(),
19
19
  privateFiles: z.boolean().optional(),
20
- folderLevelPermissions: z.boolean().optional()
20
+ folderLevelPermissions: z.boolean().optional(),
21
+ hcmsFieldPermissions: z.boolean().optional()
21
22
  })]).optional(),
22
23
  auditLogs: z.boolean().optional(),
23
24
  recordLocking: z.boolean().optional(),
24
- fileManager: z.union([z.boolean(), z.object({
25
+ fileManager: z.object({
25
26
  threatDetection: z.boolean().optional()
26
- })]).optional()
27
+ }).optional()
27
28
  })
28
29
  }),
29
30
  render: ({
@@ -1 +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={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,UAAU;AACnB,SAASC,eAAe;AACxB,SAASC,eAAe;AAExB,OAAO,MAAMC,YAAY,GAAGD,eAAe,CAAC;EACxCE,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EAAE,iCAAiC;EAC9CC,YAAY,EAAET,CAAC,CAACU,MAAM,CAAC;IACnB;IACAC,QAAQ,EAAEX,CAAC,CAACU,MAAM,CAAC;MACfE,YAAY,EAAEZ,CAAC,CAACa,OAAO,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;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CAC9D,CAAC;EAEX;AACJ,CAAC,CAAC","ignoreList":[]}
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","hcmsFieldPermissions","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/types.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 hcmsFieldPermissions: z.boolean().optional()\n })\n ])\n .optional(),\n auditLogs: z.boolean().optional(),\n recordLocking: z.boolean().optional(),\n fileManager: z\n .object({\n threatDetection: z.boolean().optional()\n })\n .optional()\n })\n }),\n render: ({ features = {} }) => {\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,UAAU;AACnB,SAASC,eAAe;AACxB,SAASC,eAAe;AAExB,OAAO,MAAMC,YAAY,GAAGD,eAAe,CAAC;EACxCE,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAE;IAA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B,KAAA,CAAA6B,QAAA,qBACI7B,KAAA,CAAA4B,aAAA,CAAC1B,UAAU;MAAC4B,SAAS,EAAC,cAAc;MAACC,KAAK,EAAEnB;IAAS,CAAE,CAAC,eACxDZ,KAAA,CAAA4B,aAAA,CAACzB,eAAe;MAAC2B,SAAS,EAAC,cAAc;MAACC,KAAK,EAAEnB;IAAS,CAAE,CAC9D,CAAC;EAEX;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -93,24 +93,27 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
93
93
  teams: import("zod").ZodOptional<import("zod").ZodBoolean>;
94
94
  privateFiles: import("zod").ZodOptional<import("zod").ZodBoolean>;
95
95
  folderLevelPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
96
+ hcmsFieldPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
96
97
  }, "strip", import("zod").ZodTypeAny, {
97
98
  teams?: boolean | undefined;
98
99
  privateFiles?: boolean | undefined;
99
100
  folderLevelPermissions?: boolean | undefined;
101
+ hcmsFieldPermissions?: boolean | undefined;
100
102
  }, {
101
103
  teams?: boolean | undefined;
102
104
  privateFiles?: boolean | undefined;
103
105
  folderLevelPermissions?: boolean | undefined;
106
+ hcmsFieldPermissions?: boolean | undefined;
104
107
  }>]>>;
105
108
  auditLogs: import("zod").ZodOptional<import("zod").ZodBoolean>;
106
109
  recordLocking: import("zod").ZodOptional<import("zod").ZodBoolean>;
107
- fileManager: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodObject<{
110
+ fileManager: import("zod").ZodOptional<import("zod").ZodObject<{
108
111
  threatDetection: import("zod").ZodOptional<import("zod").ZodBoolean>;
109
112
  }, "strip", import("zod").ZodTypeAny, {
110
113
  threatDetection?: boolean | undefined;
111
114
  }, {
112
115
  threatDetection?: boolean | undefined;
113
- }>]>>;
116
+ }>>;
114
117
  }, "strip", import("zod").ZodTypeAny, {
115
118
  multiTenancy?: boolean | undefined;
116
119
  advancedPublishingWorkflow?: boolean | undefined;
@@ -118,10 +121,11 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
118
121
  teams?: boolean | undefined;
119
122
  privateFiles?: boolean | undefined;
120
123
  folderLevelPermissions?: boolean | undefined;
124
+ hcmsFieldPermissions?: boolean | undefined;
121
125
  } | undefined;
122
126
  auditLogs?: boolean | undefined;
123
127
  recordLocking?: boolean | undefined;
124
- fileManager?: boolean | {
128
+ fileManager?: {
125
129
  threatDetection?: boolean | undefined;
126
130
  } | undefined;
127
131
  }, {
@@ -131,10 +135,11 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
131
135
  teams?: boolean | undefined;
132
136
  privateFiles?: boolean | undefined;
133
137
  folderLevelPermissions?: boolean | undefined;
138
+ hcmsFieldPermissions?: boolean | undefined;
134
139
  } | undefined;
135
140
  auditLogs?: boolean | undefined;
136
141
  recordLocking?: boolean | undefined;
137
- fileManager?: boolean | {
142
+ fileManager?: {
138
143
  threatDetection?: boolean | undefined;
139
144
  } | undefined;
140
145
  }>;
@@ -146,10 +151,11 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
146
151
  teams?: boolean | undefined;
147
152
  privateFiles?: boolean | undefined;
148
153
  folderLevelPermissions?: boolean | undefined;
154
+ hcmsFieldPermissions?: boolean | undefined;
149
155
  } | undefined;
150
156
  auditLogs?: boolean | undefined;
151
157
  recordLocking?: boolean | undefined;
152
- fileManager?: boolean | {
158
+ fileManager?: {
153
159
  threatDetection?: boolean | undefined;
154
160
  } | undefined;
155
161
  };
@@ -161,10 +167,11 @@ export declare const definitions: (import("../defineExtension/index.js").Extensi
161
167
  teams?: boolean | undefined;
162
168
  privateFiles?: boolean | undefined;
163
169
  folderLevelPermissions?: boolean | undefined;
170
+ hcmsFieldPermissions?: boolean | undefined;
164
171
  } | undefined;
165
172
  auditLogs?: boolean | undefined;
166
173
  recordLocking?: boolean | undefined;
167
- fileManager?: boolean | {
174
+ fileManager?: {
168
175
  threatDetection?: boolean | undefined;
169
176
  } | undefined;
170
177
  };
@@ -0,0 +1,10 @@
1
+ import { FeatureFlags } from "@webiny/feature-flags";
2
+ import { GetFeatureFlags } from "../../abstractions/index.js";
3
+ import { GetProjectConfig } from "../../abstractions/index.js";
4
+ declare class DefaultGetFeatureFlags implements GetFeatureFlags.Interface {
5
+ private getProjectConfig;
6
+ constructor(getProjectConfig: GetProjectConfig.Interface);
7
+ execute(): Promise<FeatureFlags>;
8
+ }
9
+ export declare const getFeatureFlags: import("@webiny/di").Implementation<typeof DefaultGetFeatureFlags>;
10
+ export {};
@@ -0,0 +1,29 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { FeatureFlags } from "@webiny/feature-flags";
3
+ import { GetFeatureFlags } from "../../abstractions/index.js";
4
+ import { GetProjectConfig } from "../../abstractions/index.js";
5
+ import { FeatureFlags as FeatureFlagsExtension } from "../../extensions/FeatureFlags.js";
6
+ class DefaultGetFeatureFlags {
7
+ constructor(getProjectConfig) {
8
+ this.getProjectConfig = getProjectConfig;
9
+ }
10
+ async execute() {
11
+ const projectConfig = await this.getProjectConfig.execute({
12
+ tags: {
13
+ runtimeContext: "project"
14
+ }
15
+ });
16
+ const extensions = projectConfig.extensionsByType(FeatureFlagsExtension);
17
+ if (extensions.length === 0) {
18
+ return new FeatureFlags({});
19
+ }
20
+ return FeatureFlags.fromDto(extensions[0].params.features);
21
+ }
22
+ }
23
+ export const getFeatureFlags = createImplementation({
24
+ abstraction: GetFeatureFlags,
25
+ implementation: DefaultGetFeatureFlags,
26
+ dependencies: [GetProjectConfig]
27
+ });
28
+
29
+ //# sourceMappingURL=GetFeatureFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","FeatureFlags","GetFeatureFlags","GetProjectConfig","FeatureFlagsExtension","DefaultGetFeatureFlags","constructor","getProjectConfig","execute","projectConfig","tags","runtimeContext","extensions","extensionsByType","length","fromDto","params","features","getFeatureFlags","abstraction","implementation","dependencies"],"sources":["GetFeatureFlags.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport { GetFeatureFlags } from \"~/abstractions/index.js\";\nimport { GetProjectConfig } from \"~/abstractions/index.js\";\nimport { FeatureFlags as FeatureFlagsExtension } from \"~/extensions/FeatureFlags.js\";\n\nclass DefaultGetFeatureFlags implements GetFeatureFlags.Interface {\n constructor(private getProjectConfig: GetProjectConfig.Interface) {}\n\n async execute(): Promise<FeatureFlags> {\n const projectConfig = await this.getProjectConfig.execute({\n tags: { runtimeContext: \"project\" }\n });\n\n const extensions = projectConfig.extensionsByType(FeatureFlagsExtension);\n\n if (extensions.length === 0) {\n return new FeatureFlags({});\n }\n\n return FeatureFlags.fromDto(extensions[0].params.features);\n }\n}\n\nexport const getFeatureFlags = createImplementation({\n abstraction: GetFeatureFlags,\n implementation: DefaultGetFeatureFlags,\n dependencies: [GetProjectConfig]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASF,YAAY,IAAIG,qBAAqB;AAE9C,MAAMC,sBAAsB,CAAsC;EAC9DC,WAAWA,CAASC,gBAA4C,EAAE;IAAA,KAA9CA,gBAA4C,GAA5CA,gBAA4C;EAAG;EAEnE,MAAMC,OAAOA,CAAA,EAA0B;IACnC,MAAMC,aAAa,GAAG,MAAM,IAAI,CAACF,gBAAgB,CAACC,OAAO,CAAC;MACtDE,IAAI,EAAE;QAAEC,cAAc,EAAE;MAAU;IACtC,CAAC,CAAC;IAEF,MAAMC,UAAU,GAAGH,aAAa,CAACI,gBAAgB,CAACT,qBAAqB,CAAC;IAExE,IAAIQ,UAAU,CAACE,MAAM,KAAK,CAAC,EAAE;MACzB,OAAO,IAAIb,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B;IAEA,OAAOA,YAAY,CAACc,OAAO,CAACH,UAAU,CAAC,CAAC,CAAC,CAACI,MAAM,CAACC,QAAQ,CAAC;EAC9D;AACJ;AAEA,OAAO,MAAMC,eAAe,GAAGlB,oBAAoB,CAAC;EAChDmB,WAAW,EAAEjB,eAAe;EAC5BkB,cAAc,EAAEf,sBAAsB;EACtCgB,YAAY,EAAE,CAAClB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./GetFeatureFlags.js";
@@ -0,0 +1,3 @@
1
+ export * from "./GetFeatureFlags.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./GetFeatureFlags.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -149,6 +149,7 @@ export class DefaultWatch {
149
149
  // Ignore promise, we don't need to wait for this to finish.
150
150
  replaceLambdaFunctions({
151
151
  app,
152
+ deploymentId,
152
153
  dependencies: {
153
154
  uiService: ui,
154
155
  loggerService: logger,