@deepgram/sdk 1.3.1-beta.1 → 1.4.1

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 (235) hide show
  1. package/CHANGELOG.md +203 -196
  2. package/CODE_OF_CONDUCT.md +127 -127
  3. package/CONTRIBUTING.md +50 -50
  4. package/LICENSE +21 -21
  5. package/README.md +151 -151
  6. package/{dist → bundle}/billing.d.ts +3 -2
  7. package/{dist → bundle}/billing.js +4 -4
  8. package/bundle/billing.js.map +1 -0
  9. package/bundle/browser/httpFetch.d.ts +1 -0
  10. package/bundle/browser/httpFetch.js +75 -0
  11. package/bundle/browser/httpFetch.js.map +1 -0
  12. package/bundle/browser/index.d.ts +21 -0
  13. package/bundle/browser/index.js +35 -0
  14. package/bundle/browser/index.js.map +1 -0
  15. package/bundle/browser/transcription/index.d.ts +17 -0
  16. package/bundle/browser/transcription/index.js +75 -0
  17. package/bundle/browser/transcription/index.js.map +1 -0
  18. package/bundle/browser/transcription/preRecordedTranscription.d.ts +9 -0
  19. package/bundle/browser/transcription/preRecordedTranscription.js +87 -0
  20. package/bundle/browser/transcription/preRecordedTranscription.js.map +1 -0
  21. package/{dist → bundle}/constants/defaultOptions.d.ts +0 -0
  22. package/{dist → bundle}/constants/defaultOptions.js +0 -0
  23. package/{dist → bundle}/constants/defaultOptions.js.map +0 -0
  24. package/{dist → bundle}/constants/index.d.ts +0 -0
  25. package/{dist → bundle}/constants/index.js +0 -0
  26. package/{dist → bundle}/constants/index.js.map +0 -0
  27. package/{dist → bundle}/enums/alternatives.d.ts +0 -0
  28. package/{dist → bundle}/enums/alternatives.js +0 -0
  29. package/{dist → bundle}/enums/alternatives.js.map +0 -0
  30. package/{dist → bundle}/enums/connectionState.d.ts +0 -0
  31. package/{dist → bundle}/enums/connectionState.js +0 -0
  32. package/{dist → bundle}/enums/connectionState.js.map +0 -0
  33. package/{dist → bundle}/enums/diarization.d.ts +0 -0
  34. package/{dist → bundle}/enums/diarization.js +0 -0
  35. package/{dist → bundle}/enums/diarization.js.map +0 -0
  36. package/{dist → bundle}/enums/index.d.ts +0 -0
  37. package/{dist → bundle}/enums/index.js +0 -0
  38. package/{dist → bundle}/enums/index.js.map +0 -0
  39. package/{dist → bundle}/enums/liveTranscriptionEvents.d.ts +0 -0
  40. package/{dist → bundle}/enums/liveTranscriptionEvents.js +0 -0
  41. package/{dist → bundle}/enums/liveTranscriptionEvents.js.map +0 -0
  42. package/{dist → bundle}/enums/models.d.ts +0 -0
  43. package/{dist → bundle}/enums/models.js +0 -0
  44. package/{dist → bundle}/enums/models.js.map +0 -0
  45. package/{dist → bundle}/enums/punctuation.d.ts +0 -0
  46. package/{dist → bundle}/enums/punctuation.js +0 -0
  47. package/{dist → bundle}/enums/punctuation.js.map +0 -0
  48. package/{dist → bundle}/enums/searchKind.d.ts +0 -0
  49. package/{dist → bundle}/enums/searchKind.js +0 -0
  50. package/{dist → bundle}/enums/searchKind.js.map +0 -0
  51. package/{dist → bundle}/helpers/index.d.ts +1 -0
  52. package/{dist → bundle}/helpers/index.js +1 -0
  53. package/{dist → bundle}/helpers/index.js.map +1 -1
  54. package/{dist → bundle}/helpers/secondsToTimestamp.d.ts +0 -0
  55. package/{dist → bundle}/helpers/secondsToTimestamp.js +0 -0
  56. package/{dist → bundle}/helpers/secondsToTimestamp.js.map +0 -0
  57. package/bundle/helpers/validateOptions.d.ts +1 -0
  58. package/bundle/helpers/validateOptions.js +13 -0
  59. package/bundle/helpers/validateOptions.js.map +1 -0
  60. package/{dist → bundle}/httpRequest.d.ts +0 -0
  61. package/{dist → bundle}/httpRequest.js +0 -0
  62. package/{dist → bundle}/httpRequest.js.map +0 -0
  63. package/bundle/index.d.ts +21 -0
  64. package/bundle/index.js +35 -0
  65. package/bundle/index.js.map +1 -0
  66. package/{dist → bundle}/invitation.d.ts +3 -2
  67. package/{dist → bundle}/invitation.js +6 -6
  68. package/bundle/invitation.js.map +1 -0
  69. package/{dist → bundle}/keys.d.ts +3 -2
  70. package/{dist → bundle}/keys.js +6 -6
  71. package/bundle/keys.js.map +1 -0
  72. package/{dist → bundle}/members.d.ts +3 -2
  73. package/{dist → bundle}/members.js +4 -4
  74. package/bundle/members.js.map +1 -0
  75. package/{dist → bundle}/projects.d.ts +4 -3
  76. package/{dist → bundle}/projects.js +6 -6
  77. package/bundle/projects.js.map +1 -0
  78. package/{dist → bundle}/scopes.d.ts +3 -2
  79. package/{dist → bundle}/scopes.js +4 -4
  80. package/bundle/scopes.js.map +1 -0
  81. package/{dist → bundle}/transcription/index.d.ts +0 -0
  82. package/{dist → bundle}/transcription/index.js +0 -0
  83. package/{dist → bundle}/transcription/index.js.map +0 -0
  84. package/{dist → bundle}/transcription/liveTranscription.d.ts +0 -0
  85. package/{dist → bundle}/transcription/liveTranscription.js +0 -0
  86. package/{dist → bundle}/transcription/liveTranscription.js.map +0 -0
  87. package/{dist → bundle}/transcription/preRecordedTranscription.d.ts +0 -0
  88. package/{dist → bundle}/transcription/preRecordedTranscription.js +0 -0
  89. package/{dist → bundle}/transcription/preRecordedTranscription.js.map +0 -0
  90. package/{dist → bundle}/types/balance.d.ts +0 -0
  91. package/{dist → bundle}/types/balance.js +0 -0
  92. package/{dist → bundle}/types/balance.js.map +0 -0
  93. package/{dist → bundle}/types/balanceList.d.ts +0 -0
  94. package/{dist → bundle}/types/balanceList.js +0 -0
  95. package/{dist → bundle}/types/balanceList.js.map +0 -0
  96. package/{dist → bundle}/types/channel.d.ts +0 -0
  97. package/{dist → bundle}/types/channel.js +0 -0
  98. package/{dist → bundle}/types/channel.js.map +0 -0
  99. package/{dist → bundle}/types/createKeyOptions.d.ts +0 -0
  100. package/{dist → bundle}/types/createKeyOptions.js +0 -0
  101. package/{dist → bundle}/types/createKeyOptions.js.map +0 -0
  102. package/{dist → bundle}/types/hit.d.ts +0 -0
  103. package/{dist → bundle}/types/hit.js +0 -0
  104. package/{dist → bundle}/types/hit.js.map +0 -0
  105. package/{dist → bundle}/types/index.d.ts +3 -0
  106. package/{dist → bundle}/types/index.js +3 -0
  107. package/{dist → bundle}/types/index.js.map +1 -1
  108. package/{dist → bundle}/types/invitationList.d.ts +0 -0
  109. package/{dist → bundle}/types/invitationList.js +0 -0
  110. package/{dist → bundle}/types/invitationList.js.map +0 -0
  111. package/{dist → bundle}/types/invitationOptions.d.ts +0 -0
  112. package/{dist → bundle}/types/invitationOptions.js +0 -0
  113. package/{dist → bundle}/types/invitationOptions.js.map +0 -0
  114. package/{dist → bundle}/types/key.d.ts +0 -0
  115. package/{dist → bundle}/types/key.js +0 -0
  116. package/{dist → bundle}/types/key.js.map +0 -0
  117. package/bundle/types/keyResponse.d.ts +10 -0
  118. package/{dist → bundle}/types/keyResponse.js +0 -0
  119. package/{dist → bundle}/types/keyResponse.js.map +0 -0
  120. package/bundle/types/keyResponseObj.d.ts +42 -0
  121. package/bundle/types/keyResponseObj.js +3 -0
  122. package/bundle/types/keyResponseObj.js.map +1 -0
  123. package/{dist → bundle}/types/keyword.d.ts +0 -0
  124. package/{dist → bundle}/types/keyword.js +0 -0
  125. package/{dist → bundle}/types/keyword.js.map +0 -0
  126. package/{dist → bundle}/types/liveTranscriptionOptions.d.ts +0 -0
  127. package/{dist → bundle}/types/liveTranscriptionOptions.js +0 -0
  128. package/{dist → bundle}/types/liveTranscriptionOptions.js.map +0 -0
  129. package/{dist → bundle}/types/liveTranscriptionResponse.d.ts +0 -0
  130. package/{dist → bundle}/types/liveTranscriptionResponse.js +0 -0
  131. package/{dist → bundle}/types/liveTranscriptionResponse.js.map +0 -0
  132. package/{dist → bundle}/types/member.d.ts +0 -0
  133. package/{dist → bundle}/types/member.js +0 -0
  134. package/{dist → bundle}/types/member.js.map +0 -0
  135. package/{dist → bundle}/types/memberList.d.ts +0 -0
  136. package/{dist → bundle}/types/memberList.js +0 -0
  137. package/{dist → bundle}/types/memberList.js.map +0 -0
  138. package/{dist → bundle}/types/message.d.ts +0 -0
  139. package/{dist → bundle}/types/message.js +0 -0
  140. package/{dist → bundle}/types/message.js.map +0 -0
  141. package/{dist → bundle}/types/metadata.d.ts +0 -0
  142. package/{dist → bundle}/types/metadata.js +0 -0
  143. package/{dist → bundle}/types/metadata.js.map +0 -0
  144. package/{dist → bundle}/types/prerecordedTranscriptionOptions.d.ts +0 -0
  145. package/{dist → bundle}/types/prerecordedTranscriptionOptions.js +0 -0
  146. package/{dist → bundle}/types/prerecordedTranscriptionOptions.js.map +0 -0
  147. package/{dist → bundle}/types/prerecordedTranscriptionResponse.d.ts +0 -0
  148. package/{dist → bundle}/types/prerecordedTranscriptionResponse.js +0 -0
  149. package/{dist → bundle}/types/prerecordedTranscriptionResponse.js.map +0 -0
  150. package/{dist → bundle}/types/project.d.ts +0 -0
  151. package/{dist → bundle}/types/project.js +0 -0
  152. package/{dist → bundle}/types/project.js.map +0 -0
  153. package/bundle/types/projectPatchRequest.d.ts +4 -0
  154. package/bundle/types/projectPatchRequest.js +3 -0
  155. package/bundle/types/projectPatchRequest.js.map +1 -0
  156. package/{dist → bundle}/types/projectPatchResponse.d.ts +0 -0
  157. package/{dist → bundle}/types/projectPatchResponse.js +0 -0
  158. package/{dist → bundle}/types/projectPatchResponse.js.map +0 -0
  159. package/{dist → bundle}/types/projectResponse.d.ts +0 -0
  160. package/{dist → bundle}/types/projectResponse.js +0 -0
  161. package/{dist → bundle}/types/projectResponse.js.map +0 -0
  162. package/bundle/types/requestFunction.d.ts +5 -0
  163. package/bundle/types/requestFunction.js +3 -0
  164. package/bundle/types/requestFunction.js.map +1 -0
  165. package/{dist → bundle}/types/scopeList.d.ts +0 -0
  166. package/{dist → bundle}/types/scopeList.js +0 -0
  167. package/{dist → bundle}/types/scopeList.js.map +0 -0
  168. package/{dist → bundle}/types/search.d.ts +0 -0
  169. package/{dist → bundle}/types/search.js +0 -0
  170. package/{dist → bundle}/types/search.js.map +0 -0
  171. package/{dist → bundle}/types/transcriptionSource.d.ts +0 -0
  172. package/{dist → bundle}/types/transcriptionSource.js +0 -0
  173. package/{dist → bundle}/types/transcriptionSource.js.map +0 -0
  174. package/{dist → bundle}/types/usageCallback.d.ts +0 -0
  175. package/{dist → bundle}/types/usageCallback.js +0 -0
  176. package/{dist → bundle}/types/usageCallback.js.map +0 -0
  177. package/{dist → bundle}/types/usageField.d.ts +0 -0
  178. package/{dist → bundle}/types/usageField.js +0 -0
  179. package/{dist → bundle}/types/usageField.js.map +0 -0
  180. package/{dist → bundle}/types/usageFieldOptions.d.ts +0 -0
  181. package/{dist → bundle}/types/usageFieldOptions.js +0 -0
  182. package/{dist → bundle}/types/usageFieldOptions.js.map +0 -0
  183. package/{dist → bundle}/types/usageOptions.d.ts +0 -0
  184. package/{dist → bundle}/types/usageOptions.js +0 -0
  185. package/{dist → bundle}/types/usageOptions.js.map +0 -0
  186. package/{dist → bundle}/types/usageRequest.d.ts +0 -0
  187. package/{dist → bundle}/types/usageRequest.js +0 -0
  188. package/{dist → bundle}/types/usageRequest.js.map +0 -0
  189. package/{dist → bundle}/types/usageRequestDetail.d.ts +0 -0
  190. package/{dist → bundle}/types/usageRequestDetail.js +0 -0
  191. package/{dist → bundle}/types/usageRequestDetail.js.map +0 -0
  192. package/{dist → bundle}/types/usageRequestList.d.ts +0 -0
  193. package/{dist → bundle}/types/usageRequestList.js +0 -0
  194. package/{dist → bundle}/types/usageRequestList.js.map +0 -0
  195. package/{dist → bundle}/types/usageRequestListOptions.d.ts +0 -0
  196. package/{dist → bundle}/types/usageRequestListOptions.js +0 -0
  197. package/{dist → bundle}/types/usageRequestListOptions.js.map +0 -0
  198. package/{dist → bundle}/types/usageRequestMessage.d.ts +0 -0
  199. package/{dist → bundle}/types/usageRequestMessage.js +0 -0
  200. package/{dist → bundle}/types/usageRequestMessage.js.map +0 -0
  201. package/{dist → bundle}/types/usageResponse.d.ts +0 -0
  202. package/{dist → bundle}/types/usageResponse.js +0 -0
  203. package/{dist → bundle}/types/usageResponse.js.map +0 -0
  204. package/{dist → bundle}/types/usageResponseDetail.d.ts +0 -0
  205. package/{dist → bundle}/types/usageResponseDetail.js +0 -0
  206. package/{dist → bundle}/types/usageResponseDetail.js.map +0 -0
  207. package/{dist → bundle}/types/utterance.d.ts +0 -0
  208. package/{dist → bundle}/types/utterance.js +0 -0
  209. package/{dist → bundle}/types/utterance.js.map +0 -0
  210. package/{dist → bundle}/types/wordBase.d.ts +0 -0
  211. package/{dist → bundle}/types/wordBase.js +0 -0
  212. package/{dist → bundle}/types/wordBase.js.map +0 -0
  213. package/{dist → bundle}/usage.d.ts +3 -2
  214. package/{dist → bundle}/usage.js +6 -6
  215. package/bundle/usage.js.map +1 -0
  216. package/{dist → bundle}/userAgent.d.ts +0 -0
  217. package/{dist → bundle}/userAgent.js +1 -1
  218. package/bundle/userAgent.js.map +1 -0
  219. package/dist/browser/index.js +1659 -0
  220. package/dist/index.d.ts +1315 -24
  221. package/dist/index.js +1 -41
  222. package/package.json +67 -59
  223. package/webpack.config.js +15 -0
  224. package/.devcontainer/Dockerfile +0 -16
  225. package/.devcontainer/devcontainer.json +0 -29
  226. package/dist/billing.js.map +0 -1
  227. package/dist/index.js.map +0 -1
  228. package/dist/invitation.js.map +0 -1
  229. package/dist/keys.js.map +0 -1
  230. package/dist/members.js.map +0 -1
  231. package/dist/projects.js.map +0 -1
  232. package/dist/scopes.js.map +0 -1
  233. package/dist/types/keyResponse.d.ts +0 -50
  234. package/dist/usage.js.map +0 -1
  235. package/dist/userAgent.js.map +0 -1
