@eluvio/elv-client-js 4.0.143 → 4.0.144

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.
@@ -1,7 +1,11 @@
1
+ var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
1
2
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
2
3
  var _typeof = require("@babel/runtime/helpers/typeof");
3
4
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
4
5
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
10
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
11
  /**
@@ -1517,4 +1521,429 @@ exports.ResetTenantId = /*#__PURE__*/function () {
1517
1521
  return function (_x21) {
1518
1522
  return _ref48.apply(this, arguments);
1519
1523
  };
1524
+ }();
1525
+
1526
+ /**
1527
+ * Enum for object types that can be cleaned up after object deletion.
1528
+ * Used by the ObjectCleanup method to determine which associated objects to clean.
1529
+ *
1530
+ * @property {string=} LIBRARY - Cleanup libraries
1531
+ * @property {string=} CONTENT_OBJECT - Cleanup content objects
1532
+ * @property {string=} GROUP - Cleanup access groups
1533
+ * @property {string=} CONTENT_TYPE - Cleanup content types
1534
+ * @property {string=} ALL - Cleanup all of the above
1535
+ */
1536
+ var ObjectTypesToClean = Object.freeze({
1537
+ LIBRARY: "library",
1538
+ CONTENT_OBJECT: "content_object",
1539
+ GROUP: "group",
1540
+ CONTENT_TYPE: "content_type",
1541
+ ALL: "all"
1542
+ });
1543
+
1544
+ /**
1545
+ * Cleans up deleted objects pointed to by the access index of a given "access group" or "user wallet"
1546
+ * Contracts of type "access group" and "user wallet" contain an "access index" - a list of objects that they have access to.
1547
+ *
1548
+ * There are 4 specific indexes, one for each object type:
1549
+ * - content
1550
+ * - library
1551
+ * - access groups
1552
+ * - content types
1553
+ *
1554
+ * If an object gets deleted and the access index still points to it, it will cause errors in API calls for the access
1555
+ * group or user wallet.
1556
+ *
1557
+ * This function checks each index for objects that are deleted, and removes them from the index (either all indexes or
1558
+ * just the one specified by parameter 'objectTypeToClean')
1559
+ *
1560
+ * For user, the cleanup is performed on the user wallet and on all its access group
1561
+ *
1562
+ * @methodGroup Contracts
1563
+ * @namedParams
1564
+ * @param {string=} contractAddress - The address of the object
1565
+ * @param {string=} objectId - The ID of the object
1566
+ * @param {string=} versionHash - A version hash of the object
1567
+ * @param {string=} objectTypeToClean - The type of object to clean: one of "library", "content_object", "group", "content_type", or "all"
1568
+ * @returns {Promise<Object>} - Resolves with an object showing the count of items before and after cleanup.
1569
+ *
1570
+ * Example return value:
1571
+ * {
1572
+ * "0x123...": {
1573
+ * beforeCleanup: {
1574
+ * librariesLength: 2,
1575
+ * contentObjectsLength: 4,
1576
+ * accessGroupsLength: 1,
1577
+ * contentTypesLength: 3
1578
+ * },
1579
+ * afterCleanup: {
1580
+ * librariesLength: 0,
1581
+ * contentObjectsLength: 0,
1582
+ * accessGroupsLength: 0,
1583
+ * contentTypesLength: 0
1584
+ * }
1585
+ * },
1586
+ * "groups": {
1587
+ * "0x123...": {
1588
+ * beforeCleanup: {
1589
+ * contentObjectsLength: 1
1590
+ * },
1591
+ * afterCleanup: {
1592
+ * contentObjectsLength: 0
1593
+ * }
1594
+ * }
1595
+ * }
1596
+ * }
1597
+ */
1598
+ exports.ObjectCleanup = /*#__PURE__*/function () {
1599
+ var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref49) {
1600
+ var _this = this,
1601
+ _cleanupTasks;
1602
+ var contractAddress, objectId, versionHash, _ref49$objectTypeToCl, objectTypeToClean, isUserWallet, userAddress, allowedTypes, cleanupTasks, runCleanupTasks, results, res, groupsLength, groupAddressPromises, i, groupAddresses, cleanupResults, _iterator, _step, _step$value, addr, _res2;
1603
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
1604
+ while (1) switch (_context29.prev = _context29.next) {
1605
+ case 0:
1606
+ contractAddress = _ref49.contractAddress, objectId = _ref49.objectId, versionHash = _ref49.versionHash, _ref49$objectTypeToCl = _ref49.objectTypeToClean, objectTypeToClean = _ref49$objectTypeToCl === void 0 ? ObjectTypesToClean.ALL : _ref49$objectTypeToCl;
1607
+ _context29.next = 3;
1608
+ return GetObjectIDAndContractAddress({
1609
+ contractAddress: contractAddress,
1610
+ objectId: objectId,
1611
+ versionHash: versionHash
1612
+ });
1613
+ case 3:
1614
+ objectInfo = _context29.sent;
1615
+ contractAddress = objectInfo.contractAddress;
1616
+ isUserWallet = false;
1617
+ _context29.prev = 6;
1618
+ _context29.next = 9;
1619
+ return this.CallContractMethod({
1620
+ contractAddress: contractAddress,
1621
+ methodName: "getLibrariesLength",
1622
+ formatArguments: false
1623
+ });
1624
+ case 9:
1625
+ _context29.next = 24;
1626
+ break;
1627
+ case 11:
1628
+ _context29.prev = 11;
1629
+ _context29.t0 = _context29["catch"](6);
1630
+ _context29.prev = 13;
1631
+ userAddress = contractAddress;
1632
+ _context29.next = 17;
1633
+ return this.userProfileClient.UserWalletAddress({
1634
+ address: contractAddress
1635
+ });
1636
+ case 17:
1637
+ contractAddress = _context29.sent;
1638
+ isUserWallet = true;
1639
+ _context29.next = 24;
1640
+ break;
1641
+ case 21:
1642
+ _context29.prev = 21;
1643
+ _context29.t1 = _context29["catch"](13);
1644
+ throw new Error("Invalid object: ".concat(_context29.t1.message));
1645
+ case 24:
1646
+ allowedTypes = Object.values(ObjectTypesToClean);
1647
+ if (allowedTypes.includes(objectTypeToClean)) {
1648
+ _context29.next = 27;
1649
+ break;
1650
+ }
1651
+ throw Error("Invalid objectType '".concat(objectTypeToClean, "'. Allowed types: ").concat(allowedTypes.join(", ")));
1652
+ case 27:
1653
+ cleanupTasks = (_cleanupTasks = {}, _defineProperty(_cleanupTasks, ObjectTypesToClean.LIBRARY, function () {
1654
+ var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref51) {
1655
+ var contractAddress, res, before, after;
1656
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1657
+ while (1) switch (_context24.prev = _context24.next) {
1658
+ case 0:
1659
+ contractAddress = _ref51.contractAddress, res = _ref51.res;
1660
+ _context24.next = 3;
1661
+ return _this.CallContractMethod({
1662
+ contractAddress: contractAddress,
1663
+ methodName: "getLibrariesLength",
1664
+ formatArguments: false
1665
+ });
1666
+ case 3:
1667
+ before = _context24.sent;
1668
+ res.beforeCleanup.librariesLength = before.toNumber();
1669
+ _context24.next = 7;
1670
+ return _this.CallContractMethodAndWait({
1671
+ contractAddress: contractAddress,
1672
+ methodName: "cleanUpLibraries",
1673
+ formatArguments: true
1674
+ });
1675
+ case 7:
1676
+ _context24.next = 9;
1677
+ return _this.CallContractMethod({
1678
+ contractAddress: contractAddress,
1679
+ methodName: "getLibrariesLength",
1680
+ formatArguments: false
1681
+ });
1682
+ case 9:
1683
+ after = _context24.sent;
1684
+ res.afterCleanup.librariesLength = after.toNumber();
1685
+ case 11:
1686
+ case "end":
1687
+ return _context24.stop();
1688
+ }
1689
+ }, _callee24);
1690
+ }));
1691
+ return function (_x23) {
1692
+ return _ref52.apply(this, arguments);
1693
+ };
1694
+ }()), _defineProperty(_cleanupTasks, ObjectTypesToClean.CONTENT_OBJECT, function () {
1695
+ var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref53) {
1696
+ var contractAddress, res, before, after;
1697
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1698
+ while (1) switch (_context25.prev = _context25.next) {
1699
+ case 0:
1700
+ contractAddress = _ref53.contractAddress, res = _ref53.res;
1701
+ _context25.next = 3;
1702
+ return _this.CallContractMethod({
1703
+ contractAddress: contractAddress,
1704
+ methodName: "getContentObjectsLength",
1705
+ formatArguments: false
1706
+ });
1707
+ case 3:
1708
+ before = _context25.sent;
1709
+ res.beforeCleanup.contentObjectsLength = before.toNumber();
1710
+ _context25.next = 7;
1711
+ return _this.CallContractMethodAndWait({
1712
+ contractAddress: contractAddress,
1713
+ methodName: "cleanUpContentObjects",
1714
+ formatArguments: true
1715
+ });
1716
+ case 7:
1717
+ _context25.next = 9;
1718
+ return _this.CallContractMethod({
1719
+ contractAddress: contractAddress,
1720
+ methodName: "getContentObjectsLength",
1721
+ formatArguments: false
1722
+ });
1723
+ case 9:
1724
+ after = _context25.sent;
1725
+ res.afterCleanup.contentObjectsLength = after.toNumber();
1726
+ case 11:
1727
+ case "end":
1728
+ return _context25.stop();
1729
+ }
1730
+ }, _callee25);
1731
+ }));
1732
+ return function (_x24) {
1733
+ return _ref54.apply(this, arguments);
1734
+ };
1735
+ }()), _defineProperty(_cleanupTasks, ObjectTypesToClean.GROUP, function () {
1736
+ var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref55) {
1737
+ var contractAddress, res, before, after;
1738
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
1739
+ while (1) switch (_context26.prev = _context26.next) {
1740
+ case 0:
1741
+ contractAddress = _ref55.contractAddress, res = _ref55.res;
1742
+ _context26.next = 3;
1743
+ return _this.CallContractMethod({
1744
+ contractAddress: contractAddress,
1745
+ methodName: "getAccessGroupsLength",
1746
+ formatArguments: false
1747
+ });
1748
+ case 3:
1749
+ before = _context26.sent;
1750
+ res.beforeCleanup.accessGroupsLength = before.toNumber();
1751
+ _context26.next = 7;
1752
+ return _this.CallContractMethodAndWait({
1753
+ contractAddress: contractAddress,
1754
+ methodName: "cleanUpAccessGroups",
1755
+ formatArguments: true
1756
+ });
1757
+ case 7:
1758
+ _context26.next = 9;
1759
+ return _this.CallContractMethod({
1760
+ contractAddress: contractAddress,
1761
+ methodName: "getAccessGroupsLength",
1762
+ formatArguments: false
1763
+ });
1764
+ case 9:
1765
+ after = _context26.sent;
1766
+ res.afterCleanup.accessGroupsLength = after.toNumber();
1767
+ case 11:
1768
+ case "end":
1769
+ return _context26.stop();
1770
+ }
1771
+ }, _callee26);
1772
+ }));
1773
+ return function (_x25) {
1774
+ return _ref56.apply(this, arguments);
1775
+ };
1776
+ }()), _defineProperty(_cleanupTasks, ObjectTypesToClean.CONTENT_TYPE, function () {
1777
+ var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref57) {
1778
+ var contractAddress, res, before, after;
1779
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
1780
+ while (1) switch (_context27.prev = _context27.next) {
1781
+ case 0:
1782
+ contractAddress = _ref57.contractAddress, res = _ref57.res;
1783
+ _context27.next = 3;
1784
+ return _this.CallContractMethod({
1785
+ contractAddress: contractAddress,
1786
+ methodName: "getContentTypesLength",
1787
+ formatArguments: false
1788
+ });
1789
+ case 3:
1790
+ before = _context27.sent;
1791
+ res.beforeCleanup.contentTypesLength = before.toNumber();
1792
+ _context27.next = 7;
1793
+ return _this.CallContractMethodAndWait({
1794
+ contractAddress: contractAddress,
1795
+ methodName: "cleanUpContentTypes",
1796
+ formatArguments: true
1797
+ });
1798
+ case 7:
1799
+ _context27.next = 9;
1800
+ return _this.CallContractMethod({
1801
+ contractAddress: contractAddress,
1802
+ methodName: "getContentTypesLength",
1803
+ formatArguments: false
1804
+ });
1805
+ case 9:
1806
+ after = _context27.sent;
1807
+ res.afterCleanup.contentTypesLength = after.toNumber();
1808
+ case 11:
1809
+ case "end":
1810
+ return _context27.stop();
1811
+ }
1812
+ }, _callee27);
1813
+ }));
1814
+ return function (_x26) {
1815
+ return _ref58.apply(this, arguments);
1816
+ };
1817
+ }()), _cleanupTasks);
1818
+ runCleanupTasks = /*#__PURE__*/function () {
1819
+ var _ref60 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref59) {
1820
+ var contractAddress, _res, _i, _Object$keys, type;
1821
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
1822
+ while (1) switch (_context28.prev = _context28.next) {
1823
+ case 0:
1824
+ contractAddress = _ref59.contractAddress;
1825
+ _context28.prev = 1;
1826
+ _res = {
1827
+ beforeCleanup: {},
1828
+ afterCleanup: {}
1829
+ };
1830
+ if (!(objectTypeToClean === ObjectTypesToClean.ALL)) {
1831
+ _context28.next = 14;
1832
+ break;
1833
+ }
1834
+ _i = 0, _Object$keys = Object.keys(cleanupTasks);
1835
+ case 5:
1836
+ if (!(_i < _Object$keys.length)) {
1837
+ _context28.next = 12;
1838
+ break;
1839
+ }
1840
+ type = _Object$keys[_i];
1841
+ _context28.next = 9;
1842
+ return cleanupTasks[type]({
1843
+ contractAddress: contractAddress,
1844
+ res: _res
1845
+ });
1846
+ case 9:
1847
+ _i++;
1848
+ _context28.next = 5;
1849
+ break;
1850
+ case 12:
1851
+ _context28.next = 16;
1852
+ break;
1853
+ case 14:
1854
+ _context28.next = 16;
1855
+ return cleanupTasks[objectTypeToClean]({
1856
+ contractAddress: contractAddress,
1857
+ res: _res
1858
+ });
1859
+ case 16:
1860
+ return _context28.abrupt("return", _res);
1861
+ case 19:
1862
+ _context28.prev = 19;
1863
+ _context28.t0 = _context28["catch"](1);
1864
+ throw new Error("Error during '".concat(objectTypeToClean, "' cleanup for ").concat(contractAddress, ": ").concat(_context28.t0.message));
1865
+ case 22:
1866
+ case "end":
1867
+ return _context28.stop();
1868
+ }
1869
+ }, _callee28, null, [[1, 19]]);
1870
+ }));
1871
+ return function runCleanupTasks(_x27) {
1872
+ return _ref60.apply(this, arguments);
1873
+ };
1874
+ }();
1875
+ results = {}; // run cleanup on main contract
1876
+ _context29.next = 32;
1877
+ return runCleanupTasks({
1878
+ contractAddress: contractAddress
1879
+ });
1880
+ case 32:
1881
+ res = _context29.sent;
1882
+ if (isUserWallet) {
1883
+ results[userAddress] = res;
1884
+ } else {
1885
+ results[contractAddress] = res;
1886
+ }
1887
+
1888
+ // run cleanup on access group contracts if this is a user wallet
1889
+ if (!isUserWallet) {
1890
+ _context29.next = 49;
1891
+ break;
1892
+ }
1893
+ _context29.next = 37;
1894
+ return this.CallContractMethod({
1895
+ contractAddress: contractAddress,
1896
+ methodName: "getAccessGroupsLength",
1897
+ formatArguments: false
1898
+ });
1899
+ case 37:
1900
+ groupsLength = _context29.sent;
1901
+ if (groupsLength > 0) {
1902
+ results["groups"] = {};
1903
+ }
1904
+ groupAddressPromises = [];
1905
+ for (i = 0; i < groupsLength; i++) {
1906
+ groupAddressPromises.push(this.CallContractMethod({
1907
+ contractAddress: contractAddress,
1908
+ methodName: "getAccessGroup",
1909
+ methodArgs: [i],
1910
+ formatArguments: false
1911
+ }));
1912
+ }
1913
+ _context29.next = 43;
1914
+ return Promise.all(groupAddressPromises);
1915
+ case 43:
1916
+ groupAddresses = _context29.sent;
1917
+ _context29.next = 46;
1918
+ return Promise.all(groupAddresses.map(function (addr) {
1919
+ return runCleanupTasks({
1920
+ contractAddress: addr
1921
+ }).then(function (res) {
1922
+ return [addr, res];
1923
+ });
1924
+ }));
1925
+ case 46:
1926
+ cleanupResults = _context29.sent;
1927
+ _iterator = _createForOfIteratorHelper(cleanupResults);
1928
+ try {
1929
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1930
+ _step$value = _slicedToArray(_step.value, 2), addr = _step$value[0], _res2 = _step$value[1];
1931
+ results["groups"][addr] = _res2;
1932
+ }
1933
+ } catch (err) {
1934
+ _iterator.e(err);
1935
+ } finally {
1936
+ _iterator.f();
1937
+ }
1938
+ case 49:
1939
+ return _context29.abrupt("return", results);
1940
+ case 50:
1941
+ case "end":
1942
+ return _context29.stop();
1943
+ }
1944
+ }, _callee29, this, [[6, 11], [13, 21]]);
1945
+ }));
1946
+ return function (_x22) {
1947
+ return _ref50.apply(this, arguments);
1948
+ };
1520
1949
  }();
