@eluvio/elv-client-js 4.2.22 → 4.2.23
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 +1 -1
- package/dist/ElvClient-node-min.js +1 -1
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/AuthorizationClient.js +12 -7
- package/dist/src/ContentObjectAudit.js +1 -2
- package/dist/src/ElvClient.js +13 -25
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/HttpClient.js +47 -90
- package/dist/src/RemoteSigner.js +70 -170
- package/dist/src/abr_profiles/abr_profile_live_drm.js +10 -0
- package/dist/src/client/ContentAccess.js +1154 -1196
- package/dist/src/client/ContentManagement.js +41 -67
- package/dist/src/client/LiveConf.js +84 -171
- package/dist/src/client/LiveStream.js +2115 -5213
- package/dist/src/client/NTP.js +77 -172
- package/package.json +1 -1
- package/src/Crypto.js +13 -1
- package/src/ElvClient.js +1 -3
- package/src/client/ContentAccess.js +2 -6
- package/src/client/ContentManagement.js +2 -6
- package/dist/src/ContentObjectVerification.js +0 -281
- package/dist/src/NetworkUrls.js +0 -8
- package/dist/src/live_recording_config_profiles/live_recording_config_default.js +0 -45
package/dist/src/RemoteSigner.js
CHANGED
|
@@ -49,12 +49,12 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
49
49
|
key: "Initialize",
|
|
50
50
|
value: function () {
|
|
51
51
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
52
|
-
var body, _yield$Utils$Response, addr, eth, token,
|
|
52
|
+
var body, _yield$Utils$Response, addr, eth, token, keys, address;
|
|
53
53
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
54
54
|
while (1) switch (_context.prev = _context.next) {
|
|
55
55
|
case 0:
|
|
56
56
|
if (this.authToken) {
|
|
57
|
-
_context.next =
|
|
57
|
+
_context.next = 13;
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
body = {
|
|
@@ -80,17 +80,15 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
80
80
|
addr = _yield$Utils$Response.addr;
|
|
81
81
|
eth = _yield$Utils$Response.eth;
|
|
82
82
|
token = _yield$Utils$Response.token;
|
|
83
|
-
pubkey = _yield$Utils$Response.pubkey;
|
|
84
83
|
this.authToken = token;
|
|
85
84
|
this.address = Utils.FormatAddress(addr);
|
|
86
85
|
this.id = eth;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_context.next = 21;
|
|
86
|
+
case 13:
|
|
87
|
+
if (this.address) {
|
|
88
|
+
_context.next = 19;
|
|
91
89
|
break;
|
|
92
90
|
}
|
|
93
|
-
_context.next =
|
|
91
|
+
_context.next = 16;
|
|
94
92
|
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
95
93
|
method: "GET",
|
|
96
94
|
path: UrlJoin("as", "wlt", "keys"),
|
|
@@ -98,23 +96,18 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
98
96
|
Authorization: "Bearer ".concat(this.authToken)
|
|
99
97
|
}
|
|
100
98
|
}));
|
|
101
|
-
case
|
|
99
|
+
case 16:
|
|
102
100
|
keys = _context.sent;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.address = Utils.HashToAddress(keys.eth[0]);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (!this.publicKey) {
|
|
112
|
-
this.publicKey = keys.pubkey && keys.pubkey[0];
|
|
101
|
+
address = keys.eth[0];
|
|
102
|
+
if (address && address.startsWith("0x")) {
|
|
103
|
+
this.address = address;
|
|
104
|
+
} else {
|
|
105
|
+
this.address = Utils.HashToAddress(keys.eth[0]);
|
|
113
106
|
}
|
|
114
|
-
case
|
|
107
|
+
case 19:
|
|
115
108
|
this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
|
|
116
109
|
this.signer = this.provider.getSigner(this.address);
|
|
117
|
-
case
|
|
110
|
+
case 21:
|
|
118
111
|
case "end":
|
|
119
112
|
return _context.stop();
|
|
120
113
|
}
|
|
@@ -284,116 +277,23 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
284
277
|
value: function getAddress() {
|
|
285
278
|
return this.address;
|
|
286
279
|
}
|
|
287
|
-
}, {
|
|
288
|
-
key: "_normalizePublicKey",
|
|
289
|
-
value: function _normalizePublicKey(key) {
|
|
290
|
-
var with0x = key.startsWith("0x") ? key : "0x".concat(key);
|
|
291
|
-
return with0x.length === 2 + 128 ? "0x04".concat(with0x.slice(2)) : with0x;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* This signer's public key, as provided by the authd service
|
|
296
|
-
*
|
|
297
|
-
* @return {Promise<string>} - The public key, in uncompressed hex like SigningKey.publicKey
|
|
298
|
-
*/
|
|
299
|
-
}, {
|
|
300
|
-
key: "PublicKey",
|
|
301
|
-
value: function () {
|
|
302
|
-
var _PublicKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
303
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
304
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
305
|
-
case 0:
|
|
306
|
-
if (this.publicKey) {
|
|
307
|
-
_context6.next = 2;
|
|
308
|
-
break;
|
|
309
|
-
}
|
|
310
|
-
throw Error("RemoteSigner: public key not available - call Initialize() first");
|
|
311
|
-
case 2:
|
|
312
|
-
return _context6.abrupt("return", this._normalizePublicKey(this.publicKey));
|
|
313
|
-
case 3:
|
|
314
|
-
case "end":
|
|
315
|
-
return _context6.stop();
|
|
316
|
-
}
|
|
317
|
-
}, _callee6, this);
|
|
318
|
-
}));
|
|
319
|
-
function PublicKey() {
|
|
320
|
-
return _PublicKey.apply(this, arguments);
|
|
321
|
-
}
|
|
322
|
-
return PublicKey;
|
|
323
|
-
}() /** so remote signers can be used interchangeably with local signers */
|
|
324
|
-
}, {
|
|
325
|
-
key: "_signingKey",
|
|
326
|
-
value: function _signingKey() {
|
|
327
|
-
if (!this.publicKey) {
|
|
328
|
-
throw Error("RemoteSigner: public key not available - call Initialize() first");
|
|
329
|
-
}
|
|
330
|
-
var publicKey = this._normalizePublicKey(this.publicKey);
|
|
331
|
-
return {
|
|
332
|
-
publicKey: publicKey,
|
|
333
|
-
get privateKey() {
|
|
334
|
-
throw Error("RemoteSigner: remote signer does not have direct access to a private key");
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Decrypt a secp256k1 ECIES-encrypted blob (e.g. a fabric encryption conk) that was wrapped
|
|
341
|
-
* for this signer's public key, via the authd service's generic decrypt endpoint.
|
|
342
|
-
*
|
|
343
|
-
* @param {string} encryptedData - Base64-encoded ECIES-encrypted blob
|
|
344
|
-
* @return {Promise<Object>} - The decrypted, JSON-parsed contents
|
|
345
|
-
*/
|
|
346
|
-
}, {
|
|
347
|
-
key: "DecryptCap",
|
|
348
|
-
value: function () {
|
|
349
|
-
var _DecryptCap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(encryptedData) {
|
|
350
|
-
var _yield$Utils$Response2, data;
|
|
351
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
352
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
353
|
-
case 0:
|
|
354
|
-
_context7.next = 2;
|
|
355
|
-
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
356
|
-
method: "POST",
|
|
357
|
-
path: UrlJoin("as", "wlt", "decrypt", "eth", this.id),
|
|
358
|
-
headers: {
|
|
359
|
-
Authorization: "Bearer ".concat(this.authToken)
|
|
360
|
-
},
|
|
361
|
-
body: {
|
|
362
|
-
data: encryptedData
|
|
363
|
-
}
|
|
364
|
-
}));
|
|
365
|
-
case 2:
|
|
366
|
-
_yield$Utils$Response2 = _context7.sent;
|
|
367
|
-
data = _yield$Utils$Response2.data;
|
|
368
|
-
return _context7.abrupt("return", JSON.parse(Buffer.from(data, "base64").toString()));
|
|
369
|
-
case 5:
|
|
370
|
-
case "end":
|
|
371
|
-
return _context7.stop();
|
|
372
|
-
}
|
|
373
|
-
}, _callee7, this);
|
|
374
|
-
}));
|
|
375
|
-
function DecryptCap(_x5) {
|
|
376
|
-
return _DecryptCap.apply(this, arguments);
|
|
377
|
-
}
|
|
378
|
-
return DecryptCap;
|
|
379
|
-
}()
|
|
380
280
|
}, {
|
|
381
281
|
key: "signDigest",
|
|
382
282
|
value: function () {
|
|
383
|
-
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
283
|
+
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(digest) {
|
|
384
284
|
var _this2 = this;
|
|
385
|
-
return _regeneratorRuntime.wrap(function
|
|
386
|
-
while (1) switch (
|
|
285
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
286
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
387
287
|
case 0:
|
|
388
288
|
if (!this.signatureCache[digest]) {
|
|
389
289
|
this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
|
|
390
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
290
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(resolve, reject) {
|
|
391
291
|
var signature;
|
|
392
|
-
return _regeneratorRuntime.wrap(function
|
|
393
|
-
while (1) switch (
|
|
292
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
293
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
394
294
|
case 0:
|
|
395
|
-
|
|
396
|
-
|
|
295
|
+
_context6.prev = 0;
|
|
296
|
+
_context6.next = 3;
|
|
397
297
|
return Utils.ResponseToJson(_this2.HttpClient.Request({
|
|
398
298
|
method: "POST",
|
|
399
299
|
path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
|
|
@@ -405,38 +305,38 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
405
305
|
}
|
|
406
306
|
}));
|
|
407
307
|
case 3:
|
|
408
|
-
signature =
|
|
308
|
+
signature = _context6.sent;
|
|
409
309
|
signature.v = parseInt(signature.v, 16);
|
|
410
310
|
signature.recoveryParam = signature.v - 27;
|
|
411
311
|
resolve(signature);
|
|
412
|
-
|
|
312
|
+
_context6.next = 12;
|
|
413
313
|
break;
|
|
414
314
|
case 9:
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
reject(
|
|
315
|
+
_context6.prev = 9;
|
|
316
|
+
_context6.t0 = _context6["catch"](0);
|
|
317
|
+
reject(_context6.t0);
|
|
418
318
|
case 12:
|
|
419
319
|
case "end":
|
|
420
|
-
return
|
|
320
|
+
return _context6.stop();
|
|
421
321
|
}
|
|
422
|
-
},
|
|
322
|
+
}, _callee6, null, [[0, 9]]);
|
|
423
323
|
}));
|
|
424
|
-
return function (
|
|
324
|
+
return function (_x6, _x7) {
|
|
425
325
|
return _ref6.apply(this, arguments);
|
|
426
326
|
};
|
|
427
327
|
}());
|
|
428
328
|
}
|
|
429
|
-
|
|
329
|
+
_context7.next = 3;
|
|
430
330
|
return this.signatureCache[digest];
|
|
431
331
|
case 3:
|
|
432
|
-
return
|
|
332
|
+
return _context7.abrupt("return", _context7.sent);
|
|
433
333
|
case 4:
|
|
434
334
|
case "end":
|
|
435
|
-
return
|
|
335
|
+
return _context7.stop();
|
|
436
336
|
}
|
|
437
|
-
},
|
|
337
|
+
}, _callee7, this);
|
|
438
338
|
}));
|
|
439
|
-
function signDigest(
|
|
339
|
+
function signDigest(_x5) {
|
|
440
340
|
return _signDigest.apply(this, arguments);
|
|
441
341
|
}
|
|
442
342
|
return signDigest;
|
|
@@ -444,27 +344,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
444
344
|
}, {
|
|
445
345
|
key: "signMessage",
|
|
446
346
|
value: function () {
|
|
447
|
-
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
448
|
-
return _regeneratorRuntime.wrap(function
|
|
449
|
-
while (1) switch (
|
|
347
|
+
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(message) {
|
|
348
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
349
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
450
350
|
case 0:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
351
|
+
_context8.t0 = Promise;
|
|
352
|
+
_context8.t1 = Ethers.utils;
|
|
353
|
+
_context8.t2 = "0x";
|
|
354
|
+
_context8.next = 5;
|
|
455
355
|
return this.signDigest(Ethers.utils.hashMessage(message));
|
|
456
356
|
case 5:
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return
|
|
357
|
+
_context8.t3 = _context8.sent;
|
|
358
|
+
_context8.t4 = _context8.t2.concat.call(_context8.t2, _context8.t3);
|
|
359
|
+
_context8.t5 = _context8.t1.joinSignature.call(_context8.t1, _context8.t4);
|
|
360
|
+
return _context8.abrupt("return", _context8.t0.resolve.call(_context8.t0, _context8.t5));
|
|
461
361
|
case 9:
|
|
462
362
|
case "end":
|
|
463
|
-
return
|
|
363
|
+
return _context8.stop();
|
|
464
364
|
}
|
|
465
|
-
},
|
|
365
|
+
}, _callee8, this);
|
|
466
366
|
}));
|
|
467
|
-
function signMessage(
|
|
367
|
+
function signMessage(_x8) {
|
|
468
368
|
return _signMessage.apply(this, arguments);
|
|
469
369
|
}
|
|
470
370
|
return signMessage;
|
|
@@ -472,27 +372,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
472
372
|
}, {
|
|
473
373
|
key: "sign",
|
|
474
374
|
value: function () {
|
|
475
|
-
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
375
|
+
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
|
|
476
376
|
var signature;
|
|
477
|
-
return _regeneratorRuntime.wrap(function
|
|
478
|
-
while (1) switch (
|
|
377
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
378
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
479
379
|
case 0:
|
|
480
|
-
|
|
380
|
+
_context9.next = 2;
|
|
481
381
|
return Ethers.utils.resolveProperties(transaction);
|
|
482
382
|
case 2:
|
|
483
|
-
transaction =
|
|
484
|
-
|
|
383
|
+
transaction = _context9.sent;
|
|
384
|
+
_context9.next = 5;
|
|
485
385
|
return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
|
|
486
386
|
case 5:
|
|
487
|
-
signature =
|
|
488
|
-
return
|
|
387
|
+
signature = _context9.sent;
|
|
388
|
+
return _context9.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
|
|
489
389
|
case 7:
|
|
490
390
|
case "end":
|
|
491
|
-
return
|
|
391
|
+
return _context9.stop();
|
|
492
392
|
}
|
|
493
|
-
},
|
|
393
|
+
}, _callee9, this);
|
|
494
394
|
}));
|
|
495
|
-
function sign(
|
|
395
|
+
function sign(_x9) {
|
|
496
396
|
return _sign.apply(this, arguments);
|
|
497
397
|
}
|
|
498
398
|
return sign;
|
|
@@ -500,33 +400,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
500
400
|
}, {
|
|
501
401
|
key: "sendTransaction",
|
|
502
402
|
value: function () {
|
|
503
|
-
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
403
|
+
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(transaction) {
|
|
504
404
|
var _this3 = this;
|
|
505
|
-
return _regeneratorRuntime.wrap(function
|
|
506
|
-
while (1) switch (
|
|
405
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
406
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
507
407
|
case 0:
|
|
508
408
|
if (!(transaction.nonce == null)) {
|
|
509
|
-
|
|
409
|
+
_context10.next = 5;
|
|
510
410
|
break;
|
|
511
411
|
}
|
|
512
412
|
transaction = Ethers.utils.shallowCopy(transaction);
|
|
513
|
-
|
|
413
|
+
_context10.next = 4;
|
|
514
414
|
return this.provider.getTransactionCount(this.address, "pending");
|
|
515
415
|
case 4:
|
|
516
|
-
transaction.nonce =
|
|
416
|
+
transaction.nonce = _context10.sent;
|
|
517
417
|
case 5:
|
|
518
|
-
return
|
|
418
|
+
return _context10.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
|
|
519
419
|
return _this3.sign(tx).then(function (signedTransaction) {
|
|
520
420
|
return _this3.provider.sendTransaction(signedTransaction);
|
|
521
421
|
});
|
|
522
422
|
}));
|
|
523
423
|
case 6:
|
|
524
424
|
case "end":
|
|
525
|
-
return
|
|
425
|
+
return _context10.stop();
|
|
526
426
|
}
|
|
527
|
-
},
|
|
427
|
+
}, _callee10, this);
|
|
528
428
|
}));
|
|
529
|
-
function sendTransaction(
|
|
429
|
+
function sendTransaction(_x10) {
|
|
530
430
|
return _sendTransaction.apply(this, arguments);
|
|
531
431
|
}
|
|
532
432
|
return sendTransaction;
|
|
@@ -1578,6 +1578,16 @@ var AbrProfileLiveDrm = {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
},
|
|
1580
1580
|
"playout_formats": {
|
|
1581
|
+
"dash-playready-cenc": {
|
|
1582
|
+
"drm": {
|
|
1583
|
+
"enc_scheme_name": "cenc",
|
|
1584
|
+
"type": "DrmPlayReady"
|
|
1585
|
+
},
|
|
1586
|
+
"protocol": {
|
|
1587
|
+
"min_buffer_length": 2,
|
|
1588
|
+
"type": "ProtoDash"
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1581
1591
|
"dash-widevine": {
|
|
1582
1592
|
"drm": {
|
|
1583
1593
|
"content_id": "",
|