@eluvio/elv-client-js 4.0.86 → 4.0.88
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/dist/ElvClient-min.js +10 -10
- package/dist/ElvClient-node-min.js +11 -11
- package/dist/ElvFrameClient-min.js +7 -7
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +11 -11
- package/dist/ElvWalletClient-node-min.js +11 -11
- package/dist/src/ContentObjectAudit.js +163 -0
- package/dist/src/ElvClient.js +422 -444
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/HttpClient.js +70 -9
- package/dist/src/RemoteSigner.js +162 -57
- package/dist/src/Validation.js +6 -2
- package/dist/src/abr_profiles/abr_profile_live_to_vod.js +7 -0
- package/dist/src/client/ContentAccess.js +834 -770
- package/dist/src/client/ContentManagement.js +55 -3
- package/dist/src/client/Files.js +9 -6
- package/dist/src/client/LiveConf.js +144 -35
- package/dist/src/client/LiveStream.js +1104 -531
- package/dist/src/walletClient/index.js +366 -279
- package/package.json +1 -1
- package/src/ContentObjectAudit.js +98 -0
- package/src/ElvClient.js +7 -3
- package/src/FrameClient.js +2 -1
- package/src/HttpClient.js +36 -4
- package/src/Validation.js +5 -2
- package/src/client/ContentAccess.js +13 -10
- package/src/client/Files.js +7 -5
- package/src/client/LiveConf.js +11 -11
- package/src/client/LiveStream.js +29 -2
- package/src/ContentObjectVerification.js +0 -210
package/dist/src/FrameClient.js
CHANGED
|
@@ -449,7 +449,7 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
449
449
|
}, {
|
|
450
450
|
key: "AllowedMethods",
|
|
451
451
|
value: function AllowedMethods() {
|
|
452
|
-
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "SpaceNodes", "StartABRMezzanineJobs", "StreamConfig", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "
|
|
452
|
+
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AuditContentObject", "AuditStream", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamConfig", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamRemoveWatermark", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrl"];
|
|
453
453
|
}
|
|
454
454
|
}, {
|
|
455
455
|
key: "AllowedUserProfileMethods",
|
package/dist/src/HttpClient.js
CHANGED
|
@@ -27,8 +27,11 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
27
27
|
}
|
|
28
28
|
}, {
|
|
29
29
|
key: "BaseURI",
|
|
30
|
-
value: function BaseURI() {
|
|
31
|
-
|
|
30
|
+
value: function BaseURI(uriIndex) {
|
|
31
|
+
if (uriIndex === undefined) {
|
|
32
|
+
uriIndex = this.uriIndex;
|
|
33
|
+
}
|
|
34
|
+
return new URI(this.uris[uriIndex]);
|
|
32
35
|
}
|
|
33
36
|
}, {
|
|
34
37
|
key: "RecordWriteToken",
|
|
@@ -63,12 +66,12 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
63
66
|
key: "Request",
|
|
64
67
|
value: function () {
|
|
65
68
|
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
66
|
-
var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, baseURI, writeTokenMatch, writeToken, uri, fetchParameters, response, responseType, errorBody, error;
|
|
69
|
+
var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, uriIndex, baseURI, writeTokenMatch, writeToken, uri, fetchParameters, response, responseType, errorBody, error;
|
|
67
70
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
68
71
|
while (1) switch (_context.prev = _context.next) {
|
|
69
72
|
case 0:
|
|
70
|
-
method = _ref3.method, path = _ref3.path, _ref3$queryParams = _ref3.queryParams, queryParams = _ref3$queryParams === void 0 ? {} : _ref3$queryParams, body = _ref3.body, _ref3$bodyType = _ref3.bodyType, bodyType = _ref3$bodyType === void 0 ? "JSON" : _ref3$bodyType, _ref3$headers = _ref3.headers, headers = _ref3$headers === void 0 ? {} : _ref3$headers, _ref3$attempts = _ref3.attempts, attempts = _ref3$attempts === void 0 ? 0 : _ref3$attempts, _ref3$allowFailover = _ref3.allowFailover, allowFailover = _ref3$allowFailover === void 0 ? true : _ref3$allowFailover, _ref3$forceFailover = _ref3.forceFailover, forceFailover = _ref3$forceFailover === void 0 ? false : _ref3$forceFailover, _ref3$allowRetry = _ref3.allowRetry, allowRetry = _ref3$allowRetry === void 0 ? true : _ref3$allowRetry;
|
|
71
|
-
baseURI = this.BaseURI(); // If URL contains a write token, it must go to the correct server and can not fail over
|
|
73
|
+
method = _ref3.method, path = _ref3.path, _ref3$queryParams = _ref3.queryParams, queryParams = _ref3$queryParams === void 0 ? {} : _ref3$queryParams, body = _ref3.body, _ref3$bodyType = _ref3.bodyType, bodyType = _ref3$bodyType === void 0 ? "JSON" : _ref3$bodyType, _ref3$headers = _ref3.headers, headers = _ref3$headers === void 0 ? {} : _ref3$headers, _ref3$attempts = _ref3.attempts, attempts = _ref3$attempts === void 0 ? 0 : _ref3$attempts, _ref3$allowFailover = _ref3.allowFailover, allowFailover = _ref3$allowFailover === void 0 ? true : _ref3$allowFailover, _ref3$forceFailover = _ref3.forceFailover, forceFailover = _ref3$forceFailover === void 0 ? false : _ref3$forceFailover, _ref3$allowRetry = _ref3.allowRetry, allowRetry = _ref3$allowRetry === void 0 ? true : _ref3$allowRetry, uriIndex = _ref3.uriIndex;
|
|
74
|
+
baseURI = this.BaseURI(uriIndex); // If URL contains a write token, it must go to the correct server and can not fail over
|
|
72
75
|
writeTokenMatch = path.replace(/^\//, "").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/);
|
|
73
76
|
writeToken = writeTokenMatch ? writeTokenMatch[2] : undefined;
|
|
74
77
|
if (writeToken) {
|
|
@@ -146,6 +149,7 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
146
149
|
bodyType: bodyType,
|
|
147
150
|
headers: headers,
|
|
148
151
|
attempts: attempts + 1,
|
|
152
|
+
uriIndex: uriIndex,
|
|
149
153
|
forceFailover: forceFailover
|
|
150
154
|
});
|
|
151
155
|
case 30:
|
|
@@ -201,12 +205,69 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
201
205
|
}
|
|
202
206
|
return Request;
|
|
203
207
|
}()
|
|
208
|
+
}, {
|
|
209
|
+
key: "RequestAll",
|
|
210
|
+
value: function () {
|
|
211
|
+
var _RequestAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
212
|
+
var _this = this;
|
|
213
|
+
var method, path, _ref4$queryParams, queryParams, body, _ref4$bodyType, bodyType, _ref4$headers, headers;
|
|
214
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
215
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
216
|
+
case 0:
|
|
217
|
+
method = _ref4.method, path = _ref4.path, _ref4$queryParams = _ref4.queryParams, queryParams = _ref4$queryParams === void 0 ? {} : _ref4$queryParams, body = _ref4.body, _ref4$bodyType = _ref4.bodyType, bodyType = _ref4$bodyType === void 0 ? "JSON" : _ref4$bodyType, _ref4$headers = _ref4.headers, headers = _ref4$headers === void 0 ? {} : _ref4$headers;
|
|
218
|
+
_context3.next = 3;
|
|
219
|
+
return Promise.all(Array.from(new Array(this.uris.length).keys()).map( /*#__PURE__*/function () {
|
|
220
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(uriIndex) {
|
|
221
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
222
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
223
|
+
case 0:
|
|
224
|
+
_context2.prev = 0;
|
|
225
|
+
_context2.next = 3;
|
|
226
|
+
return _this.Request({
|
|
227
|
+
method: method,
|
|
228
|
+
path: path,
|
|
229
|
+
queryParams: queryParams,
|
|
230
|
+
body: body,
|
|
231
|
+
bodyType: bodyType,
|
|
232
|
+
headers: headers,
|
|
233
|
+
allowFailover: false,
|
|
234
|
+
uriIndex: uriIndex
|
|
235
|
+
});
|
|
236
|
+
case 3:
|
|
237
|
+
return _context2.abrupt("return", _context2.sent);
|
|
238
|
+
case 6:
|
|
239
|
+
_context2.prev = 6;
|
|
240
|
+
_context2.t0 = _context2["catch"](0);
|
|
241
|
+
return _context2.abrupt("return", _context2.t0);
|
|
242
|
+
case 9:
|
|
243
|
+
case "end":
|
|
244
|
+
return _context2.stop();
|
|
245
|
+
}
|
|
246
|
+
}, _callee2, null, [[0, 6]]);
|
|
247
|
+
}));
|
|
248
|
+
return function (_x3) {
|
|
249
|
+
return _ref5.apply(this, arguments);
|
|
250
|
+
};
|
|
251
|
+
}()));
|
|
252
|
+
case 3:
|
|
253
|
+
return _context3.abrupt("return", _context3.sent);
|
|
254
|
+
case 4:
|
|
255
|
+
case "end":
|
|
256
|
+
return _context3.stop();
|
|
257
|
+
}
|
|
258
|
+
}, _callee3, this);
|
|
259
|
+
}));
|
|
260
|
+
function RequestAll(_x2) {
|
|
261
|
+
return _RequestAll.apply(this, arguments);
|
|
262
|
+
}
|
|
263
|
+
return RequestAll;
|
|
264
|
+
}()
|
|
204
265
|
}, {
|
|
205
266
|
key: "URL",
|
|
206
|
-
value: function URL(
|
|
207
|
-
var path =
|
|
208
|
-
|
|
209
|
-
queryParams =
|
|
267
|
+
value: function URL(_ref6) {
|
|
268
|
+
var path = _ref6.path,
|
|
269
|
+
_ref6$queryParams = _ref6.queryParams,
|
|
270
|
+
queryParams = _ref6$queryParams === void 0 ? {} : _ref6$queryParams;
|
|
210
271
|
var baseURI = this.BaseURI();
|
|
211
272
|
|
|
212
273
|
// If URL contains a write token, it must go to the correct server and can not fail over
|
package/dist/src/RemoteSigner.js
CHANGED
|
@@ -11,6 +11,7 @@ var Ethers = require("ethers");
|
|
|
11
11
|
var Utils = require("./Utils");
|
|
12
12
|
var HttpClient = require("./HttpClient");
|
|
13
13
|
var UrlJoin = require("url-join");
|
|
14
|
+
var UUID = require("uuid");
|
|
14
15
|
var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
15
16
|
"use strict";
|
|
16
17
|
|
|
@@ -110,6 +111,110 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
110
111
|
return _Initialize.apply(this, arguments);
|
|
111
112
|
}
|
|
112
113
|
return Initialize;
|
|
114
|
+
}()
|
|
115
|
+
}, {
|
|
116
|
+
key: "RetrieveCSAT",
|
|
117
|
+
value: function () {
|
|
118
|
+
var _RetrieveCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
119
|
+
var email, nonce, _ref2$force, force, response;
|
|
120
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
121
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
122
|
+
case 0:
|
|
123
|
+
email = _ref2.email, nonce = _ref2.nonce, _ref2$force = _ref2.force, force = _ref2$force === void 0 ? false : _ref2$force;
|
|
124
|
+
nonce = nonce || Utils.B58(UUID.parse(UUID.v4()));
|
|
125
|
+
_context2.next = 4;
|
|
126
|
+
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
127
|
+
method: "POST",
|
|
128
|
+
body: {
|
|
129
|
+
email: email,
|
|
130
|
+
nonce: nonce,
|
|
131
|
+
force: force
|
|
132
|
+
},
|
|
133
|
+
path: UrlJoin("as", "wlt", "sign", "csat"),
|
|
134
|
+
headers: {
|
|
135
|
+
Authorization: "Bearer ".concat(this.authToken)
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
case 4:
|
|
139
|
+
response = _context2.sent;
|
|
140
|
+
response.nonce = nonce;
|
|
141
|
+
return _context2.abrupt("return", response);
|
|
142
|
+
case 7:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context2.stop();
|
|
145
|
+
}
|
|
146
|
+
}, _callee2, this);
|
|
147
|
+
}));
|
|
148
|
+
function RetrieveCSAT(_x) {
|
|
149
|
+
return _RetrieveCSAT.apply(this, arguments);
|
|
150
|
+
}
|
|
151
|
+
return RetrieveCSAT;
|
|
152
|
+
}()
|
|
153
|
+
}, {
|
|
154
|
+
key: "CSATStatus",
|
|
155
|
+
value: function () {
|
|
156
|
+
var _CSATStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
157
|
+
var accessToken, response;
|
|
158
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
159
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
accessToken = _ref3.accessToken;
|
|
162
|
+
_context3.prev = 1;
|
|
163
|
+
_context3.next = 4;
|
|
164
|
+
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
165
|
+
method: "POST",
|
|
166
|
+
path: UrlJoin("as", "wlt", "login", "status"),
|
|
167
|
+
headers: {
|
|
168
|
+
Authorization: "Bearer ".concat(accessToken)
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
case 4:
|
|
172
|
+
response = _context3.sent;
|
|
173
|
+
return _context3.abrupt("return", response && response.is_active);
|
|
174
|
+
case 8:
|
|
175
|
+
_context3.prev = 8;
|
|
176
|
+
_context3.t0 = _context3["catch"](1);
|
|
177
|
+
return _context3.abrupt("return", !_context3.t0 || _context3.t0.status !== 403);
|
|
178
|
+
case 11:
|
|
179
|
+
case "end":
|
|
180
|
+
return _context3.stop();
|
|
181
|
+
}
|
|
182
|
+
}, _callee3, this, [[1, 8]]);
|
|
183
|
+
}));
|
|
184
|
+
function CSATStatus(_x2) {
|
|
185
|
+
return _CSATStatus.apply(this, arguments);
|
|
186
|
+
}
|
|
187
|
+
return CSATStatus;
|
|
188
|
+
}()
|
|
189
|
+
}, {
|
|
190
|
+
key: "ReleaseCSAT",
|
|
191
|
+
value: function () {
|
|
192
|
+
var _ReleaseCSAT = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
193
|
+
var accessToken;
|
|
194
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
195
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
196
|
+
case 0:
|
|
197
|
+
accessToken = _ref4.accessToken;
|
|
198
|
+
_context4.next = 3;
|
|
199
|
+
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
200
|
+
method: "POST",
|
|
201
|
+
path: UrlJoin("as", "wlt", "login", "release"),
|
|
202
|
+
headers: {
|
|
203
|
+
Authorization: "Bearer ".concat(accessToken)
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
case 3:
|
|
207
|
+
return _context4.abrupt("return", _context4.sent);
|
|
208
|
+
case 4:
|
|
209
|
+
case "end":
|
|
210
|
+
return _context4.stop();
|
|
211
|
+
}
|
|
212
|
+
}, _callee4, this);
|
|
213
|
+
}));
|
|
214
|
+
function ReleaseCSAT(_x3) {
|
|
215
|
+
return _ReleaseCSAT.apply(this, arguments);
|
|
216
|
+
}
|
|
217
|
+
return ReleaseCSAT;
|
|
113
218
|
}() // Overrides
|
|
114
219
|
}, {
|
|
115
220
|
key: "getAddress",
|
|
@@ -119,20 +224,20 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
119
224
|
}, {
|
|
120
225
|
key: "signDigest",
|
|
121
226
|
value: function () {
|
|
122
|
-
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
227
|
+
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(digest) {
|
|
123
228
|
var _this2 = this;
|
|
124
|
-
return _regeneratorRuntime.wrap(function
|
|
125
|
-
while (1) switch (
|
|
229
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
230
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
126
231
|
case 0:
|
|
127
232
|
if (!this.signatureCache[digest]) {
|
|
128
233
|
this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
|
|
129
|
-
var
|
|
234
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve, reject) {
|
|
130
235
|
var signature;
|
|
131
|
-
return _regeneratorRuntime.wrap(function
|
|
132
|
-
while (1) switch (
|
|
236
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
237
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
133
238
|
case 0:
|
|
134
|
-
|
|
135
|
-
|
|
239
|
+
_context5.prev = 0;
|
|
240
|
+
_context5.next = 3;
|
|
136
241
|
return Utils.ResponseToJson(_this2.HttpClient.Request({
|
|
137
242
|
method: "POST",
|
|
138
243
|
path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
|
|
@@ -144,38 +249,38 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
144
249
|
}
|
|
145
250
|
}));
|
|
146
251
|
case 3:
|
|
147
|
-
signature =
|
|
252
|
+
signature = _context5.sent;
|
|
148
253
|
signature.v = parseInt(signature.v, 16);
|
|
149
254
|
signature.recoveryParam = signature.v - 27;
|
|
150
255
|
resolve(signature);
|
|
151
|
-
|
|
256
|
+
_context5.next = 12;
|
|
152
257
|
break;
|
|
153
258
|
case 9:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
reject(
|
|
259
|
+
_context5.prev = 9;
|
|
260
|
+
_context5.t0 = _context5["catch"](0);
|
|
261
|
+
reject(_context5.t0);
|
|
157
262
|
case 12:
|
|
158
263
|
case "end":
|
|
159
|
-
return
|
|
264
|
+
return _context5.stop();
|
|
160
265
|
}
|
|
161
|
-
},
|
|
266
|
+
}, _callee5, null, [[0, 9]]);
|
|
162
267
|
}));
|
|
163
|
-
return function (
|
|
164
|
-
return
|
|
268
|
+
return function (_x5, _x6) {
|
|
269
|
+
return _ref5.apply(this, arguments);
|
|
165
270
|
};
|
|
166
271
|
}());
|
|
167
272
|
}
|
|
168
|
-
|
|
273
|
+
_context6.next = 3;
|
|
169
274
|
return this.signatureCache[digest];
|
|
170
275
|
case 3:
|
|
171
|
-
return
|
|
276
|
+
return _context6.abrupt("return", _context6.sent);
|
|
172
277
|
case 4:
|
|
173
278
|
case "end":
|
|
174
|
-
return
|
|
279
|
+
return _context6.stop();
|
|
175
280
|
}
|
|
176
|
-
},
|
|
281
|
+
}, _callee6, this);
|
|
177
282
|
}));
|
|
178
|
-
function signDigest(
|
|
283
|
+
function signDigest(_x4) {
|
|
179
284
|
return _signDigest.apply(this, arguments);
|
|
180
285
|
}
|
|
181
286
|
return signDigest;
|
|
@@ -183,27 +288,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
183
288
|
}, {
|
|
184
289
|
key: "signMessage",
|
|
185
290
|
value: function () {
|
|
186
|
-
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
187
|
-
return _regeneratorRuntime.wrap(function
|
|
188
|
-
while (1) switch (
|
|
291
|
+
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(message) {
|
|
292
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
293
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
189
294
|
case 0:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
295
|
+
_context7.t0 = Promise;
|
|
296
|
+
_context7.t1 = Ethers.utils;
|
|
297
|
+
_context7.t2 = "0x";
|
|
298
|
+
_context7.next = 5;
|
|
194
299
|
return this.signDigest(Ethers.utils.hashMessage(message));
|
|
195
300
|
case 5:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return
|
|
301
|
+
_context7.t3 = _context7.sent;
|
|
302
|
+
_context7.t4 = _context7.t2.concat.call(_context7.t2, _context7.t3);
|
|
303
|
+
_context7.t5 = _context7.t1.joinSignature.call(_context7.t1, _context7.t4);
|
|
304
|
+
return _context7.abrupt("return", _context7.t0.resolve.call(_context7.t0, _context7.t5));
|
|
200
305
|
case 9:
|
|
201
306
|
case "end":
|
|
202
|
-
return
|
|
307
|
+
return _context7.stop();
|
|
203
308
|
}
|
|
204
|
-
},
|
|
309
|
+
}, _callee7, this);
|
|
205
310
|
}));
|
|
206
|
-
function signMessage(
|
|
311
|
+
function signMessage(_x7) {
|
|
207
312
|
return _signMessage.apply(this, arguments);
|
|
208
313
|
}
|
|
209
314
|
return signMessage;
|
|
@@ -211,27 +316,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
211
316
|
}, {
|
|
212
317
|
key: "sign",
|
|
213
318
|
value: function () {
|
|
214
|
-
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
319
|
+
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(transaction) {
|
|
215
320
|
var signature;
|
|
216
|
-
return _regeneratorRuntime.wrap(function
|
|
217
|
-
while (1) switch (
|
|
321
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
322
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
218
323
|
case 0:
|
|
219
|
-
|
|
324
|
+
_context8.next = 2;
|
|
220
325
|
return Ethers.utils.resolveProperties(transaction);
|
|
221
326
|
case 2:
|
|
222
|
-
transaction =
|
|
223
|
-
|
|
327
|
+
transaction = _context8.sent;
|
|
328
|
+
_context8.next = 5;
|
|
224
329
|
return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
|
|
225
330
|
case 5:
|
|
226
|
-
signature =
|
|
227
|
-
return
|
|
331
|
+
signature = _context8.sent;
|
|
332
|
+
return _context8.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
|
|
228
333
|
case 7:
|
|
229
334
|
case "end":
|
|
230
|
-
return
|
|
335
|
+
return _context8.stop();
|
|
231
336
|
}
|
|
232
|
-
},
|
|
337
|
+
}, _callee8, this);
|
|
233
338
|
}));
|
|
234
|
-
function sign(
|
|
339
|
+
function sign(_x8) {
|
|
235
340
|
return _sign.apply(this, arguments);
|
|
236
341
|
}
|
|
237
342
|
return sign;
|
|
@@ -239,33 +344,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
239
344
|
}, {
|
|
240
345
|
key: "sendTransaction",
|
|
241
346
|
value: function () {
|
|
242
|
-
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
347
|
+
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
|
|
243
348
|
var _this3 = this;
|
|
244
|
-
return _regeneratorRuntime.wrap(function
|
|
245
|
-
while (1) switch (
|
|
349
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
350
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
246
351
|
case 0:
|
|
247
352
|
if (!(transaction.nonce == null)) {
|
|
248
|
-
|
|
353
|
+
_context9.next = 5;
|
|
249
354
|
break;
|
|
250
355
|
}
|
|
251
356
|
transaction = Ethers.utils.shallowCopy(transaction);
|
|
252
|
-
|
|
357
|
+
_context9.next = 4;
|
|
253
358
|
return this.provider.getTransactionCount(this.address, "pending");
|
|
254
359
|
case 4:
|
|
255
|
-
transaction.nonce =
|
|
360
|
+
transaction.nonce = _context9.sent;
|
|
256
361
|
case 5:
|
|
257
|
-
return
|
|
362
|
+
return _context9.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
|
|
258
363
|
return _this3.sign(tx).then(function (signedTransaction) {
|
|
259
364
|
return _this3.provider.sendTransaction(signedTransaction);
|
|
260
365
|
});
|
|
261
366
|
}));
|
|
262
367
|
case 6:
|
|
263
368
|
case "end":
|
|
264
|
-
return
|
|
369
|
+
return _context9.stop();
|
|
265
370
|
}
|
|
266
|
-
},
|
|
371
|
+
}, _callee9, this);
|
|
267
372
|
}));
|
|
268
|
-
function sendTransaction(
|
|
373
|
+
function sendTransaction(_x9) {
|
|
269
374
|
return _sendTransaction.apply(this, arguments);
|
|
270
375
|
}
|
|
271
376
|
return sendTransaction;
|
package/dist/src/Validation.js
CHANGED
|
@@ -44,8 +44,12 @@ exports.ValidatePartHash = function (partHash) {
|
|
|
44
44
|
exports.ValidateParameters = function (_ref) {
|
|
45
45
|
var libraryId = _ref.libraryId,
|
|
46
46
|
objectId = _ref.objectId,
|
|
47
|
-
versionHash = _ref.versionHash
|
|
48
|
-
|
|
47
|
+
versionHash = _ref.versionHash,
|
|
48
|
+
writeToken = _ref.writeToken;
|
|
49
|
+
if (writeToken) {
|
|
50
|
+
if (versionHash) throw Error("Cannot specify writeToken and versionHash at same time (token:".concat(writeToken, ", hash:").concat(versionHash, ")"));
|
|
51
|
+
exports.ValidateWriteToken(writeToken);
|
|
52
|
+
} else if (versionHash) {
|
|
49
53
|
exports.ValidateVersion(versionHash);
|
|
50
54
|
} else {
|
|
51
55
|
exports.ValidateLibrary(libraryId);
|
|
@@ -16,6 +16,13 @@ var AbrProfileLiveVod = {
|
|
|
16
16
|
"pregenerate": true
|
|
17
17
|
}]
|
|
18
18
|
},
|
|
19
|
+
"{\"media_type\":\"audio\",\"channels\":6}": {
|
|
20
|
+
"rung_specs": [{
|
|
21
|
+
"bit_rate": 384000,
|
|
22
|
+
"media_type": "audio",
|
|
23
|
+
"pregenerate": true
|
|
24
|
+
}]
|
|
25
|
+
},
|
|
19
26
|
"{\"media_type\":\"video\",\"aspect_ratio_height\":273,\"aspect_ratio_width\":640}": {
|
|
20
27
|
"rung_specs": [{
|
|
21
28
|
"bit_rate": 9500000,
|