@voiceflow/base-types 2.15.0 → 2.16.2

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.
Files changed (33) hide show
  1. package/build/common/node/buttons.d.ts +6 -4
  2. package/build/common/node/capture.d.ts +3 -5
  3. package/build/common/node/captureV2.d.ts +8 -11
  4. package/build/common/node/captureV2.js.map +1 -1
  5. package/build/common/node/goTo.d.ts +2 -4
  6. package/build/common/node/interaction.d.ts +7 -7
  7. package/build/common/node/interaction.js.map +1 -1
  8. package/build/common/node/prompt.d.ts +6 -5
  9. package/build/common/node/utils/index.d.ts +1 -0
  10. package/build/common/node/utils/index.js +1 -0
  11. package/build/common/node/utils/index.js.map +1 -1
  12. package/build/common/node/utils/intent.d.ts +10 -0
  13. package/build/common/node/utils/intent.js +9 -0
  14. package/build/common/node/utils/intent.js.map +1 -0
  15. package/build/common/node/utils/noMatch.d.ts +6 -0
  16. package/build/common/node/utils/noReply.d.ts +6 -0
  17. package/build/esm/node/buttons.d.ts +6 -4
  18. package/build/esm/node/capture.d.ts +3 -5
  19. package/build/esm/node/captureV2.d.ts +8 -11
  20. package/build/esm/node/captureV2.js.map +1 -1
  21. package/build/esm/node/goTo.d.ts +2 -4
  22. package/build/esm/node/interaction.d.ts +7 -7
  23. package/build/esm/node/interaction.js.map +1 -1
  24. package/build/esm/node/prompt.d.ts +6 -5
  25. package/build/esm/node/utils/index.d.ts +1 -0
  26. package/build/esm/node/utils/index.js +1 -0
  27. package/build/esm/node/utils/index.js.map +1 -1
  28. package/build/esm/node/utils/intent.d.ts +10 -0
  29. package/build/esm/node/utils/intent.js +6 -0
  30. package/build/esm/node/utils/intent.js.map +1 -0
  31. package/build/esm/node/utils/noMatch.d.ts +6 -0
  32. package/build/esm/node/utils/noReply.d.ts +6 -0
  33. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  import { Nullable } from "../types";
2
2
  import { StepButtonsLayout } from '../button';
3
3
  import { NodeType } from './constants';
