@webiny/project-aws 6.3.0-beta.4 → 6.4.0-beta.0

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 (393) hide show
  1. package/_templates/appTemplates/admin/src/index.tsx +0 -3
  2. package/abstractions/ApiGqlClient.js +2 -1
  3. package/abstractions/ApiGqlClient.js.map +1 -1
  4. package/abstractions/InvokeLambdaFunction.js +2 -1
  5. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  6. package/abstractions/features/pulumi/AdminPulumi.js +2 -1
  7. package/abstractions/features/pulumi/AdminPulumi.js.map +1 -1
  8. package/abstractions/features/pulumi/ApiPulumi.js +2 -1
  9. package/abstractions/features/pulumi/ApiPulumi.js.map +1 -1
  10. package/abstractions/features/pulumi/CorePulumi.js +2 -1
  11. package/abstractions/features/pulumi/CorePulumi.js.map +1 -1
  12. package/abstractions/features/pulumi/index.js +0 -2
  13. package/abstractions/index.js +0 -2
  14. package/abstractions/services/AdminStackOutputService.js +2 -1
  15. package/abstractions/services/AdminStackOutputService.js.map +1 -1
  16. package/abstractions/services/ApiStackOutputService.js +2 -1
  17. package/abstractions/services/ApiStackOutputService.js.map +1 -1
  18. package/abstractions/services/CoreStackOutputService.js +2 -1
  19. package/abstractions/services/CoreStackOutputService.js.map +1 -1
  20. package/admin.js +5 -4
  21. package/admin.js.map +1 -1
  22. package/api.js +13 -12
  23. package/api.js.map +1 -1
  24. package/apps/createAdminApp.js +11 -12
  25. package/apps/createAdminApp.js.map +1 -1
  26. package/apps/createAdminAppConfig.js +12 -18
  27. package/apps/createAdminAppConfig.js.map +1 -1
  28. package/apps/createApiApp.js +17 -22
  29. package/apps/createApiApp.js.map +1 -1
  30. package/apps/createBlueGreenApp.js +13 -16
  31. package/apps/createBlueGreenApp.js.map +1 -1
  32. package/apps/createCoreApp.js +12 -13
  33. package/apps/createCoreApp.js.map +1 -1
  34. package/apps/createReactAppConfig.d.ts +0 -7
  35. package/apps/createReactAppConfig.js +56 -69
  36. package/apps/createReactAppConfig.js.map +1 -1
  37. package/apps/createSyncSystemApp.js +8 -7
  38. package/apps/createSyncSystemApp.js.map +1 -1
  39. package/apps/index.js +0 -2
  40. package/cli.js +3 -2
  41. package/cli.js.map +1 -1
  42. package/exports/extensions.js +0 -2
  43. package/exports/infra/admin.js +0 -2
  44. package/exports/infra/api.js +0 -2
  45. package/exports/infra/core.js +0 -2
  46. package/exports/infra.js +1 -3
  47. package/extensions/ApiLambdaFunction.js +45 -56
  48. package/extensions/ApiLambdaFunction.js.map +1 -1
  49. package/extensions/ApiRoute.js +90 -104
  50. package/extensions/ApiRoute.js.map +1 -1
  51. package/extensions/AwsDefaultRegion.js +17 -16
  52. package/extensions/AwsDefaultRegion.js.map +1 -1
  53. package/extensions/Cms/ModelFieldCompression.js +16 -15
  54. package/extensions/Cms/ModelFieldCompression.js.map +1 -1
  55. package/extensions/Encryption.js +30 -29
  56. package/extensions/Encryption.js.map +1 -1
  57. package/extensions/Mailer/Smtp.js +15 -14
  58. package/extensions/Mailer/Smtp.js.map +1 -1
  59. package/extensions/Mailer/Smtp.test.js +117 -131
  60. package/extensions/Mailer/Smtp.test.js.map +1 -1
  61. package/extensions/Mailer/SmtpParamsSchema.js +11 -14
  62. package/extensions/Mailer/SmtpParamsSchema.js.map +1 -1
  63. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +25 -30
  64. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
  65. package/extensions/OpenSearch/EnsureOsWasDeployed.js +14 -24
  66. package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
  67. package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js +25 -21
  68. package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js.map +1 -1
  69. package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js +26 -22
  70. package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js.map +1 -1
  71. package/extensions/OpenSearch.js +30 -31
  72. package/extensions/OpenSearch.js.map +1 -1
  73. package/extensions/ProjectAws/AdminStackOutputService.js +0 -2
  74. package/extensions/ProjectAws/ApiStackOutputService.js +0 -2
  75. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +65 -74
  76. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  77. package/extensions/ProjectAws/AutoInstall.js +15 -14
  78. package/extensions/ProjectAws/AutoInstall.js.map +1 -1
  79. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +15 -19
  80. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
  81. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +56 -45
  82. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
  83. package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js +57 -55
  84. package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js.map +1 -1
  85. package/extensions/ProjectAws/BuildAppWorkspace.js +49 -54
  86. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  87. package/extensions/ProjectAws/CoreStackOutputService.js +0 -2
  88. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +26 -30
  89. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  90. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +25 -38
  91. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  92. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +22 -17
  93. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
  94. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +22 -17
  95. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
  96. package/extensions/ProjectAws/SetDatabaseSetupOutput.js +20 -21
  97. package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
  98. package/extensions/ProjectAws/UploadAdminAppToS3.js +53 -58
  99. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  100. package/extensions/ProjectAws/definitions.js +13 -6
  101. package/extensions/ProjectAws/definitions.js.map +1 -1
  102. package/extensions/ProjectAws.js +44 -45
  103. package/extensions/ProjectAws.js.map +1 -1
  104. package/extensions/RegisterRoutesPulumi.js +24 -29
  105. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  106. package/extensions/definitions.js +10 -3
  107. package/extensions/definitions.js.map +1 -1
  108. package/extensions/index.js +0 -2
  109. package/features/ApiGqlClient.js +46 -51
  110. package/features/ApiGqlClient.js.map +1 -1
  111. package/features/InvokeLambdaFunction.js +30 -32
  112. package/features/InvokeLambdaFunction.js.map +1 -1
  113. package/features/index.js +0 -2
  114. package/index.js +0 -2
  115. package/infra.js +57 -59
  116. package/infra.js.map +1 -1
  117. package/package.json +14 -14
  118. package/project.js +7 -6
  119. package/project.js.map +1 -1
  120. package/pulumi/apps/admin/createAdminPulumiApp.js +36 -44
  121. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  122. package/pulumi/apps/admin/index.js +0 -2
  123. package/pulumi/apps/api/ApiBackgroundTask.js +153 -137
  124. package/pulumi/apps/api/ApiBackgroundTask.js.map +1 -1
  125. package/pulumi/apps/api/ApiCloudfront.js +188 -130
  126. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  127. package/pulumi/apps/api/ApiFileManager.js +34 -33
  128. package/pulumi/apps/api/ApiFileManager.js.map +1 -1
  129. package/pulumi/apps/api/ApiGateway.js +67 -74
  130. package/pulumi/apps/api/ApiGateway.js.map +1 -1
  131. package/pulumi/apps/api/ApiGraphql.js +223 -152
  132. package/pulumi/apps/api/ApiGraphql.js.map +1 -1
  133. package/pulumi/apps/api/ApiOutput.js +29 -30
  134. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  135. package/pulumi/apps/api/ApiScheduler.js +94 -92
  136. package/pulumi/apps/api/ApiScheduler.js.map +1 -1
  137. package/pulumi/apps/api/ApiWebsocket.js +141 -133
  138. package/pulumi/apps/api/ApiWebsocket.js.map +1 -1
  139. package/pulumi/apps/api/backgroundTask/definition.js +122 -144
  140. package/pulumi/apps/api/backgroundTask/definition.js.map +1 -1
  141. package/pulumi/apps/api/backgroundTask/policy.js +37 -23
  142. package/pulumi/apps/api/backgroundTask/policy.js.map +1 -1
  143. package/pulumi/apps/api/backgroundTask/role.js +29 -29
  144. package/pulumi/apps/api/backgroundTask/role.js.map +1 -1
  145. package/pulumi/apps/api/backgroundTask/types.js +9 -11
  146. package/pulumi/apps/api/backgroundTask/types.js.map +1 -1
  147. package/pulumi/apps/api/createApiPulumiApp.js +206 -274
  148. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  149. package/pulumi/apps/api/handleGuardDutyEvents.js +54 -51
  150. package/pulumi/apps/api/handleGuardDutyEvents.js.map +1 -1
  151. package/pulumi/apps/api/index.js +0 -2
  152. package/pulumi/apps/awsUtils.js +21 -24
  153. package/pulumi/apps/awsUtils.js.map +1 -1
  154. package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js +37 -40
  155. package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js.map +1 -1
  156. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js +83 -91
  157. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js.map +1 -1
  158. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js +17 -16
  159. package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js.map +1 -1
  160. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js +13 -12
  161. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js.map +1 -1
  162. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js +9 -14
  163. package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js.map +1 -1
  164. package/pulumi/apps/blueGreen/cloudfront/createOriginId.js +5 -7
  165. package/pulumi/apps/blueGreen/cloudfront/createOriginId.js.map +1 -1
  166. package/pulumi/apps/blueGreen/constants.js +15 -3
  167. package/pulumi/apps/blueGreen/constants.js.map +1 -1
  168. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +77 -103
  169. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  170. package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js +20 -26
  171. package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js.map +1 -1
  172. package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js +17 -20
  173. package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js.map +1 -1
  174. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +51 -61
  175. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  176. package/pulumi/apps/blueGreen/domains/resolveDomains.js +24 -38
  177. package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
  178. package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js +7 -14
  179. package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js.map +1 -1
  180. package/pulumi/apps/blueGreen/functions/handler.js +1 -57
  181. package/pulumi/apps/blueGreen/functions/handler.js.map +1 -1
  182. package/pulumi/apps/blueGreen/types.js +0 -3
  183. package/pulumi/apps/blueGreen/validation/validateDeployments.js +19 -24
  184. package/pulumi/apps/blueGreen/validation/validateDeployments.js.map +1 -1
  185. package/pulumi/apps/common/CoreOutput.js +34 -37
  186. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  187. package/pulumi/apps/common/VpcConfig.js +20 -20
  188. package/pulumi/apps/common/VpcConfig.js.map +1 -1
  189. package/pulumi/apps/common/index.js +0 -2
  190. package/pulumi/apps/core/CoreAuditLogsDynamo.js +245 -182
  191. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  192. package/pulumi/apps/core/CoreCognito.js +117 -106
  193. package/pulumi/apps/core/CoreCognito.js.map +1 -1
  194. package/pulumi/apps/core/CoreDynamo.js +91 -70
  195. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  196. package/pulumi/apps/core/CoreEventBus.js +10 -9
  197. package/pulumi/apps/core/CoreEventBus.js.map +1 -1
  198. package/pulumi/apps/core/CoreFileManager.js +76 -68
  199. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  200. package/pulumi/apps/core/CoreOpenSearch.js +281 -305
  201. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  202. package/pulumi/apps/core/CoreVpc.js +155 -156
  203. package/pulumi/apps/core/CoreVpc.js.map +1 -1
  204. package/pulumi/apps/core/WatchCommand.js +94 -96
  205. package/pulumi/apps/core/WatchCommand.js.map +1 -1
  206. package/pulumi/apps/core/cognitoIdentityProviders/amazon.js +16 -22
  207. package/pulumi/apps/core/cognitoIdentityProviders/amazon.js.map +1 -1
  208. package/pulumi/apps/core/cognitoIdentityProviders/apple.js +16 -17
  209. package/pulumi/apps/core/cognitoIdentityProviders/apple.js.map +1 -1
  210. package/pulumi/apps/core/cognitoIdentityProviders/configure.js +44 -50
  211. package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
  212. package/pulumi/apps/core/cognitoIdentityProviders/facebook.js +16 -17
  213. package/pulumi/apps/core/cognitoIdentityProviders/facebook.js.map +1 -1
  214. package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js +7 -8
  215. package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js.map +1 -1
  216. package/pulumi/apps/core/cognitoIdentityProviders/google.js +16 -17
  217. package/pulumi/apps/core/cognitoIdentityProviders/google.js.map +1 -1
  218. package/pulumi/apps/core/cognitoIdentityProviders/index.js +0 -2
  219. package/pulumi/apps/core/cognitoIdentityProviders/oidc.js +17 -18
  220. package/pulumi/apps/core/cognitoIdentityProviders/oidc.js.map +1 -1
  221. package/pulumi/apps/core/configureS3BucketMalwareProtection.js +251 -188
  222. package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
  223. package/pulumi/apps/core/createCorePulumiApp.js +212 -280
  224. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  225. package/pulumi/apps/core/index.js +0 -2
  226. package/pulumi/apps/core/webinyWatchCommand/handler.js +45 -32
  227. package/pulumi/apps/core/webinyWatchCommand/handler.js.map +1 -1
  228. package/pulumi/apps/createAppBucket.js +157 -146
  229. package/pulumi/apps/createAppBucket.js.map +1 -1
  230. package/pulumi/apps/customDomain.js +7 -6
  231. package/pulumi/apps/customDomain.js.map +1 -1
  232. package/pulumi/apps/extensions/getAwsTagsFromExtension.js +8 -7
  233. package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
  234. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +6 -7
  235. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
  236. package/pulumi/apps/extensions/getOsConfigFromExtension.js +17 -41
  237. package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
  238. package/pulumi/apps/extensions/getVpcConfigFromExtension.js +13 -25
  239. package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
  240. package/pulumi/apps/index.js +0 -3
  241. package/pulumi/apps/lambdaUtils.js +57 -61
  242. package/pulumi/apps/lambdaUtils.js.map +1 -1
  243. package/pulumi/apps/react/createReactPulumiApp.js +108 -129
  244. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  245. package/pulumi/apps/react/index.js +0 -2
  246. package/pulumi/apps/syncSystem/SyncSystemDynamo.js +77 -62
  247. package/pulumi/apps/syncSystem/SyncSystemDynamo.js.map +1 -1
  248. package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js +74 -57
  249. package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js.map +1 -1
  250. package/pulumi/apps/syncSystem/SyncSystemEventBus.js +77 -71
  251. package/pulumi/apps/syncSystem/SyncSystemEventBus.js.map +1 -1
  252. package/pulumi/apps/syncSystem/SyncSystemLambda.js +154 -86
  253. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  254. package/pulumi/apps/syncSystem/SyncSystemOutput.js +14 -13
  255. package/pulumi/apps/syncSystem/SyncSystemOutput.js.map +1 -1
  256. package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js +56 -60
  257. package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js.map +1 -1
  258. package/pulumi/apps/syncSystem/SyncSystemSQS.js +25 -49
  259. package/pulumi/apps/syncSystem/SyncSystemSQS.js.map +1 -1
  260. package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js +44 -43
  261. package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js.map +1 -1
  262. package/pulumi/apps/syncSystem/addTableItems.js +35 -45
  263. package/pulumi/apps/syncSystem/addTableItems.js.map +1 -1
  264. package/pulumi/apps/syncSystem/api/addServiceManifest.js +12 -14
  265. package/pulumi/apps/syncSystem/api/addServiceManifest.js.map +1 -1
  266. package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js +49 -55
  267. package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js.map +1 -1
  268. package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js +88 -40
  269. package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js.map +1 -1
  270. package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js +37 -43
  271. package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js.map +1 -1
  272. package/pulumi/apps/syncSystem/api/attachS3Permissions.js +51 -47
  273. package/pulumi/apps/syncSystem/api/attachS3Permissions.js.map +1 -1
  274. package/pulumi/apps/syncSystem/api/index.js +28 -46
  275. package/pulumi/apps/syncSystem/api/index.js.map +1 -1
  276. package/pulumi/apps/syncSystem/constants.js +2 -1
  277. package/pulumi/apps/syncSystem/constants.js.map +1 -1
  278. package/pulumi/apps/syncSystem/createSyncResourceName.js +2 -7
  279. package/pulumi/apps/syncSystem/createSyncResourceName.js.map +1 -1
  280. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +101 -166
  281. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  282. package/pulumi/apps/syncSystem/customApp.js +12 -16
  283. package/pulumi/apps/syncSystem/customApp.js.map +1 -1
  284. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +5 -6
  285. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  286. package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +108 -42
  287. package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js.map +1 -1
  288. package/pulumi/apps/syncSystem/types.js +0 -3
  289. package/pulumi/constants.js +2 -1
  290. package/pulumi/constants.js.map +1 -1
  291. package/pulumi/env/awsRegion.js +3 -2
  292. package/pulumi/env/awsRegion.js.map +1 -1
  293. package/pulumi/env/base.js +11 -27
  294. package/pulumi/env/base.js.map +1 -1
  295. package/pulumi/env/env.js +3 -2
  296. package/pulumi/env/env.js.map +1 -1
  297. package/pulumi/env/projectName.js +3 -2
  298. package/pulumi/env/projectName.js.map +1 -1
  299. package/pulumi/env/variant.js +4 -3
  300. package/pulumi/env/variant.js.map +1 -1
  301. package/pulumi/extensions/AdminCustomDomains.js +15 -11
  302. package/pulumi/extensions/AdminCustomDomains.js.map +1 -1
  303. package/pulumi/extensions/AdminPulumi.js +16 -19
  304. package/pulumi/extensions/AdminPulumi.js.map +1 -1
  305. package/pulumi/extensions/ApiCustomDomains.js +15 -11
  306. package/pulumi/extensions/ApiCustomDomains.js.map +1 -1
  307. package/pulumi/extensions/ApiPulumi.js +16 -19
  308. package/pulumi/extensions/ApiPulumi.js.map +1 -1
  309. package/pulumi/extensions/AwsTags.js +11 -10
  310. package/pulumi/extensions/AwsTags.js.map +1 -1
  311. package/pulumi/extensions/BlueGreenDeployments.js +29 -26
  312. package/pulumi/extensions/BlueGreenDeployments.js.map +1 -1
  313. package/pulumi/extensions/CorePulumi.js +16 -19
  314. package/pulumi/extensions/CorePulumi.js.map +1 -1
  315. package/pulumi/extensions/OpenSearch.js +16 -15
  316. package/pulumi/extensions/OpenSearch.js.map +1 -1
  317. package/pulumi/extensions/Vpc.js +21 -20
  318. package/pulumi/extensions/Vpc.js.map +1 -1
  319. package/pulumi/extensions/index.js +12 -10
  320. package/pulumi/extensions/index.js.map +1 -1
  321. package/pulumi/features/AdminPulumi/AdminPulumi.js +18 -14
  322. package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -1
  323. package/pulumi/features/AdminPulumi/index.js +0 -2
  324. package/pulumi/features/ApiPulumi/ApiPulumi.js +18 -14
  325. package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -1
  326. package/pulumi/features/ApiPulumi/index.js +0 -2
  327. package/pulumi/features/CorePulumi/CorePulumi.js +18 -14
  328. package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -1
  329. package/pulumi/features/CorePulumi/index.js +0 -2
  330. package/pulumi/features/index.js +0 -2
  331. package/pulumi/index.js +0 -2
  332. package/pulumi/types.js +0 -3
  333. package/pulumi/utils/addDomainsUrlsOutputs.js +20 -37
  334. package/pulumi/utils/addDomainsUrlsOutputs.js.map +1 -1
  335. package/pulumi/utils/addServiceManifestTableItem.js +12 -15
  336. package/pulumi/utils/addServiceManifestTableItem.js.map +1 -1
  337. package/pulumi/utils/crawlDirectory.js +10 -15
  338. package/pulumi/utils/crawlDirectory.js.map +1 -1
  339. package/pulumi/utils/createAssetArchive.js +5 -6
  340. package/pulumi/utils/createAssetArchive.js.map +1 -1
  341. package/pulumi/utils/dynamodb.js +26 -27
  342. package/pulumi/utils/dynamodb.js.map +1 -1
  343. package/pulumi/utils/getPresignedPost.js +27 -30
  344. package/pulumi/utils/getPresignedPost.js.map +1 -1
  345. package/pulumi/utils/index.js +1 -3
  346. package/pulumi/utils/lambdaEnvVariables.js +42 -54
  347. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  348. package/pulumi/utils/tagResources.js +248 -28
  349. package/pulumi/utils/tagResources.js.map +1 -1
  350. package/pulumi/utils/uploadFolderToS3.js +101 -131
  351. package/pulumi/utils/uploadFolderToS3.js.map +1 -1
  352. package/pulumi/utils/withServiceManifest.js +28 -37
  353. package/pulumi/utils/withServiceManifest.js.map +1 -1
  354. package/services/AdminStackOutputService.js +14 -11
  355. package/services/AdminStackOutputService.js.map +1 -1
  356. package/services/ApiStackOutputService.js +14 -11
  357. package/services/ApiStackOutputService.js.map +1 -1
  358. package/services/CoreStackOutputService.js +14 -11
  359. package/services/CoreStackOutputService.js.map +1 -1
  360. package/utils/getTemplatesFolderPath.js +8 -10
  361. package/utils/getTemplatesFolderPath.js.map +1 -1
  362. package/utils/index.js +0 -2
  363. package/abstractions/features/pulumi/index.js.map +0 -1
  364. package/abstractions/index.js.map +0 -1
  365. package/apps/index.js.map +0 -1
  366. package/exports/extensions.js.map +0 -1
  367. package/exports/infra/admin.js.map +0 -1
  368. package/exports/infra/api.js.map +0 -1
  369. package/exports/infra/core.js.map +0 -1
  370. package/exports/infra.js.map +0 -1
  371. package/extensions/ProjectAws/AdminStackOutputService.js.map +0 -1
  372. package/extensions/ProjectAws/ApiStackOutputService.js.map +0 -1
  373. package/extensions/ProjectAws/CoreStackOutputService.js.map +0 -1
  374. package/extensions/index.js.map +0 -1
  375. package/features/index.js.map +0 -1
  376. package/index.js.map +0 -1
  377. package/pulumi/apps/admin/index.js.map +0 -1
  378. package/pulumi/apps/api/index.js.map +0 -1
  379. package/pulumi/apps/blueGreen/types.js.map +0 -1
  380. package/pulumi/apps/common/index.js.map +0 -1
  381. package/pulumi/apps/core/cognitoIdentityProviders/index.js.map +0 -1
  382. package/pulumi/apps/core/index.js.map +0 -1
  383. package/pulumi/apps/index.js.map +0 -1
  384. package/pulumi/apps/react/index.js.map +0 -1
  385. package/pulumi/apps/syncSystem/types.js.map +0 -1
  386. package/pulumi/features/AdminPulumi/index.js.map +0 -1
  387. package/pulumi/features/ApiPulumi/index.js.map +0 -1
  388. package/pulumi/features/CorePulumi/index.js.map +0 -1
  389. package/pulumi/features/index.js.map +0 -1
  390. package/pulumi/index.js.map +0 -1
  391. package/pulumi/types.js.map +0 -1
  392. package/pulumi/utils/index.js.map +0 -1
  393. package/utils/index.js.map +0 -1
