@dudousxd/nestjs-durable 0.30.0 → 0.30.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/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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, DurableTopology, RunDetail, RunQuery,
|
|
1
|
+
import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, DurableTopology, RunDetail, RunQuery, RunListItem, 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';
|
|
@@ -717,7 +717,9 @@ declare class ProxyRunGateway implements RunGateway {
|
|
|
717
717
|
private request;
|
|
718
718
|
topology(): DurableTopology;
|
|
719
719
|
getRunDetail(runId: string): Promise<RunDetail | null>;
|
|
720
|
-
|
|
720
|
+
/** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
|
|
721
|
+
* it through as plain JSON, so a tenant's list rows name the wait too. */
|
|
722
|
+
listRuns(query: RunQuery): Promise<RunListItem[]>;
|
|
721
723
|
/** Round-trips to the operator, which scopes the result to this tenant's own `@<tenant>` groups. */
|
|
722
724
|
workerHealth(): Promise<GroupHealth[]>;
|
|
723
725
|
cancel(runId: string, opts?: {
|
|
@@ -804,7 +806,7 @@ declare class StoreRunGateway implements RunGateway {
|
|
|
804
806
|
constructor(store: StateStore, engine: WorkflowEngine);
|
|
805
807
|
topology(): DurableTopology;
|
|
806
808
|
getRunDetail(runId: string): Promise<RunDetail | null>;
|
|
807
|
-
listRuns(query: RunQuery): Promise<
|
|
809
|
+
listRuns(query: RunQuery): Promise<RunListItem[]>;
|
|
808
810
|
/** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
|
|
809
811
|
* `RunRequestResponder` (to the requester's `@<tenant>` groups); the operator's own UI sees all. */
|
|
810
812
|
workerHealth(): Promise<GroupHealth[]>;
|
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, DurableTopology, RunDetail, RunQuery,
|
|
1
|
+
import { StepError, WorkflowRef, SingletonConfig, StateStore, Transport, NamedTransport, ControlPlane, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowClass, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, DurableTopology, RunDetail, RunQuery, RunListItem, 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';
|
|
@@ -717,7 +717,9 @@ declare class ProxyRunGateway implements RunGateway {
|
|
|
717
717
|
private request;
|
|
718
718
|
topology(): DurableTopology;
|
|
719
719
|
getRunDetail(runId: string): Promise<RunDetail | null>;
|
|
720
|
-
|
|
720
|
+
/** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
|
|
721
|
+
* it through as plain JSON, so a tenant's list rows name the wait too. */
|
|
722
|
+
listRuns(query: RunQuery): Promise<RunListItem[]>;
|
|
721
723
|
/** Round-trips to the operator, which scopes the result to this tenant's own `@<tenant>` groups. */
|
|
722
724
|
workerHealth(): Promise<GroupHealth[]>;
|
|
723
725
|
cancel(runId: string, opts?: {
|
|
@@ -804,7 +806,7 @@ declare class StoreRunGateway implements RunGateway {
|
|
|
804
806
|
constructor(store: StateStore, engine: WorkflowEngine);
|
|
805
807
|
topology(): DurableTopology;
|
|
806
808
|
getRunDetail(runId: string): Promise<RunDetail | null>;
|
|
807
|
-
listRuns(query: RunQuery): Promise<
|
|
809
|
+
listRuns(query: RunQuery): Promise<RunListItem[]>;
|
|
808
810
|
/** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
|
|
809
811
|
* `RunRequestResponder` (to the requester's `@<tenant>` groups); the operator's own UI sees all. */
|
|
810
812
|
workerHealth(): Promise<GroupHealth[]>;
|
package/dist/index.js
CHANGED
|
@@ -836,6 +836,8 @@ var ProxyRunGateway = class {
|
|
|
836
836
|
runId
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
|
+
/** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
|
|
840
|
+
* it through as plain JSON, so a tenant's list rows name the wait too. */
|
|
839
841
|
listRuns(query) {
|
|
840
842
|
return this.request({
|
|
841
843
|
kind: "listRuns",
|
|
@@ -1113,7 +1115,7 @@ var RunRequestResponder = class {
|
|
|
1113
1115
|
};
|
|
1114
1116
|
|
|
1115
1117
|
// src/store-run-gateway.ts
|
|
1116
|
-
import { STATE_STORE_CANONICAL as STATE_STORE_CANONICAL2, WorkflowEngine as WorkflowEngine2 } from "@dudousxd/nestjs-durable-core";
|
|
1118
|
+
import { STATE_STORE_CANONICAL as STATE_STORE_CANONICAL2, WorkflowEngine as WorkflowEngine2, indexWaitersByRun, resolveRunWaiting } from "@dudousxd/nestjs-durable-core";
|
|
1117
1119
|
import { Inject as Inject5, Injectable as Injectable8 } from "@nestjs/common";
|
|
1118
1120
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
1119
1121
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1160,8 +1162,16 @@ var StoreRunGateway = class {
|
|
|
1160
1162
|
children
|
|
1161
1163
|
};
|
|
1162
1164
|
}
|
|
1163
|
-
listRuns(query) {
|
|
1164
|
-
|
|
1165
|
+
async listRuns(query) {
|
|
1166
|
+
const runs = await this.store.listRuns(query);
|
|
1167
|
+
const waiterByRun = indexWaitersByRun(await this.store.listSignalWaiters(""));
|
|
1168
|
+
return runs.map((run) => {
|
|
1169
|
+
const waiting = resolveRunWaiting(run, waiterByRun);
|
|
1170
|
+
return waiting ? {
|
|
1171
|
+
...run,
|
|
1172
|
+
waiting
|
|
1173
|
+
} : run;
|
|
1174
|
+
});
|
|
1165
1175
|
}
|
|
1166
1176
|
/** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
|
|
1167
1177
|
* `RunRequestResponder` (to the requester's `@<tenant>` groups); the operator's own UI sees all. */
|