@voiceflow/base-types 2.25.3 → 2.26.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.
Files changed (89) hide show
  1. package/build/common/index.d.ts +1 -0
  2. package/build/common/index.js +2 -1
  3. package/build/common/runtimeLogs/index.d.ts +1 -0
  4. package/build/common/runtimeLogs/index.js +13 -0
  5. package/build/common/runtimeLogs/logs/base.d.ts +21 -0
  6. package/build/common/runtimeLogs/logs/base.js +2 -0
  7. package/build/common/runtimeLogs/logs/global/conversationStart.d.ts +6 -0
  8. package/build/common/runtimeLogs/logs/global/conversationStart.js +2 -0
  9. package/build/common/runtimeLogs/logs/index.d.ts +23 -0
  10. package/build/common/runtimeLogs/logs/index.js +13 -0
  11. package/build/common/runtimeLogs/logs/steps/api.d.ts +33 -0
  12. package/build/common/runtimeLogs/logs/steps/api.js +2 -0
  13. package/build/common/runtimeLogs/logs/steps/buttons.d.ts +16 -0
  14. package/build/common/runtimeLogs/logs/steps/buttons.js +2 -0
  15. package/build/common/runtimeLogs/logs/steps/capture.d.ts +8 -0
  16. package/build/common/runtimeLogs/logs/steps/capture.js +2 -0
  17. package/build/common/runtimeLogs/logs/steps/code.d.ts +9 -0
  18. package/build/common/runtimeLogs/logs/steps/code.js +2 -0
  19. package/build/common/runtimeLogs/logs/steps/condition.d.ts +5 -0
  20. package/build/common/runtimeLogs/logs/steps/condition.js +2 -0
  21. package/build/common/runtimeLogs/logs/steps/customAction.d.ts +7 -0
  22. package/build/common/runtimeLogs/logs/steps/customAction.js +2 -0
  23. package/build/common/runtimeLogs/logs/steps/exit.d.ts +7 -0
  24. package/build/common/runtimeLogs/logs/steps/exit.js +2 -0
  25. package/build/common/runtimeLogs/logs/steps/flow.d.ts +5 -0
  26. package/build/common/runtimeLogs/logs/steps/flow.js +2 -0
  27. package/build/common/runtimeLogs/logs/steps/intent.d.ts +11 -0
  28. package/build/common/runtimeLogs/logs/steps/intent.js +2 -0
  29. package/build/common/runtimeLogs/logs/steps/random.d.ts +5 -0
  30. package/build/common/runtimeLogs/logs/steps/random.js +2 -0
  31. package/build/common/runtimeLogs/logs/steps/set.d.ts +6 -0
  32. package/build/common/runtimeLogs/logs/steps/set.js +2 -0
  33. package/build/common/runtimeLogs/logs/steps/speak.d.ts +5 -0
  34. package/build/common/runtimeLogs/logs/steps/speak.js +2 -0
  35. package/build/common/runtimeLogs/logs/steps/start.d.ts +4 -0
  36. package/build/common/runtimeLogs/logs/steps/start.js +2 -0
  37. package/build/common/runtimeLogs/logs/steps/text.d.ts +5 -0
  38. package/build/common/runtimeLogs/logs/steps/text.js +2 -0
  39. package/build/common/runtimeLogs/utils/index.d.ts +2 -0
  40. package/build/common/runtimeLogs/utils/index.js +14 -0
  41. package/build/common/runtimeLogs/utils/logs.d.ts +8 -0
  42. package/build/common/runtimeLogs/utils/logs.js +19 -0
  43. package/build/common/runtimeLogs/utils/types.d.ts +32 -0
  44. package/build/common/runtimeLogs/utils/types.js +36 -0
  45. package/build/esm/index.d.ts +1 -0
  46. package/build/esm/index.js +1 -0
  47. package/build/esm/runtimeLogs/index.d.ts +1 -0
  48. package/build/esm/runtimeLogs/index.js +1 -0
  49. package/build/esm/runtimeLogs/logs/base.d.ts +21 -0
  50. package/build/esm/runtimeLogs/logs/base.js +1 -0
  51. package/build/esm/runtimeLogs/logs/global/conversationStart.d.ts +6 -0
  52. package/build/esm/runtimeLogs/logs/global/conversationStart.js +1 -0
  53. package/build/esm/runtimeLogs/logs/index.d.ts +23 -0
  54. package/build/esm/runtimeLogs/logs/index.js +1 -0
  55. package/build/esm/runtimeLogs/logs/steps/api.d.ts +33 -0
  56. package/build/esm/runtimeLogs/logs/steps/api.js +1 -0
  57. package/build/esm/runtimeLogs/logs/steps/buttons.d.ts +16 -0
  58. package/build/esm/runtimeLogs/logs/steps/buttons.js +1 -0
  59. package/build/esm/runtimeLogs/logs/steps/capture.d.ts +8 -0
  60. package/build/esm/runtimeLogs/logs/steps/capture.js +1 -0
  61. package/build/esm/runtimeLogs/logs/steps/code.d.ts +9 -0
  62. package/build/esm/runtimeLogs/logs/steps/code.js +1 -0
  63. package/build/esm/runtimeLogs/logs/steps/condition.d.ts +5 -0
  64. package/build/esm/runtimeLogs/logs/steps/condition.js +1 -0
  65. package/build/esm/runtimeLogs/logs/steps/customAction.d.ts +7 -0
  66. package/build/esm/runtimeLogs/logs/steps/customAction.js +1 -0
  67. package/build/esm/runtimeLogs/logs/steps/exit.d.ts +7 -0
  68. package/build/esm/runtimeLogs/logs/steps/exit.js +1 -0
  69. package/build/esm/runtimeLogs/logs/steps/flow.d.ts +5 -0
  70. package/build/esm/runtimeLogs/logs/steps/flow.js +1 -0
  71. package/build/esm/runtimeLogs/logs/steps/intent.d.ts +11 -0
  72. package/build/esm/runtimeLogs/logs/steps/intent.js +1 -0
  73. package/build/esm/runtimeLogs/logs/steps/random.d.ts +5 -0
  74. package/build/esm/runtimeLogs/logs/steps/random.js +1 -0
  75. package/build/esm/runtimeLogs/logs/steps/set.d.ts +6 -0
  76. package/build/esm/runtimeLogs/logs/steps/set.js +1 -0
  77. package/build/esm/runtimeLogs/logs/steps/speak.d.ts +5 -0
  78. package/build/esm/runtimeLogs/logs/steps/speak.js +1 -0
  79. package/build/esm/runtimeLogs/logs/steps/start.d.ts +4 -0
  80. package/build/esm/runtimeLogs/logs/steps/start.js +1 -0
  81. package/build/esm/runtimeLogs/logs/steps/text.d.ts +5 -0
  82. package/build/esm/runtimeLogs/logs/steps/text.js +1 -0
  83. package/build/esm/runtimeLogs/utils/index.d.ts +2 -0
  84. package/build/esm/runtimeLogs/utils/index.js +2 -0
  85. package/build/esm/runtimeLogs/utils/logs.d.ts +8 -0
  86. package/build/esm/runtimeLogs/utils/logs.js +15 -0
  87. package/build/esm/runtimeLogs/utils/types.d.ts +32 -0
  88. package/build/esm/runtimeLogs/utils/types.js +33 -0
  89. package/package.json +2 -2
