@rtsdk/topia 0.3.4 → 0.3.6

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 CHANGED
@@ -40532,6 +40532,32 @@ class World extends SDKController {
40532
40532
  return outcomes;
40533
40533
  });
40534
40534
  }
40535
+ /**
40536
+ * @summary
40537
+ * Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
40538
+ *
40539
+ * @usage
40540
+ * ```ts
40541
+ * await world.fetchSceneDropIds();
40542
+ * ```
40543
+ *
40544
+ * @result
40545
+ * ```ts
40546
+ * { sceneDropIds: [] }
40547
+ * ```
40548
+ */
40549
+ fetchSceneDropIds() {
40550
+ return __awaiter(this, void 0, void 0, function* () {
40551
+ try {
40552
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes`, this.requestOptions);
40553
+ this.sceneDropIds = response.data;
40554
+ return response.data;
40555
+ }
40556
+ catch (error) {
40557
+ throw this.errorHandler({ error });
40558
+ }
40559
+ });
40560
+ }
40535
40561
  /**
40536
40562
  * @summary
40537
40563
  * Drops a scene in a world and returns sceneDropId.
@@ -40768,6 +40794,27 @@ class User extends SDKController {
40768
40794
  }
40769
40795
  });
40770
40796
  }
40797
+ /**
40798
+ * @summary
40799
+ * Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
40800
+ *
40801
+ * @usage
40802
+ * ```ts
40803
+ * await user.fetchInteractiveWorldsByKey("interactivePublicKeyExample");
40804
+ * const interactiveWorlds = user.interactiveWorlds;
40805
+ * ```
40806
+ */
40807
+ fetchInteractiveWorldsByKey(interactivePublicKey) {
40808
+ return __awaiter(this, void 0, void 0, function* () {
40809
+ try {
40810
+ const response = yield this.topiaPublicApi().get(`/user/interactive-worlds?interactivePublicKey=${interactivePublicKey}`, this.requestOptions);
40811
+ return response.data;
40812
+ }
40813
+ catch (error) {
40814
+ throw this.errorHandler({ error });
40815
+ }
40816
+ });
40817
+ }
40771
40818
  /**
40772
40819
  * @summary
40773
40820
  * Retrieves the data object for a user.
@@ -41009,6 +41056,25 @@ class Visitor extends User {
41009
41056
  }
41010
41057
  });
41011
41058
  }
41059
+ /**
41060
+ * @summary
41061
+ * Mute and turn video off for a visitor currently in a world.
41062
+ *
41063
+ * @usage
41064
+ * ```ts
41065
+ * await visitor.turnAVOff();
41066
+ * ```
41067
+ */
41068
+ turnAVOff() {
41069
+ return __awaiter(this, void 0, void 0, function* () {
41070
+ try {
41071
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/turn-av-off`, this.requestOptions);
41072
+ }
41073
+ catch (error) {
41074
+ throw this.errorHandler({ error });
41075
+ }
41076
+ });
41077
+ }
41012
41078
  /**
41013
41079
  * @summary
41014
41080
  * Retrieves the data object for a visitor.
@@ -41304,11 +41370,12 @@ class DroppedAssetFactory extends SDKController {
41304
41370
  return droppedAsset;
41305
41371
  });
41306
41372
  }
41307
- drop(asset, { position: { x, y }, uniqueName, urlSlug, }) {
41373
+ drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
41308
41374
  return __awaiter(this, void 0, void 0, function* () {
41309
41375
  try {
41310
41376
  const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
41311
41377
  assetId: asset.id,
41378
+ interactivePublicKey,
41312
41379
  position: { x, y },
41313
41380
  uniqueName,
41314
41381
  }, asset.requestOptions);
package/dist/index.d.ts CHANGED
@@ -373,6 +373,7 @@ declare class World extends SDKController implements WorldInterface {
373
373
  #private;
374
374
  urlSlug: string;
375
375
  dataObject?: object | null | undefined;
376
+ sceneDropIds?: [string] | null | undefined;
376
377
  constructor(topia: Topia, urlSlug: string, options?: WorldOptionalInterface);
377
378
  get droppedAssets(): {
378
379
  [key: string]: DroppedAsset;
@@ -475,6 +476,21 @@ declare class World extends SDKController implements WorldInterface {
475
476
  * Updates each DroppedAsset instance and world.droppedAssets map.
476
477
  */
477
478
  updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
479
+ /**
480
+ * @summary
481
+ * Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
482
+ *
483
+ * @usage
484
+ * ```ts
485
+ * await world.fetchSceneDropIds();
486
+ * ```
487
+ *
488
+ * @result
489
+ * ```ts
490
+ * { sceneDropIds: [] }
491
+ * ```
492
+ */
493
+ fetchSceneDropIds(): Promise<object | ResponseType>;
478
494
  /**
479
495
  * @summary
480
496
  * Drops a scene in a world and returns sceneDropId.
@@ -660,6 +676,17 @@ declare class User extends SDKController implements UserInterface {
660
676
  * ```
661
677
  */
662
678
  fetchAdminWorldsByKey(): Promise<void | ResponseType>;
