@voiceflow/base-types 2.27.0 → 2.29.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 (71) hide show
  1. package/build/common/models/base/port.d.ts +2 -1
  2. package/build/common/node/index.d.ts +4 -2
  3. package/build/common/node/index.js +2 -1
  4. package/build/common/node/utils/trace.d.ts +2 -1
  5. package/build/common/node/utils/trace.js +1 -0
  6. package/build/common/runtimeLogs/index.d.ts +1 -0
  7. package/build/common/runtimeLogs/logs/base.d.ts +5 -4
  8. package/build/common/runtimeLogs/logs/global/conversationStart.d.ts +2 -2
  9. package/build/common/runtimeLogs/logs/index.d.ts +5 -22
  10. package/build/common/runtimeLogs/logs/index.js +17 -3
  11. package/build/common/runtimeLogs/logs/kinds.d.ts +26 -0
  12. package/build/common/runtimeLogs/logs/kinds.js +36 -0
  13. package/build/common/runtimeLogs/logs/levels.d.ts +6 -0
  14. package/build/common/runtimeLogs/logs/levels.js +10 -0
  15. package/build/common/runtimeLogs/logs/logs.d.ts +20 -0
  16. package/build/common/runtimeLogs/logs/logs.js +2 -0
  17. package/build/common/runtimeLogs/logs/steps/api.d.ts +3 -2
  18. package/build/common/runtimeLogs/logs/steps/buttons.d.ts +3 -2
  19. package/build/common/runtimeLogs/logs/steps/capture.d.ts +2 -2
  20. package/build/common/runtimeLogs/logs/steps/code.d.ts +4 -3
  21. package/build/common/runtimeLogs/logs/steps/condition.d.ts +3 -2
  22. package/build/common/runtimeLogs/logs/steps/customAction.d.ts +3 -2
  23. package/build/common/runtimeLogs/logs/steps/exit.d.ts +6 -3
  24. package/build/common/runtimeLogs/logs/steps/flow.d.ts +3 -2
  25. package/build/common/runtimeLogs/logs/steps/intent.d.ts +2 -2
  26. package/build/common/runtimeLogs/logs/steps/random.d.ts +3 -2
  27. package/build/common/runtimeLogs/logs/steps/set.d.ts +2 -2
  28. package/build/common/runtimeLogs/logs/steps/speak.d.ts +2 -2
  29. package/build/common/runtimeLogs/logs/steps/start.d.ts +2 -2
  30. package/build/common/runtimeLogs/logs/steps/text.d.ts +2 -2
  31. package/build/common/runtimeLogs/utils/logs.d.ts +1 -6
  32. package/build/common/runtimeLogs/utils/logs.js +6 -12
  33. package/build/common/runtimeLogs/utils/types.d.ts +2 -27
  34. package/build/common/runtimeLogs/utils/types.js +0 -34
  35. package/build/common/trace/index.d.ts +6 -1
  36. package/build/esm/models/base/port.d.ts +2 -1
  37. package/build/esm/node/index.d.ts +4 -2
  38. package/build/esm/node/index.js +1 -0
  39. package/build/esm/node/utils/trace.d.ts +2 -1
  40. package/build/esm/node/utils/trace.js +1 -0
  41. package/build/esm/runtimeLogs/index.d.ts +1 -0
  42. package/build/esm/runtimeLogs/logs/base.d.ts +5 -4
  43. package/build/esm/runtimeLogs/logs/global/conversationStart.d.ts +2 -2
  44. package/build/esm/runtimeLogs/logs/index.d.ts +5 -22
  45. package/build/esm/runtimeLogs/logs/index.js +4 -1
  46. package/build/esm/runtimeLogs/logs/kinds.d.ts +26 -0
  47. package/build/esm/runtimeLogs/logs/kinds.js +33 -0
  48. package/build/esm/runtimeLogs/logs/levels.d.ts +6 -0
  49. package/build/esm/runtimeLogs/logs/levels.js +7 -0
  50. package/build/esm/runtimeLogs/logs/logs.d.ts +20 -0
  51. package/build/esm/runtimeLogs/logs/logs.js +1 -0
  52. package/build/esm/runtimeLogs/logs/steps/api.d.ts +3 -2
  53. package/build/esm/runtimeLogs/logs/steps/buttons.d.ts +3 -2
  54. package/build/esm/runtimeLogs/logs/steps/capture.d.ts +2 -2
  55. package/build/esm/runtimeLogs/logs/steps/code.d.ts +4 -3
  56. package/build/esm/runtimeLogs/logs/steps/condition.d.ts +3 -2
  57. package/build/esm/runtimeLogs/logs/steps/customAction.d.ts +3 -2
  58. package/build/esm/runtimeLogs/logs/steps/exit.d.ts +6 -3
  59. package/build/esm/runtimeLogs/logs/steps/flow.d.ts +3 -2
  60. package/build/esm/runtimeLogs/logs/steps/intent.d.ts +2 -2
  61. package/build/esm/runtimeLogs/logs/steps/random.d.ts +3 -2
  62. package/build/esm/runtimeLogs/logs/steps/set.d.ts +2 -2
  63. package/build/esm/runtimeLogs/logs/steps/speak.d.ts +2 -2
  64. package/build/esm/runtimeLogs/logs/steps/start.d.ts +2 -2
  65. package/build/esm/runtimeLogs/logs/steps/text.d.ts +2 -2
  66. package/build/esm/runtimeLogs/utils/logs.d.ts +1 -6
  67. package/build/esm/runtimeLogs/utils/logs.js +1 -7
  68. package/build/esm/runtimeLogs/utils/types.d.ts +2 -27
  69. package/build/esm/runtimeLogs/utils/types.js +1 -33
  70. package/build/esm/trace/index.d.ts +6 -1
  71. package/package.json +3 -3
