@deepgram/sdk 1.4.0 → 1.4.4
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 +25 -0
- package/dist/browser/index.js +1 -0
- package/dist/index.d.ts +1342 -0
- package/dist/index.js +1 -0
- package/package.json +9 -6
- package/tsconfig-es6.json +16 -0
- package/webpack.config.js +21 -1
- package/bundle/billing.d.ts +0 -19
- package/bundle/billing.js +0 -73
- package/bundle/billing.js.map +0 -1
- package/bundle/browser/httpFetch.d.ts +0 -1
- package/bundle/browser/httpFetch.js +0 -75
- package/bundle/browser/httpFetch.js.map +0 -1
- package/bundle/browser/index.d.ts +0 -21
- package/bundle/browser/index.js +0 -35
- package/bundle/browser/index.js.map +0 -1
- package/bundle/browser/transcription/index.d.ts +0 -17
- package/bundle/browser/transcription/index.js +0 -75
- package/bundle/browser/transcription/index.js.map +0 -1
- package/bundle/browser/transcription/preRecordedTranscription.d.ts +0 -9
- package/bundle/browser/transcription/preRecordedTranscription.js +0 -87
- package/bundle/browser/transcription/preRecordedTranscription.js.map +0 -1
- package/bundle/constants/defaultOptions.d.ts +0 -6
- package/bundle/constants/defaultOptions.js +0 -10
- package/bundle/constants/defaultOptions.js.map +0 -1
- package/bundle/constants/index.d.ts +0 -1
- package/bundle/constants/index.js +0 -18
- package/bundle/constants/index.js.map +0 -1
- package/bundle/enums/alternatives.d.ts +0 -4
- package/bundle/enums/alternatives.js +0 -3
- package/bundle/enums/alternatives.js.map +0 -1
- package/bundle/enums/connectionState.d.ts +0 -6
- package/bundle/enums/connectionState.js +0 -11
- package/bundle/enums/connectionState.js.map +0 -1
- package/bundle/enums/diarization.d.ts +0 -4
- package/bundle/enums/diarization.js +0 -3
- package/bundle/enums/diarization.js.map +0 -1
- package/bundle/enums/index.d.ts +0 -7
- package/bundle/enums/index.js +0 -24
- package/bundle/enums/index.js.map +0 -1
- package/bundle/enums/liveTranscriptionEvents.d.ts +0 -6
- package/bundle/enums/liveTranscriptionEvents.js +0 -3
- package/bundle/enums/liveTranscriptionEvents.js.map +0 -1
- package/bundle/enums/models.d.ts +0 -5
- package/bundle/enums/models.js +0 -3
- package/bundle/enums/models.js.map +0 -1
- package/bundle/enums/punctuation.d.ts +0 -4
- package/bundle/enums/punctuation.js +0 -3
- package/bundle/enums/punctuation.js.map +0 -1
- package/bundle/enums/searchKind.d.ts +0 -4
- package/bundle/enums/searchKind.js +0 -3
- package/bundle/enums/searchKind.js.map +0 -1
- package/bundle/helpers/index.d.ts +0 -2
- package/bundle/helpers/index.js +0 -19
- package/bundle/helpers/index.js.map +0 -1
- package/bundle/helpers/secondsToTimestamp.d.ts +0 -1
- package/bundle/helpers/secondsToTimestamp.js +0 -8
- package/bundle/helpers/secondsToTimestamp.js.map +0 -1
- package/bundle/helpers/validateOptions.d.ts +0 -1
- package/bundle/helpers/validateOptions.js +0 -13
- package/bundle/helpers/validateOptions.js.map +0 -1
- package/bundle/httpRequest.d.ts +0 -3
- package/bundle/httpRequest.js +0 -91
- package/bundle/httpRequest.js.map +0 -1
- package/bundle/index.d.ts +0 -21
- package/bundle/index.js +0 -35
- package/bundle/index.js.map +0 -1
- package/bundle/invitation.d.ts +0 -30
- package/bundle/invitation.js +0 -99
- package/bundle/invitation.js.map +0 -1
- package/bundle/keys.d.ts +0 -33
- package/bundle/keys.js +0 -132
- package/bundle/keys.js.map +0 -1
- package/bundle/members.d.ts +0 -19
- package/bundle/members.js +0 -73
- package/bundle/members.js.map +0 -1
- package/bundle/projects.d.ts +0 -22
- package/bundle/projects.js +0 -82
- package/bundle/projects.js.map +0 -1
- package/bundle/scopes.d.ts +0 -21
- package/bundle/scopes.js +0 -77
- package/bundle/scopes.js.map +0 -1
- package/bundle/transcription/index.d.ts +0 -18
- package/bundle/transcription/index.js +0 -72
- package/bundle/transcription/index.js.map +0 -1
- package/bundle/transcription/liveTranscription.d.ts +0 -23
- package/bundle/transcription/liveTranscription.js +0 -83
- package/bundle/transcription/liveTranscription.js.map +0 -1
- package/bundle/transcription/preRecordedTranscription.d.ts +0 -8
- package/bundle/transcription/preRecordedTranscription.js +0 -114
- package/bundle/transcription/preRecordedTranscription.js.map +0 -1
- package/bundle/types/balance.d.ts +0 -6
- package/bundle/types/balance.js +0 -3
- package/bundle/types/balance.js.map +0 -1
- package/bundle/types/balanceList.d.ts +0 -4
- package/bundle/types/balanceList.js +0 -3
- package/bundle/types/balanceList.js.map +0 -1
- package/bundle/types/channel.d.ts +0 -25
- package/bundle/types/channel.js +0 -3
- package/bundle/types/channel.js.map +0 -1
- package/bundle/types/createKeyOptions.d.ts +0 -13
- package/bundle/types/createKeyOptions.js +0 -3
- package/bundle/types/createKeyOptions.js.map +0 -1
- package/bundle/types/hit.d.ts +0 -21
- package/bundle/types/hit.js +0 -3
- package/bundle/types/hit.js.map +0 -1
- package/bundle/types/index.d.ts +0 -38
- package/bundle/types/index.js +0 -55
- package/bundle/types/index.js.map +0 -1
- package/bundle/types/invitationList.d.ts +0 -4
- package/bundle/types/invitationList.js +0 -3
- package/bundle/types/invitationList.js.map +0 -1
- package/bundle/types/invitationOptions.d.ts +0 -4
- package/bundle/types/invitationOptions.js +0 -3
- package/bundle/types/invitationOptions.js.map +0 -1
- package/bundle/types/key.d.ts +0 -25
- package/bundle/types/key.js +0 -3
- package/bundle/types/key.js.map +0 -1
- package/bundle/types/keyResponse.d.ts +0 -10
- package/bundle/types/keyResponse.js +0 -3
- package/bundle/types/keyResponse.js.map +0 -1
- package/bundle/types/keyResponseObj.d.ts +0 -42
- package/bundle/types/keyResponseObj.js +0 -3
- package/bundle/types/keyResponseObj.js.map +0 -1
- package/bundle/types/keyword.d.ts +0 -4
- package/bundle/types/keyword.js +0 -3
- package/bundle/types/keyword.js.map +0 -1
- package/bundle/types/liveTranscriptionOptions.d.ts +0 -148
- package/bundle/types/liveTranscriptionOptions.js +0 -3
- package/bundle/types/liveTranscriptionOptions.js.map +0 -1
- package/bundle/types/liveTranscriptionResponse.d.ts +0 -9
- package/bundle/types/liveTranscriptionResponse.js +0 -3
- package/bundle/types/liveTranscriptionResponse.js.map +0 -1
- package/bundle/types/member.d.ts +0 -7
- package/bundle/types/member.js +0 -3
- package/bundle/types/member.js.map +0 -1
- package/bundle/types/memberList.d.ts +0 -4
- package/bundle/types/memberList.js +0 -3
- package/bundle/types/memberList.js.map +0 -1
- package/bundle/types/message.d.ts +0 -3
- package/bundle/types/message.js +0 -3
- package/bundle/types/message.js.map +0 -1
- package/bundle/types/metadata.d.ts +0 -8
- package/bundle/types/metadata.js +0 -3
- package/bundle/types/metadata.js.map +0 -1
- package/bundle/types/prerecordedTranscriptionOptions.d.ts +0 -126
- package/bundle/types/prerecordedTranscriptionOptions.js +0 -3
- package/bundle/types/prerecordedTranscriptionOptions.js.map +0 -1
- package/bundle/types/prerecordedTranscriptionResponse.d.ts +0 -25
- package/bundle/types/prerecordedTranscriptionResponse.js +0 -51
- package/bundle/types/prerecordedTranscriptionResponse.js.map +0 -1
- package/bundle/types/project.d.ts +0 -17
- package/bundle/types/project.js +0 -3
- package/bundle/types/project.js.map +0 -1
- package/bundle/types/projectPatchRequest.d.ts +0 -4
- package/bundle/types/projectPatchRequest.js +0 -3
- package/bundle/types/projectPatchRequest.js.map +0 -1
- package/bundle/types/projectPatchResponse.d.ts +0 -6
- package/bundle/types/projectPatchResponse.js +0 -3
- package/bundle/types/projectPatchResponse.js.map +0 -1
- package/bundle/types/projectResponse.d.ts +0 -4
- package/bundle/types/projectResponse.js +0 -3
- package/bundle/types/projectResponse.js.map +0 -1
- package/bundle/types/requestFunction.d.ts +0 -5
- package/bundle/types/requestFunction.js +0 -3
- package/bundle/types/requestFunction.js.map +0 -1
- package/bundle/types/scopeList.d.ts +0 -3
- package/bundle/types/scopeList.js +0 -3
- package/bundle/types/scopeList.js.map +0 -1
- package/bundle/types/search.d.ts +0 -14
- package/bundle/types/search.js +0 -3
- package/bundle/types/search.js.map +0 -1
- package/bundle/types/transcriptionSource.d.ts +0 -14
- package/bundle/types/transcriptionSource.js +0 -3
- package/bundle/types/transcriptionSource.js.map +0 -1
- package/bundle/types/usageCallback.d.ts +0 -4
- package/bundle/types/usageCallback.js +0 -3
- package/bundle/types/usageCallback.js.map +0 -1
- package/bundle/types/usageField.d.ts +0 -7
- package/bundle/types/usageField.js +0 -3
- package/bundle/types/usageField.js.map +0 -1
- package/bundle/types/usageFieldOptions.d.ts +0 -4
- package/bundle/types/usageFieldOptions.js +0 -3
- package/bundle/types/usageFieldOptions.js.map +0 -1
- package/bundle/types/usageOptions.d.ts +0 -23
- package/bundle/types/usageOptions.js +0 -3
- package/bundle/types/usageOptions.js.map +0 -1
- package/bundle/types/usageRequest.d.ts +0 -11
- package/bundle/types/usageRequest.js +0 -3
- package/bundle/types/usageRequest.js.map +0 -1
- package/bundle/types/usageRequestDetail.d.ts +0 -30
- package/bundle/types/usageRequestDetail.js +0 -3
- package/bundle/types/usageRequestDetail.js.map +0 -1
- package/bundle/types/usageRequestList.d.ts +0 -6
- package/bundle/types/usageRequestList.js +0 -3
- package/bundle/types/usageRequestList.js.map +0 -1
- package/bundle/types/usageRequestListOptions.d.ts +0 -7
- package/bundle/types/usageRequestListOptions.js +0 -3
- package/bundle/types/usageRequestListOptions.js.map +0 -1
- package/bundle/types/usageRequestMessage.d.ts +0 -3
- package/bundle/types/usageRequestMessage.js +0 -3
- package/bundle/types/usageRequestMessage.js.map +0 -1
- package/bundle/types/usageResponse.d.ts +0 -10
- package/bundle/types/usageResponse.js +0 -3
- package/bundle/types/usageResponse.js.map +0 -1
- package/bundle/types/usageResponseDetail.d.ts +0 -6
- package/bundle/types/usageResponseDetail.js +0 -3
- package/bundle/types/usageResponseDetail.js.map +0 -1
- package/bundle/types/utterance.d.ts +0 -39
- package/bundle/types/utterance.js +0 -3
- package/bundle/types/utterance.js.map +0 -1
- package/bundle/types/wordBase.d.ts +0 -8
- package/bundle/types/wordBase.js +0 -3
- package/bundle/types/wordBase.js.map +0 -1
- package/bundle/usage.d.ts +0 -35
- package/bundle/usage.js +0 -122
- package/bundle/usage.js.map +0 -1
- package/bundle/userAgent.d.ts +0 -1
- package/bundle/userAgent.js +0 -20
- package/bundle/userAgent.js.map +0 -1
package/bundle/invitation.js
DELETED
|
@@ -1,99 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Invitation = void 0;
|
|
40
|
-
var Invitation = /** @class */ (function () {
|
|
41
|
-
function Invitation(_credentials, _apiUrl, _request) {
|
|
42
|
-
this._credentials = _credentials;
|
|
43
|
-
this._apiUrl = _apiUrl;
|
|
44
|
-
this._request = _request;
|
|
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*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(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*/, this._request("POST", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(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*/, this._request("DELETE", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(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*/, this._request("DELETE", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/invites/").concat(email))];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
return Invitation;
|
|
97
|
-
}());
|
|
98
|
-
exports.Invitation = Invitation;
|
|
99
|
-
//# sourceMappingURL=invitation.js.map
|
package/bundle/invitation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.js","sourceRoot":"","sources":["../src/invitation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;IACE,oBACU,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;;;OAGG;IACG,yBAAI,GAAV,UAAW,SAAiB;;;gBAC1B,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,aAAU,CACvC,EAAC;;;KACH;IAED;;;OAGG;IACG,yBAAI,GAAV,UAAW,SAAiB,EAAE,OAA0B;;;gBACtD,sBAAO,IAAI,CAAC,QAAQ,CAClB,MAAM,EACN,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,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,IAAI,CAAC,QAAQ,CAClB,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,WAAQ,CACrC,EAAC;;;KACH;IAED;;;;;OAKG;IACG,2BAAM,GAAZ,UAAa,SAAiB,EAAE,KAAa;;;gBAC3C,sBAAO,IAAI,CAAC,QAAQ,CAClB,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,sBAAY,KAAK,CAAE,CAChD,EAAC;;;KACH;IACH,iBAAC;AAAD,CAAC,AAlED,IAkEC;AAlEY,gCAAU"}
|
package/bundle/keys.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CreateKeyOptions, KeyResponse, Key, RequestFunction } from "./types";
|
|
2
|
-
export declare class Keys {
|
|
3
|
-
private _credentials;
|
|
4
|
-
private _apiUrl;
|
|
5
|
-
private _request;
|
|
6
|
-
constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
|
|
7
|
-
private apiPath;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves all keys associated with the provided projectId
|
|
10
|
-
* @param projectId Unique identifier of the project containing API keys
|
|
11
|
-
*/
|
|
12
|
-
list(projectId: string): Promise<KeyResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* Retrieves a specific key associated with the provided projectId
|
|
15
|
-
* @param projectId Unique identifier of the project containing API keys
|
|
16
|
-
* @param keyId Unique identifier for the key to retrieve
|
|
17
|
-
*/
|
|
18
|
-
get(projectId: string, keyId: string): Promise<Key>;
|
|
19
|
-
/**
|
|
20
|
-
* Creates an API key with the provided scopes
|
|
21
|
-
* @param projectId Unique identifier of the project to create an API key under
|
|
22
|
-
* @param comment Comment to describe the key
|
|
23
|
-
* @param scopes Permission scopes associated with the API key
|
|
24
|
-
* @param options Optional options used when creating API keys
|
|
25
|
-
*/
|
|
26
|
-
create(projectId: string, comment: string, scopes: Array<string>, options?: CreateKeyOptions): Promise<Key>;
|
|
27
|
-
/**
|
|
28
|
-
* Deletes an API key
|
|
29
|
-
* @param projectId Unique identifier of the project to create an API key under
|
|
30
|
-
* @param keyId Unique identifier for the key to delete
|
|
31
|
-
*/
|
|
32
|
-
delete(projectId: string, keyId: string): Promise<void>;
|
|
33
|
-
}
|
package/bundle/keys.js
DELETED
|
@@ -1,132 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.Keys = void 0;
|
|
51
|
-
var Keys = /** @class */ (function () {
|
|
52
|
-
function Keys(_credentials, _apiUrl, _request) {
|
|
53
|
-
this._credentials = _credentials;
|
|
54
|
-
this._apiUrl = _apiUrl;
|
|
55
|
-
this._request = _request;
|
|
56
|
-
this.apiPath = "/v1/projects";
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Retrieves all keys associated with the provided projectId
|
|
60
|
-
* @param projectId Unique identifier of the project containing API keys
|
|
61
|
-
*/
|
|
62
|
-
Keys.prototype.list = function (projectId) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
var response, output;
|
|
65
|
-
return __generator(this, function (_a) {
|
|
66
|
-
switch (_a.label) {
|
|
67
|
-
case 0: return [4 /*yield*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(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
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves a specific key associated with the provided projectId
|
|
80
|
-
* @param projectId Unique identifier of the project containing API keys
|
|
81
|
-
* @param keyId Unique identifier for the key to retrieve
|
|
82
|
-
*/
|
|
83
|
-
Keys.prototype.get = function (projectId, keyId) {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/keys/").concat(keyId))];
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Creates an API key with the provided scopes
|
|
92
|
-
* @param projectId Unique identifier of the project to create an API key under
|
|
93
|
-
* @param comment Comment to describe the key
|
|
94
|
-
* @param scopes Permission scopes associated with the API key
|
|
95
|
-
* @param options Optional options used when creating API keys
|
|
96
|
-
*/
|
|
97
|
-
Keys.prototype.create = function (projectId, comment, scopes, options) {
|
|
98
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
-
return __generator(this, function (_a) {
|
|
100
|
-
/** Throw an error if the user provided both expirationDate and timeToLive */
|
|
101
|
-
if (options &&
|
|
102
|
-
options.expirationDate !== undefined &&
|
|
103
|
-
options.timeToLive !== undefined) {
|
|
104
|
-
throw new Error("Please provide expirationDate or timeToLive or neither. Providing both is not allowed.");
|
|
105
|
-
}
|
|
106
|
-
return [2 /*return*/, this._request("POST", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/keys"), JSON.stringify({
|
|
107
|
-
comment: comment,
|
|
108
|
-
scopes: scopes,
|
|
109
|
-
expiration_date: options && options.expirationDate
|
|
110
|
-
? options.expirationDate
|
|
111
|
-
: undefined,
|
|
112
|
-
time_to_live_in_seconds: options && options.timeToLive ? options.timeToLive : undefined,
|
|
113
|
-
}))];
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Deletes an API key
|
|
119
|
-
* @param projectId Unique identifier of the project to create an API key under
|
|
120
|
-
* @param keyId Unique identifier for the key to delete
|
|
121
|
-
*/
|
|
122
|
-
Keys.prototype.delete = function (projectId, keyId) {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
-
return __generator(this, function (_a) {
|
|
125
|
-
return [2 /*return*/, this._request("DELETE", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/keys/").concat(keyId))];
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
return Keys;
|
|
130
|
-
}());
|
|
131
|
-
exports.Keys = Keys;
|
|
132
|
-
//# sourceMappingURL=keys.js.map
|
package/bundle/keys.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;IACE,cACU,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;;;OAGG;IACG,mBAAI,GAAV,UAAW,SAAiB;;;;;4BACT,qBAAM,IAAI,CAAC,QAAQ,CAClC,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,UAAO,CACpC,EAAA;;wBALK,QAAQ,GAAG,SAKhB;wBAEK,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,MAAsB;4BAC1D,6BACK,MAAM,GACN,MAAM,CAAC,OAAO,EACjB;wBACJ,CAAC,CAAC,CAAC;wBAEH,sBAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAC;;;;KAC7B;IAED;;;;OAIG;IACG,kBAAG,GAAT,UAAU,SAAiB,EAAE,KAAa;;;gBACxC,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,mBAAS,KAAK,CAAE,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,IAAI,CAAC,QAAQ,CAClB,MAAM,EACN,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,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,IAAI,CAAC,QAAQ,CAClB,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,mBAAS,KAAK,CAAE,CAC7C,EAAC;;;KACH;IACH,WAAC;AAAD,CAAC,AApGD,IAoGC;AApGY,oBAAI"}
|
package/bundle/members.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { MemberList, Message, RequestFunction } from "./types";
|
|
2
|
-
export declare class Members {
|
|
3
|
-
private _credentials;
|
|
4
|
-
private _apiUrl;
|
|
5
|
-
private _request;
|
|
6
|
-
constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
|
|
7
|
-
private apiPath;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves account objects for all of the accounts in the specified project.
|
|
10
|
-
* @param projectId Unique identifier of the project
|
|
11
|
-
*/
|
|
12
|
-
listMembers(projectId: string): Promise<MemberList>;
|
|
13
|
-
/**
|
|
14
|
-
* Retrieves account objects for all of the accounts in the specified project.
|
|
15
|
-
* @param projectId Unique identifier of the project
|
|
16
|
-
* @param memberId Unique identifier of the member
|
|
17
|
-
*/
|
|
18
|
-
removeMember(projectId: string, memberId: string): Promise<Message>;
|
|
19
|
-
}
|
package/bundle/members.js
DELETED
|
@@ -1,73 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Members = void 0;
|
|
40
|
-
var Members = /** @class */ (function () {
|
|
41
|
-
function Members(_credentials, _apiUrl, _request) {
|
|
42
|
-
this._credentials = _credentials;
|
|
43
|
-
this._apiUrl = _apiUrl;
|
|
44
|
-
this._request = _request;
|
|
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*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(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*/, this._request("DELETE", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/members/").concat(memberId))];
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
return Members;
|
|
71
|
-
}());
|
|
72
|
-
exports.Members = Members;
|
|
73
|
-
//# sourceMappingURL=members.js.map
|
package/bundle/members.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"members.js","sourceRoot":"","sources":["../src/members.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IACE,iBACU,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;;;OAGG;IACG,6BAAW,GAAjB,UAAkB,SAAiB;;;gBACjC,sBAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,aAAU,CACvC,EAAC;;;KACH;IAED;;;;OAIG;IACG,8BAAY,GAAlB,UAAmB,SAAiB,EAAE,QAAgB;;;gBACpD,sBAAO,IAAI,CAAC,QAAQ,CAClB,QAAQ,EACR,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,OAAO,EACZ,UAAG,IAAI,CAAC,OAAO,cAAI,SAAS,sBAAY,QAAQ,CAAE,CACnD,EAAC;;;KACH;IACH,cAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,0BAAO"}
|
package/bundle/projects.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Project, ProjectPatchResponse, ProjectResponse, ProjectPatchRequest, RequestFunction } from "./types";
|
|
2
|
-
export declare class Projects {
|
|
3
|
-
private _credentials;
|
|
4
|
-
private _apiUrl;
|
|
5
|
-
private _request;
|
|
6
|
-
constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
|
|
7
|
-
private apiPath;
|
|
8
|
-
/**
|
|
9
|
-
* Returns all projects accessible by the API key
|
|
10
|
-
*/
|
|
11
|
-
list(): Promise<ProjectResponse>;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves a specific project based on the provided projectId
|
|
14
|
-
* @param projectId Unique identifier of the project to retrieve
|
|
15
|
-
*/
|
|
16
|
-
get(projectId: string): Promise<Project>;
|
|
17
|
-
/**
|
|
18
|
-
* Update a specific project
|
|
19
|
-
* @param project project to update
|
|
20
|
-
*/
|
|
21
|
-
update(project: Project, payload: ProjectPatchRequest): Promise<ProjectPatchResponse>;
|
|
22
|
-
}
|
package/bundle/projects.js
DELETED
|
@@ -1,82 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Projects = void 0;
|
|
40
|
-
var Projects = /** @class */ (function () {
|
|
41
|
-
function Projects(_credentials, _apiUrl, _request) {
|
|
42
|
-
this._credentials = _credentials;
|
|
43
|
-
this._apiUrl = _apiUrl;
|
|
44
|
-
this._request = _request;
|
|
45
|
-
this.apiPath = "/v1/projects";
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns all projects accessible by the API key
|
|
49
|
-
*/
|
|
50
|
-
Projects.prototype.list = function () {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
return __generator(this, function (_a) {
|
|
53
|
-
return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, this.apiPath)];
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Retrieves a specific project based on the provided projectId
|
|
59
|
-
* @param projectId Unique identifier of the project to retrieve
|
|
60
|
-
*/
|
|
61
|
-
Projects.prototype.get = function (projectId) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
return __generator(this, function (_a) {
|
|
64
|
-
return [2 /*return*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId))];
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Update a specific project
|
|
70
|
-
* @param project project to update
|
|
71
|
-
*/
|
|
72
|
-
Projects.prototype.update = function (project, payload) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
return __generator(this, function (_a) {
|
|
75
|
-
return [2 /*return*/, this._request("PATCH", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(project.project_id), JSON.stringify(payload))];
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
return Projects;
|
|
80
|
-
}());
|
|
81
|
-
exports.Projects = Projects;
|
|
82
|
-
//# sourceMappingURL=projects.js.map
|
package/bundle/projects.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/bundle/scopes.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ScopeList, Message, RequestFunction } from "./types";
|
|
2
|
-
export declare class Scopes {
|
|
3
|
-
private _credentials;
|
|
4
|
-
private _apiUrl;
|
|
5
|
-
private _request;
|
|
6
|
-
constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
|
|
7
|
-
private apiPath;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves scopes of the specified member in the specified project.
|
|
10
|
-
* @param projectId Unique identifier of the project
|
|
11
|
-
* @param memberId Unique identifier of the member
|
|
12
|
-
*/
|
|
13
|
-
get(projectId: string, memberId: string): Promise<ScopeList>;
|
|
14
|
-
/**
|
|
15
|
-
* Updates the scope for the specified member in the specified project.
|
|
16
|
-
* @param projectId Unique identifier of the project
|
|
17
|
-
* @param memberId Unique identifier of the member being updated
|
|
18
|
-
* @param scope string of the scope to update to
|
|
19
|
-
*/
|
|
20
|
-
update(projectID: string, memberId: string, scope: string): Promise<Message>;
|
|
21
|
-
}
|
package/bundle/scopes.js
DELETED
|
@@ -1,77 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Scopes = void 0;
|
|
40
|
-
var Scopes = /** @class */ (function () {
|
|
41
|
-
function Scopes(_credentials, _apiUrl, _request) {
|
|
42
|
-
this._credentials = _credentials;
|
|
43
|
-
this._apiUrl = _apiUrl;
|
|
44
|
-
this._request = _request;
|
|
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*/, this._request("GET", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectId, "/members/").concat(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*/, this._request("PUT", this._credentials, this._apiUrl, "".concat(this.apiPath, "/").concat(projectID, "/members/").concat(memberId, "/scopes"), JSON.stringify({
|
|
69
|
-
scope: scope,
|
|
70
|
-
}))];
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return Scopes;
|
|
75
|
-
}());
|
|
76
|
-
exports.Scopes = Scopes;
|
|
77
|
-
//# sourceMappingURL=scopes.js.map
|
package/bundle/scopes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource } from "../types";
|
|
2
|
-
import { LiveTranscription } from "./liveTranscription";
|
|
3
|
-
export declare class Transcriber {
|
|
4
|
-
private _credentials;
|
|
5
|
-
private _apiUrl;
|
|
6
|
-
constructor(_credentials: string, _apiUrl: string);
|
|
7
|
-
/**
|
|
8
|
-
* Transcribes prerecorded audio from a file or buffer
|
|
9
|
-
* @param source Url or Buffer of file to transcribe
|
|
10
|
-
* @param options Options to modify transcriptions
|
|
11
|
-
*/
|
|
12
|
-
preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions): Promise<PrerecordedTranscriptionResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* Opens a websocket to Deepgram's API for live transcriptions
|
|
15
|
-
* @param options Options to modify transcriptions
|
|
16
|
-
*/
|
|
17
|
-
live(options?: LiveTranscriptionOptions): LiveTranscription;
|
|
18
|
-
}
|