@rtsdk/topia 0.3.3 → 0.3.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/README.md +1 -1
- package/dist/index.cjs +37 -2
- package/dist/index.d.ts +16 -0
- package/dist/index.js +37 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Javascript RTSDK - Topia Client Library
|
|
2
2
|
|
|
3
|
-
The Topia Client Library leverages the Topia Public API and allows users to interact with the topia systems and modify their world programmatically. With the SDK you can now build new features to be used in Topia! Check out a
|
|
3
|
+
The Topia Client Library leverages the Topia Public API and allows users to interact with the topia systems and modify their world programmatically. With the SDK you can now build new features to be used in Topia! Check out a list of examples [here](https://github.com/metaversecloud-com/sdk-examples).
|
|
4
4
|
|
|
5
5
|
<br>
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -40619,7 +40619,7 @@ class World extends SDKController {
|
|
|
40619
40619
|
}
|
|
40620
40620
|
_World_droppedAssetsMap = new WeakMap();
|
|
40621
40621
|
|
|
40622
|
-
var _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
40622
|
+
var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
40623
40623
|
/**
|
|
40624
40624
|
* @summary
|
|
40625
40625
|
* Create an instance of User class with optional session credentials.
|
|
@@ -40632,16 +40632,21 @@ var _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40632
40632
|
class User extends SDKController {
|
|
40633
40633
|
constructor(topia, options = { profileId: null, credentials: {} }) {
|
|
40634
40634
|
super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
|
|
40635
|
+
_User_adminWorldsMap.set(this, void 0);
|
|
40635
40636
|
_User_assetsMap.set(this, void 0);
|
|
40636
40637
|
_User_scenesMap.set(this, void 0);
|
|
40637
40638
|
_User_worldsMap.set(this, void 0);
|
|
40638
40639
|
this.profileId = options.profileId;
|
|
40639
40640
|
this.dataObject = {};
|
|
40640
40641
|
this.profile = {};
|
|
40642
|
+
__classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
|
|
40641
40643
|
__classPrivateFieldSet(this, _User_assetsMap, {}, "f");
|
|
40642
40644
|
__classPrivateFieldSet(this, _User_scenesMap, {}, "f");
|
|
40643
40645
|
__classPrivateFieldSet(this, _User_worldsMap, {}, "f");
|
|
40644
40646
|
}
|
|
40647
|
+
get adminWorlds() {
|
|
40648
|
+
return __classPrivateFieldGet(this, _User_adminWorldsMap, "f");
|
|
40649
|
+
}
|
|
40645
40650
|
get assets() {
|
|
40646
40651
|
return __classPrivateFieldGet(this, _User_assetsMap, "f");
|
|
40647
40652
|
}
|
|
@@ -40733,6 +40738,36 @@ class User extends SDKController {
|
|
|
40733
40738
|
}
|
|
40734
40739
|
});
|
|
40735
40740
|
}
|
|
40741
|
+
/**
|
|
40742
|
+
* @summary
|
|
40743
|
+
* Retrieves all worlds a user with matching API Key is an admin in,
|
|
40744
|
+
* creates a new World object for each,
|
|
40745
|
+
* and creates new map of Worlds accessible via user.adminWorlds.
|
|
40746
|
+
*
|
|
40747
|
+
* @usage
|
|
40748
|
+
* ```ts
|
|
40749
|
+
* await user.fetchAdminWorldsByKey();
|
|
40750
|
+
* const adminWorlds = user.adminWorlds;
|
|
40751
|
+
* ```
|
|
40752
|
+
*/
|
|
40753
|
+
fetchAdminWorldsByKey() {
|
|
40754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40755
|
+
try {
|
|
40756
|
+
const response = yield this.topiaPublicApi().get("/user/admin-worlds", this.requestOptions);
|
|
40757
|
+
const tempAdminWorldsMap = {};
|
|
40758
|
+
for (const i in response.data) {
|
|
40759
|
+
const urlSlug = response.data[i];
|
|
40760
|
+
tempAdminWorldsMap[urlSlug] = new World(this.topia, urlSlug, {
|
|
40761
|
+
credentials: this.credentials,
|
|
40762
|
+
});
|
|
40763
|
+
}
|
|
40764
|
+
__classPrivateFieldSet(this, _User_adminWorldsMap, tempAdminWorldsMap, "f");
|
|
40765
|
+
}
|
|
40766
|
+
catch (error) {
|
|
40767
|
+
throw this.errorHandler({ error });
|
|
40768
|
+
}
|
|
40769
|
+
});
|
|
40770
|
+
}
|
|
40736
40771
|
/**
|
|
40737
40772
|
* @summary
|
|
40738
40773
|
* Retrieves the data object for a user.
|
|
@@ -40836,7 +40871,7 @@ class User extends SDKController {
|
|
|
40836
40871
|
});
|
|
40837
40872
|
}
|
|
40838
40873
|
}
|
|
40839
|
-
_User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap();
|
|
40874
|
+
_User_adminWorldsMap = new WeakMap(), _User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap();
|
|
40840
40875
|
|
|
40841
40876
|
/**
|
|
40842
40877
|
* @summary
|
package/dist/index.d.ts
CHANGED
|
@@ -607,6 +607,9 @@ declare class User extends SDKController implements UserInterface {
|
|
|
607
607
|
dataObject?: object | null | undefined;
|
|
608
608
|
profile?: Record<string, any>;
|
|
609
609
|
constructor(topia: Topia, options?: UserOptionalInterface);
|
|
610
|
+
get adminWorlds(): {
|
|
611
|
+
[key: string]: World;
|
|
612
|
+
};
|
|
610
613
|
get assets(): {
|
|
611
614
|
[key: string]: Asset;
|
|
612
615
|
};
|
|
@@ -644,6 +647,19 @@ declare class User extends SDKController implements UserInterface {
|
|
|
644
647
|
* ```
|
|
645
648
|
*/
|
|
646
649
|
fetchWorldsByKey(): Promise<void | ResponseType>;
|
|
650
|
+
/**
|
|
651
|
+
* @summary
|
|
652
|
+
* Retrieves all worlds a user with matching API Key is an admin in,
|
|
653
|
+
* creates a new World object for each,
|
|
654
|
+
* and creates new map of Worlds accessible via user.adminWorlds.
|
|
655
|
+
*
|
|
656
|
+
* @usage
|
|
657
|
+
* ```ts
|
|
658
|
+
* await user.fetchAdminWorldsByKey();
|
|
659
|
+
* const adminWorlds = user.adminWorlds;
|
|
660
|
+
* ```
|
|
661
|
+
*/
|
|
662
|
+
fetchAdminWorldsByKey(): Promise<void | ResponseType>;
|
|
647
663
|
/**
|
|
648
664
|
* @summary
|
|
649
665
|
* Retrieves the data object for a user.
|
package/dist/index.js
CHANGED
|
@@ -40617,7 +40617,7 @@ class World extends SDKController {
|
|
|
40617
40617
|
}
|
|
40618
40618
|
_World_droppedAssetsMap = new WeakMap();
|
|
40619
40619
|
|
|
40620
|
-
var _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
40620
|
+
var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
40621
40621
|
/**
|
|
40622
40622
|
* @summary
|
|
40623
40623
|
* Create an instance of User class with optional session credentials.
|
|
@@ -40630,16 +40630,21 @@ var _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40630
40630
|
class User extends SDKController {
|
|
40631
40631
|
constructor(topia, options = { profileId: null, credentials: {} }) {
|
|
40632
40632
|
super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
|
|
40633
|
+
_User_adminWorldsMap.set(this, void 0);
|
|
40633
40634
|
_User_assetsMap.set(this, void 0);
|
|
40634
40635
|
_User_scenesMap.set(this, void 0);
|
|
40635
40636
|
_User_worldsMap.set(this, void 0);
|
|
40636
40637
|
this.profileId = options.profileId;
|
|
40637
40638
|
this.dataObject = {};
|
|
40638
40639
|
this.profile = {};
|
|
40640
|
+
__classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
|
|
40639
40641
|
__classPrivateFieldSet(this, _User_assetsMap, {}, "f");
|
|
40640
40642
|
__classPrivateFieldSet(this, _User_scenesMap, {}, "f");
|
|
40641
40643
|
__classPrivateFieldSet(this, _User_worldsMap, {}, "f");
|
|
40642
40644
|
}
|
|
40645
|
+
get adminWorlds() {
|
|
40646
|
+
return __classPrivateFieldGet(this, _User_adminWorldsMap, "f");
|
|
40647
|
+
}
|
|
40643
40648
|
get assets() {
|
|
40644
40649
|
return __classPrivateFieldGet(this, _User_assetsMap, "f");
|
|
40645
40650
|
}
|
|
@@ -40731,6 +40736,36 @@ class User extends SDKController {
|
|
|
40731
40736
|
}
|
|
40732
40737
|
});
|
|
40733
40738
|
}
|
|
40739
|
+
/**
|
|
40740
|
+
* @summary
|
|
40741
|
+
* Retrieves all worlds a user with matching API Key is an admin in,
|
|
40742
|
+
* creates a new World object for each,
|
|
40743
|
+
* and creates new map of Worlds accessible via user.adminWorlds.
|
|
40744
|
+
*
|
|
40745
|
+
* @usage
|
|
40746
|
+
* ```ts
|
|
40747
|
+
* await user.fetchAdminWorldsByKey();
|
|
40748
|
+
* const adminWorlds = user.adminWorlds;
|
|
40749
|
+
* ```
|
|
40750
|
+
*/
|
|
40751
|
+
fetchAdminWorldsByKey() {
|
|
40752
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40753
|
+
try {
|
|
40754
|
+
const response = yield this.topiaPublicApi().get("/user/admin-worlds", this.requestOptions);
|
|
40755
|
+
const tempAdminWorldsMap = {};
|
|
40756
|
+
for (const i in response.data) {
|
|
40757
|
+
const urlSlug = response.data[i];
|
|
40758
|
+
tempAdminWorldsMap[urlSlug] = new World(this.topia, urlSlug, {
|
|
40759
|
+
credentials: this.credentials,
|
|
40760
|
+
});
|
|
40761
|
+
}
|
|
40762
|
+
__classPrivateFieldSet(this, _User_adminWorldsMap, tempAdminWorldsMap, "f");
|
|
40763
|
+
}
|
|
40764
|
+
catch (error) {
|
|
40765
|
+
throw this.errorHandler({ error });
|
|
40766
|
+
}
|
|
40767
|
+
});
|
|
40768
|
+
}
|
|
40734
40769
|
/**
|
|
40735
40770
|
* @summary
|
|
40736
40771
|
* Retrieves the data object for a user.
|
|
@@ -40834,7 +40869,7 @@ class User extends SDKController {
|
|
|
40834
40869
|
});
|
|
40835
40870
|
}
|
|
40836
40871
|
}
|
|
40837
|
-
_User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap();
|
|
40872
|
+
_User_adminWorldsMap = new WeakMap(), _User_assetsMap = new WeakMap(), _User_scenesMap = new WeakMap(), _User_worldsMap = new WeakMap();
|
|
40838
40873
|
|
|
40839
40874
|
/**
|
|
40840
40875
|
* @summary
|
package/package.json
CHANGED