@eluvio/elv-client-js 4.0.120 → 4.0.121
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 +47 -28
- package/dist/src/ElvWallet.js +7 -5
- package/dist/src/EthClient.js +8 -9
- package/dist/src/FrameClient.js +8 -9
- 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 +40 -33
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +4 -6
- package/dist/src/client/LiveStream.js +24 -13
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +3 -3
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +48 -136
- package/package.json +1 -1
- package/src/client/LiveStream.js +25 -12
|
@@ -7,8 +7,8 @@ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
|
7
7
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
8
8
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
9
9
|
var _excluded = ["code", "address", "type", "authToken", "expiresAt"];
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
12
|
var _require = require("../ElvClient"),
|
|
13
13
|
ElvClient = _require.ElvClient;
|
|
14
14
|
var Configuration = require("./Configuration");
|
|
@@ -79,7 +79,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
79
79
|
this.utils = client.utils;
|
|
80
80
|
this.ForbiddenMethods = ElvWalletClient.ForbiddenMethods;
|
|
81
81
|
}
|
|
82
|
-
_createClass(ElvWalletClient, [{
|
|
82
|
+
return _createClass(ElvWalletClient, [{
|
|
83
83
|
key: "Log",
|
|
84
84
|
value: function Log(message) {
|
|
85
85
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -136,7 +136,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
136
136
|
*/
|
|
137
137
|
}, {
|
|
138
138
|
key: "PersonalSign",
|
|
139
|
-
value: function () {
|
|
139
|
+
value: (function () {
|
|
140
140
|
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
141
141
|
var message, parameters, url;
|
|
142
142
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -265,7 +265,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
265
265
|
return _PersonalSign.apply(this, arguments);
|
|
266
266
|
}
|
|
267
267
|
return PersonalSign;
|
|
268
|
-
}()
|
|
268
|
+
}())
|
|
269
269
|
}, {
|
|
270
270
|
key: "LogInURL",
|
|
271
271
|
value: function () {
|
|
@@ -344,7 +344,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
344
344
|
*/
|
|
345
345
|
}, {
|
|
346
346
|
key: "LogIn",
|
|
347
|
-
value: function () {
|
|
347
|
+
value: (function () {
|
|
348
348
|
var _LogIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref5) {
|
|
349
349
|
var _this = this;
|
|
350
350
|
var _ref5$method, method, provider, _ref5$mode, mode, callbackUrl, marketplaceParams, _ref5$clearLogin, clearLogin, callback, loginUrl;
|
|
@@ -463,9 +463,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
463
463
|
*
|
|
464
464
|
* @methodGroup Login
|
|
465
465
|
*/
|
|
466
|
+
)
|
|
466
467
|
}, {
|
|
467
468
|
key: "LogOut",
|
|
468
|
-
value: function () {
|
|
469
|
+
value: (function () {
|
|
469
470
|
var _LogOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
470
471
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
471
472
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -508,7 +509,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
508
509
|
return _LogOut.apply(this, arguments);
|
|
509
510
|
}
|
|
510
511
|
return LogOut;
|
|
511
|
-
}()
|
|
512
|
+
}())
|
|
512
513
|
}, {
|
|
513
514
|
key: "TokenStatus",
|
|
514
515
|
value: function () {
|
|
@@ -548,7 +549,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
548
549
|
*/
|
|
549
550
|
}, {
|
|
550
551
|
key: "Authenticate",
|
|
551
|
-
value: function () {
|
|
552
|
+
value: (function () {
|
|
552
553
|
var _Authenticate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref7) {
|
|
553
554
|
var token, decodedToken;
|
|
554
555
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
@@ -614,9 +615,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
614
615
|
* - signingToken - Identical to `authToken`, but also includes the ability to perform arbitrary signatures with the custodial wallet. This token should be protected and should not be
|
|
615
616
|
* shared with third parties.
|
|
616
617
|
*/
|
|
618
|
+
)
|
|
617
619
|
}, {
|
|
618
620
|
key: "AuthenticateOAuth",
|
|
619
|
-
value: function () {
|
|
621
|
+
value: (function () {
|
|
620
622
|
var _AuthenticateOAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref8) {
|
|
621
623
|
var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, tokenDuration, fabricToken, expiresAt, tokenResponse, address, decodedToken;
|
|
622
624
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
@@ -744,9 +746,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
744
746
|
* @returns {Promise<string>} - Returns an authorization token that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
|
|
745
747
|
* Save this token to avoid having to reauthenticate. This token expires after 24 hours.
|
|
746
748
|
*/
|
|
749
|
+
)
|
|
747
750
|
}, {
|
|
748
751
|
key: "AuthenticateExternalWallet",
|
|
749
|
-
value: function () {
|
|
752
|
+
value: (function () {
|
|
750
753
|
var _AuthenticateExternalWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref9) {
|
|
751
754
|
var _this2 = this;
|
|
752
755
|
var address, _ref9$tokenDuration, tokenDuration, _ref9$walletName, walletName, Sign, expiresAt, fabricToken;
|
|
@@ -815,6 +818,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
815
818
|
*
|
|
816
819
|
* @returns {string} - The client auth token
|
|
817
820
|
*/
|
|
821
|
+
)
|
|
818
822
|
}, {
|
|
819
823
|
key: "ClientAuthToken",
|
|
820
824
|
value: function ClientAuthToken() {
|
|
@@ -1085,11 +1089,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1085
1089
|
var _LoadAvailableMarketplaces = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
1086
1090
|
var _this4 = this;
|
|
1087
1091
|
var forceReload,
|
|
1088
|
-
|
|
1089
|
-
marketplaceOrder,
|
|
1090
|
-
previewTenantSlug,
|
|
1091
|
-
previewMarketplaceSlug,
|
|
1092
|
-
previewMarketplaceMetadata,
|
|
1092
|
+
marketplaces,
|
|
1093
1093
|
availableMarketplaces,
|
|
1094
1094
|
availableMarketplacesById,
|
|
1095
1095
|
_args18 = arguments;
|
|
@@ -1103,124 +1103,27 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
return _context18.abrupt("return");
|
|
1105
1105
|
case 3:
|
|
1106
|
-
|
|
1107
|
-
return this.client.ContentObjectMetadata({
|
|
1108
|
-
libraryId: this.mainSiteLibraryId,
|
|
1109
|
-
objectId: this.mainSiteId,
|
|
1110
|
-
metadataSubtree: "public/asset_metadata",
|
|
1111
|
-
resolveLinks: true,
|
|
1112
|
-
linkDepthLimit: 2,
|
|
1113
|
-
resolveIncludeSource: true,
|
|
1114
|
-
resolveIgnoreErrors: true,
|
|
1115
|
-
produceLinkUrls: true,
|
|
1116
|
-
authorizationToken: this.publicStaticToken,
|
|
1117
|
-
noAuth: true,
|
|
1118
|
-
select: ["info/marketplace_order", "tenants/*/.", "tenants/*/info/branding/show", "tenants/*/info/branding/name", "tenants/*/marketplaces/*/.", "tenants/*/marketplaces/*/info/tenant_id", "tenants/*/marketplaces/*/info/tenant_name", "tenants/*/marketplaces/*/info/branding/show", "tenants/*/marketplaces/*/info/branding/name"]
|
|
1119
|
-
});
|
|
1120
|
-
case 5:
|
|
1121
|
-
metadata = _context18.sent;
|
|
1122
|
-
marketplaceOrder = ((metadata || {}).info || {}).marketplace_order || [];
|
|
1123
|
-
metadata = (metadata || {}).tenants || {};
|
|
1124
|
-
|
|
1125
|
-
// If preview marketplace is specified, load it appropriately
|
|
1126
|
-
if (!this.previewMarketplaceId) {
|
|
1127
|
-
_context18.next = 23;
|
|
1128
|
-
break;
|
|
1129
|
-
}
|
|
1130
|
-
previewTenantSlug = "PREVIEW";
|
|
1131
|
-
Object.keys(metadata || {}).forEach(function (tenantSlug) {
|
|
1132
|
-
return Object.keys(metadata[tenantSlug].marketplaces || {}).forEach(function (marketplaceSlug) {
|
|
1133
|
-
var versionHash = metadata[tenantSlug].marketplaces[marketplaceSlug]["."].source;
|
|
1134
|
-
var objectId = _this4.utils.DecodeVersionHash(versionHash).objectId;
|
|
1135
|
-
if (objectId === _this4.previewMarketplaceId) {
|
|
1136
|
-
// Marketplace exists in site meta
|
|
1137
|
-
previewTenantSlug = tenantSlug;
|
|
1138
|
-
previewMarketplaceSlug = marketplaceSlug;
|
|
1139
|
-
|
|
1140
|
-
// Deployed marketplace is same as preview marketplace
|
|
1141
|
-
if (versionHash === _this4.previewMarketplaceHash) {
|
|
1142
|
-
previewMarketplaceMetadata = metadata[tenantSlug].marketplaces[marketplaceSlug];
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
});
|
|
1147
|
-
|
|
1148
|
-
// Marketplace not present in branch, or preview version is different - Load metadata directly
|
|
1149
|
-
if (previewMarketplaceMetadata) {
|
|
1150
|
-
_context18.next = 16;
|
|
1151
|
-
break;
|
|
1152
|
-
}
|
|
1153
|
-
_context18.next = 14;
|
|
1154
|
-
return this.client.ContentObjectMetadata({
|
|
1155
|
-
versionHash: this.previewMarketplaceHash,
|
|
1156
|
-
metadataSubtree: "public/asset_metadata",
|
|
1157
|
-
produceLinkUrls: true,
|
|
1158
|
-
authorizationToken: this.publicStaticToken,
|
|
1159
|
-
noAuth: true,
|
|
1160
|
-
select: ["slug", "info/tenant_id", "info/tenant_name", "info/branding"],
|
|
1161
|
-
remove: ["info/branding/custom_css"]
|
|
1162
|
-
});
|
|
1163
|
-
case 14:
|
|
1164
|
-
previewMarketplaceMetadata = _context18.sent;
|
|
1165
|
-
if (!previewMarketplaceSlug) {
|
|
1166
|
-
previewMarketplaceSlug = previewMarketplaceMetadata.slug;
|
|
1167
|
-
}
|
|
1168
|
-
case 16:
|
|
1169
|
-
previewMarketplaceMetadata["."] = {
|
|
1170
|
-
source: this.previewMarketplaceHash
|
|
1171
|
-
};
|
|
1172
|
-
previewMarketplaceMetadata.info["."] = {
|
|
1173
|
-
source: this.previewMarketplaceHash
|
|
1174
|
-
};
|
|
1175
|
-
previewMarketplaceMetadata.info.branding.preview = true;
|
|
1176
|
-
previewMarketplaceMetadata.info.branding.show = true;
|
|
1177
|
-
metadata[previewTenantSlug] = metadata[previewTenantSlug] || {};
|
|
1178
|
-
metadata[previewTenantSlug].marketplaces = metadata[previewTenantSlug].marketplaces || {};
|
|
1179
|
-
metadata[previewTenantSlug].marketplaces[previewMarketplaceSlug] = previewMarketplaceMetadata;
|
|
1180
|
-
case 23:
|
|
1106
|
+
marketplaces = this.topLevelInfo.marketplaces;
|
|
1181
1107
|
availableMarketplaces = _objectSpread({}, this.availableMarketplaces || {});
|
|
1182
1108
|
availableMarketplacesById = _objectSpread({}, this.availableMarketplacesById || {});
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
marketplaceId: objectId,
|
|
1198
|
-
marketplaceHash: versionHash,
|
|
1199
|
-
tenantBranding: (metadata[tenantSlug].info || {}).branding || {},
|
|
1200
|
-
order: marketplaceOrder.findIndex(function (slug) {
|
|
1201
|
-
return slug === marketplaceSlug;
|
|
1202
|
-
})
|
|
1203
|
-
});
|
|
1204
|
-
availableMarketplacesById[objectId] = availableMarketplaces[tenantSlug][marketplaceSlug];
|
|
1205
|
-
_this4.marketplaceHashes[objectId] = versionHash;
|
|
1206
|
-
|
|
1207
|
-
// Fill out selected marketplace info
|
|
1208
|
-
if (_this4.selectedMarketplaceInfo) {
|
|
1209
|
-
if (_this4.selectedMarketplaceInfo.tenantSlug === tenantSlug && _this4.selectedMarketplaceInfo.marketplaceSlug === marketplaceSlug || _this4.selectedMarketplaceInfo.marketplaceId === objectId) {
|
|
1210
|
-
_this4.selectedMarketplaceInfo = availableMarketplaces[tenantSlug][marketplaceSlug];
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
} catch (error) {
|
|
1214
|
-
_this4.Log("Eluvio Wallet Client: Unable to load info for marketplace ".concat(tenantSlug, "/").concat(marketplaceSlug), true);
|
|
1215
|
-
}
|
|
1216
|
-
});
|
|
1217
|
-
} catch (error) {
|
|
1218
|
-
_this4.Log("Eluvio Wallet Client: Failed to load tenant info ".concat(tenantSlug), true, error);
|
|
1219
|
-
}
|
|
1109
|
+
marketplaces.map(function (marketplaceInfo) {
|
|
1110
|
+
var marketplaceId = Utils.DecodeVersionHash(marketplaceInfo.source_hash).objectId;
|
|
1111
|
+
var marketplaceSlug = marketplaceInfo.slug || marketplaceInfo.name;
|
|
1112
|
+
availableMarketplaces[marketplaceInfo.tenant_slug] = availableMarketplaces[marketplaceInfo.tenant_slug] || {};
|
|
1113
|
+
availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug] = _objectSpread(_objectSpread({}, marketplaceInfo), {}, {
|
|
1114
|
+
tenantName: marketplaceInfo.tenant_slug,
|
|
1115
|
+
tenantSlug: marketplaceInfo.tenant_slug,
|
|
1116
|
+
tenantId: marketplaceInfo.tenant_id,
|
|
1117
|
+
marketplaceSlug: marketplaceSlug,
|
|
1118
|
+
marketplaceId: marketplaceId,
|
|
1119
|
+
marketplaceHash: marketplaceInfo.source_hash
|
|
1120
|
+
});
|
|
1121
|
+
availableMarketplacesById[marketplaceId] = availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug];
|
|
1122
|
+
_this4.marketplaceHashes[marketplaceId] = marketplaceInfo.source_hash;
|
|
1220
1123
|
});
|
|
1221
1124
|
this.availableMarketplaces = availableMarketplaces;
|
|
1222
1125
|
this.availableMarketplacesById = availableMarketplacesById;
|
|
1223
|
-
case
|
|
1126
|
+
case 9:
|
|
1224
1127
|
case "end":
|
|
1225
1128
|
return _context18.stop();
|
|
1226
1129
|
}
|
|
@@ -1830,6 +1733,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1830
1733
|
offerId = status.op.split(":")[3];
|
|
1831
1734
|
}
|
|
1832
1735
|
if (op === "nft-claim-entitlement") {
|
|
1736
|
+
// eslint-disable-next-line no-unused-vars
|
|
1833
1737
|
var _status$op$split3 = status.op.split(":"),
|
|
1834
1738
|
_status$op$split4 = _slicedToArray(_status$op$split3, 4),
|
|
1835
1739
|
_op = _status$op$split4[0],
|
|
@@ -1978,7 +1882,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1978
1882
|
*/
|
|
1979
1883
|
}, {
|
|
1980
1884
|
key: "Initialize",
|
|
1981
|
-
value: function () {
|
|
1885
|
+
value: (function () {
|
|
1982
1886
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref24) {
|
|
1983
1887
|
var client, _ref24$appId, appId, _ref24$network, network, _ref24$mode, mode, localization, marketplaceParams, previewMarketplaceId, _ref24$storeAuthToken, storeAuthToken, _ref24$skipMarketplac, skipMarketplaceLoad, _ref25, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
|
|
1984
1888
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
@@ -2078,15 +1982,24 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
2078
1982
|
_context25.prev = 35;
|
|
2079
1983
|
_context25.t0 = _context25["catch"](28);
|
|
2080
1984
|
case 37:
|
|
1985
|
+
_context25.next = 39;
|
|
1986
|
+
return client.utils.ResponseToJson(client.MakeAuthServiceRequest({
|
|
1987
|
+
path: "/as/mw/toplevel",
|
|
1988
|
+
queryParams: {
|
|
1989
|
+
env: mode
|
|
1990
|
+
}
|
|
1991
|
+
}));
|
|
1992
|
+
case 39:
|
|
1993
|
+
walletClient.topLevelInfo = _context25.sent;
|
|
2081
1994
|
if (skipMarketplaceLoad) {
|
|
2082
|
-
_context25.next =
|
|
1995
|
+
_context25.next = 43;
|
|
2083
1996
|
break;
|
|
2084
1997
|
}
|
|
2085
|
-
_context25.next =
|
|
1998
|
+
_context25.next = 43;
|
|
2086
1999
|
return walletClient.LoadAvailableMarketplaces();
|
|
2087
|
-
case
|
|
2000
|
+
case 43:
|
|
2088
2001
|
return _context25.abrupt("return", walletClient);
|
|
2089
|
-
case
|
|
2002
|
+
case 44:
|
|
2090
2003
|
case "end":
|
|
2091
2004
|
return _context25.stop();
|
|
2092
2005
|
}
|
|
@@ -2096,9 +2009,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
2096
2009
|
return _Initialize.apply(this, arguments);
|
|
2097
2010
|
}
|
|
2098
2011
|
return Initialize;
|
|
2099
|
-
}()
|
|
2012
|
+
}())
|
|
2100
2013
|
}]);
|
|
2101
|
-
return ElvWalletClient;
|
|
2102
2014
|
}();
|
|
2103
2015
|
Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
|
|
2104
2016
|
Object.assign(ElvWalletClient.prototype, require("./Profile"));
|
package/package.json
CHANGED
package/src/client/LiveStream.js
CHANGED
|
@@ -1358,10 +1358,19 @@ exports.StreamInsertion = async function({name, insertionTime, sinceStart=false,
|
|
|
1358
1358
|
* @param {string} name - Object ID or name of the live stream object
|
|
1359
1359
|
* @param {Object=} customSettings - Additional options to customize configuration settings
|
|
1360
1360
|
* @param {Object=} probeMetadata - Metadata for the probe. If not specified, a new probe will be configured
|
|
1361
|
+
* @param {string=} writeToken - Write token of the draft
|
|
1362
|
+
* @param {boolean=} finalize - If enabled, target object will be finalized after configuring
|
|
1363
|
+
*
|
|
1361
1364
|
* @return {Promise<Object>} - The status response for the stream
|
|
1362
1365
|
*
|
|
1363
1366
|
*/
|
|
1364
|
-
exports.StreamConfig = async function({
|
|
1367
|
+
exports.StreamConfig = async function({
|
|
1368
|
+
name,
|
|
1369
|
+
customSettings={},
|
|
1370
|
+
probeMetadata,
|
|
1371
|
+
writeToken,
|
|
1372
|
+
finalize=true
|
|
1373
|
+
}) {
|
|
1365
1374
|
let objectId = name;
|
|
1366
1375
|
let status = {name};
|
|
1367
1376
|
|
|
@@ -1444,11 +1453,13 @@ exports.StreamConfig = async function({name, customSettings={}, probeMetadata})
|
|
|
1444
1453
|
});
|
|
1445
1454
|
|
|
1446
1455
|
// Store live recording config into the stream object
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1456
|
+
if(!writeToken) {
|
|
1457
|
+
let e = await this.EditContentObject({
|
|
1458
|
+
libraryId,
|
|
1459
|
+
objectId: objectId
|
|
1460
|
+
});
|
|
1461
|
+
writeToken = e.write_token;
|
|
1462
|
+
}
|
|
1452
1463
|
|
|
1453
1464
|
await this.ReplaceMetadata({
|
|
1454
1465
|
libraryId,
|
|
@@ -1466,12 +1477,14 @@ exports.StreamConfig = async function({name, customSettings={}, probeMetadata})
|
|
|
1466
1477
|
metadata: probe
|
|
1467
1478
|
});
|
|
1468
1479
|
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1480
|
+
if(finalize) {
|
|
1481
|
+
status.fin = await this.FinalizeContentObject({
|
|
1482
|
+
libraryId,
|
|
1483
|
+
objectId,
|
|
1484
|
+
writeToken,
|
|
1485
|
+
commitMessage: "Apply live stream configuration"
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1475
1488
|
|
|
1476
1489
|
return status;
|
|
1477
1490
|
};
|