@voiceflow/base-types 2.41.0 → 2.42.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.
@@ -2,5 +2,5 @@ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
3
  import { StepLogKind } from '../kinds';
4
4
  export declare type RandomStepLog = BaseStepLog<StepLogKind.RANDOM, {
5
- path: PathReference;
5
+ path: PathReference | null;
6
6
  }>;
@@ -1,6 +1,4 @@
1
+ import { ChangedVariables } from "../../utils";
1
2
  import { BaseStepLog } from '../base';
2
3
  import { StepLogKind } from '../kinds';
3
- export declare type SetStepLog = BaseStepLog<StepLogKind.SET, {
4
- variableName: string;
5
- expression: string;
6
- }>;
4
+ export declare type SetStepLog = BaseStepLog<StepLogKind.SET, ChangedVariables<any>>;
@@ -5,3 +5,15 @@ export interface PathReference {
5
5
  componentName: StepLogKind;
6
6
  stepID: string;
7
7
  }
8
+ /** A common interface for representing a before & after change of a value. */
9
+ export interface ValueChange<T> {
10
+ before: T;
11
+ after: T;
12
+ }
13
+ /**
14
+ * An abstract interface for something that includes changed variables.
15
+ * This enforces a consistent naming scheme of the property.
16
+ */
17
+ export interface ChangedVariables<V, K extends PropertyKey = string> {
18
+ changedVariables: Record<K, ValueChange<V>>;
19
+ }
@@ -2,5 +2,5 @@ import { PathReference } from '../../utils';
2
2
  import { BaseStepLog } from '../base';
3
3
  import { StepLogKind } from '../kinds';
4
4
  export declare type RandomStepLog = BaseStepLog<StepLogKind.RANDOM, {
5
- path: PathReference;
5
+ path: PathReference | null;
6
6
  }>;
@@ -1,6 +1,4 @@
1
+ import { ChangedVariables } from "../../utils";
1
2
  import { BaseStepLog } from '../base';
2
3
  import { StepLogKind } from '../kinds';
3
- export declare type SetStepLog = BaseStepLog<StepLogKind.SET, {
4
- variableName: string;
5
- expression: string;
6
- }>;
4
+ export declare type SetStepLog = BaseStepLog<StepLogKind.SET, ChangedVariables<any>>;
@@ -5,3 +5,15 @@ export interface PathReference {
5
5
  componentName: StepLogKind;
6
6
  stepID: string;
7
7
  }
8
+ /** A common interface for representing a before & after change of a value. */
9
+ export interface ValueChange<T> {
10
+ before: T;
11
+ after: T;
12
+ }
13
+ /**
14
+ * An abstract interface for something that includes changed variables.
15
+ * This enforces a consistent naming scheme of the property.
16
+ */
17
+ export interface ChangedVariables<V, K extends PropertyKey = string> {
18
+ changedVariables: Record<K, ValueChange<V>>;
19
+ }
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.41.0",
4
+ "version": "2.42.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": "317b55ee40a73d3c720016fd36e908e1fabe8a4f"
46
+ "gitHead": "73bc5adcfc124c2c6925cf4c478ff34a1141ce78"
47
47
  }