@dudousxd/nestjs-durable 0.52.6 → 0.52.7

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 { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnErrorInput, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, TenantVerifier, TenantTokenSource, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, EngineEvent, StepInvocation, WorkflowRun, TenantEvent } from '@dudousxd/nestjs-durable-core';
1
+ import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnErrorInput, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, TenantVerifier, TenantTokenSource, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, EngineEvent, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
2
2
  export { AttributeFilter, DynamicWorkflowCtx, EngineEvent, InferSearchAttributes, OnErrorInput, RunDetail, RunGateway, RunListItem, RunQuery, RunSchedulesOptions, RunStatus, RunWaiting, ScheduledWorkflow, SearchAttributes, SearchAttributesSchema, StepCheckpoint, StepEvent, StepLogger, TenantTokenSource, TenantVerifier, VerifiedTenant, WorkflowCtx, WorkflowEngine, WorkflowHandler, WorkflowRun, hmacTenantVerifier, prevCronFireMs, readSearchAttributes, runSchedules, scheduleRunIdAt, scheduledRunId, signTenantToken } from '@dudousxd/nestjs-durable-core';
3
3
  import { z } from 'zod';
4
4
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
@@ -1216,6 +1216,11 @@ declare class ProxyRunGateway implements RunGateway {
1216
1216
  getRunDetail(runId: string, options?: RunDetailOptions): Promise<RunDetail | null>;
1217
1217
  /** Paged from the full detail when the control plane is too old to page a fan itself. */
1218
1218
  getFanMembers(runId: string, group: string, query: FanPageQuery): Promise<FanPage | null>;
1219
+ /**
1220
+ * The run alone, without its timeline. Read from the full detail when the control plane is too old
1221
+ * to know the verb: it then answers with no data, or with an unsupported-request error.
1222
+ */
1223
+ getRun(runId: string): Promise<WorkflowRun | null>;
1219
1224
  private knownUnsupported;
1220
1225
  /** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
1221
1226
  * it through as plain JSON, so a tenant's list rows name the wait too. */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnErrorInput, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, TenantVerifier, TenantTokenSource, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, EngineEvent, StepInvocation, WorkflowRun, TenantEvent } from '@dudousxd/nestjs-durable-core';
1
+ import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnErrorInput, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, TenantVerifier, TenantTokenSource, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, EngineEvent, StepInvocation, TenantEvent } from '@dudousxd/nestjs-durable-core';
2
2
  export { AttributeFilter, DynamicWorkflowCtx, EngineEvent, InferSearchAttributes, OnErrorInput, RunDetail, RunGateway, RunListItem, RunQuery, RunSchedulesOptions, RunStatus, RunWaiting, ScheduledWorkflow, SearchAttributes, SearchAttributesSchema, StepCheckpoint, StepEvent, StepLogger, TenantTokenSource, TenantVerifier, VerifiedTenant, WorkflowCtx, WorkflowEngine, WorkflowHandler, WorkflowRun, hmacTenantVerifier, prevCronFireMs, readSearchAttributes, runSchedules, scheduleRunIdAt, scheduledRunId, signTenantToken } from '@dudousxd/nestjs-durable-core';
3
3
  import { z } from 'zod';
4
4
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
@@ -1216,6 +1216,11 @@ declare class ProxyRunGateway implements RunGateway {
1216
1216
  getRunDetail(runId: string, options?: RunDetailOptions): Promise<RunDetail | null>;
1217
1217
  /** Paged from the full detail when the control plane is too old to page a fan itself. */
1218
1218
  getFanMembers(runId: string, group: string, query: FanPageQuery): Promise<FanPage | null>;
1219
+ /**
1220
+ * The run alone, without its timeline. Read from the full detail when the control plane is too old
1221
+ * to know the verb: it then answers with no data, or with an unsupported-request error.
1222
+ */
1223
+ getRun(runId: string): Promise<WorkflowRun | null>;
1219
1224
  private knownUnsupported;
1220
1225
  /** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
1221
1226
  * it through as plain JSON, so a tenant's list rows name the wait too. */
package/dist/index.js CHANGED
@@ -1170,6 +1170,7 @@ var UNSUPPORTED_RUN_REQUEST = "unsupported-request";
1170
1170
  var KNOWN_KINDS = /* @__PURE__ */ new Set([
1171
1171
  "getRunDetail",
1172
1172
  "getFanMembers",
1173
+ "getRun",
1173
1174
  "listRuns",
1174
1175
  "runFacets",
1175
1176
  "runValueFacets",
@@ -1342,6 +1343,15 @@ var RunRequestResponder = class {
1342
1343
  }
1343
1344
  };
1344
1345
  }
1346
+ if (body.kind === "getRun") {
1347
+ return {
1348
+ requestId: msg.requestId,
1349
+ result: {
1350
+ ok: true,
1351
+ data: run ?? null
1352
+ }
1353
+ };
1354
+ }
1345
1355
  if (body.kind === "getFanMembers") {
1346
1356
  const data = run ? await this.gateway.getFanMembers?.(body.runId, body.group, body.query) ?? null : null;
1347
1357
  return {
@@ -1549,6 +1559,29 @@ var ProxyRunGateway = class {
1549
1559
  });
1550
1560
  return detail ? pageFan(detail.timeline, group, query) : null;
1551
1561
  }
1562
+ /**
1563
+ * The run alone, without its timeline. Read from the full detail when the control plane is too old
1564
+ * to know the verb: it then answers with no data, or with an unsupported-request error.
1565
+ */
1566
+ async getRun(runId) {
1567
+ if (!this.knownUnsupported("getRun")) {
1568
+ try {
1569
+ const run = await this.request({
1570
+ kind: "getRun",
1571
+ runId
1572
+ });
1573
+ if (run !== void 0) return run;
1574
+ } catch (err) {
1575
+ if (!isUnsupported(err)) throw err;
1576
+ }
1577
+ this.unsupportedUntil.set("getRun", Date.now() + this.capabilityTtlMs);
1578
+ }
1579
+ const detail = await this.request({
1580
+ kind: "getRunDetail",
1581
+ runId
1582
+ });
1583
+ return detail?.run ?? null;
1584
+ }
1552
1585
  knownUnsupported(kind) {
1553
1586
  const until = this.unsupportedUntil.get(kind);
1554
1587
  if (until === void 0) return false;