@webiny/api-event-handler-aws 0.0.0-unstable.7c2def32a7 → 0.0.0-unstable.e9333b3f0b
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/registerInboundEventTypes.js +1 -2
- package/composition/registerInboundEventTypes.js.map +1 -1
- package/composition/registerWebinyApiChild.js +1 -4
- package/composition/registerWebinyApiChild.js.map +1 -1
- package/composition/registerWebinyApiRoot.d.ts +2 -2
- package/composition/registerWebinyApiRoot.js +2 -0
- package/composition/registerWebinyApiRoot.js.map +1 -1
- package/composition/types.d.ts +6 -0
- package/createWebinyApiHandler.js.map +1 -1
- package/package.json +19 -19
- package/publicUrls/ManifestPublicUrls.d.ts +0 -15
- package/publicUrls/ManifestPublicUrls.js +0 -19
- package/publicUrls/ManifestPublicUrls.js.map +0 -1
- package/publicUrls/feature.d.ts +0 -4
- package/publicUrls/feature.js +0 -11
- package/publicUrls/feature.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BackgroundTaskEventType, ScheduledActionEventType } from "@webiny/event-handler-
|
|
2
|
-
import { EventBridgeEventType, WebSocketEventType } from "@webiny/event-handler-aws";
|
|
1
|
+
import { BackgroundTaskEventType, EventBridgeEventType, ScheduledActionEventType, WebSocketEventType } from "@webiny/event-handler-aws";
|
|
3
2
|
import { BackgroundTasksAwsFeature } from "@webiny/background-tasks-aws";
|
|
4
3
|
import { BulkActionsEventBridgeLambdaHandlerFeature } from "@webiny/api-headless-cms-bulk-actions-aws";
|
|
5
4
|
import { ScheduledActionLambdaHandler } from "@webiny/api-scheduler";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition/registerInboundEventTypes.js","sources":["../../src/composition/registerInboundEventTypes.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport {
|
|
1
|
+
{"version":3,"file":"composition/registerInboundEventTypes.js","sources":["../../src/composition/registerInboundEventTypes.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport {\n BackgroundTaskEventType,\n EventBridgeEventType,\n ScheduledActionEventType,\n WebSocketEventType\n} from \"@webiny/event-handler-aws\";\nimport { BackgroundTasksAwsFeature } from \"@webiny/background-tasks-aws\";\nimport { BulkActionsEventBridgeLambdaHandlerFeature } from \"@webiny/api-headless-cms-bulk-actions-aws\";\nimport { ScheduledActionLambdaHandler } from \"@webiny/api-scheduler\";\n\n/**\n * Registers every NON-HTTP way this Lambda can be invoked: the event type that recognises the\n * payload shape, plus the handler the dispatcher resolves once it matches. (The HTTP transport is\n * registered by `ApiGatewayFeature`, which also brings the router.)\n *\n * Both halves are required. An event type with no handler resolves to an empty handler chain and\n * the invocation silently does nothing; a handler with no event type fails the dispatch outright\n * with \"No event type matched the incoming event\".\n *\n * This lives in one function so the set is testable, and so an inbound transport cannot be\n * half-wired. Two bugs of exactly that shape have already shipped: WebSockets ($connect never\n * dispatched, so server→client push was dead) and EventBridge Scheduler (schedules were created\n * and fired, but the invocation was rejected, so scheduled publishing silently never happened).\n */\nexport function registerInboundEventTypes(container: Container): void {\n // Background task invocations (Step Functions → Lambda directly). BackgroundTasksAwsFeature\n // registers the Lambda handler + StepFunctionService (the AWS dispatch transport).\n container.register(BackgroundTaskEventType);\n BackgroundTasksAwsFeature.register(container);\n\n // EventBridge invocations (e.g. scheduled empty-trash-bin).\n container.register(EventBridgeEventType);\n BulkActionsEventBridgeLambdaHandlerFeature.register(container);\n\n // EventBridge Scheduler invocations (a scheduled publish/unpublish firing). SchedulerAwsFeature\n // wires only the OUTBOUND side (creating the schedule), so the inbound half belongs here.\n container.register(ScheduledActionEventType);\n container.register(ScheduledActionLambdaHandler);\n\n // API Gateway WebSocket invocations ($connect/$disconnect/$default). The connection handlers\n // come from WebsocketsFeature in the per-request stack.\n container.register(WebSocketEventType);\n}\n"],"names":["registerInboundEventTypes","container","BackgroundTaskEventType","BackgroundTasksAwsFeature","EventBridgeEventType","BulkActionsEventBridgeLambdaHandlerFeature","ScheduledActionEventType","ScheduledActionLambdaHandler","WebSocketEventType"],"mappings":";;;;AAyBO,SAASA,0BAA0BC,SAAoB;IAG1DA,UAAU,QAAQ,CAACC;IACnBC,0BAA0B,QAAQ,CAACF;IAGnCA,UAAU,QAAQ,CAACG;IACnBC,2CAA2C,QAAQ,CAACJ;IAIpDA,UAAU,QAAQ,CAACK;IACnBL,UAAU,QAAQ,CAACM;IAInBN,UAAU,QAAQ,CAACO;AACvB"}
|
|
@@ -2,14 +2,11 @@ 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";
|
|
6
5
|
async function registerWebinyApiChild(container, config) {
|
|
7
6
|
await registerApiRequestStack(container, {
|
|
8
7
|
extensions: config.extensions,
|
|
8
|
+
registerRequestStorage: config.registerRequestStorage,
|
|
9
9
|
transports: {
|
|
10
|
-
publicUrls: (c)=>{
|
|
11
|
-
ManifestPublicUrlsFeature.register(c);
|
|
12
|
-
},
|
|
13
10
|
realtime: (c)=>{
|
|
14
11
|
WebsocketsAwsFeature.register(c);
|
|
15
12
|
},
|
|
@@ -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
|
|
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 registerRequestStorage: config.registerRequestStorage,\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":";;;;AAcO,eAAeA,uBAClBC,SAAoB,EACpBC,MAAkC;IAElC,MAAMC,wBAAwBF,WAAW;QACrC,YAAYC,OAAO,UAAU;QAC7B,wBAAwBA,OAAO,sBAAsB;QACrD,YAAY;YAGR,UAAUE,CAAAA;gBACNC,qBAAqB,QAAQ,CAACD;YAClC;YAEA,WAAWA,CAAAA;gBACPE,oBAAoB,QAAQ,CAACF;YACjC;YAEA,aAAaA,CAAAA;gBACTG,qBAAqB,QAAQ,CAACH,GAAG,CAAC;YACtC;QACJ;IACJ;AACJ"}
|
|
@@ -2,7 +2,7 @@ import type { Container } from "@webiny/di";
|
|
|
2
2
|
import type { getDocumentClient } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
3
3
|
import type { WebinyApiCompositionConfig } from "./types.js";
|
|
4
4
|
/**
|
|
5
|
-
* ROOT container registration that is not transport-specific: database,
|
|
6
|
-
* variant. Shared by both AWS Lambda composition roots.
|
|
5
|
+
* ROOT container registration that is not transport-specific: database, identity providers, and the
|
|
6
|
+
* storage variant. Shared by both AWS Lambda composition roots.
|
|
7
7
|
*/
|
|
8
8
|
export declare function registerWebinyApiRoot(container: Container, config: WebinyApiCompositionConfig, documentClient: ReturnType<typeof getDocumentClient>): Promise<void>;
|
|
@@ -2,10 +2,12 @@ import { DynamoDBCoreFeature } from "@webiny/db-dynamodb";
|
|
|
2
2
|
import { GraphQLSchemaCacheFeature } from "@webiny/api-graphql";
|
|
3
3
|
import { EncryptionKeyCacheFeature } from "@webiny/api-core/features/encryption/index.js";
|
|
4
4
|
import { JwksStoreFeature } from "@webiny/api-core/idp/index.js";
|
|
5
|
+
import { CognitoIdpFeature } from "@webiny/cognito/api/features/CognitoIdp/feature.js";
|
|
5
6
|
async function registerWebinyApiRoot(container, config, documentClient) {
|
|
6
7
|
DynamoDBCoreFeature.register(container, {
|
|
7
8
|
documentClient
|
|
8
9
|
});
|
|
10
|
+
CognitoIdpFeature.register(container);
|
|
9
11
|
GraphQLSchemaCacheFeature.register(container);
|
|
10
12
|
EncryptionKeyCacheFeature.register(container);
|
|
11
13
|
JwksStoreFeature.register(container);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition/registerWebinyApiRoot.js","sources":["../../src/composition/registerWebinyApiRoot.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport type { getDocumentClient } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { DynamoDBCoreFeature } from \"@webiny/db-dynamodb\";\nimport { GraphQLSchemaCacheFeature } from \"@webiny/api-graphql\";\nimport { EncryptionKeyCacheFeature } from \"@webiny/api-core/features/encryption/index.js\";\nimport { JwksStoreFeature } from \"@webiny/api-core/idp/index.js\";\nimport type { WebinyApiCompositionConfig } from \"./types.js\";\n\n/**\n * ROOT container registration that is not transport-specific: database,
|
|
1
|
+
{"version":3,"file":"composition/registerWebinyApiRoot.js","sources":["../../src/composition/registerWebinyApiRoot.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport type { getDocumentClient } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { DynamoDBCoreFeature } from \"@webiny/db-dynamodb\";\nimport { GraphQLSchemaCacheFeature } from \"@webiny/api-graphql\";\nimport { EncryptionKeyCacheFeature } from \"@webiny/api-core/features/encryption/index.js\";\nimport { JwksStoreFeature } from \"@webiny/api-core/idp/index.js\";\n// CognitoIdpFeature must be in the root container so the request auth step\n// (identity loader decorator → RequestIdentityLoader) sees CognitoIdentityProvider when it is first\n// instantiated. Extensions register in the child/request container — too late.\nimport { CognitoIdpFeature } from \"@webiny/cognito/api/features/CognitoIdp/feature.js\";\nimport type { WebinyApiCompositionConfig } from \"./types.js\";\n\n/**\n * ROOT container registration that is not transport-specific: database, identity providers, and the\n * storage variant. Shared by both AWS Lambda composition roots.\n */\nexport async function registerWebinyApiRoot(\n container: Container,\n config: WebinyApiCompositionConfig,\n documentClient: ReturnType<typeof getDocumentClient>\n): Promise<void> {\n // ── Database ───────────────────────────────────────────────\n DynamoDBCoreFeature.register(container, { documentClient });\n\n // ── Identity providers ─────────────────────────────────────\n // Must be in root so the request auth step can authenticate requests before the GraphQL engine\n // runs.\n CognitoIdpFeature.register(container);\n\n // ── GraphQL schema cache ───────────────────────────────────\n // Root, so a built schema outlives the request that built it: one build per Lambda instance\n // instead of one per request.\n GraphQLSchemaCacheFeature.register(container);\n\n // ── Encryption key cache ───────────────────────────────────\n // Root, so the scrypt-derived key is computed once per Lambda instance instead of per request.\n EncryptionKeyCacheFeature.register(container);\n // Root, so identity providers' signing keys are fetched once per process, not per request.\n JwksStoreFeature.register(container);\n\n // ── Storage (variant-specific: CMS storage ops, DDB registries, OpenSearch core) ──\n await config.registerRootStorage(container, { documentClient });\n}\n"],"names":["registerWebinyApiRoot","container","config","documentClient","DynamoDBCoreFeature","CognitoIdpFeature","GraphQLSchemaCacheFeature","EncryptionKeyCacheFeature","JwksStoreFeature"],"mappings":";;;;;AAgBO,eAAeA,sBAClBC,SAAoB,EACpBC,MAAkC,EAClCC,cAAoD;IAGpDC,oBAAoB,QAAQ,CAACH,WAAW;QAAEE;IAAe;IAKzDE,kBAAkB,QAAQ,CAACJ;IAK3BK,0BAA0B,QAAQ,CAACL;IAInCM,0BAA0B,QAAQ,CAACN;IAEnCO,iBAAiB,QAAQ,CAACP;IAG1B,MAAMC,OAAO,mBAAmB,CAACD,WAAW;QAAEE;IAAe;AACjE"}
|
package/composition/types.d.ts
CHANGED
|
@@ -27,4 +27,10 @@ export interface WebinyApiCompositionConfig {
|
|
|
27
27
|
* variant package.
|
|
28
28
|
*/
|
|
29
29
|
registerRootStorage: (container: Container, ctx: RegisterRootStorageContext) => void | Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Register any request-phase storage features that must run BEFORE `HeadlessCmsFeature` builds
|
|
32
|
+
* its storage — e.g. `DbRegistryFeature` for the DDB+ES variant. Per-request storage
|
|
33
|
+
* state (the CMS storage operations) goes here too. Optional.
|
|
34
|
+
*/
|
|
35
|
+
registerRequestStorage?: (container: Container) => void | Promise<void>;
|
|
30
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWebinyApiHandler.js","sources":["../src/createWebinyApiHandler.ts"],"sourcesContent":["/**\n * DI-native Webiny API handler for the AWS Lambda transport — storage-agnostic BASE.\n *\n * The ROOT container wires the AWS transport (API Gateway HTTP + auth/tenant loaders, background-task\n * and WebSocket Lambda invocations, DynamoDB, Cognito, storage). Everything that is not\n * transport-specific — database, identity providers, storage, and the transport-AGNOSTIC per-request\n * feature stack — lives in `composition/`, shared with the response-streaming handler\n * (`createWebinyStreamApiHandler`) so the two roots cannot drift. The storage variant is injected via\n * `registerRootStorage` by a thin variant package\n * (`@webiny/api-event-handler-aws-ddb`, `-aws-ddb-os`). Keeping the wiring in real packages (not an app\n * template) is what makes it unit/integration testable.\n */\nimport { getDocumentClient } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createLambdaHandler, ApiGatewayFeature } from \"@webiny/event-handler-aws\";\nimport { ApiGatewayIdentityLoaderDecorator } from \"~/handlers/ApiGatewayIdentityLoaderDecorator.js\";\nimport { ApiGatewayTenantLoaderDecorator } from \"~/handlers/ApiGatewayTenantLoaderDecorator.js\";\nimport { ApiGatewayAssumePermissionsDecorator } from \"~/handlers/ApiGatewayAssumePermissionsDecorator.js\";\nimport {\n registerInboundEventTypes,\n registerWebinyApiChild,\n registerWebinyApiRoot\n} from \"~/composition/index.js\";\nimport type { WebinyApiCompositionConfig } from \"~/composition/index.js\";\n\nexport type { RegisterRootStorageContext } from \"~/composition/index.js\";\n\nexport type CreateWebinyApiHandlerConfig = WebinyApiCompositionConfig;\n\nexport function createWebinyApiHandler(config: CreateWebinyApiHandlerConfig) {\n return createLambdaHandler({\n root: async container => {\n // ── Transport ──────────────────────────────────────────────\n // ApiGatewayFeature registers the HTTP transport (event type + router + HttpFeature).\n ApiGatewayFeature.register(container);\n\n // ── Tenant + auth (extract → shared load) ──────────────────\n // These decorators depend on api-core (RequestTenantLoader/RequestIdentityLoader), so\n // they live in this composition layer, not event-handler-aws. registerDecorator applies\n // LATER registrations as the OUTER wrapper (whose execute() runs first). TENANT must be\n // established before IDENTITY: API-key authentication resolves the key by tenant partition\n // (ApiKeysRepository reads TenantContext.getTenant()), so identity establishment depends on\n // the tenant. The reverse is not true — RequestTenantLoader has no identity dependency. So\n // register identity first (inner) and tenant last (outer) → tenant runs, then identity,\n // then the router.\n container.registerDecorator(ApiGatewayIdentityLoaderDecorator);\n container.registerDecorator(ApiGatewayTenantLoaderDecorator);\n\n /*\n * Preview-as. Outermost, so the header lands in RawAssumePermissions before anything\n * can ask for permissions. Order is not load-bearing beyond that: the holder is read\n * lazily, and AssumedPermissions checks the caller's real permissions before it\n * honours the header.\n */\n container.registerDecorator(ApiGatewayAssumePermissionsDecorator);\n\n // Every non-HTTP invocation shape (background tasks, EventBridge, scheduled actions,\n // WebSockets) with its handler. Kept in one function so the set is testable and an\n // inbound transport can't be half-wired.\n registerInboundEventTypes(container);\n\n // Resolved here rather than at factory time: one bundle exports BOTH this handler and the\n // streaming one, so building the client eagerly would open a second DynamoDB client on\n // every cold start. `root` runs once, lazily.\n await registerWebinyApiRoot(\n container,\n config,\n config.documentClient ?? getDocumentClient()\n );\n },\n\n child: async container => {\n await registerWebinyApiChild(container, config);\n }\n });\n}\n"],"names":["createWebinyApiHandler","config","createLambdaHandler","container","ApiGatewayFeature","ApiGatewayIdentityLoaderDecorator","ApiGatewayTenantLoaderDecorator","ApiGatewayAssumePermissionsDecorator","registerInboundEventTypes","registerWebinyApiRoot","getDocumentClient","registerWebinyApiChild"],"mappings":";;;;;;AA4BO,SAASA,uBAAuBC,MAAoC;IACvE,OAAOC,oBAAoB;QACvB,MAAM,OAAMC;YAGRC,kBAAkB,QAAQ,CAACD;YAW3BA,UAAU,iBAAiB,CAACE;YAC5BF,UAAU,iBAAiB,CAACG;YAQ5BH,UAAU,iBAAiB,CAACI;YAK5BC,0BAA0BL;YAK1B,MAAMM,sBACFN,WACAF,QACAA,OAAO,cAAc,IAAIS;QAEjC;QAEA,OAAO,OAAMP;YACT,MAAMQ,uBAAuBR,WAAWF;QAC5C;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"createWebinyApiHandler.js","sources":["../src/createWebinyApiHandler.ts"],"sourcesContent":["/**\n * DI-native Webiny API handler for the AWS Lambda transport — storage-agnostic BASE.\n *\n * The ROOT container wires the AWS transport (API Gateway HTTP + auth/tenant loaders, background-task\n * and WebSocket Lambda invocations, DynamoDB, Cognito, storage). Everything that is not\n * transport-specific — database, identity providers, storage, and the transport-AGNOSTIC per-request\n * feature stack — lives in `composition/`, shared with the response-streaming handler\n * (`createWebinyStreamApiHandler`) so the two roots cannot drift. The storage variant is injected via\n * `registerRootStorage` / `registerRequestStorage` by a thin variant package\n * (`@webiny/api-event-handler-aws-ddb`, `-aws-ddb-os`). Keeping the wiring in real packages (not an app\n * template) is what makes it unit/integration testable.\n */\nimport { getDocumentClient } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createLambdaHandler, ApiGatewayFeature } from \"@webiny/event-handler-aws\";\nimport { ApiGatewayIdentityLoaderDecorator } from \"~/handlers/ApiGatewayIdentityLoaderDecorator.js\";\nimport { ApiGatewayTenantLoaderDecorator } from \"~/handlers/ApiGatewayTenantLoaderDecorator.js\";\nimport { ApiGatewayAssumePermissionsDecorator } from \"~/handlers/ApiGatewayAssumePermissionsDecorator.js\";\nimport {\n registerInboundEventTypes,\n registerWebinyApiChild,\n registerWebinyApiRoot\n} from \"~/composition/index.js\";\nimport type { WebinyApiCompositionConfig } from \"~/composition/index.js\";\n\nexport type { RegisterRootStorageContext } from \"~/composition/index.js\";\n\nexport type CreateWebinyApiHandlerConfig = WebinyApiCompositionConfig;\n\nexport function createWebinyApiHandler(config: CreateWebinyApiHandlerConfig) {\n return createLambdaHandler({\n root: async container => {\n // ── Transport ──────────────────────────────────────────────\n // ApiGatewayFeature registers the HTTP transport (event type + router + HttpFeature).\n ApiGatewayFeature.register(container);\n\n // ── Tenant + auth (extract → shared load) ──────────────────\n // These decorators depend on api-core (RequestTenantLoader/RequestIdentityLoader), so\n // they live in this composition layer, not event-handler-aws. registerDecorator applies\n // LATER registrations as the OUTER wrapper (whose execute() runs first). TENANT must be\n // established before IDENTITY: API-key authentication resolves the key by tenant partition\n // (ApiKeysRepository reads TenantContext.getTenant()), so identity establishment depends on\n // the tenant. The reverse is not true — RequestTenantLoader has no identity dependency. So\n // register identity first (inner) and tenant last (outer) → tenant runs, then identity,\n // then the router.\n container.registerDecorator(ApiGatewayIdentityLoaderDecorator);\n container.registerDecorator(ApiGatewayTenantLoaderDecorator);\n\n /*\n * Preview-as. Outermost, so the header lands in RawAssumePermissions before anything\n * can ask for permissions. Order is not load-bearing beyond that: the holder is read\n * lazily, and AssumedPermissions checks the caller's real permissions before it\n * honours the header.\n */\n container.registerDecorator(ApiGatewayAssumePermissionsDecorator);\n\n // Every non-HTTP invocation shape (background tasks, EventBridge, scheduled actions,\n // WebSockets) with its handler. Kept in one function so the set is testable and an\n // inbound transport can't be half-wired.\n registerInboundEventTypes(container);\n\n // Resolved here rather than at factory time: one bundle exports BOTH this handler and the\n // streaming one, so building the client eagerly would open a second DynamoDB client on\n // every cold start. `root` runs once, lazily.\n await registerWebinyApiRoot(\n container,\n config,\n config.documentClient ?? getDocumentClient()\n );\n },\n\n child: async container => {\n await registerWebinyApiChild(container, config);\n }\n });\n}\n"],"names":["createWebinyApiHandler","config","createLambdaHandler","container","ApiGatewayFeature","ApiGatewayIdentityLoaderDecorator","ApiGatewayTenantLoaderDecorator","ApiGatewayAssumePermissionsDecorator","registerInboundEventTypes","registerWebinyApiRoot","getDocumentClient","registerWebinyApiChild"],"mappings":";;;;;;AA4BO,SAASA,uBAAuBC,MAAoC;IACvE,OAAOC,oBAAoB;QACvB,MAAM,OAAMC;YAGRC,kBAAkB,QAAQ,CAACD;YAW3BA,UAAU,iBAAiB,CAACE;YAC5BF,UAAU,iBAAiB,CAACG;YAQ5BH,UAAU,iBAAiB,CAACI;YAK5BC,0BAA0BL;YAK1B,MAAMM,sBACFN,WACAF,QACAA,OAAO,cAAc,IAAIS;QAEjC;QAEA,OAAO,OAAMP;YACT,MAAMQ,uBAAuBR,WAAWF;QAC5C;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.e9333b3f0b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -18,28 +18,28 @@
|
|
|
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/
|
|
32
|
-
"@webiny/
|
|
33
|
-
"@webiny/event-handler-
|
|
34
|
-
"@webiny/
|
|
35
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
21
|
+
"@webiny/api-core": "0.0.0-unstable.e9333b3f0b",
|
|
22
|
+
"@webiny/api-event-handler-core": "0.0.0-unstable.e9333b3f0b",
|
|
23
|
+
"@webiny/api-file-manager-s3": "0.0.0-unstable.e9333b3f0b",
|
|
24
|
+
"@webiny/api-graphql": "0.0.0-unstable.e9333b3f0b",
|
|
25
|
+
"@webiny/api-headless-cms-bulk-actions-aws": "0.0.0-unstable.e9333b3f0b",
|
|
26
|
+
"@webiny/api-scheduler": "0.0.0-unstable.e9333b3f0b",
|
|
27
|
+
"@webiny/api-scheduler-aws": "0.0.0-unstable.e9333b3f0b",
|
|
28
|
+
"@webiny/api-websockets-aws": "0.0.0-unstable.e9333b3f0b",
|
|
29
|
+
"@webiny/aws-sdk": "0.0.0-unstable.e9333b3f0b",
|
|
30
|
+
"@webiny/background-tasks-aws": "0.0.0-unstable.e9333b3f0b",
|
|
31
|
+
"@webiny/cognito": "0.0.0-unstable.e9333b3f0b",
|
|
32
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.e9333b3f0b",
|
|
33
|
+
"@webiny/event-handler-aws": "0.0.0-unstable.e9333b3f0b",
|
|
34
|
+
"@webiny/event-handler-core": "0.0.0-unstable.e9333b3f0b",
|
|
35
|
+
"@webiny/handler": "0.0.0-unstable.e9333b3f0b"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@webiny/di": "^
|
|
38
|
+
"@webiny/di": "^1.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
42
|
-
"@webiny/di": "
|
|
41
|
+
"@webiny/build-tools": "0.0.0-unstable.e9333b3f0b",
|
|
42
|
+
"@webiny/di": "1.1.0",
|
|
43
43
|
"rimraf": "6.1.3",
|
|
44
44
|
"typescript": "7.0.2",
|
|
45
45
|
"vitest": "4.1.11"
|
|
@@ -1,15 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/publicUrls/feature.d.ts
DELETED
package/publicUrls/feature.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|