@voiceflow/utils-designer 1.12.2 → 1.13.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.
@@ -1,8 +1,3 @@
1
- import type { Flow } from '@voiceflow/dtos';
2
- export declare const flowNameUniqValidator: import("./main").IValidatorWithContext<string, {
3
- flows: Flow[];
4
- }>;
5
- export declare const flowNameValidator: import("./main").IValidatorWithContext<string, {
6
- flows: Flow[];
7
- }>;
1
+ export declare const flowNameSpellingValidator: (value: string) => import("./main").IValidatorResult<string>;
2
+ export declare const flowNameValidator: import("./main").IValidatorWithContext<string, unknown>;
8
3
  //# sourceMappingURL=flow.util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow.util.d.ts","sourceRoot":"","sources":["../../src/flow.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,eAAO,MAAM,qBAAqB;WACG,IAAI,EAAE;EAG1C,CAAC;AAEF,eAAO,MAAM,iBAAiB;WALO,IAAI,EAAE;EAK8B,CAAC"}
1
+ {"version":3,"file":"flow.util.d.ts","sourceRoot":"","sources":["../../src/flow.util.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,8DAA0C,CAAC;AAEjF,eAAO,MAAM,iBAAiB,yDAA+C,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flowNameValidator = exports.flowNameUniqValidator = void 0;
3
+ exports.flowNameValidator = exports.flowNameSpellingValidator = void 0;
4
+ const dtos_1 = require("@voiceflow/dtos");
4
5
  const validator_util_1 = require("./validator/validator.util");
5
- exports.flowNameUniqValidator = (0, validator_util_1.validatorFactory)((name, { flows }) => flows.every((flow) => flow.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `flow name already exists.`);
6
- exports.flowNameValidator = (0, validator_util_1.composeValidators)(exports.flowNameUniqValidator);
6
+ exports.flowNameSpellingValidator = (0, validator_util_1.validatorZodFactory)(dtos_1.FlowDTO.shape.name);
7
+ exports.flowNameValidator = (0, validator_util_1.composeValidators)(exports.flowNameSpellingValidator);
@@ -1,8 +1,3 @@
1
- import type { Flow } from '@voiceflow/dtos';
2
- export declare const flowNameUniqValidator: import("./main.js").IValidatorWithContext<string, {
3
- flows: Flow[];
4
- }>;
5
- export declare const flowNameValidator: import("./main.js").IValidatorWithContext<string, {
6
- flows: Flow[];
7
- }>;
1
+ export declare const flowNameSpellingValidator: (value: string) => import("./main.js").IValidatorResult<string>;
2
+ export declare const flowNameValidator: import("./main.js").IValidatorWithContext<string, unknown>;
8
3
  //# sourceMappingURL=flow.util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow.util.d.ts","sourceRoot":"","sources":["../../src/flow.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,eAAO,MAAM,qBAAqB;WACG,IAAI,EAAE;EAG1C,CAAC;AAEF,eAAO,MAAM,iBAAiB;WALO,IAAI,EAAE;EAK8B,CAAC"}
1
+ {"version":3,"file":"flow.util.d.ts","sourceRoot":"","sources":["../../src/flow.util.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,8DAA0C,CAAC;AAEjF,eAAO,MAAM,iBAAiB,yDAA+C,CAAC"}
@@ -1,3 +1,4 @@
1
- import { composeValidators, validatorFactory } from './validator/validator.util.js';
2
- export const flowNameUniqValidator = validatorFactory((name, { flows }) => flows.every((flow) => flow.name.toLocaleLowerCase() !== name.toLocaleLowerCase()), () => `flow name already exists.`);
3
- export const flowNameValidator = composeValidators(flowNameUniqValidator);
1
+ import { FlowDTO } from '@voiceflow/dtos';
2
+ import { composeValidators, validatorZodFactory } from './validator/validator.util.js';
3
+ export const flowNameSpellingValidator = validatorZodFactory(FlowDTO.shape.name);
4
+ export const flowNameValidator = composeValidators(flowNameSpellingValidator);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/utils-designer",
3
- "version": "1.12.2",
3
+ "version": "1.13.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.36.0",
39
+ "@voiceflow/dtos": "1.37.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": "d8e2ab8cf86889eaa0c7f8a453e9453098e26e56"
58
+ "gitHead": "d224ae0012e00def1b70cf60cd5362c64d5a5f13"
59
59
  }