@@ -1,23 +1,24 @@
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 { BuildParam } from "@webiny/project/extensions/index.js";
5
5
  const paramsSchema = z.object({
6
- enabled: z.boolean().describe("Enable compression of model fields before storing in the database.")
6
+ enabled: z.boolean().describe("Enable compression of model fields before storing in the database.")
7
7
  });
8
- export 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,
15
- render(params) {
16
- return /*#__PURE__*/React.createElement(BuildParam, {
17
- paramName: "ContentModelFieldCompression",
18
- value: params.enabled
19
- });
20
- }
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
21
  });
22
+ export { ModelFieldCompression };
22
23
 
23
24
  //# sourceMappingURL=ModelFieldCompression.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","z","defineExtension","BuildParam","paramsSchema","object","enabled","boolean","describe","ModelFieldCompression","type","tags","runtimeContext","description","render","params","createElement","paramName","value"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,QAAQ,qCAAqC;AAEhE,MAAMC,YAAY,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC1BC,OAAO,EAAEL,CAAC,CACLM,OAAO,CAAC,CAAC,CACTC,QAAQ,CAAC,oEAAoE;AACtF,CAAC,CAAC;AAEF,OAAO,MAAMC,qBAAqB,GAAGP,eAAe,CAAC;EACjDQ,IAAI,EAAE,+BAA+B;EACrCC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EACP,2FAA2F;EAC/FT,YAAY;EACZU,MAAMA,CAACC,MAAM,EAAE;IACX,oBAAOf,KAAA,CAAAgB,aAAA,CAACb,UAAU;MAACc,SAAS,EAAC,8BAA8B;MAACC,KAAK,EAAEH,MAAM,CAACT;IAAQ,CAAE,CAAC;EACzF;AACJ,CAAC,CAAC","ignoreList":[]}
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"}
@@ -1,35 +1,36 @@
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 { BuildParam } from "@webiny/project/extensions/index.js";
5
- const SUPPORTED_ALGORITHMS = ["aes-128-gcm", "aes-192-gcm", "aes-256-gcm"];
6
- export const Encryption = defineExtension({
7
- type: "Infra/Encryption",
8
- tags: {
9
- runtimeContext: "project"
10
- },
11
- description: "Configure the API's EncryptionService.",
12
- paramsSchema: z.object({
13
- passphrase: z.string().min(1).describe("The passphrase used to derive the AES encryption key via scrypt."),
14
- salt: z.string().min(1).optional().describe("Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys."),
15
- algorithm: z.enum(SUPPORTED_ALGORITHMS).optional().describe("AES-GCM algorithm. Defaults to aes-256-gcm.")
16
- }),
17
- render({
18
- passphrase,
19
- salt,
20
- algorithm
21
- }) {
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
- }
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
33
  });
