@eluvio/elv-client-js 4.0.128 → 4.0.129
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 +15 -14
- package/dist/ElvClient-node-min.js +14 -13
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +15 -14
- package/dist/ElvWalletClient-node-min.js +14 -13
- package/dist/src/AuthorizationClient.js +9 -12
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +263 -222
- package/dist/src/ElvWallet.js +7 -5
- package/dist/src/EthClient.js +8 -9
- package/dist/src/FrameClient.js +9 -10
- package/dist/src/HttpClient.js +1 -2
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +31 -19
- package/dist/src/RemoteSigner.js +6 -8
- package/dist/src/UserProfileClient.js +35 -20
- package/dist/src/Utils.js +2 -3
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +8 -12
- package/dist/src/client/ContentManagement.js +82 -72
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +9 -5
- package/dist/src/client/LiveStream.js +0 -2
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/client/Shares.js +47 -24
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +35 -21
- package/package.json +1 -1
- package/src/ElvClient.js +9 -3
- package/src/client/ContentAccess.js +2 -2
- package/src/client/ContentManagement.js +47 -27
- package/src/client/LiveConf.js +8 -0
|
@@ -2,8 +2,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
2
2
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
8
8
|
* Methods for managing content types, libraries and objects
|
|
9
9
|
*
|
|
@@ -421,11 +421,11 @@ exports.CreateContentType = /*#__PURE__*/function () {
|
|
|
421
421
|
* @param {string} name - Library name
|
|
422
422
|
* @param {string=} description - Library description
|
|
423
423
|
* @param {blob=} image - Image associated with the library
|
|
424
|
-
* @param {string=}
|
|
424
|
+
* @param {string=} imageName - Name of the image associated with the library (required if image specified)
|
|
425
425
|
* @param {Object=} metadata - Metadata of library object
|
|
426
426
|
* @param {string=} kmsId - ID of the KMS to use for content in this library. If not specified,
|
|
427
427
|
* the default KMS will be used.
|
|
428
|
-
* @param {string=}
|
|
428
|
+
* @param {string=} tenantContractId - ID of the tenant to use for this library
|
|
429
429
|
*
|
|
430
430
|
* @returns {Promise<string>} - Library ID of created library
|
|
431
431
|
*/
|
|
@@ -657,32 +657,17 @@ exports.SetContentObjectImage = /*#__PURE__*/function () {
|
|
|
657
657
|
*/
|
|
658
658
|
exports.DeleteContentLibrary = /*#__PURE__*/function () {
|
|
659
659
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref14) {
|
|
660
|
-
var libraryId
|
|
660
|
+
var libraryId;
|
|
661
661
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
662
662
|
while (1) switch (_context8.prev = _context8.next) {
|
|
663
663
|
case 0:
|
|
664
664
|
libraryId = _ref14.libraryId;
|
|
665
|
-
throw Error("
|
|
666
|
-
case
|
|
667
|
-
authorizationHeader = _context8.sent;
|
|
668
|
-
_context8.next = 9;
|
|
669
|
-
return this.CallContractMethodAndWait({
|
|
670
|
-
contractAddress: this.utils.HashToAddress(libraryId),
|
|
671
|
-
methodName: "kill",
|
|
672
|
-
methodArgs: []
|
|
673
|
-
});
|
|
674
|
-
case 9:
|
|
675
|
-
_context8.next = 11;
|
|
676
|
-
return this.HttpClient.Request({
|
|
677
|
-
headers: authorizationHeader,
|
|
678
|
-
method: "DELETE",
|
|
679
|
-
path: path
|
|
680
|
-
});
|
|
681
|
-
case 11:
|
|
665
|
+
throw Error("Delete library not supported. (".concat(libraryId, ")"));
|
|
666
|
+
case 2:
|
|
682
667
|
case "end":
|
|
683
668
|
return _context8.stop();
|
|
684
669
|
}
|
|
685
|
-
}, _callee8
|
|
670
|
+
}, _callee8);
|
|
686
671
|
}));
|
|
687
672
|
return function (_x8) {
|
|
688
673
|
return _ref15.apply(this, arguments);
|
|
@@ -828,7 +813,11 @@ exports.RemoveLibraryContentType = /*#__PURE__*/function () {
|
|
|
828
813
|
*
|
|
829
814
|
* meta: Metadata to use for the new object
|
|
830
815
|
*
|
|
831
|
-
*
|
|
816
|
+
* noEncryptionConk: Set to true to prevent creation of an encryption conk for the object
|
|
817
|
+
*
|
|
818
|
+
* createKMSConk: Set to true to create a KMS conk for object (usually for sharing a playable object) (incompatible with noEncryptionConk: true)
|
|
819
|
+
*
|
|
820
|
+
* @returns {Promise<Object>} - Response containing the object ID and write token of the draft, as well as the url of the node that created the write token.
|
|
832
821
|
*/
|
|
833
822
|
exports.CreateContentObject = /*#__PURE__*/function () {
|
|
834
823
|
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref20) {
|
|
@@ -842,143 +831,164 @@ exports.CreateContentObject = /*#__PURE__*/function () {
|
|
|
842
831
|
ValidateObject(objectId);
|
|
843
832
|
}
|
|
844
833
|
this.Log("Creating content object: ".concat(libraryId, " ").concat(objectId || ""));
|
|
845
|
-
|
|
846
|
-
|
|
834
|
+
if (!(options.noEncryptionConk && options.createKMSConk)) {
|
|
835
|
+
_context11.next = 6;
|
|
836
|
+
break;
|
|
837
|
+
}
|
|
838
|
+
throw new Error("Incompatible options: noEncryptionConk and createKMSConk both set to true");
|
|
839
|
+
case 6:
|
|
847
840
|
if (!options.type) {
|
|
848
|
-
_context11.next =
|
|
841
|
+
_context11.next = 28;
|
|
849
842
|
break;
|
|
850
843
|
}
|
|
851
844
|
this.Log("Type specified: ".concat(options.type));
|
|
852
845
|
type = options.type;
|
|
853
846
|
if (!type.startsWith("hq__")) {
|
|
854
|
-
_context11.next =
|
|
847
|
+
_context11.next = 15;
|
|
855
848
|
break;
|
|
856
849
|
}
|
|
857
|
-
_context11.next =
|
|
850
|
+
_context11.next = 12;
|
|
858
851
|
return this.ContentType({
|
|
859
852
|
versionHash: type
|
|
860
853
|
});
|
|
861
|
-
case
|
|
854
|
+
case 12:
|
|
862
855
|
type = _context11.sent;
|
|
863
|
-
_context11.next =
|
|
856
|
+
_context11.next = 24;
|
|
864
857
|
break;
|
|
865
|
-
case
|
|
858
|
+
case 15:
|
|
866
859
|
if (!type.startsWith("iq__")) {
|
|
867
|
-
_context11.next =
|
|
860
|
+
_context11.next = 21;
|
|
868
861
|
break;
|
|
869
862
|
}
|
|
870
|
-
_context11.next =
|
|
863
|
+
_context11.next = 18;
|
|
871
864
|
return this.ContentType({
|
|
872
865
|
typeId: type
|
|
873
866
|
});
|
|
874
|
-
case
|
|
867
|
+
case 18:
|
|
875
868
|
type = _context11.sent;
|
|
876
|
-
_context11.next =
|
|
869
|
+
_context11.next = 24;
|
|
877
870
|
break;
|
|
878
|
-
case
|
|
879
|
-
_context11.next =
|
|
871
|
+
case 21:
|
|
872
|
+
_context11.next = 23;
|
|
880
873
|
return this.ContentType({
|
|
881
874
|
name: type
|
|
882
875
|
});
|
|
883
|
-
case
|
|
876
|
+
case 23:
|
|
884
877
|
type = _context11.sent;
|
|
885
|
-
case
|
|
878
|
+
case 24:
|
|
886
879
|
if (type) {
|
|
887
|
-
_context11.next =
|
|
880
|
+
_context11.next = 26;
|
|
888
881
|
break;
|
|
889
882
|
}
|
|
890
883
|
throw Error("Unable to find content type '".concat(options.type, "'"));
|
|
891
|
-
case
|
|
884
|
+
case 26:
|
|
892
885
|
typeId = type.id;
|
|
893
886
|
options.type = type.hash;
|
|
894
|
-
case
|
|
887
|
+
case 28:
|
|
895
888
|
if (objectId) {
|
|
896
|
-
_context11.next =
|
|
889
|
+
_context11.next = 46;
|
|
897
890
|
break;
|
|
898
891
|
}
|
|
899
|
-
_context11.next =
|
|
892
|
+
_context11.next = 31;
|
|
900
893
|
return this.CurrentAccountAddress();
|
|
901
|
-
case
|
|
894
|
+
case 31:
|
|
902
895
|
currentAccountAddress = _context11.sent;
|
|
903
|
-
_context11.next =
|
|
896
|
+
_context11.next = 34;
|
|
904
897
|
return this.CallContractMethod({
|
|
905
898
|
contractAddress: this.utils.HashToAddress(libraryId),
|
|
906
899
|
methodName: "canContribute",
|
|
907
900
|
methodArgs: [currentAccountAddress]
|
|
908
901
|
});
|
|
909
|
-
case
|
|
902
|
+
case 34:
|
|
910
903
|
canContribute = _context11.sent;
|
|
911
904
|
if (canContribute) {
|
|
912
|
-
_context11.next =
|
|
905
|
+
_context11.next = 37;
|
|
913
906
|
break;
|
|
914
907
|
}
|
|
915
908
|
throw Error("Current user does not have permission to create content in library ".concat(libraryId));
|
|
916
|
-
case
|
|
909
|
+
case 37:
|
|
917
910
|
this.Log("Deploying contract...");
|
|
918
|
-
_context11.next =
|
|
911
|
+
_context11.next = 40;
|
|
919
912
|
return this.authClient.CreateContentObject({
|
|
920
913
|
libraryId: libraryId,
|
|
921
914
|
typeId: typeId
|
|
922
915
|
});
|
|
923
|
-
case
|
|
916
|
+
case 40:
|
|
924
917
|
_yield$this$authClien3 = _context11.sent;
|
|
925
918
|
contractAddress = _yield$this$authClien3.contractAddress;
|
|
926
919
|
objectId = this.utils.AddressToObjectId(contractAddress);
|
|
927
920
|
this.Log("Contract deployed: ".concat(contractAddress, " ").concat(objectId));
|
|
928
|
-
_context11.next =
|
|
921
|
+
_context11.next = 53;
|
|
929
922
|
break;
|
|
930
|
-
case
|
|
923
|
+
case 46:
|
|
931
924
|
_context11.t0 = this;
|
|
932
925
|
_context11.t1 = "Contract already deployed for contract type: ";
|
|
933
|
-
_context11.next =
|
|
926
|
+
_context11.next = 50;
|
|
934
927
|
return this.AccessType({
|
|
935
928
|
id: objectId
|
|
936
929
|
});
|
|
937
|
-
case
|
|
930
|
+
case 50:
|
|
938
931
|
_context11.t2 = _context11.sent;
|
|
939
932
|
_context11.t3 = _context11.t1.concat.call(_context11.t1, _context11.t2);
|
|
940
933
|
_context11.t0.Log.call(_context11.t0, _context11.t3);
|
|
941
|
-
case
|
|
934
|
+
case 53:
|
|
942
935
|
if (!options.visibility) {
|
|
943
|
-
_context11.next =
|
|
936
|
+
_context11.next = 57;
|
|
944
937
|
break;
|
|
945
938
|
}
|
|
946
939
|
this.Log("Setting visibility to ".concat(options.visibility));
|
|
947
|
-
_context11.next =
|
|
940
|
+
_context11.next = 57;
|
|
948
941
|
return this.SetVisibility({
|
|
949
942
|
id: objectId,
|
|
950
943
|
visibility: options.visibility
|
|
951
944
|
});
|
|
952
|
-
case
|
|
945
|
+
case 57:
|
|
953
946
|
path = UrlJoin("qid", objectId);
|
|
954
947
|
_context11.t4 = this.HttpClient;
|
|
955
|
-
_context11.next =
|
|
948
|
+
_context11.next = 61;
|
|
956
949
|
return this.authClient.AuthorizationHeader({
|
|
957
950
|
libraryId: libraryId,
|
|
958
951
|
objectId: objectId,
|
|
959
952
|
update: true
|
|
960
953
|
});
|
|
961
|
-
case
|
|
954
|
+
case 61:
|
|
962
955
|
_context11.t5 = _context11.sent;
|
|
963
956
|
_context11.t6 = path;
|
|
964
|
-
_context11.t7 =
|
|
957
|
+
_context11.t7 = {
|
|
958
|
+
// filter out options not recognized by server (noEncryptionConk, createKMSConk)
|
|
959
|
+
type: options.type,
|
|
960
|
+
meta: options.meta
|
|
961
|
+
};
|
|
965
962
|
_context11.t8 = {
|
|
966
963
|
headers: _context11.t5,
|
|
967
964
|
method: "POST",
|
|
968
965
|
path: _context11.t6,
|
|
969
966
|
body: _context11.t7
|
|
970
967
|
};
|
|
971
|
-
_context11.next =
|
|
968
|
+
_context11.next = 67;
|
|
972
969
|
return _context11.t4.Request.call(_context11.t4, _context11.t8);
|
|
973
|
-
case
|
|
970
|
+
case 67:
|
|
974
971
|
rawCreateResponse = _context11.sent;
|
|
975
972
|
// extract the url for the node that handled the request
|
|
976
|
-
//
|
|
973
|
+
// (not strictly needed now that we can quickly look up node URL for a write token,
|
|
974
|
+
// but still convenient)
|
|
977
975
|
nodeUrl = new URL(rawCreateResponse.url).origin;
|
|
978
|
-
_context11.next =
|
|
976
|
+
_context11.next = 71;
|
|
979
977
|
return this.utils.ResponseToJson(rawCreateResponse, this.HttpClient.debug, this.HttpClient.Log.bind(this.HttpClient));
|
|
980
|
-
case
|
|
978
|
+
case 71:
|
|
981
979
|
createResponse = _context11.sent;
|
|
980
|
+
if (options.noEncryptionConk) {
|
|
981
|
+
_context11.next = 75;
|
|
982
|
+
break;
|
|
983
|
+
}
|
|
984
|
+
_context11.next = 75;
|
|
985
|
+
return this.CreateEncryptionConk({
|
|
986
|
+
libraryId: libraryId,
|
|
987
|
+
objectId: objectId,
|
|
988
|
+
writeToken: createResponse.write_token,
|
|
989
|
+
createKMSConk: options.createKMSConk
|
|
990
|
+
});
|
|
991
|
+
case 75:
|
|
982
992
|
// Record the node used in creating this write token
|
|
983
993
|
this.RecordWriteToken({
|
|
984
994
|
writeToken: createResponse.write_token,
|
|
@@ -988,7 +998,7 @@ exports.CreateContentObject = /*#__PURE__*/function () {
|
|
|
988
998
|
createResponse.objectId = createResponse.id;
|
|
989
999
|
createResponse.nodeUrl = nodeUrl;
|
|
990
1000
|
return _context11.abrupt("return", createResponse);
|
|
991
|
-
case
|
|
1001
|
+
case 80:
|
|
992
1002
|
case "end":
|
|
993
1003
|
return _context11.stop();
|
|
994
1004
|
}
|
|
@@ -2303,7 +2313,7 @@ exports.UpdateContentObjectGraph = /*#__PURE__*/function () {
|
|
|
2303
2313
|
return _context30.delegateYield(_loop(), "t0", 8);
|
|
2304
2314
|
case 8:
|
|
2305
2315
|
_ret = _context30.t0;
|
|
2306
|
-
if (!
|
|
2316
|
+
if (!_ret) {
|
|
2307
2317
|
_context30.next = 11;
|
|
2308
2318
|
break;
|
|
2309
2319
|
}
|
|
@@ -2451,12 +2461,12 @@ exports.CreateLinks = /*#__PURE__*/function () {
|
|
|
2451
2461
|
return _regeneratorRuntime.wrap(function _callee31$(_context32) {
|
|
2452
2462
|
while (1) switch (_context32.prev = _context32.next) {
|
|
2453
2463
|
case 0:
|
|
2454
|
-
path = info.path.replace(/^(
|
|
2464
|
+
path = info.path.replace(/^([/.])+/, "");
|
|
2455
2465
|
type = (info.type || "file") === "file" ? "files" : info.type;
|
|
2456
2466
|
if (type === "metadata") {
|
|
2457
2467
|
type = "meta";
|
|
2458
2468
|
}
|
|
2459
|
-
target = authTarget = info.target.replace(/^(
|
|
2469
|
+
target = authTarget = info.target.replace(/^([/.])+/, "");
|
|
2460
2470
|
if (info.targetHash) {
|
|
2461
2471
|
target = "/qfab/".concat(info.targetHash, "/").concat(type, "/").concat(target);
|
|
2462
2472
|
} else {
|
|
@@ -2,8 +2,8 @@ var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
|
2
2
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
8
8
|
* Methods for deploying and interacting with contracts
|
|
9
9
|
*
|
package/dist/src/client/Files.js
CHANGED
|
@@ -2,8 +2,8 @@ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
2
2
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
8
8
|
* Methods for accessing and managing access groups
|
|
9
9
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
3
3
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
/* eslint no-console: 0 */
|
|
7
7
|
|
|
8
8
|
var DefaultABRLadder = {
|
|
@@ -109,7 +109,7 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
109
109
|
this.overwriteOriginUrl = overwriteOriginUrl;
|
|
110
110
|
this.syncAudioToVideo = syncAudioToVideo;
|
|
111
111
|
}
|
|
112
|
-
_createClass(LiveConf, [{
|
|
112
|
+
return _createClass(LiveConf, [{
|
|
113
113
|
key: "probeKind",
|
|
114
114
|
value: function probeKind() {
|
|
115
115
|
var fileNameSplit = this.probeData.format.filename.split(":");
|
|
@@ -224,7 +224,6 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
224
224
|
} else {
|
|
225
225
|
seg.audio = 29.76 * 48000; // Other codecs are resampled @48000
|
|
226
226
|
}
|
|
227
|
-
|
|
228
227
|
return seg;
|
|
229
228
|
}
|
|
230
229
|
|
|
@@ -453,12 +452,18 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
453
452
|
if (customSettings.part_ttl) {
|
|
454
453
|
conf.live_recording.recording_config.recording_params.part_ttl = customSettings.part_ttl;
|
|
455
454
|
}
|
|
455
|
+
if (Object.hasOwn(customSettings, "persistent")) {
|
|
456
|
+
conf.live_recording.recording_config.recording_params.persistent = customSettings.persistent;
|
|
457
|
+
}
|
|
456
458
|
if (customSettings.connection_timeout) {
|
|
457
459
|
conf.live_recording.recording_config.recording_params.xc_params.connection_timeout = customSettings.connection_timeout;
|
|
458
460
|
}
|
|
459
461
|
if (customSettings.reconnect_timeout) {
|
|
460
462
|
conf.live_recording.recording_config.recording_params.reconnect_timeout = customSettings.reconnect_timeout;
|
|
461
463
|
}
|
|
464
|
+
if (Object.hasOwn(customSettings, "copy_mpegts")) {
|
|
465
|
+
conf.live_recording.recording_config.recording_params.xc_params.copy_mpegts = customSettings.copy_mpegts;
|
|
466
|
+
}
|
|
462
467
|
|
|
463
468
|
// Fill in specifics for protocol
|
|
464
469
|
switch (this.probeKind()) {
|
|
@@ -564,6 +569,5 @@ var LiveConf = /*#__PURE__*/function () {
|
|
|
564
569
|
return conf;
|
|
565
570
|
}
|
|
566
571
|
}]);
|
|
567
|
-
return LiveConf;
|
|
568
572
|
}();
|
|
569
573
|
exports.LiveConf = LiveConf;
|
|
@@ -835,7 +835,6 @@ exports.StreamCreate = /*#__PURE__*/function () {
|
|
|
835
835
|
edge_write_token: edgeToken,
|
|
836
836
|
state: "active" // indicates there is an active session (set to 'closed' when done)
|
|
837
837
|
},
|
|
838
|
-
|
|
839
838
|
fabric_config: {
|
|
840
839
|
edge_write_token: edgeToken
|
|
841
840
|
}
|
|
@@ -1478,7 +1477,6 @@ exports.StreamInsertion = /*#__PURE__*/function () {
|
|
|
1478
1477
|
insertionInfo = {
|
|
1479
1478
|
duration_sec: 0 // Minimum of video and audio duration
|
|
1480
1479
|
};
|
|
1481
|
-
|
|
1482
1480
|
["video", "audio"].forEach(function (mt) {
|
|
1483
1481
|
var stream = offeringMeta.media_struct.streams[mt];
|
|
1484
1482
|
insertionInfo[mt] = {
|
package/dist/src/client/NFT.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
/**
|
|
7
7
|
* Methods for creating and managing NFTs
|
|
8
8
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
/**
|
|
7
7
|
* Methods for creating and managing shared authorization tokens
|
|
8
8
|
*
|
|
@@ -23,7 +23,7 @@ var UrlJoin = require("url-join");
|
|
|
23
23
|
*/
|
|
24
24
|
exports.CreateShare = /*#__PURE__*/function () {
|
|
25
25
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
26
|
-
var objectId, expiresAt, _ref$params, params, tenantId;
|
|
26
|
+
var objectId, expiresAt, _ref$params, params, tenantId, token, share;
|
|
27
27
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
@@ -32,23 +32,30 @@ exports.CreateShare = /*#__PURE__*/function () {
|
|
|
32
32
|
return this.userProfileClient.TenantContractId();
|
|
33
33
|
case 3:
|
|
34
34
|
tenantId = _context.sent;
|
|
35
|
+
_context.next = 6;
|
|
36
|
+
return this.CreateFabricToken({});
|
|
37
|
+
case 6:
|
|
38
|
+
token = _context.sent;
|
|
35
39
|
params.object_id = objectId;
|
|
36
40
|
if (expiresAt) {
|
|
37
41
|
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
38
42
|
}
|
|
39
|
-
_context.next =
|
|
43
|
+
_context.next = 11;
|
|
40
44
|
return this.MakeAuthServiceRequest({
|
|
41
45
|
path: UrlJoin("as", "sharing", tenantId, "share"),
|
|
42
46
|
method: "POST",
|
|
43
47
|
format: "JSON",
|
|
44
48
|
body: params,
|
|
45
49
|
headers: {
|
|
46
|
-
Authorization: "Bearer ".concat(
|
|
50
|
+
Authorization: "Bearer ".concat(token)
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
|
-
case
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
case 11:
|
|
54
|
+
share = _context.sent;
|
|
55
|
+
share.start_time = share.start_time ? new Date(share.start_time * 1000).toISOString() : undefined;
|
|
56
|
+
share.end_time = share.end_time ? new Date(share.end_time * 1000).toISOString() : undefined;
|
|
57
|
+
return _context.abrupt("return", share);
|
|
58
|
+
case 15:
|
|
52
59
|
case "end":
|
|
53
60
|
return _context.stop();
|
|
54
61
|
}
|
|
@@ -66,6 +73,7 @@ exports.CreateShare = /*#__PURE__*/function () {
|
|
|
66
73
|
* @param {string=} objectId - If specified, the results will be limited shares for the specified object
|
|
67
74
|
* @param {number=} limit=100 - Maximum number of results to return
|
|
68
75
|
* @param {number=} offset=0 - Offset from which to return results
|
|
76
|
+
* @param {Object=} params={} - Additional parameters
|
|
69
77
|
*
|
|
70
78
|
* @returns {Promise<Array<Object>>} - Info about the shares
|
|
71
79
|
*/
|
|
@@ -76,34 +84,41 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
76
84
|
limit,
|
|
77
85
|
_ref4$offset,
|
|
78
86
|
offset,
|
|
87
|
+
_ref4$params,
|
|
88
|
+
params,
|
|
79
89
|
tenantId,
|
|
90
|
+
token,
|
|
80
91
|
response,
|
|
81
92
|
_args2 = arguments;
|
|
82
93
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
83
94
|
while (1) switch (_context2.prev = _context2.next) {
|
|
84
95
|
case 0:
|
|
85
|
-
_ref4 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, objectId = _ref4.objectId, _ref4$limit = _ref4.limit, limit = _ref4$limit === void 0 ? 100 : _ref4$limit, _ref4$offset = _ref4.offset, offset = _ref4$offset === void 0 ? 0 : _ref4$offset;
|
|
96
|
+
_ref4 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, objectId = _ref4.objectId, _ref4$limit = _ref4.limit, limit = _ref4$limit === void 0 ? 100 : _ref4$limit, _ref4$offset = _ref4.offset, offset = _ref4$offset === void 0 ? 0 : _ref4$offset, _ref4$params = _ref4.params, params = _ref4$params === void 0 ? {} : _ref4$params;
|
|
86
97
|
_context2.next = 3;
|
|
87
98
|
return this.userProfileClient.TenantContractId();
|
|
88
99
|
case 3:
|
|
89
100
|
tenantId = _context2.sent;
|
|
90
101
|
_context2.next = 6;
|
|
102
|
+
return this.CreateFabricToken({});
|
|
103
|
+
case 6:
|
|
104
|
+
token = _context2.sent;
|
|
105
|
+
_context2.next = 9;
|
|
91
106
|
return this.MakeAuthServiceRequest({
|
|
92
107
|
path: UrlJoin("as", "sharing", tenantId, "shares"),
|
|
93
|
-
method: objectId ? "POST" : "GET",
|
|
108
|
+
method: objectId || Object.keys(params).length > 0 ? "POST" : "GET",
|
|
94
109
|
queryParams: {
|
|
95
110
|
limit: limit,
|
|
96
111
|
offset: offset
|
|
97
112
|
},
|
|
98
|
-
body: objectId ? {
|
|
113
|
+
body: objectId ? _objectSpread({
|
|
99
114
|
object_id: objectId
|
|
100
|
-
} : undefined,
|
|
115
|
+
}, params) : undefined,
|
|
101
116
|
format: "JSON",
|
|
102
117
|
headers: {
|
|
103
|
-
Authorization: "Bearer ".concat(
|
|
118
|
+
Authorization: "Bearer ".concat(token)
|
|
104
119
|
}
|
|
105
120
|
});
|
|
106
|
-
case
|
|
121
|
+
case 9:
|
|
107
122
|
response = _context2.sent;
|
|
108
123
|
// Convert dates from seconds to date strings
|
|
109
124
|
if (response && response.shares) {
|
|
@@ -115,7 +130,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
115
130
|
});
|
|
116
131
|
}
|
|
117
132
|
return _context2.abrupt("return", response);
|
|
118
|
-
case
|
|
133
|
+
case 12:
|
|
119
134
|
case "end":
|
|
120
135
|
return _context2.stop();
|
|
121
136
|
}
|
|
@@ -134,7 +149,7 @@ exports.Shares = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
134
149
|
*/
|
|
135
150
|
exports.UpdateShare = /*#__PURE__*/function () {
|
|
136
151
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
137
|
-
var shareId, expiresAt, _ref5$params, params, tenantId;
|
|
152
|
+
var shareId, expiresAt, _ref5$params, params, tenantId, token;
|
|
138
153
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
139
154
|
while (1) switch (_context3.prev = _context3.next) {
|
|
140
155
|
case 0:
|
|
@@ -143,22 +158,26 @@ exports.UpdateShare = /*#__PURE__*/function () {
|
|
|
143
158
|
return this.userProfileClient.TenantContractId();
|
|
144
159
|
case 3:
|
|
145
160
|
tenantId = _context3.sent;
|
|
161
|
+
_context3.next = 6;
|
|
162
|
+
return this.CreateFabricToken({});
|
|
163
|
+
case 6:
|
|
164
|
+
token = _context3.sent;
|
|
146
165
|
if (expiresAt) {
|
|
147
166
|
params.end_time = Math.floor(new Date(expiresAt).getTime() / 1000);
|
|
148
167
|
}
|
|
149
|
-
_context3.next =
|
|
168
|
+
_context3.next = 10;
|
|
150
169
|
return this.MakeAuthServiceRequest({
|
|
151
170
|
path: UrlJoin("as", "sharing", tenantId, "share", shareId),
|
|
152
171
|
method: "PUT",
|
|
153
172
|
format: "JSON",
|
|
154
173
|
body: params,
|
|
155
174
|
headers: {
|
|
156
|
-
Authorization: "Bearer ".concat(
|
|
175
|
+
Authorization: "Bearer ".concat(token)
|
|
157
176
|
}
|
|
158
177
|
});
|
|
159
|
-
case
|
|
178
|
+
case 10:
|
|
160
179
|
return _context3.abrupt("return", _context3.sent);
|
|
161
|
-
case
|
|
180
|
+
case 11:
|
|
162
181
|
case "end":
|
|
163
182
|
return _context3.stop();
|
|
164
183
|
}
|
|
@@ -177,7 +196,7 @@ exports.UpdateShare = /*#__PURE__*/function () {
|
|
|
177
196
|
*/
|
|
178
197
|
exports.RevokeShare = /*#__PURE__*/function () {
|
|
179
198
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
180
|
-
var shareId, tenantId;
|
|
199
|
+
var shareId, tenantId, token;
|
|
181
200
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
182
201
|
while (1) switch (_context4.prev = _context4.next) {
|
|
183
202
|
case 0:
|
|
@@ -187,17 +206,21 @@ exports.RevokeShare = /*#__PURE__*/function () {
|
|
|
187
206
|
case 3:
|
|
188
207
|
tenantId = _context4.sent;
|
|
189
208
|
_context4.next = 6;
|
|
209
|
+
return this.CreateFabricToken({});
|
|
210
|
+
case 6:
|
|
211
|
+
token = _context4.sent;
|
|
212
|
+
_context4.next = 9;
|
|
190
213
|
return this.MakeAuthServiceRequest({
|
|
191
214
|
path: UrlJoin("as", "sharing", tenantId, "share", shareId, "revoke"),
|
|
192
215
|
method: "PUT",
|
|
193
216
|
format: "JSON",
|
|
194
217
|
headers: {
|
|
195
|
-
Authorization: "Bearer ".concat(
|
|
218
|
+
Authorization: "Bearer ".concat(token)
|
|
196
219
|
}
|
|
197
220
|
});
|
|
198
|
-
case
|
|
221
|
+
case 9:
|
|
199
222
|
return _context4.abrupt("return", _context4.sent);
|
|
200
|
-
case
|
|
223
|
+
case 10:
|
|
201
224
|
case "end":
|
|
202
225
|
return _context4.stop();
|
|
203
226
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
var Utils = require("../Utils");
|
|
7
7
|
var UrlJoin = require("url-join");
|
|
8
8
|
var _require = require("./Utils"),
|