@deepgram/sdk 1.2.1 → 1.3.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 +39 -4
- package/README.md +1 -1
- package/dist/billing.d.ts +18 -0
- package/dist/billing.js +73 -0
- package/dist/billing.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/invitation.d.ts +29 -0
- package/dist/invitation.js +99 -0
- package/dist/invitation.js.map +1 -0
- package/dist/keys.js +21 -1
- package/dist/keys.js.map +1 -1
- package/dist/members.d.ts +18 -0
- package/dist/members.js +73 -0
- package/dist/members.js.map +1 -0
- package/dist/scopes.d.ts +20 -0
- package/dist/scopes.js +77 -0
- package/dist/scopes.js.map +1 -0
- package/dist/types/balance.d.ts +6 -0
- package/dist/types/balance.js +3 -0
- package/dist/types/balance.js.map +1 -0
- package/dist/types/balanceList.d.ts +4 -0
- package/dist/types/balanceList.js +3 -0
- package/dist/types/balanceList.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/invitationList.d.ts +4 -0
- package/dist/types/invitationList.js +3 -0
- package/dist/types/invitationList.js.map +1 -0
- package/dist/types/invitationOptions.d.ts +4 -0
- package/dist/types/invitationOptions.js +3 -0
- package/dist/types/invitationOptions.js.map +1 -0
- package/dist/types/keyResponse.d.ts +41 -1
- package/dist/types/liveTranscriptionOptions.d.ts +1 -1
- package/dist/types/member.d.ts +4 -3
- package/dist/types/memberList.d.ts +4 -0
- package/dist/types/memberList.js +3 -0
- package/dist/types/memberList.js.map +1 -0
- package/dist/types/message.d.ts +3 -0
- package/dist/types/message.js +3 -0
- package/dist/types/message.js.map +1 -0
- package/dist/types/prerecordedTranscriptionOptions.d.ts +1 -1
- package/dist/types/scopeList.d.ts +3 -0
- package/dist/types/scopeList.js +3 -0
- package/dist/types/scopeList.js.map +1 -0
- package/dist/types/utterance.d.ts +2 -1
- package/dist/types/wordBase.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -9,20 +9,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## [1.3.0]
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Added Message Class for generic message responses
|
|
17
|
+
- Added member endpoint functionality
|
|
18
|
+
- This includes the `listMembers` and `removeMember` methods
|
|
19
|
+
- Added Member and MemberList Class
|
|
20
|
+
- Added scopes endpoint functionality
|
|
21
|
+
- This includes the `get` and `update` methods
|
|
22
|
+
- Added ScopeList Class
|
|
23
|
+
- Added invites endpoint functionality
|
|
24
|
+
- This includes the `list`, `send`, `leave` and `delete` methods
|
|
25
|
+
- Added InvitationOptions and InvitationList Class
|
|
26
|
+
- Added balances endpoint functionality
|
|
27
|
+
- This includes the `listBalances` and `getBalance` methods
|
|
28
|
+
- Added Balance and BalanceList Class
|
|
29
|
+
|
|
30
|
+
## [1.2.4]
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- 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.
|
|
35
|
+
- The `version` parameter was typed as required for both pre-recorded and live transcription. Changed this to be optional.
|
|
36
|
+
|
|
37
|
+
## [1.2.2]
|
|
38
|
+
|
|
39
|
+
### Updated
|
|
40
|
+
|
|
41
|
+
- Updated the `wordBase` type to include an optional `speaker` property.
|
|
42
|
+
- Updated the documentation for the speaker property of the `utterance` type.
|
|
43
|
+
|
|
12
44
|
## [1.2.1]
|
|
13
45
|
|
|
14
46
|
### Fixed
|
|
15
47
|
|
|
16
48
|
- Fixed a bug that caused real-time transcriptions to not close correctly. This
|
|
17
|
-
would result in the user not received the final transcription.
|
|
49
|
+
would result in the user not received the final transcription.
|
|
18
50
|
|
|
19
51
|
## [1.2.0]
|
|
20
52
|
|
|
21
53
|
### Updated
|
|
22
54
|
|
|
23
55
|
- Updated the `keys.create` function to allow new `expirationDate` or `timeToLive`
|
|
24
|
-
values. These are optional and one at most can be provided. Providing both will
|
|
25
|
-
throw an error.
|
|
56
|
+
values. These are optional and one at most can be provided. Providing both will
|
|
57
|
+
throw an error.
|
|
26
58
|
|
|
27
59
|
## [1.1.0]
|
|
28
60
|
|
|
@@ -144,7 +176,10 @@ throw an error.
|
|
|
144
176
|
|
|
145
177
|
---
|
|
146
178
|
|
|
147
|
-
[unreleased]: https://github.com/deepgram/node-sdk/compare/1.
|
|
179
|
+
[unreleased]: https://github.com/deepgram/node-sdk/compare/1.3.0...HEAD
|
|
180
|
+
[1.3.0]: https://github.com/deepgram/node-sdk/compare/1.2.2...1.2.4
|
|
181
|
+
[1.2.4]: https://github.com/deepgram/node-sdk/compare/1.2.2...1.2.4
|
|
182
|
+
[1.2.2]: https://github.com/deepgram/node-sdk/compare/1.2.1...1.2.2
|
|
148
183
|
[1.2.1]: https://github.com/deepgram/node-sdk/compare/1.2.0...1.2.1
|
|
149
184
|
[1.2.0]: https://github.com/deepgram/node-sdk/compare/1.1.0...1.2.0
|
|
150
185
|
[1.1.0]: https://github.com/deepgram/node-sdk/compare/1.0.3...1.1.0
|
package/README.md
CHANGED
|
@@ -147,5 +147,5 @@ project, let us know! You can either:
|
|
|
147
147
|
|
|
148
148
|
Check out the Developer Documentation at [https://developers.deepgram.com/](https://developers.deepgram.com/)
|
|
149
149
|
|
|
150
|
-
[signup]: https://console.deepgram.com?utm_source=node-sdk
|
|
150
|
+
[signup]: https://console.deepgram.com/signup?utm_medium=github&utm_source=DEVREL&utm_content=node-sdk
|
|
151
151
|
[license]: LICENSE.txt
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BalanceList, Balance } from "./types";
|
|
2
|
+
export declare class Billing {
|
|
3
|
+
private _credentials;
|
|
4
|
+
private _apiUrl;
|
|
5
|
+
constructor(_credentials: string, _apiUrl: string);
|
|
6
|
+
private apiPath;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves list of balance info of the specified project.
|
|
9
|
+
* @param projectId Unique identifier of the project
|
|
10
|
+
*/
|
|
11
|
+
listBalances(projectId: string): Promise<BalanceList>;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves balance info of a specified balance_id in the specified project.
|
|
14
|
+
* @param projectId Unique identifier of the project
|
|
15
|
+
* @param balanceId Unique identifier of the balance
|
|
16
|
+
*/
|
|
17
|
+
getBalance(projectId: string, balanceId: string): Promise<Balance>;
|
|
18
|
+
}
|
package/dist/billing.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Billing = void 0;
|
|
40
|
+
var httpRequest_1 = require("./httpRequest");
|
|
41
|
+
var Billing = /** @class */ (function () {
|
|
42
|
+
function Billing(_credentials, _apiUrl) {
|
|
43
|
+
this._credentials = _credentials;
|
|
44
|
+
this._apiUrl = _apiUrl;
|
|
45
|
+
this.apiPath = "/v1/projects";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves list of balance info of the specified project.
|
|
49
|
+
* @param projectId Unique identifier of the project
|
|
50
|
+
*/
|
|
51
|
+
Billing.prototype.listBalances = function (projectId) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/balances")];
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves balance info of a specified balance_id in the specified project.
|
|
60
|
+
* @param projectId Unique identifier of the project
|
|
61
|
+
* @param balanceId Unique identifier of the balance
|
|
62
|
+
*/
|
|
63
|
+
Billing.prototype.getBalance = function (projectId, balanceId) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/balances/" + balanceId)];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return Billing;
|
|
71
|
+
}());
|
|
72
|
+
exports.Billing = Billing;
|
|
73
|
+
//# sourceMappingURL=billing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../src/billing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC;IACE,iBAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;OAGG;IACG,8BAAY,GAAlB,UAAmB,SAAiB;;;gBAClC,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,cAAW,CACxC,EAAC;;;KACH;IAED;;;;OAIG;IAEG,4BAAU,GAAhB,UAAiB,SAAiB,EAAE,SAAiB;;;gBACnD,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,kBAAa,SAAW,CACrD,EAAC;;;KACH;IACH,cAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,0BAAO"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { Keys } from "./keys";
|
|
|
2
2
|
import { Projects } from "./projects";
|
|
3
3
|
import { Transcriber } from "./transcription";
|
|
4
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";
|
|
5
9
|
export declare class Deepgram {
|
|
6
10
|
private _apiUrl;
|
|
7
11
|
private _apiKey;
|
|
@@ -9,6 +13,10 @@ export declare class Deepgram {
|
|
|
9
13
|
projects: Projects;
|
|
10
14
|
transcription: Transcriber;
|
|
11
15
|
usage: Usage;
|
|
16
|
+
members: Members;
|
|
17
|
+
invitation: Invitation;
|
|
18
|
+
billing: Billing;
|
|
19
|
+
scopes: Scopes;
|
|
12
20
|
constructor(apiKey: string, apiUrl?: string);
|
|
13
21
|
/**
|
|
14
22
|
* Ensures that the provided options were provided
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,10 @@ var keys_1 = require("./keys");
|
|
|
6
6
|
var projects_1 = require("./projects");
|
|
7
7
|
var transcription_1 = require("./transcription");
|
|
8
8
|
var usage_1 = require("./usage");
|
|
9
|
+
var members_1 = require("./members");
|
|
10
|
+
var invitation_1 = require("./invitation");
|
|
11
|
+
var billing_1 = require("./billing");
|
|
12
|
+
var scopes_1 = require("./scopes");
|
|
9
13
|
var Deepgram = /** @class */ (function () {
|
|
10
14
|
function Deepgram(apiKey, apiUrl) {
|
|
11
15
|
this._apiKey = apiKey;
|
|
@@ -15,6 +19,10 @@ var Deepgram = /** @class */ (function () {
|
|
|
15
19
|
this.projects = new projects_1.Projects(this._apiKey, this._apiUrl);
|
|
16
20
|
this.transcription = new transcription_1.Transcriber(this._apiKey, this._apiUrl);
|
|
17
21
|
this.usage = new usage_1.Usage(this._apiKey, this._apiUrl);
|
|
22
|
+
this.members = new members_1.Members(this._apiKey, this._apiUrl);
|
|
23
|
+
this.invitation = new invitation_1.Invitation(this._apiKey, this._apiUrl);
|
|
24
|
+
this.billing = new billing_1.Billing(this._apiKey, this._apiUrl);
|
|
25
|
+
this.scopes = new scopes_1.Scopes(this._apiKey, this._apiUrl);
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
20
28
|
* Ensures that the provided options were provided
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,+BAA8B;AAC9B,uCAAsC;AACtC,iDAA8C;AAC9C,iCAAgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,+BAA8B;AAC9B,uCAAsC;AACtC,iDAA8C;AAC9C,iCAAgC;AAChC,qCAAoC;AACpC,2CAA0C;AAC1C,qCAAoC;AACpC,mCAAkC;AAElC;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,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,IAAI,CAAC,IAAI,GAAG,IAAI,WAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACK,mCAAgB,GAAxB;QACE,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;YACrD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;YACrD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;SACtE;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAzCD,IAyCC;AAzCY,4BAAQ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Message, InvitationOptions, InvitationList } from "./types";
|
|
2
|
+
export declare class Invitation {
|
|
3
|
+
private _credentials;
|
|
4
|
+
private _apiUrl;
|
|
5
|
+
constructor(_credentials: string, _apiUrl: string);
|
|
6
|
+
private apiPath;
|
|
7
|
+
/**
|
|
8
|
+
* Lists all the current invites of a specified project.
|
|
9
|
+
* @param projectId Unique identifier of the project
|
|
10
|
+
*/
|
|
11
|
+
list(projectId: string): Promise<InvitationList>;
|
|
12
|
+
/**
|
|
13
|
+
* Sends an invitation to join the specified project.
|
|
14
|
+
* @param projectId Unique identifier of the project
|
|
15
|
+
*/
|
|
16
|
+
send(projectId: string, options: InvitationOptions): Promise<Message>;
|
|
17
|
+
/**
|
|
18
|
+
* Removes the authenticated account from the specified project.
|
|
19
|
+
* @param projectId Unique identifier of the project
|
|
20
|
+
*/
|
|
21
|
+
leave(projectId: string): Promise<Message>;
|
|
22
|
+
/**
|
|
23
|
+
* Removes the specified email from the invitations on the specified project.
|
|
24
|
+
* @param projectId Unique identifier of the project
|
|
25
|
+
* @param email email address of the invitee
|
|
26
|
+
* NOTE: This will return successful even if the email does not have an invite on the project.
|
|
27
|
+
*/
|
|
28
|
+
delete(projectId: string, email: string): Promise<Message>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Invitation = void 0;
|
|
40
|
+
var httpRequest_1 = require("./httpRequest");
|
|
41
|
+
var Invitation = /** @class */ (function () {
|
|
42
|
+
function Invitation(_credentials, _apiUrl) {
|
|
43
|
+
this._credentials = _credentials;
|
|
44
|
+
this._apiUrl = _apiUrl;
|
|
45
|
+
this.apiPath = "/v1/projects";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Lists all the current invites of a specified project.
|
|
49
|
+
* @param projectId Unique identifier of the project
|
|
50
|
+
*/
|
|
51
|
+
Invitation.prototype.list = function (projectId) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/invites")];
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Sends an invitation to join the specified project.
|
|
60
|
+
* @param projectId Unique identifier of the project
|
|
61
|
+
*/
|
|
62
|
+
Invitation.prototype.send = function (projectId, options) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
return [2 /*return*/, (0, httpRequest_1._request)("POST", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/invites", JSON.stringify({
|
|
66
|
+
email: options.email,
|
|
67
|
+
scope: options.scope,
|
|
68
|
+
}))];
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Removes the authenticated account from the specified project.
|
|
74
|
+
* @param projectId Unique identifier of the project
|
|
75
|
+
*/
|
|
76
|
+
Invitation.prototype.leave = function (projectId) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
return [2 /*return*/, (0, httpRequest_1._request)("DELETE", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/leave")];
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Removes the specified email from the invitations on the specified project.
|
|
85
|
+
* @param projectId Unique identifier of the project
|
|
86
|
+
* @param email email address of the invitee
|
|
87
|
+
* NOTE: This will return successful even if the email does not have an invite on the project.
|
|
88
|
+
*/
|
|
89
|
+
Invitation.prototype.delete = function (projectId, email) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
return [2 /*return*/, (0, httpRequest_1._request)("DELETE", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/invites/" + email)];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
return Invitation;
|
|
97
|
+
}());
|
|
98
|
+
exports.Invitation = Invitation;
|
|
99
|
+
//# sourceMappingURL=invitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.js","sourceRoot":"","sources":["../src/invitation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC;IACE,oBAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;OAGG;IACG,yBAAI,GAAV,UAAW,SAAiB;;;gBAC1B,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,aAAU,CACvC,EAAC;;;KACH;IAED;;;OAGG;IACG,yBAAI,GAAV,UAAW,SAAiB,EAAE,OAA0B;;;gBACtD,sBAAO,IAAA,sBAAQ,EACb,MAAM,EACN,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,aAAU,EACtC,IAAI,CAAC,SAAS,CAAC;wBACb,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;qBACrB,CAAC,CACH,EAAC;;;KACH;IAED;;;OAGG;IACG,0BAAK,GAAX,UAAY,SAAiB;;;gBAC3B,sBAAO,IAAA,sBAAQ,EACb,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,WAAQ,CACrC,EAAC;;;KACH;IAED;;;;;OAKG;IACG,2BAAM,GAAZ,UAAa,SAAiB,EAAE,KAAa;;;gBAC3C,sBAAO,IAAA,sBAAQ,EACb,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,iBAAY,KAAO,CAChD,EAAC;;;KACH;IACH,iBAAC;AAAD,CAAC,AA9DD,IA8DC;AA9DY,gCAAU"}
|
package/dist/keys.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -50,8 +61,17 @@ var Keys = /** @class */ (function () {
|
|
|
50
61
|
*/
|
|
51
62
|
Keys.prototype.list = function (projectId) {
|
|
52
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
var response, output;
|
|
53
65
|
return __generator(this, function (_a) {
|
|
54
|
-
|
|
66
|
+
switch (_a.label) {
|
|
67
|
+
case 0: return [4 /*yield*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/keys")];
|
|
68
|
+
case 1:
|
|
69
|
+
response = _a.sent();
|
|
70
|
+
output = response.api_keys.map(function (apiKey) {
|
|
71
|
+
return __assign(__assign({}, apiKey), apiKey.api_key);
|
|
72
|
+
});
|
|
73
|
+
return [2 /*return*/, { api_keys: output }];
|
|
74
|
+
}
|
|
55
75
|
});
|
|
56
76
|
});
|
|
57
77
|
};
|
package/dist/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC;IACE,cAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;OAGG;IACG,mBAAI,GAAV,UAAW,SAAiB;;;;;4BACT,qBAAM,IAAA,sBAAQ,EAC7B,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,UAAO,CACpC,EAAA;;wBALK,QAAQ,GAAG,SAKhB;wBAEK,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,MAAM;4BAC1C,6BACK,MAAM,GACN,MAAM,CAAC,OAAO,EAClB;wBACH,CAAC,CAAC,CAAC;wBAEH,sBAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAC;;;;KAC7B;IAED;;;;OAIG;IACG,kBAAG,GAAT,UAAU,SAAiB,EAAE,KAAa;;;gBACxC,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,cAAS,KAAO,CAC7C,EAAC;;;KACH;IAED;;;;;;OAMG;IACG,qBAAM,GAAZ,UACE,SAAiB,EACjB,OAAe,EACf,MAAqB,EACrB,OAA0B;;;gBAE1B,6EAA6E;gBAC7E,IACE,OAAO;oBACP,OAAO,CAAC,cAAc,KAAK,SAAS;oBACpC,OAAO,CAAC,UAAU,KAAK,SAAS,EAChC;oBACA,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;iBACH;gBAED,sBAAO,IAAA,sBAAQ,EACb,MAAM,EACN,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,UAAO,EACnC,IAAI,CAAC,SAAS,CAAC;wBACb,OAAO,SAAA;wBACP,MAAM,QAAA;wBACN,eAAe,EACb,OAAO,IAAI,OAAO,CAAC,cAAc;4BAC/B,CAAC,CAAC,OAAO,CAAC,cAAc;4BACxB,CAAC,CAAC,SAAS;wBACf,uBAAuB,EACrB,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;qBACjE,CAAC,CACH,EAAC;;;KACH;IAED;;;;OAIG;IACG,qBAAM,GAAZ,UAAa,SAAiB,EAAE,KAAa;;;gBAC3C,sBAAO,IAAA,sBAAQ,EACb,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,cAAS,KAAO,CAC7C,EAAC;;;KACH;IACH,WAAC;AAAD,CAAC,AAhGD,IAgGC;AAhGY,oBAAI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MemberList, Message } from "./types";
|
|
2
|
+
export declare class Members {
|
|
3
|
+
private _credentials;
|
|
4
|
+
private _apiUrl;
|
|
5
|
+
constructor(_credentials: string, _apiUrl: string);
|
|
6
|
+
private apiPath;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves account objects for all of the accounts in the specified project.
|
|
9
|
+
* @param projectId Unique identifier of the project
|
|
10
|
+
*/
|
|
11
|
+
listMembers(projectId: string): Promise<MemberList>;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves account objects for all of the accounts in the specified project.
|
|
14
|
+
* @param projectId Unique identifier of the project
|
|
15
|
+
* @param memberId Unique identifier of the member
|
|
16
|
+
*/
|
|
17
|
+
removeMember(projectId: string, memberId: string): Promise<Message>;
|
|
18
|
+
}
|
package/dist/members.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Members = void 0;
|
|
40
|
+
var httpRequest_1 = require("./httpRequest");
|
|
41
|
+
var Members = /** @class */ (function () {
|
|
42
|
+
function Members(_credentials, _apiUrl) {
|
|
43
|
+
this._credentials = _credentials;
|
|
44
|
+
this._apiUrl = _apiUrl;
|
|
45
|
+
this.apiPath = "/v1/projects";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves account objects for all of the accounts in the specified project.
|
|
49
|
+
* @param projectId Unique identifier of the project
|
|
50
|
+
*/
|
|
51
|
+
Members.prototype.listMembers = function (projectId) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/members")];
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves account objects for all of the accounts in the specified project.
|
|
60
|
+
* @param projectId Unique identifier of the project
|
|
61
|
+
* @param memberId Unique identifier of the member
|
|
62
|
+
*/
|
|
63
|
+
Members.prototype.removeMember = function (projectId, memberId) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
return [2 /*return*/, (0, httpRequest_1._request)("DELETE", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/members/" + memberId)];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return Members;
|
|
71
|
+
}());
|
|
72
|
+
exports.Members = Members;
|
|
73
|
+
//# sourceMappingURL=members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../src/members.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC;IACE,iBAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;OAGG;IACG,6BAAW,GAAjB,UAAkB,SAAiB;;;gBACjC,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,aAAU,CACvC,EAAC;;;KACH;IAED;;;;OAIG;IACG,8BAAY,GAAlB,UAAmB,SAAiB,EAAE,QAAgB;;;gBACpD,sBAAO,IAAA,sBAAQ,EACb,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,iBAAY,QAAU,CACnD,EAAC;;;KACH;IACH,cAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,0BAAO"}
|
package/dist/scopes.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ScopeList, Message } from "./types";
|
|
2
|
+
export declare class Scopes {
|
|
3
|
+
private _credentials;
|
|
4
|
+
private _apiUrl;
|
|
5
|
+
constructor(_credentials: string, _apiUrl: string);
|
|
6
|
+
private apiPath;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves scopes of the specified member in the specified project.
|
|
9
|
+
* @param projectId Unique identifier of the project
|
|
10
|
+
* @param memberId Unique identifier of the member
|
|
11
|
+
*/
|
|
12
|
+
get(projectId: string, memberId: string): Promise<ScopeList>;
|
|
13
|
+
/**
|
|
14
|
+
* Updates the scope for the specified member in the specified project.
|
|
15
|
+
* @param projectId Unique identifier of the project
|
|
16
|
+
* @param memberId Unique identifier of the member being updated
|
|
17
|
+
* @param scope string of the scope to update to
|
|
18
|
+
*/
|
|
19
|
+
update(projectID: string, memberId: string, scope: string): Promise<Message>;
|
|
20
|
+
}
|
package/dist/scopes.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Scopes = void 0;
|
|
40
|
+
var httpRequest_1 = require("./httpRequest");
|
|
41
|
+
var Scopes = /** @class */ (function () {
|
|
42
|
+
function Scopes(_credentials, _apiUrl) {
|
|
43
|
+
this._credentials = _credentials;
|
|
44
|
+
this._apiUrl = _apiUrl;
|
|
45
|
+
this.apiPath = "/v1/projects";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves scopes of the specified member in the specified project.
|
|
49
|
+
* @param projectId Unique identifier of the project
|
|
50
|
+
* @param memberId Unique identifier of the member
|
|
51
|
+
*/
|
|
52
|
+
Scopes.prototype.get = function (projectId, memberId) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
return [2 /*return*/, (0, httpRequest_1._request)("GET", this._credentials, this._apiUrl, this.apiPath + "/" + projectId + "/members/" + memberId + "/scopes")];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Updates the scope for the specified member in the specified project.
|
|
61
|
+
* @param projectId Unique identifier of the project
|
|
62
|
+
* @param memberId Unique identifier of the member being updated
|
|
63
|
+
* @param scope string of the scope to update to
|
|
64
|
+
*/
|
|
65
|
+
Scopes.prototype.update = function (projectID, memberId, scope) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
return [2 /*return*/, (0, httpRequest_1._request)("PUT", this._credentials, this._apiUrl, this.apiPath + "/" + projectID + "/members/" + memberId + "/scopes", JSON.stringify({
|
|
69
|
+
scope: scope,
|
|
70
|
+
}))];
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
return Scopes;
|
|
75
|
+
}());
|
|
76
|
+
exports.Scopes = Scopes;
|
|
77
|
+
//# sourceMappingURL=scopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.js","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC;IACE,gBAAoB,YAAoB,EAAU,OAAe;QAA7C,iBAAY,GAAZ,YAAY,CAAQ;QAAU,YAAO,GAAP,OAAO,CAAQ;QAEzD,YAAO,GAAG,cAAc,CAAC;IAFmC,CAAC;IAIrE;;;;OAIG;IACG,oBAAG,GAAT,UAAU,SAAiB,EAAE,QAAgB;;;gBAC3C,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,iBAAY,QAAQ,YAAS,CAC1D,EAAC;;;KACH;IAED;;;;;OAKG;IACG,uBAAM,GAAZ,UACE,SAAiB,EACjB,QAAgB,EAChB,KAAa;;;gBAEb,sBAAO,IAAA,sBAAQ,EACb,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACT,IAAI,CAAC,OAAO,SAAI,SAAS,iBAAY,QAAQ,YAAS,EACzD,IAAI,CAAC,SAAS,CAAC;wBACb,KAAK,OAAA;qBACN,CAAC,CACH,EAAC;;;KACH;IACH,aAAC;AAAD,CAAC,AAxCD,IAwCC;AAxCY,wBAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/types/balance.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balanceList.js","sourceRoot":"","sources":["../../src/types/balanceList.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./keyResponse";
|
|
|
6
6
|
export * from "./liveTranscriptionOptions";
|
|
7
7
|
export * from "./liveTranscriptionResponse";
|
|
8
8
|
export * from "./member";
|
|
9
|
+
export * from "./memberList";
|
|
9
10
|
export * from "./metadata";
|
|
10
11
|
export * from "./prerecordedTranscriptionOptions";
|
|
11
12
|
export * from "./prerecordedTranscriptionResponse";
|
|
@@ -26,3 +27,9 @@ export * from "./usageResponse";
|
|
|
26
27
|
export * from "./usageResponseDetail";
|
|
27
28
|
export * from "./utterance";
|
|
28
29
|
export * from "./wordBase";
|
|
30
|
+
export * from "./message";
|
|
31
|
+
export * from "./invitationOptions";
|
|
32
|
+
export * from "./invitationList";
|
|
33
|
+
export * from "./balance";
|
|
34
|
+
export * from "./balanceList";
|
|
35
|
+
export * from "./scopeList";
|
package/dist/types/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./keyResponse"), exports);
|
|
|
18
18
|
__exportStar(require("./liveTranscriptionOptions"), exports);
|
|
19
19
|
__exportStar(require("./liveTranscriptionResponse"), exports);
|
|
20
20
|
__exportStar(require("./member"), exports);
|
|
21
|
+
__exportStar(require("./memberList"), exports);
|
|
21
22
|
__exportStar(require("./metadata"), exports);
|
|
22
23
|
__exportStar(require("./prerecordedTranscriptionOptions"), exports);
|
|
23
24
|
__exportStar(require("./prerecordedTranscriptionResponse"), exports);
|
|
@@ -38,4 +39,10 @@ __exportStar(require("./usageResponse"), exports);
|
|
|
38
39
|
__exportStar(require("./usageResponseDetail"), exports);
|
|
39
40
|
__exportStar(require("./utterance"), exports);
|
|
40
41
|
__exportStar(require("./wordBase"), exports);
|
|
42
|
+
__exportStar(require("./message"), exports);
|
|
43
|
+
__exportStar(require("./invitationOptions"), exports);
|
|
44
|
+
__exportStar(require("./invitationList"), exports);
|
|
45
|
+
__exportStar(require("./balance"), exports);
|
|
46
|
+
__exportStar(require("./balanceList"), exports);
|
|
47
|
+
__exportStar(require("./scopeList"), exports);
|
|
41
48
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,qDAAmC;AACnC,wCAAsB;AACtB,wCAAsB;AACtB,gDAA8B;AAC9B,6DAA2C;AAC3C,8DAA4C;AAC5C,2CAAyB;AACzB,6CAA2B;AAC3B,oEAAkD;AAClD,qEAAmD;AACnD,4CAA0B;AAC1B,yDAAuC;AACvC,oDAAkC;AAClC,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,qDAAmC;AACnC,wCAAsB;AACtB,wCAAsB;AACtB,gDAA8B;AAC9B,6DAA2C;AAC3C,8DAA4C;AAC5C,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,oEAAkD;AAClD,qEAAmD;AACnD,4CAA0B;AAC1B,yDAAuC;AACvC,oDAAkC;AAClC,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,4CAA0B;AAC1B,sDAAoC;AACpC,mDAAiC;AACjC,4CAA0B;AAC1B,gDAA8B;AAC9B,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitationList.js","sourceRoot":"","sources":["../../src/types/invitationList.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitationOptions.js","sourceRoot":"","sources":["../../src/types/invitationOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Key } from "./key";
|
|
2
|
+
import { Member } from "./member";
|
|
2
3
|
/**
|
|
3
4
|
* Response from the Deepgram API to list keys
|
|
4
5
|
*/
|
|
@@ -6,5 +7,44 @@ export declare type KeyResponse = {
|
|
|
6
7
|
/**
|
|
7
8
|
* Array of API keys associated with the project
|
|
8
9
|
*/
|
|
9
|
-
api_keys: Array<
|
|
10
|
+
api_keys: Array<{
|
|
11
|
+
/**
|
|
12
|
+
* Optional member associated with the API key
|
|
13
|
+
*/
|
|
14
|
+
member?: Member;
|
|
15
|
+
/**
|
|
16
|
+
* API key
|
|
17
|
+
*/
|
|
18
|
+
api_key: Key;
|
|
19
|
+
/**
|
|
20
|
+
* Unique identifier of the key to use in API requests
|
|
21
|
+
* @deprecated This property has moved to api_key.api_key_id and will
|
|
22
|
+
* be removed in future versions.
|
|
23
|
+
*/
|
|
24
|
+
api_key_id: string;
|
|
25
|
+
/**
|
|
26
|
+
* API key to send in API requests (Only displayed when first created)
|
|
27
|
+
* @deprecated This property has moved to api_key.key and will
|
|
28
|
+
* be removed in future versions.
|
|
29
|
+
*/
|
|
30
|
+
key?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Comment for user reference
|
|
33
|
+
* @deprecated This property has moved to api_key.comment and will
|
|
34
|
+
* be removed in future versions.
|
|
35
|
+
*/
|
|
36
|
+
comment: string;
|
|
37
|
+
/**
|
|
38
|
+
* Timestamp of the date/time the key was created
|
|
39
|
+
* @deprecated This property has moved to api_key.created and will
|
|
40
|
+
* be removed in future versions.
|
|
41
|
+
*/
|
|
42
|
+
created: string;
|
|
43
|
+
/**
|
|
44
|
+
* Array of scopes assigned to the key
|
|
45
|
+
* @deprecated This property has moved to api_key.scopes and will
|
|
46
|
+
* be removed in future versions.
|
|
47
|
+
*/
|
|
48
|
+
scopes: Array<string>;
|
|
49
|
+
}>;
|
|
10
50
|
};
|
|
@@ -16,7 +16,7 @@ export declare type LiveTranscriptionOptions = {
|
|
|
16
16
|
* @remarks latest OR <version_id>
|
|
17
17
|
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/version
|
|
18
18
|
*/
|
|
19
|
-
version
|
|
19
|
+
version?: string;
|
|
20
20
|
/**
|
|
21
21
|
* BCP-47 language tag that hints at the primary spoken language.
|
|
22
22
|
* @default en-US
|
package/dist/types/member.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memberList.js","sourceRoot":"","sources":["../../src/types/memberList.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":""}
|
|
@@ -16,7 +16,7 @@ export declare type PrerecordedTranscriptionOptions = {
|
|
|
16
16
|
* @remarks latest OR <version_id>
|
|
17
17
|
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/version
|
|
18
18
|
*/
|
|
19
|
-
version
|
|
19
|
+
version?: string;
|
|
20
20
|
/**
|
|
21
21
|
* BCP-47 language tag that hints at the primary spoken language.
|
|
22
22
|
* @default en-US
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopeList.js","sourceRoot":"","sources":["../../src/types/scopeList.ts"],"names":[],"mappings":""}
|
|
@@ -28,7 +28,8 @@ export declare type Utterance = {
|
|
|
28
28
|
*/
|
|
29
29
|
words: Array<WordBase>;
|
|
30
30
|
/**
|
|
31
|
-
* Integer indicating the speaker
|
|
31
|
+
* Integer indicating the predicted speaker of the majority of words
|
|
32
|
+
* in the utterance who is saying the words being processed.
|
|
32
33
|
*/
|
|
33
34
|
speaker?: number;
|
|
34
35
|
/**
|
package/dist/types/wordBase.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepgram/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/deepgram/node-sdk.git"
|
|
16
|
+
"url": "git+https://github.com/deepgram/deepgram-node-sdk.git"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"deepgram",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"bugs": {
|
|
30
|
-
"url": "https://github.com/deepgram/node-sdk/issues"
|
|
30
|
+
"url": "https://github.com/deepgram/deepgram-node-sdk/issues"
|
|
31
31
|
},
|
|
32
|
-
"homepage": "https://github.com/deepgram/node-sdk#readme",
|
|
32
|
+
"homepage": "https://github.com/deepgram/deepgram-node-sdk#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/chai": "^4.2.22",
|
|
35
35
|
"@types/mocha": "^9.0.0",
|