@botpress/cli 1.4.3 → 1.4.4
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/.turbo/turbo-build.log +10 -10
- package/dist/linter/ruleset-tests/bot.ruleset.test.js +58 -56
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +2 -2
- package/dist/linter/ruleset-tests/integration.ruleset.test.js +110 -117
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +2 -2
- package/dist/linter/ruleset-tests/interface.ruleset.test.js +76 -84
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +2 -2
- package/dist/linter/rulesets/bot.ruleset.js +8 -8
- package/dist/linter/rulesets/bot.ruleset.js.map +2 -2
- package/dist/linter/rulesets/integration.ruleset.js +14 -14
- package/dist/linter/rulesets/integration.ruleset.js.map +2 -2
- package/dist/linter/rulesets/interface.ruleset.js +8 -8
- package/dist/linter/rulesets/interface.ruleset.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@ const ACTION_NAME = "actionName";
|
|
|
9
9
|
const EVENT_NAME = "eventName";
|
|
10
10
|
const CONFIG_NAME = "configName";
|
|
11
11
|
const PARAM_NAME = "paramName";
|
|
12
|
+
const PROPERTIES_PARAM = "properties";
|
|
13
|
+
const PARAM_NAMES = [PARAM_NAME, PROPERTIES_PARAM];
|
|
12
14
|
const TAG_NAME = "tagName";
|
|
13
15
|
const CHANNEL_NAME = "channelName";
|
|
14
16
|
const STATE_NAME = "stateName";
|
|
@@ -139,39 +141,30 @@ describeRule("actions-must-have-a-description", (lint) => {
|
|
|
139
141
|
});
|
|
140
142
|
});
|
|
141
143
|
describeRule("action-inputparams-should-have-a-title", (lint) => {
|
|
142
|
-
|
|
144
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
143
145
|
const definition = {
|
|
144
|
-
actions: { [ACTION_NAME]: { input: { schema: { properties: { [
|
|
146
|
+
actions: { [ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } } }
|
|
145
147
|
};
|
|
146
148
|
const results = await lint(definition);
|
|
147
149
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
148
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties",
|
|
150
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName, ZUI]);
|
|
149
151
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
150
152
|
});
|
|
151
|
-
|
|
153
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
152
154
|
const definition = {
|
|
153
155
|
actions: {
|
|
154
|
-
[ACTION_NAME]: { input: { schema: { properties: { [
|
|
156
|
+
[ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
const results = await lint(definition);
|
|
158
160
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
159
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual([
|
|
160
|
-
"actions",
|
|
161
|
-
ACTION_NAME,
|
|
162
|
-
"input",
|
|
163
|
-
"schema",
|
|
164
|
-
"properties",
|
|
165
|
-
PARAM_NAME,
|
|
166
|
-
ZUI,
|
|
167
|
-
"title"
|
|
168
|
-
]);
|
|
161
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName, ZUI, "title"]);
|
|
169
162
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
170
163
|
});
|
|
171
|
-
|
|
164
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
172
165
|
const definition = {
|
|
173
166
|
actions: {
|
|
174
|
-
[ACTION_NAME]: { input: { schema: { properties: { [
|
|
167
|
+
[ACTION_NAME]: { input: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
|
|
175
168
|
}
|
|
176
169
|
};
|
|
177
170
|
const results = await lint(definition);
|
|
@@ -179,19 +172,19 @@ describeRule("action-inputparams-should-have-a-title", (lint) => {
|
|
|
179
172
|
});
|
|
180
173
|
});
|
|
181
174
|
describeRule("action-inputparams-must-have-a-description", (lint) => {
|
|
182
|
-
|
|
175
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
183
176
|
const definition = {
|
|
184
|
-
actions: { [ACTION_NAME]: { input: { schema: { properties: { [
|
|
177
|
+
actions: { [ACTION_NAME]: { input: { schema: { properties: { [paramName]: {} } } } } }
|
|
185
178
|
};
|
|
186
179
|
const results = await lint(definition);
|
|
187
180
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
188
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties",
|
|
181
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "input", "schema", "properties", paramName]);
|
|
189
182
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
190
183
|
});
|
|
191
|
-
|
|
184
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
192
185
|
const definition = {
|
|
193
186
|
actions: {
|
|
194
|
-
[ACTION_NAME]: { input: { schema: { properties: { [
|
|
187
|
+
[ACTION_NAME]: { input: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
|
|
195
188
|
}
|
|
196
189
|
};
|
|
197
190
|
const results = await lint(definition);
|
|
@@ -202,15 +195,15 @@ describeRule("action-inputparams-must-have-a-description", (lint) => {
|
|
|
202
195
|
"input",
|
|
203
196
|
"schema",
|
|
204
197
|
"properties",
|
|
205
|
-
|
|
198
|
+
paramName,
|
|
206
199
|
"description"
|
|
207
200
|
]);
|
|
208
201
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
209
202
|
});
|
|
210
|
-
|
|
203
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
211
204
|
const definition = {
|
|
212
205
|
actions: {
|
|
213
|
-
[ACTION_NAME]: { input: { schema: { properties: { [
|
|
206
|
+
[ACTION_NAME]: { input: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
|
|
214
207
|
}
|
|
215
208
|
};
|
|
216
209
|
const results = await lint(definition);
|
|
@@ -218,19 +211,19 @@ describeRule("action-inputparams-must-have-a-description", (lint) => {
|
|
|
218
211
|
});
|
|
219
212
|
});
|
|
220
213
|
describeRule("action-outputparams-should-have-a-title", (lint) => {
|
|
221
|
-
|
|
214
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
222
215
|
const definition = {
|
|
223
|
-
actions: { [ACTION_NAME]: { output: { schema: { properties: { [
|
|
216
|
+
actions: { [ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } } }
|
|
224
217
|
};
|
|
225
218
|
const results = await lint(definition);
|
|
226
219
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
227
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties",
|
|
220
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties", paramName, ZUI]);
|
|
228
221
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
229
222
|
});
|
|
230
|
-
|
|
223
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
231
224
|
const definition = {
|
|
232
225
|
actions: {
|
|
233
|
-
[ACTION_NAME]: { output: { schema: { properties: { [
|
|
226
|
+
[ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
|
|
234
227
|
}
|
|
235
228
|
};
|
|
236
229
|
const results = await lint(definition);
|
|
@@ -241,16 +234,16 @@ describeRule("action-outputparams-should-have-a-title", (lint) => {
|
|
|
241
234
|
"output",
|
|
242
235
|
"schema",
|
|
243
236
|
"properties",
|
|
244
|
-
|
|
237
|
+
paramName,
|
|
245
238
|
ZUI,
|
|
246
239
|
"title"
|
|
247
240
|
]);
|
|
248
241
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
249
242
|
});
|
|
250
|
-
|
|
243
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
251
244
|
const definition = {
|
|
252
245
|
actions: {
|
|
253
|
-
[ACTION_NAME]: { output: { schema: { properties: { [
|
|
246
|
+
[ACTION_NAME]: { output: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
|
|
254
247
|
}
|
|
255
248
|
};
|
|
256
249
|
const results = await lint(definition);
|
|
@@ -258,19 +251,19 @@ describeRule("action-outputparams-should-have-a-title", (lint) => {
|
|
|
258
251
|
});
|
|
259
252
|
});
|
|
260
253
|
describeRule("action-outputparams-must-have-a-description", (lint) => {
|
|
261
|
-
|
|
254
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
262
255
|
const definition = {
|
|
263
|
-
actions: { [ACTION_NAME]: { output: { schema: { properties: { [
|
|
256
|
+
actions: { [ACTION_NAME]: { output: { schema: { properties: { [paramName]: {} } } } } }
|
|
264
257
|
};
|
|
265
258
|
const results = await lint(definition);
|
|
266
259
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
267
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties",
|
|
260
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["actions", ACTION_NAME, "output", "schema", "properties", paramName]);
|
|
268
261
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
269
262
|
});
|
|
270
|
-
|
|
263
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
271
264
|
const definition = {
|
|
272
265
|
actions: {
|
|
273
|
-
[ACTION_NAME]: { output: { schema: { properties: { [
|
|
266
|
+
[ACTION_NAME]: { output: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
|
|
274
267
|
}
|
|
275
268
|
};
|
|
276
269
|
const results = await lint(definition);
|
|
@@ -281,15 +274,15 @@ describeRule("action-outputparams-must-have-a-description", (lint) => {
|
|
|
281
274
|
"output",
|
|
282
275
|
"schema",
|
|
283
276
|
"properties",
|
|
284
|
-
|
|
277
|
+
paramName,
|
|
285
278
|
"description"
|
|
286
279
|
]);
|
|
287
280
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
288
281
|
});
|
|
289
|
-
|
|
282
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
290
283
|
const definition = {
|
|
291
284
|
actions: {
|
|
292
|
-
[ACTION_NAME]: { output: { schema: { properties: { [
|
|
285
|
+
[ACTION_NAME]: { output: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
|
|
293
286
|
}
|
|
294
287
|
};
|
|
295
288
|
const results = await lint(definition);
|
|
@@ -297,30 +290,30 @@ describeRule("action-outputparams-must-have-a-description", (lint) => {
|
|
|
297
290
|
});
|
|
298
291
|
});
|
|
299
292
|
describeRule("event-outputparams-should-have-title", (lint) => {
|
|
300
|
-
|
|
293
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
301
294
|
const definition = {
|
|
302
|
-
events: { [EVENT_NAME]: { schema: { properties: { [
|
|
295
|
+
events: { [EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
|
|
303
296
|
};
|
|
304
297
|
const results = await lint(definition);
|
|
305
298
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
306
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties",
|
|
299
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, ZUI]);
|
|
307
300
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
308
301
|
});
|
|
309
|
-
|
|
302
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
310
303
|
const definition = {
|
|
311
304
|
events: {
|
|
312
|
-
[EVENT_NAME]: { schema: { properties: { [
|
|
305
|
+
[EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
|
|
313
306
|
}
|
|
314
307
|
};
|
|
315
308
|
const results = await lint(definition);
|
|
316
309
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
317
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties",
|
|
310
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, ZUI, "title"]);
|
|
318
311
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
319
312
|
});
|
|
320
|
-
|
|
313
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
321
314
|
const definition = {
|
|
322
315
|
events: {
|
|
323
|
-
[EVENT_NAME]: { schema: { properties: { [
|
|
316
|
+
[EVENT_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
|
|
324
317
|
}
|
|
325
318
|
};
|
|
326
319
|
const results = await lint(definition);
|
|
@@ -328,30 +321,30 @@ describeRule("event-outputparams-should-have-title", (lint) => {
|
|
|
328
321
|
});
|
|
329
322
|
});
|
|
330
323
|
describeRule("event-outputparams-must-have-description", (lint) => {
|
|
331
|
-
|
|
324
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
332
325
|
const definition = {
|
|
333
|
-
events: { [EVENT_NAME]: { schema: { properties: { [
|
|
326
|
+
events: { [EVENT_NAME]: { schema: { properties: { [paramName]: {} } } } }
|
|
334
327
|
};
|
|
335
328
|
const results = await lint(definition);
|
|
336
329
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
337
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties",
|
|
330
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName]);
|
|
338
331
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
339
332
|
});
|
|
340
|
-
|
|
333
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
341
334
|
const definition = {
|
|
342
335
|
events: {
|
|
343
|
-
[EVENT_NAME]: { schema: { properties: { [
|
|
336
|
+
[EVENT_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
|
|
344
337
|
}
|
|
345
338
|
};
|
|
346
339
|
const results = await lint(definition);
|
|
347
340
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
348
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties",
|
|
341
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["events", EVENT_NAME, "schema", "properties", paramName, "description"]);
|
|
349
342
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
350
343
|
});
|
|
351
|
-
|
|
344
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
352
345
|
const definition = {
|
|
353
346
|
events: {
|
|
354
|
-
[EVENT_NAME]: { schema: { properties: { [
|
|
347
|
+
[EVENT_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
|
|
355
348
|
}
|
|
356
349
|
};
|
|
357
350
|
const results = await lint(definition);
|
|
@@ -403,54 +396,54 @@ describeRule("events-must-have-a-description", (lint) => {
|
|
|
403
396
|
});
|
|
404
397
|
});
|
|
405
398
|
describeRule("configuration-fields-must-have-a-title", (lint) => {
|
|
406
|
-
|
|
399
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
407
400
|
const definition = {
|
|
408
|
-
configuration: { schema: { properties: { [
|
|
401
|
+
configuration: { schema: { properties: { [paramName]: { [ZUI]: {} } } } }
|
|
409
402
|
};
|
|
410
403
|
const results = await lint(definition);
|
|
411
404
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
412
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties",
|
|
405
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, ZUI]);
|
|
413
406
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
414
407
|
});
|
|
415
|
-
|
|
408
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
416
409
|
const definition = {
|
|
417
|
-
configuration: { schema: { properties: { [
|
|
410
|
+
configuration: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
|
|
418
411
|
};
|
|
419
412
|
const results = await lint(definition);
|
|
420
413
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
421
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties",
|
|
414
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, ZUI, "title"]);
|
|
422
415
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
423
416
|
});
|
|
424
|
-
|
|
417
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
425
418
|
const definition = {
|
|
426
|
-
configuration: { schema: { properties: { [
|
|
419
|
+
configuration: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
|
|
427
420
|
};
|
|
428
421
|
const results = await lint(definition);
|
|
429
422
|
(0, import_vitest.expect)(results).toHaveLength(0);
|
|
430
423
|
});
|
|
431
424
|
});
|
|
432
425
|
describeRule("configuration-fields-must-have-a-description", (lint) => {
|
|
433
|
-
|
|
426
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
434
427
|
const definition = {
|
|
435
|
-
configuration: { schema: { properties: { [
|
|
428
|
+
configuration: { schema: { properties: { [paramName]: {} } } }
|
|
436
429
|
};
|
|
437
430
|
const results = await lint(definition);
|
|
438
431
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
439
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties",
|
|
432
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName]);
|
|
440
433
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
441
434
|
});
|
|
442
|
-
|
|
435
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
443
436
|
const definition = {
|
|
444
|
-
configuration: { schema: { properties: { [
|
|
437
|
+
configuration: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
|
|
445
438
|
};
|
|
446
439
|
const results = await lint(definition);
|
|
447
440
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
448
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties",
|
|
441
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configuration", "schema", "properties", paramName, "description"]);
|
|
449
442
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
450
443
|
});
|
|
451
|
-
|
|
444
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
452
445
|
const definition = {
|
|
453
|
-
configuration: { schema: { properties: { [
|
|
446
|
+
configuration: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
|
|
454
447
|
};
|
|
455
448
|
const results = await lint(definition);
|
|
456
449
|
(0, import_vitest.expect)(results).toHaveLength(0);
|
|
@@ -511,30 +504,30 @@ describeRule("multiple-configurations-must-have-a-description", (lint) => {
|
|
|
511
504
|
});
|
|
512
505
|
});
|
|
513
506
|
describeRule("multipes-configurations-fields-must-have-a-title", (lint) => {
|
|
514
|
-
|
|
507
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
515
508
|
const definition = {
|
|
516
|
-
configurations: { [CONFIG_NAME]: { schema: { properties: { [
|
|
509
|
+
configurations: { [CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
|
|
517
510
|
};
|
|
518
511
|
const results = await lint(definition);
|
|
519
512
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
520
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties",
|
|
513
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, ZUI]);
|
|
521
514
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
522
515
|
});
|
|
523
|
-
|
|
516
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
524
517
|
const definition = {
|
|
525
518
|
configurations: {
|
|
526
|
-
[CONFIG_NAME]: { schema: { properties: { [
|
|
519
|
+
[CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } }
|
|
527
520
|
}
|
|
528
521
|
};
|
|
529
522
|
const results = await lint(definition);
|
|
530
523
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
531
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties",
|
|
524
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, ZUI, "title"]);
|
|
532
525
|
(0, import_vitest.expect)(results[0]?.message).toContain("title");
|
|
533
526
|
});
|
|
534
|
-
|
|
527
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
535
528
|
const definition = {
|
|
536
529
|
configurations: {
|
|
537
|
-
[CONFIG_NAME]: { schema: { properties: { [
|
|
530
|
+
[CONFIG_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } }
|
|
538
531
|
}
|
|
539
532
|
};
|
|
540
533
|
const results = await lint(definition);
|
|
@@ -542,30 +535,30 @@ describeRule("multipes-configurations-fields-must-have-a-title", (lint) => {
|
|
|
542
535
|
});
|
|
543
536
|
});
|
|
544
537
|
describeRule("multipes-configurations-fields-must-have-a-description", (lint) => {
|
|
545
|
-
|
|
538
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
546
539
|
const definition = {
|
|
547
|
-
configurations: { [CONFIG_NAME]: { schema: { properties: { [
|
|
540
|
+
configurations: { [CONFIG_NAME]: { schema: { properties: { [paramName]: {} } } } }
|
|
548
541
|
};
|
|
549
542
|
const results = await lint(definition);
|
|
550
543
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
551
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties",
|
|
544
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName]);
|
|
552
545
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
553
546
|
});
|
|
554
|
-
|
|
547
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
555
548
|
const definition = {
|
|
556
549
|
configurations: {
|
|
557
|
-
[CONFIG_NAME]: { schema: { properties: { [
|
|
550
|
+
[CONFIG_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } }
|
|
558
551
|
}
|
|
559
552
|
};
|
|
560
553
|
const results = await lint(definition);
|
|
561
554
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
562
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties",
|
|
555
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["configurations", CONFIG_NAME, "schema", "properties", paramName, "description"]);
|
|
563
556
|
(0, import_vitest.expect)(results[0]?.message).toContain("description");
|
|
564
557
|
});
|
|
565
|
-
|
|
558
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
566
559
|
const definition = {
|
|
567
560
|
configurations: {
|
|
568
|
-
[CONFIG_NAME]: { schema: { properties: { [
|
|
561
|
+
[CONFIG_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } }
|
|
569
562
|
}
|
|
570
563
|
};
|
|
571
564
|
const results = await lint(definition);
|
|
@@ -775,22 +768,22 @@ describeRule("channels-message-tags-must-have-a-description", (lint) => {
|
|
|
775
768
|
});
|
|
776
769
|
});
|
|
777
770
|
describeRule("legacy-zui-title-should-be-removed", (lint) => {
|
|
778
|
-
|
|
771
|
+
import_vitest.test.each(PARAM_NAMES)("legacy zui title should trigger (%s)", async (paramName) => {
|
|
779
772
|
const definition = {
|
|
780
773
|
actions: {
|
|
781
|
-
[ACTION_NAME]: { input: { [LEGACY_ZUI]: { [
|
|
774
|
+
[ACTION_NAME]: { input: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
|
|
782
775
|
},
|
|
783
776
|
configuration: {
|
|
784
|
-
[LEGACY_ZUI]: { [
|
|
777
|
+
[LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } },
|
|
785
778
|
schema: {}
|
|
786
779
|
},
|
|
787
|
-
events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [
|
|
780
|
+
events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } },
|
|
788
781
|
channels: {
|
|
789
782
|
[CHANNEL_NAME]: {
|
|
790
|
-
messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [
|
|
783
|
+
messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
|
|
791
784
|
}
|
|
792
785
|
},
|
|
793
|
-
states: { [STATE_NAME]: { [LEGACY_ZUI]: { [
|
|
786
|
+
states: { [STATE_NAME]: { [LEGACY_ZUI]: { [paramName]: { title: TRUTHY_STRING } }, schema: {} } }
|
|
794
787
|
};
|
|
795
788
|
const results = await lint(definition);
|
|
796
789
|
(0, import_vitest.expect)(results).toHaveLength(5);
|
|
@@ -798,22 +791,22 @@ describeRule("legacy-zui-title-should-be-removed", (lint) => {
|
|
|
798
791
|
});
|
|
799
792
|
});
|
|
800
793
|
describeRule("legacy-zui-examples-should-be-removed", (lint) => {
|
|
801
|
-
|
|
794
|
+
import_vitest.test.each(PARAM_NAMES)("legacy zui examples should trigger (%s)", async (paramName) => {
|
|
802
795
|
const definition = {
|
|
803
796
|
actions: {
|
|
804
|
-
[ACTION_NAME]: { input: { [LEGACY_ZUI]: { [
|
|
797
|
+
[ACTION_NAME]: { input: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
|
|
805
798
|
},
|
|
806
799
|
configuration: {
|
|
807
|
-
[LEGACY_ZUI]: { [
|
|
800
|
+
[LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } },
|
|
808
801
|
schema: {}
|
|
809
802
|
},
|
|
810
|
-
events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [
|
|
803
|
+
events: { [EVENT_NAME]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } },
|
|
811
804
|
channels: {
|
|
812
805
|
[CHANNEL_NAME]: {
|
|
813
|
-
messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [
|
|
806
|
+
messages: { [MESSAGE_TYPE]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
|
|
814
807
|
}
|
|
815
808
|
},
|
|
816
|
-
states: { [STATE_NAME]: { [LEGACY_ZUI]: { [
|
|
809
|
+
states: { [STATE_NAME]: { [LEGACY_ZUI]: { [paramName]: { examples: [TRUTHY_STRING] } }, schema: {} } }
|
|
817
810
|
};
|
|
818
811
|
const results = await lint(definition);
|
|
819
812
|
(0, import_vitest.expect)(results).toHaveLength(5);
|
|
@@ -821,50 +814,50 @@ describeRule("legacy-zui-examples-should-be-removed", (lint) => {
|
|
|
821
814
|
});
|
|
822
815
|
});
|
|
823
816
|
describeRule("state-fields-should-have-title", (lint) => {
|
|
824
|
-
|
|
817
|
+
import_vitest.test.each(PARAM_NAMES)("missing title should trigger (%s)", async (paramName) => {
|
|
825
818
|
const definition = {
|
|
826
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
819
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: {} } } } } }
|
|
827
820
|
};
|
|
828
821
|
const results = await lint(definition);
|
|
829
822
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
830
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties",
|
|
823
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, ZUI]);
|
|
831
824
|
});
|
|
832
|
-
|
|
825
|
+
import_vitest.test.each(PARAM_NAMES)("empty title should trigger (%s)", async (paramName) => {
|
|
833
826
|
const definition = {
|
|
834
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
827
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: EMPTY_STRING } } } } } }
|
|
835
828
|
};
|
|
836
829
|
const results = await lint(definition);
|
|
837
830
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
838
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties",
|
|
831
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, ZUI, "title"]);
|
|
839
832
|
});
|
|
840
|
-
|
|
833
|
+
import_vitest.test.each(PARAM_NAMES)("valid title should not trigger (%s)", async (paramName) => {
|
|
841
834
|
const definition = {
|
|
842
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
835
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: { [ZUI]: { title: TRUTHY_STRING } } } } } }
|
|
843
836
|
};
|
|
844
837
|
const results = await lint(definition);
|
|
845
838
|
(0, import_vitest.expect)(results).toHaveLength(0);
|
|
846
839
|
});
|
|
847
840
|
});
|
|
848
841
|
describeRule("state-fields-must-have-description", (lint) => {
|
|
849
|
-
|
|
842
|
+
import_vitest.test.each(PARAM_NAMES)("missing description should trigger (%s)", async (paramName) => {
|
|
850
843
|
const definition = {
|
|
851
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
844
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: {} } } } }
|
|
852
845
|
};
|
|
853
846
|
const results = await lint(definition);
|
|
854
847
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
855
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties",
|
|
848
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName]);
|
|
856
849
|
});
|
|
857
|
-
|
|
850
|
+
import_vitest.test.each(PARAM_NAMES)("empty description should trigger (%s)", async (paramName) => {
|
|
858
851
|
const definition = {
|
|
859
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
852
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: { description: EMPTY_STRING } } } } }
|
|
860
853
|
};
|
|
861
854
|
const results = await lint(definition);
|
|
862
855
|
(0, import_vitest.expect)(results).toHaveLength(1);
|
|
863
|
-
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties",
|
|
856
|
+
(0, import_vitest.expect)(results[0]?.path).toEqual(["states", STATE_NAME, "schema", "properties", paramName, "description"]);
|
|
864
857
|
});
|
|
865
|
-
|
|
858
|
+
import_vitest.test.each(PARAM_NAMES)("valid description should not trigger (%s)", async (paramName) => {
|
|
866
859
|
const definition = {
|
|
867
|
-
states: { [STATE_NAME]: { schema: { properties: { [
|
|
860
|
+
states: { [STATE_NAME]: { schema: { properties: { [paramName]: { description: TRUTHY_STRING } } } } }
|
|
868
861
|
};
|
|
869
862
|
const results = await lint(definition);
|
|
870
863
|
(0, import_vitest.expect)(results).toHaveLength(0);
|