@webiny/pulumi-aws 6.0.0-alpha.0 → 6.0.0-alpha.1

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 (191) hide show
  1. package/apps/admin/createAdminPulumiApp.d.ts +3 -2
  2. package/apps/admin/createAdminPulumiApp.js +1 -0
  3. package/apps/admin/createAdminPulumiApp.js.map +1 -1
  4. package/apps/api/ApiApwScheduler.d.ts +1 -1
  5. package/apps/api/ApiApwScheduler.js.map +1 -1
  6. package/apps/api/ApiBackgroundTask.d.ts +1 -1
  7. package/apps/api/ApiBackgroundTask.js.map +1 -1
  8. package/apps/api/ApiCloudfront.d.ts +1 -1
  9. package/apps/api/ApiCloudfront.js.map +1 -1
  10. package/apps/api/ApiFileManager.d.ts +7 -1
  11. package/apps/api/ApiFileManager.js +6 -0
  12. package/apps/api/ApiFileManager.js.map +1 -1
  13. package/apps/api/ApiGateway.d.ts +2 -2
  14. package/apps/api/ApiGateway.js.map +1 -1
  15. package/apps/api/ApiGraphql.d.ts +1 -1
  16. package/apps/api/ApiGraphql.js.map +1 -1
  17. package/apps/api/ApiMigration.d.ts +1 -1
  18. package/apps/api/ApiMigration.js.map +1 -1
  19. package/apps/api/ApiOutput.d.ts +11 -1
  20. package/apps/api/ApiOutput.js +11 -1
  21. package/apps/api/ApiOutput.js.map +1 -1
  22. package/apps/api/ApiPageBuilder.d.ts +1 -1
  23. package/apps/api/ApiPageBuilder.js.map +1 -1
  24. package/apps/api/ApiScheduler.d.ts +8 -0
  25. package/apps/api/ApiScheduler.js +105 -0
  26. package/apps/api/ApiScheduler.js.map +1 -0
  27. package/apps/api/ApiWebsocket.d.ts +1 -1
  28. package/apps/api/ApiWebsocket.js.map +1 -1
  29. package/apps/api/backgroundTask/definition.d.ts +2 -2
  30. package/apps/api/backgroundTask/definition.js.map +1 -1
  31. package/apps/api/backgroundTask/policy.d.ts +2 -2
  32. package/apps/api/backgroundTask/policy.js.map +1 -1
  33. package/apps/api/backgroundTask/role.d.ts +2 -2
  34. package/apps/api/backgroundTask/role.js.map +1 -1
  35. package/apps/api/backgroundTask/types.d.ts +1 -1
  36. package/apps/api/backgroundTask/types.js.map +1 -1
  37. package/apps/api/createApiPulumiApp.d.ts +19 -13
  38. package/apps/api/createApiPulumiApp.js +50 -19
  39. package/apps/api/createApiPulumiApp.js.map +1 -1
  40. package/apps/awsUtils.d.ts +1 -1
  41. package/apps/awsUtils.js.map +1 -1
  42. package/apps/blueGreen/createBlueGreenPulumiApp.d.ts +7 -1
  43. package/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  44. package/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  45. package/apps/blueGreen/domains/attachDomainsToOutput.d.ts +1 -1
  46. package/apps/blueGreen/domains/attachDomainsToOutput.js.map +1 -1
  47. package/apps/blueGreen/types.d.ts +4 -1
  48. package/apps/blueGreen/types.js.map +1 -1
  49. package/apps/common/CoreOutput.d.ts +2 -1
  50. package/apps/common/CoreOutput.js +1 -0
  51. package/apps/common/CoreOutput.js.map +1 -1
  52. package/apps/common/VpcConfig.d.ts +1 -1
  53. package/apps/common/VpcConfig.js.map +1 -1
  54. package/apps/core/CoreCognito.d.ts +1 -1
  55. package/apps/core/CoreCognito.js.map +1 -1
  56. package/apps/core/CoreDynamo.d.ts +1 -1
  57. package/apps/core/CoreDynamo.js.map +1 -1
  58. package/apps/core/CoreElasticSearch.d.ts +1 -1
  59. package/apps/core/CoreElasticSearch.js +7 -1
  60. package/apps/core/CoreElasticSearch.js.map +1 -1
  61. package/apps/core/CoreEventBus.js.map +1 -1
  62. package/apps/core/CoreFileManager.d.ts +1 -1
  63. package/apps/core/CoreFileManager.js.map +1 -1
  64. package/apps/core/CoreOpenSearch.d.ts +1 -1
  65. package/apps/core/CoreOpenSearch.js +7 -1
  66. package/apps/core/CoreOpenSearch.js.map +1 -1
  67. package/apps/core/CoreVpc.d.ts +1 -1
  68. package/apps/core/CoreVpc.js.map +1 -1
  69. package/apps/core/LogDynamo.d.ts +1 -1
  70. package/apps/core/LogDynamo.js.map +1 -1
  71. package/apps/core/WatchCommand.js.map +1 -1
  72. package/apps/core/cognitoIdentityProviders/amazon.d.ts +3 -3
  73. package/apps/core/cognitoIdentityProviders/amazon.js.map +1 -1
  74. package/apps/core/cognitoIdentityProviders/apple.d.ts +3 -3
  75. package/apps/core/cognitoIdentityProviders/apple.js.map +1 -1
  76. package/apps/core/cognitoIdentityProviders/configure.d.ts +3 -3
  77. package/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
  78. package/apps/core/cognitoIdentityProviders/facebook.d.ts +3 -3
  79. package/apps/core/cognitoIdentityProviders/facebook.js.map +1 -1
  80. package/apps/core/cognitoIdentityProviders/getIdpConfig.d.ts +2 -2
  81. package/apps/core/cognitoIdentityProviders/getIdpConfig.js.map +1 -1
  82. package/apps/core/cognitoIdentityProviders/google.d.ts +3 -3
  83. package/apps/core/cognitoIdentityProviders/google.js.map +1 -1
  84. package/apps/core/cognitoIdentityProviders/oidc.d.ts +3 -3
  85. package/apps/core/cognitoIdentityProviders/oidc.js.map +1 -1
  86. package/apps/core/createCorePulumiApp.d.ts +1 -1
  87. package/apps/core/createCorePulumiApp.js +2 -1
  88. package/apps/core/createCorePulumiApp.js.map +1 -1
  89. package/apps/createAppBucket.d.ts +1 -1
  90. package/apps/createAppBucket.js.map +1 -1
  91. package/apps/customDomain.d.ts +3 -3
  92. package/apps/customDomain.js.map +1 -1
  93. package/apps/lambdaUtils.d.ts +3 -2
  94. package/apps/lambdaUtils.js +21 -3
  95. package/apps/lambdaUtils.js.map +1 -1
  96. package/apps/react/createReactPulumiApp.d.ts +2 -2
  97. package/apps/react/createReactPulumiApp.js.map +1 -1
  98. package/apps/syncSystem/SyncSystemDynamo.d.ts +1 -1
  99. package/apps/syncSystem/SyncSystemDynamo.js.map +1 -1
  100. package/apps/syncSystem/SyncSystemDynamoDb.d.ts +3 -0
  101. package/apps/syncSystem/SyncSystemDynamoDb.js +55 -0
  102. package/apps/syncSystem/SyncSystemDynamoDb.js.map +1 -0
  103. package/apps/syncSystem/SyncSystemEventBus.d.ts +6 -0
  104. package/apps/syncSystem/SyncSystemEventBus.js +84 -0
  105. package/apps/syncSystem/SyncSystemEventBus.js.map +1 -0
  106. package/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
  107. package/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  108. package/apps/syncSystem/SyncSystemOutput.d.ts +3 -0
  109. package/apps/syncSystem/SyncSystemOutput.js +26 -0
  110. package/apps/syncSystem/SyncSystemOutput.js.map +1 -0
  111. package/apps/syncSystem/SyncSystemResolverLambda.d.ts +8 -0
  112. package/apps/syncSystem/SyncSystemResolverLambda.js +78 -0
  113. package/apps/syncSystem/SyncSystemResolverLambda.js.map +1 -0
  114. package/apps/syncSystem/SyncSystemSQS.d.ts +3 -4
  115. package/apps/syncSystem/SyncSystemSQS.js +33 -12
  116. package/apps/syncSystem/SyncSystemSQS.js.map +1 -1
  117. package/apps/syncSystem/SyncSystemWorkerLambda.d.ts +7 -0
  118. package/apps/syncSystem/SyncSystemWorkerLambda.js +57 -0
  119. package/apps/syncSystem/SyncSystemWorkerLambda.js.map +1 -0
  120. package/apps/syncSystem/api/addServiceManifest.d.ts +8 -0
  121. package/apps/syncSystem/api/addServiceManifest.js +25 -0
  122. package/apps/syncSystem/api/addServiceManifest.js.map +1 -0
  123. package/apps/syncSystem/api/attachCognitoPermissions.d.ts +14 -0
  124. package/apps/syncSystem/api/attachCognitoPermissions.js +67 -0
  125. package/apps/syncSystem/api/attachCognitoPermissions.js.map +1 -0
  126. package/apps/syncSystem/api/attachDynamoDbPermissions.d.ts +13 -0
  127. package/apps/syncSystem/api/attachDynamoDbPermissions.js +53 -0
  128. package/apps/syncSystem/api/attachDynamoDbPermissions.js.map +1 -0
  129. package/apps/syncSystem/api/attachEventBusPermissions.d.ts +18 -0
  130. package/apps/syncSystem/api/attachEventBusPermissions.js +66 -0
  131. package/apps/syncSystem/api/attachEventBusPermissions.js.map +1 -0
  132. package/apps/syncSystem/api/attachS3Permissions.d.ts +14 -0
  133. package/apps/syncSystem/api/attachS3Permissions.js +59 -0
  134. package/apps/syncSystem/api/attachS3Permissions.js.map +1 -0
  135. package/apps/syncSystem/api/index.d.ts +9 -0
  136. package/apps/syncSystem/api/index.js +65 -0
  137. package/apps/syncSystem/api/index.js.map +1 -0
  138. package/apps/syncSystem/constants.d.ts +1 -0
  139. package/apps/syncSystem/constants.js +9 -0
  140. package/apps/syncSystem/constants.js.map +1 -0
  141. package/apps/syncSystem/createSyncResourceName.d.ts +4 -0
  142. package/apps/syncSystem/createSyncResourceName.js +17 -0
  143. package/apps/syncSystem/createSyncResourceName.js.map +1 -0
  144. package/apps/syncSystem/createSyncSystemPulumiApp.d.ts +19 -10
  145. package/apps/syncSystem/createSyncSystemPulumiApp.js +107 -34
  146. package/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  147. package/apps/syncSystem/customApp.d.ts +6 -0
  148. package/apps/syncSystem/customApp.js +26 -0
  149. package/apps/syncSystem/customApp.js.map +1 -0
  150. package/apps/syncSystem/getSyncSystemOutput.d.ts +6 -0
  151. package/apps/syncSystem/getSyncSystemOutput.js +28 -0
  152. package/apps/syncSystem/getSyncSystemOutput.js.map +1 -0
  153. package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.d.ts +7 -0
  154. package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +55 -0
  155. package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js.map +1 -0
  156. package/apps/syncSystem/types.d.ts +55 -0
  157. package/apps/syncSystem/types.js +7 -0
  158. package/apps/syncSystem/types.js.map +1 -0
  159. package/apps/tenantRouter.d.ts +1 -1
  160. package/apps/tenantRouter.js.map +1 -1
  161. package/apps/website/WebsitePrerendering.d.ts +1 -1
  162. package/apps/website/WebsitePrerendering.js.map +1 -1
  163. package/apps/website/createWebsitePulumiApp.d.ts +2 -2
  164. package/apps/website/createWebsitePulumiApp.js.map +1 -1
  165. package/enterprise/api/handleGuardDutyEvents.d.ts +1 -1
  166. package/enterprise/api/handleGuardDutyEvents.js.map +1 -1
  167. package/enterprise/createApiPulumiApp.d.ts +13 -2
  168. package/enterprise/createApiPulumiApp.js.map +1 -1
  169. package/enterprise/createCorePulumiApp.d.ts +2 -2
  170. package/enterprise/createCorePulumiApp.js.map +1 -1
  171. package/enterprise/createSyncSystemPulumiApp.d.ts +13 -8
  172. package/enterprise/createSyncSystemPulumiApp.js +1 -1
  173. package/enterprise/createSyncSystemPulumiApp.js.map +1 -1
  174. package/enterprise/createWebsitePulumiApp.d.ts +2 -2
  175. package/enterprise/createWebsitePulumiApp.js.map +1 -1
  176. package/package.json +12 -12
  177. package/utils/addDomainsUrlsOutputs.d.ts +2 -2
  178. package/utils/addDomainsUrlsOutputs.js.map +1 -1
  179. package/utils/addServiceManifestTableItem.d.ts +1 -1
  180. package/utils/addServiceManifestTableItem.js.map +1 -1
  181. package/utils/createAssetArchive.d.ts +2 -0
  182. package/utils/createAssetArchive.js +16 -0
  183. package/utils/createAssetArchive.js.map +1 -0
  184. package/utils/getPresignedPost.d.ts +1 -1
  185. package/utils/getPresignedPost.js.map +1 -1
  186. package/utils/lambdaEnvVariables.d.ts +1 -1
  187. package/utils/lambdaEnvVariables.js.map +1 -1
  188. package/utils/uploadFolderToS3.d.ts +1 -1
  189. package/utils/uploadFolderToS3.js.map +1 -1
  190. package/utils/withServiceManifest.d.ts +2 -2
  191. package/utils/withServiceManifest.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/pulumi-aws",