@@ -1,3 +1,4 @@
1
+ var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
1
2
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
2
3
  var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
3
4
  var _createClass = require("@babel/runtime/helpers/createClass");
@@ -133,14 +134,17 @@ var LiveConf = /*#__PURE__*/function () {
133
134
  key: "getAudioStreamsFromProbe",
134
135
  value: function getAudioStreamsFromProbe() {
135
136
  var audioStreams = {};
136
- for (var index = 0; index < this.probeData.streams.length; index++) {
137
- if (this.probeData.streams[index].codec_type == "audio") {
138
- audioStreams[index] = {
139
- recordingBitrate: Math.max(this.probeData.streams[index].bit_rate, 128000),
140
- recordingChannels: this.probeData.streams[index].channels,
141
- playoutLabel: "Audio ".concat(index)
142
- };
143
- }
137
+ var audioStreamData = this.probeData.streams.filter(function (value) {
138
+ return value.codec_type === "audio";
139
+ });
140
+ for (var index = 0; index < audioStreamData.length; index++) {
141
+ var currentStreamIndex = audioStreamData[index].stream_index;
142
+ var currentStreamData = audioStreamData[index];
143
+ audioStreams[currentStreamIndex] = {
144
+ recordingBitrate: Math.max(currentStreamData.bit_rate, 128000),
145
+ recordingChannels: currentStreamData.channels,
146
+ playoutLabel: "Audio ".concat(index + 1)
147
+ };
144
148
  }
145
149
  return audioStreams;
146
150
  }
@@ -398,7 +402,7 @@ var LiveConf = /*#__PURE__*/function () {
398
402
  recordingChannels: audio.recording_channels || 2
399
403
  };
400
404
  if (audio.playout) {
401
- audioStreams[audioIdx].playoutLabel = audio.playout_label || "Audio ".concat(audioIdx);
405
+ audioStreams[audioIdx].playoutLabel = audio.playout_label || "Audio ".concat(i + 1);
402
406
  }
403
407
  }
404
408
  }
