@voiceflow/utils-designer 1.6.6 → 1.6.8
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/cjs/entity.util.js
CHANGED
@@ -9,8 +9,8 @@ exports.isDefaultEntityName = isDefaultEntityName;
|
|
9
9
|
const isEntityVariantLikeEmpty = ({ value, synonyms }) => !value.trim() && synonyms.every((synonym) => !synonym.trim());
|
10
10
|
exports.isEntityVariantLikeEmpty = isEntityVariantLikeEmpty;
|
11
11
|
exports.entityNameSpellingValidator = (0, validator_util_1.validatorZodFactory)(dtos_1.EntityDTO.shape.name);
|
12
|
-
exports.entityNameUniqEntitiesValidator = (0, validator_util_1.validatorFactory)((name, { entities, entityID }) => entities.every((entity) => entity.id === entityID || entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
12
|
+
exports.entityNameUniqEntitiesValidator = (0, validator_util_1.validatorFactory)((name, { entities, entityID }) => entities.every((entity) => entity.id === entityID || entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `'Entity name already exists.`);
|
13
13
|
exports.entityNameUniqVariablesValidator = (0, validator_util_1.validatorFactory)((name, { variables }) => variables.every((variable) => variable.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `You have a variable defined with the '${name}' name already. Entity/Variable/Intent name must be unique.`);
|
14
|
-
exports.entityNameUniqIntentsValidator = (0, validator_util_1.validatorFactory)((name, { intents }) => intents.every((intent) => intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
14
|
+
exports.entityNameUniqIntentsValidator = (0, validator_util_1.validatorFactory)((name, { intents }) => intents.every((intent) => intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `Intent name already exists.`);
|
15
15
|
exports.entityNameValidator = (0, validator_util_1.composeValidators)(exports.entityNameSpellingValidator, exports.entityNameUniqEntitiesValidator, exports.entityNameUniqVariablesValidator, exports.entityNameUniqIntentsValidator);
|
16
16
|
exports.entityVariantsValidator = (0, validator_util_1.validatorFactory)((variants, { classifier }) => classifier !== common_1.CUSTOM_SLOT_TYPE || variants.some(({ value }) => value.trim().length), 'Custom entities require at least one value.');
|
package/build/cjs/intent.util.js
CHANGED
@@ -8,7 +8,7 @@ const isDefaultIntentName = (name) => !name || name.toLowerCase().startsWith('in
|
|
8
8
|
exports.isDefaultIntentName = isDefaultIntentName;
|
9
9
|
exports.intentNameSpellingValidator = (0, validator_util_1.validatorZodFactory)(dtos_1.IntentDTO.shape.name);
|
10
10
|
exports.intentNameUniqIntentsValidator = (0, validator_util_1.validatorFactory)((name, { intents, intentID }) => intents.every((intent) => intent.id === intentID || intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `The '${name}' intent already exists.`);
|
11
|
-
exports.intentNameUniqEntitiesValidator = (0, validator_util_1.validatorFactory)((name, { entities }) => entities.every((entity) => entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
11
|
+
exports.intentNameUniqEntitiesValidator = (0, validator_util_1.validatorFactory)((name, { entities }) => entities.every((entity) => entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `Intent name already exists.`);
|
12
12
|
exports.intentNameUniqVariablesValidator = (0, validator_util_1.validatorFactory)((name, { variables }) => variables.every((variable) => variable.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `You have a variable defined with the '${name}' name already. Intent/Variable/Entity name must be unique.`);
|
13
13
|
exports.intentNameValidator = (0, validator_util_1.composeValidators)(exports.intentNameSpellingValidator, exports.intentNameUniqIntentsValidator, exports.intentNameUniqEntitiesValidator, exports.intentNameUniqVariablesValidator);
|
14
14
|
exports.intentUtterancesValidator = (0, validator_util_1.validatorFactory)((utterances, { isBuiltInIntent }) => isBuiltInIntent || utterances.some(({ text }) => !(0, markup_util_1.isMarkupEmpty)(text)), 'Intent requires at least 1 sample phrase.');
|
package/build/esm/entity.util.js
CHANGED
@@ -4,8 +4,8 @@ import { composeValidators, validatorFactory, validatorZodFactory } from './vali
|
|
4
4
|
export const isDefaultEntityName = (name) => !name || name.toLowerCase().startsWith('entity');
|
5
5
|
export const isEntityVariantLikeEmpty = ({ value, synonyms }) => !value.trim() && synonyms.every((synonym) => !synonym.trim());
|
6
6
|
export const entityNameSpellingValidator = validatorZodFactory(EntityDTO.shape.name);
|
7
|
-
export const entityNameUniqEntitiesValidator = validatorFactory((name, { entities, entityID }) => entities.every((entity) => entity.id === entityID || entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
7
|
+
export const entityNameUniqEntitiesValidator = validatorFactory((name, { entities, entityID }) => entities.every((entity) => entity.id === entityID || entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `'Entity name already exists.`);
|
8
8
|
export const entityNameUniqVariablesValidator = validatorFactory((name, { variables }) => variables.every((variable) => variable.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `You have a variable defined with the '${name}' name already. Entity/Variable/Intent name must be unique.`);
|
9
|
-
export const entityNameUniqIntentsValidator = validatorFactory((name, { intents }) => intents.every((intent) => intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
9
|
+
export const entityNameUniqIntentsValidator = validatorFactory((name, { intents }) => intents.every((intent) => intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `Intent name already exists.`);
|
10
10
|
export const entityNameValidator = composeValidators(entityNameSpellingValidator, entityNameUniqEntitiesValidator, entityNameUniqVariablesValidator, entityNameUniqIntentsValidator);
|
11
11
|
export const entityVariantsValidator = validatorFactory((variants, { classifier }) => classifier !== CUSTOM_SLOT_TYPE || variants.some(({ value }) => value.trim().length), 'Custom entities require at least one value.');
|
package/build/esm/intent.util.js
CHANGED
@@ -4,7 +4,7 @@ import { composeValidators, validatorFactory, validatorZodFactory } from './vali
|
|
4
4
|
export const isDefaultIntentName = (name) => !name || name.toLowerCase().startsWith('intent');
|
5
5
|
export const intentNameSpellingValidator = validatorZodFactory(IntentDTO.shape.name);
|
6
6
|
export const intentNameUniqIntentsValidator = validatorFactory((name, { intents, intentID }) => intents.every((intent) => intent.id === intentID || intent.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `The '${name}' intent already exists.`);
|
7
|
-
export const intentNameUniqEntitiesValidator = validatorFactory((name, { entities }) => entities.every((entity) => entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (
|
7
|
+
export const intentNameUniqEntitiesValidator = validatorFactory((name, { entities }) => entities.every((entity) => entity.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `Intent name already exists.`);
|
8
8
|
export const intentNameUniqVariablesValidator = validatorFactory((name, { variables }) => variables.every((variable) => variable.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), (name) => `You have a variable defined with the '${name}' name already. Intent/Variable/Entity name must be unique.`);
|
9
9
|
export const intentNameValidator = composeValidators(intentNameSpellingValidator, intentNameUniqIntentsValidator, intentNameUniqEntitiesValidator, intentNameUniqVariablesValidator);
|
10
10
|
export const intentUtterancesValidator = validatorFactory((utterances, { isBuiltInIntent }) => isBuiltInIntent || utterances.some(({ text }) => !isMarkupEmpty(text)), 'Intent requires at least 1 sample phrase.');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@voiceflow/utils-designer",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.8",
|
4
4
|
"exports": {
|
5
5
|
".": {
|
6
6
|
"types": "./build/cjs/main.d.ts",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"@voiceflow/common": "8.2.3",
|
39
|
-
"@voiceflow/dtos": "1.21.
|
39
|
+
"@voiceflow/dtos": "1.21.1",
|
40
40
|
"bidirectional-adapter": "1.2.1",
|
41
41
|
"ts-pattern": "^5.0.5",
|
42
42
|
"zod": "3.22.4"
|
@@ -49,5 +49,5 @@
|
|
49
49
|
"tsd": {
|
50
50
|
"directory": "src"
|
51
51
|
},
|
52
|
-
"gitHead": "
|
52
|
+
"gitHead": "009e56e793f45c5843f1b2b380ffed909cf0289d"
|
53
53
|
}
|