@webiny/project-aws 0.0.0-unstable.6844005670 → 0.0.0-unstable.7be00a75a9

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 (479) hide show
  1. package/_templates/appTemplates/admin/src/index.tsx +0 -3
  2. package/_templates/appTemplates/admin/webiny.application.ts +1 -1
  3. package/_templates/appTemplates/api/graphql/package.json +3 -5
  4. package/_templates/appTemplates/api/graphql/src/extensions.ts +1 -1
  5. package/_templates/appTemplates/api/graphql/src/index.ts +9 -8
  6. package/_templates/appTemplates/api/webiny.application.ts +1 -1
  7. package/_templates/appTemplates/blueGreen/webiny.application.ts +1 -1
  8. package/_templates/appTemplates/core/webiny.application.ts +1 -1
  9. package/_templates/appTemplates/syncSystem/webiny.application.ts +1 -1
  10. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +22 -17
  11. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +14 -7
  12. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/webiny.config.ts +2 -2
  13. package/abstractions/ApiGqlClient.js +2 -1
  14. package/abstractions/ApiGqlClient.js.map +1 -1
  15. package/abstractions/InvokeLambdaFunction.js +2 -1
  16. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  17. package/abstractions/features/pulumi/AdminPulumi.d.ts +9 -0
  18. package/abstractions/features/pulumi/AdminPulumi.js +5 -0
  19. package/abstractions/features/pulumi/AdminPulumi.js.map +1 -0
  20. package/abstractions/features/pulumi/ApiPulumi.d.ts +9 -0
  21. package/abstractions/features/pulumi/ApiPulumi.js +5 -0
  22. package/abstractions/features/pulumi/ApiPulumi.js.map +1 -0
  23. package/abstractions/features/pulumi/CorePulumi.d.ts +9 -0
  24. package/abstractions/features/pulumi/CorePulumi.js +5 -0
  25. package/abstractions/features/pulumi/CorePulumi.js.map +1 -0
  26. package/abstractions/features/pulumi/index.d.ts +3 -0
  27. package/abstractions/features/pulumi/index.js +3 -0
  28. package/abstractions/index.d.ts +1 -0
  29. package/abstractions/index.js +1 -2
  30. package/abstractions/services/AdminStackOutputService.js +2 -1
  31. package/abstractions/services/AdminStackOutputService.js.map +1 -1
  32. package/abstractions/services/ApiStackOutputService.d.ts +0 -1
  33. package/abstractions/services/ApiStackOutputService.js +2 -1
  34. package/abstractions/services/ApiStackOutputService.js.map +1 -1
  35. package/abstractions/services/CoreStackOutputService.js +2 -1
  36. package/abstractions/services/CoreStackOutputService.js.map +1 -1
  37. package/admin.d.ts +6 -18
  38. package/admin.js +5 -4
  39. package/admin.js.map +1 -1
  40. package/api.d.ts +36 -18
  41. package/api.js +14 -3
  42. package/api.js.map +1 -1
  43. package/apps/createAdminApp.js +11 -12
  44. package/apps/createAdminApp.js.map +1 -1
  45. package/apps/createAdminAppConfig.js +12 -18
  46. package/apps/createAdminAppConfig.js.map +1 -1
  47. package/apps/createApiApp.d.ts +0 -3
  48. package/apps/createApiApp.js +17 -22
  49. package/apps/createApiApp.js.map +1 -1
  50. package/apps/createBlueGreenApp.js +13 -16
  51. package/apps/createBlueGreenApp.js.map +1 -1
  52. package/apps/createCoreApp.d.ts +0 -1
  53. package/apps/createCoreApp.js +12 -13
  54. package/apps/createCoreApp.js.map +1 -1
  55. package/apps/createReactAppConfig.d.ts +0 -7
  56. package/apps/createReactAppConfig.js +56 -69
  57. package/apps/createReactAppConfig.js.map +1 -1
  58. package/apps/createSyncSystemApp.js +8 -7
  59. package/apps/createSyncSystemApp.js.map +1 -1
  60. package/apps/index.js +0 -2
  61. package/cli.d.ts +2 -6
  62. package/cli.js +3 -2
  63. package/cli.js.map +1 -1
  64. package/exports/extensions.js +0 -2
  65. package/exports/infra/admin.d.ts +1 -0
  66. package/exports/infra/admin.js +1 -2
  67. package/exports/infra/api.d.ts +1 -0
  68. package/exports/infra/api.js +1 -2
  69. package/exports/infra/core.d.ts +1 -0
  70. package/exports/infra/core.js +1 -2
  71. package/exports/{infra/index.d.ts → infra.d.ts} +1 -1
  72. package/exports/infra.js +1 -0
  73. package/extensions/ApiLambdaFunction.d.ts +4 -10
  74. package/extensions/ApiLambdaFunction.js +45 -56
  75. package/extensions/ApiLambdaFunction.js.map +1 -1
  76. package/extensions/ApiRoute.d.ts +16 -0
  77. package/extensions/ApiRoute.js +106 -0
  78. package/extensions/ApiRoute.js.map +1 -0
  79. package/extensions/AwsDefaultRegion.d.ts +1 -5
  80. package/extensions/AwsDefaultRegion.js +17 -16
  81. package/extensions/AwsDefaultRegion.js.map +1 -1
  82. package/extensions/Cms/ModelFieldCompression.d.ts +4 -0
  83. package/extensions/Cms/ModelFieldCompression.js +24 -0
  84. package/extensions/Cms/ModelFieldCompression.js.map +1 -0
  85. package/extensions/Encryption.d.ts +10 -0
  86. package/extensions/Encryption.js +36 -0
  87. package/extensions/Encryption.js.map +1 -0
  88. package/extensions/Mailer/Smtp.d.ts +8 -0
  89. package/extensions/Mailer/Smtp.js +21 -0
  90. package/extensions/Mailer/Smtp.js.map +1 -0
  91. package/extensions/Mailer/Smtp.test.d.ts +1 -0
  92. package/extensions/Mailer/Smtp.test.js +127 -0
  93. package/extensions/Mailer/Smtp.test.js.map +1 -0
  94. package/extensions/Mailer/SmtpParamsSchema.d.ts +9 -0
  95. package/extensions/Mailer/SmtpParamsSchema.js +17 -0
  96. package/extensions/Mailer/SmtpParamsSchema.js.map +1 -0
  97. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +1 -1
  98. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +25 -30
  99. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
  100. package/extensions/OpenSearch/EnsureOsWasDeployed.js +14 -24
  101. package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
  102. package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js +25 -21
  103. package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js.map +1 -1
  104. package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js +26 -22
  105. package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js.map +1 -1
  106. package/extensions/OpenSearch.d.ts +4 -11
  107. package/extensions/OpenSearch.js +30 -28
  108. package/extensions/OpenSearch.js.map +1 -1
  109. package/extensions/ProjectAws/AdminStackOutputService.js +0 -2
  110. package/extensions/ProjectAws/ApiStackOutputService.js +0 -2
  111. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
  112. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +65 -70
  113. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  114. package/extensions/ProjectAws/AutoInstall.d.ts +3 -27
  115. package/extensions/ProjectAws/AutoInstall.js +15 -14
  116. package/extensions/ProjectAws/AutoInstall.js.map +1 -1
  117. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +1 -1
  118. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +15 -19
  119. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
  120. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +1 -1
  121. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +56 -45
  122. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
  123. package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js +57 -55
  124. package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js.map +1 -1
  125. package/extensions/ProjectAws/BuildAppWorkspace.js +49 -54
  126. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  127. package/extensions/ProjectAws/CoreStackOutputService.js +0 -2
  128. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.d.ts +10 -0
  129. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +36 -0
  130. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -0
  131. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +25 -38
  132. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  133. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +22 -17
  134. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
  135. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +22 -17
  136. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
  137. package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +5 -3
  138. package/extensions/ProjectAws/SetDatabaseSetupOutput.js +22 -22
  139. package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
  140. package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +1 -1
  141. package/extensions/ProjectAws/UploadAdminAppToS3.js +53 -58
  142. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  143. package/extensions/ProjectAws/definitions.js +13 -6
  144. package/extensions/ProjectAws/definitions.js.map +1 -1
  145. package/extensions/ProjectAws.js +45 -45
  146. package/extensions/ProjectAws.js.map +1 -1
  147. package/extensions/RegisterRoutesPulumi.d.ts +12 -0
  148. package/extensions/RegisterRoutesPulumi.js +37 -0
  149. package/extensions/RegisterRoutesPulumi.js.map +1 -0
  150. package/extensions/definitions.js +12 -2
  151. package/extensions/definitions.js.map +1 -1
  152. package/extensions/index.d.ts +3 -0
  153. package/extensions/index.js +3 -2
  154. package/features/ApiGqlClient.js +46 -51
  155. package/features/ApiGqlClient.js.map +1 -1
  156. package/features/InvokeLambdaFunction.js +30 -32
  157. package/features/InvokeLambdaFunction.js.map +1 -1
  158. package/features/index.js +0 -2
  159. package/index.js +0 -2
  160. package/infra.d.ts +110 -348
  161. package/infra.js +59 -48
  162. package/infra.js.map +1 -1
  163. package/package.json +31 -30
  164. package/project.d.ts +22 -116
  165. package/project.js +7 -6
  166. package/project.js.map +1 -1
  167. package/pulumi/apps/admin/createAdminPulumiApp.js +38 -44
  168. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  169. package/pulumi/apps/admin/index.js +0 -2
  170. package/pulumi/apps/api/ApiBackgroundTask.js +153 -137
  171. package/pulumi/apps/api/ApiBackgroundTask.js.map +1 -1
  172. package/pulumi/apps/api/ApiCloudfront.js +188 -130
  173. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  174. package/pulumi/apps/api/ApiFileManager.js +34 -33
  175. package/pulumi/apps/api/ApiFileManager.js.map +1 -1
  176. package/pulumi/apps/api/ApiGateway.js +67 -71
  177. package/pulumi/apps/api/ApiGateway.js.map +1 -1
  178. package/pulumi/apps/api/ApiGraphql.js +223 -152
  179. package/pulumi/apps/api/ApiGraphql.js.map +1 -1
  180. package/pulumi/apps/api/ApiOutput.d.ts +0 -1
  181. package/pulumi/apps/api/ApiOutput.js +29 -31
  182. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  183. package/pulumi/apps/api/ApiScheduler.js +94 -92
  184. package/pulumi/apps/api/ApiScheduler.js.map +1 -1
  185. package/pulumi/apps/api/ApiWebsocket.js +141 -133
  186. package/pulumi/apps/api/ApiWebsocket.js.map +1 -1
  187. package/pulumi/apps/api/backgroundTask/definition.js +122 -144
  188. package/pulumi/apps/api/backgroundTask/definition.js.map +1 -1
  189. package/pulumi/apps/api/backgroundTask/policy.js +37 -23
  190. package/pulumi/apps/api/backgroundTask/policy.js.map +1 -1
  191. package/pulumi/apps/api/backgroundTask/role.js +29 -29
  192. package/pulumi/apps/api/backgroundTask/role.js.map +1 -1
  193. package/pulumi/apps/api/backgroundTask/types.js +9 -11
  194. package/pulumi/apps/api/backgroundTask/types.js.map +1 -1
  195. package/pulumi/apps/api/createApiPulumiApp.d.ts +0 -3
  196. package/pulumi/apps/api/createApiPulumiApp.js +210 -261
  197. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  198. package/pulumi/apps/api/handleGuardDutyEvents.js +54 -51
  199. package/pulumi/apps/api/handleGuardDutyEvents.js.map +1 -1
  200. package/pulumi/apps/api/index.d.ts +0 -1
  201. package/pulumi/apps/api/index.js +0 -3
  202. package/pulumi/apps/awsUtils.js +21 -24
  203. package/pulumi/apps/awsUtils.js.map +1 -1
  204. package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js +37 -40
  205. package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js.map +1 -1
  206. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js +83 -91
  207. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js.map +1 -1
  208. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js +17 -16
  209. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js.map +1 -1
  210. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js +13 -12
  211. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js.map +1 -1
  212. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js +9 -14
  213. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js.map +1 -1
  214. package/pulumi/apps/blueGreen/cloudfront/createOriginId.js +5 -7
  215. package/pulumi/apps/blueGreen/cloudfront/createOriginId.js.map +1 -1
  216. package/pulumi/apps/blueGreen/constants.js +15 -3
  217. package/pulumi/apps/blueGreen/constants.js.map +1 -1
  218. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +77 -103
  219. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  220. package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js +20 -26
  221. package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js.map +1 -1
  222. package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js +17 -20
  223. package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js.map +1 -1
  224. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +51 -61
  225. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  226. package/pulumi/apps/blueGreen/domains/resolveDomains.js +24 -38
  227. package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
  228. package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js +7 -14
  229. package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js.map +1 -1
  230. package/pulumi/apps/blueGreen/functions/handler.js +1 -56
  231. package/pulumi/apps/blueGreen/functions/handler.js.map +1 -1
  232. package/pulumi/apps/blueGreen/types.js +0 -3
  233. package/pulumi/apps/blueGreen/validation/validateDeployments.js +19 -24
  234. package/pulumi/apps/blueGreen/validation/validateDeployments.js.map +1 -1
  235. package/pulumi/apps/common/CoreOutput.d.ts +0 -4
  236. package/pulumi/apps/common/CoreOutput.js +34 -41
  237. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  238. package/pulumi/apps/common/VpcConfig.js +20 -20
  239. package/pulumi/apps/common/VpcConfig.js.map +1 -1
  240. package/pulumi/apps/common/index.js +0 -2
  241. package/pulumi/apps/core/CoreAuditLogsDynamo.js +245 -182
  242. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  243. package/pulumi/apps/core/CoreCognito.js +117 -106
  244. package/pulumi/apps/core/CoreCognito.js.map +1 -1
  245. package/pulumi/apps/core/CoreDynamo.js +91 -70
  246. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  247. package/pulumi/apps/core/CoreEventBus.js +10 -9
  248. package/pulumi/apps/core/CoreEventBus.js.map +1 -1
  249. package/pulumi/apps/core/CoreFileManager.js +76 -68
  250. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  251. package/pulumi/apps/core/CoreOpenSearch.d.ts +2 -0
  252. package/pulumi/apps/core/CoreOpenSearch.js +281 -278
  253. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  254. package/pulumi/apps/core/CoreVpc.js +155 -156
  255. package/pulumi/apps/core/CoreVpc.js.map +1 -1
  256. package/pulumi/apps/core/WatchCommand.js +94 -96
  257. package/pulumi/apps/core/WatchCommand.js.map +1 -1
  258. package/pulumi/apps/core/cognitoIdentityProviders/amazon.js +16 -22
  259. package/pulumi/apps/core/cognitoIdentityProviders/amazon.js.map +1 -1
  260. package/pulumi/apps/core/cognitoIdentityProviders/apple.js +16 -17
  261. package/pulumi/apps/core/cognitoIdentityProviders/apple.js.map +1 -1
  262. package/pulumi/apps/core/cognitoIdentityProviders/configure.js +44 -50
  263. package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
  264. package/pulumi/apps/core/cognitoIdentityProviders/facebook.js +16 -17
  265. package/pulumi/apps/core/cognitoIdentityProviders/facebook.js.map +1 -1
  266. package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js +7 -8
  267. package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js.map +1 -1
  268. package/pulumi/apps/core/cognitoIdentityProviders/google.js +16 -17
  269. package/pulumi/apps/core/cognitoIdentityProviders/google.js.map +1 -1
  270. package/pulumi/apps/core/cognitoIdentityProviders/index.js +0 -2
  271. package/pulumi/apps/core/cognitoIdentityProviders/oidc.js +17 -18
  272. package/pulumi/apps/core/cognitoIdentityProviders/oidc.js.map +1 -1
  273. package/pulumi/apps/core/configureS3BucketMalwareProtection.js +251 -188
  274. package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
  275. package/pulumi/apps/core/createCorePulumiApp.d.ts +0 -1
  276. package/pulumi/apps/core/createCorePulumiApp.js +214 -268
  277. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  278. package/pulumi/apps/core/index.js +0 -2
  279. package/pulumi/apps/core/webinyWatchCommand/handler.js +45 -32
  280. package/pulumi/apps/core/webinyWatchCommand/handler.js.map +1 -1
  281. package/pulumi/apps/createAppBucket.js +157 -146
  282. package/pulumi/apps/createAppBucket.js.map +1 -1
  283. package/pulumi/apps/customDomain.js +7 -6
  284. package/pulumi/apps/customDomain.js.map +1 -1
  285. package/pulumi/apps/extensions/getAwsTagsFromExtension.js +8 -7
  286. package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
  287. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +4 -6
  288. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +6 -7
  289. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
  290. package/pulumi/apps/extensions/getOsConfigFromExtension.d.ts +3 -0
  291. package/pulumi/apps/extensions/getOsConfigFromExtension.js +17 -29
  292. package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
  293. package/pulumi/apps/extensions/getVpcConfigFromExtension.js +13 -25
  294. package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
  295. package/pulumi/apps/index.js +0 -3
  296. package/pulumi/apps/lambdaUtils.js +57 -61
  297. package/pulumi/apps/lambdaUtils.js.map +1 -1
  298. package/pulumi/apps/react/createReactPulumiApp.js +108 -129
  299. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  300. package/pulumi/apps/react/index.js +0 -2
  301. package/pulumi/apps/syncSystem/SyncSystemDynamo.js +77 -52
  302. package/pulumi/apps/syncSystem/SyncSystemDynamo.js.map +1 -1
  303. package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js +74 -47
  304. package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js.map +1 -1
  305. package/pulumi/apps/syncSystem/SyncSystemEventBus.js +77 -71
  306. package/pulumi/apps/syncSystem/SyncSystemEventBus.js.map +1 -1
  307. package/pulumi/apps/syncSystem/SyncSystemLambda.js +154 -87
  308. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  309. package/pulumi/apps/syncSystem/SyncSystemOutput.js +14 -13
  310. package/pulumi/apps/syncSystem/SyncSystemOutput.js.map +1 -1
  311. package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js +56 -60
  312. package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js.map +1 -1
  313. package/pulumi/apps/syncSystem/SyncSystemSQS.js +25 -49
  314. package/pulumi/apps/syncSystem/SyncSystemSQS.js.map +1 -1
  315. package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js +44 -43
  316. package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js.map +1 -1
  317. package/pulumi/apps/syncSystem/addTableItems.js +35 -45
  318. package/pulumi/apps/syncSystem/addTableItems.js.map +1 -1
  319. package/pulumi/apps/syncSystem/api/addServiceManifest.js +12 -14
  320. package/pulumi/apps/syncSystem/api/addServiceManifest.js.map +1 -1
  321. package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js +49 -55
  322. package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js.map +1 -1
  323. package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js +88 -40
  324. package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js.map +1 -1
  325. package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js +37 -43
  326. package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js.map +1 -1
  327. package/pulumi/apps/syncSystem/api/attachS3Permissions.js +51 -47
  328. package/pulumi/apps/syncSystem/api/attachS3Permissions.js.map +1 -1
  329. package/pulumi/apps/syncSystem/api/index.js +28 -46
  330. package/pulumi/apps/syncSystem/api/index.js.map +1 -1
  331. package/pulumi/apps/syncSystem/constants.js +2 -1
  332. package/pulumi/apps/syncSystem/constants.js.map +1 -1
  333. package/pulumi/apps/syncSystem/createSyncResourceName.js +2 -7
  334. package/pulumi/apps/syncSystem/createSyncResourceName.js.map +1 -1
  335. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +101 -166
  336. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  337. package/pulumi/apps/syncSystem/customApp.js +12 -16
  338. package/pulumi/apps/syncSystem/customApp.js.map +1 -1
  339. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +5 -6
  340. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  341. package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +108 -42
  342. package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js.map +1 -1
  343. package/pulumi/apps/syncSystem/types.js +0 -3
  344. package/pulumi/constants.js +2 -1
  345. package/pulumi/constants.js.map +1 -1
  346. package/pulumi/env/awsRegion.js +3 -2
  347. package/pulumi/env/awsRegion.js.map +1 -1
  348. package/pulumi/env/base.js +11 -27
  349. package/pulumi/env/base.js.map +1 -1
  350. package/pulumi/env/env.js +3 -2
  351. package/pulumi/env/env.js.map +1 -1
  352. package/pulumi/env/projectName.js +3 -2
  353. package/pulumi/env/projectName.js.map +1 -1
  354. package/pulumi/env/variant.js +4 -3
  355. package/pulumi/env/variant.js.map +1 -1
  356. package/pulumi/extensions/AdminCustomDomains.d.ts +7 -12
  357. package/pulumi/extensions/AdminCustomDomains.js +15 -11
  358. package/pulumi/extensions/AdminCustomDomains.js.map +1 -1
  359. package/pulumi/extensions/AdminPulumi.d.ts +4 -0
  360. package/pulumi/extensions/AdminPulumi.js +22 -0
  361. package/pulumi/extensions/AdminPulumi.js.map +1 -0
  362. package/pulumi/extensions/ApiCustomDomains.d.ts +9 -0
  363. package/pulumi/extensions/ApiCustomDomains.js +20 -0
  364. package/pulumi/extensions/ApiCustomDomains.js.map +1 -0
  365. package/pulumi/extensions/ApiPulumi.d.ts +4 -0
  366. package/pulumi/extensions/ApiPulumi.js +22 -0
  367. package/pulumi/extensions/ApiPulumi.js.map +1 -0
  368. package/pulumi/extensions/AwsTags.d.ts +2 -6
  369. package/pulumi/extensions/AwsTags.js +11 -10
  370. package/pulumi/extensions/AwsTags.js.map +1 -1
  371. package/pulumi/extensions/BlueGreenDeployments.d.ts +15 -115
  372. package/pulumi/extensions/BlueGreenDeployments.js +29 -25
  373. package/pulumi/extensions/BlueGreenDeployments.js.map +1 -1
  374. package/pulumi/extensions/CorePulumi.d.ts +4 -0
  375. package/pulumi/extensions/CorePulumi.js +22 -0
  376. package/pulumi/extensions/CorePulumi.js.map +1 -0
  377. package/pulumi/extensions/OpenSearch.d.ts +5 -12
  378. package/pulumi/extensions/OpenSearch.js +16 -12
  379. package/pulumi/extensions/OpenSearch.js.map +1 -1
  380. package/pulumi/extensions/Vpc.d.ts +9 -65
  381. package/pulumi/extensions/Vpc.js +21 -20
  382. package/pulumi/extensions/Vpc.js.map +1 -1
  383. package/pulumi/extensions/index.d.ts +40 -187
  384. package/pulumi/extensions/index.js +16 -6
  385. package/pulumi/extensions/index.js.map +1 -1
  386. package/pulumi/features/AdminPulumi/AdminPulumi.d.ts +7 -0
  387. package/pulumi/features/AdminPulumi/AdminPulumi.js +25 -0
  388. package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -0
  389. package/pulumi/features/AdminPulumi/index.d.ts +1 -0
  390. package/pulumi/features/AdminPulumi/index.js +1 -0
  391. package/pulumi/features/ApiPulumi/ApiPulumi.d.ts +7 -0
  392. package/pulumi/features/ApiPulumi/ApiPulumi.js +25 -0
  393. package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -0
  394. package/pulumi/features/ApiPulumi/index.d.ts +1 -0
  395. package/pulumi/features/ApiPulumi/index.js +1 -0
  396. package/pulumi/features/CorePulumi/CorePulumi.d.ts +7 -0
  397. package/pulumi/features/CorePulumi/CorePulumi.js +25 -0
  398. package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -0
  399. package/pulumi/features/CorePulumi/index.d.ts +1 -0
  400. package/pulumi/features/CorePulumi/index.js +1 -0
  401. package/pulumi/features/index.d.ts +3 -0
  402. package/pulumi/features/index.js +3 -0
  403. package/pulumi/index.js +0 -2
  404. package/pulumi/types.d.ts +0 -5
  405. package/pulumi/types.js +0 -3
  406. package/pulumi/utils/addDomainsUrlsOutputs.js +20 -37
  407. package/pulumi/utils/addDomainsUrlsOutputs.js.map +1 -1
  408. package/pulumi/utils/addServiceManifestTableItem.js +12 -15
  409. package/pulumi/utils/addServiceManifestTableItem.js.map +1 -1
  410. package/pulumi/utils/crawlDirectory.js +10 -15
  411. package/pulumi/utils/crawlDirectory.js.map +1 -1
  412. package/pulumi/utils/createAssetArchive.js +5 -6
  413. package/pulumi/utils/createAssetArchive.js.map +1 -1
  414. package/pulumi/utils/dynamodb.js +26 -27
  415. package/pulumi/utils/dynamodb.js.map +1 -1
  416. package/pulumi/utils/getPresignedPost.d.ts +1 -1
  417. package/pulumi/utils/getPresignedPost.js +27 -30
  418. package/pulumi/utils/getPresignedPost.js.map +1 -1
  419. package/pulumi/utils/index.js +1 -3
  420. package/pulumi/utils/lambdaEnvVariables.js +42 -54
  421. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  422. package/pulumi/utils/tagResources.js +248 -28
  423. package/pulumi/utils/tagResources.js.map +1 -1
  424. package/pulumi/utils/uploadFolderToS3.js +101 -131
  425. package/pulumi/utils/uploadFolderToS3.js.map +1 -1
  426. package/pulumi/utils/withServiceManifest.js +28 -37
  427. package/pulumi/utils/withServiceManifest.js.map +1 -1
  428. package/services/AdminStackOutputService.d.ts +1 -1
  429. package/services/AdminStackOutputService.js +14 -11
  430. package/services/AdminStackOutputService.js.map +1 -1
  431. package/services/ApiStackOutputService.d.ts +1 -1
  432. package/services/ApiStackOutputService.js +14 -11
  433. package/services/ApiStackOutputService.js.map +1 -1
  434. package/services/CoreStackOutputService.d.ts +1 -1
  435. package/services/CoreStackOutputService.js +14 -11
  436. package/services/CoreStackOutputService.js.map +1 -1
  437. package/utils/getTemplatesFolderPath.js +9 -11
  438. package/utils/getTemplatesFolderPath.js.map +1 -1
  439. package/utils/index.js +0 -2
  440. package/_templates/appTemplates/api/migration/src/index.ts +0 -23
  441. package/_templates/appTemplates/api/migration/tsconfig.json +0 -6
  442. package/_templates/appTemplates/api/migration/webiny.config.ts +0 -8
  443. package/_templates/extensions/OpenSearch/api/migration/src/index.ts +0 -33
  444. package/abstractions/index.js.map +0 -1
  445. package/apps/index.js.map +0 -1
  446. package/exports/extensions.js.map +0 -1
  447. package/exports/infra/admin.js.map +0 -1
  448. package/exports/infra/api.js.map +0 -1
  449. package/exports/infra/core.js.map +0 -1
  450. package/exports/infra/index.js +0 -3
  451. package/exports/infra/index.js.map +0 -1
  452. package/extensions/ProjectAws/AdminStackOutputService.js.map +0 -1
  453. package/extensions/ProjectAws/ApiStackOutputService.js.map +0 -1
  454. package/extensions/ProjectAws/CoreStackOutputService.js.map +0 -1
  455. package/extensions/ProjectAws/ExecuteDataMigrations.d.ts +0 -16
  456. package/extensions/ProjectAws/ExecuteDataMigrations.js +0 -69
  457. package/extensions/ProjectAws/ExecuteDataMigrations.js.map +0 -1
  458. package/extensions/index.js.map +0 -1
  459. package/features/index.js.map +0 -1
  460. package/index.js.map +0 -1
  461. package/pulumi/apps/admin/index.js.map +0 -1
  462. package/pulumi/apps/api/ApiMigration.d.ts +0 -5
  463. package/pulumi/apps/api/ApiMigration.js +0 -83
  464. package/pulumi/apps/api/ApiMigration.js.map +0 -1
  465. package/pulumi/apps/api/index.js.map +0 -1
  466. package/pulumi/apps/blueGreen/types.js.map +0 -1
  467. package/pulumi/apps/common/index.js.map +0 -1
  468. package/pulumi/apps/core/LogDynamo.d.ts +0 -5
  469. package/pulumi/apps/core/LogDynamo.js +0 -122
  470. package/pulumi/apps/core/LogDynamo.js.map +0 -1
  471. package/pulumi/apps/core/cognitoIdentityProviders/index.js.map +0 -1
  472. package/pulumi/apps/core/index.js.map +0 -1
  473. package/pulumi/apps/index.js.map +0 -1
  474. package/pulumi/apps/react/index.js.map +0 -1
  475. package/pulumi/apps/syncSystem/types.js.map +0 -1
  476. package/pulumi/index.js.map +0 -1
  477. package/pulumi/types.js.map +0 -1
  478. package/pulumi/utils/index.js.map +0 -1
  479. package/utils/index.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import path from "path";
