@eluvio/elv-client-js 4.0.120 → 4.0.122

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.
@@ -708,6 +708,7 @@ var ElvClient = /*#__PURE__*/function () {
708
708
  }, {
709
709
  key: "SetSigner",
710
710
  value: function SetSigner(_ref10) {
711
+ var _this2 = this;
711
712
  var signer = _ref10.signer,
712
713
  _ref10$reset = _ref10.reset,
713
714
  reset = _ref10$reset === void 0 ? true : _ref10$reset;
@@ -715,6 +716,9 @@ var ElvClient = /*#__PURE__*/function () {
715
716
  signer.connect(this.ethClient.Provider());
716
717
  signer.provider.pollingInterval = 500;
717
718
  this.signer = signer;
719
+ this.CreateFabricToken({}).then(function (token) {
720
+ return _this2.signedToken = token;
721
+ });
718
722
  if (reset) {
719
723
  this.InitializeClients();
720
724
  }
@@ -915,7 +919,7 @@ var ElvClient = /*#__PURE__*/function () {
915
919
  key: "PersonalSign",
916
920
  value: function () {
917
921
  var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref14) {
918
- var _this2 = this;
922
+ var _this3 = this;
919
923
  var message, addEthereumPrefix, Sign;
920
924
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
921
925
  while (1) switch (_context11.prev = _context11.next) {
@@ -929,19 +933,19 @@ var ElvClient = /*#__PURE__*/function () {
929
933
  while (1) switch (_context10.prev = _context10.next) {
930
934
  case 0:
931
935
  _context10.t0 = Ethers.utils;
932
- if (!_this2.signer.signDigest) {
936
+ if (!_this3.signer.signDigest) {
933
937
  _context10.next = 7;
934
938
  break;
935
939
  }
936
940
  _context10.next = 4;
937
- return _this2.signer.signDigest(message);
941
+ return _this3.signer.signDigest(message);
938
942
  case 4:
939
943
  _context10.t1 = _context10.sent;
940
944
  _context10.next = 10;
941
945
  break;
942
946
  case 7:
943
947
  _context10.next = 9;
944
- return _this2.signer._signingKey().signDigest(message);
948
+ return _this3.signer._signingKey().signDigest(message);
945
949
  case 9:
946
950
  _context10.t1 = _context10.sent;
947
951
  case 10:
@@ -1659,12 +1663,12 @@ var ElvClient = /*#__PURE__*/function () {
1659
1663
  key: "MakeAuthServiceRequest",
1660
1664
  value: function () {
1661
1665
  var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref28) {
1662
- var kmsId, objectId, versionHash, _ref28$method, method, path, bodyType, _ref28$body, body, _ref28$queryParams, queryParams, headers;
1666
+ var kmsId, objectId, versionHash, _ref28$method, method, path, bodyType, _ref28$body, body, _ref28$queryParams, queryParams, headers, format, response;
1663
1667
  return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1664
1668
  while (1) switch (_context23.prev = _context23.next) {
1665
1669
  case 0:
1666
- kmsId = _ref28.kmsId, objectId = _ref28.objectId, versionHash = _ref28.versionHash, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, path = _ref28.path, bodyType = _ref28.bodyType, _ref28$body = _ref28.body, body = _ref28$body === void 0 ? {} : _ref28$body, _ref28$queryParams = _ref28.queryParams, queryParams = _ref28$queryParams === void 0 ? {} : _ref28$queryParams, headers = _ref28.headers;
1667
- return _context23.abrupt("return", this.authClient.MakeAuthServiceRequest({
1670
+ kmsId = _ref28.kmsId, objectId = _ref28.objectId, versionHash = _ref28.versionHash, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, path = _ref28.path, bodyType = _ref28.bodyType, _ref28$body = _ref28.body, body = _ref28$body === void 0 ? {} : _ref28$body, _ref28$queryParams = _ref28.queryParams, queryParams = _ref28$queryParams === void 0 ? {} : _ref28$queryParams, headers = _ref28.headers, format = _ref28.format;
1671
+ response = this.authClient.MakeAuthServiceRequest({
1668
1672
  kmsId: kmsId,
1669
1673
  objectId: objectId,
1670
1674
  versionHash: versionHash,
@@ -1674,8 +1678,9 @@ var ElvClient = /*#__PURE__*/function () {
1674
1678
  body: body,
1675
1679
  queryParams: queryParams,
1676
1680
  headers: headers
1677
- }));
1678
- case 2:
1681
+ });
1682
+ return _context23.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
1683
+ case 3:
1679
1684
  case "end":
1680
1685
  return _context23.stop();
1681
1686
  }
@@ -1691,10 +1696,10 @@ var ElvClient = /*#__PURE__*/function () {
1691
1696
  }, {
1692
1697
  key: "FrameAllowedMethods",
1693
1698
  value: function FrameAllowedMethods() {
1694
- var _this3 = this;
1699
+ var _this4 = this;
1695
1700
  var forbiddenMethods = ["constructor", "AccessGroupMembershipMethod", "CallFromFrameMessage", "ClearSigner", "CreateAccount", "EnableMethodLogging", "FormatBlockNumbers", "FrameAllowedMethods", "FromConfigurationUrl", "GenerateWallet", "InitializeClients", "Log", "PersonalSign", "SetRemoteSigner", "SetSigner", "SetSignerFromWeb3Provider", "Sign", "ToggleLogging"];
1696
1701
  return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(function (method) {
1697
- return typeof _this3[method] === "function" && !forbiddenMethods.includes(method);
1702
+ return typeof _this4[method] === "function" && !forbiddenMethods.includes(method);
1698
1703
  });
1699
1704
  }
1700
1705
 
@@ -1703,7 +1708,7 @@ var ElvClient = /*#__PURE__*/function () {
1703
1708
  key: "CallFromFrameMessage",
1704
1709
  value: function () {
1705
1710
  var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(message, Respond) {
1706
- var _this4 = this;
1711
+ var _this5 = this;
1707
1712
  var callback, method, methodResults, responseError;
1708
1713
  return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1709
1714
  while (1) switch (_context24.prev = _context24.next) {
@@ -1716,7 +1721,7 @@ var ElvClient = /*#__PURE__*/function () {
1716
1721
  case 2:
1717
1722
  if (message.callbackId) {
1718
1723
  callback = function callback(result) {
1719
- Respond(_this4.utils.MakeClonable({
1724
+ Respond(_this5.utils.MakeClonable({
1720
1725
  type: "ElvFrameResponse",
1721
1726
  requestId: message.callbackId,
1722
1727
  response: result
@@ -2041,4 +2046,5 @@ Object.assign(ElvClient.prototype, require("./client/LiveStream"));
2041
2046
  Object.assign(ElvClient.prototype, require("./client/ContentManagement"));
2042
2047
  Object.assign(ElvClient.prototype, require("./client/NTP"));
2043
2048
  Object.assign(ElvClient.prototype, require("./client/NFT"));
2049
+ Object.assign(ElvClient.prototype, require("./client/Shares"));
2044
2050
  exports.ElvClient = ElvClient;
@@ -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", "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", "CreateStaticToken", "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", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "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"];
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", "CreateShare", "CreateSignedToken", "CreateStaticToken", "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", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RedeemShareToken", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "RevokeShare", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "Shares", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamConfig", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamRemoveWatermark", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UpdateShare", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrl"];
453
453
  }
454
454
  }, {
455
455
  key: "AllowedUserProfileMethods",
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  /**
8
8
  * Methods for ABR video creation and management
9
9
  *
10
- * For more information on how to publish ABR content see <a href="./abr/index.html">this detailed guide</a>
10
+ * For more information on how to publish ABR content see <a href="https://docs.eluv.io/docs/guides/media-ingest/">this detailed guide</a>
11
11
  *
12
12
  * @module ElvClient/ABRPublishing
13
13
  */
@@ -1613,7 +1613,7 @@ exports.ContentObjectMetadata = /*#__PURE__*/function () {
1613
1613
  throw _context24.t0;
1614
1614
  case 27:
1615
1615
  // For a 404 error, check if error was due to write token not found
1616
- errQwtoken = objectPath.get(_context24.t0.body, "errors[0].cause.cause.cause.qwtoken");
1616
+ errQwtoken = objectPath.get(_context24.t0.body, "errors.0.cause.cause.cause.qwtoken");
1617
1617
  if (!errQwtoken) {
1618
1618
  _context24.next = 32;
1619
1619
  break;
@@ -3595,16 +3595,18 @@ var EmbedMediaTypes = {
3595
3595
  - `ntpId` - NTP ID, required for tickets authorization
3596
3596
  - `ticketCode` - Ticket code, optional with tickets authorization
3597
3597
  - `ticketSubject` - Ticket subject, optional with tickets authorization
3598
+ - `verifyContent` - Verify content
3599
+ - `additionalParameters` - Additional search params that will be appended to the URL
3598
3600
  *
3599
3601
  * @returns {Promise<string>} - Will return an embed URL
3600
3602
  */
3601
3603
  exports.EmbedUrl = /*#__PURE__*/function () {
3602
3604
  var _ref79 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref78) {
3603
- var objectId, versionHash, _ref78$duration, duration, _ref78$mediaType, mediaType, _ref78$options, options, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, token;
3605
+ var objectId, versionHash, _ref78$duration, duration, _ref78$mediaType, mediaType, _ref78$options, options, _ref78$additionalPara, additionalParameters, controlsMap, embedUrl, networkInfo, networkName, permission, data, _i, _Object$keys, option, _i2, _Object$keys2, item, token;
3604
3606
  return _regeneratorRuntime.wrap(function _callee44$(_context44) {
3605
3607
  while (1) switch (_context44.prev = _context44.next) {
3606
3608
  case 0:
3607
- objectId = _ref78.objectId, versionHash = _ref78.versionHash, _ref78$duration = _ref78.duration, duration = _ref78$duration === void 0 ? 86400000 : _ref78$duration, _ref78$mediaType = _ref78.mediaType, mediaType = _ref78$mediaType === void 0 ? "video" : _ref78$mediaType, _ref78$options = _ref78.options, options = _ref78$options === void 0 ? {} : _ref78$options;
3609
+ objectId = _ref78.objectId, versionHash = _ref78.versionHash, _ref78$duration = _ref78.duration, duration = _ref78$duration === void 0 ? 86400000 : _ref78$duration, _ref78$mediaType = _ref78.mediaType, mediaType = _ref78$mediaType === void 0 ? "video" : _ref78$mediaType, _ref78$options = _ref78.options, options = _ref78$options === void 0 ? {} : _ref78$options, _ref78$additionalPara = _ref78.additionalParameters, additionalParameters = _ref78$additionalPara === void 0 ? {} : _ref78$additionalPara;
3608
3610
  if (versionHash) {
3609
3611
  ValidateVersion(versionHash);
3610
3612
  } else if (objectId) {
@@ -3643,69 +3645,69 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3643
3645
  _i = 0, _Object$keys = Object.keys(options);
3644
3646
  case 18:
3645
3647
  if (!(_i < _Object$keys.length)) {
3646
- _context44.next = 68;
3648
+ _context44.next = 69;
3647
3649
  break;
3648
3650
  }
3649
3651
  option = _Object$keys[_i];
3650
3652
  _context44.t0 = option;
3651
- _context44.next = _context44.t0 === "accountWatermark" ? 23 : _context44.t0 === "autoplay" ? 25 : _context44.t0 === "capLevelToPlayerSize" ? 27 : _context44.t0 === "clipEnd" ? 29 : _context44.t0 === "clipStart" ? 31 : _context44.t0 === "controls" ? 33 : _context44.t0 === "description" ? 35 : _context44.t0 === "directLink" ? 37 : _context44.t0 === "linkPath" ? 39 : _context44.t0 === "loop" ? 41 : _context44.t0 === "muted" ? 43 : _context44.t0 === "offerings" ? 45 : _context44.t0 === "posterUrl" ? 47 : _context44.t0 === "protocols" ? 49 : _context44.t0 === "showShare" ? 51 : _context44.t0 === "showTitle" ? 53 : _context44.t0 === "title" ? 55 : _context44.t0 === "viewRecordKey" ? 57 : _context44.t0 === "useTicketCodes" ? 59 : 65;
3653
+ _context44.next = _context44.t0 === "accountWatermark" ? 23 : _context44.t0 === "autoplay" ? 25 : _context44.t0 === "capLevelToPlayerSize" ? 27 : _context44.t0 === "clipEnd" ? 29 : _context44.t0 === "clipStart" ? 31 : _context44.t0 === "controls" ? 33 : _context44.t0 === "description" ? 35 : _context44.t0 === "directLink" ? 37 : _context44.t0 === "linkPath" ? 39 : _context44.t0 === "loop" ? 41 : _context44.t0 === "muted" ? 43 : _context44.t0 === "offerings" ? 45 : _context44.t0 === "posterUrl" ? 47 : _context44.t0 === "protocols" ? 49 : _context44.t0 === "showShare" ? 51 : _context44.t0 === "showTitle" ? 53 : _context44.t0 === "title" ? 55 : _context44.t0 === "viewRecordKey" ? 57 : _context44.t0 === "useTicketCodes" ? 59 : _context44.t0 === "verifyContent" ? 65 : 66;
3652
3654
  break;
3653
3655
  case 23:
3654
3656
  embedUrl.searchParams.set("awm", "");
3655
- return _context44.abrupt("break", 65);
3657
+ return _context44.abrupt("break", 66);
3656
3658
  case 25:
3657
3659
  embedUrl.searchParams.set("ap", "");
3658
- return _context44.abrupt("break", 65);
3660
+ return _context44.abrupt("break", 66);
3659
3661
  case 27:
3660
3662
  embedUrl.searchParams.set("cap", "");
3661
- return _context44.abrupt("break", 65);
3663
+ return _context44.abrupt("break", 66);
3662
3664
  case 29:
3663
3665
  embedUrl.searchParams.set("end", options.clipEnd);
3664
- return _context44.abrupt("break", 65);
3666
+ return _context44.abrupt("break", 66);
3665
3667
  case 31:
3666
3668
  embedUrl.searchParams.set("start", options.clipStart);
3667
- return _context44.abrupt("break", 65);
3669
+ return _context44.abrupt("break", 66);
3668
3670
  case 33:
3669
3671
  if (options.controls !== "hide") {
3670
3672
  embedUrl.searchParams.set("ct", controlsMap[options.controls]);
3671
3673
  }
3672
- return _context44.abrupt("break", 65);
3674
+ return _context44.abrupt("break", 66);
3673
3675
  case 35:
3674
3676
  data["og:description"] = options.description;
3675
- return _context44.abrupt("break", 65);
3677
+ return _context44.abrupt("break", 66);
3676
3678
  case 37:
3677
3679
  embedUrl.searchParams.set("dr", "");
3678
- return _context44.abrupt("break", 65);
3680
+ return _context44.abrupt("break", 66);
3679
3681
  case 39:
3680
3682
  embedUrl.searchParams.set("ln", this.utils.B64(options.linkPath));
3681
- return _context44.abrupt("break", 65);
3683
+ return _context44.abrupt("break", 66);
3682
3684
  case 41:
3683
3685
  embedUrl.searchParams.set("lp", "");
3684
- return _context44.abrupt("break", 65);
3686
+ return _context44.abrupt("break", 66);
3685
3687
  case 43:
3686
3688
  embedUrl.searchParams.set("m", "");
3687
- return _context44.abrupt("break", 65);
3689
+ return _context44.abrupt("break", 66);
3688
3690
  case 45:
3689
3691
  embedUrl.searchParams.set("off", options.offerings.join(","));
3690
- return _context44.abrupt("break", 65);
3692
+ return _context44.abrupt("break", 66);
3691
3693
  case 47:
3692
3694
  embedUrl.searchParams.set("pst", options.posterUrl);
3693
- return _context44.abrupt("break", 65);
3695
+ return _context44.abrupt("break", 66);
3694
3696
  case 49:
3695
3697
  embedUrl.searchParams.set("ptc", options.protocols.join(","));
3696
- return _context44.abrupt("break", 65);
3698
+ return _context44.abrupt("break", 66);
3697
3699
  case 51:
3698
3700
  embedUrl.searchParams.set("sh", "");
3699
- return _context44.abrupt("break", 65);
3701
+ return _context44.abrupt("break", 66);
3700
3702
  case 53:
3701
3703
  embedUrl.searchParams.set("st", "");
3702
- return _context44.abrupt("break", 65);
3704
+ return _context44.abrupt("break", 66);
3703
3705
  case 55:
3704
3706
  data["og:title"] = options.title;
3705
- return _context44.abrupt("break", 65);
3707
+ return _context44.abrupt("break", 66);
3706
3708
  case 57:
3707
3709
  embedUrl.searchParams.set("vrk", options.viewRecordKey);
3708
- return _context44.abrupt("break", 65);
3710
+ return _context44.abrupt("break", 66);
3709
3711
  case 59:
3710
3712
  embedUrl.searchParams.set("ptk", "");
3711
3713
  if (options.tenantId) {
@@ -3720,33 +3722,39 @@ exports.EmbedUrl = /*#__PURE__*/function () {
3720
3722
  if (options.ticketSubject) {
3721
3723
  embedUrl.searchParams.set("sbj", Buffer.from(options.ticketSubject).toString("base64"));
3722
3724
  }
3723
- return _context44.abrupt("break", 65);
3725
+ return _context44.abrupt("break", 66);
3724
3726
  case 65:
3727
+ embedUrl.searchParams.set("vc", "");
3728
+ case 66:
3725
3729
  _i++;
3726
3730
  _context44.next = 18;
3727
3731
  break;
3728
- case 68:
3732
+ case 69:
3733
+ for (_i2 = 0, _Object$keys2 = Object.keys(additionalParameters); _i2 < _Object$keys2.length; _i2++) {
3734
+ item = _Object$keys2[_i2];
3735
+ embedUrl.searchParams.set(item, additionalParameters[item]);
3736
+ }
3729
3737
  if (Object.keys(data).length > 0) {
3730
3738
  embedUrl.searchParams.set("data", this.utils.B64(JSON.stringify({
3731
3739
  meta_tags: data
3732
3740
  })));
3733
3741
  }
3734
3742
  if (!["owner", "editable", "viewable"].includes(permission)) {
3735
- _context44.next = 74;
3743
+ _context44.next = 76;
3736
3744
  break;
3737
3745
  }
3738
- _context44.next = 72;
3746
+ _context44.next = 74;
3739
3747
  return this.CreateSignedToken({
3740
3748
  objectId: objectId,
3741
3749
  versionHash: versionHash,
3742
3750
  duration: duration
3743
3751
  });
3744
- case 72:
3752
+ case 74:
3745
3753
  token = _context44.sent;
3746
3754
  embedUrl.searchParams.set("ath", token);
3747
- case 74:
3755
+ case 76:
3748
3756
  return _context44.abrupt("return", embedUrl.toString());
3749
- case 75:
3757
+ case 77:
3750
3758
  case "end":
3751
3759
  return _context44.stop();
3752
3760
  }
@@ -269,7 +269,7 @@ var LiveConf = /*#__PURE__*/function () {
269
269
  break;
270
270
  case "30000/1001":
271
271
  //seg.videoFrameDurationTs = 3003;
272
- seg.video = sourceTimescale * 30;
272
+ seg.video = sourceTimescale * 30.03;
273
273
  seg.keyint = 60;
274
274
  seg.duration = "30.03";
275
275
  break;
@@ -1692,16 +1692,19 @@ exports.StreamInsertion = /*#__PURE__*/function () {
1692
1692
  * @param {string} name - Object ID or name of the live stream object
1693
1693
  * @param {Object=} customSettings - Additional options to customize configuration settings
1694
1694
  * @param {Object=} probeMetadata - Metadata for the probe. If not specified, a new probe will be configured
1695
+ * @param {string=} writeToken - Write token of the draft
1696
+ * @param {boolean=} finalize - If enabled, target object will be finalized after configuring
1697
+ *
1695
1698
  * @return {Promise<Object>} - The status response for the stream
1696
1699
  *
1697
1700
  */
1698
1701
  exports.StreamConfig = /*#__PURE__*/function () {
1699
1702
  var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref21) {
1700
- var name, _ref21$customSettings, customSettings, probeMetadata, objectId, status, libraryId, probe, mainMeta, userConfig, parsedName, hostName, streamUrl, nodes, node, endpoint, probeUrl, lc, liveRecordingConfig, e, writeToken;
1703
+ var name, _ref21$customSettings, customSettings, probeMetadata, writeToken, _ref21$finalize, finalize, objectId, status, libraryId, probe, mainMeta, userConfig, parsedName, hostName, streamUrl, nodes, node, endpoint, probeUrl, lc, liveRecordingConfig, e;
1701
1704
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1702
1705
  while (1) switch (_context11.prev = _context11.next) {
1703
1706
  case 0:
1704
- name = _ref21.name, _ref21$customSettings = _ref21.customSettings, customSettings = _ref21$customSettings === void 0 ? {} : _ref21$customSettings, probeMetadata = _ref21.probeMetadata;
1707
+ name = _ref21.name, _ref21$customSettings = _ref21.customSettings, customSettings = _ref21$customSettings === void 0 ? {} : _ref21$customSettings, probeMetadata = _ref21.probeMetadata, writeToken = _ref21.writeToken, _ref21$finalize = _ref21.finalize, finalize = _ref21$finalize === void 0 ? true : _ref21$finalize;
1705
1708
  objectId = name;
1706
1709
  status = {
1707
1710
  name: name
@@ -1809,15 +1812,20 @@ exports.StreamConfig = /*#__PURE__*/function () {
1809
1812
  liveRecordingConfig = lc.generateLiveConf({
1810
1813
  customSettings: customSettings
1811
1814
  }); // Store live recording config into the stream object
1812
- _context11.next = 57;
1815
+ if (writeToken) {
1816
+ _context11.next = 60;
1817
+ break;
1818
+ }
1819
+ _context11.next = 58;
1813
1820
  return this.EditContentObject({
1814
1821
  libraryId: libraryId,
1815
1822
  objectId: objectId
1816
1823
  });
1817
- case 57:
1824
+ case 58:
1818
1825
  e = _context11.sent;
1819
1826
  writeToken = e.write_token;
1820
- _context11.next = 61;
1827
+ case 60:
1828
+ _context11.next = 62;
1821
1829
  return this.ReplaceMetadata({
1822
1830
  libraryId: libraryId,
1823
1831
  objectId: objectId,
@@ -1825,8 +1833,8 @@ exports.StreamConfig = /*#__PURE__*/function () {
1825
1833
  metadataSubtree: "live_recording",
1826
1834
  metadata: liveRecordingConfig.live_recording
1827
1835
  });
1828
- case 61:
1829
- _context11.next = 63;
1836
+ case 62:
1837
+ _context11.next = 64;
1830
1838
  return this.ReplaceMetadata({
1831
1839
  libraryId: libraryId,
1832
1840
  objectId: objectId,
@@ -1834,18 +1842,23 @@ exports.StreamConfig = /*#__PURE__*/function () {
1834
1842
  metadataSubtree: "live_recording_config/probe_info",
1835
1843
  metadata: probe
1836
1844
  });
1837
- case 63:
1838
- _context11.next = 65;
1845
+ case 64:
1846
+ if (!finalize) {
1847
+ _context11.next = 68;
1848
+ break;
1849
+ }
1850
+ _context11.next = 67;
1839
1851
  return this.FinalizeContentObject({
1840
1852
  libraryId: libraryId,
1841
1853
  objectId: objectId,
1842
1854
  writeToken: writeToken,
1843
1855
  commitMessage: "Apply live stream configuration"
1844
1856
  });
1845
- case 65:
1857
+ case 67:
1846
1858
  status.fin = _context11.sent;
1859
+ case 68:
1847
1860
  return _context11.abrupt("return", status);
1848
- case 67:
1861
+ case 69:
1849
1862
  case "end":
1850
1863
  return _context11.stop();
1851
1864
  }