@voiceflow/utils-designer 1.5.2 → 1.6.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,6 +1,7 @@
1
1
  export * from './entity.util';
2
2
  export * from './intent.util';
3
3
  export * from './markup.util';
4
+ export * from './request.util';
4
5
  export * from './validator/validator.interface';
5
6
  export * from './validator/validator.util';
6
7
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC"}
package/build/cjs/main.js CHANGED
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./entity.util"), exports);
18
18
  __exportStar(require("./intent.util"), exports);
19
19
  __exportStar(require("./markup.util"), exports);
20
+ __exportStar(require("./request.util"), exports);
20
21
  __exportStar(require("./validator/validator.interface"), exports);
21
22
  __exportStar(require("./validator/validator.util"), exports);
@@ -0,0 +1,32 @@
1
+ export declare const isTextRequest: (request: unknown) => request is {
2
+ type: "text";
3
+ payload: string;
4
+ diagramID?: string | undefined;
5
+ };
6
+ export declare const isActionRequest: (request: unknown) => request is {
7
+ type: "action";
8
+ payload: {
9
+ label?: string | undefined;
10
+ };
11
+ diagramID?: string | undefined;
12
+ };
13
+ export declare const isIntentRequest: (request: unknown) => request is {
14
+ type: "intent";
15
+ payload: {
16
+ intent: {
17
+ name: string;
18
+ };
19
+ data?: Record<string, any> | undefined;
20
+ query?: string | undefined;
21
+ entities?: {
22
+ value: string;
23
+ name: string;
24
+ query?: string | undefined;
25
+ verboseValue?: string | undefined;
26
+ }[] | undefined;
27
+ confidence?: number | undefined;
28
+ label?: string | undefined;
29
+ };
30
+ diagramID?: string | undefined;
31
+ };
32
+ //# sourceMappingURL=request.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.util.d.ts","sourceRoot":"","sources":["../../src/request.util.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,YAAa,OAAO;;;;CAAsE,CAAC;AAErH,eAAO,MAAM,eAAe,YAAa,OAAO;;;;;;CACH,CAAC;AAE9C,eAAO,MAAM,eAAe,YAAa,OAAO;;;;;;;;;;;;;;;;;;CACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isIntentRequest = exports.isActionRequest = exports.isTextRequest = void 0;
4
+ const dtos_1 = require("@voiceflow/dtos");
5
+ const isTextRequest = (request) => dtos_1.TextRequestDTO.safeParse(request).success;
6
+ exports.isTextRequest = isTextRequest;
7
+ const isActionRequest = (request) => dtos_1.ActionRequestDTO.safeParse(request).success;
8
+ exports.isActionRequest = isActionRequest;
9
+ const isIntentRequest = (request) => dtos_1.IntentRequestDTO.safeParse(request).success;
10
+ exports.isIntentRequest = isIntentRequest;
@@ -1,6 +1,7 @@
1
1
  export * from './entity.util.js';
2
2
  export * from './intent.util.js';
3
3
  export * from './markup.util.js';
4
+ export * from './request.util.js';
4
5
  export * from './validator/validator.interface.js';
5
6
  export * from './validator/validator.util.js';
6
7
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC"}
package/build/esm/main.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './entity.util.js';
2
2
  export * from './intent.util.js';
3
3
  export * from './markup.util.js';
4
+ export * from './request.util.js';
4
5
  export * from './validator/validator.interface.js';
5
6
  export * from './validator/validator.util.js';
@@ -0,0 +1,32 @@
1
+ export declare const isTextRequest: (request: unknown) => request is {
2
+ type: "text";
3
+ payload: string;
4
+ diagramID?: string | undefined;
5
+ };
6
+ export declare const isActionRequest: (request: unknown) => request is {
7
+ type: "action";
8
+ payload: {
9
+ label?: string | undefined;
10
+ };
11
+ diagramID?: string | undefined;
12
+ };
13
+ export declare const isIntentRequest: (request: unknown) => request is {
14
+ type: "intent";
15
+ payload: {
16
+ intent: {
17
+ name: string;
18
+ };
19
+ data?: Record<string, any> | undefined;
20
+ query?: string | undefined;
21
+ entities?: {
22
+ value: string;
23
+ name: string;
24
+ query?: string | undefined;
25
+ verboseValue?: string | undefined;
26
+ }[] | undefined;
27
+ confidence?: number | undefined;
28
+ label?: string | undefined;
29
+ };
30
+ diagramID?: string | undefined;
31
+ };
32
+ //# sourceMappingURL=request.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.util.d.ts","sourceRoot":"","sources":["../../src/request.util.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,YAAa,OAAO;;;;CAAsE,CAAC;AAErH,eAAO,MAAM,eAAe,YAAa,OAAO;;;;;;CACH,CAAC;AAE9C,eAAO,MAAM,eAAe,YAAa,OAAO;;;;;;;;;;;;;;;;;;CACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ActionRequestDTO, IntentRequestDTO, TextRequestDTO } from '@voiceflow/dtos';
2
+ export const isTextRequest = (request) => TextRequestDTO.safeParse(request).success;
3
+ export const isActionRequest = (request) => ActionRequestDTO.safeParse(request).success;
4
+ export const isIntentRequest = (request) => IntentRequestDTO.safeParse(request).success;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceflow/utils-designer",
3
- "version": "1.5.2",
3
+ "version": "1.6.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.3",
39
- "@voiceflow/dtos": "1.14.0",
39
+ "@voiceflow/dtos": "1.15.0",
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": "821ffc2594ddd0d9087557374334678965c82f51"
52
+ "gitHead": "893439677cbb4c7b11af535a9a7918943815c4c6"
53
53
  }