@pgflow/dsl 0.0.0-array-map-steps-302d00a8-20250925065142 → 0.0.0-array-map-steps-f18b09ac-20251006160811
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/README.md +73 -7
- package/dist/CHANGELOG.md +3 -5
- package/dist/README.md +73 -7
- package/dist/dsl.d.ts +54 -22
- package/dist/dsl.d.ts.map +1 -1
- package/dist/example-flow.d.ts +2 -2
- package/dist/example-flow.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/dist/platforms/supabase.d.ts +3 -13
- package/dist/platforms/supabase.d.ts.map +1 -1
- package/dist/platforms/supabase.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,35 +93,71 @@ The standard method for adding steps to a flow. Each step processes input and re
|
|
|
93
93
|
|
|
94
94
|
#### `.array()` - Array-Returning Steps
|
|
95
95
|
|
|
96
|
-
A semantic wrapper around `.step()` that provides type enforcement for steps that return arrays. Useful for data fetching or collection steps.
|
|
96
|
+
A semantic wrapper around `.step()` that provides type enforcement for steps that return arrays. Useful for data fetching or collection steps that will be processed by map steps.
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
+
// Fetch an array of items to be processed
|
|
99
100
|
.array(
|
|
100
101
|
{ slug: 'fetch_items' },
|
|
101
102
|
async () => [1, 2, 3, 4, 5]
|
|
102
103
|
)
|
|
104
|
+
|
|
105
|
+
// With dependencies - combining data from multiple sources
|
|
106
|
+
.array(
|
|
107
|
+
{ slug: 'combine_results', dependsOn: ['source1', 'source2'] },
|
|
108
|
+
async (input) => [...input.source1, ...input.source2]
|
|
109
|
+
)
|
|
103
110
|
```
|
|
104
111
|
|
|
112
|
+
**Key Points:**
|
|
113
|
+
- Return type is enforced to be an array at compile time
|
|
114
|
+
- Commonly used as input for subsequent map steps
|
|
115
|
+
- Can depend on other steps just like regular steps
|
|
116
|
+
|
|
105
117
|
#### `.map()` - Array Processing Steps
|
|
106
118
|
|
|
107
119
|
Processes arrays element-by-element, similar to JavaScript's `Array.map()`. The handler receives individual items instead of the full input object.
|
|
108
120
|
|
|
121
|
+
**Two Modes of Operation:**
|
|
122
|
+
|
|
123
|
+
1. **Root Map** (no `array:` property): Processes the flow's input array directly
|
|
124
|
+
- The flow input MUST be an array when using root maps
|
|
125
|
+
- Omitting the `array:` property tells pgflow to use the flow input
|
|
126
|
+
|
|
127
|
+
2. **Dependent Map** (with `array:` property): Processes another step's array output
|
|
128
|
+
- The `array:` property specifies which step's output to process
|
|
129
|
+
- That step must return an array
|
|
130
|
+
|
|
109
131
|
```typescript
|
|
110
|
-
//
|
|
132
|
+
// ROOT MAP - No array: property means use flow input
|
|
133
|
+
// Flow input MUST be an array (e.g., ["hello", "world"])
|
|
111
134
|
new Flow<string[]>({ slug: 'process_strings' })
|
|
112
|
-
.map(
|
|
135
|
+
.map(
|
|
136
|
+
{ slug: 'uppercase' }, // No array: property!
|
|
137
|
+
(item) => item.toUpperCase()
|
|
138
|
+
);
|
|
139
|
+
// Each string in the input array gets uppercased in parallel
|
|
113
140
|
|
|
114
|
-
//
|
|
141
|
+
// DEPENDENT MAP - array: property specifies the source step
|
|
115
142
|
new Flow<{}>({ slug: 'data_pipeline' })
|
|
116
143
|
.array({ slug: 'numbers' }, () => [1, 2, 3])
|
|
117
|
-
.map(
|
|
118
|
-
|
|
144
|
+
.map(
|
|
145
|
+
{ slug: 'double', array: 'numbers' }, // Processes 'numbers' output
|
|
146
|
+
(n) => n * 2
|
|
147
|
+
)
|
|
148
|
+
.map(
|
|
149
|
+
{ slug: 'square', array: 'double' }, // Chains from 'double'
|
|
150
|
+
(n) => n * n
|
|
151
|
+
);
|
|
152
|
+
// Results: numbers: [1,2,3] → double: [2,4,6] → square: [4,16,36]
|
|
119
153
|
```
|
|
120
154
|
|
|
121
155
|
**Key differences from regular steps:**
|
|
122
|
-
- Uses `array:`
|
|
156
|
+
- Uses `array:` to specify dependency (not `dependsOn:`)
|
|
157
|
+
- When `array:` is omitted, uses flow input array (root map)
|
|
123
158
|
- Handler signature is `(item, context) => result` instead of `(input, context) => result`
|
|
124
159
|
- Return type is always an array
|
|
160
|
+
- Map steps can have at most one dependency (the array source)
|
|
125
161
|
- Generates SQL with `step_type => 'map'` parameter for pgflow's map processing
|
|
126
162
|
|
|
127
163
|
**Type Safety:**
|
|
@@ -141,9 +177,39 @@ new Flow<{}>({ slug: 'user_flow' })
|
|
|
141
177
|
});
|
|
142
178
|
```
|
|
143
179
|
|
|
180
|
+
**Common Patterns:**
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
// Batch processing - process multiple items in parallel
|
|
184
|
+
new Flow<number[]>({ slug: 'batch_processor' })
|
|
185
|
+
.map({ slug: 'validate' }, (item) => {
|
|
186
|
+
if (item < 0) throw new Error('Invalid item');
|
|
187
|
+
return item;
|
|
188
|
+
})
|
|
189
|
+
.map({ slug: 'process', array: 'validate' }, async (item) => {
|
|
190
|
+
// Each item processed in its own task
|
|
191
|
+
return await expensiveOperation(item);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Data transformation pipeline
|
|
195
|
+
new Flow<{}>({ slug: 'etl_pipeline' })
|
|
196
|
+
.step({ slug: 'fetch_urls' }, () => ['url1', 'url2', 'url3'])
|
|
197
|
+
.map({ slug: 'scrape', array: 'fetch_urls' }, async (url) => {
|
|
198
|
+
return await fetchContent(url);
|
|
199
|
+
})
|
|
200
|
+
.map({ slug: 'extract', array: 'scrape' }, (html) => {
|
|
201
|
+
return extractData(html);
|
|
202
|
+
})
|
|
203
|
+
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (input) => {
|
|
204
|
+
// input.extract is the aggregated array from all map tasks
|
|
205
|
+
return consolidateResults(input.extract);
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
144
209
|
**Limitations:**
|
|
145
210
|
- Can only depend on a single array-returning step
|
|
146
211
|
- TypeScript may not track type transformations between chained maps (use type assertions if needed)
|
|
212
|
+
- Root maps require the entire flow input to be an array
|
|
147
213
|
|
|
148
214
|
### Context Object
|
|
149
215
|
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @pgflow/dsl
|
|
2
2
|
|
|
3
|
-
## 0.0.0-array-map-steps-
|
|
3
|
+
## 0.0.0-array-map-steps-f18b09ac-20251006160811
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 8dc0d99: Add `.array()` method for type-safe array step creation
|
|
8
8
|
|
|
9
9
|
Introduces a new `.array()` method that provides compile-time type safety for array-returning handlers with zero runtime overhead.
|
|
10
10
|
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
flow.array({ slug: 'invalid' }, () => 42); // ❌ Compile error
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- 6449647: Add `.map()` method to Flow DSL for defining map-type steps
|
|
21
|
+
- 8dc0d99: Add `.map()` method to Flow DSL for defining map-type steps
|
|
24
22
|
|
|
25
23
|
The new `.map()` method enables defining steps that process arrays element-by-element, complementing the existing SQL Core map infrastructure. Key features:
|
|
26
24
|
|
package/dist/README.md
CHANGED
|
@@ -93,35 +93,71 @@ The standard method for adding steps to a flow. Each step processes input and re
|
|
|
93
93
|
|
|
94
94
|
#### `.array()` - Array-Returning Steps
|
|
95
95
|
|
|
96
|
-
A semantic wrapper around `.step()` that provides type enforcement for steps that return arrays. Useful for data fetching or collection steps.
|
|
96
|
+
A semantic wrapper around `.step()` that provides type enforcement for steps that return arrays. Useful for data fetching or collection steps that will be processed by map steps.
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
+
// Fetch an array of items to be processed
|
|
99
100
|
.array(
|
|
100
101
|
{ slug: 'fetch_items' },
|
|
101
102
|
async () => [1, 2, 3, 4, 5]
|
|
102
103
|
)
|
|
104
|
+
|
|
105
|
+
// With dependencies - combining data from multiple sources
|
|
106
|
+
.array(
|
|
107
|
+
{ slug: 'combine_results', dependsOn: ['source1', 'source2'] },
|
|
108
|
+
async (input) => [...input.source1, ...input.source2]
|
|
109
|
+
)
|
|
103
110
|
```
|
|
104
111
|
|
|
112
|
+
**Key Points:**
|
|
113
|
+
- Return type is enforced to be an array at compile time
|
|
114
|
+
- Commonly used as input for subsequent map steps
|
|
115
|
+
- Can depend on other steps just like regular steps
|
|
116
|
+
|
|
105
117
|
#### `.map()` - Array Processing Steps
|
|
106
118
|
|
|
107
119
|
Processes arrays element-by-element, similar to JavaScript's `Array.map()`. The handler receives individual items instead of the full input object.
|
|
108
120
|
|
|
121
|
+
**Two Modes of Operation:**
|
|
122
|
+
|
|
123
|
+
1. **Root Map** (no `array:` property): Processes the flow's input array directly
|
|
124
|
+
- The flow input MUST be an array when using root maps
|
|
125
|
+
- Omitting the `array:` property tells pgflow to use the flow input
|
|
126
|
+
|
|
127
|
+
2. **Dependent Map** (with `array:` property): Processes another step's array output
|
|
128
|
+
- The `array:` property specifies which step's output to process
|
|
129
|
+
- That step must return an array
|
|
130
|
+
|
|
109
131
|
```typescript
|
|
110
|
-
//
|
|
132
|
+
// ROOT MAP - No array: property means use flow input
|
|
133
|
+
// Flow input MUST be an array (e.g., ["hello", "world"])
|
|
111
134
|
new Flow<string[]>({ slug: 'process_strings' })
|
|
112
|
-
.map(
|
|
135
|
+
.map(
|
|
136
|
+
{ slug: 'uppercase' }, // No array: property!
|
|
137
|
+
(item) => item.toUpperCase()
|
|
138
|
+
);
|
|
139
|
+
// Each string in the input array gets uppercased in parallel
|
|
113
140
|
|
|
114
|
-
//
|
|
141
|
+
// DEPENDENT MAP - array: property specifies the source step
|
|
115
142
|
new Flow<{}>({ slug: 'data_pipeline' })
|
|
116
143
|
.array({ slug: 'numbers' }, () => [1, 2, 3])
|
|
117
|
-
.map(
|
|
118
|
-
|
|
144
|
+
.map(
|
|
145
|
+
{ slug: 'double', array: 'numbers' }, // Processes 'numbers' output
|
|
146
|
+
(n) => n * 2
|
|
147
|
+
)
|
|
148
|
+
.map(
|
|
149
|
+
{ slug: 'square', array: 'double' }, // Chains from 'double'
|
|
150
|
+
(n) => n * n
|
|
151
|
+
);
|
|
152
|
+
// Results: numbers: [1,2,3] → double: [2,4,6] → square: [4,16,36]
|
|
119
153
|
```
|
|
120
154
|
|
|
121
155
|
**Key differences from regular steps:**
|
|
122
|
-
- Uses `array:`
|
|
156
|
+
- Uses `array:` to specify dependency (not `dependsOn:`)
|
|
157
|
+
- When `array:` is omitted, uses flow input array (root map)
|
|
123
158
|
- Handler signature is `(item, context) => result` instead of `(input, context) => result`
|
|
124
159
|
- Return type is always an array
|
|
160
|
+
- Map steps can have at most one dependency (the array source)
|
|
125
161
|
- Generates SQL with `step_type => 'map'` parameter for pgflow's map processing
|
|
126
162
|
|
|
127
163
|
**Type Safety:**
|
|
@@ -141,9 +177,39 @@ new Flow<{}>({ slug: 'user_flow' })
|
|
|
141
177
|
});
|
|
142
178
|
```
|
|
143
179
|
|
|
180
|
+
**Common Patterns:**
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
// Batch processing - process multiple items in parallel
|
|
184
|
+
new Flow<number[]>({ slug: 'batch_processor' })
|
|
185
|
+
.map({ slug: 'validate' }, (item) => {
|
|
186
|
+
if (item < 0) throw new Error('Invalid item');
|
|
187
|
+
return item;
|
|
188
|
+
})
|
|
189
|
+
.map({ slug: 'process', array: 'validate' }, async (item) => {
|
|
190
|
+
// Each item processed in its own task
|
|
191
|
+
return await expensiveOperation(item);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Data transformation pipeline
|
|
195
|
+
new Flow<{}>({ slug: 'etl_pipeline' })
|
|
196
|
+
.step({ slug: 'fetch_urls' }, () => ['url1', 'url2', 'url3'])
|
|
197
|
+
.map({ slug: 'scrape', array: 'fetch_urls' }, async (url) => {
|
|
198
|
+
return await fetchContent(url);
|
|
199
|
+
})
|
|
200
|
+
.map({ slug: 'extract', array: 'scrape' }, (html) => {
|
|
201
|
+
return extractData(html);
|
|
202
|
+
})
|
|
203
|
+
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (input) => {
|
|
204
|
+
// input.extract is the aggregated array from all map tasks
|
|
205
|
+
return consolidateResults(input.extract);
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
144
209
|
**Limitations:**
|
|
145
210
|
- Can only depend on a single array-returning step
|
|
146
211
|
- TypeScript may not track type transformations between chained maps (use type assertions if needed)
|
|
212
|
+
- Root maps require the entire flow input to be an array
|
|
147
213
|
|
|
148
214
|
### Context Object
|
|
149
215
|
|
package/dist/dsl.d.ts
CHANGED
|
@@ -21,18 +21,18 @@ export type AnyDeps = Record<string, string[]>;
|
|
|
21
21
|
/**
|
|
22
22
|
* Represents a Flow that has not steps nor deps defined yet
|
|
23
23
|
*/
|
|
24
|
-
export type EmptyFlow = Flow<AnyInput,
|
|
24
|
+
export type EmptyFlow = Flow<AnyInput, {}, EmptySteps, EmptyDeps>;
|
|
25
25
|
/**
|
|
26
26
|
* Represents any Flow with flexible input, context, steps, and dependencies.
|
|
27
27
|
* This type is intentionally more permissive to allow for better type inference
|
|
28
28
|
* in utility types like StepOutput.
|
|
29
29
|
*/
|
|
30
|
-
export type AnyFlow = Flow<any, any, any, any>;
|
|
30
|
+
export type AnyFlow = Flow<any, any, any, any, any>;
|
|
31
31
|
/**
|
|
32
32
|
* Extracts the input type from a Flow
|
|
33
33
|
* @template TFlow - The Flow type to extract from
|
|
34
34
|
*/
|
|
35
|
-
export type ExtractFlowInput<TFlow extends AnyFlow> = TFlow extends Flow<infer TI, infer _TC, infer _TS, infer _TD> ? TI : never;
|
|
35
|
+
export type ExtractFlowInput<TFlow extends AnyFlow> = TFlow extends Flow<infer TI, infer _TC, infer _TS, infer _TD, infer _TEnv> ? TI : never;
|
|
36
36
|
/**
|
|
37
37
|
* Utility type to extract all possible step inputs from a flow
|
|
38
38
|
* This creates a union of all step input types
|
|
@@ -44,24 +44,31 @@ export type AllStepInputs<TFlow extends AnyFlow> = {
|
|
|
44
44
|
* Extracts the output type from a Flow
|
|
45
45
|
* @template TFlow - The Flow type to extract from
|
|
46
46
|
*/
|
|
47
|
-
export type ExtractFlowOutput<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer _TD> ? {
|
|
47
|
+
export type ExtractFlowOutput<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer _TD, infer _TEnv> ? {
|
|
48
48
|
[K in keyof ExtractFlowLeafSteps<TFlow> as K extends string ? K : never]: StepOutput<TFlow, K & string>;
|
|
49
49
|
} : never;
|
|
50
50
|
/**
|
|
51
51
|
* Extracts the steps type from a Flow
|
|
52
52
|
* @template TFlow - The Flow type to extract from
|
|
53
53
|
*/
|
|
54
|
-
export type ExtractFlowSteps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer TS, infer _TD> ? TS : never;
|
|
54
|
+
export type ExtractFlowSteps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer TS, infer _TD, infer _TEnv> ? TS : never;
|
|
55
55
|
/**
|
|
56
56
|
* Extracts the dependencies type from a Flow
|
|
57
57
|
* @template TFlow - The Flow type to extract from
|
|
58
58
|
*/
|
|
59
|
-
export type ExtractFlowDeps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer TD> ? TD : never;
|
|
59
|
+
export type ExtractFlowDeps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer TD, infer _TEnv> ? TD : never;
|
|
60
60
|
/**
|
|
61
|
-
* Extracts the
|
|
61
|
+
* Extracts the environment type from a Flow
|
|
62
62
|
* @template TFlow - The Flow type to extract from
|
|
63
|
+
* Returns the TEnv type parameter
|
|
63
64
|
*/
|
|
64
|
-
export type
|
|
65
|
+
export type ExtractFlowEnv<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer _TD, infer TEnv> ? TEnv : never;
|
|
66
|
+
/**
|
|
67
|
+
* Extracts the full handler context type from a Flow
|
|
68
|
+
* @template TFlow - The Flow type to extract from
|
|
69
|
+
* Returns FlowContext<TEnv> & TContext (the complete context handlers receive)
|
|
70
|
+
*/
|
|
71
|
+
export type ExtractFlowContext<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer TC, infer _TS, infer _TD, infer TEnv> ? FlowContext<TEnv> & TC : never;
|
|
65
72
|
/**
|
|
66
73
|
* Extracts the dependencies type from a Flow
|
|
67
74
|
* @template TFlow - The Flow type to extract from
|
|
@@ -92,24 +99,49 @@ export interface RuntimeOptions {
|
|
|
92
99
|
baseDelay?: number;
|
|
93
100
|
timeout?: number;
|
|
94
101
|
}
|
|
95
|
-
export interface
|
|
96
|
-
|
|
102
|
+
export interface WorkerConfig {
|
|
103
|
+
maxConcurrent: number;
|
|
104
|
+
maxPollSeconds: number;
|
|
105
|
+
pollIntervalMs: number;
|
|
106
|
+
batchSize: number;
|
|
107
|
+
visibilityTimeout: number;
|
|
108
|
+
}
|
|
109
|
+
export interface MessageRecord {
|
|
110
|
+
msg_id: number;
|
|
111
|
+
read_ct: number;
|
|
112
|
+
enqueued_at: string;
|
|
113
|
+
vt: string;
|
|
114
|
+
message: Json;
|
|
115
|
+
}
|
|
116
|
+
export interface StepTaskRecord<TFlow extends AnyFlow> {
|
|
117
|
+
flow_slug: string;
|
|
118
|
+
run_id: string;
|
|
119
|
+
step_slug: string;
|
|
120
|
+
input: Json;
|
|
121
|
+
msg_id: number;
|
|
122
|
+
}
|
|
123
|
+
export interface BaseContext<TEnv extends Env = Env> {
|
|
124
|
+
env: TEnv & ValidEnv<UserEnv>;
|
|
97
125
|
shutdownSignal: AbortSignal;
|
|
126
|
+
rawMessage: MessageRecord;
|
|
127
|
+
workerConfig: Readonly<WorkerConfig>;
|
|
128
|
+
}
|
|
129
|
+
export interface FlowContext<TEnv extends Env = Env> extends BaseContext<TEnv> {
|
|
130
|
+
stepTask: StepTaskRecord<AnyFlow>;
|
|
98
131
|
}
|
|
99
|
-
export type Context<T extends Record<string, unknown> = Record<string, never
|
|
100
|
-
type ExtractHandlerContext<T> = T extends (input: any, context: infer C) => any ? C : never;
|
|
132
|
+
export type Context<T extends Record<string, unknown> = Record<string, never>, TEnv extends Env = Env> = FlowContext<TEnv> & T;
|
|
101
133
|
export interface StepRuntimeOptions extends RuntimeOptions {
|
|
102
134
|
startDelay?: number;
|
|
103
135
|
}
|
|
104
|
-
export interface StepDefinition<TInput extends AnyInput, TOutput extends AnyOutput, TContext =
|
|
136
|
+
export interface StepDefinition<TInput extends AnyInput, TOutput extends AnyOutput, TContext = FlowContext> {
|
|
105
137
|
slug: string;
|
|
106
138
|
handler: (input: TInput, context: TContext) => TOutput | Promise<TOutput>;
|
|
107
139
|
dependencies: string[];
|
|
108
140
|
options: StepRuntimeOptions;
|
|
109
141
|
stepType?: 'single' | 'map';
|
|
110
142
|
}
|
|
111
|
-
export declare class Flow<TFlowInput extends AnyInput = AnyInput, TContext =
|
|
112
|
-
Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDeps> {
|
|
143
|
+
export declare class Flow<TFlowInput extends AnyInput = AnyInput, TContext extends Record<string, unknown> = {}, // Accumulated custom context (FlowContext is always provided)
|
|
144
|
+
Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDeps, TEnv extends Env = Env> {
|
|
113
145
|
/**
|
|
114
146
|
* Store step definitions with their proper types
|
|
115
147
|
*
|
|
@@ -137,14 +169,14 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
137
169
|
run: TFlowInput;
|
|
138
170
|
} & {
|
|
139
171
|
[K in Deps]: K extends keyof Steps ? Steps[K] : never;
|
|
140
|
-
}>, context:
|
|
172
|
+
}>, context: FlowContext<TEnv> & TContext) => any, Deps extends Extract<keyof Steps, string> = never>(opts: Simplify<{
|
|
141
173
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
142
174
|
dependsOn?: Deps[];
|
|
143
|
-
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext
|
|
175
|
+
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
|
|
144
176
|
[K in Slug]: AwaitedReturn<THandler>;
|
|
145
177
|
}, StepDependencies & {
|
|
146
178
|
[K in Slug]: Deps[];
|
|
147
|
-
}>;
|
|
179
|
+
}, TEnv>;
|
|
148
180
|
/**
|
|
149
181
|
* Add an array-returning step to the flow with compile-time type safety
|
|
150
182
|
*
|
|
@@ -165,11 +197,11 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
165
197
|
}>, context: BaseContext & TContext) => Array<Json> | Promise<Array<Json>>, Deps extends Extract<keyof Steps, string> = never>(opts: Simplify<{
|
|
166
198
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
167
199
|
dependsOn?: Deps[];
|
|
168
|
-
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext
|
|
200
|
+
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
|
|
169
201
|
[K in Slug]: AwaitedReturn<THandler>;
|
|
170
202
|
}, StepDependencies & {
|
|
171
203
|
[K in Slug]: Deps[];
|
|
172
|
-
}>;
|
|
204
|
+
}, TEnv>;
|
|
173
205
|
/**
|
|
174
206
|
* Add a map step to the flow that processes arrays element by element
|
|
175
207
|
*
|
|
@@ -184,7 +216,7 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
184
216
|
map<Slug extends string, THandler>(opts: Simplify<{
|
|
185
217
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
186
218
|
} & StepRuntimeOptions>, handler: TFlowInput extends readonly (infer Item)[] ? THandler & ((item: Item, context: BaseContext & TContext) => Json | Promise<Json>) : never): Flow<TFlowInput, TContext & BaseContext, Steps & {
|
|
187
|
-
[K in Slug]:
|
|
219
|
+
[K in Slug]: AwaitedReturn<THandler>[];
|
|
188
220
|
}, StepDependencies & {
|
|
189
221
|
[K in Slug]: [];
|
|
190
222
|
}>;
|
|
@@ -192,7 +224,7 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
192
224
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
193
225
|
array: TArrayDep;
|
|
194
226
|
} & StepRuntimeOptions>, handler: Steps[TArrayDep] extends readonly (infer Item)[] ? THandler & ((item: Item, context: BaseContext & TContext) => Json | Promise<Json>) : never): Flow<TFlowInput, TContext & BaseContext, Steps & {
|
|
195
|
-
[K in Slug]:
|
|
227
|
+
[K in Slug]: AwaitedReturn<THandler>[];
|
|
196
228
|
}, StepDependencies & {
|
|
197
229
|
[K in Slug]: [TArrayDep];
|
|
198
230
|
}>;
|
package/dist/dsl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dsl.d.ts","sourceRoot":"","sources":["../src/dsl.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,EAAE,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,CAAC;AAGxC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;CAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"dsl.d.ts","sourceRoot":"","sources":["../src/dsl.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,EAAE,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,CAAC;AAGxC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,O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AAE,OAAO,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAClF,KAAK,GACR,IAAI,CACL,UAAU,EACV,QAAQ,GAAG,WAAW,EACtB,KAAK,GAAG;SAAG,CAAC,IAAI,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,EAAE;KAAE,EAClD,gBAAgB,GAAG;SAAG,CAAC,IAAI,IAAI,GAAG,EAAE;KAAE,CACvC;IAGD,GAAG,CAAC,IAAI,SAAS,MAAM,EAAE,SAAS,SAAS,OAAO,CAAC,MAAM,KAAK,EAAE,MAAM,CAAC,EAAE,QAAQ,EAC/E,IAAI,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,IAAI,SAAS,MAAM,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,GAAG,kBAAkB,CAAC,EACxG,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GACrD,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAClF,KAAK,GACR,IAAI,CACL,UAAU,EACV,QAAQ,GAAG,WAAW,EACtB,KAAK,GAAG;SAAG,CAAC,IAAI,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,EAAE;KAAE,EAClD,gBAAgB,GAAG;SAAG,CAAC,IAAI,IAAI,GAAG,CAAC,SAAS,CAAC;KAAE,CAChD;CA8DF"}
|
package/dist/example-flow.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Flow } from './dsl.js';
|
|
|
2
2
|
type Input = {
|
|
3
3
|
url: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const AnalyzeWebsite: Flow<Input,
|
|
5
|
+
export declare const AnalyzeWebsite: Flow<Input, {}, import("./dsl.js").EmptySteps & {
|
|
6
6
|
website: {
|
|
7
7
|
content: string;
|
|
8
8
|
};
|
|
@@ -24,6 +24,6 @@ export declare const AnalyzeWebsite: Flow<Input, import("./dsl.js").BaseContext,
|
|
|
24
24
|
summary: "website"[];
|
|
25
25
|
} & {
|
|
26
26
|
saveToDb: ("sentiment" | "summary")[];
|
|
27
|
-
}>;
|
|
27
|
+
}, import("./dsl.js").Env>;
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=example-flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-flow.d.ts","sourceRoot":"","sources":["../src/example-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"example-flow.d.ts","sourceRoot":"","sources":["../src/example-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;0BA4BxB,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sql } from 'postgres';
|
|
2
2
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
-
import { Flow as CoreFlow, type AnyInput, type AnySteps, type AnyDeps, EmptySteps, EmptyDeps, type Env
|
|
3
|
+
import { Flow as CoreFlow, type AnyInput, type AnySteps, type AnyDeps, EmptySteps, EmptyDeps, type Env } from '../index.js';
|
|
4
4
|
export interface SupabaseResources extends Record<string, unknown> {
|
|
5
5
|
sql: Sql;
|
|
6
6
|
/**
|
|
@@ -16,17 +16,7 @@ export interface SupabaseEnv extends Env {
|
|
|
16
16
|
SB_EXECUTION_ID: string;
|
|
17
17
|
EDGE_WORKER_LOG_LEVEL?: string;
|
|
18
18
|
}
|
|
19
|
-
export type SupabasePlatformContext =
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export type SupabaseMessageContext<T extends Json = Json> = SupabasePlatformContext & {
|
|
23
|
-
rawMessage: any;
|
|
24
|
-
};
|
|
25
|
-
export type SupabaseStepTaskContext<F extends AnyFlow = AnyFlow> = SupabasePlatformContext & {
|
|
26
|
-
rawMessage: any;
|
|
27
|
-
stepTask: any;
|
|
28
|
-
};
|
|
29
|
-
export declare class Flow<I extends AnyInput = AnyInput, ExtraCtx extends Record<string, unknown> = Record<string, never>, S extends AnySteps = EmptySteps, D extends AnyDeps = EmptyDeps> extends CoreFlow<I, SupabasePlatformContext & ExtraCtx, // <── full ctx in handlers
|
|
30
|
-
S, D> {
|
|
19
|
+
export type SupabasePlatformContext = SupabaseResources;
|
|
20
|
+
export declare class Flow<I extends AnyInput = AnyInput, CustomCtx extends Record<string, unknown> = {}, S extends AnySteps = EmptySteps, D extends AnyDeps = EmptyDeps, TEnv extends Env = SupabaseEnv> extends CoreFlow<I, SupabasePlatformContext & CustomCtx, S, D, TEnv> {
|
|
31
21
|
}
|
|
32
22
|
//# sourceMappingURL=supabase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/platforms/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,IAAI,IAAI,QAAQ,EAChB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAC1C,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/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