@voiceflow/utils-designer 1.10.0 → 1.11.0
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.
@@ -26,5 +26,9 @@ export interface VariableDeclaration {
|
|
26
26
|
datatype?: VariableDatatype;
|
27
27
|
defaultValue: string | null;
|
28
28
|
}
|
29
|
-
export declare
|
29
|
+
export declare const parseVariableDefaultValue: (name: string, { datatype, isSystem, defaultValue }: VariableDeclaration) => string | number | boolean | Date | null;
|
30
|
+
/**
|
31
|
+
* @deprecated use parseVariableDefaultValue instead
|
32
|
+
*/
|
33
|
+
export declare const parseCMSVariableDefaultValue: (name: string, { datatype, isSystem, defaultValue }: VariableDeclaration) => string | number | boolean | Date | null;
|
30
34
|
//# sourceMappingURL=variable.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"variable.util.d.ts","sourceRoot":"","sources":["../../src/variable.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA4B,cAAc,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AAI1G,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,mCACe,CAAC;AAEzE,eAAO,MAAM,6BAA6B,8DAA8C,CAAC;AAEzF,eAAO,MAAM,kCAAkC;eACU,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;EAG7F,CAAC;AAEF,eAAO,MAAM,iCAAiC;cACH,MAAM,EAAE;EAElD,CAAC;AAEF,eAAO,MAAM,gCAAgC;aACJ,MAAM,EAAE;EAEhD,CAAC;AAEF,eAAO,MAAM,qBAAqB;eAfuB,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;;cAMnD,MAAM,EAAE;;aAKV,MAAM,EAAE;EAShD,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,
|
1
|
+
{"version":3,"file":"variable.util.d.ts","sourceRoot":"","sources":["../../src/variable.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA4B,cAAc,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AAI1G,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,mCACe,CAAC;AAEzE,eAAO,MAAM,6BAA6B,8DAA8C,CAAC;AAEzF,eAAO,MAAM,kCAAkC;eACU,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;EAG7F,CAAC;AAEF,eAAO,MAAM,iCAAiC;cACH,MAAM,EAAE;EAElD,CAAC;AAEF,eAAO,MAAM,gCAAgC;aACJ,MAAM,EAAE;EAEhD,CAAC;AAEF,eAAO,MAAM,qBAAqB;eAfuB,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;;cAMnD,MAAM,EAAE;;aAKV,MAAM,EAAE;EAShD,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,yBAAyB,SAAU,MAAM,wCAAwC,mBAAmB,4CAmBhH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,SAxBO,MAAM,wCAAwC,mBAAmB,4CAwB5C,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.parseCMSVariableDefaultValue = exports.variableNameValidator = exports.variableNameUniqIntentsValidator = exports.variableNameUniqEntitiesValidator = exports.variableNameUniqVariablesValidator = exports.variableNameSpellingValidator = exports.isSystemVariableName = void 0;
|
3
|
+
exports.parseCMSVariableDefaultValue = exports.parseVariableDefaultValue = exports.variableNameValidator = exports.variableNameUniqIntentsValidator = exports.variableNameUniqEntitiesValidator = exports.variableNameUniqVariablesValidator = exports.variableNameSpellingValidator = exports.isSystemVariableName = void 0;
|
4
4
|
const dtos_1 = require("@voiceflow/dtos");
|
5
5
|
const validator_util_1 = require("./validator/validator.util");
|
6
6
|
const isSystemVariableName = (variableName) => Object.values(dtos_1.SystemVariable).includes(variableName);
|
@@ -10,7 +10,7 @@ exports.variableNameUniqVariablesValidator = (0, validator_util_1.validatorFacto
|
|
10
10
|
exports.variableNameUniqEntitiesValidator = (0, validator_util_1.validatorFactory)((name, { entities }) => entities.every((entity) => entity.name !== name), () => `Entity name already exists.`);
|
11
11
|
exports.variableNameUniqIntentsValidator = (0, validator_util_1.validatorFactory)((name, { intents }) => intents.every((intent) => intent.name !== name), () => `Intent name already exists.`);
|
12
12
|
exports.variableNameValidator = (0, validator_util_1.composeValidators)(exports.variableNameSpellingValidator, exports.variableNameUniqVariablesValidator, exports.variableNameUniqEntitiesValidator, exports.variableNameUniqIntentsValidator);
|
13
|
-
|
13
|
+
const parseVariableDefaultValue = (name, { datatype, isSystem, defaultValue }) => {
|
14
14
|
if (!defaultValue)
|
15
15
|
return defaultValue;
|
16
16
|
const type = isSystem && (0, exports.isSystemVariableName)(name) ? dtos_1.SYSTEM_VARIABLE_TYPE_MAP[name] : datatype;
|
@@ -28,5 +28,9 @@ function parseCMSVariableDefaultValue(name, { datatype, isSystem, defaultValue }
|
|
28
28
|
default:
|
29
29
|
throw new Error(`Received unexpected variable type '${type}'`);
|
30
30
|
}
|
31
|
-
}
|
32
|
-
exports.
|
31
|
+
};
|
32
|
+
exports.parseVariableDefaultValue = parseVariableDefaultValue;
|
33
|
+
/**
|
34
|
+
* @deprecated use parseVariableDefaultValue instead
|
35
|
+
*/
|
36
|
+
exports.parseCMSVariableDefaultValue = exports.parseVariableDefaultValue;
|
@@ -26,5 +26,9 @@ export interface VariableDeclaration {
|
|
26
26
|
datatype?: VariableDatatype;
|
27
27
|
defaultValue: string | null;
|
28
28
|
}
|
29
|
-
export declare
|
29
|
+
export declare const parseVariableDefaultValue: (name: string, { datatype, isSystem, defaultValue }: VariableDeclaration) => string | number | boolean | Date | null;
|
30
|
+
/**
|
31
|
+
* @deprecated use parseVariableDefaultValue instead
|
32
|
+
*/
|
33
|
+
export declare const parseCMSVariableDefaultValue: (name: string, { datatype, isSystem, defaultValue }: VariableDeclaration) => string | number | boolean | Date | null;
|
30
34
|
//# sourceMappingURL=variable.util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"variable.util.d.ts","sourceRoot":"","sources":["../../src/variable.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA4B,cAAc,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AAI1G,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,mCACe,CAAC;AAEzE,eAAO,MAAM,6BAA6B,8DAA8C,CAAC;AAEzF,eAAO,MAAM,kCAAkC;eACU,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;EAG7F,CAAC;AAEF,eAAO,MAAM,iCAAiC;cACH,MAAM,EAAE;EAElD,CAAC;AAEF,eAAO,MAAM,gCAAgC;aACJ,MAAM,EAAE;EAEhD,CAAC;AAEF,eAAO,MAAM,qBAAqB;eAfuB,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;;cAMnD,MAAM,EAAE;;aAKV,MAAM,EAAE;EAShD,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,
|
1
|
+
{"version":3,"file":"variable.util.d.ts","sourceRoot":"","sources":["../../src/variable.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAA4B,cAAc,EAAE,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AAI1G,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,mCACe,CAAC;AAEzE,eAAO,MAAM,6BAA6B,8DAA8C,CAAC;AAEzF,eAAO,MAAM,kCAAkC;eACU,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;EAG7F,CAAC;AAEF,eAAO,MAAM,iCAAiC;cACH,MAAM,EAAE;EAElD,CAAC;AAEF,eAAO,MAAM,gCAAgC;aACJ,MAAM,EAAE;EAEhD,CAAC;AAEF,eAAO,MAAM,qBAAqB;eAfuB,QAAQ,EAAE;gBAAc,MAAM,GAAG,IAAI;;cAMnD,MAAM,EAAE;;aAKV,MAAM,EAAE;EAShD,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,yBAAyB,SAAU,MAAM,wCAAwC,mBAAmB,4CAmBhH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,SAxBO,MAAM,wCAAwC,mBAAmB,4CAwB5C,CAAC"}
|
@@ -6,7 +6,7 @@ export const variableNameUniqVariablesValidator = validatorFactory((name, { vari
|
|
6
6
|
export const variableNameUniqEntitiesValidator = validatorFactory((name, { entities }) => entities.every((entity) => entity.name !== name), () => `Entity name already exists.`);
|
7
7
|
export const variableNameUniqIntentsValidator = validatorFactory((name, { intents }) => intents.every((intent) => intent.name !== name), () => `Intent name already exists.`);
|
8
8
|
export const variableNameValidator = composeValidators(variableNameSpellingValidator, variableNameUniqVariablesValidator, variableNameUniqEntitiesValidator, variableNameUniqIntentsValidator);
|
9
|
-
export
|
9
|
+
export const parseVariableDefaultValue = (name, { datatype, isSystem, defaultValue }) => {
|
10
10
|
if (!defaultValue)
|
11
11
|
return defaultValue;
|
12
12
|
const type = isSystem && isSystemVariableName(name) ? SYSTEM_VARIABLE_TYPE_MAP[name] : datatype;
|
@@ -24,4 +24,8 @@ export function parseCMSVariableDefaultValue(name, { datatype, isSystem, default
|
|
24
24
|
default:
|
25
25
|
throw new Error(`Received unexpected variable type '${type}'`);
|
26
26
|
}
|
27
|
-
}
|
27
|
+
};
|
28
|
+
/**
|
29
|
+
* @deprecated use parseVariableDefaultValue instead
|
30
|
+
*/
|
31
|
+
export const parseCMSVariableDefaultValue = parseVariableDefaultValue;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@voiceflow/utils-designer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.11.0",
|
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.7",
|
39
|
-
"@voiceflow/dtos": "1.
|
39
|
+
"@voiceflow/dtos": "1.35.0",
|
40
40
|
"bidirectional-adapter": "1.2.1",
|
41
41
|
"ts-pattern": "^5.0.5",
|
42
42
|
"zod": "3.22.4"
|
@@ -55,5 +55,5 @@
|
|
55
55
|
"tsd": {
|
56
56
|
"directory": "src"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "936dce82eb7543051fdbb5b784ffba40a33c065d"
|
59
59
|
}
|