@xapp/stentor-validation 1.7.2-alpha.0 → 1.7.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/CHANGELOG.md +1 -1
- package/lib/AppValidator/AppValidator.js +29 -26
- package/lib/AppValidator/AppValidator.js.map +1 -1
- package/lib/AppValidator/containsIllegalCharacters.js +4 -1
- package/lib/AppValidator/containsIllegalCharacters.js.map +1 -1
- package/lib/AppValidator/containsNumbers.js +6 -3
- package/lib/AppValidator/containsNumbers.js.map +1 -1
- package/lib/AppValidator/containsReservedAlexaWords.js +8 -5
- package/lib/AppValidator/containsReservedAlexaWords.js.map +1 -1
- package/lib/AppValidator/containsReservedGrammarWords.js +7 -4
- package/lib/AppValidator/containsReservedGrammarWords.js.map +1 -1
- package/lib/AppValidator/containsUppercase.js +6 -3
- package/lib/AppValidator/containsUppercase.js.map +1 -1
- package/lib/AppValidator/index.js +6 -1
- package/lib/AppValidator/index.js.map +1 -1
- package/lib/HandlerValidator/HandlerValidator.js +5 -2
- package/lib/HandlerValidator/HandlerValidator.js.map +1 -1
- package/lib/HandlerValidator/index.js +6 -1
- package/lib/HandlerValidator/index.js.map +1 -1
- package/lib/LogicValidator.js +5 -2
- package/lib/LogicValidator.js.map +1 -1
- package/lib/analyzeModelAndContent.js +25 -21
- package/lib/analyzeModelAndContent.js.map +1 -1
- package/lib/index.js +9 -4
- package/lib/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [1.7.
|
|
6
|
+
## [1.7.5](https://github.com/XappMedia/stentor-core/compare/v1.7.4...v1.7.5) (2019-09-04)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @xapp/stentor-validation
|
|
9
9
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lakmus_1 = require("lakmus");
|
|
4
|
+
const containsIllegalCharacters_1 = require("./containsIllegalCharacters");
|
|
5
|
+
const containsNumbers_1 = require("./containsNumbers");
|
|
6
|
+
const containsReservedAlexaWords_1 = require("./containsReservedAlexaWords");
|
|
7
|
+
const containsReservedGrammarWords_1 = require("./containsReservedGrammarWords");
|
|
8
|
+
const containsUppercase_1 = require("./containsUppercase");
|
|
9
|
+
exports.MIN_APP_NAME_LENGTH = 2;
|
|
10
|
+
exports.MAX_APP_NAME_LENGTH = 50;
|
|
11
|
+
exports.MIN_INVOCATION_NAME_LENGTH = 2;
|
|
12
|
+
exports.MAX_INVOCATION_NAME_LENGTH = 50;
|
|
13
|
+
exports.MAX_SUMMARY_LENGTH = 160;
|
|
14
|
+
exports.MAX_DESCRIPTION_LENGTH = 4000;
|
|
15
|
+
exports.MAX_KEYWORDS_LENGTH = 30;
|
|
14
16
|
/**
|
|
15
17
|
* Validation for App model.
|
|
16
18
|
*
|
|
@@ -18,7 +20,7 @@ export const MAX_KEYWORDS_LENGTH = 30;
|
|
|
18
20
|
* @class AppValidator
|
|
19
21
|
* @extends {Validator<App>}
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
class AppValidator extends lakmus_1.Validator {
|
|
22
24
|
constructor() {
|
|
23
25
|
super();
|
|
24
26
|
// Required fields
|
|
@@ -31,63 +33,64 @@ export class AppValidator extends Validator {
|
|
|
31
33
|
this.ruleFor(x => x.name)
|
|
32
34
|
.notNull()
|
|
33
35
|
.notEmpty()
|
|
34
|
-
.minLength(MIN_APP_NAME_LENGTH)
|
|
35
|
-
.maxLength(MAX_APP_NAME_LENGTH);
|
|
36
|
+
.minLength(exports.MIN_APP_NAME_LENGTH)
|
|
37
|
+
.maxLength(exports.MAX_APP_NAME_LENGTH);
|
|
36
38
|
// Invocation Name Requirements
|
|
37
39
|
// Alexa https://developer.amazon.com/docs/custom-skills/choose-the-invocation-name-for-a-custom-skill.html#cert-invocation-name-req
|
|
38
40
|
// Google (none specified)
|
|
39
41
|
this.ruleFor(x => x.invocationName)
|
|
40
42
|
.when(x => !!x.invocationName)
|
|
41
|
-
.minLength(MIN_INVOCATION_NAME_LENGTH)
|
|
42
|
-
.maxLength(MAX_INVOCATION_NAME_LENGTH)
|
|
43
|
+
.minLength(exports.MIN_INVOCATION_NAME_LENGTH)
|
|
44
|
+
.maxLength(exports.MAX_INVOCATION_NAME_LENGTH)
|
|
43
45
|
.withMessage("Invocation phrase must be at least two characters and no longer than fifty.");
|
|
44
46
|
this.ruleFor(x => x.invocationName)
|
|
45
47
|
.when(x => !!x.invocationName)
|
|
46
48
|
.must((invocationName, app) => {
|
|
47
|
-
return !containsReservedGrammarWords(invocationName);
|
|
49
|
+
return !containsReservedGrammarWords_1.containsReservedGrammarWords(invocationName);
|
|
48
50
|
})
|
|
49
51
|
.withMessage("Two word invocation phrases must not include the definite article, an indefinite article, or a preposition.");
|
|
50
52
|
this.ruleFor(x => x.invocationName)
|
|
51
53
|
.when(x => !!x.invocationName)
|
|
52
54
|
.must((invocationName, app) => {
|
|
53
|
-
return !containsNumbers(invocationName);
|
|
55
|
+
return !containsNumbers_1.containsNumbers(invocationName);
|
|
54
56
|
})
|
|
55
57
|
.withMessage("All numbers in the invocation phrase must be spelled out, for example 'twenty one' not '21'.");
|
|
56
58
|
this.ruleFor(x => x.invocationName)
|
|
57
59
|
.when(x => !!x.invocationName)
|
|
58
60
|
.must((invocationName, app) => {
|
|
59
|
-
return !containsUppercase(invocationName);
|
|
61
|
+
return !containsUppercase_1.containsUppercase(invocationName);
|
|
60
62
|
})
|
|
61
63
|
.withMessage("Invocation phrase must not include uppercase letters.");
|
|
62
64
|
this.ruleFor(x => x.invocationName)
|
|
63
65
|
.when(x => !!x.invocationName)
|
|
64
66
|
.must((invocationName, app) => {
|
|
65
|
-
return !containsIllegalCharacters(invocationName);
|
|
67
|
+
return !containsIllegalCharacters_1.containsIllegalCharacters(invocationName);
|
|
66
68
|
})
|
|
67
69
|
.withMessage("Invocation phrase can only include periods and apostrophes.");
|
|
68
70
|
this.ruleFor(x => x.invocationName)
|
|
69
71
|
.when(x => !!x.invocationName)
|
|
70
72
|
.must((invocationName, app) => {
|
|
71
|
-
return !containsReservedAlexaWords(invocationName);
|
|
73
|
+
return !containsReservedAlexaWords_1.containsReservedAlexaWords(invocationName);
|
|
72
74
|
})
|
|
73
75
|
.withMessage("Invocation phrases must not include wake words, launch phrases or connecting words.");
|
|
74
76
|
// Summary, max 160
|
|
75
77
|
this.ruleFor(x => x.summary)
|
|
76
78
|
.when(x => !!x.summary)
|
|
77
79
|
.notEmpty()
|
|
78
|
-
.maxLength(MAX_SUMMARY_LENGTH);
|
|
80
|
+
.maxLength(exports.MAX_SUMMARY_LENGTH);
|
|
79
81
|
// Description, max 4000
|
|
80
82
|
this.ruleFor(x => x.description)
|
|
81
83
|
.when(x => !!x.description)
|
|
82
84
|
.notEmpty()
|
|
83
|
-
.maxLength(MAX_DESCRIPTION_LENGTH);
|
|
85
|
+
.maxLength(exports.MAX_DESCRIPTION_LENGTH);
|
|
84
86
|
// Keywords, max 30
|
|
85
87
|
this.ruleFor(x => x.keywords)
|
|
86
88
|
.when(x => Array.isArray(x.keywords))
|
|
87
89
|
.must((keywords, app) => {
|
|
88
|
-
return keywords.length <= MAX_KEYWORDS_LENGTH;
|
|
90
|
+
return keywords.length <= exports.MAX_KEYWORDS_LENGTH;
|
|
89
91
|
})
|
|
90
92
|
.withMessage("30 keywords is the maximum amount allowed.");
|
|
91
93
|
}
|
|
92
94
|
}
|
|
95
|
+
exports.AppValidator = AppValidator;
|
|
93
96
|
//# sourceMappingURL=AppValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppValidator.js","sourceRoot":"","sources":["../../src/AppValidator/AppValidator.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"AppValidator.js","sourceRoot":"","sources":["../../src/AppValidator/AppValidator.ts"],"names":[],"mappings":";;AAEA,mCAAmC;AACnC,2EAAwE;AACxE,uDAAoD;AACpD,6EAA0E;AAC1E,iFAA8E;AAC9E,2DAAwD;AAE3C,QAAA,mBAAmB,GAAG,CAAC,CAAC;AACxB,QAAA,mBAAmB,GAAG,EAAE,CAAC;AAEzB,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAC/B,QAAA,0BAA0B,GAAG,EAAE,CAAC;AAEhC,QAAA,kBAAkB,GAAG,GAAG,CAAC;AAEzB,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE9B,QAAA,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,kBAAc;IAC5C;QACI,KAAK,EAAE,CAAC;QAER,kBAAkB;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;aACrB,OAAO,EAAE;aACT,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;aAC9B,OAAO,EAAE;aACT,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACpB,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,SAAS,CAAC,2BAAmB,CAAC;aAC9B,SAAS,CAAC,2BAAmB,CAAC,CAAC;QAEpC,+BAA+B;QAC/B,oIAAoI;QACpI,0BAA0B;QAC1B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;aAC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E,GAAG,EAAE,EAAE;YACpB,OAAO,QAAQ,CAAC,MAAM,IAAI,2BAAmB,CAAC;QAClD,CAAC,CAAC;aACD,WAAW,CAAC,4CAA4C,CAAC,CAAC;IACnE,CAAC;CACJ;AAhFD,oCAgFC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
4
|
/**
|
|
3
5
|
* Does the provided string or array of strings contain anything besides
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
* @param {(string | string[])} invocationName
|
|
8
10
|
* @returns {boolean}
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
function containsIllegalCharacters(invocationName) {
|
|
11
13
|
const sentences = [].concat(invocationName);
|
|
12
14
|
let result = false;
|
|
13
15
|
sentences.forEach(sentence => {
|
|
@@ -18,4 +20,5 @@ export function containsIllegalCharacters(invocationName) {
|
|
|
18
20
|
});
|
|
19
21
|
return result;
|
|
20
22
|
}
|
|
23
|
+
exports.containsIllegalCharacters = containsIllegalCharacters;
|
|
21
24
|
//# sourceMappingURL=containsIllegalCharacters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containsIllegalCharacters.js","sourceRoot":"","sources":["../../src/AppValidator/containsIllegalCharacters.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"containsIllegalCharacters.js","sourceRoot":"","sources":["../../src/AppValidator/containsIllegalCharacters.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CAAC,cAAiC;IACvE,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,IAAI,MAAM,GAAY,KAAK,CAAC;IAE5B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,qDAAqD;QACrD,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,GAAG,IAAI,CAAC;SACjB;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAbD,8DAaC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
4
|
+
const stentor_utils_1 = require("@xapp/stentor-utils");
|
|
3
5
|
/**
|
|
4
6
|
* Does the provided string or array of strings contains numerical
|
|
5
7
|
* characters.
|
|
@@ -8,14 +10,15 @@ import { containsNumbers as _containsNumbers } from "@xapp/stentor-utils";
|
|
|
8
10
|
* @param {(string | string[])} invocationName
|
|
9
11
|
* @returns {boolean}
|
|
10
12
|
*/
|
|
11
|
-
|
|
13
|
+
function containsNumbers(invocationName) {
|
|
12
14
|
const sentences = [].concat(invocationName);
|
|
13
15
|
let result = false;
|
|
14
16
|
sentences.forEach(sentence => {
|
|
15
|
-
if (
|
|
17
|
+
if (stentor_utils_1.containsNumbers(sentence)) {
|
|
16
18
|
result = true;
|
|
17
19
|
}
|
|
18
20
|
});
|
|
19
21
|
return result;
|
|
20
22
|
}
|
|
23
|
+
exports.containsNumbers = containsNumbers;
|
|
21
24
|
//# sourceMappingURL=containsNumbers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containsNumbers.js","sourceRoot":"","sources":["../../src/AppValidator/containsNumbers.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"containsNumbers.js","sourceRoot":"","sources":["../../src/AppValidator/containsNumbers.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC,uDAA0E;AAE1E;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,cAAiC;IAC7D,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,IAAI,MAAM,GAAY,KAAK,CAAC;IAE5B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,IAAI,+BAAgB,CAAC,QAAQ,CAAC,EAAE;YAC5B,MAAM,GAAG,IAAI,CAAC;SACjB;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAZD,0CAYC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
const stentor_utils_1 = require("@xapp/stentor-utils");
|
|
5
|
+
exports.ALEXA_RESERVED_WORDS = [
|
|
4
6
|
"alexa",
|
|
5
7
|
"and",
|
|
6
8
|
"app",
|
|
@@ -27,18 +29,19 @@ export const ALEXA_RESERVED_WORDS = [
|
|
|
27
29
|
* @param {(string | string[])} invocationName
|
|
28
30
|
* @returns {boolean}
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
function containsReservedAlexaWords(invocationName) {
|
|
31
33
|
const sentences = [].concat(invocationName);
|
|
32
34
|
let result = false;
|
|
33
35
|
sentences.forEach(sentence => {
|
|
34
36
|
// rule only applies if they have two words
|
|
35
|
-
const words = toWords(sentence);
|
|
37
|
+
const words = stentor_utils_1.toWords(sentence);
|
|
36
38
|
words.forEach(word => {
|
|
37
|
-
if (ALEXA_RESERVED_WORDS.indexOf(word.toLowerCase()) !== -1) {
|
|
39
|
+
if (exports.ALEXA_RESERVED_WORDS.indexOf(word.toLowerCase()) !== -1) {
|
|
38
40
|
result = true;
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
43
|
});
|
|
42
44
|
return result;
|
|
43
45
|
}
|
|
46
|
+
exports.containsReservedAlexaWords = containsReservedAlexaWords;
|
|
44
47
|
//# sourceMappingURL=containsReservedAlexaWords.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containsReservedAlexaWords.js","sourceRoot":"","sources":["../../src/AppValidator/containsReservedAlexaWords.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"containsReservedAlexaWords.js","sourceRoot":"","sources":["../../src/AppValidator/containsReservedAlexaWords.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC,uDAA8C;AAEjC,QAAA,oBAAoB,GAAG;IAChC,OAAO;IACP,KAAK;IACL,KAAK;IACL,KAAK;IACL,OAAO;IACP,IAAI;IACJ,UAAU;IACV,MAAM;IACN,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,IAAI;IACJ,SAAS;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CAAC,cAAiC;IACxE,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,IAAI,MAAM,GAAY,KAAK,CAAC;IAE5B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,2CAA2C;QAC3C,MAAM,KAAK,GAAG,uBAAO,CAAC,QAAQ,CAAC,CAAC;QAChC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjB,IAAI,4BAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBACzD,MAAM,GAAG,IAAI,CAAC;aACjB;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAhBD,gEAgBC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
4
|
+
const stentor_utils_1 = require("@xapp/stentor-utils");
|
|
3
5
|
/**
|
|
4
6
|
* Does the provided string or array of strings include a preposition, definite article, or indefinite article.
|
|
5
7
|
*
|
|
@@ -7,15 +9,15 @@ import { isDefiniteArticle, isIndefiniteArticle, isPreposition, toWords } from "
|
|
|
7
9
|
* @param {(string | string[])} invocationName
|
|
8
10
|
* @returns {boolean}
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
function containsReservedGrammarWords(invocationName) {
|
|
11
13
|
const sentences = [].concat(invocationName);
|
|
12
14
|
let result = false;
|
|
13
15
|
sentences.forEach(sentence => {
|
|
14
16
|
// rule only applies if they have two words
|
|
15
|
-
const words = toWords(sentence);
|
|
17
|
+
const words = stentor_utils_1.toWords(sentence);
|
|
16
18
|
if (words.length === 2) {
|
|
17
19
|
words.forEach(word => {
|
|
18
|
-
if (isPreposition(word) || isDefiniteArticle(word) || isIndefiniteArticle(word)) {
|
|
20
|
+
if (stentor_utils_1.isPreposition(word) || stentor_utils_1.isDefiniteArticle(word) || stentor_utils_1.isIndefiniteArticle(word)) {
|
|
19
21
|
result = true;
|
|
20
22
|
}
|
|
21
23
|
});
|
|
@@ -23,4 +25,5 @@ export function containsReservedGrammarWords(invocationName) {
|
|
|
23
25
|
});
|
|
24
26
|
return result;
|
|
25
27
|
}
|
|
28
|
+
exports.containsReservedGrammarWords = containsReservedGrammarWords;
|
|
26
29
|
//# sourceMappingURL=containsReservedGrammarWords.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containsReservedGrammarWords.js","sourceRoot":"","sources":["../../src/AppValidator/containsReservedGrammarWords.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"containsReservedGrammarWords.js","sourceRoot":"","sources":["../../src/AppValidator/containsReservedGrammarWords.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC,uDAAqG;AAErG;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,cAAiC;IAC1E,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,IAAI,MAAM,GAAY,KAAK,CAAC;IAE5B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,2CAA2C;QAC3C,MAAM,KAAK,GAAG,uBAAO,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACjB,IAAI,6BAAa,CAAC,IAAI,CAAC,IAAI,iCAAiB,CAAC,IAAI,CAAC,IAAI,mCAAmB,CAAC,IAAI,CAAC,EAAE;oBAC7E,MAAM,GAAG,IAAI,CAAC;iBACjB;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAlBD,oEAkBC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
4
|
+
const stentor_utils_1 = require("@xapp/stentor-utils");
|
|
3
5
|
/**
|
|
4
6
|
* If the provided string or array of strings contains uppercase characters.
|
|
5
7
|
*
|
|
@@ -7,14 +9,15 @@ import { containsUppercase as _containsUppercase } from "@xapp/stentor-utils";
|
|
|
7
9
|
* @param {(string | string[])} invocationName
|
|
8
10
|
* @returns {boolean}
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
function containsUppercase(invocationName) {
|
|
11
13
|
const sentences = [].concat(invocationName);
|
|
12
14
|
let result = false;
|
|
13
15
|
sentences.forEach(sentence => {
|
|
14
|
-
if (
|
|
16
|
+
if (stentor_utils_1.containsUppercase(sentence)) {
|
|
15
17
|
result = true;
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
return result;
|
|
19
21
|
}
|
|
22
|
+
exports.containsUppercase = containsUppercase;
|
|
20
23
|
//# sourceMappingURL=containsUppercase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containsUppercase.js","sourceRoot":"","sources":["../../src/AppValidator/containsUppercase.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"containsUppercase.js","sourceRoot":"","sources":["../../src/AppValidator/containsUppercase.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC,uDAA8E;AAE9E;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,cAAiC;IAC/D,MAAM,SAAS,GAAa,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtD,IAAI,MAAM,GAAY,KAAK,CAAC;IAE5B,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACzB,IAAI,iCAAkB,CAAC,QAAQ,CAAC,EAAE;YAC9B,MAAM,GAAG,IAAI,CAAC;SACjB;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAZD,8CAYC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
6
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
7
|
+
__export(require("./AppValidator"));
|
|
3
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AppValidator/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AppValidator/index.ts"],"names":[],"mappings":";;;;;AAAA,oCAAoC;AACpC,oCAA+B"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lakmus_1 = require("lakmus");
|
|
2
4
|
/**
|
|
3
5
|
* Handler validation.
|
|
4
6
|
*
|
|
@@ -6,7 +8,7 @@ import { Validator } from "lakmus";
|
|
|
6
8
|
* @class HandlerValidator
|
|
7
9
|
* @extends {Validator<Handler>}
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
class HandlerValidator extends lakmus_1.Validator {
|
|
10
12
|
constructor() {
|
|
11
13
|
super();
|
|
12
14
|
// Required fields
|
|
@@ -26,4 +28,5 @@ export class HandlerValidator extends Validator {
|
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
exports.HandlerValidator = HandlerValidator;
|
|
29
32
|
//# sourceMappingURL=HandlerValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandlerValidator.js","sourceRoot":"","sources":["../../src/HandlerValidator/HandlerValidator.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"HandlerValidator.js","sourceRoot":"","sources":["../../src/HandlerValidator/HandlerValidator.ts"],"names":[],"mappings":";;AAEA,mCAAmC;AAEnC;;;;;;GAMG;AACH,MAAa,gBAAiB,SAAQ,kBAAkB;IACpD;QACI,KAAK,EAAE,CAAC;QAER,kBAAkB;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;aACxB,OAAO,EAAE;aACT,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;aACrB,OAAO,EAAE;aACT,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACpB,OAAO,EAAE;aACT,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;aACvB,OAAO,EAAE;aACT,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YACvB,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC;QACvC,CAAC,CAAC,CAAC;IACX,CAAC;CACJ;AApBD,4CAoBC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
6
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
7
|
+
__export(require("./HandlerValidator"));
|
|
3
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/HandlerValidator/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/HandlerValidator/index.ts"],"names":[],"mappings":";;;;;AAAA,oCAAoC;AACpC,wCAAmC"}
|
package/lib/LogicValidator.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lakmus_1 = require("lakmus");
|
|
4
|
+
class LogicValidator extends lakmus_1.Validator {
|
|
3
5
|
constructor() {
|
|
4
6
|
super();
|
|
5
7
|
this.ruleFor(x => x.compiled).notEmpty();
|
|
@@ -10,4 +12,5 @@ export class LogicValidator extends Validator {
|
|
|
10
12
|
.withMessage("You must include the 'done()' call in your logic");
|
|
11
13
|
}
|
|
12
14
|
}
|
|
15
|
+
exports.LogicValidator = LogicValidator;
|
|
13
16
|
//# sourceMappingURL=LogicValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogicValidator.js","sourceRoot":"","sources":["../src/LogicValidator.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"LogicValidator.js","sourceRoot":"","sources":["../src/LogicValidator.ts"],"names":[],"mappings":";;AAEA,mCAAmC;AAEnC,MAAa,cAAe,SAAQ,kBAAgB;IAChD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;aACxB,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;YACtB,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5E,CAAC,CAAC;aACD,WAAW,CAAC,kDAAkD,CAAC,CAAC;IACzE,CAAC;CACJ;AAVD,wCAUC"}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
const logger_1 = require("@xapp/logger");
|
|
5
|
+
const stentor_handler_1 = require("@xapp/stentor-handler");
|
|
4
6
|
const OPEN_ENDED_RESPONSE = "^((?!(StopIntent|HelpIntent|CancelIntent)).)*$";
|
|
5
|
-
|
|
7
|
+
function analyzeModelAndContent(value) {
|
|
6
8
|
const results = {
|
|
7
9
|
info: [],
|
|
8
10
|
warnings: [],
|
|
9
11
|
errors: []
|
|
10
12
|
};
|
|
11
|
-
const map = toMap(value);
|
|
13
|
+
const map = stentor_handler_1.toMap(value);
|
|
12
14
|
// Look for any without utterance patterns or content.
|
|
13
15
|
Object.keys(map).forEach(intentId => {
|
|
14
16
|
/* tslint:disable:cyclomatic-complexity */
|
|
15
17
|
const intent = map[intentId];
|
|
16
18
|
const referenceName = `${intent.name ? intent.name + " / " : ""}${intentId}`;
|
|
17
|
-
if (isGlobalHandler(intent)) {
|
|
19
|
+
if (stentor_handler_1.isGlobalHandler(intent)) {
|
|
18
20
|
results.info.push({
|
|
19
21
|
id: intentId,
|
|
20
22
|
message: `${referenceName} is a global handler (it has utterances and content).`
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
25
|
// Warning if it doesn't have any utterances or content
|
|
24
|
-
if (!hasUtterances(intent) && !hasContent(intent)) {
|
|
26
|
+
if (!stentor_handler_1.hasUtterances(intent) && !stentor_handler_1.hasContent(intent)) {
|
|
25
27
|
results.warnings.push({
|
|
26
28
|
id: intentId,
|
|
27
29
|
message: `${referenceName} has neither utterances or content.`
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
// Warning if it doesn't have content for itself
|
|
31
|
-
if (hasContent(intent)) {
|
|
32
|
-
if (isHandler(intent) && !intent.content[intent.intentId]) {
|
|
33
|
+
if (stentor_handler_1.hasContent(intent)) {
|
|
34
|
+
if (stentor_handler_1.isHandler(intent) && !intent.content[intent.intentId]) {
|
|
33
35
|
results.warnings.push({
|
|
34
36
|
id: intentId,
|
|
35
37
|
message: `${referenceName} does not have content for it's own ID`
|
|
@@ -37,28 +39,28 @@ export function analyzeModelAndContent(value) {
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
// Warning if it forwards to itself
|
|
40
|
-
if (forwardsTo(intent, intent.intentId)) {
|
|
42
|
+
if (stentor_handler_1.forwardsTo(intent, intent.intentId)) {
|
|
41
43
|
results.warnings.push({
|
|
42
44
|
id: intentId,
|
|
43
45
|
message: `${referenceName} forwards to itself.`
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
// Info that is has an open ended response
|
|
47
|
-
if (handles(intent, OPEN_ENDED_RESPONSE, HandledIn.Forward)) {
|
|
49
|
+
if (stentor_handler_1.handles(intent, OPEN_ENDED_RESPONSE, stentor_handler_1.HandledIn.Forward)) {
|
|
48
50
|
results.info.push({
|
|
49
51
|
id: intentId,
|
|
50
52
|
message: `${intentId} handles an open-ended forward.`
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
// Warning if it has forwards and no reprompt
|
|
54
|
-
if (hasForwards(intent) && !hasReprompt(intent)) {
|
|
56
|
+
if (stentor_handler_1.hasForwards(intent) && !stentor_handler_1.hasReprompt(intent)) {
|
|
55
57
|
results.errors.push({
|
|
56
58
|
id: intentId,
|
|
57
59
|
message: `${referenceName} has forwards but no reprompts.`
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
// Warning if it has reprompt but no forwards
|
|
61
|
-
if (!hasForwards(intent) && hasReprompt(intent)) {
|
|
63
|
+
if (!stentor_handler_1.hasForwards(intent) && stentor_handler_1.hasReprompt(intent)) {
|
|
62
64
|
results.warnings.push({
|
|
63
65
|
id: intentId,
|
|
64
66
|
message: `${referenceName} has a reprompt but no forwards`
|
|
@@ -72,20 +74,20 @@ export function analyzeModelAndContent(value) {
|
|
|
72
74
|
})
|
|
73
75
|
} */
|
|
74
76
|
// Error Contains improper comments
|
|
75
|
-
if (responsesContain(intent, "<! --")) {
|
|
77
|
+
if (stentor_handler_1.responsesContain(intent, "<! --")) {
|
|
76
78
|
results.errors.push({
|
|
77
79
|
id: intentId,
|
|
78
80
|
message: `${referenceName} contains improperly formated comments (<! -- instead of <!--) in the response.`
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
83
|
// Error contains improper comments <!—
|
|
82
|
-
if (responsesContain(intent, "<!—")) {
|
|
84
|
+
if (stentor_handler_1.responsesContain(intent, "<!—")) {
|
|
83
85
|
results.errors.push({
|
|
84
86
|
id: intentId,
|
|
85
87
|
message: `${referenceName} contains improperly formated comments (<!— instead of <!--) in the response.`
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
|
-
const containsInvalid = containsInvalidResponse(intent);
|
|
90
|
+
const containsInvalid = stentor_handler_1.containsInvalidResponse(intent);
|
|
89
91
|
if (containsInvalid.error) {
|
|
90
92
|
results.errors.push({
|
|
91
93
|
id: intentId,
|
|
@@ -93,8 +95,8 @@ export function analyzeModelAndContent(value) {
|
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
// Warning, has only one forward that isn't the open ended key
|
|
96
|
-
if (hasForwards(intent)) {
|
|
97
|
-
if (isHandler(intent)) {
|
|
98
|
+
if (stentor_handler_1.hasForwards(intent)) {
|
|
99
|
+
if (stentor_handler_1.isHandler(intent)) {
|
|
98
100
|
if (Object.keys(intent.forward).length === 1) {
|
|
99
101
|
const key = Object.keys(intent.forward)[0];
|
|
100
102
|
const paths = intent.forward[key];
|
|
@@ -117,19 +119,21 @@ export function analyzeModelAndContent(value) {
|
|
|
117
119
|
});
|
|
118
120
|
return results;
|
|
119
121
|
}
|
|
120
|
-
|
|
122
|
+
exports.analyzeModelAndContent = analyzeModelAndContent;
|
|
123
|
+
function printResult(results) {
|
|
121
124
|
// Info
|
|
122
125
|
results.info.forEach(result => {
|
|
123
|
-
log().info(result.message);
|
|
126
|
+
logger_1.log().info(result.message);
|
|
124
127
|
});
|
|
125
128
|
// Warning
|
|
126
129
|
results.warnings.forEach(result => {
|
|
127
|
-
log().warn(result.message);
|
|
130
|
+
logger_1.log().warn(result.message);
|
|
128
131
|
});
|
|
129
132
|
// Errors
|
|
130
133
|
// Info
|
|
131
134
|
results.errors.forEach(result => {
|
|
132
|
-
log().error(result.message);
|
|
135
|
+
logger_1.log().error(result.message);
|
|
133
136
|
});
|
|
134
137
|
}
|
|
138
|
+
exports.printResult = printResult;
|
|
135
139
|
//# sourceMappingURL=analyzeModelAndContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeModelAndContent.js","sourceRoot":"","sources":["../src/analyzeModelAndContent.ts"],"names":[],"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AAG,aAAa,iGAAiG;yBAC7H,CAAC,CAAC;qBACN;iBACJ;aACJ;SACJ;QACD,yCAAyC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACnB,CAAC;AArID,wDAqIC;AAED,SAAgB,WAAW,CAAC,OAAqC;IAC7D,OAAO;IACP,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,YAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,UAAU;IACV,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC9B,YAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,SAAS;IACT,OAAO;IACP,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC5B,YAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC;AAhBD,kCAgBC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
6
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
__export(require("./analyzeModelAndContent"));
|
|
8
|
+
__export(require("./AppValidator"));
|
|
9
|
+
__export(require("./HandlerValidator"));
|
|
10
|
+
__export(require("./LogicValidator"));
|
|
6
11
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,oCAAoC;AACpC,8CAAyC;AACzC,oCAA+B;AAC/B,wCAAmC;AACnC,sCAAiC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "restricted"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.7.
|
|
7
|
+
"version": "1.7.5",
|
|
8
8
|
"description": "Model validation for Stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"typescript": "3.5.3"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@xapp/logger": "^1.7.
|
|
28
|
-
"@xapp/stentor-handler": "^1.7.
|
|
29
|
-
"@xapp/stentor-models": "^1.7.
|
|
30
|
-
"@xapp/stentor-utils": "^1.7.
|
|
27
|
+
"@xapp/logger": "^1.7.1",
|
|
28
|
+
"@xapp/stentor-handler": "^1.7.5",
|
|
29
|
+
"@xapp/stentor-models": "^1.7.1",
|
|
30
|
+
"@xapp/stentor-utils": "^1.7.1",
|
|
31
31
|
"lakmus": "0.3.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"clean": "rm -rf ./lib/*",
|
|
36
36
|
"test": "mocha --recursive -r ts-node/register \"./src/**/*.test.ts\""
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "76caa8128312b8eed09a63a40e79fddc82685bd1"
|
|
39
39
|
}
|