@webiny/api-event-handler-core 6.6.0-alpha.0 → 6.6.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-event-handler-core",
3
- "version": "6.6.0-alpha.0",
3
+ "version": "6.6.0-alpha.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -18,39 +18,39 @@
18
18
  ],
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@webiny/api-aco": "6.6.0-alpha.0",
22
- "@webiny/api-audit-logs": "6.6.0-alpha.0",
23
- "@webiny/api-core": "6.6.0-alpha.0",
24
- "@webiny/api-file-manager": "6.6.0-alpha.0",
25
- "@webiny/api-file-manager-aco": "6.6.0-alpha.0",
26
- "@webiny/api-graphql": "6.6.0-alpha.0",
27
- "@webiny/api-headless-cms": "6.6.0-alpha.0",
28
- "@webiny/api-headless-cms-aco": "6.6.0-alpha.0",
29
- "@webiny/api-headless-cms-scheduler": "6.6.0-alpha.0",
30
- "@webiny/api-headless-cms-tasks": "6.6.0-alpha.0",
31
- "@webiny/api-headless-cms-workflows": "6.6.0-alpha.0",
32
- "@webiny/api-mailer": "6.6.0-alpha.0",
33
- "@webiny/api-record-locking": "6.6.0-alpha.0",
34
- "@webiny/api-scheduler": "6.6.0-alpha.0",
35
- "@webiny/api-website-builder": "6.6.0-alpha.0",
36
- "@webiny/api-website-builder-scheduler": "6.6.0-alpha.0",
37
- "@webiny/api-website-builder-workflows": "6.6.0-alpha.0",
38
- "@webiny/api-websockets": "6.6.0-alpha.0",
39
- "@webiny/api-workflows": "6.6.0-alpha.0",
40
- "@webiny/background-tasks": "6.6.0-alpha.0",
41
- "@webiny/event-handler-core": "6.6.0-alpha.0",
42
- "@webiny/handler": "6.6.0-alpha.0",
43
- "@webiny/webhooks": "6.6.0-alpha.0"
21
+ "@webiny/ai-chat": "6.6.0-alpha.1",
22
+ "@webiny/api-aco": "6.6.0-alpha.1",
23
+ "@webiny/api-audit-logs": "6.6.0-alpha.1",
24
+ "@webiny/api-core": "6.6.0-alpha.1",
25
+ "@webiny/api-file-manager": "6.6.0-alpha.1",
26
+ "@webiny/api-file-manager-aco": "6.6.0-alpha.1",
27
+ "@webiny/api-graphql": "6.6.0-alpha.1",
28
+ "@webiny/api-headless-cms": "6.6.0-alpha.1",
29
+ "@webiny/api-headless-cms-aco": "6.6.0-alpha.1",
30
+ "@webiny/api-headless-cms-scheduler": "6.6.0-alpha.1",
31
+ "@webiny/api-headless-cms-tasks": "6.6.0-alpha.1",
32
+ "@webiny/api-headless-cms-workflows": "6.6.0-alpha.1",
33
+ "@webiny/api-mailer": "6.6.0-alpha.1",
34
+ "@webiny/api-record-locking": "6.6.0-alpha.1",
35
+ "@webiny/api-scheduler": "6.6.0-alpha.1",
36
+ "@webiny/api-website-builder": "6.6.0-alpha.1",
37
+ "@webiny/api-website-builder-scheduler": "6.6.0-alpha.1",
38
+ "@webiny/api-website-builder-workflows": "6.6.0-alpha.1",
39
+ "@webiny/api-websockets": "6.6.0-alpha.1",
40
+ "@webiny/api-workflows": "6.6.0-alpha.1",
41
+ "@webiny/background-tasks": "6.6.0-alpha.1",
42
+ "@webiny/handler": "6.6.0-alpha.1",
43
+ "@webiny/webhooks": "6.6.0-alpha.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@webiny/di": ">=0.2.3"
47
47
  },
