@deepgram/sdk 1.4.1 → 1.4.2

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.
Files changed (218) hide show
  1. package/dist/browser/index.js +1 -1659
  2. package/dist/index.js +1 -1
  3. package/package.json +9 -6
  4. package/tsconfig-es6.json +16 -0
  5. package/webpack.config.js +21 -1
  6. package/bundle/billing.d.ts +0 -19
  7. package/bundle/billing.js +0 -73
  8. package/bundle/billing.js.map +0 -1
  9. package/bundle/browser/httpFetch.d.ts +0 -1
  10. package/bundle/browser/httpFetch.js +0 -75
  11. package/bundle/browser/httpFetch.js.map +0 -1
  12. package/bundle/browser/index.d.ts +0 -21
  13. package/bundle/browser/index.js +0 -35
  14. package/bundle/browser/index.js.map +0 -1
  15. package/bundle/browser/transcription/index.d.ts +0 -17
  16. package/bundle/browser/transcription/index.js +0 -75
  17. package/bundle/browser/transcription/index.js.map +0 -1
  18. package/bundle/browser/transcription/preRecordedTranscription.d.ts +0 -9
  19. package/bundle/browser/transcription/preRecordedTranscription.js +0 -87
  20. package/bundle/browser/transcription/preRecordedTranscription.js.map +0 -1
  21. package/bundle/constants/defaultOptions.d.ts +0 -6
  22. package/bundle/constants/defaultOptions.js +0 -10
  23. package/bundle/constants/defaultOptions.js.map +0 -1
  24. package/bundle/constants/index.d.ts +0 -1
  25. package/bundle/constants/index.js +0 -18
  26. package/bundle/constants/index.js.map +0 -1
  27. package/bundle/enums/alternatives.d.ts +0 -4
  28. package/bundle/enums/alternatives.js +0 -3
  29. package/bundle/enums/alternatives.js.map +0 -1
  30. package/bundle/enums/connectionState.d.ts +0 -6
  31. package/bundle/enums/connectionState.js +0 -11
  32. package/bundle/enums/connectionState.js.map +0 -1
  33. package/bundle/enums/diarization.d.ts +0 -4
  34. package/bundle/enums/diarization.js +0 -3
  35. package/bundle/enums/diarization.js.map +0 -1
  36. package/bundle/enums/index.d.ts +0 -7
  37. package/bundle/enums/index.js +0 -24
  38. package/bundle/enums/index.js.map +0 -1
  39. package/bundle/enums/liveTranscriptionEvents.d.ts +0 -6
  40. package/bundle/enums/liveTranscriptionEvents.js +0 -3
  41. package/bundle/enums/liveTranscriptionEvents.js.map +0 -1
  42. package/bundle/enums/models.d.ts +0 -5
  43. package/bundle/enums/models.js +0 -3
  44. package/bundle/enums/models.js.map +0 -1
  45. package/bundle/enums/punctuation.d.ts +0 -4
  46. package/bundle/enums/punctuation.js +0 -3
  47. package/bundle/enums/punctuation.js.map +0 -1
  48. package/bundle/enums/searchKind.d.ts +0 -4
  49. package/bundle/enums/searchKind.js +0 -3
  50. package/bundle/enums/searchKind.js.map +0 -1
  51. package/bundle/helpers/index.d.ts +0 -2
  52. package/bundle/helpers/index.js +0 -19
  53. package/bundle/helpers/index.js.map +0 -1
  54. package/bundle/helpers/secondsToTimestamp.d.ts +0 -1
  55. package/bundle/helpers/secondsToTimestamp.js +0 -8
  56. package/bundle/helpers/secondsToTimestamp.js.map +0 -1
  57. package/bundle/helpers/validateOptions.d.ts +0 -1
  58. package/bundle/helpers/validateOptions.js +0 -13
  59. package/bundle/helpers/validateOptions.js.map +0 -1
  60. package/bundle/httpRequest.d.ts +0 -3
  61. package/bundle/httpRequest.js +0 -91
  62. package/bundle/httpRequest.js.map +0 -1
  63. package/bundle/index.d.ts +0 -21
  64. package/bundle/index.js +0 -35
  65. package/bundle/index.js.map +0 -1
  66. package/bundle/invitation.d.ts +0 -30
  67. package/bundle/invitation.js +0 -99
  68. package/bundle/invitation.js.map +0 -1
  69. package/bundle/keys.d.ts +0 -33
  70. package/bundle/keys.js +0 -132
  71. package/bundle/keys.js.map +0 -1
  72. package/bundle/members.d.ts +0 -19
  73. package/bundle/members.js +0 -73
  74. package/bundle/members.js.map +0 -1
  75. package/bundle/projects.d.ts +0 -22
  76. package/bundle/projects.js +0 -82
  77. package/bundle/projects.js.map +0 -1
  78. package/bundle/scopes.d.ts +0 -21
  79. package/bundle/scopes.js +0 -77
  80. package/bundle/scopes.js.map +0 -1
  81. package/bundle/transcription/index.d.ts +0 -18
  82. package/bundle/transcription/index.js +0 -72
  83. package/bundle/transcription/index.js.map +0 -1
  84. package/bundle/transcription/liveTranscription.d.ts +0 -23
  85. package/bundle/transcription/liveTranscription.js +0 -83
  86. package/bundle/transcription/liveTranscription.js.map +0 -1
  87. package/bundle/transcription/preRecordedTranscription.d.ts +0 -8
  88. package/bundle/transcription/preRecordedTranscription.js +0 -114
  89. package/bundle/transcription/preRecordedTranscription.js.map +0 -1
  90. package/bundle/types/balance.d.ts +0 -6
  91. package/bundle/types/balance.js +0 -3
  92. package/bundle/types/balance.js.map +0 -1
  93. package/bundle/types/balanceList.d.ts +0 -4
  94. package/bundle/types/balanceList.js +0 -3
  95. package/bundle/types/balanceList.js.map +0 -1
  96. package/bundle/types/channel.d.ts +0 -25
  97. package/bundle/types/channel.js +0 -3
  98. package/bundle/types/channel.js.map +0 -1
  99. package/bundle/types/createKeyOptions.d.ts +0 -13
  100. package/bundle/types/createKeyOptions.js +0 -3
  101. package/bundle/types/createKeyOptions.js.map +0 -1
  102. package/bundle/types/hit.d.ts +0 -21
  103. package/bundle/types/hit.js +0 -3
  104. package/bundle/types/hit.js.map +0 -1
  105. package/bundle/types/index.d.ts +0 -38
  106. package/bundle/types/index.js +0 -55
  107. package/bundle/types/index.js.map +0 -1
  108. package/bundle/types/invitationList.d.ts +0 -4
  109. package/bundle/types/invitationList.js +0 -3
  110. package/bundle/types/invitationList.js.map +0 -1
  111. package/bundle/types/invitationOptions.d.ts +0 -4
  112. package/bundle/types/invitationOptions.js +0 -3
  113. package/bundle/types/invitationOptions.js.map +0 -1
  114. package/bundle/types/key.d.ts +0 -25
  115. package/bundle/types/key.js +0 -3
  116. package/bundle/types/key.js.map +0 -1
  117. package/bundle/types/keyResponse.d.ts +0 -10
  118. package/bundle/types/keyResponse.js +0 -3
  119. package/bundle/types/keyResponse.js.map +0 -1
  120. package/bundle/types/keyResponseObj.d.ts +0 -42
  121. package/bundle/types/keyResponseObj.js +0 -3
  122. package/bundle/types/keyResponseObj.js.map +0 -1
  123. package/bundle/types/keyword.d.ts +0 -4
  124. package/bundle/types/keyword.js +0 -3
  125. package/bundle/types/keyword.js.map +0 -1
  126. package/bundle/types/liveTranscriptionOptions.d.ts +0 -148
  127. package/bundle/types/liveTranscriptionOptions.js +0 -3
  128. package/bundle/types/liveTranscriptionOptions.js.map +0 -1
  129. package/bundle/types/liveTranscriptionResponse.d.ts +0 -9
  130. package/bundle/types/liveTranscriptionResponse.js +0 -3
  131. package/bundle/types/liveTranscriptionResponse.js.map +0 -1
  132. package/bundle/types/member.d.ts +0 -7
  133. package/bundle/types/member.js +0 -3
  134. package/bundle/types/member.js.map +0 -1
  135. package/bundle/types/memberList.d.ts +0 -4
  136. package/bundle/types/memberList.js +0 -3
  137. package/bundle/types/memberList.js.map +0 -1
  138. package/bundle/types/message.d.ts +0 -3
  139. package/bundle/types/message.js +0 -3
  140. package/bundle/types/message.js.map +0 -1
  141. package/bundle/types/metadata.d.ts +0 -8
  142. package/bundle/types/metadata.js +0 -3
  143. package/bundle/types/metadata.js.map +0 -1
  144. package/bundle/types/prerecordedTranscriptionOptions.d.ts +0 -126
  145. package/bundle/types/prerecordedTranscriptionOptions.js +0 -3
  146. package/bundle/types/prerecordedTranscriptionOptions.js.map +0 -1
  147. package/bundle/types/prerecordedTranscriptionResponse.d.ts +0 -25
  148. package/bundle/types/prerecordedTranscriptionResponse.js +0 -51
  149. package/bundle/types/prerecordedTranscriptionResponse.js.map +0 -1
  150. package/bundle/types/project.d.ts +0 -17
  151. package/bundle/types/project.js +0 -3
  152. package/bundle/types/project.js.map +0 -1
  153. package/bundle/types/projectPatchRequest.d.ts +0 -4
  154. package/bundle/types/projectPatchRequest.js +0 -3
  155. package/bundle/types/projectPatchRequest.js.map +0 -1
  156. package/bundle/types/projectPatchResponse.d.ts +0 -6
  157. package/bundle/types/projectPatchResponse.js +0 -3
  158. package/bundle/types/projectPatchResponse.js.map +0 -1
  159. package/bundle/types/projectResponse.d.ts +0 -4
  160. package/bundle/types/projectResponse.js +0 -3
  161. package/bundle/types/projectResponse.js.map +0 -1
  162. package/bundle/types/requestFunction.d.ts +0 -5
  163. package/bundle/types/requestFunction.js +0 -3
  164. package/bundle/types/requestFunction.js.map +0 -1
  165. package/bundle/types/scopeList.d.ts +0 -3
  166. package/bundle/types/scopeList.js +0 -3
  167. package/bundle/types/scopeList.js.map +0 -1
  168. package/bundle/types/search.d.ts +0 -14
  169. package/bundle/types/search.js +0 -3
  170. package/bundle/types/search.js.map +0 -1
  171. package/bundle/types/transcriptionSource.d.ts +0 -14
  172. package/bundle/types/transcriptionSource.js +0 -3
  173. package/bundle/types/transcriptionSource.js.map +0 -1
  174. package/bundle/types/usageCallback.d.ts +0 -4
  175. package/bundle/types/usageCallback.js +0 -3
  176. package/bundle/types/usageCallback.js.map +0 -1
  177. package/bundle/types/usageField.d.ts +0 -7
  178. package/bundle/types/usageField.js +0 -3
  179. package/bundle/types/usageField.js.map +0 -1
  180. package/bundle/types/usageFieldOptions.d.ts +0 -4
  181. package/bundle/types/usageFieldOptions.js +0 -3
  182. package/bundle/types/usageFieldOptions.js.map +0 -1
  183. package/bundle/types/usageOptions.d.ts +0 -23
  184. package/bundle/types/usageOptions.js +0 -3
  185. package/bundle/types/usageOptions.js.map +0 -1
  186. package/bundle/types/usageRequest.d.ts +0 -11
  187. package/bundle/types/usageRequest.js +0 -3
  188. package/bundle/types/usageRequest.js.map +0 -1
  189. package/bundle/types/usageRequestDetail.d.ts +0 -30
  190. package/bundle/types/usageRequestDetail.js +0 -3
  191. package/bundle/types/usageRequestDetail.js.map +0 -1
  192. package/bundle/types/usageRequestList.d.ts +0 -6
  193. package/bundle/types/usageRequestList.js +0 -3
  194. package/bundle/types/usageRequestList.js.map +0 -1
  195. package/bundle/types/usageRequestListOptions.d.ts +0 -7
  196. package/bundle/types/usageRequestListOptions.js +0 -3
  197. package/bundle/types/usageRequestListOptions.js.map +0 -1
  198. package/bundle/types/usageRequestMessage.d.ts +0 -3
  199. package/bundle/types/usageRequestMessage.js +0 -3
  200. package/bundle/types/usageRequestMessage.js.map +0 -1
  201. package/bundle/types/usageResponse.d.ts +0 -10
  202. package/bundle/types/usageResponse.js +0 -3
  203. package/bundle/types/usageResponse.js.map +0 -1
  204. package/bundle/types/usageResponseDetail.d.ts +0 -6
  205. package/bundle/types/usageResponseDetail.js +0 -3
  206. package/bundle/types/usageResponseDetail.js.map +0 -1
  207. package/bundle/types/utterance.d.ts +0 -39
  208. package/bundle/types/utterance.js +0 -3
  209. package/bundle/types/utterance.js.map +0 -1
  210. package/bundle/types/wordBase.d.ts +0 -8
  211. package/bundle/types/wordBase.js +0 -3
  212. package/bundle/types/wordBase.js.map +0 -1
  213. package/bundle/usage.d.ts +0 -35
  214. package/bundle/usage.js +0 -122
  215. package/bundle/usage.js.map +0 -1
  216. package/bundle/userAgent.d.ts +0 -1
  217. package/bundle/userAgent.js +0 -20
  218. package/bundle/userAgent.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpFetch.js","sourceRoot":"","sources":["../../src/browser/httpFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAyC;AAEzC,SAAsB,QAAQ,CAC5B,MAAc,EACd,OAAe,EACf,MAAc,EACd,IAAY,EACZ,OAAgB;;;;;;oBAEV,GAAG,GAAG,kBAAW,MAAM,SAAG,IAAI,CAAE,CAAC;;;;oBAEpB,qBAAM,KAAK,CAAC,GAAG,EAAE;4BAChC,MAAM,EAAE,MAAM;4BACd,OAAO,EAAE;gCACP,aAAa,EAAE,gBAAS,OAAO,CAAE;gCACjC,cAAc,EAAE,kBAAkB;gCAClC,YAAY,EAAE,IAAA,qBAAS,GAAE;6BAC1B;4BACD,IAAI,EAAE,OAAO;yBACd,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBACW,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;oBAA5B,IAAI,GAAG,SAAqB;oBAClC,sBAAO,IAAI,EAAC;;;oBAEZ,MAAM,IAAI,KAAK,CAAC,cAAO,KAAG,CAAE,CAAC,CAAC;;;;;CAEjC;AAvBD,4BAuBC"}