@@ -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';
@@ -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"));
@@ -0,0 +1 @@
1
+ export * from './logs';
@@ -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("./logs"), exports);
@@ -0,0 +1,21 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { GlobalLogKinds, Iso8601Timestamp, LoggingNodeType, PathReference } from '../utils';
3
+ import { LogLevel } from '../utils/logs';
4
+ /** The base log interface. This should not be used directly, use one of the subtypes instead. */
5
+ interface BaseLog {
6
+ kind: string;
7
+ timestamp: Iso8601Timestamp;
8
+ message: EmptyObject;
9
+ level: LogLevel;
10
+ }
11
+ export interface BaseGlobalLog<Kind extends GlobalLogKinds, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
12
+ kind: `global.${Kind}`;
13
+ level: Level;
14
+ message: Message;
15
+ }
16
+ export interface BaseStepLog<Kind extends LoggingNodeType, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
17
+ kind: `step.${Kind}`;
18
+ level: Level;
19
+ message: PathReference & Message;
20
+ }
21
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { GlobalLogKinds } from "../../utils";
2
+ import { BaseGlobalLog } from '../base';
3
+ export declare type ConversationStartLog = BaseGlobalLog<GlobalLogKinds.CONVERSATION_START, {
4
+ versionID: string;
5
+ userID: string;
6
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
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 * 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;
22
+ /** All possible runtime logs. */
23
+ export declare type Log = GlobalLog | StepLog;
@@ -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("./global/conversationStart"), exports);
@@ -0,0 +1,33 @@
1
+ import { APIBodyType, APIMethod } from "../../../node/api";
2
+ import { LoggingNodeType, LogLevel } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ interface ApiLogMessage {
5
+ request: {
6
+ method: APIMethod;
7
+ url: string;
8
+ };
9
+ response: {
10
+ statusCode: number;
11
+ statusMessage: string;
12
+ };
13
+ }
14
+ interface VerboseApiLogMessage {
15
+ request: {
16
+ headers: Record<string, string>;
17
+ query: Record<string, string>;
18
+ } & ({
19
+ method: Exclude<APIMethod, APIMethod.GET>;
20
+ bodyType: APIBodyType;
21
+ body: string;
22
+ } | {
23
+ method: APIMethod.GET;
24
+ bodyType: null;
25
+ body: null;
26
+ });
27
+ response: {
28
+ headers: Record<string, string>;
29
+ body: string;
30
+ };
31
+ }
32
+ export declare type ApiStepLog = BaseStepLog<LoggingNodeType.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<LoggingNodeType.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
33
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { Nullable } from '@voiceflow/common';
2
+ import { LoggingNodeType, PathReference } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ interface UrlButtonLogMessage {
5
+ url: Nullable<string>;
6
+ }
7
+ interface FollowPathButtonLogMessage extends UrlButtonLogMessage {
8
+ intent: null;
9
+ path: PathReference;
10
+ }
11
+ interface GoToIntentButtonLogMessage extends UrlButtonLogMessage {
12
+ intent: string;
13
+ path: null;
14
+ }
15
+ export declare type ButtonsStepLog = BaseStepLog<LoggingNodeType.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type CaptureStepLog = BaseStepLog<LoggingNodeType.CAPTURE, {
4
+ slots: Array<{
5
+ utteredValue: string;
6
+ canonicalValue: string;
7
+ }>;
8
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { LoggingNodeType, LogLevel } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type CodeStepLog = BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
4
+ data: any;
5
+ error: null;
6
+ }, LogLevel.INFO> | BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
7
+ data: null;
8
+ error: any;
9
+ }, LogLevel.ERROR>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type ConditionStepLog = BaseStepLog<LoggingNodeType.CONDITION, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { Nullable } from '@voiceflow/common';
2
+ import { LoggingNodeType, PathReference } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type CustomActionStepLog = BaseStepLog<LoggingNodeType.CUSTOM_ACTION, {
5
+ actionBody: Nullable<string>;
6
+ path: PathReference;
7
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { LoggingNodeType } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type ExitStepLog = BaseStepLog<LoggingNodeType.EXIT, {
5
+ /** The state of the program on exit. */
6
+ state: EmptyObject;
7
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type FlowStepLog = BaseStepLog<LoggingNodeType.FLOW, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type IntentStepLog = BaseStepLog<LoggingNodeType.INTENT, {
4
+ intentName: string;
5
+ utterance: string;
6
+ confidence: number;
7
+ slots: Array<{
8
+ utteredValue: string;
9
+ canonicalValue: string;
10
+ }>;
11
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type RandomStepLog = BaseStepLog<LoggingNodeType.RANDOM, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type SetStepLog = BaseStepLog<LoggingNodeType.SET, {
4
+ variableName: string;
5
+ expression: string;
6
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type SpeakStepLog = BaseStepLog<LoggingNodeType.SPEAK, {
4
+ text: string;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { LoggingNodeType } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type StartStepLog = BaseStepLog<LoggingNodeType.START, EmptyObject>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type TextStepLog = BaseStepLog<LoggingNodeType.TEXT, {
4
+ text: string;
5
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './logs';
2
+ export * from './types';
@@ -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,8 @@
1
+ export declare enum LogLevel {
2
+ ERROR = "error",
3
+ WARN = "warn",
4
+ INFO = "info",
5
+ VERBOSE = "verbose"
6
+ }
7
+ /** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
8
+ export declare const getValueForLogLevel: (level: LogLevel) => number;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValueForLogLevel = 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 = {}));
11
+ const logLevelValues = {
12
+ [LogLevel.ERROR]: 0,
13
+ [LogLevel.WARN]: 1,
14
+ [LogLevel.INFO]: 2,
15
+ [LogLevel.VERBOSE]: 3,
16
+ };
17
+ /** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
18
+ const getValueForLogLevel = (level) => logLevelValues[level];
19
+ exports.getValueForLogLevel = getValueForLogLevel;
@@ -0,0 +1,32 @@
1
+ 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
+ /** A reference to a path on the canvas. */
29
+ export interface PathReference {
30
+ componentName: LoggingNodeType;
31
+ stepID: string;
32
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
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 = {}));
@@ -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';
@@ -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';
@@ -0,0 +1 @@
1
+ export * from './logs';
@@ -0,0 +1 @@
1
+ export * from './logs';
@@ -0,0 +1,21 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { GlobalLogKinds, Iso8601Timestamp, LoggingNodeType, PathReference } from '../utils';
3
+ import { LogLevel } from '../utils/logs';
4
+ /** The base log interface. This should not be used directly, use one of the subtypes instead. */
5
+ interface BaseLog {
6
+ kind: string;
7
+ timestamp: Iso8601Timestamp;
8
+ message: EmptyObject;
9
+ level: LogLevel;
10
+ }
11
+ export interface BaseGlobalLog<Kind extends GlobalLogKinds, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
12
+ kind: `global.${Kind}`;
13
+ level: Level;
14
+ message: Message;
15
+ }
16
+ export interface BaseStepLog<Kind extends LoggingNodeType, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
17
+ kind: `step.${Kind}`;
18
+ level: Level;
19
+ message: PathReference & Message;
20
+ }
21
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { GlobalLogKinds } from "../../utils";
2
+ import { BaseGlobalLog } from '../base';
3
+ export declare type ConversationStartLog = BaseGlobalLog<GlobalLogKinds.CONVERSATION_START, {
4
+ versionID: string;
5
+ userID: string;
6
+ }>;
@@ -0,0 +1,23 @@
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 * 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;
22
+ /** All possible runtime logs. */
23
+ export declare type Log = GlobalLog | StepLog;
@@ -0,0 +1 @@
1
+ export * from './global/conversationStart';
@@ -0,0 +1,33 @@
1
+ import { APIBodyType, APIMethod } from "../../../node/api";
2
+ import { LoggingNodeType, LogLevel } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ interface ApiLogMessage {
5
+ request: {
6
+ method: APIMethod;
7
+ url: string;
8
+ };
9
+ response: {
10
+ statusCode: number;
11
+ statusMessage: string;
12
+ };
13
+ }
14
+ interface VerboseApiLogMessage {
15
+ request: {
16
+ headers: Record<string, string>;
17
+ query: Record<string, string>;
18
+ } & ({
19
+ method: Exclude<APIMethod, APIMethod.GET>;
20
+ bodyType: APIBodyType;
21
+ body: string;
22
+ } | {
23
+ method: APIMethod.GET;
24
+ bodyType: null;
25
+ body: null;
26
+ });
27
+ response: {
28
+ headers: Record<string, string>;
29
+ body: string;
30
+ };
31
+ }
32
+ export declare type ApiStepLog = BaseStepLog<LoggingNodeType.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<LoggingNodeType.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
33
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Nullable } from '@voiceflow/common';
2
+ import { LoggingNodeType, PathReference } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ interface UrlButtonLogMessage {
5
+ url: Nullable<string>;
6
+ }
7
+ interface FollowPathButtonLogMessage extends UrlButtonLogMessage {
8
+ intent: null;
9
+ path: PathReference;
10
+ }
11
+ interface GoToIntentButtonLogMessage extends UrlButtonLogMessage {
12
+ intent: string;
13
+ path: null;
14
+ }
15
+ export declare type ButtonsStepLog = BaseStepLog<LoggingNodeType.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
16
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type CaptureStepLog = BaseStepLog<LoggingNodeType.CAPTURE, {
4
+ slots: Array<{
5
+ utteredValue: string;
6
+ canonicalValue: string;
7
+ }>;
8
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { LoggingNodeType, LogLevel } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type CodeStepLog = BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
4
+ data: any;
5
+ error: null;
6
+ }, LogLevel.INFO> | BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
7
+ data: null;
8
+ error: any;
9
+ }, LogLevel.ERROR>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type ConditionStepLog = BaseStepLog<LoggingNodeType.CONDITION, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Nullable } from '@voiceflow/common';
2
+ import { LoggingNodeType, PathReference } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type CustomActionStepLog = BaseStepLog<LoggingNodeType.CUSTOM_ACTION, {
5
+ actionBody: Nullable<string>;
6
+ path: PathReference;
7
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { LoggingNodeType } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type ExitStepLog = BaseStepLog<LoggingNodeType.EXIT, {
5
+ /** The state of the program on exit. */
6
+ state: EmptyObject;
7
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type FlowStepLog = BaseStepLog<LoggingNodeType.FLOW, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type IntentStepLog = BaseStepLog<LoggingNodeType.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 {};
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType, PathReference } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type RandomStepLog = BaseStepLog<LoggingNodeType.RANDOM, {
4
+ path: PathReference;
5
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type SetStepLog = BaseStepLog<LoggingNodeType.SET, {
4
+ variableName: string;
5
+ expression: string;
6
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type SpeakStepLog = BaseStepLog<LoggingNodeType.SPEAK, {
4
+ text: string;
5
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { EmptyObject } from '@voiceflow/common';
2
+ import { LoggingNodeType } from '../../utils';
3
+ import { BaseStepLog } from '../base';
4
+ export declare type StartStepLog = BaseStepLog<LoggingNodeType.START, EmptyObject>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { LoggingNodeType } from '../../utils';
2
+ import { BaseStepLog } from '../base';
3
+ export declare type TextStepLog = BaseStepLog<LoggingNodeType.TEXT, {
4
+ text: string;
5
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './logs';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './logs';
2
+ export * from './types';
@@ -0,0 +1,8 @@
1
+ export declare enum LogLevel {
2
+ ERROR = "error",
3
+ WARN = "warn",
4
+ INFO = "info",
5
+ VERBOSE = "verbose"
6
+ }
7
+ /** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
8
+ export declare const getValueForLogLevel: (level: LogLevel) => number;
@@ -0,0 +1,15 @@
1
+ export var LogLevel;
2
+ (function (LogLevel) {
3
+ LogLevel["ERROR"] = "error";
4
+ LogLevel["WARN"] = "warn";
5
+ LogLevel["INFO"] = "info";
6
+ LogLevel["VERBOSE"] = "verbose";
7
+ })(LogLevel || (LogLevel = {}));
8
+ const logLevelValues = {
9
+ [LogLevel.ERROR]: 0,
10
+ [LogLevel.WARN]: 1,
11
+ [LogLevel.INFO]: 2,
12
+ [LogLevel.VERBOSE]: 3,
13
+ };
14
+ /** Returns the number (non-negative integer) value of `level`. A higher number is more verbose. `0` is the least verbose and most "important". */
15
+ export const getValueForLogLevel = (level) => logLevelValues[level];
@@ -0,0 +1,32 @@
1
+ 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
+ /** A reference to a path on the canvas. */
29
+ export interface PathReference {
30
+ componentName: LoggingNodeType;
31
+ stepID: string;
32
+ }
@@ -0,0 +1,33 @@
1
+ /** Similar to {@link NodeType}, but for runtime logging */
2
+ export var LoggingNodeType;
3
+ (function (LoggingNodeType) {
4
+ // Response
5
+ LoggingNodeType["TEXT"] = "text";
6
+ LoggingNodeType["SPEAK"] = "speak";
7
+ LoggingNodeType["AUDIO"] = "audio";
8
+ LoggingNodeType["VISUALS"] = "visuals";
9
+ // User input
10
+ LoggingNodeType["BUTTONS"] = "buttons";
11
+ LoggingNodeType["CHOICE"] = "choice";
12
+ LoggingNodeType["CAPTURE"] = "capture";
13
+ LoggingNodeType["PROMPT"] = "prompt";
14
+ LoggingNodeType["INTENT"] = "intent";
15
+ // Logic
16
+ LoggingNodeType["CONDITION"] = "condition";
17
+ LoggingNodeType["SET"] = "set";
18
+ LoggingNodeType["RANDOM"] = "random";
19
+ LoggingNodeType["FLOW"] = "flow";
20
+ LoggingNodeType["EXIT"] = "exit";
21
+ // Integration
22
+ LoggingNodeType["API"] = "api";
23
+ /** @deprecated Will be removed soon */
24
+ LoggingNodeType["GOOGLE_SHEETS"] = "google_sheets";
25
+ LoggingNodeType["CUSTOM_CODE"] = "custom_code";
26
+ LoggingNodeType["CUSTOM_ACTION"] = "custom_action";
27
+ // Special
28
+ LoggingNodeType["START"] = "start";
29
+ })(LoggingNodeType || (LoggingNodeType = {}));
30
+ export var GlobalLogKinds;
31
+ (function (GlobalLogKinds) {
32
+ GlobalLogKinds["CONVERSATION_START"] = "conversation_start";
33
+ })(GlobalLogKinds || (GlobalLogKinds = {}));
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.25.3",
4
+ "version": "2.26.0",
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": "cb4e203e5c4c1d59d74b959ab313afe595a81d2f"
46
+ "gitHead": "f079d147cc752ca233177cb1f0a1771a36c88309"
47
47
  }