@rtsdk/topia 0.2.4 → 0.3.1
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/index.cjs +41277 -1177
- package/dist/index.d.ts +215 -43
- package/dist/index.js +484 -474
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
import require$$0$1 from 'buffer';
|
|
19
19
|
import stream from 'stream';
|
|
20
|
-
import require$$
|
|
20
|
+
import require$$5 from 'util';
|
|
21
21
|
import require$$2 from 'crypto';
|
|
22
|
-
import require$$1
|
|
22
|
+
import require$$1 from 'path';
|
|
23
23
|
import require$$3 from 'http';
|
|
24
24
|
import require$$4 from 'https';
|
|
25
25
|
import require$$0$2 from 'url';
|
|
26
26
|
import require$$6 from 'fs';
|
|
27
27
|
import require$$4$1 from 'assert';
|
|
28
|
-
import require$$1$
|
|
28
|
+
import require$$1$1 from 'tty';
|
|
29
29
|
import require$$0$3 from 'os';
|
|
30
30
|
import zlib from 'zlib';
|
|
31
31
|
import EventEmitter from 'events';
|
|
@@ -192,7 +192,7 @@ var safeBuffer = {exports: {}};
|
|
|
192
192
|
|
|
193
193
|
var Buffer$7 = safeBuffer.exports.Buffer;
|
|
194
194
|
var Stream$5 = stream;
|
|
195
|
-
var util$6 = require$$
|
|
195
|
+
var util$6 = require$$5;
|
|
196
196
|
|
|
197
197
|
function DataStream$2(data) {
|
|
198
198
|
this.buffer = null;
|
|
@@ -498,7 +498,7 @@ var bufferEqual = bufferEqualConstantTime;
|
|
|
498
498
|
var Buffer$4 = safeBuffer.exports.Buffer;
|
|
499
499
|
var crypto = require$$2;
|
|
500
500
|
var formatEcdsa = ecdsaSigFormatter;
|
|
501
|
-
var util$5 = require$$
|
|
501
|
+
var util$5 = require$$5;
|
|
502
502
|
|
|
503
503
|
var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".';
|
|
504
504
|
var MSG_INVALID_SECRET = 'secret must be a string or buffer';
|
|
@@ -764,7 +764,7 @@ var DataStream$1 = dataStream;
|
|
|
764
764
|
var jwa$1 = jwa$2;
|
|
765
765
|
var Stream$4 = stream;
|
|
766
766
|
var toString$2 = tostring;
|
|
767
|
-
var util$4 = require$$
|
|
767
|
+
var util$4 = require$$5;
|
|
768
768
|
|
|
769
769
|
function base64url(string, encoding) {
|
|
770
770
|
return Buffer$2
|
|
@@ -844,7 +844,7 @@ var DataStream = dataStream;
|
|
|
844
844
|
var jwa = jwa$2;
|
|
845
845
|
var Stream$3 = stream;
|
|
846
846
|
var toString$1 = tostring;
|
|
847
|
-
var util$3 = require$$
|
|
847
|
+
var util$3 = require$$5;
|
|
848
848
|
var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;
|
|
849
849
|
|
|
850
850
|
function isObject$1(thing) {
|
|
@@ -1039,7 +1039,7 @@ var y = d * 365.25;
|
|
|
1039
1039
|
* @api public
|
|
1040
1040
|
*/
|
|
1041
1041
|
|
|
1042
|
-
var ms$
|
|
1042
|
+
var ms$1 = function(val, options) {
|
|
1043
1043
|
options = options || {};
|
|
1044
1044
|
var type = typeof val;
|
|
1045
1045
|
if (type === 'string' && val.length > 0) {
|
|
@@ -1177,13 +1177,13 @@ function plural(ms, msAbs, n, name) {
|
|
|
1177
1177
|
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
|
-
var ms
|
|
1180
|
+
var ms = ms$1;
|
|
1181
1181
|
|
|
1182
1182
|
var timespan$2 = function (time, iat) {
|
|
1183
1183
|
var timestamp = iat || Math.floor(Date.now() / 1000);
|
|
1184
1184
|
|
|
1185
1185
|
if (typeof time === 'string') {
|
|
1186
|
-
var milliseconds = ms
|
|
1186
|
+
var milliseconds = ms(time);
|
|
1187
1187
|
if (typeof milliseconds === 'undefined') {
|
|
1188
1188
|
return;
|
|
1189
1189
|
}
|
|
@@ -1196,24 +1196,37 @@ var timespan$2 = function (time, iat) {
|
|
|
1196
1196
|
|
|
1197
1197
|
};
|
|
1198
1198
|
|
|
1199
|
-
var re$
|
|
1199
|
+
var re$2 = {exports: {}};
|
|
1200
1200
|
|
|
1201
1201
|
// Note: this is the semver.org version of the spec that it implements
|
|
1202
1202
|
// Not necessarily the package version of this code.
|
|
1203
1203
|
const SEMVER_SPEC_VERSION = '2.0.0';
|
|
1204
1204
|
|
|
1205
|
-
const MAX_LENGTH$
|
|
1205
|
+
const MAX_LENGTH$1 = 256;
|
|
1206
1206
|
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
|
|
1207
1207
|
/* istanbul ignore next */ 9007199254740991;
|
|
1208
1208
|
|
|
1209
1209
|
// Max safe segment length for coercion.
|
|
1210
1210
|
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
1211
1211
|
|
|
1212
|
+
const RELEASE_TYPES = [
|
|
1213
|
+
'major',
|
|
1214
|
+
'premajor',
|
|
1215
|
+
'minor',
|
|
1216
|
+
'preminor',
|
|
1217
|
+
'patch',
|
|
1218
|
+
'prepatch',
|
|
1219
|
+
'prerelease',
|
|
1220
|
+
];
|
|
1221
|
+
|
|
1212
1222
|
var constants$1 = {
|
|
1213
|
-
|
|
1214
|
-
MAX_LENGTH: MAX_LENGTH$2,
|
|
1215
|
-
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
1223
|
+
MAX_LENGTH: MAX_LENGTH$1,
|
|
1216
1224
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
1225
|
+
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
1226
|
+
RELEASE_TYPES,
|
|
1227
|
+
SEMVER_SPEC_VERSION,
|
|
1228
|
+
FLAG_INCLUDE_PRERELEASE: 0b001,
|
|
1229
|
+
FLAG_LOOSE: 0b010,
|
|
1217
1230
|
};
|
|
1218
1231
|
|
|
1219
1232
|
const debug$3 = (
|
|
@@ -1409,19 +1422,23 @@ var debug_1$1 = debug$3;
|
|
|
1409
1422
|
// >=0.0.0 is like a star
|
|
1410
1423
|
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
1411
1424
|
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
1412
|
-
} (re$
|
|
1413
|
-
|
|
1414
|
-
// parse out just the options we care about
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1417
|
-
const parseOptions$
|
|
1418
|
-
!options
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
+
} (re$2, re$2.exports));
|
|
1426
|
+
|
|
1427
|
+
// parse out just the options we care about
|
|
1428
|
+
const looseOption = Object.freeze({ loose: true });
|
|
1429
|
+
const emptyOpts = Object.freeze({ });
|
|
1430
|
+
const parseOptions$1 = options => {
|
|
1431
|
+
if (!options) {
|
|
1432
|
+
return emptyOpts
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
if (typeof options !== 'object') {
|
|
1436
|
+
return looseOption
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
return options
|
|
1440
|
+
};
|
|
1441
|
+
var parseOptions_1 = parseOptions$1;
|
|
1425
1442
|
|
|
1426
1443
|
const numeric = /^[0-9]+$/;
|
|
1427
1444
|
const compareIdentifiers$1 = (a, b) => {
|
|
@@ -1448,14 +1465,14 @@ var identifiers$1 = {
|
|
|
1448
1465
|
};
|
|
1449
1466
|
|
|
1450
1467
|
const debug$2 = debug_1$1;
|
|
1451
|
-
const { MAX_LENGTH
|
|
1452
|
-
const { re: re$
|
|
1468
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants$1;
|
|
1469
|
+
const { re: re$1, t: t$1 } = re$2.exports;
|
|
1453
1470
|
|
|
1454
|
-
const parseOptions
|
|
1471
|
+
const parseOptions = parseOptions_1;
|
|
1455
1472
|
const { compareIdentifiers } = identifiers$1;
|
|
1456
1473
|
let SemVer$d = class SemVer {
|
|
1457
1474
|
constructor (version, options) {
|
|
1458
|
-
options = parseOptions
|
|
1475
|
+
options = parseOptions(options);
|
|
1459
1476
|
|
|
1460
1477
|
if (version instanceof SemVer$d) {
|
|
1461
1478
|
if (version.loose === !!options.loose &&
|
|
@@ -1465,12 +1482,12 @@ let SemVer$d = class SemVer {
|
|
|
1465
1482
|
version = version.version;
|
|
1466
1483
|
}
|
|
1467
1484
|
} else if (typeof version !== 'string') {
|
|
1468
|
-
throw new TypeError(`Invalid Version: ${version}`)
|
|
1485
|
+
throw new TypeError(`Invalid Version: ${require$$5.inspect(version)}`)
|
|
1469
1486
|
}
|
|
1470
1487
|
|
|
1471
|
-
if (version.length > MAX_LENGTH
|
|
1488
|
+
if (version.length > MAX_LENGTH) {
|
|
1472
1489
|
throw new TypeError(
|
|
1473
|
-
`version is longer than ${MAX_LENGTH
|
|
1490
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
1474
1491
|
)
|
|
1475
1492
|
}
|
|
1476
1493
|
|
|
@@ -1481,7 +1498,7 @@ let SemVer$d = class SemVer {
|
|
|
1481
1498
|
// don't run into trouble passing this.options around.
|
|
1482
1499
|
this.includePrerelease = !!options.includePrerelease;
|
|
1483
1500
|
|
|
1484
|
-
const m = version.trim().match(options.loose ? re$
|
|
1501
|
+
const m = version.trim().match(options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL]);
|
|
1485
1502
|
|
|
1486
1503
|
if (!m) {
|
|
1487
1504
|
throw new TypeError(`Invalid Version: ${version}`)
|
|
@@ -1624,36 +1641,36 @@ let SemVer$d = class SemVer {
|
|
|
1624
1641
|
|
|
1625
1642
|
// preminor will bump the version up to the next minor release, and immediately
|
|
1626
1643
|
// down to pre-release. premajor and prepatch work the same way.
|
|
1627
|
-
inc (release, identifier) {
|
|
1644
|
+
inc (release, identifier, identifierBase) {
|
|
1628
1645
|
switch (release) {
|
|
1629
1646
|
case 'premajor':
|
|
1630
1647
|
this.prerelease.length = 0;
|
|
1631
1648
|
this.patch = 0;
|
|
1632
1649
|
this.minor = 0;
|
|
1633
1650
|
this.major++;
|
|
1634
|
-
this.inc('pre', identifier);
|
|
1651
|
+
this.inc('pre', identifier, identifierBase);
|
|
1635
1652
|
break
|
|
1636
1653
|
case 'preminor':
|
|
1637
1654
|
this.prerelease.length = 0;
|
|
1638
1655
|
this.patch = 0;
|
|
1639
1656
|
this.minor++;
|
|
1640
|
-
this.inc('pre', identifier);
|
|
1657
|
+
this.inc('pre', identifier, identifierBase);
|
|
1641
1658
|
break
|
|
1642
1659
|
case 'prepatch':
|
|
1643
1660
|
// If this is already a prerelease, it will bump to the next version
|
|
1644
1661
|
// drop any prereleases that might already exist, since they are not
|
|
1645
1662
|
// relevant at this point.
|
|
1646
1663
|
this.prerelease.length = 0;
|
|
1647
|
-
this.inc('patch', identifier);
|
|
1648
|
-
this.inc('pre', identifier);
|
|
1664
|
+
this.inc('patch', identifier, identifierBase);
|
|
1665
|
+
this.inc('pre', identifier, identifierBase);
|
|
1649
1666
|
break
|
|
1650
1667
|
// If the input is a non-prerelease version, this acts the same as
|
|
1651
1668
|
// prepatch.
|
|
1652
1669
|
case 'prerelease':
|
|
1653
1670
|
if (this.prerelease.length === 0) {
|
|
1654
|
-
this.inc('patch', identifier);
|
|
1671
|
+
this.inc('patch', identifier, identifierBase);
|
|
1655
1672
|
}
|
|
1656
|
-
this.inc('pre', identifier);
|
|
1673
|
+
this.inc('pre', identifier, identifierBase);
|
|
1657
1674
|
break
|
|
1658
1675
|
|
|
1659
1676
|
case 'major':
|
|
@@ -1695,9 +1712,15 @@ let SemVer$d = class SemVer {
|
|
|
1695
1712
|
break
|
|
1696
1713
|
// This probably shouldn't be used publicly.
|
|
1697
1714
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
1698
|
-
case 'pre':
|
|
1715
|
+
case 'pre': {
|
|
1716
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
1717
|
+
|
|
1718
|
+
if (!identifier && identifierBase === false) {
|
|
1719
|
+
throw new Error('invalid increment argument: identifier is empty')
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1699
1722
|
if (this.prerelease.length === 0) {
|
|
1700
|
-
this.prerelease = [
|
|
1723
|
+
this.prerelease = [base];
|
|
1701
1724
|
} else {
|
|
1702
1725
|
let i = this.prerelease.length;
|
|
1703
1726
|
while (--i >= 0) {
|
|
@@ -1708,22 +1731,29 @@ let SemVer$d = class SemVer {
|
|
|
1708
1731
|
}
|
|
1709
1732
|
if (i === -1) {
|
|
1710
1733
|
// didn't increment anything
|
|
1711
|
-
this.prerelease.
|
|
1734
|
+
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
|
1735
|
+
throw new Error('invalid increment argument: identifier already exists')
|
|
1736
|
+
}
|
|
1737
|
+
this.prerelease.push(base);
|
|
1712
1738
|
}
|
|
1713
1739
|
}
|
|
1714
1740
|
if (identifier) {
|
|
1715
1741
|
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
|
1716
1742
|
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
|
1743
|
+
let prerelease = [identifier, base];
|
|
1744
|
+
if (identifierBase === false) {
|
|
1745
|
+
prerelease = [identifier];
|
|
1746
|
+
}
|
|
1717
1747
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
1718
1748
|
if (isNaN(this.prerelease[1])) {
|
|
1719
|
-
this.prerelease =
|
|
1749
|
+
this.prerelease = prerelease;
|
|
1720
1750
|
}
|
|
1721
1751
|
} else {
|
|
1722
|
-
this.prerelease =
|
|
1752
|
+
this.prerelease = prerelease;
|
|
1723
1753
|
}
|
|
1724
1754
|
}
|
|
1725
1755
|
break
|
|
1726
|
-
|
|
1756
|
+
}
|
|
1727
1757
|
default:
|
|
1728
1758
|
throw new Error(`invalid increment argument: ${release}`)
|
|
1729
1759
|
}
|
|
@@ -1735,35 +1765,18 @@ let SemVer$d = class SemVer {
|
|
|
1735
1765
|
|
|
1736
1766
|
var semver$4 = SemVer$d;
|
|
1737
1767
|
|
|
1738
|
-
const { MAX_LENGTH } = constants$1;
|
|
1739
|
-
const { re: re$1, t: t$1 } = re$3.exports;
|
|
1740
1768
|
const SemVer$c = semver$4;
|
|
1741
|
-
|
|
1742
|
-
const parseOptions = parseOptions_1;
|
|
1743
|
-
const parse$6 = (version, options) => {
|
|
1744
|
-
options = parseOptions(options);
|
|
1745
|
-
|
|
1769
|
+
const parse$6 = (version, options, throwErrors = false) => {
|
|
1746
1770
|
if (version instanceof SemVer$c) {
|
|
1747
1771
|
return version
|
|
1748
1772
|
}
|
|
1749
|
-
|
|
1750
|
-
if (typeof version !== 'string') {
|
|
1751
|
-
return null
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
if (version.length > MAX_LENGTH) {
|
|
1755
|
-
return null
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
const r = options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL];
|
|
1759
|
-
if (!r.test(version)) {
|
|
1760
|
-
return null
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
1773
|
try {
|
|
1764
1774
|
return new SemVer$c(version, options)
|
|
1765
1775
|
} catch (er) {
|
|
1766
|
-
|
|
1776
|
+
if (!throwErrors) {
|
|
1777
|
+
return null
|
|
1778
|
+
}
|
|
1779
|
+
throw er
|
|
1767
1780
|
}
|
|
1768
1781
|
};
|
|
1769
1782
|
|
|
@@ -1785,8 +1798,9 @@ var clean_1 = clean$2;
|
|
|
1785
1798
|
|
|
1786
1799
|
const SemVer$b = semver$4;
|
|
1787
1800
|
|
|
1788
|
-
const inc$1 = (version, release, options, identifier) => {
|
|
1801
|
+
const inc$1 = (version, release, options, identifier, identifierBase) => {
|
|
1789
1802
|
if (typeof (options) === 'string') {
|
|
1803
|
+
identifierBase = identifier;
|
|
1790
1804
|
identifier = options;
|
|
1791
1805
|
options = undefined;
|
|
1792
1806
|
}
|
|
@@ -1795,57 +1809,78 @@ const inc$1 = (version, release, options, identifier) => {
|
|
|
1795
1809
|
return new SemVer$b(
|
|
1796
1810
|
version instanceof SemVer$b ? version.version : version,
|
|
1797
1811
|
options
|
|
1798
|
-
).inc(release, identifier).version
|
|
1812
|
+
).inc(release, identifier, identifierBase).version
|
|
1799
1813
|
} catch (er) {
|
|
1800
1814
|
return null
|
|
1801
1815
|
}
|
|
1802
1816
|
};
|
|
1803
1817
|
var inc_1 = inc$1;
|
|
1804
1818
|
|
|
1805
|
-
const SemVer$a = semver$4;
|
|
1806
|
-
const compare$b = (a, b, loose) =>
|
|
1807
|
-
new SemVer$a(a, loose).compare(new SemVer$a(b, loose));
|
|
1808
|
-
|
|
1809
|
-
var compare_1 = compare$b;
|
|
1810
|
-
|
|
1811
|
-
const compare$a = compare_1;
|
|
1812
|
-
const eq$3 = (a, b, loose) => compare$a(a, b, loose) === 0;
|
|
1813
|
-
var eq_1 = eq$3;
|
|
1814
|
-
|
|
1815
1819
|
const parse$3 = parse_1;
|
|
1816
|
-
const eq$2 = eq_1;
|
|
1817
1820
|
|
|
1818
1821
|
const diff$1 = (version1, version2) => {
|
|
1819
|
-
|
|
1822
|
+
const v1 = parse$3(version1, null, true);
|
|
1823
|
+
const v2 = parse$3(version2, null, true);
|
|
1824
|
+
const comparison = v1.compare(v2);
|
|
1825
|
+
|
|
1826
|
+
if (comparison === 0) {
|
|
1820
1827
|
return null
|
|
1821
|
-
} else {
|
|
1822
|
-
const v1 = parse$3(version1);
|
|
1823
|
-
const v2 = parse$3(version2);
|
|
1824
|
-
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
1825
|
-
const prefix = hasPre ? 'pre' : '';
|
|
1826
|
-
const defaultResult = hasPre ? 'prerelease' : '';
|
|
1827
|
-
for (const key in v1) {
|
|
1828
|
-
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
1829
|
-
if (v1[key] !== v2[key]) {
|
|
1830
|
-
return prefix + key
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
return defaultResult // may be undefined
|
|
1835
1828
|
}
|
|
1829
|
+
|
|
1830
|
+
const v1Higher = comparison > 0;
|
|
1831
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
1832
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
1833
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
1834
|
+
|
|
1835
|
+
// add the `pre` prefix if we are going to a prerelease version
|
|
1836
|
+
const prefix = highHasPre ? 'pre' : '';
|
|
1837
|
+
|
|
1838
|
+
if (v1.major !== v2.major) {
|
|
1839
|
+
return prefix + 'major'
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
if (v1.minor !== v2.minor) {
|
|
1843
|
+
return prefix + 'minor'
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
if (v1.patch !== v2.patch) {
|
|
1847
|
+
return prefix + 'patch'
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
// at this point we know stable versions match but overall versions are not equal,
|
|
1851
|
+
// so either they are both prereleases, or the lower version is a prerelease
|
|
1852
|
+
|
|
1853
|
+
if (highHasPre) {
|
|
1854
|
+
// high and low are preleases
|
|
1855
|
+
return 'prerelease'
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
if (lowVersion.patch) {
|
|
1859
|
+
// anything higher than a patch bump would result in the wrong version
|
|
1860
|
+
return 'patch'
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
if (lowVersion.minor) {
|
|
1864
|
+
// anything higher than a minor bump would result in the wrong version
|
|
1865
|
+
return 'minor'
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
// bumping major/minor/patch all have same result
|
|
1869
|
+
return 'major'
|
|
1836
1870
|
};
|
|
1871
|
+
|
|
1837
1872
|
var diff_1 = diff$1;
|
|
1838
1873
|
|
|
1839
|
-
const SemVer$
|
|
1840
|
-
const major$1 = (a, loose) => new SemVer$
|
|
1874
|
+
const SemVer$a = semver$4;
|
|
1875
|
+
const major$1 = (a, loose) => new SemVer$a(a, loose).major;
|
|
1841
1876
|
var major_1 = major$1;
|
|
1842
1877
|
|
|
1843
|
-
const SemVer$
|
|
1844
|
-
const minor$1 = (a, loose) => new SemVer$
|
|
1878
|
+
const SemVer$9 = semver$4;
|
|
1879
|
+
const minor$1 = (a, loose) => new SemVer$9(a, loose).minor;
|
|
1845
1880
|
var minor_1 = minor$1;
|
|
1846
1881
|
|
|
1847
|
-
const SemVer$
|
|
1848
|
-
const patch$1 = (a, loose) => new SemVer$
|
|
1882
|
+
const SemVer$8 = semver$4;
|
|
1883
|
+
const patch$1 = (a, loose) => new SemVer$8(a, loose).patch;
|
|
1849
1884
|
var patch_1 = patch$1;
|
|
1850
1885
|
|
|
1851
1886
|
const parse$2 = parse_1;
|
|
@@ -1855,12 +1890,18 @@ const prerelease$1 = (version, options) => {
|
|
|
1855
1890
|
};
|
|
1856
1891
|
var prerelease_1 = prerelease$1;
|
|
1857
1892
|
|
|
1858
|
-
const
|
|
1859
|
-
const
|
|
1893
|
+
const SemVer$7 = semver$4;
|
|
1894
|
+
const compare$b = (a, b, loose) =>
|
|
1895
|
+
new SemVer$7(a, loose).compare(new SemVer$7(b, loose));
|
|
1896
|
+
|
|
1897
|
+
var compare_1 = compare$b;
|
|
1898
|
+
|
|
1899
|
+
const compare$a = compare_1;
|
|
1900
|
+
const rcompare$1 = (a, b, loose) => compare$a(b, a, loose);
|
|
1860
1901
|
var rcompare_1 = rcompare$1;
|
|
1861
1902
|
|
|
1862
|
-
const compare$
|
|
1863
|
-
const compareLoose$1 = (a, b) => compare$
|
|
1903
|
+
const compare$9 = compare_1;
|
|
1904
|
+
const compareLoose$1 = (a, b) => compare$9(a, b, true);
|
|
1864
1905
|
var compareLoose_1 = compareLoose$1;
|
|
1865
1906
|
|
|
1866
1907
|
const SemVer$6 = semver$4;
|
|
@@ -1879,14 +1920,18 @@ const compareBuild$1 = compareBuild_1;
|
|
|
1879
1920
|
const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose));
|
|
1880
1921
|
var rsort_1 = rsort$1;
|
|
1881
1922
|
|
|
1882
|
-
const compare$
|
|
1883
|
-
const gt$4 = (a, b, loose) => compare$
|
|
1923
|
+
const compare$8 = compare_1;
|
|
1924
|
+
const gt$4 = (a, b, loose) => compare$8(a, b, loose) > 0;
|
|
1884
1925
|
var gt_1 = gt$4;
|
|
1885
1926
|
|
|
1886
|
-
const compare$
|
|
1887
|
-
const lt$3 = (a, b, loose) => compare$
|
|
1927
|
+
const compare$7 = compare_1;
|
|
1928
|
+
const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
|
|
1888
1929
|
var lt_1 = lt$3;
|
|
1889
1930
|
|
|
1931
|
+
const compare$6 = compare_1;
|
|
1932
|
+
const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
|
|
1933
|
+
var eq_1 = eq$2;
|
|
1934
|
+
|
|
1890
1935
|
const compare$5 = compare_1;
|
|
1891
1936
|
const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
|
|
1892
1937
|
var neq_1 = neq$2;
|
|
@@ -1954,7 +1999,7 @@ var cmp_1 = cmp$1;
|
|
|
1954
1999
|
|
|
1955
2000
|
const SemVer$5 = semver$4;
|
|
1956
2001
|
const parse$1 = parse_1;
|
|
1957
|
-
const { re, t } = re$
|
|
2002
|
+
const { re, t } = re$2.exports;
|
|
1958
2003
|
|
|
1959
2004
|
const coerce$1 = (version, options) => {
|
|
1960
2005
|
if (version instanceof SemVer$5) {
|
|
@@ -2886,8 +2931,10 @@ function requireRange () {
|
|
|
2886
2931
|
|
|
2887
2932
|
// memoize range parsing for performance.
|
|
2888
2933
|
// this is a very hot path, and fully deterministic.
|
|
2889
|
-
const memoOpts =
|
|
2890
|
-
|
|
2934
|
+
const memoOpts =
|
|
2935
|
+
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
|
|
2936
|
+
(this.options.loose && FLAG_LOOSE);
|
|
2937
|
+
const memoKey = memoOpts + ':' + range;
|
|
2891
2938
|
const cached = cache.get(memoKey);
|
|
2892
2939
|
if (cached) {
|
|
2893
2940
|
return cached
|
|
@@ -2995,6 +3042,7 @@ function requireRange () {
|
|
|
2995
3042
|
return false
|
|
2996
3043
|
}
|
|
2997
3044
|
}
|
|
3045
|
+
|
|
2998
3046
|
range = Range;
|
|
2999
3047
|
|
|
3000
3048
|
const LRU = requireLruCache();
|
|
@@ -3010,7 +3058,8 @@ function requireRange () {
|
|
|
3010
3058
|
comparatorTrimReplace,
|
|
3011
3059
|
tildeTrimReplace,
|
|
3012
3060
|
caretTrimReplace,
|
|
3013
|
-
} = re$
|
|
3061
|
+
} = re$2.exports;
|
|
3062
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = constants$1;
|
|
3014
3063
|
|
|
3015
3064
|
const isNullSet = c => c.value === '<0.0.0-0';
|
|
3016
3065
|
const isAny = c => c.value === '';
|
|
@@ -3414,13 +3463,6 @@ function requireComparator () {
|
|
|
3414
3463
|
throw new TypeError('a Comparator is required')
|
|
3415
3464
|
}
|
|
3416
3465
|
|
|
3417
|
-
if (!options || typeof options !== 'object') {
|
|
3418
|
-
options = {
|
|
3419
|
-
loose: !!options,
|
|
3420
|
-
includePrerelease: false,
|
|
3421
|
-
};
|
|
3422
|
-
}
|
|
3423
|
-
|
|
3424
3466
|
if (this.operator === '') {
|
|
3425
3467
|
if (this.value === '') {
|
|
3426
3468
|
return true
|
|
@@ -3433,39 +3475,50 @@ function requireComparator () {
|
|
|
3433
3475
|
return new Range(this.value, options).test(comp.semver)
|
|
3434
3476
|
}
|
|
3435
3477
|
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
(this.
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
(this.
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
(
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3478
|
+
options = parseOptions(options);
|
|
3479
|
+
|
|
3480
|
+
// Special cases where nothing can possibly be lower
|
|
3481
|
+
if (options.includePrerelease &&
|
|
3482
|
+
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
|
3483
|
+
return false
|
|
3484
|
+
}
|
|
3485
|
+
if (!options.includePrerelease &&
|
|
3486
|
+
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
|
3487
|
+
return false
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
// Same direction increasing (> or >=)
|
|
3491
|
+
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
|
|
3492
|
+
return true
|
|
3493
|
+
}
|
|
3494
|
+
// Same direction decreasing (< or <=)
|
|
3495
|
+
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
|
|
3496
|
+
return true
|
|
3497
|
+
}
|
|
3498
|
+
// same SemVer and both sides are inclusive (<= or >=)
|
|
3499
|
+
if (
|
|
3500
|
+
(this.semver.version === comp.semver.version) &&
|
|
3501
|
+
this.operator.includes('=') && comp.operator.includes('=')) {
|
|
3502
|
+
return true
|
|
3503
|
+
}
|
|
3504
|
+
// opposite directions less than
|
|
3505
|
+
if (cmp(this.semver, '<', comp.semver, options) &&
|
|
3506
|
+
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
|
3507
|
+
return true
|
|
3508
|
+
}
|
|
3509
|
+
// opposite directions greater than
|
|
3510
|
+
if (cmp(this.semver, '>', comp.semver, options) &&
|
|
3511
|
+
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
|
3512
|
+
return true
|
|
3513
|
+
}
|
|
3514
|
+
return false
|
|
3462
3515
|
}
|
|
3463
3516
|
}
|
|
3464
3517
|
|
|
3465
3518
|
comparator = Comparator;
|
|
3466
3519
|
|
|
3467
3520
|
const parseOptions = parseOptions_1;
|
|
3468
|
-
const { re, t } = re$
|
|
3521
|
+
const { re, t } = re$2.exports;
|
|
3469
3522
|
const cmp = cmp_1;
|
|
3470
3523
|
const debug = debug_1$1;
|
|
3471
3524
|
const SemVer = semver$4;
|
|
@@ -3713,7 +3766,7 @@ const Range$2 = requireRange();
|
|
|
3713
3766
|
const intersects$1 = (r1, r2, options) => {
|
|
3714
3767
|
r1 = new Range$2(r1, options);
|
|
3715
3768
|
r2 = new Range$2(r2, options);
|
|
3716
|
-
return r1.intersects(r2)
|
|
3769
|
+
return r1.intersects(r2, options)
|
|
3717
3770
|
};
|
|
3718
3771
|
var intersects_1 = intersects$1;
|
|
3719
3772
|
|
|
@@ -3835,6 +3888,9 @@ const subset$1 = (sub, dom, options = {}) => {
|
|
|
3835
3888
|
return true
|
|
3836
3889
|
};
|
|
3837
3890
|
|
|
3891
|
+
const minimumVersionWithPreRelease = [new Comparator$1('>=0.0.0-0')];
|
|
3892
|
+
const minimumVersion = [new Comparator$1('>=0.0.0')];
|
|
3893
|
+
|
|
3838
3894
|
const simpleSubset = (sub, dom, options) => {
|
|
3839
3895
|
if (sub === dom) {
|
|
3840
3896
|
return true
|
|
@@ -3844,9 +3900,9 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
3844
3900
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
3845
3901
|
return true
|
|
3846
3902
|
} else if (options.includePrerelease) {
|
|
3847
|
-
sub =
|
|
3903
|
+
sub = minimumVersionWithPreRelease;
|
|
3848
3904
|
} else {
|
|
3849
|
-
sub =
|
|
3905
|
+
sub = minimumVersion;
|
|
3850
3906
|
}
|
|
3851
3907
|
}
|
|
3852
3908
|
|
|
@@ -3854,7 +3910,7 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
3854
3910
|
if (options.includePrerelease) {
|
|
3855
3911
|
return true
|
|
3856
3912
|
} else {
|
|
3857
|
-
dom =
|
|
3913
|
+
dom = minimumVersion;
|
|
3858
3914
|
}
|
|
3859
3915
|
}
|
|
3860
3916
|
|
|
@@ -4011,7 +4067,7 @@ const lowerLT = (a, b, options) => {
|
|
|
4011
4067
|
var subset_1 = subset$1;
|
|
4012
4068
|
|
|
4013
4069
|
// just pre-load all the stuff that index.js lazily exports
|
|
4014
|
-
const internalRe = re$
|
|
4070
|
+
const internalRe = re$2.exports;
|
|
4015
4071
|
const constants = constants$1;
|
|
4016
4072
|
const SemVer = semver$4;
|
|
4017
4073
|
const identifiers = identifiers$1;
|
|
@@ -4095,6 +4151,7 @@ var semver$3 = {
|
|
|
4095
4151
|
src: internalRe.src,
|
|
4096
4152
|
tokens: internalRe.t,
|
|
4097
4153
|
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
4154
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
4098
4155
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
4099
4156
|
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
|
4100
4157
|
};
|
|
@@ -22620,7 +22677,7 @@ AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
|
22620
22677
|
};
|
|
22621
22678
|
|
|
22622
22679
|
var Stream$2 = stream.Stream;
|
|
22623
|
-
var util$2 = require$$
|
|
22680
|
+
var util$2 = require$$5;
|
|
22624
22681
|
|
|
22625
22682
|
var delayed_stream = DelayedStream$1;
|
|
22626
22683
|
function DelayedStream$1() {
|
|
@@ -22727,7 +22784,7 @@ DelayedStream$1.prototype._checkIfMaxDataSizeExceeded = function() {
|
|
|
22727
22784
|
this.emit('error', new Error(message));
|
|
22728
22785
|
};
|
|
22729
22786
|
|
|
22730
|
-
var util$1 = require$$
|
|
22787
|
+
var util$1 = require$$5;
|
|
22731
22788
|
var Stream$1 = stream.Stream;
|
|
22732
22789
|
var DelayedStream = delayed_stream;
|
|
22733
22790
|
|
|
@@ -33673,7 +33730,7 @@ var require$$0 = {
|
|
|
33673
33730
|
*/
|
|
33674
33731
|
|
|
33675
33732
|
var db = mimeDb.exports;
|
|
33676
|
-
var extname = require$$1
|
|
33733
|
+
var extname = require$$1.extname;
|
|
33677
33734
|
|
|
33678
33735
|
/**
|
|
33679
33736
|
* Module variables.
|
|
@@ -34243,8 +34300,8 @@ var populate$1 = function(dst, src) {
|
|
|
34243
34300
|
};
|
|
34244
34301
|
|
|
34245
34302
|
var CombinedStream = combined_stream;
|
|
34246
|
-
var util = require$$
|
|
34247
|
-
var path = require$$1
|
|
34303
|
+
var util = require$$5;
|
|
34304
|
+
var path = require$$1;
|
|
34248
34305
|
var http$1 = require$$3;
|
|
34249
34306
|
var https$1 = require$$4;
|
|
34250
34307
|
var parseUrl$1 = require$$0$2.parse;
|
|
@@ -35444,177 +35501,6 @@ var src = {exports: {}};
|
|
|
35444
35501
|
|
|
35445
35502
|
var browser = {exports: {}};
|
|
35446
35503
|
|
|
35447
|
-
/**
|
|
35448
|
-
* Helpers.
|
|
35449
|
-
*/
|
|
35450
|
-
|
|
35451
|
-
var ms;
|
|
35452
|
-
var hasRequiredMs;
|
|
35453
|
-
|
|
35454
|
-
function requireMs () {
|
|
35455
|
-
if (hasRequiredMs) return ms;
|
|
35456
|
-
hasRequiredMs = 1;
|
|
35457
|
-
var s = 1000;
|
|
35458
|
-
var m = s * 60;
|
|
35459
|
-
var h = m * 60;
|
|
35460
|
-
var d = h * 24;
|
|
35461
|
-
var w = d * 7;
|
|
35462
|
-
var y = d * 365.25;
|
|
35463
|
-
|
|
35464
|
-
/**
|
|
35465
|
-
* Parse or format the given `val`.
|
|
35466
|
-
*
|
|
35467
|
-
* Options:
|
|
35468
|
-
*
|
|
35469
|
-
* - `long` verbose formatting [false]
|
|
35470
|
-
*
|
|
35471
|
-
* @param {String|Number} val
|
|
35472
|
-
* @param {Object} [options]
|
|
35473
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
35474
|
-
* @return {String|Number}
|
|
35475
|
-
* @api public
|
|
35476
|
-
*/
|
|
35477
|
-
|
|
35478
|
-
ms = function(val, options) {
|
|
35479
|
-
options = options || {};
|
|
35480
|
-
var type = typeof val;
|
|
35481
|
-
if (type === 'string' && val.length > 0) {
|
|
35482
|
-
return parse(val);
|
|
35483
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
35484
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
35485
|
-
}
|
|
35486
|
-
throw new Error(
|
|
35487
|
-
'val is not a non-empty string or a valid number. val=' +
|
|
35488
|
-
JSON.stringify(val)
|
|
35489
|
-
);
|
|
35490
|
-
};
|
|
35491
|
-
|
|
35492
|
-
/**
|
|
35493
|
-
* Parse the given `str` and return milliseconds.
|
|
35494
|
-
*
|
|
35495
|
-
* @param {String} str
|
|
35496
|
-
* @return {Number}
|
|
35497
|
-
* @api private
|
|
35498
|
-
*/
|
|
35499
|
-
|
|
35500
|
-
function parse(str) {
|
|
35501
|
-
str = String(str);
|
|
35502
|
-
if (str.length > 100) {
|
|
35503
|
-
return;
|
|
35504
|
-
}
|
|
35505
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
35506
|
-
str
|
|
35507
|
-
);
|
|
35508
|
-
if (!match) {
|
|
35509
|
-
return;
|
|
35510
|
-
}
|
|
35511
|
-
var n = parseFloat(match[1]);
|
|
35512
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
35513
|
-
switch (type) {
|
|
35514
|
-
case 'years':
|
|
35515
|
-
case 'year':
|
|
35516
|
-
case 'yrs':
|
|
35517
|
-
case 'yr':
|
|
35518
|
-
case 'y':
|
|
35519
|
-
return n * y;
|
|
35520
|
-
case 'weeks':
|
|
35521
|
-
case 'week':
|
|
35522
|
-
case 'w':
|
|
35523
|
-
return n * w;
|
|
35524
|
-
case 'days':
|
|
35525
|
-
case 'day':
|
|
35526
|
-
case 'd':
|
|
35527
|
-
return n * d;
|
|
35528
|
-
case 'hours':
|
|
35529
|
-
case 'hour':
|
|
35530
|
-
case 'hrs':
|
|
35531
|
-
case 'hr':
|
|
35532
|
-
case 'h':
|
|
35533
|
-
return n * h;
|
|
35534
|
-
case 'minutes':
|
|
35535
|
-
case 'minute':
|
|
35536
|
-
case 'mins':
|
|
35537
|
-
case 'min':
|
|
35538
|
-
case 'm':
|
|
35539
|
-
return n * m;
|
|
35540
|
-
case 'seconds':
|
|
35541
|
-
case 'second':
|
|
35542
|
-
case 'secs':
|
|
35543
|
-
case 'sec':
|
|
35544
|
-
case 's':
|
|
35545
|
-
return n * s;
|
|
35546
|
-
case 'milliseconds':
|
|
35547
|
-
case 'millisecond':
|
|
35548
|
-
case 'msecs':
|
|
35549
|
-
case 'msec':
|
|
35550
|
-
case 'ms':
|
|
35551
|
-
return n;
|
|
35552
|
-
default:
|
|
35553
|
-
return undefined;
|
|
35554
|
-
}
|
|
35555
|
-
}
|
|
35556
|
-
|
|
35557
|
-
/**
|
|
35558
|
-
* Short format for `ms`.
|
|
35559
|
-
*
|
|
35560
|
-
* @param {Number} ms
|
|
35561
|
-
* @return {String}
|
|
35562
|
-
* @api private
|
|
35563
|
-
*/
|
|
35564
|
-
|
|
35565
|
-
function fmtShort(ms) {
|
|
35566
|
-
var msAbs = Math.abs(ms);
|
|
35567
|
-
if (msAbs >= d) {
|
|
35568
|
-
return Math.round(ms / d) + 'd';
|
|
35569
|
-
}
|
|
35570
|
-
if (msAbs >= h) {
|
|
35571
|
-
return Math.round(ms / h) + 'h';
|
|
35572
|
-
}
|
|
35573
|
-
if (msAbs >= m) {
|
|
35574
|
-
return Math.round(ms / m) + 'm';
|
|
35575
|
-
}
|
|
35576
|
-
if (msAbs >= s) {
|
|
35577
|
-
return Math.round(ms / s) + 's';
|
|
35578
|
-
}
|
|
35579
|
-
return ms + 'ms';
|
|
35580
|
-
}
|
|
35581
|
-
|
|
35582
|
-
/**
|
|
35583
|
-
* Long format for `ms`.
|
|
35584
|
-
*
|
|
35585
|
-
* @param {Number} ms
|
|
35586
|
-
* @return {String}
|
|
35587
|
-
* @api private
|
|
35588
|
-
*/
|
|
35589
|
-
|
|
35590
|
-
function fmtLong(ms) {
|
|
35591
|
-
var msAbs = Math.abs(ms);
|
|
35592
|
-
if (msAbs >= d) {
|
|
35593
|
-
return plural(ms, msAbs, d, 'day');
|
|
35594
|
-
}
|
|
35595
|
-
if (msAbs >= h) {
|
|
35596
|
-
return plural(ms, msAbs, h, 'hour');
|
|
35597
|
-
}
|
|
35598
|
-
if (msAbs >= m) {
|
|
35599
|
-
return plural(ms, msAbs, m, 'minute');
|
|
35600
|
-
}
|
|
35601
|
-
if (msAbs >= s) {
|
|
35602
|
-
return plural(ms, msAbs, s, 'second');
|
|
35603
|
-
}
|
|
35604
|
-
return ms + ' ms';
|
|
35605
|
-
}
|
|
35606
|
-
|
|
35607
|
-
/**
|
|
35608
|
-
* Pluralization helper.
|
|
35609
|
-
*/
|
|
35610
|
-
|
|
35611
|
-
function plural(ms, msAbs, n, name) {
|
|
35612
|
-
var isPlural = msAbs >= n * 1.5;
|
|
35613
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
35614
|
-
}
|
|
35615
|
-
return ms;
|
|
35616
|
-
}
|
|
35617
|
-
|
|
35618
35504
|
var common;
|
|
35619
35505
|
var hasRequiredCommon;
|
|
35620
35506
|
|
|
@@ -35633,7 +35519,7 @@ function requireCommon () {
|
|
|
35633
35519
|
createDebug.disable = disable;
|
|
35634
35520
|
createDebug.enable = enable;
|
|
35635
35521
|
createDebug.enabled = enabled;
|
|
35636
|
-
createDebug.humanize =
|
|
35522
|
+
createDebug.humanize = ms$1;
|
|
35637
35523
|
createDebug.destroy = destroy;
|
|
35638
35524
|
|
|
35639
35525
|
Object.keys(env).forEach(key => {
|
|
@@ -36201,7 +36087,7 @@ function requireSupportsColor () {
|
|
|
36201
36087
|
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
36202
36088
|
hasRequiredSupportsColor = 1;
|
|
36203
36089
|
const os = require$$0$3;
|
|
36204
|
-
const tty = require$$1$
|
|
36090
|
+
const tty = require$$1$1;
|
|
36205
36091
|
const hasFlag = requireHasFlag();
|
|
36206
36092
|
|
|
36207
36093
|
const {env} = process;
|
|
@@ -36347,8 +36233,8 @@ function requireNode () {
|
|
|
36347
36233
|
if (hasRequiredNode) return node.exports;
|
|
36348
36234
|
hasRequiredNode = 1;
|
|
36349
36235
|
(function (module, exports) {
|
|
36350
|
-
const tty = require$$1$
|
|
36351
|
-
const util = require$$
|
|
36236
|
+
const tty = require$$1$1;
|
|
36237
|
+
const util = require$$5;
|
|
36352
36238
|
|
|
36353
36239
|
/**
|
|
36354
36240
|
* This is the Node.js implementation of `debug()`.
|
|
@@ -39749,7 +39635,7 @@ const {
|
|
|
39749
39635
|
*/
|
|
39750
39636
|
class SDKController {
|
|
39751
39637
|
constructor(topia, credentials = {}) {
|
|
39752
|
-
const {
|
|
39638
|
+
const { apiKey = null, assetId = null, interactiveNonce = null, profileId = null, visitorId = null } = credentials;
|
|
39753
39639
|
this.topia = topia;
|
|
39754
39640
|
this.credentials = credentials;
|
|
39755
39641
|
this.requestOptions = {};
|
|
@@ -39841,7 +39727,7 @@ class Asset extends SDKController {
|
|
|
39841
39727
|
}
|
|
39842
39728
|
}
|
|
39843
39729
|
|
|
39844
|
-
var
|
|
39730
|
+
var _DroppedAsset_updateDroppedAsset;
|
|
39845
39731
|
/**
|
|
39846
39732
|
* @summary
|
|
39847
39733
|
* Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.
|
|
@@ -39856,38 +39742,6 @@ class DroppedAsset extends Asset {
|
|
|
39856
39742
|
var _a;
|
|
39857
39743
|
super(topia, id, options);
|
|
39858
39744
|
// private methods
|
|
39859
|
-
_DroppedAsset_fetchDroppedAssetDataObject.set(this, () => __awaiter(this, void 0, void 0, function* () {
|
|
39860
|
-
try {
|
|
39861
|
-
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object`, this.requestOptions);
|
|
39862
|
-
this.dataObject = response.data;
|
|
39863
|
-
return response.data;
|
|
39864
|
-
}
|
|
39865
|
-
catch (error) {
|
|
39866
|
-
throw this.errorHandler({ error });
|
|
39867
|
-
}
|
|
39868
|
-
}));
|
|
39869
|
-
_DroppedAsset_setDroppedAssetDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
39870
|
-
try {
|
|
39871
|
-
const { lock = {} } = options;
|
|
39872
|
-
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { dataObject, lock }, this.requestOptions);
|
|
39873
|
-
this.dataObject = dataObject;
|
|
39874
|
-
return response.data;
|
|
39875
|
-
}
|
|
39876
|
-
catch (error) {
|
|
39877
|
-
throw this.errorHandler({ error });
|
|
39878
|
-
}
|
|
39879
|
-
}));
|
|
39880
|
-
_DroppedAsset_updateDroppedAssetDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
39881
|
-
try {
|
|
39882
|
-
const { lock = {} } = options;
|
|
39883
|
-
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { dataObject, lock }, this.requestOptions);
|
|
39884
|
-
this.dataObject = response.data;
|
|
39885
|
-
return response.data;
|
|
39886
|
-
}
|
|
39887
|
-
catch (error) {
|
|
39888
|
-
throw this.errorHandler({ error });
|
|
39889
|
-
}
|
|
39890
|
-
}));
|
|
39891
39745
|
_DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
|
|
39892
39746
|
try {
|
|
39893
39747
|
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/${updateType}`, Object.assign({}, payload), this.requestOptions);
|
|
@@ -39949,13 +39803,19 @@ class DroppedAsset extends Asset {
|
|
|
39949
39803
|
*
|
|
39950
39804
|
* @usage
|
|
39951
39805
|
* ```ts
|
|
39952
|
-
* await droppedAsset.fetchDataObject();
|
|
39953
|
-
* const { dataObject } = droppedAsset;
|
|
39806
|
+
* const dataObject = await droppedAsset.fetchDataObject();
|
|
39954
39807
|
* ```
|
|
39955
39808
|
*/
|
|
39956
39809
|
fetchDataObject() {
|
|
39957
39810
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39958
|
-
|
|
39811
|
+
try {
|
|
39812
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object`, this.requestOptions);
|
|
39813
|
+
this.dataObject = response.data;
|
|
39814
|
+
return response.data;
|
|
39815
|
+
}
|
|
39816
|
+
catch (error) {
|
|
39817
|
+
throw this.errorHandler({ error });
|
|
39818
|
+
}
|
|
39959
39819
|
});
|
|
39960
39820
|
}
|
|
39961
39821
|
/**
|
|
@@ -39969,12 +39829,18 @@ class DroppedAsset extends Asset {
|
|
|
39969
39829
|
* await droppedAsset.setDataObject({
|
|
39970
39830
|
* "exampleKey": "exampleValue",
|
|
39971
39831
|
* });
|
|
39972
|
-
* const { dataObject } = droppedAsset;
|
|
39973
39832
|
* ```
|
|
39974
39833
|
*/
|
|
39975
39834
|
setDataObject(dataObject, options = {}) {
|
|
39976
39835
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39977
|
-
|
|
39836
|
+
try {
|
|
39837
|
+
const { lock = {} } = options;
|
|
39838
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39839
|
+
this.dataObject = dataObject || this.dataObject;
|
|
39840
|
+
}
|
|
39841
|
+
catch (error) {
|
|
39842
|
+
throw this.errorHandler({ error });
|
|
39843
|
+
}
|
|
39978
39844
|
});
|
|
39979
39845
|
}
|
|
39980
39846
|
/**
|
|
@@ -39988,13 +39854,44 @@ class DroppedAsset extends Asset {
|
|
|
39988
39854
|
* await droppedAsset.updateDataObject({
|
|
39989
39855
|
* "exampleKey": "exampleValue",
|
|
39990
39856
|
* });
|
|
39991
|
-
* const { dataObject } = droppedAsset;
|
|
39992
39857
|
* ```
|
|
39993
39858
|
*/
|
|
39994
39859
|
// get dropped asset
|
|
39995
|
-
|
|
39860
|
+
updateDataObject(dataObject, options = {}) {
|
|
39861
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39862
|
+
try {
|
|
39863
|
+
const { lock = {} } = options;
|
|
39864
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39865
|
+
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
39866
|
+
}
|
|
39867
|
+
catch (error) {
|
|
39868
|
+
throw this.errorHandler({ error });
|
|
39869
|
+
}
|
|
39870
|
+
});
|
|
39871
|
+
}
|
|
39872
|
+
/**
|
|
39873
|
+
* @summary
|
|
39874
|
+
* Increments a specific value in the data object for a dropped asset by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
39875
|
+
*
|
|
39876
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
39877
|
+
*
|
|
39878
|
+
* @usage
|
|
39879
|
+
* ```ts
|
|
39880
|
+
* await droppedAsset.incrementDataObjectValue(
|
|
39881
|
+
* "path": "key",
|
|
39882
|
+
* "amount": 1,
|
|
39883
|
+
* );
|
|
39884
|
+
* ```
|
|
39885
|
+
*/
|
|
39886
|
+
incrementDataObjectValue(path, amount, options = {}) {
|
|
39996
39887
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39997
|
-
|
|
39888
|
+
try {
|
|
39889
|
+
const { lock = {} } = options;
|
|
39890
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
39891
|
+
}
|
|
39892
|
+
catch (error) {
|
|
39893
|
+
throw this.errorHandler({ error });
|
|
39894
|
+
}
|
|
39998
39895
|
});
|
|
39999
39896
|
}
|
|
40000
39897
|
// update dropped assets
|
|
@@ -40299,7 +40196,7 @@ class DroppedAsset extends Asset {
|
|
|
40299
40196
|
});
|
|
40300
40197
|
}
|
|
40301
40198
|
}
|
|
40302
|
-
|
|
40199
|
+
_DroppedAsset_updateDroppedAsset = new WeakMap();
|
|
40303
40200
|
|
|
40304
40201
|
/**
|
|
40305
40202
|
* @summary
|
|
@@ -40370,6 +40267,74 @@ class World extends SDKController {
|
|
|
40370
40267
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40371
40268
|
super(topia, options.credentials);
|
|
40372
40269
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40270
|
+
/**
|
|
40271
|
+
* @summary
|
|
40272
|
+
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
40273
|
+
*
|
|
40274
|
+
* @usage
|
|
40275
|
+
* ```ts
|
|
40276
|
+
* await world.fetchDataObject();
|
|
40277
|
+
* const { dataObject } = world;
|
|
40278
|
+
* ```
|
|
40279
|
+
*/
|
|
40280
|
+
this.fetchDataObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
40281
|
+
try {
|
|
40282
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/get-data-object`, this.requestOptions);
|
|
40283
|
+
this.dataObject = response.data;
|
|
40284
|
+
return response.data;
|
|
40285
|
+
}
|
|
40286
|
+
catch (error) {
|
|
40287
|
+
throw this.errorHandler({ error });
|
|
40288
|
+
}
|
|
40289
|
+
});
|
|
40290
|
+
/**
|
|
40291
|
+
* @summary
|
|
40292
|
+
* Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
|
|
40293
|
+
*
|
|
40294
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
40295
|
+
*
|
|
40296
|
+
* @usage
|
|
40297
|
+
* ```ts
|
|
40298
|
+
* await world.setDataObject({
|
|
40299
|
+
* "exampleKey": "exampleValue",
|
|
40300
|
+
* });
|
|
40301
|
+
* const { dataObject } = world;
|
|
40302
|
+
* ```
|
|
40303
|
+
*/
|
|
40304
|
+
this.setDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40305
|
+
try {
|
|
40306
|
+
const { lock = {} } = options;
|
|
40307
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40308
|
+
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40309
|
+
}
|
|
40310
|
+
catch (error) {
|
|
40311
|
+
throw this.errorHandler({ error });
|
|
40312
|
+
}
|
|
40313
|
+
});
|
|
40314
|
+
/**
|
|
40315
|
+
* @summary
|
|
40316
|
+
* Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
40317
|
+
*
|
|
40318
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
40319
|
+
*
|
|
40320
|
+
* @usage
|
|
40321
|
+
* ```ts
|
|
40322
|
+
* await world.updateDataObject({
|
|
40323
|
+
* "exampleKey": "exampleValue",
|
|
40324
|
+
* });
|
|
40325
|
+
* const { dataObject } = world;
|
|
40326
|
+
* ```
|
|
40327
|
+
*/
|
|
40328
|
+
this.updateDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40329
|
+
try {
|
|
40330
|
+
const { lock = {} } = options;
|
|
40331
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40332
|
+
this.dataObject = dataObject || this.dataObject;
|
|
40333
|
+
}
|
|
40334
|
+
catch (error) {
|
|
40335
|
+
throw this.errorHandler({ error });
|
|
40336
|
+
}
|
|
40337
|
+
});
|
|
40373
40338
|
Object.assign(this, options.attributes);
|
|
40374
40339
|
this.urlSlug = urlSlug;
|
|
40375
40340
|
__classPrivateFieldSet(this, _World_droppedAssetsMap, {}, "f");
|
|
@@ -40584,10 +40549,35 @@ class World extends SDKController {
|
|
|
40584
40549
|
}
|
|
40585
40550
|
});
|
|
40586
40551
|
}
|
|
40552
|
+
/**
|
|
40553
|
+
* @summary
|
|
40554
|
+
* Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
40555
|
+
*
|
|
40556
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
40557
|
+
*
|
|
40558
|
+
* @usage
|
|
40559
|
+
* ```ts
|
|
40560
|
+
* await world.incrementDataObjectValue(
|
|
40561
|
+
* "path": "key",
|
|
40562
|
+
* "amount": 1,
|
|
40563
|
+
* );
|
|
40564
|
+
* ```
|
|
40565
|
+
*/
|
|
40566
|
+
incrementDataObjectValue(path, amount, options = {}) {
|
|
40567
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40568
|
+
try {
|
|
40569
|
+
const { lock = {} } = options;
|
|
40570
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
40571
|
+
}
|
|
40572
|
+
catch (error) {
|
|
40573
|
+
throw this.errorHandler({ error });
|
|
40574
|
+
}
|
|
40575
|
+
});
|
|
40576
|
+
}
|
|
40587
40577
|
}
|
|
40588
40578
|
_World_droppedAssetsMap = new WeakMap();
|
|
40589
40579
|
|
|
40590
|
-
var _User_assetsMap, _User_scenesMap, _User_worldsMap
|
|
40580
|
+
var _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
40591
40581
|
/**
|
|
40592
40582
|
* @summary
|
|
40593
40583
|
* Create an instance of User class with optional session credentials.
|
|
@@ -40599,48 +40589,10 @@ var _User_assetsMap, _User_scenesMap, _User_worldsMap, _User_fetchUserDataObject
|
|
|
40599
40589
|
*/
|
|
40600
40590
|
class User extends SDKController {
|
|
40601
40591
|
constructor(topia, options = { profileId: null, credentials: {} }) {
|
|
40602
|
-
super(topia, options.credentials);
|
|
40592
|
+
super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
|
|
40603
40593
|
_User_assetsMap.set(this, void 0);
|
|
40604
40594
|
_User_scenesMap.set(this, void 0);
|
|
40605
40595
|
_User_worldsMap.set(this, void 0);
|
|
40606
|
-
_User_fetchUserDataObject.set(this, () => __awaiter(this, void 0, void 0, function* () {
|
|
40607
|
-
try {
|
|
40608
|
-
if (!this.profileId)
|
|
40609
|
-
throw "This method requires the use of a profileId";
|
|
40610
|
-
const response = yield this.topiaPublicApi().get(`/user/dataObjects/${this.profileId}/get-data-object`, this.requestOptions);
|
|
40611
|
-
this.dataObject = response.data;
|
|
40612
|
-
return response.data;
|
|
40613
|
-
}
|
|
40614
|
-
catch (error) {
|
|
40615
|
-
throw this.errorHandler({ error });
|
|
40616
|
-
}
|
|
40617
|
-
}));
|
|
40618
|
-
_User_setUserDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40619
|
-
try {
|
|
40620
|
-
if (!this.profileId)
|
|
40621
|
-
throw "This method requires the use of a profileId";
|
|
40622
|
-
const { lock = {} } = options;
|
|
40623
|
-
const response = yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { dataObject, lock }, this.requestOptions);
|
|
40624
|
-
this.dataObject = response.data;
|
|
40625
|
-
return response.data;
|
|
40626
|
-
}
|
|
40627
|
-
catch (error) {
|
|
40628
|
-
throw this.errorHandler({ error });
|
|
40629
|
-
}
|
|
40630
|
-
}));
|
|
40631
|
-
_User_updateUserDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40632
|
-
try {
|
|
40633
|
-
if (!this.profileId)
|
|
40634
|
-
throw "This method requires the use of a profileId";
|
|
40635
|
-
const { lock = {} } = options;
|
|
40636
|
-
const response = yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { dataObject, lock }, this.requestOptions);
|
|
40637
|
-
this.dataObject = response.data;
|
|
40638
|
-
return response.data;
|
|
40639
|
-
}
|
|
40640
|
-
catch (error) {
|
|
40641
|
-
throw this.errorHandler({ error });
|
|
40642
|
-
}
|
|
40643
|
-
}));
|
|
40644
40596
|
this.profileId = options.profileId;
|
|
40645
40597
|
this.dataObject = {};
|
|
40646
40598
|
this.profile = {};
|
|
@@ -40745,13 +40697,21 @@ class User extends SDKController {
|
|
|
40745
40697
|
*
|
|
40746
40698
|
* @usage
|
|
40747
40699
|
* ```ts
|
|
40748
|
-
* await
|
|
40749
|
-
* const { dataObject } = droppedAsset;
|
|
40700
|
+
* const dataObject = await user.fetchDataObject();
|
|
40750
40701
|
* ```
|
|
40751
40702
|
*/
|
|
40752
40703
|
fetchDataObject() {
|
|
40753
40704
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40754
|
-
|
|
40705
|
+
try {
|
|
40706
|
+
if (!this.profileId)
|
|
40707
|
+
throw "This method requires the use of a profileId";
|
|
40708
|
+
const response = yield this.topiaPublicApi().get(`/user/dataObjects/${this.profileId}/get-data-object`, this.requestOptions);
|
|
40709
|
+
this.dataObject = response.data;
|
|
40710
|
+
return response.data;
|
|
40711
|
+
}
|
|
40712
|
+
catch (error) {
|
|
40713
|
+
throw this.errorHandler({ error });
|
|
40714
|
+
}
|
|
40755
40715
|
});
|
|
40756
40716
|
}
|
|
40757
40717
|
/**
|
|
@@ -40762,15 +40722,23 @@ class User extends SDKController {
|
|
|
40762
40722
|
*
|
|
40763
40723
|
* @usage
|
|
40764
40724
|
* ```ts
|
|
40765
|
-
* await
|
|
40725
|
+
* await user.setDataObject({
|
|
40766
40726
|
* "exampleKey": "exampleValue",
|
|
40767
40727
|
* });
|
|
40768
|
-
* const { dataObject } = droppedAsset;
|
|
40769
40728
|
* ```
|
|
40770
40729
|
*/
|
|
40771
40730
|
setDataObject(dataObject, options = {}) {
|
|
40772
40731
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40773
|
-
|
|
40732
|
+
try {
|
|
40733
|
+
if (!this.profileId)
|
|
40734
|
+
throw "This method requires the use of a profileId";
|
|
40735
|
+
const { lock = {} } = options;
|
|
40736
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40737
|
+
this.dataObject = dataObject || this.dataObject;
|
|
40738
|
+
}
|
|
40739
|
+
catch (error) {
|
|
40740
|
+
throw this.errorHandler({ error });
|
|
40741
|
+
}
|
|
40774
40742
|
});
|
|
40775
40743
|
}
|
|
40776
40744
|
/**
|
|
@@ -40781,21 +40749,53 @@ class User extends SDKController {
|
|
|
40781
40749
|
*
|
|
40782
40750
|
* @usage
|
|
40783
40751
|
* ```ts
|
|
40784
|
-
* await
|
|
40752
|
+
* await user.updateUserDataObject({
|
|
40785
40753
|
* "exampleKey": "exampleValue",
|
|
40786
40754
|
* });
|
|
40787
|
-
* const { dataObject } = droppedAsset;
|
|
40788
40755
|
* ```
|
|
40789
40756
|
*/
|
|
40790
40757
|
updateDataObject(dataObject, options = {}) {
|
|
40791
40758
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40792
|
-
|
|
40759
|
+
try {
|
|
40760
|
+
if (!this.profileId)
|
|
40761
|
+
throw "This method requires the use of a profileId";
|
|
40762
|
+
const { lock = {} } = options;
|
|
40763
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40764
|
+
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40765
|
+
}
|
|
40766
|
+
catch (error) {
|
|
40767
|
+
throw this.errorHandler({ error });
|
|
40768
|
+
}
|
|
40769
|
+
});
|
|
40770
|
+
}
|
|
40771
|
+
/**
|
|
40772
|
+
* @summary
|
|
40773
|
+
* Increments a specific value in the data object for a user by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
40774
|
+
*
|
|
40775
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
40776
|
+
*
|
|
40777
|
+
* @usage
|
|
40778
|
+
* ```ts
|
|
40779
|
+
* await user.incrementDataObjectValue(
|
|
40780
|
+
* "path": "key",
|
|
40781
|
+
* "amount": 1,
|
|
40782
|
+
* );
|
|
40783
|
+
* ```
|
|
40784
|
+
*/
|
|
40785
|
+
incrementDataObjectValue(path, amount, options = {}) {
|
|
40786
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40787
|
+
try {
|
|
40788
|
+
const { lock = {} } = options;
|
|
40789
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
40790
|
+
}
|
|
40791
|
+
catch (error) {
|
|
40792
|
+
throw this.errorHandler({ error });
|
|
40793
|
+
}
|
|
40793
40794
|
});
|
|
40794
40795
|
}
|
|
40795
40796
|
}
|
|
40796
|
-
_User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap()
|
|
40797
|
+
_User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap();
|
|
40797
40798
|
|
|
40798
|
-
var _Visitor_fetchVisitorDataObject, _Visitor_setVisitorDataObject, _Visitor_updateVisitorDataObject;
|
|
40799
40799
|
/**
|
|
40800
40800
|
* @summary
|
|
40801
40801
|
* Create an instance of Visitor class with a given id and optional attributes and session credentials.
|
|
@@ -40808,38 +40808,6 @@ var _Visitor_fetchVisitorDataObject, _Visitor_setVisitorDataObject, _Visitor_upd
|
|
|
40808
40808
|
class Visitor extends User {
|
|
40809
40809
|
constructor(topia, id, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40810
40810
|
super(topia, { credentials: options.credentials });
|
|
40811
|
-
_Visitor_fetchVisitorDataObject.set(this, () => __awaiter(this, void 0, void 0, function* () {
|
|
40812
|
-
try {
|
|
40813
|
-
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/get-data-object`, this.requestOptions);
|
|
40814
|
-
this.dataObject = response.data;
|
|
40815
|
-
return response.data;
|
|
40816
|
-
}
|
|
40817
|
-
catch (error) {
|
|
40818
|
-
throw this.errorHandler({ error });
|
|
40819
|
-
}
|
|
40820
|
-
}));
|
|
40821
|
-
_Visitor_setVisitorDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40822
|
-
try {
|
|
40823
|
-
const { lock = {} } = options;
|
|
40824
|
-
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40825
|
-
this.dataObject = response.data;
|
|
40826
|
-
return response.data;
|
|
40827
|
-
}
|
|
40828
|
-
catch (error) {
|
|
40829
|
-
throw this.errorHandler({ error });
|
|
40830
|
-
}
|
|
40831
|
-
}));
|
|
40832
|
-
_Visitor_updateVisitorDataObject.set(this, (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40833
|
-
try {
|
|
40834
|
-
const { lock = {} } = options;
|
|
40835
|
-
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40836
|
-
this.dataObject = response.data;
|
|
40837
|
-
return response.data;
|
|
40838
|
-
}
|
|
40839
|
-
catch (error) {
|
|
40840
|
-
throw this.errorHandler({ error });
|
|
40841
|
-
}
|
|
40842
|
-
}));
|
|
40843
40811
|
Object.assign(this, options.attributes);
|
|
40844
40812
|
this.id = id;
|
|
40845
40813
|
this.urlSlug = urlSlug;
|
|
@@ -40970,13 +40938,19 @@ class Visitor extends User {
|
|
|
40970
40938
|
*
|
|
40971
40939
|
* @usage
|
|
40972
40940
|
* ```ts
|
|
40973
|
-
* await
|
|
40974
|
-
* const { dataObject } = droppedAsset;
|
|
40941
|
+
* const dataObject = await visitor.fetchVisitorDataObject();
|
|
40975
40942
|
* ```
|
|
40976
40943
|
*/
|
|
40977
40944
|
fetchDataObject() {
|
|
40978
40945
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40979
|
-
|
|
40946
|
+
try {
|
|
40947
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/get-data-object`, this.requestOptions);
|
|
40948
|
+
this.dataObject = response.data;
|
|
40949
|
+
return response.data;
|
|
40950
|
+
}
|
|
40951
|
+
catch (error) {
|
|
40952
|
+
throw this.errorHandler({ error });
|
|
40953
|
+
}
|
|
40980
40954
|
});
|
|
40981
40955
|
}
|
|
40982
40956
|
/**
|
|
@@ -40987,15 +40961,21 @@ class Visitor extends User {
|
|
|
40987
40961
|
*
|
|
40988
40962
|
* @usage
|
|
40989
40963
|
* ```ts
|
|
40990
|
-
* await
|
|
40964
|
+
* await visitor.setVisitorDataObject({
|
|
40991
40965
|
* "exampleKey": "exampleValue",
|
|
40992
40966
|
* });
|
|
40993
|
-
* const { dataObject } = droppedAsset;
|
|
40994
40967
|
* ```
|
|
40995
40968
|
*/
|
|
40996
40969
|
setDataObject(dataObject, options = {}) {
|
|
40997
40970
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40998
|
-
|
|
40971
|
+
try {
|
|
40972
|
+
const { lock = {} } = options;
|
|
40973
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40974
|
+
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40975
|
+
}
|
|
40976
|
+
catch (error) {
|
|
40977
|
+
throw this.errorHandler({ error });
|
|
40978
|
+
}
|
|
40999
40979
|
});
|
|
41000
40980
|
}
|
|
41001
40981
|
/**
|
|
@@ -41006,19 +40986,49 @@ class Visitor extends User {
|
|
|
41006
40986
|
*
|
|
41007
40987
|
* @usage
|
|
41008
40988
|
* ```ts
|
|
41009
|
-
* await
|
|
40989
|
+
* await visitor.updateVisitorDataObject({
|
|
41010
40990
|
* "exampleKey": "exampleValue",
|
|
41011
40991
|
* });
|
|
41012
|
-
* const { dataObject } = droppedAsset;
|
|
41013
40992
|
* ```
|
|
41014
40993
|
*/
|
|
41015
40994
|
updateDataObject(dataObject, options = {}) {
|
|
41016
40995
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41017
|
-
|
|
40996
|
+
try {
|
|
40997
|
+
const { lock = {} } = options;
|
|
40998
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40999
|
+
this.dataObject = dataObject || this.dataObject;
|
|
41000
|
+
}
|
|
41001
|
+
catch (error) {
|
|
41002
|
+
throw this.errorHandler({ error });
|
|
41003
|
+
}
|
|
41018
41004
|
});
|
|
41019
41005
|
}
|
|
41020
|
-
|
|
41021
|
-
|
|
41006
|
+
/**
|
|
41007
|
+
* @summary
|
|
41008
|
+
* Increments a specific value in the data object for a visitor by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
41009
|
+
*
|
|
41010
|
+
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
41011
|
+
*
|
|
41012
|
+
* @usage
|
|
41013
|
+
* ```ts
|
|
41014
|
+
* await visitor.incrementDataObjectValue(
|
|
41015
|
+
* "path": "key",
|
|
41016
|
+
* "amount": 1,
|
|
41017
|
+
* );
|
|
41018
|
+
* ```
|
|
41019
|
+
*/
|
|
41020
|
+
incrementDataObjectValue(path, amount, options = {}) {
|
|
41021
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41022
|
+
try {
|
|
41023
|
+
const { lock = {} } = options;
|
|
41024
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
41025
|
+
}
|
|
41026
|
+
catch (error) {
|
|
41027
|
+
throw this.errorHandler({ error });
|
|
41028
|
+
}
|
|
41029
|
+
});
|
|
41030
|
+
}
|
|
41031
|
+
}
|
|
41022
41032
|
|
|
41023
41033
|
var _WorldActivity_visitorsMap;
|
|
41024
41034
|
/**
|
|
@@ -41321,4 +41331,4 @@ process.on("uncaughtException", function (err) {
|
|
|
41321
41331
|
process.exit(1);
|
|
41322
41332
|
});
|
|
41323
41333
|
|
|
41324
|
-
export { AssetFactory, DroppedAssetFactory, SceneFactory, Topia, UserFactory, VisitorFactory, WorldActivityFactory, WorldFactory };
|
|
41334
|
+
export { Asset, AssetFactory, DroppedAsset, DroppedAssetFactory, SDKController, Scene, SceneFactory, Topia, User, UserFactory, Visitor, VisitorFactory, World, WorldActivity, WorldActivityFactory, WorldFactory };
|