@webiny/project-aws 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (182) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +3 -21
  2. package/_templates/appTemplates/api/graphql/src/index.ts +19 -89
  3. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +17 -101
  4. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +15 -9
  5. package/abstractions/ApiGqlClient.js +1 -1
  6. package/abstractions/ApiGqlClient.js.map +1 -1
  7. package/abstractions/InvokeLambdaFunction.js +1 -1
  8. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  9. package/abstractions/services/ApiStackOutputService.d.ts +14 -1
  10. package/abstractions/services/ApiStackOutputService.js.map +1 -1
  11. package/admin.d.ts +6 -0
  12. package/admin.js +4 -2
  13. package/admin.js.map +1 -1
  14. package/apps/createApiApp.d.ts +8 -0
  15. package/extensions/ApiRoute.d.ts +1 -1
  16. package/extensions/ApiRoute.js +16 -30
  17. package/extensions/ApiRoute.js.map +1 -1
  18. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
  19. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -2
  20. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  21. package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
  22. package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
  23. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  24. package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
  25. package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
  26. package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
  27. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
  28. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
  29. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
  30. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
  31. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
  32. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
  33. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
  34. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
  35. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
  36. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
  37. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  38. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
  39. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
  40. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
  41. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
  42. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
  43. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
  44. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +2 -3
  45. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  46. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
  47. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
  48. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
  49. package/extensions/ProjectAws/UploadAdminAppToS3.js +1 -1
  50. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  51. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
  52. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
  53. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
  54. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
  55. package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
  56. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
  57. package/extensions/ProjectAws/definitions.js +1 -3
  58. package/extensions/ProjectAws/definitions.js.map +1 -1
  59. package/extensions/ProjectAws.js +18 -4
  60. package/extensions/ProjectAws.js.map +1 -1
  61. package/extensions/RegisterRoutesPulumi.js +3 -6
  62. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  63. package/extensions/definitions.js +0 -2
  64. package/extensions/definitions.js.map +1 -1
  65. package/extensions/index.d.ts +0 -1
  66. package/extensions/index.js +0 -1
  67. package/extensions/routePath.d.ts +20 -0
  68. package/extensions/routePath.js +13 -0
  69. package/extensions/routePath.js.map +1 -0
  70. package/features/InvokeLambdaFunction.js +1 -1
  71. package/features/InvokeLambdaFunction.js.map +1 -1
  72. package/features/Watch/AwsWatch.d.ts +17 -0
  73. package/features/Watch/AwsWatch.js +108 -0
  74. package/features/Watch/AwsWatch.js.map +1 -0
  75. package/features/Watch/getIotEndpoint.d.ts +2 -0
  76. package/features/Watch/getIotEndpoint.js +18 -0
  77. package/features/Watch/getIotEndpoint.js.map +1 -0
  78. package/features/Watch/handler/handler.zip +0 -0
  79. package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
  80. package/features/Watch/replaceLambdaFunctions.js +72 -0
  81. package/features/Watch/replaceLambdaFunctions.js.map +1 -0
  82. package/index.d.ts +1 -0
  83. package/index.js +1 -0
  84. package/infra.d.ts +44 -0
  85. package/infra.js +18 -4
  86. package/infra.js.map +1 -1
  87. package/package.json +19 -16
  88. package/project.d.ts +27 -17
  89. package/project.js +3 -2
  90. package/project.js.map +1 -1
  91. package/pulumi/apps/admin/createAdminPulumiApp.js +4 -2
  92. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  93. package/pulumi/apps/api/ApiCloudfront.js +105 -2
  94. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  95. package/pulumi/apps/api/ApiGraphqlStream.d.ts +29 -0
  96. package/pulumi/apps/api/ApiGraphqlStream.js +58 -0
  97. package/pulumi/apps/api/ApiGraphqlStream.js.map +1 -0
  98. package/pulumi/apps/api/ApiOutput.d.ts +6 -6
  99. package/pulumi/apps/api/ApiOutput.js +1 -1
  100. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  101. package/pulumi/apps/api/createApiPulumiApp.d.ts +8 -0
  102. package/pulumi/apps/api/createApiPulumiApp.js +28 -20
  103. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  104. package/pulumi/apps/api/index.d.ts +1 -0
  105. package/pulumi/apps/api/index.js +1 -0
  106. package/pulumi/apps/awsUtils.d.ts +1 -1
  107. package/pulumi/apps/awsUtils.js +2 -2
  108. package/pulumi/apps/awsUtils.js.map +1 -1
  109. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  110. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  111. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
  112. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  113. package/pulumi/apps/blueGreen/types.d.ts +0 -3
  114. package/pulumi/apps/common/CoreOutput.d.ts +2 -1
  115. package/pulumi/apps/common/CoreOutput.js +2 -2
  116. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  117. package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
  118. package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
  119. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  120. package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
  121. package/pulumi/apps/core/CoreDynamo.js +3 -0
  122. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  123. package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
  124. package/pulumi/apps/core/CoreFileManager.js +11 -1
  125. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  126. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
  127. package/pulumi/apps/core/CoreOpenSearch.js +3 -0
  128. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  129. package/pulumi/apps/core/createCorePulumiApp.js +16 -7
  130. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  131. package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
  132. package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
  133. package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
  134. package/pulumi/apps/react/createReactPulumiApp.js +2 -2
  135. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  136. package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
  137. package/pulumi/apps/syncSystem/SyncSystemLambda.js +1 -1
  138. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  139. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
  140. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  141. package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
  142. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
  143. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  144. package/pulumi/extensions/DynamoDbPitr.d.ts +4 -0
  145. package/pulumi/extensions/DynamoDbPitr.js +15 -0
  146. package/pulumi/extensions/DynamoDbPitr.js.map +1 -0
  147. package/pulumi/extensions/S3BucketVersioning.d.ts +4 -0
  148. package/pulumi/extensions/S3BucketVersioning.js +15 -0
  149. package/pulumi/extensions/S3BucketVersioning.js.map +1 -0
  150. package/pulumi/extensions/index.d.ts +9 -3
  151. package/pulumi/extensions/index.js +6 -2
  152. package/pulumi/extensions/index.js.map +1 -1
  153. package/pulumi/getAwsProjectSdk.d.ts +12 -0
  154. package/pulumi/getAwsProjectSdk.js +6 -0
  155. package/pulumi/getAwsProjectSdk.js.map +1 -0
  156. package/pulumi/getStackOutput.d.ts +7 -0
  157. package/pulumi/getStackOutput.js +8 -0
  158. package/pulumi/getStackOutput.js.map +1 -0
  159. package/pulumi/types.d.ts +2 -1
  160. package/pulumi/utils/getDistributionUrl.d.ts +9 -0
  161. package/pulumi/utils/getDistributionUrl.js +8 -0
  162. package/pulumi/utils/getDistributionUrl.js.map +1 -0
  163. package/pulumi/utils/index.d.ts +1 -0
  164. package/pulumi/utils/index.js +1 -0
  165. package/pulumi/utils/lambdaEnvVariables.js +4 -16
  166. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  167. package/registerAwsProjectFeatures.d.ts +8 -0
  168. package/registerAwsProjectFeatures.js +55 -0
  169. package/registerAwsProjectFeatures.js.map +1 -0
  170. package/services/GetPulumiService/GetPulumiService.d.ts +8 -0
  171. package/services/GetPulumiService/GetPulumiService.js +44 -0
  172. package/services/GetPulumiService/GetPulumiService.js.map +1 -0
  173. package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
  174. package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
  175. package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
  176. package/utils/index.d.ts +1 -0
  177. package/utils/index.js +1 -0
  178. package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
  179. package/_templates/extensions/sqlite/api/graphql/src/index.ts +0 -90
  180. package/extensions/Encryption.d.ts +0 -10
  181. package/extensions/Encryption.js +0 -36
  182. package/extensions/Encryption.js.map +0 -1
