workflow 4.0.1-beta.2 → 4.0.1-beta.20
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/LICENSE.md +201 -21
- package/README.md +8 -8
- package/dist/api-workflow.d.ts +11 -0
- package/dist/api-workflow.d.ts.map +1 -0
- package/dist/api-workflow.js +15 -0
- package/dist/api-workflow.js.map +1 -0
- package/dist/api.d.ts +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/next.cjs +6 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +3 -0
- package/dist/next.d.cts.map +1 -0
- package/dist/nuxt.d.ts +4 -0
- package/dist/nuxt.d.ts.map +1 -0
- package/dist/nuxt.js +4 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/rollup.d.ts +2 -0
- package/dist/rollup.d.ts.map +1 -0
- package/dist/rollup.js +2 -0
- package/dist/rollup.js.map +1 -0
- package/dist/stdlib.d.ts +1 -22
- package/dist/stdlib.d.ts.map +1 -1
- package/dist/stdlib.js +1 -31
- package/dist/stdlib.js.map +1 -1
- package/dist/sveltekit.d.ts +2 -0
- package/dist/sveltekit.d.ts.map +1 -0
- package/dist/sveltekit.js +2 -0
- package/dist/sveltekit.js.map +1 -0
- package/dist/typescript-plugin.cjs +6 -0
- package/dist/typescript-plugin.cjs.map +1 -0
- package/dist/typescript-plugin.d.cts +3 -0
- package/dist/typescript-plugin.d.cts.map +1 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +2 -0
- package/dist/vite.js.map +1 -0
- package/package.json +24 -14
- package/dist/index.cjs +0 -26
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.cts.map +0 -1
- package/dist/next.d.ts +0 -2
- package/dist/next.d.ts.map +0 -1
- package/dist/next.js +0 -2
- package/dist/next.js.map +0 -1
- package/dist/rollup-plugin.d.ts +0 -2
- package/dist/rollup-plugin.d.ts.map +0 -1
- package/dist/rollup-plugin.js +0 -2
- package/dist/rollup-plugin.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
<http://www.apache.org/licenses/>
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Vercel Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
<h1>Workflow Development Kit</h1>
|
|
9
9
|
|
|
10
10
|
<a href="https://vercel.com"><img alt="Vercel logo" src="https://img.shields.io/badge/MADE%20BY%20Vercel-000000.svg?style=for-the-badge&logo=Vercel&labelColor=000"></a>
|
|
11
|
-
<a href="https://www.npmjs.com/package/
|
|
12
|
-
<a href="https://github.com/vercel/workflow/blob/
|
|
11
|
+
<a href="https://www.npmjs.com/package/workflow"><img alt="NPM version" src="https://img.shields.io/npm/v/workflow?style=for-the-badge&labelColor=000000"></a>
|
|
12
|
+
<a href="https://github.com/vercel/workflow/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/npm/l/workflow.svg?style=for-the-badge&labelColor=000000"></a>
|
|
13
13
|
<a href="https://github.com/vercel/workflow/discussions"><img alt="Join the community on GitHub" src="https://img.shields.io/badge/Join%20the%20community-blueviolet.svg?style=for-the-badge&logo=Github&labelColor=000000&logoWidth=20"></a>
|
|
14
14
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
## Getting Started
|
|
18
18
|
|
|
19
|
-
The **Workflow Development Kit** lets you easily add durability, reliability, and observability to async JavaScript. Build apps and AI
|
|
19
|
+
The **Workflow Development Kit** lets you easily add durability, reliability, and observability to async JavaScript. Build apps and AI agents that can suspend, resume, and maintain state with ease.
|
|
20
20
|
|
|
21
21
|
Visit [https://useworkflow.dev](https://useworkflow.dev) to view the full documentation.
|
|
22
22
|
|
|
23
23
|
## Community
|
|
24
24
|
|
|
25
|
-
The Workflow DevKit community can be found on [GitHub Discussions](https://github.com/vercel/workflow/discussions) where you can ask questions, voice ideas, and share your projects with other people.
|
|
25
|
+
The Workflow DevKit community can be found on [GitHub Discussions](https://github.com/vercel/workflow/discussions), where you can ask questions, voice ideas, and share your projects with other people.
|
|
26
26
|
|
|
27
27
|
## Contributing
|
|
28
28
|
|
|
29
|
-
Contributions to Workflow DevKit are welcome and highly appreciated. Please use GitHub [issues](https://github.com/vercel/workflow/issues) and [discussions](https://github.com/vercel/workflow/discussions) to collaborate with the team and
|
|
29
|
+
Contributions to Workflow DevKit are welcome and highly appreciated. Please use GitHub [issues](https://github.com/vercel/workflow/issues) and [discussions](https://github.com/vercel/workflow/discussions) to collaborate with the team and wider community.
|
|
30
30
|
|
|
31
31
|
## Authors
|
|
32
32
|
|
|
33
33
|
Workflow DevKit was built by engineers at [Vercel](https://vercel.com) and the [Open Source Community](https://github.com/vercel/workflow/graphs/contributors).
|
|
34
34
|
|
|
35
|
-
The initial core contributing engineers are
|
|
35
|
+
The initial core contributing engineers are:
|
|
36
36
|
|
|
37
37
|
- Adrian Lam ([@adriandlam](https://github.com/adriandlam))
|
|
38
38
|
- Dillon Mulroy ([@dmmulroy](https://github.com/dmmulroy))
|
|
@@ -42,12 +42,12 @@ The initial core contributing engineers are
|
|
|
42
42
|
- Peter Wielander ([@VaguelySerious](https://github.com/VaguelySerious))
|
|
43
43
|
- Pranay Prakash ([@pranaygp](https://github.com/pranaygp))
|
|
44
44
|
|
|
45
|
-
The Workflow DevKit
|
|
45
|
+
The Workflow DevKit logo was designed by Cecilio Ruiz [@ceciliorz](https://x.com/ceciliorz)
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
49
|
## Security
|
|
50
50
|
|
|
51
|
-
If you believe you have found a security vulnerability in Workflow DevKit, we encourage you to **_responsibly disclose this and
|
|
51
|
+
If you believe you have found a security vulnerability in Workflow DevKit, we encourage you to **_responsibly disclose this and not open a public issue_**.
|
|
52
52
|
|
|
53
53
|
To participate in our Open Source Software Bug Bounty program, please email [responsible.disclosure@vercel.com](mailto:responsible.disclosure@vercel.com). We will add you to the program and provide further instructions for submitting your report.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { Event, StartOptions, WorkflowReadableStreamOptions, WorkflowRun, } from '@workflow/core/runtime';
|
|
2
|
+
export declare class Run {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare const getRun: () => never;
|
|
6
|
+
export declare const getHookByToken: () => never;
|
|
7
|
+
export declare const resumeHook: () => never;
|
|
8
|
+
export declare const resumeWebhook: () => never;
|
|
9
|
+
export declare const runStep: () => never;
|
|
10
|
+
export declare const start: () => never;
|
|
11
|
+
//# sourceMappingURL=api-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-workflow.d.ts","sourceRoot":"","sources":["../src/api-workflow.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,YAAY,EACZ,6BAA6B,EAC7B,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAQhC,qBAAa,GAAG;;CAIf;AACD,eAAO,MAAM,MAAM,aAA+B,CAAC;AACnD,eAAO,MAAM,cAAc,aAAuC,CAAC;AACnE,eAAO,MAAM,UAAU,aAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa,aAAsC,CAAC;AACjE,eAAO,MAAM,OAAO,aAAgC,CAAC;AACrD,eAAO,MAAM,KAAK,aAA8B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const workflowStub = (item) => {
|
|
2
|
+
throw new Error(`The workflow environment doesn't allow this runtime usage of ${item}.`);
|
|
3
|
+
};
|
|
4
|
+
export class Run {
|
|
5
|
+
constructor() {
|
|
6
|
+
workflowStub('Run');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export const getRun = () => workflowStub('getRun');
|
|
10
|
+
export const getHookByToken = () => workflowStub('getHookByToken');
|
|
11
|
+
export const resumeHook = () => workflowStub('resumeHook');
|
|
12
|
+
export const resumeWebhook = () => workflowStub('resumeWebhook');
|
|
13
|
+
export const runStep = () => workflowStub('runStep');
|
|
14
|
+
export const start = () => workflowStub('start');
|
|
15
|
+
//# sourceMappingURL=api-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-workflow.js","sourceRoot":"","sources":["../src/api-workflow.ts"],"names":[],"mappings":"AAOA,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,MAAM,IAAI,KAAK,CACb,gEAAgE,IAAI,GAAG,CACxE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG;IACd;QACE,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;CACF;AACD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type Event, getHookByToken, getRun, Run, resumeHook, resumeWebhook, runStep, type StartOptions, start, type WorkflowRun, } from '@workflow/core/runtime';
|
|
1
|
+
export { type Event, getHookByToken, getRun, Run, resumeHook, resumeWebhook, runStep, type StartOptions, start, type WorkflowReadableStreamOptions, type WorkflowRun, } from '@workflow/core/runtime';
|
|
2
2
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,cAAc,EACd,MAAM,EACN,GAAG,EACH,UAAU,EACV,aAAa,EACb,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,EACL,KAAK,WAAW,GACjB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,cAAc,EACd,MAAM,EACN,GAAG,EACH,UAAU,EACV,aAAa,EACb,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,EACL,KAAK,6BAA6B,EAClC,KAAK,WAAW,GACjB,MAAM,wBAAwB,CAAC"}
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,MAAM,EACN,GAAG,EACH,UAAU,EACV,aAAa,EACb,OAAO,EAEP,KAAK,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,MAAM,EACN,GAAG,EACH,UAAU,EACV,aAAa,EACb,OAAO,EAEP,KAAK,GAGN,MAAM,wBAAwB,CAAC"}
|
package/dist/next.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.cjs","sourceRoot":"","sources":["../src/next.cts"],"names":[],"mappings":";AAAA,2DAA2D;AAC3D,0DAA0D;AAC1D,6CAA8C;AAC9C,iBAAS,UAAU,CAAC"}
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.cts","sourceRoot":"","sources":["../src/next.cts"],"names":[],"mappings":"AAEA,OAAO,UAAU,GAAG,QAAQ,gBAAgB,CAAC,CAAC;AAC9C,SAAS,UAAU,CAAC"}
|
package/dist/nuxt.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,eAAe,YAAY,CAAC"}
|
package/dist/nuxt.js
ADDED
package/dist/nuxt.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt.js","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,eAAe,YAAY,CAAC"}
|
package/dist/rollup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/rollup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/stdlib.d.ts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is the "standard library" of steps that we make available to all workflow users.
|
|
3
|
-
* The can be imported like so: `import {
|
|
3
|
+
* The can be imported like so: `import { fetch } from 'workflow'`. and used in workflow.
|
|
4
4
|
* The need to be exported directly in this package and cannot live in `core` to prevent
|
|
5
5
|
* circular dependencies post-compilation.
|
|
6
6
|
*/
|
|
7
|
-
import { type StringValue } from 'ms';
|
|
8
|
-
/**
|
|
9
|
-
* Sleep within a workflow for a given duration.
|
|
10
|
-
*
|
|
11
|
-
* @param duration - The duration to sleep for, this is a string in the format
|
|
12
|
-
* of `"1000ms"`, `"1s"`, `"1m"`, `"1h"`, or `"1d"`.
|
|
13
|
-
* @overload
|
|
14
|
-
* @returns A promise that resolves when the sleep is complete.
|
|
15
|
-
*/
|
|
16
|
-
export declare function sleep(duration: StringValue): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Sleep within a workflow until a specific date.
|
|
19
|
-
*
|
|
20
|
-
* @param date - The date to sleep until, this must be a future date.
|
|
21
|
-
* @overload
|
|
22
|
-
* @returns A promise that resolves when the sleep is complete.
|
|
23
|
-
*/
|
|
24
|
-
export declare function sleep(date: Date): Promise<void>;
|
|
25
|
-
export declare namespace sleep {
|
|
26
|
-
var maxRetries: number;
|
|
27
|
-
}
|
|
28
7
|
/**
|
|
29
8
|
* A hoisted `fetch()` function that is executed as a "step" function,
|
|
30
9
|
* for use within workflow functions.
|
package/dist/stdlib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdlib.d.ts","sourceRoot":"","sources":["../src/stdlib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"stdlib.d.ts","sourceRoot":"","sources":["../src/stdlib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,qBAGvE"}
|
package/dist/stdlib.js
CHANGED
|
@@ -1,39 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is the "standard library" of steps that we make available to all workflow users.
|
|
3
|
-
* The can be imported like so: `import {
|
|
3
|
+
* The can be imported like so: `import { fetch } from 'workflow'`. and used in workflow.
|
|
4
4
|
* The need to be exported directly in this package and cannot live in `core` to prevent
|
|
5
5
|
* circular dependencies post-compilation.
|
|
6
6
|
*/
|
|
7
|
-
import { RetryableError } from '@workflow/errors';
|
|
8
|
-
import ms from 'ms';
|
|
9
|
-
import { getStepMetadata } from './index.js';
|
|
10
|
-
// vqs has a max message visibility lifespan, the workflow sleep function
|
|
11
|
-
// will retry repeatedly until the user requested duration is reached.
|
|
12
|
-
// (Eventually make this configurable based on the queue backend adapter)
|
|
13
|
-
const MAX_SLEEP_DURATION_SECONDS = ms('23h') / 1000;
|
|
14
|
-
export async function sleep(param) {
|
|
15
|
-
'use step';
|
|
16
|
-
const { stepStartedAt } = getStepMetadata();
|
|
17
|
-
const durationMs = typeof param === 'string'
|
|
18
|
-
? ms(param)
|
|
19
|
-
: param.getTime() - Number(stepStartedAt);
|
|
20
|
-
if (typeof durationMs !== 'number' || durationMs < 0) {
|
|
21
|
-
const message = param instanceof Date
|
|
22
|
-
? `Invalid sleep date: "${param}". Expected a future date.`
|
|
23
|
-
: `Invalid sleep duration: "${param}". Expected a valid duration string like "1s", "1m", "1h", etc.`;
|
|
24
|
-
throw new Error(message);
|
|
25
|
-
}
|
|
26
|
-
const endAt = +stepStartedAt + durationMs;
|
|
27
|
-
const now = Date.now();
|
|
28
|
-
if (now < endAt) {
|
|
29
|
-
const remainingSeconds = (endAt - now) / 1000;
|
|
30
|
-
const retryAfter = Math.min(remainingSeconds, MAX_SLEEP_DURATION_SECONDS);
|
|
31
|
-
throw new RetryableError(`Sleeping for ${ms(retryAfter * 1000, { long: true })}`, {
|
|
32
|
-
retryAfter,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
sleep.maxRetries = Infinity;
|
|
37
7
|
/**
|
|
38
8
|
* A hoisted `fetch()` function that is executed as a "step" function,
|
|
39
9
|
* for use within workflow functions.
|
package/dist/stdlib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdlib.js","sourceRoot":"","sources":["../src/stdlib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"stdlib.js","sourceRoot":"","sources":["../src/stdlib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,GAAG,IAAyC;IACtE,UAAU,CAAC;IACX,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../src/sveltekit.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sveltekit.js","sourceRoot":"","sources":["../src/sveltekit.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TypeScript server does `require(pluginName)` to load plugins,
|
|
3
|
+
// so we need to export the plugin as a CommonJS module
|
|
4
|
+
const typescriptPlugin = require("@workflow/typescript-plugin");
|
|
5
|
+
module.exports = typescriptPlugin;
|
|
6
|
+
//# sourceMappingURL=typescript-plugin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-plugin.cjs","sourceRoot":"","sources":["../src/typescript-plugin.cts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,uDAAuD;AACvD,gEAAiE;AACjE,iBAAS,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-plugin.d.cts","sourceRoot":"","sources":["../src/typescript-plugin.cts"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,GAAG,QAAQ,6BAA6B,CAAC,CAAC;AACjE,SAAS,gBAAgB,CAAC"}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/vite.js
ADDED
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "4.0.1-beta.
|
|
3
|
+
"version": "4.0.1-beta.20",
|
|
4
4
|
"description": "Workflow DevKit - Build durable, resilient, and observable workflows",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "dist/typescript-plugin.cjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"workflow": "./bin/run.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"license": "
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/vercel/workflow.git",
|
|
@@ -25,30 +25,40 @@
|
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"workflow": "./dist/workflow.js",
|
|
28
|
+
"require": "./dist/typescript-plugin.cjs",
|
|
28
29
|
"default": "./dist/index.js"
|
|
29
30
|
},
|
|
30
|
-
"./api":
|
|
31
|
+
"./api": {
|
|
32
|
+
"types": "./dist/api.d.ts",
|
|
33
|
+
"workflow": "./dist/api-workflow.js",
|
|
34
|
+
"default": "./dist/api.js"
|
|
35
|
+
},
|
|
31
36
|
"./internal/errors": "./dist/internal/errors.js",
|
|
32
37
|
"./internal/serialization": "./dist/internal/serialization.js",
|
|
33
38
|
"./internal/builtins": "./dist/internal/builtins.js",
|
|
34
39
|
"./internal/private": "./dist/internal/private.js",
|
|
35
|
-
"./next": "./dist/next.
|
|
40
|
+
"./next": "./dist/next.cjs",
|
|
36
41
|
"./nitro": "./dist/nitro.js",
|
|
37
|
-
"./
|
|
42
|
+
"./nuxt": "./dist/nuxt.js",
|
|
43
|
+
"./sveltekit": "./dist/sveltekit.js",
|
|
44
|
+
"./rollup": "./dist/rollup.js",
|
|
45
|
+
"./vite": "./dist/vite.js",
|
|
38
46
|
"./runtime": "./dist/runtime.js"
|
|
39
47
|
},
|
|
40
48
|
"dependencies": {
|
|
41
49
|
"ms": "2.1.3",
|
|
42
|
-
"@workflow/cli": "4.0.1-beta.
|
|
43
|
-
"@workflow/core": "4.0.1-beta.
|
|
44
|
-
"@workflow/errors": "4.0.1-beta.
|
|
45
|
-
"@workflow/typescript-plugin": "4.0.1-beta.
|
|
46
|
-
"@workflow/next": "4.0.1-beta.
|
|
47
|
-
"@workflow/
|
|
50
|
+
"@workflow/cli": "4.0.1-beta.20",
|
|
51
|
+
"@workflow/core": "4.0.1-beta.17",
|
|
52
|
+
"@workflow/errors": "4.0.1-beta.6",
|
|
53
|
+
"@workflow/typescript-plugin": "4.0.1-beta.4",
|
|
54
|
+
"@workflow/next": "4.0.1-beta.20",
|
|
55
|
+
"@workflow/sveltekit": "4.0.0-beta.14",
|
|
56
|
+
"@workflow/nitro": "4.0.1-beta.20",
|
|
57
|
+
"@workflow/nuxt": "4.0.1-beta.9"
|
|
48
58
|
},
|
|
49
59
|
"devDependencies": {
|
|
50
|
-
"@types/ms": "
|
|
51
|
-
"@types/node": "
|
|
60
|
+
"@types/ms": "2.1.0",
|
|
61
|
+
"@types/node": "22.19.0",
|
|
52
62
|
"@workflow/tsconfig": "4.0.1-beta.0"
|
|
53
63
|
},
|
|
54
64
|
"peerDependencies": {
|
package/dist/index.cjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// CommonJS wrapper for dual SDK/TypeScript plugin functionality
|
|
3
|
-
// Allows workflow to work as both:
|
|
4
|
-
// 1. An SDK: import { ... } from 'workflow'
|
|
5
|
-
// 2. A TypeScript Language Service plugin
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const node_module_1 = require("node:module");
|
|
8
|
-
const requireFromHere = (0, node_module_1.createRequire)(__filename);
|
|
9
|
-
const sdk = requireFromHere('./index.js');
|
|
10
|
-
function createTSPlugin(options) {
|
|
11
|
-
// The package is being used as a TypeScript Language Service plugin
|
|
12
|
-
if (options &&
|
|
13
|
-
'typescript' in options &&
|
|
14
|
-
typeof options.typescript === 'object') {
|
|
15
|
-
const pluginInit = requireFromHere('@workflow/typescript-plugin');
|
|
16
|
-
return pluginInit(options);
|
|
17
|
-
}
|
|
18
|
-
// Not being used as a TS plugin
|
|
19
|
-
throw new Error('workflow should be imported using named exports, not called as a function.\nUse: import { ... } from "workflow"');
|
|
20
|
-
}
|
|
21
|
-
// Export all named exports from the SDK
|
|
22
|
-
Object.keys(sdk).forEach((key) => {
|
|
23
|
-
createTSPlugin[key] = sdk[key];
|
|
24
|
-
});
|
|
25
|
-
module.exports = createTSPlugin;
|
|
26
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,mCAAmC;AACnC,4CAA4C;AAC5C,0CAA0C;;AAE1C,6CAA4C;AAC5C,MAAM,eAAe,GAAG,IAAA,2BAAa,EAAC,UAAU,CAAC,CAAC;AAElD,MAAM,GAAG,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAE1C,SAAS,cAAc,CAAC,OAAY;IAClC,oEAAoE;IACpE,IACE,OAAO;QACP,YAAY,IAAI,OAAO;QACvB,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ,EACtC,CAAC;QACD,MAAM,UAAU,GAAG,eAAe,CAAC,6BAA6B,CAAC,CAAC;QAClE,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,gCAAgC;IAChC,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;IAC9B,cAAsB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC"}
|
package/dist/index.d.cts
DELETED
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":""}
|
package/dist/next.d.ts
DELETED
package/dist/next.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/next.js
DELETED
package/dist/next.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/rollup-plugin.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin.d.ts","sourceRoot":"","sources":["../src/rollup-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/rollup-plugin.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin.js","sourceRoot":"","sources":["../src/rollup-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|