@velaro/cli 1.4.135 → 1.4.136
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// velaro part-finder find "<part, model or description>" Run the same lookup the bot uses (shows the trace)
|
|
4
4
|
// velaro part-finder config get Show the order, time limits, confidence and no-result action
|
|
5
5
|
// velaro part-finder config set [--enabled true|false] [--order matrix,erp,catalog_exact,spec_search] [--disable erp,...]
|
|
6
|
-
// [--item-noun part|product|service|plan|policy|course] [--min-confidence 0.8] [--no-result handoff|categories|handoff_and_categories|capture_lead]
|
|
6
|
+
// [--item-noun part|product|service|plan|policy|course] [--min-confidence 0.8] [--on-no-result handoff|categories|handoff_and_categories|capture_lead]
|
|
7
7
|
// velaro part-finder sources list|sync|preview|remove [id] Matrix sources (SharePoint, OneDrive); preview shows the diff, nothing applied
|
|
8
8
|
// velaro part-finder sources add --url <share link> [--type sharepoint|onedrive] [--load-mode preload|live] [--sync-hours N] [--auto-approve]
|
|
9
9
|
// velaro part-finder misses [--dismiss <id>] What customers asked that found nothing
|
|
@@ -56,9 +56,9 @@ export function buildConfigPatch(current, flags) {
|
|
|
56
56
|
if (t !== '' && !/^[\p{L}\p{N} -]+$/u.test(t)) throw new Error('--item-noun can use letters, digits, spaces and hyphens only.');
|
|
57
57
|
patch.itemNoun = t === '' ? 'item' : t;
|
|
58
58
|
}
|
|
59
|
-
if (flags['no-result'] !== undefined) {
|
|
60
|
-
if (!NO_RESULT_ACTIONS.includes(flags['no-result'])) throw new Error(`--no-result must be one of ${NO_RESULT_ACTIONS.join(', ')}.`);
|
|
61
|
-
patch.noResultAction = flags['no-result'];
|
|
59
|
+
if (flags['on-no-result'] !== undefined) {
|
|
60
|
+
if (!NO_RESULT_ACTIONS.includes(flags['on-no-result'])) throw new Error(`--on-no-result must be one of ${NO_RESULT_ACTIONS.join(', ')}.`);
|
|
61
|
+
patch.noResultAction = flags['on-no-result'];
|
|
62
62
|
}
|
|
63
63
|
if (flags.enabled !== undefined) patch.enabled = String(flags.enabled) === 'true';
|
|
64
64
|
if (Object.keys(patch).length === 0) throw new Error('Nothing to change. Pass at least one flag.');
|
|
@@ -116,7 +116,7 @@ export const partFinderCommand = {
|
|
|
116
116
|
.option('disable', { type: 'string' })
|
|
117
117
|
.option('enable', { type: 'string' })
|
|
118
118
|
.option('min-confidence', { type: 'string' })
|
|
119
|
-
.option('no-result', { type: 'string' })
|
|
119
|
+
.option('on-no-result', { type: 'string' })
|
|
120
120
|
.option('item-noun', { type: 'string', describe: 'what you call the things customers look for: part, product, service, plan, policy, course (default item)' })
|
|
121
121
|
.option('json', J),
|
|
122
122
|
runCommand(async (a) => {
|
package/lib/part-finder.test.js
CHANGED
|
@@ -37,8 +37,8 @@ test('rejects unknown steps, duplicates, and switching off both matrix and catal
|
|
|
37
37
|
test('validates confidence and the no-result action, and refuses an empty change', () => {
|
|
38
38
|
assert.equal(buildConfigPatch(current(), { 'min-confidence': '0.9' }).minConfidence, 0.9);
|
|
39
39
|
assert.throws(() => buildConfigPatch(current(), { 'min-confidence': '2' }), /between 0 and 1/);
|
|
40
|
-
assert.equal(buildConfigPatch(current(), { 'no-result': 'capture_lead' }).noResultAction, 'capture_lead');
|
|
41
|
-
assert.throws(() => buildConfigPatch(current(), { 'no-result': 'shrug' }), /must be one of/);
|
|
40
|
+
assert.equal(buildConfigPatch(current(), { 'on-no-result': 'capture_lead' }).noResultAction, 'capture_lead');
|
|
41
|
+
assert.throws(() => buildConfigPatch(current(), { 'on-no-result': 'shrug' }), /must be one of/);
|
|
42
42
|
assert.equal(buildConfigPatch(current(), { enabled: 'false' }).enabled, false);
|
|
43
43
|
assert.throws(() => buildConfigPatch(current(), {}), /Nothing to change/);
|
|
44
44
|
});
|
package/package.json
CHANGED