@voiceflow/base-types 2.24.2 → 2.25.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.
@@ -18,21 +18,36 @@ export interface BaseDiagramNode<D extends AnyRecord = AnyRecord> {
18
18
  nodeID: string;
19
19
  coords?: Point;
20
20
  }
21
- export interface BlockOnlyData {
21
+ export interface BaseNodeData {
22
+ name?: string;
23
+ }
24
+ export interface BlockOnlyData extends BaseNodeData {
22
25
  name: string;
23
26
  color: string;
24
27
  steps: string[];
25
28
  }
29
+ export declare enum BaseNodeType {
30
+ BLOCK = "block",
31
+ ACTIONS = "actions"
32
+ }
26
33
  export interface BaseBlock<D extends AnyRecord = AnyRecord> extends BaseDiagramNode<D & BlockOnlyData> {
34
+ type: BaseNodeType.BLOCK;
27
35
  coords: Point;
28
36
  }
29
- export declare type StepOnlyData<Ports, PortsOld> = {
37
+ export interface ActionsData extends BaseNodeData {
38
+ steps: string[];
39
+ }
40
+ export interface BaseActions extends BaseDiagramNode<ActionsData> {
41
+ type: BaseNodeType.ACTIONS;
42
+ }
43
+ export declare type StepPortsData<Ports, PortsOld> = {
30
44
  ports?: never;
31
45
  portsV2: Ports;
32
46
  } | {
33
47
  ports: PortsOld;
34
48
  portsV2?: never;
35
49
  };
50
+ export declare type StepOnlyData<Ports, PortsOld> = StepPortsData<Ports, PortsOld> & BaseNodeData;
36
51
  export interface BaseStep<Data extends AnyRecord = AnyRecord, Ports = NextStepPorts, PortsOld = BasePortList> extends BaseDiagramNode<Data & StepOnlyData<Ports, PortsOld>> {
37
52
  }
38
53
  export interface AnyBaseStep extends BaseStep<AnyRecord, AnyBaseStepPorts> {
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseNodeType = void 0;
4
+ var BaseNodeType;
5
+ (function (BaseNodeType) {
6
+ BaseNodeType["BLOCK"] = "block";
7
+ BaseNodeType["ACTIONS"] = "actions";
8
+ })(BaseNodeType = exports.BaseNodeType || (exports.BaseNodeType = {}));
@@ -14,6 +14,7 @@ export declare enum NodeType {
14
14
  CAPTURE = "capture",
15
15
  CAPTURE_V2 = "captureV2",
16
16
  GOTO = "goTo",
17
+ GOTO_BLOCK = "goToBlock",
17
18
  API = "api",
18
19
  ZAPIER = "zapier",
19
20
  INTEGRATIONS = "integrations",
@@ -20,6 +20,7 @@ var NodeType;
20
20
  NodeType["CAPTURE_V2"] = "captureV2";
21
21
  // navigation
22
22
  NodeType["GOTO"] = "goTo";
23
+ NodeType["GOTO_BLOCK"] = "goToBlock";
23
24
  // integrations
24
25
  NodeType["API"] = "api";
25
26
  NodeType["ZAPIER"] = "zapier";
@@ -1,6 +1,14 @@
1
1
  import { IntentRequest } from "../request";
2
+ import { Nullable } from "../types";
2
3
  import { NodeType } from './constants';
3
- import { BaseNode, BaseNoMatchNodeData } from './utils';
4
+ import { BaseNode, BaseNoMatchNodeData, BaseStep } from './utils';
5
+ export interface StepData {
6
+ intent: Nullable<string>;
7
+ diagramID: Nullable<string>;
8
+ }
9
+ export interface Step<Data = StepData> extends BaseStep<Data> {
10
+ type: NodeType.GOTO;
11
+ }
4
12
  export interface Node extends BaseNode, BaseNoMatchNodeData {
5
13
  type: NodeType.GOTO;
6
14
  request: IntentRequest;
@@ -0,0 +1,14 @@
1
+ import { Nullable } from "../types";
2
+ import { NodeType } from './constants';
3
+ import { BaseNode, BaseStep, NodeNextID } from './utils';
4
+ export interface StepData {
5
+ blockID: Nullable<string>;
6
+ diagramID: Nullable<string>;
7
+ }
8
+ export interface Step<Data = StepData> extends BaseStep<Data> {
9
+ type: NodeType.GOTO_BLOCK;
10
+ }
11
+ export interface Node extends BaseNode, NodeNextID {
12
+ type: NodeType.GOTO_BLOCK;
13
+ diagramID: Nullable<string>;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -18,21 +18,36 @@ export interface BaseDiagramNode<D extends AnyRecord = AnyRecord> {
18
18
  nodeID: string;
19
19
  coords?: Point;
20
20
  }
21
- export interface BlockOnlyData {
21
+ export interface BaseNodeData {
22
+ name?: string;
23
+ }
24
+ export interface BlockOnlyData extends BaseNodeData {
22
25
  name: string;
23
26
  color: string;
24
27
  steps: string[];
25
28
  }
29
+ export declare enum BaseNodeType {
30
+ BLOCK = "block",
31
+ ACTIONS = "actions"
32
+ }
26
33
  export interface BaseBlock<D extends AnyRecord = AnyRecord> extends BaseDiagramNode<D & BlockOnlyData> {
34
+ type: BaseNodeType.BLOCK;
27
35
  coords: Point;
28
36
  }
29
- export declare type StepOnlyData<Ports, PortsOld> = {
37
+ export interface ActionsData extends BaseNodeData {
38
+ steps: string[];
39
+ }
40
+ export interface BaseActions extends BaseDiagramNode<ActionsData> {
41
+ type: BaseNodeType.ACTIONS;
42
+ }
43
+ export declare type StepPortsData<Ports, PortsOld> = {
30
44
  ports?: never;
31
45
  portsV2: Ports;
32
46
  } | {
33
47
  ports: PortsOld;
34
48
  portsV2?: never;
35
49
  };
50
+ export declare type StepOnlyData<Ports, PortsOld> = StepPortsData<Ports, PortsOld> & BaseNodeData;
36
51
  export interface BaseStep<Data extends AnyRecord = AnyRecord, Ports = NextStepPorts, PortsOld = BasePortList> extends BaseDiagramNode<Data & StepOnlyData<Ports, PortsOld>> {
37
52
  }
38
53
  export interface AnyBaseStep extends BaseStep<AnyRecord, AnyBaseStepPorts> {
@@ -1 +1,5 @@
1
- export {};
1
+ export var BaseNodeType;
2
+ (function (BaseNodeType) {
3
+ BaseNodeType["BLOCK"] = "block";
4
+ BaseNodeType["ACTIONS"] = "actions";
5
+ })(BaseNodeType || (BaseNodeType = {}));
@@ -14,6 +14,7 @@ export declare enum NodeType {
14
14
  CAPTURE = "capture",
15
15
  CAPTURE_V2 = "captureV2",
16
16
  GOTO = "goTo",
17
+ GOTO_BLOCK = "goToBlock",
17
18
  API = "api",
18
19
  ZAPIER = "zapier",
19
20
  INTEGRATIONS = "integrations",
@@ -17,6 +17,7 @@ export var NodeType;
17
17
  NodeType["CAPTURE_V2"] = "captureV2";
18
18
  // navigation
19
19
  NodeType["GOTO"] = "goTo";
20
+ NodeType["GOTO_BLOCK"] = "goToBlock";
20
21
  // integrations
21
22
  NodeType["API"] = "api";
22
23
  NodeType["ZAPIER"] = "zapier";
@@ -1,6 +1,14 @@
1
1
  import { IntentRequest } from "../request";
2
+ import { Nullable } from "../types";
2
3
  import { NodeType } from './constants';
3
- import { BaseNode, BaseNoMatchNodeData } from './utils';
4
+ import { BaseNode, BaseNoMatchNodeData, BaseStep } from './utils';
5
+ export interface StepData {
6
+ intent: Nullable<string>;
7
+ diagramID: Nullable<string>;
8
+ }
9
+ export interface Step<Data = StepData> extends BaseStep<Data> {
10
+ type: NodeType.GOTO;
11
+ }
4
12
  export interface Node extends BaseNode, BaseNoMatchNodeData {
5
13
  type: NodeType.GOTO;
6
14
  request: IntentRequest;
@@ -0,0 +1,14 @@
1
+ import { Nullable } from "../types";
2
+ import { NodeType } from './constants';
3
+ import { BaseNode, BaseStep, NodeNextID } from './utils';
4
+ export interface StepData {
5
+ blockID: Nullable<string>;
6
+ diagramID: Nullable<string>;
7
+ }
8
+ export interface Step<Data = StepData> extends BaseStep<Data> {
9
+ type: NodeType.GOTO_BLOCK;
10
+ }
11
+ export interface Node extends BaseNode, NodeNextID {
12
+ type: NodeType.GOTO_BLOCK;
13
+ diagramID: Nullable<string>;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
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.24.2",
4
+ "version": "2.25.2",
5
5
  "author": "Voiceflow",
6
6
  "bugs": {
7
7
  "url": "https://github.com/voiceflow/libs/issues"
@@ -43,5 +43,5 @@
43
43
  "test:smoke": "exit 0",
44
44
  "test:unit": "exit 0"
45
45
  },
46
- "gitHead": "ee2e1c75470fa43035981fa8297b08da5eaf1870"
46
+ "gitHead": "e60f8588e20c179f50b5048b25c76f74ab78fb9f"
47
47
  }