@voiceflow/base-types 2.14.0 → 2.16.1

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 (53) hide show
  1. package/build/common/index.d.ts +1 -0
  2. package/build/common/index.js +2 -1
  3. package/build/common/index.js.map +1 -1
  4. package/build/common/models/index.d.ts +1 -0
  5. package/build/common/models/index.js +2 -1
  6. package/build/common/models/index.js.map +1 -1
  7. package/build/common/models/variableState.d.ts +12 -0
  8. package/build/common/models/variableState.js +3 -0
  9. package/build/common/models/variableState.js.map +1 -0
  10. package/build/common/models/version/prototype.d.ts +1 -0
  11. package/build/common/node/buttons.d.ts +6 -4
  12. package/build/common/node/capture.d.ts +3 -5
  13. package/build/common/node/captureV2.d.ts +8 -11
  14. package/build/common/node/captureV2.js.map +1 -1
  15. package/build/common/node/goTo.d.ts +2 -4
  16. package/build/common/node/interaction.d.ts +7 -7
  17. package/build/common/node/interaction.js.map +1 -1
  18. package/build/common/node/prompt.d.ts +6 -5
  19. package/build/common/node/utils/index.d.ts +1 -0
  20. package/build/common/node/utils/index.js +1 -0
  21. package/build/common/node/utils/index.js.map +1 -1
  22. package/build/common/node/utils/intent.d.ts +10 -0
  23. package/build/common/node/utils/intent.js +9 -0
  24. package/build/common/node/utils/intent.js.map +1 -0
  25. package/build/common/node/utils/noMatch.d.ts +6 -0
  26. package/build/common/node/utils/noReply.d.ts +6 -0
  27. package/build/esm/index.d.ts +1 -0
  28. package/build/esm/index.js +1 -0
  29. package/build/esm/index.js.map +1 -1
  30. package/build/esm/models/index.d.ts +1 -0
  31. package/build/esm/models/index.js +1 -0
  32. package/build/esm/models/index.js.map +1 -1
  33. package/build/esm/models/variableState.d.ts +12 -0
  34. package/build/esm/models/variableState.js +2 -0
  35. package/build/esm/models/variableState.js.map +1 -0
  36. package/build/esm/models/version/prototype.d.ts +1 -0
  37. package/build/esm/node/buttons.d.ts +6 -4
  38. package/build/esm/node/capture.d.ts +3 -5
  39. package/build/esm/node/captureV2.d.ts +8 -11
  40. package/build/esm/node/captureV2.js.map +1 -1
  41. package/build/esm/node/goTo.d.ts +2 -4
  42. package/build/esm/node/interaction.d.ts +7 -7
  43. package/build/esm/node/interaction.js.map +1 -1
  44. package/build/esm/node/prompt.d.ts +6 -5
  45. package/build/esm/node/utils/index.d.ts +1 -0
  46. package/build/esm/node/utils/index.js +1 -0
  47. package/build/esm/node/utils/index.js.map +1 -1
  48. package/build/esm/node/utils/intent.d.ts +10 -0
  49. package/build/esm/node/utils/intent.js +6 -0
  50. package/build/esm/node/utils/intent.js.map +1 -0
  51. package/build/esm/node/utils/noMatch.d.ts +6 -0
  52. package/build/esm/node/utils/noReply.d.ts +6 -0
  53. package/package.json +3 -2
@@ -17,3 +17,4 @@ export * as Utils from './utils';
17
17
  export * as BaseUtils from './utils';
18
18
  export * as Version from './version';
19
19
  export * as BaseVersion from './version';
20
+ export * as VariableState from './version';
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.BaseVersion = exports.Version = exports.BaseUtils = exports.Utils = exports.BaseTrace = exports.Trace = exports.BaseText = exports.Text = exports.BaseRequest = exports.Request = exports.BaseProject = exports.Project = exports.BaseNode = exports.Node = exports.BaseModels = exports.Models = exports.BaseButton = exports.Button = void 0;
25
+ exports.VariableState = exports.BaseVersion = exports.Version = exports.BaseUtils = exports.Utils = exports.BaseTrace = exports.Trace = exports.BaseText = exports.Text = exports.BaseRequest = exports.Request = exports.BaseProject = exports.Project = exports.BaseNode = exports.Node = exports.BaseModels = exports.Models = exports.BaseButton = exports.Button = void 0;
26
26
  exports.Button = __importStar(require("./button"));
27
27
  exports.BaseButton = __importStar(require("./button"));
28
28
  exports.Models = __importStar(require("./models"));
@@ -42,4 +42,5 @@ exports.Utils = __importStar(require("./utils"));
42
42
  exports.BaseUtils = __importStar(require("./utils"));
43
43
  exports.Version = __importStar(require("./version"));
44
44
  exports.BaseVersion = __importStar(require("./version"));
