@webiny/project 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e

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 (1021) hide show
  1. package/GracefulError.js +13 -15
  2. package/GracefulError.js.map +1 -1
  3. package/ProjectError.js +11 -13
  4. package/ProjectError.js.map +1 -1
  5. package/ProjectSdk.d.ts +7 -5
  6. package/ProjectSdk.js +120 -129
  7. package/ProjectSdk.js.map +1 -1
  8. package/abstractions/createAbstraction.js +3 -2
  9. package/abstractions/createAbstraction.js.map +1 -1
  10. package/abstractions/features/BuildApp.js +2 -1
  11. package/abstractions/features/BuildApp.js.map +1 -1
  12. package/abstractions/features/BuildExtension.js +2 -1
  13. package/abstractions/features/BuildExtension.js.map +1 -1
  14. package/abstractions/features/DeployApp.d.ts +2 -2
  15. package/abstractions/features/DeployApp.js +2 -1
  16. package/abstractions/features/DeployApp.js.map +1 -1
  17. package/abstractions/features/DestroyApp.d.ts +4 -4
  18. package/abstractions/features/DestroyApp.js +2 -1
  19. package/abstractions/features/DestroyApp.js.map +1 -1
  20. package/abstractions/features/ExportStack.js +2 -1
  21. package/abstractions/features/ExportStack.js.map +1 -1
  22. package/abstractions/features/GetApp.js +2 -1
  23. package/abstractions/features/GetApp.js.map +1 -1
  24. package/abstractions/features/GetAppOutput.d.ts +2 -2
  25. package/abstractions/features/GetAppOutput.js +2 -1
  26. package/abstractions/features/GetAppOutput.js.map +1 -1
  27. package/abstractions/features/GetAppStackOutput.js +2 -6
  28. package/abstractions/features/GetAppStackOutput.js.map +1 -1
  29. package/abstractions/features/GetFeatureFlags.js +2 -1
  30. package/abstractions/features/GetFeatureFlags.js.map +1 -1
  31. package/abstractions/features/GetLogger.js +2 -1
  32. package/abstractions/features/GetLogger.js.map +1 -1
  33. package/abstractions/features/GetProductionEnvironments.js +2 -1
  34. package/abstractions/features/GetProductionEnvironments.js.map +1 -1
  35. package/abstractions/features/GetProject.js +2 -1
  36. package/abstractions/features/GetProject.js.map +1 -1
  37. package/abstractions/features/GetProjectConfig.js +2 -1
  38. package/abstractions/features/GetProjectConfig.js.map +1 -1
  39. package/abstractions/features/GetProjectInfo.js +2 -1
  40. package/abstractions/features/GetProjectInfo.js.map +1 -1
  41. package/abstractions/features/GetPulumiResourceNamePrefix.js +2 -1
  42. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -1
  43. package/abstractions/features/InstallExtension.js +2 -1
  44. package/abstractions/features/InstallExtension.js.map +1 -1
  45. package/abstractions/features/IsCi.js +2 -1
  46. package/abstractions/features/IsCi.js.map +1 -1
  47. package/abstractions/features/IsTelemetryEnabled.js +2 -1
  48. package/abstractions/features/IsTelemetryEnabled.js.map +1 -1
  49. package/abstractions/features/IsWcpEnabled.js +2 -1
  50. package/abstractions/features/IsWcpEnabled.js.map +1 -1
  51. package/abstractions/features/IsWebinyJsRepo.js +2 -1
  52. package/abstractions/features/IsWebinyJsRepo.js.map +1 -1
  53. package/abstractions/features/RefreshApp.d.ts +2 -2
  54. package/abstractions/features/RefreshApp.js +2 -1
  55. package/abstractions/features/RefreshApp.js.map +1 -1
  56. package/abstractions/features/RunPulumiCommand.d.ts +2 -2
  57. package/abstractions/features/RunPulumiCommand.js +2 -1
  58. package/abstractions/features/RunPulumiCommand.js.map +1 -1
  59. package/abstractions/features/Serve.d.ts +27 -0
  60. package/abstractions/features/Serve.js +5 -0
  61. package/abstractions/features/Serve.js.map +1 -0
  62. package/abstractions/features/ValidateProjectConfig.js +2 -1
  63. package/abstractions/features/ValidateProjectConfig.js.map +1 -1
  64. package/abstractions/features/Watch.d.ts +10 -0
  65. package/abstractions/features/Watch.js +2 -1
  66. package/abstractions/features/Watch.js.map +1 -1
  67. package/abstractions/features/hooks/AdminAfterBuild.js +2 -1
  68. package/abstractions/features/hooks/AdminAfterBuild.js.map +1 -1
  69. package/abstractions/features/hooks/AdminAfterDeploy.js +2 -1
  70. package/abstractions/features/hooks/AdminAfterDeploy.js.map +1 -1
  71. package/abstractions/features/hooks/AdminBeforeBuild.js +2 -1
  72. package/abstractions/features/hooks/AdminBeforeBuild.js.map +1 -1
  73. package/abstractions/features/hooks/AdminBeforeDeploy.js +2 -1
  74. package/abstractions/features/hooks/AdminBeforeDeploy.js.map +1 -1
  75. package/abstractions/features/hooks/AdminBeforeWatch.js +2 -1
  76. package/abstractions/features/hooks/AdminBeforeWatch.js.map +1 -1
  77. package/abstractions/features/hooks/AfterBuild.js +2 -1
  78. package/abstractions/features/hooks/AfterBuild.js.map +1 -1
  79. package/abstractions/features/hooks/AfterDeploy.js +2 -1
  80. package/abstractions/features/hooks/AfterDeploy.js.map +1 -1
  81. package/abstractions/features/hooks/ApiAfterBuild.js +2 -1
  82. package/abstractions/features/hooks/ApiAfterBuild.js.map +1 -1
  83. package/abstractions/features/hooks/ApiAfterDeploy.js +2 -1
  84. package/abstractions/features/hooks/ApiAfterDeploy.js.map +1 -1
  85. package/abstractions/features/hooks/ApiBeforeBuild.js +2 -1
  86. package/abstractions/features/hooks/ApiBeforeBuild.js.map +1 -1
  87. package/abstractions/features/hooks/ApiBeforeDeploy.js +2 -1
  88. package/abstractions/features/hooks/ApiBeforeDeploy.js.map +1 -1
  89. package/abstractions/features/hooks/ApiBeforeWatch.js +2 -1
  90. package/abstractions/features/hooks/ApiBeforeWatch.js.map +1 -1
  91. package/abstractions/features/hooks/BeforeBuild.js +2 -1
  92. package/abstractions/features/hooks/BeforeBuild.js.map +1 -1
  93. package/abstractions/features/hooks/BeforeDeploy.js +2 -1
  94. package/abstractions/features/hooks/BeforeDeploy.js.map +1 -1
  95. package/abstractions/features/hooks/BeforeWatch.js +2 -1
  96. package/abstractions/features/hooks/BeforeWatch.js.map +1 -1
  97. package/abstractions/features/hooks/CoreAfterBuild.js +2 -1
  98. package/abstractions/features/hooks/CoreAfterBuild.js.map +1 -1
  99. package/abstractions/features/hooks/CoreAfterDeploy.js +2 -1
  100. package/abstractions/features/hooks/CoreAfterDeploy.js.map +1 -1
  101. package/abstractions/features/hooks/CoreBeforeBuild.js +2 -1
  102. package/abstractions/features/hooks/CoreBeforeBuild.js.map +1 -1
  103. package/abstractions/features/hooks/CoreBeforeDeploy.js +2 -1
  104. package/abstractions/features/hooks/CoreBeforeDeploy.js.map +1 -1
  105. package/abstractions/features/hooks/CoreBeforeWatch.js +2 -1
  106. package/abstractions/features/hooks/CoreBeforeWatch.js.map +1 -1
  107. package/abstractions/features/hooks/index.js +0 -2
  108. package/abstractions/features/index.d.ts +1 -0
  109. package/abstractions/features/index.js +1 -2
  110. package/abstractions/index.js +0 -2
  111. package/abstractions/models/IAppModel.js +0 -3
  112. package/abstractions/models/IAppPackageModel.js +0 -3
  113. package/abstractions/models/IPathModel.js +0 -3
  114. package/abstractions/models/IProjectConfigDto.js +0 -3
  115. package/abstractions/models/IProjectConfigModel.js +0 -3
  116. package/abstractions/models/IProjectModel.js +0 -3
  117. package/abstractions/models/IUrlModel.js +0 -3
  118. package/abstractions/models/IWcpEnvironmentDto.js +0 -3
  119. package/abstractions/models/IWcpEnvironmentModel.js +0 -3
  120. package/abstractions/models/IWcpUserDto.js +0 -3
  121. package/abstractions/models/IWcpUserModel.js +0 -3
  122. package/abstractions/models/IWcpUserPatDto.js +0 -3
  123. package/abstractions/models/IWcpUserPatModel.js +0 -3
  124. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js +0 -3
  125. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js +0 -3
  126. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js +0 -3
  127. package/abstractions/models/PackagesBuilder/index.js +0 -3
  128. package/abstractions/models/index.js +0 -3
  129. package/abstractions/services/BuildAppWorkspaceService.js +2 -1
  130. package/abstractions/services/BuildAppWorkspaceService.js.map +1 -1
  131. package/abstractions/services/BuildProjectWorkspaceService.js +2 -1
  132. package/abstractions/services/BuildProjectWorkspaceService.js.map +1 -1
  133. package/abstractions/services/GetAppPackagesService.js +2 -1
  134. package/abstractions/services/GetAppPackagesService.js.map +1 -1
  135. package/abstractions/services/GetAppService.js +2 -1
  136. package/abstractions/services/GetAppService.js.map +1 -1
  137. package/abstractions/services/GetCwdService.js +2 -1
  138. package/abstractions/services/GetCwdService.js.map +1 -1
  139. package/abstractions/services/GetProjectConfigService.js +2 -1
  140. package/abstractions/services/GetProjectConfigService.js.map +1 -1
  141. package/abstractions/services/GetProjectIdService.js +2 -1
  142. package/abstractions/services/GetProjectIdService.js.map +1 -1
  143. package/abstractions/services/GetProjectInstallationIdService.d.ts +10 -0
  144. package/abstractions/services/GetProjectInstallationIdService.js +5 -0
  145. package/abstractions/services/GetProjectInstallationIdService.js.map +1 -0
  146. package/abstractions/services/GetProjectService.js +2 -1
  147. package/abstractions/services/GetProjectService.js.map +1 -1
  148. package/abstractions/services/GetProjectVersionService.js +2 -1
  149. package/abstractions/services/GetProjectVersionService.js.map +1 -1
  150. package/abstractions/services/GetPulumiService.js +2 -1
  151. package/abstractions/services/GetPulumiService.js.map +1 -1
  152. package/abstractions/services/InitProjectSdkService.js +2 -1
  153. package/abstractions/services/InitProjectSdkService.js.map +1 -1
  154. package/abstractions/services/InstallExtensionService.js +2 -1
  155. package/abstractions/services/InstallExtensionService.js.map +1 -1
  156. package/abstractions/services/IsRemotePulumiBackendService.js +2 -1
  157. package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -1
  158. package/abstractions/services/ListAppLambdaFunctionsService.js +2 -1
  159. package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -1
  160. package/abstractions/services/ListDeployedEnvironmentsService.js +2 -1
  161. package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -1
  162. package/abstractions/services/ListPackagesInAppWorkspaceService.js +2 -1
  163. package/abstractions/services/ListPackagesInAppWorkspaceService.js.map +1 -1
  164. package/abstractions/services/ListPackagesService.js +2 -1
  165. package/abstractions/services/ListPackagesService.js.map +1 -1
  166. package/abstractions/services/LoadEnvVarsService.js +2 -1
  167. package/abstractions/services/LoadEnvVarsService.js.map +1 -1
  168. package/abstractions/services/LocalStorageService.js +2 -1
  169. package/abstractions/services/LocalStorageService.js.map +1 -1
  170. package/abstractions/services/LoggerService.js +2 -1
  171. package/abstractions/services/LoggerService.js.map +1 -1
  172. package/abstractions/services/ProjectInfoService/GetIsCiService.js +2 -1
  173. package/abstractions/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  174. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js +2 -1
  175. package/abstractions/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  176. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js +2 -1
  177. package/abstractions/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  178. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +2 -1
  179. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
  180. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js +2 -1
  181. package/abstractions/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  182. package/abstractions/services/ProjectInfoService/ProjectInfoService.js +2 -1
  183. package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  184. package/abstractions/services/ProjectInfoService/index.js +0 -2
  185. package/abstractions/services/ProjectSdkParamsService.js +2 -1
  186. package/abstractions/services/ProjectSdkParamsService.js.map +1 -1
  187. package/abstractions/services/PulumiExportService.js +3 -4
  188. package/abstractions/services/PulumiExportService.js.map +1 -1
  189. package/abstractions/services/PulumiGetConfigPassphraseService.js +2 -1
  190. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -1
  191. package/abstractions/services/PulumiGetSecretsProviderService.js +2 -1
  192. package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -1
  193. package/abstractions/services/PulumiGetStackOutputService.js +2 -1
  194. package/abstractions/services/PulumiGetStackOutputService.js.map +1 -1
  195. package/abstractions/services/PulumiImportService.js +2 -1
  196. package/abstractions/services/PulumiImportService.js.map +1 -1
  197. package/abstractions/services/PulumiLoginService.js +2 -1
  198. package/abstractions/services/PulumiLoginService.js.map +1 -1
  199. package/abstractions/services/PulumiSelectStackService.js +2 -1
  200. package/abstractions/services/PulumiSelectStackService.js.map +1 -1
  201. package/abstractions/services/SetProjectIdService.js +2 -1
  202. package/abstractions/services/SetProjectIdService.js.map +1 -1
  203. package/abstractions/services/StackOutputCacheService.d.ts +10 -0
  204. package/abstractions/services/StackOutputCacheService.js +5 -0
  205. package/abstractions/services/StackOutputCacheService.js.map +1 -0
  206. package/abstractions/services/StdioService.js +2 -1
  207. package/abstractions/services/StdioService.js.map +1 -1
  208. package/abstractions/services/UiService.js +2 -1
  209. package/abstractions/services/UiService.js.map +1 -1
  210. package/abstractions/services/ValidateProjectConfigService.js +2 -1
  211. package/abstractions/services/ValidateProjectConfigService.js.map +1 -1
  212. package/abstractions/services/WatchedLambdaFunctionsService.js +2 -1
  213. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -1
  214. package/abstractions/services/WcpService.js +2 -1
  215. package/abstractions/services/WcpService.js.map +1 -1
  216. package/abstractions/services/index.d.ts +2 -0
  217. package/abstractions/services/index.js +2 -2
  218. package/abstractions/types.js +0 -3
  219. package/components/FeatureFlag.d.ts +43 -0
  220. package/components/FeatureFlag.js +60 -0
  221. package/components/FeatureFlag.js.map +1 -0
  222. package/createProjectSdkContainer.d.ts +1 -1
  223. package/createProjectSdkContainer.js +92 -112
  224. package/createProjectSdkContainer.js.map +1 -1
  225. package/decorators/BuildAppWithHooks.js +54 -44
  226. package/decorators/BuildAppWithHooks.js.map +1 -1
  227. package/decorators/DeployAppClearWatchedLambdaFunctions.js +27 -29
  228. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -1
  229. package/decorators/DeployAppRefreshStackOutputCache.js +26 -30
  230. package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -1
  231. package/decorators/DeployAppWithHooks.js +51 -41
  232. package/decorators/DeployAppWithHooks.js.map +1 -1
  233. package/decorators/DeployAppWithWatchedLambdaReplacement.js +33 -37
  234. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -1
  235. package/decorators/DestroyAppClearStackOutputCache.d.ts +25 -0
  236. package/decorators/DestroyAppClearStackOutputCache.js +29 -0
  237. package/decorators/DestroyAppClearStackOutputCache.js.map +1 -0
  238. package/decorators/GetFeatureFlagsWithLicense.d.ts +0 -1
  239. package/decorators/GetFeatureFlagsWithLicense.js +45 -59
  240. package/decorators/GetFeatureFlagsWithLicense.js.map +1 -1
  241. package/decorators/GetPulumiServiceWithDownloadInfo.js +21 -19
  242. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -1
  243. package/decorators/WatchWithHooks.js +30 -27
  244. package/decorators/WatchWithHooks.js.map +1 -1
  245. package/decorators/index.d.ts +1 -0
  246. package/decorators/index.js +1 -2
  247. package/defineExtension/createExtensionDefinition.js +12 -19
  248. package/defineExtension/createExtensionDefinition.js.map +1 -1
  249. package/defineExtension/createExtensionReactComponent.js +40 -46
  250. package/defineExtension/createExtensionReactComponent.js.map +1 -1
  251. package/defineExtension/defineExtension.js +8 -9
  252. package/defineExtension/defineExtension.js.map +1 -1
  253. package/defineExtension/index.js +0 -2
  254. package/defineExtension/models/ExtensionDefinitionModel.js +11 -10
  255. package/defineExtension/models/ExtensionDefinitionModel.js.map +1 -1
  256. package/defineExtension/models/ExtensionInstanceModel.js +23 -24
  257. package/defineExtension/models/ExtensionInstanceModel.js.map +1 -1
  258. package/defineExtension/models/index.js +0 -2
  259. package/defineExtension/types.js +0 -3
  260. package/defineExtension/zodTypes/zodSrcPath.js +35 -61
  261. package/defineExtension/zodTypes/zodSrcPath.js.map +1 -1
  262. package/exports/infra/admin.js +0 -2
  263. package/exports/infra/api.js +0 -2
  264. package/exports/infra/core.js +0 -2
  265. package/exports/infra.js +0 -2
  266. package/extensions/AdminApiUrl.d.ts +10 -0
  267. package/extensions/AdminApiUrl.js +21 -0
  268. package/extensions/AdminApiUrl.js.map +1 -0
  269. package/extensions/AdminBuildParam.js +105 -147
  270. package/extensions/AdminBuildParam.js.map +1 -1
  271. package/extensions/AdminExtension.js +65 -91
  272. package/extensions/AdminExtension.js.map +1 -1
  273. package/extensions/AdminWebsocketsUrl.d.ts +12 -0
  274. package/extensions/AdminWebsocketsUrl.js +21 -0
  275. package/extensions/AdminWebsocketsUrl.js.map +1 -0
  276. package/extensions/ApiBuildParam.js +73 -97
  277. package/extensions/ApiBuildParam.js.map +1 -1
  278. package/extensions/ApiExtension.js +74 -93
  279. package/extensions/ApiExtension.js.map +1 -1
  280. package/extensions/ApiMaxBundleSize.d.ts +4 -0
  281. package/extensions/ApiMaxBundleSize.js +23 -0
  282. package/extensions/ApiMaxBundleSize.js.map +1 -0
  283. package/extensions/BugReporter.d.ts +6 -0
  284. package/extensions/BugReporter.js +33 -0
  285. package/extensions/BugReporter.js.map +1 -0
  286. package/extensions/DatabaseSetup.js +14 -9
  287. package/extensions/DatabaseSetup.js.map +1 -1
  288. package/extensions/EnvVar.js +12 -16
  289. package/extensions/EnvVar.js.map +1 -1
  290. package/extensions/ExtensionDefinitions.js +11 -10
  291. package/extensions/ExtensionDefinitions.js.map +1 -1
  292. package/extensions/FeatureFlags.d.ts +21 -11
  293. package/extensions/FeatureFlags.js +67 -48
  294. package/extensions/FeatureFlags.js.map +1 -1
  295. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.d.ts +3 -2
  296. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js +37 -35
  297. package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js.map +1 -1
  298. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.d.ts +3 -2
  299. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js +37 -35
  300. package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js.map +1 -1
  301. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js +13 -9
  302. package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js.map +1 -1
  303. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js +13 -9
  304. package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js.map +1 -1
  305. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js +47 -51
  306. package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
  307. package/extensions/Project/showConfigChangeNotice.d.ts +7 -0
  308. package/extensions/Project/showConfigChangeNotice.js +9 -0
  309. package/extensions/Project/showConfigChangeNotice.js.map +1 -0
  310. package/extensions/Project.js +14 -31
  311. package/extensions/Project.js.map +1 -1
  312. package/extensions/ProjectDecorator.js +13 -16
  313. package/extensions/ProjectDecorator.js.map +1 -1
  314. package/extensions/ProjectId.js +11 -13
  315. package/extensions/ProjectId.js.map +1 -1
  316. package/extensions/ProjectImplementation.js +14 -17
  317. package/extensions/ProjectImplementation.js.map +1 -1
  318. package/extensions/Telemetry.js +10 -9
  319. package/extensions/Telemetry.js.map +1 -1
  320. package/extensions/hasDefaultExport.d.ts +2 -0
  321. package/extensions/hasDefaultExport.js +17 -0
  322. package/extensions/hasDefaultExport.js.map +1 -0
  323. package/extensions/hooks/AdminAfterBuild.js +16 -19
  324. package/extensions/hooks/AdminAfterBuild.js.map +1 -1
  325. package/extensions/hooks/AdminAfterDeploy.js +16 -19
  326. package/extensions/hooks/AdminAfterDeploy.js.map +1 -1
  327. package/extensions/hooks/AdminBeforeBuild.js +16 -19
  328. package/extensions/hooks/AdminBeforeBuild.js.map +1 -1
  329. package/extensions/hooks/AdminBeforeDeploy.js +16 -19
  330. package/extensions/hooks/AdminBeforeDeploy.js.map +1 -1
  331. package/extensions/hooks/AdminBeforeWatch.js +16 -19
  332. package/extensions/hooks/AdminBeforeWatch.js.map +1 -1
  333. package/extensions/hooks/AfterBuild.js +15 -18
  334. package/extensions/hooks/AfterBuild.js.map +1 -1
  335. package/extensions/hooks/AfterDeploy.js +15 -18
  336. package/extensions/hooks/AfterDeploy.js.map +1 -1
  337. package/extensions/hooks/ApiAfterBuild.js +16 -19
  338. package/extensions/hooks/ApiAfterBuild.js.map +1 -1
  339. package/extensions/hooks/ApiAfterDeploy.js +16 -19
  340. package/extensions/hooks/ApiAfterDeploy.js.map +1 -1
  341. package/extensions/hooks/ApiBeforeBuild.js +16 -19
  342. package/extensions/hooks/ApiBeforeBuild.js.map +1 -1
  343. package/extensions/hooks/ApiBeforeDeploy.js +16 -19
  344. package/extensions/hooks/ApiBeforeDeploy.js.map +1 -1
  345. package/extensions/hooks/ApiBeforeWatch.js +16 -19
  346. package/extensions/hooks/ApiBeforeWatch.js.map +1 -1
  347. package/extensions/hooks/BeforeBuild.js +15 -18
  348. package/extensions/hooks/BeforeBuild.js.map +1 -1
  349. package/extensions/hooks/BeforeDeploy.js +15 -18
  350. package/extensions/hooks/BeforeDeploy.js.map +1 -1
  351. package/extensions/hooks/BeforeWatch.js +15 -18
  352. package/extensions/hooks/BeforeWatch.js.map +1 -1
  353. package/extensions/hooks/CoreAfterBuild.js +16 -19
  354. package/extensions/hooks/CoreAfterBuild.js.map +1 -1
  355. package/extensions/hooks/CoreAfterDeploy.js +16 -19
  356. package/extensions/hooks/CoreAfterDeploy.js.map +1 -1
  357. package/extensions/hooks/CoreBeforeBuild.js +16 -19
  358. package/extensions/hooks/CoreBeforeBuild.js.map +1 -1
  359. package/extensions/hooks/CoreBeforeDeploy.js +16 -19
  360. package/extensions/hooks/CoreBeforeDeploy.js.map +1 -1
  361. package/extensions/hooks/CoreBeforeWatch.js +16 -19
  362. package/extensions/hooks/CoreBeforeWatch.js.map +1 -1
  363. package/extensions/hooks/index.js +0 -2
  364. package/extensions/index.d.ts +64 -23
  365. package/extensions/index.js +55 -57
  366. package/extensions/index.js.map +1 -1
  367. package/extensions/infra/Ci.js +8 -24
  368. package/extensions/infra/Ci.js.map +1 -1
  369. package/extensions/infra/Encryption.d.ts +10 -0
  370. package/extensions/infra/Encryption.js +36 -0
  371. package/extensions/infra/Encryption.js.map +1 -0
  372. package/extensions/infra/Env.js +35 -92
  373. package/extensions/infra/Env.js.map +1 -1
  374. package/extensions/infra/Hashing.d.ts +5 -0
  375. package/extensions/infra/Hashing.js +27 -0
  376. package/extensions/infra/Hashing.js.map +1 -0
  377. package/extensions/infra/index.js +0 -2
  378. package/extensions/pulumi/AdminStackOutputValue.js +13 -12
  379. package/extensions/pulumi/AdminStackOutputValue.js.map +1 -1
  380. package/extensions/pulumi/ApiStackOutputValue.js +13 -12
  381. package/extensions/pulumi/ApiStackOutputValue.js.map +1 -1
  382. package/extensions/pulumi/CoreStackOutputValue.js +13 -12
  383. package/extensions/pulumi/CoreStackOutputValue.js.map +1 -1
  384. package/extensions/pulumi/ProductionEnvironments.js +29 -39
  385. package/extensions/pulumi/ProductionEnvironments.js.map +1 -1
  386. package/extensions/pulumi/PulumiResourceNamePrefix.js +10 -9
  387. package/extensions/pulumi/PulumiResourceNamePrefix.js.map +1 -1
  388. package/extensions/pulumi/index.js +0 -2
  389. package/features/BuildApp/BuildApp.js +49 -40
  390. package/features/BuildApp/BuildApp.js.map +1 -1
  391. package/features/BuildApp/PackagesBuilder/PackagesBuilder.js +34 -39
  392. package/features/BuildApp/PackagesBuilder/PackagesBuilder.js.map +1 -1
  393. package/features/BuildApp/PackagesBuilder/RunnableBuildProcess.js +39 -33
  394. package/features/BuildApp/PackagesBuilder/RunnableBuildProcess.js.map +1 -1
  395. package/features/BuildApp/PackagesBuilder/RunnableBuildProcesses.js +39 -46
  396. package/features/BuildApp/PackagesBuilder/RunnableBuildProcesses.js.map +1 -1
  397. package/features/BuildApp/PackagesBuilder/worker.js +26 -34
  398. package/features/BuildApp/PackagesBuilder/worker.js.map +1 -1
  399. package/features/BuildApp/index.js +0 -2
  400. package/features/DeployApp/DeployApp.js +79 -79
  401. package/features/DeployApp/DeployApp.js.map +1 -1
  402. package/features/DeployApp/index.js +0 -2
  403. package/features/DestroyApp/DestroyApp.d.ts +1 -1
  404. package/features/DestroyApp/DestroyApp.js +60 -46
  405. package/features/DestroyApp/DestroyApp.js.map +1 -1
  406. package/features/DestroyApp/index.js +0 -2
  407. package/features/ExportStack/ExportStack.js +21 -16
  408. package/features/ExportStack/ExportStack.js.map +1 -1
  409. package/features/ExportStack/index.js +0 -2
  410. package/features/GetApp/GetApp.js +14 -11
  411. package/features/GetApp/GetApp.js.map +1 -1
  412. package/features/GetApp/index.js +0 -2
  413. package/features/GetAppOutput/GetAppOutput.d.ts +1 -1
  414. package/features/GetAppOutput/GetAppOutput.js +44 -33
  415. package/features/GetAppOutput/GetAppOutput.js.map +1 -1
  416. package/features/GetAppOutput/index.js +0 -2
  417. package/features/GetAppStackOutput/GetAppStackOutput.js +20 -15
  418. package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -1
  419. package/features/GetAppStackOutput/index.js +0 -2
  420. package/features/GetFeatureFlags/GetFeatureFlags.js +20 -19
  421. package/features/GetFeatureFlags/GetFeatureFlags.js.map +1 -1
  422. package/features/GetFeatureFlags/index.js +0 -2
  423. package/features/GetLogger/GetLogger.js +14 -11
  424. package/features/GetLogger/GetLogger.js.map +1 -1
  425. package/features/GetLogger/index.js +0 -2
  426. package/features/GetProductionEnvironments/GetProductionEnvironments.js +24 -19
  427. package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
  428. package/features/GetProductionEnvironments/index.js +0 -2
  429. package/features/GetProject/GetProject.js +14 -11
  430. package/features/GetProject/GetProject.js.map +1 -1
  431. package/features/GetProject/index.js +0 -2
  432. package/features/GetProjectConfig/GetProjectConfig.js +14 -11
  433. package/features/GetProjectConfig/GetProjectConfig.js.map +1 -1
  434. package/features/GetProjectConfig/index.js +0 -2
  435. package/features/GetProjectInfo/GetProjectInfo.js +14 -11
  436. package/features/GetProjectInfo/GetProjectInfo.js.map +1 -1
  437. package/features/GetProjectInfo/index.js +0 -2
  438. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +18 -17
  439. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -1
  440. package/features/GetPulumiResourceNamePrefix/index.js +0 -2
  441. package/features/InstallExtension/InstallExtension.js +14 -11
  442. package/features/InstallExtension/InstallExtension.js.map +1 -1
  443. package/features/InstallExtension/index.js +0 -2
  444. package/features/IsCi/IsCi.js +14 -11
  445. package/features/IsCi/IsCi.js.map +1 -1
  446. package/features/IsCi/index.js +0 -2
  447. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js +19 -18
  448. package/features/IsTelemetryEnabled/IsTelemetryEnabled.js.map +1 -1
  449. package/features/IsTelemetryEnabled/index.js +0 -2
  450. package/features/IsWcpEnabled/IsWcpEnabled.js +15 -12
  451. package/features/IsWcpEnabled/IsWcpEnabled.js.map +1 -1
  452. package/features/IsWcpEnabled/index.js +0 -2
  453. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js +17 -14
  454. package/features/IsWebinyJsRepo/IsWebinyJsRepo.js.map +1 -1
  455. package/features/IsWebinyJsRepo/index.js +0 -2
  456. package/features/RefreshApp/RefreshApp.d.ts +1 -1
  457. package/features/RefreshApp/RefreshApp.js +57 -46
  458. package/features/RefreshApp/RefreshApp.js.map +1 -1
  459. package/features/RefreshApp/index.js +0 -2
  460. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +1 -1
  461. package/features/RunPulumiCommand/RunPulumiCommand.js +54 -43
  462. package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -1
  463. package/features/RunPulumiCommand/index.js +0 -2
  464. package/features/Serve/Serve.d.ts +10 -0
  465. package/features/Serve/Serve.js +15 -0
  466. package/features/Serve/Serve.js.map +1 -0
  467. package/features/Serve/index.d.ts +1 -0
  468. package/features/Serve/index.js +1 -0
  469. package/features/ValidateProjectConfig/ValidateProjectConfig.js +14 -11
  470. package/features/ValidateProjectConfig/ValidateProjectConfig.js.map +1 -1
  471. package/features/ValidateProjectConfig/index.js +0 -2
  472. package/features/Watch/Watch.d.ts +3 -16
  473. package/features/Watch/Watch.js +99 -184
  474. package/features/Watch/Watch.js.map +1 -1
  475. package/features/Watch/index.js +0 -2
  476. package/features/Watch/initInvocationForwarding.js +76 -95
  477. package/features/Watch/initInvocationForwarding.js.map +1 -1
  478. package/features/Watch/localInvocationWorker.js +24 -33
  479. package/features/Watch/localInvocationWorker.js.map +1 -1
  480. package/features/Watch/watchers/BasePackagesWatcher.js +10 -13
  481. package/features/Watch/watchers/BasePackagesWatcher.js.map +1 -1
  482. package/features/Watch/watchers/MultiplePackagesWatcher.js +11 -12
  483. package/features/Watch/watchers/MultiplePackagesWatcher.js.map +1 -1
  484. package/features/Watch/watchers/PackagesWatcher.js +15 -18
  485. package/features/Watch/watchers/PackagesWatcher.js.map +1 -1
  486. package/features/Watch/watchers/RunnableWatchProcess.js +41 -40
  487. package/features/Watch/watchers/RunnableWatchProcess.js.map +1 -1
  488. package/features/Watch/watchers/RunnableWatchProcesses.js +35 -34
  489. package/features/Watch/watchers/RunnableWatchProcesses.js.map +1 -1
  490. package/features/Watch/watchers/ServersWatcher.d.ts +36 -0
  491. package/features/Watch/watchers/ServersWatcher.js +38 -0
  492. package/features/Watch/watchers/ServersWatcher.js.map +1 -0
  493. package/features/Watch/watchers/SinglePackageWatcher.js +11 -8
  494. package/features/Watch/watchers/SinglePackageWatcher.js.map +1 -1
  495. package/features/Watch/watchers/WebinyConfigWatcher.js +30 -40
  496. package/features/Watch/watchers/WebinyConfigWatcher.js.map +1 -1
  497. package/features/Watch/watchers/ZeroPackagesWatcher.js +5 -5
  498. package/features/Watch/watchers/ZeroPackagesWatcher.js.map +1 -1
  499. package/features/Watch/watchers/utils/measureDuration.js +7 -8
  500. package/features/Watch/watchers/utils/measureDuration.js.map +1 -1
  501. package/features/Watch/watchers/worker.js +15 -21
  502. package/features/Watch/watchers/worker.js.map +1 -1
  503. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js +19 -15
  504. package/features/hooks/AdminAfterBuild/AdminBeforeBuild.js.map +1 -1
  505. package/features/hooks/AdminAfterBuild/index.js +0 -2
  506. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +19 -15
  507. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +1 -1
  508. package/features/hooks/AdminAfterDeploy/index.js +0 -2
  509. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js +19 -15
  510. package/features/hooks/AdminBeforeBuild/AdminBeforeBuild.js.map +1 -1
  511. package/features/hooks/AdminBeforeBuild/index.js +0 -2
  512. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +19 -15
  513. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -1
  514. package/features/hooks/AdminBeforeDeploy/index.js +0 -2
  515. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js +18 -14
  516. package/features/hooks/AdminBeforeWatch/AdminBeforeWatch.js.map +1 -1
  517. package/features/hooks/AdminBeforeWatch/index.js +0 -2
  518. package/features/hooks/AfterBuild/AfterBuild.js +19 -15
  519. package/features/hooks/AfterBuild/AfterBuild.js.map +1 -1
  520. package/features/hooks/AfterBuild/index.js +0 -2
  521. package/features/hooks/AfterDeploy/AfterDeploy.js +19 -15
  522. package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -1
  523. package/features/hooks/AfterDeploy/index.js +0 -2
  524. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js +18 -14
  525. package/features/hooks/ApiAfterBuild/ApiBeforeBuild.js.map +1 -1
  526. package/features/hooks/ApiAfterBuild/index.js +0 -2
  527. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +18 -14
  528. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +1 -1
  529. package/features/hooks/ApiAfterDeploy/index.js +0 -2
  530. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js +18 -14
  531. package/features/hooks/ApiBeforeBuild/ApiBeforeBuild.js.map +1 -1
  532. package/features/hooks/ApiBeforeBuild/index.js +0 -2
  533. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +18 -14
  534. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -1
  535. package/features/hooks/ApiBeforeDeploy/index.js +0 -2
  536. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js +18 -14
  537. package/features/hooks/ApiBeforeWatch/ApiBeforeWatch.js.map +1 -1
  538. package/features/hooks/ApiBeforeWatch/index.js +0 -2
  539. package/features/hooks/BeforeBuild/BeforeBuild.js +19 -15
  540. package/features/hooks/BeforeBuild/BeforeBuild.js.map +1 -1
  541. package/features/hooks/BeforeBuild/index.js +0 -2
  542. package/features/hooks/BeforeDeploy/BeforeDeploy.js +19 -15
  543. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -1
  544. package/features/hooks/BeforeDeploy/index.js +0 -2
  545. package/features/hooks/BeforeWatch/BeforeWatch.js +19 -15
  546. package/features/hooks/BeforeWatch/BeforeWatch.js.map +1 -1
  547. package/features/hooks/BeforeWatch/index.js +0 -2
  548. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js +18 -14
  549. package/features/hooks/CoreAfterBuild/CoreBeforeBuild.js.map +1 -1
  550. package/features/hooks/CoreAfterBuild/index.js +0 -2
  551. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +18 -14
  552. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +1 -1
  553. package/features/hooks/CoreAfterDeploy/index.js +0 -2
  554. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js +18 -14
  555. package/features/hooks/CoreBeforeBuild/CoreBeforeBuild.js.map +1 -1
  556. package/features/hooks/CoreBeforeBuild/index.js +0 -2
  557. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +18 -14
  558. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -1
  559. package/features/hooks/CoreBeforeDeploy/index.js +0 -2
  560. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js +18 -14
  561. package/features/hooks/CoreBeforeWatch/CoreBeforeWatch.js.map +1 -1
  562. package/features/hooks/CoreBeforeWatch/index.js +0 -2
  563. package/features/hooks/index.js +0 -2
  564. package/features/index.d.ts +1 -0
  565. package/features/index.js +1 -2
  566. package/index.d.ts +3 -1
  567. package/index.js +8 -11
  568. package/index.js.map +1 -1
  569. package/models/AppModel.js +20 -19
  570. package/models/AppModel.js.map +1 -1
  571. package/models/AppPackageModel.js +10 -9
  572. package/models/AppPackageModel.js.map +1 -1
  573. package/models/PathModel.js +23 -26
  574. package/models/PathModel.js.map +1 -1
  575. package/models/ProjectConfigModel.js +12 -16
  576. package/models/ProjectConfigModel.js.map +1 -1
  577. package/models/ProjectModel.js +37 -36
  578. package/models/ProjectModel.js.map +1 -1
  579. package/models/UrlModel.js +23 -23
  580. package/models/UrlModel.js.map +1 -1
  581. package/models/WcpEnvironmentModel.js +23 -22
  582. package/models/WcpEnvironmentModel.js.map +1 -1
  583. package/models/WcpUserModel.js +13 -12
  584. package/models/WcpUserModel.js.map +1 -1
  585. package/models/WcpUserPatModel.js +12 -11
  586. package/models/WcpUserPatModel.js.map +1 -1
  587. package/models/index.js +0 -2
  588. package/package.json +32 -30
  589. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.d.ts +2 -3
  590. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js +33 -73
  591. package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js.map +1 -1
  592. package/services/BuildAppWorkspaceService/index.js +0 -2
  593. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js +21 -19
  594. package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js.map +1 -1
  595. package/services/BuildProjectWorkspaceService/index.js +0 -2
  596. package/services/GetAppPackagesService/GetAppPackagesService.js +24 -23
  597. package/services/GetAppPackagesService/GetAppPackagesService.js.map +1 -1
  598. package/services/GetAppPackagesService/index.js +0 -2
  599. package/services/GetAppService/GetAppService.js +24 -27
  600. package/services/GetAppService/GetAppService.js.map +1 -1
  601. package/services/GetAppService/index.js +0 -2
  602. package/services/GetCwdService/GetCwdService.js +15 -12
  603. package/services/GetCwdService/GetCwdService.js.map +1 -1
  604. package/services/GetCwdService/index.js +0 -2
  605. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.d.ts +15 -0
  606. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js +23 -0
  607. package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js.map +1 -0
  608. package/services/GetProjectConfigService/EnvContext.d.ts +3 -2
  609. package/services/GetProjectConfigService/EnvContext.js +28 -39
  610. package/services/GetProjectConfigService/EnvContext.js.map +1 -1
  611. package/services/GetProjectConfigService/FeatureFlagsContext.d.ts +26 -0
  612. package/services/GetProjectConfigService/FeatureFlagsContext.js +41 -0
  613. package/services/GetProjectConfigService/FeatureFlagsContext.js.map +1 -0
  614. package/services/GetProjectConfigService/GetProjectConfigService.js +105 -115
  615. package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
  616. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.d.ts +8 -0
  617. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js +27 -0
  618. package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js.map +1 -0
  619. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js +13 -18
  620. package/services/GetProjectConfigService/ProductionEnvironmentsContext.js.map +1 -1
  621. package/services/GetProjectConfigService/WcpProjectLicenseContext.js +32 -37
  622. package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
  623. package/services/GetProjectConfigService/getRenderCacheKey.d.ts +1 -0
  624. package/services/GetProjectConfigService/getRenderCacheKey.js +13 -0
  625. package/services/GetProjectConfigService/getRenderCacheKey.js.map +1 -0
  626. package/services/GetProjectConfigService/index.js +0 -2
  627. package/services/GetProjectConfigService/nullRenderer.d.ts +4 -0
  628. package/services/GetProjectConfigService/nullRenderer.js +51 -0
  629. package/services/GetProjectConfigService/nullRenderer.js.map +1 -0
  630. package/services/GetProjectConfigService/renderConfig.d.ts +3 -12
  631. package/services/GetProjectConfigService/renderConfig.js +11 -42
  632. package/services/GetProjectConfigService/renderConfig.js.map +1 -1
  633. package/services/GetProjectConfigService/renderExtensions.d.ts +8 -0
  634. package/services/GetProjectConfigService/renderExtensions.js +52 -0
  635. package/services/GetProjectConfigService/renderExtensions.js.map +1 -0
  636. package/services/GetProjectIdService/GetProjectIdService.js +22 -23
  637. package/services/GetProjectIdService/GetProjectIdService.js.map +1 -1
  638. package/services/GetProjectIdService/index.js +0 -2
  639. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.d.ts +10 -0
  640. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.js +34 -0
  641. package/services/GetProjectInstallationIdService/GetProjectInstallationIdService.js.map +1 -0
  642. package/services/GetProjectInstallationIdService/index.d.ts +1 -0
  643. package/services/GetProjectInstallationIdService/index.js +1 -0
  644. package/services/GetProjectService/GetProjectService.js +43 -45
  645. package/services/GetProjectService/GetProjectService.js.map +1 -1
  646. package/services/GetProjectService/index.js +0 -2
  647. package/services/GetProjectVersionService/GetProjectVersionService.js +23 -22
  648. package/services/GetProjectVersionService/GetProjectVersionService.js.map +1 -1
  649. package/services/GetProjectVersionService/index.js +0 -2
  650. package/services/InitProjectSdkService/InitProjectSdkService.js +36 -48
  651. package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
  652. package/services/InitProjectSdkService/applyEnvVars.js +5 -8
  653. package/services/InitProjectSdkService/applyEnvVars.js.map +1 -1
  654. package/services/InitProjectSdkService/applyWcpEnvVars.js +110 -137
  655. package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
  656. package/services/InitProjectSdkService/index.js +0 -2
  657. package/services/InitProjectSdkService/registerDecorators.js +10 -7
  658. package/services/InitProjectSdkService/registerDecorators.js.map +1 -1
  659. package/services/InitProjectSdkService/registerHooks.js +30 -7
  660. package/services/InitProjectSdkService/registerHooks.js.map +1 -1
  661. package/services/InitProjectSdkService/registerImplementations.js +10 -11
  662. package/services/InitProjectSdkService/registerImplementations.js.map +1 -1
  663. package/services/InitProjectSdkService/registerPulumiExtensions.js +12 -9
  664. package/services/InitProjectSdkService/registerPulumiExtensions.js.map +1 -1
  665. package/services/InstallExtensionService/InstallExtensionService.js +78 -121
  666. package/services/InstallExtensionService/InstallExtensionService.js.map +1 -1
  667. package/services/InstallExtensionService/downloadFolderFromS3.js +46 -65
  668. package/services/InstallExtensionService/downloadFolderFromS3.js.map +1 -1
  669. package/services/InstallExtensionService/index.js +0 -2
  670. package/services/InstallExtensionService/mergePackageJson.js +15 -25
  671. package/services/InstallExtensionService/mergePackageJson.js.map +1 -1
  672. package/services/InstallExtensionService/types.js +0 -3
  673. package/services/InstallExtensionService/updateWebinyConfig.js +60 -137
  674. package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
  675. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +3 -2
  676. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +9 -17
  677. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -1
  678. package/services/IsRemotePulumiBackendService/index.js +0 -2
  679. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +50 -73
  680. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -1
  681. package/services/ListAppLambdaFunctionsService/index.js +0 -2
  682. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +21 -23
  683. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -1
  684. package/services/ListDeployedEnvironmentsService/index.js +0 -2
  685. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js +34 -29
  686. package/services/ListPackagesInAppWorkspaceService/ListPackagesInAppWorkspaceService.js.map +1 -1
  687. package/services/ListPackagesInAppWorkspaceService/index.js +0 -2
  688. package/services/ListPackagesService/ListPackagesService.js +81 -114
  689. package/services/ListPackagesService/ListPackagesService.js.map +1 -1
  690. package/services/ListPackagesService/index.js +0 -2
  691. package/services/LoadEnvVarsService/LoadEnvVarsService.d.ts +3 -2
  692. package/services/LoadEnvVarsService/LoadEnvVarsService.js +37 -30
  693. package/services/LoadEnvVarsService/LoadEnvVarsService.js.map +1 -1
  694. package/services/LoadEnvVarsService/index.js +0 -2
  695. package/services/LocalStorageService/LocalStorageService.js +41 -44
  696. package/services/LocalStorageService/LocalStorageService.js.map +1 -1
  697. package/services/LocalStorageService/index.js +0 -2
  698. package/services/LoggerService/LoggerService.js +76 -84
  699. package/services/LoggerService/LoggerService.js.map +1 -1
  700. package/services/LoggerService/index.js +0 -2
  701. package/services/ProjectInfoService/GetIsCiService.js +9 -8
  702. package/services/ProjectInfoService/GetIsCiService.js.map +1 -1
  703. package/services/ProjectInfoService/GetNpmVersionService.js +9 -8
  704. package/services/ProjectInfoService/GetNpmVersionService.js.map +1 -1
  705. package/services/ProjectInfoService/GetNpxVersionService.js +9 -8
  706. package/services/ProjectInfoService/GetNpxVersionService.js.map +1 -1
  707. package/services/ProjectInfoService/GetPulumiVersionService.js +39 -31
  708. package/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
  709. package/services/ProjectInfoService/GetYarnVersionService.js +9 -8
  710. package/services/ProjectInfoService/GetYarnVersionService.js.map +1 -1
  711. package/services/ProjectInfoService/ProjectInfoService.js +56 -51
  712. package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  713. package/services/ProjectInfoService/index.js +0 -2
  714. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js +37 -34
  715. package/services/ProjectSdkParamsService/ProjectSdkParamsService.js.map +1 -1
  716. package/services/ProjectSdkParamsService/index.js +0 -2
  717. package/services/PulumiExportService/PulumiExportService.js +42 -35
  718. package/services/PulumiExportService/PulumiExportService.js.map +1 -1
  719. package/services/PulumiExportService/index.js +0 -2
  720. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +9 -8
  721. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -1
  722. package/services/PulumiGetConfigPassphraseService/index.js +0 -2
  723. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +9 -8
  724. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -1
  725. package/services/PulumiGetSecretsProviderService/index.js +0 -2
  726. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +3 -11
  727. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +54 -103
  728. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -1
  729. package/services/PulumiGetStackOutputService/index.js +0 -2
  730. package/services/PulumiGetStackOutputService/mapStackOutput.js +17 -29
  731. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -1
  732. package/services/PulumiImportService/PulumiImportService.js +48 -45
  733. package/services/PulumiImportService/PulumiImportService.js.map +1 -1
  734. package/services/PulumiImportService/index.js +0 -2
  735. package/services/PulumiLoginService/PulumiLoginService.js +43 -40
  736. package/services/PulumiLoginService/PulumiLoginService.js.map +1 -1
  737. package/services/PulumiLoginService/index.js +0 -2
  738. package/services/PulumiSelectStackService/PulumiSelectStackService.js +91 -86
  739. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -1
  740. package/services/PulumiSelectStackService/index.js +0 -2
  741. package/services/SetProjectIdService/SetProjectIdService.js +43 -57
  742. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  743. package/services/SetProjectIdService/index.js +0 -2
  744. package/services/StackOutputCacheService/StackOutputCacheService.d.ts +18 -0
  745. package/services/StackOutputCacheService/StackOutputCacheService.js +89 -0
  746. package/services/StackOutputCacheService/StackOutputCacheService.js.map +1 -0
  747. package/services/StackOutputCacheService/index.d.ts +1 -0
  748. package/services/StackOutputCacheService/index.js +1 -0
  749. package/services/StdioService/StdioService.js +15 -14
  750. package/services/StdioService/StdioService.js.map +1 -1
  751. package/services/StdioService/index.js +0 -2
  752. package/services/UiService/UiService.d.ts +18 -0
  753. package/services/UiService/UiService.js +71 -58
  754. package/services/UiService/UiService.js.map +1 -1
  755. package/services/UiService/index.js +0 -2
  756. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js +21 -19
  757. package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
  758. package/services/ValidateProjectConfigService/index.js +0 -2
  759. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +47 -54
  760. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -1
  761. package/services/WatchedLambdaFunctionsService/index.js +0 -2
  762. package/services/WcpService/CreateUserPat.js +20 -23
  763. package/services/WcpService/CreateUserPat.js.map +1 -1
  764. package/services/WcpService/GenerateUserPat.js +15 -18
  765. package/services/WcpService/GenerateUserPat.js.map +1 -1
  766. package/services/WcpService/GetPatFromLocalStorage.js +9 -10
  767. package/services/WcpService/GetPatFromLocalStorage.js.map +1 -1
  768. package/services/WcpService/GetProjectEnvironment.js +45 -47
  769. package/services/WcpService/GetProjectEnvironment.js.map +1 -1
  770. package/services/WcpService/GetProjectLicense.js +28 -38
  771. package/services/WcpService/GetProjectLicense.js.map +1 -1
  772. package/services/WcpService/GetUser.js +43 -46
  773. package/services/WcpService/GetUser.js.map +1 -1
  774. package/services/WcpService/GetUserPat.js +20 -23
  775. package/services/WcpService/GetUserPat.js.map +1 -1
  776. package/services/WcpService/LogoutUser.js +9 -8
  777. package/services/WcpService/LogoutUser.js.map +1 -1
  778. package/services/WcpService/StorePatToLocalStorage.js +9 -10
  779. package/services/WcpService/StorePatToLocalStorage.js.map +1 -1
  780. package/services/WcpService/UnsetPatFromLocalStorage.js +9 -10
  781. package/services/WcpService/UnsetPatFromLocalStorage.js.map +1 -1
  782. package/services/WcpService/WcpGqlClient.js +7 -6
  783. package/services/WcpService/WcpGqlClient.js.map +1 -1
  784. package/services/WcpService/WcpService.js +74 -75
  785. package/services/WcpService/WcpService.js.map +1 -1
  786. package/services/WcpService/fetchProjectEnvironmentByApiKey.d.ts +8 -0
  787. package/services/WcpService/fetchProjectEnvironmentByApiKey.js +21 -0
  788. package/services/WcpService/fetchProjectEnvironmentByApiKey.js.map +1 -0
  789. package/services/WcpService/index.js +0 -2
  790. package/services/index.d.ts +2 -1
  791. package/services/index.js +2 -3
  792. package/utils/ExtensionSrcResolver.js +51 -106
  793. package/utils/ExtensionSrcResolver.js.map +1 -1
  794. package/utils/apiRuntimeEnv.d.ts +20 -0
  795. package/utils/apiRuntimeEnv.js +51 -0
  796. package/utils/apiRuntimeEnv.js.map +1 -0
  797. package/utils/constants.js +8 -7
  798. package/utils/constants.js.map +1 -1
  799. package/utils/createPathResolver.js +2 -5
  800. package/utils/createPathResolver.js.map +1 -1
  801. package/utils/env/configuration.js +16 -25
  802. package/utils/env/configuration.js.map +1 -1
  803. package/utils/env/index.js +0 -2
  804. package/utils/env/types.js +0 -3
  805. package/utils/env/withEnv.js +4 -7
  806. package/utils/env/withEnv.js.map +1 -1
  807. package/utils/env/withEnvVariant.js +8 -11
  808. package/utils/env/withEnvVariant.js.map +1 -1
  809. package/utils/env/withProjectName.js +4 -9
  810. package/utils/env/withProjectName.js.map +1 -1
  811. package/utils/env/withPulumiConfigPassphrase.js +4 -8
  812. package/utils/env/withPulumiConfigPassphrase.js.map +1 -1
  813. package/utils/env/withRegion.js +10 -17
  814. package/utils/env/withRegion.js.map +1 -1
  815. package/utils/getRandomColorForString.js +86 -8
  816. package/utils/getRandomColorForString.js.map +1 -1
  817. package/utils/getStackName.js +11 -18
  818. package/utils/getStackName.js.map +1 -1
  819. package/utils/index.d.ts +2 -1
  820. package/utils/index.js +2 -3
  821. package/utils/isValidRegionName.js +8 -13
  822. package/utils/isValidRegionName.js.map +1 -1
  823. package/utils/isValidVariantName.js +11 -10
  824. package/utils/isValidVariantName.js.map +1 -1
  825. package/utils/measureDuration.js +7 -8
  826. package/utils/measureDuration.js.map +1 -1
  827. package/utils/projectSdkContext.js +23 -39
  828. package/utils/projectSdkContext.js.map +1 -1
  829. package/utils/regions.js +75 -63
  830. package/utils/regions.js.map +1 -1
  831. package/utils/registerExtension.js +6 -15
  832. package/utils/registerExtension.js.map +1 -1
  833. package/utils/requireConfig.js +7 -12
  834. package/utils/requireConfig.js.map +1 -1
  835. package/utils/toImportSpecifier.js +3 -9
  836. package/utils/toImportSpecifier.js.map +1 -1
  837. package/utils/trace/TraceRecorder.d.ts +17 -0
  838. package/utils/trace/TraceRecorder.js +51 -0
  839. package/utils/trace/TraceRecorder.js.map +1 -0
  840. package/utils/trace/formatTraceReport.d.ts +2 -0
  841. package/utils/trace/formatTraceReport.js +53 -0
  842. package/utils/trace/formatTraceReport.js.map +1 -0
  843. package/utils/trace/index.d.ts +6 -0
  844. package/utils/trace/index.js +6 -0
  845. package/utils/trace/isTraceRequested.d.ts +1 -0
  846. package/utils/trace/isTraceRequested.js +12 -0
  847. package/utils/trace/isTraceRequested.js.map +1 -0
  848. package/utils/trace/startTrace.d.ts +1 -0
  849. package/utils/trace/startTrace.js +19 -0
  850. package/utils/trace/startTrace.js.map +1 -0
  851. package/utils/trace/trace.d.ts +1 -0
  852. package/utils/trace/trace.js +13 -0
  853. package/utils/trace/trace.js.map +1 -0
  854. package/utils/trace/traceAsync.d.ts +1 -0
  855. package/utils/trace/traceAsync.js +13 -0
  856. package/utils/trace/traceAsync.js.map +1 -0
  857. package/abstractions/features/hooks/index.js.map +0 -1
  858. package/abstractions/features/index.js.map +0 -1
  859. package/abstractions/index.js.map +0 -1
  860. package/abstractions/models/IAppModel.js.map +0 -1
  861. package/abstractions/models/IAppPackageModel.js.map +0 -1
  862. package/abstractions/models/IPathModel.js.map +0 -1
  863. package/abstractions/models/IProjectConfigDto.js.map +0 -1
  864. package/abstractions/models/IProjectConfigModel.js.map +0 -1
  865. package/abstractions/models/IProjectModel.js.map +0 -1
  866. package/abstractions/models/IUrlModel.js.map +0 -1
  867. package/abstractions/models/IWcpEnvironmentDto.js.map +0 -1
  868. package/abstractions/models/IWcpEnvironmentModel.js.map +0 -1
  869. package/abstractions/models/IWcpUserDto.js.map +0 -1
  870. package/abstractions/models/IWcpUserModel.js.map +0 -1
  871. package/abstractions/models/IWcpUserPatDto.js.map +0 -1
  872. package/abstractions/models/IWcpUserPatModel.js.map +0 -1
  873. package/abstractions/models/PackagesBuilder/IPackagesBuilder.js.map +0 -1
  874. package/abstractions/models/PackagesBuilder/IRunnableBuildProcess.js.map +0 -1
  875. package/abstractions/models/PackagesBuilder/IRunnableBuildProcesses.js.map +0 -1
  876. package/abstractions/models/PackagesBuilder/index.js.map +0 -1
  877. package/abstractions/models/index.js.map +0 -1
  878. package/abstractions/services/ProjectInfoService/index.js.map +0 -1
  879. package/abstractions/services/index.js.map +0 -1
  880. package/abstractions/types.js.map +0 -1
  881. package/components/Wcp.d.ts +0 -19
  882. package/components/Wcp.js +0 -48
  883. package/components/Wcp.js.map +0 -1
  884. package/decorators/index.js.map +0 -1
  885. package/defineExtension/index.js.map +0 -1
  886. package/defineExtension/models/index.js.map +0 -1
  887. package/defineExtension/types.js.map +0 -1
  888. package/exports/infra/admin.js.map +0 -1
  889. package/exports/infra/api.js.map +0 -1
  890. package/exports/infra/core.js.map +0 -1
  891. package/exports/infra.js.map +0 -1
  892. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.d.ts +0 -11
  893. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js +0 -31
  894. package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js.map +0 -1
  895. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.d.ts +0 -11
  896. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js +0 -31
  897. package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js.map +0 -1
  898. package/extensions/Project/EnsureApiDeployedBeforeWatch.d.ts +0 -11
  899. package/extensions/Project/EnsureApiDeployedBeforeWatch.js +0 -31
  900. package/extensions/Project/EnsureApiDeployedBeforeWatch.js.map +0 -1
  901. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.d.ts +0 -11
  902. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js +0 -34
  903. package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js.map +0 -1
  904. package/extensions/Project/EnsureTelemetryEnabledForOss.d.ts +0 -13
  905. package/extensions/Project/EnsureTelemetryEnabledForOss.js +0 -37
  906. package/extensions/Project/EnsureTelemetryEnabledForOss.js.map +0 -1
  907. package/extensions/Project/TelemetryNoLongerNewUser.d.ts +0 -8
  908. package/extensions/Project/TelemetryNoLongerNewUser.js +0 -14
  909. package/extensions/Project/TelemetryNoLongerNewUser.js.map +0 -1
  910. package/extensions/Project/ValidateEncryptionBeforeDeploy.d.ts +0 -12
  911. package/extensions/Project/ValidateEncryptionBeforeDeploy.js +0 -32
  912. package/extensions/Project/ValidateEncryptionBeforeDeploy.js.map +0 -1
  913. package/extensions/Project/ValidateProductionPulumiState.d.ts +0 -11
  914. package/extensions/Project/ValidateProductionPulumiState.js +0 -37
  915. package/extensions/Project/ValidateProductionPulumiState.js.map +0 -1
  916. package/extensions/hooks/index.js.map +0 -1
  917. package/extensions/infra/index.js.map +0 -1
  918. package/extensions/pulumi/index.js.map +0 -1
  919. package/features/BuildApp/index.js.map +0 -1
  920. package/features/DeployApp/index.js.map +0 -1
  921. package/features/DestroyApp/index.js.map +0 -1
  922. package/features/ExportStack/index.js.map +0 -1
  923. package/features/GetApp/index.js.map +0 -1
  924. package/features/GetAppOutput/index.js.map +0 -1
  925. package/features/GetAppStackOutput/index.js.map +0 -1
  926. package/features/GetFeatureFlags/index.js.map +0 -1
  927. package/features/GetLogger/index.js.map +0 -1
  928. package/features/GetProductionEnvironments/index.js.map +0 -1
  929. package/features/GetProject/index.js.map +0 -1
  930. package/features/GetProjectConfig/index.js.map +0 -1
  931. package/features/GetProjectInfo/index.js.map +0 -1
  932. package/features/GetPulumiResourceNamePrefix/index.js.map +0 -1
  933. package/features/InstallExtension/index.js.map +0 -1
  934. package/features/IsCi/index.js.map +0 -1
  935. package/features/IsTelemetryEnabled/index.js.map +0 -1
  936. package/features/IsWcpEnabled/index.js.map +0 -1
  937. package/features/IsWebinyJsRepo/index.js.map +0 -1
  938. package/features/RefreshApp/index.js.map +0 -1
  939. package/features/RunPulumiCommand/index.js.map +0 -1
  940. package/features/ValidateProjectConfig/index.js.map +0 -1
  941. package/features/Watch/getIotEndpoint.d.ts +0 -2
  942. package/features/Watch/getIotEndpoint.js +0 -16
  943. package/features/Watch/getIotEndpoint.js.map +0 -1
  944. package/features/Watch/index.js.map +0 -1
  945. package/features/Watch/replaceLambdaFunctions.d.ts +0 -19
  946. package/features/Watch/replaceLambdaFunctions.js +0 -95
  947. package/features/Watch/replaceLambdaFunctions.js.map +0 -1
  948. package/features/hooks/AdminAfterBuild/index.js.map +0 -1
  949. package/features/hooks/AdminAfterDeploy/index.js.map +0 -1
  950. package/features/hooks/AdminBeforeBuild/index.js.map +0 -1
  951. package/features/hooks/AdminBeforeDeploy/index.js.map +0 -1
  952. package/features/hooks/AdminBeforeWatch/index.js.map +0 -1
  953. package/features/hooks/AfterBuild/index.js.map +0 -1
  954. package/features/hooks/AfterDeploy/index.js.map +0 -1
  955. package/features/hooks/ApiAfterBuild/index.js.map +0 -1
  956. package/features/hooks/ApiAfterDeploy/index.js.map +0 -1
  957. package/features/hooks/ApiBeforeBuild/index.js.map +0 -1
  958. package/features/hooks/ApiBeforeDeploy/index.js.map +0 -1
  959. package/features/hooks/ApiBeforeWatch/index.js.map +0 -1
  960. package/features/hooks/BeforeBuild/index.js.map +0 -1
  961. package/features/hooks/BeforeDeploy/index.js.map +0 -1
  962. package/features/hooks/BeforeWatch/index.js.map +0 -1
  963. package/features/hooks/CoreAfterBuild/index.js.map +0 -1
  964. package/features/hooks/CoreAfterDeploy/index.js.map +0 -1
  965. package/features/hooks/CoreBeforeBuild/index.js.map +0 -1
  966. package/features/hooks/CoreBeforeDeploy/index.js.map +0 -1
  967. package/features/hooks/CoreBeforeWatch/index.js.map +0 -1
  968. package/features/hooks/index.js.map +0 -1
  969. package/features/index.js.map +0 -1
  970. package/models/index.js.map +0 -1
  971. package/services/BuildAppWorkspaceService/index.js.map +0 -1
  972. package/services/BuildProjectWorkspaceService/index.js.map +0 -1
  973. package/services/GetAppPackagesService/index.js.map +0 -1
  974. package/services/GetAppService/index.js.map +0 -1
  975. package/services/GetCwdService/index.js.map +0 -1
  976. package/services/GetProjectConfigService/index.js.map +0 -1
  977. package/services/GetProjectConfigService/renderConfigWorker.d.ts +0 -1
  978. package/services/GetProjectConfigService/renderConfigWorker.js +0 -68
  979. package/services/GetProjectConfigService/renderConfigWorker.js.map +0 -1
  980. package/services/GetProjectIdService/index.js.map +0 -1
  981. package/services/GetProjectService/index.js.map +0 -1
  982. package/services/GetProjectVersionService/index.js.map +0 -1
  983. package/services/GetPulumiService/GetPulumiService.d.ts +0 -9
  984. package/services/GetPulumiService/GetPulumiService.js +0 -49
  985. package/services/GetPulumiService/GetPulumiService.js.map +0 -1
  986. package/services/GetPulumiService/index.d.ts +0 -1
  987. package/services/GetPulumiService/index.js +0 -3
  988. package/services/GetPulumiService/index.js.map +0 -1
  989. package/services/InitProjectSdkService/index.js.map +0 -1
  990. package/services/InstallExtensionService/index.js.map +0 -1
  991. package/services/InstallExtensionService/types.js.map +0 -1
  992. package/services/IsRemotePulumiBackendService/index.js.map +0 -1
  993. package/services/ListAppLambdaFunctionsService/index.js.map +0 -1
  994. package/services/ListDeployedEnvironmentsService/index.js.map +0 -1
  995. package/services/ListPackagesInAppWorkspaceService/index.js.map +0 -1
  996. package/services/ListPackagesService/index.js.map +0 -1
  997. package/services/LoadEnvVarsService/index.js.map +0 -1
  998. package/services/LocalStorageService/index.js.map +0 -1
  999. package/services/LoggerService/index.js.map +0 -1
  1000. package/services/ProjectInfoService/index.js.map +0 -1
  1001. package/services/ProjectSdkParamsService/index.js.map +0 -1
  1002. package/services/PulumiExportService/index.js.map +0 -1
  1003. package/services/PulumiGetConfigPassphraseService/index.js.map +0 -1
  1004. package/services/PulumiGetSecretsProviderService/index.js.map +0 -1
  1005. package/services/PulumiGetStackOutputService/index.js.map +0 -1
  1006. package/services/PulumiImportService/index.js.map +0 -1
  1007. package/services/PulumiLoginService/index.js.map +0 -1
  1008. package/services/PulumiSelectStackService/index.js.map +0 -1
  1009. package/services/SetProjectIdService/index.js.map +0 -1
  1010. package/services/StdioService/index.js.map +0 -1
  1011. package/services/UiService/index.js.map +0 -1
  1012. package/services/ValidateProjectConfigService/index.js.map +0 -1
  1013. package/services/WatchedLambdaFunctionsService/index.js.map +0 -1
  1014. package/services/WcpService/index.js.map +0 -1
  1015. package/services/index.js.map +0 -1
  1016. package/utils/env/index.js.map +0 -1
  1017. package/utils/env/types.js.map +0 -1
  1018. package/utils/getTemplatesFolderPath.d.ts +0 -1
  1019. package/utils/getTemplatesFolderPath.js +0 -13
  1020. package/utils/getTemplatesFolderPath.js.map +0 -1
  1021. package/utils/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["defineExtension","zodSrcPath","ExtensionSrcResolver","z","path","Node","Project","crypto","AdminExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsxFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","resolvePath","extensionFileName","basename","parse","name","hash","createHash","update","digest","componentName","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","extensionsIdentifier","getFirstDescendant","node","isIdentifier","getText","Error","extensionsArrowFn","getNextSibling","isArrowFunction","extensionsArrowFnFragment","isJsxFragment","extensionsArrowFnFragmentChildrenText","getFullText","trim","replaceWithText","save"],"sources":["AdminExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Extend the Admin application with custom functionality.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Import as default export if available, otherwise import named export.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n extensionsArrowFnFragment.replaceWithText(\n `<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`\n );\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU;AACpC,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,CAAC,QAAQ,KAAK;AACvB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAA2BC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AAC1D,OAAOC,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,cAAc,GAAGR,eAAe,CAAC;EAC1CS,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAQ,CAAC;EACvDC,WAAW,EAAE,yDAAyD;EACtEC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC3B,OAAOb,CAAC,CAACc,MAAM,CAAC;MACZC,GAAG,EAAEjB,UAAU,CA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AO,CAAC,CAAC,KAAK,YAAY;IAC1C,CAAC,CAAC;IAEF,IAAI,CAACJ,oBAAoB,EAAE;MACvB,MAAM,IAAIK,KAAK,CACX,uDAAuDhD,qBAAqB,oDAChF,CAAC;IACL;IAEA,MAAMiD,iBAAiB,GAAGN,oBAAoB,CAACO,cAAc,CAACL,IAAI,IAC9DjE,IAAI,CAACuE,eAAe,CAACN,IAAI,CAC7B,CAAC;IACD,IAAI,CAACI,iBAAiB,EAAE;MACpB,MAAM,IAAID,KAAK,CACX,uDAAuDhD,qBAAqB,yEAChF,CAAC;IACL;IAEA,MAAMoD,yBAAyB,GAAGH,iBAAiB,CAACL,kBAAkB,CAACC,IAAI,IAAI;MAC3E,OAAOjE,IAAI,CAACyE,aAAa,CAACR,IAAI,CAAC;IACnC,CAAC,CAAgB;IAEjB,MAAMS,qCAAqC,GAAGF,yBAAyB,CAClEG,WAAW,CAAC,CAAC,CACblC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CACjBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAClBmC,IAAI,CAAC,CAAC;IAEXJ,yBAAyB,CAACK,eAAe,CACrC,MAAMzC,aAAa,KAAKsC,qCAAqC,KACjE,CAAC;IAED,MAAM/B,MAAM,CAACmC,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/AdminExtension.js","sources":["../../src/extensions/AdminExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { type JsxFragment, Node, Project } from \"ts-morph\";\nimport crypto from \"crypto\";\nimport { hasDefaultExport } from \"./hasDefaultExport.js\";\n\nexport const AdminExtension = defineExtension({\n type: \"Admin/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"admin\" },\n description: \"Extend the Admin application with custom functionality.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsxFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"admin\", \"src\", \"Extensions.tsx\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name can be customized or defaults to the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Generate a constant hash-based component name to avoid using timestamps.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const componentName = `AdminExtension_${hash.slice(-10)}`;\n\n const project = new Project();\n\n const importPath = path\n .relative(path.dirname(extensionsTsxFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n project.addSourceFileAtPath(extensionsTsxFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsxFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n // Check if the extension file has a default export or named export.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Import as default export if available, otherwise import named export.\n if (hasDefaultExport(extensionSource)) {\n source.insertImportDeclaration(index, {\n defaultImport: componentName,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: componentName }],\n moduleSpecifier: importPath\n });\n }\n\n const extensionsIdentifier = source.getFirstDescendant(node => {\n if (!Node.isIdentifier(node)) {\n return false;\n }\n\n return node.getText() === \"Extensions\";\n });\n\n if (!extensionsIdentifier) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change the name of the component?`\n );\n }\n\n const extensionsArrowFn = extensionsIdentifier.getNextSibling(node =>\n Node.isArrowFunction(node)\n );\n if (!extensionsArrowFn) {\n throw new Error(\n `Could not find the \"Extensions\" React component in \"${extensionsTsxFilePath}\". Did you maybe change its definition? It should be an arrow function.`\n );\n }\n\n const extensionsArrowFnFragment = extensionsArrowFn.getFirstDescendant(node => {\n return Node.isJsxFragment(node);\n }) as JsxFragment;\n\n const extensionsArrowFnFragmentChildrenText = extensionsArrowFnFragment\n .getFullText()\n .replace(\"<>\", \"\")\n .replace(\"</>\", \"\")\n .trim();\n\n extensionsArrowFnFragment.replaceWithText(\n `<><${componentName}/>${extensionsArrowFnFragmentChildrenText}</>`\n );\n\n await source.save();\n }\n});\n"],"names":["AdminExtension","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsxFilePath","extensionFilePath","absoluteExtensionFilePath","ExtensionSrcResolver","extensionFileName","path","exportName","hash","crypto","componentName","Project","importPath","source","existingImportDeclaration","extensionProject","extensionSource","index","importDeclarations","last","hasDefaultExport","extensionsIdentifier","node","Node","Error","extensionsArrowFn","extensionsArrowFnFragment","extensionsArrowFnFragmentChildrenText"],"mappings":";;;;;;;AAQO,MAAMA,iBAAiBC,gBAAgB;IAC1C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAQ;IACtD,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,wBAAwBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAC1D,IAAI,CAAC,QAAQ,SAAS,OAAO,kBAC7B,QAAQ;QAEb,MAAM,EA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,OAAO;YAGX,OAAOA,AAAmB,iBAAnBA,KAAK,OAAO;QACvB;QAEA,IAAI,CAACD,sBACD,MAAM,IAAIG,MACN,CAAC,oDAAoD,EAAEvB,sBAAsB,kDAAkD,CAAC;QAIxI,MAAMwB,oBAAoBJ,qBAAqB,cAAc,CAACC,CAAAA,OAC1DC,KAAK,eAAe,CAACD;QAEzB,IAAI,CAACG,mBACD,MAAM,IAAID,MACN,CAAC,oDAAoD,EAAEvB,sBAAsB,uEAAuE,CAAC;QAI7J,MAAMyB,4BAA4BD,kBAAkB,kBAAkB,CAACH,CAAAA,OAC5DC,KAAK,aAAa,CAACD;QAG9B,MAAMK,wCAAwCD,0BACzC,WAAW,GACX,OAAO,CAAC,MAAM,IACd,OAAO,CAAC,OAAO,IACf,IAAI;QAETA,0BAA0B,eAAe,CACrC,CAAC,GAAG,EAAEhB,cAAc,EAAE,EAAEiB,sCAAsC,GAAG,CAAC;QAGtE,MAAMd,OAAO,IAAI;IACrB;AACJ"}
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as
4
+ * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL
5
+ * from the API URL (same origin, http -> ws), which is what the standalone hosting type needs by
6
+ * default. Set it only when WebSockets are served from a different origin than the API. Because the
7
+ * config is evaluated at build time, the value can come from any env var the user chooses, e.g.
8
+ * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.
9
+ */
10
+ export declare const AdminWebsocketsUrl: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
11
+ url: z.ZodString;
12
+ }, z.core.$strip>>;
@@ -0,0 +1,21 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "../defineExtension/index.js";
4
+ import { EnvVar } from "./EnvVar.js";
5
+ const AdminWebsocketsUrl = defineExtension({
6
+ type: "Admin/WebsocketsUrl",
7
+ tags: {
8
+ runtimeContext: "project"
9
+ },
10
+ description: "Set a dedicated WebSocket URL for the Admin app.",
11
+ paramsSchema: z.object({
12
+ url: z.string().describe("The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002")
13
+ }),
14
+ render: (props)=>/*#__PURE__*/ react.createElement(EnvVar, {
15
+ varName: "WEBINY_ADMIN_WS_API_URL",
16
+ value: props.url
17
+ })
18
+ });
19
+ export { AdminWebsocketsUrl };
20
+
21
+ //# sourceMappingURL=AdminWebsocketsUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws), which is what the standalone hosting type needs by\n * default. Set it only when WebSockets are served from a different origin than the API. Because the\n * config is evaluated at build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\"The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002\")\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAaO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CAAC;IAClB;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
@@ -1,53 +1,42 @@
1
1
  import { z } from "zod";
