@voiceflow/base-types 2.26.0 → 2.28.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/index.d.ts +4 -2
- package/build/common/node/index.js +2 -1
- package/build/common/node/utils/trace.d.ts +2 -1
- package/build/common/node/utils/trace.js +1 -0
- package/build/common/runtimeLogs/index.d.ts +2 -0
- package/build/common/runtimeLogs/index.js +1 -0
- package/build/common/runtimeLogs/logs/base.d.ts +5 -4
- package/build/common/runtimeLogs/logs/global/conversationStart.d.ts +2 -2
- package/build/common/runtimeLogs/logs/index.d.ts +5 -22
- package/build/common/runtimeLogs/logs/index.js +17 -3
- package/build/common/runtimeLogs/logs/kinds.d.ts +26 -0
- package/build/common/runtimeLogs/logs/kinds.js +36 -0
- package/build/common/runtimeLogs/logs/levels.d.ts +6 -0
- package/build/common/runtimeLogs/logs/levels.js +10 -0
- package/build/common/runtimeLogs/logs/logs.d.ts +20 -0
- package/build/common/runtimeLogs/logs/logs.js +2 -0
- package/build/common/runtimeLogs/logs/steps/api.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/buttons.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/capture.d.ts +2 -2
- package/build/common/runtimeLogs/logs/steps/code.d.ts +4 -3
- package/build/common/runtimeLogs/logs/steps/condition.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/customAction.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/exit.d.ts +6 -3
- package/build/common/runtimeLogs/logs/steps/flow.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/intent.d.ts +2 -2
- package/build/common/runtimeLogs/logs/steps/random.d.ts +3 -2
- package/build/common/runtimeLogs/logs/steps/set.d.ts +2 -2
- package/build/common/runtimeLogs/logs/steps/speak.d.ts +2 -2
- package/build/common/runtimeLogs/logs/steps/start.d.ts +2 -2
- package/build/common/runtimeLogs/logs/steps/text.d.ts +2 -2
- package/build/common/runtimeLogs/runtime/index.d.ts +1 -0
- package/build/common/runtimeLogs/runtime/index.js +13 -0
- package/build/common/runtimeLogs/runtime/logBuffer.d.ts +19 -0
- package/build/common/runtimeLogs/runtime/logBuffer.js +2 -0
- package/build/common/runtimeLogs/utils/logs.d.ts +1 -6
- package/build/common/runtimeLogs/utils/logs.js +6 -12
- package/build/common/runtimeLogs/utils/types.d.ts +2 -27
- package/build/common/runtimeLogs/utils/types.js +0 -34
- package/build/common/trace/index.d.ts +6 -1
- package/build/esm/node/index.d.ts +4 -2
- package/build/esm/node/index.js +1 -0
- package/build/esm/node/utils/trace.d.ts +2 -1
- package/build/esm/node/utils/trace.js +1 -0
- package/build/esm/runtimeLogs/index.d.ts +2 -0
- package/build/esm/runtimeLogs/index.js +1 -0
- package/build/esm/runtimeLogs/logs/base.d.ts +5 -4
- package/build/esm/runtimeLogs/logs/global/conversationStart.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/index.d.ts +5 -22
- package/build/esm/runtimeLogs/logs/index.js +4 -1
- package/build/esm/runtimeLogs/logs/kinds.d.ts +26 -0
- package/build/esm/runtimeLogs/logs/kinds.js +33 -0
- package/build/esm/runtimeLogs/logs/levels.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/levels.js +7 -0
- package/build/esm/runtimeLogs/logs/logs.d.ts +20 -0
- package/build/esm/runtimeLogs/logs/logs.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/api.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/buttons.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/capture.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/steps/code.d.ts +4 -3
- package/build/esm/runtimeLogs/logs/steps/condition.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/customAction.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/exit.d.ts +6 -3
- package/build/esm/runtimeLogs/logs/steps/flow.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/intent.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/steps/random.d.ts +3 -2
- package/build/esm/runtimeLogs/logs/steps/set.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/steps/speak.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/steps/start.d.ts +2 -2
- package/build/esm/runtimeLogs/logs/steps/text.d.ts +2 -2
- package/build/esm/runtimeLogs/runtime/index.d.ts +1 -0
- package/build/esm/runtimeLogs/runtime/index.js +1 -0
- package/build/esm/runtimeLogs/runtime/logBuffer.d.ts +19 -0
- package/build/esm/runtimeLogs/runtime/logBuffer.js +1 -0
- package/build/esm/runtimeLogs/utils/logs.d.ts +1 -6
- package/build/esm/runtimeLogs/utils/logs.js +1 -7
- package/build/esm/runtimeLogs/utils/types.d.ts +2 -27
- package/build/esm/runtimeLogs/utils/types.js +1 -33
- package/build/esm/trace/index.d.ts +6 -1
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import * as Flow from './flow';
|
|
|
7
7
|
import * as General from './general';
|
|
8
8
|
import * as GoogleSheets from './googleSheets';
|
|
9
9
|
import * as GoTo from './goTo';
|
|
10
|
+
import * as GoToBlock from './goToBlock';
|
|
10
11
|
import * as If from './if';
|
|
11
12
|
import * as IfV2 from './ifV2';
|
|
12
13
|
import * as Integration from './integration';
|
|
@@ -33,6 +34,7 @@ export * as Flow from './flow';
|
|
|
33
34
|
export * as General from './general';
|
|
34
35
|
export * as GoogleSheets from './googleSheets';
|
|
35
36
|
export * as GoTo from './goTo';
|
|
37
|
+
export * as GoToBlock from './goToBlock';
|
|
36
38
|
export * as If from './if';
|
|
37
39
|
export * as IfV2 from './ifV2';
|
|
38
40
|
export * as Integration from './integration';
|
|
@@ -50,6 +52,6 @@ export * as Text from './text';
|
|
|
50
52
|
export * as Utils from './utils';
|
|
51
53
|
export * as Visual from './visual';
|
|
52
54
|
export * as Zapier from './zapier';
|
|
53
|
-
export declare type AnyCommonStep = Set.Step | SetV2.Step | Flow.Step | Component.Step | Start.Step | Code.Step | Intent.Step | Command.Step | Api.Step | Exit.Step | Random.Step | Zapier.Step | GoogleSheets.Step | If.Step | IfV2.Step | General.Step | _v1.Step;
|
|
54
|
-
export declare type AnyCommonNode = Set.Node | SetV2.Node | Flow.Node | Start.Node | Code.Node | Integration.Node | Exit.Node | Random.Node | General.Node | If.Node | IfV2.Node | GoTo.Node | _v1.Node;
|
|
55
|
+
export declare type AnyCommonStep = Set.Step | SetV2.Step | Flow.Step | Component.Step | Start.Step | Code.Step | Intent.Step | Command.Step | Api.Step | Exit.Step | Random.Step | Zapier.Step | GoogleSheets.Step | If.Step | IfV2.Step | General.Step | GoTo.Step | GoToBlock.Step | _v1.Step;
|
|
56
|
+
export declare type AnyCommonNode = Set.Node | SetV2.Node | Flow.Node | Start.Node | Code.Node | Integration.Node | Exit.Node | Random.Node | General.Node | If.Node | IfV2.Node | GoTo.Node | GoToBlock.Node | _v1.Node;
|
|
55
57
|
export declare type AnyCommonCommand = Intent.Command | Command.Command;
|
|
@@ -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.Zapier = exports.Visual = exports.Utils = 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.GoTo = exports.GoogleSheets = exports.General = exports.Flow = exports.Exit = exports.Directive = exports.Component = exports.Code = exports.CardV2 = exports.Card = exports.CaptureV2 = exports.Capture = exports.Buttons = exports.Api = exports._v1 = void 0;
|
|
25
|
+
exports.Zapier = exports.Visual = exports.Utils = 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.GoToBlock = exports.GoTo = exports.GoogleSheets = exports.General = exports.Flow = exports.Exit = exports.Directive = exports.Component = exports.Code = exports.CardV2 = 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"));
|
|
@@ -39,6 +39,7 @@ exports.Flow = __importStar(require("./flow"));
|
|
|
39
39
|
exports.General = __importStar(require("./general"));
|
|
40
40
|
exports.GoogleSheets = __importStar(require("./googleSheets"));
|
|
41
41
|
exports.GoTo = __importStar(require("./goTo"));
|
|
42
|
+
exports.GoToBlock = __importStar(require("./goToBlock"));
|
|
42
43
|
exports.If = __importStar(require("./if"));
|
|
43
44
|
exports.IfV2 = __importStar(require("./ifV2"));
|
|
44
45
|
exports.Integration = __importStar(require("./integration"));
|
|
@@ -12,7 +12,8 @@ export declare enum TraceType {
|
|
|
12
12
|
STREAM = "stream",
|
|
13
13
|
VISUAL = "visual",
|
|
14
14
|
NO_REPLY = "no-reply",
|
|
15
|
-
ENTITY_FILLING = "entity-filling"
|
|
15
|
+
ENTITY_FILLING = "entity-filling",
|
|
16
|
+
LOG = "log"
|
|
16
17
|
}
|
|
17
18
|
export interface BaseTraceFramePath<Event extends BaseEvent = BaseEvent> {
|
|
18
19
|
label?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EmptyObject } from '@voiceflow/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Iso8601Timestamp, PathReference } from '../utils';
|
|
3
|
+
import { GlobalLogKind, StepLogKind } from './kinds';
|
|
4
|
+
import { LogLevel } from './levels';
|
|
4
5
|
/** The base log interface. This should not be used directly, use one of the subtypes instead. */
|
|
5
6
|
interface BaseLog {
|
|
6
7
|
kind: string;
|
|
@@ -8,12 +9,12 @@ interface BaseLog {
|
|
|
8
9
|
message: EmptyObject;
|
|
9
10
|
level: LogLevel;
|
|
10
11
|
}
|
|
11
|
-
export interface BaseGlobalLog<Kind extends
|
|
12
|
+
export interface BaseGlobalLog<Kind extends GlobalLogKind, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
|
|
12
13
|
kind: `global.${Kind}`;
|
|
13
14
|
level: Level;
|
|
14
15
|
message: Message;
|
|
15
16
|
}
|
|
16
|
-
export interface BaseStepLog<Kind extends
|
|
17
|
+
export interface BaseStepLog<Kind extends StepLogKind, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
|
|
17
18
|
kind: `step.${Kind}`;
|
|
18
19
|
level: Level;
|
|
19
20
|
message: PathReference & Message;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GlobalLogKinds } from "../../utils";
|
|
2
1
|
import { BaseGlobalLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { GlobalLogKind } from '../kinds';
|
|
3
|
+
export declare type ConversationStartLog = BaseGlobalLog<GlobalLogKind.CONVERSATION_START, {
|
|
4
4
|
versionID: string;
|
|
5
5
|
userID: string;
|
|
6
6
|
}>;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CodeStepLog } from './steps/code';
|
|
6
|
-
import { ConditionStepLog } from './steps/condition';
|
|
7
|
-
import { CustomActionStepLog } from './steps/customAction';
|
|
8
|
-
import { ExitStepLog } from './steps/exit';
|
|
9
|
-
import { FlowStepLog } from './steps/flow';
|
|
10
|
-
import { IntentStepLog } from './steps/intent';
|
|
11
|
-
import { RandomStepLog } from './steps/random';
|
|
12
|
-
import { SetStepLog } from './steps/set';
|
|
13
|
-
import { SpeakStepLog } from './steps/speak';
|
|
14
|
-
import { StartStepLog } from './steps/start';
|
|
15
|
-
import { TextStepLog } from './steps/text';
|
|
16
|
-
export * from './global/conversationStart';
|
|
17
|
-
export { ApiStepLog, ButtonsStepLog, CaptureStepLog, CodeStepLog, ConditionStepLog, CustomActionStepLog, ExitStepLog, FlowStepLog, IntentStepLog, RandomStepLog, SetStepLog, SpeakStepLog, StartStepLog, TextStepLog, };
|
|
18
|
-
/** All possible runtime logs for global events. */
|
|
19
|
-
declare type GlobalLog = ConversationStartLog;
|
|
20
|
-
/** All possible runtime logs for steps. */
|
|
21
|
-
declare type StepLog = ApiStepLog | ButtonsStepLog | CaptureStepLog | CodeStepLog | ConditionStepLog | CustomActionStepLog | ExitStepLog | FlowStepLog | IntentStepLog | RandomStepLog | SetStepLog | SpeakStepLog | StartStepLog | TextStepLog;
|
|
1
|
+
import * as Logs from './logs';
|
|
2
|
+
export * as Kinds from './kinds';
|
|
3
|
+
export { Logs };
|
|
4
|
+
export { LogLevel } from './levels';
|
|
22
5
|
/** All possible runtime logs. */
|
|
23
|
-
export declare type Log = GlobalLog | StepLog;
|
|
6
|
+
export declare type Log = Logs.GlobalLog | Logs.StepLog;
|
|
@@ -6,8 +6,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
11
20
|
};
|
|
12
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
22
|
+
exports.LogLevel = exports.Logs = exports.Kinds = void 0;
|
|
23
|
+
const Logs = __importStar(require("./logs"));
|
|
24
|
+
exports.Logs = Logs;
|
|
25
|
+
exports.Kinds = __importStar(require("./kinds"));
|
|
26
|
+
var levels_1 = require("./levels");
|
|
27
|
+
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return levels_1.LogLevel; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Similar to {@link NodeType}, but for runtime logging */
|
|
2
|
+
export declare enum StepLogKind {
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
SPEAK = "speak",
|
|
5
|
+
AUDIO = "audio",
|
|
6
|
+
VISUALS = "visuals",
|
|
7
|
+
BUTTONS = "buttons",
|
|
8
|
+
CHOICE = "choice",
|
|
9
|
+
CAPTURE = "capture",
|
|
10
|
+
PROMPT = "prompt",
|
|
11
|
+
INTENT = "intent",
|
|
12
|
+
CONDITION = "condition",
|
|
13
|
+
SET = "set",
|
|
14
|
+
RANDOM = "random",
|
|
15
|
+
FLOW = "flow",
|
|
16
|
+
EXIT = "exit",
|
|
17
|
+
API = "api",
|
|
18
|
+
/** @deprecated Will be removed soon */
|
|
19
|
+
GOOGLE_SHEETS = "google_sheets",
|
|
20
|
+
CUSTOM_CODE = "custom_code",
|
|
21
|
+
CUSTOM_ACTION = "custom_action",
|
|
22
|
+
START = "start"
|
|
23
|
+
}
|
|
24
|
+
export declare enum GlobalLogKind {
|
|
25
|
+
CONVERSATION_START = "conversation_start"
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalLogKind = exports.StepLogKind = void 0;
|
|
4
|
+
/** Similar to {@link NodeType}, but for runtime logging */
|
|
5
|
+
var StepLogKind;
|
|
6
|
+
(function (StepLogKind) {
|
|
7
|
+
// Response
|
|
8
|
+
StepLogKind["TEXT"] = "text";
|
|
9
|
+
StepLogKind["SPEAK"] = "speak";
|
|
10
|
+
StepLogKind["AUDIO"] = "audio";
|
|
11
|
+
StepLogKind["VISUALS"] = "visuals";
|
|
12
|
+
// User input
|
|
13
|
+
StepLogKind["BUTTONS"] = "buttons";
|
|
14
|
+
StepLogKind["CHOICE"] = "choice";
|
|
15
|
+
StepLogKind["CAPTURE"] = "capture";
|
|
16
|
+
StepLogKind["PROMPT"] = "prompt";
|
|
17
|
+
StepLogKind["INTENT"] = "intent";
|
|
18
|
+
// Logic
|
|
19
|
+
StepLogKind["CONDITION"] = "condition";
|
|
20
|
+
StepLogKind["SET"] = "set";
|
|
21
|
+
StepLogKind["RANDOM"] = "random";
|
|
22
|
+
StepLogKind["FLOW"] = "flow";
|
|
23
|
+
StepLogKind["EXIT"] = "exit";
|
|
24
|
+
// Integration
|
|
25
|
+
StepLogKind["API"] = "api";
|
|
26
|
+
/** @deprecated Will be removed soon */
|
|
27
|
+
StepLogKind["GOOGLE_SHEETS"] = "google_sheets";
|
|
28
|
+
StepLogKind["CUSTOM_CODE"] = "custom_code";
|
|
29
|
+
StepLogKind["CUSTOM_ACTION"] = "custom_action";
|
|
30
|
+
// Special
|
|
31
|
+
StepLogKind["START"] = "start";
|
|
32
|
+
})(StepLogKind = exports.StepLogKind || (exports.StepLogKind = {}));
|
|
33
|
+
var GlobalLogKind;
|
|
34
|
+
(function (GlobalLogKind) {
|
|
35
|
+
GlobalLogKind["CONVERSATION_START"] = "conversation_start";
|
|
36
|
+
})(GlobalLogKind = exports.GlobalLogKind || (exports.GlobalLogKind = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel["ERROR"] = "error";
|
|
7
|
+
LogLevel["WARN"] = "warn";
|
|
8
|
+
LogLevel["INFO"] = "info";
|
|
9
|
+
LogLevel["VERBOSE"] = "verbose";
|
|
10
|
+
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConversationStartLog } from './global/conversationStart';
|
|
2
|
+
import { ApiStepLog } from './steps/api';
|
|
3
|
+
import { ButtonsStepLog } from './steps/buttons';
|
|
4
|
+
import { CaptureStepLog } from './steps/capture';
|
|
5
|
+
import { CodeStepLog } from './steps/code';
|
|
6
|
+
import { ConditionStepLog } from './steps/condition';
|
|
7
|
+
import { CustomActionStepLog } from './steps/customAction';
|
|
8
|
+
import { ExitStepLog } from './steps/exit';
|
|
9
|
+
import { FlowStepLog } from './steps/flow';
|
|
10
|
+
import { IntentStepLog } from './steps/intent';
|
|
11
|
+
import { RandomStepLog } from './steps/random';
|
|
12
|
+
import { SetStepLog } from './steps/set';
|
|
13
|
+
import { SpeakStepLog } from './steps/speak';
|
|
14
|
+
import { StartStepLog } from './steps/start';
|
|
15
|
+
import { TextStepLog } from './steps/text';
|
|
16
|
+
export { ApiStepLog, ButtonsStepLog, CaptureStepLog, CodeStepLog, ConditionStepLog, ConversationStartLog, CustomActionStepLog, ExitStepLog, FlowStepLog, IntentStepLog, RandomStepLog, SetStepLog, SpeakStepLog, StartStepLog, TextStepLog, };
|
|
17
|
+
/** All possible runtime logs for global events. */
|
|
18
|
+
export declare type GlobalLog = ConversationStartLog;
|
|
19
|
+
/** All possible runtime logs for steps. */
|
|
20
|
+
export declare type StepLog = ApiStepLog | ButtonsStepLog | CaptureStepLog | CodeStepLog | ConditionStepLog | CustomActionStepLog | ExitStepLog | FlowStepLog | IntentStepLog | RandomStepLog | SetStepLog | SpeakStepLog | StartStepLog | TextStepLog;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIBodyType, APIMethod } from "../../../node/api";
|
|
2
|
-
import { LoggingNodeType, LogLevel } from '../../utils';
|
|
3
2
|
import { BaseStepLog } from '../base';
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
import { LogLevel } from '../levels';
|
|
4
5
|
interface ApiLogMessage {
|
|
5
6
|
request: {
|
|
6
7
|
method: APIMethod;
|
|
@@ -29,5 +30,5 @@ interface VerboseApiLogMessage {
|
|
|
29
30
|
body: string;
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
export declare type ApiStepLog = BaseStepLog<
|
|
33
|
+
export declare type ApiStepLog = BaseStepLog<StepLogKind.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<StepLogKind.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
|
|
33
34
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Nullable } from '@voiceflow/common';
|
|
2
|
-
import {
|
|
2
|
+
import { PathReference } from '../../utils';
|
|
3
3
|
import { BaseStepLog } from '../base';
|
|
4
|
+
import { StepLogKind } from '../kinds';
|
|
4
5
|
interface UrlButtonLogMessage {
|
|
5
6
|
url: Nullable<string>;
|
|
6
7
|
}
|
|
@@ -12,5 +13,5 @@ interface GoToIntentButtonLogMessage extends UrlButtonLogMessage {
|
|
|
12
13
|
intent: string;
|
|
13
14
|
path: null;
|
|
14
15
|
}
|
|
15
|
-
export declare type ButtonsStepLog = BaseStepLog<
|
|
16
|
+
export declare type ButtonsStepLog = BaseStepLog<StepLogKind.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
|
|
16
17
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoggingNodeType } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type CaptureStepLog = BaseStepLog<StepLogKind.CAPTURE, {
|
|
4
4
|
slots: Array<{
|
|
5
5
|
utteredValue: string;
|
|
6
6
|
canonicalValue: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { LoggingNodeType, LogLevel } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
import { LogLevel } from '../levels';
|
|
4
|
+
export declare type CodeStepLog = BaseStepLog<StepLogKind.CUSTOM_CODE, {
|
|
4
5
|
data: any;
|
|
5
6
|
error: null;
|
|
6
|
-
}, LogLevel.INFO> | BaseStepLog<
|
|
7
|
+
}, LogLevel.INFO> | BaseStepLog<StepLogKind.CUSTOM_CODE, {
|
|
7
8
|
data: null;
|
|
8
9
|
error: any;
|
|
9
10
|
}, LogLevel.ERROR>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PathReference } from '../../utils';
|
|
2
2
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
export declare type ConditionStepLog = BaseStepLog<StepLogKind.CONDITION, {
|
|
4
5
|
path: PathReference;
|
|
5
6
|
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Nullable } from '@voiceflow/common';
|
|
2
|
-
import {
|
|
2
|
+
import { PathReference } from '../../utils';
|
|
3
3
|
import { BaseStepLog } from '../base';
|
|
4
|
-
|
|
4
|
+
import { StepLogKind } from '../kinds';
|
|
5
|
+
export declare type CustomActionStepLog = BaseStepLog<StepLogKind.CUSTOM_ACTION, {
|
|
5
6
|
actionBody: Nullable<string>;
|
|
6
7
|
path: PathReference;
|
|
7
8
|
}>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EmptyObject } from '@voiceflow/common';
|
|
2
|
-
import { LoggingNodeType } from '../../utils';
|
|
3
2
|
import { BaseStepLog } from '../base';
|
|
4
|
-
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
import { LogLevel } from '../levels';
|
|
5
|
+
export declare type ExitStepLog = BaseStepLog<StepLogKind.EXIT, {
|
|
6
|
+
state: null;
|
|
7
|
+
}, LogLevel.INFO> | BaseStepLog<StepLogKind.EXIT, {
|
|
5
8
|
/** The state of the program on exit. */
|
|
6
9
|
state: EmptyObject;
|
|
7
|
-
}>;
|
|
10
|
+
}, LogLevel.VERBOSE>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PathReference } from '../../utils';
|
|
2
2
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
export declare type FlowStepLog = BaseStepLog<StepLogKind.FLOW, {
|
|
4
5
|
path: PathReference;
|
|
5
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoggingNodeType } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type IntentStepLog = BaseStepLog<StepLogKind.INTENT, {
|
|
4
4
|
intentName: string;
|
|
5
5
|
utterance: string;
|
|
6
6
|
confidence: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PathReference } from '../../utils';
|
|
2
2
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
export declare type RandomStepLog = BaseStepLog<StepLogKind.RANDOM, {
|
|
4
5
|
path: PathReference;
|
|
5
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoggingNodeType } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type SetStepLog = BaseStepLog<StepLogKind.SET, {
|
|
4
4
|
variableName: string;
|
|
5
5
|
expression: string;
|
|
6
6
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoggingNodeType } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type SpeakStepLog = BaseStepLog<StepLogKind.SPEAK, {
|
|
4
4
|
text: string;
|
|
5
5
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EmptyObject } from '@voiceflow/common';
|
|
2
|
-
import { LoggingNodeType } from '../../utils';
|
|
3
2
|
import { BaseStepLog } from '../base';
|
|
4
|
-
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
export declare type StartStepLog = BaseStepLog<StepLogKind.START, EmptyObject>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoggingNodeType } from '../../utils';
|
|
2
1
|
import { BaseStepLog } from '../base';
|
|
3
|
-
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type TextStepLog = BaseStepLog<StepLogKind.TEXT, {
|
|
4
4
|
text: string;
|
|
5
5
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './logBuffer';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./logBuffer"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Log } from '../logs';
|
|
2
|
+
/**
|
|
3
|
+
* It acts as a buffer in between the runtime which produces the logs and the service/datastore which consumes the logs.
|
|
4
|
+
* In practice, this will almost always be implemented as part of the runtime itself.
|
|
5
|
+
*/
|
|
6
|
+
export interface LogBuffer {
|
|
7
|
+
/** The number of {@link Log} in this {@link LogBuffer}'s buffer. */
|
|
8
|
+
readonly bufferSize: number;
|
|
9
|
+
/** Add {@link Log} to this {@link LogBuffer}'s buffer. */
|
|
10
|
+
push(...logs: Log[]): void;
|
|
11
|
+
/** Dispatch all {@link Log} from this {@link LogBuffer}'s buffer and then remove them. */
|
|
12
|
+
flush(): void;
|
|
13
|
+
/** Remove all {@link Log} from this {@link LogBuffer}'s buffer. */
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
export interface AsyncLogBuffer extends LogBuffer {
|
|
17
|
+
flush(): void | Promise<void>;
|
|
18
|
+
clear(): void | Promise<void>;
|
|
19
|
+
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
ERROR = "error",
|
|
3
|
-
WARN = "warn",
|
|
4
|
-
INFO = "info",
|
|
5
|
-
VERBOSE = "verbose"
|
|
6
|
-
}
|
|
1
|
+
import { LogLevel } from '../logs/levels';
|
|
7
2
|
/** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
|
|
8
3
|
export declare const getValueForLogLevel: (level: LogLevel) => number;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValueForLogLevel =
|
|
4
|
-
|
|
5
|
-
(function (LogLevel) {
|
|
6
|
-
LogLevel["ERROR"] = "error";
|
|
7
|
-
LogLevel["WARN"] = "warn";
|
|
8
|
-
LogLevel["INFO"] = "info";
|
|
9
|
-
LogLevel["VERBOSE"] = "verbose";
|
|
10
|
-
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
3
|
+
exports.getValueForLogLevel = void 0;
|
|
4
|
+
const levels_1 = require("../logs/levels");
|
|
11
5
|
const logLevelValues = {
|
|
12
|
-
[LogLevel.ERROR]: 0,
|
|
13
|
-
[LogLevel.WARN]: 1,
|
|
14
|
-
[LogLevel.INFO]: 2,
|
|
15
|
-
[LogLevel.VERBOSE]: 3,
|
|
6
|
+
[levels_1.LogLevel.ERROR]: 0,
|
|
7
|
+
[levels_1.LogLevel.WARN]: 1,
|
|
8
|
+
[levels_1.LogLevel.INFO]: 2,
|
|
9
|
+
[levels_1.LogLevel.VERBOSE]: 3,
|
|
16
10
|
};
|
|
17
11
|
/** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
|
|
18
12
|
const getValueForLogLevel = (level) => logLevelValues[level];
|
|
@@ -1,32 +1,7 @@
|
|
|
1
|
+
import { StepLogKind } from '../logs/kinds';
|
|
1
2
|
export declare type Iso8601Timestamp = string;
|
|
2
|
-
/** Similar to {@link NodeType}, but for runtime logging */
|
|
3
|
-
export declare enum LoggingNodeType {
|
|
4
|
-
TEXT = "text",
|
|
5
|
-
SPEAK = "speak",
|
|
6
|
-
AUDIO = "audio",
|
|
7
|
-
VISUALS = "visuals",
|
|
8
|
-
BUTTONS = "buttons",
|
|
9
|
-
CHOICE = "choice",
|
|
10
|
-
CAPTURE = "capture",
|
|
11
|
-
PROMPT = "prompt",
|
|
12
|
-
INTENT = "intent",
|
|
13
|
-
CONDITION = "condition",
|
|
14
|
-
SET = "set",
|
|
15
|
-
RANDOM = "random",
|
|
16
|
-
FLOW = "flow",
|
|
17
|
-
EXIT = "exit",
|
|
18
|
-
API = "api",
|
|
19
|
-
/** @deprecated Will be removed soon */
|
|
20
|
-
GOOGLE_SHEETS = "google_sheets",
|
|
21
|
-
CUSTOM_CODE = "custom_code",
|
|
22
|
-
CUSTOM_ACTION = "custom_action",
|
|
23
|
-
START = "start"
|
|
24
|
-
}
|
|
25
|
-
export declare enum GlobalLogKinds {
|
|
26
|
-
CONVERSATION_START = "conversation_start"
|
|
27
|
-
}
|
|
28
3
|
/** A reference to a path on the canvas. */
|
|
29
4
|
export interface PathReference {
|
|
30
|
-
componentName:
|
|
5
|
+
componentName: StepLogKind;
|
|
31
6
|
stepID: string;
|
|
32
7
|
}
|
|
@@ -1,36 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalLogKinds = exports.LoggingNodeType = void 0;
|
|
4
|
-
/** Similar to {@link NodeType}, but for runtime logging */
|
|
5
|
-
var LoggingNodeType;
|
|
6
|
-
(function (LoggingNodeType) {
|
|
7
|
-
// Response
|
|
8
|
-
LoggingNodeType["TEXT"] = "text";
|
|
9
|
-
LoggingNodeType["SPEAK"] = "speak";
|
|
10
|
-
LoggingNodeType["AUDIO"] = "audio";
|
|
11
|
-
LoggingNodeType["VISUALS"] = "visuals";
|
|
12
|
-
// User input
|
|
13
|
-
LoggingNodeType["BUTTONS"] = "buttons";
|
|
14
|
-
LoggingNodeType["CHOICE"] = "choice";
|
|
15
|
-
LoggingNodeType["CAPTURE"] = "capture";
|
|
16
|
-
LoggingNodeType["PROMPT"] = "prompt";
|
|
17
|
-
LoggingNodeType["INTENT"] = "intent";
|
|
18
|
-
// Logic
|
|
19
|
-
LoggingNodeType["CONDITION"] = "condition";
|
|
20
|
-
LoggingNodeType["SET"] = "set";
|
|
21
|
-
LoggingNodeType["RANDOM"] = "random";
|
|
22
|
-
LoggingNodeType["FLOW"] = "flow";
|
|
23
|
-
LoggingNodeType["EXIT"] = "exit";
|
|
24
|
-
// Integration
|
|
25
|
-
LoggingNodeType["API"] = "api";
|
|
26
|
-
/** @deprecated Will be removed soon */
|
|
27
|
-
LoggingNodeType["GOOGLE_SHEETS"] = "google_sheets";
|
|
28
|
-
LoggingNodeType["CUSTOM_CODE"] = "custom_code";
|
|
29
|
-
LoggingNodeType["CUSTOM_ACTION"] = "custom_action";
|
|
30
|
-
// Special
|
|
31
|
-
LoggingNodeType["START"] = "start";
|
|
32
|
-
})(LoggingNodeType = exports.LoggingNodeType || (exports.LoggingNodeType = {}));
|
|
33
|
-
var GlobalLogKinds;
|
|
34
|
-
(function (GlobalLogKinds) {
|
|
35
|
-
GlobalLogKinds["CONVERSATION_START"] = "conversation_start";
|
|
36
|
-
})(GlobalLogKinds = exports.GlobalLogKinds || (exports.GlobalLogKinds = {}));
|
|
@@ -7,6 +7,7 @@ import { TraceFrame as TextTrace } from "../node/text";
|
|
|
7
7
|
import { BaseTraceFrame, TraceType } from "../node/utils";
|
|
8
8
|
import { TraceFrame as VisualTrace } from "../node/visual";
|
|
9
9
|
import { IntentRequest } from "../request";
|
|
10
|
+
import { Log as RuntimeLog } from "../runtimeLogs";
|
|
10
11
|
export { TraceFrame as ExitTrace } from "../node/exit";
|
|
11
12
|
export { TraceFrame as FlowTrace } from "../node/flow";
|
|
12
13
|
export { TraceFrame as ChoiceTrace } from "../node/interaction";
|
|
@@ -53,4 +54,8 @@ export interface EntityFillingTracePayload {
|
|
|
53
54
|
export interface EntityFillingTrace extends BaseTraceFrame<EntityFillingTracePayload> {
|
|
54
55
|
type: TraceType.ENTITY_FILLING;
|
|
55
56
|
}
|
|
56
|
-
export declare type
|
|
57
|
+
export declare type LogTracePayload = RuntimeLog;
|
|
58
|
+
export interface LogTrace extends BaseTraceFrame<LogTracePayload> {
|
|
59
|
+
type: TraceType.LOG;
|
|
60
|
+
}
|
|
61
|
+
export declare type AnyTrace = ExitTrace | TextTrace | GoToTrace | FlowTrace | SpeakTrace | BlockTrace | DebugTrace | ChoiceTrace | StreamTrace | VisualTrace | NoReplyTrace | EntityFillingTrace | LogTrace;
|