3
3
  import fs from "fs";
4
4
  import { z } from "zod";
@@ -6,63 +6,52 @@ import { replaceInPath } from "replace-in-path";
6
6
  import { defineExtension } from "@webiny/project/defineExtension/index.js";
7
7
  import { zodSrcPath } from "@webiny/project/defineExtension/zodTypes/zodSrcPath.js";
8
8
  import { ExtensionSrcResolver } from "@webiny/project/utils/index.js";
9
- import { ApiPulumi as ApiPulumiAbstraction } from "@webiny/project/abstractions/features/pulumi/index.js";
10
- import { ApiPulumi } from "@webiny/project/extensions/index.js";
9
+ import { ApiPulumi } from "../abstractions/features/pulumi/index.js";
10
+ import { ApiPulumi as ApiPulumi_js_ApiPulumi } from "../pulumi/extensions/ApiPulumi.js";
11
11
  import { getTemplatesFolderPath } from "../utils/index.js";
12
- export const ApiLambdaFunction = defineExtension({
13
- type: "Api/LambdaFunction",
14
- tags: {
15
- runtimeContext: "app-build",
16
- appName: "api"
17
- },
18
- description: "Add a custom Lambda function to the API app.",
19
- multiple: true,
20
- paramsSchema: ({
21
- project
22
- }) => {
23
- return z.object({
24
- functionSrc: zodSrcPath({
25
- project
26
- }),
27
- pulumiSrc: zodSrcPath({
28
- project,
29
- abstraction: ApiPulumiAbstraction
30
- })
31
- });
32
- },
33
- async build(params, ctx) {
34
- const absoluteFunctionSrc = ExtensionSrcResolver.resolvePath(params.functionSrc, ctx.project);
35
-
36
- // Derive function name from the handler file name (without extension).
37
- const functionName = path.parse(absoluteFunctionSrc).name;
38
- const fnWorkspacePath = ctx.project.paths.workspaceFolder.join("apps", "api", functionName).toString();
39
-
40
- // 1. Scaffold from template if the folder doesn't exist yet.
41
- if (!fs.existsSync(fnWorkspacePath)) {
42
- const templatePath = path.join(getTemplatesFolderPath(), "extensions", "ApiLambdaFunction");
43
- fs.cpSync(templatePath, fnWorkspacePath, {
44
- recursive: true
45
- });
46
-
47
- // Replace the {{functionName}} placeholder in package.json.
48
- replaceInPath(path.join(fnWorkspacePath, "package.json"), {
49
- find: "{{functionName}}",
50
- replaceWith: functionName
51
- });
12
+ const ApiLambdaFunction = defineExtension({
13
+ type: "Api/LambdaFunction",
14
+ tags: {
15
+ runtimeContext: "app-build",
16
+ appName: "api"
17
+ },
18
+ description: "Add a custom Lambda function to the API app.",
19
+ multiple: true,
20
+ paramsSchema: ({ project })=>z.object({
21
+ functionSrc: zodSrcPath({
22
+ project
23
+ }),
24
+ pulumiSrc: zodSrcPath({
25
+ project,
26
+ abstraction: ApiPulumi
27
+ })
28
+ }),
29
+ async build (params, ctx) {
30
+ const absoluteFunctionSrc = ExtensionSrcResolver.resolvePath(params.functionSrc, ctx.project);
31
+ const functionName = path.parse(absoluteFunctionSrc).name;
32
+ const fnWorkspacePath = ctx.project.paths.workspaceFolder.join("apps", "api", functionName).toString();
33
+ if (!fs.existsSync(fnWorkspacePath)) {
34
+ const templatePath = path.join(getTemplatesFolderPath(), "extensions", "ApiLambdaFunction");
35
+ fs.cpSync(templatePath, fnWorkspacePath, {
36
+ recursive: true
37
+ });
38
+ replaceInPath(path.join(fnWorkspacePath, "package.json"), {
39
+ find: "{{functionName}}",
40
+ replaceWith: functionName
41
+ });
42
+ }
43
+ const srcDir = path.join(fnWorkspacePath, "src");
44
+ fs.mkdirSync(srcDir, {
45
+ recursive: true
46
+ });
47
+ fs.copyFileSync(absoluteFunctionSrc, path.join(srcDir, "index.ts"));
48
+ },
49
+ render (props) {
50
+ return /*#__PURE__*/ react.createElement(ApiPulumi_js_ApiPulumi, {
51
+ src: props.pulumiSrc
52
+ });
52
53
  }
53
-
54
- // 2. Copy user's handler file → <functionName>/src/index.ts.
55
- const srcDir = path.join(fnWorkspacePath, "src");
56
- fs.mkdirSync(srcDir, {
57
- recursive: true
58
- });
59
- fs.copyFileSync(absoluteFunctionSrc, path.join(srcDir, "index.ts"));
60
- },
61
- render(props) {
62
- return /*#__PURE__*/React.createElement(ApiPulumi, {
63
- src: props.pulumiSrc
64
- });
65
- }
66
54
  });
55
+ export { ApiLambdaFunction };
67
56
 
68
57
  //# sourceMappingURL=ApiLambdaFunction.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","path","fs","z","replaceInPath","defineExtension","zodSrcPath","ExtensionSrcResolver","ApiPulumi","ApiPulumiAbstraction","getTemplatesFolderPath","ApiLambdaFunction","type","tags","runtimeContext","appName","description","multiple","paramsSchema","project","object","functionSrc","pulumiSrc","abstraction","build","params","ctx","absoluteFunctionSrc","resolvePath","functionName","parse","name","fnWorkspacePath","paths","workspaceFolder","join","toString","existsSync","templatePath","cpSync","recursive","find","replaceWith","srcDir","mkdirSync","copyFileSync","render","props","createElement","src"],"sources":["ApiLambdaFunction.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { z } from \"zod\";\nimport { replaceInPath } from \"replace-in-path\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi as ApiPulumiAbstraction } from \"@webiny/project/abstractions/features/pulumi/index.js\";\nimport { ApiPulumi } from \"@webiny/project/extensions/index.js\";\nimport { getTemplatesFolderPath } from \"~/utils/index.js\";\n\nexport const ApiLambdaFunction = defineExtension({\n type: \"Api/LambdaFunction\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add a custom Lambda function to the API app.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n functionSrc: zodSrcPath({ project }),\n pulumiSrc: zodSrcPath({ project, abstraction: ApiPulumiAbstraction })\n });\n },\n async build(params, ctx) {\n const absoluteFunctionSrc = ExtensionSrcResolver.resolvePath(\n params.functionSrc,\n ctx.project\n );\n\n // Derive function name from the handler file name (without extension).\n const functionName = path.parse(absoluteFunctionSrc).name;\n\n const fnWorkspacePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", functionName)\n .toString();\n\n // 1. Scaffold from template if the folder doesn't exist yet.\n if (!fs.existsSync(fnWorkspacePath)) {\n const templatePath = path.join(\n getTemplatesFolderPath(),\n \"extensions\",\n \"ApiLambdaFunction\"\n );\n\n fs.cpSync(templatePath, fnWorkspacePath, { recursive: true });\n\n // Replace the {{functionName}} placeholder in package.json.\n replaceInPath(path.join(fnWorkspacePath, \"package.json\"), {\n find: \"{{functionName}}\",\n replaceWith: functionName\n });\n }\n\n // 2. Copy user's handler file → <functionName>/src/index.ts.\n const srcDir = path.join(fnWorkspacePath, \"src\");\n fs.mkdirSync(srcDir, { recursive: true });\n fs.copyFileSync(absoluteFunctionSrc, path.join(srcDir, \"index.ts\"));\n },\n render(props) {\n return <ApiPulumi src={props.pulumiSrc} />;\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,QAAQ,wDAAwD;AACnF,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,SAAS,IAAIC,oBAAoB,QAAQ,uDAAuD;AACzG,SAASD,SAAS,QAAQ,qCAAqC;AAC/D,SAASE,sBAAsB;AAE/B,OAAO,MAAMC,iBAAiB,GAAGN,eAAe,CAAC;EAC7CO,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAM,CAAC;EACrDC,WAAW,EAAE,8CAA8C;EAC3DC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC3B,OAAOhB,CAAC,CAACiB,MAAM,CAAC;MACZC,WAAW,EAAEf,UAAU,CAAC;QAAEa;MAAQ,CAAC,CAAC;MACpCG,SAAS,EAAEhB,UAAU,CAAC;QAAEa,OAAO;QAAEI,WAAW,EAAEd;MAAqB,CAAC;IACxE,CAAC,CAAC;EACN,CAAC;EACD,MAAMe,KAAKA,CAACC,MAAM,EAAEC,GAAG,EAAE;IACrB,MAAMC,mBAAmB,GAAGpB,oBAAoB,CAACqB,WAAW,CACxDH,MAAM,CAACJ,WAAW,EAClBK,GAAG,CAACP,OACR,CAAC;;IAED;IACA,MAAMU,YAAY,GAAG5B,IAAI,CAAC6B,KAAK,CAACH,mBAAmB,CAAC,CAACI,IAAI;IAEzD,MAAMC,eAAe,GAAGN,GAAG,CAACP,OAAO,CAACc,KAAK,CAACC,eAAe,CACpDC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAEN,YAAY,CAAC,CACjCO,QAAQ,CAAC,CAAC;;IAEf;IACA,IAAI,CAAClC,EAAE,CAACmC,UAAU,CAACL,eAAe,CAAC,EAAE;MACjC,MAAMM,YAAY,GAAGrC,IAAI,CAACkC,IAAI,CAC1BzB,sBAAsB,CAAC,CAAC,EACxB,YAAY,EACZ,mBACJ,CAAC;MAEDR,EAAE,CAACqC,MAAM,CAACD,YAAY,EAAEN,eAAe,EAAE;QAAEQ,SAAS,EAAE;MAAK,CAAC,CAAC;;MAE7D;MACApC,aAAa,CAACH,IAAI,CAACkC,IAAI,CAACH,eAAe,EAAE,cAAc,CAAC,EAAE;QACtDS,IAAI,EAAE,kBAAkB;QACxBC,WAAW,EAAEb;MACjB,CAAC,CAAC;IACN;;IAEA;IACA,MAAMc,MAAM,GAAG1C,IAAI,CAACkC,IAAI,CAACH,eAAe,EAAE,KAAK,CAAC;IAChD9B,EAAE,CAAC0C,SAAS,CAACD,MAAM,EAAE;MAAEH,SAAS,EAAE;IAAK,CAAC,CAAC;IACzCtC,EAAE,CAAC2C,YAAY,CAAClB,mBAAmB,EAAE1B,IAAI,CAACkC,IAAI,CAACQ,MAAM,EAAE,UAAU,CAAC,CAAC;EACvE,CAAC;EACDG,MAAMA,CAACC,KAAK,EAAE;IACV,oBAAO/C,KAAA,CAAAgD,aAAA,CAACxC,SAAS;MAACyC,GAAG,EAAEF,KAAK,CAACzB;IAAU,CAAE,CAAC;EAC9C;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/ApiLambdaFunction.js","sources":["../../src/extensions/ApiLambdaFunction.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport { z } from \"zod\";\nimport { replaceInPath } from \"replace-in-path\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi as ApiPulumiAbstraction } from \"~/abstractions/features/pulumi/index.js\";\nimport { ApiPulumi } from \"~/pulumi/extensions/ApiPulumi.js\";\nimport { getTemplatesFolderPath } from \"~/utils/index.js\";\n\nexport const ApiLambdaFunction = defineExtension({\n type: \"Api/LambdaFunction\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add a custom Lambda function to the API app.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n functionSrc: zodSrcPath({ project }),\n pulumiSrc: zodSrcPath({ project, abstraction: ApiPulumiAbstraction })\n });\n },\n async build(params, ctx) {\n const absoluteFunctionSrc = ExtensionSrcResolver.resolvePath(\n params.functionSrc,\n ctx.project\n );\n\n // Derive function name from the handler file name (without extension).\n const functionName = path.parse(absoluteFunctionSrc).name;\n\n const fnWorkspacePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", functionName)\n .toString();\n\n // 1. Scaffold from template if the folder doesn't exist yet.\n if (!fs.existsSync(fnWorkspacePath)) {\n const templatePath = path.join(\n getTemplatesFolderPath(),\n \"extensions\",\n \"ApiLambdaFunction\"\n );\n\n fs.cpSync(templatePath, fnWorkspacePath, { recursive: true });\n\n // Replace the {{functionName}} placeholder in package.json.\n replaceInPath(path.join(fnWorkspacePath, \"package.json\"), {\n find: \"{{functionName}}\",\n replaceWith: functionName\n });\n }\n\n // 2. Copy user's handler file → <functionName>/src/index.ts.\n const srcDir = path.join(fnWorkspacePath, \"src\");\n fs.mkdirSync(srcDir, { recursive: true });\n fs.copyFileSync(absoluteFunctionSrc, path.join(srcDir, \"index.ts\"));\n },\n render(props) {\n return <ApiPulumi src={props.pulumiSrc} />;\n }\n});\n"],"names":["ApiLambdaFunction","defineExtension","project","z","zodSrcPath","ApiPulumiAbstraction","params","ctx","absoluteFunctionSrc","ExtensionSrcResolver","functionName","path","fnWorkspacePath","fs","templatePath","getTemplatesFolderPath","replaceInPath","srcDir","props","ApiPulumi"],"mappings":";;;;;;;;;;;AAYO,MAAMA,oBAAoBC,gBAAgB;IAC7C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,aAAaC,WAAW;gBAAEF;YAAQ;YAClC,WAAWE,WAAW;gBAAEF;gBAAS,aAAaG;YAAqB;QACvE;IAEJ,MAAM,OAAMC,MAAM,EAAEC,GAAG;QACnB,MAAMC,sBAAsBC,qBAAqB,WAAW,CACxDH,OAAO,WAAW,EAClBC,IAAI,OAAO;QAIf,MAAMG,eAAeC,KAAK,KAAK,CAACH,qBAAqB,IAAI;QAEzD,MAAMI,kBAAkBL,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACpD,IAAI,CAAC,QAAQ,OAAOG,cACpB,QAAQ;QAGb,IAAI,CAACG,GAAG,UAAU,CAACD,kBAAkB;YACjC,MAAME,eAAeH,KAAK,IAAI,CAC1BI,0BACA,cACA;YAGJF,GAAG,MAAM,CAACC,cAAcF,iBAAiB;gBAAE,WAAW;YAAK;YAG3DI,cAAcL,KAAK,IAAI,CAACC,iBAAiB,iBAAiB;gBACtD,MAAM;gBACN,aAAaF;YACjB;QACJ;QAGA,MAAMO,SAASN,KAAK,IAAI,CAACC,iBAAiB;QAC1CC,GAAG,SAAS,CAACI,QAAQ;YAAE,WAAW;QAAK;QACvCJ,GAAG,YAAY,CAACL,qBAAqBG,KAAK,IAAI,CAACM,QAAQ;IAC3D;IACA,QAAOC,KAAK;QACR,OAAO,WAAP,GAAO,oBAACC,wBAASA;YAAC,KAAKD,MAAM,SAAS;;IAC1C;AACJ"}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export declare const ApiRoute: import("@webiny/project/extensions").ExtensionComponent<z.ZodObject<{
3
+ path: z.ZodString;
4
+ method: z.ZodEnum<{
5
+ POST: "POST";
6
+ GET: "GET";
7
+ PUT: "PUT";
8
+ HEAD: "HEAD";
9
+ OPTIONS: "OPTIONS";
10
+ PATCH: "PATCH";
11
+ DELETE: "DELETE";
12
+ ANY: "ANY";
13
+ }>;
14
+ src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
15
+ routeName: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>;
@@ -0,0 +1,106 @@
1
+ import react from "react";
2
+ import path from "path";
3
+ import crypto_0 from "crypto";
4
+ import { z } from "zod";
5
+ import { Node, Project } from "ts-morph";
6
+ import { defineExtension } from "@webiny/project/defineExtension/index.js";
7
+ import { zodSrcPath } from "@webiny/project/defineExtension/zodTypes/zodSrcPath.js";
8
+ import { ExtensionSrcResolver } from "@webiny/project/utils/index.js";
9
+ import { ApiPulumi } from "../pulumi/extensions/ApiPulumi.js";
10
+ import { createPathResolver } from "@webiny/project";
11
+ const p = createPathResolver(import.meta.dirname);
12
+ const HTTP_METHODS = [
13
+ "DELETE",
14
+ "GET",
15
+ "HEAD",
16
+ "PATCH",
17
+ "POST",
18
+ "PUT",
19
+ "OPTIONS",
20
+ "ANY"
21
+ ];
22
+ const METHOD_HANDLER = {
23
+ DELETE: "onDelete",
24
+ GET: "onGet",
25
+ HEAD: "onHead",
26
+ PATCH: "onPatch",
27
+ POST: "onPost",
28
+ PUT: "onPut",
29
+ OPTIONS: "onOptions",
30
+ ANY: "onAll"
31
+ };
32
+ const ApiRoute = defineExtension({
33
+ type: "Api/Route",
34
+ tags: {
35
+ runtimeContext: "app-build",
36
+ appName: "api"
37
+ },
38
+ description: "Register a custom REST route on the API Gateway + GraphQL Lambda.",
39
+ multiple: true,
40
+ paramsSchema: ({ project })=>z.object({
41
+ path: z.string().startsWith("/"),
42
+ method: z["enum"](HTTP_METHODS),
43
+ src: zodSrcPath({
44
+ project
45
+ }),
46
+ routeName: z.string().optional()
47
+ }),
48
+ async build (params, ctx) {
49
+ const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
50
+ const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);
51
+ const hash = crypto_0.createHash("sha256").update(params.src).digest("hex");
52
+ const alias = `ApiRoute_${hash.slice(-10)}`;
53
+ const importPath = path.relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath).replace(/\.tsx?$/, ".js");
54
+ const tsProject = new Project();
55
+ tsProject.addSourceFileAtPath(extensionsTsFilePath);
56
+ const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);
57
+ if (source.getImportDeclaration(importPath)) return;
58
+ let insertIndex = 1;
59
+ const importDeclarations = source.getImportDeclarations();
60
+ if (importDeclarations.length) insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;
61
+ source.insertImportDeclaration(insertIndex, {
62
+ defaultImport: alias,
63
+ moduleSpecifier: importPath
64
+ });
65
+ const ctxPluginPath = "@webiny/api/plugins/ContextPlugin.js";
66
+ if (!source.getImportDeclaration(ctxPluginPath)) {
67
+ const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
68
+ source.insertImportDeclaration(lastIdx, {
69
+ namedImports: [
70
+ "createContextPlugin"
71
+ ],
72
+ moduleSpecifier: ctxPluginPath
73
+ });
74
+ }
75
+ const handlerImportPath = "@webiny/handler";
76
+ const existingHandlerImport = source.getImportDeclaration(handlerImportPath);
77
+ const requiredHandlerImports = [
78
+ "createRoute",
79
+ "Route"
80
+ ];
81
+ if (existingHandlerImport) {
82
+ const present = existingHandlerImport.getNamedImports().map((i)=>i.getName());
83
+ for (const name of requiredHandlerImports)if (!present.includes(name)) existingHandlerImport.addNamedImport(name);
84
+ } else {
85
+ const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
86
+ source.insertImportDeclaration(lastIdx, {
87
+ namedImports: requiredHandlerImports,
88
+ moduleSpecifier: handlerImportPath
89
+ });
90
+ }
91
+ const onMethod = METHOD_HANDLER[params.method];
92
+ const routePath = params.path;
93
+ const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
94
+ pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${alias});\n})`);
95
+ pluginsArray.addElement(`\ncreateRoute(({ ${onMethod}, context }) => {\n\t${onMethod}("${routePath}", async (request, reply) => {\n\t\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\n\t\treturn instance.execute(request, reply);\n\t});\n})`);
96
+ await source.save();
97
+ },
98
+ render () {
99
+ return /*#__PURE__*/ react.createElement(ApiPulumi, {
100
+ src: p("RegisterRoutesPulumi.js")
101
+ });
102
+ }
103
+ });
104
+ export { ApiRoute };
105
+
106
+ //# sourceMappingURL=ApiRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ApiRoute.js","sources":["../../src/extensions/ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi } from \"~/pulumi/extensions/ApiPulumi.js\";\nimport { createPathResolver } from \"@webiny/project\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nconst HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\", \"ANY\"] as const;\n\nconst METHOD_HANDLER: Record<string, string> = {\n DELETE: \"onDelete\",\n GET: \"onGet\",\n HEAD: \"onHead\",\n PATCH: \"onPatch\",\n POST: \"onPost\",\n PUT: \"onPut\",\n OPTIONS: \"onOptions\",\n ANY: \"onAll\"\n};\n\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Register a custom REST route on the API Gateway + GraphQL Lambda.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // TODO: add zodSrcPath abstraction validation once Route abstraction is wired to zodSrcPath.\n src: zodSrcPath({ project }),\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Skip if the route handler is already registered.\n if (source.getImportDeclaration(importPath)) {\n return;\n }\n\n // Insert handler import after the last existing import.\n let insertIndex = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;\n }\n\n source.insertImportDeclaration(insertIndex, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n\n // Ensure createContextPlugin import exists.\n const ctxPluginPath = \"@webiny/api/plugins/ContextPlugin.js\";\n if (!source.getImportDeclaration(ctxPluginPath)) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: ctxPluginPath\n });\n }\n\n // Ensure createRoute and Route are imported from @webiny/handler.\n const handlerImportPath = \"@webiny/handler\";\n const existingHandlerImport = source.getImportDeclaration(handlerImportPath);\n const requiredHandlerImports = [\"createRoute\", \"Route\"];\n if (!existingHandlerImport) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: requiredHandlerImports,\n moduleSpecifier: handlerImportPath\n });\n } else {\n const present = existingHandlerImport.getNamedImports().map(i => i.getName());\n for (const name of requiredHandlerImports) {\n if (!present.includes(name)) {\n existingHandlerImport.addNamedImport(name);\n }\n }\n }\n\n const onMethod = METHOD_HANDLER[params.method];\n const routePath = params.path as `/${string}`;\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n // Register factory in DI container.\n pluginsArray.addElement(\n `\\ncreateContextPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${alias});\\n})`\n );\n\n // Register Fastify route with hardcoded path/method.\n // We use resolveAll(Route) + instanceof to find the correct handler when multiple\n // Api.Route extensions are registered.\n pluginsArray.addElement(\n `\\ncreateRoute(({ ${onMethod}, context }) => {\\n` +\n `\\t${onMethod}(\"${routePath}\", async (request, reply) => {\\n` +\n `\\t\\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\\n` +\n `\\t\\treturn instance.execute(request, reply);\\n` +\n `\\t});\\n` +\n `})`\n );\n\n await source.save();\n },\n render() {\n return <ApiPulumi src={p(\"RegisterRoutesPulumi.js\")} />;\n }\n});\n"],"names":["p","createPathResolver","HTTP_METHODS","METHOD_HANDLER","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","importPath","path","tsProject","Project","source","insertIndex","importDeclarations","ctxPluginPath","lastIdx","handlerImportPath","existingHandlerImport","requiredHandlerImports","present","i","name","onMethod","routePath","pluginsArray","node","Node","ApiPulumi"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAIC,mBAAmB,YAAY,OAAO;AAEhD,MAAMC,eAAe;IAAC;IAAU;IAAO;IAAQ;IAAS;IAAQ;IAAO;IAAW;CAAM;AAExF,MAAMC,iBAAyC;IAC3C,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,SAAS;IACT,KAAK;AACT;AAEO,MAAMC,WAAWC,gBAAgB;IACpC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAa,SAAS;IAAM;IACpD,aAAa;IACb,UAAU;IACV,cAAc,CAAC,EAAEC,OAAO,EAAE,GACfC,EAAE,MAAM,CAAC;YACZ,MAAMA,EAAE,MAAM,GAAG,UAAU,CAAC;YAC5B,QAAQA,CAAC,CAADA,OAAM,CAACL;YAEf,KAAKM,WAAW;gBAAEF;YAAQ;YAC1B,WAAWC,EAAE,MAAM,GAAG,QAAQ;QAClC;IAEJ,MAAM,OAAME,MAAM,EAAEC,GAAG;QACnB,MAAMC,uBAAuBD,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CACzD,IAAI,CAAC,QAAQ,OAAO,WAAW,OAAO,iBACtC,QAAQ;QAEb,MAAME,sBAAsBC,qBAAqB,WAAW,CAACJ,OAAO,GAAG,EAAEC,IAAI,OAAO;QAGpF,MAAMI,OAAOC,SAAAA,UAAiB,CAAC,UAAU,MAAM,CAACN,OAAO,GAAG,EAAE,MAAM,CAAC;QACnE,MAAMO,QAAQ,CAAC,SAAS,EAAEF,KAAK,KAAK,CAAC,MAAM;QAE3C,MAAMG,aAAaC,KAAAA,QACN,CAACA,KAAK,OAAO,CAACP,uBAAuBC,qBAC7C,OAAO,CAAC,WAAW;QAExB,MAAMO,YAAY,IAAIC;QACtBD,UAAU,mBAAmB,CAACR;QAC9B,MAAMU,SAASF,UAAU,oBAAoB,CAACR;QAG9C,IAAIU,OAAO,oBAAoB,CAACJ,aAC5B;QAIJ,IAAIK,cAAc;QAClB,MAAMC,qBAAqBF,OAAO,qBAAqB;QACvD,IAAIE,mBAAmB,MAAM,EACzBD,cAAcC,kBAAkB,CAACA,mBAAmB,MAAM,GAAG,EAAE,CAAC,aAAa,KAAK;QAGtFF,OAAO,uBAAuB,CAACC,aAAa;YACxC,eAAeN;YACf,iBAAiBC;QACrB;QAGA,MAAMO,gBAAgB;QACtB,IAAI,CAACH,OAAO,oBAAoB,CAACG,gBAAgB;YAC7C,MAAMC,UACFJ,OACK,qBAAqB,EACtB,CAACA,OAAO,qBAAqB,GAAG,MAAM,GAAG,EAAE,CAAC,aAAa,KAAK;YACtEA,OAAO,uBAAuB,CAACI,SAAS;gBACpC,cAAc;oBAAC;iBAAsB;gBACrC,iBAAiBD;YACrB;QACJ;QAGA,MAAME,oBAAoB;QAC1B,MAAMC,wBAAwBN,OAAO,oBAAoB,CAACK;QAC1D,MAAME,yBAAyB;YAAC;YAAe;SAAQ;QACvD,IAAKD,uBASE;YACH,MAAME,UAAUF,sBAAsB,eAAe,GAAG,GAAG,CAACG,CAAAA,IAAKA,EAAE,OAAO;YAC1E,KAAK,MAAMC,QAAQH,uBACf,IAAI,CAACC,QAAQ,QAAQ,CAACE,OAClBJ,sBAAsB,cAAc,CAACI;QAGjD,OAhB4B;YACxB,MAAMN,UACFJ,OACK,qBAAqB,EACtB,CAACA,OAAO,qBAAqB,GAAG,MAAM,GAAG,EAAE,CAAC,aAAa,KAAK;YACtEA,OAAO,uBAAuB,CAACI,SAAS;gBACpC,cAAcG;gBACd,iBAAiBF;YACrB;QACJ;QASA,MAAMM,WAAW7B,cAAc,CAACM,OAAO,MAAM,CAAC;QAC9C,MAAMwB,YAAYxB,OAAO,IAAI;QAE7B,MAAMyB,eAAeb,OAAO,kBAAkB,CAACc,CAAAA,OAC3CC,KAAK,wBAAwB,CAACD;QAIlCD,aAAa,UAAU,CACnB,CAAC,mEAAmE,EAAElB,MAAM,MAAM,CAAC;QAMvFkB,aAAa,UAAU,CACnB,CAAC,iBAAiB,EAAEF,SACf,qBAAE,EAAEA,SAAS,EAAE,EAAEC,UACjB,gHAAgF,EAAEjB,MAElF,4DAAO,CAJqC;QAQrD,MAAMK,OAAO,IAAI;IACrB;IACA;QACI,OAAO,WAAP,GAAO,oBAACgB,WAASA;YAAC,KAAKrC,EAAE;;IAC7B;AACJ"}
@@ -1,8 +1,4 @@
1
1
  import { z } from "zod";
2
2
  export declare const AwsDefaultRegion: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
3
3
  name: z.ZodString;
4
- }, "strip", z.ZodTypeAny, {
5
- name: string;
6
- }, {
7
- name: string;
8
- }>>;
4
+ }, z.core.$strip>>;
@@ -1,22 +1,23 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { z } from "zod";
3
3
  import { defineExtension } from "@webiny/project/defineExtension/index.js";
4
4
  import { EnvVar } from "@webiny/project/extensions/index.js";
5
- export const AwsDefaultRegion = defineExtension({
6
- type: "Aws/DefaultRegion",
7
- tags: {
8
- runtimeContext: "project"
9
- },
10
- description: "Set the default AWS region for the project.",
11
- paramsSchema: z.object({
12
- name: z.string().describe("The AWS region name.")
13
- }),
14
- render(props) {
15
- return /*#__PURE__*/React.createElement(EnvVar, {
16
- varName: "AWS_REGION",
17
- value: props.name
18
- });
19
- }
5
+ const AwsDefaultRegion = defineExtension({
6
+ type: "Aws/DefaultRegion",
7
+ tags: {
8
+ runtimeContext: "project"
9
+ },
10
+ description: "Set the default AWS region for the project.",
11
+ paramsSchema: z.object({
12
+ name: z.string().describe("The AWS region name.")
13
+ }),
14
+ render (props) {
15
+ return /*#__PURE__*/ react.createElement(EnvVar, {
16
+ varName: "AWS_REGION",
17
+ value: props.name
18
+ });
19
+ }
20
20
  });
21
+ export { AwsDefaultRegion };
21
22
 
22
23
  //# sourceMappingURL=AwsDefaultRegion.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","z","defineExtension","EnvVar","AwsDefaultRegion","type","tags","runtimeContext","description","paramsSchema","object","name","string","describe","render","props","createElement","varName","value"],"sources":["AwsDefaultRegion.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\n\nexport const AwsDefaultRegion = defineExtension({\n type: \"Aws/DefaultRegion\",\n tags: { runtimeContext: \"project\" },\n description: \"Set the default AWS region for the project.\",\n paramsSchema: z.object({\n name: z.string().describe(\"The AWS region name.\")\n }),\n render(props) {\n return <EnvVar varName=\"AWS_REGION\" value={props.name} />;\n }\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,MAAM,QAAQ,qCAAqC;AAE5D,OAAO,MAAMC,gBAAgB,GAAGF,eAAe,CAAC;EAC5CG,IAAI,EAAE,mBAAmB;EACzBC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EAAE,6CAA6C;EAC1DC,YAAY,EAAER,CAAC,CAACS,MAAM,CAAC;IACnBC,IAAI,EAAEV,CAAC,CAACW,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,sBAAsB;EACpD,CAAC,CAAC;EACFC,MAAMA,CAACC,KAAK,EAAE;IACV,oBAAOf,KAAA,CAAAgB,aAAA,CAACb,MAAM;MAACc,OAAO,EAAC,YAAY;MAACC,KAAK,EAAEH,KAAK,CAACJ;IAAK,CAAE,CAAC;EAC7D;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/AwsDefaultRegion.js","sources":["../../src/extensions/AwsDefaultRegion.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\n\nexport const AwsDefaultRegion = defineExtension({\n type: \"Aws/DefaultRegion\",\n tags: { runtimeContext: \"project\" },\n description: \"Set the default AWS region for the project.\",\n paramsSchema: z.object({\n name: z.string().describe(\"The AWS region name.\")\n }),\n render(props) {\n return <EnvVar varName=\"AWS_REGION\" value={props.name} />;\n }\n});\n"],"names":["AwsDefaultRegion","defineExtension","z","props","EnvVar"],"mappings":";;;;AAKO,MAAMA,mBAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,MAAMA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B;IACA,QAAOC,KAAK;QACR,OAAO,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAAa,OAAOD,MAAM,IAAI;;IACzD;AACJ"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const ModelFieldCompression: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
3
+ enabled: z.ZodBoolean;
4
+ }, z.core.$strip>>;
@@ -0,0 +1,24 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "@webiny/project/defineExtension/index.js";
4
+ import { BuildParam } from "@webiny/project/extensions/index.js";
5
+ const paramsSchema = z.object({
6
+ enabled: z.boolean().describe("Enable compression of model fields before storing in the database.")
7
+ });
8
+ const ModelFieldCompression = defineExtension({
9
+ type: "Api/Cms/ModelFieldCompression",
10
+ tags: {
11
+ runtimeContext: "project"
12
+ },
13
+ description: "Enable or disable compression of Headless CMS model fields at the database storage level.",
14
+ paramsSchema: paramsSchema,
15
+ render (params) {
16
+ return /*#__PURE__*/ react.createElement(BuildParam, {
17
+ paramName: "ContentModelFieldCompression",
18
+ value: params.enabled
19
+ });
20
+ }
21
+ });
22
+ export { ModelFieldCompression };
23
+
24
+ //# sourceMappingURL=ModelFieldCompression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/Cms/ModelFieldCompression.js","sources":["../../../src/extensions/Cms/ModelFieldCompression.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { BuildParam } from \"@webiny/project/extensions/index.js\";\n\nconst paramsSchema = z.object({\n enabled: z\n .boolean()\n .describe(\"Enable compression of model fields before storing in the database.\")\n});\n\nexport const ModelFieldCompression = defineExtension({\n type: \"Api/Cms/ModelFieldCompression\",\n tags: { runtimeContext: \"project\" },\n description:\n \"Enable or disable compression of Headless CMS model fields at the database storage level.\",\n paramsSchema,\n render(params) {\n return <BuildParam paramName=\"ContentModelFieldCompression\" value={params.enabled} />;\n }\n});\n"],"names":["paramsSchema","z","ModelFieldCompression","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,SAASA,EAAAA,OACG,GACP,QAAQ,CAAC;AAClB;AAEO,MAAMC,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aACI;IACJH,cAAAA;IACA,QAAOI,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAA+B,OAAOD,OAAO,OAAO;;IACrF;AACJ"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const Encryption: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
3
+ passphrase: z.ZodString;
4
+ salt: z.ZodOptional<z.ZodString>;
5
+ algorithm: z.ZodOptional<z.ZodEnum<{
6
+ "aes-128-gcm": "aes-128-gcm";
7
+ "aes-192-gcm": "aes-192-gcm";
8
+ "aes-256-gcm": "aes-256-gcm";
9
+ }>>;
10
+ }, z.core.$strip>>;
@@ -0,0 +1,36 @@
1
+ import react from "react";
2
+ import { z } from "zod";
3
+ import { defineExtension } from "@webiny/project/defineExtension/index.js";
4
+ import { BuildParam } from "@webiny/project/extensions/index.js";
5
+ const SUPPORTED_ALGORITHMS = [
6
+ "aes-128-gcm",
7
+ "aes-192-gcm",
8
+ "aes-256-gcm"
9
+ ];
10
+ const Encryption = defineExtension({
11
+ type: "Infra/Encryption",
12
+ tags: {
13
+ runtimeContext: "project"
14
+ },
15
+ description: "Configure the API's EncryptionService.",
16
+ paramsSchema: z.object({
17
+ passphrase: z.string().min(1).describe("The passphrase used to derive the AES encryption key via scrypt."),
18
+ salt: z.string().min(1).optional().describe("Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys."),
19
+ algorithm: z["enum"](SUPPORTED_ALGORITHMS).optional().describe("AES-GCM algorithm. Defaults to aes-256-gcm.")
20
+ }),
21
+ render ({ passphrase, salt, algorithm }) {
22
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(BuildParam, {
23
+ paramName: "EncryptionPassphrase",
24
+ value: passphrase
25
+ }), salt && /*#__PURE__*/ react.createElement(BuildParam, {
26
+ paramName: "EncryptionSalt",
27
+ value: salt
28
+ }), algorithm && /*#__PURE__*/ react.createElement(BuildParam, {
29
+ paramName: "EncryptionAlgorithm",
30
+ value: algorithm
31
+ }));
32
+ }
33
+ });
34
+ export { Encryption };
35
+
36
+ //# sourceMappingURL=Encryption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/Encryption.js","sources":["../../src/extensions/Encryption.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { BuildParam } from \"@webiny/project/extensions/index.js\";\n\nconst SUPPORTED_ALGORITHMS = [\"aes-128-gcm\", \"aes-192-gcm\", \"aes-256-gcm\"] as const;\n\nexport const Encryption = defineExtension({\n type: \"Infra/Encryption\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure the API's EncryptionService.\",\n paramsSchema: z.object({\n passphrase: z\n .string()\n .min(1)\n .describe(\"The passphrase used to derive the AES encryption key via scrypt.\"),\n salt: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys.\"\n ),\n algorithm: z\n .enum(SUPPORTED_ALGORITHMS)\n .optional()\n .describe(\"AES-GCM algorithm. Defaults to aes-256-gcm.\")\n }),\n render({ passphrase, salt, algorithm }) {\n return (\n <>\n <BuildParam paramName=\"EncryptionPassphrase\" value={passphrase} />\n {salt && <BuildParam paramName=\"EncryptionSalt\" value={salt} />}\n {algorithm && <BuildParam paramName=\"EncryptionAlgorithm\" value={algorithm} />}\n </>\n );\n }\n});\n"],"names":["SUPPORTED_ALGORITHMS","Encryption","defineExtension","z","passphrase","salt","algorithm","BuildParam"],"mappings":";;;;AAKA,MAAMA,uBAAuB;IAAC;IAAe;IAAe;CAAc;AAEnE,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,YAAYA,EAAAA,MACD,GACN,GAAG,CAAC,GACJ,QAAQ,CAAC;QACd,MAAMA,EAAAA,MACK,GACN,GAAG,CAAC,GACJ,QAAQ,GACR,QAAQ,CACL;QAER,WAAWA,CAAC,CAADA,OACF,CAACH,sBACL,QAAQ,GACR,QAAQ,CAAC;IAClB;IACA,QAAO,EAAEI,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAE;QAClC,OAAO,WAAP,GACI,wDACI,oBAACC,YAAUA;YAAC,WAAU;YAAuB,OAAOH;YACnDC,QAAQ,WAARA,GAAQ,oBAACE,YAAUA;YAAC,WAAU;YAAiB,OAAOF;YACtDC,aAAa,WAAbA,GAAa,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAG7E;AACJ"}
@@ -0,0 +1,8 @@
1
+ export declare const Smtp: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
2
+ host: import("zod").ZodString;
3
+ port: import("zod").ZodNumber;
4
+ user: import("zod").ZodString;
5
+ password: import("zod").ZodString;
6
+ from: import("zod").ZodString;
7
+ replyTo: import("zod").ZodOptional<import("zod").ZodString>;
8
+ }, import("zod/v4/core").$strip>>;
@@ -0,0 +1,21 @@
1
+ import react from "react";
2
+ import { defineExtension } from "@webiny/project/defineExtension/index.js";
3
+ import { BuildParam } from "@webiny/project/extensions/index.js";
4
+ import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
5
+ const Smtp = defineExtension({
6
+ type: "Api/Mailer/Smtp",
7
+ tags: {
8
+ runtimeContext: "project"
9
+ },
10
+ description: "Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.",
11
+ paramsSchema: SmtpParamsSchema,
12
+ render (params) {
13
+ return /*#__PURE__*/ react.createElement(BuildParam, {
14
+ paramName: "Mailer.SmtpSettings",
15
+ value: params
16
+ });
17
+ }
18
+ });
19
+ export { Smtp };
20
+
21
+ //# sourceMappingURL=Smtp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/Mailer/Smtp.js","sources":["../../../src/extensions/Mailer/Smtp.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { BuildParam } from \"@webiny/project/extensions/index.js\";\nimport { SmtpParamsSchema } from \"./SmtpParamsSchema.js\";\n\nexport const Smtp = defineExtension({\n type: \"Api/Mailer/Smtp\",\n tags: { runtimeContext: \"project\" },\n description:\n \"Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.\",\n paramsSchema: SmtpParamsSchema,\n render(params) {\n return <BuildParam paramName=\"Mailer.SmtpSettings\" value={params} />;\n }\n});\n"],"names":["Smtp","defineExtension","SmtpParamsSchema","params","BuildParam"],"mappings":";;;;AAKO,MAAMA,OAAOC,gBAAgB;IAChC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aACI;IACJ,cAAcC;IACd,QAAOC,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAC9D;AACJ"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,127 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
3
+ const validParams = {
4
+ host: "smtp.example.com",
5
+ port: 587,
6
+ user: "smtp-user",
7
+ password: "secret",
8
+ from: "Webiny <test@webiny.com>",
9
+ replyTo: "No-reply <no-reply@webiny.com>"
10
+ };
11
+ describe("Smtp paramsSchema", ()=>{
12
+ describe("valid inputs", ()=>{
13
+ it("accepts a complete valid config", async ()=>{
14
+ const result = await SmtpParamsSchema.safeParseAsync(validParams);
15
+ expect(result.success).toBe(true);
16
+ });
17
+ it("accepts config without replyTo (it is optional)", async ()=>{
18
+ const { replyTo: _, ...params } = validParams;
19
+ const result = await SmtpParamsSchema.safeParseAsync(params);
20
+ expect(result.success).toBe(true);
21
+ });
22
+ it("accepts bare addr-spec for from and replyTo", async ()=>{
23
+ const result = await SmtpParamsSchema.safeParseAsync({
24
+ ...validParams,
25
+ from: "test@webiny.com",
26
+ replyTo: "no-reply@webiny.com"
27
+ });
28
+ expect(result.success).toBe(true);
29
+ });
30
+ });
31
+ describe("react-properties serialization bug", ()=>{
32
+ it("password={} reproduces the 'expected string, received object' error", async ()=>{
33
+ const result = await SmtpParamsSchema.safeParseAsync({
34
+ ...validParams,
35
+ password: {}
36
+ });
37
+ expect(result.success).toBe(false);
38
+ const issue = result.error?.issues[0];
39
+ expect(issue?.code).toBe("invalid_type");
40
+ expect(issue?.path).toEqual([
41
+ "password"
42
+ ]);
43
+ expect(issue?.message).toBe("Invalid input: expected string, received object");
44
+ });
45
+ });
46
+ describe("required string fields", ()=>{
47
+ it("rejects missing host", async ()=>{
48
+ const { host: _, ...params } = validParams;
49
+ const result = await SmtpParamsSchema.safeParseAsync(params);
50
+ expect(result.success).toBe(false);
51
+ });
52
+ it("rejects empty host", async ()=>{
53
+ const result = await SmtpParamsSchema.safeParseAsync({
54
+ ...validParams,
55
+ host: ""
56
+ });
57
+ expect(result.success).toBe(false);
58
+ });
59
+ it("rejects missing user", async ()=>{
60
+ const { user: _, ...params } = validParams;
61
+ const result = await SmtpParamsSchema.safeParseAsync(params);
62
+ expect(result.success).toBe(false);
63
+ });
64
+ it("rejects empty user", async ()=>{
65
+ const result = await SmtpParamsSchema.safeParseAsync({
66
+ ...validParams,
67
+ user: ""
68
+ });
69
+ expect(result.success).toBe(false);
70
+ });
71
+ it("rejects missing password", async ()=>{
72
+ const { password: _, ...params } = validParams;
73
+ const result = await SmtpParamsSchema.safeParseAsync(params);
74
+ expect(result.success).toBe(false);
75
+ });
76
+ it("rejects empty password", async ()=>{
77
+ const result = await SmtpParamsSchema.safeParseAsync({
78
+ ...validParams,
79
+ password: ""
80
+ });
81
+ expect(result.success).toBe(false);
82
+ });
83
+ });
84
+ describe("port validation", ()=>{
85
+ it("rejects port 0", async ()=>{
86
+ const result = await SmtpParamsSchema.safeParseAsync({
87
+ ...validParams,
88
+ port: 0
89
+ });
90
+ expect(result.success).toBe(false);
91
+ });
92
+ it("rejects negative port", async ()=>{
93
+ const result = await SmtpParamsSchema.safeParseAsync({
94
+ ...validParams,
95
+ port: -1
96
+ });
97
+ expect(result.success).toBe(false);
98
+ });
99
+ it("rejects fractional port", async ()=>{
100
+ const result = await SmtpParamsSchema.safeParseAsync({
101
+ ...validParams,
102
+ port: 587.5
103
+ });
104
+ expect(result.success).toBe(false);
105
+ });
106
+ });
107
+ describe("email address validation", ()=>{
108
+ it("rejects invalid from address", async ()=>{
109
+ const result = await SmtpParamsSchema.safeParseAsync({
110
+ ...validParams,
111
+ from: "not-an-email"
112
+ });
113
+ expect(result.success).toBe(false);
114
+ expect(result.error?.issues[0].message).toBe("Invalid email address.");
115
+ });
116
+ it("rejects invalid replyTo address", async ()=>{
117
+ const result = await SmtpParamsSchema.safeParseAsync({
118
+ ...validParams,
119
+ replyTo: "not-an-email"
120
+ });
121
+ expect(result.success).toBe(false);
122
+ expect(result.error?.issues[0].message).toBe("Invalid email address.");
123
+ });
124
+ });
125
+ });
126
+
127
+ //# sourceMappingURL=Smtp.test.js.map