@@ -4,48 +4,30 @@
4
4
  "type": "module",
5
5
  "scripts": {},
6
6
  "dependencies": {
7
+ "@webiny/api-event-handler-aws-ddb": "latest",
8
+ "@webiny/api-event-handler-aws-ddb-os": "latest",
7
9
  "@webiny/api-aco": "latest",
8
- "@webiny/api-aco-ddb": "latest",
9
- "@webiny/api-aco-sql": "latest",
10
10
  "@webiny/api-audit-logs": "latest",
11
- "@webiny/api-audit-logs-ddb": "latest",
12
- "@webiny/api-audit-logs-sql": "latest",
13
- "@webiny/api-background-tasks-ddb": "latest",
14
- "@webiny/api-background-tasks-os": "latest",
15
11
  "@webiny/api-core": "latest",
16
- "@webiny/api-core-ddb": "latest",
17
- "@webiny/api-dynamodb-to-elasticsearch": "latest",
18
- "@webiny/api-opensearch": "latest",
19
12
  "@webiny/api-file-manager": "latest",
20
13
  "@webiny/api-file-manager-aco": "latest",
21
14
  "@webiny/api-file-manager-s3": "latest",
22
15
  "@webiny/api-headless-cms": "latest",
23
16
  "@webiny/api-headless-cms-aco": "latest",
24
- "@webiny/api-headless-cms-ddb": "latest",
25
- "@webiny/api-headless-cms-ddb-es": "latest",
26
17
  "@webiny/api-headless-cms-scheduler": "latest",
27
18
  "@webiny/api-headless-cms-tasks": "latest",
28
- "@webiny/api-headless-cms-tasks-ddb-es": "latest",
29
19
  "@webiny/api-headless-cms-workflows": "latest",
30
20
  "@webiny/api-mailer": "latest",
31
21
  "@webiny/api-record-locking": "latest",
32
22
  "@webiny/api-scheduler": "latest",
33
- "@webiny/api-scheduler-aws": "latest",
34
23
  "@webiny/api-website-builder": "latest",
35
24
  "@webiny/api-website-builder-scheduler": "latest",
36
25
  "@webiny/api-website-builder-workflows": "latest",
37
26
  "@webiny/api-websockets": "latest",
38
- "@webiny/api-websockets-aws": "latest",
39
- "@webiny/api-websockets-ddb": "latest",
40
- "@webiny/api-websockets-server": "latest",
41
- "@webiny/api-websockets-sql": "latest",
42
-
43
27
  "@webiny/api-workflows": "latest",
44
28
  "@webiny/aws-sdk": "latest",
45
29
  "@webiny/build-tools": "latest",
46
30
  "@webiny/db-dynamodb": "latest",
47
- "@webiny/handler-aws": "latest",
48
- "@webiny/handler-db": "latest",
49
- "@webiny/handler-graphql": "latest"
31
+ "@webiny/api-graphql": "latest"
50
32
  }
51
33
  }
@@ -1,92 +1,22 @@
1
- import { getDocumentClient } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
- import { createHandler } from "@webiny/handler-aws";
3
- import graphqlPlugins from "@webiny/handler-graphql";
4
- import { createApiCore } from "@webiny/api-core";
5
- import { createApiCoreDdb } from "@webiny/api-core-ddb";
6
- import dbPlugins from "@webiny/handler-db";
7
- import { DynamoDbDriver, registerDynamoDBCore } from "@webiny/db-dynamodb";
8
- import { createFileManagerContext } from "@webiny/api-file-manager";
9
- import { createFileManagerAco } from "@webiny/api-file-manager-aco";
10
- import { createFileManagerS3, createAssetDelivery } from "@webiny/api-file-manager-s3";
11
- import { createCmsExtension } from "@webiny/api-headless-cms";
12
- import { registerDynamoDbStorageOperations } from "@webiny/api-headless-cms-ddb";
13
- import { createHcmsTasks } from "@webiny/api-headless-cms-tasks";
14
- import { createAco } from "@webiny/api-aco";
15
- import { registerAcoDdbStorageOperations } from "@webiny/api-aco-ddb";
16
- import { createAcoHcmsContext } from "@webiny/api-headless-cms-aco";
17
- import securityPlugins from "./security";
18
- import { createWebsiteBuilder } from "@webiny/api-website-builder";
19
- import { createAuditLogs } from "@webiny/api-audit-logs";
20
- import { registerAuditLogsDdbStorageOperations } from "@webiny/api-audit-logs-ddb";
21
- import { createBackgroundTasks } from "@webiny/api-background-tasks-ddb";
22
- import { createWebsockets } from "@webiny/api-websockets";
23
- import { createAwsWebsockets } from "@webiny/api-websockets-aws";
24
- import { registerWebsocketsDdbStorageOperations } from "@webiny/api-websockets-ddb";
25
- import { createRecordLocking } from "@webiny/api-record-locking";
26
- import { createHeadlessCmsScheduler } from "@webiny/api-headless-cms-scheduler";
27
- import { registerSchedulerExtension } from "@webiny/api-scheduler";
28
- import { registerSchedulerAwsExtension } from "@webiny/api-scheduler-aws";
29
- import { createSchedulerClient } from "@webiny/aws-sdk/client-scheduler/index.js";
30
- import { createMailerContext, createMailerGraphQL } from "@webiny/api-mailer";
31
- import { createWorkflows } from "@webiny/api-workflows";
32
- import { createHeadlessCmsWorkflows } from "@webiny/api-headless-cms-workflows";
33
- import { createWebsiteBuilderWorkflows } from "@webiny/api-website-builder-workflows";
34
- import { createWebsiteBuilderScheduler } from "@webiny/api-website-builder-scheduler";
35
- import { createWebhooks } from "@webiny/webhooks/api";
36
-
1
+ /**
2
+ * DI-native API GraphQL handler (DynamoDB storage).
3
+ *
4
+ * The composition root lives in @webiny/api-event-handler-aws-ddb (`createAwsDdbApiHandler`) so the wiring
5
+ * is a real, testable package rather than template code. This file only supplies project-specific
6
+ * extensions.
7
+ *
8
+ * Two handlers are exported from this one bundle and deployed as two Lambda functions:
9
+ * - `handler` — behind API Gateway, buffered responses. Everything except streaming routes.
10
+ * - `streamHandler` — behind a Lambda Function URL with `InvokeMode: RESPONSE_STREAM`, for routes that
11
+ * stream (e.g. `/stream/*`). A separate function is required because a Lambda's handler entry is
12
+ * fixed per function, and API Gateway buffers the whole response so it cannot stream at all.
13
+ */
14
+ import {
15
+ createAwsDdbApiHandler,
16
+ createAwsDdbStreamApiHandler
17
+ } from "@webiny/api-event-handler-aws-ddb";
37
18
  import { extensions } from "./extensions";
