@webiny/project 6.6.0-alpha.10 → 6.6.0-alpha.12

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 (398) hide show
  1. package/ProjectSdk.d.ts +8 -19
  2. package/ProjectSdk.js +1 -28
  3. package/ProjectSdk.js.map +1 -1
  4. package/abstractions/features/hooks/index.d.ts +0 -8
  5. package/abstractions/features/hooks/index.js +0 -8
  6. package/abstractions/features/index.d.ts +0 -8
  7. package/abstractions/features/index.js +0 -8
  8. package/abstractions/models/IAppModel.d.ts +0 -2
  9. package/abstractions/models/IProjectModel.d.ts +0 -2
  10. package/abstractions/services/InitHostingSdkService.d.ts +21 -0
  11. package/abstractions/services/InitHostingSdkService.js +5 -0
  12. package/abstractions/services/InitHostingSdkService.js.map +1 -0
  13. package/abstractions/services/ProjectInfoService/ProjectInfoService.d.ts +6 -6
  14. package/abstractions/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  15. package/abstractions/services/ProjectInfoService/index.d.ts +0 -1
  16. package/abstractions/services/ProjectInfoService/index.js +0 -1
  17. package/abstractions/services/index.d.ts +1 -13
  18. package/abstractions/services/index.js +1 -13
  19. package/createProjectSdkContainer.js +1 -3
  20. package/createProjectSdkContainer.js.map +1 -1
  21. package/decorators/index.d.ts +0 -6
  22. package/decorators/index.js +0 -6
  23. package/defineExtension/types.d.ts +1 -1
  24. package/exports/infra/admin.d.ts +0 -2
  25. package/exports/infra/admin.js +0 -2
  26. package/exports/infra/api.d.ts +0 -2
  27. package/exports/infra/api.js +0 -2
  28. package/exports/infra/core.d.ts +0 -2
  29. package/exports/infra/core.js +0 -2
  30. package/exports/infra.d.ts +0 -2
  31. package/exports/infra.js +0 -2
  32. package/extensions/AdminWebsocketsUrl.d.ts +5 -3
  33. package/extensions/AdminWebsocketsUrl.js +1 -1
  34. package/extensions/AdminWebsocketsUrl.js.map +1 -1
  35. package/extensions/DatabaseSetup.d.ts +1 -0
  36. package/extensions/DatabaseSetup.js +4 -3
  37. package/extensions/DatabaseSetup.js.map +1 -1
  38. package/extensions/{pulumi/ProductionEnvironments.js → ProductionEnvironments.js} +2 -2
  39. package/extensions/ProductionEnvironments.js.map +1 -0
  40. package/extensions/api/Route/ApiRoute.d.ts +23 -0
  41. package/extensions/api/Route/ApiRoute.js +92 -0
  42. package/extensions/api/Route/ApiRoute.js.map +1 -0
  43. package/extensions/api/Route/index.d.ts +2 -0
  44. package/extensions/api/Route/index.js +2 -0
  45. package/extensions/api/Route/routePath.d.ts +21 -0
  46. package/extensions/api/Route/routePath.js +10 -0
  47. package/extensions/api/Route/routePath.js.map +1 -0
  48. package/extensions/api/index.d.ts +1 -0
  49. package/extensions/api/index.js +1 -0
  50. package/extensions/hooks/index.d.ts +0 -8
  51. package/extensions/hooks/index.js +0 -8
  52. package/extensions/hosting/extensionImplementations.d.ts +5 -4
  53. package/extensions/hosting/extensionImplementations.js.map +1 -1
  54. package/extensions/index.d.ts +7 -17
  55. package/extensions/index.js +5 -13
  56. package/extensions/index.js.map +1 -1
  57. package/features/GetProductionEnvironments/GetProductionEnvironments.js +1 -1
  58. package/features/GetProductionEnvironments/GetProductionEnvironments.js.map +1 -1
  59. package/features/hooks/index.d.ts +0 -8
  60. package/features/hooks/index.js +0 -8
  61. package/features/index.d.ts +0 -8
  62. package/features/index.js +0 -8
  63. package/index.d.ts +0 -4
  64. package/index.js +1 -5
  65. package/index.js.map +1 -1
  66. package/models/AppModel.js +1 -2
  67. package/models/AppModel.js.map +1 -1
  68. package/models/ProjectModel.js +0 -2
  69. package/models/ProjectModel.js.map +1 -1
  70. package/package.json +8 -14
  71. package/services/GetAppService/GetAppService.js +1 -3
  72. package/services/GetAppService/GetAppService.js.map +1 -1
  73. package/services/GetProjectService/GetProjectService.js +0 -2
  74. package/services/GetProjectService/GetProjectService.js.map +1 -1
  75. package/services/InitProjectSdkService/InitProjectSdkService.d.ts +6 -2
  76. package/services/InitProjectSdkService/InitProjectSdkService.js +18 -12
  77. package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
  78. package/services/InitProjectSdkService/registerHooks.js +4 -16
  79. package/services/InitProjectSdkService/registerHooks.js.map +1 -1
  80. package/services/InstallExtensionService/updateWebinyConfig.js +9 -23
  81. package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
  82. package/services/ProjectInfoService/ProjectInfoService.d.ts +7 -3
  83. package/services/ProjectInfoService/ProjectInfoService.js +3 -11
  84. package/services/ProjectInfoService/ProjectInfoService.js.map +1 -1
  85. package/services/ProjectInfoService/index.d.ts +0 -1
  86. package/services/ProjectInfoService/index.js +0 -1
  87. package/services/SetProjectIdService/SetProjectIdService.js +2 -7
  88. package/services/SetProjectIdService/SetProjectIdService.js.map +1 -1
  89. package/services/index.d.ts +0 -12
  90. package/services/index.js +0 -12
  91. package/utils/ensureNamedImport.d.ts +12 -0
  92. package/utils/ensureNamedImport.js +27 -0
  93. package/utils/ensureNamedImport.js.map +1 -0
  94. package/utils/env/index.d.ts +0 -1
  95. package/utils/env/index.js +0 -1
  96. package/utils/index.d.ts +2 -0
  97. package/utils/index.js +2 -0
  98. package/utils/registerSrcExtensions.d.ts +13 -0
  99. package/utils/registerSrcExtensions.js +10 -0
  100. package/utils/registerSrcExtensions.js.map +1 -0
  101. package/abstractions/features/DeployApp.d.ts +0 -20
  102. package/abstractions/features/DeployApp.js +0 -5
  103. package/abstractions/features/DeployApp.js.map +0 -1
  104. package/abstractions/features/DestroyApp.d.ts +0 -18
  105. package/abstractions/features/DestroyApp.js +0 -5
  106. package/abstractions/features/DestroyApp.js.map +0 -1
  107. package/abstractions/features/ExportStack.d.ts +0 -18
  108. package/abstractions/features/ExportStack.js +0 -5
  109. package/abstractions/features/ExportStack.js.map +0 -1
  110. package/abstractions/features/GetAppOutput.d.ts +0 -18
  111. package/abstractions/features/GetAppOutput.js +0 -5
  112. package/abstractions/features/GetAppOutput.js.map +0 -1
  113. package/abstractions/features/GetAppStackOutput.d.ts +0 -22
  114. package/abstractions/features/GetAppStackOutput.js +0 -5
  115. package/abstractions/features/GetAppStackOutput.js.map +0 -1
  116. package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +0 -7
  117. package/abstractions/features/GetPulumiResourceNamePrefix.js +0 -5
  118. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +0 -1
  119. package/abstractions/features/RefreshApp.d.ts +0 -18
  120. package/abstractions/features/RefreshApp.js +0 -5
  121. package/abstractions/features/RefreshApp.js.map +0 -1
  122. package/abstractions/features/RunPulumiCommand.d.ts +0 -19
  123. package/abstractions/features/RunPulumiCommand.js +0 -5
  124. package/abstractions/features/RunPulumiCommand.js.map +0 -1
  125. package/abstractions/features/hooks/AdminAfterDeploy.d.ts +0 -9
  126. package/abstractions/features/hooks/AdminAfterDeploy.js +0 -5
  127. package/abstractions/features/hooks/AdminAfterDeploy.js.map +0 -1
  128. package/abstractions/features/hooks/AdminBeforeDeploy.d.ts +0 -9
  129. package/abstractions/features/hooks/AdminBeforeDeploy.js +0 -5
  130. package/abstractions/features/hooks/AdminBeforeDeploy.js.map +0 -1
  131. package/abstractions/features/hooks/AfterDeploy.d.ts +0 -9
  132. package/abstractions/features/hooks/AfterDeploy.js +0 -5
  133. package/abstractions/features/hooks/AfterDeploy.js.map +0 -1
  134. package/abstractions/features/hooks/ApiAfterDeploy.d.ts +0 -9
  135. package/abstractions/features/hooks/ApiAfterDeploy.js +0 -5
  136. package/abstractions/features/hooks/ApiAfterDeploy.js.map +0 -1
  137. package/abstractions/features/hooks/ApiBeforeDeploy.d.ts +0 -9
  138. package/abstractions/features/hooks/ApiBeforeDeploy.js +0 -5
  139. package/abstractions/features/hooks/ApiBeforeDeploy.js.map +0 -1
  140. package/abstractions/features/hooks/BeforeDeploy.d.ts +0 -9
  141. package/abstractions/features/hooks/BeforeDeploy.js +0 -5
  142. package/abstractions/features/hooks/BeforeDeploy.js.map +0 -1
  143. package/abstractions/features/hooks/CoreAfterDeploy.d.ts +0 -9
  144. package/abstractions/features/hooks/CoreAfterDeploy.js +0 -5
  145. package/abstractions/features/hooks/CoreAfterDeploy.js.map +0 -1
  146. package/abstractions/features/hooks/CoreBeforeDeploy.d.ts +0 -9
  147. package/abstractions/features/hooks/CoreBeforeDeploy.js +0 -5
  148. package/abstractions/features/hooks/CoreBeforeDeploy.js.map +0 -1
  149. package/abstractions/services/GetPulumiService.d.ts +0 -14
  150. package/abstractions/services/GetPulumiService.js +0 -5
  151. package/abstractions/services/GetPulumiService.js.map +0 -1
  152. package/abstractions/services/IsRemotePulumiBackendService.d.ts +0 -7
  153. package/abstractions/services/IsRemotePulumiBackendService.js +0 -5
  154. package/abstractions/services/IsRemotePulumiBackendService.js.map +0 -1
  155. package/abstractions/services/ListAppLambdaFunctionsService.d.ts +0 -23
  156. package/abstractions/services/ListAppLambdaFunctionsService.js +0 -5
  157. package/abstractions/services/ListAppLambdaFunctionsService.js.map +0 -1
  158. package/abstractions/services/ListDeployedEnvironmentsService.d.ts +0 -12
  159. package/abstractions/services/ListDeployedEnvironmentsService.js +0 -5
  160. package/abstractions/services/ListDeployedEnvironmentsService.js.map +0 -1
  161. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -12
  162. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js +0 -5
  163. package/abstractions/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  164. package/abstractions/services/PulumiExportService.d.ts +0 -13
  165. package/abstractions/services/PulumiExportService.js +0 -6
  166. package/abstractions/services/PulumiExportService.js.map +0 -1
  167. package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +0 -7
  168. package/abstractions/services/PulumiGetConfigPassphraseService.js +0 -5
  169. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +0 -1
  170. package/abstractions/services/PulumiGetSecretsProviderService.d.ts +0 -7
  171. package/abstractions/services/PulumiGetSecretsProviderService.js +0 -5
  172. package/abstractions/services/PulumiGetSecretsProviderService.js.map +0 -1
  173. package/abstractions/services/PulumiGetStackOutputService.d.ts +0 -13
  174. package/abstractions/services/PulumiGetStackOutputService.js +0 -5
  175. package/abstractions/services/PulumiGetStackOutputService.js.map +0 -1
  176. package/abstractions/services/PulumiImportService.d.ts +0 -8
  177. package/abstractions/services/PulumiImportService.js +0 -5
  178. package/abstractions/services/PulumiImportService.js.map +0 -1
  179. package/abstractions/services/PulumiLoginService.d.ts +0 -16
  180. package/abstractions/services/PulumiLoginService.js +0 -5
  181. package/abstractions/services/PulumiLoginService.js.map +0 -1
  182. package/abstractions/services/PulumiSelectStackService.d.ts +0 -10
  183. package/abstractions/services/PulumiSelectStackService.js +0 -5
  184. package/abstractions/services/PulumiSelectStackService.js.map +0 -1
  185. package/abstractions/services/StackOutputCacheService.d.ts +0 -10
  186. package/abstractions/services/StackOutputCacheService.js +0 -5
  187. package/abstractions/services/StackOutputCacheService.js.map +0 -1
  188. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +0 -28
  189. package/abstractions/services/WatchedLambdaFunctionsService.js +0 -5
  190. package/abstractions/services/WatchedLambdaFunctionsService.js.map +0 -1
  191. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +0 -17
  192. package/decorators/DeployAppClearWatchedLambdaFunctions.js +0 -32
  193. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +0 -1
  194. package/decorators/DeployAppRefreshStackOutputCache.d.ts +0 -17
  195. package/decorators/DeployAppRefreshStackOutputCache.js +0 -32
  196. package/decorators/DeployAppRefreshStackOutputCache.js.map +0 -1
  197. package/decorators/DeployAppWithHooks.d.ts +0 -17
  198. package/decorators/DeployAppWithHooks.js +0 -58
  199. package/decorators/DeployAppWithHooks.js.map +0 -1
  200. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +0 -17
  201. package/decorators/DeployAppWithWatchedLambdaReplacement.js +0 -39
  202. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +0 -1
  203. package/decorators/DestroyAppClearStackOutputCache.d.ts +0 -25
  204. package/decorators/DestroyAppClearStackOutputCache.js +0 -29
  205. package/decorators/DestroyAppClearStackOutputCache.js.map +0 -1
  206. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +0 -11
  207. package/decorators/GetPulumiServiceWithDownloadInfo.js +0 -27
  208. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +0 -1
  209. package/extensions/hooks/AdminAfterDeploy.d.ts +0 -4
  210. package/extensions/hooks/AdminAfterDeploy.js +0 -23
  211. package/extensions/hooks/AdminAfterDeploy.js.map +0 -1
  212. package/extensions/hooks/AdminBeforeDeploy.d.ts +0 -4
  213. package/extensions/hooks/AdminBeforeDeploy.js +0 -23
  214. package/extensions/hooks/AdminBeforeDeploy.js.map +0 -1
  215. package/extensions/hooks/AfterDeploy.d.ts +0 -4
  216. package/extensions/hooks/AfterDeploy.js +0 -22
  217. package/extensions/hooks/AfterDeploy.js.map +0 -1
  218. package/extensions/hooks/ApiAfterDeploy.d.ts +0 -4
  219. package/extensions/hooks/ApiAfterDeploy.js +0 -23
  220. package/extensions/hooks/ApiAfterDeploy.js.map +0 -1
  221. package/extensions/hooks/ApiBeforeDeploy.d.ts +0 -4
  222. package/extensions/hooks/ApiBeforeDeploy.js +0 -23
  223. package/extensions/hooks/ApiBeforeDeploy.js.map +0 -1
  224. package/extensions/hooks/BeforeDeploy.d.ts +0 -4
  225. package/extensions/hooks/BeforeDeploy.js +0 -22
  226. package/extensions/hooks/BeforeDeploy.js.map +0 -1
  227. package/extensions/hooks/CoreAfterDeploy.d.ts +0 -4
  228. package/extensions/hooks/CoreAfterDeploy.js +0 -23
  229. package/extensions/hooks/CoreAfterDeploy.js.map +0 -1
  230. package/extensions/hooks/CoreBeforeDeploy.d.ts +0 -4
  231. package/extensions/hooks/CoreBeforeDeploy.js +0 -23
  232. package/extensions/hooks/CoreBeforeDeploy.js.map +0 -1
  233. package/extensions/pulumi/ProductionEnvironments.js.map +0 -1
  234. package/extensions/pulumi/PulumiResourceNamePrefix.d.ts +0 -4
  235. package/extensions/pulumi/PulumiResourceNamePrefix.js +0 -16
  236. package/extensions/pulumi/PulumiResourceNamePrefix.js.map +0 -1
  237. package/extensions/pulumi/index.d.ts +0 -2
  238. package/extensions/pulumi/index.js +0 -2
  239. package/features/DeployApp/DeployApp.d.ts +0 -14
  240. package/features/DeployApp/DeployApp.js +0 -86
  241. package/features/DeployApp/DeployApp.js.map +0 -1
  242. package/features/DeployApp/index.d.ts +0 -1
  243. package/features/DeployApp/index.js +0 -1
  244. package/features/DestroyApp/DestroyApp.d.ts +0 -14
  245. package/features/DestroyApp/DestroyApp.js +0 -66
  246. package/features/DestroyApp/DestroyApp.js.map +0 -1
  247. package/features/DestroyApp/index.d.ts +0 -1
  248. package/features/DestroyApp/index.js +0 -1
  249. package/features/ExportStack/ExportStack.d.ts +0 -9
  250. package/features/ExportStack/ExportStack.js +0 -26
  251. package/features/ExportStack/ExportStack.js.map +0 -1
  252. package/features/ExportStack/index.d.ts +0 -1
  253. package/features/ExportStack/index.js +0 -1
  254. package/features/GetAppOutput/GetAppOutput.d.ts +0 -12
  255. package/features/GetAppOutput/GetAppOutput.js +0 -51
  256. package/features/GetAppOutput/GetAppOutput.js.map +0 -1
  257. package/features/GetAppOutput/index.d.ts +0 -1
  258. package/features/GetAppOutput/index.js +0 -1
  259. package/features/GetAppStackOutput/GetAppStackOutput.d.ts +0 -10
  260. package/features/GetAppStackOutput/GetAppStackOutput.js +0 -26
  261. package/features/GetAppStackOutput/GetAppStackOutput.js.map +0 -1
  262. package/features/GetAppStackOutput/index.d.ts +0 -1
  263. package/features/GetAppStackOutput/index.js +0 -1
  264. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +0 -7
  265. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +0 -25
  266. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +0 -1
  267. package/features/GetPulumiResourceNamePrefix/index.d.ts +0 -1
  268. package/features/GetPulumiResourceNamePrefix/index.js +0 -1
  269. package/features/RefreshApp/RefreshApp.d.ts +0 -13
  270. package/features/RefreshApp/RefreshApp.js +0 -64
  271. package/features/RefreshApp/RefreshApp.js.map +0 -1
  272. package/features/RefreshApp/index.d.ts +0 -1
  273. package/features/RefreshApp/index.js +0 -1
  274. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +0 -13
  275. package/features/RunPulumiCommand/RunPulumiCommand.js +0 -61
  276. package/features/RunPulumiCommand/RunPulumiCommand.js.map +0 -1
  277. package/features/RunPulumiCommand/index.d.ts +0 -1
  278. package/features/RunPulumiCommand/index.js +0 -1
  279. package/features/Watch/handler/handler.zip +0 -0
  280. package/features/Watch/initInvocationForwarding.d.ts +0 -9
  281. package/features/Watch/initInvocationForwarding.js +0 -91
  282. package/features/Watch/initInvocationForwarding.js.map +0 -1
  283. package/features/Watch/localInvocationWorker.d.ts +0 -1
  284. package/features/Watch/localInvocationWorker.js +0 -31
  285. package/features/Watch/localInvocationWorker.js.map +0 -1
  286. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.d.ts +0 -7
  287. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js +0 -25
  288. package/features/hooks/AdminAfterDeploy/AdminBeforeBuild.js.map +0 -1
  289. package/features/hooks/AdminAfterDeploy/index.d.ts +0 -1
  290. package/features/hooks/AdminAfterDeploy/index.js +0 -1
  291. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +0 -7
  292. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +0 -25
  293. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +0 -1
  294. package/features/hooks/AdminBeforeDeploy/index.d.ts +0 -1
  295. package/features/hooks/AdminBeforeDeploy/index.js +0 -1
  296. package/features/hooks/AfterDeploy/AfterDeploy.d.ts +0 -7
  297. package/features/hooks/AfterDeploy/AfterDeploy.js +0 -25
  298. package/features/hooks/AfterDeploy/AfterDeploy.js.map +0 -1
  299. package/features/hooks/AfterDeploy/index.d.ts +0 -1
  300. package/features/hooks/AfterDeploy/index.js +0 -1
  301. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.d.ts +0 -7
  302. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js +0 -25
  303. package/features/hooks/ApiAfterDeploy/ApiBeforeBuild.js.map +0 -1
  304. package/features/hooks/ApiAfterDeploy/index.d.ts +0 -1
  305. package/features/hooks/ApiAfterDeploy/index.js +0 -1
  306. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +0 -7
  307. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +0 -25
  308. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +0 -1
  309. package/features/hooks/ApiBeforeDeploy/index.d.ts +0 -1
  310. package/features/hooks/ApiBeforeDeploy/index.js +0 -1
  311. package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +0 -7
  312. package/features/hooks/BeforeDeploy/BeforeDeploy.js +0 -25
  313. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +0 -1
  314. package/features/hooks/BeforeDeploy/index.d.ts +0 -1
  315. package/features/hooks/BeforeDeploy/index.js +0 -1
  316. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.d.ts +0 -7
  317. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js +0 -25
  318. package/features/hooks/CoreAfterDeploy/CoreBeforeBuild.js.map +0 -1
  319. package/features/hooks/CoreAfterDeploy/index.d.ts +0 -1
  320. package/features/hooks/CoreAfterDeploy/index.js +0 -1
  321. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +0 -7
  322. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +0 -25
  323. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +0 -1
  324. package/features/hooks/CoreBeforeDeploy/index.d.ts +0 -1
  325. package/features/hooks/CoreBeforeDeploy/index.js +0 -1
  326. package/services/InitProjectSdkService/registerPulumiExtensions.d.ts +0 -4
  327. package/services/InitProjectSdkService/registerPulumiExtensions.js +0 -16
  328. package/services/InitProjectSdkService/registerPulumiExtensions.js.map +0 -1
  329. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +0 -14
  330. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +0 -15
  331. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +0 -1
  332. package/services/IsRemotePulumiBackendService/index.d.ts +0 -1
  333. package/services/IsRemotePulumiBackendService/index.js +0 -1
  334. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +0 -18
  335. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +0 -61
  336. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +0 -1
  337. package/services/ListAppLambdaFunctionsService/index.d.ts +0 -1
  338. package/services/ListAppLambdaFunctionsService/index.js +0 -1
  339. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +0 -7
  340. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +0 -30
  341. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +0 -1
  342. package/services/ListDeployedEnvironmentsService/index.d.ts +0 -1
  343. package/services/ListDeployedEnvironmentsService/index.js +0 -1
  344. package/services/ProjectInfoService/GetPulumiVersionService.d.ts +0 -5
  345. package/services/ProjectInfoService/GetPulumiVersionService.js +0 -46
  346. package/services/ProjectInfoService/GetPulumiVersionService.js.map +0 -1
  347. package/services/PulumiExportService/PulumiExportService.d.ts +0 -13
  348. package/services/PulumiExportService/PulumiExportService.js +0 -50
  349. package/services/PulumiExportService/PulumiExportService.js.map +0 -1
  350. package/services/PulumiExportService/index.d.ts +0 -1
  351. package/services/PulumiExportService/index.js +0 -1
  352. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +0 -5
  353. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +0 -15
  354. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +0 -1
  355. package/services/PulumiGetConfigPassphraseService/index.d.ts +0 -1
  356. package/services/PulumiGetConfigPassphraseService/index.js +0 -1
  357. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +0 -5
  358. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +0 -15
  359. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +0 -1
  360. package/services/PulumiGetSecretsProviderService/index.d.ts +0 -1
  361. package/services/PulumiGetSecretsProviderService/index.js +0 -1
  362. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +0 -12
  363. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +0 -64
  364. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +0 -1
  365. package/services/PulumiGetStackOutputService/index.d.ts +0 -1
  366. package/services/PulumiGetStackOutputService/index.js +0 -1
  367. package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +0 -1
  368. package/services/PulumiGetStackOutputService/mapStackOutput.js +0 -22
  369. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +0 -1
  370. package/services/PulumiImportService/PulumiImportService.d.ts +0 -10
  371. package/services/PulumiImportService/PulumiImportService.js +0 -60
  372. package/services/PulumiImportService/PulumiImportService.js.map +0 -1
  373. package/services/PulumiImportService/index.d.ts +0 -1
  374. package/services/PulumiImportService/index.js +0 -1
  375. package/services/PulumiLoginService/PulumiLoginService.d.ts +0 -10
  376. package/services/PulumiLoginService/PulumiLoginService.js +0 -54
  377. package/services/PulumiLoginService/PulumiLoginService.js.map +0 -1
  378. package/services/PulumiLoginService/index.d.ts +0 -1
  379. package/services/PulumiLoginService/index.js +0 -1
  380. package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +0 -15
  381. package/services/PulumiSelectStackService/PulumiSelectStackService.js +0 -102
  382. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +0 -1
  383. package/services/PulumiSelectStackService/index.d.ts +0 -1
  384. package/services/PulumiSelectStackService/index.js +0 -1
  385. package/services/StackOutputCacheService/StackOutputCacheService.d.ts +0 -18
  386. package/services/StackOutputCacheService/StackOutputCacheService.js +0 -89
  387. package/services/StackOutputCacheService/StackOutputCacheService.js.map +0 -1
  388. package/services/StackOutputCacheService/index.d.ts +0 -1
  389. package/services/StackOutputCacheService/index.js +0 -1
  390. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +0 -13
  391. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +0 -54
  392. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +0 -1
  393. package/services/WatchedLambdaFunctionsService/index.d.ts +0 -1
  394. package/services/WatchedLambdaFunctionsService/index.js +0 -1
  395. package/utils/env/withPulumiConfigPassphrase.d.ts +0 -1
  396. package/utils/env/withPulumiConfigPassphrase.js +0 -7
  397. package/utils/env/withPulumiConfigPassphrase.js.map +0 -1
  398. /package/extensions/{pulumi/ProductionEnvironments.d.ts → ProductionEnvironments.d.ts} +0 -0
