@deepgram/sdk 1.4.4 → 1.4.8
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/dist/billing.d.ts +19 -0
- package/dist/browser/httpFetch.d.ts +1 -0
- package/dist/browser/index.d.ts +21 -0
- package/dist/browser/index.js +1 -1
- package/dist/constants/defaultOptions.d.ts +6 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/enums/alternatives.d.ts +4 -0
- package/dist/enums/connectionState.d.ts +6 -0
- package/dist/enums/diarization.d.ts +4 -0
- package/dist/enums/index.d.ts +7 -0
- package/dist/enums/liveTranscriptionEvents.d.ts +6 -0
- package/dist/enums/models.d.ts +5 -0
- package/dist/enums/punctuation.d.ts +4 -0
- package/dist/enums/searchKind.d.ts +4 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/secondsToTimestamp.d.ts +1 -0
- package/dist/helpers/validateOptions.d.ts +1 -0
- package/dist/httpRequest.d.ts +3 -0
- package/dist/index.d.ts +20 -1341
- package/dist/index.js +1 -1
- package/dist/invitation.d.ts +30 -0
- package/dist/keys.d.ts +33 -0
- package/dist/members.d.ts +19 -0
- package/dist/projects.d.ts +22 -0
- package/dist/scopes.d.ts +21 -0
- package/dist/transcription/index.d.ts +18 -0
- package/dist/transcription/liveTranscription.d.ts +23 -0
- package/dist/transcription/preRecordedTranscription.d.ts +8 -0
- package/dist/types/balance.d.ts +6 -0
- package/dist/types/balanceList.d.ts +4 -0
- package/dist/types/channel.d.ts +25 -0
- package/dist/types/createKeyOptions.d.ts +13 -0
- package/dist/types/hit.d.ts +21 -0
- package/dist/types/index.d.ts +38 -0
- package/dist/types/invitationList.d.ts +4 -0
- package/dist/types/invitationOptions.d.ts +4 -0
- package/dist/types/key.d.ts +25 -0
- package/dist/types/keyResponse.d.ts +10 -0
- package/dist/types/keyResponseObj.d.ts +42 -0
- package/dist/types/keyword.d.ts +4 -0
- package/dist/types/liveTranscriptionOptions.d.ts +161 -0
- package/dist/types/liveTranscriptionResponse.d.ts +9 -0
- package/dist/types/member.d.ts +7 -0
- package/dist/types/memberList.d.ts +4 -0
- package/dist/types/message.d.ts +3 -0
- package/dist/types/metadata.d.ts +8 -0
- package/dist/types/prerecordedTranscriptionOptions.d.ts +139 -0
- package/dist/types/prerecordedTranscriptionResponse.d.ts +25 -0
- package/dist/types/project.d.ts +17 -0
- package/dist/types/projectPatchRequest.d.ts +4 -0
- package/dist/types/projectPatchResponse.d.ts +6 -0
- package/dist/types/projectResponse.d.ts +4 -0
- package/dist/types/requestFunction.d.ts +5 -0
- package/dist/types/scopeList.d.ts +3 -0
- package/dist/types/search.d.ts +14 -0
- package/dist/types/transcriptionSource.d.ts +14 -0
- package/dist/types/usageCallback.d.ts +4 -0
- package/dist/types/usageField.d.ts +7 -0
- package/dist/types/usageFieldOptions.d.ts +4 -0
- package/dist/types/usageOptions.d.ts +23 -0
- package/dist/types/usageRequest.d.ts +11 -0
- package/dist/types/usageRequestDetail.d.ts +30 -0
- package/dist/types/usageRequestList.d.ts +6 -0
- package/dist/types/usageRequestListOptions.d.ts +7 -0
- package/dist/types/usageRequestMessage.d.ts +3 -0
- package/dist/types/usageResponse.d.ts +10 -0
- package/dist/types/usageResponseDetail.d.ts +6 -0
- package/dist/types/utterance.d.ts +39 -0
- package/dist/types/wordBase.d.ts +8 -0
- package/dist/usage.d.ts +35 -0
- package/dist/userAgent.d.ts +1 -0
- package/package.json +4 -4
- package/webpack.config.js +1 -3
- package/CHANGELOG.md +0 -228
|
@@ -0,0 +1,39 @@
|
|
|
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 predicted speaker of the majority of words
|
|
32
|
+
* in the utterance who is saying the words being processed.
|
|
33
|
+
*/
|
|
34
|
+
speaker?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Unique identifier of the utterance
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
package/dist/usage.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RequestFunction, UsageField, UsageFieldOptions, UsageOptions, UsageRequest, UsageRequestList, UsageRequestListOptions, UsageResponse } from "./types";
|
|
2
|
+
export declare class Usage {
|
|
3
|
+
private _credentials;
|
|
4
|
+
private _apiUrl;
|
|
5
|
+
private _request;
|
|
6
|
+
constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
|
|
7
|
+
private apiPath;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves all requests associated with the provided projectId based
|
|
10
|
+
* on the provided options
|
|
11
|
+
* @param projectId Unique identifier of the project
|
|
12
|
+
* @param options Additional filter options
|
|
13
|
+
*/
|
|
14
|
+
listRequests(projectId: string, options?: UsageRequestListOptions): Promise<UsageRequestList>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a specific request associated with the provided projectId
|
|
17
|
+
* @param projectId Unique identifier of the project
|
|
18
|
+
* @param requestId Unique identifier for the request to retrieve
|
|
19
|
+
*/
|
|
20
|
+
getRequest(projectId: string, requestId: string): Promise<UsageRequest>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves usage associated with the provided projectId based
|
|
23
|
+
* on the provided options
|
|
24
|
+
* @param projectId Unique identifier of the project
|
|
25
|
+
* @param options Options to filter usage
|
|
26
|
+
*/
|
|
27
|
+
getUsage(projectId: string, options?: UsageOptions): Promise<UsageResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves features used by the provided projectId based
|
|
30
|
+
* on the provided options
|
|
31
|
+
* @param projectId Unique identifier of the project
|
|
32
|
+
* @param options Options to filter usage
|
|
33
|
+
*/
|
|
34
|
+
getFields(projectId: string, options?: UsageFieldOptions): Promise<UsageField>;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function userAgent(): string;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepgram/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"description": "An SDK for the Deepgram automated speech recognition platform",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "npm run build:lib && webpack --config webpack.config.js && npm run
|
|
7
|
+
"build": "npm run build:lib && webpack --config webpack.config.js && npm run types",
|
|
8
8
|
"build:lib": "tsc --project ./tsconfig.json && tsc --project ./tsconfig-es6.json",
|
|
9
9
|
"coverage": "nyc npm run test",
|
|
10
10
|
"lint": "eslint ./src --ext .ts && prettier --config .prettierrc src/*.ts src/**/*.ts --write",
|
|
11
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
|
+
"types": "copyfiles -f bundle/*.d.ts dist && copyfiles -u 1 bundle/**/*.d.ts dist"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./dist/index.js",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@typescript-eslint/parser": "^4.33.0",
|
|
48
48
|
"browserify": "^17.0.0",
|
|
49
49
|
"chai": "^4.3.4",
|
|
50
|
+
"copyfiles": "^2.4.1",
|
|
50
51
|
"eslint": "^7.32.0",
|
|
51
52
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
52
53
|
"eslint-plugin-import": "^2.25.2",
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"bufferutil": "^4.0.6",
|
|
66
|
-
"dts-generator": "^3.0.0",
|
|
67
67
|
"utf-8-validate": "^5.0.9",
|
|
68
68
|
"ws": "^7.5.5"
|
|
69
69
|
}
|
package/webpack.config.js
CHANGED
|
@@ -2,7 +2,7 @@ const path = require("path");
|
|
|
2
2
|
|
|
3
3
|
const clientConfig = {
|
|
4
4
|
name: "client",
|
|
5
|
-
target: "web",
|
|
5
|
+
target: "web",
|
|
6
6
|
entry: "./bundle/browser/index.js",
|
|
7
7
|
output: {
|
|
8
8
|
path: path.resolve(__dirname, "dist/browser"),
|
|
@@ -14,7 +14,6 @@ const clientConfig = {
|
|
|
14
14
|
experiments: {
|
|
15
15
|
outputModule: true,
|
|
16
16
|
},
|
|
17
|
-
//…
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const serverConfig = {
|
|
@@ -29,7 +28,6 @@ const serverConfig = {
|
|
|
29
28
|
type: "umd",
|
|
30
29
|
},
|
|
31
30
|
},
|
|
32
|
-
//…
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
module.exports = [serverConfig, clientConfig];
|
package/CHANGELOG.md
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## [1.4.4]
|
|
13
|
-
|
|
14
|
-
### Added
|
|
15
|
-
|
|
16
|
-
- Added `replace` to transcription option types
|
|
17
|
-
|
|
18
|
-
## [1.4.3]
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
|
|
22
|
-
- Added `tier` to transcription option types
|
|
23
|
-
|
|
24
|
-
## [1.4.2]
|
|
25
|
-
|
|
26
|
-
### Added
|
|
27
|
-
|
|
28
|
-
- Updated build step to build separate files for browser version
|
|
29
|
-
|
|
30
|
-
## [1.4.1]
|
|
31
|
-
|
|
32
|
-
### Added
|
|
33
|
-
|
|
34
|
-
- Small fix for npm deployment
|
|
35
|
-
|
|
36
|
-
## [1.4.0]
|
|
37
|
-
|
|
38
|
-
### Added
|
|
39
|
-
|
|
40
|
-
- Added Browser compatible versions of the live and preRecorded transcription methods
|
|
41
|
-
|
|
42
|
-
## [1.3.1]
|
|
43
|
-
|
|
44
|
-
### Updated
|
|
45
|
-
|
|
46
|
-
- Updated user-agent header to be generated on build rather than on demand. This should remove warnings when using webpack
|
|
47
|
-
|
|
48
|
-
## [1.3.0]
|
|
49
|
-
|
|
50
|
-
### Added
|
|
51
|
-
|
|
52
|
-
- Added Message Class for generic message responses
|
|
53
|
-
- Added member endpoint functionality
|
|
54
|
-
- This includes the `listMembers` and `removeMember` methods
|
|
55
|
-
- Added Member and MemberList Class
|
|
56
|
-
- Added scopes endpoint functionality
|
|
57
|
-
- This includes the `get` and `update` methods
|
|
58
|
-
- Added ScopeList Class
|
|
59
|
-
- Added invites endpoint functionality
|
|
60
|
-
- This includes the `list`, `send`, `leave` and `delete` methods
|
|
61
|
-
- Added InvitationOptions and InvitationList Class
|
|
62
|
-
- Added balances endpoint functionality
|
|
63
|
-
- This includes the `listBalances` and `getBalance` methods
|
|
64
|
-
- Added Balance and BalanceList Class
|
|
65
|
-
|
|
66
|
-
## [1.2.4]
|
|
67
|
-
|
|
68
|
-
### Fixed
|
|
69
|
-
|
|
70
|
-
- Getting the list of API keys was returning the wrong type of object. The SDK now returns the correct object type, but also returns what was previously implemented with deprecation notices.
|
|
71
|
-
- The `version` parameter was typed as required for both pre-recorded and live transcription. Changed this to be optional.
|
|
72
|
-
|
|
73
|
-
## [1.2.2]
|
|
74
|
-
|
|
75
|
-
### Updated
|
|
76
|
-
|
|
77
|
-
- Updated the `wordBase` type to include an optional `speaker` property.
|
|
78
|
-
- Updated the documentation for the speaker property of the `utterance` type.
|
|
79
|
-
|
|
80
|
-
## [1.2.1]
|
|
81
|
-
|
|
82
|
-
### Fixed
|
|
83
|
-
|
|
84
|
-
- Fixed a bug that caused real-time transcriptions to not close correctly. This
|
|
85
|
-
would result in the user not received the final transcription.
|
|
86
|
-
|
|
87
|
-
## [1.2.0]
|
|
88
|
-
|
|
89
|
-
### Updated
|
|
90
|
-
|
|
91
|
-
- Updated the `keys.create` function to allow new `expirationDate` or `timeToLive`
|
|
92
|
-
values. These are optional and one at most can be provided. Providing both will
|
|
93
|
-
throw an error.
|
|
94
|
-
|
|
95
|
-
## [1.1.0]
|
|
96
|
-
|
|
97
|
-
### Added
|
|
98
|
-
|
|
99
|
-
- Prerecorded transcription responses can now be used to generate WebVTT and
|
|
100
|
-
SRT caption files. Example:
|
|
101
|
-
|
|
102
|
-
```js
|
|
103
|
-
const response = await deepgram.transcription.preRecorded(
|
|
104
|
-
{ url: "URL_TO_FILE" },
|
|
105
|
-
{
|
|
106
|
-
punctuate: true,
|
|
107
|
-
utterances: true,
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
const webVTT = response.toWebVTT();
|
|
111
|
-
const SRT = response.toSRT();
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
The [utterances](https://developers.deepgram.com/documentation/features/utterances/)
|
|
115
|
-
feature is required to use this functionality.
|
|
116
|
-
|
|
117
|
-
## [1.0.3]
|
|
118
|
-
|
|
119
|
-
### Added
|
|
120
|
-
|
|
121
|
-
- In addition to a Url and Buffer, `trascricription.preRecorded` now accepts a
|
|
122
|
-
ReadStream as a source of the file to transcribe.
|
|
123
|
-
|
|
124
|
-
### Updated
|
|
125
|
-
|
|
126
|
-
- Removed a console log that occurred when an HTTP request ended
|
|
127
|
-
|
|
128
|
-
## [1.0.2]
|
|
129
|
-
|
|
130
|
-
### Added
|
|
131
|
-
|
|
132
|
-
- `deepgram.projects.update` will now update a project
|
|
133
|
-
- Prerecorded transcription responses now include utterances
|
|
134
|
-
|
|
135
|
-
### Updated
|
|
136
|
-
|
|
137
|
-
- The project type has been modified to the following:
|
|
138
|
-
|
|
139
|
-
```ts
|
|
140
|
-
{
|
|
141
|
-
project_id: string;
|
|
142
|
-
name?: string;
|
|
143
|
-
company?: string;
|
|
144
|
-
};
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
- The key type has been modified to the following:
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
{
|
|
151
|
-
api_key_id: string;
|
|
152
|
-
key?: string;
|
|
153
|
-
comment: string;
|
|
154
|
-
created: string;
|
|
155
|
-
scopes: Array<string>;
|
|
156
|
-
};
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
- The usage request type has been modified to the following:
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
{
|
|
163
|
-
request_id: string;
|
|
164
|
-
created: string;
|
|
165
|
-
path: string;
|
|
166
|
-
accessor: string;
|
|
167
|
-
response?: UsageRequestDetail | UsageRequestMessage;
|
|
168
|
-
callback?: UsageCallback;
|
|
169
|
-
};
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## [1.0.0]
|
|
173
|
-
|
|
174
|
-
### Added
|
|
175
|
-
|
|
176
|
-
#### Live transcription
|
|
177
|
-
|
|
178
|
-
- `deepgram.transcription.live` now manages a websocket connection to Deepgram's API
|
|
179
|
-
for live transcription
|
|
180
|
-
|
|
181
|
-
#### Projects
|
|
182
|
-
|
|
183
|
-
- `deepgram.projects` allows listing projects or getting a specific project from
|
|
184
|
-
your Deepgram account
|
|
185
|
-
|
|
186
|
-
### Updated
|
|
187
|
-
|
|
188
|
-
#### Pre-recorded transcription
|
|
189
|
-
|
|
190
|
-
- `deepgram.batch` has been moved to `deepgram.transcription.preRecorded`
|
|
191
|
-
- Type of `source` parameter of pre-recorded transcriptions has changed. You can now
|
|
192
|
-
send one of two types of objects: `{ url: YOUR_FILES_URL }` or
|
|
193
|
-
`{ buffer: BUFFER_OF_YOUR_FILE, mimetype: FILES_MIME_TYPE }`
|
|
194
|
-
|
|
195
|
-
#### API Key management
|
|
196
|
-
|
|
197
|
-
- All `deepgram.keys` methods now require a `projectId`.
|
|
198
|
-
- `deepgram.keys.create` now requires an additional parameter `scopes`. This is a
|
|
199
|
-
string array specifying the scopes available to the newly created API key
|
|
200
|
-
|
|
201
|
-
## [0.6.5]
|
|
202
|
-
|
|
203
|
-
- Added notice to README to denote the library is in a very unstable state.
|
|
204
|
-
|
|
205
|
-
## [0.6.4]
|
|
206
|
-
|
|
207
|
-
### Added
|
|
208
|
-
|
|
209
|
-
- `transcribe` method will now return transcription results for both urls or buffers.
|
|
210
|
-
- `keys` now provides `create`, `list`, and `delete` methods that allow managing of
|
|
211
|
-
API keys.
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
[unreleased]: https://github.com/deepgram/node-sdk/compare/1.4.0...HEAD
|
|
216
|
-
[1.4.0]: https://github.com/deepgram/node-sdk/compare/1.3.1...1.4.0
|
|
217
|
-
[1.3.1]: https://github.com/deepgram/node-sdk/compare/1.3.0...1.3.1
|
|
218
|
-
[1.3.0]: https://github.com/deepgram/node-sdk/compare/1.2.4...1.3.0
|
|
219
|
-
[1.2.4]: https://github.com/deepgram/node-sdk/compare/1.2.2...1.2.4
|
|
220
|
-
[1.2.2]: https://github.com/deepgram/node-sdk/compare/1.2.1...1.2.2
|
|
221
|
-
[1.2.1]: https://github.com/deepgram/node-sdk/compare/1.2.0...1.2.1
|
|
222
|
-
[1.2.0]: https://github.com/deepgram/node-sdk/compare/1.1.0...1.2.0
|
|
223
|
-
[1.1.0]: https://github.com/deepgram/node-sdk/compare/1.0.3...1.1.0
|
|
224
|
-
[1.0.3]: https://github.com/deepgram/node-sdk/compare/1.0.2...1.0.3
|
|
225
|
-
[1.0.2]: https://github.com/deepgram/node-sdk/compare/1.0.0...1.0.2
|
|
226
|
-
[1.0.0]: https://github.com/deepgram/node-sdk/compare/0.6.5...1.0.0
|
|
227
|
-
[0.6.5]: https://github.com/deepgram/node-sdk/compare/0.6.4...0.6.5
|
|
228
|
-
[0.6.4]: https://github.com/deepgram/node-sdk/compare/edc07b4...0.6.4
|