38
19
 
39
- const debug = process.env.DEBUG === "true";
40
-
41
- const documentClient = getDocumentClient();
20
+ export const handler = createAwsDdbApiHandler({ extensions });
42
21
 
43
- export const handler = createHandler({
44
- plugins: [
45
- registerDynamoDBCore({ documentClient }),
46
- createApiCore({
47
- storageOperations: createApiCoreDdb({ documentClient })
48
- }),
49
- graphqlPlugins({ debug }),
50
- dbPlugins({
51
- table: process.env.DB_TABLE,
52
- driver: new DynamoDbDriver({ documentClient })
53
- }),
54
- securityPlugins(),
55
- createWebsockets(),
56
- createAwsWebsockets(),
57
- registerWebsocketsDdbStorageOperations({ documentClient }),
58
- registerDynamoDbStorageOperations(),
59
- createCmsExtension(),
60
- createMailerContext(),
61
- createMailerGraphQL(),
62
- createWebsiteBuilder(),
63
- createRecordLocking(),
64
- createBackgroundTasks(),
65
- createFileManagerContext(),
66
- createFileManagerAco(),
67
- createAssetDelivery(),
68
- createFileManagerS3(),
69
- registerAcoDdbStorageOperations({ documentClient }),
70
- createAco(),
71
- createWorkflows(),
72
- createHeadlessCmsWorkflows(),
73
- createWebsiteBuilderWorkflows(),
74
- registerAuditLogsDdbStorageOperations({
75
- documentClient,
76
- }),
77
- createAuditLogs(),
78
- createAcoHcmsContext(),
79
- createHcmsTasks(),
80
- registerSchedulerExtension(),
81
- registerSchedulerAwsExtension({
82
- getClient: config => {
83
- return createSchedulerClient(config);
84
- }
85
- }),
86
- createHeadlessCmsScheduler(),
87
- createWebsiteBuilderScheduler(),
88
- createWebhooks(),
89
- extensions()
90
- ],
91
- debug
92
- });
22
+ export const streamHandler = createAwsDdbStreamApiHandler({ extensions });
@@ -1,104 +1,20 @@
1
- import { getDocumentClient } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
- import { createHandler } from "@webiny/handler-aws";
3
- import graphqlPlugins from "@webiny/handler-graphql";
4
- import { createApiCore } from "@webiny/api-core";
5
- import { createApiCoreDdb } from "@webiny/api-core-ddb";
6
- import dbPlugins from "@webiny/handler-db";
7
- import { DynamoDbDriver, registerDynamoDBCore } from "@webiny/db-dynamodb";
8
- import { OpenSearchClientOptions, registerOpenSearchCore } from "@webiny/api-opensearch";
9
- import { createFileManagerContext } from "@webiny/api-file-manager";
10
- import { createFileManagerAco } from "@webiny/api-file-manager-aco";
11
- import { createAssetDelivery, createFileManagerS3 } from "@webiny/api-file-manager-s3";
12
- import { createCmsExtension } from "@webiny/api-headless-cms";
13
- import { registerCmsOpenSearchStorageOperations } from "@webiny/api-headless-cms-ddb-es";
14
- import { createHcmsTasks } from "@webiny/api-headless-cms-tasks-ddb-es";
15
- import { createAco } from "@webiny/api-aco";
16
- import { registerAcoDdbStorageOperations } from "@webiny/api-aco-ddb";
17
- import { createAcoHcmsContext } from "@webiny/api-headless-cms-aco";
18
- import securityPlugins from "./security.js";
19
- import { createWebsiteBuilder } from "@webiny/api-website-builder";
20
- import { registerAuditLogsDdbStorageOperations } from "@webiny/api-audit-logs-ddb";
21
- import { createAuditLogs } from "@webiny/api-audit-logs";
22
- import { createBackgroundTasks } from "@webiny/api-background-tasks-os";
23
- import { createWebsockets } from "@webiny/api-websockets";
24
- import { createAwsWebsockets } from "@webiny/api-websockets-aws";
25
- import { registerWebsocketsDdbStorageOperations } from "@webiny/api-websockets-ddb";
26
- import { createRecordLocking } from "@webiny/api-record-locking";
27
- import { createSchedulerClient } from "@webiny/aws-sdk/client-scheduler/index.js";
28
- import { registerSchedulerExtension } from "@webiny/api-scheduler";
29
- import { registerSchedulerAwsExtension } from "@webiny/api-scheduler-aws";
30
- import { createHeadlessCmsScheduler } from "@webiny/api-headless-cms-scheduler";
31
- import { createMailerContext, createMailerGraphQL } from "@webiny/api-mailer";
32
- import { createWorkflows } from "@webiny/api-workflows";
33
- import { createHeadlessCmsWorkflows } from "@webiny/api-headless-cms-workflows";
34
- import { createWebsiteBuilderWorkflows } from "@webiny/api-website-builder-workflows";
35
- import { createWebsiteBuilderScheduler } from "@webiny/api-website-builder-scheduler";
36
- import { createWebhooks } from "@webiny/webhooks/api";
37
-
1
+ /**
2
+ * DI-native API GraphQL handler — OpenSearch (DDB+ES) variant.
3
+ *
4
+ * The composition root lives in @webiny/api-event-handler-aws-ddb-os (`createAwsDdbOsApiHandler`) so the
5
+ * wiring is a real, testable package rather than template code. The OpenSearch extension's
6
+ * ReplaceApiLambdaFnHandlers copies this file over the api workspace when OpenSearch is enabled.
7
+ * This file only supplies project-specific extensions.
8
+ *
9
+ * Exports both the buffered (API Gateway) and the response-streaming (Function URL) handler; see the
10
+ * DynamoDB variant of this file for why streaming needs its own Lambda function.
11
+ */
12
+ import {
13
+ createAwsDdbOsApiHandler,
14
+ createAwsDdbOsStreamApiHandler
15
+ } from "@webiny/api-event-handler-aws-ddb-os";
38
16
  import { extensions } from "./extensions";
