better-result-cf-workflows 0.0.3 → 0.0.4
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.ts +1 -1
- package/dist/wf-class.d.ts +1 -0
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ResultWorkflowEntrypoint } from "./wf-class";
|
|
1
|
+
export { ResultWorkflowEntrypoint, ResultGenerator } from "./wf-class";
|
|
2
2
|
export { errorMapCodec, ErrCodec, InferErrorsFromErrCodec } from "./codec";
|
|
3
3
|
export { StepEventTimeoutErr } from "./step/wait-for-event";
|
|
4
4
|
export { ResultStep } from "./step/index";
|
package/dist/wf-class.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AnyTaggedError, Err, Panic, Result } from "better-result";
|
|
|
2
2
|
import { WorkflowEntrypoint, WorkflowEvent, WorkflowStep } from "cloudflare:workers";
|
|
3
3
|
import { ErrCodec } from "./codec";
|
|
4
4
|
import { ResultStep } from "./step";
|
|
5
|
+
/** The result from *execute(). T is the final success value, E is the supported errors */
|
|
5
6
|
export type ResultGenerator<T, E extends AnyTaggedError> = AsyncGenerator<Err<never, E>, Result<T, E>, unknown>;
|
|
6
7
|
export declare abstract class ResultWorkflowEntrypoint<SupportedErrors extends AnyTaggedError, FinalSuccess extends Rpc.Serializable<FinalSuccess> = Rpc.Serializable<unknown>, Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> extends WorkflowEntrypoint<Env, T> {
|
|
7
8
|
/** Since the Result class and tagged error classes are not RPC serializable, you need a result codec for returning data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-result-cf-workflows",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "better-result compatible Cloudflare Workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-result",
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
18
24
|
"dependencies": {},
|
|
19
25
|
"devDependencies": {
|
|
20
26
|
"@cloudflare/vitest-plugin": "^1.9.2",
|