@@ -1,60 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import fs from "fs";
3
- import path from "path";
4
- import os from "os";
5
- import { GetPulumiService, LoggerService, PulumiImportService, PulumiSelectStackService } from "../../abstractions/index.js";
6
- import { createEnvConfiguration, withPulumiConfigPassphrase } from "../../utils/env/index.js";
7
- class DefaultPulumiImportService {
8
- constructor(getPulumiService, pulumiSelectStackService, loggerService){
9
- this.getPulumiService = getPulumiService;
10
- this.pulumiSelectStackService = pulumiSelectStackService;
11
- this.loggerService = loggerService;
12
- }
13
- async execute(app, state) {
14
- const pulumi = await this.getPulumiService.execute({
15
- app
16
- });
17
- await this.pulumiSelectStackService.execute(app);
18
- const tempDir = os.tmpdir();
19
- const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);
20
- try {
21
- const stateJson = JSON.stringify(state, null, 2);
22
- fs.writeFileSync(tempFilePath, stateJson, "utf-8");
23
- this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);
24
- const result = await pulumi.run({
25
- command: [
26
- "stack",
27
- "import"
28
- ],
29
- args: {
30
- file: tempFilePath
31
- },
32
- execa: {
33
- env: createEnvConfiguration({
34
- configurations: [
35
- withPulumiConfigPassphrase()
36
- ]
37
- })
38
- }
39
- });
40
- this.loggerService.debug("Pulumi import output:", result.stdout);
41
- fs.unlinkSync(tempFilePath);
42
- } catch (error) {
43
- if (fs.existsSync(tempFilePath)) fs.unlinkSync(tempFilePath);
44
- this.loggerService.error("Failed to import Pulumi stack state.", error, app);
45
- throw error;
46
- }
47
- }
48
- }
49
- const pulumiImportService = createImplementation({
50
- abstraction: PulumiImportService,
51
- implementation: DefaultPulumiImportService,
52
- dependencies: [
53
- GetPulumiService,
54
- PulumiSelectStackService,
55
- LoggerService
56
- ]
57
- });
58
- export { DefaultPulumiImportService, pulumiImportService };
59
-
60
- //# sourceMappingURL=PulumiImportService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services/PulumiImportService/PulumiImportService.js","sources":["../../../src/services/PulumiImportService/PulumiImportService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport os from \"os\";\nimport {\n GetPulumiService,\n LoggerService,\n PulumiImportService,\n PulumiSelectStackService\n} from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport { createEnvConfiguration, withPulumiConfigPassphrase } from \"~/utils/env/index.js\";\n\nexport class DefaultPulumiImportService implements PulumiImportService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: AppModel, state: Record<string, any>) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n // Write state to temporary file (pulumi stack import requires --file flag)\n const tempDir = os.tmpdir();\n const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);\n\n try {\n const stateJson = JSON.stringify(state, null, 2);\n fs.writeFileSync(tempFilePath, stateJson, \"utf-8\");\n\n this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);\n\n const result = await pulumi.run({\n command: [\"stack\", \"import\"],\n args: {\n file: tempFilePath\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n this.loggerService.debug(\"Pulumi import output:\", result.stdout);\n\n // Clean up temp file\n fs.unlinkSync(tempFilePath);\n } catch (error) {\n // Clean up temp file even on error\n if (fs.existsSync(tempFilePath)) {\n fs.unlinkSync(tempFilePath);\n }\n this.loggerService.error(\"Failed to import Pulumi stack state.\", error, app);\n throw error;\n }\n }\n}\n\nexport const pulumiImportService = createImplementation({\n abstraction: PulumiImportService,\n implementation: DefaultPulumiImportService,\n dependencies: [GetPulumiService, PulumiSelectStackService, LoggerService]\n});\n"],"names":["DefaultPulumiImportService","getPulumiService","pulumiSelectStackService","loggerService","app","state","pulumi","tempDir","os","tempFilePath","path","Date","stateJson","JSON","fs","result","createEnvConfiguration","withPulumiConfigPassphrase","error","pulumiImportService","createImplementation","PulumiImportService","GetPulumiService","PulumiSelectStackService","LoggerService"],"mappings":";;;;;;AAaO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,CAChD;aAHUF,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAa,EAAEC,KAA0B,EAAE;QACrD,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAEF;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAG5C,MAAMG,UAAUC,GAAG,MAAM;QACzB,MAAMC,eAAeC,KAAK,IAAI,CAACH,SAAS,CAAC,aAAa,EAAEI,KAAK,GAAG,GAAG,KAAK,CAAC;QAEzE,IAAI;YACA,MAAMC,YAAYC,KAAK,SAAS,CAACR,OAAO,MAAM;YAC9CS,GAAG,aAAa,CAACL,cAAcG,WAAW;YAE1C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAEH,cAAc;YAEvE,MAAMM,SAAS,MAAMT,OAAO,GAAG,CAAC;gBAC5B,SAAS;oBAAC;oBAAS;iBAAS;gBAC5B,MAAM;oBACF,MAAMG;gBACV;gBACA,OAAO;oBACH,KAAKO,uBAAuB;wBACxB,gBAAgB;4BAACC;yBAA6B;oBAClD;gBACJ;YACJ;YAEA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,yBAAyBF,OAAO,MAAM;YAG/DD,GAAG,UAAU,CAACL;QAClB,EAAE,OAAOS,OAAO;YAEZ,IAAIJ,GAAG,UAAU,CAACL,eACdK,GAAG,UAAU,CAACL;YAElB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,wCAAwCS,OAAOd;YACxE,MAAMc;QACV;IACJ;AACJ;AAEO,MAAMC,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBrB;IAChB,cAAc;QAACsB;QAAkBC;QAA0BC;KAAc;AAC7E"}
@@ -1 +0,0 @@
1
- export * from "./PulumiImportService.js";
@@ -1 +0,0 @@
1
- export * from "./PulumiImportService.js";
@@ -1,10 +0,0 @@
1
- import { GetPulumiService, PulumiLoginService } from "../../abstractions/index.js";
2
- import { type AppModel } from "../../models/index.js";
3
- export declare class DefaultPulumiLoginService implements PulumiLoginService.Interface {
4
- private getPulumiService;
5
- constructor(getPulumiService: GetPulumiService.Interface);
6
- execute(app: AppModel): Promise<{
7
- login: string;
8
- }>;
9
- }
10
- export declare const pulumiLoginService: import("@webiny/di").Implementation<typeof DefaultPulumiLoginService>;
@@ -1,54 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { GetPulumiService, PulumiLoginService } from "../../abstractions/index.js";
3
- import trimEnd from "lodash/trimEnd.js";
4
- import fs from "fs";
5
- import path from "path";
6
- const SELF_MANAGED_BACKEND = [
7
- "s3://",
8
- "azblob://",
9
- "gs://"
10
- ];
11
- class DefaultPulumiLoginService {
12
- constructor(getPulumiService){
13
- this.getPulumiService = getPulumiService;
14
- }
15
- async execute(app) {
16
- const pulumi = await this.getPulumiService.execute({
17
- app
18
- });
19
- const projectAppRelativePath = path.join("apps", app.name);
20
- let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;
21
- if (loginUrl) {
22
- const selfManagedBackend = SELF_MANAGED_BACKEND.find((item)=>loginUrl.startsWith(item));
23
- if (selfManagedBackend) {
24
- loginUrl = trimEnd(loginUrl, "/") + "/" + projectAppRelativePath;
25
- loginUrl = loginUrl.replace(/\\/g, "/");
26
- }
27
- } else {
28
- const stateFilesFolder = app.paths.localPulumiStateFilesFolder.toString();
29
- if (!fs.existsSync(stateFilesFolder)) fs.mkdirSync(stateFilesFolder, {
30
- recursive: true
31
- });
32
- loginUrl = `file://${stateFilesFolder}`;
33
- }
34
- await pulumi.run({
35
- command: [
36
- "login",
37
- loginUrl
38
- ]
39
- });
40
- return {
41
- login: loginUrl
42
- };
43
- }
44
- }
45
- const pulumiLoginService = createImplementation({
46
- abstraction: PulumiLoginService,
47
- implementation: DefaultPulumiLoginService,
48
- dependencies: [
49
- GetPulumiService
50
- ]
51
- });
52
- export { DefaultPulumiLoginService, pulumiLoginService };
53
-
54
- //# sourceMappingURL=PulumiLoginService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services/PulumiLoginService/PulumiLoginService.js","sources":["../../../src/services/PulumiLoginService/PulumiLoginService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService, PulumiLoginService } from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport trimEnd from \"lodash/trimEnd.js\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nconst SELF_MANAGED_BACKEND = [\"s3://\", \"azblob://\", \"gs://\"];\n\nexport class DefaultPulumiLoginService implements PulumiLoginService.Interface {\n constructor(private getPulumiService: GetPulumiService.Interface) {}\n\n async execute(app: AppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n const projectAppRelativePath = path.join(\"apps\", app.name);\n\n // `WEBINY_CLI_PULUMI_BACKEND` is the canonical variable. We still read the legacy\n // `WEBINY_PULUMI_BACKEND` as a fallback, to preserve backwards compatibility.\n let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;\n\n if (loginUrl) {\n // If the user passed `s3://my-bucket`, we want to store files in `s3://my-bucket/{project-application-path}`\n const selfManagedBackend = SELF_MANAGED_BACKEND.find(item =>\n loginUrl!.startsWith(item)\n );\n if (selfManagedBackend) {\n loginUrl = trimEnd(loginUrl, \"/\") + \"/\" + projectAppRelativePath;\n loginUrl = loginUrl.replace(/\\\\/g, \"/\");\n }\n } else {\n // By default, we use local file system as backend. All files are stored in project root's\n // `.pulumi` folder, e.g. `.pulumi/apps/admin`.\n const stateFilesFolder = app.paths.localPulumiStateFilesFolder.toString();\n\n if (!fs.existsSync(stateFilesFolder)) {\n fs.mkdirSync(stateFilesFolder, { recursive: true });\n }\n\n loginUrl = `file://${stateFilesFolder}`;\n }\n\n await pulumi.run({ command: [\"login\", loginUrl] });\n\n return { login: loginUrl };\n }\n}\n\nexport const pulumiLoginService = createImplementation({\n abstraction: PulumiLoginService,\n implementation: DefaultPulumiLoginService,\n dependencies: [GetPulumiService]\n});\n"],"names":["SELF_MANAGED_BACKEND","DefaultPulumiLoginService","getPulumiService","app","pulumi","projectAppRelativePath","path","loginUrl","process","selfManagedBackend","item","trimEnd","stateFilesFolder","fs","pulumiLoginService","createImplementation","PulumiLoginService","GetPulumiService"],"mappings":";;;;;AAOA,MAAMA,uBAAuB;IAAC;IAAS;IAAa;CAAQ;AAErD,MAAMC;IACT,YAAoBC,gBAA4C,CAAE;aAA9CA,gBAAgB,GAAhBA;IAA+C;IAEnE,MAAM,QAAQC,GAAa,EAAE;QACzB,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAME,yBAAyBC,KAAK,IAAI,CAAC,QAAQH,IAAI,IAAI;QAIzD,IAAII,WAAWC,QAAQ,GAAG,CAAC,yBAAyB,IAAIA,QAAQ,GAAG,CAAC,qBAAqB;QAEzF,IAAID,UAAU;YAEV,MAAME,qBAAqBT,qBAAqB,IAAI,CAACU,CAAAA,OACjDH,SAAU,UAAU,CAACG;YAEzB,IAAID,oBAAoB;gBACpBF,WAAWI,QAAQJ,UAAU,OAAO,MAAMF;gBAC1CE,WAAWA,SAAS,OAAO,CAAC,OAAO;YACvC;QACJ,OAAO;YAGH,MAAMK,mBAAmBT,IAAI,KAAK,CAAC,2BAA2B,CAAC,QAAQ;YAEvE,IAAI,CAACU,GAAG,UAAU,CAACD,mBACfC,GAAG,SAAS,CAACD,kBAAkB;gBAAE,WAAW;YAAK;YAGrDL,WAAW,CAAC,OAAO,EAAEK,kBAAkB;QAC3C;QAEA,MAAMR,OAAO,GAAG,CAAC;YAAE,SAAS;gBAAC;gBAASG;aAAS;QAAC;QAEhD,OAAO;YAAE,OAAOA;QAAS;IAC7B;AACJ;AAEO,MAAMO,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBf;IAChB,cAAc;QAACgB;KAAiB;AACpC"}
@@ -1 +0,0 @@
1
- export * from "./PulumiLoginService.js";
@@ -1 +0,0 @@
1
- export * from "./PulumiLoginService.js";
@@ -1,15 +0,0 @@
1
- import { GetPulumiService, LoggerService, ProjectSdkParamsService, PulumiGetConfigPassphraseService, PulumiGetSecretsProviderService, PulumiLoginService, PulumiSelectStackService } from "../../abstractions/index.js";
2
- import { type AppModel } from "../../models/index.js";
3
- export declare class DefaultPulumiSelectStackService implements PulumiSelectStackService.Interface {
4
- private getPulumiService;
5
- private pulumiLoginService;
6
- private pulumiGetSecretsProviderService;
7
- private pulumiGetConfigPassphraseService;
8
- private loggerService;
9
- private projectSdkParamsService;
10
- constructor(getPulumiService: GetPulumiService.Interface, pulumiLoginService: PulumiLoginService.Interface, pulumiGetSecretsProviderService: PulumiGetSecretsProviderService.Interface, pulumiGetConfigPassphraseService: PulumiGetConfigPassphraseService.Interface, loggerService: LoggerService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
11
- execute(app: AppModel): Promise<void>;
12
- private mustPerformCoreAppRegionMismatchCheck;
13
- private getAppStackOutput;
14
- }
15
- export declare const pulumiSelectStackService: import("@webiny/di").Implementation<typeof DefaultPulumiSelectStackService>;
@@ -1,102 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { GetPulumiService, LoggerService, ProjectSdkParamsService, PulumiGetConfigPassphraseService, PulumiGetSecretsProviderService, PulumiLoginService, PulumiSelectStackService } from "../../abstractions/index.js";
3
- import { createEnvConfiguration, withPulumiConfigPassphrase } from "../../utils/env/index.js";
4
- import { getStackName } from "../../utils/index.js";
5
- class DefaultPulumiSelectStackService {
6
- constructor(getPulumiService, pulumiLoginService, pulumiGetSecretsProviderService, pulumiGetConfigPassphraseService, loggerService, projectSdkParamsService){
7
- this.getPulumiService = getPulumiService;
8
- this.pulumiLoginService = pulumiLoginService;
9
- this.pulumiGetSecretsProviderService = pulumiGetSecretsProviderService;
10
- this.pulumiGetConfigPassphraseService = pulumiGetConfigPassphraseService;
11
- this.loggerService = loggerService;
12
- this.projectSdkParamsService = projectSdkParamsService;
13
- }
14
- async execute(app) {
15
- const pulumi = await this.getPulumiService.execute({
16
- app
17
- });
18
- await this.pulumiLoginService.execute(app);
19
- const secretsProvider = this.pulumiGetSecretsProviderService.execute();
20
- const configPassphrase = this.pulumiGetConfigPassphraseService.execute();
21
- const sdkParams = this.projectSdkParamsService.get();
22
- const stackName = getStackName({
23
- env: sdkParams.env,
24
- variant: sdkParams.variant
25
- });
26
- await pulumi.run({
27
- command: [
28
- "stack",
29
- "select",
30
- stackName
31
- ],
32
- args: {
33
- create: true,
34
- secretsProvider
35
- },
36
- execa: {
37
- env: createEnvConfiguration({
38
- configurations: [
39
- withPulumiConfigPassphrase(configPassphrase)
40
- ]
41
- })
42
- }
43
- });
44
- const region = sdkParams.region || process.env.AWS_REGION;
45
- const mustPerformCoreAppRegionMismatchCheck = this.mustPerformCoreAppRegionMismatchCheck(app);
46
- if (mustPerformCoreAppRegionMismatchCheck) {
47
- const coreStack = await this.getAppStackOutput(app);
48
- if (coreStack && coreStack.region && coreStack.region !== region) throw new Error(`Core App Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In Core stack: "${coreStack.region}". This can happen if you try to deploy a stack to a region different to the Core application region.`);
49
- }
50
- const targetStack = await this.getAppStackOutput(app);
51
- if (!targetStack?.region || targetStack.region === region) return;
52
- throw new Error(`Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In stack: "${targetStack.region}". This can happen if you try to deploy a stack to a region other than it was initially deployed.`);
53
- }
54
- mustPerformCoreAppRegionMismatchCheck(app) {
55
- return "core" !== app.name && "blueGreen" !== app.name;
56
- }
57
- async getAppStackOutput(app) {
58
- const pulumi = await this.getPulumiService.execute({
59
- app
60
- });
61
- const logger = this.loggerService;
62
- const stackOutputString = await pulumi.run({
63
- command: [
64
- "stack",
65
- "output"
66
- ],
67
- args: {
68
- json: true
69
- },
70
- execa: {
71
- env: createEnvConfiguration({
72
- configurations: [
73
- withPulumiConfigPassphrase()
74
- ]
75
- })
76
- }
77
- });
78
- try {
79
- const stackOutputJson = JSON.parse(stackOutputString.stdout);
80
- if (!stackOutputJson) return null;
81
- return stackOutputJson;
82
- } catch {
83
- logger.error("Could not parse stack output as JSON.", stackOutputString.stdout, app);
84
- return null;
85
- }
86
- }
87
- }
88
- const pulumiSelectStackService = createImplementation({
89
- abstraction: PulumiSelectStackService,
90
- implementation: DefaultPulumiSelectStackService,
91
- dependencies: [
92
- GetPulumiService,
93
- PulumiLoginService,
94
- PulumiGetSecretsProviderService,
95
- PulumiGetConfigPassphraseService,
96
- LoggerService,
97
- ProjectSdkParamsService
98
- ]
99
- });
100
- export { DefaultPulumiSelectStackService, pulumiSelectStackService };
101
-
102
- //# sourceMappingURL=PulumiSelectStackService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services/PulumiSelectStackService/PulumiSelectStackService.js","sources":["../../../src/services/PulumiSelectStackService/PulumiSelectStackService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n GetPulumiService,\n LoggerService,\n ProjectSdkParamsService,\n PulumiGetConfigPassphraseService,\n PulumiGetSecretsProviderService,\n PulumiLoginService,\n PulumiSelectStackService\n} from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport { createEnvConfiguration, withPulumiConfigPassphrase } from \"~/utils/env/index.js\";\nimport { getStackName } from \"~/utils/index.js\";\n\nexport class DefaultPulumiSelectStackService implements PulumiSelectStackService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiLoginService: PulumiLoginService.Interface,\n private pulumiGetSecretsProviderService: PulumiGetSecretsProviderService.Interface,\n private pulumiGetConfigPassphraseService: PulumiGetConfigPassphraseService.Interface,\n private loggerService: LoggerService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(app: AppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiLoginService.execute(app);\n\n const secretsProvider = this.pulumiGetSecretsProviderService.execute();\n const configPassphrase = this.pulumiGetConfigPassphraseService.execute();\n\n const sdkParams = this.projectSdkParamsService.get();\n const stackName = getStackName({ env: sdkParams.env, variant: sdkParams.variant });\n\n await pulumi.run({\n command: [\"stack\", \"select\", stackName],\n args: {\n create: true,\n secretsProvider\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase(configPassphrase)]\n })\n }\n });\n\n /**\n * A region from the input or process CANNOT be different to the region from the stack.\n * Also, if there is no stack, everything is ok.\n */\n const region = sdkParams.region || process.env.AWS_REGION;\n\n const mustPerformCoreAppRegionMismatchCheck =\n this.mustPerformCoreAppRegionMismatchCheck(app);\n\n if (mustPerformCoreAppRegionMismatchCheck) {\n const coreStack = await this.getAppStackOutput(app);\n if (coreStack && coreStack.region && coreStack.region !== region) {\n throw new Error(\n `Core App Region mismatch. Input: \"${sdkParams.region || \"none\"}\", process: \"${\n process.env.AWS_REGION || \"none\"\n }\". In Core stack: \"${\n coreStack.region\n }\". This can happen if you try to deploy a stack to a region different to the Core application region.`\n );\n }\n }\n\n const targetStack = await this.getAppStackOutput(app);\n\n if (!targetStack?.region || targetStack.region === region) {\n return;\n }\n\n throw new Error(\n `Region mismatch. Input: \"${sdkParams.region || \"none\"}\", process: \"${\n process.env.AWS_REGION || \"none\"\n }\". In stack: \"${\n targetStack.region\n }\". This can happen if you try to deploy a stack to a region other than it was initially deployed.`\n );\n }\n\n private mustPerformCoreAppRegionMismatchCheck(app: AppModel) {\n return app.name !== \"core\" && app.name !== \"blueGreen\";\n }\n\n private async getAppStackOutput(app: AppModel) {\n // We had to reimplement `getAppStackOutput` locally here. We could not use the existing\n // `PulumiGetStackOutputService` because, internally, it also depends on `PulumiSelectStackService`.\n // This would create a circular dependency. But also, this works just fine.\n const pulumi = await this.getPulumiService.execute({ app });\n const logger = this.loggerService;\n\n const stackOutputString = await pulumi.run({\n command: [\"stack\", \"output\"],\n args: {\n json: true\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n try {\n const stackOutputJson = JSON.parse(stackOutputString.stdout as string);\n if (!stackOutputJson) {\n return null;\n }\n\n return stackOutputJson;\n } catch {\n logger.error(\"Could not parse stack output as JSON.\", stackOutputString.stdout, app);\n return null;\n }\n }\n}\n\nexport const pulumiSelectStackService = createImplementation({\n abstraction: PulumiSelectStackService,\n implementation: DefaultPulumiSelectStackService,\n dependencies: [\n GetPulumiService,\n PulumiLoginService,\n PulumiGetSecretsProviderService,\n PulumiGetConfigPassphraseService,\n LoggerService,\n ProjectSdkParamsService\n ]\n});\n"],"names":["DefaultPulumiSelectStackService","getPulumiService","pulumiLoginService","pulumiGetSecretsProviderService","pulumiGetConfigPassphraseService","loggerService","projectSdkParamsService","app","pulumi","secretsProvider","configPassphrase","sdkParams","stackName","getStackName","createEnvConfiguration","withPulumiConfigPassphrase","region","process","mustPerformCoreAppRegionMismatchCheck","coreStack","Error","targetStack","logger","stackOutputString","stackOutputJson","JSON","pulumiSelectStackService","createImplementation","PulumiSelectStackService","GetPulumiService","PulumiLoginService","PulumiGetSecretsProviderService","PulumiGetConfigPassphraseService","LoggerService","ProjectSdkParamsService"],"mappings":";;;;AAcO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,kBAAgD,EAChDC,+BAA0E,EAC1EC,gCAA4E,EAC5EC,aAAsC,EACtCC,uBAA0D,CACpE;aANUL,gBAAgB,GAAhBA;aACAC,kBAAkB,GAAlBA;aACAC,+BAA+B,GAA/BA;aACAC,gCAAgC,GAAhCA;aACAC,aAAa,GAAbA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,GAAa,EAAE;QACzB,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAACA;QAEtC,MAAME,kBAAkB,IAAI,CAAC,+BAA+B,CAAC,OAAO;QACpE,MAAMC,mBAAmB,IAAI,CAAC,gCAAgC,CAAC,OAAO;QAEtE,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,YAAYC,aAAa;YAAE,KAAKF,UAAU,GAAG;YAAE,SAASA,UAAU,OAAO;QAAC;QAEhF,MAAMH,OAAO,GAAG,CAAC;YACb,SAAS;gBAAC;gBAAS;gBAAUI;aAAU;YACvC,MAAM;gBACF,QAAQ;gBACRH;YACJ;YACA,OAAO;gBACH,KAAKK,uBAAuB;oBACxB,gBAAgB;wBAACC,2BAA2BL;qBAAkB;gBAClE;YACJ;QACJ;QAMA,MAAMM,SAASL,UAAU,MAAM,IAAIM,QAAQ,GAAG,CAAC,UAAU;QAEzD,MAAMC,wCACF,IAAI,CAAC,qCAAqC,CAACX;QAE/C,IAAIW,uCAAuC;YACvC,MAAMC,YAAY,MAAM,IAAI,CAAC,iBAAiB,CAACZ;YAC/C,IAAIY,aAAaA,UAAU,MAAM,IAAIA,UAAU,MAAM,KAAKH,QACtD,MAAM,IAAII,MACN,CAAC,kCAAkC,EAAET,UAAU,MAAM,IAAI,OAAO,aAAa,EACzEM,QAAQ,GAAG,CAAC,UAAU,IAAI,OAC7B,mBAAmB,EAChBE,UAAU,MAAM,CACnB,qGAAqG,CAAC;QAGnH;QAEA,MAAME,cAAc,MAAM,IAAI,CAAC,iBAAiB,CAACd;QAEjD,IAAI,CAACc,aAAa,UAAUA,YAAY,MAAM,KAAKL,QAC/C;QAGJ,MAAM,IAAII,MACN,CAAC,yBAAyB,EAAET,UAAU,MAAM,IAAI,OAAO,aAAa,EAChEM,QAAQ,GAAG,CAAC,UAAU,IAAI,OAC7B,cAAc,EACXI,YAAY,MAAM,CACrB,iGAAiG,CAAC;IAE3G;IAEQ,sCAAsCd,GAAa,EAAE;QACzD,OAAOA,AAAa,WAAbA,IAAI,IAAI,IAAeA,AAAa,gBAAbA,IAAI,IAAI;IAC1C;IAEA,MAAc,kBAAkBA,GAAa,EAAE;QAI3C,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QACzD,MAAMe,SAAS,IAAI,CAAC,aAAa;QAEjC,MAAMC,oBAAoB,MAAMf,OAAO,GAAG,CAAC;YACvC,SAAS;gBAAC;gBAAS;aAAS;YAC5B,MAAM;gBACF,MAAM;YACV;YACA,OAAO;gBACH,KAAKM,uBAAuB;oBACxB,gBAAgB;wBAACC;qBAA6B;gBAClD;YACJ;QACJ;QAEA,IAAI;YACA,MAAMS,kBAAkBC,KAAK,KAAK,CAACF,kBAAkB,MAAM;YAC3D,IAAI,CAACC,iBACD,OAAO;YAGX,OAAOA;QACX,EAAE,OAAM;YACJF,OAAO,KAAK,CAAC,yCAAyCC,kBAAkB,MAAM,EAAEhB;YAChF,OAAO;QACX;IACJ;AACJ;AAEO,MAAMmB,2BAA2BC,qBAAqB;IACzD,aAAaC;IACb,gBAAgB5B;IAChB,cAAc;QACV6B;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -1 +0,0 @@
1
- export * from "./PulumiSelectStackService.js";
@@ -1 +0,0 @@
1
- export * from "./PulumiSelectStackService.js";
@@ -1,18 +0,0 @@
1
- import { GetProjectService, LoggerService, ProjectSdkParamsService, StackOutputCacheService } from "../../abstractions/index.js";
2
- import { type AppModel } from "../../models/index.js";
3
- export declare class DefaultStackOutputCacheService implements StackOutputCacheService.Interface {
4
- private getProjectService;
5
- private projectSdkParamsService;
6
- private loggerService;
7
- private static readonly DEFAULT_ENV;
8
- private static readonly DEFAULT_REGION;
9
- private static readonly DEFAULT_VARIANT;
10
- constructor(getProjectService: GetProjectService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface, loggerService: LoggerService.Interface);
11
- read(app: AppModel): Promise<Record<string, any> | null>;
12
- write(app: AppModel, data: Record<string, any>): Promise<void>;
13
- delete(app: AppModel): Promise<void>;
14
- private getCacheKey;
15
- private getCacheDir;
16
- private getCachePath;
17
- }
18
- export declare const stackOutputCacheService: import("@webiny/di").Implementation<typeof DefaultStackOutputCacheService>;
@@ -1,89 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { GetProjectService, LoggerService, ProjectSdkParamsService, StackOutputCacheService } from "../../abstractions/index.js";
3
- import promises from "fs/promises";
4
- class DefaultStackOutputCacheService {
5
- static{
6
- this.DEFAULT_ENV = "dev";
7
- }
8
- static{
9
- this.DEFAULT_REGION = "default";
10
- }
11
- static{
12
- this.DEFAULT_VARIANT = "default";
13
- }
14
- constructor(getProjectService, projectSdkParamsService, loggerService){
15
- this.getProjectService = getProjectService;
16
- this.projectSdkParamsService = projectSdkParamsService;
17
- this.loggerService = loggerService;
18
- }
19
- async read(app) {
20
- const cachePath = this.getCachePath(app);
21
- try {
22
- const content = await promises.readFile(cachePath, "utf-8");
23
- const data = JSON.parse(content);
24
- this.loggerService.debug({
25
- app: app.name,
26
- cacheKey: this.getCacheKey(app)
27
- }, "Stack output read from cache");
28
- return data;
29
- } catch {
30
- return null;
31
- }
32
- }
33
- async write(app, data) {
34
- const cachePath = this.getCachePath(app);
35
- const cacheDir = this.getCacheDir().toString();
36
- try {
37
- await promises.mkdir(cacheDir, {
38
- recursive: true
39
- });
40
- await promises.writeFile(cachePath, JSON.stringify(data, null, 2), "utf-8");
41
- this.loggerService.debug("Stack output stored to cache", {
42
- app: app.name,
43
- cacheKey: this.getCacheKey(app)
44
- });
45
- } catch (error) {
46
- this.loggerService.error("Could not write to cache file.", cachePath, error);
47
- }
48
- }
49
- async delete(app) {
50
- const cachePath = this.getCachePath(app);
51
- try {
52
- await promises.rm(cachePath, {
53
- force: true
54
- });
55
- this.loggerService.debug("Stack output cache deleted.", {
56
- app: app.name,
57
- cacheKey: this.getCacheKey(app)
58
- });
59
- } catch (error) {
60
- this.loggerService.error("Could not delete stack output cache file.", cachePath, error);
61
- }
62
- }
63
- getCacheKey(app) {
64
- const sdkParams = this.projectSdkParamsService.get();
65
- const env = sdkParams.env || DefaultStackOutputCacheService.DEFAULT_ENV;
66
- const region = sdkParams.region || DefaultStackOutputCacheService.DEFAULT_REGION;
67
- const variant = sdkParams.variant || DefaultStackOutputCacheService.DEFAULT_VARIANT;
68
- return `${app.name}-${env}-${region}-${variant}.json`;
69
- }
70
- getCacheDir() {
71
- const project = this.getProjectService.execute();
72
- return project.paths.dotWebinyFolder.join("caches", "stack-output");
73
- }
74
- getCachePath(app) {
75
- return this.getCacheDir().join(this.getCacheKey(app)).toString();
76
- }
77
- }
78
- const stackOutputCacheService = createImplementation({
79
- abstraction: StackOutputCacheService,
80
- implementation: DefaultStackOutputCacheService,
81
- dependencies: [
82
- GetProjectService,
83
- ProjectSdkParamsService,
84
- LoggerService
85
- ]
86
- });
87
- export { DefaultStackOutputCacheService, stackOutputCacheService };
88
-
89
- //# sourceMappingURL=StackOutputCacheService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services/StackOutputCacheService/StackOutputCacheService.js","sources":["../../../src/services/StackOutputCacheService/StackOutputCacheService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n GetProjectService,\n LoggerService,\n ProjectSdkParamsService,\n StackOutputCacheService\n} from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport fs from \"fs/promises\";\n\nexport class DefaultStackOutputCacheService implements StackOutputCacheService.Interface {\n private static readonly DEFAULT_ENV = \"dev\";\n private static readonly DEFAULT_REGION = \"default\";\n private static readonly DEFAULT_VARIANT = \"default\";\n\n constructor(\n private getProjectService: GetProjectService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async read(app: AppModel): Promise<Record<string, any> | null> {\n const cachePath = this.getCachePath(app);\n\n try {\n const content = await fs.readFile(cachePath, \"utf-8\");\n const data = JSON.parse(content);\n this.loggerService.debug(\n { app: app.name, cacheKey: this.getCacheKey(app) },\n \"Stack output read from cache\"\n );\n return data;\n } catch {\n // File doesn't exist or couldn't be read/parsed - this is expected on first run.\n return null;\n }\n }\n\n async write(app: AppModel, data: Record<string, any>): Promise<void> {\n const cachePath = this.getCachePath(app);\n const cacheDir = this.getCacheDir().toString();\n\n try {\n // Create cache directory if it doesn't exist.\n await fs.mkdir(cacheDir, { recursive: true });\n await fs.writeFile(cachePath, JSON.stringify(data, null, 2), \"utf-8\");\n this.loggerService.debug(\"Stack output stored to cache\", {\n app: app.name,\n cacheKey: this.getCacheKey(app)\n });\n } catch (error) {\n this.loggerService.error(\"Could not write to cache file.\", cachePath, error);\n }\n }\n\n async delete(app: AppModel): Promise<void> {\n const cachePath = this.getCachePath(app);\n\n try {\n // `force: true` makes this a no-op if the cache file doesn't exist.\n await fs.rm(cachePath, { force: true });\n this.loggerService.debug(\"Stack output cache deleted.\", {\n app: app.name,\n cacheKey: this.getCacheKey(app)\n });\n } catch (error) {\n this.loggerService.error(\"Could not delete stack output cache file.\", cachePath, error);\n }\n }\n\n private getCacheKey(app: AppModel): string {\n const sdkParams = this.projectSdkParamsService.get();\n const env = sdkParams.env || DefaultStackOutputCacheService.DEFAULT_ENV;\n const region = sdkParams.region || DefaultStackOutputCacheService.DEFAULT_REGION;\n const variant = sdkParams.variant || DefaultStackOutputCacheService.DEFAULT_VARIANT;\n return `${app.name}-${env}-${region}-${variant}.json`;\n }\n\n private getCacheDir() {\n const project = this.getProjectService.execute();\n return project.paths.dotWebinyFolder.join(\"caches\", \"stack-output\");\n }\n\n private getCachePath(app: AppModel): string {\n return this.getCacheDir().join(this.getCacheKey(app)).toString();\n }\n}\n\nexport const stackOutputCacheService = createImplementation({\n abstraction: StackOutputCacheService,\n implementation: DefaultStackOutputCacheService,\n dependencies: [GetProjectService, ProjectSdkParamsService, LoggerService]\n});\n"],"names":["DefaultStackOutputCacheService","getProjectService","projectSdkParamsService","loggerService","app","cachePath","content","fs","data","JSON","cacheDir","error","sdkParams","env","region","variant","project","stackOutputCacheService","createImplementation","StackOutputCacheService","GetProjectService","ProjectSdkParamsService","LoggerService"],"mappings":";;;AAUO,MAAMA;;aACe,WAAW,GAAG;;;aACd,cAAc,GAAG;;;aACjB,eAAe,GAAG;;IAE1C,YACYC,iBAA8C,EAC9CC,uBAA0D,EAC1DC,aAAsC,CAChD;aAHUF,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,KAAKC,GAAa,EAAuC;QAC3D,MAAMC,YAAY,IAAI,CAAC,YAAY,CAACD;QAEpC,IAAI;YACA,MAAME,UAAU,MAAMC,SAAAA,QAAW,CAACF,WAAW;YAC7C,MAAMG,OAAOC,KAAK,KAAK,CAACH;YACxB,IAAI,CAAC,aAAa,CAAC,KAAK,CACpB;gBAAE,KAAKF,IAAI,IAAI;gBAAE,UAAU,IAAI,CAAC,WAAW,CAACA;YAAK,GACjD;YAEJ,OAAOI;QACX,EAAE,OAAM;YAEJ,OAAO;QACX;IACJ;IAEA,MAAM,MAAMJ,GAAa,EAAEI,IAAyB,EAAiB;QACjE,MAAMH,YAAY,IAAI,CAAC,YAAY,CAACD;QACpC,MAAMM,WAAW,IAAI,CAAC,WAAW,GAAG,QAAQ;QAE5C,IAAI;YAEA,MAAMH,SAAAA,KAAQ,CAACG,UAAU;gBAAE,WAAW;YAAK;YAC3C,MAAMH,SAAAA,SAAY,CAACF,WAAWI,KAAK,SAAS,CAACD,MAAM,MAAM,IAAI;YAC7D,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,gCAAgC;gBACrD,KAAKJ,IAAI,IAAI;gBACb,UAAU,IAAI,CAAC,WAAW,CAACA;YAC/B;QACJ,EAAE,OAAOO,OAAO;YACZ,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,kCAAkCN,WAAWM;QAC1E;IACJ;IAEA,MAAM,OAAOP,GAAa,EAAiB;QACvC,MAAMC,YAAY,IAAI,CAAC,YAAY,CAACD;QAEpC,IAAI;YAEA,MAAMG,SAAAA,EAAK,CAACF,WAAW;gBAAE,OAAO;YAAK;YACrC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,+BAA+B;gBACpD,KAAKD,IAAI,IAAI;gBACb,UAAU,IAAI,CAAC,WAAW,CAACA;YAC/B;QACJ,EAAE,OAAOO,OAAO;YACZ,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,6CAA6CN,WAAWM;QACrF;IACJ;IAEQ,YAAYP,GAAa,EAAU;QACvC,MAAMQ,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAMD,UAAU,GAAG,IAAIZ,+BAA+B,WAAW;QACvE,MAAMc,SAASF,UAAU,MAAM,IAAIZ,+BAA+B,cAAc;QAChF,MAAMe,UAAUH,UAAU,OAAO,IAAIZ,+BAA+B,eAAe;QACnF,OAAO,GAAGI,IAAI,IAAI,CAAC,CAAC,EAAES,IAAI,CAAC,EAAEC,OAAO,CAAC,EAAEC,QAAQ,KAAK,CAAC;IACzD;IAEQ,cAAc;QAClB,MAAMC,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,OAAOA,QAAQ,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU;IACxD;IAEQ,aAAaZ,GAAa,EAAU;QACxC,OAAO,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAACA,MAAM,QAAQ;IAClE;AACJ;AAEO,MAAMa,0BAA0BC,qBAAqB;IACxD,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QAACoB;QAAmBC;QAAyBC;KAAc;AAC7E"}
@@ -1 +0,0 @@
1
- export * from "./StackOutputCacheService.js";
@@ -1 +0,0 @@
1
- export * from "./StackOutputCacheService.js";
@@ -1,13 +0,0 @@
1
- import { WatchedLambdaFunctionsService, LocalStorageService } from "../../abstractions/index.js";
2
- export declare class DefaultWatchedLambdaFunctionsService implements WatchedLambdaFunctionsService.Interface {
3
- private localStorageService;
4
- constructor(localStorageService: LocalStorageService.Interface);
5
- markDirty(params: WatchedLambdaFunctionsService.Params, functionUrns: string[]): void;
6
- getDirty(params: WatchedLambdaFunctionsService.Params): string[];
7
- clearDirty(params: WatchedLambdaFunctionsService.Params): void;
8
- clearAll(): void;
9
- private getCacheKey;
10
- private getData;
11
- private setData;
12
- }
13
- export declare const watchedLambdaFunctionsService: import("@webiny/di").Implementation<typeof DefaultWatchedLambdaFunctionsService>;
@@ -1,54 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { LocalStorageService, WatchedLambdaFunctionsService } from "../../abstractions/index.js";
3
- const WATCHED_LAMBDA_FUNCTIONS_KEY = "watchedLambdaFunctions";
4
- class DefaultWatchedLambdaFunctionsService {
5
- constructor(localStorageService){
6
- this.localStorageService = localStorageService;
7
- }
8
- markDirty(params, functionUrns) {
9
- const key = this.getCacheKey(params);
10
- const data = this.getData(key);
11
- if (!data[params.name]) data[params.name] = [];
12
- for (const urn of functionUrns)if (!data[params.name].includes(urn)) data[params.name].push(urn);
13
- this.setData(key, data);
14
- }
15
- getDirty(params) {
16
- const key = this.getCacheKey(params);
17
- const data = this.getData(key);
18
- return data[params.name] || [];
19
- }
20
- clearDirty(params) {
21
- const key = this.getCacheKey(params);
22
- const data = this.getData(key);
23
- delete data[params.name];
24
- this.setData(key, data);
25
- }
26
- clearAll() {
27
- this.setData(WATCHED_LAMBDA_FUNCTIONS_KEY, {});
28
- }
29
- getCacheKey(params) {
30
- return params.deploymentId ? `${WATCHED_LAMBDA_FUNCTIONS_KEY}-${params.deploymentId}` : WATCHED_LAMBDA_FUNCTIONS_KEY;
31
- }
32
- getData(key) {
33
- const data = this.localStorageService.get(key);
34
- if (!data) return {};
35
- try {
36
- return "string" == typeof data ? JSON.parse(data) : data;
37
- } catch {
38
- return {};
39
- }
40
- }
41
- setData(key, data) {
42
- this.localStorageService.set(key, data);
43
- }
44
- }
45
- const watchedLambdaFunctionsService = createImplementation({
46
- abstraction: WatchedLambdaFunctionsService,
47
- implementation: DefaultWatchedLambdaFunctionsService,
48
- dependencies: [
49
- LocalStorageService
50
- ]
51
- });
52
- export { DefaultWatchedLambdaFunctionsService, watchedLambdaFunctionsService };
53
-
54
- //# sourceMappingURL=WatchedLambdaFunctionsService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js","sources":["../../../src/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { WatchedLambdaFunctionsService, LocalStorageService } from \"~/abstractions/index.js\";\n\nconst WATCHED_LAMBDA_FUNCTIONS_KEY = \"watchedLambdaFunctions\";\n\ninterface WatchedLambdaFunctionsData {\n [app: string]: string[]; // app name -> array of Lambda URNs\n}\n\nexport class DefaultWatchedLambdaFunctionsService\n implements WatchedLambdaFunctionsService.Interface\n{\n constructor(private localStorageService: LocalStorageService.Interface) {}\n\n markDirty(params: WatchedLambdaFunctionsService.Params, functionUrns: string[]): void {\n const key = this.getCacheKey(params);\n const data = this.getData(key);\n\n if (!data[params.name]) {\n data[params.name] = [];\n }\n\n // Add new URNs, avoiding duplicates.\n for (const urn of functionUrns) {\n if (!data[params.name].includes(urn)) {\n data[params.name].push(urn);\n }\n }\n\n this.setData(key, data);\n }\n\n getDirty(params: WatchedLambdaFunctionsService.Params): string[] {\n const key = this.getCacheKey(params);\n const data = this.getData(key);\n return data[params.name] || [];\n }\n\n clearDirty(params: WatchedLambdaFunctionsService.Params): void {\n const key = this.getCacheKey(params);\n const data = this.getData(key);\n delete data[params.name];\n this.setData(key, data);\n }\n\n clearAll(): void {\n this.setData(WATCHED_LAMBDA_FUNCTIONS_KEY, {});\n }\n\n private getCacheKey(params: WatchedLambdaFunctionsService.Params): string {\n return params.deploymentId\n ? `${WATCHED_LAMBDA_FUNCTIONS_KEY}-${params.deploymentId}`\n : WATCHED_LAMBDA_FUNCTIONS_KEY;\n }\n\n private getData(key: string): WatchedLambdaFunctionsData {\n const data = this.localStorageService.get(key);\n if (!data) {\n return {};\n }\n\n try {\n return typeof data === \"string\" ? JSON.parse(data) : data;\n } catch {\n return {};\n }\n }\n\n private setData(key: string, data: WatchedLambdaFunctionsData): void {\n this.localStorageService.set(key, data);\n }\n}\n\nexport const watchedLambdaFunctionsService = createImplementation({\n abstraction: WatchedLambdaFunctionsService,\n implementation: DefaultWatchedLambdaFunctionsService,\n dependencies: [LocalStorageService]\n});\n"],"names":["WATCHED_LAMBDA_FUNCTIONS_KEY","DefaultWatchedLambdaFunctionsService","localStorageService","params","functionUrns","key","data","urn","JSON","watchedLambdaFunctionsService","createImplementation","WatchedLambdaFunctionsService","LocalStorageService"],"mappings":";;AAGA,MAAMA,+BAA+B;AAM9B,MAAMC;IAGT,YAAoBC,mBAAkD,CAAE;aAApDA,mBAAmB,GAAnBA;IAAqD;IAEzE,UAAUC,MAA4C,EAAEC,YAAsB,EAAQ;QAClF,MAAMC,MAAM,IAAI,CAAC,WAAW,CAACF;QAC7B,MAAMG,OAAO,IAAI,CAAC,OAAO,CAACD;QAE1B,IAAI,CAACC,IAAI,CAACH,OAAO,IAAI,CAAC,EAClBG,IAAI,CAACH,OAAO,IAAI,CAAC,GAAG,EAAE;QAI1B,KAAK,MAAMI,OAAOH,aACd,IAAI,CAACE,IAAI,CAACH,OAAO,IAAI,CAAC,CAAC,QAAQ,CAACI,MAC5BD,IAAI,CAACH,OAAO,IAAI,CAAC,CAAC,IAAI,CAACI;QAI/B,IAAI,CAAC,OAAO,CAACF,KAAKC;IACtB;IAEA,SAASH,MAA4C,EAAY;QAC7D,MAAME,MAAM,IAAI,CAAC,WAAW,CAACF;QAC7B,MAAMG,OAAO,IAAI,CAAC,OAAO,CAACD;QAC1B,OAAOC,IAAI,CAACH,OAAO,IAAI,CAAC,IAAI,EAAE;IAClC;IAEA,WAAWA,MAA4C,EAAQ;QAC3D,MAAME,MAAM,IAAI,CAAC,WAAW,CAACF;QAC7B,MAAMG,OAAO,IAAI,CAAC,OAAO,CAACD;QAC1B,OAAOC,IAAI,CAACH,OAAO,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,CAACE,KAAKC;IACtB;IAEA,WAAiB;QACb,IAAI,CAAC,OAAO,CAACN,8BAA8B,CAAC;IAChD;IAEQ,YAAYG,MAA4C,EAAU;QACtE,OAAOA,OAAO,YAAY,GACpB,GAAGH,6BAA6B,CAAC,EAAEG,OAAO,YAAY,EAAE,GACxDH;IACV;IAEQ,QAAQK,GAAW,EAA8B;QACrD,MAAMC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAACD;QAC1C,IAAI,CAACC,MACD,OAAO,CAAC;QAGZ,IAAI;YACA,OAAO,AAAgB,YAAhB,OAAOA,OAAoBE,KAAK,KAAK,CAACF,QAAQA;QACzD,EAAE,OAAM;YACJ,OAAO,CAAC;QACZ;IACJ;IAEQ,QAAQD,GAAW,EAAEC,IAAgC,EAAQ;QACjE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAACD,KAAKC;IACtC;AACJ;AAEO,MAAMG,gCAAgCC,qBAAqB;IAC9D,aAAaC;IACb,gBAAgBV;IAChB,cAAc;QAACW;KAAoB;AACvC"}
@@ -1 +0,0 @@
1
- export * from "./WatchedLambdaFunctionsService.js";
@@ -1 +0,0 @@
1
- export * from "./WatchedLambdaFunctionsService.js";
@@ -1 +0,0 @@
1
- export declare const withPulumiConfigPassphrase: (passphrase?: string) => import("./types.js").IConfigurationCb;
@@ -1,7 +0,0 @@
1
- import { createConfiguration } from "./configuration.js";
2
- const withPulumiConfigPassphrase = (passphrase)=>createConfiguration(()=>({
3
- PULUMI_CONFIG_PASSPHRASE: passphrase || process.env.PULUMI_CONFIG_PASSPHRASE || "webiny"
4
- }));
5
- export { withPulumiConfigPassphrase };
6
-
7
- //# sourceMappingURL=withPulumiConfigPassphrase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils/env/withPulumiConfigPassphrase.js","sources":["../../../src/utils/env/withPulumiConfigPassphrase.ts"],"sourcesContent":["import { createConfiguration } from \"./configuration.js\";\n\nexport const withPulumiConfigPassphrase = (passphrase?: string) => {\n // TODO: use PulumiGetConfigPassphraseService instead.\n return createConfiguration(() => {\n return {\n PULUMI_CONFIG_PASSPHRASE: passphrase || process.env.PULUMI_CONFIG_PASSPHRASE || \"webiny\"\n };\n });\n};\n"],"names":["withPulumiConfigPassphrase","passphrase","createConfiguration","process"],"mappings":";AAEO,MAAMA,6BAA6B,CAACC,aAEhCC,oBAAoB,IAChB;YACH,0BAA0BD,cAAcE,QAAQ,GAAG,CAAC,wBAAwB,IAAI;QACpF"}