34
+ export { Encryption };
34
35
 
35
36
  //# sourceMappingURL=Encryption.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","z","defineExtension","BuildParam","SUPPORTED_ALGORITHMS","Encryption","type","tags","runtimeContext","description","paramsSchema","object","passphrase","string","min","describe","salt","optional","algorithm","enum","render","createElement","Fragment","paramName","value"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,QAAQ,qCAAqC;AAEhE,MAAMC,oBAAoB,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,CAAU;AAEnF,OAAO,MAAMC,UAAU,GAAGH,eAAe,CAAC;EACtCI,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EAAE,wCAAwC;EACrDC,YAAY,EAAET,CAAC,CAACU,MAAM,CAAC;IACnBC,UAAU,EAAEX,CAAC,CACRY,MAAM,CAAC,CAAC,CACRC,GAAG,CAAC,CAAC,CAAC,CACNC,QAAQ,CAAC,kEAAkE,CAAC;IACjFC,IAAI,EAAEf,CAAC,CACFY,MAAM,CAAC,CAAC,CACRC,GAAG,CAAC,CAAC,CAAC,CACNG,QAAQ,CAAC,CAAC,CACVF,QAAQ,CACL,wGACJ,CAAC;IACLG,SAAS,EAAEjB,CAAC,CACPkB,IAAI,CAACf,oBAAoB,CAAC,CAC1Ba,QAAQ,CAAC,CAAC,CACVF,QAAQ,CAAC,6CAA6C;EAC/D,CAAC,CAAC;EACFK,MAAMA,CAAC;IAAER,UAAU;IAAEI,IAAI;IAAEE;EAAU,CAAC,EAAE;IACpC,oBACIlB,KAAA,CAAAqB,aAAA,CAAArB,KAAA,CAAAsB,QAAA,qBACItB,KAAA,CAAAqB,aAAA,CAAClB,UAAU;MAACoB,SAAS,EAAC,sBAAsB;MAACC,KAAK,EAAEZ;IAAW,CAAE,CAAC,EACjEI,IAAI,iBAAIhB,KAAA,CAAAqB,aAAA,CAAClB,UAAU;MAACoB,SAAS,EAAC,gBAAgB;MAACC,KAAK,EAAER;IAAK,CAAE,CAAC,EAC9DE,SAAS,iBAAIlB,KAAA,CAAAqB,aAAA,CAAClB,UAAU;MAACoB,SAAS,EAAC,qBAAqB;MAACC,KAAK,EAAEN;IAAU,CAAE,CAC/E,CAAC;EAEX;AACJ,CAAC,CAAC","ignoreList":[]}
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"}
@@ -1,20 +1,21 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { defineExtension } from "@webiny/project/defineExtension/index.js";
3
3
  import { BuildParam } from "@webiny/project/extensions/index.js";
