@voiceflow/base-types 2.19.1 → 2.20.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.
- package/build/common/models/base/index.d.ts +1 -0
- package/build/common/models/base/index.js +1 -0
- package/build/common/models/base/node.d.ts +11 -18
- package/build/common/models/base/node.js +0 -10
- package/build/common/models/base/port.d.ts +50 -0
- package/build/common/models/base/port.js +12 -0
- package/build/common/node/_v1.d.ts +11 -6
- package/build/common/node/api.d.ts +4 -2
- package/build/common/node/buttons.d.ts +4 -2
- package/build/common/node/capture.d.ts +7 -2
- package/build/common/node/captureV2.d.ts +6 -2
- package/build/common/node/code.d.ts +4 -2
- package/build/common/node/exit.d.ts +4 -2
- package/build/common/node/googleSheets.d.ts +4 -2
- package/build/common/node/if.d.ts +4 -2
- package/build/common/node/ifV2.d.ts +4 -2
- package/build/common/node/interaction.d.ts +4 -2
- package/build/common/node/prompt.d.ts +4 -2
- package/build/common/node/random.d.ts +4 -2
- package/build/common/node/stream.d.ts +11 -2
- package/build/common/node/stream.js +1 -0
- package/build/common/node/utils/base.d.ts +1 -1
- package/build/common/node/zapier.d.ts +4 -2
- package/build/common/types.d.ts +1 -0
- package/build/common/utils/step.d.ts +1 -1
- package/build/esm/models/base/index.d.ts +1 -0
- package/build/esm/models/base/index.js +1 -0
- package/build/esm/models/base/node.d.ts +11 -18
- package/build/esm/models/base/node.js +1 -9
- package/build/esm/models/base/port.d.ts +50 -0
- package/build/esm/models/base/port.js +9 -0
- package/build/esm/node/_v1.d.ts +11 -6
- package/build/esm/node/api.d.ts +4 -2
- package/build/esm/node/buttons.d.ts +4 -2
- package/build/esm/node/capture.d.ts +7 -2
- package/build/esm/node/captureV2.d.ts +6 -2
- package/build/esm/node/code.d.ts +4 -2
- package/build/esm/node/exit.d.ts +4 -2
- package/build/esm/node/googleSheets.d.ts +4 -2
- package/build/esm/node/if.d.ts +4 -2
- package/build/esm/node/ifV2.d.ts +4 -2
- package/build/esm/node/interaction.d.ts +4 -2
- package/build/esm/node/prompt.d.ts +4 -2
- package/build/esm/node/random.d.ts +4 -2
- package/build/esm/node/stream.d.ts +11 -2
- package/build/esm/node/stream.js +1 -0
- package/build/esm/node/utils/base.d.ts +1 -1
- package/build/esm/node/zapier.d.ts +4 -2
- package/build/esm/types.d.ts +1 -0
- package/build/esm/utils/step.d.ts +1 -1
- package/package.json +3 -3
|
@@ -15,5 +15,6 @@ __exportStar(require("./common"), exports);
|
|
|
15
15
|
__exportStar(require("./intent"), exports);
|
|
16
16
|
__exportStar(require("./node"), exports);
|
|
17
17
|
__exportStar(require("./note"), exports);
|
|
18
|
+
__exportStar(require("./port"), exports);
|
|
18
19
|
__exportStar(require("./prototype"), exports);
|
|
19
20
|
__exportStar(require("./slot"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnyRecord
|
|
1
|
+
import { AnyRecord } from "../../types";
|
|
2
|
+
import { AnyBaseStepPorts, BasePortList, NextStepPorts } from './port';
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated use BaseNode instead
|
|
4
5
|
*/
|
|
@@ -25,22 +26,14 @@ export interface BlockOnlyData {
|
|
|
25
26
|
export interface BaseBlock<D extends AnyRecord = AnyRecord> extends BaseDiagramNode<D & BlockOnlyData> {
|
|
26
27
|
coords: Point;
|
|
27
28
|
}
|
|
28
|
-
export declare
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
export declare type StepOnlyData<Ports, PortsOld> = {
|
|
30
|
+
ports?: never;
|
|
31
|
+
portsV2: Ports;
|
|
32
|
+
} | {
|
|
33
|
+
ports: PortsOld;
|
|
34
|
+
portsV2?: never;
|
|
35
|
+
};
|
|
36
|
+
export interface BaseStep<Data extends AnyRecord = AnyRecord, Ports = NextStepPorts, PortsOld = BasePortList> extends BaseDiagramNode<Data & StepOnlyData<Ports, PortsOld>> {
|
|
35
37
|
}
|
|
36
|
-
export interface
|
|
37
|
-
id: string;
|
|
38
|
-
type: string | PortType;
|
|
39
|
-
data?: PD;
|
|
40
|
-
target: Nullable<string>;
|
|
41
|
-
}
|
|
42
|
-
export interface StepOnlyData<P = [BasePort, ...BasePort[]]> {
|
|
43
|
-
ports: P;
|
|
44
|
-
}
|
|
45
|
-
export interface BaseStep<D extends AnyRecord = AnyRecord, P = [BasePort, ...BasePort[]]> extends BaseDiagramNode<D & StepOnlyData<P>> {
|
|
38
|
+
export interface AnyBaseStep extends BaseStep<AnyRecord, AnyBaseStepPorts> {
|
|
46
39
|
}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PortType = void 0;
|
|
4
|
-
var PortType;
|
|
5
|
-
(function (PortType) {
|
|
6
|
-
PortType["FAIL"] = "fail";
|
|
7
|
-
PortType["NEXT"] = "next";
|
|
8
|
-
PortType["PAUSE"] = "pause";
|
|
9
|
-
PortType["NO_REPLY"] = "no-reply";
|
|
10
|
-
PortType["NO_MATCH"] = "else";
|
|
11
|
-
PortType["PREVIOUS"] = "previous";
|
|
12
|
-
})(PortType = exports.PortType || (exports.PortType = {}));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EmptyRecord, Nullable } from "../../types";
|
|
2
|
+
export declare enum PortType {
|
|
3
|
+
FAIL = "fail",
|
|
4
|
+
NEXT = "next",
|
|
5
|
+
PAUSE = "pause",
|
|
6
|
+
NO_REPLY = "no-reply",
|
|
7
|
+
NO_MATCH = "else",
|
|
8
|
+
PREVIOUS = "previous"
|
|
9
|
+
}
|
|
10
|
+
export interface BasePort {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string | PortType;
|
|
13
|
+
target: Nullable<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[]> {
|
|
16
|
+
builtIn: Builtin;
|
|
17
|
+
dynamic: Dynamic;
|
|
18
|
+
}
|
|
19
|
+
export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
|
|
20
|
+
}
|
|
21
|
+
export interface BuiltInNextPort {
|
|
22
|
+
[PortType.NEXT]: BasePort;
|
|
23
|
+
}
|
|
24
|
+
export interface BuiltInFailPort {
|
|
25
|
+
[PortType.FAIL]: BasePort;
|
|
26
|
+
}
|
|
27
|
+
export interface BuiltInNoMatchPort {
|
|
28
|
+
[PortType.NO_MATCH]?: BasePort;
|
|
29
|
+
}
|
|
30
|
+
export interface BuiltInNoReplyPort {
|
|
31
|
+
[PortType.NO_REPLY]?: BasePort;
|
|
32
|
+
}
|
|
33
|
+
export interface BuiltInNextFailPorts extends BuiltInNextPort, BuiltInFailPort {
|
|
34
|
+
}
|
|
35
|
+
export interface BuiltInNoMatchNoReplyPorts extends BuiltInNoMatchPort, BuiltInNoReplyPort {
|
|
36
|
+
}
|
|
37
|
+
export interface EmptyStepPorts extends BaseStepPorts<EmptyRecord, []> {
|
|
38
|
+
}
|
|
39
|
+
export interface NextStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextPort, Dynamic> {
|
|
40
|
+
}
|
|
41
|
+
export interface SuccessFailStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextFailPorts, Dynamic> {
|
|
42
|
+
}
|
|
43
|
+
export interface DynamicOnlyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<EmptyRecord, Dynamic> {
|
|
44
|
+
}
|
|
45
|
+
export interface NoMatchNoReplyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNoMatchNoReplyPorts, Dynamic> {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
export declare type BasePortList<Port extends BasePort = BasePort> = [Port, ...Port[]];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PortType = void 0;
|
|
4
|
+
var PortType;
|
|
5
|
+
(function (PortType) {
|
|
6
|
+
PortType["FAIL"] = "fail";
|
|
7
|
+
PortType["NEXT"] = "next";
|
|
8
|
+
PortType["PAUSE"] = "pause";
|
|
9
|
+
PortType["NO_REPLY"] = "no-reply";
|
|
10
|
+
PortType["NO_MATCH"] = "else";
|
|
11
|
+
PortType["PREVIOUS"] = "previous";
|
|
12
|
+
})(PortType = exports.PortType || (exports.PortType = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
|
-
import { BaseEvent, BaseNode, BasePort, BaseStep, NodeID } from './utils';
|
|
2
|
+
import { BaseEvent, BaseNode, BasePort, BasePortList, BaseStep, BaseStepPorts, NodeID } from './utils';
|
|
3
3
|
export declare const _V1_STOP_TYPES = "stopTypes";
|
|
4
4
|
export interface StepData<Payload = unknown> {
|
|
5
5
|
_v: 1;
|
|
@@ -7,6 +7,16 @@ export interface StepData<Payload = unknown> {
|
|
|
7
7
|
payload: Payload;
|
|
8
8
|
defaultPath?: number;
|
|
9
9
|
}
|
|
10
|
+
export interface StepPort<Event = BaseEvent> extends BasePort {
|
|
11
|
+
data: {
|
|
12
|
+
event?: Event;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface StepPorts<Event> extends BaseStepPorts<Record<string, StepPort<Event>>, StepPort<Event>[]> {
|
|
16
|
+
}
|
|
17
|
+
export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, StepPorts<Event>, BasePortList<StepPort<Event>>> {
|
|
18
|
+
type: string;
|
|
19
|
+
}
|
|
10
20
|
export interface NodePath<Event = BaseEvent> {
|
|
11
21
|
label?: string;
|
|
12
22
|
event?: Event;
|
|
@@ -19,8 +29,3 @@ export interface Node<Event = BaseEvent> extends BaseNode {
|
|
|
19
29
|
payload: unknown;
|
|
20
30
|
defaultPath?: number;
|
|
21
31
|
}
|
|
22
|
-
export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, BasePort<{
|
|
23
|
-
event?: Event;
|
|
24
|
-
}>[]> {
|
|
25
|
-
type: string;
|
|
26
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseStep, IntegrationType, NodeSuccessFailID } from './utils';
|
|
3
|
+
import { BaseStep, IntegrationType, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
4
4
|
export interface APIKeyVal {
|
|
5
5
|
key: string;
|
|
6
6
|
val: string;
|
|
@@ -40,6 +40,8 @@ export interface StepData {
|
|
|
40
40
|
selectedAction: APIActionType;
|
|
41
41
|
selectedIntegration: IntegrationType.CUSTOM_API;
|
|
42
42
|
}
|
|
43
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
44
|
+
}
|
|
43
45
|
export interface NodeData extends NodeSuccessFailID {
|
|
44
46
|
action_data: {
|
|
45
47
|
url: string;
|
|
@@ -55,6 +57,6 @@ export interface NodeData extends NodeSuccessFailID {
|
|
|
55
57
|
selected_action: APIActionType;
|
|
56
58
|
selected_integration: IntegrationType.CUSTOM_API;
|
|
57
59
|
}
|
|
58
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
60
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
59
61
|
type: NodeType.API;
|
|
60
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { StepButtonsLayout } from '../button';
|
|
3
3
|
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, StepIntentScope } from './utils';
|
|
4
|
+
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, NoMatchNoReplyStepPorts, StepIntentScope } from './utils';
|
|
5
5
|
export declare enum ButtonAction {
|
|
6
6
|
URL = "URL",
|
|
7
7
|
PATH = "PATH",
|
|
@@ -21,6 +21,8 @@ export interface StepData extends StepButtonsLayout, BaseNoReplyStepData, StepIn
|
|
|
21
21
|
*/
|
|
22
22
|
else?: BaseStepNoMatch;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
25
27
|
type: NodeType.BUTTONS;
|
|
26
28
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeNextID } from './utils';
|
|
3
|
+
import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepPorts, BuiltInNextPort, BuiltInNoReplyPort, NodeNextID } from './utils';
|
|
4
4
|
/** @deprecated */
|
|
5
5
|
export interface StepData extends BaseNoReplyStepData {
|
|
6
6
|
slot: Nullable<string>;
|
|
7
7
|
variable: Nullable<string>;
|
|
8
8
|
slotInputs: string[];
|
|
9
9
|
}
|
|
10
|
+
export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoReplyPort {
|
|
11
|
+
}
|
|
12
|
+
/** @deprecated */
|
|
13
|
+
export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
|
|
14
|
+
}
|
|
10
15
|
/** @deprecated */
|
|
11
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
16
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
12
17
|
type: NodeType.CAPTURE;
|
|
13
18
|
}
|
|
14
19
|
/** @deprecated */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Intent } from "../models";
|
|
2
2
|
import { Nullable } from "../types";
|
|
3
3
|
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
|
|
4
|
+
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepPorts, BuiltInNextPort, BuiltInNoMatchNoReplyPorts, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
|
|
5
5
|
export declare enum CaptureType {
|
|
6
6
|
INTENT = "intent",
|
|
7
7
|
QUERY = "query"
|
|
@@ -19,7 +19,11 @@ export interface QueryCapture {
|
|
|
19
19
|
export interface StepData extends BaseCaptureData {
|
|
20
20
|
capture: IntentCapture | QueryCapture;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
|
|
23
|
+
}
|
|
24
|
+
export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
23
27
|
type: NodeType.CAPTURE_V2;
|
|
24
28
|
}
|
|
25
29
|
export interface NodeIntent {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, NodeSuccessFailID } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
3
3
|
export interface StepData {
|
|
4
4
|
code: string;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
7
|
+
}
|
|
8
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
7
9
|
type: NodeType.CODE;
|
|
8
10
|
}
|
|
9
11
|
export interface Node extends BaseNode, NodeSuccessFailID {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { UnknownRecord } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseStep, BaseTraceFrame, TraceType } from './utils';
|
|
3
|
+
import { BaseNode, BaseStep, BaseTraceFrame, EmptyStepPorts, TraceType } from './utils';
|
|
4
4
|
export declare type StepData = UnknownRecord;
|
|
5
5
|
export interface NodeData {
|
|
6
6
|
end: true;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface StepPorts extends EmptyStepPorts {
|
|
9
|
+
}
|
|
10
|
+
export interface Step<Data = StepData> extends BaseStep<Data, [], StepPorts> {
|
|
9
11
|
type: NodeType.EXIT;
|
|
10
12
|
}
|
|
11
13
|
export interface Node extends BaseNode {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID } from './utils';
|
|
3
|
+
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
4
4
|
export declare enum GoogleSheetsActionType {
|
|
5
5
|
CREATE_DATA = "Create Data",
|
|
6
6
|
UPDATE_DATA = "Update Data",
|
|
@@ -33,7 +33,9 @@ export interface StepData {
|
|
|
33
33
|
selectedAction: Nullable<GoogleSheetsActionType>;
|
|
34
34
|
selectedIntegration: IntegrationType.GOOGLE_SHEETS;
|
|
35
35
|
}
|
|
36
|
-
export interface
|
|
36
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
37
|
+
}
|
|
38
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
37
39
|
type: NodeType.GOOGLE_SHEETS;
|
|
38
40
|
}
|
|
39
41
|
export interface NodeActionData {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, Expression, NodeElseID, NodeNextIDs } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, BaseStepPorts, BuiltInNoMatchPort, Expression, NodeElseID, NodeNextIDs } from './utils';
|
|
3
3
|
export interface StepData {
|
|
4
4
|
expressions: Expression[];
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface StepPorts extends BaseStepPorts<BuiltInNoMatchPort> {
|
|
7
|
+
}
|
|
8
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
7
9
|
type: NodeType.IF;
|
|
8
10
|
}
|
|
9
11
|
export interface Node extends BaseNode, NodeElseID, NodeNextIDs {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodePath } from './_v1';
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseStep, ExpressionData, NodeElseID } from './utils';
|
|
3
|
+
import { BaseNode, BaseStep, BaseStepPorts, BuiltInNoMatchPort, ExpressionData, NodeElseID } from './utils';
|
|
4
4
|
export declare enum IfNoMatchType {
|
|
5
5
|
PATH = "path",
|
|
6
6
|
NONE = "none"
|
|
@@ -13,7 +13,9 @@ export interface StepData {
|
|
|
13
13
|
expressions: ExpressionData[];
|
|
14
14
|
noMatch?: IfNoMatch;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface StepPorts extends BaseStepPorts<BuiltInNoMatchPort> {
|
|
17
|
+
}
|
|
18
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
17
19
|
type: NodeType.IF_V2;
|
|
18
20
|
}
|
|
19
21
|
export interface NodePayload extends NodeElseID {
|
|
@@ -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, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, SlotMappings, StepIntentScope, TraceType } from './utils';
|
|
4
|
+
import { BaseEvent, BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, NoMatchNoReplyStepPorts, SlotMappings, StepIntentScope, TraceType } from './utils';
|
|
5
5
|
export declare enum ChoiceAction {
|
|
6
6
|
PATH = "PATH",
|
|
7
7
|
GO_TO = "GO_TO"
|
|
@@ -23,7 +23,9 @@ export interface StepData extends BaseNoReplyStepData, StepIntentScope, BaseNoMa
|
|
|
23
23
|
*/
|
|
24
24
|
else?: BaseStepNoMatch;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
27
|
+
}
|
|
28
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
27
29
|
type: NodeType.INTERACTION;
|
|
28
30
|
}
|
|
29
31
|
export interface NodeInteraction<Event = BaseEvent> extends NodeNextID {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch } from './utils';
|
|
2
|
+
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, NoMatchNoReplyStepPorts } from './utils';
|
|
3
3
|
export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated use noMatch instead
|
|
6
6
|
*/
|
|
7
7
|
noMatches?: BaseStepNoMatch;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts<[]> {
|
|
10
|
+
}
|
|
11
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
10
12
|
type: NodeType.PROMPT;
|
|
11
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, NodeNextIDs } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, DynamicOnlyStepPorts, NodeNextIDs } from './utils';
|
|
3
3
|
export declare enum RandomType {
|
|
4
4
|
DEFAULT = 1,
|
|
5
5
|
DO_DUPLICATES = 2
|
|
@@ -8,7 +8,9 @@ export interface StepData {
|
|
|
8
8
|
paths: number;
|
|
9
9
|
noDuplicates: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface StepPorts extends DynamicOnlyStepPorts {
|
|
12
|
+
}
|
|
13
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
12
14
|
type: NodeType.RANDOM;
|
|
13
15
|
}
|
|
14
16
|
export interface Node extends BaseNode, NodeNextIDs {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { PortType } from "../models";
|
|
1
2
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, BaseTraceFrame, NodeID, TraceType } from './utils';
|
|
3
|
+
import { BaseNode, BasePort, BaseStep, BaseStepPorts, BaseTraceFrame, BuiltInNextPort, NodeID, TraceType } from './utils';
|
|
3
4
|
export interface StepData {
|
|
4
5
|
src: string;
|
|
5
6
|
loop: boolean;
|
|
@@ -10,7 +11,15 @@ export declare enum TraceStreamAction {
|
|
|
10
11
|
PLAY = "PLAY",
|
|
11
12
|
PAUSE = "PAUSE"
|
|
12
13
|
}
|
|
13
|
-
export interface
|
|
14
|
+
export interface StepBaseBuiltInPorts extends BuiltInNextPort {
|
|
15
|
+
}
|
|
16
|
+
export interface StepDefaultBuiltPorts extends StepBaseBuiltInPorts {
|
|
17
|
+
[PortType.PAUSE]?: BasePort;
|
|
18
|
+
[PortType.PREVIOUS]?: BasePort;
|
|
19
|
+
}
|
|
20
|
+
export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts, []> {
|
|
21
|
+
}
|
|
22
|
+
export interface Step<Data = StepData, Ports = StepPorts> extends BaseStep<Data, Ports> {
|
|
14
23
|
type: NodeType.STREAM;
|
|
15
24
|
}
|
|
16
25
|
export interface Node extends BaseNode {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from "../../types";
|
|
2
|
-
export { BaseCommand, BaseNode, BasePort, BaseStep } from "../../models";
|
|
2
|
+
export { BaseCommand, BaseNode, BasePort, BasePortList, BaseStep, BaseStepPorts, BuiltInFailPort, BuiltInNextFailPorts, BuiltInNextPort, BuiltInNoMatchNoReplyPorts, BuiltInNoMatchPort, BuiltInNoReplyPort, DynamicOnlyStepPorts, EmptyStepPorts, NextStepPorts, NoMatchNoReplyStepPorts, SuccessFailStepPorts, } from "../../models";
|
|
3
3
|
export declare type NodeID = Nullable<string>;
|
|
4
4
|
export interface DataID {
|
|
5
5
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID } from './utils';
|
|
2
|
+
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
3
3
|
export declare enum ZapierActionType {
|
|
4
4
|
START_A_ZAP = "Start a Zap"
|
|
5
5
|
}
|
|
@@ -9,6 +9,8 @@ export interface StepData {
|
|
|
9
9
|
selectedAction: ZapierActionType;
|
|
10
10
|
selectedIntegration: IntegrationType.ZAPIER;
|
|
11
11
|
}
|
|
12
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
13
|
+
}
|
|
12
14
|
export interface ActionData {
|
|
13
15
|
user?: IntegrationUser;
|
|
14
16
|
value: string;
|
|
@@ -18,6 +20,6 @@ export interface NodeData extends NodeSuccessFailID {
|
|
|
18
20
|
selected_action: ZapierActionType;
|
|
19
21
|
selected_integration: IntegrationType.ZAPIER;
|
|
20
22
|
}
|
|
21
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
23
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
22
24
|
type: NodeType.ZAPIER;
|
|
23
25
|
}
|
package/build/common/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare type Nullable<T> = T | null;
|
|
2
2
|
export declare type AnyRecord = Record<string, any>;
|
|
3
3
|
export declare type UnknownRecord = Record<string, unknown>;
|
|
4
|
+
export declare type EmptyRecord = Record<string, never>;
|
|
4
5
|
export declare type DeepPartialByKey<T, K extends keyof T> = {
|
|
5
6
|
[P in keyof T]?: P extends K ? Partial<T[P]> : T[P];
|
|
6
7
|
};
|
|
@@ -16,7 +16,7 @@ export declare const isSetV2: (value: BaseModels.BaseDiagramNode<import("..").An
|
|
|
16
16
|
export declare const isPrompt: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Prompt.Step<Node.Prompt.StepData>;
|
|
17
17
|
export declare const isVisual: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Visual.Step<Node.Visual.StepData>;
|
|
18
18
|
export declare const isIntent: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Intent.Step<Node.Intent.StepData>;
|
|
19
|
-
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData
|
|
19
|
+
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData, Node.Stream.StepPorts<Node.Stream.StepDefaultBuiltPorts>>;
|
|
20
20
|
export declare const isZapier: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Zapier.Step<Node.Zapier.StepData>;
|
|
21
21
|
export declare const isRandom: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Random.Step<Node.Random.StepData>;
|
|
22
22
|
export declare const isCommand: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Command.Step<Node.Command.StepData>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnyRecord
|
|
1
|
+
import { AnyRecord } from "../../types";
|
|
2
|
+
import { AnyBaseStepPorts, BasePortList, NextStepPorts } from './port';
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated use BaseNode instead
|
|
4
5
|
*/
|
|
@@ -25,22 +26,14 @@ export interface BlockOnlyData {
|
|
|
25
26
|
export interface BaseBlock<D extends AnyRecord = AnyRecord> extends BaseDiagramNode<D & BlockOnlyData> {
|
|
26
27
|
coords: Point;
|
|
27
28
|
}
|
|
28
|
-
export declare
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
export declare type StepOnlyData<Ports, PortsOld> = {
|
|
30
|
+
ports?: never;
|
|
31
|
+
portsV2: Ports;
|
|
32
|
+
} | {
|
|
33
|
+
ports: PortsOld;
|
|
34
|
+
portsV2?: never;
|
|
35
|
+
};
|
|
36
|
+
export interface BaseStep<Data extends AnyRecord = AnyRecord, Ports = NextStepPorts, PortsOld = BasePortList> extends BaseDiagramNode<Data & StepOnlyData<Ports, PortsOld>> {
|
|
35
37
|
}
|
|
36
|
-
export interface
|
|
37
|
-
id: string;
|
|
38
|
-
type: string | PortType;
|
|
39
|
-
data?: PD;
|
|
40
|
-
target: Nullable<string>;
|
|
41
|
-
}
|
|
42
|
-
export interface StepOnlyData<P = [BasePort, ...BasePort[]]> {
|
|
43
|
-
ports: P;
|
|
44
|
-
}
|
|
45
|
-
export interface BaseStep<D extends AnyRecord = AnyRecord, P = [BasePort, ...BasePort[]]> extends BaseDiagramNode<D & StepOnlyData<P>> {
|
|
38
|
+
export interface AnyBaseStep extends BaseStep<AnyRecord, AnyBaseStepPorts> {
|
|
46
39
|
}
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (PortType) {
|
|
3
|
-
PortType["FAIL"] = "fail";
|
|
4
|
-
PortType["NEXT"] = "next";
|
|
5
|
-
PortType["PAUSE"] = "pause";
|
|
6
|
-
PortType["NO_REPLY"] = "no-reply";
|
|
7
|
-
PortType["NO_MATCH"] = "else";
|
|
8
|
-
PortType["PREVIOUS"] = "previous";
|
|
9
|
-
})(PortType || (PortType = {}));
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EmptyRecord, Nullable } from "../../types";
|
|
2
|
+
export declare enum PortType {
|
|
3
|
+
FAIL = "fail",
|
|
4
|
+
NEXT = "next",
|
|
5
|
+
PAUSE = "pause",
|
|
6
|
+
NO_REPLY = "no-reply",
|
|
7
|
+
NO_MATCH = "else",
|
|
8
|
+
PREVIOUS = "previous"
|
|
9
|
+
}
|
|
10
|
+
export interface BasePort {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string | PortType;
|
|
13
|
+
target: Nullable<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[]> {
|
|
16
|
+
builtIn: Builtin;
|
|
17
|
+
dynamic: Dynamic;
|
|
18
|
+
}
|
|
19
|
+
export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
|
|
20
|
+
}
|
|
21
|
+
export interface BuiltInNextPort {
|
|
22
|
+
[PortType.NEXT]: BasePort;
|
|
23
|
+
}
|
|
24
|
+
export interface BuiltInFailPort {
|
|
25
|
+
[PortType.FAIL]: BasePort;
|
|
26
|
+
}
|
|
27
|
+
export interface BuiltInNoMatchPort {
|
|
28
|
+
[PortType.NO_MATCH]?: BasePort;
|
|
29
|
+
}
|
|
30
|
+
export interface BuiltInNoReplyPort {
|
|
31
|
+
[PortType.NO_REPLY]?: BasePort;
|
|
32
|
+
}
|
|
33
|
+
export interface BuiltInNextFailPorts extends BuiltInNextPort, BuiltInFailPort {
|
|
34
|
+
}
|
|
35
|
+
export interface BuiltInNoMatchNoReplyPorts extends BuiltInNoMatchPort, BuiltInNoReplyPort {
|
|
36
|
+
}
|
|
37
|
+
export interface EmptyStepPorts extends BaseStepPorts<EmptyRecord, []> {
|
|
38
|
+
}
|
|
39
|
+
export interface NextStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextPort, Dynamic> {
|
|
40
|
+
}
|
|
41
|
+
export interface SuccessFailStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextFailPorts, Dynamic> {
|
|
42
|
+
}
|
|
43
|
+
export interface DynamicOnlyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<EmptyRecord, Dynamic> {
|
|
44
|
+
}
|
|
45
|
+
export interface NoMatchNoReplyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNoMatchNoReplyPorts, Dynamic> {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
export declare type BasePortList<Port extends BasePort = BasePort> = [Port, ...Port[]];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var PortType;
|
|
2
|
+
(function (PortType) {
|
|
3
|
+
PortType["FAIL"] = "fail";
|
|
4
|
+
PortType["NEXT"] = "next";
|
|
5
|
+
PortType["PAUSE"] = "pause";
|
|
6
|
+
PortType["NO_REPLY"] = "no-reply";
|
|
7
|
+
PortType["NO_MATCH"] = "else";
|
|
8
|
+
PortType["PREVIOUS"] = "previous";
|
|
9
|
+
})(PortType || (PortType = {}));
|
package/build/esm/node/_v1.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
|
-
import { BaseEvent, BaseNode, BasePort, BaseStep, NodeID } from './utils';
|
|
2
|
+
import { BaseEvent, BaseNode, BasePort, BasePortList, BaseStep, BaseStepPorts, NodeID } from './utils';
|
|
3
3
|
export declare const _V1_STOP_TYPES = "stopTypes";
|
|
4
4
|
export interface StepData<Payload = unknown> {
|
|
5
5
|
_v: 1;
|
|
@@ -7,6 +7,16 @@ export interface StepData<Payload = unknown> {
|
|
|
7
7
|
payload: Payload;
|
|
8
8
|
defaultPath?: number;
|
|
9
9
|
}
|
|
10
|
+
export interface StepPort<Event = BaseEvent> extends BasePort {
|
|
11
|
+
data: {
|
|
12
|
+
event?: Event;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface StepPorts<Event> extends BaseStepPorts<Record<string, StepPort<Event>>, StepPort<Event>[]> {
|
|
16
|
+
}
|
|
17
|
+
export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, StepPorts<Event>, BasePortList<StepPort<Event>>> {
|
|
18
|
+
type: string;
|
|
19
|
+
}
|
|
10
20
|
export interface NodePath<Event = BaseEvent> {
|
|
11
21
|
label?: string;
|
|
12
22
|
event?: Event;
|
|
@@ -19,8 +29,3 @@ export interface Node<Event = BaseEvent> extends BaseNode {
|
|
|
19
29
|
payload: unknown;
|
|
20
30
|
defaultPath?: number;
|
|
21
31
|
}
|
|
22
|
-
export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, BasePort<{
|
|
23
|
-
event?: Event;
|
|
24
|
-
}>[]> {
|
|
25
|
-
type: string;
|
|
26
|
-
}
|
package/build/esm/node/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseStep, IntegrationType, NodeSuccessFailID } from './utils';
|
|
3
|
+
import { BaseStep, IntegrationType, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
4
4
|
export interface APIKeyVal {
|
|
5
5
|
key: string;
|
|
6
6
|
val: string;
|
|
@@ -40,6 +40,8 @@ export interface StepData {
|
|
|
40
40
|
selectedAction: APIActionType;
|
|
41
41
|
selectedIntegration: IntegrationType.CUSTOM_API;
|
|
42
42
|
}
|
|
43
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
44
|
+
}
|
|
43
45
|
export interface NodeData extends NodeSuccessFailID {
|
|
44
46
|
action_data: {
|
|
45
47
|
url: string;
|
|
@@ -55,6 +57,6 @@ export interface NodeData extends NodeSuccessFailID {
|
|
|
55
57
|
selected_action: APIActionType;
|
|
56
58
|
selected_integration: IntegrationType.CUSTOM_API;
|
|
57
59
|
}
|
|
58
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
60
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
59
61
|
type: NodeType.API;
|
|
60
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { StepButtonsLayout } from '../button';
|
|
3
3
|
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, StepIntentScope } from './utils';
|
|
4
|
+
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, DataID, NoMatchNoReplyStepPorts, StepIntentScope } from './utils';
|
|
5
5
|
export declare enum ButtonAction {
|
|
6
6
|
URL = "URL",
|
|
7
7
|
PATH = "PATH",
|
|
@@ -21,6 +21,8 @@ export interface StepData extends StepButtonsLayout, BaseNoReplyStepData, StepIn
|
|
|
21
21
|
*/
|
|
22
22
|
else?: BaseStepNoMatch;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
24
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
25
27
|
type: NodeType.BUTTONS;
|
|
26
28
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeNextID } from './utils';
|
|
3
|
+
import { BaseNode, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepPorts, BuiltInNextPort, BuiltInNoReplyPort, NodeNextID } from './utils';
|
|
4
4
|
/** @deprecated */
|
|
5
5
|
export interface StepData extends BaseNoReplyStepData {
|
|
6
6
|
slot: Nullable<string>;
|
|
7
7
|
variable: Nullable<string>;
|
|
8
8
|
slotInputs: string[];
|
|
9
9
|
}
|
|
10
|
+
export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoReplyPort {
|
|
11
|
+
}
|
|
12
|
+
/** @deprecated */
|
|
13
|
+
export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
|
|
14
|
+
}
|
|
10
15
|
/** @deprecated */
|
|
11
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
16
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
12
17
|
type: NodeType.CAPTURE;
|
|
13
18
|
}
|
|
14
19
|
/** @deprecated */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Intent } from "../models";
|
|
2
2
|
import { Nullable } from "../types";
|
|
3
3
|
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
|
|
4
|
+
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepPorts, BuiltInNextPort, BuiltInNoMatchNoReplyPorts, NodeIntentScope, NodeNextID, StepIntentScope } from './utils';
|
|
5
5
|
export declare enum CaptureType {
|
|
6
6
|
INTENT = "intent",
|
|
7
7
|
QUERY = "query"
|
|
@@ -19,7 +19,11 @@ export interface QueryCapture {
|
|
|
19
19
|
export interface StepData extends BaseCaptureData {
|
|
20
20
|
capture: IntentCapture | QueryCapture;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
|
|
23
|
+
}
|
|
24
|
+
export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
23
27
|
type: NodeType.CAPTURE_V2;
|
|
24
28
|
}
|
|
25
29
|
export interface NodeIntent {
|
package/build/esm/node/code.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, NodeSuccessFailID } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
3
3
|
export interface StepData {
|
|
4
4
|
code: string;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
7
|
+
}
|
|
8
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
7
9
|
type: NodeType.CODE;
|
|
8
10
|
}
|
|
9
11
|
export interface Node extends BaseNode, NodeSuccessFailID {
|
package/build/esm/node/exit.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { UnknownRecord } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseStep, BaseTraceFrame, TraceType } from './utils';
|
|
3
|
+
import { BaseNode, BaseStep, BaseTraceFrame, EmptyStepPorts, TraceType } from './utils';
|
|
4
4
|
export declare type StepData = UnknownRecord;
|
|
5
5
|
export interface NodeData {
|
|
6
6
|
end: true;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface StepPorts extends EmptyStepPorts {
|
|
9
|
+
}
|
|
10
|
+
export interface Step<Data = StepData> extends BaseStep<Data, [], StepPorts> {
|
|
9
11
|
type: NodeType.EXIT;
|
|
10
12
|
}
|
|
11
13
|
export interface Node extends BaseNode {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../types";
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID } from './utils';
|
|
3
|
+
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
4
4
|
export declare enum GoogleSheetsActionType {
|
|
5
5
|
CREATE_DATA = "Create Data",
|
|
6
6
|
UPDATE_DATA = "Update Data",
|
|
@@ -33,7 +33,9 @@ export interface StepData {
|
|
|
33
33
|
selectedAction: Nullable<GoogleSheetsActionType>;
|
|
34
34
|
selectedIntegration: IntegrationType.GOOGLE_SHEETS;
|
|
35
35
|
}
|
|
36
|
-
export interface
|
|
36
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
37
|
+
}
|
|
38
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
37
39
|
type: NodeType.GOOGLE_SHEETS;
|
|
38
40
|
}
|
|
39
41
|
export interface NodeActionData {
|
package/build/esm/node/if.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, Expression, NodeElseID, NodeNextIDs } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, BaseStepPorts, BuiltInNoMatchPort, Expression, NodeElseID, NodeNextIDs } from './utils';
|
|
3
3
|
export interface StepData {
|
|
4
4
|
expressions: Expression[];
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface StepPorts extends BaseStepPorts<BuiltInNoMatchPort> {
|
|
7
|
+
}
|
|
8
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
7
9
|
type: NodeType.IF;
|
|
8
10
|
}
|
|
9
11
|
export interface Node extends BaseNode, NodeElseID, NodeNextIDs {
|
package/build/esm/node/ifV2.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodePath } from './_v1';
|
|
2
2
|
import { NodeType } from './constants';
|
|
3
|
-
import { BaseNode, BaseStep, ExpressionData, NodeElseID } from './utils';
|
|
3
|
+
import { BaseNode, BaseStep, BaseStepPorts, BuiltInNoMatchPort, ExpressionData, NodeElseID } from './utils';
|
|
4
4
|
export declare enum IfNoMatchType {
|
|
5
5
|
PATH = "path",
|
|
6
6
|
NONE = "none"
|
|
@@ -13,7 +13,9 @@ export interface StepData {
|
|
|
13
13
|
expressions: ExpressionData[];
|
|
14
14
|
noMatch?: IfNoMatch;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface StepPorts extends BaseStepPorts<BuiltInNoMatchPort> {
|
|
17
|
+
}
|
|
18
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
17
19
|
type: NodeType.IF_V2;
|
|
18
20
|
}
|
|
19
21
|
export interface NodePayload extends NodeElseID {
|
|
@@ -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, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, SlotMappings, StepIntentScope, TraceType } from './utils';
|
|
4
|
+
import { BaseEvent, BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, BaseTraceFrame, DeprecatedBaseNodeNoMatch, NodeIntentScope, NodeNextID, NoMatchNoReplyStepPorts, SlotMappings, StepIntentScope, TraceType } from './utils';
|
|
5
5
|
export declare enum ChoiceAction {
|
|
6
6
|
PATH = "PATH",
|
|
7
7
|
GO_TO = "GO_TO"
|
|
@@ -23,7 +23,9 @@ export interface StepData extends BaseNoReplyStepData, StepIntentScope, BaseNoMa
|
|
|
23
23
|
*/
|
|
24
24
|
else?: BaseStepNoMatch;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
27
|
+
}
|
|
28
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
27
29
|
type: NodeType.INTERACTION;
|
|
28
30
|
}
|
|
29
31
|
export interface NodeInteraction<Event = BaseEvent> extends NodeNextID {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch } from './utils';
|
|
2
|
+
import { BaseNoMatchStepData, BaseNoReplyStepData, BaseStep, BaseStepNoMatch, NoMatchNoReplyStepPorts } from './utils';
|
|
3
3
|
export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated use noMatch instead
|
|
6
6
|
*/
|
|
7
7
|
noMatches?: BaseStepNoMatch;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts<[]> {
|
|
10
|
+
}
|
|
11
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
10
12
|
type: NodeType.PROMPT;
|
|
11
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, NodeNextIDs } from './utils';
|
|
2
|
+
import { BaseNode, BaseStep, DynamicOnlyStepPorts, NodeNextIDs } from './utils';
|
|
3
3
|
export declare enum RandomType {
|
|
4
4
|
DEFAULT = 1,
|
|
5
5
|
DO_DUPLICATES = 2
|
|
@@ -8,7 +8,9 @@ export interface StepData {
|
|
|
8
8
|
paths: number;
|
|
9
9
|
noDuplicates: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface StepPorts extends DynamicOnlyStepPorts {
|
|
12
|
+
}
|
|
13
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
12
14
|
type: NodeType.RANDOM;
|
|
13
15
|
}
|
|
14
16
|
export interface Node extends BaseNode, NodeNextIDs {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { PortType } from "../models";
|
|
1
2
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseNode, BaseStep, BaseTraceFrame, NodeID, TraceType } from './utils';
|
|
3
|
+
import { BaseNode, BasePort, BaseStep, BaseStepPorts, BaseTraceFrame, BuiltInNextPort, NodeID, TraceType } from './utils';
|
|
3
4
|
export interface StepData {
|
|
4
5
|
src: string;
|
|
5
6
|
loop: boolean;
|
|
@@ -10,7 +11,15 @@ export declare enum TraceStreamAction {
|
|
|
10
11
|
PLAY = "PLAY",
|
|
11
12
|
PAUSE = "PAUSE"
|
|
12
13
|
}
|
|
13
|
-
export interface
|
|
14
|
+
export interface StepBaseBuiltInPorts extends BuiltInNextPort {
|
|
15
|
+
}
|
|
16
|
+
export interface StepDefaultBuiltPorts extends StepBaseBuiltInPorts {
|
|
17
|
+
[PortType.PAUSE]?: BasePort;
|
|
18
|
+
[PortType.PREVIOUS]?: BasePort;
|
|
19
|
+
}
|
|
20
|
+
export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts, []> {
|
|
21
|
+
}
|
|
22
|
+
export interface Step<Data = StepData, Ports = StepPorts> extends BaseStep<Data, Ports> {
|
|
14
23
|
type: NodeType.STREAM;
|
|
15
24
|
}
|
|
16
25
|
export interface Node extends BaseNode {
|
package/build/esm/node/stream.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from "../../types";
|
|
2
|
-
export { BaseCommand, BaseNode, BasePort, BaseStep } from "../../models";
|
|
2
|
+
export { BaseCommand, BaseNode, BasePort, BasePortList, BaseStep, BaseStepPorts, BuiltInFailPort, BuiltInNextFailPorts, BuiltInNextPort, BuiltInNoMatchNoReplyPorts, BuiltInNoMatchPort, BuiltInNoReplyPort, DynamicOnlyStepPorts, EmptyStepPorts, NextStepPorts, NoMatchNoReplyStepPorts, SuccessFailStepPorts, } from "../../models";
|
|
3
3
|
export declare type NodeID = Nullable<string>;
|
|
4
4
|
export interface DataID {
|
|
5
5
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeType } from './constants';
|
|
2
|
-
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID } from './utils';
|
|
2
|
+
import { BaseStep, IntegrationType, IntegrationUser, NodeSuccessFailID, SuccessFailStepPorts } from './utils';
|
|
3
3
|
export declare enum ZapierActionType {
|
|
4
4
|
START_A_ZAP = "Start a Zap"
|
|
5
5
|
}
|
|
@@ -9,6 +9,8 @@ export interface StepData {
|
|
|
9
9
|
selectedAction: ZapierActionType;
|
|
10
10
|
selectedIntegration: IntegrationType.ZAPIER;
|
|
11
11
|
}
|
|
12
|
+
export interface StepPorts extends SuccessFailStepPorts<[]> {
|
|
13
|
+
}
|
|
12
14
|
export interface ActionData {
|
|
13
15
|
user?: IntegrationUser;
|
|
14
16
|
value: string;
|
|
@@ -18,6 +20,6 @@ export interface NodeData extends NodeSuccessFailID {
|
|
|
18
20
|
selected_action: ZapierActionType;
|
|
19
21
|
selected_integration: IntegrationType.ZAPIER;
|
|
20
22
|
}
|
|
21
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
23
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
22
24
|
type: NodeType.ZAPIER;
|
|
23
25
|
}
|
package/build/esm/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare type Nullable<T> = T | null;
|
|
2
2
|
export declare type AnyRecord = Record<string, any>;
|
|
3
3
|
export declare type UnknownRecord = Record<string, unknown>;
|
|
4
|
+
export declare type EmptyRecord = Record<string, never>;
|
|
4
5
|
export declare type DeepPartialByKey<T, K extends keyof T> = {
|
|
5
6
|
[P in keyof T]?: P extends K ? Partial<T[P]> : T[P];
|
|
6
7
|
};
|
|
@@ -16,7 +16,7 @@ export declare const isSetV2: (value: BaseModels.BaseDiagramNode<import("..").An
|
|
|
16
16
|
export declare const isPrompt: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Prompt.Step<Node.Prompt.StepData>;
|
|
17
17
|
export declare const isVisual: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Visual.Step<Node.Visual.StepData>;
|
|
18
18
|
export declare const isIntent: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Intent.Step<Node.Intent.StepData>;
|
|
19
|
-
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData
|
|
19
|
+
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData, Node.Stream.StepPorts<Node.Stream.StepDefaultBuiltPorts>>;
|
|
20
20
|
export declare const isZapier: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Zapier.Step<Node.Zapier.StepData>;
|
|
21
21
|
export declare const isRandom: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Random.Step<Node.Random.StepData>;
|
|
22
22
|
export declare const isCommand: (value: BaseModels.BaseDiagramNode<import("..").AnyRecord>) => value is Node.Command.Step<Node.Command.StepData>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/base-types",
|
|
3
3
|
"description": "Voiceflow base project types",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.20.1",
|
|
5
5
|
"author": "Voiceflow",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/voiceflow/libs/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@voiceflow/common": "^7.25.
|
|
10
|
+
"@voiceflow/common": "^7.25.2",
|
|
11
11
|
"slate": "0.73.0"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"test:smoke": "exit 0",
|
|
44
44
|
"test:unit": "exit 0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "13bae0c256520e18682b0b3f1e4c16693f092c68"
|
|
47
47
|
}
|