3
- "version": "6.0.0-alpha.0",
3
+ "version": "6.0.0-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/webiny/webiny-js.git"
@@ -16,22 +16,22 @@
16
16
  "@pulumi/aws": "6.67.0",
17
17
  "@pulumi/pulumi": "3.147.0",
18
18
  "@pulumi/random": "4.17.0",
19
- "@webiny/aws-sdk": "6.0.0-alpha.0",
20
- "@webiny/cli-plugin-deploy-pulumi": "6.0.0-alpha.0",
21
- "@webiny/pulumi": "6.0.0-alpha.0",
22
- "@webiny/utils": "6.0.0-alpha.0",
23
- "@webiny/wcp": "6.0.0-alpha.0",
19
+ "@webiny/aws-sdk": "6.0.0-alpha.1",
20
+ "@webiny/cli-plugin-deploy-pulumi": "6.0.0-alpha.1",
21
+ "@webiny/pulumi": "6.0.0-alpha.1",
22
+ "@webiny/utils": "6.0.0-alpha.1",
23
+ "@webiny/wcp": "6.0.0-alpha.1",
24
24
  "form-data": "4.0.0",
25
25
  "lodash": "4.17.21",
26
26
  "node-fetch": "2.6.7",
27
27
  "zod": "3.23.8"
28
28
  },
29
29
  "devDependencies": {
30
- "@webiny/api-page-builder": "6.0.0-alpha.0",
31
- "@webiny/aws-layers": "6.0.0-alpha.0",
32
- "@webiny/cli": "6.0.0-alpha.0",
33
- "@webiny/feature-flags": "6.0.0-alpha.0",
34
- "@webiny/project-utils": "6.0.0-alpha.0",
30
+ "@webiny/api-page-builder": "6.0.0-alpha.1",
31
+ "@webiny/aws-layers": "6.0.0-alpha.1",
32
+ "@webiny/cli": "6.0.0-alpha.1",
33
+ "@webiny/feature-flags": "6.0.0-alpha.1",
34
+ "@webiny/project-utils": "6.0.0-alpha.1",
35
35
  "chalk": "4.1.2",
36
36
  "mime": "3.0.0",
37
37
  "rimraf": "6.0.1",
@@ -54,5 +54,5 @@
54
54
  ]
55
55
  }
56
56
  },
57
- "gitHead": "a5b28fed7a242d8f56712197a8ea83aa6d2ed101"
57
+ "gitHead": "9bd236cf5e689f209a11bec089207dcc2d41a53c"
58
58
  }