679
+ /**
680
+ * @summary
681
+ * Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
682
+ *
683
+ * @usage
684
+ * ```ts
685
+ * await user.fetchInteractiveWorldsByKey("interactivePublicKeyExample");
686
+ * const interactiveWorlds = user.interactiveWorlds;
687
+ * ```
688
+ */
689
+ fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType>;
663
690
  /**
664
691
  * @summary
665
692
  * Retrieves the data object for a user.
@@ -802,6 +829,16 @@ declare class Visitor extends User implements VisitorInterface {
802
829
  * ```
803
830
  */
804
831
  openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType>;
832
+ /**
833
+ * @summary
834
+ * Mute and turn video off for a visitor currently in a world.
835
+ *
836
+ * @usage
837
+ * ```ts
838
+ * await visitor.turnAVOff();
839
+ * ```
840
+ */
841
+ turnAVOff(): Promise<void | ResponseType>;
805
842
  /**
806
843
  * @summary
807
844
  * Retrieves the data object for a visitor.
@@ -1416,7 +1453,8 @@ declare class DroppedAssetFactory extends SDKController {
1416
1453
  constructor(topia: Topia);
1417
1454
  create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
1418
1455
  get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
1419
- drop(asset: Asset, { position: { x, y }, uniqueName, urlSlug, }: {
1456
+ drop(asset: Asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }: {
1457
+ interactivePublicKey?: string;
1420
1458
  position: {
1421
1459
  x: number;
1422
1460
  y: number;
package/dist/index.js CHANGED
@@ -40530,6 +40530,32 @@ class World extends SDKController {
40530
40530
  return outcomes;
40531
40531
  });
40532
40532
  }
40533
+ /**
40534
+ * @summary
40535
+ * Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
40536
+ *
40537
+ * @usage
40538
+ * ```ts
40539
+ * await world.fetchSceneDropIds();
40540
+ * ```
40541
+ *
40542
+ * @result
40543
+ * ```ts
40544
+ * { sceneDropIds: [] }
40545
+ * ```
40546
+ */
40547
+ fetchSceneDropIds() {
40548
+ return __awaiter(this, void 0, void 0, function* () {
40549
+ try {
40550
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes`, this.requestOptions);
40551
+ this.sceneDropIds = response.data;
40552
+ return response.data;
40553
+ }
40554
+ catch (error) {
40555
+ throw this.errorHandler({ error });
40556
+ }
40557
+ });
40558
+ }
40533
40559
  /**
40534
40560
  * @summary
40535
40561
  * Drops a scene in a world and returns sceneDropId.
@@ -40766,6 +40792,27 @@ class User extends SDKController {
40766
40792
  }
40767
40793
  });
40768
40794
  }
40795
+ /**
40796
+ * @summary
40797
+ * Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
40798
+ *
40799
+ * @usage
40800
+ * ```ts
40801
+ * await user.fetchInteractiveWorldsByKey("interactivePublicKeyExample");
40802
+ * const interactiveWorlds = user.interactiveWorlds;
40803
+ * ```
40804
+ */
40805
+ fetchInteractiveWorldsByKey(interactivePublicKey) {
40806
+ return __awaiter(this, void 0, void 0, function* () {
40807
+ try {
40808
+ const response = yield this.topiaPublicApi().get(`/user/interactive-worlds?interactivePublicKey=${interactivePublicKey}`, this.requestOptions);
40809
+ return response.data;
40810
+ }
40811
+ catch (error) {
40812
+ throw this.errorHandler({ error });
40813
+ }
40814
+ });
40815
+ }
40769
40816
  /**
40770
40817
  * @summary
40771
40818
  * Retrieves the data object for a user.
@@ -41007,6 +41054,25 @@ class Visitor extends User {
41007
41054
  }
41008
41055
  });
41009
41056
  }
41057
+ /**
41058
+ * @summary
41059
+ * Mute and turn video off for a visitor currently in a world.
41060
+ *
41061
+ * @usage
41062
+ * ```ts
41063
+ * await visitor.turnAVOff();
41064
+ * ```
41065
+ */
41066
+ turnAVOff() {
41067
+ return __awaiter(this, void 0, void 0, function* () {
41068
+ try {
41069
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/turn-av-off`, this.requestOptions);
41070
+ }
41071
+ catch (error) {
41072
+ throw this.errorHandler({ error });
41073
+ }
41074
+ });
41075
+ }
41010
41076
  /**
41011
41077
  * @summary
41012
41078
  * Retrieves the data object for a visitor.
@@ -41302,11 +41368,12 @@ class DroppedAssetFactory extends SDKController {
41302
41368
  return droppedAsset;
41303
41369
  });
41304
41370
  }
41305
- drop(asset, { position: { x, y }, uniqueName, urlSlug, }) {
41371
+ drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
41306
41372
  return __awaiter(this, void 0, void 0, function* () {
41307
41373
  try {
41308
41374
  const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
41309
41375
  assetId: asset.id,
41376
+ interactivePublicKey,
41310
41377
  position: { x, y },
41311
41378
  uniqueName,
41312
41379
  }, asset.requestOptions);
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.4"
62
+ "version": "0.3.6"
63
63
  }