@fugood/bricks-project 2.24.4 → 2.24.5
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/compile/action-name-map.ts +5 -0
- package/compile/index.ts +8 -4
- package/package.json +2 -2
- package/package.json.bak +2 -2
- package/skills/bricks-ctor/SKILL.md +2 -2
- package/skills/bricks-ctor/rules/architecture-patterns.md +12 -0
- package/skills/bricks-ctor/rules/automations.md +11 -0
- package/skills/bricks-ctor/rules/data-calculation.md +5 -5
- package/skills/bricks-ctor/rules/verification-toolchain.md +16 -9
- package/skills/bricks-design/SKILL.md +2 -2
- package/skills/bricks-design/references/architecture-truths.md +10 -3
- package/skills/bricks-design/references/variations-and-tweaks.md +1 -1
- package/tools/_shell.ts +8 -1
- package/tools/mcp-tools/compile.ts +17 -7
- package/tools/mcp-tools/media.ts +4 -1
- package/types/animation.ts +8 -3
- package/types/brick-base.ts +1 -1
- package/types/bricks/Camera.ts +8 -8
- package/types/bricks/Chart.ts +4 -4
- package/types/bricks/GenerativeMedia.ts +15 -15
- package/types/bricks/Icon.ts +7 -7
- package/types/bricks/Image.ts +9 -9
- package/types/bricks/Items.ts +7 -7
- package/types/bricks/Lottie.ts +10 -10
- package/types/bricks/Maps.ts +11 -11
- package/types/bricks/QrCode.ts +7 -7
- package/types/bricks/Rect.ts +7 -7
- package/types/bricks/RichText.ts +12 -9
- package/types/bricks/Rive.ts +9 -9
- package/types/bricks/Sketch.ts +6 -6
- package/types/bricks/Slideshow.ts +7 -7
- package/types/bricks/Svg.ts +7 -7
- package/types/bricks/Text.ts +9 -9
- package/types/bricks/TextInput.ts +10 -10
- package/types/bricks/Video.ts +12 -12
- package/types/bricks/VideoStreaming.ts +10 -10
- package/types/bricks/WebRtcStream.ts +1 -1
- package/types/bricks/WebView.ts +4 -4
- package/types/common.ts +2 -2
- package/types/data-calc-command/base.ts +57 -0
- package/types/data-calc-command/collection.ts +418 -0
- package/types/data-calc-command/color.ts +432 -0
- package/types/data-calc-command/constant.ts +50 -0
- package/types/data-calc-command/datetime.ts +147 -0
- package/types/data-calc-command/file.ts +129 -0
- package/types/data-calc-command/index.ts +13 -0
- package/types/data-calc-command/iteratee.ts +23 -0
- package/types/data-calc-command/logictype.ts +190 -0
- package/types/data-calc-command/math.ts +275 -0
- package/types/data-calc-command/object.ts +119 -0
- package/types/data-calc-command/sandbox.ts +58 -0
- package/types/data-calc-command/string.ts +407 -0
- package/types/data.ts +1 -1
- package/types/generators/LlmGgml.ts +37 -0
- package/utils/data.ts +1 -1
- package/utils/id.ts +78 -27
- package/types/data-calc-command.ts +0 -7005
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
2
|
+
import type { DataCalculationData, DataCommand, DataCalcInput, DataCalcOutput } from './base'
|
|
3
|
+
|
|
4
|
+
/* Compact — Remove false, undefined, 0, "", undefined, NaN in array */
|
|
5
|
+
export type DataCommandCollectionCompact = DataCommand & {
|
|
6
|
+
__commandName: 'COLLECTION_COMPACT'
|
|
7
|
+
inputs?: Array<DataCalcInput<'collection', Array<any>> /* default: [] */>
|
|
8
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Concat — Concat object or array. Return empty array if no var provided. */
|
|
12
|
+
export type DataCommandCollectionConcat = DataCommand & {
|
|
13
|
+
__commandName: 'COLLECTION_CONCAT'
|
|
14
|
+
inputs?: Array<
|
|
15
|
+
| DataCalcInput<'var1', any> /* default: [] */
|
|
16
|
+
| DataCalcInput<'var2', any> /* default: [] */
|
|
17
|
+
| DataCalcInput<'var3', any> /* default: [] */
|
|
18
|
+
>
|
|
19
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Count — Group the contents of arrays or objects and output individual counts.
|
|
23
|
+
If group_by_path provided, it will use value from path to group, use whole value as key if path is empty string, then output to result.
|
|
24
|
+
If group_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_group, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
25
|
+
export type DataCommandCollectionCount = DataCommand & {
|
|
26
|
+
__commandName: 'COLLECTION_COUNT'
|
|
27
|
+
inputs?: Array<
|
|
28
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
29
|
+
| DataCalcInput<'group_by_path', string> /* default: undefined */
|
|
30
|
+
| DataCalcInput<
|
|
31
|
+
'iteratee_result_group',
|
|
32
|
+
string
|
|
33
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
34
|
+
>
|
|
35
|
+
outputs?: Array<
|
|
36
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
37
|
+
| DataCalcOutput<'result'> /* target: object */
|
|
38
|
+
>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Difference — Creates an array of array values not included in the other given arrays. */
|
|
42
|
+
export type DataCommandCollectionDifference = DataCommand & {
|
|
43
|
+
__commandName: 'COLLECTION_DIFFERENCE'
|
|
44
|
+
inputs?: Array<
|
|
45
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
46
|
+
| DataCalcInput<'values', Array<any>> /* default: [] */
|
|
47
|
+
>
|
|
48
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Drop — Drop values with number in array or object. */
|
|
52
|
+
export type DataCommandCollectionDrop = DataCommand & {
|
|
53
|
+
__commandName: 'COLLECTION_DROP'
|
|
54
|
+
inputs?: Array<
|
|
55
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
56
|
+
| DataCalcInput<'number', any> /* default: 1 */
|
|
57
|
+
| DataCalcInput<'forward', boolean> /* default: true */
|
|
58
|
+
>
|
|
59
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Every — Whether all the contents in the array or object meet the conditions.
|
|
63
|
+
If predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.
|
|
64
|
+
If predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
65
|
+
export type DataCommandCollectionEvery = DataCommand & {
|
|
66
|
+
__commandName: 'COLLECTION_EVERY'
|
|
67
|
+
inputs?: Array<
|
|
68
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
69
|
+
| DataCalcInput<'predicate', object> /* default: undefined */
|
|
70
|
+
| DataCalcInput<
|
|
71
|
+
'iteratee_result_valid',
|
|
72
|
+
boolean
|
|
73
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
74
|
+
>
|
|
75
|
+
outputs?: Array<
|
|
76
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
77
|
+
| DataCalcOutput<'result'> /* target: boolean */
|
|
78
|
+
>
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Fill — Fill value in array with length. Example: COLLECTION_FILL(start=2, length=2, value='A') Result:[undefined, undefined, 'A', 'A'] */
|
|
82
|
+
export type DataCommandCollectionFill = DataCommand & {
|
|
83
|
+
__commandName: 'COLLECTION_FILL'
|
|
84
|
+
inputs?: Array<
|
|
85
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
86
|
+
| DataCalcInput<'start', any> /* default: 0 */
|
|
87
|
+
| DataCalcInput<'length', any> /* default: length to end of array */
|
|
88
|
+
| DataCalcInput<'value', any> /* default: undefined */
|
|
89
|
+
>
|
|
90
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Filter — Filter the content that meets the conditions in the array or object.
|
|
94
|
+
If predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.
|
|
95
|
+
If predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
96
|
+
export type DataCommandCollectionFilter = DataCommand & {
|
|
97
|
+
__commandName: 'COLLECTION_FILTER'
|
|
98
|
+
inputs?: Array<
|
|
99
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
100
|
+
| DataCalcInput<'predicate', object> /* default: undefined */
|
|
101
|
+
| DataCalcInput<
|
|
102
|
+
'iteratee_result_valid',
|
|
103
|
+
boolean
|
|
104
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
105
|
+
>
|
|
106
|
+
outputs?: Array<
|
|
107
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
108
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
109
|
+
>
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Find — Find first value by condition in array.
|
|
113
|
+
If predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.
|
|
114
|
+
If predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
115
|
+
export type DataCommandCollectionFind = DataCommand & {
|
|
116
|
+
__commandName: 'COLLECTION_FIND'
|
|
117
|
+
inputs?: Array<
|
|
118
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
119
|
+
| DataCalcInput<'predicate', object> /* default: undefined */
|
|
120
|
+
| DataCalcInput<
|
|
121
|
+
'iteratee_result_valid',
|
|
122
|
+
boolean
|
|
123
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
124
|
+
| DataCalcInput<'forward', boolean> /* default: true */
|
|
125
|
+
>
|
|
126
|
+
outputs?: Array<
|
|
127
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
128
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
129
|
+
>
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Find Key — Find key of first value by condition in array.
|
|
133
|
+
If predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.
|
|
134
|
+
If predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
135
|
+
export type DataCommandCollectionFindKey = DataCommand & {
|
|
136
|
+
__commandName: 'COLLECTION_FIND_KEY'
|
|
137
|
+
inputs?: Array<
|
|
138
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
139
|
+
| DataCalcInput<'predicate', object> /* default: undefined */
|
|
140
|
+
| DataCalcInput<
|
|
141
|
+
'iteratee_result_valid',
|
|
142
|
+
boolean
|
|
143
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
144
|
+
| DataCalcInput<'forward', boolean> /* default: true */
|
|
145
|
+
>
|
|
146
|
+
outputs?: Array<
|
|
147
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
148
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
149
|
+
>
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* First — Get first value in array */
|
|
153
|
+
export type DataCommandCollectionFirst = DataCommand & {
|
|
154
|
+
__commandName: 'COLLECTION_FIRST'
|
|
155
|
+
inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>
|
|
156
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Flatten — Flatten a single level deep or recursively deep. */
|
|
160
|
+
export type DataCommandCollectionFlatten = DataCommand & {
|
|
161
|
+
__commandName: 'COLLECTION_FLATTEN'
|
|
162
|
+
inputs?: Array<
|
|
163
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
164
|
+
| DataCalcInput<'deep', boolean> /* default: true */
|
|
165
|
+
>
|
|
166
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Group By — Group array elements or object attributes into groups and generate objects.
|
|
170
|
+
If group_by_path provided, it will use value from path to group, use whole value as key if path is empty string, then output to result.
|
|
171
|
+
If group_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_group, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
172
|
+
export type DataCommandCollectionGroupBy = DataCommand & {
|
|
173
|
+
__commandName: 'COLLECTION_GROUP_BY'
|
|
174
|
+
inputs?: Array<
|
|
175
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
176
|
+
| DataCalcInput<'group_by_path', string> /* default: undefined */
|
|
177
|
+
| DataCalcInput<
|
|
178
|
+
'iteratee_result_group',
|
|
179
|
+
string
|
|
180
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
181
|
+
>
|
|
182
|
+
outputs?: Array<
|
|
183
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
184
|
+
| DataCalcOutput<'result'> /* target: object */
|
|
185
|
+
>
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Includes — Check value in array. */
|
|
189
|
+
export type DataCommandCollectionIncludes = DataCommand & {
|
|
190
|
+
__commandName: 'COLLECTION_INCLUDES'
|
|
191
|
+
inputs?: Array<
|
|
192
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
193
|
+
| DataCalcInput<'value', any> /* default: undefined */
|
|
194
|
+
| DataCalcInput<'from_index', any> /* default: 0 */
|
|
195
|
+
>
|
|
196
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: boolean */>
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Intersection — Get arrays intersection.
|
|
200
|
+
If intersection_by_path provided, it will use value from path to intersect, use whole value as key if path is empty string, then output to result.
|
|
201
|
+
If intersection_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
202
|
+
export type DataCommandCollectionIntersection = DataCommand & {
|
|
203
|
+
__commandName: 'COLLECTION_INTERSECTION'
|
|
204
|
+
inputs?: Array<
|
|
205
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
206
|
+
| DataCalcInput<'intersection_by_path', string> /* default: undefined */
|
|
207
|
+
| DataCalcInput<
|
|
208
|
+
'iteratee_result_value',
|
|
209
|
+
any
|
|
210
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
211
|
+
>
|
|
212
|
+
outputs?: Array<
|
|
213
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
214
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
215
|
+
>
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* Key By — Use the specified value as the property name of the new object.
|
|
219
|
+
If key_by_path provided, it will use value from path as key, use whole value as key if path is empty string, then output to result.
|
|
220
|
+
If key_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_key, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
221
|
+
export type DataCommandCollectionKeyBy = DataCommand & {
|
|
222
|
+
__commandName: 'COLLECTION_KEY_BY'
|
|
223
|
+
inputs?: Array<
|
|
224
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
225
|
+
| DataCalcInput<'key_by_path', string> /* default: undefined */
|
|
226
|
+
| DataCalcInput<
|
|
227
|
+
'iteratee_result_key',
|
|
228
|
+
string
|
|
229
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
230
|
+
>
|
|
231
|
+
outputs?: Array<
|
|
232
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
233
|
+
| DataCalcOutput<'result'> /* target: object */
|
|
234
|
+
>
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Last — Get last value of array. */
|
|
238
|
+
export type DataCommandCollectionLast = DataCommand & {
|
|
239
|
+
__commandName: 'COLLECTION_LAST'
|
|
240
|
+
inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>
|
|
241
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Map — Map to new array.
|
|
245
|
+
If map_by_path provided, it will use value from path, use whole value if path is empty string, then output to result.
|
|
246
|
+
If map_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
247
|
+
export type DataCommandCollectionMap = DataCommand & {
|
|
248
|
+
__commandName: 'COLLECTION_MAP'
|
|
249
|
+
inputs?: Array<
|
|
250
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
251
|
+
| DataCalcInput<'map_by_path', string> /* default: undefined */
|
|
252
|
+
| DataCalcInput<
|
|
253
|
+
'iteratee_result_value',
|
|
254
|
+
any
|
|
255
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
256
|
+
>
|
|
257
|
+
outputs?: Array<
|
|
258
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
259
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
260
|
+
>
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Nth — Get N th value of array. */
|
|
264
|
+
export type DataCommandCollectionNth = DataCommand & {
|
|
265
|
+
__commandName: 'COLLECTION_NTH'
|
|
266
|
+
inputs?: Array<
|
|
267
|
+
DataCalcInput<'array', Array<any>> /* default: [] */ | DataCalcInput<'n', any> /* default: 0 */
|
|
268
|
+
>
|
|
269
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* Push — Push value into array. */
|
|
273
|
+
export type DataCommandCollectionPush = DataCommand & {
|
|
274
|
+
__commandName: 'COLLECTION_PUSH'
|
|
275
|
+
inputs?: Array<
|
|
276
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
277
|
+
| DataCalcInput<'forward', boolean> /* default: true */
|
|
278
|
+
| DataCalcInput<'var1', any> /* default: undefined */
|
|
279
|
+
| DataCalcInput<'var2', any> /* default: undefined */
|
|
280
|
+
| DataCalcInput<'var3', any> /* default: undefined */
|
|
281
|
+
>
|
|
282
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Reduce — Reduce the array to a single result.
|
|
286
|
+
It will trigger iteratee_input callback for every property (With { result, key, value }). After the calculation triggered iteratee_result, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
287
|
+
export type DataCommandCollectionReduce = DataCommand & {
|
|
288
|
+
__commandName: 'COLLECTION_REDUCE'
|
|
289
|
+
inputs?: Array<
|
|
290
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
291
|
+
| DataCalcInput<'initial_value', any> /* default: undefined */
|
|
292
|
+
| DataCalcInput<'iteratee_result', any> /* iteratee callback input */ /* default: undefined */
|
|
293
|
+
>
|
|
294
|
+
outputs?: Array<
|
|
295
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
296
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
297
|
+
>
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Reverse — Reverse array */
|
|
301
|
+
export type DataCommandCollectionReverse = DataCommand & {
|
|
302
|
+
__commandName: 'COLLECTION_REVERSE'
|
|
303
|
+
inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>
|
|
304
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* Sample — Get N th value of array randomly. */
|
|
308
|
+
export type DataCommandCollectionSample = DataCommand & {
|
|
309
|
+
__commandName: 'COLLECTION_SAMPLE'
|
|
310
|
+
inputs?: Array<
|
|
311
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
312
|
+
| DataCalcInput<'n', any> /* default: 0 */
|
|
313
|
+
>
|
|
314
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* Shuffie — Shuffie array order. */
|
|
318
|
+
export type DataCommandCollectionShuffle = DataCommand & {
|
|
319
|
+
__commandName: 'COLLECTION_SHUFFLE'
|
|
320
|
+
inputs?: Array<DataCalcInput<'array', Array<any>> /* default: [] */>
|
|
321
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Size — Get array size. */
|
|
325
|
+
export type DataCommandCollectionSize = DataCommand & {
|
|
326
|
+
__commandName: 'COLLECTION_SIZE'
|
|
327
|
+
inputs?: Array<DataCalcInput<'collection', Array<any> | object> /* default: [] */>
|
|
328
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Slice — Slice array. */
|
|
332
|
+
export type DataCommandCollectionSlice = DataCommand & {
|
|
333
|
+
__commandName: 'COLLECTION_SLICE'
|
|
334
|
+
inputs?: Array<
|
|
335
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
336
|
+
| DataCalcInput<'start', any> /* default: 0 */
|
|
337
|
+
| DataCalcInput<'end', any> /* default: Array length */
|
|
338
|
+
>
|
|
339
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Some — Check whether any of the array or object property meets the conditions.
|
|
343
|
+
If predicate provided, it will use LOGICTYPE_EQUAL_VALUE to compare, then output to result.
|
|
344
|
+
If predicate not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_valid, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
345
|
+
export type DataCommandCollectionSome = DataCommand & {
|
|
346
|
+
__commandName: 'COLLECTION_SOME'
|
|
347
|
+
inputs?: Array<
|
|
348
|
+
| DataCalcInput<'collection', Array<any> | object> /* default: [] */
|
|
349
|
+
| DataCalcInput<'predicate', object> /* default: undefined */
|
|
350
|
+
| DataCalcInput<
|
|
351
|
+
'iteratee_result_valid',
|
|
352
|
+
boolean
|
|
353
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
354
|
+
>
|
|
355
|
+
outputs?: Array<
|
|
356
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
357
|
+
| DataCalcOutput<'result'> /* target: boolean */
|
|
358
|
+
>
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Sort — Sort array.
|
|
362
|
+
If sort_by_path provided, it will use value from path to sort, use whole value if path is empty string, then output to result.
|
|
363
|
+
If sort_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
364
|
+
export type DataCommandCollectionSort = DataCommand & {
|
|
365
|
+
__commandName: 'COLLECTION_SORT'
|
|
366
|
+
inputs?: Array<
|
|
367
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
368
|
+
| DataCalcInput<'sort_by_path', string | Array<any>> /* default: undefined */
|
|
369
|
+
| DataCalcInput<
|
|
370
|
+
'iteratee_result_value',
|
|
371
|
+
any
|
|
372
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
373
|
+
>
|
|
374
|
+
outputs?: Array<
|
|
375
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
376
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
377
|
+
>
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Take — Creates a slice of array with n elements taken from the beginning. */
|
|
381
|
+
export type DataCommandCollectionTake = DataCommand & {
|
|
382
|
+
__commandName: 'COLLECTION_TAKE'
|
|
383
|
+
inputs?: Array<
|
|
384
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
385
|
+
| DataCalcInput<'n', any> /* default: 1 */
|
|
386
|
+
| DataCalcInput<'forward', boolean> /* default: true */
|
|
387
|
+
>
|
|
388
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* Union — Creates an array of unique values, in order, from all given arrays.
|
|
392
|
+
If union_by_path provided, it will use path to compare, then output to result.
|
|
393
|
+
If union_by_path not provided, it will trigger iteratee_input callback for every property (With { key, value }). After the calculation triggered iteratee_result_value, it will confirm whether to continue the next trigger of iteratee_input. Finally, it will trigger result output. */
|
|
394
|
+
export type DataCommandCollectionUnion = DataCommand & {
|
|
395
|
+
__commandName: 'COLLECTION_UNION'
|
|
396
|
+
inputs?: Array<
|
|
397
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
398
|
+
| DataCalcInput<'union_by_path', string> /* default: "" */
|
|
399
|
+
| DataCalcInput<
|
|
400
|
+
'iteratee_result_value',
|
|
401
|
+
any
|
|
402
|
+
> /* iteratee callback input */ /* default: undefined */
|
|
403
|
+
>
|
|
404
|
+
outputs?: Array<
|
|
405
|
+
| DataCalcOutput<'iteratee_input'> /* iteratee callback */ /* target: object */
|
|
406
|
+
| DataCalcOutput<'result'> /* target: any */
|
|
407
|
+
>
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* Without — Creates an array excluding all given values. */
|
|
411
|
+
export type DataCommandCollectionWithout = DataCommand & {
|
|
412
|
+
__commandName: 'COLLECTION_WITHOUT'
|
|
413
|
+
inputs?: Array<
|
|
414
|
+
| DataCalcInput<'array', Array<any>> /* default: [] */
|
|
415
|
+
| DataCalcInput<'exclude', Array<any>> /* default: [] */
|
|
416
|
+
>
|
|
417
|
+
outputs?: Array<DataCalcOutput<'result'> /* target: any */>
|
|
418
|
+
}
|