@voiceflow/base-types 2.34.0 → 2.36.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/node/carousel.d.ts +43 -0
- package/build/common/node/carousel.js +8 -0
- package/build/common/node/constants.d.ts +1 -1
- package/build/common/node/constants.js +1 -1
- package/build/common/node/index.d.ts +1 -1
- package/build/common/node/index.js +2 -2
- package/build/common/node/utils/trace.d.ts +3 -2
- package/build/common/node/utils/trace.js +2 -1
- package/build/common/utils/node.d.ts +1 -1
- package/build/common/utils/node.js +2 -2
- package/build/common/utils/nodeType.d.ts +1 -1
- package/build/common/utils/nodeType.js +2 -2
- package/build/common/utils/step.d.ts +1 -1
- package/build/common/utils/step.js +2 -2
- package/build/common/version/settings.d.ts +3 -3
- package/build/common/version/settings.js +2 -2
- package/build/esm/node/carousel.d.ts +43 -0
- package/build/esm/node/carousel.js +5 -0
- package/build/esm/node/constants.d.ts +1 -1
- package/build/esm/node/constants.js +1 -1
- package/build/esm/node/index.d.ts +1 -1
- package/build/esm/node/index.js +1 -1
- package/build/esm/node/utils/trace.d.ts +3 -2
- package/build/esm/node/utils/trace.js +2 -1
- package/build/esm/utils/node.d.ts +1 -1
- package/build/esm/utils/node.js +1 -1
- package/build/esm/utils/nodeType.d.ts +1 -1
- package/build/esm/utils/nodeType.js +1 -1
- package/build/esm/utils/step.d.ts +1 -1
- package/build/esm/utils/step.js +1 -1
- package/build/esm/version/settings.d.ts +3 -3
- package/build/esm/version/settings.js +2 -2
- package/package.json +2 -2
- package/build/common/node/cardV2.d.ts +0 -31
- package/build/common/node/cardV2.js +0 -8
- package/build/esm/node/cardV2.d.ts +0 -31
- package/build/esm/node/cardV2.js +0 -5
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GeneralRequestButton } from "../request";
|
|
2
|
+
import { SlateTextValue } from "../text";
|
|
3
|
+
import { Nullable } from '@voiceflow/common';
|
|
4
|
+
import { NodeType } from './constants';
|
|
5
|
+
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseTraceFrame, DataID, NoMatchNoReplyStepPorts, TraceType } from './utils';
|
|
6
|
+
export declare enum CarouselLayout {
|
|
7
|
+
CAROUSEL = "Carousel",
|
|
8
|
+
LIST = "List"
|
|
9
|
+
}
|
|
10
|
+
export interface CarouselButton extends DataID {
|
|
11
|
+
name: string;
|
|
12
|
+
intent?: Nullable<string>;
|
|
13
|
+
}
|
|
14
|
+
export interface CarouselCard<B = CarouselButton> extends DataID {
|
|
15
|
+
imageUrl: string | null;
|
|
16
|
+
title: string;
|
|
17
|
+
description: SlateTextValue;
|
|
18
|
+
buttons: B[];
|
|
19
|
+
}
|
|
20
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
21
|
+
}
|
|
22
|
+
export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
|
|
23
|
+
layout: CarouselLayout;
|
|
24
|
+
cards: CarouselCard[];
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
27
|
+
type: NodeType.CAROUSEL;
|
|
28
|
+
}
|
|
29
|
+
export declare type NodeCarouselCard = CarouselCard<GeneralRequestButton>;
|
|
30
|
+
export interface Node extends BaseNode, BaseNoReplyNodeData, BaseNoMatchNodeData {
|
|
31
|
+
type: NodeType.CAROUSEL;
|
|
32
|
+
cards: NodeCarouselCard[];
|
|
33
|
+
isBlocking: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface TraceCarouselCard extends Omit<NodeCarouselCard, 'description'> {
|
|
36
|
+
description: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TraceFramePayload {
|
|
39
|
+
cards: TraceCarouselCard[];
|
|
40
|
+
}
|
|
41
|
+
export interface TraceFrame extends BaseTraceFrame<TraceFramePayload> {
|
|
42
|
+
type: TraceType.CAROUSEL;
|
|
43
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CarouselLayout = void 0;
|
|
4
|
+
var CarouselLayout;
|
|
5
|
+
(function (CarouselLayout) {
|
|
6
|
+
CarouselLayout["CAROUSEL"] = "Carousel";
|
|
7
|
+
CarouselLayout["LIST"] = "List";
|
|
8
|
+
})(CarouselLayout = exports.CarouselLayout || (exports.CarouselLayout = {}));
|
|
@@ -7,7 +7,7 @@ var NodeType;
|
|
|
7
7
|
NodeType["SPEAK"] = "speak";
|
|
8
8
|
NodeType["START"] = "start";
|
|
9
9
|
NodeType["CARD"] = "card";
|
|
10
|
-
NodeType["
|
|
10
|
+
NodeType["CAROUSEL"] = "carousel";
|
|
11
11
|
NodeType["BUTTONS"] = "buttons";
|
|
12
12
|
NodeType["INTERACTION"] = "interaction";
|
|
13
13
|
// logic
|
|
@@ -25,7 +25,7 @@ export * as Buttons from './buttons';
|
|
|
25
25
|
export * as Capture from './capture';
|
|
26
26
|
export * as CaptureV2 from './captureV2';
|
|
27
27
|
export * as Card from './card';
|
|
28
|
-
export * as
|
|
28
|
+
export * as Carousel from './carousel';
|
|
29
29
|
export * as Code from './code';
|
|
30
30
|
export * as Component from './component';
|
|
31
31
|
export * from './constants';
|
|
@@ -22,14 +22,14 @@ 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.Zapier = exports.Visual = exports.Utils = exports.Url = exports.Text = exports.Stream = exports.Start = exports.Speak = exports.SetV2 = exports.Set = exports.Random = exports.Command = exports.Prompt = exports.Intent = exports.Interaction = exports.Integration = exports.IfV2 = exports.If = exports.GoToNode = exports.GoTo = exports.GoogleSheets = exports.General = exports.Flow = exports.Exit = exports.Directive = exports.Component = exports.Code = exports.
|
|
25
|
+
exports.Zapier = exports.Visual = exports.Utils = exports.Url = exports.Text = exports.Stream = exports.Start = exports.Speak = exports.SetV2 = exports.Set = exports.Random = exports.Command = exports.Prompt = exports.Intent = exports.Interaction = exports.Integration = exports.IfV2 = exports.If = exports.GoToNode = exports.GoTo = exports.GoogleSheets = exports.General = exports.Flow = exports.Exit = exports.Directive = exports.Component = exports.Code = exports.Carousel = exports.Card = exports.CaptureV2 = exports.Capture = exports.Buttons = exports.Api = exports._v1 = void 0;
|
|
26
26
|
exports._v1 = __importStar(require("./_v1"));
|
|
27
27
|
exports.Api = __importStar(require("./api"));
|
|
28
28
|
exports.Buttons = __importStar(require("./buttons"));
|
|
29
29
|
exports.Capture = __importStar(require("./capture"));
|
|
30
30
|
exports.CaptureV2 = __importStar(require("./captureV2"));
|
|
31
31
|
exports.Card = __importStar(require("./card"));
|
|
32
|
-
exports.
|
|
32
|
+
exports.Carousel = __importStar(require("./carousel"));
|
|
33
33
|
exports.Code = __importStar(require("./code"));
|
|
34
34
|
exports.Component = __importStar(require("./component"));
|
|
35
35
|
__exportStar(require("./constants"), exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseEvent } from './event';
|
|
2
2
|
export declare enum TraceType {
|
|
3
|
+
LOG = "log",
|
|
3
4
|
END = "end",
|
|
4
5
|
TEXT = "text",
|
|
5
6
|
PATH = "path",
|
|
@@ -11,9 +12,9 @@ export declare enum TraceType {
|
|
|
11
12
|
CHOICE = "choice",
|
|
12
13
|
STREAM = "stream",
|
|
13
14
|
VISUAL = "visual",
|
|
15
|
+
CAROUSEL = "carousel",
|
|
14
16
|
NO_REPLY = "no-reply",
|
|
15
|
-
ENTITY_FILLING = "entity-filling"
|
|
16
|
-
LOG = "log"
|
|
17
|
+
ENTITY_FILLING = "entity-filling"
|
|
17
18
|
}
|
|
18
19
|
export interface BaseTraceFramePath<Event extends BaseEvent = BaseEvent> {
|
|
19
20
|
label?: string;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TraceType = void 0;
|
|
4
4
|
var TraceType;
|
|
5
5
|
(function (TraceType) {
|
|
6
|
+
TraceType["LOG"] = "log";
|
|
6
7
|
TraceType["END"] = "end";
|
|
7
8
|
TraceType["TEXT"] = "text";
|
|
8
9
|
TraceType["PATH"] = "path";
|
|
@@ -14,7 +15,7 @@ var TraceType;
|
|
|
14
15
|
TraceType["CHOICE"] = "choice";
|
|
15
16
|
TraceType["STREAM"] = "stream";
|
|
16
17
|
TraceType["VISUAL"] = "visual";
|
|
18
|
+
TraceType["CAROUSEL"] = "carousel";
|
|
17
19
|
TraceType["NO_REPLY"] = "no-reply";
|
|
18
20
|
TraceType["ENTITY_FILLING"] = "entity-filling";
|
|
19
|
-
TraceType["LOG"] = "log";
|
|
20
21
|
})(TraceType = exports.TraceType || (exports.TraceType = {}));
|
|
@@ -16,7 +16,7 @@ export declare const isSpeak: (value: BaseModels.BaseNode) => value is Node.Spea
|
|
|
16
16
|
export declare const isStart: (value: BaseModels.BaseNode) => value is Node.Start.Node;
|
|
17
17
|
export declare const isSetV2: (value: BaseModels.BaseNode) => value is Node.SetV2.Node;
|
|
18
18
|
export declare const isVisual: (value: BaseModels.BaseNode) => value is Node.Visual.Node;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const isCarousel: (value: BaseModels.BaseNode) => value is Node.Carousel.Node;
|
|
20
20
|
export declare const isStream: (value: BaseModels.BaseNode) => value is Node.Stream.Node;
|
|
21
21
|
export declare const isRandom: (value: BaseModels.BaseNode) => value is Node.Random.Node;
|
|
22
22
|
export declare const isCapture: (value: BaseModels.BaseNode) => value is Node.Capture.Node;
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.isIntegrations = exports.isInteraction = exports.isCaptureV2 = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isRandom = exports.isStream = exports.
|
|
22
|
+
exports.isIntegrations = exports.isInteraction = exports.isCaptureV2 = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isRandom = exports.isStream = exports.isCarousel = exports.isVisual = exports.isSetV2 = exports.isStart = exports.isSpeak = exports.isExit = exports.isCode = exports.isFlow = exports.isIfV2 = exports.isCard = exports.isGoTo = exports.isText = exports.isSet = exports.isUrl = exports.isIf = exports.isV1 = exports.createNodeTypeguard = void 0;
|
|
23
23
|
const Node = __importStar(require("../node"));
|
|
24
24
|
const common_1 = require("@voiceflow/common");
|
|
25
25
|
exports.createNodeTypeguard = common_1.Utils.typeguard.createTypedTypeguardCreator();
|
|
@@ -39,7 +39,7 @@ exports.isSpeak = (0, exports.createNodeTypeguard)(Node.NodeType.SPEAK);
|
|
|
39
39
|
exports.isStart = (0, exports.createNodeTypeguard)(Node.NodeType.START);
|
|
40
40
|
exports.isSetV2 = (0, exports.createNodeTypeguard)(Node.NodeType.SET_V2);
|
|
41
41
|
exports.isVisual = (0, exports.createNodeTypeguard)(Node.NodeType.VISUAL);
|
|
42
|
-
exports.
|
|
42
|
+
exports.isCarousel = (0, exports.createNodeTypeguard)(Node.NodeType.CAROUSEL);
|
|
43
43
|
exports.isStream = (0, exports.createNodeTypeguard)(Node.NodeType.STREAM);
|
|
44
44
|
exports.isRandom = (0, exports.createNodeTypeguard)(Node.NodeType.RANDOM);
|
|
45
45
|
exports.isCapture = (0, exports.createNodeTypeguard)(Node.NodeType.CAPTURE);
|
|
@@ -14,7 +14,7 @@ export declare const isExit: (value?: unknown) => value is Node.NodeType.EXIT;
|
|
|
14
14
|
export declare const isSpeak: (value?: unknown) => value is Node.NodeType.SPEAK;
|
|
15
15
|
export declare const isStart: (value?: unknown) => value is Node.NodeType.START;
|
|
16
16
|
export declare const isSetV2: (value?: unknown) => value is Node.NodeType.SET_V2;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const isCarousel: (value?: unknown) => value is Node.NodeType.CAROUSEL;
|
|
18
18
|
export declare const isPrompt: (value?: unknown) => value is Node.NodeType.PROMPT;
|
|
19
19
|
export declare const isVisual: (value?: unknown) => value is Node.NodeType.VISUAL;
|
|
20
20
|
export declare const isIntent: (value?: unknown) => value is Node.NodeType.INTENT;
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.isRuntimeOnly = exports.isGoogleSheets = exports.isIntegrations = exports.isInteraction = exports.isDeprecated = exports.isCaptureV2 = exports.isComponent = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isButtons = exports.isCommand = exports.isRandom = exports.isZapier = exports.isStream = exports.isIntent = exports.isVisual = exports.isPrompt = exports.
|
|
22
|
+
exports.isRuntimeOnly = exports.isGoogleSheets = exports.isIntegrations = exports.isInteraction = exports.isDeprecated = exports.isCaptureV2 = exports.isComponent = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isButtons = exports.isCommand = exports.isRandom = exports.isZapier = exports.isStream = exports.isIntent = exports.isVisual = exports.isPrompt = exports.isCarousel = exports.isSetV2 = exports.isStart = exports.isSpeak = exports.isExit = exports.isCode = exports.isFlow = exports.isIfV2 = exports.isCard = exports.isText = exports.isGoTo = exports.isApi = exports.isSet = exports.isUrl = exports.isIf = exports.createNodeTypeTypeguard = void 0;
|
|
23
23
|
const Node = __importStar(require("../node"));
|
|
24
24
|
const common_1 = require("@voiceflow/common");
|
|
25
25
|
exports.createNodeTypeTypeguard = common_1.Utils.typeguard.createTypeguardCreator();
|
|
@@ -37,7 +37,7 @@ exports.isExit = (0, exports.createNodeTypeTypeguard)(Node.NodeType.EXIT);
|
|
|
37
37
|
exports.isSpeak = (0, exports.createNodeTypeTypeguard)(Node.NodeType.SPEAK);
|
|
38
38
|
exports.isStart = (0, exports.createNodeTypeTypeguard)(Node.NodeType.START);
|
|
39
39
|
exports.isSetV2 = (0, exports.createNodeTypeTypeguard)(Node.NodeType.SET_V2);
|
|
40
|
-
exports.
|
|
40
|
+
exports.isCarousel = (0, exports.createNodeTypeTypeguard)(Node.NodeType.CAROUSEL);
|
|
41
41
|
exports.isPrompt = (0, exports.createNodeTypeTypeguard)(Node.NodeType.PROMPT);
|
|
42
42
|
exports.isVisual = (0, exports.createNodeTypeTypeguard)(Node.NodeType.VISUAL);
|
|
43
43
|
exports.isIntent = (0, exports.createNodeTypeTypeguard)(Node.NodeType.INTENT);
|
|
@@ -16,7 +16,7 @@ export declare const isSpeak: (value: BaseModels.BaseDiagramNode<import("@voicef
|
|
|
16
16
|
export declare const isStart: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Start.Step<Node.Start.StepData>;
|
|
17
17
|
export declare const isSetV2: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.SetV2.Step<Node.SetV2.StepData>;
|
|
18
18
|
export declare const isPrompt: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Prompt.Step<Node.Prompt.StepData>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const isCarousel: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Carousel.Step<Node.Carousel.StepData>;
|
|
20
20
|
export declare const isVisual: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Visual.Step<Node.Visual.StepData>;
|
|
21
21
|
export declare const isIntent: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Intent.Step<Node.Intent.StepData>;
|
|
22
22
|
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData, Node.Stream.StepPorts<Node.Stream.StepDefaultBuiltPorts>>;
|
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.isGoogleSheets = exports.isInteraction = exports.isDeprecated = exports.isCaptureV2 = exports.isComponent = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isButtons = exports.isCommand = exports.isRandom = exports.isZapier = exports.isStream = exports.isIntent = exports.isVisual = exports.
|
|
22
|
+
exports.isGoogleSheets = exports.isInteraction = exports.isDeprecated = exports.isCaptureV2 = exports.isComponent = exports.isDirective = exports.isGoToNode = exports.isGeneral = exports.isCapture = exports.isButtons = exports.isCommand = exports.isRandom = exports.isZapier = exports.isStream = exports.isIntent = exports.isVisual = exports.isCarousel = exports.isPrompt = exports.isSetV2 = exports.isStart = exports.isSpeak = exports.isExit = exports.isCode = exports.isGoTo = exports.isFlow = exports.isIfV2 = exports.isCard = exports.isText = exports.isApi = exports.isSet = exports.isUrl = exports.isIf = exports.createStepTypeguard = void 0;
|
|
23
23
|
const Node = __importStar(require("../node"));
|
|
24
24
|
const common_1 = require("@voiceflow/common");
|
|
25
25
|
exports.createStepTypeguard = common_1.Utils.typeguard.createTypedTypeguardCreator();
|
|
@@ -38,7 +38,7 @@ exports.isSpeak = (0, exports.createStepTypeguard)(Node.NodeType.SPEAK);
|
|
|
38
38
|
exports.isStart = (0, exports.createStepTypeguard)(Node.NodeType.START);
|
|
39
39
|
exports.isSetV2 = (0, exports.createStepTypeguard)(Node.NodeType.SET_V2);
|
|
40
40
|
exports.isPrompt = (0, exports.createStepTypeguard)(Node.NodeType.PROMPT);
|
|
41
|
-
exports.
|
|
41
|
+
exports.isCarousel = (0, exports.createStepTypeguard)(Node.NodeType.CAROUSEL);
|
|
42
42
|
exports.isVisual = (0, exports.createStepTypeguard)(Node.NodeType.VISUAL);
|
|
43
43
|
exports.isIntent = (0, exports.createStepTypeguard)(Node.NodeType.INTENT);
|
|
44
44
|
exports.isStream = (0, exports.createStepTypeguard)(Node.NodeType.STREAM);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CarouselLayout } from "../node/carousel";
|
|
2
2
|
import { Nullable } from '@voiceflow/common';
|
|
3
3
|
import { Utils } from '../node';
|
|
4
4
|
export declare enum RepeatType {
|
|
@@ -24,6 +24,6 @@ export interface Settings<Prompt = unknown> {
|
|
|
24
24
|
repeat: RepeatType;
|
|
25
25
|
session: Session<Prompt>;
|
|
26
26
|
defaultCanvasNodeVisibility: Nullable<Utils.CanvasNodeVisibility>;
|
|
27
|
-
|
|
27
|
+
defaultCarouselLayout?: Nullable<CarouselLayout>;
|
|
28
28
|
}
|
|
29
|
-
export declare const defaultSettings: <Prompt>({ error, repeat, session, defaultCanvasNodeVisibility,
|
|
29
|
+
export declare const defaultSettings: <Prompt>({ error, repeat, session, defaultCanvasNodeVisibility, defaultCarouselLayout, }?: Partial<Settings<Prompt>>) => Settings<Prompt>;
|
|
@@ -12,11 +12,11 @@ var SessionType;
|
|
|
12
12
|
SessionType["RESUME"] = "resume";
|
|
13
13
|
SessionType["RESTART"] = "restart";
|
|
14
14
|
})(SessionType = exports.SessionType || (exports.SessionType = {}));
|
|
15
|
-
const defaultSettings = ({ error = null, repeat = RepeatType.ALL, session = { type: SessionType.RESTART }, defaultCanvasNodeVisibility = null,
|
|
15
|
+
const defaultSettings = ({ error = null, repeat = RepeatType.ALL, session = { type: SessionType.RESTART }, defaultCanvasNodeVisibility = null, defaultCarouselLayout = null, } = {}) => ({
|
|
16
16
|
error,
|
|
17
17
|
repeat,
|
|
18
18
|
session,
|
|
19
19
|
defaultCanvasNodeVisibility,
|
|
20
|
-
|
|
20
|
+
defaultCarouselLayout,
|
|
21
21
|
});
|
|
22
22
|
exports.defaultSettings = defaultSettings;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { GeneralRequestButton } from "../request";
|
|
2
|
+
import { SlateTextValue } from "../text";
|
|
3
|
+
import { Nullable } from '@voiceflow/common';
|
|
4
|
+
import { NodeType } from './constants';
|
|
5
|
+
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, BaseTraceFrame, DataID, NoMatchNoReplyStepPorts, TraceType } from './utils';
|
|
6
|
+
export declare enum CarouselLayout {
|
|
7
|
+
CAROUSEL = "Carousel",
|
|
8
|
+
LIST = "List"
|
|
9
|
+
}
|
|
10
|
+
export interface CarouselButton extends DataID {
|
|
11
|
+
name: string;
|
|
12
|
+
intent?: Nullable<string>;
|
|
13
|
+
}
|
|
14
|
+
export interface CarouselCard<B = CarouselButton> extends DataID {
|
|
15
|
+
imageUrl: string | null;
|
|
16
|
+
title: string;
|
|
17
|
+
description: SlateTextValue;
|
|
18
|
+
buttons: B[];
|
|
19
|
+
}
|
|
20
|
+
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
21
|
+
}
|
|
22
|
+
export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
|
|
23
|
+
layout: CarouselLayout;
|
|
24
|
+
cards: CarouselCard[];
|
|
25
|
+
}
|
|
26
|
+
export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
|
|
27
|
+
type: NodeType.CAROUSEL;
|
|
28
|
+
}
|
|
29
|
+
export declare type NodeCarouselCard = CarouselCard<GeneralRequestButton>;
|
|
30
|
+
export interface Node extends BaseNode, BaseNoReplyNodeData, BaseNoMatchNodeData {
|
|
31
|
+
type: NodeType.CAROUSEL;
|
|
32
|
+
cards: NodeCarouselCard[];
|
|
33
|
+
isBlocking: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface TraceCarouselCard extends Omit<NodeCarouselCard, 'description'> {
|
|
36
|
+
description: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TraceFramePayload {
|
|
39
|
+
cards: TraceCarouselCard[];
|
|
40
|
+
}
|
|
41
|
+
export interface TraceFrame extends BaseTraceFrame<TraceFramePayload> {
|
|
42
|
+
type: TraceType.CAROUSEL;
|
|
43
|
+
}
|
|
@@ -4,7 +4,7 @@ export var NodeType;
|
|
|
4
4
|
NodeType["SPEAK"] = "speak";
|
|
5
5
|
NodeType["START"] = "start";
|
|
6
6
|
NodeType["CARD"] = "card";
|
|
7
|
-
NodeType["
|
|
7
|
+
NodeType["CAROUSEL"] = "carousel";
|
|
8
8
|
NodeType["BUTTONS"] = "buttons";
|
|
9
9
|
NodeType["INTERACTION"] = "interaction";
|
|
10
10
|
// logic
|
|
@@ -25,7 +25,7 @@ export * as Buttons from './buttons';
|
|
|
25
25
|
export * as Capture from './capture';
|
|
26
26
|
export * as CaptureV2 from './captureV2';
|
|
27
27
|
export * as Card from './card';
|
|
28
|
-
export * as
|
|
28
|
+
export * as Carousel from './carousel';
|
|
29
29
|
export * as Code from './code';
|
|
30
30
|
export * as Component from './component';
|
|
31
31
|
export * from './constants';
|
package/build/esm/node/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export * as Buttons from './buttons';
|
|
|
4
4
|
export * as Capture from './capture';
|
|
5
5
|
export * as CaptureV2 from './captureV2';
|
|
6
6
|
export * as Card from './card';
|
|
7
|
-
export * as
|
|
7
|
+
export * as Carousel from './carousel';
|
|
8
8
|
export * as Code from './code';
|
|
9
9
|
export * as Component from './component';
|
|
10
10
|
export * from './constants';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseEvent } from './event';
|
|
2
2
|
export declare enum TraceType {
|
|
3
|
+
LOG = "log",
|
|
3
4
|
END = "end",
|
|
4
5
|
TEXT = "text",
|
|
5
6
|
PATH = "path",
|
|
@@ -11,9 +12,9 @@ export declare enum TraceType {
|
|
|
11
12
|
CHOICE = "choice",
|
|
12
13
|
STREAM = "stream",
|
|
13
14
|
VISUAL = "visual",
|
|
15
|
+
CAROUSEL = "carousel",
|
|
14
16
|
NO_REPLY = "no-reply",
|
|
15
|
-
ENTITY_FILLING = "entity-filling"
|
|
16
|
-
LOG = "log"
|
|
17
|
+
ENTITY_FILLING = "entity-filling"
|
|
17
18
|
}
|
|
18
19
|
export interface BaseTraceFramePath<Event extends BaseEvent = BaseEvent> {
|
|
19
20
|
label?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export var TraceType;
|
|
2
2
|
(function (TraceType) {
|
|
3
|
+
TraceType["LOG"] = "log";
|
|
3
4
|
TraceType["END"] = "end";
|
|
4
5
|
TraceType["TEXT"] = "text";
|
|
5
6
|
TraceType["PATH"] = "path";
|
|
@@ -11,7 +12,7 @@ export var TraceType;
|
|
|
11
12
|
TraceType["CHOICE"] = "choice";
|
|
12
13
|
TraceType["STREAM"] = "stream";
|
|
13
14
|
TraceType["VISUAL"] = "visual";
|
|
15
|
+
TraceType["CAROUSEL"] = "carousel";
|
|
14
16
|
TraceType["NO_REPLY"] = "no-reply";
|
|
15
17
|
TraceType["ENTITY_FILLING"] = "entity-filling";
|
|
16
|
-
TraceType["LOG"] = "log";
|
|
17
18
|
})(TraceType || (TraceType = {}));
|
|
@@ -16,7 +16,7 @@ export declare const isSpeak: (value: BaseModels.BaseNode) => value is Node.Spea
|
|
|
16
16
|
export declare const isStart: (value: BaseModels.BaseNode) => value is Node.Start.Node;
|
|
17
17
|
export declare const isSetV2: (value: BaseModels.BaseNode) => value is Node.SetV2.Node;
|
|
18
18
|
export declare const isVisual: (value: BaseModels.BaseNode) => value is Node.Visual.Node;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const isCarousel: (value: BaseModels.BaseNode) => value is Node.Carousel.Node;
|
|
20
20
|
export declare const isStream: (value: BaseModels.BaseNode) => value is Node.Stream.Node;
|
|
21
21
|
export declare const isRandom: (value: BaseModels.BaseNode) => value is Node.Random.Node;
|
|
22
22
|
export declare const isCapture: (value: BaseModels.BaseNode) => value is Node.Capture.Node;
|
package/build/esm/utils/node.js
CHANGED
|
@@ -16,7 +16,7 @@ export const isSpeak = createNodeTypeguard(Node.NodeType.SPEAK);
|
|
|
16
16
|
export const isStart = createNodeTypeguard(Node.NodeType.START);
|
|
17
17
|
export const isSetV2 = createNodeTypeguard(Node.NodeType.SET_V2);
|
|
18
18
|
export const isVisual = createNodeTypeguard(Node.NodeType.VISUAL);
|
|
19
|
-
export const
|
|
19
|
+
export const isCarousel = createNodeTypeguard(Node.NodeType.CAROUSEL);
|
|
20
20
|
export const isStream = createNodeTypeguard(Node.NodeType.STREAM);
|
|
21
21
|
export const isRandom = createNodeTypeguard(Node.NodeType.RANDOM);
|
|
22
22
|
export const isCapture = createNodeTypeguard(Node.NodeType.CAPTURE);
|
|
@@ -14,7 +14,7 @@ export declare const isExit: (value?: unknown) => value is Node.NodeType.EXIT;
|
|
|
14
14
|
export declare const isSpeak: (value?: unknown) => value is Node.NodeType.SPEAK;
|
|
15
15
|
export declare const isStart: (value?: unknown) => value is Node.NodeType.START;
|
|
16
16
|
export declare const isSetV2: (value?: unknown) => value is Node.NodeType.SET_V2;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const isCarousel: (value?: unknown) => value is Node.NodeType.CAROUSEL;
|
|
18
18
|
export declare const isPrompt: (value?: unknown) => value is Node.NodeType.PROMPT;
|
|
19
19
|
export declare const isVisual: (value?: unknown) => value is Node.NodeType.VISUAL;
|
|
20
20
|
export declare const isIntent: (value?: unknown) => value is Node.NodeType.INTENT;
|
|
@@ -15,7 +15,7 @@ export const isExit = createNodeTypeTypeguard(Node.NodeType.EXIT);
|
|
|
15
15
|
export const isSpeak = createNodeTypeTypeguard(Node.NodeType.SPEAK);
|
|
16
16
|
export const isStart = createNodeTypeTypeguard(Node.NodeType.START);
|
|
17
17
|
export const isSetV2 = createNodeTypeTypeguard(Node.NodeType.SET_V2);
|
|
18
|
-
export const
|
|
18
|
+
export const isCarousel = createNodeTypeTypeguard(Node.NodeType.CAROUSEL);
|
|
19
19
|
export const isPrompt = createNodeTypeTypeguard(Node.NodeType.PROMPT);
|
|
20
20
|
export const isVisual = createNodeTypeTypeguard(Node.NodeType.VISUAL);
|
|
21
21
|
export const isIntent = createNodeTypeTypeguard(Node.NodeType.INTENT);
|
|
@@ -16,7 +16,7 @@ export declare const isSpeak: (value: BaseModels.BaseDiagramNode<import("@voicef
|
|
|
16
16
|
export declare const isStart: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Start.Step<Node.Start.StepData>;
|
|
17
17
|
export declare const isSetV2: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.SetV2.Step<Node.SetV2.StepData>;
|
|
18
18
|
export declare const isPrompt: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Prompt.Step<Node.Prompt.StepData>;
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const isCarousel: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Carousel.Step<Node.Carousel.StepData>;
|
|
20
20
|
export declare const isVisual: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Visual.Step<Node.Visual.StepData>;
|
|
21
21
|
export declare const isIntent: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Intent.Step<Node.Intent.StepData>;
|
|
22
22
|
export declare const isStream: (value: BaseModels.BaseDiagramNode<import("@voiceflow/common").AnyRecord>) => value is Node.Stream.Step<Node.Stream.StepData, Node.Stream.StepPorts<Node.Stream.StepDefaultBuiltPorts>>;
|
package/build/esm/utils/step.js
CHANGED
|
@@ -16,7 +16,7 @@ export const isSpeak = createStepTypeguard(Node.NodeType.SPEAK);
|
|
|
16
16
|
export const isStart = createStepTypeguard(Node.NodeType.START);
|
|
17
17
|
export const isSetV2 = createStepTypeguard(Node.NodeType.SET_V2);
|
|
18
18
|
export const isPrompt = createStepTypeguard(Node.NodeType.PROMPT);
|
|
19
|
-
export const
|
|
19
|
+
export const isCarousel = createStepTypeguard(Node.NodeType.CAROUSEL);
|
|
20
20
|
export const isVisual = createStepTypeguard(Node.NodeType.VISUAL);
|
|
21
21
|
export const isIntent = createStepTypeguard(Node.NodeType.INTENT);
|
|
22
22
|
export const isStream = createStepTypeguard(Node.NodeType.STREAM);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CarouselLayout } from "../node/carousel";
|
|
2
2
|
import { Nullable } from '@voiceflow/common';
|
|
3
3
|
import { Utils } from '../node';
|
|
4
4
|
export declare enum RepeatType {
|
|
@@ -24,6 +24,6 @@ export interface Settings<Prompt = unknown> {
|
|
|
24
24
|
repeat: RepeatType;
|
|
25
25
|
session: Session<Prompt>;
|
|
26
26
|
defaultCanvasNodeVisibility: Nullable<Utils.CanvasNodeVisibility>;
|
|
27
|
-
|
|
27
|
+
defaultCarouselLayout?: Nullable<CarouselLayout>;
|
|
28
28
|
}
|
|
29
|
-
export declare const defaultSettings: <Prompt>({ error, repeat, session, defaultCanvasNodeVisibility,
|
|
29
|
+
export declare const defaultSettings: <Prompt>({ error, repeat, session, defaultCanvasNodeVisibility, defaultCarouselLayout, }?: Partial<Settings<Prompt>>) => Settings<Prompt>;
|
|
@@ -9,10 +9,10 @@ export var SessionType;
|
|
|
9
9
|
SessionType["RESUME"] = "resume";
|
|
10
10
|
SessionType["RESTART"] = "restart";
|
|
11
11
|
})(SessionType || (SessionType = {}));
|
|
12
|
-
export const defaultSettings = ({ error = null, repeat = RepeatType.ALL, session = { type: SessionType.RESTART }, defaultCanvasNodeVisibility = null,
|
|
12
|
+
export const defaultSettings = ({ error = null, repeat = RepeatType.ALL, session = { type: SessionType.RESTART }, defaultCanvasNodeVisibility = null, defaultCarouselLayout = null, } = {}) => ({
|
|
13
13
|
error,
|
|
14
14
|
repeat,
|
|
15
15
|
session,
|
|
16
16
|
defaultCanvasNodeVisibility,
|
|
17
|
-
|
|
17
|
+
defaultCarouselLayout,
|
|
18
18
|
});
|
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.
|
|
4
|
+
"version": "2.36.1",
|
|
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": "
|
|
46
|
+
"gitHead": "4d9e3ca67f050e5a4263f85bac00ddac32e19150"
|
|
47
47
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { SlateTextValue } from "../text";
|
|
2
|
-
import { Nullable } from '@voiceflow/common';
|
|
3
|
-
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, DataID, NoMatchNoReplyStepPorts } from './utils';
|
|
5
|
-
export declare enum CardLayout {
|
|
6
|
-
CAROUSEL = "Carousel",
|
|
7
|
-
LIST = "List"
|
|
8
|
-
}
|
|
9
|
-
export interface CardButton extends DataID {
|
|
10
|
-
name: string;
|
|
11
|
-
intent?: Nullable<string>;
|
|
12
|
-
}
|
|
13
|
-
export interface Card extends DataID {
|
|
14
|
-
imageUrl: string | null;
|
|
15
|
-
title: string;
|
|
16
|
-
description: SlateTextValue;
|
|
17
|
-
buttons: CardButton[];
|
|
18
|
-
}
|
|
19
|
-
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
20
|
-
}
|
|
21
|
-
export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
|
|
22
|
-
layout: CardLayout;
|
|
23
|
-
cards: Card[];
|
|
24
|
-
}
|
|
25
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
26
|
-
type: NodeType.CARDV2;
|
|
27
|
-
}
|
|
28
|
-
export interface Node extends BaseNode, BaseNoReplyNodeData, BaseNoMatchNodeData {
|
|
29
|
-
type: NodeType.CARDV2;
|
|
30
|
-
cards: Card[];
|
|
31
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CardLayout = void 0;
|
|
4
|
-
var CardLayout;
|
|
5
|
-
(function (CardLayout) {
|
|
6
|
-
CardLayout["CAROUSEL"] = "Carousel";
|
|
7
|
-
CardLayout["LIST"] = "List";
|
|
8
|
-
})(CardLayout = exports.CardLayout || (exports.CardLayout = {}));
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { SlateTextValue } from "../text";
|
|
2
|
-
import { Nullable } from '@voiceflow/common';
|
|
3
|
-
import { NodeType } from './constants';
|
|
4
|
-
import { BaseNode, BaseNoMatchNodeData, BaseNoMatchStepData, BaseNoReplyNodeData, BaseNoReplyStepData, BaseStep, DataID, NoMatchNoReplyStepPorts } from './utils';
|
|
5
|
-
export declare enum CardLayout {
|
|
6
|
-
CAROUSEL = "Carousel",
|
|
7
|
-
LIST = "List"
|
|
8
|
-
}
|
|
9
|
-
export interface CardButton extends DataID {
|
|
10
|
-
name: string;
|
|
11
|
-
intent?: Nullable<string>;
|
|
12
|
-
}
|
|
13
|
-
export interface Card extends DataID {
|
|
14
|
-
imageUrl: string | null;
|
|
15
|
-
title: string;
|
|
16
|
-
description: SlateTextValue;
|
|
17
|
-
buttons: CardButton[];
|
|
18
|
-
}
|
|
19
|
-
export interface StepPorts extends NoMatchNoReplyStepPorts {
|
|
20
|
-
}
|
|
21
|
-
export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
|
|
22
|
-
layout: CardLayout;
|
|
23
|
-
cards: Card[];
|
|
24
|
-
}
|
|
25
|
-
export interface Step<Data = StepData> extends BaseStep<Data> {
|
|
26
|
-
type: NodeType.CARDV2;
|
|
27
|
-
}
|
|
28
|
-
export interface Node extends BaseNode, BaseNoReplyNodeData, BaseNoMatchNodeData {
|
|
29
|
-
type: NodeType.CARDV2;
|
|
30
|
-
cards: Card[];
|
|
31
|
-
}
|