@voiceflow/base-types
Version:
Voiceflow base project types
10 lines (9 loc) • 492 B
JavaScript
export const API_KEY_PREFIX = 'VF.';
export var APIKeySubType;
(function (APIKeySubType) {
APIKeySubType["Workspace"] = "WS";
APIKeySubType["DialogManager"] = "DM";
})(APIKeySubType || (APIKeySubType = {}));
const buildAPIKeyGuard = (type) => (key) => typeof key === 'string' && key.startsWith(`${API_KEY_PREFIX}${type}.`);
export const isWorkspaceAPIKey = buildAPIKeyGuard(APIKeySubType.Workspace);
export const isDialogManagerAPIKey = buildAPIKeyGuard(APIKeySubType.DialogManager);