39
17
 
40
- const debug = process.env.DEBUG === "true";
41
-
42
- const documentClient = getDocumentClient();
43
-
44
- const osUsername = process.env.OPENSEARCH_USERNAME;
45
- const osPassword = process.env.OPENSEARCH_PASSWORD;
46
-
47
- const openSearchClientOptions: OpenSearchClientOptions = {
48
- endpoint: `https://${process.env.OPENSEARCH_ENDPOINT}`
49
- };
50
- if (osUsername && osPassword) {
51
- openSearchClientOptions.auth = { username: osUsername, password: osPassword };
52
- }
18
+ export const handler = createAwsDdbOsApiHandler({ extensions });
53
19
 
54
- export const handler = createHandler({
55
- plugins: [
56
- registerDynamoDBCore({ documentClient }),
57
- registerOpenSearchCore(openSearchClientOptions),
58
- createApiCore({
59
- storageOperations: createApiCoreDdb({ documentClient })
60
- }),
61
- graphqlPlugins({ debug }),
62
- dbPlugins({
63
- table: process.env.DB_TABLE,
64
- driver: new DynamoDbDriver({ documentClient })
65
- }),
66
- securityPlugins(),
67
- createWebsockets(),
68
- createAwsWebsockets(),
69
- registerWebsocketsDdbStorageOperations({ documentClient }),
70
- registerCmsOpenSearchStorageOperations(),
71
- createCmsExtension(),
72
- createMailerContext(),
73
- createMailerGraphQL(),
74
- createWebsiteBuilder(),
75
- createRecordLocking(),
76
- createBackgroundTasks(),
77
- createFileManagerContext(),
78
- createFileManagerAco(),
79
- createAssetDelivery(),
80
- createFileManagerS3(),
81
- registerAcoDdbStorageOperations({ documentClient }),
82
- createAco(),
83
- createWorkflows(),
84
- createHeadlessCmsWorkflows(),
85
- createWebsiteBuilderWorkflows(),
86
- registerAuditLogsDdbStorageOperations({
87
- documentClient
88
- }),
89
- createAuditLogs(),
90
- createAcoHcmsContext(),
91
- createHcmsTasks(),
92
- registerSchedulerExtension(),
93
- registerSchedulerAwsExtension({
94
- getClient: config => {
95
- return createSchedulerClient(config);
96
- }
97
- }),
98
- createHeadlessCmsScheduler(),
99
- createWebsiteBuilderScheduler(),
100
- createWebhooks(),
101
- extensions()
102
- ],
103
- debug
104
- });
20
+ export const streamHandler = createAwsDdbOsStreamApiHandler({ extensions });
@@ -1,6 +1,13 @@
1
- import { createHandler } from "@webiny/handler-aws";
2
- import { type OpenSearchClientOptions, registerOpenSearchCore } from "@webiny/api-opensearch";
3
- import { createEventHandler } from "@webiny/api-dynamodb-to-elasticsearch";
1
+ /**
2
+ * DI-native DynamoDB -> OpenSearch stream handler (core app, OpenSearch setup).
3
+ *
4
+ * Triggered by the core table's DynamoDB stream (EventSourceMapping) and syncs records into
5
+ * OpenSearch. `createDdbToOpenSearchStreamHandler` wires DdbToOpenSearchHandler + OpenSearchClient +
6
+ * compression in its own DI container, so this entry only builds the OpenSearch client.
7
+ */
8
+ import { type OpenSearchClientOptions } from "@webiny/api-opensearch";
9
+ import { createAwsOpenSearchClient } from "@webiny/api-opensearch-aws";
10
+ import { createDdbToOpenSearchStreamHandler } from "@webiny/api-sync-ddb-to-opensearch";
4
11
 
5
12
  const osUsername = process.env.OPENSEARCH_USERNAME;
6
13
  const osPassword = process.env.OPENSEARCH_PASSWORD;
@@ -8,6 +15,8 @@ const osPassword = process.env.OPENSEARCH_PASSWORD;
8
15
  const clientOptions: OpenSearchClientOptions = {
9
16
  endpoint: `https://${process.env.OPENSEARCH_ENDPOINT}`
10
17
  };
18
+
19
+ // Basic auth for local / self-managed OpenSearch; when absent the client falls back to AWS SigV4.
11
20
  if (osUsername && osPassword) {
12
21
  clientOptions.auth = {
13
22
  username: osUsername,
@@ -15,9 +24,6 @@ if (osUsername && osPassword) {
15
24
  };
16
25
  }
17
26
 
18
- export const handler = createHandler({
19
- plugins: [registerOpenSearchCore(clientOptions), createEventHandler()],
20
- options: {
21
- bodyLimit: 536870912 // 512MB
22
- }
23
- });
27
+ const client = createAwsOpenSearchClient(clientOptions);
28
+
29
+ export const handler = createDdbToOpenSearchStreamHandler(client);
@@ -1,4 +1,4 @@
1
- import { createAbstraction } from "@webiny/project/abstractions/createAbstraction";
1
+ import { createAbstraction } from "@webiny/project/abstractions/createAbstraction.js";
2
2
  const ApiGqlClient = createAbstraction("ApiGqlClient");
3
3
  export { ApiGqlClient };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"abstractions/ApiGqlClient.js","sources":["../../src/abstractions/ApiGqlClient.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction\";\n\nexport interface IApiGqlClientResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n code?: string;\n data?: any;\n }>;\n}\n\nexport interface IApiGqlClient {\n query<T = any>(params: {\n query: string;\n variables?: Record<string, any>;\n }): Promise<IApiGqlClientResponse<T>>;\n mutation<T = any>(params: {\n mutation: string;\n variables?: Record<string, any>;\n }): Promise<IApiGqlClientResponse<T>>;\n}\n\nexport const ApiGqlClient = createAbstraction<IApiGqlClient>(\"ApiGqlClient\");\n\nexport namespace ApiGqlClient {\n export type Interface = IApiGqlClient;\n export type Response<T = any> = IApiGqlClientResponse<T>;\n}\n"],"names":["ApiGqlClient","createAbstraction"],"mappings":";AAsBO,MAAMA,eAAeC,kBAAiC"}
