@vocalstack/js-sdk 1.0.13 → 1.1.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/README.md CHANGED
@@ -1,9 +1,9 @@
1
- [![](/logo.svg 'VocalStack')](https://vocalstack.com)
1
+ [![](/logo.svg 'VocalStack')](https://www.vocalstack.com)
2
2
 
3
- > VocalStack is a platform that can be used for building voice applications. See more at [https://vocalstack.com](vocalstack.com).
3
+ > VocalStack is a platform that can be used for building voice applications. See more at [https://www.vocalstack.com](vocalstack.com).
4
4
 
5
5
  This repository contains the official VocalStack SDK for JavaScript. It provides a simple way
6
- to interact with the [VocalStack API](https://vocalstack.com/api).
6
+ to interact with the [VocalStack API](https://www.vocalstack.com/api).
7
7
  Most notably, it helps implement asynchronous bidirectional communication
8
8
  such as live stream transcriptions in just a few lines of code.
9
9
  This SDK will work in both Node.js and the browser.
@@ -17,8 +17,8 @@ Before you start, install the VocalStack JavaScript SDK using your preferred Nod
17
17
  npm install @vocalstack/js-sdk
18
18
  ```
19
19
 
20
- Also make sure to have a [VocalStack account](https://vocalstack.com) and an API key, which you can generate
21
- at https://vocalstack.com/dashboard/api-keys.
20
+ Also make sure to have a [VocalStack account](https://www.vocalstack.com) and an API key, which you can generate
21
+ at https://www.vocalstack.com/dashboard/api-keys.
22
22
  There is a free tier available, so you can start experimenting right away.
23
23
 
24
24
 
@@ -63,27 +63,27 @@ transcription.onData(console.log);
63
63
 
64
64
  # Documentation Index
65
65
 
66
- - [Transcribe Audio from URL](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-audio-from-url-to-text.md):
67
- Transcribe speech from pre-recorded audio in a URL to plain text. Major file formats are supported, including MP3, WAV, FLAC, and OGG.
66
+ - [Get Transcription Data](https://github.com/vocalstack/js-sdk/blob/main/documentation/get-transcription-data.md):
67
+ Get data from pending or completed transcriptions. This includes the transcription timeline, key words, summary, and paragraph segments.
68
68
 
69
69
  - [Transcribe from a Microphone or LiveStream](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-from-a-microphone-or-live-stream.md):
70
70
  Transcribe live speech from a microphone or live stream. Integrate with Polyglot to create a public shareable link for the transcription which users can read in any language.
71
71
 
72
- - [Transcribe and Present a Polyglot Session](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-and-present-a-polyglot-session.md):
73
- Create a session that can be used to broadcast a live transcription via a public shareable link. Users can read live transcriptions in their preferred language, and even past transcriptions when your session is inactive.
72
+ - [Transcription Sessions](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcription-sessions.md):
73
+ Monitor and manage transcription state with sessions. Using sessions you can reconnect to a previously created asynchronous connection.
74
74
 
75
75
  - [Translate a Transcription](https://github.com/vocalstack/js-sdk/blob/main/documentation/translate-transcription-to-another-language.md):
76
76
  Translate transcribed text to another language. This can be done for any transcription, including prerecorded transcriptions, live transcriptions or Polyglot session transcriptions.
77
77
 
78
- - [Get Transcription Data](https://github.com/vocalstack/js-sdk/blob/main/documentation/get-transcription-data.md):
79
- Get data from pending or completed transcriptions. This includes the transcription timeline, key words, summary, and paragraph segments.
78
+ - [Transcribe Audio from URL](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-audio-from-url-to-text.md):
79
+ Transcribe speech from pre-recorded audio in a URL to plain text. Major file formats are supported, including MP3, WAV, FLAC, and OGG.
80
80
 
81
81
  - [Client Side Authentication Tokens](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-on-the-front-end-with-auth-tokens.md):
82
82
  Create a temporary authentication token for client side requests. Safely implement API requests in web browsers without exposing your API keys.
83
83
 
84
- - [Transcription Sessions](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcription-sessions.md):
85
- Monitor and manage transcription state with sessions. Using sessions you can reconnect to a previously created asynchronous connection.
86
-
87
84
  - [Transcription Request and Response](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcription-request-and-response.md):
88
85
  Common request options and responses for all transcription operations. Use options to configure the transcription settings.
89
86
 
87
+ - [Transcribe and Present a Polyglot Session](https://github.com/vocalstack/js-sdk/blob/main/documentation/transcribe-and-present-a-polyglot-session.md):
88
+ Create a session that can be used to broadcast a live transcription via a public shareable link. Users can read live transcriptions in their preferred language, and even past transcriptions when your session is inactive.
89
+
@@ -0,0 +1,2 @@
1
+ export declare const EXPECTED_VOCALSTACK_API_VERSION = "1.1.0";
2
+ export declare const verifyApiVersion: (actualVersion: string | null, discontinued?: boolean) => void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifyApiVersion = exports.EXPECTED_VOCALSTACK_API_VERSION = void 0;
4
+ exports.EXPECTED_VOCALSTACK_API_VERSION = '1.1.0';
5
+ const verifyApiVersion = (actualVersion, discontinued = false) => {
6
+ if (!actualVersion) {
7
+ throw new Error('VocalStack API version is missing.');
8
+ }
9
+ if (discontinued) {
10
+ throw Error(`The VocalStack API has undergone a new release (v.${actualVersion}) and no longer supports this SDK. Please update the SDK to the latest version by running 'npm update @vocalstack/js-sdk'.`);
11
+ }
12
+ const [major, minor, patch] = parseVersion(actualVersion);
13
+ const [expectedMajor, expectedMinor, expectedPatch] = exports.EXPECTED_VOCALSTACK_API_VERSION.split('.').map((v) => parseInt(v, 10));
14
+ if (major < expectedMajor ||
15
+ (major === expectedMajor && minor < expectedMinor) ||
16
+ (major === expectedMajor && minor === expectedMinor && patch < expectedPatch)) {
17
+ throw new Error(`VocalStack API version ${actualVersion} is lower than that expected by this SDK. Expected version >= ${exports.EXPECTED_VOCALSTACK_API_VERSION}`);
18
+ }
19
+ if (major > expectedMajor || (major === expectedMajor && minor > expectedMinor)) {
20
+ const type = major > expectedMajor ? 'major' : 'minor';
21
+ console[type === 'major' ? 'error' : 'warn'](`The VocalStack API has undergone a new ${type} release (v.${actualVersion}). Your SDK version may not support all new API features. Consider updating by running 'npm update @vocalstack/js-sdk'.`);
22
+ }
23
+ };
24
+ exports.verifyApiVersion = verifyApiVersion;
25
+ function parseVersion(version) {
26
+ const regex = /^\d+\.\d+\.\d+$/;
27
+ if (!regex.test(version)) {
28
+ throw new Error(`Invalid version format: ${version}. Expected format "major.minor.patch" with numeric segments.`);
29
+ }
30
+ const segments = version.split('.').map((v) => parseInt(v, 10));
31
+ return [segments[0], segments[1], segments[2]];
32
+ }
package/dist/RestApi.js CHANGED
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.RestApi = void 0;
24
+ const ApiVersion_1 = require("./ApiVersion");
24
25
  class RestApi {
25
26
  constructor(apiServer, headers) {
26
27
  this.apiServer = apiServer;
@@ -57,14 +58,14 @@ class RestApi {
57
58
  const fixedPath = path.startsWith('/') ? path.slice(1) : path;
58
59
  const _a = options || {}, { json } = _a, fetchOptions = __rest(_a, ["json"]);
59
60
  const body = json ? JSON.stringify(json) : undefined;
60
- const headers = Object.assign({}, this.headers);
61
+ const headers = Object.assign(Object.assign({}, this.headers), { 'X-Expected-API-Version': ApiVersion_1.EXPECTED_VOCALSTACK_API_VERSION });
61
62
  if (body) {
62
63
  headers['Content-Type'] = 'application/json';
63
64
  }
64
65
  const response = yield fetch(`${this.apiServer}/${fixedPath}`, Object.assign({ method,
65
66
  headers,
66
67
  body }, fetchOptions));
67
- console.log('-->', response.headers);
68
+ (0, ApiVersion_1.verifyApiVersion)(response.headers.get('X-API-Version'), response.headers.get('X-API-Version-Discontinued') === '1');
68
69
  return this.respond(response);
69
70
  }
70
71
  catch (e) {
@@ -6,7 +6,6 @@ export declare const VOCALSTACK_API_SERVER = "https://api.vocalstack.com";
6
6
  export declare class VocalStackApi {
7
7
  protected headers: Record<string, string>;
8
8
  protected apiServer: string;
9
- protected apiVersion: string;
10
9
  constructor(config: Configuration);
11
10
  protected _rest(): RestApi;
12
11
  protected _ws(): WebSocketsApi;
@@ -16,5 +15,5 @@ export declare class VocalStackApi {
16
15
  badResponse: ApiResponse<null> | undefined;
17
16
  data: any;
18
17
  };
19
- protected buildQueryString(params: Record<string, undefined | string | number | boolean>): string;
18
+ protected buildQueryString(params: Record<string, undefined | string | number | boolean | Array<string | number | boolean>>): string;
20
19
  }
@@ -7,7 +7,6 @@ const generics_zod_1 = require("./generics.zod");
7
7
  exports.VOCALSTACK_API_SERVER = 'https://api.vocalstack.com';
8
8
  class VocalStackApi {
9
9
  constructor(config) {
10
- this.apiVersion = '1.0.7';
11
10
  const { apiServer, headers } = this.buildConfiguration(config);
12
11
  this.apiServer = apiServer;
13
12
  this.headers = headers;
@@ -43,8 +42,18 @@ class VocalStackApi {
43
42
  }
44
43
  buildQueryString(params) {
45
44
  return Object.entries(params)
46
- .filter(([, value]) => value !== undefined && value !== null && value !== '')
47
- .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
45
+ .flatMap(([key, value]) => {
46
+ if (value === undefined || value === null)
47
+ return [];
48
+ if (Array.isArray(value)) {
49
+ return value
50
+ .filter((v) => v !== undefined && v !== null && v !== '')
51
+ .map((v) => `${key}=${encodeURIComponent(String(v))}`);
52
+ }
53
+ if (value === '')
54
+ return [];
55
+ return [`${key}=${encodeURIComponent(String(value))}`];
56
+ })
48
57
  .join('&');
49
58
  }
50
59
  }
@@ -37,7 +37,7 @@ export type FinishedTranscriptionResponse = ApiResponse<FinishedTranscription>;
37
37
  export type AllTranscriptionsResponse = ApiResponse<SummaryTranscriptions>;
38
38
  export type AddTranscriptionTranslationRequest = {
39
39
  id: string;
40
- language: Language;
40
+ languages: Language[];
41
41
  };
42
42
  export type AddTranslationResponse = ApiResponse<{
43
43
  timeline: Timeline;
@@ -55,7 +55,6 @@ export type AddTranscriptionTranslationConnection = WebsocketConnection<AddTrans
55
55
  export declare class Transcriptions extends VocalStackApi {
56
56
  getTranscription({ id }: FinishedTranscriptionRequest): Promise<FinishedTranscriptionResponse>;
57
57
  getAllTranscriptions(): Promise<AllTranscriptionsResponse>;
58
- addTranslation({ id, language }: AddTranscriptionTranslationRequest): Promise<AddTranslationResponse>;
59
- removeTranslation(req: RemoveTranscriptionTranslationRequest): Promise<RemoveTranslationResponse>;
60
- addTranslationAsync(req: AddTranscriptionTranslationRequest): Promise<AddTranscriptionTranslationConnection>;
58
+ addTranslations({ id, languages }: AddTranscriptionTranslationRequest): Promise<AddTranslationResponse>;
59
+ addTranslationAsync({ id, languages, }: AddTranscriptionTranslationRequest): Promise<AddTranscriptionTranslationConnection>;
61
60
  }
@@ -22,20 +22,15 @@ class Transcriptions extends VocalStackApi_1.VocalStackApi {
22
22
  return this._rest().get('/transcriptions');
23
23
  });
24
24
  }
25
- addTranslation(_a) {
26
- return __awaiter(this, arguments, void 0, function* ({ id, language }) {
27
- return this._rest().post(`/transcription/${id}/language/${language}`);
25
+ addTranslations(_a) {
26
+ return __awaiter(this, arguments, void 0, function* ({ id, languages }) {
27
+ return this._rest().post(`/transcription/${id}/translate?${this.buildQueryString({ languages })}`);
28
28
  });
29
29
  }
30
- removeTranslation(req) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- return this._rest().delete(`/transcription/${req.id}/language/${req.language}`);
33
- });
34
- }
35
- addTranslationAsync(req) {
36
- return __awaiter(this, void 0, void 0, function* () {
30
+ addTranslationAsync(_a) {
31
+ return __awaiter(this, arguments, void 0, function* ({ id, languages, }) {
37
32
  return this._ws().connect({
38
- path: `/async/transcription/${req.id}/language/${req.language}`,
33
+ path: `/async/transcription/${id}/translate?${this.buildQueryString({ languages })}`,
39
34
  });
40
35
  });
41
36
  }
@@ -1,2 +1,2 @@
1
- export declare const EXPECTED_VOCALSTACK_API_VERSION = "1.0.7";
1
+ export declare const EXPECTED_VOCALSTACK_API_VERSION = "1.1.0";
2
2
  export declare const verifyApiVersion: (actualVersion: string | null, discontinued?: boolean) => void;
@@ -1,4 +1,4 @@
1
- export const EXPECTED_VOCALSTACK_API_VERSION = '1.0.7';
1
+ export const EXPECTED_VOCALSTACK_API_VERSION = '1.1.0';
2
2
  export const verifyApiVersion = (actualVersion, discontinued = false) => {
3
3
  if (!actualVersion) {
4
4
  throw new Error('VocalStack API version is missing.');
@@ -15,5 +15,5 @@ export declare class VocalStackApi {
15
15
  badResponse: ApiResponse<null> | undefined;
16
16
  data: any;
17
17
  };
18
- protected buildQueryString(params: Record<string, undefined | string | number | boolean>): string;
18
+ protected buildQueryString(params: Record<string, undefined | string | number | boolean | Array<string | number | boolean>>): string;
19
19
  }
@@ -39,8 +39,18 @@ export class VocalStackApi {
39
39
  }
40
40
  buildQueryString(params) {
41
41
  return Object.entries(params)
42
- .filter(([, value]) => value !== undefined && value !== null && value !== '')
43
- .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
42
+ .flatMap(([key, value]) => {
43
+ if (value === undefined || value === null)
44
+ return [];
45
+ if (Array.isArray(value)) {
46
+ return value
47
+ .filter((v) => v !== undefined && v !== null && v !== '')
48
+ .map((v) => `${key}=${encodeURIComponent(String(v))}`);
49
+ }
50
+ if (value === '')
51
+ return [];
52
+ return [`${key}=${encodeURIComponent(String(value))}`];
53
+ })
44
54
  .join('&');
45
55
  }
46
56
  }
@@ -37,7 +37,7 @@ export type FinishedTranscriptionResponse = ApiResponse<FinishedTranscription>;
37
37
  export type AllTranscriptionsResponse = ApiResponse<SummaryTranscriptions>;
38
38
  export type AddTranscriptionTranslationRequest = {
39
39
  id: string;
40
- language: Language;
40
+ languages: Language[];
41
41
  };
42
42
  export type AddTranslationResponse = ApiResponse<{
43
43
  timeline: Timeline;
@@ -55,7 +55,6 @@ export type AddTranscriptionTranslationConnection = WebsocketConnection<AddTrans
55
55
  export declare class Transcriptions extends VocalStackApi {
56
56
  getTranscription({ id }: FinishedTranscriptionRequest): Promise<FinishedTranscriptionResponse>;
57
57
  getAllTranscriptions(): Promise<AllTranscriptionsResponse>;
58
- addTranslation({ id, language }: AddTranscriptionTranslationRequest): Promise<AddTranslationResponse>;
59
- removeTranslation(req: RemoveTranscriptionTranslationRequest): Promise<RemoveTranslationResponse>;
60
- addTranslationAsync(req: AddTranscriptionTranslationRequest): Promise<AddTranscriptionTranslationConnection>;
58
+ addTranslations({ id, languages }: AddTranscriptionTranslationRequest): Promise<AddTranslationResponse>;
59
+ addTranslationAsync({ id, languages, }: AddTranscriptionTranslationRequest): Promise<AddTranscriptionTranslationConnection>;
61
60
  }
@@ -19,20 +19,15 @@ export class Transcriptions extends VocalStackApi {
19
19
  return this._rest().get('/transcriptions');
20
20
  });
21
21
  }
22
- addTranslation(_a) {
23
- return __awaiter(this, arguments, void 0, function* ({ id, language }) {
24
- return this._rest().post(`/transcription/${id}/language/${language}`);
22
+ addTranslations(_a) {
23
+ return __awaiter(this, arguments, void 0, function* ({ id, languages }) {
24
+ return this._rest().post(`/transcription/${id}/translate?${this.buildQueryString({ languages })}`);
25
25
  });
26
26
  }
27
- removeTranslation(req) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- return this._rest().delete(`/transcription/${req.id}/language/${req.language}`);
30
- });
31
- }
32
- addTranslationAsync(req) {
33
- return __awaiter(this, void 0, void 0, function* () {
27
+ addTranslationAsync(_a) {
28
+ return __awaiter(this, arguments, void 0, function* ({ id, languages, }) {
34
29
  return this._ws().connect({
35
- path: `/async/transcription/${req.id}/language/${req.language}`,
30
+ path: `/async/transcription/${id}/translate?${this.buildQueryString({ languages })}`,
36
31
  });
37
32
  });
38
33
  }
@@ -9,6 +9,8 @@ declare const zTimelineItem: z.ZodObject<{
9
9
  start: z.ZodNumber;
10
10
  end: z.ZodNumber;
11
11
  text: z.ZodString;
12
+ latest: z.ZodOptional<z.ZodBoolean>;
13
+ pending: z.ZodOptional<z.ZodBoolean>;
12
14
  language: z.ZodOptional<z.ZodEnum<["af", "am", "an", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ca", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "ga", "gl", "gu", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "jv", "ka", "kk", "km", "kn", "ko", "ku", "ky", "la", "lb", "lo", "lt", "lv", "mg", "mk", "ml", "mn", "mr", "ms", "mt", "nb", "ne", "nl", "nn", "no", "oc", "or", "pa", "pl", "ps", "pt", "qu", "ro", "ru", "rw", "se", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "ug", "uk", "ur", "vi", "vo", "wa", "xh", "zh", "zu"]>>;
13
15
  language_probability: z.ZodOptional<z.ZodNumber>;
14
16
  translations: z.ZodOptional<z.ZodRecord<z.ZodEnum<["af", "am", "an", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ca", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "ga", "gl", "gu", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "jv", "ka", "kk", "km", "kn", "ko", "ku", "ky", "la", "lb", "lo", "lt", "lv", "mg", "mk", "ml", "mn", "mr", "ms", "mt", "nb", "ne", "nl", "nn", "no", "oc", "or", "pa", "pl", "ps", "pt", "qu", "ro", "ru", "rw", "se", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "ug", "uk", "ur", "vi", "vo", "wa", "xh", "zh", "zu"]>, z.ZodString>>;
@@ -28,7 +30,9 @@ declare const zTimelineItem: z.ZodObject<{
28
30
  end: number;
29
31
  start: number;
30
32
  text: string;
33
+ pending?: boolean | undefined;
31
34
  language?: "id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu" | undefined;
35
+ latest?: boolean | undefined;
32
36
  language_probability?: number | undefined;
33
37
  translations?: Partial<Record<"id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu", string>> | undefined;
34
38
  execution_times?: {
@@ -41,7 +45,9 @@ declare const zTimelineItem: z.ZodObject<{
41
45
  end: number;
42
46
  start: number;
43
47
  text: string;
48
+ pending?: boolean | undefined;
44
49
  language?: "id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu" | undefined;
50
+ latest?: boolean | undefined;
45
51
  language_probability?: number | undefined;
46
52
  translations?: Partial<Record<"id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu", string>> | undefined;
47
53
  execution_times?: {
@@ -20,6 +20,8 @@ const zTimelineItem = z.object({
20
20
  start: z.number(),
21
21
  end: z.number(),
22
22
  text: z.string(),
23
+ latest: z.boolean().optional(),
24
+ pending: z.boolean().optional(),
23
25
  language: zLanguage.optional(),
24
26
  language_probability: z.number().optional(),
25
27
  translations: z.record(zLanguage, z.string()).optional(),
@@ -9,6 +9,8 @@ declare const zTimelineItem: z.ZodObject<{
9
9
  start: z.ZodNumber;
10
10
  end: z.ZodNumber;
11
11
  text: z.ZodString;
12
+ latest: z.ZodOptional<z.ZodBoolean>;
13
+ pending: z.ZodOptional<z.ZodBoolean>;
12
14
  language: z.ZodOptional<z.ZodEnum<["af", "am", "an", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ca", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "ga", "gl", "gu", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "jv", "ka", "kk", "km", "kn", "ko", "ku", "ky", "la", "lb", "lo", "lt", "lv", "mg", "mk", "ml", "mn", "mr", "ms", "mt", "nb", "ne", "nl", "nn", "no", "oc", "or", "pa", "pl", "ps", "pt", "qu", "ro", "ru", "rw", "se", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "ug", "uk", "ur", "vi", "vo", "wa", "xh", "zh", "zu"]>>;
13
15
  language_probability: z.ZodOptional<z.ZodNumber>;
14
16
  translations: z.ZodOptional<z.ZodRecord<z.ZodEnum<["af", "am", "an", "ar", "as", "az", "be", "bg", "bn", "br", "bs", "ca", "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fo", "fr", "ga", "gl", "gu", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "jv", "ka", "kk", "km", "kn", "ko", "ku", "ky", "la", "lb", "lo", "lt", "lv", "mg", "mk", "ml", "mn", "mr", "ms", "mt", "nb", "ne", "nl", "nn", "no", "oc", "or", "pa", "pl", "ps", "pt", "qu", "ro", "ru", "rw", "se", "si", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "ug", "uk", "ur", "vi", "vo", "wa", "xh", "zh", "zu"]>, z.ZodString>>;
@@ -28,7 +30,9 @@ declare const zTimelineItem: z.ZodObject<{
28
30
  end: number;
29
31
  start: number;
30
32
  text: string;
33
+ pending?: boolean | undefined;
31
34
  language?: "id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu" | undefined;
35
+ latest?: boolean | undefined;
32
36
  language_probability?: number | undefined;
33
37
  translations?: Partial<Record<"id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu", string>> | undefined;
34
38
  execution_times?: {
@@ -41,7 +45,9 @@ declare const zTimelineItem: z.ZodObject<{
41
45
  end: number;
42
46
  start: number;
43
47
  text: string;
48
+ pending?: boolean | undefined;
44
49
  language?: "id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu" | undefined;
50
+ latest?: boolean | undefined;
45
51
  language_probability?: number | undefined;
46
52
  translations?: Partial<Record<"id" | "cy" | "br" | "hr" | "th" | "tr" | "mn" | "ms" | "or" | "af" | "am" | "an" | "ar" | "as" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cs" | "da" | "de" | "dz" | "el" | "en" | "eo" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "ga" | "gl" | "gu" | "he" | "hi" | "ht" | "hu" | "hy" | "is" | "it" | "ja" | "jv" | "ka" | "kk" | "km" | "kn" | "ko" | "ku" | "ky" | "la" | "lb" | "lo" | "lt" | "lv" | "mg" | "mk" | "ml" | "mr" | "mt" | "nb" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "qu" | "ro" | "ru" | "rw" | "se" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "sw" | "ta" | "te" | "tl" | "ug" | "uk" | "ur" | "vi" | "vo" | "wa" | "xh" | "zh" | "zu", string>> | undefined;
47
53
  execution_times?: {
@@ -23,6 +23,8 @@ const zTimelineItem = zod_1.z.object({
23
23
  start: zod_1.z.number(),
24
24
  end: zod_1.z.number(),
25
25
  text: zod_1.z.string(),
26
+ latest: zod_1.z.boolean().optional(),
27
+ pending: zod_1.z.boolean().optional(),
26
28
  language: exports.zLanguage.optional(),
27
29
  language_probability: zod_1.z.number().optional(),
28
30
  translations: zod_1.z.record(exports.zLanguage, zod_1.z.string()).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocalstack/js-sdk",
3
- "version": "1.0.13",
3
+ "version": "1.1.0",
4
4
  "description": "A JavaScript API Client and SDK for VocalStack",
5
5
  "author": "VocalStack",
6
6
  "repository": {
@@ -16,8 +16,7 @@
16
16
  "module": "./dist/esm/index.js",
17
17
  "scripts": {
18
18
  "lint": "eslint",
19
- "build": "rm -rf ./dist && npm i && npm run version && tsc && tsc -p tsconfig.esm.json",
20
- "version": "node ./scripts/generate-version.js",
19
+ "build": "rm -rf ./dist && npm i && tsc && tsc -p tsconfig.esm.json",
21
20
  "docs": "rm -rf ./documentation && npm run --prefix ./../website script:docs -- $(node -e \"console.log(process.cwd())\")",
22
21
  "prepublish": "npm run docs",
23
22
  "prepare": "tsc -p tsconfig.esm.json"
@@ -43,6 +42,7 @@
43
42
  "transcription",
44
43
  "livestream",
45
44
  "ASR",
46
- "speech-to-text"
45
+ "speech-to-text",
46
+ "speech-to-speech"
47
47
  ]
48
48
  }
@@ -1 +0,0 @@
1
- export declare const version = "1.0.12";
@@ -1 +0,0 @@
1
- export const version = '1.0.12';