@@ -12,9 +12,10 @@ export interface BasePort {
12
12
  type: string | PortType;
13
13
  target: Nullable<string>;
14
14
  }
15
- export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[]> {
15
+ export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[], ByKey extends Record<string, BasePort> = Record<string, BasePort>> {
16
16
  builtIn: Builtin;
17
17
  dynamic: Dynamic;
18
+ byKey: ByKey;
18
19
  }
19
20
  export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
20
21
  }
@@ -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;
@@ -16,4 +16,5 @@ var TraceType;
16
16
  TraceType["VISUAL"] = "visual";
17
17
  TraceType["NO_REPLY"] = "no-reply";
18
18
  TraceType["ENTITY_FILLING"] = "entity-filling";
19
+ TraceType["LOG"] = "log";
19
20
  })(TraceType = exports.TraceType || (exports.TraceType = {}));
@@ -1,2 +1,3 @@
1
1
  export * from './logs';
2
2
  export * from './runtime';
3
+ export { Iso8601Timestamp, PathReference } from './utils';
@@ -1,6 +1,7 @@
1
1
  import { EmptyObject } from '@voiceflow/common';
2
- import { GlobalLogKinds, Iso8601Timestamp, LoggingNodeType, PathReference } from '../utils';
3
- import { LogLevel } from '../utils/logs';
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 GlobalLogKinds, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
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 LoggingNodeType, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
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
- export declare type ConversationStartLog = BaseGlobalLog<GlobalLogKinds.CONVERSATION_START, {
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 { 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;
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 __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);
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
- __exportStar(require("./global/conversationStart"), exports);
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,6 @@
1
+ export declare enum LogLevel {
2
+ ERROR = "error",
3
+ WARN = "warn",
4
+ INFO = "info",
5
+ VERBOSE = "verbose"
6
+ }
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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<LoggingNodeType.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<LoggingNodeType.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
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 { LoggingNodeType, PathReference } from '../../utils';
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<LoggingNodeType.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
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
- export declare type CaptureStepLog = BaseStepLog<LoggingNodeType.CAPTURE, {
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
- export declare type CodeStepLog = BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
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<LoggingNodeType.CUSTOM_CODE, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type ConditionStepLog = BaseStepLog<LoggingNodeType.CONDITION, {
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 { LoggingNodeType, PathReference } from '../../utils';
2
+ import { PathReference } from '../../utils';
3
3
  import { BaseStepLog } from '../base';
4
- export declare type CustomActionStepLog = BaseStepLog<LoggingNodeType.CUSTOM_ACTION, {
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
- export declare type ExitStepLog = BaseStepLog<LoggingNodeType.EXIT, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type FlowStepLog = BaseStepLog<LoggingNodeType.FLOW, {
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
- export declare type IntentStepLog = BaseStepLog<LoggingNodeType.INTENT, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type RandomStepLog = BaseStepLog<LoggingNodeType.RANDOM, {
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
- export declare type SetStepLog = BaseStepLog<LoggingNodeType.SET, {
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
- export declare type SpeakStepLog = BaseStepLog<LoggingNodeType.SPEAK, {
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
- export declare type StartStepLog = BaseStepLog<LoggingNodeType.START, EmptyObject>;
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
- export declare type TextStepLog = BaseStepLog<LoggingNodeType.TEXT, {
2
+ import { StepLogKind } from '../kinds';
3
+ export declare type TextStepLog = BaseStepLog<StepLogKind.TEXT, {
4
4
  text: string;
5
5
  }>;
@@ -1,8 +1,3 @@
1
- export declare enum LogLevel {
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 = 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 = {}));
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: LoggingNodeType;
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 AnyTrace = ExitTrace | TextTrace | GoToTrace | FlowTrace | SpeakTrace | BlockTrace | DebugTrace | ChoiceTrace | StreamTrace | VisualTrace | NoReplyTrace | EntityFillingTrace;
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;
@@ -12,9 +12,10 @@ export interface BasePort {
12
12
  type: string | PortType;
13
13
  target: Nullable<string>;
14
14
  }
15
- export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[]> {
15
+ export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[], ByKey extends Record<string, BasePort> = Record<string, BasePort>> {
16
16
  builtIn: Builtin;
17
17
  dynamic: Dynamic;
18
+ byKey: ByKey;
18
19
  }
19
20
  export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
20
21
  }
@@ -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;
@@ -14,6 +14,7 @@ export * as Flow from './flow';
14
14
  export * as General from './general';
15
15
  export * as GoogleSheets from './googleSheets';
16
16
  export * as GoTo from './goTo';
17
+ export * as GoToBlock from './goToBlock';
17
18
  export * as If from './if';
18
19
  export * as IfV2 from './ifV2';
19
20
  export * as Integration from './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;
@@ -13,4 +13,5 @@ export var TraceType;
13
13
  TraceType["VISUAL"] = "visual";
14
14
  TraceType["NO_REPLY"] = "no-reply";
15
15
  TraceType["ENTITY_FILLING"] = "entity-filling";
16
+ TraceType["LOG"] = "log";
16
17
  })(TraceType || (TraceType = {}));
@@ -1,2 +1,3 @@
1
1
  export * from './logs';
2
2
  export * from './runtime';
3
+ export { Iso8601Timestamp, PathReference } from './utils';
@@ -1,6 +1,7 @@
1
1
  import { EmptyObject } from '@voiceflow/common';
2
- import { GlobalLogKinds, Iso8601Timestamp, LoggingNodeType, PathReference } from '../utils';
3
- import { LogLevel } from '../utils/logs';
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 GlobalLogKinds, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
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 LoggingNodeType, Message extends EmptyObject, Level extends LogLevel = LogLevel.INFO> extends BaseLog {
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
- export declare type ConversationStartLog = BaseGlobalLog<GlobalLogKinds.CONVERSATION_START, {
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 { 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;
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;
@@ -1 +1,4 @@
1
- export * from './global/conversationStart';
1
+ import * as Logs from './logs';
2
+ export * as Kinds from './kinds';
3
+ export { Logs };
4
+ export { LogLevel } from './levels';
@@ -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,33 @@
1
+ /** Similar to {@link NodeType}, but for runtime logging */
2
+ export var StepLogKind;
3
+ (function (StepLogKind) {
4
+ // Response
5
+ StepLogKind["TEXT"] = "text";
6
+ StepLogKind["SPEAK"] = "speak";
7
+ StepLogKind["AUDIO"] = "audio";
8
+ StepLogKind["VISUALS"] = "visuals";
9
+ // User input
10
+ StepLogKind["BUTTONS"] = "buttons";
11
+ StepLogKind["CHOICE"] = "choice";
12
+ StepLogKind["CAPTURE"] = "capture";
13
+ StepLogKind["PROMPT"] = "prompt";
14
+ StepLogKind["INTENT"] = "intent";
15
+ // Logic
16
+ StepLogKind["CONDITION"] = "condition";
17
+ StepLogKind["SET"] = "set";
18
+ StepLogKind["RANDOM"] = "random";
19
+ StepLogKind["FLOW"] = "flow";
20
+ StepLogKind["EXIT"] = "exit";
21
+ // Integration
22
+ StepLogKind["API"] = "api";
23
+ /** @deprecated Will be removed soon */
24
+ StepLogKind["GOOGLE_SHEETS"] = "google_sheets";
25
+ StepLogKind["CUSTOM_CODE"] = "custom_code";
26
+ StepLogKind["CUSTOM_ACTION"] = "custom_action";
27
+ // Special
28
+ StepLogKind["START"] = "start";
29
+ })(StepLogKind || (StepLogKind = {}));
30
+ export var GlobalLogKind;
31
+ (function (GlobalLogKind) {
32
+ GlobalLogKind["CONVERSATION_START"] = "conversation_start";
33
+ })(GlobalLogKind || (GlobalLogKind = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum LogLevel {
2
+ ERROR = "error",
3
+ WARN = "warn",
4
+ INFO = "info",
5
+ VERBOSE = "verbose"
6
+ }
@@ -0,0 +1,7 @@
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 = {}));
@@ -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 @@
1
+ export {};
@@ -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<LoggingNodeType.API, ApiLogMessage, LogLevel.INFO | LogLevel.ERROR> | BaseStepLog<LoggingNodeType.API, ApiLogMessage & VerboseApiLogMessage, LogLevel.VERBOSE | LogLevel.ERROR>;
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 { LoggingNodeType, PathReference } from '../../utils';
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<LoggingNodeType.BUTTONS, FollowPathButtonLogMessage | GoToIntentButtonLogMessage>;
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
- export declare type CaptureStepLog = BaseStepLog<LoggingNodeType.CAPTURE, {
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
- export declare type CodeStepLog = BaseStepLog<LoggingNodeType.CUSTOM_CODE, {
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<LoggingNodeType.CUSTOM_CODE, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type ConditionStepLog = BaseStepLog<LoggingNodeType.CONDITION, {
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 { LoggingNodeType, PathReference } from '../../utils';
2
+ import { PathReference } from '../../utils';
3
3
  import { BaseStepLog } from '../base';
4
- export declare type CustomActionStepLog = BaseStepLog<LoggingNodeType.CUSTOM_ACTION, {
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
- export declare type ExitStepLog = BaseStepLog<LoggingNodeType.EXIT, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type FlowStepLog = BaseStepLog<LoggingNodeType.FLOW, {
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
- export declare type IntentStepLog = BaseStepLog<LoggingNodeType.INTENT, {
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 { LoggingNodeType, PathReference } from '../../utils';
1
+ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
- export declare type RandomStepLog = BaseStepLog<LoggingNodeType.RANDOM, {
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
- export declare type SetStepLog = BaseStepLog<LoggingNodeType.SET, {
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
- export declare type SpeakStepLog = BaseStepLog<LoggingNodeType.SPEAK, {
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
- export declare type StartStepLog = BaseStepLog<LoggingNodeType.START, EmptyObject>;
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
- export declare type TextStepLog = BaseStepLog<LoggingNodeType.TEXT, {
2
+ import { StepLogKind } from '../kinds';
3
+ export declare type TextStepLog = BaseStepLog<StepLogKind.TEXT, {
4
4
  text: string;
5
5
  }>;
@@ -1,8 +1,3 @@
1
- export declare enum LogLevel {
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,10 +1,4 @@
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 = {}));
1
+ import { LogLevel } from '../logs/levels';
8
2
  const logLevelValues = {
9
3
  [LogLevel.ERROR]: 0,
10
4
  [LogLevel.WARN]: 1,
@@ -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: LoggingNodeType;
5
+ componentName: StepLogKind;
31
6
  stepID: string;
32
7
  }
@@ -1,33 +1 @@
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 = {}));
1
+ export {};
@@ -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 AnyTrace = ExitTrace | TextTrace | GoToTrace | FlowTrace | SpeakTrace | BlockTrace | DebugTrace | ChoiceTrace | StreamTrace | VisualTrace | NoReplyTrace | EntityFillingTrace;
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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@voiceflow/base-types",
3
3
  "description": "Voiceflow base project types",
4
- "version": "2.27.0",
4
+ "version": "2.29.0",
5
5
  "author": "Voiceflow",
6
6
  "bugs": {
7
7
  "url": "https://github.com/voiceflow/libs/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@voiceflow/common": "^7.26.1",
10
+ "@voiceflow/common": "^7.27.0",
11
11
  "slate": "0.73.0"
12
12
  },
13
13
  "files": [
@@ -43,5 +43,5 @@
43
43
  "test:smoke": "exit 0",
44
44
  "test:unit": "exit 0"
45
45
  },
46
- "gitHead": "32f0757eae3d1cee6af9220f541feac9d8cd9e75"
46
+ "gitHead": "aad20f39f18f98da96b48ad4ee7ff0c95e096421"
47
47
  }