@rtsdk/topia 0.11.3 → 0.11.5
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/README.md +30 -2
- package/dist/index.cjs +12 -24
- package/dist/index.d.ts +20 -12
- package/dist/index.js +12 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -243,10 +243,38 @@ try {
|
|
|
243
243
|
Once complete be sure to also call `await keyAsset.updateDataObject({ turnCount: turnCount + 1 });` so that the next player is free to take their turn!
|
|
244
244
|
|
|
245
245
|
**Custom analytics**
|
|
246
|
-
You can leverage the data object methods for all types to track analytics unique to your Public Key by passing `analytics` as an optional array to all calls that set, update, or increment data objects!
|
|
246
|
+
You can leverage the data object methods for all types to track analytics unique to your Public Key by passing `analytics` as an optional array along with `profileId`, `urlSlug`, and/or `uniqueKey` to all calls that set, update, or increment data objects!
|
|
247
|
+
|
|
248
|
+
**World** and **Dropped Asset** classes will automatically include `urlSlug`. In addition to `analytics` you can also pass `profileId` if you want to track event per user and/or a `uniqueKey` to additionally track uniqueness of the event for all time, per user (if `profileId` is included), and per world.
|
|
249
|
+
|
|
250
|
+
Examples leveraging World data objects calls:
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
await world.setDataObject({ hello: "world" }, { analytics: [{ analyticName: "resets"} ], lock: { lockId, releaseLock: true });
|
|
254
|
+
|
|
255
|
+
await world.updateDataObject({}, { analytics: [ {analyticName: "matches", uniqueKey: `${playerOneProfileId}-${playerTwoProfileId}`, urlSlug }], });
|
|
256
|
+
|
|
257
|
+
await world.incrementDataObjectValue(`keyAssets.${assetId}.completions`, 1, { analytics: [{ analyticName:"completions", incrementBy: 2, profileId, uniqueKey: profileId, urlSlug }] });
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Visitor** and **User** classes will automatically include `profileId`. In addition to `analytics` you can also pass `urlSlug` if you want to track event per world and/or a `uniqueKey` to additionally track uniqueness of the event for all time, per user, and per world (if `urlSlug` is included).
|
|
261
|
+
|
|
262
|
+
Examples leveraging Visitor data objects calls:
|
|
247
263
|
|
|
248
264
|
```js
|
|
249
|
-
await
|
|
265
|
+
await visitor.setDataObject(
|
|
266
|
+
{ hello: "world" },
|
|
267
|
+
{ analytics: [{ analyticName: "starts" }], lock: { lockId, releaseLock: true } },
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
await visitor.updateDataObject(
|
|
271
|
+
{},
|
|
272
|
+
{ analytics: [{ analyticName: "emotesUnlocked", profileId, uniqueKey: profileId }] },
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
await visitor.incrementDataObjectValue(`completions`, 1, {
|
|
276
|
+
analytics: [{ analyticName: "completions", incrementBy: 2, profileId, urlSlug, uniqueKey: profileId }],
|
|
277
|
+
});
|
|
250
278
|
```
|
|
251
279
|
|
|
252
280
|
Note: This does NOT impact the data objects themselves but rather allows you to track custom analytics (incremented by 1) across all instances of your application with a given Public Key.
|
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({
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,14 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
77
77
|
fetchSceneById(): Promise<void | ResponseType$1>;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
type AnalyticType = {
|
|
81
|
+
analyticName: string;
|
|
82
|
+
incrementBy?: number;
|
|
83
|
+
profileId?: string;
|
|
84
|
+
uniqueKey?: string;
|
|
85
|
+
urlSlug?: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
80
88
|
/**
|
|
81
89
|
* @summary
|
|
82
90
|
* Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.
|
|
@@ -147,7 +155,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
147
155
|
* ```
|
|
148
156
|
*/
|
|
149
157
|
setDataObject(dataObject: object, options?: {
|
|
150
|
-
analytics?:
|
|
158
|
+
analytics?: AnalyticType[];
|
|
151
159
|
lock?: {
|
|
152
160
|
lockId: string;
|
|
153
161
|
releaseLock?: boolean;
|
|
@@ -167,7 +175,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
167
175
|
* ```
|
|
168
176
|
*/
|
|
169
177
|
updateDataObject(dataObject: object, options?: {
|
|
170
|
-
analytics?:
|
|
178
|
+
analytics?: AnalyticType[];
|
|
171
179
|
lock?: {
|
|
172
180
|
lockId: string;
|
|
173
181
|
releaseLock?: boolean;
|
|
@@ -188,7 +196,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
188
196
|
* ```
|
|
189
197
|
*/
|
|
190
198
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
191
|
-
analytics?:
|
|
199
|
+
analytics?: AnalyticType[];
|
|
192
200
|
lock?: {
|
|
193
201
|
lockId: string;
|
|
194
202
|
releaseLock?: boolean;
|
|
@@ -729,7 +737,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
729
737
|
* ```
|
|
730
738
|
*/
|
|
731
739
|
setDataObject: (dataObject: object | null | undefined, options?: {
|
|
732
|
-
analytics?:
|
|
740
|
+
analytics?: AnalyticType[];
|
|
733
741
|
lock?: {
|
|
734
742
|
lockId: string;
|
|
735
743
|
releaseLock?: boolean;
|
|
@@ -750,7 +758,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
750
758
|
* ```
|
|
751
759
|
*/
|
|
752
760
|
updateDataObject: (dataObject: object, options?: {
|
|
753
|
-
analytics?:
|
|
761
|
+
analytics?: AnalyticType[];
|
|
754
762
|
lock?: {
|
|
755
763
|
lockId: string;
|
|
756
764
|
releaseLock?: boolean;
|
|
@@ -771,7 +779,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
771
779
|
* ```
|
|
772
780
|
*/
|
|
773
781
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
774
|
-
analytics?:
|
|
782
|
+
analytics?: AnalyticType[];
|
|
775
783
|
lock?: {
|
|
776
784
|
lockId: string;
|
|
777
785
|
releaseLock?: boolean;
|
|
@@ -1108,7 +1116,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1108
1116
|
* ```
|
|
1109
1117
|
*/
|
|
1110
1118
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
1111
|
-
analytics?:
|
|
1119
|
+
analytics?: AnalyticType[];
|
|
1112
1120
|
lock?: {
|
|
1113
1121
|
lockId: string;
|
|
1114
1122
|
releaseLock?: boolean;
|
|
@@ -1128,7 +1136,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1128
1136
|
* ```
|
|
1129
1137
|
*/
|
|
1130
1138
|
updateDataObject(dataObject: object, options?: {
|
|
1131
|
-
analytics?:
|
|
1139
|
+
analytics?: AnalyticType[];
|
|
1132
1140
|
lock?: {
|
|
1133
1141
|
lockId: string;
|
|
1134
1142
|
releaseLock?: boolean;
|
|
@@ -1149,7 +1157,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1149
1157
|
* ```
|
|
1150
1158
|
*/
|
|
1151
1159
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
1152
|
-
analytics?:
|
|
1160
|
+
analytics?: AnalyticType[];
|
|
1153
1161
|
lock?: {
|
|
1154
1162
|
lockId: string;
|
|
1155
1163
|
releaseLock?: boolean;
|
|
@@ -1321,7 +1329,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1321
1329
|
* ```
|
|
1322
1330
|
*/
|
|
1323
1331
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
1324
|
-
analytics?:
|
|
1332
|
+
analytics?: AnalyticType[];
|
|
1325
1333
|
lock?: {
|
|
1326
1334
|
lockId: string;
|
|
1327
1335
|
releaseLock?: boolean;
|
|
@@ -1341,7 +1349,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1341
1349
|
* ```
|
|
1342
1350
|
*/
|
|
1343
1351
|
updateDataObject(dataObject: object, options?: {
|
|
1344
|
-
analytics?:
|
|
1352
|
+
analytics?: AnalyticType[];
|
|
1345
1353
|
lock?: {
|
|
1346
1354
|
lockId: string;
|
|
1347
1355
|
releaseLock?: boolean;
|
|
@@ -1362,7 +1370,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1362
1370
|
* ```
|
|
1363
1371
|
*/
|
|
1364
1372
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
1365
|
-
analytics?:
|
|
1373
|
+
analytics?: AnalyticType[];
|
|
1366
1374
|
lock?: {
|
|
1367
1375
|
lockId: string;
|
|
1368
1376
|
releaseLock?: boolean;
|
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({
|
package/package.json
CHANGED