@webiny/api-event-handler-aws 0.0.0-unstable.5387e5f7c8 → 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.
- package/composition/registerWebinyApiChild.js +4 -0
- package/composition/registerWebinyApiChild.js.map +1 -1
- package/package.json +17 -16
- package/publicUrls/ManifestPublicUrls.d.ts +15 -0
- package/publicUrls/ManifestPublicUrls.js +19 -0
- package/publicUrls/ManifestPublicUrls.js.map +1 -0
- package/publicUrls/feature.d.ts +4 -0
- package/publicUrls/feature.js +11 -0
- package/publicUrls/feature.js.map +1 -0
|
@@ -2,10 +2,14 @@ import { registerApiRequestStack } from "@webiny/api-event-handler-core";
|
|
|
2
2
|
import { WebsocketsAwsFeature } from "@webiny/api-websockets-aws";
|
|
3
3
|
import { SchedulerAwsFeature } from "@webiny/api-scheduler-aws";
|
|
4
4
|
import { FileManagerS3Feature } from "@webiny/api-file-manager-s3";
|
|
5
|
+
import { ManifestPublicUrlsFeature } from "../publicUrls/feature.js";
|
|
5
6
|
async function registerWebinyApiChild(container, config) {
|
|
6
7
|
await registerApiRequestStack(container, {
|
|
7
8
|
extensions: config.extensions,
|
|
8
9
|
transports: {
|
|
10
|
+
publicUrls: (c)=>{
|
|
11
|
+
ManifestPublicUrlsFeature.register(c);
|
|
12
|
+
},
|
|
9
13
|
realtime: (c)=>{
|
|
10
14
|
WebsocketsAwsFeature.register(c);
|
|
11
15
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition/registerWebinyApiChild.js","sources":["../../src/composition/registerWebinyApiChild.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { registerApiRequestStack } from \"@webiny/api-event-handler-core\";\nimport { WebsocketsAwsFeature } from \"@webiny/api-websockets-aws\";\nimport { SchedulerAwsFeature } from \"@webiny/api-scheduler-aws\";\nimport { FileManagerS3Feature } from \"@webiny/api-file-manager-s3\";\nimport type { WebinyApiCompositionConfig } from \"./types.js\";\n\n/**\n * Sets up the per-request CHILD container: the transport-agnostic feature stack (shared with the\n * server transport), with the AWS-specific interleave points supplied as the `transports` adapters.\n *\n * Named for the `child` lifecycle step of `HandlerConfig`, not \"request\", so it matches the contract\n * it implements.\n */\nexport async function registerWebinyApiChild(\n container: Container,\n config: WebinyApiCompositionConfig\n): Promise<void> {\n await registerApiRequestStack(container, {\n extensions: config.extensions,\n transports: {\n // Real AWS WebSocket transport (API Gateway Management API), registered right after\n // WebsocketsFeature so it overrides the NullWebsocketsTransport.\n realtime: c => {\n WebsocketsAwsFeature.register(c);\n },\n // Scheduler transport: the scheduler-aws extension (EventBridge Scheduler).\n scheduler: c => {\n SchedulerAwsFeature.register(c);\n },\n // File-manager storage transport: S3 (asset delivery + S3 file operations + schema).\n fileManager: c => {\n FileManagerS3Feature.register(c, {});\n }\n }\n });\n}\n"],"names":["registerWebinyApiChild","container","config","registerApiRequestStack","c","WebsocketsAwsFeature","SchedulerAwsFeature","FileManagerS3Feature"],"mappings":"
|
|
1
|
+
{"version":3,"file":"composition/registerWebinyApiChild.js","sources":["../../src/composition/registerWebinyApiChild.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { registerApiRequestStack } from \"@webiny/api-event-handler-core\";\nimport { WebsocketsAwsFeature } from \"@webiny/api-websockets-aws\";\nimport { SchedulerAwsFeature } from \"@webiny/api-scheduler-aws\";\nimport { FileManagerS3Feature } from \"@webiny/api-file-manager-s3\";\nimport { ManifestPublicUrlsFeature } from \"~/publicUrls/feature.js\";\nimport type { WebinyApiCompositionConfig } from \"./types.js\";\n\n/**\n * Sets up the per-request CHILD container: the transport-agnostic feature stack (shared with the\n * server transport), with the AWS-specific interleave points supplied as the `transports` adapters.\n *\n * Named for the `child` lifecycle step of `HandlerConfig`, not \"request\", so it matches the contract\n * it implements.\n */\nexport async function registerWebinyApiChild(\n container: Container,\n config: WebinyApiCompositionConfig\n): Promise<void> {\n await registerApiRequestStack(container, {\n extensions: config.extensions,\n transports: {\n // Public URLs: written to the service manifest by the `api` and `admin` Pulumi apps.\n publicUrls: c => {\n ManifestPublicUrlsFeature.register(c);\n },\n // Real AWS WebSocket transport (API Gateway Management API), registered right after\n // WebsocketsFeature so it overrides the NullWebsocketsTransport.\n realtime: c => {\n WebsocketsAwsFeature.register(c);\n },\n // Scheduler transport: the scheduler-aws extension (EventBridge Scheduler).\n scheduler: c => {\n SchedulerAwsFeature.register(c);\n },\n // File-manager storage transport: S3 (asset delivery + S3 file operations + schema).\n fileManager: c => {\n FileManagerS3Feature.register(c, {});\n }\n }\n });\n}\n"],"names":["registerWebinyApiChild","container","config","registerApiRequestStack","c","ManifestPublicUrlsFeature","WebsocketsAwsFeature","SchedulerAwsFeature","FileManagerS3Feature"],"mappings":";;;;;AAeO,eAAeA,uBAClBC,SAAoB,EACpBC,MAAkC;IAElC,MAAMC,wBAAwBF,WAAW;QACrC,YAAYC,OAAO,UAAU;QAC7B,YAAY;YAER,YAAYE,CAAAA;gBACRC,0BAA0B,QAAQ,CAACD;YACvC;YAGA,UAAUA,CAAAA;gBACNE,qBAAqB,QAAQ,CAACF;YAClC;YAEA,WAAWA,CAAAA;gBACPG,oBAAoB,QAAQ,CAACH;YACjC;YAEA,aAAaA,CAAAA;gBACTI,qBAAqB,QAAQ,CAACJ,GAAG,CAAC;YACtC;QACJ;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-event-handler-aws",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.a85ef555b2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -18,26 +18,27 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
22
|
-
"@webiny/api-event-handler-core": "0.0.0-unstable.
|
|
23
|
-
"@webiny/api-file-manager-s3": "0.0.0-unstable.
|
|
24
|
-
"@webiny/api-graphql": "0.0.0-unstable.
|
|
25
|
-
"@webiny/api-headless-cms-bulk-actions-aws": "0.0.0-unstable.
|
|
26
|
-
"@webiny/api-scheduler": "0.0.0-unstable.
|
|
27
|
-
"@webiny/api-scheduler-aws": "0.0.0-unstable.
|
|
28
|
-
"@webiny/api-websockets-aws": "0.0.0-unstable.
|
|
29
|
-
"@webiny/aws-sdk": "0.0.0-unstable.
|
|
30
|
-
"@webiny/background-tasks-aws": "0.0.0-unstable.
|
|
31
|
-
"@webiny/db-dynamodb": "0.0.0-unstable.
|
|
32
|
-
"@webiny/event-handler-aws": "0.0.0-unstable.
|
|
33
|
-
"@webiny/event-handler-core": "0.0.0-unstable.
|
|
34
|
-
"@webiny/
|
|
21
|
+
"@webiny/api-core": "0.0.0-unstable.a85ef555b2",
|
|
22
|
+
"@webiny/api-event-handler-core": "0.0.0-unstable.a85ef555b2",
|
|
23
|
+
"@webiny/api-file-manager-s3": "0.0.0-unstable.a85ef555b2",
|
|
24
|
+
"@webiny/api-graphql": "0.0.0-unstable.a85ef555b2",
|
|
25
|
+
"@webiny/api-headless-cms-bulk-actions-aws": "0.0.0-unstable.a85ef555b2",
|
|
26
|
+
"@webiny/api-scheduler": "0.0.0-unstable.a85ef555b2",
|
|
27
|
+
"@webiny/api-scheduler-aws": "0.0.0-unstable.a85ef555b2",
|
|
28
|
+
"@webiny/api-websockets-aws": "0.0.0-unstable.a85ef555b2",
|
|
29
|
+
"@webiny/aws-sdk": "0.0.0-unstable.a85ef555b2",
|
|
30
|
+
"@webiny/background-tasks-aws": "0.0.0-unstable.a85ef555b2",
|
|
31
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.a85ef555b2",
|
|
32
|
+
"@webiny/event-handler-aws": "0.0.0-unstable.a85ef555b2",
|
|
33
|
+
"@webiny/event-handler-core": "0.0.0-unstable.a85ef555b2",
|
|
34
|
+
"@webiny/feature": "0.0.0-unstable.a85ef555b2",
|
|
35
|
+
"@webiny/handler": "0.0.0-unstable.a85ef555b2"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"@webiny/di": "^2.0.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
41
|
+
"@webiny/build-tools": "0.0.0-unstable.a85ef555b2",
|
|
41
42
|
"@webiny/di": "2.0.0",
|
|
42
43
|
"rimraf": "6.1.3",
|
|
43
44
|
"typescript": "7.0.2",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PublicUrl } from "@webiny/api-core/features/publicUrls/index.js";
|
|
2
|
+
import { PublicUrls } from "@webiny/api-core/features/publicUrls/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* AWS: the `api` and `admin` Pulumi apps write their public URL (custom domain if set, CloudFront
|
|
5
|
+
* otherwise) into the service manifest at deploy time. The API is deployed before the Admin app, so
|
|
6
|
+
* the Admin URL is unknown until the Admin app has been deployed.
|
|
7
|
+
*/
|
|
8
|
+
declare class ManifestPublicUrlsImpl implements PublicUrls.Interface {
|
|
9
|
+
getApiUrl(): Promise<PublicUrl>;
|
|
10
|
+
getAdminUrl(): Promise<PublicUrl>;
|
|
11
|
+
}
|
|
12
|
+
export declare const ManifestPublicUrls: typeof ManifestPublicUrlsImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/publicUrls/abstractions").IPublicUrls>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PublicUrl, PublicUrls } from "@webiny/api-core/features/publicUrls/index.js";
|
|
2
|
+
import { ServiceDiscovery } from "@webiny/api-core/features/serviceDiscovery/index.js";
|
|
3
|
+
class ManifestPublicUrlsImpl {
|
|
4
|
+
async getApiUrl() {
|
|
5
|
+
const manifest = await ServiceDiscovery.load();
|
|
6
|
+
return PublicUrl.from(manifest?.api?.url);
|
|
7
|
+
}
|
|
8
|
+
async getAdminUrl() {
|
|
9
|
+
const manifest = await ServiceDiscovery.load();
|
|
10
|
+
return PublicUrl.from(manifest?.admin?.url);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const ManifestPublicUrls = PublicUrls.createImplementation({
|
|
14
|
+
implementation: ManifestPublicUrlsImpl,
|
|
15
|
+
dependencies: []
|
|
16
|
+
});
|
|
17
|
+
export { ManifestPublicUrls };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ManifestPublicUrls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicUrls/ManifestPublicUrls.js","sources":["../../src/publicUrls/ManifestPublicUrls.ts"],"sourcesContent":["import { PublicUrl } from \"@webiny/api-core/features/publicUrls/index.js\";\nimport { PublicUrls } from \"@webiny/api-core/features/publicUrls/index.js\";\nimport { ServiceDiscovery } from \"@webiny/api-core/features/serviceDiscovery/index.js\";\n\n/**\n * AWS: the `api` and `admin` Pulumi apps write their public URL (custom domain if set, CloudFront\n * otherwise) into the service manifest at deploy time. The API is deployed before the Admin app, so\n * the Admin URL is unknown until the Admin app has been deployed.\n */\nclass ManifestPublicUrlsImpl implements PublicUrls.Interface {\n async getApiUrl() {\n const manifest = await ServiceDiscovery.load();\n return PublicUrl.from(manifest?.api?.url);\n }\n\n async getAdminUrl() {\n const manifest = await ServiceDiscovery.load();\n return PublicUrl.from(manifest?.admin?.url);\n }\n}\n\nexport const ManifestPublicUrls = PublicUrls.createImplementation({\n implementation: ManifestPublicUrlsImpl,\n dependencies: []\n});\n"],"names":["ManifestPublicUrlsImpl","manifest","ServiceDiscovery","PublicUrl","ManifestPublicUrls","PublicUrls"],"mappings":";;AASA,MAAMA;IACF,MAAM,YAAY;QACd,MAAMC,WAAW,MAAMC,iBAAiB,IAAI;QAC5C,OAAOC,UAAU,IAAI,CAACF,UAAU,KAAK;IACzC;IAEA,MAAM,cAAc;QAChB,MAAMA,WAAW,MAAMC,iBAAiB,IAAI;QAC5C,OAAOC,UAAU,IAAI,CAACF,UAAU,OAAO;IAC3C;AACJ;AAEO,MAAMG,qBAAqBC,WAAW,oBAAoB,CAAC;IAC9D,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ManifestPublicUrls } from "./ManifestPublicUrls.js";
|
|
3
|
+
const ManifestPublicUrlsFeature = createFeature({
|
|
4
|
+
name: "ManifestPublicUrlsFeature",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ManifestPublicUrls);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { ManifestPublicUrlsFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicUrls/feature.js","sources":["../../src/publicUrls/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ManifestPublicUrls } from \"./ManifestPublicUrls.js\";\n\nexport const ManifestPublicUrlsFeature = createFeature({\n name: \"ManifestPublicUrlsFeature\",\n register(container) {\n container.register(ManifestPublicUrls);\n }\n});\n"],"names":["ManifestPublicUrlsFeature","createFeature","container","ManifestPublicUrls"],"mappings":";;AAGO,MAAMA,4BAA4BC,cAAc;IACnD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|