@@ -447,18 +451,6 @@ var LiveConf = /*#__PURE__*/function () {
447
451
  if (this.syncAudioToVideo) {
448
452
  conf.live_recording.recording_config.recording_params.xc_params.sync_audio_to_stream_id = this.syncAudioToStreamIdValue();
449
453
  }
450
- if (customSettings.edge_write_token) {
451
- conf.live_recording.fabric_config.edge_write_token = customSettings.edge_write_token;
452
- }
453
- if (customSettings.part_ttl) {
454
- conf.live_recording.recording_config.recording_params.part_ttl = customSettings.part_ttl;
455
- }
456
- if (customSettings.connection_timeout) {
457
- conf.live_recording.recording_config.recording_params.xc_params.connection_timeout = customSettings.connection_timeout;
458
- }
459
- if (customSettings.reconnect_timeout) {
460
- conf.live_recording.recording_config.recording_params.reconnect_timeout = customSettings.reconnect_timeout;
461
- }
462
454
 
463
455
  // Fill in specifics for protocol
464
456
  switch (this.probeKind()) {
@@ -561,6 +553,33 @@ var LiveConf = /*#__PURE__*/function () {
561
553
  // Global recording bitrate for all audio streams
562
554
  conf.live_recording.recording_config.recording_params.xc_params.audio_bitrate = globalAudioBitrate;
563
555
  conf.live_recording.recording_config.recording_params.xc_params.n_audio = nAudio;
556
+
557
+ // Iterate through custom settings (which will override any existing setting)
558
+ function SetByPath(_ref6) {
559
+ var obj = _ref6.obj,
560
+ path = _ref6.path,
561
+ value = _ref6.value;
562
+ var keys = path.split(".");
563
+ var temp = obj;
564
+ for (var _i3 = 0; _i3 < keys.length - 1; _i3++) {
565
+ if (!temp[keys[_i3]]) {
566
+ temp[keys[_i3]] = {};
567
+ }
568
+ temp = temp[keys[_i3]];
569
+ }
570
+ temp[keys[keys.length - 1]] = value;
571
+ }
572
+ var metaPathValues = customSettings.metaPathValues;
573
+ for (var _i4 = 0, _Object$entries = Object.entries(metaPathValues || {}); _i4 < _Object$entries.length; _i4++) {
574
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i4], 2),
575
+ path = _Object$entries$_i[0],
576
+ value = _Object$entries$_i[1];
577
+ SetByPath({
578
+ obj: conf,
579
+ path: path,
580
+ value: value
581
+ });
582
+ }
564
583
  return conf;
565
584
  }
566
585
  }]);