@deepgram/sdk 1.0.1 → 1.2.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/CHANGELOG.md +89 -1
- package/README.md +41 -734
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +14 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/secondsToTimestamp.d.ts +1 -0
- package/dist/helpers/secondsToTimestamp.js +8 -0
- package/dist/helpers/secondsToTimestamp.js.map +1 -0
- package/dist/httpRequest.d.ts +2 -1
- package/dist/httpRequest.js +22 -13
- package/dist/httpRequest.js.map +1 -1
- package/dist/keys.d.ts +3 -2
- package/dist/keys.js +19 -5
- package/dist/keys.js.map +1 -1
- package/dist/projects.d.ts +6 -1
- package/dist/projects.js +13 -2
- package/dist/projects.js.map +1 -1
- package/dist/transcription/index.js +1 -1
- package/dist/transcription/index.js.map +1 -1
- package/dist/transcription/liveTranscription.js +1 -1
- package/dist/transcription/liveTranscription.js.map +1 -1
- package/dist/transcription/preRecordedTranscription.js +35 -10
- package/dist/transcription/preRecordedTranscription.js.map +1 -1
- package/dist/types/createKeyOptions.d.ts +13 -0
- package/dist/types/createKeyOptions.js +3 -0
- package/dist/types/createKeyOptions.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/key.d.ts +2 -2
- package/dist/types/prerecordedTranscriptionResponse.d.ts +18 -2
- package/dist/types/prerecordedTranscriptionResponse.js +48 -0
- package/dist/types/prerecordedTranscriptionResponse.js.map +1 -1
- package/dist/types/project.d.ts +6 -2
- package/dist/types/projectPatchResponse.d.ts +6 -0
- package/dist/types/projectPatchResponse.js +3 -0
- package/dist/types/projectPatchResponse.js.map +1 -0
- package/dist/types/transcriptionSource.d.ts +6 -1
- package/dist/types/usageRequest.d.ts +1 -1
- package/dist/types/utterance.d.ts +38 -0
- package/dist/types/utterance.js +3 -0
- package/dist/types/utterance.js.map +1 -0
- package/dist/usage.js +4 -4
- package/dist/usage.js.map +1 -1
- package/package.json +18 -18
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { WordBase } from "./wordBase";
|
|
2
|
+
export declare type Utterance = {
|
|
3
|
+
/**
|
|
4
|
+
* Start time (in seconds) from the beginning of the audio stream.
|
|
5
|
+
*/
|
|
6
|
+
start: number;
|
|
7
|
+
/**
|
|
8
|
+
* End time (in seconds) from the beginning of the audio stream.
|
|
9
|
+
*/
|
|
10
|
+
end: number;
|
|
11
|
+
/**
|
|
12
|
+
* Floating point value between 0 and 1 that indicates overall transcript
|
|
13
|
+
* reliability. Larger values indicate higher confidence.
|
|
14
|
+
*/
|
|
15
|
+
confidence: number;
|
|
16
|
+
/**
|
|
17
|
+
* Audio channel to which the utterance belongs. When using multichannel audio,
|
|
18
|
+
* utterances are chronologically ordered by channel.
|
|
19
|
+
*/
|
|
20
|
+
channel: number;
|
|
21
|
+
/**
|
|
22
|
+
* Transcript for the audio segment being processed.
|
|
23
|
+
*/
|
|
24
|
+
transcript: string;
|
|
25
|
+
/**
|
|
26
|
+
* Object containing each word in the transcript, along with its start time
|
|
27
|
+
* and end time (in seconds) from the beginning of the audio stream, and a confidence value.
|
|
28
|
+
*/
|
|
29
|
+
words: Array<WordBase>;
|
|
30
|
+
/**
|
|
31
|
+
* Integer indicating the speaker who is saying the word being processed.
|
|
32
|
+
*/
|
|
33
|
+
speaker?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Unique identifier of the utterance
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utterance.js","sourceRoot":"","sources":["../../src/types/utterance.ts"],"names":[],"mappings":""}
|
package/dist/usage.js
CHANGED
|
@@ -70,7 +70,7 @@ var Usage = /** @class */ (function () {
|
|
|
70
70
|
var requestOptions;
|
|
71
71
|
return __generator(this, function (_a) {
|
|
72
72
|
requestOptions = __assign({}, options);
|
|
73
|
-
return [2 /*return*/, httpRequest_1._request("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/requests?" + querystring_1.default.stringify(requestOptions))];
|
|
73
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/requests?" + querystring_1.default.stringify(requestOptions))];
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
};
|
|
@@ -82,7 +82,7 @@ var Usage = /** @class */ (function () {
|
|
|
82
82
|
Usage.prototype.getRequest = function (projectId, requestId) {
|
|
83
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
84
|
return __generator(this, function (_a) {
|
|
85
|
-
return [2 /*return*/, httpRequest_1._request("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/requests/" + requestId)];
|
|
85
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/requests/" + requestId)];
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
};
|
|
@@ -97,7 +97,7 @@ var Usage = /** @class */ (function () {
|
|
|
97
97
|
var requestOptions;
|
|
98
98
|
return __generator(this, function (_a) {
|
|
99
99
|
requestOptions = __assign({}, options);
|
|
100
|
-
return [2 /*return*/, httpRequest_1._request("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/usage?" + querystring_1.default.stringify(requestOptions))];
|
|
100
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/usage?" + querystring_1.default.stringify(requestOptions))];
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
};
|
|
@@ -112,7 +112,7 @@ var Usage = /** @class */ (function () {
|
|
|
112
112
|
var requestOptions;
|
|
113
113
|
return __generator(this, function (_a) {
|
|
114
114
|
requestOptions = __assign({}, options);
|
|
115
|
-
return [2 /*return*/, httpRequest_1._request("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/usage/fields?" + querystring_1.default.stringify(requestOptions))];
|
|
115
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/usage/fields?" + querystring_1.default.stringify(requestOptions))];
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
118
|
};
|
package/dist/usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAsC;AACtC,6CAAyC;AAWzC;IACE,eAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;;;OAKG;IACG,4BAAY,GAAlB,UACE,SAAiB,EACjB,OAAiC;;;;gBAE3B,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,sBAAQ,
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAsC;AACtC,6CAAyC;AAWzC;IACE,eAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;;;OAKG;IACG,4BAAY,GAAlB,UACE,SAAiB,EACjB,OAAiC;;;;gBAE3B,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,kBAAa,qBAAW,CAAC,SAAS,CAC5D,cAAc,CACb,CACJ,EAAC;;;KACH;IAED;;;;OAIG;IACG,0BAAU,GAAhB,UACE,SAAiB,EACjB,SAAiB;;;gBAEjB,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,kBAAa,SAAW,CACrD,EAAC;;;KACH;IAED;;;;;OAKG;IACG,wBAAQ,GAAd,UACE,SAAiB,EACjB,OAAsB;;;;gBAEhB,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,eAAU,qBAAW,CAAC,SAAS,CACzD,cAAc,CACb,CACJ,EAAC;;;KACH;IAED;;;;;OAKG;IACG,yBAAS,GAAf,UACE,SAAiB,EACjB,OAA2B;;;;gBAErB,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,sBAAiB,qBAAW,CAAC,SAAS,CAChE,cAAc,CACb,CACJ,EAAC;;;KACH;IACH,YAAC;AAAD,CAAC,AApFD,IAoFC;AApFY,sBAAK"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepgram/sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "An SDK for the Deepgram automated speech recognition platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -p ./",
|
|
9
9
|
"coverage": "nyc npm run test",
|
|
10
|
-
"lint": "eslint ./src --ext .ts && prettier --config .prettierrc src/**/*.ts --write",
|
|
11
|
-
"test": "mocha -r ts-node/register tests/**/*test.ts --insect",
|
|
10
|
+
"lint": "eslint ./src --ext .ts && prettier --config .prettierrc src/*.ts src/**/*.ts --write",
|
|
11
|
+
"test": "mocha -r ts-node/register tests/*test.ts tests/**/*test.ts --insect",
|
|
12
12
|
"watch": "nodemon -e ts --watch src --exec \"npm run build\""
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
@@ -31,27 +31,27 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/deepgram/node-sdk#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/chai": "^4.2.
|
|
35
|
-
"@types/mocha": "^
|
|
36
|
-
"@types/node": "^14.17.
|
|
37
|
-
"@types/sinon": "^10.0.
|
|
38
|
-
"@types/ws": "^7.4.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
40
|
-
"@typescript-eslint/parser": "^4.
|
|
34
|
+
"@types/chai": "^4.2.22",
|
|
35
|
+
"@types/mocha": "^9.0.0",
|
|
36
|
+
"@types/node": "^14.17.32",
|
|
37
|
+
"@types/sinon": "^10.0.6",
|
|
38
|
+
"@types/ws": "^7.4.7",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
40
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
|
-
"eslint": "^7.
|
|
42
|
+
"eslint": "^7.32.0",
|
|
43
43
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
44
|
-
"eslint-plugin-import": "^2.
|
|
45
|
-
"mocha": "^
|
|
46
|
-
"nock": "^13.
|
|
47
|
-
"nodemon": "^2.0.
|
|
44
|
+
"eslint-plugin-import": "^2.25.2",
|
|
45
|
+
"mocha": "^9.1.3",
|
|
46
|
+
"nock": "^13.1.4",
|
|
47
|
+
"nodemon": "^2.0.14",
|
|
48
48
|
"nyc": "^15.1.0",
|
|
49
|
-
"prettier": "^2.
|
|
49
|
+
"prettier": "^2.4.1",
|
|
50
50
|
"sinon": "^10.0.0",
|
|
51
51
|
"ts-node": "^9.1.1",
|
|
52
|
-
"typescript": "^4.
|
|
52
|
+
"typescript": "^4.4.4"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"ws": "^7.
|
|
55
|
+
"ws": "^7.5.5"
|
|
56
56
|
}
|
|
57
57
|
}
|