1
+ {"version":3,"file":"abstractions/ApiGqlClient.js","sources":["../../src/abstractions/ApiGqlClient.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction.js\";\n\nexport interface IApiGqlClientResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n code?: string;\n data?: any;\n }>;\n}\n\nexport interface IApiGqlClient {\n query<T = any>(params: {\n query: string;\n variables?: Record<string, any>;\n }): Promise<IApiGqlClientResponse<T>>;\n mutation<T = any>(params: {\n mutation: string;\n variables?: Record<string, any>;\n }): Promise<IApiGqlClientResponse<T>>;\n}\n\nexport const ApiGqlClient = createAbstraction<IApiGqlClient>(\"ApiGqlClient\");\n\nexport namespace ApiGqlClient {\n export type Interface = IApiGqlClient;\n export type Response<T = any> = IApiGqlClientResponse<T>;\n}\n"],"names":["ApiGqlClient","createAbstraction"],"mappings":";AAsBO,MAAMA,eAAeC,kBAAiC"}
@@ -1,4 +1,4 @@
1
- import { createAbstraction } from "@webiny/project/abstractions/createAbstraction";
1
+ import { createAbstraction } from "@webiny/project/abstractions/createAbstraction.js";
2
2
  const InvokeLambdaFunction = createAbstraction("InvokeLambdaFunction");
3
3
  export { InvokeLambdaFunction };
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"abstractions/InvokeLambdaFunction.js","sources":["../../src/abstractions/InvokeLambdaFunction.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction\";\n\nexport interface IInvokeLambdaFunctionParams {\n functionName: string;\n payload: Record<string, any>;\n invocationType?: \"RequestResponse\" | \"Event\";\n}\n\nexport interface IInvokeLambdaFunctionResult<T = any> {\n statusCode?: number;\n payload: T;\n}\n\nexport interface IInvokeLambdaFunction {\n execute<T = any>(params: IInvokeLambdaFunctionParams): Promise<IInvokeLambdaFunctionResult<T>>;\n}\n\nexport const InvokeLambdaFunction =\n createAbstraction<IInvokeLambdaFunction>(\"InvokeLambdaFunction\");\n\nexport namespace InvokeLambdaFunction {\n export type Interface = IInvokeLambdaFunction;\n export type Params = IInvokeLambdaFunctionParams;\n export type Result<T = any> = IInvokeLambdaFunctionResult<T>;\n}\n"],"names":["InvokeLambdaFunction","createAbstraction"],"mappings":";AAiBO,MAAMA,uBACTC,kBAAyC"}
1
+ {"version":3,"file":"abstractions/InvokeLambdaFunction.js","sources":["../../src/abstractions/InvokeLambdaFunction.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction.js\";\n\nexport interface IInvokeLambdaFunctionParams {\n functionName: string;\n payload: Record<string, any>;\n invocationType?: \"RequestResponse\" | \"Event\";\n}\n\nexport interface IInvokeLambdaFunctionResult<T = any> {\n statusCode?: number;\n payload: T;\n}\n\nexport interface IInvokeLambdaFunction {\n execute<T = any>(params: IInvokeLambdaFunctionParams): Promise<IInvokeLambdaFunctionResult<T>>;\n}\n\nexport const InvokeLambdaFunction =\n createAbstraction<IInvokeLambdaFunction>(\"InvokeLambdaFunction\");\n\nexport namespace InvokeLambdaFunction {\n export type Interface = IInvokeLambdaFunction;\n export type Params = IInvokeLambdaFunctionParams;\n export type Result<T = any> = IInvokeLambdaFunctionResult<T>;\n}\n"],"names":["InvokeLambdaFunction","createAbstraction"],"mappings":";AAiBO,MAAMA,uBACTC,kBAAyC"}
@@ -1,3 +1,16 @@
1
+ /**
2
+ * The Cognito user pool's `passwordPolicy`, as the API stack outputs it. The admin reads the rule
3
+ * fields from `WEBINY_ADMIN_PASSWORD_POLICY`, in the shape of app-admin's `PasswordPolicy.Rules`.
4
+ */
5
+ export interface IApiStackOutputPasswordPolicy {
6
+ minimumLength?: number;
7
+ requireLowercase?: boolean;
8
+ requireNumbers?: boolean;
9
+ requireSymbols?: boolean;
10
+ requireUppercase?: boolean;
11
+ temporaryPasswordValidityDays?: number;
12
+ passwordHistorySize?: number;
13
+ }
1
14
  export interface IApiStackOutput {
2
15
  apiDomain?: string;
3
16
  apiUrl?: string;
@@ -5,7 +18,7 @@ export interface IApiStackOutput {
5
18
  graphqlLambdaRoleName?: string;
6
19
  cognitoAppClientId?: string;
7
20
  cognitoUserPoolId?: string;
8
- cognitoUserPoolPasswordPolicy?: string;
21
+ cognitoUserPoolPasswordPolicy?: IApiStackOutputPasswordPolicy;
9
22
  dynamoDbTable?: string;
10
23
  region?: string;
11
24
  websocketApiId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"abstractions/services/ApiStackOutputService.js","sources":["../../../src/abstractions/services/ApiStackOutputService.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction.js\";\n\nexport interface IApiStackOutput {\n apiDomain?: string;\n apiUrl?: string;\n graphqlLambdaRole?: string;\n graphqlLambdaRoleName?: string;\n cognitoAppClientId?: string;\n cognitoUserPoolId?: string;\n cognitoUserPoolPasswordPolicy?: string;\n dynamoDbTable?: string;\n region?: string;\n websocketApiId?: string;\n websocketApiUrl?: string;\n graphqlLambdaName?: string;\n backgroundTaskLambdaArn?: string;\n backgroundTaskStepFunctionArn?: string;\n fileManagerManageLambdaArn?: string;\n fileManagerManageLambdaRole?: string;\n fileManagerManageLambdaRoleName?: string;\n fileManagerDownloadLambdaArn?: string;\n [key: string]: any;\n}\n\nexport interface IApiStackOutputService {\n execute<TOutput extends IApiStackOutput = IApiStackOutput>(): Promise<TOutput | null>;\n}\n\nexport const ApiStackOutputService =\n createAbstraction<IApiStackOutputService>(\"ApiStackOutputService\");\n\nexport namespace ApiStackOutputService {\n export type Interface = IApiStackOutputService;\n export type Output = IApiStackOutput;\n}\n"],"names":["ApiStackOutputService","createAbstraction"],"mappings":";AA4BO,MAAMA,wBACTC,kBAA0C"}
1
+ {"version":3,"file":"abstractions/services/ApiStackOutputService.js","sources":["../../../src/abstractions/services/ApiStackOutputService.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/project/abstractions/createAbstraction.js\";\n\n/**\n * The Cognito user pool's `passwordPolicy`, as the API stack outputs it. The admin reads the rule\n * fields from `WEBINY_ADMIN_PASSWORD_POLICY`, in the shape of app-admin's `PasswordPolicy.Rules`.\n */\nexport interface IApiStackOutputPasswordPolicy {\n minimumLength?: number;\n requireLowercase?: boolean;\n requireNumbers?: boolean;\n requireSymbols?: boolean;\n requireUppercase?: boolean;\n temporaryPasswordValidityDays?: number;\n passwordHistorySize?: number;\n}\n\nexport interface IApiStackOutput {\n apiDomain?: string;\n apiUrl?: string;\n graphqlLambdaRole?: string;\n graphqlLambdaRoleName?: string;\n cognitoAppClientId?: string;\n cognitoUserPoolId?: string;\n cognitoUserPoolPasswordPolicy?: IApiStackOutputPasswordPolicy;\n dynamoDbTable?: string;\n region?: string;\n websocketApiId?: string;\n websocketApiUrl?: string;\n graphqlLambdaName?: string;\n backgroundTaskLambdaArn?: string;\n backgroundTaskStepFunctionArn?: string;\n fileManagerManageLambdaArn?: string;\n fileManagerManageLambdaRole?: string;\n fileManagerManageLambdaRoleName?: string;\n fileManagerDownloadLambdaArn?: string;\n [key: string]: any;\n}\n\nexport interface IApiStackOutputService {\n execute<TOutput extends IApiStackOutput = IApiStackOutput>(): Promise<TOutput | null>;\n}\n\nexport const ApiStackOutputService =\n createAbstraction<IApiStackOutputService>(\"ApiStackOutputService\");\n\nexport namespace ApiStackOutputService {\n export type Interface = IApiStackOutputService;\n export type Output = IApiStackOutput;\n}\n"],"names":["ApiStackOutputService","createAbstraction"],"mappings":";AA0CO,MAAMA,wBACTC,kBAA0C"}
package/admin.d.ts CHANGED
@@ -7,4 +7,10 @@ export declare const Admin: {
7
7
  paramName: import("zod").ZodString;
8
8
  value: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny>, import("zod").ZodNumber, import("zod").ZodBoolean]>;
9
9
  }, import("zod/v4/core").$strip>>;