2
2
  import { Node, Project } from "ts-morph";
3
3
  import { defineExtension } from "../defineExtension/index.js";
4
- import crypto from "crypto";
4
+ import crypto_0 from "crypto";
5
5
  import path from "path";
6
6
  import fs from "fs";
7
- export const BuildParam = defineExtension({
8
- type: "Api/BuildParam",
9
- tags: {
10
- runtimeContext: "app-build",
11
- appName: "api"
12
- },
13
- description: "Add build-time parameter to API app.",
14
- multiple: true,
15
- paramsSchema: () => {
16
- return z.object({
17
- paramName: z.string(),
18
- value: z.union([z.string(), z.record(z.string(), z.any()), z.array(z.any()), z.number(), z.boolean()])
19
- });
20
- },
21
- async build(params, ctx) {
22
- const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
23
- const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
24
- const {
25
- paramName,
26
- value
27
- } = params;
28
-
29
- // Serialize value to a TypeScript literal.
30
- const valueStr = JSON.stringify(value, null, 4);
31
-
32
- // Generate a unique class name based on the paramName.
33
- const hash = crypto.createHash("sha256").update(paramName).digest("hex");
34
- const className = `BuildParam_${hash.slice(-10)}`;
35
- const fileName = `${className}.ts`;
36
- const filePath = path.join(buildParamsDir, fileName);
37
-
38
- // Ensure buildParams directory exists.
39
- if (!fs.existsSync(buildParamsDir)) {
40
- fs.mkdirSync(buildParamsDir, {
41
- recursive: true
42
- });
43
- }
44
-
45
- // Check if file already exists.
46
- if (fs.existsSync(filePath)) {
47
- // File exists, just ensure it's imported in extensions.ts
48
- } else {
49
- // Create the BuildParam implementation file.
50
- const fileContent = `import { BuildParam } from "webiny/api/build-params";
7
+ const BuildParam = defineExtension({
8
+ type: "Api/BuildParam",
9
+ tags: {
10
+ runtimeContext: "app-build",
11
+ appName: "api"
12
+ },
13
+ description: "Add build-time parameter to API app.",
14
+ multiple: true,
15
+ paramsSchema: ()=>z.object({
16
+ paramName: z.string(),
17
+ value: z.union([
18
+ z.string(),
19
+ z.record(z.string(), z.any()),
20
+ z.array(z.any()),
21
+ z.number(),
22
+ z.boolean()
23
+ ])
24
+ }),
25
+ async build (params, ctx) {
26
+ const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
27
+ const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
28
+ const { paramName, value } = params;
29
+ const valueStr = JSON.stringify(value, null, 4);
30
+ const hash = crypto_0.createHash("sha256").update(paramName).digest("hex");
31
+ const className = `BuildParam_${hash.slice(-10)}`;
32
+ const fileName = `${className}.ts`;
33
+ const filePath = path.join(buildParamsDir, fileName);
34
+ if (!fs.existsSync(buildParamsDir)) fs.mkdirSync(buildParamsDir, {
35
+ recursive: true
36
+ });
37
+ if (fs.existsSync(filePath)) ;
38
+ else {
39
+ const fileContent = `import { BuildParam } from "webiny/api/build-params";
51
40
 
52
41
  class ${className} implements BuildParam.Interface {
53
42
  key = "${paramName}";
@@ -59,61 +48,48 @@ export default BuildParam.createImplementation({
59
48
  dependencies: []
60
49
  });
61
50
  `;
62
- fs.writeFileSync(filePath, fileContent, "utf8");
63
- }
64
-
65
- // Now update extensions.ts to import and register this BuildParam.
66
- const project = new Project();
67
- project.addSourceFileAtPath(extensionsTsFilePath);
68
- const source = project.getSourceFileOrThrow(extensionsTsFilePath);
69
-
70
- // Calculate import path relative to extensions.ts.
71
- let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
72
-
73
- // Ensure the path starts with ./
74
- if (!importPath.startsWith(".")) {
75
- importPath = "./" + importPath;
76
- }
77
-
78
- // Check if import already exists.
79
- const existingImportDeclaration = source.getImportDeclaration(importPath);
80
- if (existingImportDeclaration) {
81
- return;
82
- }
83
- let index = 1;
84
- const importDeclarations = source.getImportDeclarations();
85
- if (importDeclarations.length) {
86
- const last = importDeclarations[importDeclarations.length - 1];
87
- index = last.getChildIndex() + 1;
88
- }
89
-
90
- // Add import for the BuildParam implementation.
91
- source.insertImportDeclaration(index, {
92
- defaultImport: className,
93
- moduleSpecifier: importPath
94
- });
95
-
96
- // Add the registration to the plugins array.
97
- const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
98
- pluginsArray.addElement(`\ncreateRegisterExtensionPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
99
- {
100
- let index = 1;
101
- const importDeclarations = source.getImportDeclarations();
102
- if (importDeclarations.length) {
103
- const last = importDeclarations[importDeclarations.length - 1];
104
- index = last.getChildIndex() + 1;
105
- }
106
- const contextPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
107
- const existingContextPluginImport = source.getImportDeclaration(contextPluginImportPath);
108
- if (!existingContextPluginImport) {
51
+ fs.writeFileSync(filePath, fileContent, "utf8");
52
+ }
53
+ const project = new Project();
54
+ project.addSourceFileAtPath(extensionsTsFilePath);
55
+ const source = project.getSourceFileOrThrow(extensionsTsFilePath);
56
+ let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
57
+ if (!importPath.startsWith(".")) importPath = "./" + importPath;
58
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
59
+ if (existingImportDeclaration) return;
60
+ let index = 1;
61
+ const importDeclarations = source.getImportDeclarations();
62
+ if (importDeclarations.length) {
63
+ const last = importDeclarations[importDeclarations.length - 1];
64
+ index = last.getChildIndex() + 1;
65
+ }
109
66
  source.insertImportDeclaration(index, {
110
- namedImports: ["createRegisterExtensionPlugin"],
111
- moduleSpecifier: contextPluginImportPath
67
+ defaultImport: className,
68
+ moduleSpecifier: importPath
112
69
  });
113
- }
70
+ const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
71
+ pluginsArray.addElement(`\ncreateRegisterBuildParamPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
72
+ {
73
+ let index = 1;
74
+ const importDeclarations = source.getImportDeclarations();
75
+ if (importDeclarations.length) {
76
+ const last = importDeclarations[importDeclarations.length - 1];
77
+ index = last.getChildIndex() + 1;
78
+ }
79
+ const contextPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
80
+ const existingImport = source.getImportDeclaration(contextPluginImportPath);
81
+ if (existingImport) {
82
+ if (!existingImport.getNamedImports().some((i)=>"createRegisterBuildParamPlugin" === i.getName())) existingImport.addNamedImport("createRegisterBuildParamPlugin");
83
+ } else source.insertImportDeclaration(index, {
84
+ namedImports: [
85
+ "createRegisterBuildParamPlugin"
86
+ ],
87
+ moduleSpecifier: contextPluginImportPath
88
+ });
89
+ }
90
+ await source.save();
114
91
  }
115
- await source.save();
116
- }
117
92
  });
93
+ export { BuildParam };
118
94
 
119
95
  //# sourceMappingURL=ApiBuildParam.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["z","Node","Project","defineExtension","crypto","path","fs","BuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","ctx","extensionsTsFilePath","project","paths","workspaceFolder","join","toString","buildParamsDir","valueStr","JSON","stringify","hash","createHash","update","digest","className","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent","writeFileSync","addSourceFileAtPath","source","getSourceFileOrThrow","importPath","relative","dirname","replace","startsWith","existingImportDeclaration","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","contextPluginImportPath","existingContextPluginImport","namedImports","save"],"sources":["ApiBuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.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 existingContextPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingContextPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,IAAI,EAAEC,OAAO,QAAgC,UAAU;AAChE,SAASC,eAAe;AACxB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AAEnB,OAAO,MAAMC,UAAU,GAAGJ,eAAe,CAAC;EACtCK,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAM,CAAC;EACrDC,WAAW,EAAE,sCAAsC;EACnDC,QAA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ACJ,CAAC,CAAC","ignoreList":[]}
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 `\\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","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;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,CA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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,102 +1,83 @@
1
1
  import { defineExtension, zodSrcPath } from "./index.js";
2
- import { ExtensionSrcResolver } from "@webiny/project";
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
- import crypto from "crypto";
7
- export const ApiExtension = defineExtension({
8
- type: "Api/Extension",
9
- tags: {
10
- runtimeContext: "app-build",
11
- appName: "api"
12
- },
13
- description: "Add any API extension.",
14
- multiple: true,
15
- paramsSchema: ({
16
- project
17
- }) => {
18
- return z.object({
19
- src: zodSrcPath({
20
- project
21
- }),
22
- exportName: z.string().optional()
23
- });
24
- },
25
- async build(params, ctx) {
26
- const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
27
- const {
28
- src: extensionFilePath
29
- } = params;
30
-
31
- // Resolve to absolute path for file operations.
32
- const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
33
- const extensionFileName = path.basename(absoluteExtensionFilePath);
34
-
35
- // Export name is always the file name without extension.
36
- const exportName = params.exportName ?? path.parse(extensionFileName).name;
37
-
38
- // Alias name is "ApiExtension_" + hash of the file path. This way we
39
- // avoid potential naming conflicts and keep the identifier constant.
40
- const hash = crypto.createHash("sha256").update(extensionFilePath).digest("hex");
41
- const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;
42
-
43
- // Calculate import path relative to `extensions.ts` file.
44
- const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
45
- const project = new Project();
46
- project.addSourceFileAtPath(extensionsTsFilePath);
47
- const source = project.getSourceFileOrThrow(extensionsTsFilePath);
48
- const existingImportDeclaration = source.getImportDeclaration(importPath);
49
- if (existingImportDeclaration) {
50
- return;
51
- }
52
- let index = 1;
53
- const importDeclarations = source.getImportDeclarations();
54
- if (importDeclarations.length) {
55
- const last = importDeclarations[importDeclarations.length - 1];
56
- index = last.getChildIndex() + 1;
57
- }
58
-
59
- // Check if the file has a default export using AST parsing.
60
- const extensionProject = new Project();
61
- extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
62
- const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
63
- const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;
64
-
65
- // Support both default and named exports.
66
- if (hasDefaultExport) {
67
- source.insertImportDeclaration(index, {
68
- defaultImport: exportNameAlias,
69
- moduleSpecifier: importPath
70
- });
71
- } else {
72
- source.insertImportDeclaration(index, {
73
- namedImports: [{
74
- name: exportName,
75
- alias: exportNameAlias
76
- }],
77
- moduleSpecifier: importPath
78
- });
79
- }
80
- const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
81
- pluginsArray.addElement(`\ncreateRegisterExtensionPlugin(ctx => {\n\tregisterExtension(ctx.container, ${exportNameAlias});\n})`);
82
- {
83
- let index = 1;
84
- const importDeclarations = source.getImportDeclarations();
85
- if (importDeclarations.length) {
86
- const last = importDeclarations[importDeclarations.length - 1];
87
- index = last.getChildIndex() + 1;
88
- }
89
- const registerExtensionPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
90
- const existingContextPluginImport = source.getImportDeclaration(registerExtensionPluginImportPath);
91
- if (!existingContextPluginImport) {
92
- source.insertImportDeclaration(index, {
93
- namedImports: ["createRegisterExtensionPlugin"],
94
- moduleSpecifier: registerExtensionPluginImportPath
6
+ import crypto_0 from "crypto";
7
+ import { hasDefaultExport } from "./hasDefaultExport.js";
8
+ const ApiExtension = defineExtension({
9
+ type: "Api/Extension",
10
+ tags: {
11
+ runtimeContext: "app-build",
12
+ appName: "api"
13
+ },
14
+ description: "Add any API extension.",
15
+ multiple: true,
16
+ paramsSchema: ({ project })=>z.object({
17
+ src: zodSrcPath({
18
+ project
19
+ }),
20
+ exportName: z.string().optional()
21
+ }),
22
+ async build (params, ctx) {
23
+ const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
24
+ const { src: extensionFilePath } = params;
25
+ const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(extensionFilePath, ctx.project);
26
+ const extensionFileName = path.basename(absoluteExtensionFilePath);
27
+ const exportName = params.exportName ?? path.parse(extensionFileName).name;
28
+ const hash = crypto_0.createHash("sha256").update(extensionFilePath).digest("hex");
29
+ const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;
30
+ const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath).replace(/\.tsx?$/, ".js");
31
+ const project = new Project();
32
+ project.addSourceFileAtPath(extensionsTsFilePath);
33
+ const source = project.getSourceFileOrThrow(extensionsTsFilePath);
34
+ const existingImportDeclaration = source.getImportDeclaration(importPath);
35
+ if (existingImportDeclaration) return;
36
+ let index = 1;
37
+ const importDeclarations = source.getImportDeclarations();
38
+ if (importDeclarations.length) {
39
+ const last = importDeclarations[importDeclarations.length - 1];
40
+ index = last.getChildIndex() + 1;
41
+ }
42
+ const extensionProject = new Project();
43
+ extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);
44
+ const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);
45
+ if (hasDefaultExport(extensionSource)) source.insertImportDeclaration(index, {
46
+ defaultImport: exportNameAlias,
47
+ moduleSpecifier: importPath
48
+ });
49
+ else source.insertImportDeclaration(index, {
50
+ namedImports: [
51
+ {
52
+ name: exportName,
53
+ alias: exportNameAlias
54
+ }
55
+ ],
56
+ moduleSpecifier: importPath
95
57
  });
96
- }
58
+ const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
59
+ pluginsArray.addElement(`\ncreateRegisterExtensionPlugin(ctx => {\n\tregisterExtension(ctx.container, ${exportNameAlias});\n})`);
60
+ {
61
+ let index = 1;
62
+ const importDeclarations = source.getImportDeclarations();
63
+ if (importDeclarations.length) {
64
+ const last = importDeclarations[importDeclarations.length - 1];
65
+ index = last.getChildIndex() + 1;
66
+ }
67
+ const registerExtensionPluginImportPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
68
+ const existingRegisterExtensionPluginImport = source.getImportDeclaration(registerExtensionPluginImportPath);
69
+ if (existingRegisterExtensionPluginImport) {
70
+ if (!existingRegisterExtensionPluginImport.getNamedImports().some((i)=>"createRegisterExtensionPlugin" === i.getName())) existingRegisterExtensionPluginImport.addNamedImport("createRegisterExtensionPlugin");
71
+ } else source.insertImportDeclaration(index, {
72
+ namedImports: [
73
+ "createRegisterExtensionPlugin"
74
+ ],
75
+ moduleSpecifier: registerExtensionPluginImportPath
76
+ });
77
+ }
78
+ await source.save();
97
79
  }
98
- await source.save();
99
- }
100
80
  });
81
+ export { ApiExtension };
101
82
 
102
83
  //# sourceMappingURL=ApiExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["defineExtension","zodSrcPath","ExtensionSrcResolver","z","path","Node","Project","crypto","ApiExtension","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","src","exportName","string","optional","build","params","ctx","extensionsTsFilePath","paths","workspaceFolder","join","toString","extensionFilePath","absoluteExtensionFilePath","resolvePath","extensionFileName","basename","parse","name","hash","createHash","update","digest","exportNameAlias","slice","importPath","relative","dirname","replace","addSourceFileAtPath","source","getSourceFileOrThrow","existingImportDeclaration","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","extensionProject","extensionSource","hasDefaultExport","getDefaultExportSymbol","undefined","insertImportDeclaration","defaultImport","moduleSpecifier","namedImports","alias","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","registerExtensionPluginImportPath","existingContextPluginImport","save"],"sources":["ApiExtension.ts"],"sourcesContent":["import { defineExtension, zodSrcPath } from \"~/extensions/index.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project\";\nimport { z } from \"zod\";\nimport path from \"path\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport crypto from \"crypto\";\n\nexport const ApiExtension = defineExtension({\n type: \"Api/Extension\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add any API extension.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n src: zodSrcPath({ project }),\n exportName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const { src: extensionFilePath } = params;\n\n // Resolve to absolute path for file operations.\n const absoluteExtensionFilePath = ExtensionSrcResolver.resolvePath(\n extensionFilePath,\n ctx.project\n );\n\n const extensionFileName = path.basename(absoluteExtensionFilePath);\n\n // Export name is always the file name without extension.\n const exportName = params.exportName ?? path.parse(extensionFileName).name;\n\n // Alias name is \"ApiExtension_\" + hash of the file path. This way we\n // avoid potential naming conflicts and keep the identifier constant.\n const hash = crypto.createHash(\"sha256\").update(extensionFilePath).digest(\"hex\");\n const exportNameAlias = `ApiExtension_${hash.slice(-10)}`;\n\n // Calculate import path relative to `extensions.ts` file.\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteExtensionFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Check if the file has a default export using AST parsing.\n const extensionProject = new Project();\n extensionProject.addSourceFileAtPath(absoluteExtensionFilePath);\n const extensionSource = extensionProject.getSourceFileOrThrow(absoluteExtensionFilePath);\n const hasDefaultExport = extensionSource.getDefaultExportSymbol() !== undefined;\n\n // Support both default and named exports.\n if (hasDefaultExport) {\n source.insertImportDeclaration(index, {\n defaultImport: exportNameAlias,\n moduleSpecifier: importPath\n });\n } else {\n source.insertImportDeclaration(index, {\n namedImports: [{ name: exportName, alias: exportNameAlias }],\n moduleSpecifier: importPath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\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 existingContextPluginImport = source.getImportDeclaration(\n registerExtensionPluginImportPath\n );\n if (!existingContextPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: registerExtensionPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU;AACpC,SAASC,oBAAoB,QAAQ,iBAAiB;AACtD,SAASC,CAAC,QAAQ,KAAK;AACvB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,IAAI,EAAEC,OAAO,QAAgC,UAAU;AAChE,OAAOC,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,YAAY,GAAGR,eAAe,CAAC;EACxCS,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;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B,CAAC,CAAC;IACN;IAEA,MAAMyB,YAAY,GAAGpB,MAAM,CAACqB,kBAAkB,CAACC,IAAI,IAC/CjE,IAAI,CAACkE,wBAAwB,CAACD,IAAI,CACtC,CAA2B;IAE3BF,YAAY,CAACI,UAAU,CACnB,gFAAgF/B,eAAe,QACnG,CAAC;IAED;MACI,IAAIW,KAAK,GAAG,CAAC;MAEb,MAAMC,kBAAkB,GAAGL,MAAM,CAACM,qBAAqB,CAAC,CAAC;MACzD,IAAID,kBAAkB,CAACE,MAAM,EAAE;QAC3B,MAAMC,IAAI,GAAGH,kBAAkB,CAACA,kBAAkB,CAACE,MAAM,GAAG,CAAC,CAAC;QAC9DH,KAAK,GAAGI,IAAI,CAACC,aAAa,CAAC,CAAC,GAAG,CAAC;MACpC;MAEA,MAAMgB,iCAAiC,GACnC,oDAAoD;MACxD,MAAMC,2BAA2B,GAAG1B,MAAM,CAACG,oBAAoB,CAC3DsB,iCACJ,CAAC;MACD,IAAI,CAACC,2BAA2B,EAAE;QAC9B1B,MAAM,CAACe,uBAAuB,CAACX,KAAK,EAAE;UAClCc,YAAY,EAAE,CAAC,+BAA+B,CAAC;UAC/CD,eAAe,EAAEQ;QACrB,CAAC,CAAC;MACN;IACJ;IAEA,MAAMzB,MAAM,CAAC2B,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
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\";\nimport { hasDefaultExport } from \"./hasDefaultExport.js\";\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\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":";;;;;;;AAQO,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,M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;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,4 @@
1
+ import { z } from "zod";
2
+ export declare const ApiMaxBundleSize: import("~/defineExtension/index.js").ExtensionComponent<z.ZodObject<{
3
+ size: z.ZodNumber;
4
+ }, z.core.$strip>>;