@workglow/tasks 0.0.77 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +109 -1
- package/dist/index.js.map +6 -4
- package/dist/task/MergeTask.d.ts +74 -0
- package/dist/task/MergeTask.d.ts.map +1 -0
- package/dist/task/SplitTask.d.ts +72 -0
- package/dist/task/SplitTask.d.ts.map +1 -0
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5092,8 +5092,116 @@ function Lambda(input2, config) {
|
|
|
5092
5092
|
return task.run();
|
|
5093
5093
|
}
|
|
5094
5094
|
Workflow6.prototype.Lambda = CreateWorkflow6(LambdaTask);
|
|
5095
|
+
// src/task/MergeTask.ts
|
|
5096
|
+
import {
|
|
5097
|
+
CreateWorkflow as CreateWorkflow7,
|
|
5098
|
+
Task as Task5,
|
|
5099
|
+
TaskRegistry as TaskRegistry7,
|
|
5100
|
+
Workflow as Workflow7
|
|
5101
|
+
} from "@workglow/task-graph";
|
|
5102
|
+
var inputSchema7 = {
|
|
5103
|
+
type: "object",
|
|
5104
|
+
properties: {},
|
|
5105
|
+
additionalProperties: true
|
|
5106
|
+
};
|
|
5107
|
+
var outputSchema7 = {
|
|
5108
|
+
type: "object",
|
|
5109
|
+
properties: {
|
|
5110
|
+
output: {
|
|
5111
|
+
type: "array",
|
|
5112
|
+
title: "Merged Array",
|
|
5113
|
+
description: "Array containing all input values in order"
|
|
5114
|
+
}
|
|
5115
|
+
},
|
|
5116
|
+
additionalProperties: false
|
|
5117
|
+
};
|
|
5118
|
+
|
|
5119
|
+
class MergeTask extends Task5 {
|
|
5120
|
+
static type = "MergeTask";
|
|
5121
|
+
static category = "Utility";
|
|
5122
|
+
static title = "Merge";
|
|
5123
|
+
static description = "Merges multiple inputs into a single array output";
|
|
5124
|
+
static cacheable = true;
|
|
5125
|
+
static inputSchema() {
|
|
5126
|
+
return inputSchema7;
|
|
5127
|
+
}
|
|
5128
|
+
static outputSchema() {
|
|
5129
|
+
return outputSchema7;
|
|
5130
|
+
}
|
|
5131
|
+
async execute(input2, context) {
|
|
5132
|
+
const keys = Object.keys(input2).sort();
|
|
5133
|
+
const values = keys.map((key) => input2[key]);
|
|
5134
|
+
return {
|
|
5135
|
+
output: values
|
|
5136
|
+
};
|
|
5137
|
+
}
|
|
5138
|
+
}
|
|
5139
|
+
TaskRegistry7.registerTask(MergeTask);
|
|
5140
|
+
var Merge = (input2, config = {}) => {
|
|
5141
|
+
const task = new MergeTask(input2, config);
|
|
5142
|
+
return task.run();
|
|
5143
|
+
};
|
|
5144
|
+
Workflow7.prototype.Merge = CreateWorkflow7(MergeTask);
|
|
5145
|
+
// src/task/SplitTask.ts
|
|
5146
|
+
import {
|
|
5147
|
+
CreateWorkflow as CreateWorkflow8,
|
|
5148
|
+
Task as Task6,
|
|
5149
|
+
TaskRegistry as TaskRegistry8,
|
|
5150
|
+
Workflow as Workflow8
|
|
5151
|
+
} from "@workglow/task-graph";
|
|
5152
|
+
var inputSchema8 = {
|
|
5153
|
+
type: "object",
|
|
5154
|
+
properties: {
|
|
5155
|
+
input: {
|
|
5156
|
+
title: "Single Input",
|
|
5157
|
+
description: "A single value to output"
|
|
5158
|
+
}
|
|
5159
|
+
},
|
|
5160
|
+
additionalProperties: false
|
|
5161
|
+
};
|
|
5162
|
+
var outputSchema8 = {
|
|
5163
|
+
type: "object",
|
|
5164
|
+
properties: {},
|
|
5165
|
+
additionalProperties: true
|
|
5166
|
+
};
|
|
5167
|
+
|
|
5168
|
+
class SplitTask extends Task6 {
|
|
5169
|
+
static type = "SplitTask";
|
|
5170
|
+
static category = "Utility";
|
|
5171
|
+
static title = "Split";
|
|
5172
|
+
static description = "Splits an array into individual outputs, creating one output per element";
|
|
5173
|
+
static cacheable = true;
|
|
5174
|
+
static inputSchema() {
|
|
5175
|
+
return inputSchema8;
|
|
5176
|
+
}
|
|
5177
|
+
static outputSchema() {
|
|
5178
|
+
return outputSchema8;
|
|
5179
|
+
}
|
|
5180
|
+
async execute(input2, context) {
|
|
5181
|
+
const inputValue = input2.input;
|
|
5182
|
+
const output = {};
|
|
5183
|
+
if (Array.isArray(inputValue)) {
|
|
5184
|
+
inputValue.forEach((item, index) => {
|
|
5185
|
+
output[`output_${index}`] = item;
|
|
5186
|
+
});
|
|
5187
|
+
} else {
|
|
5188
|
+
output.output_0 = inputValue;
|
|
5189
|
+
}
|
|
5190
|
+
return output;
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
TaskRegistry8.registerTask(SplitTask);
|
|
5194
|
+
var Split = (input2, config = {}) => {
|
|
5195
|
+
const task = new SplitTask(input2, config);
|
|
5196
|
+
return task.run();
|
|
5197
|
+
};
|
|
5198
|
+
Workflow8.prototype.Split = CreateWorkflow8(SplitTask);
|
|
5095
5199
|
export {
|
|
5096
5200
|
process,
|
|
5201
|
+
SplitTask,
|
|
5202
|
+
Split,
|
|
5203
|
+
MergeTask,
|
|
5204
|
+
Merge,
|
|
5097
5205
|
LambdaTask,
|
|
5098
5206
|
Lambda,
|
|
5099
5207
|
JsonTask,
|
|
@@ -5109,4 +5217,4 @@ export {
|
|
|
5109
5217
|
DebugLog
|
|
5110
5218
|
};
|
|
5111
5219
|
|
|
5112
|
-
//# debugId=
|
|
5220
|
+
//# debugId=5B9570B00AF9AE2664756E2164756E21
|