@@ -37,11 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Projects = void 0;
40
- var httpRequest_1 = require("./httpRequest");
41
40
  var Projects = /** @class */ (function () {
42
- function Projects(_credentials, _apiUrl) {
41
+ function Projects(_credentials, _apiUrl, _request) {
43
42
  this._credentials = _credentials;
44
43
  this._apiUrl = _apiUrl;
44
+ this._request = _request;
45
45
  this.apiPath = "/v1/projects";
46
46
  }
47
47
  /**
@@ -50,7 +50,7 @@ var Projects = /** @class */ (function () {
50
50
  Projects.prototype.list = function () {
51
51
  return __awaiter(this, void 0, void 0, function () {
52
52
  return __generator(this, function (_a) {
53
- return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath)];
53
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, this.apiPath)];
54
54
  });
55
55
  });
56
56
  };
@@ -61,7 +61,7 @@ var Projects = /** @class */ (function () {
61
61
  Projects.prototype.get = function (projectId) {
62
62
  return __awaiter(this, void 0, void 0, function () {
63
63
  return __generator(this, function (_a) {
64
- return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId))];
64
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId))];
65
65
  });
66
66
  });
67
67
  };
@@ -69,10 +69,10 @@ var Projects = /** @class */ (function () {
69
69
  * Update a specific project
70
70
  * @param project project to update
71
71
  */
72
- Projects.prototype.update = function (project) {
72
+ Projects.prototype.update = function (project, payload) {
73
73
  return __awaiter(this, void 0, void 0, function () {
74
74
  return __generator(this, function (_a) {
75
- return [2 /*return*/, (0, httpRequest_1._request)("PATCH", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(project.project_id))];
75
+ return [2 /*return*/, this._request("PATCH", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(project.project_id), JSON.stringify(payload))];
76
76
  });
77
77
  });
78
78
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;IACE,kBACU,YAAoB,EACpB,OAAe,EACf,QAAyB;QAFzB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAiB;QAG3B,YAAO,GAAG,cAAc,CAAC;IAF9B,CAAC;IAIJ;;OAEG;IACG,uBAAI,GAAV;;;gBACE,sBAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAC;;;KAC5E;IAED;;;OAGG;IACG,sBAAG,GAAT,UAAU,SAAiB;;;gBACzB,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,CAAE,CAC/B,EAAC;;;KACH;IAED;;;OAGG;IACG,yBAAM,GAAZ,UACE,OAAgB,EAChB,OAA4B;;;gBAE5B,sBAAO,IAAI,CAAC,QAAQ,CAClB,OAAO,EACP,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,OAAO,CAAC,UAAU,CAAE,EACvC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CACxB,EAAC;;;KACH;IACH,eAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,4BAAQ"}
@@ -1,8 +1,9 @@
1
- import { ScopeList, Message } from "./types";
1
+ import { ScopeList, Message, RequestFunction } from "./types";
2
2
  export declare class Scopes {
3
3
  private _credentials;
4
4
  private _apiUrl;
5
- constructor(_credentials: string, _apiUrl: string);
5
+ private _request;
6
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
6
7
  private apiPath;
7
8
  /**
8
9
  * Retrieves scopes of the specified member in the specified project.
@@ -37,11 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Scopes = void 0;
40
- var httpRequest_1 = require("./httpRequest");
41
40
  var Scopes = /** @class */ (function () {
42
- function Scopes(_credentials, _apiUrl) {
41
+ function Scopes(_credentials, _apiUrl, _request) {
43
42
  this._credentials = _credentials;
44
43
  this._apiUrl = _apiUrl;
44
+ this._request = _request;
45
45
  this.apiPath = "/v1/projects";
46
46
  }
47
47
  /**
@@ -52,7 +52,7 @@ var Scopes = /** @class */ (function () {
52
52
  Scopes.prototype.get = function (projectId, memberId) {
53
53
  return __awaiter(this, void 0, void 0, function () {
54
54
  return __generator(this, function (_a) {
55
- return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/members/").concat(memberId, "/scopes"))];
55
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/members/").concat(memberId, "/scopes"))];
56
56
  });
57
57
  });
58
58
  };
@@ -65,7 +65,7 @@ var Scopes = /** @class */ (function () {
65
65
  Scopes.prototype.update = function (projectID, memberId, scope) {
66
66
  return __awaiter(this, void 0, void 0, function () {
67
67
  return __generator(this, function (_a) {
68
- return [2 /*return*/, (0, httpRequest_1._request)("PUT", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectID, "/members/").concat(memberId, "/scopes"), JSON.stringify({
68
+ return [2 /*return*/, this._request("PUT", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectID, "/members/").concat(memberId, "/scopes"), JSON.stringify({
69
69
  scope: scope,
70
70
  }))];
71
71
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IACE,gBACU,YAAoB,EACpB,OAAe,EACf,QAAyB;QAFzB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAiB;QAG3B,YAAO,GAAG,cAAc,CAAC;IAF9B,CAAC;IAIJ;;;;OAIG;IACG,oBAAG,GAAT,UAAU,SAAiB,EAAE,QAAgB;;;gBAC3C,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,sBAAY,QAAQ,YAAS,CAC1D,EAAC;;;KACH;IAED;;;;;OAKG;IACG,uBAAM,GAAZ,UACE,SAAiB,EACjB,QAAgB,EAChB,KAAa;;;gBAEb,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,sBAAY,QAAQ,YAAS,EACzD,IAAI,CAAC,SAAS,CAAC;wBACb,KAAK,OAAA;qBACN,CAAC,CACH,EAAC;;;KACH;IACH,aAAC;AAAD,CAAC,AA5CD,IA4CC;AA5CY,wBAAM"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -33,3 +33,6 @@ export * from "./usageResponse";
33
33
  export * from "./usageResponseDetail";
34
34
  export * from "./utterance";
35
35
  export * from "./wordBase";
36
+ export * from "./keyResponseObj";
37
+ export * from "./projectPatchRequest";
38
+ export * from "./requestFunction";
@@ -49,4 +49,7 @@ __exportStar(require("./usageResponse"), exports);
49
49
  __exportStar(require("./usageResponseDetail"), exports);
50
50
  __exportStar(require("./utterance"), exports);
51
51
  __exportStar(require("./wordBase"), exports);
52
+ __exportStar(require("./keyResponseObj"), exports);
53
+ __exportStar(require("./projectPatchRequest"), exports);
54
+ __exportStar(require("./requestFunction"), exports);
52
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,gDAA8B;AAC9B,4CAA0B;AAC1B,qDAAmC;AACnC,wCAAsB;AACtB,mDAAiC;AACjC,sDAAoC;AACpC,wCAAsB;AACtB,gDAA8B;AAC9B,6DAA2C;AAC3C,8DAA4C;AAC5C,2CAAyB;AACzB,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,oEAAkD;AAClD,qEAAmD;AACnD,4CAA0B;AAC1B,yDAAuC;AACvC,oDAAkC;AAClC,8CAA4B;AAC5B,2CAAyB;AACzB,wDAAsC;AACtC,kDAAgC;AAChC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,iDAA+B;AAC/B,uDAAqC;AACrC,qDAAmC;AACnC,4DAA0C;AAC1C,kDAAgC;AAChC,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,gDAA8B;AAC9B,4CAA0B;AAC1B,qDAAmC;AACnC,wCAAsB;AACtB,mDAAiC;AACjC,sDAAoC;AACpC,wCAAsB;AACtB,gDAA8B;AAC9B,6DAA2C;AAC3C,8DAA4C;AAC5C,2CAAyB;AACzB,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,oEAAkD;AAClD,qEAAmD;AACnD,4CAA0B;AAC1B,yDAAuC;AACvC,oDAAkC;AAClC,8CAA4B;AAC5B,2CAAyB;AACzB,wDAAsC;AACtC,kDAAgC;AAChC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,iDAA+B;AAC/B,uDAAqC;AACrC,qDAAmC;AACnC,4DAA0C;AAC1C,kDAAgC;AAChC,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,wDAAsC;AACtC,oDAAkC"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,10 @@
1
+ import { KeyResponseObj } from "./keyResponseObj";
2
+ /**
3
+ * Response from the Deepgram API to list keys
4
+ */
5
+ export declare type KeyResponse = {
6
+ /**
7
+ * Array of API keys associated with the project
8
+ */
9
+ api_keys: Array<KeyResponseObj>;
10
+ };
File without changes
File without changes
@@ -0,0 +1,42 @@
1
+ import { Key } from "./key";
2
+ import { Member } from "./member";
3
+ export declare type KeyResponseObj = {
4
+ /**
5
+ * Optional member associated with the API key
6
+ */
7
+ member?: Member;
8
+ /**
9
+ * API key
10
+ */
11
+ api_key: Key;
12
+ /**
13
+ * Unique identifier of the key to use in API requests
14
+ * @deprecated This property has moved to api_key.api_key_id and will
15
+ * be removed in future versions.
16
+ */
17
+ api_key_id: string;
18
+ /**
19
+ * API key to send in API requests (Only displayed when first created)
20
+ * @deprecated This property has moved to api_key.key and will
21
+ * be removed in future versions.
22
+ */
23
+ key?: string;
24
+ /**
25
+ * Comment for user reference
26
+ * @deprecated This property has moved to api_key.comment and will
27
+ * be removed in future versions.
28
+ */
29
+ comment: string;
30
+ /**
31
+ * Timestamp of the date/time the key was created
32
+ * @deprecated This property has moved to api_key.created and will
33
+ * be removed in future versions.
34
+ */
35
+ created: string;
36
+ /**
37
+ * Array of scopes assigned to the key
38
+ * @deprecated This property has moved to api_key.scopes and will
39
+ * be removed in future versions.
40
+ */
41
+ scopes: Array<string>;
42
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=keyResponseObj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyResponseObj.js","sourceRoot":"","sources":["../../src/types/keyResponseObj.ts"],"names":[],"mappings":""}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ export declare type ProjectPatchRequest = {
2
+ name?: string;
3
+ company?: string;
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=projectPatchRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectPatchRequest.js","sourceRoot":"","sources":["../../src/types/projectPatchRequest.ts"],"names":[],"mappings":""}
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ import { ReadStream } from "fs";
3
+ export declare type RequestFunction = NodeRequest | BrowserRequest;
4
+ export declare type NodeRequest = (method: string, api_key: string, apiUrl: string, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
5
+ export declare type BrowserRequest = (method: string, api_key: string, apiUrl: string, path: string, payload?: string) => Promise<any>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=requestFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestFunction.js","sourceRoot":"","sources":["../../src/types/requestFunction.ts"],"names":[],"mappings":""}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,9 @@
1
- import { UsageField, UsageFieldOptions, UsageOptions, UsageRequest, UsageRequestList, UsageRequestListOptions, UsageResponse } from "./types";
1
+ import { RequestFunction, UsageField, UsageFieldOptions, UsageOptions, UsageRequest, UsageRequestList, UsageRequestListOptions, UsageResponse } from "./types";
2
2
  export declare class Usage {
3
3
  private _credentials;
4
4
  private _apiUrl;
5
- constructor(_credentials: string, _apiUrl: string);
5
+ private _request;
6
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
6
7
  private apiPath;
7
8
  /**
8
9
  * Retrieves all requests associated with the provided projectId based
@@ -52,11 +52,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.Usage = void 0;
54
54
  var querystring_1 = __importDefault(require("querystring"));
55
- var httpRequest_1 = require("./httpRequest");
56
55
  var Usage = /** @class */ (function () {
57
- function Usage(_credentials, _apiUrl) {
56
+ function Usage(_credentials, _apiUrl, _request) {
58
57
  this._credentials = _credentials;
59
58
  this._apiUrl = _apiUrl;
59
+ this._request = _request;
60
60
  this.apiPath = "/v1/projects";
61
61
  }
62
62
  /**
@@ -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*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/requests?").concat(querystring_1.default.stringify(requestOptions)))];
73
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/requests?").concat(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*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/requests/").concat(requestId))];
85
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/requests/").concat(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*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/usage?").concat(querystring_1.default.stringify(requestOptions)))];
100
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/usage?").concat(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*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/usage/fields?").concat(querystring_1.default.stringify(requestOptions)))];
115
+ return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/usage/fields?").concat(querystring_1.default.stringify(requestOptions)))];
116
116
  });
117
117
  });
118
118
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAsC;AAYtC;IACE,eACU,YAAoB,EACpB,OAAe,EACf,QAAyB;QAFzB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAiB;QAG3B,YAAO,GAAG,cAAc,CAAC;IAF9B,CAAC;IAIJ;;;;;OAKG;IACG,4BAAY,GAAlB,UACE,SAAiB,EACjB,OAAiC;;;;gBAE3B,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,uBAAa,qBAAW,CAAC,SAAS,CAC5D,cAAc,CACf,CAAE,CACJ,EAAC;;;KACH;IAED;;;;OAIG;IACG,0BAAU,GAAhB,UACE,SAAiB,EACjB,SAAiB;;;gBAEjB,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,uBAAa,SAAS,CAAE,CACrD,EAAC;;;KACH;IAED;;;;;OAKG;IACG,wBAAQ,GAAd,UACE,SAAiB,EACjB,OAAsB;;;;gBAEhB,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,oBAAU,qBAAW,CAAC,SAAS,CACzD,cAAc,CACf,CAAE,CACJ,EAAC;;;KACH;IAED;;;;;OAKG;IACG,yBAAS,GAAf,UACE,SAAiB,EACjB,OAA2B;;;;gBAErB,cAAc,YAAQ,EAAE,EAAK,OAAO,CAAE,CAAC;gBAC7C,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,2BAAiB,qBAAW,CAAC,SAAS,CAChE,cAAc,CACf,CAAE,CACJ,EAAC;;;KACH;IACH,YAAC;AAAD,CAAC,AAxFD,IAwFC;AAxFY,sBAAK"}
File without changes