4
4
  import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
5
- export 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
- }
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
18
  });
19
+ export { Smtp };
19
20
 
20
21
  //# sourceMappingURL=Smtp.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","defineExtension","BuildParam","SmtpParamsSchema","Smtp","type","tags","runtimeContext","description","paramsSchema","render","params","createElement","paramName","value"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,UAAU,QAAQ,qCAAqC;AAChE,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,IAAI,GAAGH,eAAe,CAAC;EAChCI,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE;IAAEC,cAAc,EAAE;EAAU,CAAC;EACnCC,WAAW,EACP,wQAAwQ;EAC5QC,YAAY,EAAEN,gBAAgB;EAC9BO,MAAMA,CAACC,MAAM,EAAE;IACX,oBAAOX,KAAA,CAAAY,aAAA,CAACV,UAAU;MAACW,SAAS,EAAC,qBAAqB;MAACC,KAAK,EAAEH;IAAO,CAAE,CAAC;EACxE;AACJ,CAAC,CAAC","ignoreList":[]}
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"}
@@ -1,141 +1,127 @@
1
- import { describe, it, expect } from "vitest";
2
- import { SmtpParamsSchema as schema } from "./SmtpParamsSchema.js";
1
+ import { describe, expect, it } from "vitest";
2
+ import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
3
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>"
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
10
  };
