@uploadista/core 0.0.13-beta.5 → 0.0.13

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.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/dist/{checksum-P9C2JlRk.mjs → checksum-CtOagryS.mjs} +2 -2
  3. package/dist/{checksum-P9C2JlRk.mjs.map → checksum-CtOagryS.mjs.map} +1 -1
  4. package/dist/errors/index.d.cts +2 -2
  5. package/dist/errors/index.d.mts +2 -2
  6. package/dist/errors/index.mjs +1 -1
  7. package/dist/flow/index.cjs +1 -1
  8. package/dist/flow/index.d.cts +5 -5
  9. package/dist/flow/index.d.mts +5 -5
  10. package/dist/flow/index.mjs +1 -1
  11. package/dist/{flow-DkTE3siV.cjs → flow-ChADffZ5.cjs} +1 -1
  12. package/dist/{flow-IgE8hj7H.mjs → flow-_J9-Dm_m.mjs} +2 -2
  13. package/dist/flow-_J9-Dm_m.mjs.map +1 -0
  14. package/dist/{index-CrZopnP9.d.cts → index-4VDJDcWM.d.cts} +227 -241
  15. package/dist/index-4VDJDcWM.d.cts.map +1 -0
  16. package/dist/{index-BPBI84iT.d.mts → index-Bi9YYid8.d.mts} +2 -2
  17. package/dist/{index-BPBI84iT.d.mts.map → index-Bi9YYid8.d.mts.map} +1 -1
  18. package/dist/{index-BteFEg-c.d.mts → index-Cbf1OPLp.d.mts} +2 -2
  19. package/dist/{index-BteFEg-c.d.mts.map → index-Cbf1OPLp.d.mts.map} +1 -1
  20. package/dist/{index-DMfADSSJ.d.cts → index-De4wQJwR.d.cts} +2 -2
  21. package/dist/{index-DMfADSSJ.d.cts.map → index-De4wQJwR.d.cts.map} +1 -1
  22. package/dist/{index-DHt7Ht_J.d.mts → index-RgOX4psL.d.mts} +305 -139
  23. package/dist/index-RgOX4psL.d.mts.map +1 -0
  24. package/dist/{index-DubOIur4.d.cts → index-qZ90PVNl.d.cts} +2 -2
  25. package/dist/index-qZ90PVNl.d.cts.map +1 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.cts +5 -5
  28. package/dist/index.d.mts +5 -5
  29. package/dist/index.mjs +1 -1
  30. package/dist/{stream-limiter-DFtRZczp.mjs → stream-limiter-D9KSAaoY.mjs} +2 -2
  31. package/dist/{stream-limiter-DFtRZczp.mjs.map → stream-limiter-D9KSAaoY.mjs.map} +1 -1
  32. package/dist/streams/index.d.cts +2 -2
  33. package/dist/streams/index.d.mts +2 -2
  34. package/dist/streams/index.mjs +1 -1
  35. package/dist/testing/index.cjs +1 -0
  36. package/dist/testing/index.d.cts +110 -0
  37. package/dist/testing/index.d.cts.map +1 -0
  38. package/dist/testing/index.d.mts +110 -0
  39. package/dist/testing/index.d.mts.map +1 -0
  40. package/dist/testing/index.mjs +2 -0
  41. package/dist/testing/index.mjs.map +1 -0
  42. package/dist/types/index.d.cts +5 -5
  43. package/dist/types/index.d.mts +5 -5
  44. package/dist/types/index.mjs +1 -1
  45. package/dist/{types-DGZ892my.mjs → types-BI_KmpTc.mjs} +2 -2
  46. package/dist/types-BI_KmpTc.mjs.map +1 -0
  47. package/dist/upload/index.d.cts +5 -5
  48. package/dist/upload/index.d.mts +5 -5
  49. package/dist/upload/index.mjs +1 -1
  50. package/dist/{upload-DJTptYqV.mjs → upload-Yj5lrtZo.mjs} +2 -2
  51. package/dist/{upload-DJTptYqV.mjs.map → upload-Yj5lrtZo.mjs.map} +1 -1
  52. package/dist/{uploadista-error-9yLWP7TC.d.cts → uploadista-error-BQLhNZcY.d.cts} +1 -1
  53. package/dist/{uploadista-error-9yLWP7TC.d.cts.map → uploadista-error-BQLhNZcY.d.cts.map} +1 -1
  54. package/dist/{uploadista-error-nZ_q-EZy.mjs → uploadista-error-Buscq-FR.mjs} +1 -1
  55. package/dist/{uploadista-error-nZ_q-EZy.mjs.map → uploadista-error-Buscq-FR.mjs.map} +1 -1
  56. package/dist/{uploadista-error-CBkvsyZ3.d.mts → uploadista-error-DUWw6OqS.d.mts} +1 -1
  57. package/dist/{uploadista-error-CBkvsyZ3.d.mts.map → uploadista-error-DUWw6OqS.d.mts.map} +1 -1
  58. package/dist/utils/index.d.cts +2 -2
  59. package/dist/utils/index.d.mts +2 -2
  60. package/dist/utils/index.mjs +1 -1
  61. package/dist/{utils-BicUw_lt.mjs → utils-BWiu6lqv.mjs} +2 -2
  62. package/dist/{utils-BicUw_lt.mjs.map → utils-BWiu6lqv.mjs.map} +1 -1
  63. package/package.json +14 -6
  64. package/src/flow/node.ts +4 -4
  65. package/src/flow/nodes/transform-node.ts +23 -2
  66. package/src/flow/plugins/credential-provider.ts +1 -1
  67. package/src/flow/plugins/image-ai-plugin.ts +1 -1
  68. package/src/flow/plugins/image-plugin.ts +1 -1
  69. package/src/flow/plugins/video-plugin.ts +1 -1
  70. package/src/flow/plugins/zip-plugin.ts +1 -1
  71. package/src/flow/types/type-utils.ts +14 -3
  72. package/src/testing/index.ts +14 -0
  73. package/src/testing/mock-image-ai-plugin.ts +33 -0
  74. package/src/testing/mock-image-plugin.ts +56 -0
  75. package/src/testing/mock-upload-server.ts +176 -0
  76. package/src/testing/mock-video-plugin.ts +94 -0
  77. package/src/testing/mock-zip-plugin.ts +41 -0
  78. package/src/types/data-store.ts +1 -1
  79. package/{src/errors/__tests__ → tests/errors}/uploadista-error.test.ts +23 -19
  80. package/{src → tests}/flow/edge.test.ts +1 -1
  81. package/tests/flow/flow.test.ts +853 -0
  82. package/tests/flow/node.test.ts +757 -0
  83. package/{src → tests}/streams/stream-limiter.test.ts +2 -2
  84. package/tests/types/typed-event-emitter.test.ts +282 -0
  85. package/{src → tests}/utils/debounce.test.ts +1 -1
  86. package/{src → tests}/utils/once.test.ts +1 -1
  87. package/tests/utils/test-layers.ts +183 -0
  88. package/{src → tests}/utils/throttle.test.ts +1 -1
  89. package/tsdown.config.ts +1 -0
  90. package/type-tests/flow.test-d.ts +93 -0
  91. package/type-tests/type-utils.test-d.ts +104 -51
  92. package/vitest.config.ts +19 -1
  93. package/dist/flow-IgE8hj7H.mjs.map +0 -1
  94. package/dist/index-CrZopnP9.d.cts.map +0 -1
  95. package/dist/index-DHt7Ht_J.d.mts.map +0 -1
  96. package/dist/index-DubOIur4.d.cts.map +0 -1
  97. package/dist/types-DGZ892my.mjs.map +0 -1
  98. /package/dist/{errors-C0zLx77t.mjs → errors-DEFjN-xn.mjs} +0 -0
  99. /package/dist/{index-BtBZHVmz.d.cts → index-C-svZlpj.d.mts} +0 -0
  100. /package/dist/{index-DEHBdV_z.d.mts → index-_wQ5ClJU.d.cts} +0 -0
  101. /package/dist/{streams-CJKKIAwy.mjs → streams-DPU17bYp.mjs} +0 -0
