@rtsdk/topia 0.11.7 → 0.11.9
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 +33 -22
- package/dist/index.d.ts +16 -18
- package/dist/index.js +33 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39904,10 +39904,7 @@ class DroppedAsset extends Asset {
|
|
|
39904
39904
|
*
|
|
39905
39905
|
* @usage
|
|
39906
39906
|
* ```ts
|
|
39907
|
-
* await droppedAsset.incrementDataObjectValue(
|
|
39908
|
-
* "path": "key",
|
|
39909
|
-
* "amount": 1,
|
|
39910
|
-
* );
|
|
39907
|
+
* await droppedAsset.incrementDataObjectValue("key", 1);
|
|
39911
39908
|
* ```
|
|
39912
39909
|
*/
|
|
39913
39910
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -40950,10 +40947,7 @@ class World extends SDKController {
|
|
|
40950
40947
|
*
|
|
40951
40948
|
* @usage
|
|
40952
40949
|
* ```ts
|
|
40953
|
-
* await world.incrementDataObjectValue(
|
|
40954
|
-
* "path": "key",
|
|
40955
|
-
* "amount": 1,
|
|
40956
|
-
* );
|
|
40950
|
+
* await world.incrementDataObjectValue("key", 1);
|
|
40957
40951
|
* ```
|
|
40958
40952
|
*/
|
|
40959
40953
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41117,7 +41111,7 @@ class User extends SDKController {
|
|
|
41117
41111
|
fetchAvatars() {
|
|
41118
41112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41119
41113
|
try {
|
|
41120
|
-
const response = yield this.topiaPublicApi().get(`/avatars`, this.requestOptions);
|
|
41114
|
+
const response = yield this.topiaPublicApi().get(`/avatars/${this.profileId}`, this.requestOptions);
|
|
41121
41115
|
return response.data;
|
|
41122
41116
|
}
|
|
41123
41117
|
catch (error) {
|
|
@@ -41198,7 +41192,7 @@ class User extends SDKController {
|
|
|
41198
41192
|
addAvatar(formData) {
|
|
41199
41193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41200
41194
|
try {
|
|
41201
|
-
const response = yield this.topiaPublicApi().post(`/avatars`, formData, this.requestOptions);
|
|
41195
|
+
const response = yield this.topiaPublicApi().post(`/avatars/${this.profileId}`, formData, this.requestOptions);
|
|
41202
41196
|
return response.data;
|
|
41203
41197
|
}
|
|
41204
41198
|
catch (error) {
|
|
@@ -41279,7 +41273,7 @@ class User extends SDKController {
|
|
|
41279
41273
|
updateAvatar(avatarId, formData) {
|
|
41280
41274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41281
41275
|
try {
|
|
41282
|
-
const response = yield this.topiaPublicApi().post(`/avatars/${avatarId}`, formData, this.requestOptions);
|
|
41276
|
+
const response = yield this.topiaPublicApi().post(`/avatars/${this.profileId}/${avatarId}`, formData, this.requestOptions);
|
|
41283
41277
|
return response.data;
|
|
41284
41278
|
}
|
|
41285
41279
|
catch (error) {
|
|
@@ -41299,7 +41293,7 @@ class User extends SDKController {
|
|
|
41299
41293
|
deleteAvatar(avatarId) {
|
|
41300
41294
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41301
41295
|
try {
|
|
41302
|
-
const response = yield this.topiaPublicApi().delete(`/avatars/${avatarId}`, this.requestOptions);
|
|
41296
|
+
const response = yield this.topiaPublicApi().delete(`/avatars/${this.profileId}/${avatarId}`, this.requestOptions);
|
|
41303
41297
|
return response.data;
|
|
41304
41298
|
}
|
|
41305
41299
|
catch (error) {
|
|
@@ -41555,10 +41549,7 @@ class User extends SDKController {
|
|
|
41555
41549
|
*
|
|
41556
41550
|
* @usage
|
|
41557
41551
|
* ```ts
|
|
41558
|
-
* await user.incrementDataObjectValue(
|
|
41559
|
-
* "path": "key",
|
|
41560
|
-
* "amount": 1,
|
|
41561
|
-
* );
|
|
41552
|
+
* await user.incrementDataObjectValue("key", 1);
|
|
41562
41553
|
* ```
|
|
41563
41554
|
*/
|
|
41564
41555
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41922,10 +41913,7 @@ class Visitor extends User {
|
|
|
41922
41913
|
*
|
|
41923
41914
|
* @usage
|
|
41924
41915
|
* ```ts
|
|
41925
|
-
* await visitor.incrementDataObjectValue(
|
|
41926
|
-
* "path": "key",
|
|
41927
|
-
* "amount": 1,
|
|
41928
|
-
* );
|
|
41916
|
+
* await visitor.incrementDataObjectValue("key", 1);
|
|
41929
41917
|
* ```
|
|
41930
41918
|
*/
|
|
41931
41919
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41942,6 +41930,29 @@ class Visitor extends User {
|
|
|
41942
41930
|
}
|
|
41943
41931
|
});
|
|
41944
41932
|
}
|
|
41933
|
+
/**
|
|
41934
|
+
* @summary
|
|
41935
|
+
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
41936
|
+
*
|
|
41937
|
+
* @usage
|
|
41938
|
+
* ```ts
|
|
41939
|
+
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
41940
|
+
* ```
|
|
41941
|
+
*/
|
|
41942
|
+
updatePublicKeyAnalytics(analytics) {
|
|
41943
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41944
|
+
try {
|
|
41945
|
+
yield this.topiaPublicApi().put(`/analytics/public-key-analytics`, { analytics }, this.requestOptions);
|
|
41946
|
+
}
|
|
41947
|
+
catch (error) {
|
|
41948
|
+
throw this.errorHandler({
|
|
41949
|
+
error,
|
|
41950
|
+
params: { analytics },
|
|
41951
|
+
sdkMethod: "Visitor.updatePublicKeyAnalytics",
|
|
41952
|
+
});
|
|
41953
|
+
}
|
|
41954
|
+
});
|
|
41955
|
+
}
|
|
41945
41956
|
}
|
|
41946
41957
|
|
|
41947
41958
|
var _WorldActivity_visitorsMap;
|
|
@@ -42226,7 +42237,7 @@ class DroppedAssetFactory extends SDKController {
|
|
|
42226
42237
|
*
|
|
42227
42238
|
* @usage
|
|
42228
42239
|
* ```
|
|
42229
|
-
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug,
|
|
42240
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
|
|
42230
42241
|
* ```
|
|
42231
42242
|
*/
|
|
42232
42243
|
getWithUniqueName(uniqueName, urlSlug, interactiveSecret, credentials) {
|
|
@@ -42466,7 +42477,7 @@ class WorldFactory extends SDKController {
|
|
|
42466
42477
|
*
|
|
42467
42478
|
* @usage
|
|
42468
42479
|
* ```
|
|
42469
|
-
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"],
|
|
42480
|
+
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], interactiveSecret, credentials);
|
|
42470
42481
|
* ```
|
|
42471
42482
|
*/
|
|
42472
42483
|
deleteDroppedAssets(urlSlug, droppedAssetIds, interactiveSecret, credentials) {
|
package/dist/index.d.ts
CHANGED
|
@@ -189,10 +189,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
189
189
|
*
|
|
190
190
|
* @usage
|
|
191
191
|
* ```ts
|
|
192
|
-
* await droppedAsset.incrementDataObjectValue(
|
|
193
|
-
* "path": "key",
|
|
194
|
-
* "amount": 1,
|
|
195
|
-
* );
|
|
192
|
+
* await droppedAsset.incrementDataObjectValue("key", 1);
|
|
196
193
|
* ```
|
|
197
194
|
*/
|
|
198
195
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -772,10 +769,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
772
769
|
*
|
|
773
770
|
* @usage
|
|
774
771
|
* ```ts
|
|
775
|
-
* await world.incrementDataObjectValue(
|
|
776
|
-
* "path": "key",
|
|
777
|
-
* "amount": 1,
|
|
778
|
-
* );
|
|
772
|
+
* await world.incrementDataObjectValue("key", 1);
|
|
779
773
|
* ```
|
|
780
774
|
*/
|
|
781
775
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -1150,10 +1144,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1150
1144
|
*
|
|
1151
1145
|
* @usage
|
|
1152
1146
|
* ```ts
|
|
1153
|
-
* await user.incrementDataObjectValue(
|
|
1154
|
-
* "path": "key",
|
|
1155
|
-
* "amount": 1,
|
|
1156
|
-
* );
|
|
1147
|
+
* await user.incrementDataObjectValue("key", 1);
|
|
1157
1148
|
* ```
|
|
1158
1149
|
*/
|
|
1159
1150
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -1363,10 +1354,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1363
1354
|
*
|
|
1364
1355
|
* @usage
|
|
1365
1356
|
* ```ts
|
|
1366
|
-
* await visitor.incrementDataObjectValue(
|
|
1367
|
-
* "path": "key",
|
|
1368
|
-
* "amount": 1,
|
|
1369
|
-
* );
|
|
1357
|
+
* await visitor.incrementDataObjectValue("key", 1);
|
|
1370
1358
|
* ```
|
|
1371
1359
|
*/
|
|
1372
1360
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -1376,6 +1364,16 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1376
1364
|
releaseLock?: boolean;
|
|
1377
1365
|
};
|
|
1378
1366
|
}): Promise<void | ResponseType$1>;
|
|
1367
|
+
/**
|
|
1368
|
+
* @summary
|
|
1369
|
+
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
1370
|
+
*
|
|
1371
|
+
* @usage
|
|
1372
|
+
* ```ts
|
|
1373
|
+
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
1374
|
+
* ```
|
|
1375
|
+
*/
|
|
1376
|
+
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
|
|
1379
1377
|
}
|
|
1380
1378
|
|
|
1381
1379
|
type VisitorType = {
|
|
@@ -2030,7 +2028,7 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2030
2028
|
*
|
|
2031
2029
|
* @usage
|
|
2032
2030
|
* ```
|
|
2033
|
-
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug,
|
|
2031
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
|
|
2034
2032
|
* ```
|
|
2035
2033
|
*/
|
|
2036
2034
|
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: {
|
|
@@ -2209,7 +2207,7 @@ declare class WorldFactory extends SDKController {
|
|
|
2209
2207
|
*
|
|
2210
2208
|
* @usage
|
|
2211
2209
|
* ```
|
|
2212
|
-
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"],
|
|
2210
|
+
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], interactiveSecret, credentials);
|
|
2213
2211
|
* ```
|
|
2214
2212
|
*/
|
|
2215
2213
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
|
package/dist/index.js
CHANGED
|
@@ -39902,10 +39902,7 @@ class DroppedAsset extends Asset {
|
|
|
39902
39902
|
*
|
|
39903
39903
|
* @usage
|
|
39904
39904
|
* ```ts
|
|
39905
|
-
* await droppedAsset.incrementDataObjectValue(
|
|
39906
|
-
* "path": "key",
|
|
39907
|
-
* "amount": 1,
|
|
39908
|
-
* );
|
|
39905
|
+
* await droppedAsset.incrementDataObjectValue("key", 1);
|
|
39909
39906
|
* ```
|
|
39910
39907
|
*/
|
|
39911
39908
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -40948,10 +40945,7 @@ class World extends SDKController {
|
|
|
40948
40945
|
*
|
|
40949
40946
|
* @usage
|
|
40950
40947
|
* ```ts
|
|
40951
|
-
* await world.incrementDataObjectValue(
|
|
40952
|
-
* "path": "key",
|
|
40953
|
-
* "amount": 1,
|
|
40954
|
-
* );
|
|
40948
|
+
* await world.incrementDataObjectValue("key", 1);
|
|
40955
40949
|
* ```
|
|
40956
40950
|
*/
|
|
40957
40951
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41115,7 +41109,7 @@ class User extends SDKController {
|
|
|
41115
41109
|
fetchAvatars() {
|
|
41116
41110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41117
41111
|
try {
|
|
41118
|
-
const response = yield this.topiaPublicApi().get(`/avatars`, this.requestOptions);
|
|
41112
|
+
const response = yield this.topiaPublicApi().get(`/avatars/${this.profileId}`, this.requestOptions);
|
|
41119
41113
|
return response.data;
|
|
41120
41114
|
}
|
|
41121
41115
|
catch (error) {
|
|
@@ -41196,7 +41190,7 @@ class User extends SDKController {
|
|
|
41196
41190
|
addAvatar(formData) {
|
|
41197
41191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41198
41192
|
try {
|
|
41199
|
-
const response = yield this.topiaPublicApi().post(`/avatars`, formData, this.requestOptions);
|
|
41193
|
+
const response = yield this.topiaPublicApi().post(`/avatars/${this.profileId}`, formData, this.requestOptions);
|
|
41200
41194
|
return response.data;
|
|
41201
41195
|
}
|
|
41202
41196
|
catch (error) {
|
|
@@ -41277,7 +41271,7 @@ class User extends SDKController {
|
|
|
41277
41271
|
updateAvatar(avatarId, formData) {
|
|
41278
41272
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41279
41273
|
try {
|
|
41280
|
-
const response = yield this.topiaPublicApi().post(`/avatars/${avatarId}`, formData, this.requestOptions);
|
|
41274
|
+
const response = yield this.topiaPublicApi().post(`/avatars/${this.profileId}/${avatarId}`, formData, this.requestOptions);
|
|
41281
41275
|
return response.data;
|
|
41282
41276
|
}
|
|
41283
41277
|
catch (error) {
|
|
@@ -41297,7 +41291,7 @@ class User extends SDKController {
|
|
|
41297
41291
|
deleteAvatar(avatarId) {
|
|
41298
41292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41299
41293
|
try {
|
|
41300
|
-
const response = yield this.topiaPublicApi().delete(`/avatars/${avatarId}`, this.requestOptions);
|
|
41294
|
+
const response = yield this.topiaPublicApi().delete(`/avatars/${this.profileId}/${avatarId}`, this.requestOptions);
|
|
41301
41295
|
return response.data;
|
|
41302
41296
|
}
|
|
41303
41297
|
catch (error) {
|
|
@@ -41553,10 +41547,7 @@ class User extends SDKController {
|
|
|
41553
41547
|
*
|
|
41554
41548
|
* @usage
|
|
41555
41549
|
* ```ts
|
|
41556
|
-
* await user.incrementDataObjectValue(
|
|
41557
|
-
* "path": "key",
|
|
41558
|
-
* "amount": 1,
|
|
41559
|
-
* );
|
|
41550
|
+
* await user.incrementDataObjectValue("key", 1);
|
|
41560
41551
|
* ```
|
|
41561
41552
|
*/
|
|
41562
41553
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41920,10 +41911,7 @@ class Visitor extends User {
|
|
|
41920
41911
|
*
|
|
41921
41912
|
* @usage
|
|
41922
41913
|
* ```ts
|
|
41923
|
-
* await visitor.incrementDataObjectValue(
|
|
41924
|
-
* "path": "key",
|
|
41925
|
-
* "amount": 1,
|
|
41926
|
-
* );
|
|
41914
|
+
* await visitor.incrementDataObjectValue("key", 1);
|
|
41927
41915
|
* ```
|
|
41928
41916
|
*/
|
|
41929
41917
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
@@ -41940,6 +41928,29 @@ class Visitor extends User {
|
|
|
41940
41928
|
}
|
|
41941
41929
|
});
|
|
41942
41930
|
}
|
|
41931
|
+
/**
|
|
41932
|
+
* @summary
|
|
41933
|
+
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
41934
|
+
*
|
|
41935
|
+
* @usage
|
|
41936
|
+
* ```ts
|
|
41937
|
+
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
41938
|
+
* ```
|
|
41939
|
+
*/
|
|
41940
|
+
updatePublicKeyAnalytics(analytics) {
|
|
41941
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41942
|
+
try {
|
|
41943
|
+
yield this.topiaPublicApi().put(`/analytics/public-key-analytics`, { analytics }, this.requestOptions);
|
|
41944
|
+
}
|
|
41945
|
+
catch (error) {
|
|
41946
|
+
throw this.errorHandler({
|
|
41947
|
+
error,
|
|
41948
|
+
params: { analytics },
|
|
41949
|
+
sdkMethod: "Visitor.updatePublicKeyAnalytics",
|
|
41950
|
+
});
|
|
41951
|
+
}
|
|
41952
|
+
});
|
|
41953
|
+
}
|
|
41943
41954
|
}
|
|
41944
41955
|
|
|
41945
41956
|
var _WorldActivity_visitorsMap;
|
|
@@ -42224,7 +42235,7 @@ class DroppedAssetFactory extends SDKController {
|
|
|
42224
42235
|
*
|
|
42225
42236
|
* @usage
|
|
42226
42237
|
* ```
|
|
42227
|
-
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug,
|
|
42238
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
|
|
42228
42239
|
* ```
|
|
42229
42240
|
*/
|
|
42230
42241
|
getWithUniqueName(uniqueName, urlSlug, interactiveSecret, credentials) {
|
|
@@ -42464,7 +42475,7 @@ class WorldFactory extends SDKController {
|
|
|
42464
42475
|
*
|
|
42465
42476
|
* @usage
|
|
42466
42477
|
* ```
|
|
42467
|
-
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"],
|
|
42478
|
+
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], interactiveSecret, credentials);
|
|
42468
42479
|
* ```
|
|
42469
42480
|
*/
|
|
42470
42481
|
deleteDroppedAssets(urlSlug, droppedAssetIds, interactiveSecret, credentials) {
|
package/package.json
CHANGED