11
- describe("Smtp paramsSchema", () => {
12
- describe("valid inputs", () => {
13
- it("accepts a complete valid config", async () => {
14
- const result = await schema.safeParseAsync(validParams);
15
- expect(result.success).toBe(true);
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
+ });
16
30
  });
17
- it("accepts config without replyTo (it is optional)", async () => {
18
- const {
19
- replyTo: _,
20
- ...params
21
- } = validParams;
22
- const result = await schema.safeParseAsync(params);
23
- expect(result.success).toBe(true);
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
+ });
24
45
  });
25
- it("accepts bare addr-spec for from and replyTo", async () => {
26
- const result = await schema.safeParseAsync({
27
- ...validParams,
28
- from: "test@webiny.com",
29
- replyTo: "no-reply@webiny.com"
30
- });
31
- expect(result.success).toBe(true);
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
+ });
32
83
  });
33
- });
34
- describe("react-properties serialization bug", () => {
35
- // When process.env.SMTP_PASSWORD is undefined at build time,
36
- // react-properties' buildRoots treats value===undefined as "no value, build from
37
- // children". The password Property has no children, so buildRoots returns {}.
38
- // Zod then validates {} against z.string() → "expected string, received object".
39
- it("password={} reproduces the 'expected string, received object' error", async () => {
40
- const result = await schema.safeParseAsync({
41
- ...validParams,
42
- password: {}
43
- });
44
- expect(result.success).toBe(false);
45
- const issue = result.error?.issues[0];
46
- expect(issue?.code).toBe("invalid_type");
47
- expect(issue?.path).toEqual(["password"]);
48
- expect(issue?.message).toBe("Invalid input: expected string, received object");
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
+ });
49
106
  });