@@ -1,8 +1,9 @@
1
- import { n as UploadistaError$1 } from "./uploadista-error-CBkvsyZ3.mjs";
2
- import { l as GenerateId, p as GenerateIdShape } from "./index-BteFEg-c.mjs";
1
+ import { n as UploadistaError } from "./uploadista-error-DUWw6OqS.mjs";
2
+ import { l as GenerateId, p as GenerateIdShape } from "./index-Cbf1OPLp.mjs";
3
3
  import { Context, Effect, Layer, Option, Stream } from "effect";
4
+ import * as zod0 from "zod";
4
5
  import z$1, { z } from "zod";
5
- import { UploadistaError } from "@uploadista/core/errors";
6
+ import * as zod_v4_core0 from "zod/v4/core";
6
7
 
7
8
  //#region src/flow/node.d.ts
8
9
  /**
@@ -97,7 +98,7 @@ type ConditionValue = string | number;
97
98
  * });
98
99
  * ```
99
100
  */
100
- declare function createFlowNode<Input, Output>({
101
+ declare function createFlowNode<Input, Output, TType extends NodeType = NodeType>({
101
102
  id,
102
103
  name,
103
104
  description,
@@ -114,7 +115,7 @@ declare function createFlowNode<Input, Output>({
114
115
  id: string;
115
116
  name: string;
116
117
  description: string;
117
- type: NodeType;
118
+ type: TType;
118
119
  inputSchema: z.ZodSchema<Input>;
119
120
  outputSchema: z.ZodSchema<Output>;
120
121
  run: (args: {
@@ -123,7 +124,7 @@ declare function createFlowNode<Input, Output>({
123
124
  storageId: string;
124
125
  flowId: string;
125
126
  clientId: string | null;
126
- }) => Effect.Effect<NodeExecutionResult<Output>, UploadistaError$1>;
127
+ }) => Effect.Effect<NodeExecutionResult<Output>, UploadistaError>;
127
128
  condition?: {
128
129
  field: ConditionField;
129
130
  operator: ConditionOperator;
@@ -137,7 +138,9 @@ declare function createFlowNode<Input, Output>({
137
138
  retryDelay?: number;
138
139
  exponentialBackoff?: boolean;
139
140
  };
140
- }): Effect.Effect<FlowNode<Input, Output, UploadistaError$1>>;
141
+ }): Effect.Effect<FlowNode<Input, Output, UploadistaError> & {
142
+ type: TType;
143
+ }>;
141
144
  /**
142
145
  * Extracts serializable node metadata from a FlowNode instance.
143
146
  *
@@ -148,7 +151,7 @@ declare function createFlowNode<Input, Output>({
148
151
  * @param node - The flow node to extract data from
149
152
  * @returns A plain object containing the node's metadata (id, name, description, type)
150
153
  */
151
- declare const getNodeData: (node: FlowNode<any, any, UploadistaError$1>) => FlowNodeData;
154
+ declare const getNodeData: (node: FlowNode<any, any, UploadistaError>) => FlowNodeData;
152
155
  //#endregion
153
156
  //#region src/flow/event.d.ts
154
157
  /**
@@ -515,7 +518,7 @@ declare const waitingNodeExecution: (partialData?: unknown) => {
515
518
  * @see {@link NodeExecutionResult} for return type options
516
519
  * @see {@link FlowCondition} for conditional execution
517
520
  */
518
- type FlowNode<TInput = unknown, TOutput = unknown, TError$1 = UploadistaError$1> = FlowNodeData & {
521
+ type FlowNode<TInput = unknown, TOutput = unknown, TError$1 = UploadistaError> = FlowNodeData & {
519
522
  inputSchema: z.ZodSchema<TInput>;
520
523
  outputSchema: z.ZodSchema<TOutput>;
521
524
  run: (args: {
@@ -664,15 +667,15 @@ type NodeConnectionValidator = {
664
667
  type FlowConfig<TFlowInputSchema extends z.ZodSchema<any>, TFlowOutputSchema extends z.ZodSchema<any>, TNodeError = never, TNodeRequirements = never> = {
665
668
  flowId: string;
666
669
  name: string;
667
- nodes: Array<FlowNode<any, any, UploadistaError$1> | Effect.Effect<FlowNode<any, any, UploadistaError$1>, TNodeError, TNodeRequirements>>;
670
+ nodes: Array<FlowNode<any, any, UploadistaError> | Effect.Effect<FlowNode<any, any, UploadistaError>, TNodeError, TNodeRequirements>>;
668
671
  edges: FlowEdge$1[];
669
672
  inputSchema: TFlowInputSchema;
670
673
  outputSchema: TFlowOutputSchema;
671
674
  typeChecker?: TypeCompatibilityChecker;
672
675
  onEvent?: (event: FlowEvent) => Effect.Effect<{
673
676
  eventId: string | null;
674
- }, UploadistaError$1>;
675
- checkJobStatus?: (jobId: string) => Effect.Effect<"running" | "paused" | "cancelled", UploadistaError$1>;
677
+ }, UploadistaError>;
678
+ checkJobStatus?: (jobId: string) => Effect.Effect<"running" | "paused" | "cancelled", UploadistaError>;
676
679
  parallelExecution?: {
677
680
  enabled?: boolean;
678
681
  maxConcurrency?: number;
@@ -848,7 +851,7 @@ type FlowExecutionResult<TOutput> = {
848
851
  type Flow<TFlowInputSchema extends z.ZodSchema<any>, TFlowOutputSchema extends z.ZodSchema<any>, TRequirements> = {
849
852
  id: string;
850
853
  name: string;
851
- nodes: FlowNode<any, any, UploadistaError$1>[];
854
+ nodes: FlowNode<any, any, UploadistaError>[];
852
855
  edges: FlowEdge[];
853
856
  inputSchema: TFlowInputSchema;
854
857
  outputSchema: TFlowOutputSchema;
@@ -859,7 +862,7 @@ type Flow<TFlowInputSchema extends z.ZodSchema<any>, TFlowOutputSchema extends z
859
862
  storageId: string;
860
863
  jobId: string;
861
864
  clientId: string | null;
862
- }) => Effect.Effect<FlowExecutionResult<Record<string, z.infer<TFlowOutputSchema>>>, UploadistaError$1, TRequirements>;
865
+ }) => Effect.Effect<FlowExecutionResult<Record<string, z.infer<TFlowOutputSchema>>>, UploadistaError, TRequirements>;
863
866
  resume: (args: {
864
867
  jobId: string;
865
868
  storageId: string;
@@ -870,7 +873,7 @@ type Flow<TFlowInputSchema extends z.ZodSchema<any>, TFlowOutputSchema extends z
870
873
  inputs: Record<string, z.infer<TFlowInputSchema>>;
871
874
  };
872
875
  clientId: string | null;
873
- }) => Effect.Effect<FlowExecutionResult<Record<string, z.infer<TFlowOutputSchema>>>, UploadistaError$1, TRequirements>;
876
+ }) => Effect.Effect<FlowExecutionResult<Record<string, z.infer<TFlowOutputSchema>>>, UploadistaError, TRequirements>;
874
877
  validateTypes: () => {
875
878
  isValid: boolean;
876
879
  errors: string[];
@@ -1140,10 +1143,10 @@ type UploadFile = {
1140
1143
  * ```
1141
1144
  */
1142
1145
  interface BaseKvStore {
1143
- readonly get: (key: string) => Effect.Effect<string | null, UploadistaError$1>;
1144
- readonly set: (key: string, value: string) => Effect.Effect<void, UploadistaError$1>;
1145
- readonly delete: (key: string) => Effect.Effect<void, UploadistaError$1>;
1146
- readonly list?: (keyPrefix: string) => Effect.Effect<Array<string>, UploadistaError$1>;
1146
+ readonly get: (key: string) => Effect.Effect<string | null, UploadistaError>;
1147
+ readonly set: (key: string, value: string) => Effect.Effect<void, UploadistaError>;
1148
+ readonly delete: (key: string) => Effect.Effect<void, UploadistaError>;
1149
+ readonly list?: (keyPrefix: string) => Effect.Effect<Array<string>, UploadistaError>;
1147
1150
  }
1148
1151
  /**
1149
1152
  * Type-safe key-value store interface with automatic serialization.
@@ -1187,10 +1190,10 @@ interface BaseKvStore {
1187
1190
  * ```
1188
1191
  */
1189
1192
  type KvStore<TData> = {
1190
- readonly get: (key: string) => Effect.Effect<TData, UploadistaError$1>;
1191
- readonly set: (key: string, value: TData) => Effect.Effect<void, UploadistaError$1>;
1192
- readonly delete: (key: string) => Effect.Effect<void, UploadistaError$1>;
1193
- readonly list?: () => Effect.Effect<Array<string>, UploadistaError$1>;
1193
+ readonly get: (key: string) => Effect.Effect<TData, UploadistaError>;
1194
+ readonly set: (key: string, value: TData) => Effect.Effect<void, UploadistaError>;
1195
+ readonly delete: (key: string) => Effect.Effect<void, UploadistaError>;
1196
+ readonly list?: () => Effect.Effect<Array<string>, UploadistaError>;
1194
1197
  };
1195
1198
  /**
1196
1199
  * Typed wrapper class that adds serialization to a BaseKvStore.
@@ -1236,10 +1239,10 @@ declare class TypedKvStore<TData> implements KvStore<TData> {
1236
1239
  private serialize;
1237
1240
  private deserialize;
1238
1241
  constructor(baseStore: BaseKvStore, keyPrefix: string, serialize: (data: TData) => string, deserialize: (str: string) => TData);
1239
- get: (key: string) => Effect.Effect<TData, UploadistaError$1>;
1240
- set: (key: string, value: TData) => Effect.Effect<void, UploadistaError$1>;
1241
- delete: (key: string) => Effect.Effect<void, UploadistaError$1>;
1242
- list: () => Effect.Effect<Array<string>, UploadistaError$1>;
1242
+ get: (key: string) => Effect.Effect<TData, UploadistaError>;
1243
+ set: (key: string, value: TData) => Effect.Effect<void, UploadistaError>;
1244
+ delete: (key: string) => Effect.Effect<void, UploadistaError>;
1245
+ list: () => Effect.Effect<Array<string>, UploadistaError>;
1243
1246
  }
1244
1247
  /**
1245
1248
  * Default JSON serialization helpers.
@@ -1385,7 +1388,7 @@ declare const flowJobKvStore: Layer.Layer<FlowJobKVStore, never, BaseKvStoreServ
1385
1388
  */
1386
1389
  type DataStoreWriteOptions = {
1387
1390
  file_id: string;
1388
- stream: Stream.Stream<Uint8Array, UploadistaError$1>;
1391
+ stream: Stream.Stream<Uint8Array, UploadistaError>;
1389
1392
  offset: number;
1390
1393
  };
1391
1394
  /**
@@ -1517,13 +1520,13 @@ type DataStoreCapabilities = {
1517
1520
  type DataStore<TData = unknown> = {
1518
1521
  readonly bucket?: string;
1519
1522
  readonly path?: string;
1520
- readonly create: (file: TData) => Effect.Effect<TData, UploadistaError$1>;
1521
- readonly remove: (file_id: string) => Effect.Effect<void, UploadistaError$1>;
1522
- readonly read: (file_id: string) => Effect.Effect<Uint8Array, UploadistaError$1>;
1523
+ readonly create: (file: TData) => Effect.Effect<TData, UploadistaError>;
1524
+ readonly remove: (file_id: string) => Effect.Effect<void, UploadistaError>;
1525
+ readonly read: (file_id: string) => Effect.Effect<Uint8Array, UploadistaError>;
1523
1526
  readonly write: (options: DataStoreWriteOptions, dependencies: {
1524
1527
  onProgress?: (chunkSize: number) => void;
1525
- }) => Effect.Effect<number, UploadistaError$1>;
1526
- readonly deleteExpired?: Effect.Effect<number, UploadistaError$1>;
1528
+ }) => Effect.Effect<number, UploadistaError>;
1529
+ readonly deleteExpired?: () => Effect.Effect<number, UploadistaError>;
1527
1530
  readonly getCapabilities: () => DataStoreCapabilities;
1528
1531
  readonly validateUploadStrategy: (strategy: UploadStrategy) => Effect.Effect<boolean, never>;
1529
1532
  };
@@ -1572,8 +1575,8 @@ declare class BufferedUploadFileDataStore extends BufferedUploadFileDataStore_ba
1572
1575
  * @property bufferedDataStore - Optional temporary storage for intermediate files
1573
1576
  */
1574
1577
  type UploadFileDataStoresShape = {
1575
- getDataStore: (storageId: string, clientId: string | null) => Effect.Effect<DataStore<UploadFile>, UploadistaError$1>;
1576
- bufferedDataStore: Effect.Effect<DataStore<UploadFile> | undefined, UploadistaError$1>;
1578
+ getDataStore: (storageId: string, clientId: string | null) => Effect.Effect<DataStore<UploadFile>, UploadistaError>;
1579
+ bufferedDataStore: Effect.Effect<DataStore<UploadFile> | undefined, UploadistaError>;
1577
1580
  };
1578
1581
  declare const UploadFileDataStores_base: Context.TagClass<UploadFileDataStores, "UploadFileDataStores", UploadFileDataStoresShape>;
1579
1582
  /**
@@ -1693,15 +1696,15 @@ interface EventBroadcaster {
1693
1696
  /**
1694
1697
  * Publish a message to a channel
1695
1698
  */
1696
- readonly publish: (channel: string, message: string) => Effect.Effect<void, UploadistaError$1>;
1699
+ readonly publish: (channel: string, message: string) => Effect.Effect<void, UploadistaError>;
1697
1700
  /**
1698
1701
  * Subscribe to messages on a channel
1699
1702
  */
1700
- readonly subscribe: (channel: string, handler: (message: string) => void) => Effect.Effect<void, UploadistaError$1>;
1703
+ readonly subscribe: (channel: string, handler: (message: string) => void) => Effect.Effect<void, UploadistaError>;
1701
1704
  /**
1702
1705
  * Unsubscribe from a channel (optional - not all implementations may support)
1703
1706
  */
1704
- readonly unsubscribe?: (channel: string) => Effect.Effect<void, UploadistaError$1>;
1707
+ readonly unsubscribe?: (channel: string) => Effect.Effect<void, UploadistaError>;
1705
1708
  }
1706
1709
  declare const EventBroadcasterService_base: Context.TagClass<EventBroadcasterService, "EventBroadcaster", EventBroadcaster>;
1707
1710
  /**
@@ -2000,9 +2003,9 @@ type WebSocketMessage<TEvent = unknown> = z$1.infer<typeof webSocketMessageSchem
2000
2003
  * ```
2001
2004
  */
2002
2005
  interface BaseEventEmitter {
2003
- readonly subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1>;
2004
- readonly unsubscribe: (key: string) => Effect.Effect<void, UploadistaError$1>;
2005
- readonly emit: (key: string, event: string) => Effect.Effect<void, UploadistaError$1>;
2006
+ readonly subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError>;
2007
+ readonly unsubscribe: (key: string) => Effect.Effect<void, UploadistaError>;
2008
+ readonly emit: (key: string, event: string) => Effect.Effect<void, UploadistaError>;
2006
2009
  }
2007
2010
  /**
2008
2011
  * Type-safe event emitter interface with automatic serialization.
@@ -2039,9 +2042,9 @@ interface BaseEventEmitter {
2039
2042
  * ```
2040
2043
  */
2041
2044
  type EventEmitter<TEvent> = {
2042
- readonly subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1>;
2043
- readonly unsubscribe: (key: string) => Effect.Effect<void, UploadistaError$1>;
2044
- readonly emit: (key: string, event: TEvent) => Effect.Effect<void, UploadistaError$1>;
2045
+ readonly subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError>;
2046
+ readonly unsubscribe: (key: string) => Effect.Effect<void, UploadistaError>;
2047
+ readonly emit: (key: string, event: TEvent) => Effect.Effect<void, UploadistaError>;
2045
2048
  };
2046
2049
  /**
2047
2050
  * Typed wrapper class that adds event serialization to a BaseEventEmitter.
@@ -2092,9 +2095,9 @@ declare class TypedEventEmitter<TEvent> implements EventEmitter<TEvent> {
2092
2095
  private baseEmitter;
2093
2096
  private eventToMessage;
2094
2097
  constructor(baseEmitter: BaseEventEmitter, eventToMessage: (event: TEvent) => string);
2095
- subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1>;
2096
- unsubscribe: (key: string) => Effect.Effect<void, UploadistaError$1>;
2097
- emit: (key: string, event: TEvent) => Effect.Effect<void, UploadistaError$1>;
2098
+ subscribe: (key: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError>;
2099
+ unsubscribe: (key: string) => Effect.Effect<void, UploadistaError>;
2100
+ emit: (key: string, event: TEvent) => Effect.Effect<void, UploadistaError>;
2098
2101
  }
2099
2102
  /**
2100
2103
  * Default event-to-message serialization helper.
@@ -2457,7 +2460,7 @@ type MiddlewareContext = {
2457
2460
  type MiddlewareNext = () => Promise<Response>;
2458
2461
  type Middleware = (context: MiddlewareContext, next: MiddlewareNext) => Promise<Response>;
2459
2462
  declare const MiddlewareService_base: Context.TagClass<MiddlewareService, "MiddlewareService", {
2460
- readonly execute: (middlewares: Middleware[], context: MiddlewareContext, handler: MiddlewareNext) => Effect.Effect<Response, UploadistaError$1>;
2463
+ readonly execute: (middlewares: Middleware[], context: MiddlewareContext, handler: MiddlewareNext) => Effect.Effect<Response, UploadistaError>;
2461
2464
  }>;
2462
2465
  declare class MiddlewareService extends MiddlewareService_base {}
2463
2466
  declare const MiddlewareServiceLive: Layer.Layer<MiddlewareService, never, never>;
@@ -2591,16 +2594,16 @@ type UploadServerOptions = {
2591
2594
  * ```
2592
2595
  */
2593
2596
  type UploadServerShape = {
2594
- createUpload: (inputFile: InputFile, clientId: string | null) => Effect.Effect<UploadFile, UploadistaError$1>;
2595
- uploadChunk: (uploadId: string, clientId: string | null, chunk: ReadableStream) => Effect.Effect<UploadFile, UploadistaError$1>;
2596
- getCapabilities: (storageId: string, clientId: string | null) => Effect.Effect<DataStoreCapabilities, UploadistaError$1>;
2597
- upload: (file: InputFile, clientId: string | null, stream: ReadableStream) => Effect.Effect<UploadFile, UploadistaError$1>;
2598
- uploadFromUrl: (inputFile: InputFile, clientId: string | null, url: string) => Effect.Effect<UploadFile, UploadistaError$1>;
2599
- getUpload: (uploadId: string) => Effect.Effect<UploadFile, UploadistaError$1>;
2600
- read: (uploadId: string, clientId: string | null) => Effect.Effect<Uint8Array, UploadistaError$1>;
2601
- delete: (uploadId: string, clientId: string | null) => Effect.Effect<void, UploadistaError$1>;
2602
- subscribeToUploadEvents: (uploadId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1>;
2603
- unsubscribeFromUploadEvents: (uploadId: string) => Effect.Effect<void, UploadistaError$1>;
2597
+ createUpload: (inputFile: InputFile, clientId: string | null) => Effect.Effect<UploadFile, UploadistaError>;
2598
+ uploadChunk: (uploadId: string, clientId: string | null, chunk: ReadableStream) => Effect.Effect<UploadFile, UploadistaError>;
2599
+ getCapabilities: (storageId: string, clientId: string | null) => Effect.Effect<DataStoreCapabilities, UploadistaError>;
2600
+ upload: (file: InputFile, clientId: string | null, stream: ReadableStream) => Effect.Effect<UploadFile, UploadistaError>;
2601
+ uploadFromUrl: (inputFile: InputFile, clientId: string | null, url: string) => Effect.Effect<UploadFile, UploadistaError>;
2602
+ getUpload: (uploadId: string) => Effect.Effect<UploadFile, UploadistaError>;
2603
+ read: (uploadId: string, clientId: string | null) => Effect.Effect<Uint8Array, UploadistaError>;
2604
+ delete: (uploadId: string, clientId: string | null) => Effect.Effect<void, UploadistaError>;
2605
+ subscribeToUploadEvents: (uploadId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError>;
2606
+ unsubscribeFromUploadEvents: (uploadId: string) => Effect.Effect<void, UploadistaError>;
2604
2607
  };
2605
2608
  declare const UploadServer_base: Context.TagClass<UploadServer, "UploadServer", UploadServerShape>;
2606
2609
  /**
@@ -2659,16 +2662,16 @@ declare class UploadServer extends UploadServer_base {}
2659
2662
  * ```
2660
2663
  */
2661
2664
  declare function createUploadServer(): Effect.Effect<{
2662
- upload: (inputFile: InputFile, clientId: string | null, stream: ReadableStream) => Effect.Effect<UploadFile, UploadistaError$1, never>;
2663
- uploadFromUrl: (inputFile: InputFile, clientId: string | null, url: string) => Effect.Effect<UploadFile, UploadistaError$1, never>;
2664
- createUpload: (inputFile: InputFile, clientId: string | null) => Effect.Effect<UploadFile, UploadistaError$1, never>;
2665
- uploadChunk: (uploadId: string, clientId: string | null, chunk: ReadableStream) => Effect.Effect<UploadFile, UploadistaError$1, never>;
2666
- getUpload: (uploadId: string) => Effect.Effect<UploadFile, UploadistaError$1, never>;
2667
- read: (uploadId: string, clientId: string | null) => Effect.Effect<Uint8Array<ArrayBufferLike>, UploadistaError$1, never>;
2668
- delete: (uploadId: string, clientId: string | null) => Effect.Effect<void, UploadistaError$1, never>;
2669
- getCapabilities: (storageId: string, clientId: string | null) => Effect.Effect<DataStoreCapabilities, UploadistaError$1, never>;
2670
- subscribeToUploadEvents: (uploadId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1, never>;
2671
- unsubscribeFromUploadEvents: (uploadId: string) => Effect.Effect<void, UploadistaError$1, never>;
2665
+ upload: (inputFile: InputFile, clientId: string | null, stream: ReadableStream) => Effect.Effect<UploadFile, UploadistaError, never>;
2666
+ uploadFromUrl: (inputFile: InputFile, clientId: string | null, url: string) => Effect.Effect<UploadFile, UploadistaError, never>;
2667
+ createUpload: (inputFile: InputFile, clientId: string | null) => Effect.Effect<UploadFile, UploadistaError, never>;
2668
+ uploadChunk: (uploadId: string, clientId: string | null, chunk: ReadableStream) => Effect.Effect<UploadFile, UploadistaError, never>;
2669
+ getUpload: (uploadId: string) => Effect.Effect<UploadFile, UploadistaError, never>;
2670
+ read: (uploadId: string, clientId: string | null) => Effect.Effect<Uint8Array<ArrayBufferLike>, UploadistaError, never>;
2671
+ delete: (uploadId: string, clientId: string | null) => Effect.Effect<void, UploadistaError, never>;
2672
+ getCapabilities: (storageId: string, clientId: string | null) => Effect.Effect<DataStoreCapabilities, UploadistaError, never>;
2673
+ subscribeToUploadEvents: (uploadId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError, never>;
2674
+ unsubscribeFromUploadEvents: (uploadId: string) => Effect.Effect<void, UploadistaError, never>;
2672
2675
  }, never, UploadFileDataStores | UploadFileKVStore | UploadEventEmitter | GenerateId>;
2673
2676
  /**
2674
2677
  * Pre-built UploadServer Effect Layer.
@@ -3036,7 +3039,7 @@ declare class FlowWaitUntil extends FlowWaitUntil_base {
3036
3039
  * ```
3037
3040
  */
3038
3041
  type FlowProviderShape<TRequirements = any> = {
3039
- getFlow: (flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, TRequirements>, UploadistaError$1>;
3042
+ getFlow: (flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, TRequirements>, UploadistaError>;
3040
3043
  };
3041
3044
  declare const FlowProvider_base: Context.TagClass<FlowProvider, "FlowProvider", FlowProviderShape<any>>;
3042
3045
  /**
@@ -3142,8 +3145,8 @@ declare class FlowProvider extends FlowProvider_base {}
3142
3145
  * ```
3143
3146
  */
3144
3147
  type FlowServerShape = {
3145
- getFlow: <TRequirements>(flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, TRequirements>, UploadistaError$1>;
3146
- getFlowData: (flowId: string, clientId: string | null) => Effect.Effect<FlowData, UploadistaError$1>;
3148
+ getFlow: <TRequirements>(flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, TRequirements>, UploadistaError>;
3149
+ getFlowData: (flowId: string, clientId: string | null) => Effect.Effect<FlowData, UploadistaError>;
3147
3150
  runFlow: <TRequirements>({
3148
3151
  flowId,
3149
3152
  storageId,
@@ -3154,7 +3157,7 @@ type FlowServerShape = {
3154
3157
  storageId: string;
3155
3158
  clientId: string | null;
3156
3159
  inputs: any;
3157
- }) => Effect.Effect<FlowJob, UploadistaError$1, TRequirements>;
3160
+ }) => Effect.Effect<FlowJob, UploadistaError, TRequirements>;
3158
3161
  resumeFlow: <TRequirements>({
3159
3162
  jobId,
3160
3163
  nodeId,
@@ -3165,12 +3168,12 @@ type FlowServerShape = {
3165
3168
  nodeId: string;
3166
3169
  newData: unknown;
3167
3170
  clientId: string | null;
3168
- }) => Effect.Effect<FlowJob, UploadistaError$1, TRequirements>;
3169
- pauseFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError$1>;
3170
- cancelFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError$1>;
3171
- getJobStatus: (jobId: string) => Effect.Effect<FlowJob, UploadistaError$1>;
3172
- subscribeToFlowEvents: (jobId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1>;
3173
- unsubscribeFromFlowEvents: (jobId: string) => Effect.Effect<void, UploadistaError$1>;
3171
+ }) => Effect.Effect<FlowJob, UploadistaError, TRequirements>;
3172
+ pauseFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError>;
3173
+ cancelFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError>;
3174
+ getJobStatus: (jobId: string) => Effect.Effect<FlowJob, UploadistaError>;
3175
+ subscribeToFlowEvents: (jobId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError>;
3176
+ unsubscribeFromFlowEvents: (jobId: string) => Effect.Effect<void, UploadistaError>;
3174
3177
  };
3175
3178
  declare const FlowServer_base: Context.TagClass<FlowServer, "FlowServer", FlowServerShape>;
3176
3179
  /**
@@ -3222,8 +3225,8 @@ type FlowServerOptions = {
3222
3225
  kvStore: KvStore<FlowJob>;
3223
3226
  };
3224
3227
  declare function createFlowServer(): Effect.Effect<{
3225
- getFlow: <TRequirements>(flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, any>, UploadistaError$1, never>;
3226
- getFlowData: (flowId: string, clientId: string | null) => Effect.Effect<FlowData, UploadistaError$1, never>;
3228
+ getFlow: <TRequirements>(flowId: string, clientId: string | null) => Effect.Effect<Flow<any, any, any>, UploadistaError, never>;
3229
+ getFlowData: (flowId: string, clientId: string | null) => Effect.Effect<FlowData, UploadistaError, never>;
3227
3230
  runFlow: ({
3228
3231
  flowId,
3229
3232
  storageId,
@@ -3234,8 +3237,8 @@ declare function createFlowServer(): Effect.Effect<{
3234
3237
  storageId: string;
3235
3238
  clientId: string | null;
3236
3239
  inputs: unknown;
3237
- }) => Effect.Effect<FlowJob, UploadistaError$1, never>;
3238
- getJobStatus: (jobId: string) => Effect.Effect<FlowJob, UploadistaError$1, never>;
3240
+ }) => Effect.Effect<FlowJob, UploadistaError, never>;
3241
+ getJobStatus: (jobId: string) => Effect.Effect<FlowJob, UploadistaError, never>;
3239
3242
  resumeFlow: ({
3240
3243
  jobId,
3241
3244
  nodeId,
@@ -3246,11 +3249,11 @@ declare function createFlowServer(): Effect.Effect<{
3246
3249
  nodeId: string;
3247
3250
  newData: unknown;
3248
3251
  clientId: string | null;
3249
- }) => Effect.Effect<FlowJob, UploadistaError$1, never>;
3250
- pauseFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError$1, never>;
3251
- cancelFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError$1, never>;
3252
- subscribeToFlowEvents: (jobId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError$1, never>;
3253
- unsubscribeFromFlowEvents: (jobId: string) => Effect.Effect<void, UploadistaError$1, never>;
3252
+ }) => Effect.Effect<FlowJob, UploadistaError, never>;
3253
+ pauseFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError, never>;
3254
+ cancelFlow: (jobId: string, clientId: string | null) => Effect.Effect<FlowJob, UploadistaError, never>;
3255
+ subscribeToFlowEvents: (jobId: string, connection: WebSocketConnection) => Effect.Effect<void, UploadistaError, never>;
3256
+ unsubscribeFromFlowEvents: (jobId: string) => Effect.Effect<void, UploadistaError, never>;
3254
3257
  }, never, UploadServer | FlowEventEmitter | FlowJobKVStore | FlowProvider>;
3255
3258
  declare const flowServer: Layer.Layer<FlowServer, never, UploadServer | FlowEventEmitter | FlowJobKVStore | FlowProvider>;
3256
3259
  type FlowServerLayer = typeof flowServer;
@@ -3316,19 +3319,69 @@ type InputNodeParams = z.infer<typeof inputNodeParamsSchema>;
3316
3319
  * const openInputNode = yield* createInputNode("open-input");
3317
3320
  * ```
3318
3321
  */
3319
- declare function createInputNode(id: string, params?: InputNodeParams): Effect.Effect<FlowNode<{
3320
- operation: "init";
3321
- storageId: string;
3322
- metadata?: Record<string, any> | undefined;
3323
- } | {
3324
- operation: "finalize";
3325
- uploadId: string;
3326
- } | {
3327
- operation: "url";
3328
- url: string;
3329
- storageId?: string | undefined;
3330
- metadata?: Record<string, any> | undefined;
3331
- }, UploadFile, UploadistaError$1>, never, UploadServer>;
3322
+ declare function createInputNode(id: string, params?: InputNodeParams): Effect.Effect<FlowNodeData & {
3323
+ inputSchema: z.ZodType<{
3324
+ operation: "init";
3325
+ storageId: string;
3326
+ metadata?: Record<string, any> | undefined;
3327
+ } | {
3328
+ operation: "finalize";
3329
+ uploadId: string;
3330
+ } | {
3331
+ operation: "url";
3332
+ url: string;
3333
+ storageId?: string | undefined;
3334
+ metadata?: Record<string, any> | undefined;
3335
+ }, unknown, z.core.$ZodTypeInternals<{
3336
+ operation: "init";
3337
+ storageId: string;
3338
+ metadata?: Record<string, any> | undefined;
3339
+ } | {
3340
+ operation: "finalize";
3341
+ uploadId: string;
3342
+ } | {
3343
+ operation: "url";
3344
+ url: string;
3345
+ storageId?: string | undefined;
3346
+ metadata?: Record<string, any> | undefined;
3347
+ }, unknown>>;
3348
+ outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
3349
+ run: (args: {
3350
+ data: {
3351
+ operation: "init";
3352
+ storageId: string;
3353
+ metadata?: Record<string, any> | undefined;
3354
+ } | {
3355
+ operation: "finalize";
3356
+ uploadId: string;
3357
+ } | {
3358
+ operation: "url";
3359
+ url: string;
3360
+ storageId?: string | undefined;
3361
+ metadata?: Record<string, any> | undefined;
3362
+ };
3363
+ jobId: string;
3364
+ storageId: string;
3365
+ flowId: string;
3366
+ inputs?: Record<string, unknown>;
3367
+ clientId: string | null;
3368
+ }) => Effect.Effect<NodeExecutionResult<UploadFile>, UploadistaError, never>;
3369
+ condition?: {
3370
+ field: string;
3371
+ operator: string;
3372
+ value: unknown;
3373
+ };
3374
+ multiInput?: boolean;
3375
+ multiOutput?: boolean;
3376
+ pausable?: boolean;
3377
+ retry?: {
3378
+ maxRetries?: number;
3379
+ retryDelay?: number;
3380
+ exponentialBackoff?: boolean;
3381
+ };
3382
+ } & {
3383
+ type: NodeType.input;
3384
+ }, never, UploadServer>;
3332
3385
  //#endregion
3333
3386
  //#region src/flow/nodes/storage-node.d.ts
3334
3387
  /**
@@ -3369,34 +3422,114 @@ type StorageParams = z.infer<typeof storageParamsSchema>;
3369
3422
  * });
3370
3423
  * ```
3371
3424
  */
3372
- declare function createStorageNode(id: string, postProcessFile?: (file: UploadFile) => Effect.Effect<UploadFile>): Effect.Effect<FlowNode<{
3373
- id: string;
3374
- offset: number;
3375
- storage: {
3425
+ declare function createStorageNode(id: string, postProcessFile?: (file: UploadFile) => Effect.Effect<UploadFile>): Effect.Effect<FlowNodeData & {
3426
+ inputSchema: z.ZodType<{
3376
3427
  id: string;
3377
- type: string;
3378
- path?: string | undefined;
3379
- uploadId?: string | undefined;
3380
- bucket?: string | undefined;
3381
- parts?: {
3382
- partNumber: number;
3383
- etag: string;
3384
- size: number;
3385
- }[] | undefined;
3386
- };
3387
- size?: number | undefined;
3388
- metadata?: Record<string, string | number | boolean> | undefined;
3389
- creationDate?: string | undefined;
3390
- url?: string | undefined;
3391
- sizeIsDeferred?: boolean | undefined;
3392
- checksum?: string | undefined;
3393
- checksumAlgorithm?: string | undefined;
3394
- flow?: {
3395
- flowId: string;
3396
- nodeId: string;
3428
+ offset: number;
3429
+ storage: {
3430
+ id: string;
3431
+ type: string;
3432
+ path?: string | undefined;
3433
+ uploadId?: string | undefined;
3434
+ bucket?: string | undefined;
3435
+ parts?: {
3436
+ partNumber: number;
3437
+ etag: string;
3438
+ size: number;
3439
+ }[] | undefined;
3440
+ };
3441
+ size?: number | undefined;
3442
+ metadata?: Record<string, string | number | boolean> | undefined;
3443
+ creationDate?: string | undefined;
3444
+ url?: string | undefined;
3445
+ sizeIsDeferred?: boolean | undefined;
3446
+ checksum?: string | undefined;
3447
+ checksumAlgorithm?: string | undefined;
3448
+ flow?: {
3449
+ flowId: string;
3450
+ nodeId: string;
3451
+ jobId: string;
3452
+ } | undefined;
3453
+ }, unknown, z.core.$ZodTypeInternals<{
3454
+ id: string;
3455
+ offset: number;
3456
+ storage: {
3457
+ id: string;
3458
+ type: string;
3459
+ path?: string | undefined;
3460
+ uploadId?: string | undefined;
3461
+ bucket?: string | undefined;
3462
+ parts?: {
3463
+ partNumber: number;
3464
+ etag: string;
3465
+ size: number;
3466
+ }[] | undefined;
3467
+ };
3468
+ size?: number | undefined;
3469
+ metadata?: Record<string, string | number | boolean> | undefined;
3470
+ creationDate?: string | undefined;
3471
+ url?: string | undefined;
3472
+ sizeIsDeferred?: boolean | undefined;
3473
+ checksum?: string | undefined;
3474
+ checksumAlgorithm?: string | undefined;
3475
+ flow?: {
3476
+ flowId: string;
3477
+ nodeId: string;
3478
+ jobId: string;
3479
+ } | undefined;
3480
+ }, unknown>>;
3481
+ outputSchema: z.ZodType<UploadFile, unknown, z.core.$ZodTypeInternals<UploadFile, unknown>>;
3482
+ run: (args: {
3483
+ data: {
3484
+ id: string;
3485
+ offset: number;
3486
+ storage: {
3487
+ id: string;
3488
+ type: string;
3489
+ path?: string | undefined;
3490
+ uploadId?: string | undefined;
3491
+ bucket?: string | undefined;
3492
+ parts?: {
3493
+ partNumber: number;
3494
+ etag: string;
3495
+ size: number;
3496
+ }[] | undefined;
3497
+ };
3498
+ size?: number | undefined;
3499
+ metadata?: Record<string, string | number | boolean> | undefined;
3500
+ creationDate?: string | undefined;
3501
+ url?: string | undefined;
3502
+ sizeIsDeferred?: boolean | undefined;
3503
+ checksum?: string | undefined;
3504
+ checksumAlgorithm?: string | undefined;
3505
+ flow?: {
3506
+ flowId: string;
3507
+ nodeId: string;
3508
+ jobId: string;
3509
+ } | undefined;
3510
+ };
3397
3511
  jobId: string;
3398
- } | undefined;
3399
- }, UploadFile, UploadistaError$1>, never, UploadServer>;
3512
+ storageId: string;
3513
+ flowId: string;
3514
+ inputs?: Record<string, unknown>;
3515
+ clientId: string | null;
3516
+ }) => Effect.Effect<NodeExecutionResult<UploadFile>, UploadistaError, never>;
3517
+ condition?: {
3518
+ field: string;
3519
+ operator: string;
3520
+ value: unknown;
3521
+ };
3522
+ multiInput?: boolean;
3523
+ multiOutput?: boolean;
3524
+ pausable?: boolean;
3525
+ retry?: {
3526
+ maxRetries?: number;
3527
+ retryDelay?: number;
3528
+ exponentialBackoff?: boolean;
3529
+ };
3530
+ } & {
3531
+ type: NodeType.output;
3532
+ }, never, UploadServer>;
3400
3533
  //#endregion
3401
3534
  //#region src/flow/nodes/transform-node.d.ts
3402
3535
  /**
@@ -3414,7 +3547,7 @@ interface TransformNodeConfig {
3414
3547
  bytes: Uint8Array;
3415
3548
  type?: string;
3416
3549
  fileName?: string;
3417
- }, UploadistaError$1>;
3550
+ }, UploadistaError>;
3418
3551
  }
3419
3552
  /**
3420
3553
  * Creates a transform node that handles the common pattern of:
@@ -3461,7 +3594,33 @@ declare function createTransformNode({
3461
3594
  name,
3462
3595
  description,
3463
3596
  transform
3464
- }: TransformNodeConfig): Effect.Effect<FlowNode<UploadFile, UploadFile, UploadistaError$1>, never, UploadServer>;
3597
+ }: TransformNodeConfig): Effect.Effect<FlowNodeData & {
3598
+ inputSchema: zod0.ZodType<UploadFile, unknown, zod_v4_core0.$ZodTypeInternals<UploadFile, unknown>>;
3599
+ outputSchema: zod0.ZodType<UploadFile, unknown, zod_v4_core0.$ZodTypeInternals<UploadFile, unknown>>;
3600
+ run: (args: {
3601
+ data: UploadFile;
3602
+ jobId: string;
3603
+ storageId: string;
3604
+ flowId: string;
3605
+ inputs?: Record<string, unknown>;
3606
+ clientId: string | null;
3607
+ }) => Effect.Effect<NodeExecutionResult<UploadFile>, UploadistaError, never>;
3608
+ condition?: {
3609
+ field: string;
3610
+ operator: string;
3611
+ value: unknown;
3612
+ };
3613
+ multiInput?: boolean;
3614
+ multiOutput?: boolean;
3615
+ pausable?: boolean;
3616
+ retry?: {
3617
+ maxRetries?: number;
3618
+ retryDelay?: number;
3619
+ exponentialBackoff?: boolean;
3620
+ };
3621
+ } & {
3622
+ type: NodeType;
3623
+ }, never, UploadServer>;
3465
3624
  //#endregion
3466
3625
  //#region src/flow/parallel-scheduler.d.ts
3467
3626
  /**
@@ -3625,7 +3784,7 @@ interface CredentialProviderShape {
3625
3784
  getCredential: (params: {
3626
3785
  clientId: string | null;
3627
3786
  serviceType?: string;
3628
- }) => Effect.Effect<Record<string, unknown>, UploadistaError$1>;
3787
+ }) => Effect.Effect<Record<string, unknown>, UploadistaError>;
3629
3788
  }
3630
3789
  declare const CredentialProvider_base: Context.TagClass<CredentialProvider, "CredentialProvider", CredentialProviderShape>;
3631
3790
  /**
@@ -4532,7 +4691,7 @@ type ExtractLayerService<T, TError$1 = never, TRequirements = never> = T extends
4532
4691
  * the services they provide, combining them into a single union type.
4533
4692
  *
4534
4693
  * @template T - A readonly tuple of Layer types
4535
- * @returns A union of all service types provided by the layers
4694
+ * @returns A union of all service types provided by the layers, or never for empty tuples
4536
4695
  *
4537
4696
  * @example
4538
4697
  * ```typescript
@@ -4553,8 +4712,15 @@ type ExtractLayerService<T, TError$1 = never, TRequirements = never> = T extends
4553
4712
  * type AllServices = ExtractLayerServices<PluginLayers>;
4554
4713
  * // AllServices = ImagePlugin | ZipPlugin
4555
4714
  * ```
4715
+ *
4716
+ * @example
4717
+ * ```typescript
4718
+ * type EmptyLayers = [];
4719
+ * type NoServices = ExtractLayerServices<EmptyLayers>;
4720
+ * // NoServices = never
4721
+ * ```
4556
4722
  */
4557
- type ExtractLayerServices<T extends readonly Layer.Layer<any, any, any>[]> = T[number] extends Layer.Layer<infer S, any, any> ? S : never;
4723
+ type ExtractLayerServices<T extends readonly Layer.Layer<any, any, any>[]> = T extends readonly [] ? never : { [K in keyof T]: T[K] extends Layer.Layer<infer S, any, any> ? S : never }[number];
4558
4724
  /**
4559
4725
  * Unwraps an Effect type to extract its success value type.
4560
4726
  *
@@ -4646,7 +4812,7 @@ type ExtractEffectRequirements<T> = T extends Effect.Effect<any, any, infer R> ?
4646
4812
  * @template TNodeError - The error types that the node can produce
4647
4813
  * @template TNodeRequirements - The services/dependencies the node requires
4648
4814
  */
4649
- type NodeDefinition<TNodeError = never, TNodeRequirements = never> = FlowNode<any, any, UploadistaError$1> | Effect.Effect<FlowNode<any, any, UploadistaError$1>, TNodeError, TNodeRequirements>;
4815
+ type NodeDefinition<TNodeError = never, TNodeRequirements = never> = FlowNode<any, any, UploadistaError> | Effect.Effect<FlowNode<any, any, UploadistaError>, TNodeError, TNodeRequirements>;
4650
4816
  /**
4651
4817
  * A record mapping node IDs to their definitions.
4652
4818
  *
@@ -4669,7 +4835,7 @@ type NodeDefinitionsRecord = Record<string, NodeDefinition<any, any>>;
4669
4835
  * If the node is an Effect, extracts its error type.
4670
4836
  * If the node is a plain FlowNode, returns never (no errors).
4671
4837
  */
4672
- type NodeDefinitionError<T> = T extends Effect.Effect<FlowNode<any, any, UploadistaError$1>, infer TError, any> ? TError : never;
4838
+ type NodeDefinitionError<T> = T extends Effect.Effect<FlowNode<any, any, UploadistaError>, infer TError, any> ? TError : never;
4673
4839
  /**
4674
4840
  * Extracts the requirements (dependencies) from a NodeDefinition.
4675
4841
  *
@@ -4756,7 +4922,7 @@ type FlowPluginRequirements<TNodes extends NodeDefinitionsRecord> = Exclude<Flow
4756
4922
  *
4757
4923
  * Uses the shared ResolveEffect utility for consistency.
4758
4924
  */
4759
- type InferNode<T> = T extends FlowNode<any, any, UploadistaError$1> ? T : ResolveEffect<T> extends FlowNode<any, any, UploadistaError$1> ? ResolveEffect<T> : never;
4925
+ type InferNode<T> = T extends FlowNode<any, any, UploadistaError> ? T : ResolveEffect<T> extends FlowNode<any, any, UploadistaError> ? ResolveEffect<T> : never;
4760
4926
  type ExtractKeysByNodeType<TNodes extends NodeDefinitionsRecord, TType extends NodeType> = { [K in keyof TNodes]: InferNode<TNodes[K]>["type"] extends TType ? K : never }[keyof TNodes];
4761
4927
  type SchemaInfer<T> = T extends z.ZodTypeAny ? z.infer<T> : never;
4762
4928
  type FlowInputMap<TNodes extends NodeDefinitionsRecord> = { [K in Extract<ExtractKeysByNodeType<TNodes, NodeType.input>, string>]: SchemaInfer<InferNode<TNodes[K]>["inputSchema"]> };
@@ -4778,7 +4944,7 @@ type TypedFlowConfig<TNodes extends NodeDefinitionsRecord> = {
4778
4944
  typeChecker?: TypeCompatibilityChecker;
4779
4945
  onEvent?: (event: FlowEvent) => Effect.Effect<{
4780
4946
  eventId: string | null;
4781
- }, UploadistaError$1>;
4947
+ }, UploadistaError>;
4782
4948
  parallelExecution?: {
4783
4949
  enabled?: boolean;
4784
4950
  maxConcurrency?: number;
@@ -4828,7 +4994,7 @@ type TypedFlow<TNodes extends NodeDefinitionsRecord, TInputSchema extends z.ZodT
4828
4994
  inputs?: Partial<FlowInputMap<TNodes>>;
4829
4995
  storageId: string;
4830
4996
  jobId: string;
4831
- }) => Effect.Effect<FlowExecutionResult<FlowOutputMap<TNodes>>, UploadistaError$1, FlowRequirements<TNodes>>;
4997
+ }) => Effect.Effect<FlowExecutionResult<FlowOutputMap<TNodes>>, UploadistaError, FlowRequirements<TNodes>>;
4832
4998
  resume: (args: {
4833
4999
  jobId: string;
4834
5000
  storageId: string;
@@ -4838,12 +5004,12 @@ type TypedFlow<TNodes extends NodeDefinitionsRecord, TInputSchema extends z.ZodT
4838
5004
  currentIndex: number;
4839
5005
  inputs: Partial<FlowInputMap<TNodes>>;
4840
5006
  };
4841
- }) => Effect.Effect<FlowExecutionResult<FlowOutputMap<TNodes>>, UploadistaError$1, FlowRequirements<TNodes>>;
5007
+ }) => Effect.Effect<FlowExecutionResult<FlowOutputMap<TNodes>>, UploadistaError, FlowRequirements<TNodes>>;
4842
5008
  readonly [typedFlowInputsSymbol]?: FlowInputMap<TNodes>;
4843
5009
  readonly [typedFlowOutputsSymbol]?: FlowOutputMap<TNodes>;
4844
5010
  readonly [typedFlowPluginsSymbol]?: FlowPluginRequirements<TNodes>;
4845
5011
  };
4846
- declare function createFlow<TNodes extends NodeDefinitionsRecord>(config: TypedFlowConfig<TNodes>): Effect.Effect<TypedFlow<TNodes, z.ZodType<FlowInputUnion<TNodes>>, z.ZodType<FlowOutputUnion<TNodes>>>, NodesErrorUnion<TNodes> | UploadistaError$1, FlowRequirements<TNodes>>;
5012
+ declare function createFlow<TNodes extends NodeDefinitionsRecord>(config: TypedFlowConfig<TNodes>): Effect.Effect<TypedFlow<TNodes, z.ZodType<FlowInputUnion<TNodes>>, z.ZodType<FlowOutputUnion<TNodes>>>, NodesErrorUnion<TNodes> | UploadistaError, FlowRequirements<TNodes>>;
4847
5013
  //#endregion
4848
5014
  //#region src/flow/types/run-args.d.ts
4849
5015
  /**
@@ -4886,4 +5052,4 @@ type ResolvedUploadMetadata = {
4886
5052
  declare function resolveUploadMetadata(metadata: FileMetadata): ResolvedUploadMetadata;
4887
5053
  //#endregion
4888
5054
  export { LogoTransform as $, BaseKvStore as $n, FlowServerShape as $t, ZipPluginLayer as A, UploadEventEmitter as An, FlowEventFlowError as Ar, ImageAiPluginLayer as At, resizeVideoParamsSchema as B, EventBroadcaster as Bn, FlowEventNodeStart as Br, StorageParams as Bt, DescribeImageParams as C, InputFile as Cn, TypeCompatibilityChecker as Cr, watermarkTransformSchema as Ct, ZipInput as D, EventEmitter as Dn, FlowEvent as Dr, optimizeParamsSchema as Dt, PluginLayer as E, BaseEventEmitterService as En, EventType as Er, OptimizeParams as Et, TrimVideoParams as F, WebSocketMessage as Fn, FlowEventNodeEnd as Fr, ExecutionLevel as Ft, ImagePlugin as G, DataStoreConfig as Gn, createFlowNode as Gr, createInputNode as Gt, extractFrameVideoParamsSchema as H, BufferedUploadFileDataStore as Hn, ConditionOperator as Hr, storageParamsSchema as Ht, trimVideoParamsSchema as I, webSocketMessageSchema as In, FlowEventNodeError as Ir, ParallelScheduler as It, BlurTransform as J, UploadFileDataStores as Jn, FlowProvider as Jt, ImagePluginLayer as K, DataStoreWriteOptions as Kn, getNodeData as Kr, inputDataSchema as Kt, TranscodeVideoParams as L, UploadEvent as Ln, FlowEventNodePause as Lr, ParallelSchedulerConfig as Lt, VideoPlugin as M, flowEventEmitter as Mn, FlowEventFlowStart as Mr, CredentialProvider as Mt, VideoPluginLayer as N, uploadEventEmitter as Nn, FlowEventJobEnd as Nr, CredentialProviderLayer as Nt, ZipParams as O, FlowEventEmitter as On, FlowEventFlowCancel as Or, ImageAiContext as Ot, VideoPluginShape as P, WebSocketConnection as Pn, FlowEventJobStart as Pr, CredentialProviderShape as Pt, GrayscaleTransform as Q, isDataStore as Qn, FlowServerOptions as Qt, transcodeVideoParamsSchema as R, UploadEventType as Rn, FlowEventNodeResponse as Rr, TransformNodeConfig as Rt, removeBackgroundParamsSchema as S, MiddlewareServiceLive as Sn, NodeTypeMap as Sr, transformationSchema as St, Plugin as T, BaseEventEmitter as Tn, waitingNodeExecution as Tr, resizeParamsSchema as Tt, DescribeVideoMetadata as U, DataStore as Un, ConditionValue as Ur, InputData as Ut, ExtractFrameVideoParams as V, EventBroadcasterService as Vn, ConditionField as Vr, createStorageNode as Vt, describeVideoMetadataSchema as W, DataStoreCapabilities as Wn, NodeType as Wr, InputNodeParams as Wt, ContrastTransform as X, UploadStrategy as Xn, FlowServer as Xt, BrightnessTransform as Y, UploadFileDataStoresShape as Yn, FlowProviderShape as Yt, FlipTransform as Z, createDataStoreLayer as Zn, FlowServerLayer as Zt, ExtractLayerService as _, detectMimeType as _n, FlowConfig as _r, rotateTransformSchema as _t, FlowInputMap as a, FlowJobStatus as an, flowJobKvStore as ar, TextTransform as at, FlowCondition as b, MiddlewareNext as bn, NodeConnectionValidator as br, textTransformSchema as bt, FlowRequirements as c, NegotiatedStrategy as cn, UploadFile as cr, TransformationType as ct, TypedFlow as d, UploadServer as dn, FlowData as dr, brightnessTransformSchema as dt, FlowWaitUntil as en, BaseKvStoreService as er, OverlayPosition as et, TypedFlowConfig as f, UploadServerOptions as fn, FlowExecutionResult as fr, contrastTransformSchema as ft, ExtractEffectRequirements as g, compareMimeTypes as gn, createFlowEdge as gr, resizeTransformSchema as gt, ExtractEffectError as h, uploadServer as hn, FlowEdge as hr, logoTransformSchema as ht, runArgsSchema as i, FlowJob as in, UploadFileKVStore as ir, SharpenTransform as it, ZipPluginShape as j, eventToMessageSerializer as jn, FlowEventFlowPause as jr, ImageAiPluginShape as jt, ZipPlugin as k, TypedEventEmitter as kn, FlowEventFlowEnd as kr, ImageAiPlugin as kt, NodeDefinition as l, UploadStrategyNegotiator as ln, uploadFileSchema as lr, WatermarkTransform as lt, createFlow as m, createUploadServer as mn, getFlowData as mr, grayscaleTransformSchema as mt, resolveUploadMetadata as n, createFlowServer as nn, KvStore as nr, RotateTransform as nt, FlowOutputMap as o, FlowJobTask as on, jsonSerializer as or, TransformImageParams as ot, TypedFlowEdge as p, UploadServerShape as pn, createFlowWithSchema as pr, flipTransformSchema as pt, ImagePluginShape as q, UploadFileDataStore as qn, inputNodeParamsSchema as qt, RunArgs as r, flowServer as rn, TypedKvStore as rr, SepiaTransform as rt, FlowPluginRequirements as s, FlowJobTaskStatus as sn, uploadFileKvStore as sr, Transformation as st, ResolvedUploadMetadata as t, WaitUntilCallback as tn, FlowJobKVStore as tr, ResizeTransform as tt, NodeDefinitionsRecord as u, UploadStrategyOptions as un, Flow as ur, blurTransformSchema as ut, ExtractLayerServices as v, Middleware as vn, FlowNode as vr, sepiaTransformSchema as vt, describeImageParamsSchema as w, inputFileSchema as wn, completeNodeExecution as wr, ResizeParams as wt, RemoveBackgroundParams as x, MiddlewareService as xn, NodeExecutionResult as xr, transformImageParamsSchema as xt, ResolveEffect as y, MiddlewareContext as yn, FlowNodeData as yr, sharpenTransformSchema as yt, ResizeVideoParams as z, uploadEventSchema as zn, FlowEventNodeResume as zr, createTransformNode as zt };
4889
- //# sourceMappingURL=index-DHt7Ht_J.d.mts.map
5055
+ //# sourceMappingURL=index-RgOX4psL.d.mts.map