@rtsdk/topia 0.3.1 → 0.3.3

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
@@ -40445,7 +40445,7 @@ class World extends SDKController {
40445
40445
  *
40446
40446
  * @usage
40447
40447
  * ```ts
40448
- * await world.fetchDroppedAssets();
40448
+ * await world.fetchDroppedAssetsWithUniqueName();
40449
40449
  * const assets = world.droppedAssets;
40450
40450
  * ```
40451
40451
  */
@@ -40468,6 +40468,40 @@ class World extends SDKController {
40468
40468
  }
40469
40469
  });
40470
40470
  }
40471
+ /**
40472
+ * @summary
40473
+ * Retrieve all assets dropped in a world matching sceneDropId.
40474
+ *
40475
+ * @usage
40476
+ * ```ts
40477
+ * await world.fetchDroppedAssetsBySceneDropId({
40478
+ * sceneDropId: "sceneDropIdExample",
40479
+ * uniqueName: "optionalUniqueNameExample",
40480
+ * });
40481
+ * const assets = world.droppedAssets;
40482
+ * ```
40483
+ */
40484
+ fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
40485
+ return __awaiter(this, void 0, void 0, function* () {
40486
+ try {
40487
+ if (!sceneDropId)
40488
+ throw this.errorHandler({ message: "A sceneDropId is required." });
40489
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}?${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40490
+ // create temp map and then update private property only once
40491
+ const droppedAssets = [];
40492
+ for (const asset of response.data.assets) {
40493
+ droppedAssets.push(new DroppedAsset(this.topia, asset.id, this.urlSlug, {
40494
+ attributes: asset,
40495
+ credentials: this.credentials,
40496
+ }));
40497
+ }
40498
+ return droppedAssets;
40499
+ }
40500
+ catch (error) {
40501
+ throw this.errorHandler({ error });
40502
+ }
40503
+ });
40504
+ }
40471
40505
  /**
40472
40506
  * @summary
40473
40507
  * Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
@@ -40500,7 +40534,7 @@ class World extends SDKController {
40500
40534
  }
40501
40535
  /**
40502
40536
  * @summary
40503
- * Drop a scene in a world.
40537
+ * Drops a scene in a world and returns sceneDropId.
40504
40538
  *
40505
40539
  * @usage
40506
40540
  * ```ts
@@ -40513,11 +40547,17 @@ class World extends SDKController {
40513
40547
  * "assetSuffix": "string"
40514
40548
  * });
40515
40549
  * ```
40550
+ *
40551
+ * @result
40552
+ * ```ts
40553
+ * { sceneDropId: sceneId-timestamp, success: true }
40554
+ * ```
40516
40555
  */