48
48
  "devDependencies": {
49
- "@webiny/build-tools": "6.6.0-alpha.0",
50
- "@webiny/di": "1.0.2",
49
+ "@webiny/build-tools": "6.6.0-alpha.1",
50
+ "@webiny/di": "1.1.0",
51
51
  "rimraf": "6.1.3",
52
52
  "typescript": "7.0.2",
53
- "vitest": "4.1.10"
53
+ "vitest": "4.1.11"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
@@ -5,7 +5,7 @@ export type TransportRegistrar = (container: Container) => void | Promise<void>;
5
5
  export interface RegisterApiRequestStackConfig {
6
6
  /**
7
7
  * Project-defined extensions, applied at register() time (so extension features — including
8
- * code-defined CMS models — are registered before any initializer lists/caches the model set).
8
+ * code-defined CMS models — are registered before anything lists/caches the model set).
9
9
  */
10
10
  extensions: () => Parameters<typeof registerExtensions>[1];
11
11
  /**
@@ -50,7 +50,7 @@ export interface RegisterApiRequestStackConfig {
50
50
  * (HTTP/event transport, auth/tenant loaders, identity provider, DB + storage) before dispatch reaches
51
51
  * this per-request stack.
52
52
  *
53
- * ORDER IS LOAD-BEARING — do not reorder. Notably: extensions must be applied before any initializer
54
- * (e.g. ACO) lists + caches the per-request model set; the GraphQL engine must be registered last.
53
+ * ORDER IS LOAD-BEARING — do not reorder. Notably: extensions must be applied before anything that
54
+ * lists + caches the per-request model set; the GraphQL engine must be registered last.
55
55
  */
56
56
  export declare function registerApiRequestStack(container: Container, config: RegisterApiRequestStackConfig): Promise<void>;
@@ -1,7 +1,8 @@
1
1
  import { registerExtensions } from "@webiny/handler";
2
2
  import { GraphQLEngineFeature } from "@webiny/api-graphql";
3
+ import { AiChatFeature } from "@webiny/ai-chat/api/index.js";
3
4
  import { ApiCoreFeature } from "@webiny/api-core";
4
- import { WcpLicenseInitializer } from "./WcpLicenseInitializer.js";
5
+ import { WcpLicenseLoader } from "@webiny/api-core/features/wcp/WcpLicenseLoader.js";
5
6
  import { HeadlessCmsFeature } from "@webiny/api-headless-cms";
6
7
  import { AcoHcmsFeature } from "@webiny/api-headless-cms-aco";
7
8
  import { HcmsTasksFeature } from "@webiny/api-headless-cms-tasks";
@@ -15,17 +16,17 @@ import { AcoFeature } from "@webiny/api-aco";
15
16
  import { BackgroundTasksFeature } from "@webiny/background-tasks/api";
16
17
  import { FileManagerAppFeature } from "@webiny/api-file-manager";
17
18
  import { FileManagerAcoFeature } from "@webiny/api-file-manager-aco";
18
- import { WebsiteBuilderFeature, setupWebsiteBuilderModels } from "@webiny/api-website-builder";
19
+ import { WebsiteBuilderFeature } from "@webiny/api-website-builder";
19
20
  import { WebsiteBuilderWorkflowsFeature } from "@webiny/api-website-builder-workflows";
20
21
  import { WebsiteBuilderSchedulerFeature } from "@webiny/api-website-builder-scheduler";
21
22
  import { WebsocketsFeature } from "@webiny/api-websockets";
22
23
  import { WorkflowsFeature } from "@webiny/api-workflows";
23
24
  import { SchedulerFeature } from "@webiny/api-scheduler";
24
25
  async function registerApiRequestStack(container, config) {
26
+ await WcpLicenseLoader.load();
25
27
  ApiCoreFeature.register(container, {
26
28
  wcpLicense: void 0
27
29
  });
28
- container.register(WcpLicenseInitializer);
29
30
  await config.registerRequestStorage?.(container);
30
31
  HeadlessCmsFeature.register(container, {
31
32
  type: "manage"
@@ -37,7 +38,6 @@ async function registerApiRequestStack(container, config) {
37
38
  FileManagerAcoFeature.register(container);
38
39
  await config.transports?.fileManager?.(container);
39
40
  WebsiteBuilderFeature.register(container);
40
- await setupWebsiteBuilderModels(container);
41
41
  WebsiteBuilderWorkflowsFeature.register(container);
42
42
  WebsiteBuilderSchedulerFeature.register(container);
43
43
  WebsocketsFeature.register(container);
@@ -52,6 +52,7 @@ async function registerApiRequestStack(container, config) {
52
52
  SchedulerFeature.register(container);
53
53
  await config.transports?.scheduler?.(container);
54
54
  CmsSchedulerFeature.register(container);
55
+ AiChatFeature.register(container);
55
56
  await registerExtensions(container, config.extensions());
56
57
  GraphQLEngineFeature.register(container);
57
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registerApiRequestStack.js","sources":["../src/registerApiRequestStack.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { registerExtensions } from \"@webiny/handler\";\nimport { GraphQLEngineFeature } from \"@webiny/api-graphql\";\nimport { ApiCoreFeature } from \"@webiny/api-core\";\nimport { WcpLicenseInitializer } from \"./WcpLicenseInitializer.js\";\nimport { HeadlessCmsFeature } from \"@webiny/api-headless-cms\";\nimport { AcoHcmsFeature } from \"@webiny/api-headless-cms-aco\";\nimport { HcmsTasksFeature } from \"@webiny/api-headless-cms-tasks\";\nimport { CmsWorkflowsFeature } from \"@webiny/api-headless-cms-workflows\";\nimport { CmsSchedulerFeature } from \"@webiny/api-headless-cms-scheduler\";\nimport { MailerFeature } from \"@webiny/api-mailer\";\nimport { RecordLockingAppFeature } from \"@webiny/api-record-locking\";\nimport { AuditLogsFeature } from \"@webiny/api-audit-logs\";\nimport { WebhooksFeature } from \"@webiny/webhooks/api\";\nimport { AcoFeature } from \"@webiny/api-aco\";\nimport { BackgroundTasksFeature } from \"@webiny/background-tasks/api\";\nimport { FileManagerAppFeature } from \"@webiny/api-file-manager\";\nimport { FileManagerAcoFeature } from \"@webiny/api-file-manager-aco\";\nimport { WebsiteBuilderFeature, setupWebsiteBuilderModels } from \"@webiny/api-website-builder\";\nimport { WebsiteBuilderWorkflowsFeature } from \"@webiny/api-website-builder-workflows\";\nimport { WebsiteBuilderSchedulerFeature } from \"@webiny/api-website-builder-scheduler\";\nimport { WebsocketsFeature } from \"@webiny/api-websockets\";\nimport { WorkflowsFeature } from \"@webiny/api-workflows\";\nimport { SchedulerFeature } from \"@webiny/api-scheduler\";\n\n/** Installs a hosting-specific transport adapter into the per-request container at its interleave point. */\nexport type TransportRegistrar = (container: Container) => void | Promise<void>;\n\nexport interface RegisterApiRequestStackConfig {\n /**\n * Project-defined extensions, applied at register() time (so extension features — including\n * code-defined CMS models — are registered before any initializer lists/caches the model set).\n */\n extensions: () => Parameters<typeof registerExtensions>[1];\n /**\n * Register request-phase storage features that must run BEFORE `HeadlessCmsFeature` builds its\n * storage — e.g. `DbRegistryFeature` for the DDB+ES variant. Optional (DDB-only needs none).\n */\n registerRequestStorage?: (container: Container) => void | Promise<void>;\n /**\n * Hosting-specific transport adapters, each installed at its exact interleave point in the stack.\n * Every entry follows the same shape: it runs immediately AFTER the transport-agnostic domain\n * Feature has registered its NULL default, and overrides that default (nearest-container-last-wins)\n * with the real adapter. Each is optional — omit one for a deployment/transport that lacks that\n * capability. AWS supplies AWS adapters (API Gateway Management API / EventBridge / S3); the\n * self-hosted server supplies in-process adapters (server WebSockets / Bree / local disk).\n */\n transports?: {\n /**\n * Real-time (WebSockets) transport, run right after `WebsocketsFeature`. Overrides the\n * NullWebsocketsTransport, otherwise every server→client send() is a silent no-op.\n */\n realtime?: TransportRegistrar;\n /**\n * Scheduler transport, run AFTER `SchedulerFeature` and BEFORE `CmsSchedulerFeature`.\n */\n scheduler?: TransportRegistrar;\n /**\n * File-manager storage transport, run AFTER `FileManagerAppFeature` (which registers the\n * AssetDeliveryRoute + NULL asset-delivery impls). Overrides those nulls with real impls and\n * adds the file-operation features.\n */\n fileManager?: TransportRegistrar;\n };\n}\n\n/**\n * Registers the transport-AGNOSTIC Webiny API request stack: every domain feature + the GraphQL\n * engine, in the correct (order-sensitive) sequence. This is shared by all transport composition\n * packages (`@webiny/api-event-handler-aws`, and the future `-server`) so the feature set and its\n * ordering live in ONE place and can't drift between transports.\n *\n * Transport- and storage-specific pieces are injected via the hooks in {@link RegisterApiRequestStackConfig}\n * at their exact interleave points. The caller is responsible for the ROOT-container transport wiring\n * (HTTP/event transport, auth/tenant loaders, identity provider, DB + storage) before dispatch reaches\n * this per-request stack.\n *\n * ORDER IS LOAD-BEARING — do not reorder. Notably: extensions must be applied before any initializer\n * (e.g. ACO) lists + caches the per-request model set; the GraphQL engine must be registered last.\n */\nexport async function registerApiRequestStack(\n container: Container,\n config: RegisterApiRequestStackConfig\n): Promise<void> {\n // ── Core API (per-request: EventPublisher + tenant/identity/request contexts must bind to the\n // request child container so per-request event handlers are resolvable) ─────────\n ApiCoreFeature.register(container, { wcpLicense: undefined });\n\n // Refresh the WCP license once per request (RequestInitializer). Lives here (the shared request\n // stack) rather than api-core, so the domain layer has no transport dependency; runs for all\n // hosting types. Registered after ApiCoreFeature (which provides WcpLicenseProvider).\n container.register(WcpLicenseInitializer);\n\n // ── Request-phase storage (variant-specific; must precede HeadlessCmsFeature) ──\n await config.registerRequestStorage?.(container);\n\n // ── CMS ────────────────────────────────────────────────────\n HeadlessCmsFeature.register(container, { type: \"manage\" });\n AcoFeature.register(container);\n AcoHcmsFeature.register(container);\n HcmsTasksFeature.register(container);\n\n // ── File Manager (domain) + storage transport ──────────────\n FileManagerAppFeature.register(container);\n FileManagerAcoFeature.register(container);\n await config.transports?.fileManager?.(container);\n\n // ── Website Builder ────────────────────────────────────────\n WebsiteBuilderFeature.register(container);\n await setupWebsiteBuilderModels(container);\n WebsiteBuilderWorkflowsFeature.register(container);\n WebsiteBuilderSchedulerFeature.register(container);\n\n // ── Websockets (domain) + real-time transport ──────────────\n WebsocketsFeature.register(container);\n await config.transports?.realtime?.(container);\n\n // ── Supporting services ────────────────────────────────────\n MailerFeature.register(container);\n RecordLockingAppFeature.register(container, {});\n AuditLogsFeature.register(container, {});\n WebhooksFeature.register(container);\n BackgroundTasksFeature.register(container);\n\n // ── Workflows ──────────────────────────────────────────────\n WorkflowsFeature.register(container);\n CmsWorkflowsFeature.register(container);\n\n // ── Scheduler + scheduler transport ────────────────────────\n SchedulerFeature.register(container);\n await config.transports?.scheduler?.(container);\n CmsSchedulerFeature.register(container);\n\n // ── Extensions ─────────────────────────────────────────────\n // Apply at register() time (not via a post-auth initializer) so extension features — including\n // code-defined CMS models (ModelFactory), e.g. Languages — are registered before any initializer\n // (e.g. ACO) lists + caches the per-request model set.\n await registerExtensions(container, config.extensions());\n\n // ── GraphQL engine (always last) ───────────────────────────\n GraphQLEngineFeature.register(container);\n}\n"],"names":["registerApiRequestStack","container","config","ApiCoreFeature","undefined","WcpLicenseInitializer","HeadlessCmsFeature","AcoFeature","AcoHcmsFeature","HcmsTasksFeature","FileManagerAppFeature","FileManagerAcoFeature","WebsiteBuilderFeature","setupWebsiteBuilderModels","WebsiteBuilderWorkflowsFeature","WebsiteBuilderSchedulerFeature","WebsocketsFeature","MailerFeature","RecordLockingAppFeature","AuditLogsFeature","WebhooksFeature","BackgroundTasksFeature","WorkflowsFeature","CmsWorkflowsFeature","SchedulerFeature","CmsSchedulerFeature","registerExtensions","GraphQLEngineFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgFO,eAAeA,wBAClBC,SAAoB,EACpBC,MAAqC;IAIrCC,eAAe,QAAQ,CAACF,WAAW;QAAE,YAAYG;IAAU;IAK3DH,UAAU,QAAQ,CAACI;IAGnB,MAAMH,OAAO,sBAAsB,GAAGD;IAGtCK,mBAAmB,QAAQ,CAACL,WAAW;QAAE,MAAM;IAAS;IACxDM,WAAW,QAAQ,CAACN;IACpBO,eAAe,QAAQ,CAACP;IACxBQ,iBAAiB,QAAQ,CAACR;IAG1BS,sBAAsB,QAAQ,CAACT;IAC/BU,sBAAsB,QAAQ,CAACV;IAC/B,MAAMC,OAAO,UAAU,EAAE,cAAcD;IAGvCW,sBAAsB,QAAQ,CAACX;IAC/B,MAAMY,0BAA0BZ;IAChCa,+BAA+B,QAAQ,CAACb;IACxCc,+BAA+B,QAAQ,CAACd;IAGxCe,kBAAkB,QAAQ,CAACf;IAC3B,MAAMC,OAAO,UAAU,EAAE,WAAWD;IAGpCgB,cAAc,QAAQ,CAAChB;IACvBiB,wBAAwB,QAAQ,CAACjB,WAAW,CAAC;IAC7CkB,iBAAiB,QAAQ,CAAClB,WAAW,CAAC;IACtCmB,gBAAgB,QAAQ,CAACnB;IACzBoB,uBAAuB,QAAQ,CAACpB;IAGhCqB,iBAAiB,QAAQ,CAACrB;IAC1BsB,oBAAoB,QAAQ,CAACtB;IAG7BuB,iBAAiB,QAAQ,CAACvB;IAC1B,MAAMC,OAAO,UAAU,EAAE,YAAYD;IACrCwB,oBAAoB,QAAQ,CAACxB;IAM7B,MAAMyB,mBAAmBzB,WAAWC,OAAO,UAAU;IAGrDyB,qBAAqB,QAAQ,CAAC1B;AAClC"}
1
+ {"version":3,"file":"registerApiRequestStack.js","sources":["../src/registerApiRequestStack.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { registerExtensions } from \"@webiny/handler\";\nimport { GraphQLEngineFeature } from \"@webiny/api-graphql\";\nimport { AiChatFeature } from \"@webiny/ai-chat/api/index.js\";\nimport { ApiCoreFeature } from \"@webiny/api-core\";\nimport { WcpLicenseLoader } from \"@webiny/api-core/features/wcp/WcpLicenseLoader.js\";\nimport { HeadlessCmsFeature } from \"@webiny/api-headless-cms\";\nimport { AcoHcmsFeature } from \"@webiny/api-headless-cms-aco\";\nimport { HcmsTasksFeature } from \"@webiny/api-headless-cms-tasks\";\nimport { CmsWorkflowsFeature } from \"@webiny/api-headless-cms-workflows\";\nimport { CmsSchedulerFeature } from \"@webiny/api-headless-cms-scheduler\";\nimport { MailerFeature } from \"@webiny/api-mailer\";\nimport { RecordLockingAppFeature } from \"@webiny/api-record-locking\";\nimport { AuditLogsFeature } from \"@webiny/api-audit-logs\";\nimport { WebhooksFeature } from \"@webiny/webhooks/api\";\nimport { AcoFeature } from \"@webiny/api-aco\";\nimport { BackgroundTasksFeature } from \"@webiny/background-tasks/api\";\nimport { FileManagerAppFeature } from \"@webiny/api-file-manager\";\nimport { FileManagerAcoFeature } from \"@webiny/api-file-manager-aco\";\nimport { WebsiteBuilderFeature } from \"@webiny/api-website-builder\";\nimport { WebsiteBuilderWorkflowsFeature } from \"@webiny/api-website-builder-workflows\";\nimport { WebsiteBuilderSchedulerFeature } from \"@webiny/api-website-builder-scheduler\";\nimport { WebsocketsFeature } from \"@webiny/api-websockets\";\nimport { WorkflowsFeature } from \"@webiny/api-workflows\";\nimport { SchedulerFeature } from \"@webiny/api-scheduler\";\n\n/** Installs a hosting-specific transport adapter into the per-request container at its interleave point. */\nexport type TransportRegistrar = (container: Container) => void | Promise<void>;\n\nexport interface RegisterApiRequestStackConfig {\n /**\n * Project-defined extensions, applied at register() time (so extension features — including\n * code-defined CMS models — are registered before anything lists/caches the model set).\n */\n extensions: () => Parameters<typeof registerExtensions>[1];\n /**\n * Register request-phase storage features that must run BEFORE `HeadlessCmsFeature` builds its\n * storage — e.g. `DbRegistryFeature` for the DDB+ES variant. Optional (DDB-only needs none).\n */\n registerRequestStorage?: (container: Container) => void | Promise<void>;\n /**\n * Hosting-specific transport adapters, each installed at its exact interleave point in the stack.\n * Every entry follows the same shape: it runs immediately AFTER the transport-agnostic domain\n * Feature has registered its NULL default, and overrides that default (nearest-container-last-wins)\n * with the real adapter. Each is optional — omit one for a deployment/transport that lacks that\n * capability. AWS supplies AWS adapters (API Gateway Management API / EventBridge / S3); the\n * self-hosted server supplies in-process adapters (server WebSockets / Bree / local disk).\n */\n transports?: {\n /**\n * Real-time (WebSockets) transport, run right after `WebsocketsFeature`. Overrides the\n * NullWebsocketsTransport, otherwise every server→client send() is a silent no-op.\n */\n realtime?: TransportRegistrar;\n /**\n * Scheduler transport, run AFTER `SchedulerFeature` and BEFORE `CmsSchedulerFeature`.\n */\n scheduler?: TransportRegistrar;\n /**\n * File-manager storage transport, run AFTER `FileManagerAppFeature` (which registers the\n * AssetDeliveryRoute + NULL asset-delivery impls). Overrides those nulls with real impls and\n * adds the file-operation features.\n */\n fileManager?: TransportRegistrar;\n };\n}\n\n/**\n * Registers the transport-AGNOSTIC Webiny API request stack: every domain feature + the GraphQL\n * engine, in the correct (order-sensitive) sequence. This is shared by all transport composition\n * packages (`@webiny/api-event-handler-aws`, and the future `-server`) so the feature set and its\n * ordering live in ONE place and can't drift between transports.\n *\n * Transport- and storage-specific pieces are injected via the hooks in {@link RegisterApiRequestStackConfig}\n * at their exact interleave points. The caller is responsible for the ROOT-container transport wiring\n * (HTTP/event transport, auth/tenant loaders, identity provider, DB + storage) before dispatch reaches\n * this per-request stack.\n *\n * ORDER IS LOAD-BEARING — do not reorder. Notably: extensions must be applied before anything that\n * lists + caches the per-request model set; the GraphQL engine must be registered last.\n */\nexport async function registerApiRequestStack(\n container: Container,\n config: RegisterApiRequestStackConfig\n): Promise<void> {\n // Refresh the WCP license BEFORE any feature registers — this is the single per-request refresh.\n // register()-time feature-flag checks (e.g. the private-files gate) and WcpContext.canUse* both\n // read it via the process cache (`WcpLicenseProvider.get()` / `WcpLicenseLoader.getCached()`). Runs here\n // — the shared request stack both hosting types call — so no handler wires it. Process-cached\n // (~5-min TTL) + single-flighted → cheap no-op on warm requests.\n await WcpLicenseLoader.load();\n\n // ── Core API (per-request: EventPublisher + tenant/identity/request contexts must bind to the\n // request child container so per-request event handlers are resolvable) ─────────\n ApiCoreFeature.register(container, { wcpLicense: undefined });\n\n // ── Request-phase storage (variant-specific; must precede HeadlessCmsFeature) ──\n await config.registerRequestStorage?.(container);\n\n // ── CMS ────────────────────────────────────────────────────\n HeadlessCmsFeature.register(container, { type: \"manage\" });\n AcoFeature.register(container);\n AcoHcmsFeature.register(container);\n HcmsTasksFeature.register(container);\n\n // ── File Manager (domain) + storage transport ──────────────\n FileManagerAppFeature.register(container);\n FileManagerAcoFeature.register(container);\n await config.transports?.fileManager?.(container);\n\n // ── Website Builder ────────────────────────────────────────\n WebsiteBuilderFeature.register(container);\n WebsiteBuilderWorkflowsFeature.register(container);\n WebsiteBuilderSchedulerFeature.register(container);\n\n // ── Websockets (domain) + real-time transport ──────────────\n WebsocketsFeature.register(container);\n await config.transports?.realtime?.(container);\n\n // ── Supporting services ────────────────────────────────────\n MailerFeature.register(container);\n RecordLockingAppFeature.register(container, {});\n AuditLogsFeature.register(container, {});\n WebhooksFeature.register(container);\n BackgroundTasksFeature.register(container);\n\n // ── Workflows ──────────────────────────────────────────────\n WorkflowsFeature.register(container);\n CmsWorkflowsFeature.register(container);\n\n // ── Scheduler + scheduler transport ────────────────────────\n SchedulerFeature.register(container);\n await config.transports?.scheduler?.(container);\n CmsSchedulerFeature.register(container);\n\n // ── AI chat endpoint (in-admin assistant) ──────────────────\n // The agent loop runs here rather than in the browser, so the browser needs no model and no API\n // key. BEFORE extensions on purpose: the feature registers a default `AiChatProvider` that reads\n // the environment, and an extension (AI Power-Ups) overrides it with the providers configured in\n // the admin UI. A single resolve takes the LAST registration, so registering this after extensions\n // silently won and the configured provider was ignored.\n //\n // Route construction does not depend on this order — `HttpRouter` resolves routes inside `route()`,\n // and `resolveAll(AiSdkTool)` collects every tool regardless of when it was registered.\n AiChatFeature.register(container);\n\n // ── Extensions ─────────────────────────────────────────────\n // Apply at register() time so extension features — including code-defined CMS models\n // (ModelFactory), e.g. Languages — are registered before anything populates ModelCache. Anything\n // reaching the model set through GetModel/ListModels (which go via ModelsFetcher ->\n // ModelCache.getOrSet) caches it for the rest of the request, so a set built before extensions\n // register would be missing their models. Every consumer now resolves models at schema-build or\n // resolver time, i.e. after all registration.\n await registerExtensions(container, config.extensions());\n\n // ── GraphQL engine (always last) ───────────────────────────\n GraphQLEngineFeature.register(container);\n}\n"],"names":["registerApiRequestStack","container","config","WcpLicenseLoader","ApiCoreFeature","undefined","HeadlessCmsFeature","AcoFeature","AcoHcmsFeature","HcmsTasksFeature","FileManagerAppFeature","FileManagerAcoFeature","WebsiteBuilderFeature","WebsiteBuilderWorkflowsFeature","WebsiteBuilderSchedulerFeature","WebsocketsFeature","MailerFeature","RecordLockingAppFeature","AuditLogsFeature","WebhooksFeature","BackgroundTasksFeature","WorkflowsFeature","CmsWorkflowsFeature","SchedulerFeature","CmsSchedulerFeature","AiChatFeature","registerExtensions","GraphQLEngineFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiFO,eAAeA,wBAClBC,SAAoB,EACpBC,MAAqC;IAOrC,MAAMC,iBAAiB,IAAI;IAI3BC,eAAe,QAAQ,CAACH,WAAW;QAAE,YAAYI;IAAU;IAG3D,MAAMH,OAAO,sBAAsB,GAAGD;IAGtCK,mBAAmB,QAAQ,CAACL,WAAW;QAAE,MAAM;IAAS;IACxDM,WAAW,QAAQ,CAACN;IACpBO,eAAe,QAAQ,CAACP;IACxBQ,iBAAiB,QAAQ,CAACR;IAG1BS,sBAAsB,QAAQ,CAACT;IAC/BU,sBAAsB,QAAQ,CAACV;IAC/B,MAAMC,OAAO,UAAU,EAAE,cAAcD;IAGvCW,sBAAsB,QAAQ,CAACX;IAC/BY,+BAA+B,QAAQ,CAACZ;IACxCa,+BAA+B,QAAQ,CAACb;IAGxCc,kBAAkB,QAAQ,CAACd;IAC3B,MAAMC,OAAO,UAAU,EAAE,WAAWD;IAGpCe,cAAc,QAAQ,CAACf;IACvBgB,wBAAwB,QAAQ,CAAChB,WAAW,CAAC;IAC7CiB,iBAAiB,QAAQ,CAACjB,WAAW,CAAC;IACtCkB,gBAAgB,QAAQ,CAAClB;IACzBmB,uBAAuB,QAAQ,CAACnB;IAGhCoB,iBAAiB,QAAQ,CAACpB;IAC1BqB,oBAAoB,QAAQ,CAACrB;IAG7BsB,iBAAiB,QAAQ,CAACtB;IAC1B,MAAMC,OAAO,UAAU,EAAE,YAAYD;IACrCuB,oBAAoB,QAAQ,CAACvB;IAW7BwB,cAAc,QAAQ,CAACxB;IASvB,MAAMyB,mBAAmBzB,WAAWC,OAAO,UAAU;IAGrDyB,qBAAqB,QAAQ,CAAC1B;AAClC"}
@@ -1,20 +0,0 @@
1
- import { RequestInitializer } from "@webiny/event-handler-core";
2
- import { WcpLicenseProvider } from "@webiny/api-core";
3
- /**
4
- * Per-request hook that refreshes the WCP license before the request is dispatched (and before any
5
- * synchronous canUse* check runs). The license is project-level / tenant-agnostic, so this runs fine
6
- * ahead of auth/tenant.
7
- *
8
- * Lives in api-event-handler-core (the shared API request stack) rather than api-core so the domain
9
- * layer stays free of the transport request-lifecycle contract, while the refresh still runs for
10
- * every hosting type (aws + server) via registerApiRequestStack.
11
- */
12
- declare class WcpLicenseInitializerImpl implements RequestInitializer.Interface {
13
- private provider;
14
- constructor(provider: WcpLicenseProvider.Interface);
15
- init(): Promise<void>;
16
- }
17
- export declare const WcpLicenseInitializer: typeof WcpLicenseInitializerImpl & {
18
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/event-handler-core").IRequestInitializer>;
19
- };
20
- export {};
@@ -1,19 +0,0 @@
1
- import { RequestInitializer } from "@webiny/event-handler-core";
2
- import { WcpLicenseProvider } from "@webiny/api-core";
3
- class WcpLicenseInitializerImpl {
4
- constructor(provider){
5
- this.provider = provider;
6
- }
7
- async init() {
8
- await this.provider.refresh();
9
- }
10
- }
11
- const WcpLicenseInitializer = RequestInitializer.createImplementation({
12
- implementation: WcpLicenseInitializerImpl,
13
- dependencies: [
14
- WcpLicenseProvider
15
- ]
16
- });
17
- export { WcpLicenseInitializer };
18
-
19
- //# sourceMappingURL=WcpLicenseInitializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WcpLicenseInitializer.js","sources":["../src/WcpLicenseInitializer.ts"],"sourcesContent":["import { RequestInitializer } from \"@webiny/event-handler-core\";\nimport { WcpLicenseProvider } from \"@webiny/api-core\";\n\n/**\n * Per-request hook that refreshes the WCP license before the request is dispatched (and before any\n * synchronous canUse* check runs). The license is project-level / tenant-agnostic, so this runs fine\n * ahead of auth/tenant.\n *\n * Lives in api-event-handler-core (the shared API request stack) rather than api-core so the domain\n * layer stays free of the transport request-lifecycle contract, while the refresh still runs for\n * every hosting type (aws + server) via registerApiRequestStack.\n */\nclass WcpLicenseInitializerImpl implements RequestInitializer.Interface {\n constructor(private provider: WcpLicenseProvider.Interface) {}\n\n async init(): Promise<void> {\n await this.provider.refresh();\n }\n}\n\nexport const WcpLicenseInitializer = RequestInitializer.createImplementation({\n implementation: WcpLicenseInitializerImpl,\n dependencies: [WcpLicenseProvider]\n});\n"],"names":["WcpLicenseInitializerImpl","provider","WcpLicenseInitializer","RequestInitializer","WcpLicenseProvider"],"mappings":";;AAYA,MAAMA;IACF,YAAoBC,QAAsC,CAAE;aAAxCA,QAAQ,GAARA;IAAyC;IAE7D,MAAM,OAAsB;QACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO;IAC/B;AACJ;AAEO,MAAMC,wBAAwBC,mBAAmB,oBAAoB,CAAC;IACzE,gBAAgBH;IAChB,cAAc;QAACI;KAAmB;AACtC"}