@rtsdk/topia 0.11.2 → 0.11.4
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 +19 -31
- package/dist/index.d.ts +27 -3
- package/dist/index.js +19 -31
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39863,8 +39863,7 @@ class DroppedAsset extends Asset {
|
|
|
39863
39863
|
setDataObject(dataObject, options = {}) {
|
|
39864
39864
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39865
39865
|
try {
|
|
39866
|
-
|
|
39867
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39866
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
39868
39867
|
this.dataObject = dataObject || this.dataObject;
|
|
39869
39868
|
}
|
|
39870
39869
|
catch (error) {
|
|
@@ -39889,8 +39888,7 @@ class DroppedAsset extends Asset {
|
|
|
39889
39888
|
updateDataObject(dataObject, options = {}) {
|
|
39890
39889
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39891
39890
|
try {
|
|
39892
|
-
|
|
39893
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39891
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
39894
39892
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
39895
39893
|
}
|
|
39896
39894
|
catch (error) {
|
|
@@ -39915,8 +39913,7 @@ class DroppedAsset extends Asset {
|
|
|
39915
39913
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
39916
39914
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39917
39915
|
try {
|
|
39918
|
-
|
|
39919
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
39916
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
39920
39917
|
}
|
|
39921
39918
|
catch (error) {
|
|
39922
39919
|
throw this.errorHandler({
|
|
@@ -40461,8 +40458,7 @@ class World extends SDKController {
|
|
|
40461
40458
|
*/
|
|
40462
40459
|
this.setDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40463
40460
|
try {
|
|
40464
|
-
|
|
40465
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40461
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
40466
40462
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40467
40463
|
}
|
|
40468
40464
|
catch (error) {
|
|
@@ -40485,8 +40481,7 @@ class World extends SDKController {
|
|
|
40485
40481
|
*/
|
|
40486
40482
|
this.updateDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40487
40483
|
try {
|
|
40488
|
-
|
|
40489
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40484
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
40490
40485
|
this.dataObject = dataObject || this.dataObject;
|
|
40491
40486
|
}
|
|
40492
40487
|
catch (error) {
|
|
@@ -40964,8 +40959,7 @@ class World extends SDKController {
|
|
|
40964
40959
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
40965
40960
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40966
40961
|
try {
|
|
40967
|
-
|
|
40968
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
40962
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
40969
40963
|
}
|
|
40970
40964
|
catch (error) {
|
|
40971
40965
|
throw this.errorHandler({
|
|
@@ -41519,8 +41513,7 @@ class User extends SDKController {
|
|
|
41519
41513
|
try {
|
|
41520
41514
|
if (!this.profileId)
|
|
41521
41515
|
throw "This method requires the use of a profileId";
|
|
41522
|
-
|
|
41523
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41516
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41524
41517
|
this.dataObject = dataObject || this.dataObject;
|
|
41525
41518
|
}
|
|
41526
41519
|
catch (error) {
|
|
@@ -41546,8 +41539,7 @@ class User extends SDKController {
|
|
|
41546
41539
|
try {
|
|
41547
41540
|
if (!this.profileId)
|
|
41548
41541
|
throw "This method requires the use of a profileId";
|
|
41549
|
-
|
|
41550
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41542
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41551
41543
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41552
41544
|
}
|
|
41553
41545
|
catch (error) {
|
|
@@ -41572,8 +41564,7 @@ class User extends SDKController {
|
|
|
41572
41564
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41573
41565
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41574
41566
|
try {
|
|
41575
|
-
|
|
41576
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41567
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
41577
41568
|
}
|
|
41578
41569
|
catch (error) {
|
|
41579
41570
|
throw this.errorHandler({ error, params: { path, amount, options }, sdkMethod: "User.incrementDataObjectValue" });
|
|
@@ -41891,8 +41882,7 @@ class Visitor extends User {
|
|
|
41891
41882
|
setDataObject(dataObject, options = {}) {
|
|
41892
41883
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41893
41884
|
try {
|
|
41894
|
-
|
|
41895
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41885
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41896
41886
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41897
41887
|
}
|
|
41898
41888
|
catch (error) {
|
|
@@ -41916,8 +41906,7 @@ class Visitor extends User {
|
|
|
41916
41906
|
updateDataObject(dataObject, options = {}) {
|
|
41917
41907
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41918
41908
|
try {
|
|
41919
|
-
|
|
41920
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41909
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41921
41910
|
this.dataObject = dataObject || this.dataObject;
|
|
41922
41911
|
}
|
|
41923
41912
|
catch (error) {
|
|
@@ -41942,8 +41931,7 @@ class Visitor extends User {
|
|
|
41942
41931
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41943
41932
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41944
41933
|
try {
|
|
41945
|
-
|
|
41946
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41934
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
41947
41935
|
}
|
|
41948
41936
|
catch (error) {
|
|
41949
41937
|
throw this.errorHandler({
|
|
@@ -41988,7 +41976,7 @@ class WorldActivity extends SDKController {
|
|
|
41988
41976
|
return __classPrivateFieldGet(this, _WorldActivity_visitorsMap, "f");
|
|
41989
41977
|
}
|
|
41990
41978
|
//////// visitors
|
|
41991
|
-
fetchVisitors(droppedAssetId, shouldIncludeAdminPermissions) {
|
|
41979
|
+
fetchVisitors({ droppedAssetId, shouldIncludeAdminPermissions, }) {
|
|
41992
41980
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41993
41981
|
try {
|
|
41994
41982
|
let queryParams = "";
|
|
@@ -42022,13 +42010,13 @@ class WorldActivity extends SDKController {
|
|
|
42022
42010
|
*
|
|
42023
42011
|
* @usage
|
|
42024
42012
|
* ```ts
|
|
42025
|
-
* const visitors = await worldActivity.currentVisitors();
|
|
42013
|
+
* const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
|
|
42026
42014
|
* ```
|
|
42027
42015
|
*/
|
|
42028
|
-
currentVisitors() {
|
|
42016
|
+
currentVisitors(shouldIncludeAdminPermissions) {
|
|
42029
42017
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42030
42018
|
try {
|
|
42031
|
-
yield this.fetchVisitors();
|
|
42019
|
+
yield this.fetchVisitors({ shouldIncludeAdminPermissions });
|
|
42032
42020
|
return this.visitors;
|
|
42033
42021
|
}
|
|
42034
42022
|
catch (error) {
|
|
@@ -42045,12 +42033,12 @@ class WorldActivity extends SDKController {
|
|
|
42045
42033
|
* const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
|
|
42046
42034
|
* ```
|
|
42047
42035
|
*/
|
|
42048
|
-
fetchVisitorsInZone(droppedAssetId) {
|
|
42036
|
+
fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }) {
|
|
42049
42037
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42050
42038
|
try {
|
|
42051
42039
|
if (!droppedAssetId)
|
|
42052
42040
|
throw "A landmark zone id (droppedAssetId) is required.";
|
|
42053
|
-
yield this.fetchVisitors(droppedAssetId);
|
|
42041
|
+
yield this.fetchVisitors({ droppedAssetId, shouldIncludeAdminPermissions });
|
|
42054
42042
|
return this.visitors;
|
|
42055
42043
|
}
|
|
42056
42044
|
catch (error) {
|
|
@@ -42081,7 +42069,7 @@ class WorldActivity extends SDKController {
|
|
|
42081
42069
|
moveAllVisitors({ shouldFetchVisitors = true, shouldTeleportVisitors = true, scatterVisitorsBy = 0, x, y, }) {
|
|
42082
42070
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42083
42071
|
if (shouldFetchVisitors)
|
|
42084
|
-
yield this.fetchVisitors();
|
|
42072
|
+
yield this.fetchVisitors({});
|
|
42085
42073
|
const allPromises = [];
|
|
42086
42074
|
if (!this.visitors)
|
|
42087
42075
|
return;
|
package/dist/index.d.ts
CHANGED
|
@@ -152,6 +152,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
152
152
|
lockId: string;
|
|
153
153
|
releaseLock?: boolean;
|
|
154
154
|
};
|
|
155
|
+
profileId?: string;
|
|
156
|
+
uniqueKey?: string;
|
|
155
157
|
}): Promise<void | ResponseType$1>;
|
|
156
158
|
/**
|
|
157
159
|
* @summary
|
|
@@ -172,6 +174,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
172
174
|
lockId: string;
|
|
173
175
|
releaseLock?: boolean;
|
|
174
176
|
};
|
|
177
|
+
profileId?: string;
|
|
178
|
+
uniqueKey?: string;
|
|
175
179
|
}): Promise<void | ResponseType$1>;
|
|
176
180
|
/**
|
|
177
181
|
* @summary
|
|
@@ -193,6 +197,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
193
197
|
lockId: string;
|
|
194
198
|
releaseLock?: boolean;
|
|
195
199
|
};
|
|
200
|
+
profileId?: string;
|
|
201
|
+
uniqueKey?: string;
|
|
196
202
|
}): Promise<void | ResponseType$1>;
|
|
197
203
|
/**
|
|
198
204
|
* @summary
|
|
@@ -734,6 +740,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
734
740
|
lockId: string;
|
|
735
741
|
releaseLock?: boolean;
|
|
736
742
|
};
|
|
743
|
+
profileId?: string;
|
|
744
|
+
uniqueKey?: string;
|
|
737
745
|
}) => Promise<void | ResponseType$1>;
|
|
738
746
|
/**
|
|
739
747
|
* @summary
|
|
@@ -755,6 +763,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
755
763
|
lockId: string;
|
|
756
764
|
releaseLock?: boolean;
|
|
757
765
|
};
|
|
766
|
+
profileId?: string;
|
|
767
|
+
uniqueKey?: string;
|
|
758
768
|
}) => Promise<void | ResponseType$1>;
|
|
759
769
|
/**
|
|
760
770
|
* @summary
|
|
@@ -776,6 +786,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
776
786
|
lockId: string;
|
|
777
787
|
releaseLock?: boolean;
|
|
778
788
|
};
|
|
789
|
+
profileId?: string;
|
|
790
|
+
uniqueKey?: string;
|
|
779
791
|
}): Promise<void | ResponseType$1>;
|
|
780
792
|
/**
|
|
781
793
|
* @summary
|
|
@@ -1113,6 +1125,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1113
1125
|
lockId: string;
|
|
1114
1126
|
releaseLock?: boolean;
|
|
1115
1127
|
};
|
|
1128
|
+
uniqueKey?: string;
|
|
1129
|
+
urlSlug?: string;
|
|
1116
1130
|
}): Promise<void | ResponseType$1>;
|
|
1117
1131
|
/**
|
|
1118
1132
|
* @summary
|
|
@@ -1133,6 +1147,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1133
1147
|
lockId: string;
|
|
1134
1148
|
releaseLock?: boolean;
|
|
1135
1149
|
};
|
|
1150
|
+
uniqueKey?: string;
|
|
1151
|
+
urlSlug?: string;
|
|
1136
1152
|
}): Promise<void | ResponseType$1>;
|
|
1137
1153
|
/**
|
|
1138
1154
|
* @summary
|
|
@@ -1154,6 +1170,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1154
1170
|
lockId: string;
|
|
1155
1171
|
releaseLock?: boolean;
|
|
1156
1172
|
};
|
|
1173
|
+
uniqueKey?: string;
|
|
1174
|
+
urlSlug?: string;
|
|
1157
1175
|
}): Promise<void | ResponseType$1>;
|
|
1158
1176
|
}
|
|
1159
1177
|
|
|
@@ -1326,6 +1344,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1326
1344
|
lockId: string;
|
|
1327
1345
|
releaseLock?: boolean;
|
|
1328
1346
|
};
|
|
1347
|
+
uniqueKey?: string;
|
|
1329
1348
|
}): Promise<void | ResponseType$1>;
|
|
1330
1349
|
/**
|
|
1331
1350
|
* @summary
|
|
@@ -1346,6 +1365,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1346
1365
|
lockId: string;
|
|
1347
1366
|
releaseLock?: boolean;
|
|
1348
1367
|
};
|
|
1368
|
+
uniqueKey?: string;
|
|
1349
1369
|
}): Promise<void | ResponseType$1>;
|
|
1350
1370
|
/**
|
|
1351
1371
|
* @summary
|
|
@@ -1367,6 +1387,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1367
1387
|
lockId: string;
|
|
1368
1388
|
releaseLock?: boolean;
|
|
1369
1389
|
};
|
|
1390
|
+
uniqueKey?: string;
|
|
1370
1391
|
}): Promise<void | ResponseType$1>;
|
|
1371
1392
|
}
|
|
1372
1393
|
|
|
@@ -1897,10 +1918,10 @@ declare class WorldActivity extends SDKController {
|
|
|
1897
1918
|
*
|
|
1898
1919
|
* @usage
|
|
1899
1920
|
* ```ts
|
|
1900
|
-
* const visitors = await worldActivity.currentVisitors();
|
|
1921
|
+
* const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
|
|
1901
1922
|
* ```
|
|
1902
1923
|
*/
|
|
1903
|
-
currentVisitors(): Promise<{
|
|
1924
|
+
currentVisitors(shouldIncludeAdminPermissions?: boolean): Promise<{
|
|
1904
1925
|
[key: string]: Visitor;
|
|
1905
1926
|
}>;
|
|
1906
1927
|
/**
|
|
@@ -1912,7 +1933,10 @@ declare class WorldActivity extends SDKController {
|
|
|
1912
1933
|
* const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
|
|
1913
1934
|
* ```
|
|
1914
1935
|
*/
|
|
1915
|
-
fetchVisitorsInZone(droppedAssetId
|
|
1936
|
+
fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }: {
|
|
1937
|
+
droppedAssetId?: string;
|
|
1938
|
+
shouldIncludeAdminPermissions?: boolean;
|
|
1939
|
+
}): Promise<{
|
|
1916
1940
|
[key: string]: Visitor;
|
|
1917
1941
|
}>;
|
|
1918
1942
|
/**
|
package/dist/index.js
CHANGED
|
@@ -39861,8 +39861,7 @@ class DroppedAsset extends Asset {
|
|
|
39861
39861
|
setDataObject(dataObject, options = {}) {
|
|
39862
39862
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39863
39863
|
try {
|
|
39864
|
-
|
|
39865
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39864
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
39866
39865
|
this.dataObject = dataObject || this.dataObject;
|
|
39867
39866
|
}
|
|
39868
39867
|
catch (error) {
|
|
@@ -39887,8 +39886,7 @@ class DroppedAsset extends Asset {
|
|
|
39887
39886
|
updateDataObject(dataObject, options = {}) {
|
|
39888
39887
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39889
39888
|
try {
|
|
39890
|
-
|
|
39891
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39889
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
39892
39890
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
39893
39891
|
}
|
|
39894
39892
|
catch (error) {
|
|
@@ -39913,8 +39911,7 @@ class DroppedAsset extends Asset {
|
|
|
39913
39911
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
39914
39912
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39915
39913
|
try {
|
|
39916
|
-
|
|
39917
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
39914
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
39918
39915
|
}
|
|
39919
39916
|
catch (error) {
|
|
39920
39917
|
throw this.errorHandler({
|
|
@@ -40459,8 +40456,7 @@ class World extends SDKController {
|
|
|
40459
40456
|
*/
|
|
40460
40457
|
this.setDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40461
40458
|
try {
|
|
40462
|
-
|
|
40463
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40459
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
40464
40460
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40465
40461
|
}
|
|
40466
40462
|
catch (error) {
|
|
@@ -40483,8 +40479,7 @@ class World extends SDKController {
|
|
|
40483
40479
|
*/
|
|
40484
40480
|
this.updateDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40485
40481
|
try {
|
|
40486
|
-
|
|
40487
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40482
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
40488
40483
|
this.dataObject = dataObject || this.dataObject;
|
|
40489
40484
|
}
|
|
40490
40485
|
catch (error) {
|
|
@@ -40962,8 +40957,7 @@ class World extends SDKController {
|
|
|
40962
40957
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
40963
40958
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40964
40959
|
try {
|
|
40965
|
-
|
|
40966
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
40960
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
40967
40961
|
}
|
|
40968
40962
|
catch (error) {
|
|
40969
40963
|
throw this.errorHandler({
|
|
@@ -41517,8 +41511,7 @@ class User extends SDKController {
|
|
|
41517
41511
|
try {
|
|
41518
41512
|
if (!this.profileId)
|
|
41519
41513
|
throw "This method requires the use of a profileId";
|
|
41520
|
-
|
|
41521
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41514
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41522
41515
|
this.dataObject = dataObject || this.dataObject;
|
|
41523
41516
|
}
|
|
41524
41517
|
catch (error) {
|
|
@@ -41544,8 +41537,7 @@ class User extends SDKController {
|
|
|
41544
41537
|
try {
|
|
41545
41538
|
if (!this.profileId)
|
|
41546
41539
|
throw "This method requires the use of a profileId";
|
|
41547
|
-
|
|
41548
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41540
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41549
41541
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41550
41542
|
}
|
|
41551
41543
|
catch (error) {
|
|
@@ -41570,8 +41562,7 @@ class User extends SDKController {
|
|
|
41570
41562
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41571
41563
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41572
41564
|
try {
|
|
41573
|
-
|
|
41574
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41565
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
41575
41566
|
}
|
|
41576
41567
|
catch (error) {
|
|
41577
41568
|
throw this.errorHandler({ error, params: { path, amount, options }, sdkMethod: "User.incrementDataObjectValue" });
|
|
@@ -41889,8 +41880,7 @@ class Visitor extends User {
|
|
|
41889
41880
|
setDataObject(dataObject, options = {}) {
|
|
41890
41881
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41891
41882
|
try {
|
|
41892
|
-
|
|
41893
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41883
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41894
41884
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41895
41885
|
}
|
|
41896
41886
|
catch (error) {
|
|
@@ -41914,8 +41904,7 @@ class Visitor extends User {
|
|
|
41914
41904
|
updateDataObject(dataObject, options = {}) {
|
|
41915
41905
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41916
41906
|
try {
|
|
41917
|
-
|
|
41918
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41907
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, Object.assign(Object.assign({}, options), { dataObject: dataObject || this.dataObject }), this.requestOptions);
|
|
41919
41908
|
this.dataObject = dataObject || this.dataObject;
|
|
41920
41909
|
}
|
|
41921
41910
|
catch (error) {
|
|
@@ -41940,8 +41929,7 @@ class Visitor extends User {
|
|
|
41940
41929
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41941
41930
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41942
41931
|
try {
|
|
41943
|
-
|
|
41944
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41932
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, Object.assign({ path, amount }, options), this.requestOptions);
|
|
41945
41933
|
}
|
|
41946
41934
|
catch (error) {
|
|
41947
41935
|
throw this.errorHandler({
|
|
@@ -41986,7 +41974,7 @@ class WorldActivity extends SDKController {
|
|
|
41986
41974
|
return __classPrivateFieldGet(this, _WorldActivity_visitorsMap, "f");
|
|
41987
41975
|
}
|
|
41988
41976
|
//////// visitors
|
|
41989
|
-
fetchVisitors(droppedAssetId, shouldIncludeAdminPermissions) {
|
|
41977
|
+
fetchVisitors({ droppedAssetId, shouldIncludeAdminPermissions, }) {
|
|
41990
41978
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41991
41979
|
try {
|
|
41992
41980
|
let queryParams = "";
|
|
@@ -42020,13 +42008,13 @@ class WorldActivity extends SDKController {
|
|
|
42020
42008
|
*
|
|
42021
42009
|
* @usage
|
|
42022
42010
|
* ```ts
|
|
42023
|
-
* const visitors = await worldActivity.currentVisitors();
|
|
42011
|
+
* const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
|
|
42024
42012
|
* ```
|
|
42025
42013
|
*/
|
|
42026
|
-
currentVisitors() {
|
|
42014
|
+
currentVisitors(shouldIncludeAdminPermissions) {
|
|
42027
42015
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42028
42016
|
try {
|
|
42029
|
-
yield this.fetchVisitors();
|
|
42017
|
+
yield this.fetchVisitors({ shouldIncludeAdminPermissions });
|
|
42030
42018
|
return this.visitors;
|
|
42031
42019
|
}
|
|
42032
42020
|
catch (error) {
|
|
@@ -42043,12 +42031,12 @@ class WorldActivity extends SDKController {
|
|
|
42043
42031
|
* const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
|
|
42044
42032
|
* ```
|
|
42045
42033
|
*/
|
|
42046
|
-
fetchVisitorsInZone(droppedAssetId) {
|
|
42034
|
+
fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }) {
|
|
42047
42035
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42048
42036
|
try {
|
|
42049
42037
|
if (!droppedAssetId)
|
|
42050
42038
|
throw "A landmark zone id (droppedAssetId) is required.";
|
|
42051
|
-
yield this.fetchVisitors(droppedAssetId);
|
|
42039
|
+
yield this.fetchVisitors({ droppedAssetId, shouldIncludeAdminPermissions });
|
|
42052
42040
|
return this.visitors;
|
|
42053
42041
|
}
|
|
42054
42042
|
catch (error) {
|
|
@@ -42079,7 +42067,7 @@ class WorldActivity extends SDKController {
|
|
|
42079
42067
|
moveAllVisitors({ shouldFetchVisitors = true, shouldTeleportVisitors = true, scatterVisitorsBy = 0, x, y, }) {
|
|
42080
42068
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42081
42069
|
if (shouldFetchVisitors)
|
|
42082
|
-
yield this.fetchVisitors();
|
|
42070
|
+
yield this.fetchVisitors({});
|
|
42083
42071
|
const allPromises = [];
|
|
42084
42072
|
if (!this.visitors)
|
|
42085
42073
|
return;
|
package/package.json
CHANGED