@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.
- package/build/common/models/apiKey.d.ts +8 -0
- package/build/common/models/apiKey.js +10 -0
- package/build/common/models/base/index.d.ts +1 -0
- package/build/common/models/base/index.js +1 -0
- package/build/common/models/base/intent.d.ts +1 -0
- package/build/common/models/base/note.d.ts +19 -0
- package/build/common/models/base/note.js +7 -0
- package/build/common/models/version/index.d.ts +2 -1
- package/build/esm/models/apiKey.d.ts +8 -0
- package/build/esm/models/apiKey.js +9 -1
- package/build/esm/models/base/index.d.ts +1 -0
- package/build/esm/models/base/index.js +1 -0
- package/build/esm/models/base/intent.d.ts +1 -0
- package/build/esm/models/base/note.d.ts +19 -0
- package/build/esm/models/base/note.js +4 -0
- package/build/esm/models/version/index.d.ts +2 -1
- package/package.json +3 -3
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -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.
|
|
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.
|
|
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": "
|
|
46
|
+
"gitHead": "309ec4587f621f372c28fa299a55bbe9471a256b"
|
|
47
47
|
}
|