@voiceflow/base-types 2.42.0 → 2.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,40 +9,15 @@ export declare enum PortType {
9
9
  }
10
10
  export interface BasePort {
11
11
  id: string;
12
+ type: string | PortType;
12
13
  target: Nullable<string>;
13
- /**
14
- * @deprecated this will now be the refID value when the refType is 'builtin'
15
- */
16
- type?: string | PortType;
17
14
  }
18
- export declare enum ReferenceType {
19
- /**
20
- * describes a port that is not affected by step reorder operations
21
- */
22
- PERSISTENT = "persistent",
23
- /**
24
- * describes a port of a pre-defined type (next, no-match, no-reply, etc.)
25
- */
26
- BUILTIN = "builtin"
15
+ export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[], ByKey extends Partial<Record<string, BasePort>> = Partial<Record<string, BasePort>>> {
16
+ builtIn: Builtin;
17
+ dynamic: Dynamic;
18
+ byKey: ByKey;
27
19
  }
28
- export interface ReferenceMixin {
29
- refType: ReferenceType;
30
- refID: string;
31
- }
32
- export interface PersistentReference extends ReferenceMixin {
33
- refType: ReferenceType.PERSISTENT;
34
- }
35
- export interface BuiltinReference extends ReferenceMixin {
36
- refType: ReferenceType.BUILTIN;
37
- refID: PortType;
38
- }
39
- export declare type BaseReference = PersistentReference | BuiltinReference;
40
- export declare type BaseReferencePort = BasePort & BaseReference;
41
- export interface BaseStepPorts<_Typed extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort = BasePort, Reference extends BaseReferencePort = BaseReferencePort> {
42
- dynamic: Dynamic[];
43
- byRef: Reference[];
44
- }
45
- export interface AnyBaseStepPorts extends BaseStepPorts<Partial<Record<PortType, BasePort>>, BasePort, BaseReferencePort> {
20
+ export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
46
21
  }
47
22
  export interface BuiltInNextPort {
48
23
  [PortType.NEXT]: BasePort;
@@ -60,15 +35,15 @@ export interface BuiltInNextFailPorts extends BuiltInNextPort, BuiltInFailPort {
60
35
  }
61
36
  export interface BuiltInNoMatchNoReplyPorts extends BuiltInNoMatchPort, BuiltInNoReplyPort {
62
37
  }
63
- export interface EmptyStepPorts extends BaseStepPorts<EmptyObject> {
38
+ export interface EmptyStepPorts extends BaseStepPorts<EmptyObject, []> {
64
39
  }
65
- export interface NextStepPorts extends BaseStepPorts<BuiltInNextPort> {
40
+ export interface NextStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextPort, Dynamic> {
66
41
  }
67
- export interface SuccessFailStepPorts extends BaseStepPorts<BuiltInNextFailPorts> {
42
+ export interface SuccessFailStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextFailPorts, Dynamic> {
68
43
  }
69
- export interface DynamicOnlyStepPorts extends BaseStepPorts<EmptyObject> {
44
+ export interface DynamicOnlyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<EmptyObject, Dynamic> {
70
45
  }
71
- export interface NoMatchNoReplyStepPorts extends BaseStepPorts<BuiltInNoMatchNoReplyPorts> {
46
+ export interface NoMatchNoReplyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNoMatchNoReplyPorts, Dynamic> {
72
47
  }
73
48
  /**
74
49
  * @deprecated
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReferenceType = exports.PortType = void 0;
3
+ exports.PortType = void 0;
4
4
  var PortType;
5
5
  (function (PortType) {
6
6
  PortType["FAIL"] = "fail";
@@ -10,19 +10,3 @@ var PortType;
10
10
  PortType["NO_MATCH"] = "else";
11
11
  PortType["PREVIOUS"] = "previous";
12
12
  })(PortType = exports.PortType || (exports.PortType = {}));
13
- var ReferenceType;
14
- (function (ReferenceType) {
15
- /**
16
- * describes a port that is not affected by step reorder operations
17
- */
18
- ReferenceType["PERSISTENT"] = "persistent";
19
- /**
20
- * describes a port of a pre-defined type (next, no-match, no-reply, etc.)
21
- */
22
- ReferenceType["BUILTIN"] = "builtin";
23
- /**
24
- * eventually we can introduce this alongside a portsV3 structure that is
25
- * just an array of BaseReferencePorts
26
- */
27
- // DYNAMIC = 'dynamic'
28
- })(ReferenceType = exports.ReferenceType || (exports.ReferenceType = {}));
@@ -12,7 +12,7 @@ export interface StepPort<Event = BaseEvent> extends BasePort {
12
12
  event?: Event;
13
13
  };
14
14
  }
15
- export interface StepPorts<Event> extends BaseStepPorts<{}, StepPort<Event>> {
15
+ export interface StepPorts<Event> extends BaseStepPorts<Record<string, StepPort<Event>>, StepPort<Event>[]> {
16
16
  }
17
17
  export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, StepPorts<Event>, BasePortList<StepPort<Event>>> {
18
18
  type: string;
@@ -41,7 +41,7 @@ export interface StepData {
41
41
  selectedAction: APIActionType;
42
42
  selectedIntegration: IntegrationType.CUSTOM_API;
43
43
  }
44
- export interface StepPorts extends SuccessFailStepPorts {
44
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
45
45
  }
46
46
  export interface NodeData extends NodeSuccessFailID {
47
47
  action_data: {
@@ -10,7 +10,7 @@ export interface StepData extends BaseNoReplyStepData {
10
10
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoReplyPort {
11
11
  }
12
12
  /** @deprecated */
13
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
13
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
14
14
  }
15
15
  /** @deprecated */
16
16
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
@@ -21,7 +21,7 @@ export interface StepData extends BaseCaptureData {
21
21
  }
22
22
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
23
23
  }
24
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
24
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
25
25
  }
26
26
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
27
27
  type: NodeType.CAPTURE_V2;
@@ -19,7 +19,7 @@ export interface CarouselCard<B = CarouselButton> extends DataID {
19
19
  }
20
20
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
21
21
  }
22
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
22
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
23
23
  }
24
24
  export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
25
25
  layout: CarouselLayout;
@@ -3,7 +3,7 @@ import { BaseNode, BaseStep, NodeSuccessFailID, SuccessFailStepPorts } from './u
3
3
  export interface StepData {
4
4
  code: string;
5
5
  }
6
- export interface StepPorts extends SuccessFailStepPorts {
6
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
7
7
  }
8
8
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
9
9
  type: NodeType.CODE;
@@ -33,7 +33,7 @@ export interface StepData {
33
33
  selectedAction: Nullable<GoogleSheetsActionType>;
34
34
  selectedIntegration: IntegrationType.GOOGLE_SHEETS;
35
35
  }
36
- export interface StepPorts extends SuccessFailStepPorts {
36
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
37
37
  }
38
38
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
39
39
  type: NodeType.GOOGLE_SHEETS;
@@ -6,7 +6,7 @@ export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
6
6
  */
7
7
  noMatches?: BaseStepNoMatch;
8
8
  }
9
- export interface StepPorts extends NoMatchNoReplyStepPorts {
9
+ export interface StepPorts extends NoMatchNoReplyStepPorts<[]> {
10
10
  }
11
11
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
12
12
  type: NodeType.PROMPT;
@@ -21,7 +21,7 @@ export interface StepDefaultBuiltPorts extends StepBaseBuiltInPorts {
21
21
  [PortType.PAUSE]?: BasePort;
22
22
  [PortType.PREVIOUS]?: BasePort;
23
23
  }
24
- export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts> {
24
+ export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts, []> {
25
25
  }
26
26
  export interface Step<Data = StepData, Ports = StepPorts> extends BaseStep<Data, Ports> {
27
27
  type: NodeType.STREAM;
@@ -9,7 +9,7 @@ export interface StepData {
9
9
  selectedAction: ZapierActionType;
10
10
  selectedIntegration: IntegrationType.ZAPIER;
11
11
  }
12
- export interface StepPorts extends SuccessFailStepPorts {
12
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
13
13
  }
14
14
  export interface ActionData {
15
15
  user?: IntegrationUser;
@@ -9,40 +9,15 @@ export declare enum PortType {
9
9
  }
10
10
  export interface BasePort {
11
11
  id: string;
12
+ type: string | PortType;
12
13
  target: Nullable<string>;
13
- /**
14
- * @deprecated this will now be the refID value when the refType is 'builtin'
15
- */
16
- type?: string | PortType;
17
14
  }
18
- export declare enum ReferenceType {
19
- /**
20
- * describes a port that is not affected by step reorder operations
21
- */
22
- PERSISTENT = "persistent",
23
- /**
24
- * describes a port of a pre-defined type (next, no-match, no-reply, etc.)
25
- */
26
- BUILTIN = "builtin"
15
+ export interface BaseStepPorts<Builtin extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort[] = BasePort[], ByKey extends Partial<Record<string, BasePort>> = Partial<Record<string, BasePort>>> {
16
+ builtIn: Builtin;
17
+ dynamic: Dynamic;
18
+ byKey: ByKey;
27
19
  }
28
- export interface ReferenceMixin {
29
- refType: ReferenceType;
30
- refID: string;
31
- }
32
- export interface PersistentReference extends ReferenceMixin {
33
- refType: ReferenceType.PERSISTENT;
34
- }
35
- export interface BuiltinReference extends ReferenceMixin {
36
- refType: ReferenceType.BUILTIN;
37
- refID: PortType;
38
- }
39
- export declare type BaseReference = PersistentReference | BuiltinReference;
40
- export declare type BaseReferencePort = BasePort & BaseReference;
41
- export interface BaseStepPorts<_Typed extends Partial<Record<PortType, BasePort>>, Dynamic extends BasePort = BasePort, Reference extends BaseReferencePort = BaseReferencePort> {
42
- dynamic: Dynamic[];
43
- byRef: Reference[];
44
- }
45
- export interface AnyBaseStepPorts extends BaseStepPorts<Partial<Record<PortType, BasePort>>, BasePort, BaseReferencePort> {
20
+ export interface AnyBaseStepPorts extends BaseStepPorts<Record<string, BasePort>, BasePort[]> {
46
21
  }
47
22
  export interface BuiltInNextPort {
48
23
  [PortType.NEXT]: BasePort;
@@ -60,15 +35,15 @@ export interface BuiltInNextFailPorts extends BuiltInNextPort, BuiltInFailPort {
60
35
  }
61
36
  export interface BuiltInNoMatchNoReplyPorts extends BuiltInNoMatchPort, BuiltInNoReplyPort {
62
37
  }
63
- export interface EmptyStepPorts extends BaseStepPorts<EmptyObject> {
38
+ export interface EmptyStepPorts extends BaseStepPorts<EmptyObject, []> {
64
39
  }
65
- export interface NextStepPorts extends BaseStepPorts<BuiltInNextPort> {
40
+ export interface NextStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextPort, Dynamic> {
66
41
  }
67
- export interface SuccessFailStepPorts extends BaseStepPorts<BuiltInNextFailPorts> {
42
+ export interface SuccessFailStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNextFailPorts, Dynamic> {
68
43
  }
69
- export interface DynamicOnlyStepPorts extends BaseStepPorts<EmptyObject> {
44
+ export interface DynamicOnlyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<EmptyObject, Dynamic> {
70
45
  }
71
- export interface NoMatchNoReplyStepPorts extends BaseStepPorts<BuiltInNoMatchNoReplyPorts> {
46
+ export interface NoMatchNoReplyStepPorts<Dynamic extends BasePort[] = BasePort[]> extends BaseStepPorts<BuiltInNoMatchNoReplyPorts, Dynamic> {
72
47
  }
73
48
  /**
74
49
  * @deprecated
@@ -7,19 +7,3 @@ export var PortType;
7
7
  PortType["NO_MATCH"] = "else";
8
8
  PortType["PREVIOUS"] = "previous";
9
9
  })(PortType || (PortType = {}));
10
- export var ReferenceType;
11
- (function (ReferenceType) {
12
- /**
13
- * describes a port that is not affected by step reorder operations
14
- */
15
- ReferenceType["PERSISTENT"] = "persistent";
16
- /**
17
- * describes a port of a pre-defined type (next, no-match, no-reply, etc.)
18
- */
19
- ReferenceType["BUILTIN"] = "builtin";
20
- /**
21
- * eventually we can introduce this alongside a portsV3 structure that is
22
- * just an array of BaseReferencePorts
23
- */
24
- // DYNAMIC = 'dynamic'
25
- })(ReferenceType || (ReferenceType = {}));
@@ -12,7 +12,7 @@ export interface StepPort<Event = BaseEvent> extends BasePort {
12
12
  event?: Event;
13
13
  };
14
14
  }
15
- export interface StepPorts<Event> extends BaseStepPorts<{}, StepPort<Event>> {
15
+ export interface StepPorts<Event> extends BaseStepPorts<Record<string, StepPort<Event>>, StepPort<Event>[]> {
16
16
  }
17
17
  export interface Step<Payload = unknown, Event = BaseEvent> extends BaseStep<StepData<Payload>, StepPorts<Event>, BasePortList<StepPort<Event>>> {
18
18
  type: string;
@@ -41,7 +41,7 @@ export interface StepData {
41
41
  selectedAction: APIActionType;
42
42
  selectedIntegration: IntegrationType.CUSTOM_API;
43
43
  }
44
- export interface StepPorts extends SuccessFailStepPorts {
44
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
45
45
  }
46
46
  export interface NodeData extends NodeSuccessFailID {
47
47
  action_data: {
@@ -10,7 +10,7 @@ export interface StepData extends BaseNoReplyStepData {
10
10
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoReplyPort {
11
11
  }
12
12
  /** @deprecated */
13
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
13
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
14
14
  }
15
15
  /** @deprecated */
16
16
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
@@ -21,7 +21,7 @@ export interface StepData extends BaseCaptureData {
21
21
  }
22
22
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
23
23
  }
24
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
24
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
25
25
  }
26
26
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
27
27
  type: NodeType.CAPTURE_V2;
@@ -19,7 +19,7 @@ export interface CarouselCard<B = CarouselButton> extends DataID {
19
19
  }
20
20
  export interface StepBuiltInPorts extends BuiltInNextPort, BuiltInNoMatchNoReplyPorts {
21
21
  }
22
- export interface StepPorts extends BaseStepPorts<StepBuiltInPorts> {
22
+ export interface StepPorts extends BaseStepPorts<StepBuiltInPorts, []> {
23
23
  }
24
24
  export interface StepData extends BaseNoMatchStepData, BaseNoReplyStepData {
25
25
  layout: CarouselLayout;
@@ -3,7 +3,7 @@ import { BaseNode, BaseStep, NodeSuccessFailID, SuccessFailStepPorts } from './u
3
3
  export interface StepData {
4
4
  code: string;
5
5
  }
6
- export interface StepPorts extends SuccessFailStepPorts {
6
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
7
7
  }
8
8
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
9
9
  type: NodeType.CODE;
@@ -33,7 +33,7 @@ export interface StepData {
33
33
  selectedAction: Nullable<GoogleSheetsActionType>;
34
34
  selectedIntegration: IntegrationType.GOOGLE_SHEETS;
35
35
  }
36
- export interface StepPorts extends SuccessFailStepPorts {
36
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
37
37
  }
38
38
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
39
39
  type: NodeType.GOOGLE_SHEETS;
@@ -6,7 +6,7 @@ export interface StepData extends BaseNoReplyStepData, BaseNoMatchStepData {
6
6
  */
7
7
  noMatches?: BaseStepNoMatch;
8
8
  }
9
- export interface StepPorts extends NoMatchNoReplyStepPorts {
9
+ export interface StepPorts extends NoMatchNoReplyStepPorts<[]> {
10
10
  }
11
11
  export interface Step<Data = StepData> extends BaseStep<Data, StepPorts> {
12
12
  type: NodeType.PROMPT;
@@ -21,7 +21,7 @@ export interface StepDefaultBuiltPorts extends StepBaseBuiltInPorts {
21
21
  [PortType.PAUSE]?: BasePort;
22
22
  [PortType.PREVIOUS]?: BasePort;
23
23
  }
24
- export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts> {
24
+ export interface StepPorts<BuiltInPorts extends StepBaseBuiltInPorts = StepDefaultBuiltPorts> extends BaseStepPorts<BuiltInPorts, []> {
25
25
  }
26
26
  export interface Step<Data = StepData, Ports = StepPorts> extends BaseStep<Data, Ports> {
27
27
  type: NodeType.STREAM;
@@ -9,7 +9,7 @@ export interface StepData {
9
9
  selectedAction: ZapierActionType;
10
10
  selectedIntegration: IntegrationType.ZAPIER;
11
11
  }
12
- export interface StepPorts extends SuccessFailStepPorts {
12
+ export interface StepPorts extends SuccessFailStepPorts<[]> {
13
13
  }
14
14
  export interface ActionData {
15
15
  user?: IntegrationUser;
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.42.0",
4
+ "version": "2.42.1",
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": "73bc5adcfc124c2c6925cf4c478ff34a1141ce78"
46
+ "gitHead": "f57624bb299bcf11ad01cd8588d1fcd2e77dbd7e"
47
47
  }