@webiny/project 6.6.0-alpha.1 → 6.6.0-alpha.11

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 (574) hide show
  1. package/ProjectSdk.d.ts +8 -19
  2. package/ProjectSdk.js +1 -28
  3. package/ProjectSdk.js.map +1 -1
  4. package/abstractions/features/hooks/index.d.ts +0 -8
  5. package/abstractions/features/hooks/index.js +0 -8
  6. package/abstractions/features/index.d.ts +0 -8
  7. package/abstractions/features/index.js +0 -8
  8. package/abstractions/models/IAppModel.d.ts +0 -2
  9. package/abstractions/models/IProjectModel.d.ts +0 -2
  10. package/abstractions/services/InitHostingSdkService.d.ts +21 -0
  11. package/abstractions/services/InitHostingSdkService.js +5 -0
  12. package/abstractions/services/InitHostingSdkService.js.map +1 -0
  13. package/abstractions/services/ProjectInfoService/ProjectInfoService.d.ts +6 -6
  14. package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  15. package/abstractions/services/ProjectInfoService/index.d.ts +0 -1
  16. package/abstractions/services/ProjectInfoService/index.js +0 -1
  17. package/abstractions/services/index.d.ts +1 -13
  18. package/abstractions/services/index.js +1 -13
  19. package/components/FeatureFlag.d.ts +9 -4
  20. package/components/FeatureFlag.js +6 -7
  21. package/components/FeatureFlag.js.map +1 -1
  22. package/createProjectSdkContainer.js +23 -12
  23. package/createProjectSdkContainer.js.map +1 -1
  24. package/decorators/GetFeatureFlagsWithLicense.js +1 -0
  25. package/decorators/GetFeatureFlagsWithLicense.js.map +1 -1
  26. package/decorators/index.d.ts +0 -6
  27. package/decorators/index.js +0 -6
  28. package/defineExtension/createExtensionReactComponent.js +9 -1
  29. package/defineExtension/createExtensionReactComponent.js.map +1 -1
  30. package/defineExtension/types.d.ts +7 -2
  31. package/exports/infra/admin.d.ts +0 -2
  32. package/exports/infra/admin.js +0 -2
  33. package/exports/infra/api.d.ts +0 -2
  34. package/exports/infra/api.js +0 -2
  35. package/exports/infra/core.d.ts +0 -2
  36. package/exports/infra/core.js +0 -2
  37. package/exports/infra.d.ts +0 -2
  38. package/exports/infra.js +0 -2
  39. package/extensions/AdminApiUrl.js +2 -1
  40. package/extensions/AdminApiUrl.js.map +1 -1
  41. package/extensions/AdminBuildParam.js +5 -5
  42. package/extensions/AdminBuildParam.js.map +1 -1
  43. package/extensions/AdminExtension.d.ts +1 -1
  44. package/extensions/AdminExtension.js +6 -5
  45. package/extensions/AdminExtension.js.map +1 -1
  46. package/extensions/AdminWebsocketsUrl.d.ts +1 -1
  47. package/extensions/AdminWebsocketsUrl.js +2 -1
  48. package/extensions/AdminWebsocketsUrl.js.map +1 -1
  49. package/extensions/ApiBuildParam.js +11 -10
  50. package/extensions/ApiBuildParam.js.map +1 -1
  51. package/extensions/ApiExtension.d.ts +1 -1
  52. package/extensions/ApiExtension.js +8 -5
  53. package/extensions/ApiExtension.js.map +1 -1
  54. package/extensions/BugReporter.d.ts +6 -0
  55. package/extensions/BugReporter.js +34 -0
  56. package/extensions/BugReporter.js.map +1 -0
  57. package/extensions/DatabaseSetup.js +2 -1
  58. package/extensions/DatabaseSetup.js.map +1 -1
  59. package/extensions/EnvVar.js +2 -1
  60. package/extensions/EnvVar.js.map +1 -1
  61. package/extensions/ExtensionDefinitions.js +2 -1
  62. package/extensions/ExtensionDefinitions.js.map +1 -1
  63. package/extensions/FeatureFlags.d.ts +7 -1
  64. package/extensions/FeatureFlags.js +12 -2
  65. package/extensions/FeatureFlags.js.map +1 -1
  66. package/extensions/{pulumi/ProductionEnvironments.js → ProductionEnvironments.js} +4 -3
  67. package/extensions/ProductionEnvironments.js.map +1 -0
  68. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
  69. package/extensions/Project/showConfigChangeNotice.d.ts +1 -1
  70. package/extensions/Project/showConfigChangeNotice.js.map +1 -1
  71. package/extensions/ProjectDecorator.js +2 -1
  72. package/extensions/ProjectDecorator.js.map +1 -1
  73. package/extensions/ProjectId.js +2 -1
  74. package/extensions/ProjectId.js.map +1 -1
  75. package/extensions/ProjectImplementation.js +2 -1
  76. package/extensions/ProjectImplementation.js.map +1 -1
  77. package/extensions/Telemetry.js +2 -1
  78. package/extensions/Telemetry.js.map +1 -1
  79. package/extensions/api/BackgroundTasks.d.ts +4 -0
  80. package/extensions/api/BackgroundTasks.js +25 -0
  81. package/extensions/api/BackgroundTasks.js.map +1 -0
  82. package/extensions/api/Cms/ModelFieldCompression.d.ts +4 -0
  83. package/extensions/api/Cms/ModelFieldCompression.js +25 -0
  84. package/extensions/api/Cms/ModelFieldCompression.js.map +1 -0
  85. package/extensions/api/Mailer/Smtp.d.ts +8 -0
  86. package/extensions/api/Mailer/Smtp.js +22 -0
  87. package/extensions/api/Mailer/Smtp.js.map +1 -0
  88. package/extensions/api/Mailer/Smtp.test.js +127 -0
  89. package/extensions/api/Mailer/Smtp.test.js.map +1 -0
  90. package/extensions/api/Mailer/SmtpParamsSchema.d.ts +9 -0
  91. package/extensions/api/Mailer/SmtpParamsSchema.js +17 -0
  92. package/extensions/api/Mailer/SmtpParamsSchema.js.map +1 -0
  93. package/extensions/api/Route/ApiRoute.d.ts +23 -0
  94. package/extensions/api/Route/ApiRoute.js +92 -0
  95. package/extensions/api/Route/ApiRoute.js.map +1 -0
  96. package/extensions/api/Route/index.d.ts +2 -0
  97. package/extensions/api/Route/index.js +2 -0
  98. package/extensions/api/Route/routePath.d.ts +20 -0
  99. package/extensions/api/Route/routePath.js +10 -0
  100. package/extensions/api/Route/routePath.js.map +1 -0
  101. package/extensions/api/index.d.ts +5 -0
  102. package/extensions/api/index.js +5 -0
  103. package/extensions/hasDefaultExport.d.ts +2 -0
  104. package/extensions/hasDefaultExport.js +17 -0
  105. package/extensions/hasDefaultExport.js.map +1 -0
  106. package/extensions/hooks/AdminAfterBuild.js +2 -1
  107. package/extensions/hooks/AdminAfterBuild.js.map +1 -1
  108. package/extensions/hooks/AdminBeforeBuild.js +2 -1
  109. package/extensions/hooks/AdminBeforeBuild.js.map +1 -1
  110. package/extensions/hooks/AdminBeforeWatch.js +2 -1
  111. package/extensions/hooks/AdminBeforeWatch.js.map +1 -1
  112. package/extensions/hooks/AfterBuild.js +2 -1
  113. package/extensions/hooks/AfterBuild.js.map +1 -1
  114. package/extensions/hooks/ApiAfterBuild.js +2 -1
  115. package/extensions/hooks/ApiAfterBuild.js.map +1 -1
  116. package/extensions/hooks/ApiBeforeBuild.js +2 -1
  117. package/extensions/hooks/ApiBeforeBuild.js.map +1 -1
  118. package/extensions/hooks/ApiBeforeWatch.js +2 -1
  119. package/extensions/hooks/ApiBeforeWatch.js.map +1 -1
  120. package/extensions/hooks/BeforeBuild.js +2 -1
  121. package/extensions/hooks/BeforeBuild.js.map +1 -1
  122. package/extensions/hooks/BeforeWatch.js +2 -1
  123. package/extensions/hooks/BeforeWatch.js.map +1 -1
  124. package/extensions/hooks/CoreAfterBuild.js +2 -1
  125. package/extensions/hooks/CoreAfterBuild.js.map +1 -1
  126. package/extensions/hooks/CoreBeforeBuild.js +2 -1
  127. package/extensions/hooks/CoreBeforeBuild.js.map +1 -1
  128. package/extensions/hooks/CoreBeforeWatch.js +2 -1
  129. package/extensions/hooks/CoreBeforeWatch.js.map +1 -1
  130. package/extensions/hooks/index.d.ts +0 -8
  131. package/extensions/hooks/index.js +0 -8
  132. package/extensions/hosting/assertHostingType.d.ts +13 -0
  133. package/extensions/hosting/assertHostingType.js +12 -0
  134. package/extensions/hosting/assertHostingType.js.map +1 -0
  135. package/extensions/hosting/extensionImplementations.d.ts +13 -0
  136. package/extensions/hosting/extensionImplementations.js +4 -0
  137. package/extensions/hosting/extensionImplementations.js.map +1 -0
  138. package/extensions/hosting/getExtensionImplementation.d.ts +1 -0
  139. package/extensions/hosting/getExtensionImplementation.js +9 -0
  140. package/extensions/hosting/getExtensionImplementation.js.map +1 -0
  141. package/extensions/hosting/hostingType.d.ts +2 -0
  142. package/extensions/hosting/hostingType.js +0 -0
  143. package/extensions/hosting/index.d.ts +4 -0
  144. package/extensions/hosting/index.js +4 -0
  145. package/extensions/hosting/registerExtensionImplementation.d.ts +12 -0
  146. package/extensions/hosting/registerExtensionImplementation.js +13 -0
  147. package/extensions/hosting/registerExtensionImplementation.js.map +1 -0
  148. package/extensions/index.d.ts +26 -39
  149. package/extensions/index.js +10 -21
  150. package/extensions/index.js.map +1 -1
  151. package/extensions/infra/Env.js +5 -0
  152. package/extensions/infra/Env.js.map +1 -1
  153. package/features/GetProductionEnvironments/GetProductionEnvironments.js +1 -1
  154. package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
  155. package/features/Serve/Serve.d.ts +1 -1
  156. package/features/Serve/Serve.js.map +1 -1
  157. package/features/Watch/watchers/worker.js +3 -0
  158. package/features/Watch/watchers/worker.js.map +1 -1
  159. package/features/hooks/index.d.ts +0 -8
  160. package/features/hooks/index.js +0 -8
  161. package/features/index.d.ts +0 -8
  162. package/features/index.js +0 -8
  163. package/index.d.ts +0 -4
  164. package/index.js +1 -5
  165. package/index.js.map +1 -1
  166. package/models/AppModel.js +1 -2
  167. package/models/AppModel.js.map +1 -1
  168. package/models/ProjectModel.js +0 -2
  169. package/models/ProjectModel.js.map +1 -1
  170. package/package.json +29 -34
  171. package/services/GetAppService/GetAppService.js +1 -3
  172. package/services/GetAppService/GetAppService.js.map +1 -1
  173. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.d.ts +15 -0
  174. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js +23 -0
  175. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js.map +1 -0
  176. package/services/GetProjectConfigService/EnvContext.d.ts +3 -2
  177. package/services/GetProjectConfigService/EnvContext.js +4 -6
  178. package/services/GetProjectConfigService/EnvContext.js.map +1 -1
  179. package/services/GetProjectConfigService/GetProjectConfigService.js +14 -11
  180. package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
  181. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js +1 -0
  182. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js.map +1 -1
  183. package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +1 -0
  184. package/services/GetProjectConfigService/WcpProjectLicenseContext.js +1 -0
  185. package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
  186. package/services/GetProjectConfigService/getRenderCacheKey.d.ts +1 -0
  187. package/services/GetProjectConfigService/getRenderCacheKey.js +13 -0
  188. package/services/GetProjectConfigService/getRenderCacheKey.js.map +1 -0
  189. package/services/GetProjectConfigService/nullRenderer.d.ts +4 -0
  190. package/services/GetProjectConfigService/nullRenderer.js +83 -0
  191. package/services/GetProjectConfigService/nullRenderer.js.map +1 -0
  192. package/services/GetProjectConfigService/renderConfig.d.ts +3 -12
  193. package/services/GetProjectConfigService/renderConfig.js +10 -35
  194. package/services/GetProjectConfigService/renderConfig.js.map +1 -1
  195. package/services/GetProjectConfigService/renderExtensions.d.ts +8 -0
  196. package/services/GetProjectConfigService/renderExtensions.js +52 -0
  197. package/services/GetProjectConfigService/renderExtensions.js.map +1 -0
  198. package/services/GetProjectService/GetProjectService.js +0 -2
  199. package/services/GetProjectService/GetProjectService.js.map +1 -1
  200. package/services/InitProjectSdkService/InitProjectSdkService.d.ts +6 -2
  201. package/services/InitProjectSdkService/InitProjectSdkService.js +22 -19
  202. package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
  203. package/services/InitProjectSdkService/applyWcpEnvVars.js +27 -9
  204. package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
  205. package/services/InitProjectSdkService/registerHooks.js +4 -16
  206. package/services/InitProjectSdkService/registerHooks.js.map +1 -1
  207. package/services/ProjectInfoService/ProjectInfoService.d.ts +7 -3
  208. package/services/ProjectInfoService/ProjectInfoService.js +3 -11
  209. package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  210. package/services/ProjectInfoService/index.d.ts +0 -1
  211. package/services/ProjectInfoService/index.js +0 -1
  212. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js +10 -7
  213. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
  214. package/services/WcpService/GetProjectEnvironment.js +16 -5
  215. package/services/WcpService/GetProjectEnvironment.js.map +1 -1
  216. package/services/WcpService/WcpGqlClient.js +2 -2
  217. package/services/WcpService/WcpGqlClient.js.map +1 -1
  218. package/services/WcpService/fetchProjectEnvironmentByApiKey.d.ts +8 -0
  219. package/services/WcpService/fetchProjectEnvironmentByApiKey.js +21 -0
  220. package/services/WcpService/fetchProjectEnvironmentByApiKey.js.map +1 -0
  221. package/services/index.d.ts +0 -12
  222. package/services/index.js +0 -12
  223. package/utils/ExtensionSrcResolver.js +2 -2
  224. package/utils/ExtensionSrcResolver.js.map +1 -1
  225. package/utils/apiRuntimeEnv.d.ts +2 -2
  226. package/utils/apiRuntimeEnv.js.map +1 -1
  227. package/utils/env/index.d.ts +0 -1
  228. package/utils/env/index.js +0 -1
  229. package/utils/index.d.ts +2 -0
  230. package/utils/index.js +2 -0
  231. package/utils/registerSrcExtensions.d.ts +13 -0
  232. package/utils/registerSrcExtensions.js +10 -0
  233. package/utils/registerSrcExtensions.js.map +1 -0
  234. package/utils/trace/TraceRecorder.d.ts +17 -0
  235. package/utils/trace/TraceRecorder.js +51 -0
  236. package/utils/trace/TraceRecorder.js.map +1 -0
  237. package/utils/trace/formatTraceReport.d.ts +2 -0
  238. package/utils/trace/formatTraceReport.js +53 -0
  239. package/utils/trace/formatTraceReport.js.map +1 -0
  240. package/utils/trace/index.d.ts +6 -0
  241. package/utils/trace/index.js +6 -0
  242. package/utils/trace/isTraceRequested.d.ts +1 -0
  243. package/utils/trace/isTraceRequested.js +12 -0
  244. package/utils/trace/isTraceRequested.js.map +1 -0
  245. package/utils/trace/startTrace.d.ts +1 -0
  246. package/utils/trace/startTrace.js +19 -0
  247. package/utils/trace/startTrace.js.map +1 -0
  248. package/utils/trace/trace.d.ts +1 -0
  249. package/utils/trace/trace.js +13 -0
  250. package/utils/trace/trace.js.map +1 -0
  251. package/utils/trace/traceAsync.d.ts +1 -0
  252. package/utils/trace/traceAsync.js +13 -0
  253. package/utils/trace/traceAsync.js.map +1 -0
  254. package/abstractions/features/DeployApp.d.ts +0 -20
  255. package/abstractions/features/DeployApp.js +0 -5
  256. package/abstractions/features/DeployApp.js.map +0 -1
  257. package/abstractions/features/DestroyApp.d.ts +0 -18
  258. package/abstractions/features/DestroyApp.js +0 -5
  259. package/abstractions/features/DestroyApp.js.map +0 -1
  260. package/abstractions/features/ExportStack.d.ts +0 -18
  261. package/abstractions/features/ExportStack.js +0 -5
  262. package/abstractions/features/ExportStack.js.map +0 -1
  263. package/abstractions/features/GetAppOutput.d.ts +0 -18
  264. package/abstractions/features/GetAppOutput.js +0 -5
  265. package/abstractions/features/GetAppOutput.js.map +0 -1
  266. package/abstractions/features/GetAppStackOutput.d.ts +0 -21
  267. package/abstractions/features/GetAppStackOutput.js +0 -5
  268. package/abstractions/features/GetAppStackOutput.js.map +0 -1
  269. package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +0 -7
  270. package/abstractions/features/GetPulumiResourceNamePrefix.js +0 -5
  271. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +0 -1
  272. package/abstractions/features/RefreshApp.d.ts +0 -18
  273. package/abstractions/features/RefreshApp.js +0 -5
  274. package/abstractions/features/RefreshApp.js.map +0 -1
  275. package/abstractions/features/RunPulumiCommand.d.ts +0 -19
  276. package/abstractions/features/RunPulumiCommand.js +0 -5
  277. package/abstractions/features/RunPulumiCommand.js.map +0 -1
  278. package/abstractions/features/hooks/AdminAfterDeploy.d.ts +0 -9
  279. package/abstractions/features/hooks/AdminAfterDeploy.js +0 -5
  280. package/abstractions/features/hooks/AdminAfterDeploy.js.map +0 -1
  281. package/abstractions/features/hooks/AdminBeforeDeploy.d.ts +0 -9
  282. package/abstractions/features/hooks/AdminBeforeDeploy.js +0 -5
  283. package/abstractions/features/hooks/AdminBeforeDeploy.js.map +0 -1
  284. package/abstractions/features/hooks/AfterDeploy.d.ts +0 -9
  285. package/abstractions/features/hooks/AfterDeploy.js +0 -5
  286. package/abstractions/features/hooks/AfterDeploy.js.map +0 -1
  287. package/abstractions/features/hooks/ApiAfterDeploy.d.ts +0 -9
  288. package/abstractions/features/hooks/ApiAfterDeploy.js +0 -5
  289. package/abstractions/features/hooks/ApiAfterDeploy.js.map +0 -1
  290. package/abstractions/features/hooks/ApiBeforeDeploy.d.ts +0 -9
  291. package/abstractions/features/hooks/ApiBeforeDeploy.js +0 -5
  292. package/abstractions/features/hooks/ApiBeforeDeploy.js.map +0 -1
  293. package/abstractions/features/hooks/BeforeDeploy.d.ts +0 -9
  294. package/abstractions/features/hooks/BeforeDeploy.js +0 -5
  295. package/abstractions/features/hooks/BeforeDeploy.js.map +0 -1
  296. package/abstractions/features/hooks/CoreAfterDeploy.d.ts +0 -9
  297. package/abstractions/features/hooks/CoreAfterDeploy.js +0 -5
  298. package/abstractions/features/hooks/CoreAfterDeploy.js.map +0 -1
  299. package/abstractions/features/hooks/CoreBeforeDeploy.d.ts +0 -9
  300. package/abstractions/features/hooks/CoreBeforeDeploy.js +0 -5
  301. package/abstractions/features/hooks/CoreBeforeDeploy.js.map +0 -1
  302. package/abstractions/services/GetPulumiService.d.ts +0 -14
  303. package/abstractions/services/GetPulumiService.js +0 -5
  304. package/abstractions/services/GetPulumiService.js.map +0 -1
  305. package/abstractions/services/IsRemotePulumiBackendService.d.ts +0 -7
  306. package/abstractions/services/IsRemotePulumiBackendService.js +0 -5
  307. package/abstractions/services/IsRemotePulumiBackendService.js.map +0 -1
  308. package/abstractions/services/ListAppLambdaFunctionsService.d.ts +0 -23
  309. package/abstractions/services/ListAppLambdaFunctionsService.js +0 -5
  310. package/abstractions/services/ListAppLambdaFunctionsService.js.map +0 -1
  311. package/abstractions/services/ListDeployedEnvironmentsService.d.ts +0 -12
  312. package/abstractions/services/ListDeployedEnvironmentsService.js +0 -5
  313. package/abstractions/services/ListDeployedEnvironmentsService.js.map +0 -1
  314. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -12
  315. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +0 -5
  316. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  317. package/abstractions/services/PulumiExportService.d.ts +0 -13
  318. package/abstractions/services/PulumiExportService.js +0 -6
  319. package/abstractions/services/PulumiExportService.js.map +0 -1
  320. package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +0 -7
  321. package/abstractions/services/PulumiGetConfigPassphraseService.js +0 -5
  322. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +0 -1
  323. package/abstractions/services/PulumiGetSecretsProviderService.d.ts +0 -7
  324. package/abstractions/services/PulumiGetSecretsProviderService.js +0 -5
  325. package/abstractions/services/PulumiGetSecretsProviderService.js.map +0 -1
  326. package/abstractions/services/PulumiGetStackOutputService.d.ts +0 -13
  327. package/abstractions/services/PulumiGetStackOutputService.js +0 -5
  328. package/abstractions/services/PulumiGetStackOutputService.js.map +0 -1
  329. package/abstractions/services/PulumiImportService.d.ts +0 -8
  330. package/abstractions/services/PulumiImportService.js +0 -5
  331. package/abstractions/services/PulumiImportService.js.map +0 -1
  332. package/abstractions/services/PulumiLoginService.d.ts +0 -16
  333. package/abstractions/services/PulumiLoginService.js +0 -5
  334. package/abstractions/services/PulumiLoginService.js.map +0 -1
  335. package/abstractions/services/PulumiSelectStackService.d.ts +0 -10
  336. package/abstractions/services/PulumiSelectStackService.js +0 -5
  337. package/abstractions/services/PulumiSelectStackService.js.map +0 -1
  338. package/abstractions/services/StackOutputCacheService.d.ts +0 -10
  339. package/abstractions/services/StackOutputCacheService.js +0 -5
  340. package/abstractions/services/StackOutputCacheService.js.map +0 -1
  341. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +0 -28
  342. package/abstractions/services/WatchedLambdaFunctionsService.js +0 -5
  343. package/abstractions/services/WatchedLambdaFunctionsService.js.map +0 -1
  344. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +0 -17
  345. package/decorators/DeployAppClearWatchedLambdaFunctions.js +0 -32
  346. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +0 -1
  347. package/decorators/DeployAppRefreshStackOutputCache.d.ts +0 -17
  348. package/decorators/DeployAppRefreshStackOutputCache.js +0 -32
  349. package/decorators/DeployAppRefreshStackOutputCache.js.map +0 -1
  350. package/decorators/DeployAppWithHooks.d.ts +0 -17
  351. package/decorators/DeployAppWithHooks.js +0 -58
  352. package/decorators/DeployAppWithHooks.js.map +0 -1
  353. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +0 -17
  354. package/decorators/DeployAppWithWatchedLambdaReplacement.js +0 -39
  355. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +0 -1
  356. package/decorators/DestroyAppClearStackOutputCache.d.ts +0 -25
  357. package/decorators/DestroyAppClearStackOutputCache.js +0 -29
  358. package/decorators/DestroyAppClearStackOutputCache.js.map +0 -1
  359. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +0 -11
  360. package/decorators/GetPulumiServiceWithDownloadInfo.js +0 -27
  361. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +0 -1
  362. package/extensions/ApiMaxBundleSize.d.ts +0 -4
  363. package/extensions/ApiMaxBundleSize.js +0 -23
  364. package/extensions/ApiMaxBundleSize.js.map +0 -1
  365. package/extensions/hooks/AdminAfterDeploy.d.ts +0 -4
  366. package/extensions/hooks/AdminAfterDeploy.js +0 -22
  367. package/extensions/hooks/AdminAfterDeploy.js.map +0 -1
  368. package/extensions/hooks/AdminBeforeDeploy.d.ts +0 -4
  369. package/extensions/hooks/AdminBeforeDeploy.js +0 -22
  370. package/extensions/hooks/AdminBeforeDeploy.js.map +0 -1
  371. package/extensions/hooks/AfterDeploy.d.ts +0 -4
  372. package/extensions/hooks/AfterDeploy.js +0 -21
  373. package/extensions/hooks/AfterDeploy.js.map +0 -1
  374. package/extensions/hooks/ApiAfterDeploy.d.ts +0 -4
  375. package/extensions/hooks/ApiAfterDeploy.js +0 -22
  376. package/extensions/hooks/ApiAfterDeploy.js.map +0 -1
  377. package/extensions/hooks/ApiBeforeDeploy.d.ts +0 -4
  378. package/extensions/hooks/ApiBeforeDeploy.js +0 -22
  379. package/extensions/hooks/ApiBeforeDeploy.js.map +0 -1
  380. package/extensions/hooks/BeforeDeploy.d.ts +0 -4
  381. package/extensions/hooks/BeforeDeploy.js +0 -21
  382. package/extensions/hooks/BeforeDeploy.js.map +0 -1
  383. package/extensions/hooks/CoreAfterDeploy.d.ts +0 -4
  384. package/extensions/hooks/CoreAfterDeploy.js +0 -22
  385. package/extensions/hooks/CoreAfterDeploy.js.map +0 -1
  386. package/extensions/hooks/CoreBeforeDeploy.d.ts +0 -4
  387. package/extensions/hooks/CoreBeforeDeploy.js +0 -22
  388. package/extensions/hooks/CoreBeforeDeploy.js.map +0 -1
  389. package/extensions/infra/Encryption.d.ts +0 -10
  390. package/extensions/infra/Encryption.js +0 -36
  391. package/extensions/infra/Encryption.js.map +0 -1
  392. package/extensions/infra/Hashing.d.ts +0 -5
  393. package/extensions/infra/Hashing.js +0 -27
  394. package/extensions/infra/Hashing.js.map +0 -1
  395. package/extensions/pulumi/AdminStackOutputValue.d.ts +0 -5
  396. package/extensions/pulumi/AdminStackOutputValue.js +0 -18
  397. package/extensions/pulumi/AdminStackOutputValue.js.map +0 -1
  398. package/extensions/pulumi/ApiStackOutputValue.d.ts +0 -5
  399. package/extensions/pulumi/ApiStackOutputValue.js +0 -18
  400. package/extensions/pulumi/ApiStackOutputValue.js.map +0 -1
  401. package/extensions/pulumi/CoreStackOutputValue.d.ts +0 -5
  402. package/extensions/pulumi/CoreStackOutputValue.js +0 -18
  403. package/extensions/pulumi/CoreStackOutputValue.js.map +0 -1
  404. package/extensions/pulumi/ProductionEnvironments.js.map +0 -1
  405. package/extensions/pulumi/PulumiResourceNamePrefix.d.ts +0 -4
  406. package/extensions/pulumi/PulumiResourceNamePrefix.js +0 -15
  407. package/extensions/pulumi/PulumiResourceNamePrefix.js.map +0 -1
  408. package/extensions/pulumi/index.d.ts +0 -5
  409. package/extensions/pulumi/index.js +0 -5
  410. package/features/DeployApp/DeployApp.d.ts +0 -14
  411. package/features/DeployApp/DeployApp.js +0 -86
  412. package/features/DeployApp/DeployApp.js.map +0 -1
  413. package/features/DeployApp/index.d.ts +0 -1
  414. package/features/DeployApp/index.js +0 -1
  415. package/features/DestroyApp/DestroyApp.d.ts +0 -14
  416. package/features/DestroyApp/DestroyApp.js +0 -66
  417. package/features/DestroyApp/DestroyApp.js.map +0 -1
  418. package/features/DestroyApp/index.d.ts +0 -1
  419. package/features/DestroyApp/index.js +0 -1
  420. package/features/ExportStack/ExportStack.d.ts +0 -9
  421. package/features/ExportStack/ExportStack.js +0 -26
  422. package/features/ExportStack/ExportStack.js.map +0 -1
  423. package/features/ExportStack/index.d.ts +0 -1
  424. package/features/ExportStack/index.js +0 -1
  425. package/features/GetAppOutput/GetAppOutput.d.ts +0 -12
  426. package/features/GetAppOutput/GetAppOutput.js +0 -51
  427. package/features/GetAppOutput/GetAppOutput.js.map +0 -1
  428. package/features/GetAppOutput/index.d.ts +0 -1
  429. package/features/GetAppOutput/index.js +0 -1
  430. package/features/GetAppStackOutput/GetAppStackOutput.d.ts +0 -10
  431. package/features/GetAppStackOutput/GetAppStackOutput.js +0 -26
  432. package/features/GetAppStackOutput/GetAppStackOutput.js.map +0 -1
  433. package/features/GetAppStackOutput/index.d.ts +0 -1
  434. package/features/GetAppStackOutput/index.js +0 -1
  435. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +0 -7
  436. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +0 -25
  437. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +0 -1
  438. package/features/GetPulumiResourceNamePrefix/index.d.ts +0 -1
  439. package/features/GetPulumiResourceNamePrefix/index.js +0 -1
  440. package/features/RefreshApp/RefreshApp.d.ts +0 -13
  441. package/features/RefreshApp/RefreshApp.js +0 -64
  442. package/features/RefreshApp/RefreshApp.js.map +0 -1
  443. package/features/RefreshApp/index.d.ts +0 -1
  444. package/features/RefreshApp/index.js +0 -1
  445. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +0 -13
  446. package/features/RunPulumiCommand/RunPulumiCommand.js +0 -61
  447. package/features/RunPulumiCommand/RunPulumiCommand.js.map +0 -1
  448. package/features/RunPulumiCommand/index.d.ts +0 -1
  449. package/features/RunPulumiCommand/index.js +0 -1
  450. package/features/Watch/handler/handler.zip +0 -0
  451. package/features/Watch/initInvocationForwarding.d.ts +0 -9
  452. package/features/Watch/initInvocationForwarding.js +0 -91
  453. package/features/Watch/initInvocationForwarding.js.map +0 -1
  454. package/features/Watch/localInvocationWorker.js +0 -31
  455. package/features/Watch/localInvocationWorker.js.map +0 -1
  456. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.d.ts +0 -7
  457. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +0 -25
  458. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +0 -1
  459. package/features/hooks/AdminAfterDeploy/index.d.ts +0 -1
  460. package/features/hooks/AdminAfterDeploy/index.js +0 -1
  461. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +0 -7
  462. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +0 -25
  463. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +0 -1
  464. package/features/hooks/AdminBeforeDeploy/index.d.ts +0 -1
  465. package/features/hooks/AdminBeforeDeploy/index.js +0 -1
  466. package/features/hooks/AfterDeploy/AfterDeploy.d.ts +0 -7
  467. package/features/hooks/AfterDeploy/AfterDeploy.js +0 -25
  468. package/features/hooks/AfterDeploy/AfterDeploy.js.map +0 -1
  469. package/features/hooks/AfterDeploy/index.d.ts +0 -1
  470. package/features/hooks/AfterDeploy/index.js +0 -1
  471. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.d.ts +0 -7
  472. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +0 -25
  473. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +0 -1
  474. package/features/hooks/ApiAfterDeploy/index.d.ts +0 -1
  475. package/features/hooks/ApiAfterDeploy/index.js +0 -1
  476. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +0 -7
  477. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +0 -25
  478. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +0 -1
  479. package/features/hooks/ApiBeforeDeploy/index.d.ts +0 -1
  480. package/features/hooks/ApiBeforeDeploy/index.js +0 -1
  481. package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +0 -7
  482. package/features/hooks/BeforeDeploy/BeforeDeploy.js +0 -25
  483. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +0 -1
  484. package/features/hooks/BeforeDeploy/index.d.ts +0 -1
  485. package/features/hooks/BeforeDeploy/index.js +0 -1
  486. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.d.ts +0 -7
  487. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +0 -25
  488. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +0 -1
  489. package/features/hooks/CoreAfterDeploy/index.d.ts +0 -1
  490. package/features/hooks/CoreAfterDeploy/index.js +0 -1
  491. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +0 -7
  492. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +0 -25
  493. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +0 -1
  494. package/features/hooks/CoreBeforeDeploy/index.d.ts +0 -1
  495. package/features/hooks/CoreBeforeDeploy/index.js +0 -1
  496. package/rslib-runtime.js +0 -14
  497. package/rslib-runtime.js.map +0 -1
  498. package/services/GetProjectConfigService/renderConfigWorker.d.ts +0 -1
  499. package/services/GetProjectConfigService/renderConfigWorker.js +0 -64
  500. package/services/GetProjectConfigService/renderConfigWorker.js.map +0 -1
  501. package/services/InitProjectSdkService/registerPulumiExtensions.d.ts +0 -4
  502. package/services/InitProjectSdkService/registerPulumiExtensions.js +0 -16
  503. package/services/InitProjectSdkService/registerPulumiExtensions.js.map +0 -1
  504. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +0 -14
  505. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +0 -15
  506. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +0 -1
  507. package/services/IsRemotePulumiBackendService/index.d.ts +0 -1
  508. package/services/IsRemotePulumiBackendService/index.js +0 -1
  509. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +0 -18
  510. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +0 -61
  511. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +0 -1
  512. package/services/ListAppLambdaFunctionsService/index.d.ts +0 -1
  513. package/services/ListAppLambdaFunctionsService/index.js +0 -1
  514. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +0 -7
  515. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +0 -30
  516. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +0 -1
  517. package/services/ListDeployedEnvironmentsService/index.d.ts +0 -1
  518. package/services/ListDeployedEnvironmentsService/index.js +0 -1
  519. package/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -5
  520. package/services/ProjectInfoService/GetPulumiVersionService.js +0 -46
  521. package/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  522. package/services/PulumiExportService/PulumiExportService.d.ts +0 -13
  523. package/services/PulumiExportService/PulumiExportService.js +0 -50
  524. package/services/PulumiExportService/PulumiExportService.js.map +0 -1
  525. package/services/PulumiExportService/index.d.ts +0 -1
  526. package/services/PulumiExportService/index.js +0 -1
  527. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +0 -5
  528. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +0 -15
  529. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +0 -1
  530. package/services/PulumiGetConfigPassphraseService/index.d.ts +0 -1
  531. package/services/PulumiGetConfigPassphraseService/index.js +0 -1
  532. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +0 -5
  533. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +0 -15
  534. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +0 -1
  535. package/services/PulumiGetSecretsProviderService/index.d.ts +0 -1
  536. package/services/PulumiGetSecretsProviderService/index.js +0 -1
  537. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +0 -12
  538. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +0 -64
  539. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +0 -1
  540. package/services/PulumiGetStackOutputService/index.d.ts +0 -1
  541. package/services/PulumiGetStackOutputService/index.js +0 -1
  542. package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +0 -1
  543. package/services/PulumiGetStackOutputService/mapStackOutput.js +0 -22
  544. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +0 -1
  545. package/services/PulumiImportService/PulumiImportService.d.ts +0 -10
  546. package/services/PulumiImportService/PulumiImportService.js +0 -60
  547. package/services/PulumiImportService/PulumiImportService.js.map +0 -1
  548. package/services/PulumiImportService/index.d.ts +0 -1
  549. package/services/PulumiImportService/index.js +0 -1
  550. package/services/PulumiLoginService/PulumiLoginService.d.ts +0 -10
  551. package/services/PulumiLoginService/PulumiLoginService.js +0 -54
  552. package/services/PulumiLoginService/PulumiLoginService.js.map +0 -1
  553. package/services/PulumiLoginService/index.d.ts +0 -1
  554. package/services/PulumiLoginService/index.js +0 -1
  555. package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +0 -15
  556. package/services/PulumiSelectStackService/PulumiSelectStackService.js +0 -102
  557. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +0 -1
  558. package/services/PulumiSelectStackService/index.d.ts +0 -1
  559. package/services/PulumiSelectStackService/index.js +0 -1
  560. package/services/StackOutputCacheService/StackOutputCacheService.d.ts +0 -18
  561. package/services/StackOutputCacheService/StackOutputCacheService.js +0 -89
  562. package/services/StackOutputCacheService/StackOutputCacheService.js.map +0 -1
  563. package/services/StackOutputCacheService/index.d.ts +0 -1
  564. package/services/StackOutputCacheService/index.js +0 -1
  565. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +0 -13
  566. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +0 -54
  567. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +0 -1
  568. package/services/WatchedLambdaFunctionsService/index.d.ts +0 -1
  569. package/services/WatchedLambdaFunctionsService/index.js +0 -1
  570. package/utils/env/withPulumiConfigPassphrase.d.ts +0 -1
  571. package/utils/env/withPulumiConfigPassphrase.js +0 -7
  572. package/utils/env/withPulumiConfigPassphrase.js.map +0 -1
  573. /package/extensions/{pulumi/ProductionEnvironments.d.ts → ProductionEnvironments.d.ts} +0 -0
  574. /package/{features/Watch/localInvocationWorker.d.ts → extensions/api/Mailer/Smtp.test.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ApiBuildParam.js","sources":["../../src/extensions/ApiBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.string(), z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Check if file already exists.\n if (fs.existsSync(filePath)) {\n // File exists, just ensure it's imported in extensions.ts\n } else {\n // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/api/build-params\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now update extensions.ts to import and register this BuildParam.\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Calculate import path relative to extensions.ts.\n let importPath = path\n .relative(path.dirname(extensionsTsFilePath), filePath)\n .replace(/\\.tsx?$/, \".js\");\n\n // Ensure the path starts with ./\n if (!importPath.startsWith(\".\")) {\n importPath = \"./\" + importPath;\n }\n\n // Check if import already exists.\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for the BuildParam implementation.\n source.insertImportDeclaration(index, {\n defaultImport: className,\n moduleSpecifier: importPath\n });\n\n // Add the registration to the plugins array.\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${className});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const contextPluginImportPath = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingRegisterExtensionPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"names":["BuildParam","defineExtension","z","params","ctx","extensionsTsFilePath","buildParamsDir","paramName","value","valueStr","JSON","hash","crypto","className","fileName","filePath","path","fs","fileContent","project","Project","source","importPath","existingImportDeclaration","index","importDeclarations","last","pluginsArray","node","Node","contextPluginImportPath","existingRegisterExtensionPluginImport"],"mappings":";;;;;;AAOO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,IACHC,EAAE,MAAM,CAAC;YACZ,WAAWA,EAAE,MAAM;YACnB,OAAOA,EAAE,KAAK,CAAC;gBACXA,EAAE,MAAM;gBACRA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG;gBAC1BA,EAAE,KAAK,CAACA,EAAE,GAAG;gBACbA,EAAE,MAAM;gBACRA,EAAE,OAAO;aACZ;QACL;IAEJ,MAAM,OAAMC,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAME,iBAAiBF,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACnD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,eACtC,QAAQ;QAEb,MAAM,EAAEG,SAAS,EAAEC,KAAK,EAAE,GAAGL;QAG7B,MAAMM,WAAWC,KAAK,SAAS,CAACF,OAAO,MAAM;QAG7C,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACL,WAAW,MAAM,CAAC;QAClE,MAAMM,YAAY,CAAC,WAAW,EAAEF,KAAK,KAAK,CAAC,MAAM;QACjD,MAAMG,WAAW,GAAGD,UAAU,GAAG,CAAC;QAClC,MAAME,WAAWC,KAAK,IAAI,CAACV,gBAAgBQ;QAG3C,IAAI,CAACG,GAAG,UAAU,CAACX,iBACfW,GAAG,SAAS,CAACX,gBAAgB;YAAE,WAAW;QAAK;QAInD,IAAIW,GAAG,UAAU,CAACF;aAEX;YAEH,MAAMG,cAAc,CAAC;;MAE3B,EAAEL,UAAU;WACP,EAAEN,UAAU;YACX,EAAEE,SAAS;;;;oBAIH,EAAEI,UAAU;;;AAGhC,CAAC;YACWI,GAAG,aAAa,CAACF,UAAUG,aAAa;QAC5C;QAGA,MAAMC,UAAU,IAAIC;QACpBD,QAAQ,mBAAmB,CAACd;QAE5B,MAAMgB,SAASF,QAAQ,oBAAoB,CAACd;QAG5C,IAAIiB,aAAaN,KAAAA,QACJ,CAACA,KAAK,OAAO,CAACX,uBAAuBU,UAC7C,OAAO,CAAC,WAAW;QAGxB,IAAI,CAACO,WAAW,UAAU,CAAC,MACvBA,aAAa,OAAOA;QAIxB,MAAMC,4BAA4BF,OAAO,oBAAoB,CAACC;QAC9D,IAAIC,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;QACvD,IAAII,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGAL,OAAO,uBAAuB,CAACG,OAAO;YAClC,eAAeX;YACf,iBAAiBS;QACrB;QAGA,MAAMK,eAAeN,OAAO,kBAAkB,CAACO,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,6EAA6E,EAAEd,UAAU,MAAM,CAAC;QAGrG;YACI,IAAIW,QAAQ;YAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;YACvD,IAAII,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAEA,MAAMI,0BAA0B;YAChC,MAAMC,wCACFV,OAAO,oBAAoB,CAACS;YAChC,IAAI,CAACC,uCACDV,OAAO,uBAAuB,CAACG,OAAO;gBAClC,cAAc;oBAAC;iBAAgC;gBAC/C,iBAAiBM;YACrB;QAER;QAEA,MAAMT,OAAO,IAAI;IACrB;AACJ"}
1
+ {"version":3,"file":"extensions/ApiBuildParam.js","sources":["../../src/extensions/ApiBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\", hosting: \"all\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.string(), z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Written when missing or when its value changed (a config edit), and left alone when equal,\n // so an unchanged param doesn't trigger a rebuild.\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 const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, \"utf8\") : undefined;\n if (existing !== fileContent) {\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 `\\ncreateRegisterBuildParamPlugin(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 // Build params get their own plugin type so the API applies them before any feature\n // registers (features read FeatureFlags, a BuildParam, at register() time). ApiExtension\n // imports from the same path, so merge into an existing import rather than skip it.\n const contextPluginImportPath = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingImport = source.getImportDeclaration(contextPluginImportPath);\n if (!existingImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterBuildParamPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n } else if (\n !existingImport\n .getNamedImports()\n .some(i => i.getName() === \"createRegisterBuildParamPlugin\")\n ) {\n existingImport.addNamedImport(\"createRegisterBuildParamPlugin\");\n }\n }\n\n await source.save();\n }\n});\n"],"names":["BuildParam","defineExtension","z","params","ctx","extensionsTsFilePath","buildParamsDir","paramName","value","valueStr","JSON","hash","crypto","className","fileName","filePath","path","fs","fileContent","existing","undefined","project","Project","source","importPath","existingImportDeclaration","index","importDeclarations","last","pluginsArray","node","Node","contextPluginImportPath","existingImport","i"],"mappings":";;;;;;AAOO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;QAAO,SAAS;IAAM;IACpE,aAAa;IACb,UAAU;IACV,cAAc,IACHC,EAAE,MAAM,CAAC;YACZ,WAAWA,EAAE,MAAM;YACnB,OAAOA,EAAE,KAAK,CAAC;gBACXA,EAAE,MAAM;gBACRA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG;gBAC1BA,EAAE,KAAK,CAACA,EAAE,GAAG;gBACbA,EAAE,MAAM;gBACRA,EAAE,OAAO;aACZ;QACL;IAEJ,MAAM,OAAMC,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAME,iBAAiBF,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACnD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,eACtC,QAAQ;QAEb,MAAM,EAAEG,SAAS,EAAEC,KAAK,EAAE,GAAGL;QAG7B,MAAMM,WAAWC,KAAK,SAAS,CAACF,OAAO,MAAM;QAG7C,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACL,WAAW,MAAM,CAAC;QAClE,MAAMM,YAAY,CAAC,WAAW,EAAEF,KAAK,KAAK,CAAC,MAAM;QACjD,MAAMG,WAAW,GAAGD,UAAU,GAAG,CAAC;QAClC,MAAME,WAAWC,KAAK,IAAI,CAACV,gBAAgBQ;QAG3C,IAAI,CAACG,GAAG,UAAU,CAACX,iBACfW,GAAG,SAAS,CAACX,gBAAgB;YAAE,WAAW;QAAK;QAKnD,MAAMY,cAAc,CAAC;;MAEvB,EAAEL,UAAU;WACP,EAAEN,UAAU;YACX,EAAEE,SAAS;;;;oBAIH,EAAEI,UAAU;;;AAGhC,CAAC;QACO,MAAMM,WAAWF,GAAG,UAAU,CAACF,YAAYE,GAAG,YAAY,CAACF,UAAU,UAAUK;QAC/E,IAAID,aAAaD,aACbD,GAAG,aAAa,CAACF,UAAUG,aAAa;QAI5C,MAAMG,UAAU,IAAIC;QACpBD,QAAQ,mBAAmB,CAAChB;QAE5B,MAAMkB,SAASF,QAAQ,oBAAoB,CAAChB;QAG5C,IAAImB,aAAaR,KAAAA,QACJ,CAACA,KAAK,OAAO,CAACX,uBAAuBU,UAC7C,OAAO,CAAC,WAAW;QAGxB,IAAI,CAACS,WAAW,UAAU,CAAC,MACvBA,aAAa,OAAOA;QAIxB,MAAMC,4BAA4BF,OAAO,oBAAoB,CAACC;QAC9D,IAAIC,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;QACvD,IAAII,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGAL,OAAO,uBAAuB,CAACG,OAAO;YAClC,eAAeb;YACf,iBAAiBW;QACrB;QAGA,MAAMK,eAAeN,OAAO,kBAAkB,CAACO,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,8EAA8E,EAAEhB,UAAU,MAAM,CAAC;QAGtG;YACI,IAAIa,QAAQ;YAEZ,MAAMC,qBAAqBJ,OAAO,qBAAqB;YACvD,IAAII,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAKA,MAAMI,0BAA0B;YAChC,MAAMC,iBAAiBV,OAAO,oBAAoB,CAACS;YACnD,IAAKC,gBAKE;gBAAA,IACH,CAACA,eACI,eAAe,GACf,IAAI,CAACC,CAAAA,IAAKA,AAAgB,qCAAhBA,EAAE,OAAO,KAExBD,eAAe,cAAc,CAAC;YAClC,OAVIV,OAAO,uBAAuB,CAACG,OAAO;gBAClC,cAAc;oBAAC;iBAAiC;gBAChD,iBAAiBM;YACrB;QAQR;QAEA,MAAMT,OAAO,IAAI;IACrB;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const ApiExtension: import("~/extensions/index.js").ExtensionComponent<z.ZodObject<{
2
+ export declare const ApiExtension: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
3
  src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
4
  exportName: z.ZodOptional<z.ZodString>;
5
5
  }, z.core.$strip>>;
@@ -1,14 +1,16 @@
1
- import { defineExtension, zodSrcPath } from "./index.js";
1
+ import { defineExtension, zodSrcPath } from "../defineExtension/index.js";
2
2
  import { ExtensionSrcResolver } from "../index.js";
3
3
  import { z } from "zod";
4
4
  import path from "path";
5
5
  import { Node, Project } from "ts-morph";
6
6
  import crypto_0 from "crypto";
7
+ import { hasDefaultExport } from "./hasDefaultExport.js";
7
8
  const ApiExtension = defineExtension({
8
9
  type: "Api/Extension",
9
10
  tags: {
10
11
  runtimeContext: "app-build",
11
- appName: "api"
12
+ appName: "api",
13
+ hosting: "all"
12
14
  },
13
15
  description: "Add any API extension.",
14
16
  multiple: true,
@@ -41,8 +43,7 @@ const ApiExtension = defineExtension({
41
43
  const extensionProject = new Project();
42
44
  extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
43
45
  const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
44
- const hasDefaultExport = void 0 !== extensionSource.getDefaultExportSymbol();
45
- if (hasDefaultExport) source.insertImportDeclaration(index, {
46
+ if (hasDefaultExport(extensionSource)) source.insertImportDeclaration(index, {
46
47
  defaultImport: exportNameAlias,
47
48
  moduleSpecifier: importPath
48
49
  });
@@ -66,7 +67,9 @@ const ApiExtension = defineExtension({
66
67
  }
67
68
  const registerExtensionPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
68
69
  const existingRegisterExtensionPluginImport = source.getImportDeclaration(registerExtensionPluginImportPath);
69
- if (!existingRegisterExtensionPluginImport) source.insertImportDeclaration(index, {
70
+ if (existingRegisterExtensionPluginImport) {
71
+ if (!existingRegisterExtensionPluginImport.getNamedImports().some((i)=>"createRegisterExtensionPlugin" === i.getName())) existingRegisterExtensionPluginImport.addNamedImport("createRegisterExtensionPlugin");
72
+ } else source.insertImportDeclaration(index, {
70
73
  namedImports: [
71
74
  "createRegisterExtensionPlugin"
72
75
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ApiExtension.js","sources":["../../src/extensions/ApiExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const ApiExtension = defineExtension({\n type: \"Api/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add any API extension.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name is always the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Alias name is \"ApiExtension_\" + hash of the file path. This way we\n // avoid potential naming conflicts and keep the identifier constant.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;\n\n // Calculate import path relative to `extensions.ts` file.\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Check if the file has a default export using AST parsing.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n // Support both default and named exports.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: exportNameAlias,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: exportNameAlias }],\n moduleSpecifier: importPath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${exportNameAlias});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const registerExtensionPluginImportPath =\n \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport = source.getImportDeclaration(\n registerExtensionPluginImportPath\n );\n if (!existingRegisterExtensionPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: registerExtensionPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"names":["ApiExtension","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","extensionFilePath","absoluteExtensionFilePath","ExtensionSrcResolver","extensionFileName","path","exportName","hash","crypto","exportNameAlias","importPath","Project","source","existingImportDeclaration","index","importDeclarations","last","extensionProject","extensionSource","hasDefaultExport","undefined","pluginsArray","node","Node","registerExtensionPluginImportPath","existingRegisterExtensionPluginImport"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,YAAYC,EAAE,MAAM,GAAG,QAAQ;QACnC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAM,EAAE,KAAKE,iBAAiB,EAAE,GAAGH;QAGnC,MAAMI,4BAA4BC,qBAAqB,WAAW,CAC9DF,mBACAF,IAAI,OAAO;QAGf,MAAMK,oBAAoBC,KAAK,QAAQ,CAACH;QAGxC,MAAMI,aAAaR,OAAO,UAAU,IAAIO,KAAK,KAAK,CAACD,mBAAmB,IAAI;QAI1E,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACP,mBAAmB,MAAM,CAAC;QAC1E,MAAMQ,kBAAkB,CAAC,aAAa,EAAEF,KAAK,KAAK,CAAC,MAAM;QAGzD,MAAMG,aAAaL,KAAAA,QACN,CAACA,KAAK,OAAO,CAACL,uBAAuBE,2BAC7C,OAAO,CAAC,WAAW;QAExB,MAAMP,UAAU,IAAIgB;QACpBhB,QAAQ,mBAAmB,CAACK;QAE5B,MAAMY,SAASjB,QAAQ,oBAAoB,CAACK;QAE5C,MAAMa,4BAA4BD,OAAO,oBAAoB,CAACF;QAC9D,IAAIG,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;QACvD,IAAIG,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGA,MAAMC,mBAAmB,IAAIN;QAC7BM,iBAAiB,mBAAmB,CAACf;QACrC,MAAMgB,kBAAkBD,iBAAiB,oBAAoB,CAACf;QAC9D,MAAMiB,mBAAmBD,AAA6CE,WAA7CF,gBAAgB,sBAAsB;QAG/D,IAAIC,kBACAP,OAAO,uBAAuB,CAACE,OAAO;YAClC,eAAeL;YACf,iBAAiBC;QACrB;aAEAE,OAAO,uBAAuB,CAACE,OAAO;YAClC,cAAc;gBAAC;oBAAE,MAAMR;oBAAY,OAAOG;gBAAgB;aAAE;YAC5D,iBAAiBC;QACrB;QAGJ,MAAMW,eAAeT,OAAO,kBAAkB,CAACU,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,6EAA6E,EAAEZ,gBAAgB,MAAM,CAAC;QAG3G;YACI,IAAIK,QAAQ;YAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;YACvD,IAAIG,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAEA,MAAMQ,oCACF;YACJ,MAAMC,wCAAwCb,OAAO,oBAAoB,CACrEY;YAEJ,IAAI,CAACC,uCACDb,OAAO,uBAAuB,CAACE,OAAO;gBAClC,cAAc;oBAAC;iBAAgC;gBAC/C,iBAAiBU;YACrB;QAER;QAEA,MAAMZ,OAAO,IAAI;IACrB;AACJ"}
1
+ {"version":3,"file":"extensions/ApiExtension.js","sources":["../../src/extensions/ApiExtension.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport crypto from \"crypto\";\nimport { hasDefaultExport } from \"./hasDefaultExport.js\";\n\nexport const ApiExtension = defineExtension({\n type: \"Api/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"api\", hosting: \"all\" },\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\n // Support both default and named exports.\n if (hasDefaultExport(extensionSource)) {\n source.insertImportDeclaration(index, {\n defaultImport: exportNameAlias,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: exportNameAlias }],\n moduleSpecifier: importPath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${exportNameAlias});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const registerExtensionPluginImportPath =\n \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport = source.getImportDeclaration(\n registerExtensionPluginImportPath\n );\n if (!existingRegisterExtensionPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: registerExtensionPluginImportPath\n });\n } else if (\n !existingRegisterExtensionPluginImport\n .getNamedImports()\n .some(i => i.getName() === \"createRegisterExtensionPlugin\")\n ) {\n // BuildParam imports `createRegisterBuildParamPlugin` from the same path.\n existingRegisterExtensionPluginImport.addNamedImport(\n \"createRegisterExtensionPlugin\"\n );\n }\n }\n\n await source.save();\n }\n});\n"],"names":["ApiExtension","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","extensionFilePath","absoluteExtensionFilePath","ExtensionSrcResolver","extensionFileName","path","exportName","hash","crypto","exportNameAlias","importPath","Project","source","existingImportDeclaration","index","importDeclarations","last","extensionProject","extensionSource","hasDefaultExport","pluginsArray","node","Node","registerExtensionPluginImportPath","existingRegisterExtensionPluginImport","i"],"mappings":";;;;;;;AASO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;QAAO,SAAS;IAAM;IACpE,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,YAAYC,EAAE,MAAM,GAAG,QAAQ;QACnC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAM,EAAE,KAAKE,iBAAiB,EAAE,GAAGH;QAGnC,MAAMI,4BAA4BC,qBAAqB,WAAW,CAC9DF,mBACAF,IAAI,OAAO;QAGf,MAAMK,oBAAoBC,KAAK,QAAQ,CAACH;QAGxC,MAAMI,aAAaR,OAAO,UAAU,IAAIO,KAAK,KAAK,CAACD,mBAAmB,IAAI;QAI1E,MAAMG,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACP,mBAAmB,MAAM,CAAC;QAC1E,MAAMQ,kBAAkB,CAAC,aAAa,EAAEF,KAAK,KAAK,CAAC,MAAM;QAGzD,MAAMG,aAAaL,KAAAA,QACN,CAACA,KAAK,OAAO,CAACL,uBAAuBE,2BAC7C,OAAO,CAAC,WAAW;QAExB,MAAMP,UAAU,IAAIgB;QACpBhB,QAAQ,mBAAmB,CAACK;QAE5B,MAAMY,SAASjB,QAAQ,oBAAoB,CAACK;QAE5C,MAAMa,4BAA4BD,OAAO,oBAAoB,CAACF;QAC9D,IAAIG,2BACA;QAGJ,IAAIC,QAAQ;QAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;QACvD,IAAIG,mBAAmB,MAAM,EAAE;YAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;YAC9DD,QAAQE,KAAK,aAAa,KAAK;QACnC;QAGA,MAAMC,mBAAmB,IAAIN;QAC7BM,iBAAiB,mBAAmB,CAACf;QACrC,MAAMgB,kBAAkBD,iBAAiB,oBAAoB,CAACf;QAG9D,IAAIiB,iBAAiBD,kBACjBN,OAAO,uBAAuB,CAACE,OAAO;YAClC,eAAeL;YACf,iBAAiBC;QACrB;aAEAE,OAAO,uBAAuB,CAACE,OAAO;YAClC,cAAc;gBAAC;oBAAE,MAAMR;oBAAY,OAAOG;gBAAgB;aAAE;YAC5D,iBAAiBC;QACrB;QAGJ,MAAMU,eAAeR,OAAO,kBAAkB,CAACS,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAGlCD,aAAa,UAAU,CACnB,CAAC,6EAA6E,EAAEX,gBAAgB,MAAM,CAAC;QAG3G;YACI,IAAIK,QAAQ;YAEZ,MAAMC,qBAAqBH,OAAO,qBAAqB;YACvD,IAAIG,mBAAmB,MAAM,EAAE;gBAC3B,MAAMC,OAAOD,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE;gBAC9DD,QAAQE,KAAK,aAAa,KAAK;YACnC;YAEA,MAAMO,oCACF;YACJ,MAAMC,wCAAwCZ,OAAO,oBAAoB,CACrEW;YAEJ,IAAKC,uCAKE;gBAAA,IACH,CAACA,sCACI,eAAe,GACf,IAAI,CAACC,CAAAA,IAAKA,AAAgB,oCAAhBA,EAAE,OAAO,KAGxBD,sCAAsC,cAAc,CAChD;YAER,OAbIZ,OAAO,uBAAuB,CAACE,OAAO;gBAClC,cAAc;oBAAC;iBAAgC;gBAC/C,iBAAiBS;YACrB;QAWR;QAEA,MAAMX,OAAO,IAAI;IACrB;AACJ"}
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export declare const BugReporter: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ token: z.ZodOptional<z.ZodString>;
4
+ repository: z.ZodOptional<z.ZodString>;
5
+ labels: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>>;
@@ -0,0 +1,34 @@
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
+ const BugReporter = defineExtension({
7
+ type: "Project/BugReporter",
8
+ tags: {
9
+ runtimeContext: "project",
10
+ hosting: "all"
11
+ },
12
+ description: "Point the bug reporter at a GitHub repository, so the API files issues itself.",
13
+ paramsSchema: z.object({
14
+ token: z.string().optional().describe("GitHub PAT with write on BOTH issues and contents. Contents is not optional once anyone pastes a screenshot: issues have no attachment API, so images are committed to a branch. Always pass it through an env var, never a literal, since the value is serialized into the build artifact."),
15
+ repository: z.string().optional().describe("Target repository as `owner/name`. Filing requires this as well as a token; a token on its own leaves the reporter in compose mode."),
16
+ labels: z.string().optional().describe("Comma separated labels applied to every issue. Defaults to `bug`. Every issue also gets `reported-in-app`.")
17
+ }),
18
+ render: ({ token, repository, labels })=>/*#__PURE__*/ react.createElement(react.Fragment, null, token ? /*#__PURE__*/ react.createElement(BuildParam, {
19
+ paramName: "BUG_REPORT_GITHUB_TOKEN",
20
+ value: token
21
+ }) : null, repository ? /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(BuildParam, {
22
+ paramName: "BUG_REPORT_REPOSITORY",
23
+ value: repository
24
+ }), /*#__PURE__*/ react.createElement(AdminBuildParam, {
25
+ paramName: "BUG_REPORT_REPOSITORY",
26
+ value: repository
27
+ })) : null, labels ? /*#__PURE__*/ react.createElement(BuildParam, {
28
+ paramName: "BUG_REPORT_LABELS",
29
+ value: labels
30
+ }) : null)
31
+ });
32
+ export { BugReporter };
33
+
34
+ //# sourceMappingURL=BugReporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/BugReporter.js","sources":["../../src/extensions/BugReporter.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\n/*\n * The bug reporter is enabled in every project through DefaultExtensions, so this extension is not\n * what turns it on. Without it the reporter runs in compose mode: the API writes the report up and\n * returns a prefilled GitHub issues/new URL, which the reporter submits under their own account and\n * which needs no credentials. This is what switches it to filing the issue itself.\n *\n * Lives here rather than in @webiny/bug-reporter because that package already depends on\n * @webiny/project-extensions for `Api` and `Admin`, so having the Project namespace reach back into\n * it would close a cycle. Nothing is lost: the render only emits build params, and the API owns every\n * default, so there is one place they live rather than two that can drift.\n */\nexport const BugReporter = defineExtension({\n type: \"Project/BugReporter\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Point the bug reporter at a GitHub repository, so the API files issues itself.\",\n paramsSchema: z.object({\n token: z\n .string()\n .optional()\n .describe(\n \"GitHub PAT with write on BOTH issues and contents. Contents is not optional once anyone pastes a screenshot: issues have no attachment API, so images are committed to a branch. Always pass it through an env var, never a literal, since the value is serialized into the build artifact.\"\n ),\n repository: z\n .string()\n .optional()\n .describe(\n \"Target repository as `owner/name`. Filing requires this as well as a token; a token on its own leaves the reporter in compose mode.\"\n ),\n labels: z\n .string()\n .optional()\n .describe(\n \"Comma separated labels applied to every issue. Defaults to `bug`. Every issue also gets `reported-in-app`.\"\n )\n }),\n render: ({ token, repository, labels }) => {\n return (\n <>\n {token ? <BuildParam paramName=\"BUG_REPORT_GITHUB_TOKEN\" value={token} /> : null}\n {/*\n * The repository goes to the admin app too, so the dialog can name where a report\n * is headed before the reporter sends it. The token never does: an admin build\n * param is serialized into the browser bundle.\n */}\n {repository ? (\n <>\n <BuildParam paramName=\"BUG_REPORT_REPOSITORY\" value={repository} />\n <AdminBuildParam paramName=\"BUG_REPORT_REPOSITORY\" value={repository} />\n </>\n ) : null}\n {labels ? <BuildParam paramName=\"BUG_REPORT_LABELS\" value={labels} /> : null}\n </>\n );\n }\n});\n"],"names":["BugReporter","defineExtension","z","token","repository","labels","BuildParam","AdminBuildParam"],"mappings":";;;;;AAiBO,MAAMA,cAAcC,gBAAgB;IACvC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,OAAOA,EAAAA,MACI,GACN,QAAQ,GACR,QAAQ,CACL;QAER,YAAYA,EAAAA,MACD,GACN,QAAQ,GACR,QAAQ,CACL;QAER,QAAQA,EAAAA,MACG,GACN,QAAQ,GACR,QAAQ,CACL;IAEZ;IACA,QAAQ,CAAC,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAE,GAC3B,WAAP,GACI,0CACKF,QAAQ,WAARA,GAAQ,oBAACG,YAAUA;YAAC,WAAU;YAA0B,OAAOH;aAAY,MAM3EC,aAAa,WAAbA,GACG,wDACI,oBAACE,YAAUA;YAAC,WAAU;YAAwB,OAAOF;0BACrD,oBAACG,iBAAeA;YAAC,WAAU;YAAwB,OAAOH;cAE9D,MACHC,SAAS,WAATA,GAAS,oBAACC,YAAUA;YAAC,WAAU;YAAoB,OAAOD;aAAa;AAIxF"}
@@ -3,7 +3,8 @@ import { defineExtension } from "../defineExtension/index.js";
3
3
  const DatabaseSetup = defineExtension({
4
4
  type: "Project/DatabaseSetup",
5
5
  tags: {
6
- runtimeContext: "project"
6
+ runtimeContext: "project",
7
+ hosting: "all"
7
8
  },
8
9
  description: "Define the database setup configuration (ddb, ddb+es, or ddb+os).",
9
10
  paramsSchema: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/DatabaseSetup.js","sources":["../../src/extensions/DatabaseSetup.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const DatabaseSetup = defineExtension({\n type: \"Project/DatabaseSetup\",\n tags: { runtimeContext: \"project\" },\n description: \"Define the database setup configuration (ddb, ddb+es, or ddb+os).\",\n paramsSchema: z.object({\n setupName: z\n .enum([\"ddb\", \"ddb+es\", \"ddb+os\"])\n .describe(\n \"The database setup type: ddb (DynamoDB only), ddb+es (DynamoDB + ElasticSearch), or ddb+os (DynamoDB + OpenSearch)\"\n )\n })\n});\n"],"names":["DatabaseSetup","defineExtension","z"],"mappings":";;AAGO,MAAMA,gBAAgBC,gBAAgB;IACzC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,WAAWA,CAAC,CAADA,OACF,CAAC;YAAC;YAAO;YAAU;SAAS,EAChC,QAAQ,CACL;IAEZ;AACJ"}
1
+ {"version":3,"file":"extensions/DatabaseSetup.js","sources":["../../src/extensions/DatabaseSetup.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const DatabaseSetup = defineExtension({\n type: \"Project/DatabaseSetup\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Define the database setup configuration (ddb, ddb+es, or ddb+os).\",\n paramsSchema: z.object({\n setupName: z\n .enum([\"ddb\", \"ddb+es\", \"ddb+os\"])\n .describe(\n \"The database setup type: ddb (DynamoDB only), ddb+es (DynamoDB + ElasticSearch), or ddb+os (DynamoDB + OpenSearch)\"\n )\n })\n});\n"],"names":["DatabaseSetup","defineExtension","z"],"mappings":";;AAGO,MAAMA,gBAAgBC,gBAAgB;IACzC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,WAAWA,CAAC,CAADA,OACF,CAAC;YAAC;YAAO;YAAU;SAAS,EAChC,QAAQ,CACL;IAEZ;AACJ"}
@@ -3,7 +3,8 @@ import { defineExtension } from "../defineExtension/index.js";
3
3
  const EnvVar = defineExtension({
4
4
  type: "Project/EnvVar",
5
5
  tags: {
6
- runtimeContext: "project"
6
+ runtimeContext: "project",
7
+ hosting: "all"
7
8
  },
8
9
  description: "Set an environment variable in the project context.",
9
10
  multiple: true,
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/EnvVar.js","sources":["../../src/extensions/EnvVar.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\n\n/**\n * Define an environment variable in the project context.\n */\nexport const EnvVar = defineExtension({\n type: \"Project/EnvVar\",\n tags: { runtimeContext: \"project\" },\n description: \"Set an environment variable in the project context.\",\n multiple: true,\n paramsSchema: z.object({\n // TODO: enable using `name` instead of `varName` for better consistency.\n varName: z.string().describe(\"The environment variable name.\"),\n value: z.string().describe(\"The environment variable value.\")\n })\n});\n"],"names":["EnvVar","defineExtension","z"],"mappings":";;AAMO,MAAMA,SAASC,gBAAgB;IAClC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,UAAU;IACV,cAAcC,EAAE,MAAM,CAAC;QAEnB,SAASA,EAAE,MAAM,GAAG,QAAQ,CAAC;QAC7B,OAAOA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B;AACJ"}
1
+ {"version":3,"file":"extensions/EnvVar.js","sources":["../../src/extensions/EnvVar.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\n\n/**\n * Define an environment variable in the project context.\n */\nexport const EnvVar = defineExtension({\n type: \"Project/EnvVar\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Set an environment variable in the project context.\",\n multiple: true,\n paramsSchema: z.object({\n // TODO: enable using `name` instead of `varName` for better consistency.\n varName: z.string().describe(\"The environment variable name.\"),\n value: z.string().describe(\"The environment variable value.\")\n })\n});\n"],"names":["EnvVar","defineExtension","z"],"mappings":";;AAMO,MAAMA,SAASC,gBAAgB;IAClC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,UAAU;IACV,cAAcC,EAAE,MAAM,CAAC;QAEnB,SAASA,EAAE,MAAM,GAAG,QAAQ,CAAC;QAC7B,OAAOA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B;AACJ"}
@@ -3,7 +3,8 @@ import { z } from "zod";
3
3
  const ExtensionDefinitions = defineExtension({
4
4
  type: "Project/ExtensionDefinitions",
5
5
  tags: {
6
- runtimeContext: "project"
6
+ runtimeContext: "project",
7
+ hosting: "all"
7
8
  },
8
9
  description: "Register additional extension definitions.",
9
10
  multiple: true,
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ExtensionDefinitions.js","sources":["../../src/extensions/ExtensionDefinitions.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { z } from \"zod\";\n\nexport const ExtensionDefinitions = defineExtension({\n type: \"Project/ExtensionDefinitions\",\n tags: { runtimeContext: \"project\" },\n description: \"Register additional extension definitions.\",\n multiple: true,\n paramsSchema: z.object({\n src: z.string()\n })\n});\n"],"names":["ExtensionDefinitions","defineExtension","z"],"mappings":";;AAGO,MAAMA,uBAAuBC,gBAAgB;IAChD,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,UAAU;IACV,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAE,MAAM;IACjB;AACJ"}
1
+ {"version":3,"file":"extensions/ExtensionDefinitions.js","sources":["../../src/extensions/ExtensionDefinitions.ts"],"sourcesContent":["import { defineExtension } from \"~/defineExtension/index.js\";\nimport { z } from \"zod\";\n\nexport const ExtensionDefinitions = defineExtension({\n type: \"Project/ExtensionDefinitions\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Register additional extension definitions.\",\n multiple: true,\n paramsSchema: z.object({\n src: z.string()\n })\n});\n"],"names":["ExtensionDefinitions","defineExtension","z"],"mappings":";;AAGO,MAAMA,uBAAuBC,gBAAgB;IAChD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,UAAU;IACV,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAE,MAAM;IACjB;AACJ"}
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  export declare const FeatureFlags: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
3
  features: z.ZodObject<{
4
4
  multiTenancy: z.ZodOptional<z.ZodBoolean>;
5
+ languages: z.ZodOptional<z.ZodBoolean>;
5
6
  advancedPublishingWorkflow: z.ZodOptional<z.ZodBoolean>;
6
7
  advancedAccessControlLayer: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
7
8
  teams: z.ZodOptional<z.ZodBoolean>;
@@ -23,6 +24,7 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
23
24
  imageEnrichment: z.ZodOptional<z.ZodBoolean>;
24
25
  }, z.core.$strip>>;
25
26
  lexicalGeneration: z.ZodOptional<z.ZodBoolean>;
27
+ adminAssistant: z.ZodOptional<z.ZodBoolean>;
26
28
  cms: z.ZodOptional<z.ZodObject<{
27
29
  entryGeneration: z.ZodOptional<z.ZodBoolean>;
28
30
  entryComparison: z.ZodOptional<z.ZodBoolean>;
@@ -30,6 +32,10 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
30
32
  }, z.core.$strip>>;
31
33
  }, z.core.$strip>]>>;
32
34
  abTesting: z.ZodOptional<z.ZodBoolean>;
33
- remoteComponents: z.ZodOptional<z.ZodBoolean>;
35
+ collaboration: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
36
+ comments: z.ZodOptional<z.ZodBoolean>;
37
+ activityLog: z.ZodOptional<z.ZodBoolean>;
38
+ }, z.core.$strip>]>>;
39
+ webhooks: z.ZodOptional<z.ZodBoolean>;
34
40
  }, z.core.$strip>;
35
41
  }, z.core.$strip>>;
@@ -7,12 +7,14 @@ import { setProjectFeatureFlags } from "../services/GetProjectConfigService/Feat
7
7
  const FeatureFlags = defineExtension({
8
8
  type: "FeatureFlags",
9
9
  tags: {
10
- runtimeContext: "project"
10
+ runtimeContext: "project",
11
+ hosting: "all"
11
12
  },
12
13
  description: "Enable or disable features.",
13
14
  paramsSchema: z.object({
14
15
  features: z.object({
15
16
  multiTenancy: z.boolean().optional(),
17
+ languages: z.boolean().optional(),
16
18
  advancedPublishingWorkflow: z.boolean().optional(),
17
19
  advancedAccessControlLayer: z.union([
18
20
  z.boolean(),
@@ -39,6 +41,7 @@ const FeatureFlags = defineExtension({
39
41
  imageEnrichment: z.boolean().optional()
40
42
  }).optional(),
41
43
  lexicalGeneration: z.boolean().optional(),
44
+ adminAssistant: z.boolean().optional(),
42
45
  cms: z.object({
43
46
  entryGeneration: z.boolean().optional(),
44
47
  entryComparison: z.boolean().optional(),
@@ -47,7 +50,14 @@ const FeatureFlags = defineExtension({
47
50
  })
48
51
  ]).optional(),
49
52
  abTesting: z.boolean().optional(),
50
- remoteComponents: z.boolean().optional()
53
+ collaboration: z.union([
54
+ z.boolean(),
55
+ z.object({
56
+ comments: z.boolean().optional(),
57
+ activityLog: z.boolean().optional()
58
+ })
59
+ ]).optional(),
60
+ webhooks: z.boolean().optional()
51
61
  })
52
62
  }),
53
63
  render: ({ features = {} })=>{
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/FeatureFlags.js","sources":["../../src/extensions/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\";\nimport { setProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\nexport const FeatureFlags = defineExtension({\n type: \"FeatureFlags\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable or disable 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 aiPowerups: z\n .union([\n z.boolean(),\n z.object({\n websiteBuilder: z\n .object({\n pageGeneration: z.boolean().optional(),\n pageTranslation: z.boolean().optional()\n })\n .optional(),\n fileManager: z\n .object({\n imageEnrichment: z.boolean().optional()\n })\n .optional(),\n lexicalGeneration: z.boolean().optional(),\n cms: z\n .object({\n entryGeneration: z.boolean().optional(),\n entryComparison: z.boolean().optional(),\n entryTranslation: z.boolean().optional()\n })\n .optional()\n })\n ])\n .optional(),\n abTesting: z.boolean().optional(),\n remoteComponents: z.boolean().optional()\n })\n }),\n render: ({ features = {} }) => {\n setProjectFeatureFlags(features);\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"names":["FeatureFlags","defineExtension","z","features","setProjectFeatureFlags","BuildParam","AdminBuildParam"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QAEnB,UAAUA,EAAE,MAAM,CAAC;YACf,cAAcA,EAAE,OAAO,GAAG,QAAQ;YAClC,4BAA4BA,EAAE,OAAO,GAAG,QAAQ;YAChD,4BAA4BA,EAAAA,KAClB,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,OAAOA,EAAE,OAAO,GAAG,QAAQ;oBAC3B,cAAcA,EAAE,OAAO,GAAG,QAAQ;oBAClC,wBAAwBA,EAAE,OAAO,GAAG,QAAQ;oBAC5C,sBAAsBA,EAAE,OAAO,GAAG,QAAQ;gBAC9C;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAE,OAAO,GAAG,QAAQ;YACnC,aAAaA,EAAAA,MACF,CAAC;gBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;YACzC,GACC,QAAQ;YACb,YAAYA,EAAAA,KACF,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,gBAAgBA,EAAAA,MACL,CAAC;wBACJ,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;wBACpC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,aAAaA,EAAAA,MACF,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,mBAAmBA,EAAE,OAAO,GAAG,QAAQ;oBACvC,KAAKA,EAAAA,MACM,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;oBAC1C,GACC,QAAQ;gBACjB;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;QAC1C;IACJ;IACA,QAAQ,CAAC,EAAEC,WAAW,CAAC,CAAC,EAAE;QACtBC,uBAAuBD;QACvB,OAAO,WAAP,GACI,wDACI,oBAACE,YAAUA;YAAC,WAAU;YAAe,OAAOF;0BAC5C,oBAACG,iBAAeA;YAAC,WAAU;YAAe,OAAOH;;IAG7D;AACJ"}
1
+ {"version":3,"file":"extensions/FeatureFlags.js","sources":["../../src/extensions/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\";\nimport { setProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\nexport const FeatureFlags = defineExtension({\n type: \"FeatureFlags\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Enable or disable 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 languages: 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 aiPowerups: z\n .union([\n z.boolean(),\n z.object({\n websiteBuilder: z\n .object({\n pageGeneration: z.boolean().optional(),\n pageTranslation: z.boolean().optional()\n })\n .optional(),\n fileManager: z\n .object({\n imageEnrichment: z.boolean().optional()\n })\n .optional(),\n lexicalGeneration: z.boolean().optional(),\n adminAssistant: z.boolean().optional(),\n cms: z\n .object({\n entryGeneration: z.boolean().optional(),\n entryComparison: z.boolean().optional(),\n entryTranslation: z.boolean().optional()\n })\n .optional()\n })\n ])\n .optional(),\n abTesting: z.boolean().optional(),\n collaboration: z\n .union([\n z.boolean(),\n z.object({\n comments: z.boolean().optional(),\n activityLog: z.boolean().optional()\n })\n ])\n .optional(),\n webhooks: z.boolean().optional()\n })\n }),\n render: ({ features = {} }) => {\n setProjectFeatureFlags(features);\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"names":["FeatureFlags","defineExtension","z","features","setProjectFeatureFlags","BuildParam","AdminBuildParam"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QAEnB,UAAUA,EAAE,MAAM,CAAC;YACf,cAAcA,EAAE,OAAO,GAAG,QAAQ;YAClC,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,4BAA4BA,EAAE,OAAO,GAAG,QAAQ;YAChD,4BAA4BA,EAAAA,KAClB,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,OAAOA,EAAE,OAAO,GAAG,QAAQ;oBAC3B,cAAcA,EAAE,OAAO,GAAG,QAAQ;oBAClC,wBAAwBA,EAAE,OAAO,GAAG,QAAQ;oBAC5C,sBAAsBA,EAAE,OAAO,GAAG,QAAQ;gBAC9C;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAE,OAAO,GAAG,QAAQ;YACnC,aAAaA,EAAAA,MACF,CAAC;gBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;YACzC,GACC,QAAQ;YACb,YAAYA,EAAAA,KACF,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,gBAAgBA,EAAAA,MACL,CAAC;wBACJ,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;wBACpC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,aAAaA,EAAAA,MACF,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,mBAAmBA,EAAE,OAAO,GAAG,QAAQ;oBACvC,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;oBACpC,KAAKA,EAAAA,MACM,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;oBAC1C,GACC,QAAQ;gBACjB;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAAA,KACL,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,UAAUA,EAAE,OAAO,GAAG,QAAQ;oBAC9B,aAAaA,EAAE,OAAO,GAAG,QAAQ;gBACrC;aACH,EACA,QAAQ;YACb,UAAUA,EAAE,OAAO,GAAG,QAAQ;QAClC;IACJ;IACA,QAAQ,CAAC,EAAEC,WAAW,CAAC,CAAC,EAAE;QACtBC,uBAAuBD;QACvB,OAAO,WAAP,GACI,wDACI,oBAACE,YAAUA;YAAC,WAAU;YAAe,OAAOF;0BAC5C,oBAACG,iBAAeA;YAAC,WAAU;YAAe,OAAOH;;IAG7D;AACJ"}
@@ -1,7 +1,7 @@
1
1
  import react, { useEffect } from "react";
2
2
  import { z } from "zod";
3
- import { defineExtension } from "../../defineExtension/index.js";
4
- import { useRegisterProductionEnvironments } from "../../services/GetProjectConfigService/ProductionEnvironmentsContext.js";
3
+ import { defineExtension } from "../defineExtension/index.js";
4
+ import { useRegisterProductionEnvironments } from "../services/GetProjectConfigService/ProductionEnvironmentsContext.js";
5
5
  const Registrar = ({ environments })=>{
6
6
  const setProdEnvs = useRegisterProductionEnvironments();
7
7
  useEffect(()=>{
@@ -12,7 +12,8 @@ const Registrar = ({ environments })=>{
12
12
  const ProductionEnvironments = defineExtension({
13
13
  type: "Infra/ProductionEnvironments",
14
14
  tags: {
15
- runtimeContext: "project"
15
+ runtimeContext: "project",
16
+ hosting: "aws"
16
17
  },
17
18
  description: "Provide names for environments that are considered production environments.",
18
19
  paramsSchema: z.object({
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProductionEnvironments.js","sources":["../../src/extensions/ProductionEnvironments.ts"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { useRegisterProductionEnvironments } from \"~/services/GetProjectConfigService/ProductionEnvironmentsContext.js\";\n\ninterface RegistrarProps {\n environments: string[];\n}\n\nconst Registrar: React.FC<RegistrarProps> = ({ environments }) => {\n const setProdEnvs = useRegisterProductionEnvironments();\n useEffect(() => {\n if (setProdEnvs) {\n setProdEnvs(environments);\n }\n }, []);\n return null;\n};\n\nexport const ProductionEnvironments = defineExtension({\n type: \"Infra/ProductionEnvironments\",\n tags: { runtimeContext: \"project\", hosting: \"aws\" },\n description: \"Provide names for environments that are considered production environments.\",\n paramsSchema: z.object({\n environments: z.array(\n z.string().superRefine((value, ctx) => {\n if (!value) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Environment name cannot be empty.\"\n });\n return;\n }\n\n // Must allow only letters, numbers, dashes, and underscores.\n if (!/^[a-zA-Z0-9-_]+$/.test(value)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"Environment name can only contain letters, numbers, dashes, and underscores.\"\n });\n }\n })\n )\n }),\n render: props => React.createElement(Registrar, { environments: props.environments })\n});\n"],"names":["Registrar","environments","setProdEnvs","useRegisterProductionEnvironments","useEffect","ProductionEnvironments","defineExtension","z","value","ctx","props","React"],"mappings":";;;;AASA,MAAMA,YAAsC,CAAC,EAAEC,YAAY,EAAE;IACzD,MAAMC,cAAcC;IACpBC,UAAU;QACN,IAAIF,aACAA,YAAYD;IAEpB,GAAG,EAAE;IACL,OAAO;AACX;AAEO,MAAMI,yBAAyBC,gBAAgB;IAClD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,cAAcA,EAAE,KAAK,CACjBA,EAAE,MAAM,GAAG,WAAW,CAAC,CAACC,OAAOC;YAC3B,IAAI,CAACD,OAAO,YACRC,IAAI,QAAQ,CAAC;gBACT,MAAMF,EAAE,YAAY,CAAC,MAAM;gBAC3B,SAAS;YACb;YAKJ,IAAI,CAAC,mBAAmB,IAAI,CAACC,QACzBC,IAAI,QAAQ,CAAC;gBACT,MAAMF,EAAE,YAAY,CAAC,MAAM;gBAC3B,SACI;YACR;QAER;IAER;IACA,QAAQG,CAAAA,QAASC,MAAAA,aAAmB,CAACX,WAAW;YAAE,cAAcU,MAAM,YAAY;QAAC;AACvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Project/WcpInjectTelemetryClientAfterBuild.js","sources":["../../../src/extensions/Project/WcpInjectTelemetryClientAfterBuild.ts"],"sourcesContent":["import {\n ApiAfterBuild,\n GetApp,\n GetProjectIdService,\n LoggerService,\n UiService,\n WcpService\n} from \"~/abstractions/index.js\";\nimport fs from \"fs\";\n\nclass WcpInjectTelemetryClientAfterBuildImpl implements ApiAfterBuild.Interface {\n constructor(\n private getProjectIdService: GetProjectIdService.Interface,\n private wcpService: WcpService.Interface,\n private loggerService: LoggerService.Interface,\n private getApp: GetApp.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectId = await this.getProjectIdService.execute();\n if (!projectId) {\n return;\n }\n\n const logger = this.loggerService;\n const ui = this.uiService;\n\n logger.info(\"Injecting WCP telemetry client into the GraphQL API handler...\");\n\n const app = this.getApp.execute(\"api\");\n\n // Only wrap the GraphQL API handler with the telemetry client.\n const handlersPaths = [app.paths.workspaceFolder.join(\"graphql\", \"build\")];\n\n // 1. Download telemetry client code.\n const latestTelemetryClientUrl = this.wcpService\n .getWcpApiUrl()\n .join(\"/clients/latest.mjs\")\n .toString();\n\n try {\n logger.info(`Downloading telemetry client from: ${latestTelemetryClientUrl}`);\n const response = await fetch(latestTelemetryClientUrl);\n if (!response.ok) {\n throw new Error(\n `Failed to download telemetry client: ${response.status} - ${response.statusText}`\n );\n }\n\n const telemetryCodeAsString = await response.text();\n\n // The downloaded wrapper re-exports only `handler`, but the AWS api bundle also exports\n // `streamHandler` — the entry point of the response-streaming Lambda. Without this\n // re-export that function has no handler to load and fails at cold start.\n //\n // Two constraints shape how it's done:\n //\n // 1. UNWRAPPED. `streamHandler` carries the marker `awslambda.streamifyResponse` attaches,\n // and the runtime inspects the exported function for it; routing it through a telemetry\n // wrapper function would strip the marker and silently downgrade the function to\n // buffered responses. Re-exporting the same function object keeps the marker — at the\n // cost of no telemetry for that function, which is the right trade.\n //\n // 2. Via a NAMESPACE import, not `export { streamHandler } from ...`. This injection also\n // runs for the self-hosted api build, whose bundle has no `streamHandler` (streaming is\n // native there, with no Lambda involved), and a named re-export of a missing binding is\n // a hard ESM error that would break the whole handler. A namespace access just yields\n // `undefined`, which nothing on that path reads.\n //\n // BACKLOGGED, not settled. String-appending to an artifact downloaded from another repo\n // means a change to the shape of `clients/latest.mjs` breaks the build on customers'\n // machines. The agreed fix is one line on the WCP side — `export * from \"./_handler.mjs\"`\n // right after that file's own import, which passes through every bundle export unwrapped\n // (the explicit `export { handler }` still shadows the star, and `export *` re-exports\n // nothing on the self-hosted bundle). When that ships, this whole append goes away.\n const wrapperCode =\n telemetryCodeAsString +\n '\\nimport * as _webinyBuiltHandlers from \"./_handler.mjs\";\\n' +\n \"export const streamHandler = _webinyBuiltHandlers.streamHandler;\\n\";\n\n // 2. Wrap the initially built code with the telemetry client code.\n for (let i = 0; i < handlersPaths.length; i++) {\n const current = handlersPaths[i];\n\n // 2.1 Move initially built `handler.mjs` into `_handler.mjs`.\n const builtHandlerPath = current.join(\"handler.mjs\").toString();\n const renamedHandlerPath = current.join(\"_handler.mjs\").toString();\n fs.renameSync(builtHandlerPath, renamedHandlerPath);\n\n // 2.2 Write downloaded telemetry client code as a new `handler.js`.\n fs.writeFileSync(builtHandlerPath, wrapperCode);\n }\n\n logger.info(\"WCP telemetry client injected successfully.\");\n } catch (err) {\n logger.debug({ err }, \"WCP client is unavailable; telemetry was disabled.\");\n ui.warning(`WCP client is unavailable; telemetry was disabled.`);\n }\n }\n}\n\nexport const WcpInjectTelemetryClientAfterBuild = ApiAfterBuild.createImplementation({\n implementation: WcpInjectTelemetryClientAfterBuildImpl,\n dependencies: [GetProjectIdService, WcpService, LoggerService, GetApp, UiService]\n});\n"],"names":["WcpInjectTelemetryClientAfterBuildImpl","getProjectIdService","wcpService","loggerService","getApp","uiService","projectId","logger","ui","app","handlersPaths","latestTelemetryClientUrl","response","fetch","Error","telemetryCodeAsString","wrapperCode","i","current","builtHandlerPath","renamedHandlerPath","fs","err","WcpInjectTelemetryClientAfterBuild","ApiAfterBuild","GetProjectIdService","WcpService","LoggerService","GetApp","UiService"],"mappings":";;AAUA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,UAAgC,EAChCC,aAAsC,EACtCC,MAAwB,EACxBC,SAA8B,CACxC;aALUJ,mBAAmB,GAAnBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,YAAY,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QACxD,IAAI,CAACA,WACD;QAGJ,MAAMC,SAAS,IAAI,CAAC,aAAa;QACjC,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzBD,OAAO,IAAI,CAAC;QAEZ,MAAME,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAGhC,MAAMC,gBAAgB;YAACD,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;SAAS;QAG1E,MAAME,2BAA2B,IAAI,CAAC,UAAU,CAC3C,YAAY,GACZ,IAAI,CAAC,uBACL,QAAQ;QAEb,IAAI;YACAJ,OAAO,IAAI,CAAC,CAAC,mCAAmC,EAAEI,0BAA0B;YAC5E,MAAMC,WAAW,MAAMC,MAAMF;YAC7B,IAAI,CAACC,SAAS,EAAE,EACZ,MAAM,IAAIE,MACN,CAAC,qCAAqC,EAAEF,SAAS,MAAM,CAAC,GAAG,EAAEA,SAAS,UAAU,EAAE;YAI1F,MAAMG,wBAAwB,MAAMH,SAAS,IAAI;YA0BjD,MAAMI,cACFD,wBAAAA;YAKJ,IAAK,IAAIE,IAAI,GAAGA,IAAIP,cAAc,MAAM,EAAEO,IAAK;gBAC3C,MAAMC,UAAUR,aAAa,CAACO,EAAE;gBAGhC,MAAME,mBAAmBD,QAAQ,IAAI,CAAC,eAAe,QAAQ;gBAC7D,MAAME,qBAAqBF,QAAQ,IAAI,CAAC,gBAAgB,QAAQ;gBAChEG,GAAG,UAAU,CAACF,kBAAkBC;gBAGhCC,GAAG,aAAa,CAACF,kBAAkBH;YACvC;YAEAT,OAAO,IAAI,CAAC;QAChB,EAAE,OAAOe,KAAK;YACVf,OAAO,KAAK,CAAC;gBAAEe;YAAI,GAAG;YACtBd,GAAG,OAAO,CAAC;QACf;IACJ;AACJ;AAEO,MAAMe,qCAAqCC,cAAc,oBAAoB,CAAC;IACjF,gBAAgBxB;IAChB,cAAc;QAACyB;QAAqBC;QAAYC;QAAeC;QAAQC;KAAU;AACrF"}
1
+ {"version":3,"file":"extensions/Project/WcpInjectTelemetryClientAfterBuild.js","sources":["../../../src/extensions/Project/WcpInjectTelemetryClientAfterBuild.ts"],"sourcesContent":["import {\n ApiAfterBuild,\n GetApp,\n GetProjectIdService,\n LoggerService,\n UiService,\n WcpService\n} from \"~/abstractions/index.js\";\nimport fs from \"fs\";\n\nclass WcpInjectTelemetryClientAfterBuildImpl implements ApiAfterBuild.Interface {\n constructor(\n private getProjectIdService: GetProjectIdService.Interface,\n private wcpService: WcpService.Interface,\n private loggerService: LoggerService.Interface,\n private getApp: GetApp.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectId = await this.getProjectIdService.execute();\n if (!projectId) {\n return;\n }\n\n const logger = this.loggerService;\n const ui = this.uiService;\n\n logger.info(\"Injecting WCP telemetry client into the GraphQL API handler...\");\n\n const app = this.getApp.execute(\"api\");\n\n // Only wrap the GraphQL API handler with the telemetry client.\n const handlersPaths = [app.paths.workspaceFolder.join(\"graphql\", \"build\")];\n\n // 1. Download telemetry client code.\n const latestTelemetryClientUrl = this.wcpService\n .getWcpApiUrl()\n .join(\"/clients/latest.mjs\")\n .toString();\n\n try {\n logger.info(`Downloading telemetry client from: ${latestTelemetryClientUrl}`);\n const response = await fetch(latestTelemetryClientUrl);\n if (!response.ok) {\n throw new Error(\n `Failed to download telemetry client: ${response.status} - ${response.statusText}`\n );\n }\n\n const telemetryCodeAsString = await response.text();\n\n // The downloaded wrapper re-exports only `handler`, but the AWS api bundle also exports\n // `streamHandler` — the entry point of the response-streaming Lambda. Without this\n // re-export that function has no handler to load and fails at cold start.\n //\n // Two constraints shape how it's done:\n //\n // 1. UNWRAPPED. `streamHandler` carries the marker `awslambda.streamifyResponse` attaches,\n // and the runtime inspects the exported function for it; routing it through a telemetry\n // wrapper function would strip the marker and silently downgrade the function to\n // buffered responses. Re-exporting the same function object keeps the marker — at the\n // cost of no telemetry for that function, which is the right trade.\n //\n // 2. Via a NAMESPACE import, not `export { streamHandler } from ...`. This injection also\n // runs for the standalone api build, whose bundle has no `streamHandler` (streaming is\n // native there, with no Lambda involved), and a named re-export of a missing binding is\n // a hard ESM error that would break the whole handler. A namespace access just yields\n // `undefined`, which nothing on that path reads.\n //\n // BACKLOGGED, not settled. String-appending to an artifact downloaded from another repo\n // means a change to the shape of `clients/latest.mjs` breaks the build on customers'\n // machines. The agreed fix is one line on the WCP side — `export * from \"./_handler.mjs\"`\n // right after that file's own import, which passes through every bundle export unwrapped\n // (the explicit `export { handler }` still shadows the star, and `export *` re-exports\n // nothing on the standalone bundle). When that ships, this whole append goes away.\n const wrapperCode =\n telemetryCodeAsString +\n '\\nimport * as _webinyBuiltHandlers from \"./_handler.mjs\";\\n' +\n \"export const streamHandler = _webinyBuiltHandlers.streamHandler;\\n\";\n\n // 2. Wrap the initially built code with the telemetry client code.\n for (let i = 0; i < handlersPaths.length; i++) {\n const current = handlersPaths[i];\n\n // 2.1 Move initially built `handler.mjs` into `_handler.mjs`.\n const builtHandlerPath = current.join(\"handler.mjs\").toString();\n const renamedHandlerPath = current.join(\"_handler.mjs\").toString();\n fs.renameSync(builtHandlerPath, renamedHandlerPath);\n\n // 2.2 Write downloaded telemetry client code as a new `handler.js`.\n fs.writeFileSync(builtHandlerPath, wrapperCode);\n }\n\n logger.info(\"WCP telemetry client injected successfully.\");\n } catch (err) {\n logger.debug({ err }, \"WCP client is unavailable; telemetry was disabled.\");\n ui.warning(`WCP client is unavailable; telemetry was disabled.`);\n }\n }\n}\n\nexport const WcpInjectTelemetryClientAfterBuild = ApiAfterBuild.createImplementation({\n implementation: WcpInjectTelemetryClientAfterBuildImpl,\n dependencies: [GetProjectIdService, WcpService, LoggerService, GetApp, UiService]\n});\n"],"names":["WcpInjectTelemetryClientAfterBuildImpl","getProjectIdService","wcpService","loggerService","getApp","uiService","projectId","logger","ui","app","handlersPaths","latestTelemetryClientUrl","response","fetch","Error","telemetryCodeAsString","wrapperCode","i","current","builtHandlerPath","renamedHandlerPath","fs","err","WcpInjectTelemetryClientAfterBuild","ApiAfterBuild","GetProjectIdService","WcpService","LoggerService","GetApp","UiService"],"mappings":";;AAUA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,UAAgC,EAChCC,aAAsC,EACtCC,MAAwB,EACxBC,SAA8B,CACxC;aALUJ,mBAAmB,GAAnBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,YAAY,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QACxD,IAAI,CAACA,WACD;QAGJ,MAAMC,SAAS,IAAI,CAAC,aAAa;QACjC,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzBD,OAAO,IAAI,CAAC;QAEZ,MAAME,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAGhC,MAAMC,gBAAgB;YAACD,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;SAAS;QAG1E,MAAME,2BAA2B,IAAI,CAAC,UAAU,CAC3C,YAAY,GACZ,IAAI,CAAC,uBACL,QAAQ;QAEb,IAAI;YACAJ,OAAO,IAAI,CAAC,CAAC,mCAAmC,EAAEI,0BAA0B;YAC5E,MAAMC,WAAW,MAAMC,MAAMF;YAC7B,IAAI,CAACC,SAAS,EAAE,EACZ,MAAM,IAAIE,MACN,CAAC,qCAAqC,EAAEF,SAAS,MAAM,CAAC,GAAG,EAAEA,SAAS,UAAU,EAAE;YAI1F,MAAMG,wBAAwB,MAAMH,SAAS,IAAI;YA0BjD,MAAMI,cACFD,wBAAAA;YAKJ,IAAK,IAAIE,IAAI,GAAGA,IAAIP,cAAc,MAAM,EAAEO,IAAK;gBAC3C,MAAMC,UAAUR,aAAa,CAACO,EAAE;gBAGhC,MAAME,mBAAmBD,QAAQ,IAAI,CAAC,eAAe,QAAQ;gBAC7D,MAAME,qBAAqBF,QAAQ,IAAI,CAAC,gBAAgB,QAAQ;gBAChEG,GAAG,UAAU,CAACF,kBAAkBC;gBAGhCC,GAAG,aAAa,CAACF,kBAAkBH;YACvC;YAEAT,OAAO,IAAI,CAAC;QAChB,EAAE,OAAOe,KAAK;YACVf,OAAO,KAAK,CAAC;gBAAEe;YAAI,GAAG;YACtBd,GAAG,OAAO,CAAC;QACf;IACJ;AACJ;AAEO,MAAMe,qCAAqCC,cAAc,oBAAoB,CAAC;IACjF,gBAAgBxB;IAChB,cAAc;QAACyB;QAAqBC;QAAYC;QAAeC;QAAQC;KAAU;AACrF"}
@@ -1,7 +1,7 @@
1
1
  import { type UiService } from "../../abstractions/index.js";
2
2
  /**
3
3
  * The "restart the watch command" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a
4
- * single `webiny watch` can now cover several apps in one process — self-hosted watches api and admin
4
+ * single `webiny watch` can now cover several apps in one process — standalone watches api and admin
5
5
  * together. The message is identical either way, so print it once per process instead of once per app.
6
6
  */
7
7
  export declare const showConfigChangeNotice: (ui: UiService.Interface) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Project/showConfigChangeNotice.js","sources":["../../../src/extensions/Project/showConfigChangeNotice.ts"],"sourcesContent":["import { type UiService } from \"~/abstractions/index.js\";\n\nlet shown = false;\n\n/**\n * The \"restart the watch command\" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a\n * single `webiny watch` can now cover several apps in one process — self-hosted watches api and admin\n * together. The message is identical either way, so print it once per process instead of once per app.\n */\nexport const showConfigChangeNotice = (ui: UiService.Interface) => {\n if (shown) {\n return;\n }\n\n shown = true;\n\n ui.info(\n [\n \"Changes done in %s are not reloaded automatically.\",\n \"You'll have to restart the watch command in order for your changes to take effect.\"\n ].join(\" \"),\n \"webiny.config.tsx\"\n );\n};\n"],"names":["shown","showConfigChangeNotice","ui"],"mappings":"AAEA,IAAIA,QAAQ;AAOL,MAAMC,yBAAyB,CAACC;IACnC,IAAIF,OACA;IAGJA,QAAQ;IAERE,GAAG,IAAI,CACH,yIAIA;AAER"}
1
+ {"version":3,"file":"extensions/Project/showConfigChangeNotice.js","sources":["../../../src/extensions/Project/showConfigChangeNotice.ts"],"sourcesContent":["import { type UiService } from \"~/abstractions/index.js\";\n\nlet shown = false;\n\n/**\n * The \"restart the watch command\" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a\n * single `webiny watch` can now cover several apps in one process — standalone watches api and admin\n * together. The message is identical either way, so print it once per process instead of once per app.\n */\nexport const showConfigChangeNotice = (ui: UiService.Interface) => {\n if (shown) {\n return;\n }\n\n shown = true;\n\n ui.info(\n [\n \"Changes done in %s are not reloaded automatically.\",\n \"You'll have to restart the watch command in order for your changes to take effect.\"\n ].join(\" \"),\n \"webiny.config.tsx\"\n );\n};\n"],"names":["shown","showConfigChangeNotice","ui"],"mappings":"AAEA,IAAIA,QAAQ;AAOL,MAAMC,yBAAyB,CAACC;IACnC,IAAIF,OACA;IAGJA,QAAQ;IAERE,GAAG,IAAI,CACH,yIAIA;AAER"}
@@ -4,7 +4,8 @@ import { zodSrcPath } from "../defineExtension/zodTypes/zodSrcPath.js";
4
4
  const ProjectDecorator = defineExtension({
5
5
  type: "Project/Decorator",
6
6
  tags: {
7
- runtimeContext: "project"
7
+ runtimeContext: "project",
8
+ hosting: "all"
8
9
  },
9
10
  multiple: true,
10
11
  description: "Decorate an existing implementation with additional functionality.",
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectDecorator.js","sources":["../../src/extensions/ProjectDecorator.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\nimport { zodSrcPath } from \"../defineExtension/zodTypes/zodSrcPath.js\";\n\nexport const ProjectDecorator = defineExtension({\n type: \"Project/Decorator\",\n tags: { runtimeContext: \"project\" },\n multiple: true,\n description: \"Decorate an existing implementation with additional functionality.\",\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project })\n });\n }\n});\n"],"names":["ProjectDecorator","defineExtension","project","z","zodSrcPath"],"mappings":";;;AAIO,MAAMA,mBAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,UAAU;IACV,aAAa;IACb,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;QAC9B;AAER"}
1
+ {"version":3,"file":"extensions/ProjectDecorator.js","sources":["../../src/extensions/ProjectDecorator.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\nimport { zodSrcPath } from \"../defineExtension/zodTypes/zodSrcPath.js\";\n\nexport const ProjectDecorator = defineExtension({\n type: \"Project/Decorator\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n multiple: true,\n description: \"Decorate an existing implementation with additional functionality.\",\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project })\n });\n }\n});\n"],"names":["ProjectDecorator","defineExtension","project","z","zodSrcPath"],"mappings":";;;AAIO,MAAMA,mBAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,UAAU;IACV,aAAa;IACb,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;QAC9B;AAER"}
@@ -3,7 +3,8 @@ import { defineExtension } from "../defineExtension/index.js";
3
3
  const ProjectId = defineExtension({
4
4
  type: "Project/ProjectId",
5
5
  tags: {
6
- runtimeContext: "project"
6
+ runtimeContext: "project",
7
+ hosting: "all"
7
8
  },
8
9
  description: "An extension for defining the project ID.",
9
10
  paramsSchema: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectId.js","sources":["../../src/extensions/ProjectId.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const ProjectId = defineExtension({\n type: \"Project/ProjectId\",\n tags: { runtimeContext: \"project\" },\n description: \"An extension for defining the project ID.\",\n paramsSchema: z.object({\n id: z.string().refine(\n value => {\n // Allow only alphanumeric characters, dashes, underscores, no spaces, and forward slashes.\n return /^[a-zA-Z0-9-_/]+$/.test(value);\n },\n {\n message:\n \"Project ID can only contain alphanumeric characters, dashes, underscores, and forward slashes.\"\n }\n )\n })\n});\n"],"names":["ProjectId","defineExtension","z","value"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,IAAIA,EAAE,MAAM,GAAG,MAAM,CACjBC,CAAAA,QAEW,oBAAoB,IAAI,CAACA,QAEpC;YACI,SACI;QACR;IAER;AACJ"}
1
+ {"version":3,"file":"extensions/ProjectId.js","sources":["../../src/extensions/ProjectId.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\n\nexport const ProjectId = defineExtension({\n type: \"Project/ProjectId\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"An extension for defining the project ID.\",\n paramsSchema: z.object({\n id: z.string().refine(\n value => {\n // Allow only alphanumeric characters, dashes, underscores, no spaces, and forward slashes.\n return /^[a-zA-Z0-9-_/]+$/.test(value);\n },\n {\n message:\n \"Project ID can only contain alphanumeric characters, dashes, underscores, and forward slashes.\"\n }\n )\n })\n});\n"],"names":["ProjectId","defineExtension","z","value"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,IAAIA,EAAE,MAAM,GAAG,MAAM,CACjBC,CAAAA,QAEW,oBAAoB,IAAI,CAACA,QAEpC;YACI,SACI;QACR;IAER;AACJ"}
@@ -4,7 +4,8 @@ import { zodSrcPath } from "../defineExtension/zodTypes/zodSrcPath.js";
4
4
  const ProjectImplementation = defineExtension({
5
5
  type: "Project/Implementation",
6
6
  tags: {
7
- runtimeContext: "project"
7
+ runtimeContext: "project",
8
+ hosting: "all"
8
9
  },
9
10
  multiple: true,
10
11
  description: "Define a custom implementation or replace an existing one.",
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectImplementation.js","sources":["../../src/extensions/ProjectImplementation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\nimport { zodSrcPath } from \"../defineExtension/zodTypes/zodSrcPath.js\";\n\nexport const ProjectImplementation = defineExtension({\n type: \"Project/Implementation\",\n tags: { runtimeContext: \"project\" },\n multiple: true,\n description: \"Define a custom implementation or replace an existing one.\",\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n singleton: z.boolean().optional().default(true)\n });\n }\n});\n"],"names":["ProjectImplementation","defineExtension","project","z","zodSrcPath"],"mappings":";;;AAIO,MAAMA,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,UAAU;IACV,aAAa;IACb,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,WAAWC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;QAC9C;AAER"}
1
+ {"version":3,"file":"extensions/ProjectImplementation.js","sources":["../../src/extensions/ProjectImplementation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/index.js\";\nimport { zodSrcPath } from \"../defineExtension/zodTypes/zodSrcPath.js\";\n\nexport const ProjectImplementation = defineExtension({\n type: \"Project/Implementation\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n multiple: true,\n description: \"Define a custom implementation or replace an existing one.\",\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n singleton: z.boolean().optional().default(true)\n });\n }\n});\n"],"names":["ProjectImplementation","defineExtension","project","z","zodSrcPath"],"mappings":";;;AAIO,MAAMA,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,UAAU;IACV,aAAa;IACb,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,KAAKC,WAAW;gBAAEF;YAAQ;YAC1B,WAAWC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;QAC9C;AAER"}
@@ -3,7 +3,8 @@ import { defineExtension } from "../defineExtension/defineExtension.js";
3
3
  const Telemetry = defineExtension({
4
4
  type: "Project/Telemetry",
5
5
  tags: {
6
- runtimeContext: "project"
6
+ runtimeContext: "project",
7
+ hosting: "all"
7
8
  },
8
9
  description: "This extension allows you to enable or disable telemetry for the project.",
9
10
  paramsSchema: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Telemetry.js","sources":["../../src/extensions/Telemetry.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/defineExtension.js\";\n\nexport const Telemetry = defineExtension({\n type: \"Project/Telemetry\",\n tags: { runtimeContext: \"project\" },\n description: \"This extension allows you to enable or disable telemetry for the project.\",\n paramsSchema: z.object({\n enabled: z.boolean().default(true)\n })\n});\n"],"names":["Telemetry","defineExtension","z"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,SAASA,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC;AACJ"}
1
+ {"version":3,"file":"extensions/Telemetry.js","sources":["../../src/extensions/Telemetry.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"../defineExtension/defineExtension.js\";\n\nexport const Telemetry = defineExtension({\n type: \"Project/Telemetry\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"This extension allows you to enable or disable telemetry for the project.\",\n paramsSchema: z.object({\n enabled: z.boolean().default(true)\n })\n});\n"],"names":["Telemetry","defineExtension","z"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,SAASA,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC;AACJ"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const BackgroundTasks: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ retentionDays: z.ZodNumber;
4
+ }, z.core.$strip>>;
@@ -0,0 +1,25 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "../../defineExtension/index.js";
4
+ import { BuildParam } from "../ApiBuildParam.js";
5
+ const paramsSchema = z.object({
6
+ retentionDays: z.number().int().min(0).max(3650).describe("Default retention period (in days) for completed background task runs. 0 = never delete. Max 3650.")
7
+ });
8
+ const BackgroundTasks = defineExtension({
9
+ type: "Api/BackgroundTasks",
10
+ tags: {
11
+ runtimeContext: "project",
12
+ hosting: "all"
13
+ },
14
+ description: "Configure default settings for background tasks. The retention value is used as the default when no admin has explicitly set a value via the Settings UI.",
15
+ paramsSchema: paramsSchema,
16
+ render (params) {
17
+ return /*#__PURE__*/ react.createElement(BuildParam, {
18
+ paramName: "BackgroundTasks.RetentionDays",
19
+ value: params.retentionDays
20
+ });
21
+ }
22
+ });
23
+ export { BackgroundTasks };
24
+
25
+ //# sourceMappingURL=BackgroundTasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/api/BackgroundTasks.js","sources":["../../../src/extensions/api/BackgroundTasks.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n retentionDays: z\n .number()\n .int()\n .min(0)\n .max(3650)\n .describe(\n \"Default retention period (in days) for completed background task runs. 0 = never delete. Max 3650.\"\n )\n});\n\nexport const BackgroundTasks = defineExtension({\n type: \"Api/BackgroundTasks\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Configure default settings for background tasks. The retention value is used as the default when no admin has explicitly set a value via the Settings UI.\",\n paramsSchema,\n render(params) {\n return (\n <BuildParam paramName=\"BackgroundTasks.RetentionDays\" value={params.retentionDays} />\n );\n }\n});\n"],"names":["paramsSchema","z","BackgroundTasks","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,eAAeA,EAAAA,MACJ,GACN,GAAG,GACH,GAAG,CAAC,GACJ,GAAG,CAAC,MACJ,QAAQ,CACL;AAEZ;AAEO,MAAMC,kBAAkBC,gBAAgB;IAC3C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH,cAAAA;IACA,QAAOI,MAAM;QACT,OAAO,WAAP,GACI,oBAACC,YAAUA;YAAC,WAAU;YAAgC,OAAOD,OAAO,aAAa;;IAEzF;AACJ"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const ModelFieldCompression: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ enabled: z.ZodBoolean;
4
+ }, z.core.$strip>>;
@@ -0,0 +1,25 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "../../../defineExtension/index.js";
4
+ import { BuildParam } from "../../ApiBuildParam.js";
5
+ const paramsSchema = z.object({
6
+ enabled: z.boolean().describe("Enable compression of model fields before storing in the database.")
7
+ });
8
+ const ModelFieldCompression = defineExtension({
9
+ type: "Api/Cms/ModelFieldCompression",
10
+ tags: {
11
+ runtimeContext: "project",
12
+ hosting: "all"
13
+ },
14
+ description: "Enable or disable compression of Headless CMS model fields at the database storage level.",
15
+ paramsSchema: paramsSchema,
16
+ render (params) {
17
+ return /*#__PURE__*/ react.createElement(BuildParam, {
18
+ paramName: "ContentModelFieldCompression",
19
+ value: params.enabled
20
+ });
21
+ }
22
+ });
23
+ export { ModelFieldCompression };
24
+
25
+ //# sourceMappingURL=ModelFieldCompression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/api/Cms/ModelFieldCompression.js","sources":["../../../../src/extensions/api/Cms/ModelFieldCompression.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n enabled: z\n .boolean()\n .describe(\"Enable compression of model fields before storing in the database.\")\n});\n\nexport const ModelFieldCompression = defineExtension({\n type: \"Api/Cms/ModelFieldCompression\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Enable or disable compression of Headless CMS model fields at the database storage level.\",\n paramsSchema,\n render(params) {\n return <BuildParam paramName=\"ContentModelFieldCompression\" value={params.enabled} />;\n }\n});\n"],"names":["paramsSchema","z","ModelFieldCompression","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,SAASA,EAAAA,OACG,GACP,QAAQ,CAAC;AAClB;AAEO,MAAMC,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH,cAAAA;IACA,QAAOI,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAA+B,OAAOD,OAAO,OAAO;;IACrF;AACJ"}