@rtsdk/topia 0.3.9 → 0.4.0
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 +45 -3
- package/dist/index.d.ts +33 -1
- package/dist/index.js +45 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39637,14 +39637,14 @@ const {
|
|
|
39637
39637
|
*/
|
|
39638
39638
|
class SDKController {
|
|
39639
39639
|
constructor(topia, credentials = {}) {
|
|
39640
|
-
const { apiKey = null, assetId = null, interactiveNonce = null, profileId = null, visitorId = null } = credentials;
|
|
39640
|
+
const { apiKey = null, assetId = null, interactiveNonce = null, profileId = null, urlSlug = null, visitorId = null, } = credentials;
|
|
39641
39641
|
this.topia = topia;
|
|
39642
39642
|
this.credentials = credentials;
|
|
39643
39643
|
this.requestOptions = {};
|
|
39644
39644
|
let payload = {};
|
|
39645
39645
|
const headers = {};
|
|
39646
39646
|
try {
|
|
39647
|
-
if (topia.interactiveSecret && (profileId || assetId)) {
|
|
39647
|
+
if (topia.interactiveSecret && (profileId || assetId || urlSlug)) {
|
|
39648
39648
|
payload = {
|
|
39649
39649
|
interactiveNonce,
|
|
39650
39650
|
visitorId,
|
|
@@ -40267,7 +40267,7 @@ var _World_droppedAssetsMap;
|
|
|
40267
40267
|
*/
|
|
40268
40268
|
class World extends SDKController {
|
|
40269
40269
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40270
|
-
super(topia, options.credentials);
|
|
40270
|
+
super(topia, Object.assign({ urlSlug }, options.credentials));
|
|
40271
40271
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40272
40272
|
////////// data objects
|
|
40273
40273
|
/**
|
|
@@ -40534,6 +40534,8 @@ class World extends SDKController {
|
|
|
40534
40534
|
});
|
|
40535
40535
|
}
|
|
40536
40536
|
/**
|
|
40537
|
+
* @deprecated Use {@link fetchScenes} instead.
|
|
40538
|
+
*
|
|
40537
40539
|
* @summary
|
|
40538
40540
|
* Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
|
|
40539
40541
|
*
|
|
@@ -40559,6 +40561,46 @@ class World extends SDKController {
|
|
|
40559
40561
|
}
|
|
40560
40562
|
});
|
|
40561
40563
|
}
|
|
40564
|
+
/**
|
|
40565
|
+
* @summary
|
|
40566
|
+
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
40567
|
+
*
|
|
40568
|
+
* @usage
|
|
40569
|
+
* ```ts
|
|
40570
|
+
* await world.fetchScenes();
|
|
40571
|
+
* ```
|
|
40572
|
+
*
|
|
40573
|
+
* @result
|
|
40574
|
+
* ```ts
|
|
40575
|
+
* { "scenes": {
|
|
40576
|
+
* "sceneDropId_1": {
|
|
40577
|
+
* "droppedAssets": {
|
|
40578
|
+
* "droppedAssetId_1": {
|
|
40579
|
+
* "metaName": "hello"
|
|
40580
|
+
* "metaNameReversed": "olleh"
|
|
40581
|
+
* },
|
|
40582
|
+
* "droppedAssetId_2": {
|
|
40583
|
+
* "metaName": "world"
|
|
40584
|
+
* "metaNameReversed": "dlorw"
|
|
40585
|
+
* }
|
|
40586
|
+
* }
|
|
40587
|
+
* },
|
|
40588
|
+
* }
|
|
40589
|
+
* }
|
|
40590
|
+
* ```
|
|
40591
|
+
*/
|
|
40592
|
+
fetchScenes() {
|
|
40593
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40594
|
+
try {
|
|
40595
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes-with-dropped-assets`, this.requestOptions);
|
|
40596
|
+
this.scenes = response.data;
|
|
40597
|
+
return response.data;
|
|
40598
|
+
}
|
|
40599
|
+
catch (error) {
|
|
40600
|
+
throw this.errorHandler({ error });
|
|
40601
|
+
}
|
|
40602
|
+
});
|
|
40603
|
+
}
|
|
40562
40604
|
/**
|
|
40563
40605
|
* @summary
|
|
40564
40606
|
* Drops a scene in a world and returns sceneDropId.
|
package/dist/index.d.ts
CHANGED
|
@@ -270,7 +270,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
270
270
|
* await droppedAsset.updatePosition(100,200);
|
|
271
271
|
* ```
|
|
272
272
|
*/
|
|
273
|
-
updatePosition(x: number, y: number, yOrderAdjust
|
|
273
|
+
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType>;
|
|
274
274
|
/**
|
|
275
275
|
* @summary
|
|
276
276
|
* Updates private zone options for a dropped asset.
|
|
@@ -374,6 +374,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
374
374
|
urlSlug: string;
|
|
375
375
|
dataObject?: object | null | undefined;
|
|
376
376
|
sceneDropIds?: [string] | null | undefined;
|
|
377
|
+
scenes?: [string] | null | undefined;
|
|
377
378
|
webhooks?: WorldWebhooksInterface | null | undefined;
|
|
378
379
|
constructor(topia: Topia, urlSlug: string, options?: WorldOptionalInterface);
|
|
379
380
|
get droppedAssets(): {
|
|
@@ -478,6 +479,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
478
479
|
*/
|
|
479
480
|
updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
|
|
480
481
|
/**
|
|
482
|
+
* @deprecated Use {@link fetchScenes} instead.
|
|
483
|
+
*
|
|
481
484
|
* @summary
|
|
482
485
|
* Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
|
|
483
486
|
*
|
|
@@ -492,6 +495,35 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
492
495
|
* ```
|
|
493
496
|
*/
|
|
494
497
|
fetchSceneDropIds(): Promise<object | ResponseType>;
|
|
498
|
+
/**
|
|
499
|
+
* @summary
|
|
500
|
+
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
501
|
+
*
|
|
502
|
+
* @usage
|
|
503
|
+
* ```ts
|
|
504
|
+
* await world.fetchScenes();
|
|
505
|
+
* ```
|
|
506
|
+
*
|
|
507
|
+
* @result
|
|
508
|
+
* ```ts
|
|
509
|
+
* { "scenes": {
|
|
510
|
+
* "sceneDropId_1": {
|
|
511
|
+
* "droppedAssets": {
|
|
512
|
+
* "droppedAssetId_1": {
|
|
513
|
+
* "metaName": "hello"
|
|
514
|
+
* "metaNameReversed": "olleh"
|
|
515
|
+
* },
|
|
516
|
+
* "droppedAssetId_2": {
|
|
517
|
+
* "metaName": "world"
|
|
518
|
+
* "metaNameReversed": "dlorw"
|
|
519
|
+
* }
|
|
520
|
+
* }
|
|
521
|
+
* },
|
|
522
|
+
* }
|
|
523
|
+
* }
|
|
524
|
+
* ```
|
|
525
|
+
*/
|
|
526
|
+
fetchScenes(): Promise<object | ResponseType>;
|
|
495
527
|
/**
|
|
496
528
|
* @summary
|
|
497
529
|
* Drops a scene in a world and returns sceneDropId.
|
package/dist/index.js
CHANGED
|
@@ -39635,14 +39635,14 @@ const {
|
|
|
39635
39635
|
*/
|
|
39636
39636
|
class SDKController {
|
|
39637
39637
|
constructor(topia, credentials = {}) {
|
|
39638
|
-
const { apiKey = null, assetId = null, interactiveNonce = null, profileId = null, visitorId = null } = credentials;
|
|
39638
|
+
const { apiKey = null, assetId = null, interactiveNonce = null, profileId = null, urlSlug = null, visitorId = null, } = credentials;
|
|
39639
39639
|
this.topia = topia;
|
|
39640
39640
|
this.credentials = credentials;
|
|
39641
39641
|
this.requestOptions = {};
|
|
39642
39642
|
let payload = {};
|
|
39643
39643
|
const headers = {};
|
|
39644
39644
|
try {
|
|
39645
|
-
if (topia.interactiveSecret && (profileId || assetId)) {
|
|
39645
|
+
if (topia.interactiveSecret && (profileId || assetId || urlSlug)) {
|
|
39646
39646
|
payload = {
|
|
39647
39647
|
interactiveNonce,
|
|
39648
39648
|
visitorId,
|
|
@@ -40265,7 +40265,7 @@ var _World_droppedAssetsMap;
|
|
|
40265
40265
|
*/
|
|
40266
40266
|
class World extends SDKController {
|
|
40267
40267
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40268
|
-
super(topia, options.credentials);
|
|
40268
|
+
super(topia, Object.assign({ urlSlug }, options.credentials));
|
|
40269
40269
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40270
40270
|
////////// data objects
|
|
40271
40271
|
/**
|
|
@@ -40532,6 +40532,8 @@ class World extends SDKController {
|
|
|
40532
40532
|
});
|
|
40533
40533
|
}
|
|
40534
40534
|
/**
|
|
40535
|
+
* @deprecated Use {@link fetchScenes} instead.
|
|
40536
|
+
*
|
|
40535
40537
|
* @summary
|
|
40536
40538
|
* Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
|
|
40537
40539
|
*
|
|
@@ -40557,6 +40559,46 @@ class World extends SDKController {
|
|
|
40557
40559
|
}
|
|
40558
40560
|
});
|
|
40559
40561
|
}
|
|
40562
|
+
/**
|
|
40563
|
+
* @summary
|
|
40564
|
+
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
40565
|
+
*
|
|
40566
|
+
* @usage
|
|
40567
|
+
* ```ts
|
|
40568
|
+
* await world.fetchScenes();
|
|
40569
|
+
* ```
|
|
40570
|
+
*
|
|
40571
|
+
* @result
|
|
40572
|
+
* ```ts
|
|
40573
|
+
* { "scenes": {
|
|
40574
|
+
* "sceneDropId_1": {
|
|
40575
|
+
* "droppedAssets": {
|
|
40576
|
+
* "droppedAssetId_1": {
|
|
40577
|
+
* "metaName": "hello"
|
|
40578
|
+
* "metaNameReversed": "olleh"
|
|
40579
|
+
* },
|
|
40580
|
+
* "droppedAssetId_2": {
|
|
40581
|
+
* "metaName": "world"
|
|
40582
|
+
* "metaNameReversed": "dlorw"
|
|
40583
|
+
* }
|
|
40584
|
+
* }
|
|
40585
|
+
* },
|
|
40586
|
+
* }
|
|
40587
|
+
* }
|
|
40588
|
+
* ```
|
|
40589
|
+
*/
|
|
40590
|
+
fetchScenes() {
|
|
40591
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40592
|
+
try {
|
|
40593
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes-with-dropped-assets`, this.requestOptions);
|
|
40594
|
+
this.scenes = response.data;
|
|
40595
|
+
return response.data;
|
|
40596
|
+
}
|
|
40597
|
+
catch (error) {
|
|
40598
|
+
throw this.errorHandler({ error });
|
|
40599
|
+
}
|
|
40600
|
+
});
|
|
40601
|
+
}
|
|
40560
40602
|
/**
|
|
40561
40603
|
* @summary
|
|
40562
40604
|
* Drops a scene in a world and returns sceneDropId.
|
package/package.json
CHANGED