40517
40556
  dropScene({ assetSuffix, position, sceneId, }) {
40518
40557
  return __awaiter(this, void 0, void 0, function* () {
40519
40558
  try {
40520
- 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;
40521
40561
  }
40522
40562
  catch (error) {
40523
40563
  throw this.errorHandler({ error });
@@ -40751,7 +40791,7 @@ class User extends SDKController {
40751
40791
  *
40752
40792
  * @usage
40753
40793
  * ```ts
40754
- * await user.updateUserDataObject({
40794
+ * await user.updateDataObject({
40755
40795
  * "exampleKey": "exampleValue",
40756
40796
  * });
40757
40797
  * ```
@@ -40940,7 +40980,7 @@ class Visitor extends User {
40940
40980
  *
40941
40981
  * @usage
40942
40982
  * ```ts
40943
- * const dataObject = await visitor.fetchVisitorDataObject();
40983
+ * const dataObject = await visitor.fetchDataObject();
40944
40984
  * ```
40945
40985
  */
40946
40986
  fetchDataObject() {
@@ -40963,7 +41003,7 @@ class Visitor extends User {
40963
41003
  *
40964
41004
  * @usage
40965
41005
  * ```ts
40966
- * await visitor.setVisitorDataObject({
41006
+ * await visitor.setDataObject({
40967
41007
  * "exampleKey": "exampleValue",
40968
41008
  * });
40969
41009
  * ```
@@ -40988,7 +41028,7 @@ class Visitor extends User {
40988
41028
  *
40989
41029
  * @usage
40990
41030
  * ```ts
40991
- * await visitor.updateVisitorDataObject({
41031
+ * await visitor.updateDataObject({
40992
41032
  * "exampleKey": "exampleValue",
40993
41033
  * });
40994
41034
  * ```
package/dist/index.d.ts CHANGED
@@ -428,7 +428,7 @@ declare class World extends SDKController implements WorldInterface {
428
428
  *
429
429
  * @usage
430
430
  * ```ts
431
- * await world.fetchDroppedAssets();
431
+ * await world.fetchDroppedAssetsWithUniqueName();
432
432
  * const assets = world.droppedAssets;
433
433
  * ```
434
434
  */
@@ -437,6 +437,23 @@ declare class World extends SDKController implements WorldInterface {
437
437
  isPartial?: boolean;
438
438
  isReversed?: boolean;
439
439
  }): Promise<DroppedAsset[]>;
440
+ /**
441
+ * @summary
442
+ * Retrieve all assets dropped in a world matching sceneDropId.
443
+ *
444
+ * @usage
445
+ * ```ts
446
+ * await world.fetchDroppedAssetsBySceneDropId({
447
+ * sceneDropId: "sceneDropIdExample",
448
+ * uniqueName: "optionalUniqueNameExample",
449
+ * });
450
+ * const assets = world.droppedAssets;
451
+ * ```
452
+ */
453
+ fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }: {
454
+ sceneDropId: string;
455
+ uniqueName?: string;
456
+ }): Promise<DroppedAsset[]>;
440
457
  /**
441
458
  * @summary
442
459
  * Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
@@ -460,7 +477,7 @@ declare class World extends SDKController implements WorldInterface {
460
477
  updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
461
478
  /**
462
479
  * @summary
463
- * Drop a scene in a world.
480
+ * Drops a scene in a world and returns sceneDropId.
464
481
  *
465
482
  * @usage
466
483
  * ```ts
@@ -473,12 +490,17 @@ declare class World extends SDKController implements WorldInterface {
473
490
  * "assetSuffix": "string"
474
491
  * });
475
492
  * ```
493
+ *
494
+ * @result
495
+ * ```ts
496
+ * { sceneDropId: sceneId-timestamp, success: true }
497
+ * ```
476
498
  */
477
499
  dropScene({ assetSuffix, position, sceneId, }: {
478
500
  assetSuffix: string;
479
501
  position: object;
480
502
  sceneId: string;
481
- }): Promise<void | ResponseType>;
503
+ }): Promise<object | ResponseType>;
482
504
  /**
483
505
  * @summary
484
506
  * Replace the current scene of a world.
@@ -659,7 +681,7 @@ declare class User extends SDKController implements UserInterface {
659
681
  *
660
682
  * @usage
661
683
  * ```ts
662
- * await user.updateUserDataObject({
684
+ * await user.updateDataObject({
663
685
  * "exampleKey": "exampleValue",
664
686
  * });
665
687
  * ```
@@ -770,7 +792,7 @@ declare class Visitor extends User implements VisitorInterface {
770
792
  *
771
793
  * @usage
772
794
  * ```ts
773
- * const dataObject = await visitor.fetchVisitorDataObject();
795
+ * const dataObject = await visitor.fetchDataObject();
774
796
  * ```
775
797
  */
776
798
  fetchDataObject(): Promise<void | ResponseType>;
@@ -782,7 +804,7 @@ declare class Visitor extends User implements VisitorInterface {
782
804
  *
783
805
  * @usage
784
806
  * ```ts
785
- * await visitor.setVisitorDataObject({
807
+ * await visitor.setDataObject({
786
808
  * "exampleKey": "exampleValue",
787
809
  * });
788
810
  * ```
@@ -801,7 +823,7 @@ declare class Visitor extends User implements VisitorInterface {
801
823
  *
802
824
  * @usage
803
825
  * ```ts
804
- * await visitor.updateVisitorDataObject({
826
+ * await visitor.updateDataObject({
805
827
  * "exampleKey": "exampleValue",
806
828
  * });
807
829
  * ```
@@ -1189,7 +1211,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1189
1211
  assetSuffix: string;
1190
1212
  position: object;
1191
1213
  sceneId: string;
1192
- }): Promise<void | ResponseType>;
1214
+ }): Promise<object | ResponseType>;
1193
1215
  replaceScene(sceneId: string): Promise<void | ResponseType>;
1194
1216
  fetchDataObject(): Promise<void | ResponseType>;
1195
1217
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
package/dist/index.js CHANGED
@@ -40443,7 +40443,7 @@ class World extends SDKController {
40443
40443
  *
40444
40444
  * @usage
40445
40445
  * ```ts
40446
- * await world.fetchDroppedAssets();
40446
+ * await world.fetchDroppedAssetsWithUniqueName();
40447
40447
  * const assets = world.droppedAssets;
40448
40448
  * ```
40449
40449
  */
@@ -40466,6 +40466,40 @@ class World extends SDKController {
40466
40466
  }
40467
40467
  });
40468
40468
  }
40469
+ /**
40470
+ * @summary
40471
+ * Retrieve all assets dropped in a world matching sceneDropId.
40472
+ *
40473
+ * @usage
40474
+ * ```ts
40475
+ * await world.fetchDroppedAssetsBySceneDropId({
40476
+ * sceneDropId: "sceneDropIdExample",
40477
+ * uniqueName: "optionalUniqueNameExample",
40478
+ * });
40479
+ * const assets = world.droppedAssets;
40480
+ * ```
40481
+ */
40482
+ fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
40483
+ return __awaiter(this, void 0, void 0, function* () {
40484
+ try {
40485
+ if (!sceneDropId)
40486
+ throw this.errorHandler({ message: "A sceneDropId is required." });
40487
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}?${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40488
+ // create temp map and then update private property only once
40489
+ const droppedAssets = [];
40490
+ for (const asset of response.data.assets) {
40491
+ droppedAssets.push(new DroppedAsset(this.topia, asset.id, this.urlSlug, {
40492
+ attributes: asset,
40493
+ credentials: this.credentials,
40494
+ }));
40495
+ }
40496
+ return droppedAssets;
40497
+ }
40498
+ catch (error) {
40499
+ throw this.errorHandler({ error });
40500
+ }
40501
+ });
40502
+ }
40469
40503
  /**
40470
40504
  * @summary
40471
40505
  * Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
@@ -40498,7 +40532,7 @@ class World extends SDKController {
40498
40532
  }
40499
40533
  /**
40500
40534
  * @summary
40501
- * Drop a scene in a world.
40535
+ * Drops a scene in a world and returns sceneDropId.
40502
40536
  *
40503
40537
  * @usage
40504
40538
  * ```ts
@@ -40511,11 +40545,17 @@ class World extends SDKController {
40511
40545
  * "assetSuffix": "string"
40512
40546
  * });
40513
40547
  * ```
40548
+ *
40549
+ * @result
40550
+ * ```ts
40551
+ * { sceneDropId: sceneId-timestamp, success: true }
40552
+ * ```
40514
40553
  */
