@voiceflow/base-types 2.17.3 → 2.19.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.
@@ -1,9 +1,17 @@
1
1
  import { AnyRecord } from "../types";
2
+ export declare const API_KEY_PREFIX = "VF.";
3
+ export declare enum APIKeySubType {
4
+ Workspace = "WS",
5
+ DialogManager = "DM"
6
+ }
7
+ export declare const isWorkspaceAPIKey: (key: unknown) => key is string;
8
+ export declare const isDialogManagerAPIKey: (key: unknown) => key is string;
2
9
  export interface Model<Data extends AnyRecord = AnyRecord> {
3
10
  _id: string;
4
11
  creatorID: number;
5
12
  projectID?: string;
6
13
  workspaceID: string;
14
+ type: APIKeySubType;
7
15
  name: string;
8
16
  data?: Data;
9
17
  scopes: string[];
@@ -1,2 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDialogManagerAPIKey = exports.isWorkspaceAPIKey = exports.APIKeySubType = exports.API_KEY_PREFIX = void 0;
4
+ exports.API_KEY_PREFIX = 'VF.';
5
+ var APIKeySubType;
6
+ (function (APIKeySubType) {
7
+ APIKeySubType["Workspace"] = "WS";
8
+ APIKeySubType["DialogManager"] = "DM";
9
+ })(APIKeySubType = exports.APIKeySubType || (exports.APIKeySubType = {}));
10
+ const buildAPIKeyGuard = (type) => (key) => typeof key === 'string' && key.startsWith(`${exports.API_KEY_PREFIX}${type}.`);
11
+ exports.isWorkspaceAPIKey = buildAPIKeyGuard(APIKeySubType.Workspace);
12
+ exports.isDialogManagerAPIKey = buildAPIKeyGuard(APIKeySubType.DialogManager);
@@ -2,5 +2,6 @@ export * from './command';
2
2
  export * from './common';
3
3
  export * from './intent';
4
4
  export * from './node';
5
+ export * from './note';
5
6
  export * from './prototype';
6
7
  export * from './slot';
@@ -14,5 +14,6 @@ __exportStar(require("./command"), exports);
14
14
  __exportStar(require("./common"), exports);
15
15
  __exportStar(require("./intent"), exports);
16
16
  __exportStar(require("./node"), exports);
17
+ __exportStar(require("./note"), exports);
17
18
  __exportStar(require("./prototype"), exports);
18
19
  __exportStar(require("./slot"), exports);
@@ -20,4 +20,5 @@ export interface Intent {
20
20
  name: string;
21
21
  slots?: IntentSlot[];
22
22
  inputs: IntentInput[];
23
+ noteID?: string;
23
24
  }
@@ -0,0 +1,19 @@
1
+ import { AnyRecord } from "../../types";
2
+ export declare enum NoteType {
3
+ INTENT = "INTENT"
4
+ }
5
+ export interface BaseNote {
6
+ id: string;
7
+ type: NoteType;
8
+ text: string;
9
+ meta?: AnyRecord;
10
+ mentions: number[];
11
+ }
12
+ export interface IntentNoteMeta {
13
+ intentID: string;
14
+ }
15
+ export interface IntentNote extends BaseNote {
16
+ type: NoteType.INTENT;
17
+ meta: IntentNoteMeta;
18
+ }
19
+ export declare type AnyNote = IntentNote;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoteType = void 0;
4
+ var NoteType;
5
+ (function (NoteType) {
6
+ NoteType["INTENT"] = "INTENT";
7
+ })(NoteType = exports.NoteType || (exports.NoteType = {}));
@@ -1,5 +1,5 @@
1
1
  import { AnyRecord } from "../../types";
2
- import { BaseCommand, Intent, Slot, Variable } from '../base';
2
+ import { BaseCommand, BaseNote, Intent, Slot, Variable } from '../base';
3
3
  import { Prototype } from './prototype';
4
4
  export * from './prototype';
5
5
  export interface PlatformData<Settings extends AnyRecord = AnyRecord, Publishing extends AnyRecord = AnyRecord> {
@@ -35,6 +35,7 @@ export interface Model<_PlatformData extends PlatformData, Command extends BaseC
35
35
  projectID: string;
36
36
  rootDiagramID: string;
37
37
  name: string;
38
+ notes?: Record<string, BaseNote>;
38
39
  topics?: FolderItem[];
39
40
  folders?: Record<string, Folder>;
40
41
  variables: Variable[];
@@ -1,9 +1,17 @@
1
1
  import { AnyRecord } from "../types";
2
+ export declare const API_KEY_PREFIX = "VF.";
3
+ export declare enum APIKeySubType {
4
+ Workspace = "WS",
5
+ DialogManager = "DM"
6
+ }
7
+ export declare const isWorkspaceAPIKey: (key: unknown) => key is string;
8
+ export declare const isDialogManagerAPIKey: (key: unknown) => key is string;
2
9
  export interface Model<Data extends AnyRecord = AnyRecord> {
3
10
  _id: string;
4
11
  creatorID: number;
5
12
  projectID?: string;
6
13
  workspaceID: string;
14
+ type: APIKeySubType;
7
15
  name: string;
8
16
  data?: Data;
9
17
  scopes: string[];
@@ -1 +1,9 @@
1
- export {};
1
+ export const API_KEY_PREFIX = 'VF.';
2
+ export var APIKeySubType;
3
+ (function (APIKeySubType) {
4
+ APIKeySubType["Workspace"] = "WS";
5
+ APIKeySubType["DialogManager"] = "DM";
6
+ })(APIKeySubType || (APIKeySubType = {}));
7
+ const buildAPIKeyGuard = (type) => (key) => typeof key === 'string' && key.startsWith(`${API_KEY_PREFIX}${type}.`);
8
+ export const isWorkspaceAPIKey = buildAPIKeyGuard(APIKeySubType.Workspace);
9
+ export const isDialogManagerAPIKey = buildAPIKeyGuard(APIKeySubType.DialogManager);
@@ -2,5 +2,6 @@ export * from './command';
2
2
  export * from './common';
3
3
  export * from './intent';
4
4
  export * from './node';
5
+ export * from './note';
5
6
  export * from './prototype';
6
7
  export * from './slot';
@@ -2,5 +2,6 @@ export * from './command';
2
2
  export * from './common';
3
3
  export * from './intent';
4
4
  export * from './node';
5
+ export * from './note';
5
6
  export * from './prototype';
6
7
  export * from './slot';
@@ -20,4 +20,5 @@ export interface Intent {
20
20
  name: string;
21
21
  slots?: IntentSlot[];
22
22
  inputs: IntentInput[];
23
+ noteID?: string;
23
24
  }
@@ -0,0 +1,19 @@
1
+ import { AnyRecord } from "../../types";
2
+ export declare enum NoteType {
3
+ INTENT = "INTENT"
4
+ }
5
+ export interface BaseNote {
6
+ id: string;
7
+ type: NoteType;
8
+ text: string;
9
+ meta?: AnyRecord;
10
+ mentions: number[];
11
+ }
12
+ export interface IntentNoteMeta {
13
+ intentID: string;
14
+ }
15
+ export interface IntentNote extends BaseNote {
16
+ type: NoteType.INTENT;
17
+ meta: IntentNoteMeta;
18
+ }
19
+ export declare type AnyNote = IntentNote;
@@ -0,0 +1,4 @@
1
+ export var NoteType;
2
+ (function (NoteType) {
3
+ NoteType["INTENT"] = "INTENT";
4
+ })(NoteType || (NoteType = {}));
@@ -1,5 +1,5 @@
1
1
  import { AnyRecord } from "../../types";
2
- import { BaseCommand, Intent, Slot, Variable } from '../base';
2
+ import { BaseCommand, BaseNote, Intent, Slot, Variable } from '../base';
3
3
  import { Prototype } from './prototype';
4
4
  export * from './prototype';
5
5
  export interface PlatformData<Settings extends AnyRecord = AnyRecord, Publishing extends AnyRecord = AnyRecord> {
@@ -35,6 +35,7 @@ export interface Model<_PlatformData extends PlatformData, Command extends BaseC
35
35
  projectID: string;
36
36
  rootDiagramID: string;
37
37
  name: string;
38
+ notes?: Record<string, BaseNote>;
38
39
  topics?: FolderItem[];
39
40
  folders?: Record<string, Folder>;
40
41
  variables: Variable[];
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.17.3",
4
+ "version": "2.19.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.23.0",
10
+ "@voiceflow/common": "^7.24.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": "8a42f59e14588817d901cee1d3545040eefa2dee"
46
+ "gitHead": "309ec4587f621f372c28fa299a55bbe9471a256b"
47
47
  }