4
- import { BaseStep, BaseStepNoMatch, BaseStepNoReply, DataID } from './utils';
4
+ import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, StepIntentScope } from './utils';
5
5
  export declare enum ButtonAction {
6
6
  URL = "URL",
7
7
  PATH = "PATH",
@@ -14,10 +14,12 @@ export interface Button extends DataID {
14
14
  actions: ButtonAction[];
15
15
  diagramID?: Nullable<string>;
16
16
  }
17
- export interface StepData extends StepButtonsLayout {
18
- else: BaseStepNoMatch;
17
+ export interface StepData extends StepButtonsLayout, BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
19
18
  buttons: Button[];
20
- noReply?: Nullable<BaseStepNoReply>;
19
+ /**
20
+ * @deprecated use noMatch instead
21
+ */
22
+ else?: BaseStepNoMatch;
21
23
  }
22
24
  export interface Step<Data = StepData> extends BaseStep<Data> {
23
25
  type: NodeType.BUTTONS;
@@ -1,10 +1,9 @@
1
1
  import { Nullable } from "../types";
2
2
  import { NodeType } from './constants';
3
- import { BaseNode, BaseNodeNoReply, BaseStep, BaseStepNoReply, NodeNextID } from './utils';
3
+ import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeNextID } from './utils';
4
4
  /** @deprecated */
5
- export interface StepData {
5
+ export interface StepData extends BaseNoReplyStepData {
6
6
  slot: Nullable<string>;
7
- noReply?: Nullable<BaseStepNoReply>;
8
7
  variable: Nullable<string>;
9
8
  slotInputs: string[];
10
9
  }
@@ -13,10 +12,9 @@ export interface Step<Data = StepData> extends BaseStep<Data> {
13
12
  type: NodeType.CAPTURE;
14
13
  }
15
14
  /** @deprecated */
16
- export interface Node extends BaseNode, NodeNextID {
15
+ export interface Node extends BaseNode, NodeNextID, BaseNoReplyNodeData {
17
16
  type: NodeType.CAPTURE;
18
17
  intent?: string;
19
18
  slots?: string[];
20
- noReply?: Nullable<BaseNodeNoReply>;
21
19
  variable: string;
22
20
  }
@@ -1,14 +1,12 @@
1
1
  import { Intent } from "../models";
2
2
  import { Nullable } from "../types";
3
3
  import { NodeType } from './constants';
4
- import { BaseNode, BaseNodeNoMatch, BaseNodeNoReply, BaseStep, BaseStepNoMatch, BaseStepNoReply, NodeNextID } from './utils';
4
+ import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
5
5
  export declare enum CaptureType {
6
6
  INTENT = "intent",
7
7
  QUERY = "query"
8
8
  }
9
- export interface BaseCaptureData {
10
- noReply?: Nullable<BaseStepNoReply>;
11
- noMatch?: Nullable<BaseStepNoMatch>;
9
+ export interface BaseCaptureData extends BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
12
10
  }
13
11
  export interface IntentCapture {
14
12
  type: CaptureType.INTENT;
@@ -24,13 +22,12 @@ export interface StepData extends BaseCaptureData {
24
22
  export interface Step<Data = StepData> extends BaseStep<Data> {
25
23
  type: NodeType.CAPTURE_V2;
26
24
  }
27
- export interface Node extends BaseNode, NodeNextID {
25
+ export interface NodeIntent {
26
+ name: string;
27
+ entities?: string[];
28
+ }
29
+ export interface Node extends BaseNode, NodeNextID, NodeIntentScope, BaseNoReplyNodeData, BaseNoMatchNodeData {
28
30
  type: NodeType.CAPTURE_V2;
29
- intent?: {
30
- name: string;
31
- entities?: string[];
32
- };
31
+ intent?: NodeIntent;
33
32
  variable?: string;
34
- noReply?: Nullable<BaseNodeNoReply>;
35
- noMatch?: Nullable<BaseNodeNoMatch>;
36
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"captureV2.js","sourceRoot":"","sources":["../../../src/node/captureV2.ts"],"names":[],"mappings":";;;AAMA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
1
+ {"version":3,"file":"captureV2.js","sourceRoot":"","sources":["../../../src/node/captureV2.ts"],"names":[],"mappings":";;;AAgBA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
@@ -1,9 +1,7 @@
1
1
  import { IntentRequest } from "../request";
2
- import { Nullable } from "../types";
3
2
  import { NodeType } from './constants';
4
- import { BaseNode, BaseNodeNoMatch } from './utils';
5
- export interface Node extends BaseNode {
3
+ import { BaseNode, BaseNoMatchNodeData } from './utils';
4
+ export interface Node extends BaseNode, BaseNoMatchNodeData {
6
5
  type: NodeType.GOTO;
7
6
  request: IntentRequest;
8
- noMatch?: Nullable<BaseNodeNoMatch>;
9
7
  }
@@ -1,7 +1,7 @@
1
1
  import { AnyRequestButton } from "../request";
2
2
  import { Nullable } from "../types";
3
3
  import { NodeType } from './constants';
4
- import { BaseEvent, BaseNode, BaseNodeNoMatch, BaseNodeNoReply, BaseStep, BaseStepNoMatch, BaseStepNoReply, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeNextID, SlotMappings, TraceType } from './utils';
4
+ import { BaseEvent, BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, SlotMappings, StepIntentScope, TraceType } from './utils';
5
5
  export declare enum ChoiceAction {
6
6
  PATH = "PATH",
7
7
  GO_TO = "GO_TO"
@@ -15,11 +15,13 @@ export interface Choice extends SlotMappings {
15
15
  intent: string;
16
16
  action?: ChoiceAction;
17
17
  }
18
- export interface StepData {
18
+ export interface StepData extends BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
19
19
  name: string;
20
- else: BaseStepNoMatch;
21
20
  choices: Choice[];
22
- noReply?: Nullable<BaseStepNoReply>;
21
+ /**
22
+ * @deprecated use noMatch instead
23
+ */
24
+ else?: BaseStepNoMatch;
23
25
  }
24
26
  export interface Step<Data = StepData> extends BaseStep<Data> {
25
27
  type: NodeType.INTERACTION;
@@ -27,10 +29,8 @@ export interface Step<Data = StepData> extends BaseStep<Data> {
27
29
  export interface NodeInteraction<Event = BaseEvent> extends NodeNextID {
28
30
  event: Event;
29
31
  }
30
- export interface Node<Event = BaseEvent> extends BaseNode, DeprecatedBaseNodeNoMatch {
32
+ export interface Node<Event = BaseEvent> extends BaseNode, DeprecatedBaseNodeNoMatch, BaseNoReplyNodeData, NodeIntentScope, BaseNoMatchNodeData {
31
33
  type: NodeType.INTERACTION;
32
- noMatch?: Nullable<BaseNodeNoMatch>;
33
- noReply?: Nullable<BaseNodeNoReply>;
34
34
  interactions: NodeInteraction<Event>[];
35
35
  }
36
36
  export interface TraceFramePayload {
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/node/interaction.ts"],"names":[],"mappings":";;;AAmBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
1
+ {"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/node/interaction.ts"],"names":[],"mappings":";;;AAsBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
@@ -1,9 +1,10 @@
1
- import { Nullable } from "../types";
2
1
  import { NodeType } from './constants';
3
- import { BaseStep, BaseStepNoMatch, BaseStepNoReply } from './utils';
4
- export interface StepData {
5
- noReply?: Nullable<BaseStepNoReply>;
6
- noMatches: BaseStepNoMatch;
2
+ import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch } from './utils';
3
+ export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
4
+ /**
5
+ * @deprecated use noMatch instead
6
+ */
7
+ noMatches?: BaseStepNoMatch;
7
8
  }
8
9
  export interface Step<Data = StepData> extends BaseStep<Data, []> {
9
10
  type: NodeType.PROMPT;
@@ -4,6 +4,7 @@ export * from './command';
4
4
  export * from './event';
5
5
  export * from './expression';
6
6
  export * from './integration';
7
+ export * from './intent';
7
8
  export * from './mappings';
8
9
  export * from './noMatch';
9
10
  export * from './noReply';
@@ -16,6 +16,7 @@ __exportStar(require("./command"), exports);
16
16
  __exportStar(require("./event"), exports);
17
17
  __exportStar(require("./expression"), exports);
18
18
  __exportStar(require("./integration"), exports);
19
+ __exportStar(require("./intent"), exports);
19
20
  __exportStar(require("./mappings"), exports);
20
21
  __exportStar(require("./noMatch"), exports);
21
22
  __exportStar(require("./noReply"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,yDAAuC;AACvC,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,yDAAuC;AACvC,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB"}
@@ -0,0 +1,10 @@
1
+ export declare enum IntentScope {
2
+ NODE = "NODE",
3
+ GLOBAL = "GLOBAL"
4
+ }
5
+ export interface StepIntentScope {
6
+ intentScope?: IntentScope;
7
+ }
8
+ export interface NodeIntentScope {
9
+ intentScope?: IntentScope;
10
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntentScope = void 0;
4
+ var IntentScope;
5
+ (function (IntentScope) {
6
+ IntentScope["NODE"] = "NODE";
7
+ IntentScope["GLOBAL"] = "GLOBAL";
8
+ })(IntentScope = exports.IntentScope || (exports.IntentScope = {}));
9
+ //# sourceMappingURL=intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../../src/node/utils/intent.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
@@ -18,10 +18,16 @@ export interface BaseStepNoMatch {
18
18
  export interface StepNoMatch<Prompt> extends BaseStepNoMatch {
19
19
  reprompts: Prompt[];
20
20
  }
21
+ export interface BaseNoMatchStepData {
22
+ noMatch?: Nullable<BaseStepNoMatch>;
23
+ }
21
24
  export interface BaseNodeNoMatch {
22
25
  nodeID?: NodeID;
23
26
  randomize?: boolean;
24
27
  }
28
+ export interface BaseNoMatchNodeData {
29
+ noMatch?: Nullable<BaseNodeNoMatch>;
30
+ }
25
31
  export interface NodeNoMatch<NoMatch> extends BaseNodeNoMatch {
26
32
  prompts?: NoMatch[];
27
33
  }
@@ -10,6 +10,9 @@ export interface BaseStepNoReply {
10
10
  pathName?: string;
11
11
  randomize: boolean;
12
12
  }
13
+ export interface BaseNoReplyStepData {
14
+ noReply?: Nullable<BaseStepNoReply>;
15
+ }
13
16
  export interface StepNoReply<Prompt> extends BaseStepNoReply {
14
17
  reprompts?: Prompt[];
15
18
  }
@@ -18,6 +21,9 @@ export interface BaseNodeNoReply {
18
21
  timeout?: number;
19
22
  randomize?: boolean;
20
23
  }
24
+ export interface BaseNoReplyNodeData {
25
+ noReply?: Nullable<BaseNodeNoReply>;
26
+ }
21
27
  export interface NodeNoReply<NoReply> extends BaseNodeNoReply {
22
28
  prompts?: NoReply[];
23
29
  }
@@ -1,7 +1,7 @@
1
1
  import { Nullable } from "../types";
2
2
  import { StepButtonsLayout } from '../button';
3
3
  import { NodeType } from './constants';
4
- import { BaseStep, BaseStepNoMatch, BaseStepNoReply, DataID } from './utils';
4
+ import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, StepIntentScope } from './utils';
5
5
  export declare enum ButtonAction {
6
6
  URL = "URL",
7
7
  PATH = "PATH",
@@ -14,10 +14,12 @@ export interface Button extends DataID {
14
14
  actions: ButtonAction[];
15
15
  diagramID?: Nullable<string>;
16
16
  }
17
- export interface StepData extends StepButtonsLayout {
18
- else: BaseStepNoMatch;
17
+ export interface StepData extends StepButtonsLayout, BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
19
18
  buttons: Button[];
20
- noReply?: Nullable<BaseStepNoReply>;
19
+ /**
20
+ * @deprecated use noMatch instead
21
+ */
22
+ else?: BaseStepNoMatch;
21
23
  }
22
24
  export interface Step<Data = StepData> extends BaseStep<Data> {
23
25
  type: NodeType.BUTTONS;
@@ -1,10 +1,9 @@
1
1
  import { Nullable } from "../types";
2
2
  import { NodeType } from './constants';
3
- import { BaseNode, BaseNodeNoReply, BaseStep, BaseStepNoReply, NodeNextID } from './utils';
3
+ import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeNextID } from './utils';
4
4
  /** @deprecated */
5
- export interface StepData {
5
+ export interface StepData extends BaseNoReplyStepData {
6
6
  slot: Nullable<string>;
7
- noReply?: Nullable<BaseStepNoReply>;
8
7
  variable: Nullable<string>;
9
8
  slotInputs: string[];
10
9
  }
@@ -13,10 +12,9 @@ export interface Step<Data = StepData> extends BaseStep<Data> {
13
12
  type: NodeType.CAPTURE;
14
13
  }
15
14
  /** @deprecated */
16
- export interface Node extends BaseNode, NodeNextID {
15
+ export interface Node extends BaseNode, NodeNextID, BaseNoReplyNodeData {
17
16
  type: NodeType.CAPTURE;
18
17
  intent?: string;
19
18
  slots?: string[];
20
- noReply?: Nullable<BaseNodeNoReply>;
21
19
  variable: string;
22
20
  }
@@ -1,14 +1,12 @@
1
1
  import { Intent } from "../models";
2
2
  import { Nullable } from "../types";
3
3
  import { NodeType } from './constants';
4
- import { BaseNode, BaseNodeNoMatch, BaseNodeNoReply, BaseStep, BaseStepNoMatch, BaseStepNoReply, NodeNextID } from './utils';
4
+ import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
5
5
  export declare enum CaptureType {
6
6
  INTENT = "intent",
7
7
  QUERY = "query"
8
8
  }
9
- export interface BaseCaptureData {
10
- noReply?: Nullable<BaseStepNoReply>;
11
- noMatch?: Nullable<BaseStepNoMatch>;
9
+ export interface BaseCaptureData extends BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
12
10
  }
13
11
  export interface IntentCapture {
14
12
  type: CaptureType.INTENT;
@@ -24,13 +22,12 @@ export interface StepData extends BaseCaptureData {
24
22
  export interface Step<Data = StepData> extends BaseStep<Data> {
25
23
  type: NodeType.CAPTURE_V2;
26
24
  }
27
- export interface Node extends BaseNode, NodeNextID {
25
+ export interface NodeIntent {
26
+ name: string;
27
+ entities?: string[];
28
+ }
29
+ export interface Node extends BaseNode, NodeNextID, NodeIntentScope, BaseNoReplyNodeData, BaseNoMatchNodeData {
28
30
  type: NodeType.CAPTURE_V2;
29
- intent?: {
30
- name: string;
31
- entities?: string[];
32
- };
31
+ intent?: NodeIntent;
33
32
  variable?: string;
34
- noReply?: Nullable<BaseNodeNoReply>;
35
- noMatch?: Nullable<BaseNodeNoMatch>;
36
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"captureV2.js","sourceRoot":"","sources":["../../../src/node/captureV2.ts"],"names":[],"mappings":"AAMA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
1
+ {"version":3,"file":"captureV2.js","sourceRoot":"","sources":["../../../src/node/captureV2.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
@@ -1,9 +1,7 @@
1
1
  import { IntentRequest } from "../request";
2
- import { Nullable } from "../types";
3
2
  import { NodeType } from './constants';
4
- import { BaseNode, BaseNodeNoMatch } from './utils';
5
- export interface Node extends BaseNode {
3
+ import { BaseNode, BaseNoMatchNodeData } from './utils';
4
+ export interface Node extends BaseNode, BaseNoMatchNodeData {
6
5
  type: NodeType.GOTO;
7
6
  request: IntentRequest;
8
- noMatch?: Nullable<BaseNodeNoMatch>;
9
7
  }
@@ -1,7 +1,7 @@
1
1
  import { AnyRequestButton } from "../request";
2
2
  import { Nullable } from "../types";
3
3
  import { NodeType } from './constants';
4
- import { BaseEvent, BaseNode, BaseNodeNoMatch, BaseNodeNoReply, BaseStep, BaseStepNoMatch, BaseStepNoReply, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeNextID, SlotMappings, TraceType } from './utils';
4
+ import { BaseEvent, BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, SlotMappings, StepIntentScope, TraceType } from './utils';
5
5
  export declare enum ChoiceAction {
6
6
  PATH = "PATH",
7
7
  GO_TO = "GO_TO"
@@ -15,11 +15,13 @@ export interface Choice extends SlotMappings {
15
15
  intent: string;
16
16
  action?: ChoiceAction;
17
17
  }
18
- export interface StepData {
18
+ export interface StepData extends BaseNoReplyStepData, StepIntentScope, BaseNoMatchStepData {
19
19
  name: string;
20
- else: BaseStepNoMatch;
21
20
  choices: Choice[];
22
- noReply?: Nullable<BaseStepNoReply>;
21
+ /**
22
+ * @deprecated use noMatch instead
23
+ */
24
+ else?: BaseStepNoMatch;
23
25
  }
24
26
  export interface Step<Data = StepData> extends BaseStep<Data> {
25
27
  type: NodeType.INTERACTION;
@@ -27,10 +29,8 @@ export interface Step<Data = StepData> extends BaseStep<Data> {
27
29
  export interface NodeInteraction<Event = BaseEvent> extends NodeNextID {
28
30
  event: Event;
29
31
  }
30
- export interface Node<Event = BaseEvent> extends BaseNode, DeprecatedBaseNodeNoMatch {
32
+ export interface Node<Event = BaseEvent> extends BaseNode, DeprecatedBaseNodeNoMatch, BaseNoReplyNodeData, NodeIntentScope, BaseNoMatchNodeData {
31
33
  type: NodeType.INTERACTION;
32
- noMatch?: Nullable<BaseNodeNoMatch>;
33
- noReply?: Nullable<BaseNodeNoReply>;
34
34
  interactions: NodeInteraction<Event>[];
35
35
  }
36
36
  export interface TraceFramePayload {
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/node/interaction.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
1
+ {"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../../src/node/interaction.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
@@ -1,9 +1,10 @@
1
- import { Nullable } from "../types";
2
1
  import { NodeType } from './constants';
3
- import { BaseStep, BaseStepNoMatch, BaseStepNoReply } from './utils';
4
- export interface StepData {
5
- noReply?: Nullable<BaseStepNoReply>;
6
- noMatches: BaseStepNoMatch;
2
+ import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch } from './utils';
3
+ export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
4
+ /**
5
+ * @deprecated use noMatch instead
6
+ */
7
+ noMatches?: BaseStepNoMatch;
7
8
  }
8
9
  export interface Step<Data = StepData> extends BaseStep<Data, []> {
9
10
  type: NodeType.PROMPT;
@@ -4,6 +4,7 @@ export * from './command';
4
4
  export * from './event';
5
5
  export * from './expression';
6
6
  export * from './integration';
7
+ export * from './intent';
7
8
  export * from './mappings';
8
9
  export * from './noMatch';
9
10
  export * from './noReply';
@@ -4,6 +4,7 @@ export * from './command';
4
4
  export * from './event';
5
5
  export * from './expression';
6
6
  export * from './integration';
7
+ export * from './intent';
7
8
  export * from './mappings';
8
9
  export * from './noMatch';
9
10
  export * from './noReply';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare enum IntentScope {
2
+ NODE = "NODE",
3
+ GLOBAL = "GLOBAL"
4
+ }
5
+ export interface StepIntentScope {
6
+ intentScope?: IntentScope;
7
+ }
8
+ export interface NodeIntentScope {
9
+ intentScope?: IntentScope;
10
+ }
@@ -0,0 +1,6 @@
1
+ export var IntentScope;
2
+ (function (IntentScope) {
3
+ IntentScope["NODE"] = "NODE";
4
+ IntentScope["GLOBAL"] = "GLOBAL";
5
+ })(IntentScope || (IntentScope = {}));
6
+ //# sourceMappingURL=intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../../src/node/utils/intent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
@@ -18,10 +18,16 @@ export interface BaseStepNoMatch {
18
18
  export interface StepNoMatch<Prompt> extends BaseStepNoMatch {
19
19
  reprompts: Prompt[];
20
20
  }
21
+ export interface BaseNoMatchStepData {
22
+ noMatch?: Nullable<BaseStepNoMatch>;
23
+ }
21
24
  export interface BaseNodeNoMatch {
22
25
  nodeID?: NodeID;
23
26
  randomize?: boolean;
24
27
  }
28
+ export interface BaseNoMatchNodeData {
29
+ noMatch?: Nullable<BaseNodeNoMatch>;
30
+ }
25
31
  export interface NodeNoMatch<NoMatch> extends BaseNodeNoMatch {
26
32
  prompts?: NoMatch[];
27
33
  }
@@ -10,6 +10,9 @@ export interface BaseStepNoReply {
10
10
  pathName?: string;
11
11
  randomize: boolean;
12
12
  }
13
+ export interface BaseNoReplyStepData {
14
+ noReply?: Nullable<BaseStepNoReply>;
15
+ }
13
16
  export interface StepNoReply<Prompt> extends BaseStepNoReply {
14
17
  reprompts?: Prompt[];
15
18
  }
@@ -18,6 +21,9 @@ export interface BaseNodeNoReply {
18
21
  timeout?: number;
19
22
  randomize?: boolean;
20
23
  }
24
+ export interface BaseNoReplyNodeData {
25
+ noReply?: Nullable<BaseNodeNoReply>;
26
+ }
21
27
  export interface NodeNoReply<NoReply> extends BaseNodeNoReply {
22
28
  prompts?: NoReply[];
23
29
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@voiceflow/base-types",
3
3
  "description": "Voiceflow base project types",
4
- "version": "2.15.0",
4
+ "version": "2.16.2",
5
5
  "author": "Voiceflow",
6
6
  "bugs": {
7
7
  "url": "https://github.com/voiceflow/libs/issues"
@@ -40,7 +40,8 @@
40
40
  "test": "exit 0",
41
41
  "test:dependencies": "depcheck",
42
42
  "test:integration": "exit 0",
43
+ "test:smoke": "exit 0",
43
44
  "test:unit": "exit 0"
44
45
  },
45
- "gitHead": "5b2dd39405f7f326657a4e690d8a2591df5fafb4"
46
+ "gitHead": "3bc21d66a11aff0530fc4198c9f7ae6130bbe464"
46
47
  }