50
- });
51
- describe("required string fields", () => {
52
- it("rejects missing host", async () => {
53
- const {
54
- host: _,
55
- ...params
56
- } = validParams;
57
- const result = await schema.safeParseAsync(params);
58
- expect(result.success).toBe(false);
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
+ });
59
124
  });
60
- it("rejects empty host", async () => {
61
- const result = await schema.safeParseAsync({
62
- ...validParams,
63
- host: ""
64
- });
65
- expect(result.success).toBe(false);
66
- });
67
- it("rejects missing user", async () => {
68
- const {
69
- user: _,
70
- ...params
71
- } = validParams;
72
- const result = await schema.safeParseAsync(params);
73
- expect(result.success).toBe(false);
74
- });
75
- it("rejects empty user", async () => {
76
- const result = await schema.safeParseAsync({
77
- ...validParams,
78
- user: ""
79
- });
80
- expect(result.success).toBe(false);
81
- });
82
- it("rejects missing password", async () => {
83
- const {
84
- password: _,
85
- ...params
86
- } = validParams;
87
- const result = await schema.safeParseAsync(params);
88
- expect(result.success).toBe(false);
89
- });
90
- it("rejects empty password", async () => {
91
- const result = await schema.safeParseAsync({
92
- ...validParams,
93
- password: ""
94
- });
95
- expect(result.success).toBe(false);
96
- });
97
- });
98
- describe("port validation", () => {
99
- it("rejects port 0", async () => {
100
- const result = await schema.safeParseAsync({
101
- ...validParams,
102
- port: 0
103
- });
104
- expect(result.success).toBe(false);
105
- });
106
- it("rejects negative port", async () => {
107
- const result = await schema.safeParseAsync({
108
- ...validParams,
109
- port: -1
110
- });
111
- expect(result.success).toBe(false);
112
- });
113
- it("rejects fractional port", async () => {
114
- const result = await schema.safeParseAsync({
115
- ...validParams,
116
- port: 587.5
117
- });
118
- expect(result.success).toBe(false);
119
- });
120
- });
121
- describe("email address validation", () => {
122
- it("rejects invalid from address", async () => {
123
- const result = await schema.safeParseAsync({
124
- ...validParams,
125
- from: "not-an-email"
126
- });
127
- expect(result.success).toBe(false);
128
- expect(result.error?.issues[0].message).toBe("Invalid email address.");
129
- });
130
- it("rejects invalid replyTo address", async () => {
131
- const result = await schema.safeParseAsync({
132
- ...validParams,
133
- replyTo: "not-an-email"
134
- });
135
- expect(result.success).toBe(false);
136
- expect(result.error?.issues[0].message).toBe("Invalid email address.");
137
- });
138
- });
139
125
  });
140
126
 
