-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeepgram.ts
45 lines (40 loc) · 1.12 KB
/
deepgram.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
Scopes,
DefaultOptions,
validateOptions,
Transcriber,
Projects,
Members,
Keys,
Usage,
Invitation,
Billing,
} from "./deps.ts";
export class Deepgram {
private _apiUrl: string;
private _apiKey: string;
scopes: Scopes;
transcription: Transcriber;
projects: Projects;
members: Members;
keys: Keys;
usage: Usage;
invitation: Invitation;
billing: Billing;
constructor(apiKey: string, apiUrl?: string) {
this._apiKey = apiKey;
this._apiUrl = apiUrl || DefaultOptions.apiUrl;
/**
* Ensures that the provided options were provided
*/
validateOptions(this._apiKey, this._apiUrl);
this.scopes = new Scopes(this._apiKey, this._apiUrl);
this.transcription = new Transcriber(this._apiKey, this._apiUrl);
this.projects = new Projects(this._apiKey, this._apiUrl);
this.members = new Members(this._apiKey, this._apiUrl);
this.keys = new Keys(this._apiKey, this._apiUrl);
this.usage = new Usage(this._apiKey, this._apiUrl);
this.invitation = new Invitation(this._apiKey, this._apiUrl);
this.billing = new Billing(this._apiKey, this._apiUrl);
}
}