@@ -1,5 +1,5 @@
1
- import * as aws from "@pulumi/aws";
2
- import { PulumiApp, PulumiAppResource } from "@webiny/pulumi";
1
+ import type * as aws from "@pulumi/aws";
2
+ import type { PulumiApp, PulumiAppResource } from "@webiny/pulumi";
3
3
  interface AddDomainsUrlsOutputsParams {
4
4
  cloudfrontDistribution: PulumiAppResource<typeof aws.cloudfront.Distribution>;
5
5
  app: PulumiApp;
@@ -1 +1 @@
1
- {"version":3,"names":["pulumi","_interopRequireWildcard","require","addDomainsUrlsOutputs","params","cloudfrontDistribution","app","map","distributionDomain","output","domainName","distributionUrl","apply","value","addOutputs","usedDomain","usedUrl","config","aliases","firstAlias","exports"],"sources":["addDomainsUrlsOutputs.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport { PulumiApp, PulumiAppResource } from \"@webiny/pulumi\";\n\ninterface AddDomainsUrlsOutputsParams {\n cloudfrontDistribution: PulumiAppResource<typeof aws.cloudfront.Distribution>;\n app: PulumiApp;\n map: {\n distributionDomain: string;\n distributionUrl: string;\n usedDomain: string;\n usedUrl: string;\n };\n}\n\n/**\n * Based on the provided Cloudfront distribution and map,\n * adds domain and URL-related values to final stack output.\n */\nexport const addDomainsUrlsOutputs = (params: AddDomainsUrlsOutputsParams) => {\n const { cloudfrontDistribution, app, map } = params;\n\n // These will always contain the default Cloudfront domain,\n // no matter if the user provided a custom domain or not.\n const distributionDomain = cloudfrontDistribution.output.domainName;\n const distributionUrl = distributionDomain.apply(value => `https://${value}`);\n\n app.addOutputs({\n [map.distributionDomain]: distributionDomain,\n [map.distributionUrl]: distributionUrl,\n\n // These will contain a custom domain if provided,\n // otherwise again the default Cloudfront domain.\n [map.usedDomain]: distributionDomain,\n [map.usedUrl]: distributionUrl\n });\n\n // We're adjusting the outputs via the `config.aliases` setter.\n // At the time of implementing this, could not find a better solution.\n cloudfrontDistribution.config.aliases(aliases => {\n const [firstAlias] = aliases || [];\n if (firstAlias) {\n app.addOutputs({\n [map.usedDomain]: pulumi.output(firstAlias),\n [map.usedUrl]: pulumi.output(`https://${firstAlias}`)\n });\n }\n\n return aliases;\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAIC,MAAmC,IAAK;EAC1E,MAAM;IAAEC,sBAAsB;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGH,MAAM;;EAEnD;EACA;EACA,MAAMI,kBAAkB,GAAGH,sBAAsB,CAACI,MAAM,CAACC,UAAU;EACnE,MAAMC,eAAe,GAAGH,kBAAkB,CAACI,KAAK,CAACC,KAAK,IAAI,WAAWA,KAAK,EAAE,CAAC;EAE7EP,GAAG,CAACQ,UAAU,CAAC;IACX,CAACP,GAAG,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,CAACD,GAAG,CAACI,eAAe,GAAGA,eAAe;IAEtC;IACA;IACA,CAACJ,GAAG,CAACQ,UAAU,GAAGP,kBAAkB;IACpC,CAACD,GAAG,CAACS,OAAO,GAAGL;EACnB,CAAC,CAAC;;EAEF;EACA;EACAN,sBAAsB,CAACY,MAAM,CAACC,OAAO,CAACA,OAAO,IAAI;IAC7C,MAAM,CAACC,UAAU,CAAC,GAAGD,OAAO,IAAI,EAAE;IAClC,IAAIC,UAAU,EAAE;MACZb,GAAG,CAACQ,UAAU,CAAC;QACX,CAACP,GAAG,CAACQ,UAAU,GAAGf,MAAM,CAACS,MAAM,CAACU,UAAU,CAAC;QAC3C,CAACZ,GAAG,CAACS,OAAO,GAAGhB,MAAM,CAACS,MAAM,CAAC,WAAWU,UAAU,EAAE;MACxD,CAAC,CAAC;IACN;IAEA,OAAOD,OAAO;EAClB,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["pulumi","_interopRequireWildcard","require","addDomainsUrlsOutputs","params","cloudfrontDistribution","app","map","distributionDomain","output","domainName","distributionUrl","apply","value","addOutputs","usedDomain","usedUrl","config","aliases","firstAlias","exports"],"sources":["addDomainsUrlsOutputs.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppResource } from \"@webiny/pulumi\";\n\ninterface AddDomainsUrlsOutputsParams {\n cloudfrontDistribution: PulumiAppResource<typeof aws.cloudfront.Distribution>;\n app: PulumiApp;\n map: {\n distributionDomain: string;\n distributionUrl: string;\n usedDomain: string;\n usedUrl: string;\n };\n}\n\n/**\n * Based on the provided Cloudfront distribution and map,\n * adds domain and URL-related values to final stack output.\n */\nexport const addDomainsUrlsOutputs = (params: AddDomainsUrlsOutputsParams) => {\n const { cloudfrontDistribution, app, map } = params;\n\n // These will always contain the default Cloudfront domain,\n // no matter if the user provided a custom domain or not.\n const distributionDomain = cloudfrontDistribution.output.domainName;\n const distributionUrl = distributionDomain.apply(value => `https://${value}`);\n\n app.addOutputs({\n [map.distributionDomain]: distributionDomain,\n [map.distributionUrl]: distributionUrl,\n\n // These will contain a custom domain if provided,\n // otherwise again the default Cloudfront domain.\n [map.usedDomain]: distributionDomain,\n [map.usedUrl]: distributionUrl\n });\n\n // We're adjusting the outputs via the `config.aliases` setter.\n // At the time of implementing this, could not find a better solution.\n cloudfrontDistribution.config.aliases(aliases => {\n const [firstAlias] = aliases || [];\n if (firstAlias) {\n app.addOutputs({\n [map.usedDomain]: pulumi.output(firstAlias),\n [map.usedUrl]: pulumi.output(`https://${firstAlias}`)\n });\n }\n\n return aliases;\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAIC,MAAmC,IAAK;EAC1E,MAAM;IAAEC,sBAAsB;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGH,MAAM;;EAEnD;EACA;EACA,MAAMI,kBAAkB,GAAGH,sBAAsB,CAACI,MAAM,CAACC,UAAU;EACnE,MAAMC,eAAe,GAAGH,kBAAkB,CAACI,KAAK,CAACC,KAAK,IAAI,WAAWA,KAAK,EAAE,CAAC;EAE7EP,GAAG,CAACQ,UAAU,CAAC;IACX,CAACP,GAAG,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,CAACD,GAAG,CAACI,eAAe,GAAGA,eAAe;IAEtC;IACA;IACA,CAACJ,GAAG,CAACQ,UAAU,GAAGP,kBAAkB;IACpC,CAACD,GAAG,CAACS,OAAO,GAAGL;EACnB,CAAC,CAAC;;EAEF;EACA;EACAN,sBAAsB,CAACY,MAAM,CAACC,OAAO,CAACA,OAAO,IAAI;IAC7C,MAAM,CAACC,UAAU,CAAC,GAAGD,OAAO,IAAI,EAAE;IAClC,IAAIC,UAAU,EAAE;MACZb,GAAG,CAACQ,UAAU,CAAC;QACX,CAACP,GAAG,CAACQ,UAAU,GAAGf,MAAM,CAACS,MAAM,CAACU,UAAU,CAAC;QAC3C,CAACZ,GAAG,CAACS,OAAO,GAAGhB,MAAM,CAACS,MAAM,CAAC,WAAWU,UAAU,EAAE;MACxD,CAAC,CAAC;IACN;IAEA,OAAOD,OAAO;EAClB,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
- import { PulumiApp } from "@webiny/pulumi";
2
+ import type { PulumiApp } from "@webiny/pulumi";
3
3
  export interface ServiceManifest {
4
4
  name: string;
5
5
  manifest: Record<string, any>;
@@ -1 +1 @@
1
- {"version":3,"names":["pulumi","_interopRequireWildcard","require","aws","_clientDynamodb","addServiceManifestTableItem","app","table","manifest","rangeKey","apply","res","dynamodb","TableItem","name","tableName","hashKey","item","all","interpolate","JSON","stringify","v","marshall","parse","exports"],"sources":["addServiceManifestTableItem.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport { PulumiApp } from \"@webiny/pulumi\";\nimport { marshall } from \"@webiny/aws-sdk/client-dynamodb\";\n\nexport interface ServiceManifest {\n name: string;\n manifest: Record<string, any>;\n}\n\nexport interface TableDefinition {\n tableName: pulumi.Output<string>;\n hashKey: pulumi.Output<string>;\n rangeKey: pulumi.Output<string | undefined>;\n}\n\nexport const addServiceManifestTableItem = (\n app: PulumiApp,\n table: TableDefinition,\n manifest: ServiceManifest\n) => {\n table.rangeKey.apply(res => {\n new aws.dynamodb.TableItem(manifest.name, {\n tableName: table.tableName,\n hashKey: table.hashKey,\n rangeKey: res,\n item: pulumi\n .all(manifest.manifest)\n .apply(res => {\n return pulumi.interpolate`{\n \"PK\": \"SERVICE_MANIFEST#${app.name}#${manifest.name}\",\n \"SK\": \"default\",\n \"GSI1_PK\": \"SERVICE_MANIFESTS\",\n \"GSI1_SK\": \"${app.name}#${manifest.name}\",\n \"data\": {\n \"name\": \"${manifest.name}\",\n \"manifest\": ${JSON.stringify(res)}\n }\n }`;\n })\n // We're using the native DynamoDB converter to avoid building those nested objects ourselves.\n .apply(v => JSON.stringify(marshall(JSON.parse(v))))\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,uBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAaO,MAAMG,2BAA2B,GAAGA,CACvCC,GAAc,EACdC,KAAsB,EACtBC,QAAyB,KACxB;EACDD,KAAK,CAACE,QAAQ,CAACC,KAAK,CAACC,GAAG,IAAI;IACxB,IAAIR,GAAG,CAACS,QAAQ,CAACC,SAAS,CAACL,QAAQ,CAACM,IAAI,EAAE;MACtCC,SAAS,EAAER,KAAK,CAACQ,SAAS;MAC1BC,OAAO,EAAET,KAAK,CAACS,OAAO;MACtBP,QAAQ,EAAEE,GAAG;MACbM,IAAI,EAAEjB,MAAM,CACPkB,GAAG,CAACV,QAAQ,CAACA,QAAQ,CAAC,CACtBE,KAAK,CAACC,GAAG,IAAI;QACV,OAAOX,MAAM,CAACmB,WAAW;AAC7C,0CAA0Cb,GAAG,CAACQ,IAAI,IAAIN,QAAQ,CAACM,IAAI;AACnE;AACA;AACA,8BAA8BR,GAAG,CAACQ,IAAI,IAAIN,QAAQ,CAACM,IAAI;AACvD;AACA,+BAA+BN,QAAQ,CAACM,IAAI;AAC5C,kCAAkCM,IAAI,CAACC,SAAS,CAACV,GAAG,CAAC;AACrD;AACA,cAAc;MACE,CAAC;MACD;MAAA,CACCD,KAAK,CAACY,CAAC,IAAIF,IAAI,CAACC,SAAS,CAAC,IAAAE,wBAAQ,EAACH,IAAI,CAACI,KAAK,CAACF,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACG,OAAA,CAAApB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["pulumi","_interopRequireWildcard","require","aws","_clientDynamodb","addServiceManifestTableItem","app","table","manifest","rangeKey","apply","res","dynamodb","TableItem","name","tableName","hashKey","item","all","interpolate","JSON","stringify","v","marshall","parse","exports"],"sources":["addServiceManifestTableItem.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport { marshall } from \"@webiny/aws-sdk/client-dynamodb\";\n\nexport interface ServiceManifest {\n name: string;\n manifest: Record<string, any>;\n}\n\nexport interface TableDefinition {\n tableName: pulumi.Output<string>;\n hashKey: pulumi.Output<string>;\n rangeKey: pulumi.Output<string | undefined>;\n}\n\nexport const addServiceManifestTableItem = (\n app: PulumiApp,\n table: TableDefinition,\n manifest: ServiceManifest\n) => {\n table.rangeKey.apply(res => {\n new aws.dynamodb.TableItem(manifest.name, {\n tableName: table.tableName,\n hashKey: table.hashKey,\n rangeKey: res,\n item: pulumi\n .all(manifest.manifest)\n .apply(res => {\n return pulumi.interpolate`{\n \"PK\": \"SERVICE_MANIFEST#${app.name}#${manifest.name}\",\n \"SK\": \"default\",\n \"GSI1_PK\": \"SERVICE_MANIFESTS\",\n \"GSI1_SK\": \"${app.name}#${manifest.name}\",\n \"data\": {\n \"name\": \"${manifest.name}\",\n \"manifest\": ${JSON.stringify(res)}\n }\n }`;\n })\n // We're using the native DynamoDB converter to avoid building those nested objects ourselves.\n .apply(v => JSON.stringify(marshall(JSON.parse(v))))\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,uBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAaO,MAAMG,2BAA2B,GAAGA,CACvCC,GAAc,EACdC,KAAsB,EACtBC,QAAyB,KACxB;EACDD,KAAK,CAACE,QAAQ,CAACC,KAAK,CAACC,GAAG,IAAI;IACxB,IAAIR,GAAG,CAACS,QAAQ,CAACC,SAAS,CAACL,QAAQ,CAACM,IAAI,EAAE;MACtCC,SAAS,EAAER,KAAK,CAACQ,SAAS;MAC1BC,OAAO,EAAET,KAAK,CAACS,OAAO;MACtBP,QAAQ,EAAEE,GAAG;MACbM,IAAI,EAAEjB,MAAM,CACPkB,GAAG,CAACV,QAAQ,CAACA,QAAQ,CAAC,CACtBE,KAAK,CAACC,GAAG,IAAI;QACV,OAAOX,MAAM,CAACmB,WAAW;AAC7C,0CAA0Cb,GAAG,CAACQ,IAAI,IAAIN,QAAQ,CAACM,IAAI;AACnE;AACA;AACA,8BAA8BR,GAAG,CAACQ,IAAI,IAAIN,QAAQ,CAACM,IAAI;AACvD;AACA,+BAA+BN,QAAQ,CAACM,IAAI;AAC5C,kCAAkCM,IAAI,CAACC,SAAS,CAACV,GAAG,CAAC;AACrD;AACA,cAAc;MACE,CAAC;MACD;MAAA,CACCD,KAAK,CAACY,CAAC,IAAIF,IAAI,CAACC,SAAS,CAAC,IAAAE,wBAAQ,EAACH,IAAI,CAACI,KAAK,CAACF,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACG,OAAA,CAAApB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ export declare const createAssetArchive: (target: string) => pulumi.asset.AssetArchive;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createAssetArchive = void 0;
8
+ var pulumi = _interopRequireWildcard(require("@pulumi/pulumi"));
9
+ const createAssetArchive = target => {
10
+ return new pulumi.asset.AssetArchive({
11
+ ".": new pulumi.asset.FileArchive(target)
12
+ });
13
+ };
14
+ exports.createAssetArchive = createAssetArchive;
15
+
16
+ //# sourceMappingURL=createAssetArchive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pulumi","_interopRequireWildcard","require","createAssetArchive","target","asset","AssetArchive","FileArchive","exports"],"sources":["createAssetArchive.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\n\nexport const createAssetArchive = (target: string) => {\n return new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(target)\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,MAAc,IAAK;EAClD,OAAO,IAAIJ,MAAM,CAACK,KAAK,CAACC,YAAY,CAAC;IACjC,GAAG,EAAE,IAAIN,MAAM,CAACK,KAAK,CAACE,WAAW,CAACH,MAAM;EAC5C,CAAC,CAAC;AACN,CAAC;AAACI,OAAA,CAAAL,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { PresignedPostOptions } from "@webiny/aws-sdk/client-s3";
1
+ import type { PresignedPostOptions } from "@webiny/aws-sdk/client-s3";
2
2
  interface GetPresignedPostParams {
3
3
  bucket: PresignedPostOptions["Bucket"];
4
4
  key: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_clientS","require","getPresignedPost","bucket","key","acl","checksum","cacheControl","contentType","fields","s3Params","Key","Expires","Bucket","Conditions","Fields","s3","S3Client","createPresignedPost","exports"],"sources":["getPresignedPost.ts"],"sourcesContent":["import { S3Client, createPresignedPost, PresignedPostOptions } from \"@webiny/aws-sdk/client-s3\";\n\ninterface GetPresignedPostParams {\n bucket: PresignedPostOptions[\"Bucket\"];\n key: string;\n acl: string;\n checksum: string;\n contentType: string | null;\n cacheControl: string | undefined;\n}\n\nexport const getPresignedPost = async ({\n bucket,\n key,\n acl,\n checksum,\n cacheControl,\n contentType\n}: GetPresignedPostParams) => {\n const fields: Record<string, string> = { key, \"X-Amz-Meta-Checksum\": checksum, acl };\n\n if (contentType) {\n fields[\"Content-Type\"] = contentType;\n }\n\n if (cacheControl) {\n fields[\"Cache-Control\"] = cacheControl;\n }\n\n const s3Params = {\n Key: fields.key,\n Expires: 20,\n Bucket: bucket,\n Conditions: [\n [\"content-length-range\", 0, 26214400],\n { acl }\n ] as PresignedPostOptions[\"Conditions\"],\n Fields: fields\n };\n\n const s3 = new S3Client();\n\n return createPresignedPost(s3, s3Params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAWO,MAAMC,gBAAgB,GAAG,MAAAA,CAAO;EACnCC,MAAM;EACNC,GAAG;EACHC,GAAG;EACHC,QAAQ;EACRC,YAAY;EACZC;AACoB,CAAC,KAAK;EAC1B,MAAMC,MAA8B,GAAG;IAAEL,GAAG;IAAE,qBAAqB,EAAEE,QAAQ;IAAED;EAAI,CAAC;EAEpF,IAAIG,WAAW,EAAE;IACbC,MAAM,CAAC,cAAc,CAAC,GAAGD,WAAW;EACxC;EAEA,IAAID,YAAY,EAAE;IACdE,MAAM,CAAC,eAAe,CAAC,GAAGF,YAAY;EAC1C;EAEA,MAAMG,QAAQ,GAAG;IACbC,GAAG,EAAEF,MAAM,CAACL,GAAG;IACfQ,OAAO,EAAE,EAAE;IACXC,MAAM,EAAEV,MAAM;IACdW,UAAU,EAAE,CACR,CAAC,sBAAsB,EAAE,CAAC,EAAE,QAAQ,CAAC,EACrC;MAAET;IAAI,CAAC,CAC4B;IACvCU,MAAM,EAAEN;EACZ,CAAC;EAED,MAAMO,EAAE,GAAG,IAAIC,iBAAQ,CAAC,CAAC;EAEzB,OAAO,IAAAC,4BAAmB,EAACF,EAAE,EAAEN,QAAQ,CAAC;AAC5C,CAAC;AAACS,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_clientS","require","getPresignedPost","bucket","key","acl","checksum","cacheControl","contentType","fields","s3Params","Key","Expires","Bucket","Conditions","Fields","s3","S3Client","createPresignedPost","exports"],"sources":["getPresignedPost.ts"],"sourcesContent":["import type { PresignedPostOptions } from \"@webiny/aws-sdk/client-s3\";\nimport { S3Client, createPresignedPost } from \"@webiny/aws-sdk/client-s3\";\n\ninterface GetPresignedPostParams {\n bucket: PresignedPostOptions[\"Bucket\"];\n key: string;\n acl: string;\n checksum: string;\n contentType: string | null;\n cacheControl: string | undefined;\n}\n\nexport const getPresignedPost = async ({\n bucket,\n key,\n acl,\n checksum,\n cacheControl,\n contentType\n}: GetPresignedPostParams) => {\n const fields: Record<string, string> = { key, \"X-Amz-Meta-Checksum\": checksum, acl };\n\n if (contentType) {\n fields[\"Content-Type\"] = contentType;\n }\n\n if (cacheControl) {\n fields[\"Cache-Control\"] = cacheControl;\n }\n\n const s3Params = {\n Key: fields.key,\n Expires: 20,\n Bucket: bucket,\n Conditions: [\n [\"content-length-range\", 0, 26214400],\n { acl }\n ] as PresignedPostOptions[\"Conditions\"],\n Fields: fields\n };\n\n const s3 = new S3Client();\n\n return createPresignedPost(s3, s3Params);\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAWO,MAAMC,gBAAgB,GAAG,MAAAA,CAAO;EACnCC,MAAM;EACNC,GAAG;EACHC,GAAG;EACHC,QAAQ;EACRC,YAAY;EACZC;AACoB,CAAC,KAAK;EAC1B,MAAMC,MAA8B,GAAG;IAAEL,GAAG;IAAE,qBAAqB,EAAEE,QAAQ;IAAED;EAAI,CAAC;EAEpF,IAAIG,WAAW,EAAE;IACbC,MAAM,CAAC,cAAc,CAAC,GAAGD,WAAW;EACxC;EAEA,IAAID,YAAY,EAAE;IACdE,MAAM,CAAC,eAAe,CAAC,GAAGF,YAAY;EAC1C;EAEA,MAAMG,QAAQ,GAAG;IACbC,GAAG,EAAEF,MAAM,CAACL,GAAG;IACfQ,OAAO,EAAE,EAAE;IACXC,MAAM,EAAEV,MAAM;IACdW,UAAU,EAAE,CACR,CAAC,sBAAsB,EAAE,CAAC,EAAE,QAAQ,CAAC,EACrC;MAAET;IAAI,CAAC,CAC4B;IACvCU,MAAM,EAAEN;EACZ,CAAC;EAED,MAAMO,EAAE,GAAG,IAAIC,iBAAQ,CAAC,CAAC;EAEzB,OAAO,IAAAC,4BAAmB,EAACF,EAAE,EAAEN,QAAQ,CAAC;AAC5C,CAAC;AAACS,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
- import { PulumiApp } from "@webiny/pulumi";
2
+ import type { PulumiApp } from "@webiny/pulumi";
3
3
  type EnvVariables = Record<string, string | pulumi.Output<string>>;
4
4
  export declare let sealEnvVariables: () => void;
5
5
  export declare function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables>;
@@ -1 +1 @@
1
- {"version":3,"names":["pulumi","_interopRequireWildcard","require","variablesRegistry","sealEnvVariables","exports","magicPrefixes","variablesPromise","Promise","resolve","baseVariables","Object","keys","process","env","reduce","current","environmentVariableName","hasMagicPrefix","some","prefix","startsWith","undefined","String","DEBUG","PULUMI_APPS","assign","getCommonLambdaEnvVariables","output","setCommonLambdaEnvVariables","variables","withCommonLambdaEnvVariables","app","decorateProgram","program","addHandler"],"sources":["lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport { PulumiApp } from \"@webiny/pulumi\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nexport let sealEnvVariables: () => void;\n\nconst magicPrefixes = [\"WEBINY_\", \"WEBINY_API_\", \"WCP_\", \"OKTA_\", \"AUTH0_\"];\n\nconst variablesPromise = new Promise<EnvVariables>(resolve => {\n sealEnvVariables = () => {\n // Apart from a couple of basic environment variables like DEBUG,\n // we also take into consideration variables that have `WEBINY_` and `WCP_` prefix in their names.\n const baseVariables = Object.keys(process.env).reduce<EnvVariables>(\n (current, environmentVariableName) => {\n const hasMagicPrefix = magicPrefixes.some(prefix =>\n environmentVariableName.startsWith(prefix)\n );\n\n if (hasMagicPrefix && process.env[environmentVariableName] !== undefined) {\n current[environmentVariableName] = String(process.env[environmentVariableName]);\n }\n return current;\n },\n {\n // Among other things, this determines the amount of information we reveal on runtime errors.\n // https://www.webiny.com/docs/how-to-guides/environment-variables/#debug-environment-variable\n DEBUG: String(process.env.DEBUG),\n // This flag means that Lambda was deployed using the new Pulumi Apps architecture.\n PULUMI_APPS: \"true\"\n }\n );\n\n resolve(Object.assign({}, baseVariables, variablesRegistry));\n };\n});\n\nexport function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables> {\n return pulumi.output(variablesPromise);\n}\n\nfunction setCommonLambdaEnvVariables(variables: EnvVariables) {\n Object.assign(variablesRegistry, variables);\n}\n\nexport interface SetCommonLambdaEnvVariables {\n (variables: EnvVariables): void;\n}\n\nexport interface WithCommonLambdaEnvVariables {\n /**\n * Set ENV variables that wil be assigned to all Lambda functions in the current Pulumi app.\n */\n setCommonLambdaEnvVariables: SetCommonLambdaEnvVariables;\n}\n\n/**\n * Augment the given app with `setCommonLambdaEnvVariables` functionality.\n * @param {PulumiApp} app\n */\nexport function withCommonLambdaEnvVariables<T extends PulumiApp>(\n app: T\n): T & WithCommonLambdaEnvVariables {\n app.decorateProgram<{ setCommonLambdaEnvVariables: typeof setCommonLambdaEnvVariables }>(\n async (program, app) => {\n const output = await program({\n ...app,\n setCommonLambdaEnvVariables\n });\n\n // Once the program is executed, we need to seal the variables (this will resolve the pulumi.output promise).\n app.addHandler(() => {\n sealEnvVariables();\n });\n\n return output;\n }\n );\n\n // Augment the original PulumiApp.\n return {\n ...app,\n setCommonLambdaEnvVariables\n };\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,MAAMC,iBAA+B,GAAG,CAAC,CAAC;AAEnC,IAAIC,gBAA4B,GAAAC,OAAA,CAAAD,gBAAA;AAEvC,MAAME,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;AAE3E,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,CAAeC,OAAO,IAAI;EAC1DJ,OAAA,CAAAD,gBAAA,GAAAA,gBAAgB,GAAGA,CAAA,KAAM;IACrB;IACA;IACA,MAAMM,aAAa,GAAGC,MAAM,CAACC,IAAI,CAACC,OAAO,CAACC,GAAG,CAAC,CAACC,MAAM,CACjD,CAACC,OAAO,EAAEC,uBAAuB,KAAK;MAClC,MAAMC,cAAc,GAAGZ,aAAa,CAACa,IAAI,CAACC,MAAM,IAC5CH,uBAAuB,CAACI,UAAU,CAACD,MAAM,CAC7C,CAAC;MAED,IAAIF,cAAc,IAAIL,OAAO,CAACC,GAAG,CAACG,uBAAuB,CAAC,KAAKK,SAAS,EAAE;QACtEN,OAAO,CAACC,uBAAuB,CAAC,GAAGM,MAAM,CAACV,OAAO,CAACC,GAAG,CAACG,uBAAuB,CAAC,CAAC;MACnF;MACA,OAAOD,OAAO;IAClB,CAAC,EACD;MACI;MACA;MACAQ,KAAK,EAAED,MAAM,CAACV,OAAO,CAACC,GAAG,CAACU,KAAK,CAAC;MAChC;MACAC,WAAW,EAAE;IACjB,CACJ,CAAC;IAEDhB,OAAO,CAACE,MAAM,CAACe,MAAM,CAAC,CAAC,CAAC,EAAEhB,aAAa,EAAEP,iBAAiB,CAAC,CAAC;EAChE,CAAC;AACL,CAAC,CAAC;AAEK,SAASwB,2BAA2BA,CAAA,EAAgC;EACvE,OAAO3B,MAAM,CAAC4B,MAAM,CAACrB,gBAAgB,CAAC;AAC1C;AAEA,SAASsB,2BAA2BA,CAACC,SAAuB,EAAE;EAC1DnB,MAAM,CAACe,MAAM,CAACvB,iBAAiB,EAAE2B,SAAS,CAAC;AAC/C;AAaA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CACxCC,GAAM,EAC0B;EAChCA,GAAG,CAACC,eAAe,CACf,OAAOC,OAAO,EAAEF,GAAG,KAAK;IACpB,MAAMJ,MAAM,GAAG,MAAMM,OAAO,CAAC;MACzB,GAAGF,GAAG;MACNH;IACJ,CAAC,CAAC;;IAEF;IACAG,GAAG,CAACG,UAAU,CAAC,MAAM;MACjB/B,gBAAgB,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAOwB,MAAM;EACjB,CACJ,CAAC;;EAED;EACA,OAAO;IACH,GAAGI,GAAG;IACNH;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["pulumi","_interopRequireWildcard","require","variablesRegistry","sealEnvVariables","exports","magicPrefixes","variablesPromise","Promise","resolve","baseVariables","Object","keys","process","env","reduce","current","environmentVariableName","hasMagicPrefix","some","prefix","startsWith","undefined","String","DEBUG","PULUMI_APPS","assign","getCommonLambdaEnvVariables","output","setCommonLambdaEnvVariables","variables","withCommonLambdaEnvVariables","app","decorateProgram","program","addHandler"],"sources":["lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nexport let sealEnvVariables: () => void;\n\nconst magicPrefixes = [\"WEBINY_\", \"WEBINY_API_\", \"WCP_\", \"OKTA_\", \"AUTH0_\"];\n\nconst variablesPromise = new Promise<EnvVariables>(resolve => {\n sealEnvVariables = () => {\n // Apart from a couple of basic environment variables like DEBUG,\n // we also take into consideration variables that have `WEBINY_` and `WCP_` prefix in their names.\n const baseVariables = Object.keys(process.env).reduce<EnvVariables>(\n (current, environmentVariableName) => {\n const hasMagicPrefix = magicPrefixes.some(prefix =>\n environmentVariableName.startsWith(prefix)\n );\n\n if (hasMagicPrefix && process.env[environmentVariableName] !== undefined) {\n current[environmentVariableName] = String(process.env[environmentVariableName]);\n }\n return current;\n },\n {\n // Among other things, this determines the amount of information we reveal on runtime errors.\n // https://www.webiny.com/docs/how-to-guides/environment-variables/#debug-environment-variable\n DEBUG: String(process.env.DEBUG),\n // This flag means that Lambda was deployed using the new Pulumi Apps architecture.\n PULUMI_APPS: \"true\"\n }\n );\n\n resolve(Object.assign({}, baseVariables, variablesRegistry));\n };\n});\n\nexport function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables> {\n return pulumi.output(variablesPromise);\n}\n\nfunction setCommonLambdaEnvVariables(variables: EnvVariables) {\n Object.assign(variablesRegistry, variables);\n}\n\nexport interface SetCommonLambdaEnvVariables {\n (variables: EnvVariables): void;\n}\n\nexport interface WithCommonLambdaEnvVariables {\n /**\n * Set ENV variables that wil be assigned to all Lambda functions in the current Pulumi app.\n */\n setCommonLambdaEnvVariables: SetCommonLambdaEnvVariables;\n}\n\n/**\n * Augment the given app with `setCommonLambdaEnvVariables` functionality.\n * @param {PulumiApp} app\n */\nexport function withCommonLambdaEnvVariables<T extends PulumiApp>(\n app: T\n): T & WithCommonLambdaEnvVariables {\n app.decorateProgram<{ setCommonLambdaEnvVariables: typeof setCommonLambdaEnvVariables }>(\n async (program, app) => {\n const output = await program({\n ...app,\n setCommonLambdaEnvVariables\n });\n\n // Once the program is executed, we need to seal the variables (this will resolve the pulumi.output promise).\n app.addHandler(() => {\n sealEnvVariables();\n });\n\n return output;\n }\n );\n\n // Augment the original PulumiApp.\n return {\n ...app,\n setCommonLambdaEnvVariables\n };\n}\n"],"mappings":";;;;;;;;;AA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,MAAM,CAACvB,iBAAiB,EAAE2B,SAAS,CAAC;AAC/C;AAaA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CACxCC,GAAM,EAC0B;EAChCA,GAAG,CAACC,eAAe,CACf,OAAOC,OAAO,EAAEF,GAAG,KAAK;IACpB,MAAMJ,MAAM,GAAG,MAAMM,OAAO,CAAC;MACzB,GAAGF,GAAG;MACNH;IACJ,CAAC,CAAC;;IAEF;IACAG,GAAG,CAACG,UAAU,CAAC,MAAM;MACjB/B,gBAAgB,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAOwB,MAAM;EACjB,CACJ,CAAC;;EAED;EACA,OAAO;IACH,GAAGI,GAAG;IACNH;EACJ,CAAC;AACL","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { PresignedPostOptions } from "@webiny/aws-sdk/client-s3";
1
+ import type { PresignedPostOptions } from "@webiny/aws-sdk/client-s3";
2
2
  export interface Paths {
3
3
  full: string;
4
4
  relative: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_fs","_interopRequireDefault","require","_nodeFetch","_formData","_clientS","_mime","_chunk","_path","_crawlDirectory","_getPresignedPost","_awsRegion","getFileChecksum","file","crypto","hash","createHash","Promise","resolve","stream","fs","createReadStream","on","data","update","digest","uploadFolderToS3","path","root","bucket","onFileUploadSuccess","onFileUploadError","onFileUploadSkip","acl","cacheControl","s3","S3Client","region","getEnvVariableAwsRegion","existsSync","Error","paths","crawlDirectory","push","pathsChunks","chunk","cacheControls","pattern","value","Array","isArray","i","length","promises","j","key","relative","replace","checksum","skipUpload","existingObject","send","HeadObjectCommand","Bucket","Key","Metadata","full","find","item","test","contentType","mime","getType","url","fields","getPresignedPost","undefined","readFileSync","formData","FormData","Object","keys","forEach","append","res","fetch","method","body","status","statusText","text","e","error","all","exports"],"sources":["uploadFolderToS3.ts"],"sourcesContent":["import fs from \"fs\";\nimport fetch from \"node-fetch\";\nimport FormData from \"form-data\";\nimport { S3Client, PresignedPostOptions, HeadObjectCommand } from \"@webiny/aws-sdk/client-s3\";\nimport mime from \"mime\";\nimport chunk from \"lodash/chunk\";\nimport { relative } from \"path\";\nimport { crawlDirectory } from \"./crawlDirectory\";\nimport { getPresignedPost } from \"./getPresignedPost\";\nimport { getEnvVariableAwsRegion } from \"~/env/awsRegion\";\n\nfunction getFileChecksum(file: string): Promise<string> {\n const crypto = require(\"crypto\");\n const hash = crypto.createHash(\"md5\");\n\n return new Promise(resolve => {\n const stream = fs.createReadStream(file);\n stream.on(\"data\", function (data: any) {\n hash.update(data, \"utf8\");\n });\n\n stream.on(\"end\", function () {\n resolve(hash.digest(\"hex\"));\n });\n });\n}\n\nexport interface Paths {\n full: string;\n relative: string;\n}\n\nexport type CacheControls = Array<{\n pattern: RegExp;\n value: string;\n}>;\n\nexport interface UploadFolderToS3Params {\n // Path to the folder that needs to be uploaded.\n path: string;\n\n // Object ACL.\n acl: string;\n\n // A callback that gets called every time a file has been uploaded successfully.\n onFileUploadSuccess: (params: { paths: Paths }) => void;\n\n // A callback that gets called every time a file has not been uploaded successfully.\n onFileUploadError: (params: { paths: Paths; error: Error }) => void;\n\n // A callback that gets called every time a file upload has been skipped.\n onFileUploadSkip: (params: { paths: Paths }) => void;\n\n // Target bucket\n bucket: PresignedPostOptions[\"Bucket\"];\n\n // Cache control to apply to each uploaded file\n cacheControl?: string | CacheControls;\n}\n\nexport const uploadFolderToS3 = async ({\n path: root,\n bucket,\n onFileUploadSuccess,\n onFileUploadError,\n onFileUploadSkip,\n // For backwards compatibility, we need to leave ACL on \"public-read\".\n acl = \"public-read\",\n cacheControl = \"max-age=31536000\"\n}: UploadFolderToS3Params) => {\n const s3 = new S3Client({\n region: getEnvVariableAwsRegion()\n });\n\n if (!fs.existsSync(root)) {\n throw new Error(\"Cannot continue, folder does not exist.\");\n }\n\n const paths: string[] = [];\n\n await crawlDirectory(root, async (path: string) => {\n paths.push(path);\n });\n\n const pathsChunks = chunk(paths, 20);\n\n const cacheControls: CacheControls = [];\n if (typeof cacheControl === \"string\") {\n cacheControls.push({ pattern: /.*/, value: cacheControl });\n } else if (Array.isArray(cacheControls)) {\n cacheControls.push(...cacheControl);\n }\n\n for (let i = 0; i < pathsChunks.length; i++) {\n const chunk = pathsChunks[i];\n\n const promises = [];\n for (let j = 0; j < chunk.length; j++) {\n const path = chunk[j];\n\n promises.push(\n new Promise<void>(async resolve => {\n // We also replace \"\\\" with \"/\", which is a path separator on Windows' CMD or Powershell.\n const key = relative(root, path).replace(/\\\\/g, \"/\");\n try {\n // Get file checksum so that we can check if a file needs to be uploaded or not.\n const checksum = await getFileChecksum(path);\n\n let skipUpload = false;\n try {\n const existingObject = await s3.send(\n new HeadObjectCommand({\n Bucket: bucket,\n Key: key\n })\n );\n\n if (existingObject.Metadata?.checksum === checksum) {\n skipUpload = true;\n }\n } catch {\n // Do nothing.\n }\n\n if (skipUpload) {\n if (typeof onFileUploadSkip === \"function\") {\n await onFileUploadSkip({ paths: { full: path, relative: key } });\n }\n } else {\n const cacheControl = cacheControls.find(item => item.pattern.test(key));\n const contentType = mime.getType(path);\n\n const { url, fields } = await getPresignedPost({\n bucket,\n key,\n acl,\n checksum,\n contentType,\n cacheControl: cacheControl ? cacheControl.value : undefined\n });\n\n const data: Record<string, string | Buffer> = {\n ...fields,\n \"Content-Type\": contentType || \"\",\n \"X-Amz-Meta-Checksum\": checksum,\n file: fs.readFileSync(path)\n };\n\n if (cacheControl) {\n data[\"Cache-Control\"] = cacheControl.value;\n }\n\n const formData = new FormData();\n Object.keys(data).forEach(key => {\n formData.append(key, data[key]);\n });\n\n const res = await fetch(url, {\n method: \"POST\",\n body: formData\n });\n\n if (res.status > 299) {\n throw new Error(`${res.statusText}\\n${await res.text()}`);\n }\n\n if (typeof onFileUploadSuccess === \"function\") {\n await onFileUploadSuccess({ paths: { full: path, relative: key } });\n }\n }\n resolve();\n } catch (e) {\n if (typeof onFileUploadError === \"function\") {\n await onFileUploadError({\n paths: { full: path, relative: key },\n error: e\n });\n }\n resolve();\n }\n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GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_fs","_interopRequireDefault","require","_nodeFetch","_formData","_clientS","_mime","_chunk","_path","_crawlDirectory","_getPresignedPost","_awsRegion","getFileChecksum","file","crypto","hash","createHash","Promise","resolve","stream","fs","createReadStream","on","data","update","digest","uploadFolderToS3","path","root","bucket","onFileUploadSuccess","onFileUploadError","onFileUploadSkip","acl","cacheControl","s3","S3Client","region","getEnvVariableAwsRegion","existsSync","Error","paths","crawlDirectory","push","pathsChunks","chunk","cacheControls","pattern","value","Array","isArray","i","length","promises","j","key","relative","replace","checksum","skipUpload","existingObject","send","HeadObjectCommand","Bucket","Key","Metadata","full","find","item","test","contentType","mime","getType","url","fields","getPresignedPost","undefined","readFileSync","formData","FormData","Object","keys","forEach","append","res","fetch","method","body","status","statusText","text","e","error","all","exports"],"sources":["uploadFolderToS3.ts"],"sourcesContent":["import fs from \"fs\";\nimport fetch from \"node-fetch\";\nimport FormData from \"form-data\";\nimport type { PresignedPostOptions } from \"@webiny/aws-sdk/client-s3\";\nimport { S3Client, HeadObjectCommand } from \"@webiny/aws-sdk/client-s3\";\nimport mime from \"mime\";\nimport chunk from \"lodash/chunk\";\nimport { relative } from \"path\";\nimport { crawlDirectory } from \"./crawlDirectory\";\nimport { getPresignedPost } from \"./getPresignedPost\";\nimport { getEnvVariableAwsRegion } from \"~/env/awsRegion\";\n\nfunction getFileChecksum(file: string): Promise<string> {\n const crypto = require(\"crypto\");\n const hash = crypto.createHash(\"md5\");\n\n return new Promise(resolve => {\n const stream = fs.createReadStream(file);\n stream.on(\"data\", function (data: any) {\n hash.update(data, \"utf8\");\n });\n\n stream.on(\"end\", function () {\n resolve(hash.digest(\"hex\"));\n });\n });\n}\n\nexport interface Paths {\n full: string;\n relative: string;\n}\n\nexport type CacheControls = Array<{\n pattern: RegExp;\n value: string;\n}>;\n\nexport interface UploadFolderToS3Params {\n // Path to the folder that needs to be uploaded.\n path: string;\n\n // Object ACL.\n acl: string;\n\n // A callback that gets called every time a file has been uploaded successfully.\n onFileUploadSuccess: (params: { paths: Paths }) => void;\n\n // A callback that gets called every time a file has not been uploaded successfully.\n onFileUploadError: (params: { paths: Paths; error: Error }) => void;\n\n // A callback that gets called every time a file upload has been skipped.\n onFileUploadSkip: (params: { paths: Paths }) => void;\n\n // Target bucket\n bucket: PresignedPostOptions[\"Bucket\"];\n\n // Cache control to apply to each uploaded file\n cacheControl?: string | CacheControls;\n}\n\nexport const uploadFolderToS3 = async ({\n path: root,\n bucket,\n onFileUploadSuccess,\n onFileUploadError,\n onFileUploadSkip,\n // For backwards compatibility, we need to leave ACL on \"public-read\".\n acl = \"public-read\",\n cacheControl = \"max-age=31536000\"\n}: UploadFolderToS3Params) => {\n const s3 = new S3Client({\n region: getEnvVariableAwsRegion()\n });\n\n if (!fs.existsSync(root)) {\n throw new Error(\"Cannot continue, folder does not exist.\");\n }\n\n const paths: string[] = [];\n\n await crawlDirectory(root, async (path: string) => {\n paths.push(path);\n });\n\n const pathsChunks = chunk(paths, 20);\n\n const cacheControls: CacheControls = [];\n if (typeof cacheControl === \"string\") {\n cacheControls.push({ pattern: /.*/, value: cacheControl });\n } else if (Array.isArray(cacheControls)) {\n cacheControls.push(...cacheControl);\n }\n\n for (let i = 0; i < pathsChunks.length; i++) {\n const chunk = pathsChunks[i];\n\n const promises = [];\n for (let j = 0; j < chunk.length; j++) {\n const path = chunk[j];\n\n promises.push(\n new Promise<void>(async resolve => {\n // We also replace \"\\\" with \"/\", which is a path separator on Windows' CMD or Powershell.\n const key = relative(root, path).replace(/\\\\/g, \"/\");\n try {\n // Get file checksum so that we can check if a file needs to be uploaded or not.\n const checksum = await getFileChecksum(path);\n\n let skipUpload = false;\n try {\n const existingObject = await s3.send(\n new HeadObjectCommand({\n Bucket: bucket,\n Key: key\n })\n );\n\n if (existingObject.Metadata?.checksum === checksum) {\n skipUpload = true;\n }\n } catch {\n // Do nothing.\n }\n\n if (skipUpload) {\n if (typeof onFileUploadSkip === \"function\") {\n await onFileUploadSkip({ paths: { full: path, relative: key } });\n }\n } else {\n const cacheControl = cacheControls.find(item => item.pattern.test(key));\n const contentType = mime.getType(path);\n\n const { url, fields } = await getPresignedPost({\n bucket,\n key,\n acl,\n checksum,\n contentType,\n cacheControl: cacheControl ? cacheControl.value : undefined\n });\n\n const data: Record<string, string | Buffer> = {\n ...fields,\n \"Content-Type\": contentType || \"\",\n \"X-Amz-Meta-Checksum\": checksum,\n file: fs.readFileSync(path)\n };\n\n if (cacheControl) {\n data[\"Cache-Control\"] = cacheControl.value;\n }\n\n const formData = new FormData();\n Object.keys(data).forEach(key => {\n formData.append(key, data[key]);\n });\n\n const res = await fetch(url, {\n method: \"POST\",\n body: formData\n });\n\n if (res.status > 299) {\n throw new Error(`${res.statusText}\\n${await res.text()}`);\n }\n\n if (typeof onFileUploadSuccess === \"function\") {\n await onFileUploadSuccess({ paths: { full: path, relative: key } });\n }\n }\n resolve();\n } catch (e) {\n if (typeof onFileUploadError === \"function\") {\n await onFileUploadError({\n paths: { full: path, relative: key },\n error: e\n });\n }\n resolve();\n }\n })\n );\n }\n\n await Promise.all(promises);\n }\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAEA,SAASU,eAAeA,CAACC,IAAY,EAAmB;EACpD,MAAMC,MAAM,GAAGZ,OAAO,CAAC,QAAQ,CAAC;EAChC,MAAMa,IAAI,GAAGD,MAA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U,KAAK,MAAML,GAAG,CAACM,IAAI,CAAC,CAAC,EAAE,CAAC;YAC7D;YAEA,IAAI,OAAO5D,mBAAmB,KAAK,UAAU,EAAE;cAC3C,MAAMA,mBAAmB,CAAC;gBAAEW,KAAK,EAAE;kBAAEyB,IAAI,EAAEvC,IAAI;kBAAE6B,QAAQ,EAAED;gBAAI;cAAE,CAAC,CAAC;YACvE;UACJ;UACArC,OAAO,CAAC,CAAC;QACb,CAAC,CAAC,OAAOyE,CAAC,EAAE;UACR,IAAI,OAAO5D,iBAAiB,KAAK,UAAU,EAAE;YACzC,MAAMA,iBAAiB,CAAC;cACpBU,KAAK,EAAE;gBAAEyB,IAAI,EAAEvC,IAAI;gBAAE6B,QAAQ,EAAED;cAAI,CAAC;cACpCqC,KAAK,EAAED;YACX,CAAC,CAAC;UACN;UACAzE,OAAO,CAAC,CAAC;QACb;MACJ,CAAC,CACL,CAAC;IACL;IAEA,MAAMD,OAAO,CAAC4E,GAAG,CAACxC,QAAQ,CAAC;EAC/B;AACJ,CAAC;AAACyC,OAAA,CAAApE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { PulumiApp } from "@webiny/pulumi";
2
- import { ServiceManifest } from "./addServiceManifestTableItem";
1
+ import type { PulumiApp } from "@webiny/pulumi";
2
+ import type { ServiceManifest } from "./addServiceManifestTableItem";
3
3
  export interface WithServiceManifest {
4
4
  addServiceManifest(manifest: ServiceManifest): void;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_merge","_interopRequireDefault","require","_addServiceManifestTableItem","_apps","defaultApplyManifests","app","manifests","core","getModule","CoreOutput","table","tableName","primaryDynamodbTableName","hashKey","primaryDynamodbTableHashKey","rangeKey","primaryDynamodbTableRangeKey","forEach","manifest","addServiceManifestTableItem","withServiceManifest","applyManifests","addServiceManifest","name","merge","decorateProgram","program","output","addHandler","Object","values"],"sources":["withServiceManifest.ts"],"sourcesContent":["import merge from \"lodash/merge\";\nimport { PulumiApp } from \"@webiny/pulumi\";\nimport {\n addServiceManifestTableItem,\n ServiceManifest,\n TableDefinition\n} from \"./addServiceManifestTableItem\";\nimport { CoreOutput } from \"~/apps\";\n\nexport interface WithServiceManifest {\n addServiceManifest(manifest: ServiceManifest): void;\n}\n\ninterface ApplyManifests {\n (manifests: ServiceManifest[]): void;\n}\n\nconst defaultApplyManifests = (app: PulumiApp, manifests: ServiceManifest[]) => {\n const core = app.getModule(CoreOutput);\n\n const table: TableDefinition = {\n tableName: core.primaryDynamodbTableName,\n hashKey: core.primaryDynamodbTableHashKey,\n rangeKey: core.primaryDynamodbTableRangeKey\n };\n\n manifests.forEach(manifest => addServiceManifestTableItem(app, table, manifest));\n};\n\n/**\n * Augment the given app with `addServiceManifest` functionality.\n * @param {PulumiApp} app\n */\nexport function withServiceManifest<T extends PulumiApp>(\n app: T,\n applyManifests?: ApplyManifests\n): T & WithServiceManifest {\n const manifests: Record<string, ServiceManifest> = {};\n\n function addServiceManifest(manifest: ServiceManifest) {\n manifests[manifest.name] = merge({}, manifests[manifest.name], manifest);\n }\n\n app.decorateProgram<{ addServiceManifest: typeof addServiceManifest }>(async (program, app) => {\n const output = await program({\n ...app,\n addServiceManifest\n });\n\n app.addHandler(() => {\n if (!applyManifests) {\n defaultApplyManifests(app, Object.values(manifests));\n return;\n }\n\n applyManifests(Object.values(manifests));\n });\n\n return output;\n });\n\n // Augment the original PulumiApp.\n return {\n ...app,\n addServiceManifest\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,4BAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAUA,MAAMG,qBAAqB,GAAGA,CAACC,GAAc,EAAEC,SAA4B,KAAK;EAC5E,MAAMC,IAAI,GAAGF,GAAG,CAACG,SAAS,CAACC,gBAAU,CAAC;EAEtC,MAAMC,KAAsB,GAAG;IAC3BC,SAAS,EAAEJ,IAAI,CAACK,wBAAwB;IACxCC,OAAO,EAAEN,IAAI,CAACO,2BAA2B;IACzCC,QAAQ,EAAER,IAAI,CAACS;EACnB,CAAC;EAEDV,SAAS,CAACW,OAAO,CAACC,QAAQ,IAAI,IAAAC,wDAA2B,EAACd,GAAG,EAAEK,KAAK,EAAEQ,QAAQ,CAAC,CAAC;AACpF,CAAC;;AAED;AACA;AACA;AACA;AACO,SAASE,mBAAmBA,CAC/Bf,GAAM,EACNgB,cAA+B,EACR;EACvB,MAAMf,SAA0C,GAAG,CAAC,CAAC;EAErD,SAASgB,kBAAkBA,CAACJ,QAAyB,EAAE;IACnDZ,SAAS,CAACY,QAAQ,CAACK,IAAI,CAAC,GAAG,IAAAC,cAAK,EAAC,CAAC,CAAC,EAAElB,SAAS,CAACY,QAAQ,CAACK,IAAI,CAAC,EAAEL,QAAQ,CAAC;EAC5E;EAEAb,GAAG,CAACoB,eAAe,CAAoD,OAAOC,OAAO,EAAErB,GAAG,KAAK;IAC3F,MAAMsB,MAAM,GAAG,MAAMD,OAAO,CAAC;MACzB,GAAGrB,GAAG;MACNiB;IACJ,CAAC,CAAC;IAEFjB,GAAG,CAACuB,UAAU,CAAC,MAAM;MACjB,IAAI,CAACP,cAAc,EAAE;QACjBjB,qBAAqB,CAACC,GAAG,EAAEwB,MAAM,CAACC,MAAM,CAACxB,SAAS,CAAC,CAAC;QACpD;MACJ;MAEAe,cAAc,CAACQ,MAAM,CAACC,MAAM,CAACxB,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC;IAEF,OAAOqB,MAAM;EACjB,CAAC,CAAC;;EAEF;EACA,OAAO;IACH,GAAGtB,GAAG;IACNiB;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["_merge","_interopRequireDefault","require","_addServiceManifestTableItem","_apps","defaultApplyManifests","app","manifests","core","getModule","CoreOutput","table","tableName","primaryDynamodbTableName","hashKey","primaryDynamodbTableHashKey","rangeKey","primaryDynamodbTableRangeKey","forEach","manifest","addServiceManifestTableItem","withServiceManifest","applyManifests","addServiceManifest","name","merge","decorateProgram","program","output","addHandler","Object","values"],"sources":["withServiceManifest.ts"],"sourcesContent":["import merge from \"lodash/merge\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport type { ServiceManifest, TableDefinition } from \"./addServiceManifestTableItem\";\nimport { addServiceManifestTableItem } from \"./addServiceManifestTableItem\";\nimport { CoreOutput } from \"~/apps\";\n\nexport interface WithServiceManifest {\n addServiceManifest(manifest: ServiceManifest): void;\n}\n\ninterface ApplyManifests {\n (manifests: ServiceManifest[]): void;\n}\n\nconst defaultApplyManifests = (app: PulumiApp, manifests: ServiceManifest[]) => {\n const core = app.getModule(CoreOutput);\n\n const table: TableDefinition = {\n tableName: core.primaryDynamodbTableName,\n hashKey: core.primaryDynamodbTableHashKey,\n rangeKey: core.primaryDynamodbTableRangeKey\n };\n\n manifests.forEach(manifest => addServiceManifestTableItem(app, table, manifest));\n};\n\n/**\n * Augment the given app with `addServiceManifest` functionality.\n * @param {PulumiApp} app\n */\nexport function withServiceManifest<T extends PulumiApp>(\n app: T,\n applyManifests?: ApplyManifests\n): T & WithServiceManifest {\n const manifests: Record<string, ServiceManifest> = {};\n\n function addServiceManifest(manifest: ServiceManifest) {\n manifests[manifest.name] = merge({}, manifests[manifest.name], manifest);\n }\n\n app.decorateProgram<{ addServiceManifest: typeof addServiceManifest }>(async (program, app) => {\n const output = await program({\n ...app,\n addServiceManifest\n });\n\n app.addHandler(() => {\n if (!applyManifests) {\n defaultApplyManifests(app, Object.values(manifests));\n return;\n }\n\n applyManifests(Object.values(manifests));\n });\n\n return output;\n });\n\n // Augment the original PulumiApp.\n return {\n ...app,\n addServiceManifest\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,4BAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAUA,MAAMG,qBAAqB,GAAGA,CAACC,GAAc,EAAEC,SAA4B,KAAK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