@rtsdk/topia 0.3.7 → 0.3.9
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 +16 -2
- package/dist/index.cjs +28 -3
- package/dist/index.d.ts +38 -4
- package/dist/index.js +28 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,8 +10,22 @@ A Topia provided API Key can be included with every object initialization as a p
|
|
|
10
10
|
|
|
11
11
|
### Want to build interactive assets? This is how you can get started:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
Getting a Key Pair:
|
|
14
|
+
|
|
15
|
+
- Navigate directly to your [integrations page](https://topia.io/t/dashboard/integrations) or follow the steps below from within a world.
|
|
16
|
+
- Click on your image (or circle) at the top left of the left hand navbar.
|
|
17
|
+
- Click Edit Profile. This will bring you to a separate dashboard.
|
|
18
|
+
- Click Integrations on the left nav
|
|
19
|
+
- Click the “Add Key Pair” button. This is going to be your public / private key pair for your app.
|
|
20
|
+
|
|
21
|
+
Adding a Key Pair to an asset:
|
|
22
|
+
|
|
23
|
+
Make an asset “interactive” by adding your PUBLIC key to the integrations page of the asset editor.
|
|
24
|
+
|
|
25
|
+
- Go back to your world. Make sure you are in “Edit Mode” by toggling on Edit on the left nav bar
|
|
26
|
+
- Hover over any asset. Click the pencil icon that should show up on hover and select “Edit”
|
|
27
|
+
- Go to the Integrations tab
|
|
28
|
+
- At the bottom, you'll see a section that says “Add player session credentials to asset interactions”. Toggle that on. Now webhooks that fire from this asset and iframes that open from this asset will include the following values:
|
|
15
29
|
- assetId
|
|
16
30
|
- interactivePublicKey
|
|
17
31
|
- interactiveNonce
|
package/dist/index.cjs
CHANGED
|
@@ -40049,9 +40049,9 @@ class DroppedAsset extends Asset {
|
|
|
40049
40049
|
* await droppedAsset.updatePosition(100,200);
|
|
40050
40050
|
* ```
|
|
40051
40051
|
*/
|
|
40052
|
-
updatePosition(x, y) {
|
|
40052
|
+
updatePosition(x, y, yOrderAdjust) {
|
|
40053
40053
|
try {
|
|
40054
|
-
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { x, y }, "set-position");
|
|
40054
|
+
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { x, y, yOrderAdjust }, "set-position");
|
|
40055
40055
|
}
|
|
40056
40056
|
catch (error) {
|
|
40057
40057
|
throw this.errorHandler({ error });
|
|
@@ -40269,6 +40269,7 @@ class World extends SDKController {
|
|
|
40269
40269
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40270
40270
|
super(topia, options.credentials);
|
|
40271
40271
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40272
|
+
////////// data objects
|
|
40272
40273
|
/**
|
|
40273
40274
|
* @summary
|
|
40274
40275
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
@@ -40642,6 +40643,28 @@ class World extends SDKController {
|
|
|
40642
40643
|
}
|
|
40643
40644
|
});
|
|
40644
40645
|
}
|
|
40646
|
+
////////// webhooks
|
|
40647
|
+
/**
|
|
40648
|
+
* @summary
|
|
40649
|
+
* Retrieve all webhooks in a world.
|
|
40650
|
+
*
|
|
40651
|
+
* @usage
|
|
40652
|
+
* ```ts
|
|
40653
|
+
* await world.fetchWebhooks();
|
|
40654
|
+
* const webhooks = world.webhooks;
|
|
40655
|
+
* ```
|
|
40656
|
+
*/
|
|
40657
|
+
fetchWebhooks() {
|
|
40658
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40659
|
+
try {
|
|
40660
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/webhooks`, this.requestOptions);
|
|
40661
|
+
this.webhooks = response.data;
|
|
40662
|
+
}
|
|
40663
|
+
catch (error) {
|
|
40664
|
+
throw this.errorHandler({ error });
|
|
40665
|
+
}
|
|
40666
|
+
});
|
|
40667
|
+
}
|
|
40645
40668
|
}
|
|
40646
40669
|
_World_droppedAssetsMap = new WeakMap();
|
|
40647
40670
|
|
|
@@ -41370,14 +41393,16 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41370
41393
|
return droppedAsset;
|
|
41371
41394
|
});
|
|
41372
41395
|
}
|
|
41373
|
-
drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
|
|
41396
|
+
drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41374
41397
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41375
41398
|
try {
|
|
41376
41399
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41377
41400
|
assetId: asset.id,
|
|
41378
41401
|
interactivePublicKey,
|
|
41379
41402
|
position: { x, y },
|
|
41403
|
+
sceneDropId,
|
|
41380
41404
|
uniqueName,
|
|
41405
|
+
yOrderAdjust,
|
|
41381
41406
|
}, asset.requestOptions);
|
|
41382
41407
|
const { id } = response.data;
|
|
41383
41408
|
return new DroppedAsset(this.topia, id, urlSlug, { credentials: asset.credentials });
|
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): Promise<void | ResponseType>;
|
|
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
|
+
webhooks?: WorldWebhooksInterface | null | undefined;
|
|
377
378
|
constructor(topia: Topia, urlSlug: string, options?: WorldOptionalInterface);
|
|
378
379
|
get droppedAssets(): {
|
|
379
380
|
[key: string]: DroppedAsset;
|
|
@@ -606,6 +607,17 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
606
607
|
releaseLock?: boolean;
|
|
607
608
|
};
|
|
608
609
|
}): Promise<void | ResponseType>;
|
|
610
|
+
/**
|
|
611
|
+
* @summary
|
|
612
|
+
* Retrieve all webhooks in a world.
|
|
613
|
+
*
|
|
614
|
+
* @usage
|
|
615
|
+
* ```ts
|
|
616
|
+
* await world.fetchWebhooks();
|
|
617
|
+
* const webhooks = world.webhooks;
|
|
618
|
+
* ```
|
|
619
|
+
*/
|
|
620
|
+
fetchWebhooks(): Promise<void | ResponseType>;
|
|
609
621
|
}
|
|
610
622
|
|
|
611
623
|
/**
|
|
@@ -987,7 +999,7 @@ interface DroppedAssetInterface extends AssetInterface {
|
|
|
987
999
|
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType>;
|
|
988
1000
|
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType>;
|
|
989
1001
|
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType>;
|
|
990
|
-
updatePosition(x: number, y: number): Promise<void | ResponseType>;
|
|
1002
|
+
updatePosition(x: number, y: number, yOrderAdjust: number): Promise<void | ResponseType>;
|
|
991
1003
|
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType>;
|
|
992
1004
|
updateScale(assetScale: number): Promise<void | ResponseType>;
|
|
993
1005
|
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType>;
|
|
@@ -1047,6 +1059,7 @@ interface DroppedAssetInterface extends AssetInterface {
|
|
|
1047
1059
|
portalCoordsY?: number | null;
|
|
1048
1060
|
showMediaAsIfPeer?: boolean | null;
|
|
1049
1061
|
syncUserMedia?: boolean | null;
|
|
1062
|
+
uniqueName?: string | null;
|
|
1050
1063
|
urlSlug: string;
|
|
1051
1064
|
tagJson?: string | null;
|
|
1052
1065
|
text?: string | null;
|
|
@@ -1150,6 +1163,7 @@ interface UserInterface {
|
|
|
1150
1163
|
fetchDataObject(): Promise<void | ResponseType>;
|
|
1151
1164
|
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
|
|
1152
1165
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
1166
|
+
dataObject?: object | null;
|
|
1153
1167
|
}
|
|
1154
1168
|
interface UserOptionalInterface {
|
|
1155
1169
|
credentials?: InteractiveCredentials | object;
|
|
@@ -1213,6 +1227,21 @@ interface OpenIframeInterface {
|
|
|
1213
1227
|
title?: string;
|
|
1214
1228
|
}
|
|
1215
1229
|
|
|
1230
|
+
interface WebhookInterface {
|
|
1231
|
+
webhookId?: string;
|
|
1232
|
+
assetId?: string;
|
|
1233
|
+
active: boolean;
|
|
1234
|
+
dataObject?: object;
|
|
1235
|
+
dateAdded: Date;
|
|
1236
|
+
description: string;
|
|
1237
|
+
isUniqueOnly: boolean;
|
|
1238
|
+
lastUpdated?: Date;
|
|
1239
|
+
title: string;
|
|
1240
|
+
type: string;
|
|
1241
|
+
url: string;
|
|
1242
|
+
urlSlug: string;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1216
1245
|
interface WorldActivityOptionalInterface {
|
|
1217
1246
|
credentials?: InteractiveCredentials | object;
|
|
1218
1247
|
}
|
|
@@ -1275,6 +1304,9 @@ interface WorldOptionalInterface {
|
|
|
1275
1304
|
attributes?: WorldDetailsInterface | object;
|
|
1276
1305
|
credentials?: InteractiveCredentials | object;
|
|
1277
1306
|
}
|
|
1307
|
+
interface WorldWebhooksInterface {
|
|
1308
|
+
webhooks: Array<WebhookInterface>;
|
|
1309
|
+
}
|
|
1278
1310
|
|
|
1279
1311
|
/**
|
|
1280
1312
|
* @summary
|
|
@@ -1453,14 +1485,16 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
1453
1485
|
constructor(topia: Topia);
|
|
1454
1486
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
1455
1487
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
1456
|
-
drop(asset: Asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }: {
|
|
1488
|
+
drop(asset: Asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }: {
|
|
1457
1489
|
interactivePublicKey?: string;
|
|
1458
1490
|
position: {
|
|
1459
1491
|
x: number;
|
|
1460
1492
|
y: number;
|
|
1461
1493
|
};
|
|
1494
|
+
sceneDropId?: string;
|
|
1462
1495
|
uniqueName?: string;
|
|
1463
1496
|
urlSlug: string;
|
|
1497
|
+
yOrderAdjust?: number;
|
|
1464
1498
|
}): Promise<DroppedAsset>;
|
|
1465
1499
|
}
|
|
1466
1500
|
|
|
@@ -1496,4 +1530,4 @@ declare class WorldFactory {
|
|
|
1496
1530
|
create(urlSlug: string, options?: WorldOptionalInterface): World;
|
|
1497
1531
|
}
|
|
1498
1532
|
|
|
1499
|
-
export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions };
|
|
1533
|
+
export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
|
package/dist/index.js
CHANGED
|
@@ -40047,9 +40047,9 @@ class DroppedAsset extends Asset {
|
|
|
40047
40047
|
* await droppedAsset.updatePosition(100,200);
|
|
40048
40048
|
* ```
|
|
40049
40049
|
*/
|
|
40050
|
-
updatePosition(x, y) {
|
|
40050
|
+
updatePosition(x, y, yOrderAdjust) {
|
|
40051
40051
|
try {
|
|
40052
|
-
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { x, y }, "set-position");
|
|
40052
|
+
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { x, y, yOrderAdjust }, "set-position");
|
|
40053
40053
|
}
|
|
40054
40054
|
catch (error) {
|
|
40055
40055
|
throw this.errorHandler({ error });
|
|
@@ -40267,6 +40267,7 @@ class World extends SDKController {
|
|
|
40267
40267
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40268
40268
|
super(topia, options.credentials);
|
|
40269
40269
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40270
|
+
////////// data objects
|
|
40270
40271
|
/**
|
|
40271
40272
|
* @summary
|
|
40272
40273
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
@@ -40640,6 +40641,28 @@ class World extends SDKController {
|
|
|
40640
40641
|
}
|
|
40641
40642
|
});
|
|
40642
40643
|
}
|
|
40644
|
+
////////// webhooks
|
|
40645
|
+
/**
|
|
40646
|
+
* @summary
|
|
40647
|
+
* Retrieve all webhooks in a world.
|
|
40648
|
+
*
|
|
40649
|
+
* @usage
|
|
40650
|
+
* ```ts
|
|
40651
|
+
* await world.fetchWebhooks();
|
|
40652
|
+
* const webhooks = world.webhooks;
|
|
40653
|
+
* ```
|
|
40654
|
+
*/
|
|
40655
|
+
fetchWebhooks() {
|
|
40656
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40657
|
+
try {
|
|
40658
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/webhooks`, this.requestOptions);
|
|
40659
|
+
this.webhooks = response.data;
|
|
40660
|
+
}
|
|
40661
|
+
catch (error) {
|
|
40662
|
+
throw this.errorHandler({ error });
|
|
40663
|
+
}
|
|
40664
|
+
});
|
|
40665
|
+
}
|
|
40643
40666
|
}
|
|
40644
40667
|
_World_droppedAssetsMap = new WeakMap();
|
|
40645
40668
|
|
|
@@ -41368,14 +41391,16 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41368
41391
|
return droppedAsset;
|
|
41369
41392
|
});
|
|
41370
41393
|
}
|
|
41371
|
-
drop(asset, { interactivePublicKey, position: { x, y }, uniqueName, urlSlug, }) {
|
|
41394
|
+
drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41372
41395
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41373
41396
|
try {
|
|
41374
41397
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41375
41398
|
assetId: asset.id,
|
|
41376
41399
|
interactivePublicKey,
|
|
41377
41400
|
position: { x, y },
|
|
41401
|
+
sceneDropId,
|
|
41378
41402
|
uniqueName,
|
|
41403
|
+
yOrderAdjust,
|
|
41379
41404
|
}, asset.requestOptions);
|
|
41380
41405
|
const { id } = response.data;
|
|
41381
41406
|
return new DroppedAsset(this.topia, id, urlSlug, { credentials: asset.credentials });
|
package/package.json
CHANGED