@uploadista/flow-utility-nodes 1.0.0-beta.3 → 1.0.0-beta.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/nodes/index.cjs +1 -1
- package/dist/nodes/index.d.cts +26 -30
- package/dist/nodes/index.d.cts.map +1 -1
- package/dist/nodes/index.d.mts +24 -28
- package/dist/nodes/index.d.mts.map +1 -1
- package/dist/nodes/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/{zip-node-BBj1lGeU.d.mts → zip-node-DpgHSX69.d.cts} +1 -1
- package/dist/zip-node-DpgHSX69.d.cts.map +1 -0
- package/dist/{zip-node-D-UE9ml-.d.cts → zip-node-DpgHSX69.d.mts} +1 -1
- package/dist/zip-node-DpgHSX69.d.mts.map +1 -0
- package/package.json +7 -7
- package/tsconfig.json +0 -1
- package/dist/zip-node-BBj1lGeU.d.mts.map +0 -1
- package/dist/zip-node-D-UE9ml-.d.cts.map +0 -1
package/dist/nodes/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@uploadista/core/flow"),t=require("@uploadista/core/types"),n=require("effect"),r=require("@uploadista/core/errors"),i=require("@uploadista/core/upload"),a=require("zod");function o(r,{field:i,operator:a,value:o}){return(0,e.createFlowNode)({id:r,name:`Conditional Router`,description:`Routes flow based on ${i} ${a} ${o}`,type:e.NodeType.conditional,nodeTypeId:`conditional`,inputSchema:t.uploadFileSchema,outputSchema:t.uploadFileSchema,condition:{field:i,operator:a,value:o},run:({data:t})=>n.Effect.succeed((0,e.completeNodeExecution)(t))})}const s=a.z.record(a.z.string(),t.uploadFileSchema),c=t.uploadFileSchema;function l(t,{strategy:a,separator:o}){return n.Effect.gen(function*(){let o=yield*i.UploadEngine;return yield*(0,e.createFlowNode)({id:t,name:`Merge Files`,description:`Merges multiple files using ${a} strategy`,type:e.NodeType.merge,nodeTypeId:`merge`,outputTypeId:e.STORAGE_OUTPUT_TYPE_ID,inputSchema:s,outputSchema:c,multiInput:!0,run:({data:t,storageId:i,clientId:s})=>n.Effect.gen(function*(){if(!t||Object.keys(t).length===0)return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`No inputs provided to merge node`}));let c=Object.values(t);if(c.length===0)return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`No files to merge`}));switch(a){case`concat`:{let t=[],n=0;for(let e of c){let r=yield*o.read(e.id,s);t.push(r),n+=r.byteLength}let r=new Uint8Array(n),a=0;for(let e of t)r.set(e,a),a+=e.byteLength;let l=new ReadableStream({start(e){e.enqueue(r),e.close()}});return(0,e.completeNodeExecution)(yield*o.upload({storageId:i,size:r.byteLength,type:`application/octet-stream`,fileName:`merged_${c.length}_files.bin`,lastModified:0,metadata:JSON.stringify({mimeType:`application/octet-stream`,originalName:`merged_${c.length}_files`,extension:`bin`})},s,l))}default:return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`Unknown merge strategy: ${a}`}))}})})})}function u(a,{outputCount:o,strategy:s}){return n.Effect.gen(function*(){let o=yield*i.UploadEngine;return yield*(0,e.createFlowNode)({id:a,name:`Multiplex`,description:`Multiplexes input using ${s} strategy`,type:e.NodeType.multiplex,nodeTypeId:`multiplex`,outputTypeId:e.STORAGE_OUTPUT_TYPE_ID,inputSchema:t.uploadFileSchema,outputSchema:t.uploadFileSchema,multiOutput:!0,run:({data:t,storageId:i,clientId:a})=>n.Effect.gen(function*(){let{type:c,fileName:l,metadata:u,metadataJson:d}=(0,e.resolveUploadMetadata)(t.metadata),f=u?{...t,metadata:u}:t;if(s===`copy`){let t=yield*o.read(f.id,a),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}),r=yield*o.upload({storageId:i,size:t.byteLength,type:c,fileName:l,lastModified:0,metadata:d},a,n),s=(0,e.resolveUploadMetadata)(r.metadata);return(0,e.completeNodeExecution)(s.metadata?{...r,metadata:s.metadata}:r)}else if(s===`split`)return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`Split strategy is not supported with UploadFile pattern`}));return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`Unknown multiplex strategy: ${s}`}))})})})}function d(r,i){let a=i?.keepOutput??!0;return(0,e.createFlowNode)({id:r,name:`Passthrough`,description:`Passes file through without transformation, acting as an output sink`,type:e.NodeType.process,nodeTypeId:`passthrough`,inputSchema:t.uploadFileSchema,outputSchema:t.uploadFileSchema,keepOutput:a,outputTypeId:e.STORAGE_OUTPUT_TYPE_ID,run:({data:t})=>n.Effect.succeed((0,e.completeNodeExecution)(t))})}const f=a.z.record(a.z.string(),t.uploadFileSchema),p=t.uploadFileSchema;function m(t,{zipName:a,includeMetadata:o}){return n.Effect.gen(function*(){let s=yield*i.UploadEngine,c=yield*e.ZipPlugin;return yield*(0,e.createFlowNode)({id:t,name:`Zip Files`,description:`Combines multiple files into a zip archive`,type:e.NodeType.process,nodeTypeId:`zip`,outputTypeId:e.STORAGE_OUTPUT_TYPE_ID,inputSchema:f,outputSchema:p,multiInput:!0,run:({data:t,storageId:i,clientId:l})=>n.Effect.gen(function*(){if(!t||Object.keys(t).length===0)return yield*n.Effect.fail(r.UploadistaError.fromCode(`VALIDATION_ERROR`,{body:`No inputs provided to zip node`}));let u=yield*n.Effect.forEach(Object.values(t),e=>n.Effect.gen(function*(){let t=yield*s.read(e.id,l);return{id:e.id,data:t,metadata:e.metadata}}),{concurrency:`unbounded`}),d=yield*c.zip(u,{zipName:a,includeMetadata:o}),f=new ReadableStream({start(e){e.enqueue(d),e.close()}});return(0,e.completeNodeExecution)(yield*s.upload({storageId:i,size:d.byteLength,type:`application/zip`,fileName:a,lastModified:0,metadata:JSON.stringify({mimeType:`application/zip`,type:`application/zip`,originalName:a,fileName:a,extension:`zip`})},l,f))})})})}exports.createConditionalNode=o,exports.createMergeNode=l,exports.createMultiplexNode=u,exports.createPassthroughNode=d,exports.createZipNode=m;
|
package/dist/nodes/index.d.cts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { a as MergeParams, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-
|
|
2
|
-
import * as _uploadista_core_flow0 from "@uploadista/core/flow";
|
|
1
|
+
import { a as MergeParams, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-DpgHSX69.cjs";
|
|
3
2
|
import { NodeType, ZipPlugin } from "@uploadista/core/flow";
|
|
4
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
5
|
-
import * as zod from "zod";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import * as _uploadista_core_errors0 from "@uploadista/core/errors";
|
|
8
|
-
import { UploadistaError } from "@uploadista/core/errors";
|
|
9
3
|
import { UploadFile } from "@uploadista/core/types";
|
|
10
4
|
import { Effect } from "effect";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { UploadistaError } from "@uploadista/core/errors";
|
|
11
7
|
import { UploadEngine } from "@uploadista/core/upload";
|
|
12
8
|
|
|
13
9
|
//#region src/nodes/conditional-node.d.ts
|
|
@@ -15,9 +11,9 @@ declare function createConditionalNode(id: string, {
|
|
|
15
11
|
field,
|
|
16
12
|
operator,
|
|
17
13
|
value
|
|
18
|
-
}: ConditionalParams): Effect.Effect<
|
|
19
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
20
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
14
|
+
}: ConditionalParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
15
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
16
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
21
17
|
run: (args: {
|
|
22
18
|
data: UploadFile;
|
|
23
19
|
jobId: string;
|
|
@@ -25,7 +21,7 @@ declare function createConditionalNode(id: string, {
|
|
|
25
21
|
flowId: string;
|
|
26
22
|
inputs?: Record<string, unknown>;
|
|
27
23
|
clientId: string | null;
|
|
28
|
-
}) => Effect.Effect<
|
|
24
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, import("@uploadista/core/errors").UploadistaError, never>;
|
|
29
25
|
condition?: {
|
|
30
26
|
field: string;
|
|
31
27
|
operator: string;
|
|
@@ -39,16 +35,16 @@ declare function createConditionalNode(id: string, {
|
|
|
39
35
|
retryDelay?: number;
|
|
40
36
|
exponentialBackoff?: boolean;
|
|
41
37
|
};
|
|
42
|
-
circuitBreaker?:
|
|
38
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
43
39
|
} & {
|
|
44
40
|
type: NodeType;
|
|
45
|
-
},
|
|
41
|
+
}, import("@uploadista/core/errors").UploadistaError, never>;
|
|
46
42
|
//#endregion
|
|
47
43
|
//#region src/nodes/merge-node.d.ts
|
|
48
44
|
declare function createMergeNode(id: string, {
|
|
49
45
|
strategy,
|
|
50
46
|
separator: _separator
|
|
51
|
-
}: MergeParams): Effect.Effect<
|
|
47
|
+
}: MergeParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
52
48
|
inputSchema: z.ZodType<Record<string, UploadFile>, unknown, z.core.$ZodTypeInternals<Record<string, UploadFile>, unknown>>;
|
|
53
49
|
outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
|
|
54
50
|
run: (args: {
|
|
@@ -58,7 +54,7 @@ declare function createMergeNode(id: string, {
|
|
|
58
54
|
flowId: string;
|
|
59
55
|
inputs?: Record<string, unknown>;
|
|
60
56
|
clientId: string | null;
|
|
61
|
-
}) => Effect.Effect<
|
|
57
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
62
58
|
condition?: {
|
|
63
59
|
field: string;
|
|
64
60
|
operator: string;
|
|
@@ -72,7 +68,7 @@ declare function createMergeNode(id: string, {
|
|
|
72
68
|
retryDelay?: number;
|
|
73
69
|
exponentialBackoff?: boolean;
|
|
74
70
|
};
|
|
75
|
-
circuitBreaker?:
|
|
71
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
76
72
|
} & {
|
|
77
73
|
type: NodeType;
|
|
78
74
|
}, UploadistaError, UploadEngine>;
|
|
@@ -81,9 +77,9 @@ declare function createMergeNode(id: string, {
|
|
|
81
77
|
declare function createMultiplexNode(id: string, {
|
|
82
78
|
outputCount: _outputCount,
|
|
83
79
|
strategy
|
|
84
|
-
}: MultiplexParams): Effect.Effect<
|
|
85
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
86
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
80
|
+
}: MultiplexParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
81
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
82
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
87
83
|
run: (args: {
|
|
88
84
|
data: UploadFile;
|
|
89
85
|
jobId: string;
|
|
@@ -91,7 +87,7 @@ declare function createMultiplexNode(id: string, {
|
|
|
91
87
|
flowId: string;
|
|
92
88
|
inputs?: Record<string, unknown>;
|
|
93
89
|
clientId: string | null;
|
|
94
|
-
}) => Effect.Effect<
|
|
90
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
95
91
|
condition?: {
|
|
96
92
|
field: string;
|
|
97
93
|
operator: string;
|
|
@@ -105,7 +101,7 @@ declare function createMultiplexNode(id: string, {
|
|
|
105
101
|
retryDelay?: number;
|
|
106
102
|
exponentialBackoff?: boolean;
|
|
107
103
|
};
|
|
108
|
-
circuitBreaker?:
|
|
104
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
109
105
|
} & {
|
|
110
106
|
type: NodeType;
|
|
111
107
|
}, UploadistaError, UploadEngine>;
|
|
@@ -143,9 +139,9 @@ declare function createMultiplexNode(id: string, {
|
|
|
143
139
|
*/
|
|
144
140
|
declare function createPassthroughNode(id: string, options?: {
|
|
145
141
|
keepOutput?: boolean;
|
|
146
|
-
}): Effect.Effect<
|
|
147
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
148
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
142
|
+
}): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
143
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
144
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
149
145
|
run: (args: {
|
|
150
146
|
data: UploadFile;
|
|
151
147
|
jobId: string;
|
|
@@ -153,7 +149,7 @@ declare function createPassthroughNode(id: string, options?: {
|
|
|
153
149
|
flowId: string;
|
|
154
150
|
inputs?: Record<string, unknown>;
|
|
155
151
|
clientId: string | null;
|
|
156
|
-
}) => Effect.Effect<
|
|
152
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, import("@uploadista/core/errors").UploadistaError, never>;
|
|
157
153
|
condition?: {
|
|
158
154
|
field: string;
|
|
159
155
|
operator: string;
|
|
@@ -167,16 +163,16 @@ declare function createPassthroughNode(id: string, options?: {
|
|
|
167
163
|
retryDelay?: number;
|
|
168
164
|
exponentialBackoff?: boolean;
|
|
169
165
|
};
|
|
170
|
-
circuitBreaker?:
|
|
166
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
171
167
|
} & {
|
|
172
168
|
type: NodeType;
|
|
173
|
-
},
|
|
169
|
+
}, import("@uploadista/core/errors").UploadistaError, never>;
|
|
174
170
|
//#endregion
|
|
175
171
|
//#region src/nodes/zip-node.d.ts
|
|
176
172
|
declare function createZipNode(id: string, {
|
|
177
173
|
zipName,
|
|
178
174
|
includeMetadata
|
|
179
|
-
}: ZipParams): Effect.Effect<
|
|
175
|
+
}: ZipParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
180
176
|
inputSchema: z.ZodType<Record<string, UploadFile>, unknown, z.core.$ZodTypeInternals<Record<string, UploadFile>, unknown>>;
|
|
181
177
|
outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
|
|
182
178
|
run: (args: {
|
|
@@ -186,7 +182,7 @@ declare function createZipNode(id: string, {
|
|
|
186
182
|
flowId: string;
|
|
187
183
|
inputs?: Record<string, unknown>;
|
|
188
184
|
clientId: string | null;
|
|
189
|
-
}) => Effect.Effect<
|
|
185
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
190
186
|
condition?: {
|
|
191
187
|
field: string;
|
|
192
188
|
operator: string;
|
|
@@ -200,7 +196,7 @@ declare function createZipNode(id: string, {
|
|
|
200
196
|
retryDelay?: number;
|
|
201
197
|
exponentialBackoff?: boolean;
|
|
202
198
|
};
|
|
203
|
-
circuitBreaker?:
|
|
199
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
204
200
|
} & {
|
|
205
201
|
type: NodeType;
|
|
206
202
|
}, UploadistaError, UploadEngine | ZipPlugin>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"mappings":";;;;;;;;;iBASgB,qBAAA,CACd,EAAA;EACE,KAAA;EAAO,QAAA;EAAU;AAAA,GAAS,iBAAA,GAAiB,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCK/B,eAAA,CACd,EAAA;EACE,QAAA;EAAU,SAAA,EAAW;AAAA,GAAc,WAAA,GAAW,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCLlC,mBAAA,CACd,EAAA;EACE,WAAA,EAAa,YAAA;EAAc;AAAA,GAAY,eAAA,GAAe,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AFN1D;;;;;;;;;;;;;;;;;;;;;;;;iBG8BgB,qBAAA,CACd,EAAA,UACA,OAAA;EAAY,UAAA;AAAA,IAAsB,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCxBpB,aAAA,CACd,EAAA;EACE,OAAA;EAAS;AAAA,GAAmB,SAAA,GAAS,MAAA,CAAA,MAAA,iCAAA,YAAA"}
|
package/dist/nodes/index.d.mts
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import { a as MergeParams, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-
|
|
2
|
-
import * as _uploadista_core_flow0 from "@uploadista/core/flow";
|
|
1
|
+
import { a as MergeParams, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-DpgHSX69.mjs";
|
|
3
2
|
import { NodeType, ZipPlugin } from "@uploadista/core/flow";
|
|
4
3
|
import { UploadFile } from "@uploadista/core/types";
|
|
5
4
|
import { Effect } from "effect";
|
|
6
|
-
import * as _uploadista_core_errors0 from "@uploadista/core/errors";
|
|
7
5
|
import { UploadistaError } from "@uploadista/core/errors";
|
|
8
6
|
import { UploadEngine } from "@uploadista/core/upload";
|
|
9
|
-
import * as zod from "zod";
|
|
10
7
|
import { z } from "zod";
|
|
11
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
12
8
|
|
|
13
9
|
//#region src/nodes/conditional-node.d.ts
|
|
14
10
|
declare function createConditionalNode(id: string, {
|
|
15
11
|
field,
|
|
16
12
|
operator,
|
|
17
13
|
value
|
|
18
|
-
}: ConditionalParams): Effect.Effect<
|
|
19
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
20
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
14
|
+
}: ConditionalParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
15
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
16
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
21
17
|
run: (args: {
|
|
22
18
|
data: UploadFile;
|
|
23
19
|
jobId: string;
|
|
@@ -25,7 +21,7 @@ declare function createConditionalNode(id: string, {
|
|
|
25
21
|
flowId: string;
|
|
26
22
|
inputs?: Record<string, unknown>;
|
|
27
23
|
clientId: string | null;
|
|
28
|
-
}) => Effect.Effect<
|
|
24
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, import("@uploadista/core/errors").UploadistaError, never>;
|
|
29
25
|
condition?: {
|
|
30
26
|
field: string;
|
|
31
27
|
operator: string;
|
|
@@ -39,16 +35,16 @@ declare function createConditionalNode(id: string, {
|
|
|
39
35
|
retryDelay?: number;
|
|
40
36
|
exponentialBackoff?: boolean;
|
|
41
37
|
};
|
|
42
|
-
circuitBreaker?:
|
|
38
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
43
39
|
} & {
|
|
44
40
|
type: NodeType;
|
|
45
|
-
},
|
|
41
|
+
}, import("@uploadista/core/errors").UploadistaError, never>;
|
|
46
42
|
//#endregion
|
|
47
43
|
//#region src/nodes/merge-node.d.ts
|
|
48
44
|
declare function createMergeNode(id: string, {
|
|
49
45
|
strategy,
|
|
50
46
|
separator: _separator
|
|
51
|
-
}: MergeParams): Effect.Effect<
|
|
47
|
+
}: MergeParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
52
48
|
inputSchema: z.ZodType<Record<string, UploadFile>, unknown, z.core.$ZodTypeInternals<Record<string, UploadFile>, unknown>>;
|
|
53
49
|
outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
|
|
54
50
|
run: (args: {
|
|
@@ -58,7 +54,7 @@ declare function createMergeNode(id: string, {
|
|
|
58
54
|
flowId: string;
|
|
59
55
|
inputs?: Record<string, unknown>;
|
|
60
56
|
clientId: string | null;
|
|
61
|
-
}) => Effect.Effect<
|
|
57
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
62
58
|
condition?: {
|
|
63
59
|
field: string;
|
|
64
60
|
operator: string;
|
|
@@ -72,7 +68,7 @@ declare function createMergeNode(id: string, {
|
|
|
72
68
|
retryDelay?: number;
|
|
73
69
|
exponentialBackoff?: boolean;
|
|
74
70
|
};
|
|
75
|
-
circuitBreaker?:
|
|
71
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
76
72
|
} & {
|
|
77
73
|
type: NodeType;
|
|
78
74
|
}, UploadistaError, UploadEngine>;
|
|
@@ -81,9 +77,9 @@ declare function createMergeNode(id: string, {
|
|
|
81
77
|
declare function createMultiplexNode(id: string, {
|
|
82
78
|
outputCount: _outputCount,
|
|
83
79
|
strategy
|
|
84
|
-
}: MultiplexParams): Effect.Effect<
|
|
85
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
86
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
80
|
+
}: MultiplexParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
81
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
82
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
87
83
|
run: (args: {
|
|
88
84
|
data: UploadFile;
|
|
89
85
|
jobId: string;
|
|
@@ -91,7 +87,7 @@ declare function createMultiplexNode(id: string, {
|
|
|
91
87
|
flowId: string;
|
|
92
88
|
inputs?: Record<string, unknown>;
|
|
93
89
|
clientId: string | null;
|
|
94
|
-
}) => Effect.Effect<
|
|
90
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
95
91
|
condition?: {
|
|
96
92
|
field: string;
|
|
97
93
|
operator: string;
|
|
@@ -105,7 +101,7 @@ declare function createMultiplexNode(id: string, {
|
|
|
105
101
|
retryDelay?: number;
|
|
106
102
|
exponentialBackoff?: boolean;
|
|
107
103
|
};
|
|
108
|
-
circuitBreaker?:
|
|
104
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
109
105
|
} & {
|
|
110
106
|
type: NodeType;
|
|
111
107
|
}, UploadistaError, UploadEngine>;
|
|
@@ -143,9 +139,9 @@ declare function createMultiplexNode(id: string, {
|
|
|
143
139
|
*/
|
|
144
140
|
declare function createPassthroughNode(id: string, options?: {
|
|
145
141
|
keepOutput?: boolean;
|
|
146
|
-
}): Effect.Effect<
|
|
147
|
-
inputSchema: zod.ZodType<UploadFile, unknown,
|
|
148
|
-
outputSchema: zod.ZodType<UploadFile, unknown,
|
|
142
|
+
}): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
143
|
+
inputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
144
|
+
outputSchema: import("zod").ZodType<UploadFile, unknown, import("zod/v4/core").$ZodTypeInternals<UploadFile, unknown>>;
|
|
149
145
|
run: (args: {
|
|
150
146
|
data: UploadFile;
|
|
151
147
|
jobId: string;
|
|
@@ -153,7 +149,7 @@ declare function createPassthroughNode(id: string, options?: {
|
|
|
153
149
|
flowId: string;
|
|
154
150
|
inputs?: Record<string, unknown>;
|
|
155
151
|
clientId: string | null;
|
|
156
|
-
}) => Effect.Effect<
|
|
152
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, import("@uploadista/core/errors").UploadistaError, never>;
|
|
157
153
|
condition?: {
|
|
158
154
|
field: string;
|
|
159
155
|
operator: string;
|
|
@@ -167,16 +163,16 @@ declare function createPassthroughNode(id: string, options?: {
|
|
|
167
163
|
retryDelay?: number;
|
|
168
164
|
exponentialBackoff?: boolean;
|
|
169
165
|
};
|
|
170
|
-
circuitBreaker?:
|
|
166
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
171
167
|
} & {
|
|
172
168
|
type: NodeType;
|
|
173
|
-
},
|
|
169
|
+
}, import("@uploadista/core/errors").UploadistaError, never>;
|
|
174
170
|
//#endregion
|
|
175
171
|
//#region src/nodes/zip-node.d.ts
|
|
176
172
|
declare function createZipNode(id: string, {
|
|
177
173
|
zipName,
|
|
178
174
|
includeMetadata
|
|
179
|
-
}: ZipParams): Effect.Effect<
|
|
175
|
+
}: ZipParams): Effect.Effect<import("@uploadista/core/flow").FlowNodeData & {
|
|
180
176
|
inputSchema: z.ZodType<Record<string, UploadFile>, unknown, z.core.$ZodTypeInternals<Record<string, UploadFile>, unknown>>;
|
|
181
177
|
outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
|
|
182
178
|
run: (args: {
|
|
@@ -186,7 +182,7 @@ declare function createZipNode(id: string, {
|
|
|
186
182
|
flowId: string;
|
|
187
183
|
inputs?: Record<string, unknown>;
|
|
188
184
|
clientId: string | null;
|
|
189
|
-
}) => Effect.Effect<
|
|
185
|
+
}) => Effect.Effect<import("@uploadista/core/flow").NodeExecutionResult<UploadFile>, UploadistaError, never>;
|
|
190
186
|
condition?: {
|
|
191
187
|
field: string;
|
|
192
188
|
operator: string;
|
|
@@ -200,7 +196,7 @@ declare function createZipNode(id: string, {
|
|
|
200
196
|
retryDelay?: number;
|
|
201
197
|
exponentialBackoff?: boolean;
|
|
202
198
|
};
|
|
203
|
-
circuitBreaker?:
|
|
199
|
+
circuitBreaker?: import("@uploadista/core/flow").FlowCircuitBreakerConfig;
|
|
204
200
|
} & {
|
|
205
201
|
type: NodeType;
|
|
206
202
|
}, UploadistaError, UploadEngine | ZipPlugin>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"mappings":";;;;;;;;;iBASgB,qBAAA,CACd,EAAA;EACE,KAAA;EAAO,QAAA;EAAU;AAAA,GAAS,iBAAA,GAAiB,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCK/B,eAAA,CACd,EAAA;EACE,QAAA;EAAU,SAAA,EAAW;AAAA,GAAc,WAAA,GAAW,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCLlC,mBAAA,CACd,EAAA;EACE,WAAA,EAAa,YAAA;EAAc;AAAA,GAAY,eAAA,GAAe,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AFN1D;;;;;;;;;;;;;;;;;;;;;;;;iBG8BgB,qBAAA,CACd,EAAA,UACA,OAAA;EAAY,UAAA;AAAA,IAAsB,MAAA,CAAA,MAAA,iCAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCxBpB,aAAA,CACd,EAAA;EACE,OAAA;EAAS;AAAA,GAAmB,SAAA,GAAS,MAAA,CAAA,MAAA,iCAAA,YAAA"}
|
package/dist/nodes/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["inputSchema","outputSchema"],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"sourcesContent":["import {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { Effect } from \"effect\";\nimport type { ConditionalParams } from \"@/types/conditional-node\";\n\nexport function createConditionalNode(\n id: string,\n { field, operator, value }: ConditionalParams,\n) {\n return createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Conditional Router\",\n description: `Routes flow based on ${field} ${operator} ${value}`,\n type: NodeType.conditional,\n nodeTypeId: \"conditional\",\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n condition: { field, operator, value },\n run: ({ data }) => {\n // The actual routing logic is handled by the flow engine\n // This node just passes through the data\n return Effect.succeed(completeNodeExecution(data));\n },\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport { z } from \"zod\";\nimport type { MergeParams } from \"@/types/merge-node\";\n\nconst inputSchema = z.record(z.string(), uploadFileSchema);\nconst outputSchema = uploadFileSchema;\n\nexport function createMergeNode(\n id: string,\n { strategy, separator: _separator }: MergeParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n\n return yield* createFlowNode<Record<string, UploadFile>, UploadFile>({\n id,\n name: \"Merge Files\",\n description: `Merges multiple files using ${strategy} strategy`,\n type: NodeType.merge,\n nodeTypeId: \"merge\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema,\n outputSchema,\n multiInput: true,\n run: ({ data: inputs, storageId, clientId }) => {\n return Effect.gen(function* () {\n if (!inputs || Object.keys(inputs).length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No inputs provided to merge node\",\n }),\n );\n }\n\n const inputFiles = Object.values(inputs);\n\n if (inputFiles.length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No files to merge\",\n }),\n );\n }\n\n switch (strategy) {\n case \"concat\": {\n // Read bytes from all input files\n const inputBytesArray: Uint8Array[] = [];\n let totalSize = 0;\n\n for (const file of inputFiles) {\n const bytes = yield* uploadEngine.read(file.id, clientId);\n inputBytesArray.push(bytes);\n totalSize += bytes.byteLength;\n }\n\n // Concatenate all files into one\n const mergedBytes = new Uint8Array(totalSize);\n let offset = 0;\n for (const bytes of inputBytesArray) {\n mergedBytes.set(bytes, offset);\n offset += bytes.byteLength;\n }\n\n // Create a stream from the merged bytes\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(mergedBytes);\n controller.close();\n },\n });\n\n // Upload the merged file\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: mergedBytes.byteLength,\n type: \"application/octet-stream\",\n fileName: `merged_${inputFiles.length}_files.bin`,\n lastModified: 0,\n metadata: JSON.stringify({\n mimeType: \"application/octet-stream\",\n originalName: `merged_${inputFiles.length}_files`,\n extension: \"bin\",\n }),\n },\n clientId,\n stream,\n );\n\n return completeNodeExecution(result);\n }\n default: {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: `Unknown merge strategy: ${strategy}`,\n }),\n );\n }\n }\n });\n },\n });\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n resolveUploadMetadata,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport type { MultiplexParams } from \"@/types/multiplex-node\";\n\nexport function createMultiplexNode(\n id: string,\n { outputCount: _outputCount, strategy }: MultiplexParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n\n return yield* createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Multiplex\",\n description: `Multiplexes input using ${strategy} strategy`,\n type: NodeType.multiplex,\n nodeTypeId: \"multiplex\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n multiOutput: true,\n run: ({ data: file, storageId, clientId }) => {\n return Effect.gen(function* () {\n const { type, fileName, metadata, metadataJson } =\n resolveUploadMetadata(file.metadata);\n const normalizedFile = metadata ? { ...file, metadata } : file;\n\n if (strategy === \"copy\") {\n // For copy strategy, read and re-upload the file\n const inputBytes = yield* uploadEngine.read(\n normalizedFile.id,\n clientId,\n );\n\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(inputBytes);\n controller.close();\n },\n });\n\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: inputBytes.byteLength,\n type,\n fileName,\n lastModified: 0,\n metadata: metadataJson,\n },\n clientId,\n stream,\n );\n\n const resolvedResult = resolveUploadMetadata(result.metadata);\n\n return completeNodeExecution(\n resolvedResult.metadata\n ? { ...result, metadata: resolvedResult.metadata }\n : result,\n );\n } else if (strategy === \"split\") {\n // Split strategy is not supported in the new pattern\n // as it would require returning multiple UploadFiles\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"Split strategy is not supported with UploadFile pattern\",\n }),\n );\n }\n\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: `Unknown multiplex strategy: ${strategy}`,\n }),\n );\n });\n },\n });\n });\n}\n","import {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a passthrough node that acts as a data sink without transformation.\n *\n * This node is useful when you need to capture output at a specific point in the flow\n * without performing any transformation. The most common use case is after a\n * conditional routing node where one branch needs to output the file as-is.\n *\n * By default, `keepOutput` is set to `true`, making this node a sink that preserves\n * its output in the flow results even if it has outgoing edges.\n *\n * @param id - Unique identifier for the node\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to preserve output in flow results (default: true)\n *\n * @example\n * ```typescript\n * // Use after conditional routing to output files that don't need processing\n * const conditionalNode = yield* createConditionalNode(\"is-image\", {\n * field: \"mimeType\",\n * operator: \"startsWith\",\n * value: \"image/\",\n * });\n *\n * // Images go to resize node, non-images go to passthrough (stored as-is)\n * const passthroughNode = yield* createPassthroughNode(\"store-as-is\");\n *\n * // Connect conditional false edge to passthrough\n * flow.addEdge({ source: \"is-image\", target: \"store-as-is\", condition: false });\n * ```\n */\nexport function createPassthroughNode(\n id: string,\n options?: { keepOutput?: boolean },\n) {\n const keepOutput = options?.keepOutput ?? true;\n\n return createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Passthrough\",\n description:\n \"Passes file through without transformation, acting as an output sink\",\n type: NodeType.process,\n nodeTypeId: \"passthrough\",\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n keepOutput,\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n run: ({ data }) => {\n // Simply pass through the data unchanged\n return Effect.succeed(completeNodeExecution(data));\n },\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n ZipPlugin,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport { z } from \"zod\";\nimport type { ZipParams } from \"@/types/zip-node\";\n\nconst inputSchema = z.record(z.string(), uploadFileSchema);\nconst outputSchema = uploadFileSchema;\n\nexport function createZipNode(\n id: string,\n { zipName, includeMetadata }: ZipParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n const zipPlugin = yield* ZipPlugin;\n return yield* createFlowNode<Record<string, UploadFile>, UploadFile>({\n id,\n name: \"Zip Files\",\n description: \"Combines multiple files into a zip archive\",\n type: NodeType.process,\n nodeTypeId: \"zip\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema,\n outputSchema,\n multiInput: true,\n run: ({ data: inputs, storageId, clientId }) => {\n return Effect.gen(function* () {\n if (!inputs || Object.keys(inputs).length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No inputs provided to zip node\",\n }),\n );\n }\n\n const zipInputs = yield* Effect.forEach(\n Object.values(inputs),\n (input) =>\n Effect.gen(function* () {\n const data = yield* uploadEngine.read(input.id, clientId);\n return {\n id: input.id,\n data,\n metadata: input.metadata,\n };\n }),\n { concurrency: \"unbounded\" },\n );\n\n const zipBytes = yield* zipPlugin.zip(zipInputs, {\n zipName,\n includeMetadata,\n });\n\n // Create a stream from the zip bytes\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(zipBytes);\n controller.close();\n },\n });\n\n // Upload the zip file\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: zipBytes.byteLength,\n type: \"application/zip\",\n fileName: zipName,\n lastModified: 0,\n metadata: JSON.stringify({\n mimeType: \"application/zip\",\n type: \"application/zip\",\n originalName: zipName,\n fileName: zipName,\n extension: \"zip\",\n }),\n },\n clientId,\n stream,\n );\n\n return completeNodeExecution(result);\n });\n },\n });\n });\n}\n"],"mappings":"yYASA,SAAgB,EACd,EACA,CAAE,QAAO,WAAU,SACnB,CACA,OAAO,EAAuC,CAC5C,KACA,KAAM,qBACN,YAAa,wBAAwB,EAAM,GAAG,EAAS,GAAG,IAC1D,KAAM,EAAS,YACf,WAAY,cACZ,YAAa,EACb,aAAc,EACd,UAAW,CAAE,QAAO,WAAU,QAAO,CACrC,KAAM,CAAE,UAGC,EAAO,QAAQ,EAAsB,EAAK,CAAC,CAErD,CAAC,CCdJ,MAAMA,EAAc,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAiB,CACpDC,EAAe,EAErB,SAAgB,EACd,EACA,CAAE,WAAU,UAAW,GACvB,CACA,OAAO,EAAO,IAAI,WAAa,CAC7B,IAAM,EAAe,MAAO,EAE5B,OAAO,MAAO,EAAuD,CACnE,KACA,KAAM,cACN,YAAa,+BAA+B,EAAS,WACrD,KAAM,EAAS,MACf,WAAY,QACZ,aAAc,EACd,YAAA,EACA,aAAA,EACA,WAAY,GACZ,KAAM,CAAE,KAAM,EAAQ,YAAW,cACxB,EAAO,IAAI,WAAa,CAC7B,GAAI,CAAC,GAAU,OAAO,KAAK,EAAO,CAAC,SAAW,EAC5C,OAAO,MAAO,EAAO,KACnB,EAAgB,SAAS,mBAAoB,CAC3C,KAAM,mCACP,CAAC,CACH,CAGH,IAAM,EAAa,OAAO,OAAO,EAAO,CAExC,GAAI,EAAW,SAAW,EACxB,OAAO,MAAO,EAAO,KACnB,EAAgB,SAAS,mBAAo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AO,KAAK,EAAO,CAAC,SAAW,EAC5C,OAAO,MAAO,EAAO,KACnB,EAAgB,SAAS,mBAAoB,CAC3C,KAAM,iCACP,CAAC,CACH,CAGH,IAAM,EAAY,MAAO,EAAO,QAC9B,OAAO,OAAO,EAAO,CACpB,GACC,EAAO,IAAI,WAAa,CACtB,IAAM,EAAO,MAAO,EAAa,KAAK,EAAM,GAAI,EAAS,CACzD,MAAO,CACL,GAAI,EAAM,GACV,OACA,SAAU,EAAM,SACjB,EACD,CACJ,CAAE,YAAa,YAAa,CAC7B,CAEK,EAAW,MAAO,EAAU,IAAI,EAAW,CAC/C,UACA,kBACD,CAAC,CAGI,EAAS,IAAI,eAAe,CAChC,MAAM,EAAY,CAChB,EAAW,QAAQ,EAAS,CAC5B,EAAW,OAAO,EAErB,CAAC,CAsBF,OAAO,EAnBQ,MAAO,EAAa,OACjC,CACE,YACA,KAAM,EAAS,WACf,KAAM,kBACN,SAAU,EACV,aAAc,EACd,SAAU,KAAK,UAAU,CACvB,SAAU,kBACV,KAAM,kBACN,aAAc,EACd,SAAU,EACV,UAAW,MACZ,CAAC,CACH,CACD,EACA,EACD,CAEmC,EACpC,CAEL,CAAC,EACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["inputSchema","outputSchema"],"sources":["../../src/nodes/conditional-node.ts","../../src/nodes/merge-node.ts","../../src/nodes/multiplex-node.ts","../../src/nodes/passthrough-node.ts","../../src/nodes/zip-node.ts"],"sourcesContent":["import {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { Effect } from \"effect\";\nimport type { ConditionalParams } from \"@/types/conditional-node\";\n\nexport function createConditionalNode(\n id: string,\n { field, operator, value }: ConditionalParams,\n) {\n return createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Conditional Router\",\n description: `Routes flow based on ${field} ${operator} ${value}`,\n type: NodeType.conditional,\n nodeTypeId: \"conditional\",\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n condition: { field, operator, value },\n run: ({ data }) => {\n // The actual routing logic is handled by the flow engine\n // This node just passes through the data\n return Effect.succeed(completeNodeExecution(data));\n },\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport { z } from \"zod\";\nimport type { MergeParams } from \"@/types/merge-node\";\n\nconst inputSchema = z.record(z.string(), uploadFileSchema);\nconst outputSchema = uploadFileSchema;\n\nexport function createMergeNode(\n id: string,\n { strategy, separator: _separator }: MergeParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n\n return yield* createFlowNode<Record<string, UploadFile>, UploadFile>({\n id,\n name: \"Merge Files\",\n description: `Merges multiple files using ${strategy} strategy`,\n type: NodeType.merge,\n nodeTypeId: \"merge\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema,\n outputSchema,\n multiInput: true,\n run: ({ data: inputs, storageId, clientId }) => {\n return Effect.gen(function* () {\n if (!inputs || Object.keys(inputs).length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No inputs provided to merge node\",\n }),\n );\n }\n\n const inputFiles = Object.values(inputs);\n\n if (inputFiles.length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No files to merge\",\n }),\n );\n }\n\n switch (strategy) {\n case \"concat\": {\n // Read bytes from all input files\n const inputBytesArray: Uint8Array[] = [];\n let totalSize = 0;\n\n for (const file of inputFiles) {\n const bytes = yield* uploadEngine.read(file.id, clientId);\n inputBytesArray.push(bytes);\n totalSize += bytes.byteLength;\n }\n\n // Concatenate all files into one\n const mergedBytes = new Uint8Array(totalSize);\n let offset = 0;\n for (const bytes of inputBytesArray) {\n mergedBytes.set(bytes, offset);\n offset += bytes.byteLength;\n }\n\n // Create a stream from the merged bytes\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(mergedBytes);\n controller.close();\n },\n });\n\n // Upload the merged file\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: mergedBytes.byteLength,\n type: \"application/octet-stream\",\n fileName: `merged_${inputFiles.length}_files.bin`,\n lastModified: 0,\n metadata: JSON.stringify({\n mimeType: \"application/octet-stream\",\n originalName: `merged_${inputFiles.length}_files`,\n extension: \"bin\",\n }),\n },\n clientId,\n stream,\n );\n\n return completeNodeExecution(result);\n }\n default: {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: `Unknown merge strategy: ${strategy}`,\n }),\n );\n }\n }\n });\n },\n });\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n resolveUploadMetadata,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport type { MultiplexParams } from \"@/types/multiplex-node\";\n\nexport function createMultiplexNode(\n id: string,\n { outputCount: _outputCount, strategy }: MultiplexParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n\n return yield* createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Multiplex\",\n description: `Multiplexes input using ${strategy} strategy`,\n type: NodeType.multiplex,\n nodeTypeId: \"multiplex\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n multiOutput: true,\n run: ({ data: file, storageId, clientId }) => {\n return Effect.gen(function* () {\n const { type, fileName, metadata, metadataJson } =\n resolveUploadMetadata(file.metadata);\n const normalizedFile = metadata ? { ...file, metadata } : file;\n\n if (strategy === \"copy\") {\n // For copy strategy, read and re-upload the file\n const inputBytes = yield* uploadEngine.read(\n normalizedFile.id,\n clientId,\n );\n\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(inputBytes);\n controller.close();\n },\n });\n\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: inputBytes.byteLength,\n type,\n fileName,\n lastModified: 0,\n metadata: metadataJson,\n },\n clientId,\n stream,\n );\n\n const resolvedResult = resolveUploadMetadata(result.metadata);\n\n return completeNodeExecution(\n resolvedResult.metadata\n ? { ...result, metadata: resolvedResult.metadata }\n : result,\n );\n } else if (strategy === \"split\") {\n // Split strategy is not supported in the new pattern\n // as it would require returning multiple UploadFiles\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"Split strategy is not supported with UploadFile pattern\",\n }),\n );\n }\n\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: `Unknown multiplex strategy: ${strategy}`,\n }),\n );\n });\n },\n });\n });\n}\n","import {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a passthrough node that acts as a data sink without transformation.\n *\n * This node is useful when you need to capture output at a specific point in the flow\n * without performing any transformation. The most common use case is after a\n * conditional routing node where one branch needs to output the file as-is.\n *\n * By default, `keepOutput` is set to `true`, making this node a sink that preserves\n * its output in the flow results even if it has outgoing edges.\n *\n * @param id - Unique identifier for the node\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to preserve output in flow results (default: true)\n *\n * @example\n * ```typescript\n * // Use after conditional routing to output files that don't need processing\n * const conditionalNode = yield* createConditionalNode(\"is-image\", {\n * field: \"mimeType\",\n * operator: \"startsWith\",\n * value: \"image/\",\n * });\n *\n * // Images go to resize node, non-images go to passthrough (stored as-is)\n * const passthroughNode = yield* createPassthroughNode(\"store-as-is\");\n *\n * // Connect conditional false edge to passthrough\n * flow.addEdge({ source: \"is-image\", target: \"store-as-is\", condition: false });\n * ```\n */\nexport function createPassthroughNode(\n id: string,\n options?: { keepOutput?: boolean },\n) {\n const keepOutput = options?.keepOutput ?? true;\n\n return createFlowNode<UploadFile, UploadFile>({\n id,\n name: \"Passthrough\",\n description:\n \"Passes file through without transformation, acting as an output sink\",\n type: NodeType.process,\n nodeTypeId: \"passthrough\",\n inputSchema: uploadFileSchema,\n outputSchema: uploadFileSchema,\n keepOutput,\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n run: ({ data }) => {\n // Simply pass through the data unchanged\n return Effect.succeed(completeNodeExecution(data));\n },\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n completeNodeExecution,\n createFlowNode,\n NodeType,\n STORAGE_OUTPUT_TYPE_ID,\n ZipPlugin,\n} from \"@uploadista/core/flow\";\nimport { type UploadFile, uploadFileSchema } from \"@uploadista/core/types\";\nimport { UploadEngine } from \"@uploadista/core/upload\";\nimport { Effect } from \"effect\";\nimport { z } from \"zod\";\nimport type { ZipParams } from \"@/types/zip-node\";\n\nconst inputSchema = z.record(z.string(), uploadFileSchema);\nconst outputSchema = uploadFileSchema;\n\nexport function createZipNode(\n id: string,\n { zipName, includeMetadata }: ZipParams,\n) {\n return Effect.gen(function* () {\n const uploadEngine = yield* UploadEngine;\n const zipPlugin = yield* ZipPlugin;\n return yield* createFlowNode<Record<string, UploadFile>, UploadFile>({\n id,\n name: \"Zip Files\",\n description: \"Combines multiple files into a zip archive\",\n type: NodeType.process,\n nodeTypeId: \"zip\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n inputSchema,\n outputSchema,\n multiInput: true,\n run: ({ data: inputs, storageId, clientId }) => {\n return Effect.gen(function* () {\n if (!inputs || Object.keys(inputs).length === 0) {\n return yield* Effect.fail(\n UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"No inputs provided to zip node\",\n }),\n );\n }\n\n const zipInputs = yield* Effect.forEach(\n Object.values(inputs),\n (input) =>\n Effect.gen(function* () {\n const data = yield* uploadEngine.read(input.id, clientId);\n return {\n id: input.id,\n data,\n metadata: input.metadata,\n };\n }),\n { concurrency: \"unbounded\" },\n );\n\n const zipBytes = yield* zipPlugin.zip(zipInputs, {\n zipName,\n includeMetadata,\n });\n\n // Create a stream from the zip bytes\n const stream = new ReadableStream({\n start(controller) {\n controller.enqueue(zipBytes);\n controller.close();\n },\n });\n\n // Upload the zip file\n const result = yield* uploadEngine.upload(\n {\n storageId,\n size: zipBytes.byteLength,\n type: \"application/zip\",\n fileName: zipName,\n lastModified: 0,\n metadata: JSON.stringify({\n mimeType: \"application/zip\",\n type: \"application/zip\",\n originalName: zipName,\n fileName: zipName,\n extension: \"zip\",\n }),\n },\n clientId,\n stream,\n );\n\n return completeNodeExecution(result);\n });\n },\n });\n });\n}\n"],"mappings":"yYASA,SAAgB,EACd,EACA,CAAE,QAAO,WAAU,SACnB,CACA,OAAO,EAAuC,CAC5C,KACA,KAAM,qBACN,YAAa,wBAAwB,EAAM,GAAG,EAAS,GAAG,IAC1D,KAAM,EAAS,YACf,WAAY,cACZ,YAAa,EACb,aAAc,EACd,UAAW,CAAE,QAAO,WAAU,OAAM,EACpC,KAAM,CAAE,UAGC,EAAO,QAAQ,EAAsB,CAAI,CAAC,CAErD,CAAC,CACH,CCfA,MAAMA,EAAc,EAAE,OAAO,EAAE,OAAO,EAAG,CAAgB,EACnDC,EAAe,EAErB,SAAgB,EACd,EACA,CAAE,WAAU,UAAW,GACvB,CACA,OAAO,EAAO,IAAI,WAAa,CAC7B,IAAM,EAAe,MAAO,EAE5B,OAAO,MAAO,EAAuD,CACnE,KACA,KAAM,cACN,YAAa,+BAA+B,EAAS,WACrD,KAAM,EAAS,MACf,WAAY,QACZ,aAAc,EACd,YAAA,EACA,aAAA,EACA,WAAY,GACZ,KAAM,CAAE,KA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{value:`Module`});let e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("zod");const t=e.z.object({field:e.z.enum([`mimeType`,`size`,`width`,`height`,`extension`]),operator:e.z.enum([`equals`,`notEquals`,`greaterThan`,`lessThan`,`contains`,`startsWith`]),value:e.z.union([e.z.string(),e.z.number()])}),n=e.z.object({strategy:e.z.enum([`concat`,`batch`]).default(`batch`),separator:e.z.string().default(`
|
|
2
2
|
`).optional(),inputCount:e.z.number().min(2).max(10).default(2)}),r=e.z.object({outputCount:e.z.number().min(1).max(10),strategy:e.z.enum([`copy`,`split`]).default(`copy`)}),i=e.z.object({zipName:e.z.string().default(`archive.zip`),includeMetadata:e.z.boolean().default(!1),inputCount:e.z.number().min(2).max(10).default(2)});exports.conditionalParamsSchema=t,exports.mergeParamsSchema=n,exports.multiplexParamsSchema=r,exports.zipParamsSchema=i;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MergeParams, c as conditionalParamsSchema, i as multiplexParamsSchema, n as zipParamsSchema, o as mergeParamsSchema, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-
|
|
1
|
+
import { a as MergeParams, c as conditionalParamsSchema, i as multiplexParamsSchema, n as zipParamsSchema, o as mergeParamsSchema, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-DpgHSX69.cjs";
|
|
2
2
|
export { ConditionalParams, MergeParams, MultiplexParams, ZipParams, conditionalParamsSchema, mergeParamsSchema, multiplexParamsSchema, zipParamsSchema };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MergeParams, c as conditionalParamsSchema, i as multiplexParamsSchema, n as zipParamsSchema, o as mergeParamsSchema, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-
|
|
1
|
+
import { a as MergeParams, c as conditionalParamsSchema, i as multiplexParamsSchema, n as zipParamsSchema, o as mergeParamsSchema, r as MultiplexParams, s as ConditionalParams, t as ZipParams } from "../zip-node-DpgHSX69.mjs";
|
|
2
2
|
export { ConditionalParams, MergeParams, MultiplexParams, ZipParams, conditionalParamsSchema, mergeParamsSchema, multiplexParamsSchema, zipParamsSchema };
|
package/dist/types/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/types/conditional-node.ts","../../src/types/merge-node.ts","../../src/types/multiplex-node.ts","../../src/types/zip-node.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const conditionalParamsSchema = z.object({\n field: z.enum([\"mimeType\", \"size\", \"width\", \"height\", \"extension\"]),\n operator: z.enum([\n \"equals\",\n \"notEquals\",\n \"greaterThan\",\n \"lessThan\",\n \"contains\",\n \"startsWith\",\n ]),\n value: z.union([z.string(), z.number()]),\n});\n\nexport type ConditionalParams = z.infer<typeof conditionalParamsSchema>;\n","import { z } from \"zod\";\n\nexport const mergeParamsSchema = z.object({\n strategy: z.enum([\"concat\", \"batch\"]).default(\"batch\"),\n separator: z.string().default(\"\\n\").optional(),\n inputCount: z.number().min(2).max(10).default(2),\n});\n\nexport type MergeParams = z.infer<typeof mergeParamsSchema>;\n","import { z } from \"zod\";\n\nexport const multiplexParamsSchema = z.object({\n outputCount: z.number().min(1).max(10),\n strategy: z.enum([\"copy\", \"split\"]).default(\"copy\"),\n});\n\nexport type MultiplexParams = z.infer<typeof multiplexParamsSchema>;\n","import { z } from \"zod\";\n\nexport const zipParamsSchema = z.object({\n zipName: z.string().default(\"archive.zip\"),\n includeMetadata: z.boolean().default(false),\n inputCount: z.number().min(2).max(10).default(2),\n});\n\nexport type ZipParams = z.infer<typeof zipParamsSchema>;\n"],"mappings":"wBAEA,MAAa,EAA0B,EAAE,OAAO,CAC9C,MAAO,EAAE,KAAK,CAAC,WAAY,OAAQ,QAAS,SAAU,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/types/conditional-node.ts","../../src/types/merge-node.ts","../../src/types/multiplex-node.ts","../../src/types/zip-node.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const conditionalParamsSchema = z.object({\n field: z.enum([\"mimeType\", \"size\", \"width\", \"height\", \"extension\"]),\n operator: z.enum([\n \"equals\",\n \"notEquals\",\n \"greaterThan\",\n \"lessThan\",\n \"contains\",\n \"startsWith\",\n ]),\n value: z.union([z.string(), z.number()]),\n});\n\nexport type ConditionalParams = z.infer<typeof conditionalParamsSchema>;\n","import { z } from \"zod\";\n\nexport const mergeParamsSchema = z.object({\n strategy: z.enum([\"concat\", \"batch\"]).default(\"batch\"),\n separator: z.string().default(\"\\n\").optional(),\n inputCount: z.number().min(2).max(10).default(2),\n});\n\nexport type MergeParams = z.infer<typeof mergeParamsSchema>;\n","import { z } from \"zod\";\n\nexport const multiplexParamsSchema = z.object({\n outputCount: z.number().min(1).max(10),\n strategy: z.enum([\"copy\", \"split\"]).default(\"copy\"),\n});\n\nexport type MultiplexParams = z.infer<typeof multiplexParamsSchema>;\n","import { z } from \"zod\";\n\nexport const zipParamsSchema = z.object({\n zipName: z.string().default(\"archive.zip\"),\n includeMetadata: z.boolean().default(false),\n inputCount: z.number().min(2).max(10).default(2),\n});\n\nexport type ZipParams = z.infer<typeof zipParamsSchema>;\n"],"mappings":"wBAEA,MAAa,EAA0B,EAAE,OAAO,CAC9C,MAAO,EAAE,KAAK,CAAC,WAAY,OAAQ,QAAS,SAAU,WAAW,CAAC,EAClE,SAAU,EAAE,KAAK,CACf,SACA,YACA,cACA,WACA,WACA,YACF,CAAC,EACD,MAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAG,EAAE,OAAO,CAAC,CAAC,CACzC,CAAC,ECXY,EAAoB,EAAE,OAAO,CACxC,SAAU,EAAE,KAAK,CAAC,SAAU,OAAO,CAAC,CAAC,CAAC,QAAQ,OAAO,EACrD,UAAW,EAAE,OAAO,CAAC,CAAC,QAAQ;CAAI,CAAC,CAAC,SAAS,EAC7C,WAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CACjD,CAAC,ECJY,EAAwB,EAAE,OAAO,CAC5C,YAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EACrC,SAAU,EAAE,KAAK,CAAC,OAAQ,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,CACpD,CAAC,ECHY,EAAkB,EAAE,OAAO,CACtC,QAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,aAAa,EACzC,gBAAiB,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAK,EAC1C,WAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CACjD,CAAC"}
|
|
@@ -51,4 +51,4 @@ declare const zipParamsSchema: z.ZodObject<{
|
|
|
51
51
|
type ZipParams = z.infer<typeof zipParamsSchema>;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { MergeParams as a, conditionalParamsSchema as c, multiplexParamsSchema as i, zipParamsSchema as n, mergeParamsSchema as o, MultiplexParams as r, ConditionalParams as s, ZipParams as t };
|
|
54
|
-
//# sourceMappingURL=zip-node-
|
|
54
|
+
//# sourceMappingURL=zip-node-DpgHSX69.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip-node-DpgHSX69.d.cts","names":[],"sources":["../src/types/conditional-node.ts","../src/types/merge-node.ts","../src/types/multiplex-node.ts","../src/types/zip-node.ts"],"mappings":";;;cAEa,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;KAaxB,iBAAA,GAAoB,CAAA,CAAE,KAAK,QAAQ,uBAAA;;;cCblC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;KAMlB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;;;cCN5B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;KAKtB,eAAA,GAAkB,CAAA,CAAE,KAAK,QAAQ,qBAAA;;;cCLhC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;KAMhB,SAAA,GAAY,CAAA,CAAE,KAAK,QAAQ,eAAA"}
|
|
@@ -51,4 +51,4 @@ declare const zipParamsSchema: z.ZodObject<{
|
|
|
51
51
|
type ZipParams = z.infer<typeof zipParamsSchema>;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { MergeParams as a, conditionalParamsSchema as c, multiplexParamsSchema as i, zipParamsSchema as n, mergeParamsSchema as o, MultiplexParams as r, ConditionalParams as s, ZipParams as t };
|
|
54
|
-
//# sourceMappingURL=zip-node-
|
|
54
|
+
//# sourceMappingURL=zip-node-DpgHSX69.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip-node-DpgHSX69.d.mts","names":[],"sources":["../src/types/conditional-node.ts","../src/types/merge-node.ts","../src/types/multiplex-node.ts","../src/types/zip-node.ts"],"mappings":";;;cAEa,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;KAaxB,iBAAA,GAAoB,CAAA,CAAE,KAAK,QAAQ,uBAAA;;;cCblC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;KAMlB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;;;cCN5B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;KAKtB,eAAA,GAAkB,CAAA,CAAE,KAAK,QAAQ,qBAAA;;;cCLhC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;KAMhB,SAAA,GAAY,CAAA,CAAE,KAAK,QAAQ,eAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/flow-utility-nodes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.4",
|
|
5
5
|
"description": "Utility nodes for Uploadista Flow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@uploadista/core": "1.0.0-beta.
|
|
23
|
+
"@uploadista/core": "1.0.0-beta.4"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"effect": "^3.0.0",
|
|
27
27
|
"zod": "^4.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@effect/vitest": "0.
|
|
30
|
+
"@effect/vitest": "0.29.0",
|
|
31
31
|
"@types/node": "24.10.9",
|
|
32
|
-
"effect": "3.
|
|
33
|
-
"tsdown": "0.
|
|
32
|
+
"effect": "3.21.4",
|
|
33
|
+
"tsdown": "0.22.3",
|
|
34
34
|
"vitest": "4.0.18",
|
|
35
|
-
"zod": "4.3
|
|
36
|
-
"@uploadista/typescript-config": "1.0.0-beta.
|
|
35
|
+
"zod": "4.4.3",
|
|
36
|
+
"@uploadista/typescript-config": "1.0.0-beta.4"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc --noEmit && tsdown",
|
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip-node-BBj1lGeU.d.mts","names":[],"sources":["../src/types/conditional-node.ts","../src/types/merge-node.ts","../src/types/multiplex-node.ts","../src/types/zip-node.ts"],"mappings":";;;cAEa,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;KAaxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA;;;cCblC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;KAMlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;;;cCN5B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;KAKtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;;;cCLhC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;KAMhB,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip-node-D-UE9ml-.d.cts","names":[],"sources":["../src/types/conditional-node.ts","../src/types/merge-node.ts","../src/types/multiplex-node.ts","../src/types/zip-node.ts"],"mappings":";;;cAEa,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;KAaxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA;;;cCblC,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;KAMlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;;;cCN5B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;KAKtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;;;cCLhC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;KAMhB,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA"}
|