@voiceflow/base-types 2.25.3 → 2.28.0
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/index.d.ts +1 -0
- package/build/common/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 +3 -0
- package/build/common/runtimeLogs/index.js +14 -0
- package/build/common/runtimeLogs/logs/base.d.ts +22 -0
- package/build/common/runtimeLogs/logs/base.js +2 -0
- package/build/common/runtimeLogs/logs/global/conversationStart.d.ts +6 -0
- package/build/common/runtimeLogs/logs/global/conversationStart.js +2 -0
- package/build/common/runtimeLogs/logs/index.d.ts +6 -0
- package/build/common/runtimeLogs/logs/index.js +27 -0
- 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 +34 -0
- package/build/common/runtimeLogs/logs/steps/api.js +2 -0
- package/build/common/runtimeLogs/logs/steps/buttons.d.ts +17 -0
- package/build/common/runtimeLogs/logs/steps/buttons.js +2 -0
- package/build/common/runtimeLogs/logs/steps/capture.d.ts +8 -0
- package/build/common/runtimeLogs/logs/steps/capture.js +2 -0
- package/build/common/runtimeLogs/logs/steps/code.d.ts +10 -0
- package/build/common/runtimeLogs/logs/steps/code.js +2 -0
- package/build/common/runtimeLogs/logs/steps/condition.d.ts +6 -0
- package/build/common/runtimeLogs/logs/steps/condition.js +2 -0
- package/build/common/runtimeLogs/logs/steps/customAction.d.ts +8 -0
- package/build/common/runtimeLogs/logs/steps/customAction.js +2 -0
- package/build/common/runtimeLogs/logs/steps/exit.d.ts +10 -0
- package/build/common/runtimeLogs/logs/steps/exit.js +2 -0
- package/build/common/runtimeLogs/logs/steps/flow.d.ts +6 -0
- package/build/common/runtimeLogs/logs/steps/flow.js +2 -0
- package/build/common/runtimeLogs/logs/steps/intent.d.ts +11 -0
- package/build/common/runtimeLogs/logs/steps/intent.js +2 -0
- package/build/common/runtimeLogs/logs/steps/random.d.ts +6 -0
- package/build/common/runtimeLogs/logs/steps/random.js +2 -0
- package/build/common/runtimeLogs/logs/steps/set.d.ts +6 -0
- package/build/common/runtimeLogs/logs/steps/set.js +2 -0
- package/build/common/runtimeLogs/logs/steps/speak.d.ts +5 -0
- package/build/common/runtimeLogs/logs/steps/speak.js +2 -0
- package/build/common/runtimeLogs/logs/steps/start.d.ts +4 -0
- package/build/common/runtimeLogs/logs/steps/start.js +2 -0
- package/build/common/runtimeLogs/logs/steps/text.d.ts +5 -0
- package/build/common/runtimeLogs/logs/steps/text.js +2 -0
- 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/index.d.ts +2 -0
- package/build/common/runtimeLogs/utils/index.js +14 -0
- package/build/common/runtimeLogs/utils/logs.d.ts +3 -0
- package/build/common/runtimeLogs/utils/logs.js +13 -0
- package/build/common/runtimeLogs/utils/types.d.ts +7 -0
- package/build/common/runtimeLogs/utils/types.js +2 -0
- package/build/common/trace/index.d.ts +6 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/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 +3 -0
- package/build/esm/runtimeLogs/index.js +2 -0
- package/build/esm/runtimeLogs/logs/base.d.ts +22 -0
- package/build/esm/runtimeLogs/logs/base.js +1 -0
- package/build/esm/runtimeLogs/logs/global/conversationStart.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/global/conversationStart.js +1 -0
- package/build/esm/runtimeLogs/logs/index.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/index.js +4 -0
- 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 +34 -0
- package/build/esm/runtimeLogs/logs/steps/api.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/buttons.d.ts +17 -0
- package/build/esm/runtimeLogs/logs/steps/buttons.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/capture.d.ts +8 -0
- package/build/esm/runtimeLogs/logs/steps/capture.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/code.d.ts +10 -0
- package/build/esm/runtimeLogs/logs/steps/code.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/condition.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/steps/condition.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/customAction.d.ts +8 -0
- package/build/esm/runtimeLogs/logs/steps/customAction.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/exit.d.ts +10 -0
- package/build/esm/runtimeLogs/logs/steps/exit.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/flow.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/steps/flow.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/intent.d.ts +11 -0
- package/build/esm/runtimeLogs/logs/steps/intent.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/random.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/steps/random.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/set.d.ts +6 -0
- package/build/esm/runtimeLogs/logs/steps/set.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/speak.d.ts +5 -0
- package/build/esm/runtimeLogs/logs/steps/speak.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/start.d.ts +4 -0
- package/build/esm/runtimeLogs/logs/steps/start.js +1 -0
- package/build/esm/runtimeLogs/logs/steps/text.d.ts +5 -0
- package/build/esm/runtimeLogs/logs/steps/text.js +1 -0
- 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/index.d.ts +2 -0
- package/build/esm/runtimeLogs/utils/index.js +2 -0
- package/build/esm/runtimeLogs/utils/logs.d.ts +3 -0
- package/build/esm/runtimeLogs/utils/logs.js +9 -0
- package/build/esm/runtimeLogs/utils/types.d.ts +7 -0
- package/build/esm/runtimeLogs/utils/types.js +1 -0
- package/build/esm/trace/index.d.ts +6 -1
- package/package.json +2 -2
package/build/common/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * as Project from './project';
|
|
|
8
8
|
export * as BaseProject from './project';
|
|
9
9
|
export * as Request from './request';
|
|
10
10
|
export * as BaseRequest from './request';
|
|
11
|
+
export * as RuntimeLogs from './runtimeLogs';
|
|
11
12
|
export * as Text from './text';
|
|
12
13
|
export * as BaseText from './text';
|
|
13
14
|
export * as Trace from './trace';
|
package/build/common/index.js
CHANGED
|
@@ -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.VariableState = exports.BaseVersion = exports.Version = exports.BaseUtils = exports.Utils = exports.BaseTrace = exports.Trace = exports.BaseText = exports.Text = exports.BaseRequest = exports.Request = exports.BaseProject = exports.Project = exports.BaseNode = exports.Node = exports.BaseModels = exports.Models = exports.BaseButton = exports.Button = void 0;
|
|
25
|
+
exports.VariableState = exports.BaseVersion = exports.Version = exports.BaseUtils = exports.Utils = exports.BaseTrace = exports.Trace = exports.BaseText = exports.Text = exports.RuntimeLogs = exports.BaseRequest = exports.Request = exports.BaseProject = exports.Project = exports.BaseNode = exports.Node = exports.BaseModels = exports.Models = exports.BaseButton = exports.Button = void 0;
|
|
26
26
|
exports.Button = __importStar(require("./button"));
|
|
27
27
|
exports.BaseButton = __importStar(require("./button"));
|
|
28
28
|
exports.Models = __importStar(require("./models"));
|
|
@@ -33,6 +33,7 @@ exports.Project = __importStar(require("./project"));
|
|
|
33
33
|
exports.BaseProject = __importStar(require("./project"));
|
|
34
34
|
exports.Request = __importStar(require("./request"));
|
|
35
35
|
exports.BaseRequest = __importStar(require("./request"));
|
|
36
|
+
exports.RuntimeLogs = __importStar(require("./runtimeLogs"));
|
|
36
37
|
exports.Text = __importStar(require("./text"));
|
|
37
38
|
exports.BaseText = __importStar(require("./text"));
|
|
38
39
|
exports.Trace = __importStar(require("./trace"));
|
|
@@ -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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./logs"), exports);
|
|
14
|
+
__exportStar(require("./runtime"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EmptyObject } from '@voiceflow/common';
|
|
2
|
+
import { Iso8601Timestamp, PathReference } from '../utils';
|
|
3
|
+
import { GlobalLogKind, StepLogKind } from './kinds';
|
|
4
|
+
import { LogLevel } from './levels';
|
|
5
|
+
/** The base log interface. This should not be used directly, use one of the subtypes instead. */
|
|
6
|
+
interface BaseLog {
|
|
7
|
+
kind: string;
|
|
8
|
+
timestamp: Iso8601Timestamp;
|
|
9
|
+
message: EmptyObject;
|
|
10
|
+
level: LogLevel;
|
|
11
|
+
}
|
|
12
|
+
export interface BaseGlobalLog<Kind extends GlobalLogKind, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
|
|
13
|
+
kind: `global.${Kind}`;
|
|
14
|
+
level: Level;
|
|
15
|
+
message: Message;
|
|
16
|
+
}
|
|
17
|
+
export interface BaseStepLog<Kind extends StepLogKind, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
|
|
18
|
+
kind: `step.${Kind}`;
|
|
19
|
+
level: Level;
|
|
20
|
+
message: PathReference & Message;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
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 __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;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { APIBodyType, APIMethod } from "../../../node/api";
|
|
2
|
+
import { BaseStepLog } from '../base';
|
|
3
|
+
import { StepLogKind } from '../kinds';
|
|
4
|
+
import { LogLevel } from '../levels';
|
|
5
|
+
interface ApiLogMessage {
|
|
6
|
+
request: {
|
|
7
|
+
method: APIMethod;
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
response: {
|
|
11
|
+
statusCode: number;
|
|
12
|
+
statusMessage: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface VerboseApiLogMessage {
|
|
16
|
+
request: {
|
|
17
|
+
headers: Record<string, string>;
|
|
18
|
+
query: Record<string, string>;
|
|
19
|
+
} & ({
|
|
20
|
+
method: Exclude<APIMethod, APIMethod.GET>;
|
|
21
|
+
bodyType: APIBodyType;
|
|
22
|
+
body: string;
|
|
23
|
+
} | {
|
|
24
|
+
method: APIMethod.GET;
|
|
25
|
+
bodyType: null;
|
|
26
|
+
body: null;
|
|
27
|
+
});
|
|
28
|
+
response: {
|
|
29
|
+
headers: Record<string, string>;
|
|
30
|
+
body: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare type ApiStepLog = BaseStepLog<StepLogKind.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<StepLogKind.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Nullable } from '@voiceflow/common';
|
|
2
|
+
import { PathReference } from '../../utils';
|
|
3
|
+
import { BaseStepLog } from '../base';
|
|
4
|
+
import { StepLogKind } from '../kinds';
|
|
5
|
+
interface UrlButtonLogMessage {
|
|
6
|
+
url: Nullable<string>;
|
|
7
|
+
}
|
|
8
|
+
interface FollowPathButtonLogMessage extends UrlButtonLogMessage {
|
|
9
|
+
intent: null;
|
|
10
|
+
path: PathReference;
|
|
11
|
+
}
|
|
12
|
+
interface GoToIntentButtonLogMessage extends UrlButtonLogMessage {
|
|
13
|
+
intent: string;
|
|
14
|
+
path: null;
|
|
15
|
+
}
|
|
16
|
+
export declare type ButtonsStepLog = BaseStepLog<StepLogKind.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseStepLog } from '../base';
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
import { LogLevel } from '../levels';
|
|
4
|
+
export declare type CodeStepLog = BaseStepLog<StepLogKind.CUSTOM_CODE, {
|
|
5
|
+
data: any;
|
|
6
|
+
error: null;
|
|
7
|
+
}, LogLevel.INFO> | BaseStepLog<StepLogKind.CUSTOM_CODE, {
|
|
8
|
+
data: null;
|
|
9
|
+
error: any;
|
|
10
|
+
}, LogLevel.ERROR>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Nullable } from '@voiceflow/common';
|
|
2
|
+
import { PathReference } from '../../utils';
|
|
3
|
+
import { BaseStepLog } from '../base';
|
|
4
|
+
import { StepLogKind } from '../kinds';
|
|
5
|
+
export declare type CustomActionStepLog = BaseStepLog<StepLogKind.CUSTOM_ACTION, {
|
|
6
|
+
actionBody: Nullable<string>;
|
|
7
|
+
path: PathReference;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EmptyObject } from '@voiceflow/common';
|
|
2
|
+
import { BaseStepLog } from '../base';
|
|
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, {
|
|
8
|
+
/** The state of the program on exit. */
|
|
9
|
+
state: EmptyObject;
|
|
10
|
+
}, LogLevel.VERBOSE>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseStepLog } from '../base';
|
|
2
|
+
import { StepLogKind } from '../kinds';
|
|
3
|
+
export declare type IntentStepLog = BaseStepLog<StepLogKind.INTENT, {
|
|
4
|
+
intentName: string;
|
|
5
|
+
utterance: string;
|
|
6
|
+
confidence: number;
|
|
7
|
+
slots: Array<{
|
|
8
|
+
utteredValue: string;
|
|
9
|
+
canonicalValue: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./logs"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValueForLogLevel = void 0;
|
|
4
|
+
const levels_1 = require("../logs/levels");
|
|
5
|
+
const logLevelValues = {
|
|
6
|
+
[levels_1.LogLevel.ERROR]: 0,
|
|
7
|
+
[levels_1.LogLevel.WARN]: 1,
|
|
8
|
+
[levels_1.LogLevel.INFO]: 2,
|
|
9
|
+
[levels_1.LogLevel.VERBOSE]: 3,
|
|
10
|
+
};
|
|
11
|
+
/** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
|
|
12
|
+
const getValueForLogLevel = (level) => logLevelValues[level];
|
|
13
|
+
exports.getValueForLogLevel = getValueForLogLevel;
|
|
@@ -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;
|
package/build/esm/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * as Project from './project';
|
|
|
8
8
|
export * as BaseProject from './project';
|
|
9
9
|
export * as Request from './request';
|
|
10
10
|
export * as BaseRequest from './request';
|
|
11
|
+
export * as RuntimeLogs from './runtimeLogs';
|
|
11
12
|
export * as Text from './text';
|
|
12
13
|
export * as BaseText from './text';
|
|
13
14
|
export * as Trace from './trace';
|
package/build/esm/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * as Project from './project';
|
|
|
8
8
|
export * as BaseProject from './project';
|
|
9
9
|
export * as Request from './request';
|
|
10
10
|
export * as BaseRequest from './request';
|
|
11
|
+
export * as RuntimeLogs from './runtimeLogs';
|
|
11
12
|
export * as Text from './text';
|
|
12
13
|
export * as BaseText from './text';
|
|
13
14
|
export * as Trace from './trace';
|
|
@@ -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;
|