10
+ ApiUrl: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
11
+ url: import("zod").ZodString;
12
+ }, import("zod/v4/core").$strip>>;
13
+ WebsocketsUrl: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
14
+ url: import("zod").ZodString;
15
+ }, import("zod/v4/core").$strip>>;
10
16
  };
package/admin.js CHANGED
@@ -1,7 +1,9 @@
1
- import { AdminBuildParam, AdminExtension } from "@webiny/project/extensions/index.js";
1
+ import { AdminApiUrl, AdminBuildParam, AdminExtension, AdminWebsocketsUrl } from "@webiny/project/extensions/index.js";
2
2
  const Admin = {
3
3
  Extension: AdminExtension,
4
- BuildParam: AdminBuildParam
4
+ BuildParam: AdminBuildParam,
5
+ ApiUrl: AdminApiUrl,
6
+ WebsocketsUrl: AdminWebsocketsUrl
5
7
  };
6
8
  export { Admin };
7
9
 
package/admin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sources":["../src/admin.ts"],"sourcesContent":["import { AdminExtension, AdminBuildParam } from \"@webiny/project/extensions/index.js\";\n\nexport const Admin = {\n Extension: AdminExtension,\n BuildParam: AdminBuildParam\n};\n"],"names":["Admin","AdminExtension","AdminBuildParam"],"mappings":";AAEO,MAAMA,QAAQ;IACjB,WAAWC;IACX,YAAYC;AAChB"}
1
+ {"version":3,"file":"admin.js","sources":["../src/admin.ts"],"sourcesContent":["import {\n AdminExtension,\n AdminBuildParam,\n AdminApiUrl,\n AdminWebsocketsUrl\n} from \"@webiny/project/extensions/index.js\";\n\nexport const Admin = {\n Extension: AdminExtension,\n BuildParam: AdminBuildParam,\n ApiUrl: AdminApiUrl,\n WebsocketsUrl: AdminWebsocketsUrl\n};\n"],"names":["Admin","AdminExtension","AdminBuildParam","AdminApiUrl","AdminWebsocketsUrl"],"mappings":";AAOO,MAAMA,QAAQ;IACjB,WAAWC;IACX,YAAYC;IACZ,QAAQC;IACR,eAAeC;AACnB"}
@@ -22,6 +22,14 @@ export declare function createApiApp(): {
22
22
  };
23
23
  addRoute: (routeParams: import("~/pulumi/index.js").AddRouteParams) => any;
24
24
  };