141
127
  //# sourceMappingURL=Smtp.test.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["describe","it","expect","SmtpParamsSchema","schema","validParams","host","port","user","password","from","replyTo","result","safeParseAsync","success","toBe","_","params","issue","error","issues","code","path","toEqual","message"],"sources":["Smtp.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { SmtpParamsSchema as schema } from \"./SmtpParamsSchema.js\";\n\nconst validParams = {\n host: \"smtp.example.com\",\n port: 587,\n user: \"smtp-user\",\n password: \"secret\",\n from: \"Webiny <test@webiny.com>\",\n replyTo: \"No-reply <no-reply@webiny.com>\"\n};\n\ndescribe(\"Smtp paramsSchema\", () => {\n describe(\"valid inputs\", () => {\n it(\"accepts a complete valid config\", async () => {\n const result = await schema.safeParseAsync(validParams);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts config without replyTo (it is optional)\", async () => {\n const { replyTo: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts bare addr-spec for from and replyTo\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n from: \"test@webiny.com\",\n replyTo: \"no-reply@webiny.com\"\n });\n expect(result.success).toBe(true);\n });\n });\n\n describe(\"react-properties serialization bug\", () => {\n // When process.env.SMTP_PASSWORD is undefined at build time,\n // react-properties' buildRoots treats value===undefined as \"no value, build from\n // children\". The password Property has no children, so buildRoots returns {}.\n // Zod then validates {} against z.string() → \"expected string, received object\".\n it(\"password={} reproduces the 'expected string, received object' error\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: {} });\n expect(result.success).toBe(false);\n const issue = result.error?.issues[0];\n expect(issue?.code).toBe(\"invalid_type\");\n expect(issue?.path).toEqual([\"password\"]);\n expect(issue?.message).toBe(\"Invalid input: expected string, received object\");\n });\n });\n\n describe(\"required string fields\", () => {\n it(\"rejects missing host\", async () => {\n const { host: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty host\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, host: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing user\", async () => {\n const { user: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty user\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, user: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing password\", async () => {\n const { password: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty password\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: \"\" });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"port validation\", () => {\n it(\"rejects port 0\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 0 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects negative port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: -1 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects fractional port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 587.5 });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"email address validation\", () => {\n it(\"rejects invalid from address\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, from: \"not-an-email\" });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n\n it(\"rejects invalid replyTo address\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n replyTo: \"not-an-email\"\n });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,QAAQ;AAC7C,SAASC,gBAAgB,IAAIC,MAAM;AAEnC,MAAMC,WAAW,GAAG;EAChBC,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE,GAAG;EACTC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE,QAAQ;EAClBC,IAAI,EAAE,0BAA0B;EAChCC,OAAO,EAAE;AACb,CAAC;AAEDX,QAAQ,CAAC,mBAAmB,EAAE,MAAM;EAChCA,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC3BC,EAAE,CAAC,iCAAiC,EAAE,YAAY;MAC9C,MAAMW,MAAM,GAAG,MAAMR,MAAM,CAACS,cAAc,CAACR,WAAW,CAAC;MACvD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CAAC;IACtC,CAAC,CAAC;EACN,CAAC,CAAC;EAEFf,QAAQ,CAAC,0BAA0B,EAAE,MAAM;IACvCC,EAAE,CAAC,8BAA8B,EAAE,YAAY;MAC3C,MAAMW,MAAM,GAAG,MAAMR,MAAM,CAACS,cAAc,CAAC;QAAE,GAAGR,WAAW;QAAEK,IAAI,EAAE;MAAe,CAAC,CAAC;MACpFR,MAAM,CAACU,MAAM,CAACE,OAAO,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;MAClCb,MAAM,CAACU,MAAM,CAACO,KAAK,EAAEC,MAAM,CAAC,CAAC,CAAC,CAACI,OAAO,CAAC,CAACT,IAAI,CAAC,wBAAwB,CAAC;IAC1E,CAAC,CAAC;IAEFd,EAAE,CAAC,iCAAiC,EAAE,YAAY;MAC9C,MAAMW,MAAM,GAAG,MAAMR,MAAM,CAACS,cAAc,CAAC;QACvC,GAAGR,WAAW;QACdM,OAAO,EAAE;MACb,CAAC,CAAC;MACFT,MAAM,CAACU,MAAM,CAACE,OAAO,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;MAClCb,MAAM,CAACU,MAAM,CAACO,KAAK,EAAEC,MAAM,CAAC,CAAC,CAAC,CAACI,OAAO,CAAC,CAACT,IAAI,CAAC,wBAAwB,CAAC;IAC1E,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/Mailer/Smtp.test.js","sources":["../../../src/extensions/Mailer/Smtp.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { SmtpParamsSchema as schema } from \"./SmtpParamsSchema.js\";\n\nconst validParams = {\n host: \"smtp.example.com\",\n port: 587,\n user: \"smtp-user\",\n password: \"secret\",\n from: \"Webiny <test@webiny.com>\",\n replyTo: \"No-reply <no-reply@webiny.com>\"\n};\n\ndescribe(\"Smtp paramsSchema\", () => {\n describe(\"valid inputs\", () => {\n it(\"accepts a complete valid config\", async () => {\n const result = await schema.safeParseAsync(validParams);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts config without replyTo (it is optional)\", async () => {\n const { replyTo: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts bare addr-spec for from and replyTo\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n from: \"test@webiny.com\",\n replyTo: \"no-reply@webiny.com\"\n });\n expect(result.success).toBe(true);\n });\n });\n\n describe(\"react-properties serialization bug\", () => {\n // When process.env.SMTP_PASSWORD is undefined at build time,\n // react-properties' buildRoots treats value===undefined as \"no value, build from\n // children\". The password Property has no children, so buildRoots returns {}.\n // Zod then validates {} against z.string() → \"expected string, received object\".\n it(\"password={} reproduces the 'expected string, received object' error\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: {} });\n expect(result.success).toBe(false);\n const issue = result.error?.issues[0];\n expect(issue?.code).toBe(\"invalid_type\");\n expect(issue?.path).toEqual([\"password\"]);\n expect(issue?.message).toBe(\"Invalid input: expected string, received object\");\n });\n });\n\n describe(\"required string fields\", () => {\n it(\"rejects missing host\", async () => {\n const { host: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty host\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, host: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing user\", async () => {\n const { user: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty user\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, user: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing password\", async () => {\n const { password: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty password\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: \"\" });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"port validation\", () => {\n it(\"rejects port 0\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 0 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects negative port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: -1 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects fractional port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 587.5 });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"email address validation\", () => {\n it(\"rejects invalid from address\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, from: \"not-an-email\" });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n\n it(\"rejects invalid replyTo address\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n replyTo: \"not-an-email\"\n });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n });\n});\n"],"names":["validParams","describe","it","result","schema","expect","_","params","issue"],"mappings":";;AAGA,MAAMA,cAAc;IAChB,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;AACb;AAEAC,SAAS,qBAAqB;IAC1BA,SAAS,gBAAgB;QACrBC,GAAG,mCAAmC;YAClC,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAACJ;YAC3CK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,mDAAmD;YAClD,MAAM,EAAE,SAASI,CAAC,EAAE,GAAGC,QAAQ,GAAGP;YAClC,MAAMG,SAAS,MAAMC,iBAAAA,cAAqB,CAACG;YAC3CF,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,+CAA+C;YAC9C,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBACvC,GAAGJ,WAAW;gBACd,MAAM;gBACN,SAAS;YACb;YACAK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;IACJ;IAEAF,SAAS,sCAAsC;QAK3CC,GAAG,uEAAuE;YACtE,MAAMC,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