40515
40554
  dropScene({ assetSuffix, position, sceneId, }) {
40516
40555
  return __awaiter(this, void 0, void 0, function* () {
40517
40556
  try {
40518
- 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;
40519
40559
  }
40520
40560
  catch (error) {
40521
40561
  throw this.errorHandler({ error });
@@ -40749,7 +40789,7 @@ class User extends SDKController {
40749
40789
  *
40750
40790
  * @usage
40751
40791
  * ```ts
40752
- * await user.updateUserDataObject({
40792
+ * await user.updateDataObject({
40753
40793
  * "exampleKey": "exampleValue",
40754
40794
  * });
40755
40795
  * ```
@@ -40938,7 +40978,7 @@ class Visitor extends User {
40938
40978
  *
40939
40979
  * @usage
40940
40980
  * ```ts
40941
- * const dataObject = await visitor.fetchVisitorDataObject();
40981
+ * const dataObject = await visitor.fetchDataObject();
40942
40982
  * ```
40943
40983
  */
40944
40984
  fetchDataObject() {
@@ -40961,7 +41001,7 @@ class Visitor extends User {
40961
41001
  *
40962
41002
  * @usage
40963
41003
  * ```ts
40964
- * await visitor.setVisitorDataObject({
41004
+ * await visitor.setDataObject({
40965
41005
  * "exampleKey": "exampleValue",
40966
41006
  * });
40967
41007
  * ```
@@ -40986,7 +41026,7 @@ class Visitor extends User {
40986
41026
  *
40987
41027
  * @usage
40988
41028
  * ```ts
40989
- * await visitor.updateVisitorDataObject({
41029
+ * await visitor.updateDataObject({
40990
41030
  * "exampleKey": "exampleValue",
40991
41031
  * });
40992
41032
  * ```
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.1"
62
+ "version": "0.3.3"
63
63
  }