@dudousxd/nestjs-durable 0.29.0 → 0.30.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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunDetail, RunQuery, WorkflowRun, GroupHealth, EngineEvent, RunRequest, RunReply, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
1
+ import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, DurableTopology, RunDetail, RunQuery, WorkflowRun, GroupHealth, EngineEvent, RunRequest, RunReply, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
2
2
  import { z } from 'zod';
3
3
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
4
4
  import { DynamicModule, InjectionToken, OnModuleInit, OnApplicationBootstrap, OnApplicationShutdown, Provider } from '@nestjs/common';
@@ -715,6 +715,7 @@ declare class ProxyRunGateway implements RunGateway {
715
715
  constructor(transport: Transport, tenant: string, timeoutMs?: number);
716
716
  private handleReply;
717
717
  private request;
718
+ topology(): DurableTopology;
718
719
  getRunDetail(runId: string): Promise<RunDetail | null>;
719
720
  listRuns(query: RunQuery): Promise<WorkflowRun[]>;
720
721
  /** Round-trips to the operator, which scopes the result to this tenant's own `@<tenant>` groups. */
@@ -801,6 +802,7 @@ declare class StoreRunGateway implements RunGateway {
801
802
  private readonly store;
802
803
  private readonly engine;
803
804
  constructor(store: StateStore, engine: WorkflowEngine);
805
+ topology(): DurableTopology;
804
806
  getRunDetail(runId: string): Promise<RunDetail | null>;
805
807
  listRuns(query: RunQuery): Promise<WorkflowRun[]>;
806
808
  /** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunDetail, RunQuery, WorkflowRun, GroupHealth, EngineEvent, RunRequest, RunReply, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
1
+ import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, DurableTopology, RunDetail, RunQuery, WorkflowRun, GroupHealth, EngineEvent, RunRequest, RunReply, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
2
2
  import { z } from 'zod';
3
3
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
4
4
  import { DynamicModule, InjectionToken, OnModuleInit, OnApplicationBootstrap, OnApplicationShutdown, Provider } from '@nestjs/common';
@@ -715,6 +715,7 @@ declare class ProxyRunGateway implements RunGateway {
715
715
  constructor(transport: Transport, tenant: string, timeoutMs?: number);
716
716
  private handleReply;
717
717
  private request;
718
+ topology(): DurableTopology;
718
719
  getRunDetail(runId: string): Promise<RunDetail | null>;
719
720
  listRuns(query: RunQuery): Promise<WorkflowRun[]>;
720
721
  /** Round-trips to the operator, which scopes the result to this tenant's own `@<tenant>` groups. */
@@ -801,6 +802,7 @@ declare class StoreRunGateway implements RunGateway {
801
802
  private readonly store;
802
803
  private readonly engine;
803
804
  constructor(store: StateStore, engine: WorkflowEngine);
805
+ topology(): DurableTopology;
804
806
  getRunDetail(runId: string): Promise<RunDetail | null>;
805
807
  listRuns(query: RunQuery): Promise<WorkflowRun[]>;
806
808
  /** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
package/dist/index.js CHANGED
@@ -424,6 +424,12 @@ function tenantGatewayUnavailable(method) {
424
424
  __name(tenantGatewayUnavailable, "tenantGatewayUnavailable");
425
425
  function unavailableRunGateway() {
426
426
  return {
427
+ // Topology is local metadata, always answerable — a thin worker with no transport is still a tenant.
428
+ topology() {
429
+ return {
430
+ role: "tenant"
431
+ };
432
+ },
427
433
  getRunDetail(_runId) {
428
434
  return tenantGatewayUnavailable("getRunDetail");
429
435
  },
@@ -818,6 +824,12 @@ var ProxyRunGateway = class {
818
824
  });
819
825
  });
820
826
  }
827
+ topology() {
828
+ return {
829
+ role: "tenant",
830
+ tenant: this.tenant
831
+ };
832
+ }
821
833
  getRunDetail(runId) {
822
834
  return this.request({
823
835
  kind: "getRunDetail",
@@ -1130,6 +1142,11 @@ var StoreRunGateway = class {
1130
1142
  this.store = store;
1131
1143
  this.engine = engine;
1132
1144
  }
1145
+ topology() {
1146
+ return {
1147
+ role: "control-plane"
1148
+ };
1149
+ }
1133
1150
  async getRunDetail(runId) {
1134
1151
  const run = await this.store.getRun(runId);
1135
1152
  if (!run) return null;