@rtsdk/topia 0.3.2 → 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 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 few awesome examples [here](https://sdk-examples.metaversecloud.com/).
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
@@ -40470,7 +40470,7 @@ class World extends SDKController {
40470
40470
  }
40471
40471
  /**
40472
40472
  * @summary
40473
- * Retrieve all assets dropped in a world matching dropSceneId.
40473
+ * Retrieve all assets dropped in a world matching sceneDropId.
40474
40474
  *
40475
40475
  * @usage
40476
40476
  * ```ts
@@ -40534,7 +40534,7 @@ class World extends SDKController {
40534
40534
  }
40535
40535
  /**
40536
40536
  * @summary
40537
- * Drop a scene in a world.
40537
+ * Drops a scene in a world and returns sceneDropId.
40538
40538
  *
40539
40539
  * @usage
40540
40540
  * ```ts
@@ -40547,11 +40547,17 @@ class World extends SDKController {
40547
40547
  * "assetSuffix": "string"
40548
40548
  * });
40549
40549
  * ```
40550
+ *
40551
+ * @result
40552
+ * ```ts
40553
+ * { sceneDropId: sceneId-timestamp, success: true }
40554
+ * ```
40550
40555
  */
40551
40556
  dropScene({ assetSuffix, position, sceneId, }) {
40552
40557
  return __awaiter(this, void 0, void 0, function* () {
40553
40558
  try {
40554
- yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, { assetSuffix, position, sceneId }, this.requestOptions);
40559
+ const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, { assetSuffix, position, sceneId }, this.requestOptions);
40560
+ return result;
40555
40561
  }
40556
40562
  catch (error) {
40557
40563
  throw this.errorHandler({ error });
@@ -40613,7 +40619,7 @@ class World extends SDKController {
40613
40619
  }
40614
40620
  _World_droppedAssetsMap = new WeakMap();
40615
40621
 
40616
- var _User_assetsMap, _User_scenesMap, _User_worldsMap;
40622
+ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
40617
40623
  /**
40618
40624
  * @summary
40619
40625
  * Create an instance of User class with optional session credentials.
@@ -40626,16 +40632,21 @@ var _User_assetsMap, _User_scenesMap, _User_worldsMap;
40626
40632
  class User extends SDKController {
40627
40633
  constructor(topia, options = { profileId: null, credentials: {} }) {
40628
40634
  super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
40635
+ _User_adminWorldsMap.set(this, void 0);
40629
40636
  _User_assetsMap.set(this, void 0);
40630
40637
  _User_scenesMap.set(this, void 0);
40631
40638
  _User_worldsMap.set(this, void 0);
40632
40639
  this.profileId = options.profileId;
40633
40640
  this.dataObject = {};
40634
40641
  this.profile = {};
40642
+ __classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
40635
40643
  __classPrivateFieldSet(this, _User_assetsMap, {}, "f");
40636
40644
  __classPrivateFieldSet(this, _User_scenesMap, {}, "f");
40637
40645
  __classPrivateFieldSet(this, _User_worldsMap, {}, "f");
40638
40646
  }
40647
+ get adminWorlds() {
40648
+ return __classPrivateFieldGet(this, _User_adminWorldsMap, "f");
40649
+ }
40639
40650
  get assets() {
40640
40651
  return __classPrivateFieldGet(this, _User_assetsMap, "f");
40641
40652
  }
@@ -40727,6 +40738,36 @@ class User extends SDKController {
40727
40738
  }
40728
40739
  });
40729
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
+ }
40730
40771
  /**
40731
40772
  * @summary
40732
40773
  * Retrieves the data object for a user.
@@ -40830,7 +40871,7 @@ class User extends SDKController {
40830
40871
  });
40831
40872
  }
40832
40873
  }
40833
- _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();
40834
40875
 
40835
40876
  /**
40836
40877
  * @summary
package/dist/index.d.ts CHANGED
@@ -439,7 +439,7 @@ declare class World extends SDKController implements WorldInterface {
439
439
  }): Promise<DroppedAsset[]>;
440
440
  /**
441
441
  * @summary
442
- * Retrieve all assets dropped in a world matching dropSceneId.
442
+ * Retrieve all assets dropped in a world matching sceneDropId.
443
443
  *
444
444
  * @usage
445
445
  * ```ts
@@ -477,7 +477,7 @@ declare class World extends SDKController implements WorldInterface {
477
477
  updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
478
478
  /**
479
479
  * @summary
480
- * Drop a scene in a world.
480
+ * Drops a scene in a world and returns sceneDropId.
481
481
  *
482
482
  * @usage
483
483
  * ```ts
@@ -490,12 +490,17 @@ declare class World extends SDKController implements WorldInterface {
490
490
  * "assetSuffix": "string"
491
491
  * });
492
492
  * ```
493
+ *
494
+ * @result
495
+ * ```ts
496
+ * { sceneDropId: sceneId-timestamp, success: true }
497
+ * ```
493
498
  */
494
499
  dropScene({ assetSuffix, position, sceneId, }: {
495
500
  assetSuffix: string;
496
501
  position: object;
497
502
  sceneId: string;
498
- }): Promise<void | ResponseType>;
503
+ }): Promise<object | ResponseType>;
499
504
  /**
500
505
  * @summary
501
506
  * Replace the current scene of a world.
@@ -602,6 +607,9 @@ declare class User extends SDKController implements UserInterface {
602
607
  dataObject?: object | null | undefined;
603
608
  profile?: Record<string, any>;
604
609
  constructor(topia: Topia, options?: UserOptionalInterface);
610
+ get adminWorlds(): {
611
+ [key: string]: World;
612
+ };
605
613
  get assets(): {
606
614
  [key: string]: Asset;
607
615
  };
@@ -639,6 +647,19 @@ declare class User extends SDKController implements UserInterface {
639
647
  * ```
640
648
  */
641
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>;
642
663
  /**
643
664
  * @summary
644
665
  * Retrieves the data object for a user.
@@ -1206,7 +1227,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1206
1227
  assetSuffix: string;
1207
1228
  position: object;
1208
1229
  sceneId: string;
1209
- }): Promise<void | ResponseType>;
1230
+ }): Promise<object | ResponseType>;
1210
1231
  replaceScene(sceneId: string): Promise<void | ResponseType>;
1211
1232
  fetchDataObject(): Promise<void | ResponseType>;
1212
1233
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
package/dist/index.js CHANGED
@@ -40468,7 +40468,7 @@ class World extends SDKController {
40468
40468
  }
40469
40469
  /**
40470
40470
  * @summary
40471
- * Retrieve all assets dropped in a world matching dropSceneId.
40471
+ * Retrieve all assets dropped in a world matching sceneDropId.
40472
40472
  *
40473
40473
  * @usage
40474
40474
  * ```ts
@@ -40532,7 +40532,7 @@ class World extends SDKController {
40532
40532
  }
40533
40533
  /**
40534
40534
  * @summary
40535
- * Drop a scene in a world.
40535
+ * Drops a scene in a world and returns sceneDropId.
40536
40536
  *
40537
40537
  * @usage
40538
40538
  * ```ts
@@ -40545,11 +40545,17 @@ class World extends SDKController {
40545
40545
  * "assetSuffix": "string"
40546
40546
  * });
40547
40547
  * ```
40548
+ *
40549
+ * @result
40550
+ * ```ts
40551
+ * { sceneDropId: sceneId-timestamp, success: true }
40552
+ * ```
40548
40553
  */
40549
40554
  dropScene({ assetSuffix, position, sceneId, }) {
40550
40555
  return __awaiter(this, void 0, void 0, function* () {
40551
40556
  try {
40552
- yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, { assetSuffix, position, sceneId }, this.requestOptions);
40557
+ const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, { assetSuffix, position, sceneId }, this.requestOptions);
40558
+ return result;
40553
40559
  }
40554
40560
  catch (error) {
40555
40561
  throw this.errorHandler({ error });
@@ -40611,7 +40617,7 @@ class World extends SDKController {
40611
40617
  }
40612
40618
  _World_droppedAssetsMap = new WeakMap();
40613
40619
 
40614
- var _User_assetsMap, _User_scenesMap, _User_worldsMap;
40620
+ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
40615
40621
  /**
40616
40622
  * @summary
40617
40623
  * Create an instance of User class with optional session credentials.
@@ -40624,16 +40630,21 @@ var _User_assetsMap, _User_scenesMap, _User_worldsMap;
40624
40630
  class User extends SDKController {
40625
40631
  constructor(topia, options = { profileId: null, credentials: {} }) {
40626
40632
  super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
40633
+ _User_adminWorldsMap.set(this, void 0);
40627
40634
  _User_assetsMap.set(this, void 0);
40628
40635
  _User_scenesMap.set(this, void 0);
40629
40636
  _User_worldsMap.set(this, void 0);
40630
40637
  this.profileId = options.profileId;
40631
40638
  this.dataObject = {};
40632
40639
  this.profile = {};
40640
+ __classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
40633
40641
  __classPrivateFieldSet(this, _User_assetsMap, {}, "f");
40634
40642
  __classPrivateFieldSet(this, _User_scenesMap, {}, "f");
40635
40643
  __classPrivateFieldSet(this, _User_worldsMap, {}, "f");
40636
40644
  }
40645
+ get adminWorlds() {
40646
+ return __classPrivateFieldGet(this, _User_adminWorldsMap, "f");
40647
+ }
40637
40648
  get assets() {
40638
40649
  return __classPrivateFieldGet(this, _User_assetsMap, "f");
40639
40650
  }
@@ -40725,6 +40736,36 @@ class User extends SDKController {
40725
40736
  }
40726
40737
  });
40727
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
+ }
40728
40769
  /**
40729
40770
  * @summary
40730
40771
  * Retrieves the data object for a user.
@@ -40828,7 +40869,7 @@ class User extends SDKController {
40828
40869
  });
40829
40870
  }
40830
40871
  }
40831
- _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();
40832
40873
 
40833
40874
  /**
40834
40875
  * @summary
package/package.json CHANGED
@@ -59,5 +59,5 @@
59
59
  "local-publish": "yarn build && yalc publish --push --no-scripts"
60
60
  },
61
61
  "type": "module",
62
- "version": "0.3.2"
62
+ "version": "0.3.4"
63
63
  }