@vocalstack/js-sdk 1.0.12
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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/RestApi.d.ts +21 -0
- package/dist/RestApi.js +93 -0
- package/dist/VocalStackApi.d.ts +19 -0
- package/dist/VocalStackApi.js +50 -0
- package/dist/WebsocketApi.d.ts +38 -0
- package/dist/WebsocketApi.js +156 -0
- package/dist/apis/Billing.d.ts +59 -0
- package/dist/apis/Billing.js +21 -0
- package/dist/apis/LiveTranscription.d.ts +58 -0
- package/dist/apis/LiveTranscription.js +55 -0
- package/dist/apis/Polyglot.d.ts +113 -0
- package/dist/apis/Polyglot.js +68 -0
- package/dist/apis/Security.d.ts +25 -0
- package/dist/apis/Security.js +35 -0
- package/dist/apis/Transcriptions.d.ts +61 -0
- package/dist/apis/Transcriptions.js +43 -0
- package/dist/apis/UrlTranscription.d.ts +59 -0
- package/dist/apis/UrlTranscription.js +53 -0
- package/dist/apis/index.d.ts +6 -0
- package/dist/apis/index.js +22 -0
- package/dist/esm/RestApi.d.ts +21 -0
- package/dist/esm/RestApi.js +89 -0
- package/dist/esm/VocalStackApi.d.ts +19 -0
- package/dist/esm/VocalStackApi.js +46 -0
- package/dist/esm/WebsocketApi.d.ts +38 -0
- package/dist/esm/WebsocketApi.js +146 -0
- package/dist/esm/apis/Billing.d.ts +59 -0
- package/dist/esm/apis/Billing.js +17 -0
- package/dist/esm/apis/LiveTranscription.d.ts +58 -0
- package/dist/esm/apis/LiveTranscription.js +51 -0
- package/dist/esm/apis/Polyglot.d.ts +113 -0
- package/dist/esm/apis/Polyglot.js +64 -0
- package/dist/esm/apis/Security.d.ts +25 -0
- package/dist/esm/apis/Security.js +31 -0
- package/dist/esm/apis/Transcriptions.d.ts +61 -0
- package/dist/esm/apis/Transcriptions.js +39 -0
- package/dist/esm/apis/UrlTranscription.d.ts +59 -0
- package/dist/esm/apis/UrlTranscription.js +49 -0
- package/dist/esm/apis/index.d.ts +6 -0
- package/dist/esm/apis/index.js +6 -0
- package/dist/esm/generics.zod.d.ts +77 -0
- package/dist/esm/generics.zod.js +45 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/generics.zod.d.ts +77 -0
- package/dist/generics.zod.js +48 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/package.json +47 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zConfiguration = exports.zLanguage = exports.zDuration = exports.zUrl = exports.zUuid = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.zUuid = zod_1.z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(new RegExp('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89ABab][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$'), {
|
|
8
|
+
message: 'Invalid UUID',
|
|
9
|
+
});
|
|
10
|
+
exports.zUrl = zod_1.z.string().regex(new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
11
|
+
'(localhost|' + // localhost (for local development)
|
|
12
|
+
'(([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
|
13
|
+
'(\\d{1,3}\\.){3}\\d{1,3})' + // OR ip (v4) address
|
|
14
|
+
'(\\:\\d+)?' + // port
|
|
15
|
+
'(\\/[-a-z\\d%_.~+:@/]*)*' + // path
|
|
16
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
17
|
+
'(\\#[-a-z\\d_]*)?$', // fragment identifier
|
|
18
|
+
'i'), { message: 'Invalid URL' });
|
|
19
|
+
exports.zDuration = zod_1.z.number().optional();
|
|
20
|
+
// prettier-ignore
|
|
21
|
+
exports.zLanguage = zod_1.z.enum(['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']);
|
|
22
|
+
const zTimelineItem = zod_1.z.object({
|
|
23
|
+
start: zod_1.z.number(),
|
|
24
|
+
end: zod_1.z.number(),
|
|
25
|
+
text: zod_1.z.string(),
|
|
26
|
+
language: exports.zLanguage.optional(),
|
|
27
|
+
language_probability: zod_1.z.number().optional(),
|
|
28
|
+
translations: zod_1.z.record(exports.zLanguage, zod_1.z.string()).optional(),
|
|
29
|
+
execution_times: zod_1.z
|
|
30
|
+
.object({ language_detection: zod_1.z.number().optional(), translation: zod_1.z.record(exports.zLanguage, zod_1.z.number()).optional() })
|
|
31
|
+
.optional(),
|
|
32
|
+
temperature: zod_1.z.number().optional(),
|
|
33
|
+
words: zod_1.z
|
|
34
|
+
.tuple([
|
|
35
|
+
zod_1.z.number(), // start
|
|
36
|
+
zod_1.z.number(), // end
|
|
37
|
+
zod_1.z.string(), // text
|
|
38
|
+
zod_1.z.number(), // probability
|
|
39
|
+
])
|
|
40
|
+
.array()
|
|
41
|
+
.optional(),
|
|
42
|
+
});
|
|
43
|
+
exports.zConfiguration = zod_1.z.object({
|
|
44
|
+
apiKey: zod_1.z.string().optional(),
|
|
45
|
+
authToken: zod_1.z.string().optional(),
|
|
46
|
+
apiServer: zod_1.z.string().optional(),
|
|
47
|
+
headers: zod_1.z.record(zod_1.z.string()).optional(),
|
|
48
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./apis/index"), exports);
|
|
18
|
+
__exportStar(require("./generics.zod"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vocalstack/js-sdk",
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"description": "A JavaScript API Client and SDK for VocalStack",
|
|
5
|
+
"author": "VocalStack",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+ssh://git@github.com/vocalstack/js-sdk.git"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16.20.2",
|
|
12
|
+
"npm": ">=8.19.4"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"typings": "./dist/index.d.ts",
|
|
16
|
+
"module": "./dist/esm/index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"lint": "eslint",
|
|
19
|
+
"build": "rm -rf ./dist && npm i && tsc && tsc -p tsconfig.esm.json",
|
|
20
|
+
"docs": "rm -rf ./documentation && npm run --prefix ./../website script:docs -- $(node -e \"console.log(process.cwd())\")",
|
|
21
|
+
"prepublish": "npm run docs",
|
|
22
|
+
"prepare": "tsc -p tsconfig.esm.json"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"ws": "^8.18.0",
|
|
26
|
+
"zod": "^3.23.8"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^22.9.0",
|
|
30
|
+
"eslint": "^8.57.0",
|
|
31
|
+
"eslint-config-prettier": "^9.1.0",
|
|
32
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
33
|
+
"typescript": "^5.3.3"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "restricted"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"vocalstack",
|
|
40
|
+
"api",
|
|
41
|
+
"sdk",
|
|
42
|
+
"transcription",
|
|
43
|
+
"livestream",
|
|
44
|
+
"ASR",
|
|
45
|
+
"speech-to-text"
|
|
46
|
+
]
|
|
47
|
+
}
|