45
+ exports.VariableState = __importStar(require("./version"));
45
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,uDAAuC;AACvC,mDAAmC;AACnC,uDAAuC;AACvC,+CAA+B;AAC/B,mDAAmC;AACnC,qDAAqC;AACrC,yDAAyC;AACzC,qDAAqC;AACrC,yDAAyC;AACzC,+CAA+B;AAC/B,mDAAmC;AACnC,iDAAiC;AACjC,qDAAqC;AACrC,0CAAwB;AACxB,iDAAiC;AACjC,qDAAqC;AACrC,qDAAqC;AACrC,yDAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,uDAAuC;AACvC,mDAAmC;AACnC,uDAAuC;AACvC,+CAA+B;AAC/B,mDAAmC;AACnC,qDAAqC;AACrC,yDAAyC;AACzC,qDAAqC;AACrC,yDAAyC;AACzC,+CAA+B;AAC/B,mDAAmC;AACnC,iDAAiC;AACjC,qDAAqC;AACrC,0CAAwB;AACxB,iDAAiC;AACjC,qDAAqC;AACrC,qDAAqC;AACrC,yDAAyC;AACzC,2DAA2C"}
@@ -4,4 +4,5 @@ export * as Diagram from './diagram';
4
4
  export * as Program from './program';
5
5
  export * as Project from './project';
6
6
  export * as Transcript from './transcripts';
7
+ export * as VariableState from './variableState';
7
8
  export * as Version from './version';
@@ -22,12 +22,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.Version = exports.Transcript = exports.Project = exports.Program = exports.Diagram = exports.ApiKey = void 0;
25
+ exports.Version = exports.VariableState = exports.Transcript = exports.Project = exports.Program = exports.Diagram = exports.ApiKey = void 0;
26
26
  exports.ApiKey = __importStar(require("./apiKey"));
27
27
  __exportStar(require("./base"), exports);
28
28
  exports.Diagram = __importStar(require("./diagram"));
29
29
  exports.Program = __importStar(require("./program"));
30
30
  exports.Project = __importStar(require("./project"));
31
31
  exports.Transcript = __importStar(require("./transcripts"));
32
+ exports.VariableState = __importStar(require("./variableState"));
32
33
  exports.Version = __importStar(require("./version"));
33
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,yCAAuB;AACvB,qDAAqC;AACrC,qDAAqC;AACrC,qDAAqC;AACrC,4DAA4C;AAC5C,qDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,yCAAuB;AACvB,qDAAqC;AACrC,qDAAqC;AACrC,qDAAqC;AACrC,4DAA4C;AAC5C,iEAAiD;AACjD,qDAAqC"}
@@ -0,0 +1,12 @@
1
+ export declare type VariableValue = string | boolean | number | null;
2
+ export interface StartFrom {
3
+ diagramID: string;
4
+ stepID: string;
5
+ }
6
+ export interface Model {
7
+ _id: string;
8
+ name: string;
9
+ projectID: string;
10
+ startFrom: StartFrom | null;
11
+ variables: Record<string, VariableValue>;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=variableState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variableState.js","sourceRoot":"","sources":["../../../src/models/variableState.ts"],"names":[],"mappings":""}
@@ -30,6 +30,7 @@ export interface PrototypeSettings {
30
30
  brandImage?: string;
31
31
  hasPassword?: boolean;
32
32
  buttonsOnly?: boolean;
33
+ variableStateID?: string;
33
34
  }
34
35
  export interface Prototype<Command extends BaseCommand = BaseCommand, Locale extends string = string> {
35
36
  data: PrototypeData<Locale>;
@@ -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
  }
@@ -17,3 +17,4 @@ export * as Utils from './utils';
17
17
  export * as BaseUtils from './utils';
18
18
  export * as Version from './version';
19
19
  export * as BaseVersion from './version';
20
+ export * as VariableState from './version';
@@ -17,4 +17,5 @@ export * as Utils from './utils';
17
17
  export * as BaseUtils from './utils';
18
18
  export * as Version from './version';
19
19
  export * as BaseVersion from './version';
20
+ export * as VariableState from './version';
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC"}
@@ -4,4 +4,5 @@ export * as Diagram from './diagram';
4
4
  export * as Program from './program';
5
5
  export * as Project from './project';
6
6
  export * as Transcript from './transcripts';
7
+ export * as VariableState from './variableState';
7
8
  export * as Version from './version';
@@ -4,5 +4,6 @@ export * as Diagram from './diagram';
4
4
  export * as Program from './program';
5
5
  export * as Project from './project';
6
6
  export * as Transcript from './transcripts';
7
+ export * as VariableState from './variableState';
7
8
  export * as Version from './version';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare type VariableValue = string | boolean | number | null;
2
+ export interface StartFrom {
3
+ diagramID: string;
4
+ stepID: string;
5
+ }
6
+ export interface Model {
7
+ _id: string;
8
+ name: string;
9
+ projectID: string;
10
+ startFrom: StartFrom | null;
11
+ variables: Record<string, VariableValue>;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=variableState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variableState.js","sourceRoot":"","sources":["../../../src/models/variableState.ts"],"names":[],"mappings":""}
@@ -30,6 +30,7 @@ export interface PrototypeSettings {
30
30
  brandImage?: string;
31
31
  hasPassword?: boolean;
32
32
  buttonsOnly?: boolean;
33
+ variableStateID?: string;
33
34
  }
34
35
  export interface Prototype<Command extends BaseCommand = BaseCommand, Locale extends string = string> {
35
36
  data: PrototypeData<Locale>;
@@ -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.14.0",
4
+ "version": "2.16.1",
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": "a9721dad5e0a2c632ff174bda10a08e61b831885"
46
+ "gitHead": "aeab5f2fc7b85b4c3e9a987f00ebdf1bf1031da8"
46
47
  }