3
-
4
- // Accept both addr-spec ("foo@bar.com") and name-addr ("Foo <foo@bar.com>") forms.
5
- const isMailboxAddress = value => {
6
- return emailAddresses.parseOneAddress(value) !== null;
7
- };
2
+ import email_addresses from "email-addresses";
3
+ const isMailboxAddress = (value)=>null !== email_addresses.parseOneAddress(value);
8
4
  const mailboxAddress = z.string().refine(isMailboxAddress, {
9
- message: "Invalid email address."
5
+ message: "Invalid email address."
10
6
  });
11
- export const SmtpParamsSchema = z.object({
12
- host: z.string().min(1).describe("SMTP server hostname."),
13
- port: z.number().int().positive().describe("SMTP server port."),
14
- user: z.string().min(1).describe("SMTP authentication username."),
15
- password: z.string().min(1).describe("SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code."),
16
- from: mailboxAddress.describe("Default 'from' address."),
17
- replyTo: mailboxAddress.optional().describe("Default 'reply-to' address.")
7
+ const SmtpParamsSchema = z.object({
8
+ host: z.string().min(1).describe("SMTP server hostname."),
9
+ port: z.number().int().positive().describe("SMTP server port."),
10
+ user: z.string().min(1).describe("SMTP authentication username."),
11
+ password: z.string().min(1).describe("SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code."),
12
+ from: mailboxAddress.describe("Default 'from' address."),
13
+ replyTo: mailboxAddress.optional().describe("Default 'reply-to' address.")
18
14
  });
15
+ export { SmtpParamsSchema };
19
16
 
20
17
  //# sourceMappingURL=SmtpParamsSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["z","emailAddresses","isMailboxAddress","value","parseOneAddress","mailboxAddress","string","refine","message","SmtpParamsSchema","object","host","min","describe","port","number","int","positive","user","password","from","replyTo","optional"],"sources":["SmtpParamsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport emailAddresses from \"email-addresses\";\n\n// Accept both addr-spec (\"foo@bar.com\") and name-addr (\"Foo <foo@bar.com>\") forms.\nconst isMailboxAddress = (value: string): boolean => {\n return emailAddresses.parseOneAddress(value) !== null;\n};\n\nconst mailboxAddress = z.string().refine(isMailboxAddress, { message: \"Invalid email address.\" });\n\nexport const SmtpParamsSchema = z.object({\n host: z.string().min(1).describe(\"SMTP server hostname.\"),\n port: z.number().int().positive().describe(\"SMTP server port.\"),\n user: z.string().min(1).describe(\"SMTP authentication username.\"),\n password: z\n .string()\n .min(1)\n .describe(\n \"SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code.\"\n ),\n from: mailboxAddress.describe(\"Default 'from' address.\"),\n replyTo: mailboxAddress.optional().describe(\"Default 'reply-to' address.\")\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,OAAOC,cAAc,MAAM,iBAAiB;;AAE5C;AACA,MAAMC,gBAAgB,GAAIC,KAAa,IAAc;EACjD,OAAOF,cAAc,CAACG,eAAe,CAACD,KAAK,CAAC,KAAK,IAAI;AACzD,CAAC;AAED,MAAME,cAAc,GAAGL,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,MAAM,CAACL,gBAAgB,EAAE;EAAEM,OAAO,EAAE;AAAyB,CAAC,CAAC;AAEjG,OAAO,MAAMC,gBAAgB,GAAGT,CAAC,CAACU,MAAM,CAAC;EACrCC,IAAI,EAAEX,CAAC,CAACM,MAAM,CAAC,CAAC,CAACM,GAAG,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,uBAAuB,CAAC;EACzDC,IAAI,EAAEd,CAAC,CAACe,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACJ,QAAQ,CAAC,mBAAmB,CAAC;EAC/DK,IAAI,EAAElB,CAAC,CAACM,MAAM,CAAC,CAAC,CAACM,GAAG,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,+BAA+B,CAAC;EACjEM,QAAQ,EAAEnB,CAAC,CACNM,MAAM,CAAC,CAAC,CACRM,GAAG,CAAC,CAAC,CAAC,CACNC,QAAQ,CACL,sGACJ,CAAC;EACLO,IAAI,EAAEf,cAAc,CAACQ,QAAQ,CAAC,yBAAyB,CAAC;EACxDQ,OAAO,EAAEhB,cAAc,CAACiB,QAAQ,CAAC,CAAC,CAACT,QAAQ,CAAC,6BAA6B;AAC7E,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extensions/Mailer/SmtpParamsSchema.js","sources":["../../../src/extensions/Mailer/SmtpParamsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport emailAddresses from \"email-addresses\";\n\n// Accept both addr-spec (\"foo@bar.com\") and name-addr (\"Foo <foo@bar.com>\") forms.\nconst isMailboxAddress = (value: string): boolean => {\n return emailAddresses.parseOneAddress(value) !== null;\n};\n\nconst mailboxAddress = z.string().refine(isMailboxAddress, { message: \"Invalid email address.\" });\n\nexport const SmtpParamsSchema = z.object({\n host: z.string().min(1).describe(\"SMTP server hostname.\"),\n port: z.number().int().positive().describe(\"SMTP server port.\"),\n user: z.string().min(1).describe(\"SMTP authentication username.\"),\n password: z\n .string()\n .min(1)\n .describe(\n \"SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code.\"\n ),\n from: mailboxAddress.describe(\"Default 'from' address.\"),\n replyTo: mailboxAddress.optional().describe(\"Default 'reply-to' address.\")\n});\n"],"names":["isMailboxAddress","value","emailAddresses","mailboxAddress","z","SmtpParamsSchema"],"mappings":";;AAIA,MAAMA,mBAAmB,CAACC,QACfC,AAA0C,SAA1CA,gBAAAA,eAA8B,CAACD;AAG1C,MAAME,iBAAiBC,EAAE,MAAM,GAAG,MAAM,CAACJ,kBAAkB;IAAE,SAAS;AAAyB;AAExF,MAAMK,mBAAmBD,EAAE,MAAM,CAAC;IACrC,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,MAAMA,EAAE,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,UAAUA,EAAAA,MACC,GACN,GAAG,CAAC,GACJ,QAAQ,CACL;IAER,MAAMD,eAAe,QAAQ,CAAC;IAC9B,SAASA,eAAe,QAAQ,GAAG,QAAQ,CAAC;AAChD"}