@upstash/workflow 0.1.4 → 0.2.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/astro.d.mts +1 -1
- package/astro.d.ts +1 -1
- package/astro.js +348 -191
- package/astro.mjs +1 -1
- package/{chunk-HO2SB246.mjs → chunk-5R2BFC3N.mjs} +419 -194
- package/cloudflare.d.mts +1 -1
- package/cloudflare.d.ts +1 -1
- package/cloudflare.js +348 -191
- package/cloudflare.mjs +1 -1
- package/express.d.mts +1 -1
- package/express.d.ts +1 -1
- package/express.js +369 -189
- package/express.mjs +17 -4
- package/h3.d.mts +1 -1
- package/h3.d.ts +1 -1
- package/h3.js +348 -191
- package/h3.mjs +1 -1
- package/hono.d.mts +1 -1
- package/hono.d.ts +1 -1
- package/hono.js +348 -191
- package/hono.mjs +1 -1
- package/index.d.mts +74 -21
- package/index.d.ts +74 -21
- package/index.js +426 -211
- package/index.mjs +5 -5
- package/nextjs.d.mts +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +348 -191
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +348 -191
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +348 -191
- package/svelte.mjs +1 -1
- package/{types-CQuc-j8n.d.mts → types-Cki_MHrh.d.mts} +85 -31
- package/{types-CQuc-j8n.d.ts → types-Cki_MHrh.d.ts} +85 -31
package/hono.mjs
CHANGED
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext,
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-Cki_MHrh.mjs';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, o as WaitEventOptions, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, q as WorkflowLogger, p as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-Cki_MHrh.mjs';
|
|
3
3
|
import { Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,20 +30,62 @@ declare class Client {
|
|
|
30
30
|
/**
|
|
31
31
|
* Cancel an ongoing workflow
|
|
32
32
|
*
|
|
33
|
+
* Returns true if workflow is canceled succesfully. Otherwise, throws error.
|
|
34
|
+
*
|
|
35
|
+
* There are multiple ways you can cancel workflows:
|
|
36
|
+
* - pass one or more workflow run ids to cancel them
|
|
37
|
+
* - pass a workflow url to cancel all runs starting with this url
|
|
38
|
+
* - cancel all pending or active workflow runs
|
|
39
|
+
*
|
|
40
|
+
* ### Cancel a set of workflow runs
|
|
41
|
+
*
|
|
33
42
|
* ```ts
|
|
34
|
-
*
|
|
43
|
+
* // cancel a single workflow
|
|
44
|
+
* await client.cancel({ ids: "<WORKFLOW_RUN_ID>" })
|
|
35
45
|
*
|
|
36
|
-
*
|
|
37
|
-
* await client.cancel({
|
|
46
|
+
* // cancel a set of workflow runs
|
|
47
|
+
* await client.cancel({ ids: [
|
|
48
|
+
* "<WORKFLOW_RUN_ID_1>",
|
|
49
|
+
* "<WORKFLOW_RUN_ID_2>",
|
|
50
|
+
* ]})
|
|
38
51
|
* ```
|
|
39
52
|
*
|
|
40
|
-
*
|
|
53
|
+
* ### Cancel workflows starting with a url
|
|
54
|
+
*
|
|
55
|
+
* If you have an endpoint called `https://your-endpoint.com` and you
|
|
56
|
+
* want to cancel all workflow runs on it, you can use `urlStartingWith`.
|
|
57
|
+
*
|
|
58
|
+
* Note that this will cancel workflows in all endpoints under
|
|
59
|
+
* `https://your-endpoint.com`.
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.cancel({ urlStartingWith: "https://your-endpoint.com" })
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ### Cancel *all* workflows
|
|
66
|
+
*
|
|
67
|
+
* To cancel all pending and currently running workflows, you can
|
|
68
|
+
* do it like this:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* await client.cancel({ all: true })
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param ids run id of the workflow to delete
|
|
75
|
+
* @param urlStartingWith cancel workflows starting with this url. Will be ignored
|
|
76
|
+
* if `ids` parameter is set.
|
|
77
|
+
* @param all set to true in order to cancel all workflows. Will be ignored
|
|
78
|
+
* if `ids` or `urlStartingWith` parameters are set.
|
|
41
79
|
* @returns true if workflow is succesfully deleted. Otherwise throws QStashError
|
|
42
80
|
*/
|
|
43
|
-
cancel({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
81
|
+
cancel({ ids, urlStartingWith, all, }: {
|
|
82
|
+
ids?: string | string[];
|
|
83
|
+
urlStartingWith?: string;
|
|
84
|
+
all?: true;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
cancelled: number;
|
|
87
|
+
} & {
|
|
88
|
+
error?: string;
|
|
47
89
|
}>;
|
|
48
90
|
/**
|
|
49
91
|
* Notify a workflow run waiting for an event
|
|
@@ -86,13 +128,13 @@ declare class Client {
|
|
|
86
128
|
* Trigger new workflow run and returns the workflow run id
|
|
87
129
|
*
|
|
88
130
|
* ```ts
|
|
89
|
-
* const { workflowRunId } await client.trigger({
|
|
131
|
+
* const { workflowRunId } = await client.trigger({
|
|
90
132
|
* url: "https://workflow-endpoint.com",
|
|
91
|
-
* body: "hello there!",
|
|
92
|
-
* headers: { ... },
|
|
93
|
-
* workflowRunId: "my-workflow", //
|
|
94
|
-
* retries: 3
|
|
95
|
-
* })
|
|
133
|
+
* body: "hello there!", // Optional body
|
|
134
|
+
* headers: { ... }, // Optional headers
|
|
135
|
+
* workflowRunId: "my-workflow", // Optional workflow run ID
|
|
136
|
+
* retries: 3 // Optional retries for the initial request
|
|
137
|
+
* });
|
|
96
138
|
*
|
|
97
139
|
* console.log(workflowRunId)
|
|
98
140
|
* // wfr_my-workflow
|
|
@@ -124,16 +166,27 @@ declare class Client {
|
|
|
124
166
|
/**
|
|
125
167
|
* Error raised during Workflow execution
|
|
126
168
|
*/
|
|
127
|
-
declare class
|
|
169
|
+
declare class WorkflowError extends QstashError {
|
|
128
170
|
constructor(message: string);
|
|
129
171
|
}
|
|
130
172
|
/**
|
|
131
|
-
* Raised when the workflow executes a function
|
|
173
|
+
* Raised when the workflow executes a function successfully
|
|
174
|
+
* and aborts to end the execution
|
|
132
175
|
*/
|
|
133
|
-
declare class
|
|
176
|
+
declare class WorkflowAbort extends Error {
|
|
134
177
|
stepInfo?: Step;
|
|
135
178
|
stepName: string;
|
|
136
|
-
|
|
179
|
+
/**
|
|
180
|
+
* whether workflow is to be canceled on abort
|
|
181
|
+
*/
|
|
182
|
+
cancelWorkflow: boolean;
|
|
183
|
+
/**
|
|
184
|
+
*
|
|
185
|
+
* @param stepName name of the aborting step
|
|
186
|
+
* @param stepInfo step information
|
|
187
|
+
* @param cancelWorkflow
|
|
188
|
+
*/
|
|
189
|
+
constructor(stepName: string, stepInfo?: Step, cancelWorkflow?: boolean);
|
|
137
190
|
}
|
|
138
191
|
|
|
139
|
-
export { Client, NotifyResponse,
|
|
192
|
+
export { Client, NotifyResponse, RouteFunction, Step, Waiter, WorkflowAbort, WorkflowError, WorkflowServeOptions, serve };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext,
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, N as NotifyResponse, a as Waiter, S as Step } from './types-Cki_MHrh.js';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, D as Duration, j as FailureFunctionPayload, F as FinishCondition, L as LogLevel, n as NotifyStepResponse, P as ParallelCallState, g as RawStep, k as RequiredExceptFields, i as StepFunction, f as StepType, e as StepTypes, h as SyncStepFunction, o as WaitEventOptions, l as WaitRequest, m as WaitStepResponse, c as WorkflowClient, b as WorkflowContext, q as WorkflowLogger, p as WorkflowLoggerOptions, d as WorkflowReceiver } from './types-Cki_MHrh.js';
|
|
3
3
|
import { Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -30,20 +30,62 @@ declare class Client {
|
|
|
30
30
|
/**
|
|
31
31
|
* Cancel an ongoing workflow
|
|
32
32
|
*
|
|
33
|
+
* Returns true if workflow is canceled succesfully. Otherwise, throws error.
|
|
34
|
+
*
|
|
35
|
+
* There are multiple ways you can cancel workflows:
|
|
36
|
+
* - pass one or more workflow run ids to cancel them
|
|
37
|
+
* - pass a workflow url to cancel all runs starting with this url
|
|
38
|
+
* - cancel all pending or active workflow runs
|
|
39
|
+
*
|
|
40
|
+
* ### Cancel a set of workflow runs
|
|
41
|
+
*
|
|
33
42
|
* ```ts
|
|
34
|
-
*
|
|
43
|
+
* // cancel a single workflow
|
|
44
|
+
* await client.cancel({ ids: "<WORKFLOW_RUN_ID>" })
|
|
35
45
|
*
|
|
36
|
-
*
|
|
37
|
-
* await client.cancel({
|
|
46
|
+
* // cancel a set of workflow runs
|
|
47
|
+
* await client.cancel({ ids: [
|
|
48
|
+
* "<WORKFLOW_RUN_ID_1>",
|
|
49
|
+
* "<WORKFLOW_RUN_ID_2>",
|
|
50
|
+
* ]})
|
|
38
51
|
* ```
|
|
39
52
|
*
|
|
40
|
-
*
|
|
53
|
+
* ### Cancel workflows starting with a url
|
|
54
|
+
*
|
|
55
|
+
* If you have an endpoint called `https://your-endpoint.com` and you
|
|
56
|
+
* want to cancel all workflow runs on it, you can use `urlStartingWith`.
|
|
57
|
+
*
|
|
58
|
+
* Note that this will cancel workflows in all endpoints under
|
|
59
|
+
* `https://your-endpoint.com`.
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.cancel({ urlStartingWith: "https://your-endpoint.com" })
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ### Cancel *all* workflows
|
|
66
|
+
*
|
|
67
|
+
* To cancel all pending and currently running workflows, you can
|
|
68
|
+
* do it like this:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* await client.cancel({ all: true })
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param ids run id of the workflow to delete
|
|
75
|
+
* @param urlStartingWith cancel workflows starting with this url. Will be ignored
|
|
76
|
+
* if `ids` parameter is set.
|
|
77
|
+
* @param all set to true in order to cancel all workflows. Will be ignored
|
|
78
|
+
* if `ids` or `urlStartingWith` parameters are set.
|
|
41
79
|
* @returns true if workflow is succesfully deleted. Otherwise throws QStashError
|
|
42
80
|
*/
|
|
43
|
-
cancel({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
81
|
+
cancel({ ids, urlStartingWith, all, }: {
|
|
82
|
+
ids?: string | string[];
|
|
83
|
+
urlStartingWith?: string;
|
|
84
|
+
all?: true;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
cancelled: number;
|
|
87
|
+
} & {
|
|
88
|
+
error?: string;
|
|
47
89
|
}>;
|
|
48
90
|
/**
|
|
49
91
|
* Notify a workflow run waiting for an event
|
|
@@ -86,13 +128,13 @@ declare class Client {
|
|
|
86
128
|
* Trigger new workflow run and returns the workflow run id
|
|
87
129
|
*
|
|
88
130
|
* ```ts
|
|
89
|
-
* const { workflowRunId } await client.trigger({
|
|
131
|
+
* const { workflowRunId } = await client.trigger({
|
|
90
132
|
* url: "https://workflow-endpoint.com",
|
|
91
|
-
* body: "hello there!",
|
|
92
|
-
* headers: { ... },
|
|
93
|
-
* workflowRunId: "my-workflow", //
|
|
94
|
-
* retries: 3
|
|
95
|
-
* })
|
|
133
|
+
* body: "hello there!", // Optional body
|
|
134
|
+
* headers: { ... }, // Optional headers
|
|
135
|
+
* workflowRunId: "my-workflow", // Optional workflow run ID
|
|
136
|
+
* retries: 3 // Optional retries for the initial request
|
|
137
|
+
* });
|
|
96
138
|
*
|
|
97
139
|
* console.log(workflowRunId)
|
|
98
140
|
* // wfr_my-workflow
|
|
@@ -124,16 +166,27 @@ declare class Client {
|
|
|
124
166
|
/**
|
|
125
167
|
* Error raised during Workflow execution
|
|
126
168
|
*/
|
|
127
|
-
declare class
|
|
169
|
+
declare class WorkflowError extends QstashError {
|
|
128
170
|
constructor(message: string);
|
|
129
171
|
}
|
|
130
172
|
/**
|
|
131
|
-
* Raised when the workflow executes a function
|
|
173
|
+
* Raised when the workflow executes a function successfully
|
|
174
|
+
* and aborts to end the execution
|
|
132
175
|
*/
|
|
133
|
-
declare class
|
|
176
|
+
declare class WorkflowAbort extends Error {
|
|
134
177
|
stepInfo?: Step;
|
|
135
178
|
stepName: string;
|
|
136
|
-
|
|
179
|
+
/**
|
|
180
|
+
* whether workflow is to be canceled on abort
|
|
181
|
+
*/
|
|
182
|
+
cancelWorkflow: boolean;
|
|
183
|
+
/**
|
|
184
|
+
*
|
|
185
|
+
* @param stepName name of the aborting step
|
|
186
|
+
* @param stepInfo step information
|
|
187
|
+
* @param cancelWorkflow
|
|
188
|
+
*/
|
|
189
|
+
constructor(stepName: string, stepInfo?: Step, cancelWorkflow?: boolean);
|
|
137
190
|
}
|
|
138
191
|
|
|
139
|
-
export { Client, NotifyResponse,
|
|
192
|
+
export { Client, NotifyResponse, RouteFunction, Step, Waiter, WorkflowAbort, WorkflowError, WorkflowServeOptions, serve };
|