@upstash/workflow 1.2.0-demo-rc.1 → 1.2.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/README.md +1 -0
- package/astro.d.mts +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +72 -69
- package/astro.mjs +1 -1
- package/{chunk-NZCQPOPR.mjs → chunk-THS5AX2D.mjs} +128 -257
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +72 -69
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +72 -69
- package/express.mjs +1 -1
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +76 -73
- package/h3.mjs +5 -5
- package/hono.d.mts +2 -2
- package/hono.d.ts +2 -2
- package/hono.js +73 -265
- package/hono.mjs +2 -7
- package/index.d.mts +229 -138
- package/index.d.ts +229 -138
- package/index.js +275 -454
- package/index.mjs +144 -196
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +72 -263
- package/nextjs.mjs +1 -5
- package/package.json +1 -1
- package/react-router.d.mts +38 -0
- package/react-router.d.ts +38 -0
- package/react-router.js +3881 -0
- package/react-router.mjs +45 -0
- package/{serve-many-Bi8XaOyq.d.ts → serve-many-B-fe7bh7.d.ts} +1 -1
- package/{serve-many-CppVPJrh.d.mts → serve-many-C6sa_DxN.d.mts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +72 -69
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +72 -69
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +2 -2
- package/tanstack.d.ts +2 -2
- package/tanstack.js +72 -69
- package/tanstack.mjs +1 -1
- package/{types-CUwgrpCM.d.ts → types-B2S08hRU.d.mts} +18 -3
- package/{types-CUwgrpCM.d.mts → types-B2S08hRU.d.ts} +18 -3
package/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as StepType, R as RawStep, W as WorkflowMiddleware, a as WorkflowClient, b as WorkflowReceiver, c as RouteFunction, d as WorkflowServeOptions, T as Telemetry, N as NotifyResponse, e as Waiter } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse,
|
|
3
|
-
import {
|
|
1
|
+
import { S as StepType, R as RawStep, W as WorkflowMiddleware, a as WorkflowClient, b as WorkflowReceiver, c as RouteFunction, d as WorkflowServeOptions, T as Telemetry, N as NotifyResponse, e as Waiter } from './types-B2S08hRU.mjs';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, f as CallSettings, D as DetailedFinishCondition, g as Duration, E as ExclusiveValidationOptions, F as FailureFunctionPayload, h as FinishCondition, H as HeaderParams, I as InvokableWorkflow, i as InvokeStepResponse, j as InvokeWorkflowRequest, L as LazyInvokeStepParams, k as NotifyStepResponse, P as ParallelCallState, Q as QStashClientExtraConfig, l as RequiredExceptFields, m as Step, n as StepFunction, o as StepTypes, p as SyncStepFunction, q as WaitEventOptions, r as WaitRequest, s as WaitStepResponse, t as WorkflowAbort, u as WorkflowContext, v as WorkflowError, w as WorkflowNonRetryableError, x as WorkflowRetryAfterError } from './types-B2S08hRU.mjs';
|
|
3
|
+
import { FlowControl, PublishRequest, HTTPMethods, Client as Client$1 } from '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
type BaseStepLog = {
|
|
@@ -417,7 +417,21 @@ type TriggerOptions = {
|
|
|
417
417
|
* URL to call if the first request to the workflow endpoint fails
|
|
418
418
|
*/
|
|
419
419
|
failureUrl?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Configure which fields should be redacted in logs.
|
|
422
|
+
*
|
|
423
|
+
* - `{ body: true }` to redact the request body
|
|
424
|
+
* - `{ header: true }` to redact all headers
|
|
425
|
+
* - `{ header: ["Authorization"] }` to redact specific headers
|
|
426
|
+
*
|
|
427
|
+
* @default undefined
|
|
428
|
+
*/
|
|
429
|
+
redact?: {
|
|
430
|
+
body?: true;
|
|
431
|
+
header?: true | string[];
|
|
432
|
+
};
|
|
420
433
|
};
|
|
434
|
+
/** @deprecated Use `resume(dlqId)` or `resume([dlqId1, dlqId2])` instead of `resume({ dlqId })` */
|
|
421
435
|
type DLQResumeRestartOptions<TDLQId extends string | string[] = string | string[]> = {
|
|
422
436
|
dlqId: TDLQId;
|
|
423
437
|
} & Pick<TriggerOptions, "flowControl" | "retries">;
|
|
@@ -504,12 +518,116 @@ declare const serveBase: <TInitialPayload = unknown, TRequest extends Request =
|
|
|
504
518
|
*/
|
|
505
519
|
declare const serve: <TInitialPayload = unknown, TRequest extends Request = Request, TResponse extends Response = Response, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: WorkflowServeOptions<TInitialPayload, TResult>) => ReturnType<typeof serveBase<TInitialPayload, TRequest, TResponse, TResult>>;
|
|
506
520
|
|
|
507
|
-
type
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
521
|
+
type RequireAtLeastOne<T> = {
|
|
522
|
+
[K in keyof T]-?: Required<Pick<T, K>>;
|
|
523
|
+
}[keyof T];
|
|
524
|
+
/** Shared filter fields accepted by every qstash & workflow endpoint. */
|
|
525
|
+
type UniversalFilterFields = {
|
|
526
|
+
fromDate?: Date | number;
|
|
527
|
+
toDate?: Date | number;
|
|
528
|
+
callerIp?: string;
|
|
512
529
|
label?: string;
|
|
530
|
+
flowControlKey?: string;
|
|
531
|
+
};
|
|
532
|
+
/** Workflow-specific filter fields for DLQ and bulk endpoints. */
|
|
533
|
+
type WorkflowFilterFields = {
|
|
534
|
+
workflowUrl?: string;
|
|
535
|
+
workflowRunId?: string;
|
|
536
|
+
workflowCreatedAt?: number;
|
|
537
|
+
failureFunctionState?: string;
|
|
538
|
+
};
|
|
539
|
+
type WorkflowLogsFilterFields = {
|
|
540
|
+
state?: WorkflowRunLog["workflowState"];
|
|
541
|
+
messageId?: string;
|
|
542
|
+
};
|
|
543
|
+
type DLQActionFilterFields = UniversalFilterFields & WorkflowFilterFields;
|
|
544
|
+
/** Cancel filter: exact URL match. Cannot combine with `workflowUrlStartingWith`. */
|
|
545
|
+
type CancelFilterWithExactUrl = UniversalFilterFields & {
|
|
546
|
+
workflowUrl: string;
|
|
547
|
+
workflowUrlStartingWith?: never;
|
|
548
|
+
};
|
|
549
|
+
/** Cancel filter: URL prefix match. Cannot combine with `workflowUrl`. */
|
|
550
|
+
type CancelFilterWithPrefixUrl = UniversalFilterFields & {
|
|
551
|
+
workflowUrlStartingWith: string;
|
|
552
|
+
workflowUrl?: never;
|
|
553
|
+
};
|
|
554
|
+
/** Cancel filter: no URL. Requires at least one other filter field. */
|
|
555
|
+
type CancelFilterWithoutUrl = RequireAtLeastOne<UniversalFilterFields> & {
|
|
556
|
+
workflowUrl?: never;
|
|
557
|
+
workflowUrlStartingWith?: never;
|
|
558
|
+
};
|
|
559
|
+
type CancelFilter = CancelFilterWithExactUrl | CancelFilterWithPrefixUrl | CancelFilterWithoutUrl;
|
|
560
|
+
type WorkflowDLQBulkCount = {
|
|
561
|
+
cursor?: string;
|
|
562
|
+
/**
|
|
563
|
+
* Maximum number of messages to process per call.
|
|
564
|
+
*
|
|
565
|
+
* @default 100
|
|
566
|
+
*/
|
|
567
|
+
count?: number;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* DLQ bulk actions (resume, restart, delete) support three modes:
|
|
571
|
+
* - By dlqIds (no cursor)
|
|
572
|
+
* - By filter fields (with optional cursor and count)
|
|
573
|
+
* - All (with optional cursor and count)
|
|
574
|
+
*/
|
|
575
|
+
type WorkflowDLQActionFilters = {
|
|
576
|
+
dlqIds: string | string[];
|
|
577
|
+
filter?: never;
|
|
578
|
+
all?: never;
|
|
579
|
+
count?: never;
|
|
580
|
+
cursor?: never;
|
|
581
|
+
} | ({
|
|
582
|
+
filter: RequireAtLeastOne<DLQActionFilterFields>;
|
|
583
|
+
dlqIds?: never;
|
|
584
|
+
all?: never;
|
|
585
|
+
} & WorkflowDLQBulkCount) | ({
|
|
586
|
+
all: true;
|
|
587
|
+
dlqIds?: never;
|
|
588
|
+
filter?: never;
|
|
589
|
+
} & WorkflowDLQBulkCount);
|
|
590
|
+
type WorkflowDLQListFilters = UniversalFilterFields & WorkflowFilterFields & {
|
|
591
|
+
/** @deprecated Use `workflowUrl` instead. */
|
|
592
|
+
url?: string;
|
|
593
|
+
/** @deprecated No longer supported in the new API. */
|
|
594
|
+
responseStatus?: number;
|
|
595
|
+
};
|
|
596
|
+
type WorkflowCancelCount = {
|
|
597
|
+
/**
|
|
598
|
+
* Maximum number of workflow runs to cancel per call.
|
|
599
|
+
*
|
|
600
|
+
* @default 100
|
|
601
|
+
*/
|
|
602
|
+
count?: number;
|
|
603
|
+
};
|
|
604
|
+
/**
|
|
605
|
+
* We don't accept a single workflowRunId or workflowCreatedAt because there
|
|
606
|
+
* could only be one running workflow with a single wfrid at the same time.
|
|
607
|
+
* So using these do not make sense.
|
|
608
|
+
*
|
|
609
|
+
* Also failureFunctionState is not available.
|
|
610
|
+
* Cancel does not support cursor.
|
|
611
|
+
*/
|
|
612
|
+
type WorkflowRunCancelFilters = {
|
|
613
|
+
workflowRunIds: string[];
|
|
614
|
+
filter?: never;
|
|
615
|
+
all?: never;
|
|
616
|
+
count?: never;
|
|
617
|
+
} | ({
|
|
618
|
+
filter: CancelFilter;
|
|
619
|
+
workflowRunIds?: never;
|
|
620
|
+
all?: never;
|
|
621
|
+
} & WorkflowCancelCount) | ({
|
|
622
|
+
all: true;
|
|
623
|
+
workflowRunIds?: never;
|
|
624
|
+
filter?: never;
|
|
625
|
+
} & WorkflowCancelCount);
|
|
626
|
+
type WorkflowLogsListFilters = UniversalFilterFields & Pick<WorkflowFilterFields, "workflowUrl" | "workflowRunId" | "workflowCreatedAt"> & WorkflowLogsFilterFields;
|
|
627
|
+
|
|
628
|
+
type ResumeRestartOptions = {
|
|
629
|
+
flowControl?: FlowControl;
|
|
630
|
+
retries?: number;
|
|
513
631
|
};
|
|
514
632
|
type FailureCallbackInfo = {
|
|
515
633
|
state?: "CALLBACK_FAIL" | "CALLBACK_SUCCESS" | "CALLBACK_INPROGRESS";
|
|
@@ -574,7 +692,7 @@ declare class DLQ {
|
|
|
574
692
|
list(parameters?: {
|
|
575
693
|
cursor?: string;
|
|
576
694
|
count?: number;
|
|
577
|
-
filter?:
|
|
695
|
+
filter?: WorkflowDLQListFilters;
|
|
578
696
|
}): Promise<{
|
|
579
697
|
messages: PublicDLQMessage[];
|
|
580
698
|
cursor?: string;
|
|
@@ -588,41 +706,31 @@ declare class DLQ {
|
|
|
588
706
|
* If you want to restart the workflow run from the beginning, use
|
|
589
707
|
* `restart` method instead.
|
|
590
708
|
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
* key: "my-flow-control-key",
|
|
597
|
-
* value: "my-flow-control-value",
|
|
598
|
-
* },
|
|
599
|
-
* retries: 3,
|
|
600
|
-
* });
|
|
709
|
+
* Can be called with:
|
|
710
|
+
* - A single dlqId: `resume("id")`
|
|
711
|
+
* - An array of dlqIds: `resume(["id1", "id2"])`
|
|
712
|
+
* - A filter object: `resume({ filter: { label: "my-label", fromDate: 1640995200000 } })`
|
|
713
|
+
* - To target all entries: `resume({ all: true })`
|
|
601
714
|
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
715
|
+
* Processes up to `count` messages per call (defaults to 100).
|
|
716
|
+
* Call in a loop until cursor is undefined to process all:
|
|
604
717
|
*
|
|
605
|
-
* Example with multiple DLQ IDs:
|
|
606
718
|
* ```ts
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
* console.log(response[1].workflowRunId); // ID of the second workflow run
|
|
719
|
+
* let cursor: string | undefined;
|
|
720
|
+
* do {
|
|
721
|
+
* const result = await client.dlq.resume({ all: true, count: 100, cursor });
|
|
722
|
+
* cursor = result.cursor;
|
|
723
|
+
* } while (cursor);
|
|
613
724
|
* ```
|
|
614
|
-
*
|
|
615
|
-
* if the dlqId is not found, throws an error.
|
|
616
|
-
*
|
|
617
|
-
* @param dlqId - The ID(s) of the DLQ message(s) to resume.
|
|
618
|
-
* @param flowControl - Optional flow control parameters. If not passed, flow
|
|
619
|
-
* control of the failing workflow will be used
|
|
620
|
-
* @param retries - Optional number of retries to perform if the request fails.
|
|
621
|
-
* If not passed, retries settings of the failing workflow will be used.
|
|
622
|
-
* @returns run id and creation time of the new workflow run(s).
|
|
623
725
|
*/
|
|
624
|
-
resume(
|
|
625
|
-
|
|
726
|
+
resume(request: string | string[] | WorkflowDLQActionFilters, options?: ResumeRestartOptions): Promise<{
|
|
727
|
+
cursor?: string;
|
|
728
|
+
workflowRuns: DLQResumeRestartResponse[];
|
|
729
|
+
}>;
|
|
730
|
+
/** @deprecated Use `resume(dlqId)` instead */
|
|
731
|
+
resume(request: DLQResumeRestartOptions<string>): Promise<DLQResumeRestartResponse>;
|
|
732
|
+
/** @deprecated Use `resume([dlqId1, dlqId2])` instead */
|
|
733
|
+
resume(request: DLQResumeRestartOptions<string[]>): Promise<DLQResumeRestartResponse[]>;
|
|
626
734
|
/**
|
|
627
735
|
* Restarts the workflow run for the given DLQ message(s).
|
|
628
736
|
*
|
|
@@ -632,41 +740,31 @@ declare class DLQ {
|
|
|
632
740
|
* If you want to resume the workflow run from where it failed, use
|
|
633
741
|
* `resume` method instead.
|
|
634
742
|
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* key: "my-flow-control-key",
|
|
641
|
-
* value: "my-flow-control-value",
|
|
642
|
-
* },
|
|
643
|
-
* retries: 3,
|
|
644
|
-
* });
|
|
743
|
+
* Can be called with:
|
|
744
|
+
* - A single dlqId: `restart("id")`
|
|
745
|
+
* - An array of dlqIds: `restart(["id1", "id2"])`
|
|
746
|
+
* - A filter object: `restart({ filter: { label: "my-label", fromDate: 1640995200000 } })`
|
|
747
|
+
* - To target all entries: `restart({ all: true })`
|
|
645
748
|
*
|
|
646
|
-
*
|
|
647
|
-
*
|
|
749
|
+
* Processes up to `count` messages per call (defaults to 100).
|
|
750
|
+
* Call in a loop until cursor is undefined to process all:
|
|
648
751
|
*
|
|
649
|
-
* Example with multiple DLQ IDs:
|
|
650
752
|
* ```ts
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
* console.log(response[1].workflowRunId); // ID of the second workflow run
|
|
753
|
+
* let cursor: string | undefined;
|
|
754
|
+
* do {
|
|
755
|
+
* const result = await client.dlq.restart({ all: true, count: 100, cursor });
|
|
756
|
+
* cursor = result.cursor;
|
|
757
|
+
* } while (cursor);
|
|
657
758
|
* ```
|
|
658
|
-
*
|
|
659
|
-
* if the dlqId is not found, throws an error.
|
|
660
|
-
*
|
|
661
|
-
* @param dlqId - The ID(s) of the DLQ message(s) to restart.
|
|
662
|
-
* @param flowControl - Optional flow control parameters. If not passed, flow
|
|
663
|
-
* control of the failing workflow will be used
|
|
664
|
-
* @param retries - Optional number of retries to perform if the request fails.
|
|
665
|
-
* If not passed, retries settings of the failing workflow will be used.
|
|
666
|
-
* @returns run id and creation time of the new workflow run(s).
|
|
667
759
|
*/
|
|
668
|
-
restart(
|
|
669
|
-
|
|
760
|
+
restart(request: string | string[] | WorkflowDLQActionFilters, options?: ResumeRestartOptions): Promise<{
|
|
761
|
+
cursor?: string;
|
|
762
|
+
workflowRuns: DLQResumeRestartResponse[];
|
|
763
|
+
}>;
|
|
764
|
+
/** @deprecated Use `restart(dlqId)` instead */
|
|
765
|
+
restart(request: DLQResumeRestartOptions<string>): Promise<DLQResumeRestartResponse>;
|
|
766
|
+
/** @deprecated Use `restart([dlqId1, dlqId2])` instead */
|
|
767
|
+
restart(request: DLQResumeRestartOptions<string[]>): Promise<DLQResumeRestartResponse[]>;
|
|
670
768
|
/**
|
|
671
769
|
* Retry the failure callback of a workflow run whose failureUrl/failureFunction
|
|
672
770
|
* request has failed.
|
|
@@ -678,17 +776,31 @@ declare class DLQ {
|
|
|
678
776
|
error?: string;
|
|
679
777
|
}>;
|
|
680
778
|
/**
|
|
681
|
-
*
|
|
779
|
+
* Delete DLQ messages.
|
|
682
780
|
*
|
|
683
|
-
*
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
*
|
|
781
|
+
* Can be called with:
|
|
782
|
+
* - A single dlqId: `delete("id")`
|
|
783
|
+
* - An array of dlqIds: `delete(["id1", "id2"])`
|
|
784
|
+
* - A filter object: `delete({ filter: { label: "my-label", fromDate: 1640995200000 } })`
|
|
785
|
+
* - To target all entries: `delete({ all: true })`
|
|
688
786
|
*
|
|
689
|
-
*
|
|
787
|
+
* Processes up to `count` messages per call (defaults to 100).
|
|
788
|
+
* Call in a loop until cursor is undefined to process all:
|
|
789
|
+
*
|
|
790
|
+
* ```ts
|
|
791
|
+
* let cursor: string | undefined;
|
|
792
|
+
* do {
|
|
793
|
+
* const result = await client.dlq.delete({ all: true, count: 100, cursor });
|
|
794
|
+
* cursor = result.cursor;
|
|
795
|
+
* } while (cursor);
|
|
796
|
+
* ```
|
|
690
797
|
*/
|
|
691
|
-
|
|
798
|
+
delete(request: string | string[] | WorkflowDLQActionFilters): Promise<{
|
|
799
|
+
cursor?: string;
|
|
800
|
+
deleted: number;
|
|
801
|
+
} & {
|
|
802
|
+
error?: string;
|
|
803
|
+
}>;
|
|
692
804
|
}
|
|
693
805
|
|
|
694
806
|
type ClientConfig = ConstructorParameters<typeof Client$1>[0];
|
|
@@ -703,73 +815,34 @@ type ClientConfig = ConstructorParameters<typeof Client$1>[0];
|
|
|
703
815
|
*/
|
|
704
816
|
declare class Client {
|
|
705
817
|
private client;
|
|
706
|
-
|
|
707
|
-
constructor(clientConfig?: ClientConfig);
|
|
818
|
+
constructor(clientConfig: ClientConfig);
|
|
708
819
|
/**
|
|
709
|
-
*
|
|
710
|
-
* If a server is already listening on the port (started by another process
|
|
711
|
-
* or by a platform's serve()), this is a no-op.
|
|
712
|
-
*/
|
|
713
|
-
private ensureReady;
|
|
714
|
-
/**
|
|
715
|
-
* Cancel an ongoing workflow
|
|
716
|
-
*
|
|
717
|
-
* Returns true if workflow is canceled succesfully. Otherwise, throws error.
|
|
718
|
-
*
|
|
719
|
-
* There are multiple ways you can cancel workflows:
|
|
720
|
-
* - pass one or more workflow run ids to cancel them
|
|
721
|
-
* - pass a workflow url to cancel all runs starting with this url
|
|
722
|
-
* - cancel all pending or active workflow runs
|
|
723
|
-
*
|
|
724
|
-
* ### Cancel a set of workflow runs
|
|
820
|
+
* Cancel an ongoing workflow.
|
|
725
821
|
*
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
* "<WORKFLOW_RUN_ID_2>",
|
|
734
|
-
* ]})
|
|
735
|
-
* ```
|
|
736
|
-
*
|
|
737
|
-
* ### Cancel workflows starting with a url
|
|
822
|
+
* Can be called with:
|
|
823
|
+
* - A single workflow run id: `cancel("wfr_123")`
|
|
824
|
+
* - An array of workflow run ids: `cancel(["wfr_123", "wfr_456"])`
|
|
825
|
+
* - By exact URL: `cancel({ filter: { workflowUrl: "https://..." } })`
|
|
826
|
+
* - By URL prefix: `cancel({ filter: { workflowUrlStartingWith: "https://..." } })`
|
|
827
|
+
* - With other filters: `cancel({ filter: { label: "my-label" } })`
|
|
828
|
+
* - To target all: `cancel({ all: true })`
|
|
738
829
|
*
|
|
739
|
-
*
|
|
740
|
-
* want to cancel all workflow runs on it, you can use `urlStartingWith`.
|
|
741
|
-
*
|
|
742
|
-
* Note that this will cancel workflows in all endpoints under
|
|
743
|
-
* `https://your-endpoint.com`.
|
|
830
|
+
* Cancels up to `count` workflow runs per call (defaults to 100).
|
|
744
831
|
*
|
|
745
832
|
* ```ts
|
|
746
|
-
* await client.cancel({
|
|
833
|
+
* const result = await client.cancel({ all: true, count: 50 });
|
|
747
834
|
* ```
|
|
748
|
-
*
|
|
749
|
-
* ### Cancel *all* workflows
|
|
750
|
-
*
|
|
751
|
-
* To cancel all pending and currently running workflows, you can
|
|
752
|
-
* do it like this:
|
|
753
|
-
*
|
|
754
|
-
* ```ts
|
|
755
|
-
* await client.cancel({ all: true })
|
|
756
|
-
* ```
|
|
757
|
-
*
|
|
758
|
-
* @param ids run id of the workflow to delete
|
|
759
|
-
* @param urlStartingWith cancel workflows starting with this url. Will be ignored
|
|
760
|
-
* if `ids` parameter is set.
|
|
761
|
-
* @param all set to true in order to cancel all workflows. Will be ignored
|
|
762
|
-
* if `ids` or `urlStartingWith` parameters are set.
|
|
763
|
-
* @returns true if workflow is succesfully deleted. Otherwise throws QStashError
|
|
764
835
|
*/
|
|
765
|
-
cancel(
|
|
836
|
+
cancel(request: string | string[] | WorkflowRunCancelFilters): Promise<{
|
|
837
|
+
cancelled: number;
|
|
838
|
+
}>;
|
|
839
|
+
/** @deprecated Use `cancel(id)`, `cancel([id1, id2])`, `cancel({ filter: { workflowUrlStartingWith } })` instead. */
|
|
840
|
+
cancel(request: {
|
|
766
841
|
ids?: string | string[];
|
|
767
842
|
urlStartingWith?: string;
|
|
768
843
|
all?: true;
|
|
769
844
|
}): Promise<{
|
|
770
845
|
cancelled: number;
|
|
771
|
-
} & {
|
|
772
|
-
error?: string;
|
|
773
846
|
}>;
|
|
774
847
|
/**
|
|
775
848
|
* Notify a workflow run waiting for an event
|
|
@@ -784,12 +857,24 @@ declare class Client {
|
|
|
784
857
|
* });
|
|
785
858
|
* ```
|
|
786
859
|
*
|
|
860
|
+
* Optionally, you can pass a workflowRunId to enable lookback functionality:
|
|
861
|
+
*
|
|
862
|
+
* ```ts
|
|
863
|
+
* await client.notify({
|
|
864
|
+
* eventId: "my-event-id",
|
|
865
|
+
* eventData: "my-data",
|
|
866
|
+
* workflowRunId: "wfr_123" // enables lookback
|
|
867
|
+
* });
|
|
868
|
+
* ```
|
|
869
|
+
*
|
|
787
870
|
* @param eventId event id to notify
|
|
788
871
|
* @param eventData data to provide to the workflow
|
|
872
|
+
* @param workflowRunId optional workflow run id for lookback support
|
|
789
873
|
*/
|
|
790
|
-
notify({ eventId, eventData, }: {
|
|
874
|
+
notify({ eventId, eventData, workflowRunId, }: {
|
|
791
875
|
eventId: string;
|
|
792
876
|
eventData?: unknown;
|
|
877
|
+
workflowRunId?: string;
|
|
793
878
|
}): Promise<NotifyResponse[]>;
|
|
794
879
|
/**
|
|
795
880
|
* Check waiters of an event
|
|
@@ -905,13 +990,19 @@ declare class Client {
|
|
|
905
990
|
* ```
|
|
906
991
|
*/
|
|
907
992
|
logs(params?: {
|
|
908
|
-
workflowRunId?: WorkflowRunLog["workflowRunId"];
|
|
909
993
|
cursor?: string;
|
|
910
994
|
count?: number;
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
995
|
+
filter?: WorkflowLogsListFilters;
|
|
996
|
+
/** @deprecated Use `filter.workflowRunId` instead. */
|
|
997
|
+
workflowRunId?: string;
|
|
998
|
+
/** @deprecated Use `filter.state` instead. */
|
|
999
|
+
state?: string;
|
|
1000
|
+
/** @deprecated Use `filter.workflowUrl` instead. */
|
|
1001
|
+
workflowUrl?: string;
|
|
1002
|
+
/** @deprecated Use `filter.label` instead. */
|
|
1003
|
+
label?: string;
|
|
1004
|
+
/** @deprecated Use `filter.workflowCreatedAt` instead. */
|
|
1005
|
+
workflowCreatedAt?: number;
|
|
915
1006
|
}): Promise<WorkflowRunLogs>;
|
|
916
1007
|
get dlq(): DLQ;
|
|
917
1008
|
}
|