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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (540) hide show
  1. package/AwsProjectSdk.d.ts +38 -0
  2. package/AwsProjectSdk.js +61 -0
  3. package/AwsProjectSdk.js.map +1 -0
  4. package/abstractions/features/DestroyApp.d.ts +18 -0
  5. package/abstractions/features/DestroyApp.js +5 -0
  6. package/abstractions/features/DestroyApp.js.map +1 -0
  7. package/abstractions/features/ExportStack.d.ts +18 -0
  8. package/abstractions/features/ExportStack.js +5 -0
  9. package/abstractions/features/ExportStack.js.map +1 -0
  10. package/abstractions/features/GetAppOutput.d.ts +18 -0
  11. package/abstractions/features/GetAppOutput.js +5 -0
  12. package/abstractions/features/GetAppOutput.js.map +1 -0
  13. package/abstractions/features/GetAppStackOutput.d.ts +18 -0
  14. package/abstractions/features/GetAppStackOutput.js +5 -0
  15. package/abstractions/features/GetAppStackOutput.js.map +1 -0
  16. package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +7 -0
  17. package/abstractions/features/GetPulumiResourceNamePrefix.js +5 -0
  18. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -0
  19. package/abstractions/features/RefreshApp.d.ts +18 -0
  20. package/abstractions/features/RefreshApp.js +5 -0
  21. package/abstractions/features/RefreshApp.js.map +1 -0
  22. package/abstractions/features/RunPulumiCommand.d.ts +19 -0
  23. package/abstractions/features/RunPulumiCommand.js +5 -0
  24. package/abstractions/features/RunPulumiCommand.js.map +1 -0
  25. package/abstractions/index.d.ts +21 -6
  26. package/abstractions/index.js +21 -6
  27. package/abstractions/pulumiTypes.d.ts +18 -0
  28. package/abstractions/pulumiTypes.js +0 -0
  29. package/abstractions/services/GetPulumiService.d.ts +20 -0
  30. package/abstractions/services/GetPulumiService.js +5 -0
  31. package/abstractions/services/GetPulumiService.js.map +1 -0
  32. package/abstractions/services/GetPulumiVersionService.d.ts +12 -0
  33. package/abstractions/services/GetPulumiVersionService.js +5 -0
  34. package/abstractions/services/GetPulumiVersionService.js.map +1 -0
  35. package/abstractions/services/IsRemotePulumiBackendService.d.ts +7 -0
  36. package/abstractions/services/IsRemotePulumiBackendService.js +5 -0
  37. package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -0
  38. package/abstractions/services/ListAppLambdaFunctionsService.d.ts +23 -0
  39. package/abstractions/services/ListAppLambdaFunctionsService.js +5 -0
  40. package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -0
  41. package/abstractions/services/ListDeployedEnvironmentsService.d.ts +12 -0
  42. package/abstractions/services/ListDeployedEnvironmentsService.js +5 -0
  43. package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -0
  44. package/abstractions/services/PulumiExportService.d.ts +13 -0
  45. package/abstractions/services/PulumiExportService.js +6 -0
  46. package/abstractions/services/PulumiExportService.js.map +1 -0
  47. package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +7 -0
  48. package/abstractions/services/PulumiGetConfigPassphraseService.js +5 -0
  49. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -0
  50. package/abstractions/services/PulumiGetSecretsProviderService.d.ts +7 -0
  51. package/abstractions/services/PulumiGetSecretsProviderService.js +5 -0
  52. package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -0
  53. package/abstractions/services/PulumiGetStackOutputService.d.ts +13 -0
  54. package/abstractions/services/PulumiGetStackOutputService.js +5 -0
  55. package/abstractions/services/PulumiGetStackOutputService.js.map +1 -0
  56. package/abstractions/services/PulumiImportService.d.ts +8 -0
  57. package/abstractions/services/PulumiImportService.js +5 -0
  58. package/abstractions/services/PulumiImportService.js.map +1 -0
  59. package/abstractions/services/PulumiLoginService.d.ts +19 -0
  60. package/abstractions/services/PulumiLoginService.js +5 -0
  61. package/abstractions/services/PulumiLoginService.js.map +1 -0
  62. package/abstractions/services/PulumiSelectStackService.d.ts +10 -0
  63. package/abstractions/services/PulumiSelectStackService.js +5 -0
  64. package/abstractions/services/PulumiSelectStackService.js.map +1 -0
  65. package/abstractions/services/StackOutputCacheService.d.ts +10 -0
  66. package/abstractions/services/StackOutputCacheService.js +5 -0
  67. package/abstractions/services/StackOutputCacheService.js.map +1 -0
  68. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +28 -0
  69. package/abstractions/services/WatchedLambdaFunctionsService.js +5 -0
  70. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -0
  71. package/api.d.ts +1 -15
  72. package/api.js +1 -3
  73. package/api.js.map +1 -1
  74. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +20 -0
  75. package/decorators/DeployAppClearWatchedLambdaFunctions.js +35 -0
  76. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -0
  77. package/decorators/DeployAppRefreshStackOutputCache.d.ts +20 -0
  78. package/decorators/DeployAppRefreshStackOutputCache.js +34 -0
  79. package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -0
  80. package/decorators/DeployAppWithHooks.d.ts +25 -0
  81. package/decorators/DeployAppWithHooks.js +58 -0
  82. package/decorators/DeployAppWithHooks.js.map +1 -0
  83. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +20 -0
  84. package/decorators/DeployAppWithWatchedLambdaReplacement.js +42 -0
  85. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -0
  86. package/decorators/DestroyAppClearStackOutputCache.d.ts +28 -0
  87. package/decorators/DestroyAppClearStackOutputCache.js +31 -0
  88. package/decorators/DestroyAppClearStackOutputCache.js.map +1 -0
  89. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +13 -0
  90. package/decorators/GetPulumiServiceWithDownloadInfo.js +28 -0
  91. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -0
  92. package/decorators/ProjectInfoWithPulumi.d.ts +34 -0
  93. package/decorators/ProjectInfoWithPulumi.js +36 -0
  94. package/decorators/ProjectInfoWithPulumi.js.map +1 -0
  95. package/exports/infra/admin.d.ts +1 -3
  96. package/exports/infra/admin.js +0 -3
  97. package/exports/infra/api.d.ts +1 -3
  98. package/exports/infra/api.js +0 -3
  99. package/exports/infra/core.d.ts +1 -2
  100. package/exports/infra/core.js +0 -2
  101. package/extensions/ApiLambdaFunction.js +3 -2
  102. package/extensions/ApiLambdaFunction.js.map +1 -1
  103. package/extensions/ApiRoute.d.ts +7 -16
  104. package/extensions/ApiRoute.js +5 -73
  105. package/extensions/ApiRoute.js.map +1 -1
  106. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +3 -2
  107. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +2 -1
  108. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
  109. package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +3 -3
  110. package/extensions/OpenSearch/EnsureOsWasDeployed.js +1 -2
  111. package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
  112. package/extensions/OpenSearch.d.ts +9 -10
  113. package/extensions/OpenSearch.js +8 -16
  114. package/extensions/OpenSearch.js.map +1 -1
  115. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +3 -3
  116. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +3 -2
  117. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  118. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +3 -2
  119. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +2 -1
  120. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
  121. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +5 -2
  122. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +3 -1
  123. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
  124. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +3 -1
  125. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +2 -1
  126. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -1
  127. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +3 -1
  128. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +2 -1
  129. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -1
  130. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +3 -1
  131. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +2 -1
  132. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -1
  133. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.d.ts +3 -2
  134. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +3 -2
  135. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  136. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +4 -2
  137. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +3 -1
  138. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -1
  139. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +6 -2
  140. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +2 -1
  141. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -1
  142. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.d.ts +1 -1
  143. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -1
  144. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  145. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.d.ts +1 -1
  146. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +1 -1
  147. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
  148. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.d.ts +1 -1
  149. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +1 -1
  150. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
  151. package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +2 -2
  152. package/extensions/ProjectAws/SetDatabaseSetupOutput.js +1 -1
  153. package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
  154. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +2 -2
  155. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +1 -1
  156. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -1
  157. package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +5 -3
  158. package/extensions/ProjectAws/UploadAdminAppToS3.js +3 -3
  159. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  160. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +5 -2
  161. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +2 -1
  162. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -1
  163. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +5 -2
  164. package/extensions/ProjectAws/ValidateProductionPulumiState.js +3 -1
  165. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -1
  166. package/extensions/ProjectAws/definitions.js +6 -2
  167. package/extensions/ProjectAws/definitions.js.map +1 -1
  168. package/extensions/ProjectAws.d.ts +1 -0
  169. package/extensions/ProjectAws.js +3 -1
  170. package/extensions/ProjectAws.js.map +1 -1
  171. package/extensions/RegisterRoutesPulumi.d.ts +2 -2
  172. package/extensions/RegisterRoutesPulumi.js +4 -4
  173. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  174. package/extensions/definitions.js +1 -5
  175. package/extensions/definitions.js.map +1 -1
  176. package/extensions/index.d.ts +2 -3
  177. package/extensions/index.js +2 -3
  178. package/extensions/registerExtensionImplementations.js +11 -0
  179. package/extensions/registerExtensionImplementations.js.map +1 -0
  180. package/extensions/toApiGatewayPath.d.ts +2 -0
  181. package/extensions/toApiGatewayPath.js +6 -0
  182. package/extensions/toApiGatewayPath.js.map +1 -0
  183. package/features/ApiGqlClient.d.ts +4 -4
  184. package/features/ApiGqlClient.js +3 -3
  185. package/features/ApiGqlClient.js.map +1 -1
  186. package/features/DeployApp/DeployApp.d.ts +22 -0
  187. package/features/DeployApp/DeployApp.js +91 -0
  188. package/features/DeployApp/DeployApp.js.map +1 -0
  189. package/features/DeployApp/index.d.ts +1 -0
  190. package/features/DeployApp/index.js +1 -0
  191. package/features/DestroyApp/DestroyApp.d.ts +20 -0
  192. package/features/DestroyApp/DestroyApp.js +70 -0
  193. package/features/DestroyApp/DestroyApp.js.map +1 -0
  194. package/features/DestroyApp/index.d.ts +1 -0
  195. package/features/DestroyApp/index.js +1 -0
  196. package/features/ExportStack/ExportStack.d.ts +12 -0
  197. package/features/ExportStack/ExportStack.js +28 -0
  198. package/features/ExportStack/ExportStack.js.map +1 -0
  199. package/features/ExportStack/index.d.ts +1 -0
  200. package/features/ExportStack/index.js +1 -0
  201. package/features/GetAppOutput/GetAppOutput.d.ts +16 -0
  202. package/features/GetAppOutput/GetAppOutput.js +55 -0
  203. package/features/GetAppOutput/GetAppOutput.js.map +1 -0
  204. package/features/GetAppOutput/index.d.ts +1 -0
  205. package/features/GetAppOutput/index.js +1 -0
  206. package/features/GetAppStackOutput/GetAppStackOutput.d.ts +13 -0
  207. package/features/GetAppStackOutput/GetAppStackOutput.js +28 -0
  208. package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -0
  209. package/features/GetAppStackOutput/index.d.ts +1 -0
  210. package/features/GetAppStackOutput/index.js +1 -0
  211. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +8 -0
  212. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +26 -0
  213. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -0
  214. package/features/GetPulumiResourceNamePrefix/index.d.ts +1 -0
  215. package/features/GetPulumiResourceNamePrefix/index.js +1 -0
  216. package/features/InvokeLambdaFunction.d.ts +3 -3
  217. package/features/InvokeLambdaFunction.js +3 -3
  218. package/features/InvokeLambdaFunction.js.map +1 -1
  219. package/features/RefreshApp/RefreshApp.d.ts +18 -0
  220. package/features/RefreshApp/RefreshApp.js +68 -0
  221. package/features/RefreshApp/RefreshApp.js.map +1 -0
  222. package/features/RefreshApp/index.d.ts +1 -0
  223. package/features/RefreshApp/index.js +1 -0
  224. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +18 -0
  225. package/features/RunPulumiCommand/RunPulumiCommand.js +65 -0
  226. package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -0
  227. package/features/RunPulumiCommand/index.d.ts +1 -0
  228. package/features/RunPulumiCommand/index.js +1 -0
  229. package/features/Watch/AwsWatch.d.ts +9 -1
  230. package/features/Watch/AwsWatch.js +8 -4
  231. package/features/Watch/AwsWatch.js.map +1 -1
  232. package/features/Watch/getIotEndpoint.d.ts +2 -2
  233. package/features/Watch/getIotEndpoint.js.map +1 -1
  234. package/features/Watch/initInvocationForwarding.d.ts +9 -0
  235. package/features/Watch/initInvocationForwarding.js +91 -0
  236. package/features/Watch/initInvocationForwarding.js.map +1 -0
  237. package/features/Watch/localInvocationWorker.d.ts +1 -0
  238. package/features/Watch/localInvocationWorker.js +31 -0
  239. package/features/Watch/localInvocationWorker.js.map +1 -0
  240. package/features/Watch/replaceLambdaFunctions.d.ts +7 -3
  241. package/features/Watch/replaceLambdaFunctions.js.map +1 -1
  242. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.d.ts +7 -0
  243. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js +25 -0
  244. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js.map +1 -0
  245. package/features/hooks/AdminAfterDeploy/index.d.ts +1 -0
  246. package/features/hooks/AdminAfterDeploy/index.js +1 -0
  247. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +7 -0
  248. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +25 -0
  249. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -0
  250. package/features/hooks/AdminBeforeDeploy/index.d.ts +1 -0
  251. package/features/hooks/AdminBeforeDeploy/index.js +1 -0
  252. package/features/hooks/AfterDeploy/AfterDeploy.d.ts +7 -0
  253. package/features/hooks/AfterDeploy/AfterDeploy.js +25 -0
  254. package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -0
  255. package/features/hooks/AfterDeploy/index.d.ts +1 -0
  256. package/features/hooks/AfterDeploy/index.js +1 -0
  257. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.d.ts +7 -0
  258. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js +25 -0
  259. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js.map +1 -0
  260. package/features/hooks/ApiAfterDeploy/index.d.ts +1 -0
  261. package/features/hooks/ApiAfterDeploy/index.js +1 -0
  262. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +7 -0
  263. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +25 -0
  264. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -0
  265. package/features/hooks/ApiBeforeDeploy/index.d.ts +1 -0
  266. package/features/hooks/ApiBeforeDeploy/index.js +1 -0
  267. package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +7 -0
  268. package/features/hooks/BeforeDeploy/BeforeDeploy.js +25 -0
  269. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -0
  270. package/features/hooks/BeforeDeploy/index.d.ts +1 -0
  271. package/features/hooks/BeforeDeploy/index.js +1 -0
  272. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.d.ts +7 -0
  273. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js +25 -0
  274. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js.map +1 -0
  275. package/features/hooks/CoreAfterDeploy/index.d.ts +1 -0
  276. package/features/hooks/CoreAfterDeploy/index.js +1 -0
  277. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +7 -0
  278. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +25 -0
  279. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -0
  280. package/features/hooks/CoreBeforeDeploy/index.d.ts +1 -0
  281. package/features/hooks/CoreBeforeDeploy/index.js +1 -0
  282. package/index.d.ts +3 -0
  283. package/index.js +3 -0
  284. package/infra.d.ts +49 -2
  285. package/infra.js +16 -4
  286. package/infra.js.map +1 -1
  287. package/package.json +26 -23
  288. package/project.d.ts +12 -1
  289. package/project.js +3 -2
  290. package/project.js.map +1 -1
  291. package/pulumi/apps/admin/createAdminPulumiApp.js +7 -4
  292. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  293. package/pulumi/apps/api/ApiCloudfront.js +2 -1
  294. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  295. package/pulumi/apps/api/ApiOutput.d.ts +6 -6
  296. package/pulumi/apps/api/createApiPulumiApp.js +9 -7
  297. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  298. package/pulumi/apps/awsUtils.js +1 -1
  299. package/pulumi/apps/awsUtils.js.map +1 -1
  300. package/pulumi/apps/blueGreen/domains/resolveDomains.js +1 -1
  301. package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
  302. package/pulumi/apps/blueGreen/types.d.ts +2 -5
  303. package/pulumi/apps/common/CoreOutput.d.ts +2 -1
  304. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  305. package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
  306. package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
  307. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  308. package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
  309. package/pulumi/apps/core/CoreDynamo.js +3 -0
  310. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  311. package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
  312. package/pulumi/apps/core/CoreFileManager.js +11 -1
  313. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  314. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
  315. package/pulumi/apps/core/CoreOpenSearch.js +3 -0
  316. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  317. package/pulumi/apps/core/configureS3BucketMalwareProtection.js +12 -2
  318. package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
  319. package/pulumi/apps/core/createCorePulumiApp.js +16 -7
  320. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  321. package/pulumi/apps/customDomain.d.ts +10 -0
  322. package/pulumi/apps/customDomain.js +5 -1
  323. package/pulumi/apps/customDomain.js.map +1 -1
  324. package/pulumi/apps/extensions/getAwsTagsFromExtension.js +1 -1
  325. package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
  326. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +2 -2
  327. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +1 -1
  328. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
  329. package/pulumi/apps/extensions/getOsConfigFromExtension.js +2 -2
  330. package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
  331. package/pulumi/apps/extensions/getVpcConfigFromExtension.js +1 -1
  332. package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
  333. package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
  334. package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
  335. package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
  336. package/pulumi/apps/extensions/isVpcEnabled.d.ts +14 -0
  337. package/pulumi/apps/extensions/isVpcEnabled.js +8 -0
  338. package/pulumi/apps/extensions/isVpcEnabled.js.map +1 -0
  339. package/pulumi/apps/syncSystem/types.d.ts +2 -2
  340. package/pulumi/extensions/AdminPulumi.js +3 -2
  341. package/pulumi/extensions/AdminPulumi.js.map +1 -1
  342. package/pulumi/extensions/ApiPulumi.js +3 -2
  343. package/pulumi/extensions/ApiPulumi.js.map +1 -1
  344. package/pulumi/extensions/CorePulumi.js +3 -2
  345. package/pulumi/extensions/CorePulumi.js.map +1 -1
  346. package/pulumi/extensions/index.d.ts +53 -22
  347. package/pulumi/extensions/index.js +12 -9
  348. package/pulumi/extensions/index.js.map +1 -1
  349. package/pulumi/features/AdminPulumi/AdminPulumi.d.ts +1 -1
  350. package/pulumi/features/AdminPulumi/AdminPulumi.js +1 -1
  351. package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -1
  352. package/pulumi/features/ApiPulumi/ApiPulumi.d.ts +1 -1
  353. package/pulumi/features/ApiPulumi/ApiPulumi.js +1 -1
  354. package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -1
  355. package/pulumi/features/CorePulumi/CorePulumi.d.ts +1 -1
  356. package/pulumi/features/CorePulumi/CorePulumi.js +1 -1
  357. package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -1
  358. package/pulumi/features/DefaultSetAdminCustomDomains.d.ts +1 -1
  359. package/pulumi/features/DefaultSetAdminCustomDomains.js.map +1 -1
  360. package/pulumi/features/DefaultSetApiCustomDomains.d.ts +1 -1
  361. package/pulumi/features/DefaultSetApiCustomDomains.js.map +1 -1
  362. package/pulumi/getAwsProjectSdk.d.ts +2 -12
  363. package/pulumi/getAwsProjectSdk.js +2 -3
  364. package/pulumi/getAwsProjectSdk.js.map +1 -1
  365. package/pulumi/getStackOutput.d.ts +4 -5
  366. package/pulumi/getStackOutput.js.map +1 -1
  367. package/pulumi/types.d.ts +4 -3
  368. package/pulumi/utils/getDistributionUrl.d.ts +9 -0
  369. package/pulumi/utils/getDistributionUrl.js +8 -0
  370. package/pulumi/utils/getDistributionUrl.js.map +1 -0
  371. package/pulumi/utils/index.d.ts +1 -0
  372. package/pulumi/utils/index.js +1 -0
  373. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  374. package/registerAwsProjectFeatures.js +38 -9
  375. package/registerAwsProjectFeatures.js.map +1 -1
  376. package/services/AdminStackOutputService.d.ts +3 -3
  377. package/services/AdminStackOutputService.js +2 -2
  378. package/services/AdminStackOutputService.js.map +1 -1
  379. package/services/ApiStackOutputService.d.ts +3 -3
  380. package/services/ApiStackOutputService.js +2 -2
  381. package/services/ApiStackOutputService.js.map +1 -1
  382. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.d.ts +10 -0
  383. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js +30 -0
  384. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js.map +1 -0
  385. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.d.ts +9 -0
  386. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js +24 -0
  387. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js.map +1 -0
  388. package/services/CoreStackOutputService.d.ts +3 -3
  389. package/services/CoreStackOutputService.js +2 -2
  390. package/services/CoreStackOutputService.js.map +1 -1
  391. package/services/GetPulumiService/GetPulumiService.d.ts +4 -3
  392. package/services/GetPulumiService/GetPulumiService.js +3 -2
  393. package/services/GetPulumiService/GetPulumiService.js.map +1 -1
  394. package/services/GetPulumiVersionService/GetPulumiVersionService.d.ts +5 -0
  395. package/services/GetPulumiVersionService/GetPulumiVersionService.js +46 -0
  396. package/services/GetPulumiVersionService/GetPulumiVersionService.js.map +1 -0
  397. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +14 -0
  398. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +15 -0
  399. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -0
  400. package/services/IsRemotePulumiBackendService/index.d.ts +1 -0
  401. package/services/IsRemotePulumiBackendService/index.js +1 -0
  402. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +20 -0
  403. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +63 -0
  404. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -0
  405. package/services/ListAppLambdaFunctionsService/index.d.ts +1 -0
  406. package/services/ListAppLambdaFunctionsService/index.js +1 -0
  407. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +8 -0
  408. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +31 -0
  409. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -0
  410. package/services/ListDeployedEnvironmentsService/index.d.ts +1 -0
  411. package/services/ListDeployedEnvironmentsService/index.js +1 -0
  412. package/services/PulumiExportService/PulumiExportService.d.ts +16 -0
  413. package/services/PulumiExportService/PulumiExportService.js +54 -0
  414. package/services/PulumiExportService/PulumiExportService.js.map +1 -0
  415. package/services/PulumiExportService/index.d.ts +1 -0
  416. package/services/PulumiExportService/index.js +1 -0
  417. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +5 -0
  418. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +15 -0
  419. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -0
  420. package/services/PulumiGetConfigPassphraseService/index.d.ts +1 -0
  421. package/services/PulumiGetConfigPassphraseService/index.js +1 -0
  422. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +5 -0
  423. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +15 -0
  424. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -0
  425. package/services/PulumiGetSecretsProviderService/index.d.ts +1 -0
  426. package/services/PulumiGetSecretsProviderService/index.js +1 -0
  427. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +16 -0
  428. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +69 -0
  429. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -0
  430. package/services/PulumiGetStackOutputService/index.d.ts +1 -0
  431. package/services/PulumiGetStackOutputService/index.js +1 -0
  432. package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +1 -0
  433. package/services/PulumiGetStackOutputService/mapStackOutput.js +22 -0
  434. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -0
  435. package/services/PulumiImportService/PulumiImportService.d.ts +13 -0
  436. package/services/PulumiImportService/PulumiImportService.js +64 -0
  437. package/services/PulumiImportService/PulumiImportService.js.map +1 -0
  438. package/services/PulumiImportService/index.d.ts +1 -0
  439. package/services/PulumiImportService/index.js +1 -0
  440. package/services/PulumiLoginService/PulumiLoginService.d.ts +13 -0
  441. package/services/PulumiLoginService/PulumiLoginService.js +59 -0
  442. package/services/PulumiLoginService/PulumiLoginService.js.map +1 -0
  443. package/services/PulumiLoginService/index.d.ts +1 -0
  444. package/services/PulumiLoginService/index.js +1 -0
  445. package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +20 -0
  446. package/services/PulumiSelectStackService/PulumiSelectStackService.js +106 -0
  447. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -0
  448. package/services/PulumiSelectStackService/index.d.ts +1 -0
  449. package/services/PulumiSelectStackService/index.js +1 -0
  450. package/services/StackOutputCacheService/StackOutputCacheService.d.ts +21 -0
  451. package/services/StackOutputCacheService/StackOutputCacheService.js +90 -0
  452. package/services/StackOutputCacheService/StackOutputCacheService.js.map +1 -0
  453. package/services/StackOutputCacheService/index.d.ts +1 -0
  454. package/services/StackOutputCacheService/index.js +1 -0
  455. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +14 -0
  456. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +55 -0
  457. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -0
  458. package/services/WatchedLambdaFunctionsService/index.d.ts +1 -0
  459. package/services/WatchedLambdaFunctionsService/index.js +1 -0
  460. package/utils/withPulumiConfigPassphrase.d.ts +1 -0
  461. package/utils/withPulumiConfigPassphrase.js +7 -0
  462. package/utils/withPulumiConfigPassphrase.js.map +1 -0
  463. package/abstractions/ApiGqlClient.d.ts +0 -23
  464. package/abstractions/ApiGqlClient.js +0 -5
  465. package/abstractions/ApiGqlClient.js.map +0 -1
  466. package/abstractions/InvokeLambdaFunction.d.ts +0 -18
  467. package/abstractions/InvokeLambdaFunction.js +0 -5
  468. package/abstractions/InvokeLambdaFunction.js.map +0 -1
  469. package/abstractions/features/pulumi/AdminPulumi.d.ts +0 -9
  470. package/abstractions/features/pulumi/AdminPulumi.js +0 -5
  471. package/abstractions/features/pulumi/AdminPulumi.js.map +0 -1
  472. package/abstractions/features/pulumi/ApiPulumi.d.ts +0 -9
  473. package/abstractions/features/pulumi/ApiPulumi.js +0 -5
  474. package/abstractions/features/pulumi/ApiPulumi.js.map +0 -1
  475. package/abstractions/features/pulumi/CorePulumi.d.ts +0 -9
  476. package/abstractions/features/pulumi/CorePulumi.js +0 -5
  477. package/abstractions/features/pulumi/CorePulumi.js.map +0 -1
  478. package/abstractions/features/pulumi/SetAdminCustomDomains.d.ts +0 -9
  479. package/abstractions/features/pulumi/SetAdminCustomDomains.js +0 -5
  480. package/abstractions/features/pulumi/SetAdminCustomDomains.js.map +0 -1
  481. package/abstractions/features/pulumi/SetApiCustomDomains.d.ts +0 -9
  482. package/abstractions/features/pulumi/SetApiCustomDomains.js +0 -5
  483. package/abstractions/features/pulumi/SetApiCustomDomains.js.map +0 -1
  484. package/abstractions/features/pulumi/index.d.ts +0 -5
  485. package/abstractions/features/pulumi/index.js +0 -5
  486. package/abstractions/services/AdminStackOutputService.d.ts +0 -13
  487. package/abstractions/services/AdminStackOutputService.js +0 -5
  488. package/abstractions/services/AdminStackOutputService.js.map +0 -1
  489. package/abstractions/services/ApiStackOutputService.d.ts +0 -29
  490. package/abstractions/services/ApiStackOutputService.js +0 -5
  491. package/abstractions/services/ApiStackOutputService.js.map +0 -1
  492. package/abstractions/services/CoreStackOutputService.d.ts +0 -16
  493. package/abstractions/services/CoreStackOutputService.js +0 -5
  494. package/abstractions/services/CoreStackOutputService.js.map +0 -1
  495. package/exports/extensions.d.ts +0 -5
  496. package/exports/extensions.js +0 -5
  497. package/exports/infra.d.ts +0 -1
  498. package/exports/infra.js +0 -1
  499. package/extensions/AwsDefaultRegion.d.ts +0 -4
  500. package/extensions/AwsDefaultRegion.js +0 -23
  501. package/extensions/AwsDefaultRegion.js.map +0 -1
  502. package/extensions/BackgroundTasks.d.ts +0 -4
  503. package/extensions/BackgroundTasks.js +0 -24
  504. package/extensions/BackgroundTasks.js.map +0 -1
  505. package/extensions/Cms/ModelFieldCompression.d.ts +0 -4
  506. package/extensions/Cms/ModelFieldCompression.js +0 -24
  507. package/extensions/Cms/ModelFieldCompression.js.map +0 -1
  508. package/extensions/Mailer/Smtp.d.ts +0 -8
  509. package/extensions/Mailer/Smtp.js +0 -21
  510. package/extensions/Mailer/Smtp.js.map +0 -1
  511. package/extensions/Mailer/Smtp.test.js +0 -127
  512. package/extensions/Mailer/Smtp.test.js.map +0 -1
  513. package/extensions/Mailer/SmtpParamsSchema.d.ts +0 -9
  514. package/extensions/Mailer/SmtpParamsSchema.js +0 -17
  515. package/extensions/Mailer/SmtpParamsSchema.js.map +0 -1
  516. package/extensions/ProjectAws/AutoInstall.d.ts +0 -9
  517. package/extensions/ProjectAws/AutoInstall.js +0 -20
  518. package/extensions/ProjectAws/AutoInstall.js.map +0 -1
  519. package/extensions/routePath.d.ts +0 -20
  520. package/extensions/routePath.js +0 -13
  521. package/extensions/routePath.js.map +0 -1
  522. package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
  523. package/pulumi/extensions/AdminCustomDomains.js +0 -20
  524. package/pulumi/extensions/AdminCustomDomains.js.map +0 -1
  525. package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
  526. package/pulumi/extensions/ApiCustomDomains.js +0 -20
  527. package/pulumi/extensions/ApiCustomDomains.js.map +0 -1
  528. package/pulumi/extensions/AwsTags.d.ts +0 -4
  529. package/pulumi/extensions/AwsTags.js +0 -16
  530. package/pulumi/extensions/AwsTags.js.map +0 -1
  531. package/pulumi/extensions/BlueGreenDeployments.d.ts +0 -34
  532. package/pulumi/extensions/BlueGreenDeployments.js +0 -38
  533. package/pulumi/extensions/BlueGreenDeployments.js.map +0 -1
  534. package/pulumi/extensions/OpenSearch.d.ts +0 -10
  535. package/pulumi/extensions/OpenSearch.js +0 -21
  536. package/pulumi/extensions/OpenSearch.js.map +0 -1
  537. package/pulumi/extensions/Vpc.d.ts +0 -15
  538. package/pulumi/extensions/Vpc.js +0 -26
  539. package/pulumi/extensions/Vpc.js.map +0 -1
  540. /package/extensions/{Mailer/Smtp.test.d.ts → registerExtensionImplementations.d.ts} +0 -0
