@cosmicdrift/kumiko-server-runtime 0.228.0 → 0.229.0

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": "@cosmicdrift/kumiko-server-runtime",
3
- "version": "0.228.0",
3
+ "version": "0.229.0",
4
4
  "description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold/codegen tooling.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -80,8 +80,8 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
- "@cosmicdrift/kumiko-bundled-features": "0.228.0",
84
- "@cosmicdrift/kumiko-framework": "0.228.0",
83
+ "@cosmicdrift/kumiko-bundled-features": "0.229.0",
84
+ "@cosmicdrift/kumiko-framework": "0.229.0",
85
85
  "temporal-polyfill": "^0.3.2"
86
86
  },
87
87
  "publishConfig": {
@@ -119,6 +119,7 @@ import {
119
119
  createSeedMigrationContext,
120
120
  runPendingSeedMigrations,
121
121
  } from "@cosmicdrift/kumiko-framework/es-ops";
122
+ import type { JobRunnerOptions } from "@cosmicdrift/kumiko-framework/jobs";
122
123
  import {
123
124
  assertKumikoSchemaCurrent,
124
125
  SchemaDriftError,
@@ -539,6 +540,11 @@ export type RunProdAppOptions = {
539
540
  readonly jobs?: {
540
541
  /** BullMQ-Queue-Prefix (default "kumiko"). */
541
542
  readonly queueNamePrefix?: string;
543
+ /** Source of active tenant ids for `perTenant: true` jobs. Omit when the
544
+ * tenant feature is mounted — the framework then resolves tenants on
545
+ * its own via that feature's active-tenant-ids query. Only needed when
546
+ * the app manages tenants outside that feature. */
547
+ readonly getActiveTenantIds?: JobRunnerOptions["getActiveTenantIds"];
542
548
  };
543
549
  /** Event-Dispatcher (MSP-Anwendung) im API-Process. Default AN —
544
550
  * runProdApp ist das Single-Container-Deployment, es gibt keinen
@@ -1144,6 +1150,9 @@ export async function runProdApp(options: RunProdAppOptions): Promise<ProdAppHan
1144
1150
  redisUrl,
1145
1151
  ...jobLogger,
1146
1152
  ...(queueNamePrefix !== undefined && { queueNamePrefix }),
1153
+ ...(options.jobs?.getActiveTenantIds !== undefined && {
1154
+ getActiveTenantIds: options.jobs.getActiveTenantIds,
1155
+ }),
1147
1156
  ...(!options.eventDispatcher?.disabled && { eventDispatcher: dispatcherTunables }),
1148
1157
  })
1149
1158
  : createApiEntrypoint({
@@ -1154,6 +1163,9 @@ export async function runProdApp(options: RunProdAppOptions): Promise<ProdAppHan
1154
1163
  runLocalJobs: true,
1155
1164
  ...jobLogger,
1156
1165
  ...(queueNamePrefix !== undefined && { queueNamePrefix }),
1166
+ ...(options.jobs?.getActiveTenantIds !== undefined && {
1167
+ getActiveTenantIds: options.jobs.getActiveTenantIds,
1168
+ }),
1157
1169
  },
1158
1170
  }),
1159
1171
  });
@@ -39,6 +39,7 @@ import {
39
39
  createWorkerEntrypoint,
40
40
  type WorkerEntrypoint,
41
41
  } from "@cosmicdrift/kumiko-framework/entrypoint";
42
+ import type { JobRunnerOptions } from "@cosmicdrift/kumiko-framework/jobs";
42
43
  import {
43
44
  assertKumikoSchemaCurrent,
44
45
  SchemaDriftError,
@@ -113,6 +114,11 @@ export type RunWorkerAppOptions = {
113
114
  readonly allowPlaintextPii?: string;
114
115
  readonly jobs?: {
115
116
  readonly queueNamePrefix?: string;
117
+ /** Source of active tenant ids for `perTenant: true` jobs (see
118
+ * RunProdAppOptions["jobs"]["getActiveTenantIds"]) — identical
119
+ * semantics, framework falls back to the tenant feature's own
120
+ * active-tenant-ids query when omitted. */
121
+ readonly getActiveTenantIds?: JobRunnerOptions["getActiveTenantIds"];
116
122
  };
117
123
  /** Tuning knobs for the event-dispatcher loop (pollIntervalMs, pgClient
118
124
  * for LISTEN/NOTIFY). */
@@ -284,6 +290,9 @@ export async function runWorkerApp(options: RunWorkerAppOptions): Promise<Worker
284
290
  ...(options.jobs?.queueNamePrefix !== undefined && {
285
291
  queueNamePrefix: options.jobs.queueNamePrefix,
286
292
  }),
293
+ ...(options.jobs?.getActiveTenantIds !== undefined && {
294
+ getActiveTenantIds: options.jobs.getActiveTenantIds,
295
+ }),
287
296
  ...(options.eventDispatcher && { eventDispatcher: options.eventDispatcher }),
288
297
  });
289
298