25
+ graphqlStream: {
26
+ role: import("@webiny/pulumi/PulumiAppResource").PulumiAppResource<typeof import("@pulumi/aws/iam/role").Role>;
27
+ functions: {
28
+ graphqlStream: import("@webiny/pulumi/PulumiAppResource").PulumiAppResource<typeof import("@pulumi/aws/lambda/function").Function>;
29
+ };
30
+ functionUrl: import("@webiny/pulumi/PulumiAppResource").PulumiAppResource<typeof import("@pulumi/aws/lambda/functionUrl").FunctionUrl>;
31
+ functionUrlDomain: import("@pulumi/pulumi").Output<string>;
32
+ };
25
33
  apiGateway: {
26
34
  api: import("@webiny/pulumi/PulumiAppResource").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/api").Api>;
27
35
  stage: import("@webiny/pulumi/PulumiAppResource").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/stage").Stage>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const ApiRoute: import("@webiny/project/extensions").ExtensionComponent<z.ZodObject<{
2
+ export declare const ApiRoute: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<z.ZodObject<{
3
3
  path: z.ZodString;
4
4
  method: z.ZodEnum<{
5
5
  ANY: "ANY";
@@ -8,6 +8,7 @@ import { zodSrcPath } from "@webiny/project/defineExtension/zodTypes/zodSrcPath.
8
8
  import { ExtensionSrcResolver } from "@webiny/project/utils/index.js";
9
9
  import { ApiPulumi } from "../pulumi/extensions/ApiPulumi.js";
10
10
  import { createPathResolver } from "@webiny/project";
11
+ import { deriveRouteName, toRouterPath } from "./routePath.js";
11
12
  const p = createPathResolver(import.meta.dirname);
12
13
  const HTTP_METHODS = [
13
14
  "DELETE",
@@ -19,16 +20,6 @@ const HTTP_METHODS = [
19
20
  "OPTIONS",
20
21
  "ANY"
21
22
  ];
22
- const METHOD_HANDLER = {
23
- DELETE: "onDelete",
24
- GET: "onGet",
25
- HEAD: "onHead",
26
- PATCH: "onPatch",
27
- POST: "onPost",
28
- PUT: "onPut",
29
- OPTIONS: "onOptions",
30
- ANY: "onAll"
31
- };
32
23
  const ApiRoute = defineExtension({
33
24
  type: "Api/Route",
34
25
  tags: {
@@ -62,37 +53,32 @@ const ApiRoute = defineExtension({
62
53
  defaultImport: alias,
63
54
  moduleSpecifier: importPath
64
55
  });
65
- const ctxPluginPath = "@webiny/api/plugins/ContextPlugin.js";
66
- if (!source.getImportDeclaration(ctxPluginPath)) {
56
+ const registerExtensionPluginPath = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
57
+ const existingRegisterExtensionPluginImport = source.getImportDeclaration(registerExtensionPluginPath);
58
+ if (existingRegisterExtensionPluginImport && !existingRegisterExtensionPluginImport.getNamedImports().some((i)=>"createRegisterExtensionPlugin" === i.getName())) existingRegisterExtensionPluginImport.addNamedImport("createRegisterExtensionPlugin");
59
+ else if (!existingRegisterExtensionPluginImport) {
67
60
  const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
68
61
  source.insertImportDeclaration(lastIdx, {
69
62
  namedImports: [
70
- "createContextPlugin"
63
+ "createRegisterExtensionPlugin"
71
64
  ],
72
- moduleSpecifier: ctxPluginPath
65
+ moduleSpecifier: registerExtensionPluginPath
73
66
  });
74
67
  }
75
- const handlerImportPath = "@webiny/handler";
76
- const existingHandlerImport = source.getImportDeclaration(handlerImportPath);
77
- const requiredHandlerImports = [
78
- "createRoute",
79
- "Route"
80
- ];
81
- if (existingHandlerImport) {
82
- const present = existingHandlerImport.getNamedImports().map((i)=>i.getName());
83
- for (const name of requiredHandlerImports)if (!present.includes(name)) existingHandlerImport.addNamedImport(name);
84
- } else {
68
+ const eventHandlerCorePath = "@webiny/event-handler-core";
69
+ if (!source.getImportDeclaration(eventHandlerCorePath)) {
85
70
  const lastIdx = source.getImportDeclarations()[source.getImportDeclarations().length - 1].getChildIndex() + 1;
86
71
  source.insertImportDeclaration(lastIdx, {
87
- namedImports: requiredHandlerImports,
88
- moduleSpecifier: handlerImportPath
72
+ namedImports: [
73
+ "createHttpRouteDefinition"
74
+ ],
75
+ moduleSpecifier: eventHandlerCorePath
89
76
  });
90
77
  }
91
- const onMethod = METHOD_HANDLER[params.method];
92
- const routePath = params.path;
93
78
  const pluginsArray = source.getFirstDescendant((node)=>Node.isArrayLiteralExpression(node));
94
- pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${alias});\n})`);
95
- pluginsArray.addElement(`\ncreateRoute(({ ${onMethod}, context }) => {\n\t${onMethod}("${routePath}", async (request, reply) => {\n\t\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\n\t\treturn instance.execute(request, reply);\n\t});\n})`);
79
+ const routerPath = toRouterPath(params.path);
80
+ const routeName = params.routeName ?? deriveRouteName(params.path, params.method);
81
+ pluginsArray.addElement(`\ncreateRegisterExtensionPlugin(ctx => {\n\tctx.container.register(\n\t\tcreateHttpRouteDefinition({\n\t\t\tname: "${routeName}",\n\t\t\tmethod: "${params.method}",\n\t\t\tpath: "${routerPath}",\n\t\t\thandler: ${alias}\n\t\t})\n\t);\n})`);
96
82
  await source.save();
97
83
  },
98
84
  render () {
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ApiRoute.js","sources":["../../src/extensions/ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi } from \"~/pulumi/extensions/ApiPulumi.js\";\nimport { createPathResolver } from \"@webiny/project\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nconst HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\", \"ANY\"] as const;\n\nconst METHOD_HANDLER: Record<string, string> = {\n DELETE: \"onDelete\",\n GET: \"onGet\",\n HEAD: \"onHead\",\n PATCH: \"onPatch\",\n POST: \"onPost\",\n PUT: \"onPut\",\n OPTIONS: \"onOptions\",\n ANY: \"onAll\"\n};\n\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Register a custom REST route on the API Gateway + GraphQL Lambda.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // TODO: add zodSrcPath abstraction validation once Route abstraction is wired to zodSrcPath.\n src: zodSrcPath({ project }),\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Skip if the route handler is already registered.\n if (source.getImportDeclaration(importPath)) {\n return;\n }\n\n // Insert handler import after the last existing import.\n let insertIndex = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;\n }\n\n source.insertImportDeclaration(insertIndex, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n\n // Ensure createContextPlugin import exists.\n const ctxPluginPath = \"@webiny/api/plugins/ContextPlugin.js\";\n if (!source.getImportDeclaration(ctxPluginPath)) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: ctxPluginPath\n });\n }\n\n // Ensure createRoute and Route are imported from @webiny/handler.\n const handlerImportPath = \"@webiny/handler\";\n const existingHandlerImport = source.getImportDeclaration(handlerImportPath);\n const requiredHandlerImports = [\"createRoute\", \"Route\"];\n if (!existingHandlerImport) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: requiredHandlerImports,\n moduleSpecifier: handlerImportPath\n });\n } else {\n const present = existingHandlerImport.getNamedImports().map(i => i.getName());\n for (const name of requiredHandlerImports) {\n if (!present.includes(name)) {\n existingHandlerImport.addNamedImport(name);\n }\n }\n }\n\n const onMethod = METHOD_HANDLER[params.method];\n const routePath = params.path as `/${string}`;\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n // Register factory in DI container.\n pluginsArray.addElement(\n `\\ncreateContextPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${alias});\\n})`\n );\n\n // Register Fastify route with hardcoded path/method.\n // We use resolveAll(Route) + instanceof to find the correct handler when multiple\n // Api.Route extensions are registered.\n pluginsArray.addElement(\n `\\ncreateRoute(({ ${onMethod}, context }) => {\\n` +\n `\\t${onMethod}(\"${routePath}\", async (request, reply) => {\\n` +\n `\\t\\tconst instance = context.container.resolveAll(Route).find(i => i instanceof ${alias})!;\\n` +\n `\\t\\treturn instance.execute(request, reply);\\n` +\n `\\t});\\n` +\n `})`\n );\n\n await source.save();\n },\n render() {\n return <ApiPulumi src={p(\"RegisterRoutesPulumi.js\")} />;\n }\n});\n"],"names":["p","createPathResolver","HTTP_METHODS","METHOD_HANDLER","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","importPath","path","tsProject","Project","source","insertIndex","importDeclarations","ctxPluginPath","lastIdx","handlerImportPath","existingHandlerImport","requiredHandlerImports","present","i","name","onMethod","routePath","pluginsArray","node","Node","ApiPulumi"],"mappings":"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"}
1
+ {"version":3,"file":"extensions/ApiRoute.js","sources":["../../src/extensions/ApiRoute.tsx"],"sourcesContent":["import React from \"react\";\nimport path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { zodSrcPath } from \"@webiny/project/defineExtension/zodTypes/zodSrcPath.js\";\nimport { ExtensionSrcResolver } from \"@webiny/project/utils/index.js\";\nimport { ApiPulumi } from \"~/pulumi/extensions/ApiPulumi.js\";\nimport { createPathResolver } from \"@webiny/project\";\nimport { deriveRouteName, toRouterPath } from \"./routePath.js\";\n\nconst p = createPathResolver(import.meta.dirname);\n\nconst HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\", \"ANY\"] as const;\n\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Register a custom REST route on the API Gateway + GraphQL Lambda.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n // Path parameters may be written `{orderId}` (API Gateway) or `:orderId` (the DI\n // router). Both are accepted and converted per consumer — see `routePath.ts`.\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // The `src` file must default-export a route HANDLER — the result of\n // `HttpRouteHandler.createImplementation` from `@webiny/event-handler-core`. It does\n // NOT declare its own method/path: the `HttpRouteDefinition` the router matches on is\n // generated below from the props here, so the route the gateway forwards to and the\n // route the router matches cannot drift apart.\n src: zodSrcPath({ project }),\n // Doubles as the route's DI name, so a decorator on HttpRouteDefinition can pick this\n // route out by it. Derived from path + method when omitted, same as the Pulumi name.\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const importPath = path\n .relative(path.dirname(extensionsTsFilePath), absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Skip if the route handler is already registered.\n if (source.getImportDeclaration(importPath)) {\n return;\n }\n\n // Insert handler import after the last existing import.\n let insertIndex = 1;\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n insertIndex = importDeclarations[importDeclarations.length - 1].getChildIndex() + 1;\n }\n\n source.insertImportDeclaration(insertIndex, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n\n // Ensure createRegisterExtensionPlugin import exists.\n const registerExtensionPluginPath = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\n const existingRegisterExtensionPluginImport = source.getImportDeclaration(\n registerExtensionPluginPath\n );\n if (\n existingRegisterExtensionPluginImport &&\n !existingRegisterExtensionPluginImport\n .getNamedImports()\n .some(i => i.getName() === \"createRegisterExtensionPlugin\")\n ) {\n // BuildParam imports `createRegisterBuildParamPlugin` from the same path.\n existingRegisterExtensionPluginImport.addNamedImport(\"createRegisterExtensionPlugin\");\n } else if (!existingRegisterExtensionPluginImport) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: [\"createRegisterExtensionPlugin\"],\n moduleSpecifier: registerExtensionPluginPath\n });\n }\n\n // Ensure createHttpRouteDefinition import exists.\n const eventHandlerCorePath = \"@webiny/event-handler-core\";\n if (!source.getImportDeclaration(eventHandlerCorePath)) {\n const lastIdx =\n source\n .getImportDeclarations()\n [source.getImportDeclarations().length - 1].getChildIndex() + 1;\n source.insertImportDeclaration(lastIdx, {\n namedImports: [\"createHttpRouteDefinition\"],\n moduleSpecifier: eventHandlerCorePath\n });\n }\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n // Register an HttpRouteDefinition built from the props above. The router matches on\n // definitions and only then builds the handler, so registering the handler alone would\n // leave the route unreachable: it deploys, API Gateway forwards to the Lambda, and dispatch\n // finds nothing. The path is converted to the router's `:param` syntax.\n const routerPath = toRouterPath(params.path);\n const routeName = params.routeName ?? deriveRouteName(params.path, params.method);\n\n pluginsArray.addElement(\n `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tctx.container.register(\\n\\t\\tcreateHttpRouteDefinition({\\n\\t\\t\\tname: \"${routeName}\",\\n\\t\\t\\tmethod: \"${params.method}\",\\n\\t\\t\\tpath: \"${routerPath}\",\\n\\t\\t\\thandler: ${alias}\\n\\t\\t})\\n\\t);\\n})`\n );\n\n await source.save();\n },\n render() {\n return <ApiPulumi src={p(\"RegisterRoutesPulumi.js\")} />;\n }\n});\n"],"names":["p","createPathResolver","HTTP_METHODS","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","importPath","path","tsProject","Project","source","insertIndex","importDeclarations","registerExtensionPluginPath","existingRegisterExtensionPluginImport","i","lastIdx","eventHandlerCorePath","pluginsArray","node","Node","routerPath","toRouterPath","routeName","deriveRouteName","ApiPulumi"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import { ApiAfterDeploy } from "@webiny/project/abstractions/index.js";
2
2
  import { UiService } from "@webiny/project/abstractions/services/UiService.js";
3
3
  import { LoggerService } from "@webiny/project/abstractions/services/LoggerService.js";
4
- import { GetProjectConfigService } from "@webiny/project/abstractions";
4
+ import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
5
5
  import { ApiGqlClient } from "../../../abstractions/ApiGqlClient.js";
6
6
  declare class AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface {
7
7
  private apiGqlClient;
@@ -1,7 +1,6 @@
1
- import { ApiAfterDeploy } from "@webiny/project/abstractions/index.js";
1
+ import { ApiAfterDeploy, GetProjectConfigService } from "@webiny/project/abstractions/index.js";
2
2
  import { UiService } from "@webiny/project/abstractions/services/UiService.js";
3
3
  import { LoggerService } from "@webiny/project/abstractions/services/LoggerService.js";
4
- import { GetProjectConfigService } from "@webiny/project/abstractions";
5
4
  import { ApiGqlClient } from "../../../abstractions/ApiGqlClient.js";
6
5
  const IS_INSTALLED_QUERY = `
7
6
  query IsSystemInstalled {