@@ -1,4 +1,12 @@
1
- import { GetApp, ListAppLambdaFunctionsService, LoggerService, ProjectSdkParamsService, PulumiExportService, PulumiGetStackOutputService, UiService, Watch, WatchedLambdaFunctionsService } from "@webiny/project/abstractions/index.js";
1
+ import { GetApp } from "@webiny/project/abstractions/index.js";
2
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
4
+ import { UiService } from "@webiny/project/abstractions/index.js";
5
+ import { Watch } from "@webiny/project/abstractions/index.js";
6
+ import { ListAppLambdaFunctionsService } from "../../abstractions/services/ListAppLambdaFunctionsService.js";
7
+ import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
8
+ import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
9
+ import { WatchedLambdaFunctionsService } from "../../abstractions/services/WatchedLambdaFunctionsService.js";
2
10
  export declare class AwsWatch implements Watch.Interface {
3
11
  private getApp;
4
12
  private logger;
@@ -1,8 +1,9 @@
1
- import { GetApp, ListAppLambdaFunctionsService, LoggerService, ProjectSdkParamsService, PulumiExportService, PulumiGetStackOutputService, UiService, Watch, WatchedLambdaFunctionsService } from "@webiny/project/abstractions/index.js";
1
+ import { GetApp, LoggerService, ProjectSdkParamsService, UiService, Watch } from "@webiny/project/abstractions/index.js";
2
+ import { ListAppLambdaFunctionsService } from "../../abstractions/services/ListAppLambdaFunctionsService.js";
3
+ import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
4
+ import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
5
+ import { WatchedLambdaFunctionsService } from "../../abstractions/services/WatchedLambdaFunctionsService.js";
2
6
  import chalk from "chalk";
3
- import { getIotEndpoint } from "./getIotEndpoint.js";
4
- import { replaceLambdaFunctions } from "./replaceLambdaFunctions.js";
5
- import { initInvocationForwarding } from "@webiny/project/features/Watch/initInvocationForwarding.js";
6
7
  class AwsWatch {
7
8
  constructor(getApp, logger, listAppLambdaFunctionsService, ui, pulumiGetStackOutputService, pulumiExportService, watchedLambdaFunctionsService, projectSdkParamsService, decoratee){
8
9
  this.getApp = getApp;
@@ -52,6 +53,9 @@ class AwsWatch {
52
53
  if (!coreStackOutput) throw new Error(`You must deploy the ${chalk.bold("core")} app before you can start a watch session. To do that, run: ${chalk.bold(`yarn webiny deploy core --env ${sdkParams.env}`)}`);
53
54
  const deploymentId = coreStackOutput?.deploymentId;
54
55
  const iotEndpointTopic = `webiny-watch-${deploymentId}`;
56
+ const { getIotEndpoint } = await import("./getIotEndpoint.js");
57
+ const { replaceLambdaFunctions } = await import("./replaceLambdaFunctions.js");
58
+ const { initInvocationForwarding } = await import("./initInvocationForwarding.js");
55
59
  const iotEndpoint = await getIotEndpoint(coreStackOutput);
56
60
  const sessionId = new Date().getTime();
57
61
  const increaseTimeout = params.increaseTimeout;
@@ -1 +1 @@
1
- {"version":3,"file":"features/Watch/AwsWatch.js","sources":["../../../src/features/Watch/AwsWatch.ts"],"sourcesContent":["import {\n GetApp,\n ListAppLambdaFunctionsService,\n LoggerService,\n ProjectSdkParamsService,\n PulumiExportService,\n PulumiGetStackOutputService,\n UiService,\n Watch,\n WatchedLambdaFunctionsService\n} from \"@webiny/project/abstractions/index.js\";\nimport chalk from \"chalk\";\nimport type inspectorType from \"inspector\";\nimport { type ICoreStackOutput } from \"@webiny/project/abstractions/features/GetAppStackOutput.js\";\nimport { getIotEndpoint } from \"./getIotEndpoint.js\";\nimport { replaceLambdaFunctions } from \"./replaceLambdaFunctions.js\";\nimport { initInvocationForwarding } from \"@webiny/project/features/Watch/initInvocationForwarding.js\";\n\nexport class AwsWatch implements Watch.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private listAppLambdaFunctionsService: ListAppLambdaFunctionsService.Interface,\n private ui: UiService.Interface,\n private pulumiGetStackOutputService: PulumiGetStackOutputService.Interface,\n private pulumiExportService: PulumiExportService.Interface,\n private watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: Watch.Interface\n ) {}\n\n async execute(params: Watch.Params): Promise<Watch.Result> {\n // Validate Lambda-specific params before the base runs workspace build.\n if (\"app\" in params && params.increaseTimeout && params.increaseTimeout > 900) {\n throw new Error(\n `When increasing the timeout, the maximum value that can be passed is 900 seconds (15 minutes).`\n );\n }\n\n const result = await this.decoratee.execute(params);\n\n // No Lambda machinery for package-only watch.\n if (!(\"app\" in params)) {\n return result;\n }\n\n const app = this.getApp.execute(params.app);\n const sdkParams = this.projectSdkParamsService.get();\n const ui = this.ui;\n const logger = this.logger;\n\n const functionsWhitelist = Array.isArray(params.function)\n ? params.function\n : ([params.function].filter(Boolean) as string[]);\n\n const functionsList = await this.listAppLambdaFunctionsService.execute(app, {\n whitelist: functionsWhitelist\n });\n\n const deployCommand = `yarn webiny deploy ${app.name} --env ${sdkParams.env}`;\n const learnMoreLink = \"https://webiny.link/local-aws-lambda-development\";\n const troubleshootingLink = learnMoreLink + \"#troubleshooting\";\n\n if (functionsList.meta.count === 0) {\n if (functionsList.meta.totalCount > 0) {\n ui.info(\n [\n \"No AWS Lambda functions will be invoked locally. If this is unexpected, you can try the following:\",\n \" ‣ stop the current development session\",\n \" ‣ redeploy the %s application by running %s command\",\n \" ‣ start a new %s session by rerunning %s command\",\n \"\",\n \"Learn more: %s\"\n ].join(\"\\n\"),\n app.name,\n deployCommand,\n \"webiny watch\",\n \"webiny watch\",\n troubleshootingLink\n );\n }\n return result;\n }\n\n ui.info(`Local AWS Lambda development session started.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n\n logger.debug(\n \"The events for following AWS Lambda functions will be forwarded locally: \",\n functionsList.list.map(fn => fn.name)\n );\n\n ui.emptyLine();\n const { default: exitHook } = await import(/* webpackChunkName: \"exit-hook\" */ \"exit-hook\");\n\n exitHook(() => {\n console.log();\n console.log();\n\n ui.info(`Terminating local AWS Lambda development session.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app?.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n });\n\n const coreApp = this.getApp.execute(\"core\");\n const coreStackOutput =\n await this.pulumiGetStackOutputService.execute<ICoreStackOutput>(coreApp);\n\n if (!coreStackOutput) {\n throw new Error(\n `You must deploy the ${chalk.bold(\n \"core\"\n )} app before you can start a watch session. To do that, run: ${chalk.bold(\n `yarn webiny deploy core --env ${sdkParams.env}`\n )}`\n );\n }\n\n const deploymentId = coreStackOutput?.deploymentId;\n const iotEndpointTopic = `webiny-watch-${deploymentId}`;\n const iotEndpoint = await getIotEndpoint(coreStackOutput);\n\n const sessionId = new Date().getTime();\n const increaseTimeout = params.increaseTimeout;\n const localExecutionHandshakeTimeout = params.increaseHandshakeTimeout || 5;\n\n replaceLambdaFunctions({\n app,\n deploymentId,\n dependencies: {\n uiService: ui,\n loggerService: logger,\n pulumiExportService: this.pulumiExportService,\n watchedLambdaFunctionsService: this.watchedLambdaFunctionsService\n },\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout\n });\n\n let inspector: typeof inspectorType | undefined = undefined;\n if (params.inspect) {\n inspector = await import(\"inspector\");\n inspector!.open(9229, \"127.0.0.1\");\n ui.emptyLine();\n\n exitHook(() => {\n inspector!.close();\n });\n }\n\n initInvocationForwarding({\n iotEndpoint,\n iotEndpointTopic,\n functionsList,\n sessionId\n });\n\n return result;\n }\n}\n\nexport const awsWatch = Watch.createDecorator({\n decorator: AwsWatch,\n dependencies: [\n GetApp,\n LoggerService,\n ListAppLambdaFunctionsService,\n UiService,\n PulumiGetStackOutputService,\n PulumiExportService,\n WatchedLambdaFunctionsService,\n ProjectSdkParamsService\n ]\n});\n"],"names":["AwsWatch","getApp","logger","listAppLambdaFunctionsService","ui","pulumiGetStackOutputService","pulumiExportService","watchedLambdaFunctionsService","projectSdkParamsService","decoratee","params","Error","result","app","sdkParams","functionsWhitelist","Array","Boolean","functionsList","deployCommand","learnMoreLink","troubleshootingLink","fn","exitHook","console","coreApp","coreStackOutput","chalk","deploymentId","iotEndpointTopic","iotEndpoint","getIotEndpoint","sessionId","Date","increaseTimeout","localExecutionHandshakeTimeout","replaceLambdaFunctions","inspector","initInvocationForwarding","awsWatch","Watch","GetApp","LoggerService","ListAppLambdaFunctionsService","UiService","PulumiGetStackOutputService","PulumiExportService","WatchedLambdaFunctionsService","ProjectSdkParamsService"],"mappings":"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"}
1
+ {"version":3,"file":"features/Watch/AwsWatch.js","sources":["../../../src/features/Watch/AwsWatch.ts"],"sourcesContent":["import { GetApp } from \"@webiny/project/abstractions/index.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/index.js\";\nimport { Watch } from \"@webiny/project/abstractions/index.js\";\nimport { ListAppLambdaFunctionsService } from \"~/abstractions/services/ListAppLambdaFunctionsService.js\";\nimport { PulumiExportService } from \"~/abstractions/services/PulumiExportService.js\";\nimport { PulumiGetStackOutputService } from \"~/abstractions/services/PulumiGetStackOutputService.js\";\nimport { WatchedLambdaFunctionsService } from \"~/abstractions/services/WatchedLambdaFunctionsService.js\";\nimport chalk from \"chalk\";\nimport type inspectorType from \"inspector\";\nimport { type CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/services/CoreStackOutputService.js\";\n\nexport class AwsWatch implements Watch.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private listAppLambdaFunctionsService: ListAppLambdaFunctionsService.Interface,\n private ui: UiService.Interface,\n private pulumiGetStackOutputService: PulumiGetStackOutputService.Interface,\n private pulumiExportService: PulumiExportService.Interface,\n private watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: Watch.Interface\n ) {}\n\n async execute(params: Watch.Params): Promise<Watch.Result> {\n // Validate Lambda-specific params before the base runs workspace build.\n if (\"app\" in params && params.increaseTimeout && params.increaseTimeout > 900) {\n throw new Error(\n `When increasing the timeout, the maximum value that can be passed is 900 seconds (15 minutes).`\n );\n }\n\n const result = await this.decoratee.execute(params);\n\n // No Lambda machinery for package-only watch.\n if (!(\"app\" in params)) {\n return result;\n }\n\n const app = this.getApp.execute(params.app);\n const sdkParams = this.projectSdkParamsService.get();\n const ui = this.ui;\n const logger = this.logger;\n\n const functionsWhitelist = Array.isArray(params.function)\n ? params.function\n : ([params.function].filter(Boolean) as string[]);\n\n const functionsList = await this.listAppLambdaFunctionsService.execute(app, {\n whitelist: functionsWhitelist\n });\n\n const deployCommand = `yarn webiny deploy ${app.name} --env ${sdkParams.env}`;\n const learnMoreLink = \"https://webiny.link/local-aws-lambda-development\";\n const troubleshootingLink = learnMoreLink + \"#troubleshooting\";\n\n if (functionsList.meta.count === 0) {\n if (functionsList.meta.totalCount > 0) {\n ui.info(\n [\n \"No AWS Lambda functions will be invoked locally. If this is unexpected, you can try the following:\",\n \" ‣ stop the current development session\",\n \" ‣ redeploy the %s application by running %s command\",\n \" ‣ start a new %s session by rerunning %s command\",\n \"\",\n \"Learn more: %s\"\n ].join(\"\\n\"),\n app.name,\n deployCommand,\n \"webiny watch\",\n \"webiny watch\",\n troubleshootingLink\n );\n }\n return result;\n }\n\n ui.info(`Local AWS Lambda development session started.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n\n logger.debug(\n \"The events for following AWS Lambda functions will be forwarded locally: \",\n functionsList.list.map(fn => fn.name)\n );\n\n ui.emptyLine();\n const { default: exitHook } = await import(/* webpackChunkName: \"exit-hook\" */ \"exit-hook\");\n\n exitHook(() => {\n console.log();\n console.log();\n\n ui.info(`Terminating local AWS Lambda development session.`);\n ui.warning(\n `Note that once the session is terminated, the %s application will no longer work. To fix this, you %s redeploy it via the %s command. Learn more: %s.`,\n app?.getDisplayName(),\n \"MUST\",\n deployCommand,\n learnMoreLink\n );\n });\n\n const coreApp = this.getApp.execute(\"core\");\n const coreStackOutput =\n await this.pulumiGetStackOutputService.execute<CoreStackOutputService.Output>(coreApp);\n\n if (!coreStackOutput) {\n throw new Error(\n `You must deploy the ${chalk.bold(\n \"core\"\n )} app before you can start a watch session. To do that, run: ${chalk.bold(\n `yarn webiny deploy core --env ${sdkParams.env}`\n )}`\n );\n }\n\n const deploymentId = coreStackOutput?.deploymentId;\n const iotEndpointTopic = `webiny-watch-${deploymentId}`;\n // Loaded here rather than at the top of the file. This decorator is registered for every\n // command, and these pull in the AWS IoT and Lambda clients and mqtt, which only a watch\n // session needs.\n const { getIotEndpoint } = await import(\"./getIotEndpoint.js\");\n const { replaceLambdaFunctions } = await import(\"./replaceLambdaFunctions.js\");\n const { initInvocationForwarding } =\n await import(\"~/features/Watch/initInvocationForwarding.js\");\n\n const iotEndpoint = await getIotEndpoint(coreStackOutput);\n\n const sessionId = new Date().getTime();\n const increaseTimeout = params.increaseTimeout;\n const localExecutionHandshakeTimeout = params.increaseHandshakeTimeout || 5;\n\n replaceLambdaFunctions({\n app,\n deploymentId,\n dependencies: {\n uiService: ui,\n loggerService: logger,\n pulumiExportService: this.pulumiExportService,\n watchedLambdaFunctionsService: this.watchedLambdaFunctionsService\n },\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout\n });\n\n let inspector: typeof inspectorType | undefined = undefined;\n if (params.inspect) {\n inspector = await import(\"inspector\");\n inspector!.open(9229, \"127.0.0.1\");\n ui.emptyLine();\n\n exitHook(() => {\n inspector!.close();\n });\n }\n\n initInvocationForwarding({\n iotEndpoint,\n iotEndpointTopic,\n functionsList,\n sessionId\n });\n\n return result;\n }\n}\n\nexport const awsWatch = Watch.createDecorator({\n decorator: AwsWatch,\n dependencies: [\n GetApp,\n LoggerService,\n ListAppLambdaFunctionsService,\n UiService,\n PulumiGetStackOutputService,\n PulumiExportService,\n WatchedLambdaFunctionsService,\n ProjectSdkParamsService\n ]\n});\n"],"names":["AwsWatch","getApp","logger","listAppLambdaFunctionsService","ui","pulumiGetStackOutputService","pulumiExportService","watchedLambdaFunctionsService","projectSdkParamsService","decoratee","params","Error","result","app","sdkParams","functionsWhitelist","Array","Boolean","functionsList","deployCommand","learnMoreLink","troubleshootingLink","fn","exitHook","console","coreApp","coreStackOutput","chalk","deploymentId","iotEndpointTopic","getIotEndpoint","replaceLambdaFunctions","initInvocationForwarding","iotEndpoint","sessionId","Date","increaseTimeout","localExecutionHandshakeTimeout","inspector","awsWatch","Watch","GetApp","LoggerService","ListAppLambdaFunctionsService","UiService","PulumiGetStackOutputService","PulumiExportService","WatchedLambdaFunctionsService","ProjectSdkParamsService"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import { type ICoreStackOutput } from "@webiny/project/abstractions/features/GetAppStackOutput.js";
2
- export declare const getIotEndpoint: (coreStackOutput: ICoreStackOutput) => Promise<string>;
1
+ import { type CoreStackOutputService } from "@webiny/project-extensions-aws/abstractions/services/CoreStackOutputService.js";
2
+ export declare const getIotEndpoint: (coreStackOutput: CoreStackOutputService.Output) => Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"features/Watch/getIotEndpoint.js","sources":["../../../src/features/Watch/getIotEndpoint.ts"],"sourcesContent":["import { DescribeEndpointCommand, IoTClient } from \"@webiny/aws-sdk/client-iot/index.js\";\nimport { type ICoreStackOutput } from \"@webiny/project/abstractions/features/GetAppStackOutput.js\";\n\nexport const getIotEndpoint = (coreStackOutput: ICoreStackOutput): Promise<string> => {\n const iotClient = new IoTClient();\n\n return iotClient\n .send(\n new DescribeEndpointCommand({\n endpointType: \"iot:Data-ATS\"\n })\n )\n .then(({ endpointAddress }) => {\n const watchTopic = `webiny-watch-${coreStackOutput.deploymentId}`;\n const iotAuthorizerName = coreStackOutput.iotAuthorizerName;\n\n const queryParams = [\n `x-amz-customauthorizer-name=${iotAuthorizerName}`,\n `x-webiny-watch-command-topic=${watchTopic}`\n ].join(\"&\");\n\n return `wss://${endpointAddress}/mqtt?${queryParams}`;\n });\n};\n"],"names":["getIotEndpoint","coreStackOutput","iotClient","IoTClient","DescribeEndpointCommand","endpointAddress","watchTopic","iotAuthorizerName","queryParams"],"mappings":";AAGO,MAAMA,iBAAiB,CAACC;IAC3B,MAAMC,YAAY,IAAIC;IAEtB,OAAOD,UACF,IAAI,CACD,IAAIE,wBAAwB;QACxB,cAAc;IAClB,IAEH,IAAI,CAAC,CAAC,EAAEC,eAAe,EAAE;QACtB,MAAMC,aAAa,CAAC,aAAa,EAAEL,gBAAgB,YAAY,EAAE;QACjE,MAAMM,oBAAoBN,gBAAgB,iBAAiB;QAE3D,MAAMO,cAAc;YAChB,CAAC,4BAA4B,EAAED,mBAAmB;YAClD,CAAC,6BAA6B,EAAED,YAAY;SAC/C,CAAC,IAAI,CAAC;QAEP,OAAO,CAAC,MAAM,EAAED,gBAAgB,MAAM,EAAEG,aAAa;IACzD;AACR"}
1
+ {"version":3,"file":"features/Watch/getIotEndpoint.js","sources":["../../../src/features/Watch/getIotEndpoint.ts"],"sourcesContent":["import { DescribeEndpointCommand, IoTClient } from \"@webiny/aws-sdk/client-iot/index.js\";\nimport { type CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/services/CoreStackOutputService.js\";\n\nexport const getIotEndpoint = (coreStackOutput: CoreStackOutputService.Output): Promise<string> => {\n const iotClient = new IoTClient();\n\n return iotClient\n .send(\n new DescribeEndpointCommand({\n endpointType: \"iot:Data-ATS\"\n })\n )\n .then(({ endpointAddress }) => {\n const watchTopic = `webiny-watch-${coreStackOutput.deploymentId}`;\n const iotAuthorizerName = coreStackOutput.iotAuthorizerName;\n\n const queryParams = [\n `x-amz-customauthorizer-name=${iotAuthorizerName}`,\n `x-webiny-watch-command-topic=${watchTopic}`\n ].join(\"&\");\n\n return `wss://${endpointAddress}/mqtt?${queryParams}`;\n });\n};\n"],"names":["getIotEndpoint","coreStackOutput","iotClient","IoTClient","DescribeEndpointCommand","endpointAddress","watchTopic","iotAuthorizerName","queryParams"],"mappings":";AAGO,MAAMA,iBAAiB,CAACC;IAC3B,MAAMC,YAAY,IAAIC;IAEtB,OAAOD,UACF,IAAI,CACD,IAAIE,wBAAwB;QACxB,cAAc;IAClB,IAEH,IAAI,CAAC,CAAC,EAAEC,eAAe,EAAE;QACtB,MAAMC,aAAa,CAAC,aAAa,EAAEL,gBAAgB,YAAY,EAAE;QACjE,MAAMM,oBAAoBN,gBAAgB,iBAAiB;QAE3D,MAAMO,cAAc;YAChB,CAAC,4BAA4B,EAAED,mBAAmB;YAClD,CAAC,6BAA6B,EAAED,YAAY;SAC/C,CAAC,IAAI,CAAC;QAEP,OAAO,CAAC,MAAM,EAAED,gBAAgB,MAAM,EAAEG,aAAa;IACzD;AACR"}
@@ -0,0 +1,9 @@
1
+ import mqtt from "mqtt";
2
+ import type { ListAppLambdaFunctionsService } from "../../abstractions/services/ListAppLambdaFunctionsService.js";
3
+ export interface IInitInvocationForwardingParams {
4
+ iotEndpoint: string;
5
+ iotEndpointTopic: string;
6
+ sessionId: number;
7
+ functionsList: ListAppLambdaFunctionsService.Result;
8
+ }
9
+ export declare const initInvocationForwarding: ({ iotEndpoint, iotEndpointTopic, sessionId, functionsList }: IInitInvocationForwardingParams) => Promise<mqtt.MqttClient>;
@@ -0,0 +1,91 @@
1
+ import path from "path";
2
+ import { Worker } from "worker_threads";
3
+ import { compress, decompress } from "@webiny/utils/features/compression/legacy/gzip.js";
4
+ import mqtt from "mqtt";
5
+ const WEBINY_WATCH_FN_INVOCATION_EVENT = "webiny.watch.functionInvocation";
6
+ const WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT = "webiny.watch.functionInvocationResult";
7
+ const WEBINY_WATCH_FN_INVOCATION_HANDSHAKE_EVENT = "webiny.watch.functionInvocationHandshake";
8
+ const WATCH_WORKER_PATH = path.join(import.meta.dirname, "localInvocationWorker.js");
9
+ const jsonStringifyAndCompress = (input)=>{
10
+ const jsonStringInput = JSON.stringify(input);
11
+ return compress(jsonStringInput);
12
+ };
13
+ const decompressAndJsonParse = async (input)=>{
14
+ const inputBuffer = Buffer.from(input);
15
+ const jsonStringResult = await decompress(inputBuffer);
16
+ const value = jsonStringResult?.toString ? jsonStringResult.toString("utf-8") : jsonStringResult;
17
+ return JSON.parse(value);
18
+ };
19
+ const initInvocationForwarding = async ({ iotEndpoint, iotEndpointTopic, sessionId, functionsList })=>{
20
+ const client = await mqtt.connectAsync(iotEndpoint);
21
+ await client.subscribeAsync(iotEndpointTopic);
22
+ client.on("message", async (_, message)=>{
23
+ const payload = JSON.parse(message.toString());
24
+ if (payload.eventType !== WEBINY_WATCH_FN_INVOCATION_EVENT) return;
25
+ if (payload.data.sessionId !== sessionId) return;
26
+ await client.publish(iotEndpointTopic, JSON.stringify({
27
+ eventType: WEBINY_WATCH_FN_INVOCATION_HANDSHAKE_EVENT,
28
+ eventId: new Date().getTime(),
29
+ data: {
30
+ originalEventId: payload.eventId,
31
+ compressedResult: null,
32
+ compressedError: null
33
+ }
34
+ }));
35
+ const invokedLambdaFunction = functionsList.list.find((lambdaFunction)=>lambdaFunction.name === payload.data.functionName);
36
+ if (!invokedLambdaFunction) throw new Error(`Lambda function "${payload.data.functionName}" not found.`);
37
+ try {
38
+ const result = await new Promise(async (resolve, reject)=>{
39
+ const worker = new Worker(WATCH_WORKER_PATH, {
40
+ env: {
41
+ ...payload.data.env,
42
+ WEBINY_WATCH_LOCAL_INVOCATION: "1"
43
+ },
44
+ workerData: {
45
+ handler: {
46
+ path: invokedLambdaFunction.path,
47
+ args: await decompressAndJsonParse(payload.data.compressedArgs)
48
+ }
49
+ }
50
+ });
51
+ const { default: exitHook } = await import("exit-hook");
52
+ const unsubscribeExitHook = exitHook(async ()=>{
53
+ await worker.terminate();
54
+ });
55
+ worker.on("message", (message)=>{
56
+ unsubscribeExitHook();
57
+ const { success, result, error } = JSON.parse(message);
58
+ if (success) resolve(result);
59
+ else reject(error);
60
+ });
61
+ });
62
+ await client.publish(iotEndpointTopic, JSON.stringify({
63
+ eventType: WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT,
64
+ eventId: new Date().getTime(),
65
+ data: {
66
+ originalEventId: payload.eventId,
67
+ compressedResult: await jsonStringifyAndCompress(result),
68
+ compressedError: null
69
+ }
70
+ }));
71
+ } catch (error) {
72
+ console.log(error);
73
+ await client.publish(iotEndpointTopic, JSON.stringify({
74
+ eventType: WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT,
75
+ eventId: new Date().getTime(),
76
+ data: {
77
+ originalEventId: payload.eventId,
78
+ compressedResult: null,
79
+ compressedError: await jsonStringifyAndCompress({
80
+ message: error.message,
81
+ stack: error.stack
82
+ })
83
+ }
84
+ }));
85
+ }
86
+ });
87
+ return client;
88
+ };
89
+ export { initInvocationForwarding };
90
+
91
+ //# sourceMappingURL=initInvocationForwarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/Watch/initInvocationForwarding.js","sources":["../../../src/features/Watch/initInvocationForwarding.ts"],"sourcesContent":["import path from \"path\";\nimport { Worker } from \"worker_threads\";\nimport { compress, decompress } from \"@webiny/utils/features/compression/legacy/gzip.js\";\nimport mqtt from \"mqtt\";\nimport type { ListAppLambdaFunctionsService } from \"~/abstractions/services/ListAppLambdaFunctionsService.js\";\n\nconst WEBINY_WATCH_FN_INVOCATION_EVENT = \"webiny.watch.functionInvocation\";\nconst WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT = \"webiny.watch.functionInvocationResult\";\nconst WEBINY_WATCH_FN_INVOCATION_HANDSHAKE_EVENT = \"webiny.watch.functionInvocationHandshake\";\n\nconst WATCH_WORKER_PATH = path.join(import.meta.dirname, \"localInvocationWorker.js\");\n\nconst jsonStringifyAndCompress = (input: Record<string, any>): Promise<Buffer> => {\n const jsonStringInput = JSON.stringify(input);\n return compress(jsonStringInput);\n};\n\nconst decompressAndJsonParse = async (input: string) => {\n const inputBuffer = Buffer.from(input);\n const jsonStringResult = await decompress(inputBuffer);\n\n const value = jsonStringResult?.toString\n ? jsonStringResult.toString(\"utf-8\")\n : (jsonStringResult as unknown as string);\n\n return JSON.parse(value);\n};\n\nexport interface IInitInvocationForwardingParams {\n iotEndpoint: string;\n iotEndpointTopic: string;\n sessionId: number;\n functionsList: ListAppLambdaFunctionsService.Result;\n}\n\nexport const initInvocationForwarding = async ({\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList\n}: IInitInvocationForwardingParams) => {\n const client = await mqtt.connectAsync(iotEndpoint);\n\n await client.subscribeAsync(iotEndpointTopic);\n\n client.on(\"message\", async (_, message) => {\n const payload = JSON.parse(message.toString());\n\n if (payload.eventType !== WEBINY_WATCH_FN_INVOCATION_EVENT) {\n return;\n }\n\n if (payload.data.sessionId !== sessionId) {\n return;\n }\n\n await client.publish(\n iotEndpointTopic,\n JSON.stringify({\n eventType: WEBINY_WATCH_FN_INVOCATION_HANDSHAKE_EVENT,\n eventId: new Date().getTime(),\n data: {\n originalEventId: payload.eventId,\n compressedResult: null,\n compressedError: null\n }\n })\n );\n\n const invokedLambdaFunction = functionsList.list.find(\n lambdaFunction => lambdaFunction.name === payload.data.functionName\n );\n if (!invokedLambdaFunction) {\n throw new Error(`Lambda function \"${payload.data.functionName}\" not found.`);\n }\n\n try {\n const result = await new Promise<Record<string, any>>(async (resolve, reject) => {\n const worker = new Worker(WATCH_WORKER_PATH, {\n env: { ...payload.data.env, WEBINY_WATCH_LOCAL_INVOCATION: \"1\" },\n workerData: {\n handler: {\n path: invokedLambdaFunction.path,\n args: await decompressAndJsonParse(payload.data.compressedArgs)\n }\n }\n });\n\n const { default: exitHook } = await import(\n /* webpackChunkName: \"exit-hook\" */ \"exit-hook\"\n );\n\n const unsubscribeExitHook = exitHook(async () => {\n await worker.terminate();\n });\n\n worker.on(\"message\", message => {\n unsubscribeExitHook();\n\n const { success, result, error } = JSON.parse(message);\n if (success) {\n resolve(result);\n } else {\n reject(error);\n }\n });\n });\n\n await client.publish(\n iotEndpointTopic,\n JSON.stringify({\n eventType: WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT,\n eventId: new Date().getTime(),\n data: {\n originalEventId: payload.eventId,\n compressedResult: await jsonStringifyAndCompress(result),\n compressedError: null\n }\n })\n );\n } catch (error) {\n console.log(error);\n await client.publish(\n iotEndpointTopic,\n JSON.stringify({\n eventType: WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT,\n eventId: new Date().getTime(),\n data: {\n originalEventId: payload.eventId,\n compressedResult: null,\n compressedError: await jsonStringifyAndCompress({\n message: error.message,\n stack: error.stack\n })\n }\n })\n );\n }\n });\n\n return client;\n};\n"],"names":["WEBINY_WATCH_FN_INVOCATION_EVENT","WEBINY_WATCH_FN_INVOCATION_RESULT_EVENT","WEBINY_WATCH_FN_INVOCATION_HANDSHAKE_EVENT","WATCH_WORKER_PATH","path","jsonStringifyAndCompress","input","jsonStringInput","JSON","compress","decompressAndJsonParse","inputBuffer","Buffer","jsonStringResult","decompress","value","initInvocationForwarding","iotEndpoint","iotEndpointTopic","sessionId","functionsList","client","mqtt","_","message","payload","Date","invokedLambdaFunction","lambdaFunction","Error","result","Promise","resolve","reject","worker","Worker","exitHook","unsubscribeExitHook","success","error","console"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import { parentPort, workerData } from "worker_threads";
2
+ import { pathToFileURL } from "node:url";
3
+ import node_path from "node:path";
4
+ const { handler: handlerParams } = workerData;
5
+ try {
6
+ const handlerPath = handlerParams.path;
7
+ const importSpecifier = node_path.isAbsolute(handlerPath) ? pathToFileURL(handlerPath).href : handlerPath;
8
+ const { handler } = await import(importSpecifier);
9
+ const result = await handler(...handlerParams.args);
10
+ parentPort.postMessage(JSON.stringify({
11
+ success: true,
12
+ result,
13
+ error: null
14
+ }));
15
+ } catch (error) {
16
+ const { message, code, data, stack } = error;
17
+ parentPort.postMessage(JSON.stringify({
18
+ success: false,
19
+ result: null,
20
+ error: {
21
+ message,
22
+ code,
23
+ data,
24
+ stack
25
+ }
26
+ }));
27
+ } finally{
28
+ process.exit(0);
29
+ }
30
+
31
+ //# sourceMappingURL=localInvocationWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/Watch/localInvocationWorker.js","sources":["../../../src/features/Watch/localInvocationWorker.ts"],"sourcesContent":["import { parentPort, workerData } from \"worker_threads\";\nimport { pathToFileURL } from \"node:url\";\nimport path from \"node:path\";\n\nconst { handler: handlerParams } = workerData;\n\ntry {\n const handlerPath = handlerParams.path;\n const importSpecifier = path.isAbsolute(handlerPath)\n ? pathToFileURL(handlerPath).href\n : handlerPath;\n const { handler } = await import(importSpecifier);\n\n const result = await handler(...handlerParams.args);\n parentPort!.postMessage(JSON.stringify({ success: true, result, error: null }));\n} catch (error) {\n const { message, code, data, stack } = error;\n\n parentPort!.postMessage(\n JSON.stringify({\n success: false,\n result: null,\n error: { message, code, data, stack }\n })\n );\n} finally {\n process.exit(0);\n}\n"],"names":["handlerParams","workerData","handlerPath","importSpecifier","path","pathToFileURL","handler","result","parentPort","JSON","error","message","code","data","stack","process"],"mappings":";;;AAIA,MAAM,EAAE,SAASA,aAAa,EAAE,GAAGC;AAEnC,IAAI;IACA,MAAMC,cAAcF,cAAc,IAAI;IACtC,MAAMG,kBAAkBC,UAAAA,UAAe,CAACF,eAClCG,cAAcH,aAAa,IAAI,GAC/BA;IACN,MAAM,EAAEI,OAAO,EAAE,GAAG,MAAM,MAAM,CAACH;IAEjC,MAAMI,SAAS,MAAMD,WAAWN,cAAc,IAAI;IAClDQ,WAAAA,WAAuB,CAACC,KAAK,SAAS,CAAC;QAAE,SAAS;QAAMF;QAAQ,OAAO;IAAK;AAChF,EAAE,OAAOG,OAAO;IACZ,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGJ;IAEvCF,WAAAA,WAAuB,CACnBC,KAAK,SAAS,CAAC;QACX,SAAS;QACT,QAAQ;QACR,OAAO;YAAEE;YAASC;YAAMC;YAAMC;QAAM;IACxC;AAER,SAAU;IACNC,QAAQ,IAAI,CAAC;AACjB"}
@@ -1,7 +1,11 @@
1
- import { type ListAppLambdaFunctionsService, type LoggerService, type PulumiExportService, type WatchedLambdaFunctionsService, type UiService } from "@webiny/project/abstractions/index.js";
2
- import { type AppModel } from "@webiny/project/models/index.js";
1
+ import { type ListAppLambdaFunctionsService } from "../../abstractions/services/ListAppLambdaFunctionsService.js";
2
+ import { type LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { type UiService } from "@webiny/project/abstractions/index.js";
4
+ import { type PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
5
+ import { type WatchedLambdaFunctionsService } from "../../abstractions/services/WatchedLambdaFunctionsService.js";
6
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
3
7
  export interface IReplaceLambdaFunctionsParams {
4
- app: AppModel;
8
+ app: IAppModel;
5
9
  deploymentId: string | undefined;
6
10
  iotEndpoint: string;
7
11
  iotEndpointTopic: string;
@@ -1 +1 @@
1
- {"version":3,"file":"features/Watch/replaceLambdaFunctions.js","sources":["../../../src/features/Watch/replaceLambdaFunctions.ts"],"sourcesContent":["import fs from \"fs\";\nimport pRetry from \"p-retry\";\nimport {\n GetFunctionConfigurationCommand,\n LambdaClient,\n UpdateFunctionCodeCommand,\n UpdateFunctionConfigurationCommand\n} from \"@webiny/aws-sdk/client-lambda/index.js\";\nimport {\n type ListAppLambdaFunctionsService,\n type LoggerService,\n type PulumiExportService,\n type WatchedLambdaFunctionsService,\n type UiService\n} from \"@webiny/project/abstractions/index.js\";\nimport { type AppModel } from \"@webiny/project/models/index.js\";\n\nconst WATCH_MODE_NOTE_IN_DESCRIPTION = \" (💡 local development mode, redeploy to remove)\";\nconst DEFAULT_INCREASE_TIMEOUT = 120;\n\nexport interface IReplaceLambdaFunctionsParams {\n app: AppModel;\n deploymentId: string | undefined;\n iotEndpoint: string;\n iotEndpointTopic: string;\n sessionId: number;\n functionsList: ListAppLambdaFunctionsService.Result;\n increaseTimeout?: number;\n localExecutionHandshakeTimeout?: number;\n dependencies: {\n uiService: UiService.Interface;\n loggerService: LoggerService.Interface;\n pulumiExportService: PulumiExportService.Interface;\n watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface;\n };\n}\n\nexport const replaceLambdaFunctions = async ({\n app,\n deploymentId,\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout,\n dependencies\n}: IReplaceLambdaFunctionsParams) => {\n const {\n loggerService: logger,\n pulumiExportService: exportStackState,\n watchedLambdaFunctionsService\n } = dependencies;\n\n const stackExport = await exportStackState.execute(app);\n if (!stackExport) {\n logger.info(\"No AWS Lambda functions to replace.\");\n return [];\n }\n\n const functionNamesToUpdate = functionsList.list.map(fn => fn.name);\n const replacedFunctionUrns: string[] = [];\n\n if (stackExport.deployment?.resources) {\n for (const resource of stackExport.deployment.resources) {\n if (resource.type === \"aws:lambda/function:Function\") {\n const functionName = resource.inputs?.name;\n if (functionName && functionNamesToUpdate.includes(functionName)) {\n replacedFunctionUrns.push(resource.urn);\n logger.debug(`Will replace Lambda function: ${functionName} (${resource.urn})`);\n }\n }\n }\n }\n\n if (replacedFunctionUrns.length > 0) {\n watchedLambdaFunctionsService.markDirty(\n { name: app.name, deploymentId },\n replacedFunctionUrns\n );\n logger.info(\n `Marked ${replacedFunctionUrns.length} Lambda function(s) for replacement on next deployment.`\n );\n }\n\n logger.info(\"replacing %s AWS Lambda function(s).\", functionsList.meta.count);\n const lambdaClient = new LambdaClient();\n\n const replacementsPromises = functionsList.list.map(async fn => {\n const getFnConfigCmd = new GetFunctionConfigurationCommand({ FunctionName: fn.name });\n const lambdaFnConfiguration = await lambdaClient.send(getFnConfigCmd);\n\n const updateFnCodeCmd = new UpdateFunctionCodeCommand({\n FunctionName: fn.name,\n ZipFile: fs.readFileSync(import.meta.dirname + \"/handler/handler.zip\")\n });\n\n await lambdaClient.send(updateFnCodeCmd);\n\n let Description = lambdaFnConfiguration.Description || \"\";\n if (!Description.endsWith(WATCH_MODE_NOTE_IN_DESCRIPTION)) {\n Description += WATCH_MODE_NOTE_IN_DESCRIPTION;\n }\n\n const Timeout = increaseTimeout || DEFAULT_INCREASE_TIMEOUT;\n\n await pRetry(() =>\n lambdaClient.send(\n new UpdateFunctionConfigurationCommand({\n FunctionName: fn.name,\n Timeout,\n Description,\n Environment: {\n Variables: {\n ...lambdaFnConfiguration.Environment?.Variables,\n WEBINY_WATCH: JSON.stringify({\n enabled: true,\n localExecutionHandshakeTimeout,\n sessionId,\n iotEndpoint,\n iotEndpointTopic,\n functionName: fn.name\n })\n }\n }\n })\n )\n );\n });\n\n return Promise.all(replacementsPromises).then(res => {\n logger.info(\"%s AWS Lambda function(s) replaced.\", functionsList.meta.count);\n return res;\n });\n};\n"],"names":["WATCH_MODE_NOTE_IN_DESCRIPTION","DEFAULT_INCREASE_TIMEOUT","replaceLambdaFunctions","app","deploymentId","iotEndpoint","iotEndpointTopic","sessionId","functionsList","increaseTimeout","localExecutionHandshakeTimeout","dependencies","logger","exportStackState","watchedLambdaFunctionsService","stackExport","functionNamesToUpdate","fn","replacedFunctionUrns","resource","functionName","lambdaClient","LambdaClient","replacementsPromises","getFnConfigCmd","GetFunctionConfigurationCommand","lambdaFnConfiguration","updateFnCodeCmd","UpdateFunctionCodeCommand","fs","Description","Timeout","pRetry","UpdateFunctionConfigurationCommand","JSON","Promise","res"],"mappings":";;;AAiBA,MAAMA,iCAAiC;AACvC,MAAMC,2BAA2B;AAmB1B,MAAMC,yBAAyB,OAAO,EACzCC,GAAG,EACHC,YAAY,EACZC,WAAW,EACXC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,eAAe,EACfC,8BAA8B,EAC9BC,YAAY,EACgB;IAC5B,MAAM,EACF,eAAeC,MAAM,EACrB,qBAAqBC,gBAAgB,EACrCC,6BAA6B,EAChC,GAAGH;IAEJ,MAAMI,cAAc,MAAMF,iBAAiB,OAAO,CAACV;IACnD,IAAI,CAACY,aAAa;QACdH,OAAO,IAAI,CAAC;QACZ,OAAO,EAAE;IACb;IAEA,MAAMI,wBAAwBR,cAAc,IAAI,CAAC,GAAG,CAACS,CAAAA,KAAMA,GAAG,IAAI;IAClE,MAAMC,uBAAiC,EAAE;IAEzC,IAAIH,YAAY,UAAU,EAAE,WACxB;QAAA,KAAK,MAAMI,YAAYJ,YAAY,UAAU,CAAC,SAAS,CACnD,IAAII,AAAkB,mCAAlBA,SAAS,IAAI,EAAqC;YAClD,MAAMC,eAAeD,SAAS,MAAM,EAAE;YACtC,IAAIC,gBAAgBJ,sBAAsB,QAAQ,CAACI,eAAe;gBAC9DF,qBAAqB,IAAI,CAACC,SAAS,GAAG;gBACtCP,OAAO,KAAK,CAAC,CAAC,8BAA8B,EAAEQ,aAAa,EAAE,EAAED,SAAS,GAAG,CAAC,CAAC,CAAC;YAClF;QACJ;IACJ;IAGJ,IAAID,qBAAqB,MAAM,GAAG,GAAG;QACjCJ,8BAA8B,SAAS,CACnC;YAAE,MAAMX,IAAI,IAAI;YAAEC;QAAa,GAC/Bc;QAEJN,OAAO,IAAI,CACP,CAAC,OAAO,EAAEM,qBAAqB,MAAM,CAAC,uDAAuD,CAAC;IAEtG;IAEAN,OAAO,IAAI,CAAC,wCAAwCJ,cAAc,IAAI,CAAC,KAAK;IAC5E,MAAMa,eAAe,IAAIC;IAEzB,MAAMC,uBAAuBf,cAAc,IAAI,CAAC,GAAG,CAAC,OAAMS;QACtD,MAAMO,iBAAiB,IAAIC,gCAAgC;YAAE,cAAcR,GAAG,IAAI;QAAC;QACnF,MAAMS,wBAAwB,MAAML,aAAa,IAAI,CAACG;QAEtD,MAAMG,kBAAkB,IAAIC,0BAA0B;YAClD,cAAcX,GAAG,IAAI;YACrB,SAASY,GAAG,YAAY,CAAC,YAAY,OAAO,GAAG;QACnD;QAEA,MAAMR,aAAa,IAAI,CAACM;QAExB,IAAIG,cAAcJ,sBAAsB,WAAW,IAAI;QACvD,IAAI,CAACI,YAAY,QAAQ,CAAC9B,iCACtB8B,eAAe9B;QAGnB,MAAM+B,UAAUtB,mBAAmBR;QAEnC,MAAM+B,QAAO,IACTX,aAAa,IAAI,CACb,IAAIY,mCAAmC;gBACnC,cAAchB,GAAG,IAAI;gBACrBc;gBACAD;gBACA,aAAa;oBACT,WAAW;wBACP,GAAGJ,sBAAsB,WAAW,EAAE,SAAS;wBAC/C,cAAcQ,KAAK,SAAS,CAAC;4BACzB,SAAS;4BACTxB;4BACAH;4BACAF;4BACAC;4BACA,cAAcW,GAAG,IAAI;wBACzB;oBACJ;gBACJ;YACJ;IAGZ;IAEA,OAAOkB,QAAQ,GAAG,CAACZ,sBAAsB,IAAI,CAACa,CAAAA;QAC1CxB,OAAO,IAAI,CAAC,uCAAuCJ,cAAc,IAAI,CAAC,KAAK;QAC3E,OAAO4B;IACX;AACJ"}
1
+ {"version":3,"file":"features/Watch/replaceLambdaFunctions.js","sources":["../../../src/features/Watch/replaceLambdaFunctions.ts"],"sourcesContent":["import fs from \"fs\";\nimport pRetry from \"p-retry\";\nimport {\n GetFunctionConfigurationCommand,\n LambdaClient,\n UpdateFunctionCodeCommand,\n UpdateFunctionConfigurationCommand\n} from \"@webiny/aws-sdk/client-lambda/index.js\";\nimport { type ListAppLambdaFunctionsService } from \"~/abstractions/services/ListAppLambdaFunctionsService.js\";\nimport { type LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { type UiService } from \"@webiny/project/abstractions/index.js\";\nimport { type PulumiExportService } from \"~/abstractions/services/PulumiExportService.js\";\nimport { type WatchedLambdaFunctionsService } from \"~/abstractions/services/WatchedLambdaFunctionsService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\n\nconst WATCH_MODE_NOTE_IN_DESCRIPTION = \" (💡 local development mode, redeploy to remove)\";\nconst DEFAULT_INCREASE_TIMEOUT = 120;\n\nexport interface IReplaceLambdaFunctionsParams {\n app: IAppModel;\n deploymentId: string | undefined;\n iotEndpoint: string;\n iotEndpointTopic: string;\n sessionId: number;\n functionsList: ListAppLambdaFunctionsService.Result;\n increaseTimeout?: number;\n localExecutionHandshakeTimeout?: number;\n dependencies: {\n uiService: UiService.Interface;\n loggerService: LoggerService.Interface;\n pulumiExportService: PulumiExportService.Interface;\n watchedLambdaFunctionsService: WatchedLambdaFunctionsService.Interface;\n };\n}\n\nexport const replaceLambdaFunctions = async ({\n app,\n deploymentId,\n iotEndpoint,\n iotEndpointTopic,\n sessionId,\n functionsList,\n increaseTimeout,\n localExecutionHandshakeTimeout,\n dependencies\n}: IReplaceLambdaFunctionsParams) => {\n const {\n loggerService: logger,\n pulumiExportService: exportStackState,\n watchedLambdaFunctionsService\n } = dependencies;\n\n const stackExport = await exportStackState.execute(app);\n if (!stackExport) {\n logger.info(\"No AWS Lambda functions to replace.\");\n return [];\n }\n\n const functionNamesToUpdate = functionsList.list.map(fn => fn.name);\n const replacedFunctionUrns: string[] = [];\n\n if (stackExport.deployment?.resources) {\n for (const resource of stackExport.deployment.resources) {\n if (resource.type === \"aws:lambda/function:Function\") {\n const functionName = resource.inputs?.name;\n if (functionName && functionNamesToUpdate.includes(functionName)) {\n replacedFunctionUrns.push(resource.urn);\n logger.debug(`Will replace Lambda function: ${functionName} (${resource.urn})`);\n }\n }\n }\n }\n\n if (replacedFunctionUrns.length > 0) {\n watchedLambdaFunctionsService.markDirty(\n { name: app.name, deploymentId },\n replacedFunctionUrns\n );\n logger.info(\n `Marked ${replacedFunctionUrns.length} Lambda function(s) for replacement on next deployment.`\n );\n }\n\n logger.info(\"replacing %s AWS Lambda function(s).\", functionsList.meta.count);\n const lambdaClient = new LambdaClient();\n\n const replacementsPromises = functionsList.list.map(async fn => {\n const getFnConfigCmd = new GetFunctionConfigurationCommand({ FunctionName: fn.name });\n const lambdaFnConfiguration = await lambdaClient.send(getFnConfigCmd);\n\n const updateFnCodeCmd = new UpdateFunctionCodeCommand({\n FunctionName: fn.name,\n ZipFile: fs.readFileSync(import.meta.dirname + \"/handler/handler.zip\")\n });\n\n await lambdaClient.send(updateFnCodeCmd);\n\n let Description = lambdaFnConfiguration.Description || \"\";\n if (!Description.endsWith(WATCH_MODE_NOTE_IN_DESCRIPTION)) {\n Description += WATCH_MODE_NOTE_IN_DESCRIPTION;\n }\n\n const Timeout = increaseTimeout || DEFAULT_INCREASE_TIMEOUT;\n\n await pRetry(() =>\n lambdaClient.send(\n new UpdateFunctionConfigurationCommand({\n FunctionName: fn.name,\n Timeout,\n Description,\n Environment: {\n Variables: {\n ...lambdaFnConfiguration.Environment?.Variables,\n WEBINY_WATCH: JSON.stringify({\n enabled: true,\n localExecutionHandshakeTimeout,\n sessionId,\n iotEndpoint,\n iotEndpointTopic,\n functionName: fn.name\n })\n }\n }\n })\n )\n );\n });\n\n return Promise.all(replacementsPromises).then(res => {\n logger.info(\"%s AWS Lambda function(s) replaced.\", functionsList.meta.count);\n return res;\n });\n};\n"],"names":["WATCH_MODE_NOTE_IN_DESCRIPTION","DEFAULT_INCREASE_TIMEOUT","replaceLambdaFunctions","app","deploymentId","iotEndpoint","iotEndpointTopic","sessionId","functionsList","increaseTimeout","localExecutionHandshakeTimeout","dependencies","logger","exportStackState","watchedLambdaFunctionsService","stackExport","functionNamesToUpdate","fn","replacedFunctionUrns","resource","functionName","lambdaClient","LambdaClient","replacementsPromises","getFnConfigCmd","GetFunctionConfigurationCommand","lambdaFnConfiguration","updateFnCodeCmd","UpdateFunctionCodeCommand","fs","Description","Timeout","pRetry","UpdateFunctionConfigurationCommand","JSON","Promise","res"],"mappings":";;;AAeA,MAAMA,iCAAiC;AACvC,MAAMC,2BAA2B;AAmB1B,MAAMC,yBAAyB,OAAO,EACzCC,GAAG,EACHC,YAAY,EACZC,WAAW,EACXC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,eAAe,EACfC,8BAA8B,EAC9BC,YAAY,EACgB;IAC5B,MAAM,EACF,eAAeC,MAAM,EACrB,qBAAqBC,gBAAgB,EACrCC,6BAA6B,EAChC,GAAGH;IAEJ,MAAMI,cAAc,MAAMF,iBAAiB,OAAO,CAACV;IACnD,IAAI,CAACY,aAAa;QACdH,OAAO,IAAI,CAAC;QACZ,OAAO,EAAE;IACb;IAEA,MAAMI,wBAAwBR,cAAc,IAAI,CAAC,GAAG,CAACS,CAAAA,KAAMA,GAAG,IAAI;IAClE,MAAMC,uBAAiC,EAAE;IAEzC,IAAIH,YAAY,UAAU,EAAE,WACxB;QAAA,KAAK,MAAMI,YAAYJ,YAAY,UAAU,CAAC,SAAS,CACnD,IAAII,AAAkB,mCAAlBA,SAAS,IAAI,EAAqC;YAClD,MAAMC,eAAeD,SAAS,MAAM,EAAE;YACtC,IAAIC,gBAAgBJ,sBAAsB,QAAQ,CAACI,eAAe;gBAC9DF,qBAAqB,IAAI,CAACC,SAAS,GAAG;gBACtCP,OAAO,KAAK,CAAC,CAAC,8BAA8B,EAAEQ,aAAa,EAAE,EAAED,SAAS,GAAG,CAAC,CAAC,CAAC;YAClF;QACJ;IACJ;IAGJ,IAAID,qBAAqB,MAAM,GAAG,GAAG;QACjCJ,8BAA8B,SAAS,CACnC;YAAE,MAAMX,IAAI,IAAI;YAAEC;QAAa,GAC/Bc;QAEJN,OAAO,IAAI,CACP,CAAC,OAAO,EAAEM,qBAAqB,MAAM,CAAC,uDAAuD,CAAC;IAEtG;IAEAN,OAAO,IAAI,CAAC,wCAAwCJ,cAAc,IAAI,CAAC,KAAK;IAC5E,MAAMa,eAAe,IAAIC;IAEzB,MAAMC,uBAAuBf,cAAc,IAAI,CAAC,GAAG,CAAC,OAAMS;QACtD,MAAMO,iBAAiB,IAAIC,gCAAgC;YAAE,cAAcR,GAAG,IAAI;QAAC;QACnF,MAAMS,wBAAwB,MAAML,aAAa,IAAI,CAACG;QAEtD,MAAMG,kBAAkB,IAAIC,0BAA0B;YAClD,cAAcX,GAAG,IAAI;YACrB,SAASY,GAAG,YAAY,CAAC,YAAY,OAAO,GAAG;QACnD;QAEA,MAAMR,aAAa,IAAI,CAACM;QAExB,IAAIG,cAAcJ,sBAAsB,WAAW,IAAI;QACvD,IAAI,CAACI,YAAY,QAAQ,CAAC9B,iCACtB8B,eAAe9B;QAGnB,MAAM+B,UAAUtB,mBAAmBR;QAEnC,MAAM+B,QAAO,IACTX,aAAa,IAAI,CACb,IAAIY,mCAAmC;gBACnC,cAAchB,GAAG,IAAI;gBACrBc;gBACAD;gBACA,aAAa;oBACT,WAAW;wBACP,GAAGJ,sBAAsB,WAAW,EAAE,SAAS;wBAC/C,cAAcQ,KAAK,SAAS,CAAC;4BACzB,SAAS;4BACTxB;4BACAH;4BACAF;4BACAC;4BACA,cAAcW,GAAG,IAAI;wBACzB;oBACJ;gBACJ;YACJ;IAGZ;IAEA,OAAOkB,QAAQ,GAAG,CAACZ,sBAAsB,IAAI,CAACa,CAAAA;QAC1CxB,OAAO,IAAI,CAAC,uCAAuCJ,cAAc,IAAI,CAAC,KAAK;QAC3E,OAAO4B;IACX;AACJ"}
@@ -0,0 +1,7 @@
1
+ import { AdminAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeAdminAfterDeploy implements AdminAfterDeploy.Interface {
3
+ private AdminAfterDeploy;
4
+ constructor(AdminAfterDeploy: AdminAfterDeploy.Interface[]);
5
+ execute(params: AdminAfterDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const adminAfterDeploy: import("@webiny/di").Implementation<typeof CompositeAdminAfterDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { AdminAfterDeploy as index_js_AdminAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeAdminAfterDeploy {
4
+ constructor(AdminAfterDeploy){
5
+ this.AdminAfterDeploy = AdminAfterDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const beforeBuild of this.AdminAfterDeploy)await beforeBuild.execute(params);
9
+ }
10
+ }
11
+ const adminAfterDeploy = createComposite({
12
+ abstraction: index_js_AdminAfterDeploy,
13
+ implementation: CompositeAdminAfterDeploy,
14
+ dependencies: [
15
+ [
16
+ index_js_AdminAfterDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { CompositeAdminAfterDeploy, adminAfterDeploy };
24
+
25
+ //# sourceMappingURL=AdminAfterDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/hooks/AdminAfterDeploy/AdminAfterDeploy.js","sources":["../../../../src/features/hooks/AdminAfterDeploy/AdminAfterDeploy.ts"],"sourcesContent":["import { createComposite } from \"@webiny/di\";\nimport { AdminAfterDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nexport class CompositeAdminAfterDeploy implements AdminAfterDeploy.Interface {\n constructor(private AdminAfterDeploy: AdminAfterDeploy.Interface[]) {}\n\n async execute(params: AdminAfterDeploy.Params) {\n for (const beforeBuild of this.AdminAfterDeploy) {\n await beforeBuild.execute(params);\n }\n }\n}\n\nexport const adminAfterDeploy = createComposite({\n abstraction: AdminAfterDeploy,\n implementation: CompositeAdminAfterDeploy,\n dependencies: [[AdminAfterDeploy, { multiple: true }]]\n});\n"],"names":["CompositeAdminAfterDeploy","AdminAfterDeploy","params","beforeBuild","adminAfterDeploy","createComposite"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,gBAA8C,CAAE;aAAhDA,gBAAgB,GAAhBA;IAAiD;IAErE,MAAM,QAAQC,MAA+B,EAAE;QAC3C,KAAK,MAAMC,eAAe,IAAI,CAAC,gBAAgB,CAC3C,MAAMA,YAAY,OAAO,CAACD;IAElC;AACJ;AAEO,MAAME,mBAAmBC,gBAAgB;IAC5C,aAAaJ;IACb,gBAAgBD;IAChB,cAAc;QAAC;YAACC;YAAkB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAC1D"}
@@ -0,0 +1 @@
1
+ export * from "./AdminAfterDeploy.js";
@@ -0,0 +1 @@
1
+ export * from "./AdminAfterDeploy.js";
@@ -0,0 +1,7 @@
1
+ import { AdminBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeAdminBeforeDeploy implements AdminBeforeDeploy.Interface {
3
+ private AdminBeforeDeploy;
4
+ constructor(AdminBeforeDeploy: AdminBeforeDeploy.Interface[]);
5
+ execute(params: AdminBeforeDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const adminBeforeDeploy: import("@webiny/di").Implementation<typeof CompositeAdminBeforeDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { AdminBeforeDeploy as index_js_AdminBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeAdminBeforeDeploy {
4
+ constructor(AdminBeforeDeploy){
5
+ this.AdminBeforeDeploy = AdminBeforeDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const beforeDeploy of this.AdminBeforeDeploy)await beforeDeploy.execute(params);
9
+ }
10
+ }
11
+ const adminBeforeDeploy = createComposite({
12
+ abstraction: index_js_AdminBeforeDeploy,
13
+ implementation: CompositeAdminBeforeDeploy,
14
+ dependencies: [
15
+ [
16
+ index_js_AdminBeforeDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { CompositeAdminBeforeDeploy, adminBeforeDeploy };
24
+
25
+ //# sourceMappingURL=AdminBeforeDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js","sources":["../../../../src/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.ts"],"sourcesContent":["import { createComposite } from \"@webiny/di\";\nimport { AdminBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nexport class CompositeAdminBeforeDeploy implements AdminBeforeDeploy.Interface {\n constructor(private AdminBeforeDeploy: AdminBeforeDeploy.Interface[]) {}\n\n async execute(params: AdminBeforeDeploy.Params) {\n for (const beforeDeploy of this.AdminBeforeDeploy) {\n await beforeDeploy.execute(params);\n }\n }\n}\n\nexport const adminBeforeDeploy = createComposite({\n abstraction: AdminBeforeDeploy,\n implementation: CompositeAdminBeforeDeploy,\n dependencies: [[AdminBeforeDeploy, { multiple: true }]]\n});\n"],"names":["CompositeAdminBeforeDeploy","AdminBeforeDeploy","params","beforeDeploy","adminBeforeDeploy","createComposite"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,iBAAgD,CAAE;aAAlDA,iBAAiB,GAAjBA;IAAmD;IAEvE,MAAM,QAAQC,MAAgC,EAAE;QAC5C,KAAK,MAAMC,gBAAgB,IAAI,CAAC,iBAAiB,CAC7C,MAAMA,aAAa,OAAO,CAACD;IAEnC;AACJ;AAEO,MAAME,oBAAoBC,gBAAgB;IAC7C,aAAaJ;IACb,gBAAgBD;IAChB,cAAc;QAAC;YAACC;YAAmB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAC3D"}
@@ -0,0 +1 @@
1
+ export * from "./AdminBeforeDeploy.js";
@@ -0,0 +1 @@
1
+ export * from "./AdminBeforeDeploy.js";
@@ -0,0 +1,7 @@
1
+ import { AfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeAfterDeploy implements AfterDeploy.Interface {
3
+ private AfterDeploy;
4
+ constructor(AfterDeploy: AfterDeploy.Interface[]);
5
+ execute(params: AfterDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const afterDeploy: import("@webiny/di").Implementation<typeof CompositeAfterDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { AfterDeploy as index_js_AfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeAfterDeploy {
4
+ constructor(AfterDeploy){
5
+ this.AfterDeploy = AfterDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const afterDeploy of this.AfterDeploy)await afterDeploy.execute(params);
9
+ }
10
+ }
11
+ const AfterDeploy_afterDeploy = createComposite({
12
+ abstraction: index_js_AfterDeploy,
13
+ implementation: CompositeAfterDeploy,
14
+ dependencies: [
15
+ [
16
+ index_js_AfterDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { AfterDeploy_afterDeploy as afterDeploy, CompositeAfterDeploy };
24
+
25
+ //# sourceMappingURL=AfterDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/hooks/AfterDeploy/AfterDeploy.js","sources":["../../../../src/features/hooks/AfterDeploy/AfterDeploy.ts"],"sourcesContent":["import { createComposite } from \"@webiny/di\";\nimport { AfterDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nexport class CompositeAfterDeploy implements AfterDeploy.Interface {\n constructor(private AfterDeploy: AfterDeploy.Interface[]) {}\n\n async execute(params: AfterDeploy.Params) {\n for (const afterDeploy of this.AfterDeploy) {\n await afterDeploy.execute(params);\n }\n }\n}\n\nexport const afterDeploy = createComposite({\n abstraction: AfterDeploy,\n implementation: CompositeAfterDeploy,\n dependencies: [[AfterDeploy, { multiple: true }]]\n});\n"],"names":["CompositeAfterDeploy","AfterDeploy","params","afterDeploy","createComposite"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,WAAoC,CAAE;aAAtCA,WAAW,GAAXA;IAAuC;IAE3D,MAAM,QAAQC,MAA0B,EAAE;QACtC,KAAK,MAAMC,eAAe,IAAI,CAAC,WAAW,CACtC,MAAMA,YAAY,OAAO,CAACD;IAElC;AACJ;AAEO,MAAMC,0BAAcC,gBAAgB;IACvC,aAAaH;IACb,gBAAgBD;IAChB,cAAc;QAAC;YAACC;YAAa;gBAAE,UAAU;YAAK;SAAE;KAAC;AACrD"}
@@ -0,0 +1 @@
1
+ export * from "./AfterDeploy.js";
@@ -0,0 +1 @@
1
+ export * from "./AfterDeploy.js";
@@ -0,0 +1,7 @@
1
+ import { ApiAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeApiAfterDeploy implements ApiAfterDeploy.Interface {
3
+ private apiAfterDeploy;
4
+ constructor(apiAfterDeploy: ApiAfterDeploy.Interface[]);
5
+ execute(params: ApiAfterDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const apiAfterDeploy: import("@webiny/di").Implementation<typeof CompositeApiAfterDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { ApiAfterDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeApiAfterDeploy {
4
+ constructor(apiAfterDeploy){
5
+ this.apiAfterDeploy = apiAfterDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const beforeBuild of this.apiAfterDeploy)await beforeBuild.execute(params);
9
+ }
10
+ }
11
+ const ApiAfterDeploy_apiAfterDeploy = createComposite({
12
+ abstraction: ApiAfterDeploy,
13
+ implementation: CompositeApiAfterDeploy,
14
+ dependencies: [
15
+ [
16
+ ApiAfterDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { ApiAfterDeploy_apiAfterDeploy as apiAfterDeploy, CompositeApiAfterDeploy };
24
+
25
+ //# sourceMappingURL=ApiAfterDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/hooks/ApiAfterDeploy/ApiAfterDeploy.js","sources":["../../../../src/features/hooks/ApiAfterDeploy/ApiAfterDeploy.ts"],"sourcesContent":["import { createComposite } from \"@webiny/di\";\nimport { ApiAfterDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nexport class CompositeApiAfterDeploy implements ApiAfterDeploy.Interface {\n constructor(private apiAfterDeploy: ApiAfterDeploy.Interface[]) {}\n\n async execute(params: ApiAfterDeploy.Params) {\n for (const beforeBuild of this.apiAfterDeploy) {\n await beforeBuild.execute(params);\n }\n }\n}\n\nexport const apiAfterDeploy = createComposite({\n abstraction: ApiAfterDeploy,\n implementation: CompositeApiAfterDeploy,\n dependencies: [[ApiAfterDeploy, { multiple: true }]]\n});\n"],"names":["CompositeApiAfterDeploy","apiAfterDeploy","params","beforeBuild","createComposite","ApiAfterDeploy"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,cAA0C,CAAE;aAA5CA,cAAc,GAAdA;IAA6C;IAEjE,MAAM,QAAQC,MAA6B,EAAE;QACzC,KAAK,MAAMC,eAAe,IAAI,CAAC,cAAc,CACzC,MAAMA,YAAY,OAAO,CAACD;IAElC;AACJ;AAEO,MAAMD,gCAAiBG,gBAAgB;IAC1C,aAAaC;IACb,gBAAgBL;IAChB,cAAc;QAAC;YAACK;YAAgB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACxD"}
@@ -0,0 +1 @@
1
+ export * from "./ApiAfterDeploy.js";
@@ -0,0 +1 @@
1
+ export * from "./ApiAfterDeploy.js";
@@ -0,0 +1,7 @@
1
+ import { ApiBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeApiBeforeDeploy implements ApiBeforeDeploy.Interface {
3
+ private apiBeforeDeploy;
4
+ constructor(apiBeforeDeploy: ApiBeforeDeploy.Interface[]);
5
+ execute(params: ApiBeforeDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const apiBeforeDeploy: import("@webiny/di").Implementation<typeof CompositeApiBeforeDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { ApiBeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeApiBeforeDeploy {
4
+ constructor(apiBeforeDeploy){
5
+ this.apiBeforeDeploy = apiBeforeDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const beforeDeploy of this.apiBeforeDeploy)await beforeDeploy.execute(params);
9
+ }
10
+ }
11
+ const ApiBeforeDeploy_apiBeforeDeploy = createComposite({
12
+ abstraction: ApiBeforeDeploy,
13
+ implementation: CompositeApiBeforeDeploy,
14
+ dependencies: [
15
+ [
16
+ ApiBeforeDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { ApiBeforeDeploy_apiBeforeDeploy as apiBeforeDeploy, CompositeApiBeforeDeploy };
24
+
25
+ //# sourceMappingURL=ApiBeforeDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js","sources":["../../../../src/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.ts"],"sourcesContent":["import { createComposite } from \"@webiny/di\";\nimport { ApiBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\n\nexport class CompositeApiBeforeDeploy implements ApiBeforeDeploy.Interface {\n constructor(private apiBeforeDeploy: ApiBeforeDeploy.Interface[]) {}\n\n async execute(params: ApiBeforeDeploy.Params) {\n for (const beforeDeploy of this.apiBeforeDeploy) {\n await beforeDeploy.execute(params);\n }\n }\n}\n\nexport const apiBeforeDeploy = createComposite({\n abstraction: ApiBeforeDeploy,\n implementation: CompositeApiBeforeDeploy,\n dependencies: [[ApiBeforeDeploy, { multiple: true }]]\n});\n"],"names":["CompositeApiBeforeDeploy","apiBeforeDeploy","params","beforeDeploy","createComposite","ApiBeforeDeploy"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,eAA4C,CAAE;aAA9CA,eAAe,GAAfA;IAA+C;IAEnE,MAAM,QAAQC,MAA8B,EAAE;QAC1C,KAAK,MAAMC,gBAAgB,IAAI,CAAC,eAAe,CAC3C,MAAMA,aAAa,OAAO,CAACD;IAEnC;AACJ;AAEO,MAAMD,kCAAkBG,gBAAgB;IAC3C,aAAaC;IACb,gBAAgBL;IAChB,cAAc;QAAC;YAACK;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACzD"}
@@ -0,0 +1 @@
1
+ export * from "./ApiBeforeDeploy.js";
@@ -0,0 +1 @@
1
+ export * from "./ApiBeforeDeploy.js";
@@ -0,0 +1,7 @@
1
+ import { BeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
2
+ export declare class CompositeBeforeDeploy implements BeforeDeploy.Interface {
3
+ private BeforeDeploy;
4
+ constructor(BeforeDeploy: BeforeDeploy.Interface[]);
5
+ execute(params: BeforeDeploy.Params): Promise<void>;
6
+ }
7
+ export declare const beforeDeploy: import("@webiny/di").Implementation<typeof CompositeBeforeDeploy>;
@@ -0,0 +1,25 @@
1
+ import { createComposite } from "@webiny/di";
2
+ import { BeforeDeploy as index_js_BeforeDeploy } from "@webiny/project-extensions-aws/abstractions/index.js";
3
+ class CompositeBeforeDeploy {
4
+ constructor(BeforeDeploy){
5
+ this.BeforeDeploy = BeforeDeploy;
6
+ }
7
+ async execute(params) {
8
+ for (const beforeDeploy of this.BeforeDeploy)await beforeDeploy.execute(params);
9
+ }
10
+ }
11
+ const BeforeDeploy_beforeDeploy = createComposite({
12
+ abstraction: index_js_BeforeDeploy,
13
+ implementation: CompositeBeforeDeploy,
14
+ dependencies: [
15
+ [
16
+ index_js_BeforeDeploy,
17
+ {
18
+ multiple: true
19
+ }
20
+ ]
21
+ ]
22
+ });
23
+ export { BeforeDeploy_beforeDeploy as beforeDeploy, CompositeBeforeDeploy };
24
+
25
+ //# sourceMappingURL=BeforeDeploy.js.map