@rtsdk/topia 0.3.4 → 0.3.5
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 +49 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +49 -1
- package/package.json +1 -1
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.
|
|
@@ -41304,11 +41351,12 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41304
41351
|
return droppedAsset;
|
|
41305
41352
|
});
|
|
41306
41353
|
}
|
|
41307
|
-
drop(asset, { position: { x, y }, uniqueName, urlSlug, }) {
|
|
41354
|
+
drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
|
|
41308
41355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41309
41356
|
try {
|
|
41310
41357
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41311
41358
|
assetId: asset.id,
|
|
41359
|
+
interactivePublicKey,
|
|
41312
41360
|
position: { x, y },
|
|
41313
41361
|
uniqueName,
|
|
41314
41362
|
}, 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.
|
|
@@ -1416,7 +1443,8 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
1416
1443
|
constructor(topia: Topia);
|
|
1417
1444
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
1418
1445
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
1419
|
-
drop(asset: Asset, { position: { x, y }, uniqueName, urlSlug, }: {
|
|
1446
|
+
drop(asset: Asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }: {
|
|
1447
|
+
interactivePublicKey?: string;
|
|
1420
1448
|
position: {
|
|
1421
1449
|
x: number;
|
|
1422
1450
|
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.
|
|
@@ -41302,11 +41349,12 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41302
41349
|
return droppedAsset;
|
|
41303
41350
|
});
|
|
41304
41351
|
}
|
|
41305
|
-
drop(asset, { position: { x, y }, uniqueName, urlSlug, }) {
|
|
41352
|
+
drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
|
|
41306
41353
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41307
41354
|
try {
|
|
41308
41355
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41309
41356
|
assetId: asset.id,
|
|
41357
|
+
interactivePublicKey,
|
|
41310
41358
|
position: { x, y },
|
|
41311
41359
|
uniqueName,
|
|
41312
41360
|
}, asset.requestOptions);
|
package/package.json
CHANGED