@@ -1,21 +0,0 @@
1
- import { Transcriber } from "./transcription";
2
- import { Projects } from "../projects";
3
- import { Keys } from "../keys";
4
- import { Usage } from "../usage";
5
- import { Members } from "../members";
6
- import { Invitation } from "../invitation";
7
- import { Billing } from "../billing";
8
- import { Scopes } from "../scopes";
9
- export declare class Deepgram {
10
- private _apiUrl;
11
- private _apiKey;
12
- transcription: Transcriber;
13
- projects: Projects;
14
- keys: Keys;
15
- usage: Usage;
16
- members: Members;
17
- invitation: Invitation;
18
- billing: Billing;
19
- scopes: Scopes;
20
- constructor(apiKey: string, apiUrl?: string);
21
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Deepgram = void 0;
4
- var constants_1 = require("../constants");
5
- var helpers_1 = require("../helpers");
6
- var transcription_1 = require("./transcription");
7
- var projects_1 = require("../projects");
8
- var keys_1 = require("../keys");
9
- var usage_1 = require("../usage");
10
- var members_1 = require("../members");
11
- var invitation_1 = require("../invitation");
12
- var billing_1 = require("../billing");
13
- var scopes_1 = require("../scopes");
14
- var httpFetch_1 = require("./httpFetch");
15
- var Deepgram = /** @class */ (function () {
16
- function Deepgram(apiKey, apiUrl) {
17
- this._apiKey = apiKey;
18
- this._apiUrl = apiUrl || constants_1.DefaultOptions.apiUrl;
19
- /**
20
- * Ensures that the provided options were provided
21
- */
22
- (0, helpers_1.validateOptions)(this._apiKey, this._apiUrl);
23
- this.transcription = new transcription_1.Transcriber(this._apiKey, this._apiUrl);
24
- this.projects = new projects_1.Projects(this._apiKey, this._apiUrl, httpFetch_1._request);
25
- this.keys = new keys_1.Keys(this._apiKey, this._apiUrl, httpFetch_1._request);
26
- this.usage = new usage_1.Usage(this._apiKey, this._apiUrl, httpFetch_1._request);
27
- this.members = new members_1.Members(this._apiKey, this._apiUrl, httpFetch_1._request);
28
- this.invitation = new invitation_1.Invitation(this._apiKey, this._apiUrl, httpFetch_1._request);
29
- this.billing = new billing_1.Billing(this._apiKey, this._apiUrl, httpFetch_1._request);
30
- this.scopes = new scopes_1.Scopes(this._apiKey, this._apiUrl, httpFetch_1._request);
31
- }
32
- return Deepgram;
33
- }());
34
- exports.Deepgram = Deepgram;
35
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;;AAAA,0CAA8C;AAC9C,sCAA6C;AAC7C,iDAA8C;AAC9C,wCAAuC;AACvC,gCAA+B;AAC/B,kCAAiC;AACjC,sCAAqC;AACrC,4CAA2C;AAC3C,sCAAqC;AACrC,oCAAmC;AAEnC,yCAAuC;AAEvC;IAaE,kBAAY,MAAc,EAAE,MAAe;QACzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,0BAAc,CAAC,MAAM,CAAC;QAE/C;;WAEG;QACH,IAAA,yBAAe,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5C,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,WAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAQ,CAAC,CAAC;IACjE,CAAC;IACH,eAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,4BAAQ"}
@@ -1,17 +0,0 @@
1
- import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, UrlSource } from "../../types";
2
- export declare class Transcriber {
3
- private _credentials;
4
- private _apiUrl;
5
- constructor(_credentials: string, _apiUrl: string);
6
- /**
7
- * Transcribes prerecorded audio from a file or buffer
8
- * @param source Url or Buffer of file to transcribe
9
- * @param options Options to modify transcriptions
10
- */
11
- preRecorded(source: UrlSource, options?: PrerecordedTranscriptionOptions): Promise<PrerecordedTranscriptionResponse>;
12
- /**
13
- * Opens a websocket to Deepgram's API for live transcriptions
14
- * @param options Options to modify transcriptions
15
- */
16
- live(options?: LiveTranscriptionOptions): WebSocket;
17
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.Transcriber = void 0;
43
- var querystring_1 = __importDefault(require("querystring"));
44
- var preRecordedTranscription_1 = require("./preRecordedTranscription");
45
- var Transcriber = /** @class */ (function () {
46
- function Transcriber(_credentials, _apiUrl) {
47
- this._credentials = _credentials;
48
- this._apiUrl = _apiUrl;
49
- }
50
- /**
51
- * Transcribes prerecorded audio from a file or buffer
52
- * @param source Url or Buffer of file to transcribe
53
- * @param options Options to modify transcriptions
54
- */
55
- Transcriber.prototype.preRecorded = function (source, options) {
56
- return __awaiter(this, void 0, void 0, function () {
57
- return __generator(this, function (_a) {
58
- switch (_a.label) {
59
- case 0: return [4 /*yield*/, (0, preRecordedTranscription_1.preRecordedTranscription)(this._credentials, this._apiUrl || "", source, options)];
60
- case 1: return [2 /*return*/, _a.sent()];
61
- }
62
- });
63
- });
64
- };
65
- /**
66
- * Opens a websocket to Deepgram's API for live transcriptions
67
- * @param options Options to modify transcriptions
68
- */
69
- Transcriber.prototype.live = function (options) {
70
- return new WebSocket("wss://".concat(this._apiUrl, "/v1/listen?").concat(querystring_1.default.stringify(options)), ["token", this._credentials]);
71
- };
72
- return Transcriber;
73
- }());
74
- exports.Transcriber = Transcriber;
75
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/transcription/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4DAAsC;AACtC,uEAAsE;AAEtE;IACE,qBAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAErE;;;;OAIG;IACG,iCAAW,GAAjB,UACE,MAAiB,EACjB,OAAyC;;;;4BAElC,qBAAM,IAAA,mDAAwB,EACnC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,IAAI,EAAE,EAClB,MAAM,EACN,OAAO,CACR,EAAA;4BALD,sBAAO,SAKN,EAAC;;;;KACH;IAED;;;OAGG;IACH,0BAAI,GAAJ,UAAK,OAAkC;QACrC,OAAO,IAAI,SAAS,CAClB,gBAAS,IAAI,CAAC,OAAO,wBAAc,qBAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAE,EACnE,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAC7B,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AA9BD,IA8BC;AA9BY,kCAAW"}
@@ -1,9 +0,0 @@
1
- import { PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, UrlSource } from "../../types";
2
- /**
3
- * Transcribes audio from a url
4
- * @param credentials Base64 encoded API key & secret
5
- * @param apiUrl url string of Deepgram's API
6
- * @param source Url or Buffer of file to transcribe
7
- * @param options Options to modify transcriptions
8
- */
9
- export declare const preRecordedTranscription: (apiKey: string, apiUrl: string, source: UrlSource, options?: PrerecordedTranscriptionOptions | undefined) => Promise<PrerecordedTranscriptionResponse>;
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.preRecordedTranscription = void 0;
54
- var querystring_1 = __importDefault(require("querystring"));
55
- var types_1 = require("../../types");
56
- var httpFetch_1 = require("../httpFetch");
57
- function isUrlSource(providedSource) {
58
- if (providedSource.url)
59
- return true;
60
- return false;
61
- }
62
- /**
63
- * Transcribes audio from a url
64
- * @param credentials Base64 encoded API key & secret
65
- * @param apiUrl url string of Deepgram's API
66
- * @param source Url or Buffer of file to transcribe
67
- * @param options Options to modify transcriptions
68
- */
69
- var preRecordedTranscription = function (apiKey, apiUrl, source, options) { return __awaiter(void 0, void 0, void 0, function () {
70
- var transcriptionOptions, body, response;
71
- return __generator(this, function (_a) {
72
- switch (_a.label) {
73
- case 0:
74
- transcriptionOptions = __assign({}, options);
75
- if (!isUrlSource(source)) {
76
- throw new Error("DG: Source must be a URL string");
77
- }
78
- body = JSON.stringify(source);
79
- return [4 /*yield*/, (0, httpFetch_1._request)("POST", apiKey, apiUrl, "/v1/listen?".concat(querystring_1.default.stringify(transcriptionOptions)), body)];
80
- case 1:
81
- response = _a.sent();
82
- return [2 /*return*/, Object.assign(new types_1.PrerecordedTranscriptionResponse(), response)];
83
- }
84
- });
85
- }); };
86
- exports.preRecordedTranscription = preRecordedTranscription;
87
- //# sourceMappingURL=preRecordedTranscription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preRecordedTranscription.js","sourceRoot":"","sources":["../../../src/browser/transcription/preRecordedTranscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAsC;AACtC,qCAIqB;AACrB,0CAAwC;AAExC,SAAS,WAAW,CAAC,cAAyB;IAC5C,IAAK,cAA4B,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACnD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACI,IAAM,wBAAwB,GAAG,UACtC,MAAc,EACd,MAAc,EACd,MAAiB,EACjB,OAAyC;;;;;gBAEnC,oBAAoB,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBACnD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;oBACxB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;iBACpD;gBAEK,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBAEnB,qBAAM,IAAA,oBAAQ,EAC7B,MAAM,EACN,MAAM,EACN,MAAM,EACN,qBAAc,qBAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAE,EAC3D,IAAI,CACL,EAAA;;gBANK,QAAQ,GAAG,SAMhB;gBAED,sBAAO,MAAM,CAAC,MAAM,CAAC,IAAI,wCAAgC,EAAE,EAAE,QAAQ,CAAC,EAAC;;;KACxE,CAAC;AAtBW,QAAA,wBAAwB,4BAsBnC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Default SDK options
3
- */
4
- export declare const DefaultOptions: {
5
- apiUrl: string;
6
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultOptions = void 0;
4
- /**
5
- * Default SDK options
6
- */
7
- exports.DefaultOptions = {
8
- apiUrl: "api.deepgram.com",
9
- };
10
- //# sourceMappingURL=defaultOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaultOptions.js","sourceRoot":"","sources":["../../src/constants/defaultOptions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,kBAAkB;CAC3B,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./defaultOptions";
@@ -1,18 +0,0 @@
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("./defaultOptions"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
@@ -1,4 +0,0 @@
1
- export declare const enum Alternatives {
2
- One = "one-alternative",
3
- Multiple = "multiple-alternatives"
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=alternatives.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alternatives.js","sourceRoot":"","sources":["../../src/enums/alternatives.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export declare enum ConnectionState {
2
- CONNECTING = 0,
3
- OPEN = 1,
4
- CLOSING = 2,
5
- CLOSED = 3
6
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConnectionState = void 0;
4
- var ConnectionState;
5
- (function (ConnectionState) {
6
- ConnectionState[ConnectionState["CONNECTING"] = 0] = "CONNECTING";
7
- ConnectionState[ConnectionState["OPEN"] = 1] = "OPEN";
8
- ConnectionState[ConnectionState["CLOSING"] = 2] = "CLOSING";
9
- ConnectionState[ConnectionState["CLOSED"] = 3] = "CLOSED";
10
- })(ConnectionState = exports.ConnectionState || (exports.ConnectionState = {}));
11
- //# sourceMappingURL=connectionState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connectionState.js","sourceRoot":"","sources":["../../src/enums/connectionState.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,iEAAc,CAAA;IACd,qDAAQ,CAAA;IACR,2DAAW,CAAA;IACX,yDAAU,CAAA;AACZ,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
@@ -1,4 +0,0 @@
1
- export declare const enum Diarization {
2
- Diarized = "diarized",
3
- NonDiarized = "non-diarized"
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=diarization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diarization.js","sourceRoot":"","sources":["../../src/enums/diarization.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- export * from "./alternatives";
2
- export * from "./connectionState";
3
- export * from "./diarization";
4
- export * from "./liveTranscriptionEvents";
5
- export * from "./models";
6
- export * from "./punctuation";
7
- export * from "./searchKind";
@@ -1,24 +0,0 @@
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("./alternatives"), exports);
18
- __exportStar(require("./connectionState"), exports);
19
- __exportStar(require("./diarization"), exports);
20
- __exportStar(require("./liveTranscriptionEvents"), exports);
21
- __exportStar(require("./models"), exports);
22
- __exportStar(require("./punctuation"), exports);
23
- __exportStar(require("./searchKind"), exports);
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC;AAClC,gDAA8B;AAC9B,4DAA0C;AAC1C,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B"}
@@ -1,6 +0,0 @@
1
- export declare const enum LiveTranscriptionEvents {
2
- Open = "open",
3
- Close = "close",
4
- TranscriptReceived = "transcriptReceived",
5
- Error = "error"
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=liveTranscriptionEvents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"liveTranscriptionEvents.js","sourceRoot":"","sources":["../../src/enums/liveTranscriptionEvents.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export declare const enum Models {
2
- General = "general",
3
- Meeting = "meeting",
4
- PhoneCall = "phonecall"
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/enums/models.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export declare const enum Punctuation {
2
- NonPunctuated = "non-punctuated",
3
- Punctuated = "punctuated"
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=punctuation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"punctuation.js","sourceRoot":"","sources":["../../src/enums/punctuation.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export declare const enum SearchKind {
2
- NoSearch = "no-search",
3
- WithSearch = "with-search"
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=searchKind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"searchKind.js","sourceRoot":"","sources":["../../src/enums/searchKind.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from "./secondsToTimestamp";
2
- export * from "./validateOptions";
@@ -1,19 +0,0 @@
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("./secondsToTimestamp"), exports);
18
- __exportStar(require("./validateOptions"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,oDAAkC"}
@@ -1 +0,0 @@
1
- export declare function secondsToTimestamp(seconds: number): string;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.secondsToTimestamp = void 0;
4
- function secondsToTimestamp(seconds) {
5
- return new Date(seconds * 1000).toISOString().substr(11, 12);
6
- }
7
- exports.secondsToTimestamp = secondsToTimestamp;
8
- //# sourceMappingURL=secondsToTimestamp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secondsToTimestamp.js","sourceRoot":"","sources":["../../src/helpers/secondsToTimestamp.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAAC,OAAe;IAChD,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC;AAFD,gDAEC"}
@@ -1 +0,0 @@
1
- export declare function validateOptions(apiKey: string, apiUrl: string): void;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateOptions = void 0;
4
- function validateOptions(apiKey, apiUrl) {
5
- if (!apiKey || apiKey.trim().length === 0) {
6
- throw new Error("DG: API key is required");
7
- }
8
- if (!apiUrl || apiUrl.trim().length === 0) {
9
- throw new Error("DG: API url should be a valid url or not provided");
10
- }
11
- }
12
- exports.validateOptions = validateOptions;
13
- //# sourceMappingURL=validateOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateOptions.js","sourceRoot":"","sources":["../../src/helpers/validateOptions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAAC,MAAc,EAAE,MAAc;IAC5D,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;IAED,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;AACH,CAAC;AARD,0CAQC"}
@@ -1,3 +0,0 @@
1
- /// <reference types="node" />
2
- import { ReadStream } from "fs";
3
- export declare function _request<T>(method: string, api_key: string, apiUrl: string, path: string, payload?: string | Buffer | ReadStream, options?: Object): Promise<T>;