@requence/task 0.7.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/CHANGELOG.md +7 -0
- package/README.md +383 -0
- package/build/chunk-b4h2we9a.js +35 -0
- package/build/chunk-b4h2we9a.js.map +10 -0
- package/build/cli.js +76 -0
- package/build/cli.js.map +10 -0
- package/build/index.js +1134 -0
- package/build/index.js.map +28 -0
- package/build/types/helpers/src/files/RequenceFile.d.ts +40 -0
- package/build/types/helpers/src/files/RequenceFile.d.ts.map +1 -0
- package/build/types/helpers/src/files/RequenceStream.d.ts +32 -0
- package/build/types/helpers/src/files/RequenceStream.d.ts.map +1 -0
- package/build/types/helpers/src/files/fileObject.d.ts +16 -0
- package/build/types/helpers/src/files/fileObject.d.ts.map +1 -0
- package/build/types/helpers/src/files/index.d.ts +7 -0
- package/build/types/helpers/src/files/index.d.ts.map +1 -0
- package/build/types/helpers/src/files/isValidMimeType.d.ts +5 -0
- package/build/types/helpers/src/files/isValidMimeType.d.ts.map +1 -0
- package/build/types/helpers/src/files/mapOutput.d.ts +10 -0
- package/build/types/helpers/src/files/mapOutput.d.ts.map +1 -0
- package/build/types/helpers/src/files/streamObject.d.ts +14 -0
- package/build/types/helpers/src/files/streamObject.d.ts.map +1 -0
- package/build/types/helpers/src/files/types.d.ts +4 -0
- package/build/types/helpers/src/files/types.d.ts.map +1 -0
- package/build/types/helpers/src/index.d.ts +13 -0
- package/build/types/helpers/src/index.d.ts.map +1 -0
- package/build/types/helpers/src/jsonschema/mapSchema.d.ts +20 -0
- package/build/types/helpers/src/jsonschema/mapSchema.d.ts.map +1 -0
- package/build/types/helpers/src/jsonschema/types.d.ts +13 -0
- package/build/types/helpers/src/jsonschema/types.d.ts.map +1 -0
- package/build/types/helpers/src/jsonschema/validate.d.ts +32 -0
- package/build/types/helpers/src/jsonschema/validate.d.ts.map +1 -0
- package/build/types/helpers/src/jsonschema/zod.d.ts +17 -0
- package/build/types/helpers/src/jsonschema/zod.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/NodeTree.d.ts +510 -0
- package/build/types/helpers/src/protocol/NodeTree.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/command.d.ts +507 -0
- package/build/types/helpers/src/protocol/command.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/helpers.d.ts +7 -0
- package/build/types/helpers/src/protocol/helpers.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/index.d.ts +8 -0
- package/build/types/helpers/src/protocol/index.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/nodeType.d.ts +187 -0
- package/build/types/helpers/src/protocol/nodeType.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/taskOptions.d.ts +23 -0
- package/build/types/helpers/src/protocol/taskOptions.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/templateNodeTypes.d.ts +267 -0
- package/build/types/helpers/src/protocol/templateNodeTypes.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/treeNodes.d.ts +874 -0
- package/build/types/helpers/src/protocol/treeNodes.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/update.d.ts +406 -0
- package/build/types/helpers/src/protocol/update.d.ts.map +1 -0
- package/build/types/helpers/src/utils/callbackToAsyncIterator.d.ts +3 -0
- package/build/types/helpers/src/utils/callbackToAsyncIterator.d.ts.map +1 -0
- package/build/types/helpers/src/utils/clone.d.ts +3 -0
- package/build/types/helpers/src/utils/clone.d.ts.map +1 -0
- package/build/types/helpers/src/utils/createObjectProxy.d.ts +2 -0
- package/build/types/helpers/src/utils/createObjectProxy.d.ts.map +1 -0
- package/build/types/helpers/src/utils/debounce.d.ts +4 -0
- package/build/types/helpers/src/utils/debounce.d.ts.map +1 -0
- package/build/types/helpers/src/utils/guards.d.ts +3 -0
- package/build/types/helpers/src/utils/guards.d.ts.map +1 -0
- package/build/types/helpers/src/utils/mapData.d.ts +18 -0
- package/build/types/helpers/src/utils/mapData.d.ts.map +1 -0
- package/build/types/helpers/src/utils/matchSchema.d.ts +4 -0
- package/build/types/helpers/src/utils/matchSchema.d.ts.map +1 -0
- package/build/types/helpers/src/utils/obfuscate.d.ts +4 -0
- package/build/types/helpers/src/utils/obfuscate.d.ts.map +1 -0
- package/build/types/helpers/src/utils/obj.d.ts +4 -0
- package/build/types/helpers/src/utils/obj.d.ts.map +1 -0
- package/build/types/helpers/src/utils/requenceCallback.d.ts +17 -0
- package/build/types/helpers/src/utils/requenceCallback.d.ts.map +1 -0
- package/build/types/helpers/src/utils/resolveRequenceTypes.d.ts +8 -0
- package/build/types/helpers/src/utils/resolveRequenceTypes.d.ts.map +1 -0
- package/build/types/helpers/src/utils/types.d.ts +7 -0
- package/build/types/helpers/src/utils/types.d.ts.map +1 -0
- package/build/types/task/src/abortTask.d.ts +8 -0
- package/build/types/task/src/abortTask.d.ts.map +1 -0
- package/build/types/task/src/ackTask.d.ts +7 -0
- package/build/types/task/src/ackTask.d.ts.map +1 -0
- package/build/types/task/src/createTask.d.ts +21 -0
- package/build/types/task/src/createTask.d.ts.map +1 -0
- package/build/types/task/src/getTask.d.ts +26 -0
- package/build/types/task/src/getTask.d.ts.map +1 -0
- package/build/types/task/src/index.d.ts +9 -0
- package/build/types/task/src/index.d.ts.map +1 -0
- package/build/types/task/src/protectTask.d.ts +7 -0
- package/build/types/task/src/protectTask.d.ts.map +1 -0
- package/build/types/task/src/recreateTask.d.ts +10 -0
- package/build/types/task/src/recreateTask.d.ts.map +1 -0
- package/build/types/task/src/types.d.ts +243 -0
- package/build/types/task/src/types.d.ts.map +1 -0
- package/build/types/task/src/utils/getAccessToken.d.ts +5 -0
- package/build/types/task/src/utils/getAccessToken.d.ts.map +1 -0
- package/build/types/task/src/watchTasks.d.ts +21 -0
- package/build/types/task/src/watchTasks.d.ts.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createTask, TaskError } from './createTask.ts';
|
|
2
|
+
export { watchTasks } from './watchTasks.ts';
|
|
3
|
+
export { abortTask } from './abortTask.ts';
|
|
4
|
+
export { protectTask } from './protectTask.ts';
|
|
5
|
+
export { getTask } from './getTask.ts';
|
|
6
|
+
export { RequenceFile, RequenceStream } from '../../helpers/src/files/index.js';
|
|
7
|
+
export { type RequenceCallback } from '../../helpers/src/index.js';
|
|
8
|
+
export { recreateTask } from './recreateTask.ts';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protectTask.d.ts","sourceRoot":"","sources":["../../../../src/protectTask.ts"],"names":[],"mappings":"AAWA,UAAU,kBAAkB;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AACD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,iBAe5D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createTask } from './createTask.ts';
|
|
2
|
+
interface RecreateTaskOptions {
|
|
3
|
+
taskId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
accessToken?: string;
|
|
6
|
+
priority?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function recreateTask(options: RecreateTaskOptions, onUpdate?: Parameters<typeof createTask>[1]): Promise<import("./types.ts").Result<string & {}>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=recreateTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recreateTask.d.ts","sourceRoot":"","sources":["../../../../src/recreateTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAG5C,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,qDAa5C"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { Prettify } from '../../helpers/src/index.js';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
type IfUnknown<T, Then, Else> = unknown extends T ? T extends unknown ? Then : Else : Else;
|
|
4
|
+
type IfNull<T, Then, Else> = T extends null ? null extends T ? Then : Else : Else;
|
|
5
|
+
export type CreateTaskOptions<T> = {
|
|
6
|
+
taskTemplate: T;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
priority?: number;
|
|
9
|
+
accessToken?: string;
|
|
10
|
+
suppressBranchWarning?: boolean;
|
|
11
|
+
requireAck?: boolean;
|
|
12
|
+
} & IfNull<Input<T>, {
|
|
13
|
+
input?: null;
|
|
14
|
+
}, IfUnknown<Input<T>, {
|
|
15
|
+
input?: any;
|
|
16
|
+
}, {
|
|
17
|
+
input: Input<T>;
|
|
18
|
+
}>>;
|
|
19
|
+
type Input<T> = T extends keyof RequenceTask.TaskTemplate ? RequenceTask.TaskTemplate[T]['input'] : unknown;
|
|
20
|
+
type Data<T> = T extends keyof RequenceTask.TaskTemplate ? Prettify<RequenceTask.TaskTemplate[T]['results']> : unknown;
|
|
21
|
+
type NamedData<T, A> = T extends keyof RequenceTask.TaskTemplate ? A extends keyof RequenceTask.TaskTemplate[T]['namedResults'] ? Prettify<RequenceTask.TaskTemplate[T]['namedResults'][A]> : unknown : unknown;
|
|
22
|
+
type Alias<T> = T extends keyof RequenceTask.TaskTemplate ? keyof RequenceTask.TaskTemplate[T]['namedResults'] : string;
|
|
23
|
+
export interface Result<T> {
|
|
24
|
+
input: Input<T>;
|
|
25
|
+
result: Data<T>;
|
|
26
|
+
taskId: string;
|
|
27
|
+
taskUrl: string;
|
|
28
|
+
getNodeData<A extends Alias<T>>(alias: A): NamedData<T, A>;
|
|
29
|
+
getNodeError(alias: Alias<T>): string | null;
|
|
30
|
+
}
|
|
31
|
+
type Context<T> = Omit<Result<T>, 'taskUrl'>;
|
|
32
|
+
declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
34
|
+
taskId: z.ZodUUID;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
updateId: z.ZodUUID;
|
|
37
|
+
type: z.ZodLiteral<"taskStart">;
|
|
38
|
+
input: z.ZodUnknown;
|
|
39
|
+
rootTaskId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
42
|
+
taskId: z.ZodUUID;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
updateId: z.ZodUUID;
|
|
45
|
+
type: z.ZodLiteral<"taskError">;
|
|
46
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
47
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
50
|
+
taskId: z.ZodUUID;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
updateId: z.ZodUUID;
|
|
53
|
+
type: z.ZodLiteral<"taskAborted">;
|
|
54
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
55
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
58
|
+
taskId: z.ZodUUID;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
updateId: z.ZodUUID;
|
|
61
|
+
type: z.ZodLiteral<"taskEnd">;
|
|
62
|
+
result: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
63
|
+
exit: z.ZodNullable<z.ZodString>;
|
|
64
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
66
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
67
|
+
taskId: z.ZodUUID;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
updateId: z.ZodUUID;
|
|
70
|
+
type: z.ZodLiteral<"nodeStart">;
|
|
71
|
+
node: z.ZodObject<{
|
|
72
|
+
id: z.ZodUUID;
|
|
73
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
74
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
78
|
+
taskId: z.ZodUUID;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
updateId: z.ZodUUID;
|
|
81
|
+
type: z.ZodLiteral<"nodeUpdate">;
|
|
82
|
+
node: z.ZodObject<{
|
|
83
|
+
id: z.ZodUUID;
|
|
84
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
85
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
data: z.ZodUnknown;
|
|
88
|
+
output: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
91
|
+
taskId: z.ZodUUID;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
updateId: z.ZodUUID;
|
|
94
|
+
type: z.ZodLiteral<"nodeError">;
|
|
95
|
+
node: z.ZodObject<{
|
|
96
|
+
id: z.ZodUUID;
|
|
97
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
98
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
error: z.ZodString;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
103
|
+
taskId: z.ZodUUID;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
updateId: z.ZodUUID;
|
|
106
|
+
type: z.ZodLiteral<"nodeDefer">;
|
|
107
|
+
node: z.ZodObject<{
|
|
108
|
+
id: z.ZodUUID;
|
|
109
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
110
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
115
|
+
taskId: z.ZodUUID;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
updateId: z.ZodUUID;
|
|
118
|
+
type: z.ZodLiteral<"nodeEnd">;
|
|
119
|
+
node: z.ZodObject<{
|
|
120
|
+
id: z.ZodUUID;
|
|
121
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
122
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
}, z.core.$strip>], "type">;
|
|
125
|
+
type BaseUpdate = z.infer<typeof updateSchema>;
|
|
126
|
+
export type Update<T> = Prettify<(Exclude<BaseUpdate, {
|
|
127
|
+
type: 'taskEnd';
|
|
128
|
+
} | {
|
|
129
|
+
type: 'nodeUpdate';
|
|
130
|
+
}> & {
|
|
131
|
+
context: Context<Partial<T>>;
|
|
132
|
+
}) | (Extract<BaseUpdate, {
|
|
133
|
+
type: 'nodeUpdate';
|
|
134
|
+
}> & {
|
|
135
|
+
context: Context<Partial<T>>;
|
|
136
|
+
data: Partial<Data<T>>;
|
|
137
|
+
}) | (Extract<BaseUpdate, {
|
|
138
|
+
type: 'taskEnd';
|
|
139
|
+
}> & {
|
|
140
|
+
context: Context<T>;
|
|
141
|
+
})>;
|
|
142
|
+
export declare const eventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
143
|
+
event: z.ZodString;
|
|
144
|
+
data: z.ZodString;
|
|
145
|
+
}, z.core.$strip>, z.ZodTransform<any, {
|
|
146
|
+
event: string;
|
|
147
|
+
data: string;
|
|
148
|
+
}>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
149
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
150
|
+
taskId: z.ZodUUID;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
updateId: z.ZodUUID;
|
|
153
|
+
type: z.ZodLiteral<"taskStart">;
|
|
154
|
+
input: z.ZodUnknown;
|
|
155
|
+
rootTaskId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
156
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
157
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
158
|
+
taskId: z.ZodUUID;
|
|
159
|
+
name: z.ZodString;
|
|
160
|
+
updateId: z.ZodUUID;
|
|
161
|
+
type: z.ZodLiteral<"taskError">;
|
|
162
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
163
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
165
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
166
|
+
taskId: z.ZodUUID;
|
|
167
|
+
name: z.ZodString;
|
|
168
|
+
updateId: z.ZodUUID;
|
|
169
|
+
type: z.ZodLiteral<"taskAborted">;
|
|
170
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
171
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
174
|
+
taskId: z.ZodUUID;
|
|
175
|
+
name: z.ZodString;
|
|
176
|
+
updateId: z.ZodUUID;
|
|
177
|
+
type: z.ZodLiteral<"taskEnd">;
|
|
178
|
+
result: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
179
|
+
exit: z.ZodNullable<z.ZodString>;
|
|
180
|
+
requireAck: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
182
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
183
|
+
taskId: z.ZodUUID;
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
updateId: z.ZodUUID;
|
|
186
|
+
type: z.ZodLiteral<"nodeStart">;
|
|
187
|
+
node: z.ZodObject<{
|
|
188
|
+
id: z.ZodUUID;
|
|
189
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
190
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
193
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
194
|
+
taskId: z.ZodUUID;
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
updateId: z.ZodUUID;
|
|
197
|
+
type: z.ZodLiteral<"nodeUpdate">;
|
|
198
|
+
node: z.ZodObject<{
|
|
199
|
+
id: z.ZodUUID;
|
|
200
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
201
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
data: z.ZodUnknown;
|
|
204
|
+
output: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
205
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
206
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
207
|
+
taskId: z.ZodUUID;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
updateId: z.ZodUUID;
|
|
210
|
+
type: z.ZodLiteral<"nodeError">;
|
|
211
|
+
node: z.ZodObject<{
|
|
212
|
+
id: z.ZodUUID;
|
|
213
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
214
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
error: z.ZodString;
|
|
217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
219
|
+
taskId: z.ZodUUID;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
updateId: z.ZodUUID;
|
|
222
|
+
type: z.ZodLiteral<"nodeDefer">;
|
|
223
|
+
node: z.ZodObject<{
|
|
224
|
+
id: z.ZodUUID;
|
|
225
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
226
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
231
|
+
taskId: z.ZodUUID;
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
updateId: z.ZodUUID;
|
|
234
|
+
type: z.ZodLiteral<"nodeEnd">;
|
|
235
|
+
node: z.ZodObject<{
|
|
236
|
+
id: z.ZodUUID;
|
|
237
|
+
type: z.ZodLiteral<"service" | "logic" | "or" | "reference">;
|
|
238
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
}, z.core.$strip>], "type">>;
|
|
241
|
+
export declare const prioritySchema: z.ZodPipe<z.ZodDefault<z.ZodInt>, z.ZodTransform<number, number>>;
|
|
242
|
+
export {};
|
|
243
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,KAAK,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,OAAO,SAAS,CAAC,GAC7C,CAAC,SAAS,OAAO,GACf,IAAI,GACJ,IAAI,GACN,IAAI,CAAA;AAER,KAAK,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,IAAI,GACvC,IAAI,SAAS,CAAC,GACZ,IAAI,GACJ,IAAI,GACN,IAAI,CAAA;AAER,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,YAAY,EAAE,CAAC,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,GAAG,MAAM,CACR,KAAK,CAAC,CAAC,CAAC,EACR;IAAE,KAAK,CAAC,EAAE,IAAI,CAAA;CAAE,EAChB,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,GAAG,CAAA;CAAE,EAAE;IAAE,KAAK,EAAE,K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utils/getAccessToken.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM;;;EA0B1D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Update } from './types.ts';
|
|
2
|
+
type WatchUpdate = Update<unknown> & {
|
|
3
|
+
incomplete: boolean;
|
|
4
|
+
updateId: string;
|
|
5
|
+
rootTaskId: string | null;
|
|
6
|
+
};
|
|
7
|
+
type TaskUpdateHandler = (update: WatchUpdate) => void;
|
|
8
|
+
interface WatchTasksOptions {
|
|
9
|
+
accessToken?: string;
|
|
10
|
+
since: Date;
|
|
11
|
+
filter?: {
|
|
12
|
+
only?: Update<unknown>['type'][];
|
|
13
|
+
};
|
|
14
|
+
onUpdate?: TaskUpdateHandler;
|
|
15
|
+
onError?: (status: number, reason?: string) => void;
|
|
16
|
+
onConnect?: () => void;
|
|
17
|
+
onReconnecting?: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function watchTasks(options: WatchTasksOptions): (() => void) & AsyncIterable<WatchUpdate>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=watchTasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchTasks.d.ts","sourceRoot":"","sources":["../../../../src/watchTasks.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,YAAY,CAAA;AAGrD,KAAK,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG;IACnC,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,KAAK,iBAAiB,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;AAEtD,UAAU,iBAAiB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAA;KACjC,CAAA;IACD,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAC5B;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,6CA8KpD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@requence/task",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.7.1",
|
|
5
|
+
"bin": {
|
|
6
|
+
"requence-task": "build/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./build/types/task/src/index.d.ts",
|
|
11
|
+
"default": "./build/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"check-format": "oxfmt --check",
|
|
16
|
+
"fix-format": "oxfmt --write",
|
|
17
|
+
"check-types": "tsc",
|
|
18
|
+
"lint": "oxlint --deny-warnings",
|
|
19
|
+
"build-declaration": "tsc -p tsconfig.declaration.json && tsc-alias -p tsconfig.declaration.json 2>/dev/null",
|
|
20
|
+
"build": "ADD_ENTRYPOINT=src/cli.ts bun -e \"import('@requence/utils/build-package.mts')\" && bun build-declaration "
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"ajv": "^8.17.1",
|
|
24
|
+
"chalk": "^5.6.2",
|
|
25
|
+
"eventsource-client": "^1.2.0",
|
|
26
|
+
"mime-types": "^3.0.1",
|
|
27
|
+
"yargs": "^17.7.2",
|
|
28
|
+
"zod": "^4.3.6"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@requence/helpers": "workspace:*",
|
|
32
|
+
"@requence/utils": "workspace:*",
|
|
33
|
+
"@types/yargs": "^17.0.33",
|
|
34
|
+
"tsc-alias": "^1.8.16"
|
|
35
|
+
}
|
|
36
|
+
}
|