@ldsg/workflow 0.3.31 → 0.3.32
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/__tests__/unit/evaluate-variables.prefixItems.test.js +197 -191
- package/dist/__tests__/unit/resource.js +61 -61
- package/dist/__tests__/unit/resource.portId.test.js +144 -144
- package/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -10
- package/dist/handler.d.ts +4 -4
- package/dist/index.d.ts +5 -5
- package/dist/instantiate-resource.d.ts +4 -4
- package/dist/instantiate-resource.js +1 -1
- package/dist/resource.d.ts +2 -2
- package/dist/resource.js +12 -12
- package/dist/types/index.d.ts +6 -6
- package/dist/types/json_schema_with_expression_extension.d.ts +6 -6
- package/dist/types/json_schema_with_expression_extension.d.ts.map +1 -1
- package/dist/types/node.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts.map +1 -1
- package/dist/types/specific-resource-settings.js +1 -1
- package/dist/types/workflow.d.ts +3 -3
- package/dist/utils/evaluate-variables/constants.js +17 -17
- package/dist/utils/evaluate-variables/index.d.ts +1 -1
- package/dist/utils/evaluate-variables/index.debug.js +79 -79
- package/dist/utils/evaluate-variables/index.js +2 -2
- package/dist/utils/evaluate-variables/utils/get-data-with-json-schema-and-input/index.d.ts +1 -1
- package/dist/utils/evaluate-variables/utils/get-data-with-json-schema-and-input/index.js +2 -2
- package/dist/utils/evaluate-variables/utils/get-data-with-json-schema-and-input/resolve-json-schema.d.ts +1 -1
- package/dist/utils/evaluate-variables/utils/get-data-with-json-schema-and-input/resolve-json-schema.js +11 -11
- package/dist/utils/evaluate-variables/utils/get-field-path-by-field-type-key.js +3 -3
- package/dist/utils/execute-workflow.d.ts +2 -2
- package/dist/utils/execute-workflow.d.ts.map +1 -1
- package/dist/utils/execute-workflow.js +19 -17
- package/package.json +11 -7
|
@@ -1,391 +1,397 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const evaluate_variables_1 = require("../../utils/evaluate-variables");
|
|
4
|
-
describe(
|
|
5
|
-
describe(
|
|
6
|
-
it(
|
|
4
|
+
describe("evaluateVariables with prefixItems", () => {
|
|
5
|
+
describe("basic prefixItems functionality", () => {
|
|
6
|
+
it("should return array with all evaluated expressions", async () => {
|
|
7
7
|
const variables = {
|
|
8
|
-
|
|
8
|
+
"694bf14e2af2addf73c8c849": {
|
|
9
9
|
data: {
|
|
10
|
-
suite_access_token:
|
|
11
|
-
}
|
|
10
|
+
suite_access_token: "token_from_first_source",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
"694c81a0f12010773020eafb": {
|
|
14
|
+
suite_access_token: "token_from_second_source",
|
|
12
15
|
},
|
|
13
|
-
'694c81a0f12010773020eafb': {
|
|
14
|
-
suite_access_token: 'token_from_second_source'
|
|
15
|
-
}
|
|
16
16
|
};
|
|
17
17
|
const jsonSchema = {
|
|
18
|
-
type:
|
|
18
|
+
type: "object",
|
|
19
19
|
properties: {
|
|
20
20
|
tokens: {
|
|
21
|
-
type:
|
|
21
|
+
type: "array",
|
|
22
22
|
prefixItems: [
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
"x-expression": '$.\"694bf14e2af2addf73c8c849\".\"data\".\"suite_access_token\"',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
27
|
+
"x-expression": '$.\"694c81a0f12010773020eafb\".\"suite_access_token\"',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
32
|
};
|
|
33
33
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
34
|
-
expect(result.variables.tokens).toEqual([
|
|
34
|
+
expect(result.variables.tokens).toEqual([
|
|
35
|
+
"token_from_first_source",
|
|
36
|
+
"token_from_second_source",
|
|
37
|
+
]);
|
|
35
38
|
});
|
|
36
|
-
it(
|
|
39
|
+
it("should handle single prefixItem", async () => {
|
|
37
40
|
const variables = {
|
|
38
41
|
source1: {
|
|
39
|
-
value:
|
|
40
|
-
}
|
|
42
|
+
value: "test_value",
|
|
43
|
+
},
|
|
41
44
|
};
|
|
42
45
|
const jsonSchema = {
|
|
43
|
-
type:
|
|
46
|
+
type: "object",
|
|
44
47
|
properties: {
|
|
45
48
|
items: {
|
|
46
|
-
type:
|
|
49
|
+
type: "array",
|
|
47
50
|
prefixItems: [
|
|
48
51
|
{
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
52
|
+
"x-expression": "$.source1.value",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
54
57
|
};
|
|
55
58
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
56
|
-
expect(result.variables.items).toEqual([
|
|
59
|
+
expect(result.variables.items).toEqual(["test_value"]);
|
|
57
60
|
});
|
|
58
61
|
});
|
|
59
|
-
describe(
|
|
60
|
-
it(
|
|
62
|
+
describe("handling different value types", () => {
|
|
63
|
+
it("should handle null values in prefixItems", async () => {
|
|
61
64
|
const variables = {
|
|
62
65
|
source1: {
|
|
63
|
-
value: null
|
|
66
|
+
value: null,
|
|
64
67
|
},
|
|
65
68
|
source2: {
|
|
66
|
-
value:
|
|
67
|
-
}
|
|
69
|
+
value: "valid_value",
|
|
70
|
+
},
|
|
68
71
|
};
|
|
69
72
|
const jsonSchema = {
|
|
70
|
-
type:
|
|
73
|
+
type: "object",
|
|
71
74
|
properties: {
|
|
72
75
|
items: {
|
|
73
|
-
type:
|
|
76
|
+
type: "array",
|
|
74
77
|
prefixItems: [
|
|
75
78
|
{
|
|
76
|
-
|
|
79
|
+
"x-expression": "$.source1.value",
|
|
77
80
|
},
|
|
78
81
|
{
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
82
|
+
"x-expression": "$.source2.value",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
84
87
|
};
|
|
85
88
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
86
|
-
expect(result.variables.items).toEqual([null,
|
|
89
|
+
expect(result.variables.items).toEqual([null, "valid_value"]);
|
|
87
90
|
});
|
|
88
|
-
it(
|
|
91
|
+
it("should handle undefined values in prefixItems", async () => {
|
|
89
92
|
const variables = {
|
|
90
93
|
source2: {
|
|
91
|
-
value:
|
|
92
|
-
}
|
|
94
|
+
value: "valid_value",
|
|
95
|
+
},
|
|
93
96
|
};
|
|
94
97
|
const jsonSchema = {
|
|
95
|
-
type:
|
|
98
|
+
type: "object",
|
|
96
99
|
properties: {
|
|
97
100
|
items: {
|
|
98
|
-
type:
|
|
101
|
+
type: "array",
|
|
99
102
|
prefixItems: [
|
|
100
103
|
{
|
|
101
|
-
|
|
104
|
+
"x-expression": "$.source1.value",
|
|
102
105
|
},
|
|
103
106
|
{
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
}
|
|
107
|
+
"x-expression": "$.source2.value",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
109
112
|
};
|
|
110
113
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
111
|
-
expect(result.variables.items).toEqual([undefined,
|
|
114
|
+
expect(result.variables.items).toEqual([undefined, "valid_value"]);
|
|
112
115
|
});
|
|
113
|
-
it(
|
|
116
|
+
it("should handle number values", async () => {
|
|
114
117
|
const variables = {
|
|
115
118
|
source1: {
|
|
116
|
-
value: 42
|
|
119
|
+
value: 42,
|
|
117
120
|
},
|
|
118
121
|
source2: {
|
|
119
|
-
value: 100
|
|
120
|
-
}
|
|
122
|
+
value: 100,
|
|
123
|
+
},
|
|
121
124
|
};
|
|
122
125
|
const jsonSchema = {
|
|
123
|
-
type:
|
|
126
|
+
type: "object",
|
|
124
127
|
properties: {
|
|
125
128
|
numbers: {
|
|
126
|
-
type:
|
|
129
|
+
type: "array",
|
|
127
130
|
prefixItems: [
|
|
128
131
|
{
|
|
129
|
-
|
|
132
|
+
"x-expression": "$.source1.value",
|
|
130
133
|
},
|
|
131
134
|
{
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
135
|
+
"x-expression": "$.source2.value",
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
},
|
|
137
140
|
};
|
|
138
141
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
139
142
|
expect(result.variables.numbers).toEqual([42, 100]);
|
|
140
143
|
});
|
|
141
|
-
it(
|
|
144
|
+
it("should handle boolean values", async () => {
|
|
142
145
|
const variables = {
|
|
143
146
|
source1: {
|
|
144
|
-
value: true
|
|
147
|
+
value: true,
|
|
145
148
|
},
|
|
146
149
|
source2: {
|
|
147
|
-
value: false
|
|
148
|
-
}
|
|
150
|
+
value: false,
|
|
151
|
+
},
|
|
149
152
|
};
|
|
150
153
|
const jsonSchema = {
|
|
151
|
-
type:
|
|
154
|
+
type: "object",
|
|
152
155
|
properties: {
|
|
153
156
|
booleans: {
|
|
154
|
-
type:
|
|
157
|
+
type: "array",
|
|
155
158
|
prefixItems: [
|
|
156
159
|
{
|
|
157
|
-
|
|
160
|
+
"x-expression": "$.source1.value",
|
|
158
161
|
},
|
|
159
162
|
{
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
163
|
+
"x-expression": "$.source2.value",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
165
168
|
};
|
|
166
169
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
167
170
|
expect(result.variables.booleans).toEqual([true, false]);
|
|
168
171
|
});
|
|
169
|
-
it(
|
|
172
|
+
it("should handle object values", async () => {
|
|
170
173
|
const variables = {
|
|
171
174
|
source1: {
|
|
172
175
|
data: {
|
|
173
|
-
name:
|
|
174
|
-
age: 30
|
|
175
|
-
}
|
|
176
|
+
name: "Alice",
|
|
177
|
+
age: 30,
|
|
178
|
+
},
|
|
176
179
|
},
|
|
177
180
|
source2: {
|
|
178
181
|
data: {
|
|
179
|
-
name:
|
|
180
|
-
age: 25
|
|
181
|
-
}
|
|
182
|
-
}
|
|
182
|
+
name: "Bob",
|
|
183
|
+
age: 25,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
183
186
|
};
|
|
184
187
|
const jsonSchema = {
|
|
185
|
-
type:
|
|
188
|
+
type: "object",
|
|
186
189
|
properties: {
|
|
187
190
|
users: {
|
|
188
|
-
type:
|
|
191
|
+
type: "array",
|
|
189
192
|
prefixItems: [
|
|
190
193
|
{
|
|
191
|
-
|
|
194
|
+
"x-expression": "$.source1.data",
|
|
192
195
|
},
|
|
193
196
|
{
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
}
|
|
197
|
+
"x-expression": "$.source2.data",
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
199
202
|
};
|
|
200
203
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
201
204
|
expect(result.variables.users).toEqual([
|
|
202
|
-
{ name:
|
|
203
|
-
{ name:
|
|
205
|
+
{ name: "Alice", age: 30 },
|
|
206
|
+
{ name: "Bob", age: 25 },
|
|
204
207
|
]);
|
|
205
208
|
});
|
|
206
209
|
});
|
|
207
|
-
describe(
|
|
208
|
-
it(
|
|
210
|
+
describe("complex expressions", () => {
|
|
211
|
+
it("should handle complex jsonata expressions", async () => {
|
|
209
212
|
const variables = {
|
|
210
213
|
Account: {
|
|
211
|
-
|
|
214
|
+
"Account Name": "TestAccount",
|
|
212
215
|
Order: [
|
|
213
|
-
{ OrderID:
|
|
214
|
-
{ OrderID:
|
|
215
|
-
]
|
|
216
|
-
}
|
|
216
|
+
{ OrderID: "order1", total: 100 },
|
|
217
|
+
{ OrderID: "order2", total: 200 },
|
|
218
|
+
],
|
|
219
|
+
},
|
|
217
220
|
};
|
|
218
221
|
const jsonSchema = {
|
|
219
|
-
type:
|
|
222
|
+
type: "object",
|
|
220
223
|
properties: {
|
|
221
224
|
results: {
|
|
222
|
-
type:
|
|
225
|
+
type: "array",
|
|
223
226
|
prefixItems: [
|
|
224
227
|
{
|
|
225
|
-
|
|
228
|
+
"x-expression": 'Account."Account Name"',
|
|
226
229
|
},
|
|
227
230
|
{
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
}
|
|
231
|
+
"x-expression": "$sum(Account.Order.total)",
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
233
236
|
};
|
|
234
237
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
235
|
-
expect(result.variables.results).toEqual([
|
|
238
|
+
expect(result.variables.results).toEqual(["TestAccount", 300]);
|
|
236
239
|
});
|
|
237
240
|
});
|
|
238
|
-
describe(
|
|
239
|
-
it(
|
|
241
|
+
describe("mixed schema features", () => {
|
|
242
|
+
it("should work with nested objects", async () => {
|
|
240
243
|
const variables = {
|
|
241
|
-
source1: { value:
|
|
242
|
-
source2: { value:
|
|
244
|
+
source1: { value: "first" },
|
|
245
|
+
source2: { value: "second" },
|
|
243
246
|
};
|
|
244
247
|
const jsonSchema = {
|
|
245
|
-
type:
|
|
248
|
+
type: "object",
|
|
246
249
|
properties: {
|
|
247
250
|
nested: {
|
|
248
|
-
type:
|
|
251
|
+
type: "object",
|
|
249
252
|
properties: {
|
|
250
253
|
items: {
|
|
251
|
-
type:
|
|
254
|
+
type: "array",
|
|
252
255
|
prefixItems: [
|
|
253
256
|
{
|
|
254
|
-
|
|
257
|
+
"x-expression": "$.source1.value",
|
|
255
258
|
},
|
|
256
259
|
{
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
260
|
+
"x-expression": "$.source2.value",
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
264
267
|
};
|
|
265
268
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
266
|
-
expect(result.variables.nested.items).toEqual([
|
|
269
|
+
expect(result.variables.nested.items).toEqual(["first", "second"]);
|
|
267
270
|
});
|
|
268
|
-
it(
|
|
271
|
+
it("should work alongside regular properties", async () => {
|
|
269
272
|
const variables = {
|
|
270
|
-
source1: { value:
|
|
271
|
-
source2: { value:
|
|
272
|
-
source3: { value:
|
|
273
|
+
source1: { value: "a" },
|
|
274
|
+
source2: { value: "b" },
|
|
275
|
+
source3: { value: "c" },
|
|
273
276
|
};
|
|
274
277
|
const jsonSchema = {
|
|
275
|
-
type:
|
|
278
|
+
type: "object",
|
|
276
279
|
properties: {
|
|
277
280
|
singleValue: {
|
|
278
|
-
|
|
281
|
+
"x-expression": "$.source3.value",
|
|
279
282
|
},
|
|
280
283
|
arrayValue: {
|
|
281
|
-
type:
|
|
284
|
+
type: "array",
|
|
282
285
|
prefixItems: [
|
|
283
286
|
{
|
|
284
|
-
|
|
287
|
+
"x-expression": "$.source1.value",
|
|
285
288
|
},
|
|
286
289
|
{
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
]
|
|
290
|
-
}
|
|
291
|
-
}
|
|
290
|
+
"x-expression": "$.source2.value",
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
},
|
|
294
|
+
},
|
|
292
295
|
};
|
|
293
296
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
294
|
-
expect(result.variables.singleValue).toBe(
|
|
295
|
-
expect(result.variables.arrayValue).toEqual([
|
|
297
|
+
expect(result.variables.singleValue).toBe("c");
|
|
298
|
+
expect(result.variables.arrayValue).toEqual(["a", "b"]);
|
|
296
299
|
});
|
|
297
300
|
});
|
|
298
|
-
describe(
|
|
299
|
-
it(
|
|
301
|
+
describe("user schema example", () => {
|
|
302
|
+
it("should handle the exact schema from user requirement", async () => {
|
|
300
303
|
const variables = {
|
|
301
|
-
|
|
304
|
+
"694bf14e2af2addf73c8c849": {
|
|
302
305
|
data: {
|
|
303
|
-
suite_access_token:
|
|
304
|
-
}
|
|
306
|
+
suite_access_token: "token_from_first_source",
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
"694c81a0f12010773020eafb": {
|
|
310
|
+
suite_access_token: "token_from_second_source",
|
|
305
311
|
},
|
|
306
|
-
'694c81a0f12010773020eafb': {
|
|
307
|
-
suite_access_token: 'token_from_second_source'
|
|
308
|
-
}
|
|
309
312
|
};
|
|
310
313
|
const jsonSchema = {
|
|
311
|
-
type:
|
|
314
|
+
type: "object",
|
|
312
315
|
properties: {
|
|
313
316
|
input: {
|
|
314
|
-
type:
|
|
317
|
+
type: "object",
|
|
315
318
|
properties: {
|
|
316
319
|
value: {
|
|
317
|
-
title:
|
|
318
|
-
description:
|
|
319
|
-
type:
|
|
320
|
+
title: "值",
|
|
321
|
+
description: "取首个有效值",
|
|
322
|
+
type: "array",
|
|
320
323
|
prefixItems: [
|
|
321
324
|
{
|
|
322
|
-
|
|
325
|
+
"x-expression": '$.\"694bf14e2af2addf73c8c849\".\"data\".\"suite_access_token\"',
|
|
323
326
|
},
|
|
324
327
|
{
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
]
|
|
328
|
-
}
|
|
329
|
-
}
|
|
328
|
+
"x-expression": '$.\"694c81a0f12010773020eafb\".\"suite_access_token\"',
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
330
333
|
},
|
|
331
334
|
output: {
|
|
332
|
-
type:
|
|
335
|
+
type: "object",
|
|
333
336
|
properties: {
|
|
334
337
|
value: {
|
|
335
|
-
title:
|
|
336
|
-
type:
|
|
337
|
-
}
|
|
338
|
+
title: "值",
|
|
339
|
+
type: "object",
|
|
340
|
+
},
|
|
338
341
|
},
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
}
|
|
342
|
+
"x-expression": "$",
|
|
343
|
+
"x-expression-const": "$",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
343
346
|
};
|
|
344
347
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
345
|
-
expect(result.variables.input.value).toEqual([
|
|
348
|
+
expect(result.variables.input.value).toEqual([
|
|
349
|
+
"token_from_first_source",
|
|
350
|
+
"token_from_second_source",
|
|
351
|
+
]);
|
|
346
352
|
expect(result.variables.output).toBeDefined();
|
|
347
353
|
});
|
|
348
354
|
});
|
|
349
|
-
describe(
|
|
350
|
-
it(
|
|
355
|
+
describe("edge cases", () => {
|
|
356
|
+
it("should handle empty prefixItems array", async () => {
|
|
351
357
|
const variables = {};
|
|
352
358
|
const jsonSchema = {
|
|
353
|
-
type:
|
|
359
|
+
type: "object",
|
|
354
360
|
properties: {
|
|
355
361
|
items: {
|
|
356
|
-
type:
|
|
357
|
-
prefixItems: []
|
|
358
|
-
}
|
|
359
|
-
}
|
|
362
|
+
type: "array",
|
|
363
|
+
prefixItems: [],
|
|
364
|
+
},
|
|
365
|
+
},
|
|
360
366
|
};
|
|
361
367
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
362
368
|
expect(result.variables.items).toEqual([]);
|
|
363
369
|
});
|
|
364
|
-
it(
|
|
370
|
+
it("should handle multiple prefixItems with same expression", async () => {
|
|
365
371
|
const variables = {
|
|
366
|
-
source: { value:
|
|
372
|
+
source: { value: "same_value" },
|
|
367
373
|
};
|
|
368
374
|
const jsonSchema = {
|
|
369
|
-
type:
|
|
375
|
+
type: "object",
|
|
370
376
|
properties: {
|
|
371
377
|
items: {
|
|
372
|
-
type:
|
|
378
|
+
type: "array",
|
|
373
379
|
prefixItems: [
|
|
374
380
|
{
|
|
375
|
-
|
|
381
|
+
"x-expression": "$.source.value",
|
|
376
382
|
},
|
|
377
383
|
{
|
|
378
|
-
|
|
384
|
+
"x-expression": "$.source.value",
|
|
379
385
|
},
|
|
380
386
|
{
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
}
|
|
387
|
+
"x-expression": "$.source.value",
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
},
|
|
391
|
+
},
|
|
386
392
|
};
|
|
387
393
|
const result = await (0, evaluate_variables_1.evaluateVariables)({ jsonSchema, variables });
|
|
388
|
-
expect(result.variables.items).toEqual([
|
|
394
|
+
expect(result.variables.items).toEqual(["same_value", "same_value", "same_value"]);
|
|
389
395
|
});
|
|
390
396
|
});
|
|
391
397
|
});
|