@sprucelabs/spruce-conversation-plugin 62.0.2 → 62.0.3
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/build/.spruce/errors/conversation/abort.schema.js +1 -1
- package/build/.spruce/errors/conversation/conversationAborted.schema.js +1 -1
- package/build/.spruce/errors/conversation/conversationPluginError.schema.js +1 -1
- package/build/.spruce/errors/conversation/invalidTopic.schema.js +3 -3
- package/build/.spruce/errors/conversation/missingDependencies.schema.js +3 -3
- package/build/.spruce/errors/conversation/testerNotStarted.schema.js +1 -1
- package/build/.spruce/errors/conversation/topicNotFound.schema.js +5 -5
- package/build/.spruce/errors/errors.types.d.ts +8 -8
- package/build/.spruce/errors/options.types.d.ts +2 -2
- package/build/.spruce/schemas/fields/fields.types.d.ts +1 -1
- package/build/__tests__/implementation/ScriptTester.test.js +3 -4
- package/build/esm/.spruce/errors/errors.types.d.ts +8 -8
- package/build/esm/.spruce/errors/options.types.d.ts +2 -2
- package/build/esm/__tests__/implementation/ScriptTester.test.js +1 -2
- package/package.json +19 -21
|
@@ -5,7 +5,7 @@ const conversationAbortedSchema = {
|
|
|
5
5
|
id: 'conversationAborted',
|
|
6
6
|
namespace: 'Conversation',
|
|
7
7
|
name: 'Conversation aborted',
|
|
8
|
-
fields: {}
|
|
8
|
+
fields: {}
|
|
9
9
|
};
|
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(conversationAbortedSchema);
|
|
11
11
|
exports.default = conversationAbortedSchema;
|
|
@@ -5,7 +5,7 @@ const conversationPluginErrorSchema = {
|
|
|
5
5
|
id: 'conversationPluginError',
|
|
6
6
|
namespace: 'Conversation',
|
|
7
7
|
name: 'Conversation plugin error',
|
|
8
|
-
fields: {}
|
|
8
|
+
fields: {}
|
|
9
9
|
};
|
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(conversationPluginErrorSchema);
|
|
11
11
|
exports.default = conversationPluginErrorSchema;
|
|
@@ -7,13 +7,13 @@ const invalidTopicSchema = {
|
|
|
7
7
|
name: 'Invalid topic',
|
|
8
8
|
fields: {
|
|
9
9
|
/** . The script that I was attempting to load. Ends in .topic */
|
|
10
|
-
topicScript: {
|
|
10
|
+
'topicScript': {
|
|
11
11
|
type: 'text',
|
|
12
12
|
isRequired: true,
|
|
13
13
|
hint: 'The script that I was attempting to load. Ends in .topic',
|
|
14
|
-
options: undefined
|
|
14
|
+
options: undefined
|
|
15
15
|
},
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
};
|
|
18
18
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidTopicSchema);
|
|
19
19
|
exports.default = invalidTopicSchema;
|
|
@@ -7,13 +7,13 @@ const missingDependenciesSchema = {
|
|
|
7
7
|
name: 'Missing dependencies',
|
|
8
8
|
fields: {
|
|
9
9
|
/** . */
|
|
10
|
-
dependencies: {
|
|
10
|
+
'dependencies': {
|
|
11
11
|
type: 'text',
|
|
12
12
|
isRequired: true,
|
|
13
13
|
isArray: true,
|
|
14
|
-
options: undefined
|
|
14
|
+
options: undefined
|
|
15
15
|
},
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
};
|
|
18
18
|
schema_1.SchemaRegistry.getInstance().trackSchema(missingDependenciesSchema);
|
|
19
19
|
exports.default = missingDependenciesSchema;
|
|
@@ -5,7 +5,7 @@ const testerNotStartedSchema = {
|
|
|
5
5
|
id: 'testerNotStarted',
|
|
6
6
|
namespace: 'Conversation',
|
|
7
7
|
name: 'Tester not started',
|
|
8
|
-
fields: {}
|
|
8
|
+
fields: {}
|
|
9
9
|
};
|
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(testerNotStartedSchema);
|
|
11
11
|
exports.default = testerNotStartedSchema;
|
|
@@ -7,19 +7,19 @@ const topicNotFoundSchema = {
|
|
|
7
7
|
name: 'Topic not found',
|
|
8
8
|
fields: {
|
|
9
9
|
/** . */
|
|
10
|
-
suppliedTopic: {
|
|
10
|
+
'suppliedTopic': {
|
|
11
11
|
type: 'text',
|
|
12
12
|
isRequired: true,
|
|
13
|
-
options: undefined
|
|
13
|
+
options: undefined
|
|
14
14
|
},
|
|
15
15
|
/** . */
|
|
16
|
-
validTopics: {
|
|
16
|
+
'validTopics': {
|
|
17
17
|
type: 'text',
|
|
18
18
|
isRequired: true,
|
|
19
19
|
isArray: true,
|
|
20
|
-
options: undefined
|
|
20
|
+
options: undefined
|
|
21
21
|
},
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
};
|
|
24
24
|
schema_1.SchemaRegistry.getInstance().trackSchema(topicNotFoundSchema);
|
|
25
25
|
exports.default = topicNotFoundSchema;
|
|
@@ -2,8 +2,8 @@ import { default as SchemaEntity } from '@sprucelabs/schema';
|
|
|
2
2
|
import * as SpruceSchema from '@sprucelabs/schema';
|
|
3
3
|
export declare namespace SpruceErrors.Conversation {
|
|
4
4
|
interface TopicNotFound {
|
|
5
|
-
suppliedTopic: string;
|
|
6
|
-
validTopics: string[];
|
|
5
|
+
'suppliedTopic': string;
|
|
6
|
+
'validTopics': string[];
|
|
7
7
|
}
|
|
8
8
|
interface TopicNotFoundSchema extends SpruceSchema.Schema {
|
|
9
9
|
id: 'topicNotFound';
|
|
@@ -11,13 +11,13 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
11
11
|
name: 'Topic not found';
|
|
12
12
|
fields: {
|
|
13
13
|
/** . */
|
|
14
|
-
suppliedTopic: {
|
|
14
|
+
'suppliedTopic': {
|
|
15
15
|
type: 'text';
|
|
16
16
|
isRequired: true;
|
|
17
17
|
options: undefined;
|
|
18
18
|
};
|
|
19
19
|
/** . */
|
|
20
|
-
validTopics: {
|
|
20
|
+
'validTopics': {
|
|
21
21
|
type: 'text';
|
|
22
22
|
isRequired: true;
|
|
23
23
|
isArray: true;
|
|
@@ -40,7 +40,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
40
40
|
}
|
|
41
41
|
export declare namespace SpruceErrors.Conversation {
|
|
42
42
|
interface MissingDependencies {
|
|
43
|
-
dependencies: string[];
|
|
43
|
+
'dependencies': string[];
|
|
44
44
|
}
|
|
45
45
|
interface MissingDependenciesSchema extends SpruceSchema.Schema {
|
|
46
46
|
id: 'missingDependencies';
|
|
@@ -48,7 +48,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
48
48
|
name: 'Missing dependencies';
|
|
49
49
|
fields: {
|
|
50
50
|
/** . */
|
|
51
|
-
dependencies: {
|
|
51
|
+
'dependencies': {
|
|
52
52
|
type: 'text';
|
|
53
53
|
isRequired: true;
|
|
54
54
|
isArray: true;
|
|
@@ -61,7 +61,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
61
61
|
export declare namespace SpruceErrors.Conversation {
|
|
62
62
|
interface InvalidTopic {
|
|
63
63
|
/** . The script that I was attempting to load. Ends in .topic */
|
|
64
|
-
topicScript: string;
|
|
64
|
+
'topicScript': string;
|
|
65
65
|
}
|
|
66
66
|
interface InvalidTopicSchema extends SpruceSchema.Schema {
|
|
67
67
|
id: 'invalidTopic';
|
|
@@ -69,7 +69,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
69
69
|
name: 'Invalid topic';
|
|
70
70
|
fields: {
|
|
71
71
|
/** . The script that I was attempting to load. Ends in .topic */
|
|
72
|
-
topicScript: {
|
|
72
|
+
'topicScript': {
|
|
73
73
|
type: 'text';
|
|
74
74
|
isRequired: true;
|
|
75
75
|
hint: 'The script that I was attempting to load. Ends in .topic';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SpruceErrors } from "./errors.types";
|
|
2
|
+
import { ErrorOptions as ISpruceErrorOptions } from "@sprucelabs/error";
|
|
3
3
|
export interface TopicNotFoundErrorOptions extends SpruceErrors.Conversation.TopicNotFound, ISpruceErrorOptions {
|
|
4
4
|
code: 'TOPIC_NOT_FOUND';
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FieldDefinitions, FieldDefinitionMap, FieldValueTypeGeneratorMap, FieldMap
|
|
1
|
+
export { FieldDefinitions, FieldDefinitionMap, FieldValueTypeGeneratorMap, FieldMap } from '@sprucelabs/schema';
|
|
@@ -33,14 +33,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
36
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
37
36
|
const AbstractConversationTest_1 = __importDefault(require("../../tests/AbstractConversationTest"));
|
|
38
37
|
const ScriptTester_1 = __importStar(require("../../tests/ScriptTester"));
|
|
39
38
|
class ScriptTesterTest extends AbstractConversationTest_1.default {
|
|
40
39
|
static async throwsWithoutScript() {
|
|
41
40
|
//@ts-ignore
|
|
42
41
|
const err = await test_utils_1.assert.doesThrowAsync(() => ScriptTester_1.default.Tester());
|
|
43
|
-
|
|
42
|
+
test_utils_1.errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
44
43
|
parameters: ['script'],
|
|
45
44
|
});
|
|
46
45
|
}
|
|
@@ -88,7 +87,7 @@ class ScriptTesterTest extends AbstractConversationTest_1.default {
|
|
|
88
87
|
promptHandler: async () => '',
|
|
89
88
|
});
|
|
90
89
|
const err = await test_utils_1.assert.doesThrowAsync(() => tester.handleInput('taco'));
|
|
91
|
-
|
|
90
|
+
test_utils_1.errorAssert.assertError(err, 'TESTER_NOT_STARTED');
|
|
92
91
|
}
|
|
93
92
|
static async selectingBadScriptToStartThrows() {
|
|
94
93
|
const tester = await this.Tester({
|
|
@@ -100,7 +99,7 @@ class ScriptTesterTest extends AbstractConversationTest_1.default {
|
|
|
100
99
|
promptHandler: async () => '',
|
|
101
100
|
});
|
|
102
101
|
const err = await test_utils_1.assert.doesThrowAsync(() => tester.go());
|
|
103
|
-
|
|
102
|
+
test_utils_1.errorAssert.assertError(err, 'TOPIC_NOT_FOUND', {
|
|
104
103
|
suppliedTopic: 'oeuou',
|
|
105
104
|
validTopics: ['bookAppointment', 'cancelAppointment'],
|
|
106
105
|
});
|
|
@@ -2,8 +2,8 @@ import { default as SchemaEntity } from '@sprucelabs/schema';
|
|
|
2
2
|
import * as SpruceSchema from '@sprucelabs/schema';
|
|
3
3
|
export declare namespace SpruceErrors.Conversation {
|
|
4
4
|
interface TopicNotFound {
|
|
5
|
-
suppliedTopic: string;
|
|
6
|
-
validTopics: string[];
|
|
5
|
+
'suppliedTopic': string;
|
|
6
|
+
'validTopics': string[];
|
|
7
7
|
}
|
|
8
8
|
interface TopicNotFoundSchema extends SpruceSchema.Schema {
|
|
9
9
|
id: 'topicNotFound';
|
|
@@ -11,13 +11,13 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
11
11
|
name: 'Topic not found';
|
|
12
12
|
fields: {
|
|
13
13
|
/** . */
|
|
14
|
-
suppliedTopic: {
|
|
14
|
+
'suppliedTopic': {
|
|
15
15
|
type: 'text';
|
|
16
16
|
isRequired: true;
|
|
17
17
|
options: undefined;
|
|
18
18
|
};
|
|
19
19
|
/** . */
|
|
20
|
-
validTopics: {
|
|
20
|
+
'validTopics': {
|
|
21
21
|
type: 'text';
|
|
22
22
|
isRequired: true;
|
|
23
23
|
isArray: true;
|
|
@@ -40,7 +40,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
40
40
|
}
|
|
41
41
|
export declare namespace SpruceErrors.Conversation {
|
|
42
42
|
interface MissingDependencies {
|
|
43
|
-
dependencies: string[];
|
|
43
|
+
'dependencies': string[];
|
|
44
44
|
}
|
|
45
45
|
interface MissingDependenciesSchema extends SpruceSchema.Schema {
|
|
46
46
|
id: 'missingDependencies';
|
|
@@ -48,7 +48,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
48
48
|
name: 'Missing dependencies';
|
|
49
49
|
fields: {
|
|
50
50
|
/** . */
|
|
51
|
-
dependencies: {
|
|
51
|
+
'dependencies': {
|
|
52
52
|
type: 'text';
|
|
53
53
|
isRequired: true;
|
|
54
54
|
isArray: true;
|
|
@@ -61,7 +61,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
61
61
|
export declare namespace SpruceErrors.Conversation {
|
|
62
62
|
interface InvalidTopic {
|
|
63
63
|
/** . The script that I was attempting to load. Ends in .topic */
|
|
64
|
-
topicScript: string;
|
|
64
|
+
'topicScript': string;
|
|
65
65
|
}
|
|
66
66
|
interface InvalidTopicSchema extends SpruceSchema.Schema {
|
|
67
67
|
id: 'invalidTopic';
|
|
@@ -69,7 +69,7 @@ export declare namespace SpruceErrors.Conversation {
|
|
|
69
69
|
name: 'Invalid topic';
|
|
70
70
|
fields: {
|
|
71
71
|
/** . The script that I was attempting to load. Ends in .topic */
|
|
72
|
-
topicScript: {
|
|
72
|
+
'topicScript': {
|
|
73
73
|
type: 'text';
|
|
74
74
|
isRequired: true;
|
|
75
75
|
hint: 'The script that I was attempting to load. Ends in .topic';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SpruceErrors } from "./errors.types";
|
|
2
|
+
import { ErrorOptions as ISpruceErrorOptions } from "@sprucelabs/error";
|
|
3
3
|
export interface TopicNotFoundErrorOptions extends SpruceErrors.Conversation.TopicNotFound, ISpruceErrorOptions {
|
|
4
4
|
code: 'TOPIC_NOT_FOUND';
|
|
5
5
|
}
|
|
@@ -13,8 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
import { test, assert } from '@sprucelabs/test-utils';
|
|
17
|
-
import { errorAssert } from '@sprucelabs/test-utils';
|
|
16
|
+
import { test, assert, errorAssert } from '@sprucelabs/test-utils';
|
|
18
17
|
import AbstractConversationTest from '../../tests/AbstractConversationTest.js';
|
|
19
18
|
import ScriptTester, { END_OF_LINE, generateTransitionMessage, } from '../../tests/ScriptTester.js';
|
|
20
19
|
class ScriptTesterTest extends AbstractConversationTest {
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@types/inquirer"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
|
-
"version": "62.0.
|
|
15
|
+
"version": "62.0.3",
|
|
16
16
|
"files": [
|
|
17
17
|
"build/**/*",
|
|
18
18
|
"!build/__tests__",
|
|
@@ -59,43 +59,41 @@
|
|
|
59
59
|
"post.watch.build": "yarn run build.copy-files && yarn run build.resolve-paths",
|
|
60
60
|
"spruce.upgrade": "spruce upgrade",
|
|
61
61
|
"watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn post.watch.build'",
|
|
62
|
-
"watch.lint": "concurrently 'yarn run lint' \"chokidar 'src/**/*' -c 'yarn run lint.tsc'\"",
|
|
63
62
|
"watch.rebuild": "yarn run clean.all && yarn install && yarn run watch.build.dev",
|
|
64
63
|
"watch.tsc": "tsc -w",
|
|
65
64
|
"lint.tsc": "tsc -p . --noEmit"
|
|
66
65
|
},
|
|
67
66
|
"dependencies": {
|
|
68
67
|
"@nlpjs/nlu": "^4.27.0",
|
|
69
|
-
"@sprucelabs/error": "^6.0.
|
|
70
|
-
"@sprucelabs/globby": "^2.0.
|
|
71
|
-
"@sprucelabs/mercury-core-events": "^24.0.
|
|
72
|
-
"@sprucelabs/schema": "^30.0.
|
|
73
|
-
"@sprucelabs/spruce-core-schemas": "^40.0.
|
|
74
|
-
"@sprucelabs/spruce-event-plugin": "^62.0.
|
|
75
|
-
"@sprucelabs/spruce-event-utils": "^40.0.
|
|
76
|
-
"@sprucelabs/spruce-skill-booter": "^62.0.
|
|
77
|
-
"@sprucelabs/spruce-skill-utils": "^31.0.
|
|
78
|
-
"@sprucelabs/spruce-test-fixtures": "^62.0.
|
|
68
|
+
"@sprucelabs/error": "^6.0.13",
|
|
69
|
+
"@sprucelabs/globby": "^2.0.11",
|
|
70
|
+
"@sprucelabs/mercury-core-events": "^24.0.8",
|
|
71
|
+
"@sprucelabs/schema": "^30.0.17",
|
|
72
|
+
"@sprucelabs/spruce-core-schemas": "^40.0.13",
|
|
73
|
+
"@sprucelabs/spruce-event-plugin": "^62.0.3",
|
|
74
|
+
"@sprucelabs/spruce-event-utils": "^40.0.13",
|
|
75
|
+
"@sprucelabs/spruce-skill-booter": "^62.0.3",
|
|
76
|
+
"@sprucelabs/spruce-skill-utils": "^31.0.17",
|
|
77
|
+
"@sprucelabs/spruce-test-fixtures": "^62.0.3",
|
|
79
78
|
"fuzzyset": "^1.0.7",
|
|
80
79
|
"inquirer": "^8.2.4",
|
|
81
80
|
"node-nlp": "^4.27.0",
|
|
82
81
|
"random": "^4.1.0"
|
|
83
82
|
},
|
|
84
83
|
"devDependencies": {
|
|
85
|
-
"@sprucelabs/esm-postbuild": "^6.0.
|
|
86
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
87
|
-
"@sprucelabs/mercury-client": "^42.0.
|
|
88
|
-
"@sprucelabs/resolve-path-aliases": "^2.0.
|
|
84
|
+
"@sprucelabs/esm-postbuild": "^6.0.12",
|
|
85
|
+
"@sprucelabs/jest-json-reporter": "^8.0.15",
|
|
86
|
+
"@sprucelabs/mercury-client": "^42.0.13",
|
|
87
|
+
"@sprucelabs/resolve-path-aliases": "^2.0.14",
|
|
89
88
|
"@sprucelabs/semantic-release": "^5.0.1",
|
|
90
|
-
"@sprucelabs/test": "^9.0.
|
|
91
|
-
"@sprucelabs/test-utils": "^5.0.
|
|
89
|
+
"@sprucelabs/test": "^9.0.10",
|
|
90
|
+
"@sprucelabs/test-utils": "^5.0.12",
|
|
92
91
|
"@types/fuzzyset": "^1.0.7",
|
|
93
92
|
"@types/inquirer": "^8.2.1",
|
|
94
93
|
"@types/node": "17.0.5",
|
|
95
94
|
"chokidar-cli": "^3.0.0",
|
|
96
|
-
"concurrently": "^8.2.2",
|
|
97
95
|
"eslint": "^9.1.1",
|
|
98
|
-
"eslint-config-spruce": "^11.2.
|
|
96
|
+
"eslint-config-spruce": "^11.2.14",
|
|
99
97
|
"jest": "^29.7.0",
|
|
100
98
|
"jest-circus": "^29.7.0",
|
|
101
99
|
"prettier": "^3.2.5",
|
|
@@ -121,5 +119,5 @@
|
|
|
121
119
|
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
122
120
|
}
|
|
123
121
|
},
|
|
124
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "cd2ddfd22a6c237cb6b20f085967f5df56623e78"
|
|
125
123
|
}
|