@rtsdk/topia 0.19.3 → 0.19.4
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 +424 -51
- package/dist/index.d.ts +437 -280
- package/dist/index.js +424 -51
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ type DroppedAssetLinkType = {
|
|
|
74
74
|
linkSamlQueryParams?: string;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
type InteractiveCredentials
|
|
77
|
+
type InteractiveCredentials = {
|
|
78
78
|
apiKey?: string;
|
|
79
79
|
assetId?: string;
|
|
80
80
|
interactiveNonce?: string;
|
|
@@ -88,25 +88,25 @@ type InteractiveCredentials$1 = {
|
|
|
88
88
|
|
|
89
89
|
type AssetOptions = {
|
|
90
90
|
attributes?: AssetInterface | undefined;
|
|
91
|
-
credentials?: InteractiveCredentials
|
|
91
|
+
credentials?: InteractiveCredentials | undefined;
|
|
92
92
|
};
|
|
93
93
|
type DroppedAssetOptions = {
|
|
94
94
|
attributes?: DroppedAssetInterface | undefined;
|
|
95
|
-
credentials?: InteractiveCredentials
|
|
95
|
+
credentials?: InteractiveCredentials | undefined;
|
|
96
96
|
};
|
|
97
97
|
type UserOptions = {
|
|
98
|
-
credentials?: InteractiveCredentials
|
|
98
|
+
credentials?: InteractiveCredentials | undefined;
|
|
99
99
|
};
|
|
100
100
|
type VisitorOptions = {
|
|
101
101
|
attributes?: VisitorInterface | undefined;
|
|
102
|
-
credentials?: InteractiveCredentials
|
|
102
|
+
credentials?: InteractiveCredentials | undefined;
|
|
103
103
|
};
|
|
104
104
|
type WorldOptions = {
|
|
105
105
|
attributes?: WorldDetailsInterface | undefined;
|
|
106
|
-
credentials?: InteractiveCredentials
|
|
106
|
+
credentials?: InteractiveCredentials | undefined;
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
type ResponseType
|
|
109
|
+
type ResponseType = {
|
|
110
110
|
message?: string;
|
|
111
111
|
statusCode?: number;
|
|
112
112
|
success?: boolean;
|
|
@@ -139,7 +139,7 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
139
139
|
* const { name } = scene;
|
|
140
140
|
* ```
|
|
141
141
|
*/
|
|
142
|
-
fetchSceneById(): Promise<void | ResponseType
|
|
142
|
+
fetchSceneById(): Promise<void | ResponseType>;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/**
|
|
@@ -178,7 +178,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
178
178
|
* const { assetName } = droppedAsset;
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
|
-
fetchDroppedAssetById(): Promise<void | ResponseType
|
|
181
|
+
fetchDroppedAssetById(): Promise<void | ResponseType>;
|
|
182
182
|
/**
|
|
183
183
|
* Updates dropped asset details and assigns the response data to the instance. Requires Public Key to have the `canUpdateDroppedAssets` permission.
|
|
184
184
|
*
|
|
@@ -211,7 +211,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
211
211
|
* const { assetName } = droppedAsset;
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
updateDroppedAsset({ assetScale, audioRadius, audioSliderVolume, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isInteractive, isTextTopLayer, isVideo, interactivePublicKey, layer0, layer1, mediaLink, mediaName, mediaType, portalName, position, specialType, syncUserMedia, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }: UpdateDroppedAssetInterface): Promise<void | ResponseType
|
|
214
|
+
updateDroppedAsset({ assetScale, audioRadius, audioSliderVolume, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isInteractive, isTextTopLayer, isVideo, interactivePublicKey, layer0, layer1, mediaLink, mediaName, mediaType, portalName, position, specialType, syncUserMedia, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }: UpdateDroppedAssetInterface): Promise<void | ResponseType>;
|
|
215
215
|
/**
|
|
216
216
|
* Deletes the dropped asset (removes it from the world).
|
|
217
217
|
*
|
|
@@ -222,7 +222,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
222
222
|
* await droppedAsset.deleteDroppedAsset();
|
|
223
223
|
* ```
|
|
224
224
|
*/
|
|
225
|
-
deleteDroppedAsset(): Promise<void | ResponseType
|
|
225
|
+
deleteDroppedAsset(): Promise<void | ResponseType>;
|
|
226
226
|
/**
|
|
227
227
|
* Retrieves the data object for a dropped asset.
|
|
228
228
|
*
|
|
@@ -237,7 +237,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
237
237
|
*
|
|
238
238
|
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
239
239
|
*/
|
|
240
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
240
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
241
241
|
/**
|
|
242
242
|
* Sets the data object for a dropped asset and assigns the response data to the instance.
|
|
243
243
|
*
|
|
@@ -271,7 +271,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
271
271
|
lockId: string;
|
|
272
272
|
releaseLock?: boolean;
|
|
273
273
|
};
|
|
274
|
-
}): Promise<void | ResponseType
|
|
274
|
+
}): Promise<void | ResponseType>;
|
|
275
275
|
/**
|
|
276
276
|
* Updates the data object for a dropped asset and assigns the response data to the instance.
|
|
277
277
|
*
|
|
@@ -302,7 +302,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
302
302
|
lockId: string;
|
|
303
303
|
releaseLock?: boolean;
|
|
304
304
|
};
|
|
305
|
-
}): Promise<void | ResponseType
|
|
305
|
+
}): Promise<void | ResponseType>;
|
|
306
306
|
/**
|
|
307
307
|
* Increments a specific value in the data object for a dropped asset by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
308
308
|
*
|
|
@@ -328,7 +328,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
328
328
|
lockId: string;
|
|
329
329
|
releaseLock?: boolean;
|
|
330
330
|
};
|
|
331
|
-
}): Promise<void | ResponseType
|
|
331
|
+
}): Promise<void | ResponseType>;
|
|
332
332
|
/**
|
|
333
333
|
* Updates broadcast options for a dropped asset.
|
|
334
334
|
*
|
|
@@ -345,7 +345,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
345
345
|
*
|
|
346
346
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
347
347
|
*/
|
|
348
|
-
updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType
|
|
348
|
+
updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType>;
|
|
349
349
|
/**
|
|
350
350
|
* Updates click options for a dropped asset.
|
|
351
351
|
*
|
|
@@ -369,7 +369,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
369
369
|
*
|
|
370
370
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
371
371
|
*/
|
|
372
|
-
updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType
|
|
372
|
+
updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType>;
|
|
373
373
|
/**
|
|
374
374
|
* Adds an array of links to an asset. Maximum is 20 links.
|
|
375
375
|
*
|
|
@@ -397,7 +397,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
397
397
|
*
|
|
398
398
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
399
399
|
*/
|
|
400
|
-
setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType
|
|
400
|
+
setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType>;
|
|
401
401
|
/**
|
|
402
402
|
* Updates multiple clickable links for a dropped asset.
|
|
403
403
|
*
|
|
@@ -419,7 +419,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
419
419
|
*
|
|
420
420
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
421
421
|
*/
|
|
422
|
-
updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType
|
|
422
|
+
updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType>;
|
|
423
423
|
/**
|
|
424
424
|
* Removes a clickable link from a dropped asset.
|
|
425
425
|
*
|
|
@@ -432,7 +432,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
432
432
|
*
|
|
433
433
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
434
434
|
*/
|
|
435
|
-
removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType
|
|
435
|
+
removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType>;
|
|
436
436
|
/**
|
|
437
437
|
* Updates text and style of a dropped asset.
|
|
438
438
|
*
|
|
@@ -452,7 +452,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
452
452
|
*
|
|
453
453
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
454
454
|
*/
|
|
455
|
-
updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType
|
|
455
|
+
updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType>;
|
|
456
456
|
/**
|
|
457
457
|
* Updates media options for a dropped asset.
|
|
458
458
|
*
|
|
@@ -474,7 +474,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
474
474
|
*
|
|
475
475
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
476
476
|
*/
|
|
477
|
-
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType
|
|
477
|
+
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType>;
|
|
478
478
|
/**
|
|
479
479
|
* Updates mute zone options for a dropped asset.
|
|
480
480
|
*
|
|
@@ -487,7 +487,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
487
487
|
*
|
|
488
488
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
489
489
|
*/
|
|
490
|
-
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType
|
|
490
|
+
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType>;
|
|
491
491
|
/**
|
|
492
492
|
* Updates landmark zone options for a dropped asset.
|
|
493
493
|
*
|
|
@@ -508,7 +508,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
508
508
|
isLandmarkZoneEnabled: boolean;
|
|
509
509
|
landmarkZoneName?: string;
|
|
510
510
|
landmarkZoneIsVisible?: boolean;
|
|
511
|
-
}): Promise<void | ResponseType
|
|
511
|
+
}): Promise<void | ResponseType>;
|
|
512
512
|
/**
|
|
513
513
|
* Updates webhook zone options for a dropped asset.
|
|
514
514
|
*
|
|
@@ -521,7 +521,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
521
521
|
*
|
|
522
522
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
523
523
|
*/
|
|
524
|
-
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType
|
|
524
|
+
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType>;
|
|
525
525
|
/**
|
|
526
526
|
* Moves a dropped asset to specified coordinates.
|
|
527
527
|
*
|
|
@@ -534,7 +534,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
534
534
|
*
|
|
535
535
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
536
536
|
*/
|
|
537
|
-
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType
|
|
537
|
+
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType>;
|
|
538
538
|
/**
|
|
539
539
|
* Updates private zone options for a dropped asset.
|
|
540
540
|
*
|
|
@@ -551,7 +551,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
551
551
|
*
|
|
552
552
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
553
553
|
*/
|
|
554
|
-
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType
|
|
554
|
+
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType>;
|
|
555
555
|
/**
|
|
556
556
|
* Updates the size of a dropped asset.
|
|
557
557
|
*
|
|
@@ -564,7 +564,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
564
564
|
*
|
|
565
565
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
566
566
|
*/
|
|
567
|
-
updateScale(assetScale: number): Promise<void | ResponseType
|
|
567
|
+
updateScale(assetScale: number): Promise<void | ResponseType>;
|
|
568
568
|
/**
|
|
569
569
|
* Flip an dropped asset.
|
|
570
570
|
*
|
|
@@ -577,7 +577,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
577
577
|
*
|
|
578
578
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
579
579
|
*/
|
|
580
|
-
flip(): Promise<void | ResponseType
|
|
580
|
+
flip(): Promise<void | ResponseType>;
|
|
581
581
|
/**
|
|
582
582
|
* Change or remove media embedded in a dropped asset.
|
|
583
583
|
*
|
|
@@ -590,7 +590,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
590
590
|
*
|
|
591
591
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
592
592
|
*/
|
|
593
|
-
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType
|
|
593
|
+
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType>;
|
|
594
594
|
/**
|
|
595
595
|
* Change or remove top and bottom layers of a dropped asset.
|
|
596
596
|
*
|
|
@@ -603,7 +603,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
603
603
|
*
|
|
604
604
|
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
605
605
|
*/
|
|
606
|
-
updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType
|
|
606
|
+
updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType>;
|
|
607
607
|
/**
|
|
608
608
|
* Add a webhook to a dropped asset
|
|
609
609
|
*
|
|
@@ -650,7 +650,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
650
650
|
setInteractiveSettings({ isInteractive, interactivePublicKey, }: {
|
|
651
651
|
isInteractive?: boolean;
|
|
652
652
|
interactivePublicKey: string;
|
|
653
|
-
}): Promise<void | ResponseType
|
|
653
|
+
}): Promise<void | ResponseType>;
|
|
654
654
|
/**
|
|
655
655
|
* Checks if this dropped asset exists with the current app's public key installed.
|
|
656
656
|
*
|
|
@@ -686,7 +686,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
686
686
|
periodType: "week" | "month" | "quarter" | "year";
|
|
687
687
|
dateValue: number;
|
|
688
688
|
year: number;
|
|
689
|
-
}): Promise<void | ResponseType
|
|
689
|
+
}): Promise<void | ResponseType>;
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
/**
|
|
@@ -724,7 +724,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
724
724
|
* const { name } = world;
|
|
725
725
|
* ```
|
|
726
726
|
*/
|
|
727
|
-
fetchDetails(): Promise<void | ResponseType
|
|
727
|
+
fetchDetails(): Promise<void | ResponseType>;
|
|
728
728
|
/**
|
|
729
729
|
* Update details of a world.
|
|
730
730
|
*
|
|
@@ -750,7 +750,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
750
750
|
* const { name, description } = world;
|
|
751
751
|
* ```
|
|
752
752
|
*/
|
|
753
|
-
updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType
|
|
753
|
+
updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType>;
|
|
754
754
|
/**
|
|
755
755
|
* Set close world settings
|
|
756
756
|
*
|
|
@@ -779,7 +779,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
779
779
|
updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }: {
|
|
780
780
|
closeWorldDescription: string;
|
|
781
781
|
isWorldClosed: boolean;
|
|
782
|
-
}): Promise<void | ResponseType
|
|
782
|
+
}): Promise<void | ResponseType>;
|
|
783
783
|
/**
|
|
784
784
|
* Retrieve all assets dropped in a world.
|
|
785
785
|
*
|
|
@@ -793,7 +793,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
793
793
|
* const assets = world.droppedAssets;
|
|
794
794
|
* ```
|
|
795
795
|
*/
|
|
796
|
-
fetchDroppedAssets(): Promise<void | ResponseType
|
|
796
|
+
fetchDroppedAssets(): Promise<void | ResponseType>;
|
|
797
797
|
/**
|
|
798
798
|
* Retrieve all assets dropped in a world matching uniqueName.
|
|
799
799
|
*
|
|
@@ -888,7 +888,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
888
888
|
* { sceneDropIds: [] }
|
|
889
889
|
* ```
|
|
890
890
|
*/
|
|
891
|
-
fetchSceneDropIds(): Promise<object | ResponseType
|
|
891
|
+
fetchSceneDropIds(): Promise<object | ResponseType>;
|
|
892
892
|
/**
|
|
893
893
|
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
894
894
|
*
|
|
@@ -920,7 +920,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
920
920
|
* }
|
|
921
921
|
* ```
|
|
922
922
|
*/
|
|
923
|
-
fetchScenes(): Promise<object | ResponseType
|
|
923
|
+
fetchScenes(): Promise<object | ResponseType>;
|
|
924
924
|
/**
|
|
925
925
|
* Drops a scene in a world and returns sceneDropId.
|
|
926
926
|
*
|
|
@@ -951,7 +951,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
951
951
|
position: object;
|
|
952
952
|
sceneDropId?: string;
|
|
953
953
|
sceneId: string;
|
|
954
|
-
}): Promise<ResponseType
|
|
954
|
+
}): Promise<ResponseType>;
|
|
955
955
|
/**
|
|
956
956
|
* Replace the current scene of a world.
|
|
957
957
|
*
|
|
@@ -974,7 +974,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
974
974
|
*
|
|
975
975
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
976
976
|
*/
|
|
977
|
-
replaceScene(sceneId: string): Promise<void | ResponseType
|
|
977
|
+
replaceScene(sceneId: string): Promise<void | ResponseType>;
|
|
978
978
|
/**
|
|
979
979
|
* Get all particles available
|
|
980
980
|
*
|
|
@@ -989,7 +989,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
989
989
|
* @returns {Promise<ResponseType>} Returns an array of particles or an error response.
|
|
990
990
|
* ```
|
|
991
991
|
*/
|
|
992
|
-
getAllParticles(): Promise<object | ResponseType
|
|
992
|
+
getAllParticles(): Promise<object | ResponseType>;
|
|
993
993
|
/**
|
|
994
994
|
* Trigger a particle effect at a position in the world
|
|
995
995
|
*
|
|
@@ -1011,7 +1011,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1011
1011
|
name?: string;
|
|
1012
1012
|
duration?: number;
|
|
1013
1013
|
position?: object;
|
|
1014
|
-
}): Promise<ResponseType
|
|
1014
|
+
}): Promise<ResponseType | string>;
|
|
1015
1015
|
/**
|
|
1016
1016
|
* Add an activity to a world
|
|
1017
1017
|
* excludeFromNotification is an array of visitorIds to exclude from the notification
|
|
@@ -1029,7 +1029,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1029
1029
|
type: WorldActivityType;
|
|
1030
1030
|
assetId: string;
|
|
1031
1031
|
excludeFromNotification?: (string | number)[];
|
|
1032
|
-
}): Promise<ResponseType
|
|
1032
|
+
}): Promise<ResponseType | string>;
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Display a message via a toast to all visitors currently in a world.
|
|
1035
1035
|
*
|
|
@@ -1046,7 +1046,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1046
1046
|
*
|
|
1047
1047
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1048
1048
|
*/
|
|
1049
|
-
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType
|
|
1049
|
+
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
|
|
1050
1050
|
/**
|
|
1051
1051
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
1052
1052
|
*
|
|
@@ -1060,7 +1060,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1060
1060
|
* const { dataObject } = world;
|
|
1061
1061
|
* ```
|
|
1062
1062
|
*/
|
|
1063
|
-
fetchDataObject: (appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string) => Promise<void | ResponseType
|
|
1063
|
+
fetchDataObject: (appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string) => Promise<void | ResponseType>;
|
|
1064
1064
|
/**
|
|
1065
1065
|
* Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
|
|
1066
1066
|
*
|
|
@@ -1093,7 +1093,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1093
1093
|
lockId: string;
|
|
1094
1094
|
releaseLock?: boolean;
|
|
1095
1095
|
};
|
|
1096
|
-
}) => Promise<void | ResponseType
|
|
1096
|
+
}) => Promise<void | ResponseType>;
|
|
1097
1097
|
/**
|
|
1098
1098
|
* Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
1099
1099
|
*
|
|
@@ -1123,7 +1123,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1123
1123
|
lockId: string;
|
|
1124
1124
|
releaseLock?: boolean;
|
|
1125
1125
|
};
|
|
1126
|
-
}) => Promise<void | ResponseType
|
|
1126
|
+
}) => Promise<void | ResponseType>;
|
|
1127
1127
|
/**
|
|
1128
1128
|
* Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
1129
1129
|
*
|
|
@@ -1149,7 +1149,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1149
1149
|
lockId: string;
|
|
1150
1150
|
releaseLock?: boolean;
|
|
1151
1151
|
};
|
|
1152
|
-
}): Promise<void | ResponseType
|
|
1152
|
+
}): Promise<void | ResponseType>;
|
|
1153
1153
|
/**
|
|
1154
1154
|
* Retrieve all webhooks in a world.
|
|
1155
1155
|
*
|
|
@@ -1163,7 +1163,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1163
1163
|
* const webhooks = world.webhooks;
|
|
1164
1164
|
* ```
|
|
1165
1165
|
*/
|
|
1166
|
-
fetchWebhooks(): Promise<void | ResponseType
|
|
1166
|
+
fetchWebhooks(): Promise<void | ResponseType>;
|
|
1167
1167
|
/**
|
|
1168
1168
|
* Retrieve world analytics by day, week, month, quarter, or year
|
|
1169
1169
|
*
|
|
@@ -1184,7 +1184,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1184
1184
|
periodType: "week" | "month" | "quarter" | "year";
|
|
1185
1185
|
dateValue: number;
|
|
1186
1186
|
year: number;
|
|
1187
|
-
}): Promise<void | ResponseType
|
|
1187
|
+
}): Promise<void | ResponseType>;
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
1190
|
/**
|
|
@@ -1192,6 +1192,10 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1192
1192
|
*
|
|
1193
1193
|
* @remarks
|
|
1194
1194
|
* This class should be instantiated via UserInventoryItemFactory only.
|
|
1195
|
+
* UserInventoryItem represents an instance of an InventoryItem owned by a specific user or visitor.
|
|
1196
|
+
* It includes ownership details like quantity, grant_source, and user-specific metadata.
|
|
1197
|
+
*
|
|
1198
|
+
* @keywords inventory, item, user, visitor, owned, granted
|
|
1195
1199
|
*
|
|
1196
1200
|
* @property inventoryItemId - The root inventory item's id
|
|
1197
1201
|
*/
|
|
@@ -1205,53 +1209,26 @@ declare class UserInventoryItem extends InventoryItem implements UserInventoryIt
|
|
|
1205
1209
|
metadata?: object | null;
|
|
1206
1210
|
grant_source: string;
|
|
1207
1211
|
type: string;
|
|
1212
|
+
image_url: string;
|
|
1208
1213
|
profile_id?: string | null;
|
|
1209
1214
|
item: UserInventoryItemMetadataType;
|
|
1210
1215
|
constructor(topia: Topia, id: string, options?: UserInventoryItemOptionalInterface);
|
|
1211
1216
|
/**
|
|
1212
1217
|
* Fetches the user inventory item details from the platform and assigns them to this instance.
|
|
1213
1218
|
*
|
|
1214
|
-
* @
|
|
1215
|
-
* ```ts
|
|
1216
|
-
* await userInventoryItem.fetchUserInventoryItemById();
|
|
1217
|
-
* ```
|
|
1219
|
+
* @keywords get, fetch, retrieve, load, user, inventory, item, details, owned
|
|
1218
1220
|
*
|
|
1219
|
-
* @
|
|
1220
|
-
*/
|
|
1221
|
-
fetchUserInventoryItemById(): Promise<void>;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
/**
|
|
1225
|
-
* InventoryItem represents an item in a user's inventory.
|
|
1226
|
-
*
|
|
1227
|
-
* @remarks
|
|
1228
|
-
* This class should be instantiated via InventoryFactory only.
|
|
1229
|
-
*
|
|
1230
|
-
* @keywords inventory, item, asset, object
|
|
1231
|
-
*/
|
|
1232
|
-
declare class InventoryItem extends SDKController implements InventoryItemInterface {
|
|
1233
|
-
id: string;
|
|
1234
|
-
name?: string;
|
|
1235
|
-
description?: string;
|
|
1236
|
-
type?: string;
|
|
1237
|
-
created_at?: Date;
|
|
1238
|
-
updated_at?: Date;
|
|
1239
|
-
metadata?: object | null;
|
|
1240
|
-
image_path?: string;
|
|
1241
|
-
interactive_key_id?: string;
|
|
1242
|
-
status?: string;
|
|
1243
|
-
constructor(topia: Topia, id: string, options?: InventoryItemOptionalInterface);
|
|
1244
|
-
/**
|
|
1245
|
-
* Fetches the inventory item details from the platform and assigns them to this instance.
|
|
1221
|
+
* @category Inventory
|
|
1246
1222
|
*
|
|
1247
1223
|
* @example
|
|
1248
1224
|
* ```ts
|
|
1249
|
-
* await
|
|
1225
|
+
* await userInventoryItem.fetchUserInventoryItemById();
|
|
1226
|
+
* const { quantity, grant_source, item } = userInventoryItem;
|
|
1250
1227
|
* ```
|
|
1251
1228
|
*
|
|
1252
|
-
* @returns {Promise<
|
|
1229
|
+
* @returns {Promise<void>} Populates this UserInventoryItem instance with all properties from the platform.
|
|
1253
1230
|
*/
|
|
1254
|
-
|
|
1231
|
+
fetchUserInventoryItemById(): Promise<void>;
|
|
1255
1232
|
}
|
|
1256
1233
|
|
|
1257
1234
|
/**
|
|
@@ -1285,7 +1262,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1285
1262
|
get worlds(): {
|
|
1286
1263
|
[key: string]: World;
|
|
1287
1264
|
};
|
|
1288
|
-
checkInteractiveCredentials(): Promise<void | ResponseType
|
|
1265
|
+
checkInteractiveCredentials(): Promise<void | ResponseType>;
|
|
1289
1266
|
/**
|
|
1290
1267
|
* Returns all avatars owned by User
|
|
1291
1268
|
*
|
|
@@ -1300,7 +1277,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1300
1277
|
*
|
|
1301
1278
|
* @returns {Promise<void | ResponseType>} Returns the avatars or an error.
|
|
1302
1279
|
*/
|
|
1303
|
-
fetchAvatars(): Promise<void | ResponseType
|
|
1280
|
+
fetchAvatars(): Promise<void | ResponseType>;
|
|
1304
1281
|
/**
|
|
1305
1282
|
* Add a new avatar
|
|
1306
1283
|
*
|
|
@@ -1374,7 +1351,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1374
1351
|
* await user.uploadAvatarFiles("exampleAvatarId", formData);
|
|
1375
1352
|
* ```
|
|
1376
1353
|
*/
|
|
1377
|
-
addAvatar(formData: FormData): Promise<void | ResponseType
|
|
1354
|
+
addAvatar(formData: FormData): Promise<void | ResponseType>;
|
|
1378
1355
|
/**
|
|
1379
1356
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1380
1357
|
*
|
|
@@ -1448,7 +1425,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1448
1425
|
* await user.uploadAvatarFiles("exampleAvatarId", formData);
|
|
1449
1426
|
* ```
|
|
1450
1427
|
*/
|
|
1451
|
-
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType
|
|
1428
|
+
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType>;
|
|
1452
1429
|
/**
|
|
1453
1430
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1454
1431
|
*
|
|
@@ -1461,7 +1438,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1461
1438
|
* await user.deleteAvatar("exampleAvatarId");
|
|
1462
1439
|
* ```
|
|
1463
1440
|
*/
|
|
1464
|
-
deleteAvatar(avatarId: string): Promise<void | ResponseType
|
|
1441
|
+
deleteAvatar(avatarId: string): Promise<void | ResponseType>;
|
|
1465
1442
|
/**
|
|
1466
1443
|
* Returns all assets owned by User when an email address is provided.
|
|
1467
1444
|
*
|
|
@@ -1475,7 +1452,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1475
1452
|
* const userAssets = user.assets;
|
|
1476
1453
|
* ```
|
|
1477
1454
|
*/
|
|
1478
|
-
fetchAssets(): Promise<void | ResponseType
|
|
1455
|
+
fetchAssets(): Promise<void | ResponseType>;
|
|
1479
1456
|
/**
|
|
1480
1457
|
* Returns all platform assets.
|
|
1481
1458
|
*
|
|
@@ -1490,7 +1467,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1490
1467
|
*
|
|
1491
1468
|
* @returns {Promise<object | ResponseType>} Returns the platform assets or an error response.
|
|
1492
1469
|
*/
|
|
1493
|
-
fetchPlatformAssets(): Promise<object | ResponseType
|
|
1470
|
+
fetchPlatformAssets(): Promise<object | ResponseType>;
|
|
1494
1471
|
/**
|
|
1495
1472
|
* Returns all scenes owned by User.
|
|
1496
1473
|
*
|
|
@@ -1504,7 +1481,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1504
1481
|
* const userScenes = user.scenes;
|
|
1505
1482
|
* ```
|
|
1506
1483
|
*/
|
|
1507
|
-
fetchScenes(): Promise<void | ResponseType
|
|
1484
|
+
fetchScenes(): Promise<void | ResponseType>;
|
|
1508
1485
|
/**
|
|
1509
1486
|
* Retrieves all worlds owned by user with matching API Key, creates a new World object for each, and creates new map of Worlds accessible via user.worlds.
|
|
1510
1487
|
*
|
|
@@ -1523,7 +1500,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1523
1500
|
* { urlSlug: new World({ apiKey, worldArgs, urlSlug }) }
|
|
1524
1501
|
* ```
|
|
1525
1502
|
*/
|
|
1526
|
-
fetchWorldsByKey(): Promise<void | ResponseType
|
|
1503
|
+
fetchWorldsByKey(): Promise<void | ResponseType>;
|
|
1527
1504
|
/**
|
|
1528
1505
|
* Retrieves all worlds a user with matching API Key is an admin in, creates a new World object for each, and creates new map of Worlds accessible via user.adminWorlds.
|
|
1529
1506
|
*
|
|
@@ -1537,7 +1514,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1537
1514
|
* const adminWorlds = user.adminWorlds;
|
|
1538
1515
|
* ```
|
|
1539
1516
|
*/
|
|
1540
|
-
fetchAdminWorldsByKey(): Promise<void | ResponseType
|
|
1517
|
+
fetchAdminWorldsByKey(): Promise<void | ResponseType>;
|
|
1541
1518
|
/**
|
|
1542
1519
|
* Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
|
|
1543
1520
|
*
|
|
@@ -1553,7 +1530,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1553
1530
|
*
|
|
1554
1531
|
* @returns {Promise<object | ResponseType>} Returns the `urlSlugs` of worlds where the Public Key is found or an error response.
|
|
1555
1532
|
*/
|
|
1556
|
-
fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType
|
|
1533
|
+
fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType>;
|
|
1557
1534
|
/**
|
|
1558
1535
|
* Send an email
|
|
1559
1536
|
*
|
|
@@ -1571,7 +1548,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1571
1548
|
html: string;
|
|
1572
1549
|
subject: string;
|
|
1573
1550
|
to: string;
|
|
1574
|
-
}): Promise<object | ResponseType
|
|
1551
|
+
}): Promise<object | ResponseType>;
|
|
1575
1552
|
/**
|
|
1576
1553
|
* Get expressions
|
|
1577
1554
|
*
|
|
@@ -1589,7 +1566,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1589
1566
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1590
1567
|
name?: string;
|
|
1591
1568
|
getUnlockablesOnly?: boolean;
|
|
1592
|
-
}): Promise<ResponseType
|
|
1569
|
+
}): Promise<ResponseType>;
|
|
1593
1570
|
/**
|
|
1594
1571
|
* Retrieves the data object for a user.
|
|
1595
1572
|
*
|
|
@@ -1604,7 +1581,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1604
1581
|
*
|
|
1605
1582
|
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1606
1583
|
*/
|
|
1607
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType
|
|
1584
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType>;
|
|
1608
1585
|
/**
|
|
1609
1586
|
* Sets the data object for a user.
|
|
1610
1587
|
*
|
|
@@ -1638,7 +1615,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1638
1615
|
lockId: string;
|
|
1639
1616
|
releaseLock?: boolean;
|
|
1640
1617
|
};
|
|
1641
|
-
}): Promise<void | ResponseType
|
|
1618
|
+
}): Promise<void | ResponseType>;
|
|
1642
1619
|
/**
|
|
1643
1620
|
* Updates the data object for a user.
|
|
1644
1621
|
*
|
|
@@ -1670,7 +1647,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1670
1647
|
lockId: string;
|
|
1671
1648
|
releaseLock?: boolean;
|
|
1672
1649
|
};
|
|
1673
|
-
}): Promise<void | ResponseType
|
|
1650
|
+
}): Promise<void | ResponseType>;
|
|
1674
1651
|
/**
|
|
1675
1652
|
* Increments a specific value in the data object for a user by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
1676
1653
|
*
|
|
@@ -1696,7 +1673,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1696
1673
|
lockId: string;
|
|
1697
1674
|
releaseLock?: boolean;
|
|
1698
1675
|
};
|
|
1699
|
-
}): Promise<void | ResponseType
|
|
1676
|
+
}): Promise<void | ResponseType>;
|
|
1700
1677
|
/**
|
|
1701
1678
|
* Retrieves all inventory items owned by this user and app's key.
|
|
1702
1679
|
*
|
|
@@ -1724,7 +1701,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1724
1701
|
*
|
|
1725
1702
|
* @returns {Promise<UserInventoryItem>} Returns the UserInventoryItem granted.
|
|
1726
1703
|
*/
|
|
1727
|
-
grantInventoryItem(item:
|
|
1704
|
+
grantInventoryItem(item: InventoryItemInterface, quantity?: number): Promise<UserInventoryItem>;
|
|
1728
1705
|
/**
|
|
1729
1706
|
* Modifies the quantity of an inventory item in this user's inventory.
|
|
1730
1707
|
*
|
|
@@ -1738,7 +1715,45 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1738
1715
|
*
|
|
1739
1716
|
* @returns {Promise<UserInventoryItem>} Returns the updated inventory item or a response object.
|
|
1740
1717
|
*/
|
|
1741
|
-
modifyInventoryItemQuantity(item:
|
|
1718
|
+
modifyInventoryItemQuantity(item: UserInventoryItemInterface, quantity: number): Promise<UserInventoryItem>;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* InventoryItem represents an item in a user's inventory.
|
|
1723
|
+
*
|
|
1724
|
+
* @remarks
|
|
1725
|
+
* This class should be instantiated via InventoryFactory only.
|
|
1726
|
+
*
|
|
1727
|
+
* @keywords inventory, item, asset, object
|
|
1728
|
+
*/
|
|
1729
|
+
declare class InventoryItem extends SDKController implements InventoryItemInterface {
|
|
1730
|
+
id: string;
|
|
1731
|
+
name?: string;
|
|
1732
|
+
description?: string;
|
|
1733
|
+
type?: string;
|
|
1734
|
+
created_at?: Date;
|
|
1735
|
+
updated_at?: Date;
|
|
1736
|
+
metadata?: object | null;
|
|
1737
|
+
image_path?: string;
|
|
1738
|
+
interactive_key_id?: string;
|
|
1739
|
+
status?: string;
|
|
1740
|
+
constructor(topia: Topia, id: string, options?: InventoryItemOptionalInterface);
|
|
1741
|
+
/**
|
|
1742
|
+
* Fetches the inventory item details from the platform and assigns them to this instance.
|
|
1743
|
+
*
|
|
1744
|
+
* @keywords get, fetch, retrieve, load, inventory, item, details
|
|
1745
|
+
*
|
|
1746
|
+
* @category Inventory
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
* ```ts
|
|
1750
|
+
* await item.fetchInventoryItemById();
|
|
1751
|
+
* const { name, description, type } = item;
|
|
1752
|
+
* ```
|
|
1753
|
+
*
|
|
1754
|
+
* @returns {Promise<InventoryItem>} Returns this InventoryItem instance with all properties populated from the platform.
|
|
1755
|
+
*/
|
|
1756
|
+
fetchInventoryItemById(): Promise<InventoryItem>;
|
|
1742
1757
|
}
|
|
1743
1758
|
|
|
1744
1759
|
/**
|
|
@@ -1770,7 +1785,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1770
1785
|
* @returns
|
|
1771
1786
|
* Returns details for a visitor in a world by id and urlSlug
|
|
1772
1787
|
*/
|
|
1773
|
-
fetchVisitor(): Promise<void | ResponseType
|
|
1788
|
+
fetchVisitor(): Promise<void | ResponseType>;
|
|
1774
1789
|
/**
|
|
1775
1790
|
* Teleport or walk a visitor currently in a world to a single set of coordinates.
|
|
1776
1791
|
*
|
|
@@ -1788,7 +1803,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1788
1803
|
* @returns
|
|
1789
1804
|
* Returns `{ success: true }` if the visitor was moved successfully.
|
|
1790
1805
|
*/
|
|
1791
|
-
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType
|
|
1806
|
+
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
|
|
1792
1807
|
/**
|
|
1793
1808
|
* Display a message via a toast to a visitor currently in a world.
|
|
1794
1809
|
*
|
|
@@ -1805,7 +1820,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1805
1820
|
*
|
|
1806
1821
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1807
1822
|
*/
|
|
1808
|
-
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType
|
|
1823
|
+
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
|
|
1809
1824
|
/**
|
|
1810
1825
|
* Open an iframe in a drawer or modal for a visitor currently in a world.
|
|
1811
1826
|
*
|
|
@@ -1825,7 +1840,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1825
1840
|
*
|
|
1826
1841
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1827
1842
|
*/
|
|
1828
|
-
openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType
|
|
1843
|
+
openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType>;
|
|
1829
1844
|
/**
|
|
1830
1845
|
* Reload an iframe for a visitor currently in a world.
|
|
1831
1846
|
*
|
|
@@ -1840,7 +1855,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1840
1855
|
*
|
|
1841
1856
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1842
1857
|
*/
|
|
1843
|
-
reloadIframe(droppedAssetId: string): Promise<void | ResponseType
|
|
1858
|
+
reloadIframe(droppedAssetId: string): Promise<void | ResponseType>;
|
|
1844
1859
|
/**
|
|
1845
1860
|
* Close an iframe for a visitor currently in a world.
|
|
1846
1861
|
*
|
|
@@ -1855,7 +1870,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1855
1870
|
*
|
|
1856
1871
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1857
1872
|
*/
|
|
1858
|
-
closeIframe(droppedAssetId: string): Promise<void | ResponseType
|
|
1873
|
+
closeIframe(droppedAssetId: string): Promise<void | ResponseType>;
|
|
1859
1874
|
/**
|
|
1860
1875
|
* Mute and turn video off for a visitor currently in a world.
|
|
1861
1876
|
*
|
|
@@ -1868,7 +1883,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1868
1883
|
*
|
|
1869
1884
|
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1870
1885
|
*/
|
|
1871
|
-
turnAVOff(): Promise<void | ResponseType
|
|
1886
|
+
turnAVOff(): Promise<void | ResponseType>;
|
|
1872
1887
|
/**
|
|
1873
1888
|
* Get expressions
|
|
1874
1889
|
*
|
|
@@ -1885,7 +1900,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1885
1900
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1886
1901
|
name?: string;
|
|
1887
1902
|
getUnlockablesOnly?: boolean;
|
|
1888
|
-
}): Promise<ResponseType
|
|
1903
|
+
}): Promise<ResponseType>;
|
|
1889
1904
|
/**
|
|
1890
1905
|
* Grant expression to a visitor by id or name.
|
|
1891
1906
|
*
|
|
@@ -1904,7 +1919,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1904
1919
|
grantExpression({ id, name }: {
|
|
1905
1920
|
id?: string;
|
|
1906
1921
|
name?: string;
|
|
1907
|
-
}): Promise<ResponseType
|
|
1922
|
+
}): Promise<ResponseType>;
|
|
1908
1923
|
/**
|
|
1909
1924
|
* Get all particles available
|
|
1910
1925
|
*
|
|
@@ -1919,7 +1934,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1919
1934
|
*
|
|
1920
1935
|
* @returns {Promise<ResponseType>} Returns an array of particles or an error response.
|
|
1921
1936
|
*/
|
|
1922
|
-
getAllParticles(): Promise<ResponseType
|
|
1937
|
+
getAllParticles(): Promise<ResponseType>;
|
|
1923
1938
|
/**
|
|
1924
1939
|
* Trigger a particle effect on a visitor
|
|
1925
1940
|
*
|
|
@@ -1938,7 +1953,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1938
1953
|
id?: string;
|
|
1939
1954
|
name?: string;
|
|
1940
1955
|
duration?: number;
|
|
1941
|
-
}): Promise<ResponseType
|
|
1956
|
+
}): Promise<ResponseType | string>;
|
|
1942
1957
|
/**
|
|
1943
1958
|
* Retrieves the data object for a visitor.
|
|
1944
1959
|
*
|
|
@@ -1953,7 +1968,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1953
1968
|
*
|
|
1954
1969
|
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1955
1970
|
*/
|
|
1956
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
1971
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
1957
1972
|
/**
|
|
1958
1973
|
* Sets the data object for a visitor.
|
|
1959
1974
|
*
|
|
@@ -1987,7 +2002,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1987
2002
|
lockId: string;
|
|
1988
2003
|
releaseLock?: boolean;
|
|
1989
2004
|
};
|
|
1990
|
-
}): Promise<void | ResponseType
|
|
2005
|
+
}): Promise<void | ResponseType>;
|
|
1991
2006
|
/**
|
|
1992
2007
|
* Updates the data object for a visitor.
|
|
1993
2008
|
*
|
|
@@ -2019,7 +2034,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2019
2034
|
lockId: string;
|
|
2020
2035
|
releaseLock?: boolean;
|
|
2021
2036
|
};
|
|
2022
|
-
}): Promise<void | ResponseType
|
|
2037
|
+
}): Promise<void | ResponseType>;
|
|
2023
2038
|
/**
|
|
2024
2039
|
* Increments a specific value in the data object for a visitor by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
2025
2040
|
*
|
|
@@ -2045,7 +2060,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2045
2060
|
lockId: string;
|
|
2046
2061
|
releaseLock?: boolean;
|
|
2047
2062
|
};
|
|
2048
|
-
}): Promise<void | ResponseType
|
|
2063
|
+
}): Promise<void | ResponseType>;
|
|
2049
2064
|
/**
|
|
2050
2065
|
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
2051
2066
|
*
|
|
@@ -2056,7 +2071,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2056
2071
|
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
2057
2072
|
* ```
|
|
2058
2073
|
*/
|
|
2059
|
-
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType
|
|
2074
|
+
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType>;
|
|
2060
2075
|
/**
|
|
2061
2076
|
* Setup signal to visitor
|
|
2062
2077
|
*
|
|
@@ -2067,7 +2082,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2067
2082
|
* await visitor.sendSignalToVisitor(iceServers);
|
|
2068
2083
|
* ```
|
|
2069
2084
|
*/
|
|
2070
|
-
sendSignalToVisitor(signal: any): Promise<void | (ResponseType
|
|
2085
|
+
sendSignalToVisitor(signal: any): Promise<void | (ResponseType & {
|
|
2071
2086
|
answerSignal: any;
|
|
2072
2087
|
})>;
|
|
2073
2088
|
/**
|
|
@@ -2084,23 +2099,52 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2084
2099
|
*/
|
|
2085
2100
|
fetchInventoryItem(item: InventoryItem): Promise<UserInventoryItem>;
|
|
2086
2101
|
/**
|
|
2087
|
-
*
|
|
2102
|
+
* Retrieves the NPC (Non-Player Character) associated with this visitor, if one exists.
|
|
2103
|
+
*
|
|
2104
|
+
* @remarks
|
|
2105
|
+
* Each visitor can have one NPC per application public key. NPCs are AI-controlled
|
|
2106
|
+
* characters that follow the visitor around the world. They are created using inventory
|
|
2107
|
+
* items of type "npc" and appear as additional avatars that track the visitor's position.
|
|
2108
|
+
* If no NPC exists for this visitor and app, returns null.
|
|
2109
|
+
*
|
|
2110
|
+
* @keywords get, fetch, retrieve, npc, bot, follower, character, assistant, companion
|
|
2111
|
+
*
|
|
2112
|
+
* @category NPCs
|
|
2088
2113
|
*
|
|
2089
2114
|
* @example
|
|
2090
2115
|
* ```ts
|
|
2091
|
-
* await visitor.getNpc();
|
|
2116
|
+
* const npc = await visitor.getNpc();
|
|
2117
|
+
* if (npc) {
|
|
2118
|
+
* console.log(`NPC position: ${npc.position}`);
|
|
2119
|
+
* console.log(`NPC ID: ${npc.id}`);
|
|
2120
|
+
* } else {
|
|
2121
|
+
* console.log('No NPC found for this visitor');
|
|
2122
|
+
* }
|
|
2092
2123
|
* ```
|
|
2093
2124
|
*
|
|
2094
|
-
* @returns {Promise<Visitor | null>} Returns a Visitor object representing the NPC.
|
|
2125
|
+
* @returns {Promise<Visitor | null>} Returns a Visitor object representing the NPC, or null if none exists.
|
|
2095
2126
|
*/
|
|
2096
2127
|
getNpc(): Promise<Visitor | null>;
|
|
2097
2128
|
/**
|
|
2098
|
-
* Creates an NPC that follows this visitor using an inventory item the visitor owns.
|
|
2099
|
-
*
|
|
2129
|
+
* Creates an NPC (Non-Player Character) that follows this visitor using an inventory item the visitor owns.
|
|
2130
|
+
*
|
|
2131
|
+
* @remarks
|
|
2132
|
+
* One NPC is allowed per visitor, per application public key. NPCs are AI-controlled
|
|
2133
|
+
* characters that automatically follow the visitor around the world. They appear as
|
|
2134
|
+
* additional avatars and can be useful for companions, guides, or assistant characters.
|
|
2135
|
+
*
|
|
2136
|
+
* Requirements:
|
|
2137
|
+
* - The visitor must own a user inventory item of type "npc"
|
|
2138
|
+
* - The item must have been granted to the visitor before calling this method
|
|
2139
|
+
* - Only one NPC can exist per visitor per app at a time
|
|
2140
|
+
*
|
|
2141
|
+
* @keywords create, spawn, add, npc, bot, follower, character, assistant, companion
|
|
2100
2142
|
*
|
|
2101
|
-
* @
|
|
2102
|
-
*
|
|
2103
|
-
* @param
|
|
2143
|
+
* @category NPCs
|
|
2144
|
+
*
|
|
2145
|
+
* @param userInventoryItemId - The ID of the user's inventory item (must be an NPC type item owned by this visitor)
|
|
2146
|
+
* @param options - Optional configuration for the NPC
|
|
2147
|
+
* @param options.showNameplate - Whether to display a nameplate above the NPC (default: true)
|
|
2104
2148
|
*
|
|
2105
2149
|
* @example
|
|
2106
2150
|
* ```ts
|
|
@@ -2114,17 +2158,31 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2114
2158
|
* const npc = await visitor.createNpc(userItem.id, { showNameplate: false });
|
|
2115
2159
|
* ```
|
|
2116
2160
|
*
|
|
2117
|
-
* @returns {Promise<Visitor>} Returns a Visitor object representing the created NPC.
|
|
2161
|
+
* @returns {Promise<Visitor>} Returns a Visitor object representing the created NPC. The NPC will automatically follow the visitor.
|
|
2118
2162
|
*/
|
|
2119
2163
|
createNpc(userInventoryItemId: string, options?: {
|
|
2120
2164
|
showNameplate?: boolean;
|
|
2121
2165
|
}): Promise<Visitor>;
|
|
2122
2166
|
/**
|
|
2123
|
-
* Deletes the NPC this app has assigned to this visitor.
|
|
2167
|
+
* Deletes the NPC (Non-Player Character) this app has assigned to this visitor.
|
|
2168
|
+
*
|
|
2169
|
+
* @remarks
|
|
2170
|
+
* This method removes the NPC associated with this visitor for the current application.
|
|
2171
|
+
* The NPC will immediately disappear from the world. The underlying inventory item
|
|
2172
|
+
* is not consumed and can be used to create a new NPC later.
|
|
2173
|
+
*
|
|
2174
|
+
* @keywords delete, remove, destroy, dismiss, despawn, npc, bot, follower, character
|
|
2175
|
+
*
|
|
2176
|
+
* @category NPCs
|
|
2124
2177
|
*
|
|
2125
2178
|
* @example
|
|
2126
2179
|
* ```ts
|
|
2127
|
-
*
|
|
2180
|
+
* // Check if NPC exists before deleting
|
|
2181
|
+
* const npc = await visitor.getNpc();
|
|
2182
|
+
* if (npc) {
|
|
2183
|
+
* await visitor.deleteNpc();
|
|
2184
|
+
* console.log('NPC removed successfully');
|
|
2185
|
+
* }
|
|
2128
2186
|
* ```
|
|
2129
2187
|
*
|
|
2130
2188
|
* @returns {Promise<void>} Returns nothing if successful.
|
|
@@ -2147,17 +2205,34 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2147
2205
|
/**
|
|
2148
2206
|
* Grants an inventory item to this visitor.
|
|
2149
2207
|
*
|
|
2150
|
-
* @
|
|
2151
|
-
*
|
|
2208
|
+
* @remarks
|
|
2209
|
+
* This method requires that the inventory item is already defined in your application's inventory system.
|
|
2210
|
+
* Each visitor can only be granted an item once. Use modifyInventoryItemQuantity() to adjust quantities
|
|
2211
|
+
* for items the visitor already owns. The grant_source will be set to track where the item came from.
|
|
2212
|
+
*
|
|
2213
|
+
* Important: This method will throw an error if the visitor already owns this inventory item.
|
|
2214
|
+
* Check visitorInventoryItems first or use modifyInventoryItemQuantity() to update existing items.
|
|
2215
|
+
*
|
|
2216
|
+
* @keywords grant, give, add, inventory, item, visitor, award, reward
|
|
2217
|
+
*
|
|
2218
|
+
* @category Inventory
|
|
2219
|
+
*
|
|
2220
|
+
* @param item - The InventoryItem to grant to the visitor
|
|
2221
|
+
* @param quantity - The quantity to grant (default: 1)
|
|
2152
2222
|
*
|
|
2153
2223
|
* @example
|
|
2154
2224
|
* ```ts
|
|
2155
|
-
*
|
|
2225
|
+
* // First create or fetch the inventory item
|
|
2226
|
+
* const item = await InventoryItem.get("item-id-123");
|
|
2227
|
+
*
|
|
2228
|
+
* // Grant it to the visitor
|
|
2229
|
+
* const userItem = await visitor.grantInventoryItem(item, 2);
|
|
2230
|
+
* console.log(`Granted ${userItem.quantity} items to visitor`);
|
|
2156
2231
|
* ```
|
|
2157
2232
|
*
|
|
2158
|
-
* @returns {Promise<UserInventoryItem>} Returns the
|
|
2233
|
+
* @returns {Promise<UserInventoryItem>} Returns the granted UserInventoryItem with quantity and metadata.
|
|
2159
2234
|
*/
|
|
2160
|
-
grantInventoryItem(item:
|
|
2235
|
+
grantInventoryItem(item: InventoryItemInterface, quantity?: number): Promise<UserInventoryItem>;
|
|
2161
2236
|
/**
|
|
2162
2237
|
* Modifies the quantity of an inventory item in this visitor's inventory.
|
|
2163
2238
|
* Supports upsert behavior - if the visitor doesn't own the item yet, it will be granted first.
|
|
@@ -2176,7 +2251,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
2176
2251
|
*
|
|
2177
2252
|
* @returns {Promise<UserInventoryItem>} Returns the updated inventory item or a response object.
|
|
2178
2253
|
*/
|
|
2179
|
-
modifyInventoryItemQuantity(item:
|
|
2254
|
+
modifyInventoryItemQuantity(item: UserInventoryItemInterface | InventoryItemInterface, quantity: number): Promise<UserInventoryItem>;
|
|
2180
2255
|
}
|
|
2181
2256
|
|
|
2182
2257
|
type VisitorType = {
|
|
@@ -2219,7 +2294,7 @@ declare enum WorldActivityType {
|
|
|
2219
2294
|
}
|
|
2220
2295
|
|
|
2221
2296
|
interface SDKInterface {
|
|
2222
|
-
credentials?: InteractiveCredentials
|
|
2297
|
+
credentials?: InteractiveCredentials;
|
|
2223
2298
|
jwt?: string;
|
|
2224
2299
|
requestOptions: object;
|
|
2225
2300
|
topia: Topia;
|
|
@@ -2256,33 +2331,33 @@ interface AssetInterface extends SDKInterface {
|
|
|
2256
2331
|
}
|
|
2257
2332
|
type AssetOptionalInterface = {
|
|
2258
2333
|
attributes?: AssetInterface | object;
|
|
2259
|
-
credentials?: InteractiveCredentials
|
|
2334
|
+
credentials?: InteractiveCredentials;
|
|
2260
2335
|
};
|
|
2261
2336
|
|
|
2262
2337
|
interface DroppedAssetInterface extends AssetInterface {
|
|
2263
|
-
fetchDroppedAssetById(): Promise<void | ResponseType
|
|
2264
|
-
deleteDroppedAsset(): Promise<void | ResponseType
|
|
2265
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
2266
|
-
setDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2267
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2268
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType
|
|
2269
|
-
updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType
|
|
2270
|
-
updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType
|
|
2271
|
-
updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType
|
|
2272
|
-
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType
|
|
2273
|
-
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType
|
|
2338
|
+
fetchDroppedAssetById(): Promise<void | ResponseType>;
|
|
2339
|
+
deleteDroppedAsset(): Promise<void | ResponseType>;
|
|
2340
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
2341
|
+
setDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2342
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2343
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
2344
|
+
updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType>;
|
|
2345
|
+
updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType>;
|
|
2346
|
+
updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType>;
|
|
2347
|
+
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType>;
|
|
2348
|
+
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType>;
|
|
2274
2349
|
updateLandmarkZone({ isLandmarkZoneEnabled, landmarkZoneName, landmarkZoneIsVisible, }: {
|
|
2275
2350
|
isLandmarkZoneEnabled: boolean;
|
|
2276
2351
|
landmarkZoneName?: string;
|
|
2277
2352
|
landmarkZoneIsVisible?: boolean;
|
|
2278
|
-
}): Promise<void | ResponseType
|
|
2279
|
-
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType
|
|
2280
|
-
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType
|
|
2281
|
-
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType
|
|
2282
|
-
updateScale(assetScale: number): Promise<void | ResponseType
|
|
2283
|
-
flip(): Promise<void | ResponseType
|
|
2284
|
-
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType
|
|
2285
|
-
updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType
|
|
2353
|
+
}): Promise<void | ResponseType>;
|
|
2354
|
+
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType>;
|
|
2355
|
+
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType>;
|
|
2356
|
+
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType>;
|
|
2357
|
+
updateScale(assetScale: number): Promise<void | ResponseType>;
|
|
2358
|
+
flip(): Promise<void | ResponseType>;
|
|
2359
|
+
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType>;
|
|
2360
|
+
updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType>;
|
|
2286
2361
|
addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }: {
|
|
2287
2362
|
dataObject: object;
|
|
2288
2363
|
description: string;
|
|
@@ -2294,15 +2369,15 @@ interface DroppedAssetInterface extends AssetInterface {
|
|
|
2294
2369
|
setInteractiveSettings({ isInteractive, interactivePublicKey, }: {
|
|
2295
2370
|
isInteractive?: boolean;
|
|
2296
2371
|
interactivePublicKey: string;
|
|
2297
|
-
}): Promise<void | ResponseType
|
|
2298
|
-
setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType
|
|
2299
|
-
updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType
|
|
2300
|
-
removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType
|
|
2372
|
+
}): Promise<void | ResponseType>;
|
|
2373
|
+
setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType>;
|
|
2374
|
+
updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType>;
|
|
2375
|
+
removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType>;
|
|
2301
2376
|
fetchDroppedAssetAnalytics({ periodType, dateValue, year, }: {
|
|
2302
2377
|
periodType: "week" | "month" | "quarter" | "year";
|
|
2303
2378
|
dateValue: number;
|
|
2304
2379
|
year: number;
|
|
2305
|
-
}): Promise<void | ResponseType
|
|
2380
|
+
}): Promise<void | ResponseType>;
|
|
2306
2381
|
id?: string;
|
|
2307
2382
|
assetId?: string;
|
|
2308
2383
|
assetScale?: number | null;
|
|
@@ -2378,7 +2453,7 @@ interface DroppedAssetOptionalInterface {
|
|
|
2378
2453
|
text?: string;
|
|
2379
2454
|
urlSlug?: string;
|
|
2380
2455
|
};
|
|
2381
|
-
credentials?: InteractiveCredentials
|
|
2456
|
+
credentials?: InteractiveCredentials | object;
|
|
2382
2457
|
}
|
|
2383
2458
|
interface UpdateBroadcastInterface {
|
|
2384
2459
|
assetBroadcast?: boolean;
|
|
@@ -2463,18 +2538,18 @@ interface UpdatePrivateZoneInterface {
|
|
|
2463
2538
|
privateZoneUserCap: number;
|
|
2464
2539
|
}
|
|
2465
2540
|
|
|
2466
|
-
interface EcosystemInterface {
|
|
2467
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
2468
|
-
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType
|
|
2469
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2470
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType
|
|
2541
|
+
interface EcosystemInterface extends SDKInterface {
|
|
2542
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
2543
|
+
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
|
|
2544
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2545
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
2471
2546
|
}
|
|
2472
2547
|
interface EcosystemOptionalInterface {
|
|
2473
|
-
credentials?: InteractiveCredentials
|
|
2548
|
+
credentials?: InteractiveCredentials;
|
|
2474
2549
|
}
|
|
2475
2550
|
|
|
2476
2551
|
interface SceneInterface {
|
|
2477
|
-
fetchSceneById(): Promise<void | ResponseType
|
|
2552
|
+
fetchSceneById(): Promise<void | ResponseType>;
|
|
2478
2553
|
id: string;
|
|
2479
2554
|
background?: null;
|
|
2480
2555
|
description?: string;
|
|
@@ -2498,7 +2573,7 @@ interface SceneInterface {
|
|
|
2498
2573
|
}
|
|
2499
2574
|
type SceneOptionalInterface = {
|
|
2500
2575
|
attributes?: SceneInterface | object;
|
|
2501
|
-
credentials?: InteractiveCredentials
|
|
2576
|
+
credentials?: InteractiveCredentials;
|
|
2502
2577
|
};
|
|
2503
2578
|
|
|
2504
2579
|
interface FireToastInterface {
|
|
@@ -2517,28 +2592,28 @@ interface TopiaInterface {
|
|
|
2517
2592
|
}
|
|
2518
2593
|
|
|
2519
2594
|
interface UserInterface {
|
|
2520
|
-
checkInteractiveCredentials(): Promise<void | ResponseType
|
|
2521
|
-
fetchAvatars(): Promise<void | ResponseType
|
|
2522
|
-
addAvatar(formData: FormData): Promise<void | ResponseType
|
|
2523
|
-
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType
|
|
2524
|
-
deleteAvatar(avatarId: string): Promise<void | ResponseType
|
|
2525
|
-
fetchAssets(): Promise<void | ResponseType
|
|
2526
|
-
fetchPlatformAssets(): Promise<object | ResponseType
|
|
2527
|
-
fetchScenes(): Promise<void | ResponseType
|
|
2528
|
-
fetchWorldsByKey(): Promise<void | ResponseType
|
|
2595
|
+
checkInteractiveCredentials(): Promise<void | ResponseType>;
|
|
2596
|
+
fetchAvatars(): Promise<void | ResponseType>;
|
|
2597
|
+
addAvatar(formData: FormData): Promise<void | ResponseType>;
|
|
2598
|
+
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType>;
|
|
2599
|
+
deleteAvatar(avatarId: string): Promise<void | ResponseType>;
|
|
2600
|
+
fetchAssets(): Promise<void | ResponseType>;
|
|
2601
|
+
fetchPlatformAssets(): Promise<object | ResponseType>;
|
|
2602
|
+
fetchScenes(): Promise<void | ResponseType>;
|
|
2603
|
+
fetchWorldsByKey(): Promise<void | ResponseType>;
|
|
2529
2604
|
sendEmail({ html, subject, to }: {
|
|
2530
2605
|
html: string;
|
|
2531
2606
|
subject: string;
|
|
2532
2607
|
to: string;
|
|
2533
|
-
}): Promise<object | ResponseType
|
|
2608
|
+
}): Promise<object | ResponseType>;
|
|
2534
2609
|
getExpressions({ name, getUnlockablesOnly }: {
|
|
2535
2610
|
name?: string;
|
|
2536
2611
|
getUnlockablesOnly?: boolean;
|
|
2537
|
-
}): Promise<ResponseType
|
|
2538
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType
|
|
2539
|
-
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType
|
|
2540
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2541
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType
|
|
2612
|
+
}): Promise<ResponseType>;
|
|
2613
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType>;
|
|
2614
|
+
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
|
|
2615
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2616
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
2542
2617
|
fetchInventoryItems(): Promise<void>;
|
|
2543
2618
|
inventoryItems: UserInventoryItem[];
|
|
2544
2619
|
grantInventoryItem(item: InventoryItem, quantity: number): Promise<UserInventoryItem>;
|
|
@@ -2546,34 +2621,34 @@ interface UserInterface {
|
|
|
2546
2621
|
dataObject?: object | null;
|
|
2547
2622
|
}
|
|
2548
2623
|
interface UserOptionalInterface {
|
|
2549
|
-
credentials?: InteractiveCredentials
|
|
2624
|
+
credentials?: InteractiveCredentials;
|
|
2550
2625
|
profileId?: string | null;
|
|
2551
2626
|
visitorId?: number | null;
|
|
2552
2627
|
urlSlug?: string;
|
|
2553
2628
|
}
|
|
2554
2629
|
|
|
2555
2630
|
interface VisitorInterface extends SDKInterface {
|
|
2556
|
-
fetchVisitor(): Promise<void | ResponseType
|
|
2557
|
-
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType
|
|
2558
|
-
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType
|
|
2559
|
-
openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType
|
|
2560
|
-
reloadIframe(droppedAssetId: string): Promise<void | ResponseType
|
|
2561
|
-
closeIframe(droppedAssetId: string): Promise<void | ResponseType
|
|
2562
|
-
turnAVOff(): Promise<void | ResponseType
|
|
2631
|
+
fetchVisitor(): Promise<void | ResponseType>;
|
|
2632
|
+
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
|
|
2633
|
+
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
|
|
2634
|
+
openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType>;
|
|
2635
|
+
reloadIframe(droppedAssetId: string): Promise<void | ResponseType>;
|
|
2636
|
+
closeIframe(droppedAssetId: string): Promise<void | ResponseType>;
|
|
2637
|
+
turnAVOff(): Promise<void | ResponseType>;
|
|
2563
2638
|
getExpressions({ name, getUnlockablesOnly }: {
|
|
2564
2639
|
name?: string;
|
|
2565
2640
|
getUnlockablesOnly?: boolean;
|
|
2566
|
-
}): Promise<ResponseType
|
|
2641
|
+
}): Promise<ResponseType>;
|
|
2567
2642
|
grantExpression({ id, name }: {
|
|
2568
2643
|
id?: string;
|
|
2569
2644
|
name?: string;
|
|
2570
|
-
}): Promise<ResponseType
|
|
2571
|
-
getAllParticles(): Promise<ResponseType
|
|
2645
|
+
}): Promise<ResponseType>;
|
|
2646
|
+
getAllParticles(): Promise<ResponseType>;
|
|
2572
2647
|
fetchInventoryItems(): Promise<void>;
|
|
2573
2648
|
inventoryItems: UserInventoryItem[];
|
|
2574
|
-
grantInventoryItem(item:
|
|
2575
|
-
modifyInventoryItemQuantity(item:
|
|
2576
|
-
fetchInventoryItem(item:
|
|
2649
|
+
grantInventoryItem(item: InventoryItemInterface, quantity: number): Promise<UserInventoryItem>;
|
|
2650
|
+
modifyInventoryItemQuantity(item: UserInventoryItemInterface | InventoryItemInterface, quantity: number): Promise<UserInventoryItem>;
|
|
2651
|
+
fetchInventoryItem(item: InventoryItemInterface): Promise<UserInventoryItem>;
|
|
2577
2652
|
createNpc(userInventoryItemId: string, options?: {
|
|
2578
2653
|
showNameplate?: boolean;
|
|
2579
2654
|
}): Promise<Visitor>;
|
|
@@ -2583,13 +2658,13 @@ interface VisitorInterface extends SDKInterface {
|
|
|
2583
2658
|
id?: string;
|
|
2584
2659
|
name?: string;
|
|
2585
2660
|
duration?: number;
|
|
2586
|
-
}): Promise<ResponseType
|
|
2587
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
2588
|
-
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType
|
|
2589
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2590
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType
|
|
2591
|
-
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType
|
|
2592
|
-
sendSignalToVisitor(signal: any): Promise<void | (ResponseType
|
|
2661
|
+
}): Promise<ResponseType | string>;
|
|
2662
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
2663
|
+
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
|
|
2664
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2665
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
2666
|
+
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType>;
|
|
2667
|
+
sendSignalToVisitor(signal: any): Promise<void | (ResponseType & {
|
|
2593
2668
|
answerSignal: any;
|
|
2594
2669
|
})>;
|
|
2595
2670
|
color?: string;
|
|
@@ -2622,7 +2697,7 @@ interface VisitorInterface extends SDKInterface {
|
|
|
2622
2697
|
}
|
|
2623
2698
|
interface VisitorOptionalInterface {
|
|
2624
2699
|
attributes?: VisitorInterface | object;
|
|
2625
|
-
credentials?: InteractiveCredentials
|
|
2700
|
+
credentials?: InteractiveCredentials;
|
|
2626
2701
|
}
|
|
2627
2702
|
interface MoveVisitorInterface {
|
|
2628
2703
|
shouldTeleportVisitor: boolean;
|
|
@@ -2652,15 +2727,15 @@ interface WebhookInterface {
|
|
|
2652
2727
|
}
|
|
2653
2728
|
|
|
2654
2729
|
interface WebRTCConnectorInterface {
|
|
2655
|
-
getTwilioConfig(): Promise<void | ResponseType
|
|
2730
|
+
getTwilioConfig(): Promise<void | ResponseType>;
|
|
2656
2731
|
}
|
|
2657
2732
|
interface WebRTCConnectorOptionalInterface {
|
|
2658
|
-
credentials?: InteractiveCredentials
|
|
2733
|
+
credentials?: InteractiveCredentials;
|
|
2659
2734
|
twilioConfig?: object;
|
|
2660
2735
|
}
|
|
2661
2736
|
|
|
2662
2737
|
interface WorldActivityOptionalInterface {
|
|
2663
|
-
credentials?: InteractiveCredentials
|
|
2738
|
+
credentials?: InteractiveCredentials;
|
|
2664
2739
|
}
|
|
2665
2740
|
interface MoveAllVisitorsInterface {
|
|
2666
2741
|
shouldFetchVisitors?: boolean;
|
|
@@ -2697,13 +2772,13 @@ interface WorldDetailsInterface {
|
|
|
2697
2772
|
width?: number;
|
|
2698
2773
|
}
|
|
2699
2774
|
interface WorldInterface extends SDKInterface, WorldDetailsInterface {
|
|
2700
|
-
fetchDetails(): Promise<void | ResponseType
|
|
2701
|
-
updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType
|
|
2775
|
+
fetchDetails(): Promise<void | ResponseType>;
|
|
2776
|
+
updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType>;
|
|
2702
2777
|
updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }: {
|
|
2703
2778
|
closeWorldDescription: string;
|
|
2704
2779
|
isWorldClosed: boolean;
|
|
2705
|
-
}): Promise<void | ResponseType
|
|
2706
|
-
fetchDroppedAssets(): Promise<void | ResponseType
|
|
2780
|
+
}): Promise<void | ResponseType>;
|
|
2781
|
+
fetchDroppedAssets(): Promise<void | ResponseType>;
|
|
2707
2782
|
fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial, isReversed, }: {
|
|
2708
2783
|
uniqueName: string;
|
|
2709
2784
|
isPartial?: boolean;
|
|
@@ -2715,48 +2790,48 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
|
|
|
2715
2790
|
}): Promise<DroppedAsset[]>;
|
|
2716
2791
|
updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
|
|
2717
2792
|
fetchLandmarkZones(landmarkZoneName?: string, sceneDropId?: string): Promise<DroppedAsset[]>;
|
|
2718
|
-
fetchSceneDropIds(): Promise<object | ResponseType
|
|
2719
|
-
fetchScenes(): Promise<object | ResponseType
|
|
2793
|
+
fetchSceneDropIds(): Promise<object | ResponseType>;
|
|
2794
|
+
fetchScenes(): Promise<object | ResponseType>;
|
|
2720
2795
|
dropScene({ assetSuffix, position, sceneId, }: {
|
|
2721
2796
|
assetSuffix: string;
|
|
2722
2797
|
position: object;
|
|
2723
2798
|
sceneId: string;
|
|
2724
|
-
}): Promise<object | ResponseType
|
|
2725
|
-
replaceScene(sceneId: string): Promise<void | ResponseType
|
|
2726
|
-
getAllParticles(): Promise<ResponseType
|
|
2799
|
+
}): Promise<object | ResponseType>;
|
|
2800
|
+
replaceScene(sceneId: string): Promise<void | ResponseType>;
|
|
2801
|
+
getAllParticles(): Promise<ResponseType>;
|
|
2727
2802
|
triggerParticle({ id, name, duration, position, }: {
|
|
2728
2803
|
id?: string;
|
|
2729
2804
|
name?: string;
|
|
2730
2805
|
duration?: number;
|
|
2731
2806
|
position?: object;
|
|
2732
|
-
}): Promise<ResponseType
|
|
2807
|
+
}): Promise<ResponseType | string>;
|
|
2733
2808
|
triggerActivity({ type, assetId, excludeFromNotification, }: {
|
|
2734
2809
|
type: WorldActivityType;
|
|
2735
2810
|
assetId: string;
|
|
2736
2811
|
excludeFromNotification?: (string | number)[];
|
|
2737
|
-
}): Promise<ResponseType
|
|
2738
|
-
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType
|
|
2739
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
2740
|
-
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType
|
|
2741
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType
|
|
2742
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType
|
|
2743
|
-
fetchWebhooks(): Promise<void | ResponseType
|
|
2812
|
+
}): Promise<ResponseType | string>;
|
|
2813
|
+
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
|
|
2814
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
2815
|
+
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
|
|
2816
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
|
|
2817
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
|
|
2818
|
+
fetchWebhooks(): Promise<void | ResponseType>;
|
|
2744
2819
|
fetchWorldAnalytics({ periodType, dateValue, year, }: {
|
|
2745
2820
|
periodType: "week" | "month" | "quarter" | "year";
|
|
2746
2821
|
dateValue: number;
|
|
2747
2822
|
year: number;
|
|
2748
|
-
}): Promise<void | ResponseType
|
|
2823
|
+
}): Promise<void | ResponseType>;
|
|
2749
2824
|
dataObject?: object | null;
|
|
2750
2825
|
}
|
|
2751
2826
|
interface WorldOptionalInterface {
|
|
2752
2827
|
attributes?: WorldDetailsInterface | object;
|
|
2753
|
-
credentials?: InteractiveCredentials
|
|
2828
|
+
credentials?: InteractiveCredentials;
|
|
2754
2829
|
}
|
|
2755
2830
|
interface WorldWebhooksInterface {
|
|
2756
2831
|
webhooks: Array<WebhookInterface>;
|
|
2757
2832
|
}
|
|
2758
2833
|
|
|
2759
|
-
type InteractiveCredentials = {
|
|
2834
|
+
type InteractiveCredentials$1 = {
|
|
2760
2835
|
apiKey?: string;
|
|
2761
2836
|
assetId?: string;
|
|
2762
2837
|
interactiveNonce?: string;
|
|
@@ -2772,6 +2847,7 @@ type InteractiveCredentials = {
|
|
|
2772
2847
|
* Interface for an inventory item.
|
|
2773
2848
|
*/
|
|
2774
2849
|
interface InventoryItemInterface extends SDKInterface {
|
|
2850
|
+
fetchInventoryItemById(): Promise<InventoryItem>;
|
|
2775
2851
|
id: string;
|
|
2776
2852
|
name?: string;
|
|
2777
2853
|
description?: string;
|
|
@@ -2780,12 +2856,13 @@ interface InventoryItemInterface extends SDKInterface {
|
|
|
2780
2856
|
updated_at?: Date;
|
|
2781
2857
|
metadata?: object | null;
|
|
2782
2858
|
image_path?: string;
|
|
2859
|
+
image_url?: string;
|
|
2783
2860
|
interactive_key_id?: string;
|
|
2784
2861
|
status?: string;
|
|
2785
2862
|
}
|
|
2786
2863
|
type InventoryItemOptionalInterface = {
|
|
2787
2864
|
attributes?: InventoryItemInterface | object;
|
|
2788
|
-
credentials?: InteractiveCredentials;
|
|
2865
|
+
credentials?: InteractiveCredentials$1;
|
|
2789
2866
|
};
|
|
2790
2867
|
|
|
2791
2868
|
/**
|
|
@@ -2803,7 +2880,7 @@ interface UserInventoryItemInterface extends InventoryItemInterface {
|
|
|
2803
2880
|
}
|
|
2804
2881
|
type UserInventoryItemOptionalInterface = {
|
|
2805
2882
|
attributes?: UserInventoryItemInterface | object;
|
|
2806
|
-
credentials?: InteractiveCredentials;
|
|
2883
|
+
credentials?: InteractiveCredentials$1;
|
|
2807
2884
|
};
|
|
2808
2885
|
type UserInventoryItemMetadataType = {
|
|
2809
2886
|
id: string;
|
|
@@ -2815,15 +2892,30 @@ type UserInventoryItemMetadataType = {
|
|
|
2815
2892
|
};
|
|
2816
2893
|
|
|
2817
2894
|
/**
|
|
2818
|
-
*
|
|
2895
|
+
* Main Topia SDK client for configuring API access and authentication.
|
|
2896
|
+
*
|
|
2897
|
+
* @remarks
|
|
2898
|
+
* This class should be instantiated ONCE per application at initialization time.
|
|
2899
|
+
* The instance configures the Axios HTTP client with proper authentication headers
|
|
2900
|
+
* and base URL, and is passed to all factory classes to create controllers.
|
|
2901
|
+
*
|
|
2902
|
+
* Configuration options:
|
|
2903
|
+
* - apiKey: Your Topia API key for server-side authentication
|
|
2904
|
+
* - interactiveKey/interactiveSecret: For interactive iframe applications
|
|
2905
|
+
* - apiDomain: API endpoint domain (defaults to "api.topia.io")
|
|
2906
|
+
* - apiProtocol: HTTP protocol (defaults to "https")
|
|
2907
|
+
*
|
|
2908
|
+
* @keywords topia, client, sdk, initialization, config, setup, api
|
|
2819
2909
|
*
|
|
2820
2910
|
* @example
|
|
2821
2911
|
* ```ts
|
|
2822
|
-
*
|
|
2912
|
+
* import { Topia } from "@rtsdk/topia";
|
|
2913
|
+
*
|
|
2914
|
+
* const topia = new Topia({
|
|
2915
|
+
* apiKey: "your-api-key",
|
|
2823
2916
|
* apiDomain: "api.topia.io",
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
2826
|
-
* interactiveSecret: "secret",
|
|
2917
|
+
* interactiveKey: "your-public-key",
|
|
2918
|
+
* interactiveSecret: "your-secret-key",
|
|
2827
2919
|
* });
|
|
2828
2920
|
* ```
|
|
2829
2921
|
*/
|
|
@@ -2846,33 +2938,66 @@ declare class Topia implements TopiaInterface {
|
|
|
2846
2938
|
}
|
|
2847
2939
|
|
|
2848
2940
|
/**
|
|
2849
|
-
*
|
|
2941
|
+
* Abstract base controller that provides common functionality for all SDK controllers.
|
|
2942
|
+
*
|
|
2943
|
+
* @remarks
|
|
2944
|
+
* This class should NOT be instantiated directly. It serves as the base class for all
|
|
2945
|
+
* SDK controllers (World, Visitor, User, etc.) and provides:
|
|
2946
|
+
* - Authentication and credential management
|
|
2947
|
+
* - Axios instance configuration for API calls
|
|
2948
|
+
* - Standardized error handling
|
|
2949
|
+
* - JWT token generation for interactive credentials
|
|
2950
|
+
*
|
|
2951
|
+
* @keywords base, controller, sdk, authentication, api, abstract
|
|
2850
2952
|
*
|
|
2851
2953
|
* @example
|
|
2852
2954
|
* ```ts
|
|
2853
|
-
*
|
|
2854
|
-
*
|
|
2855
|
-
*
|
|
2856
|
-
* interactivePublicKey: "examplePublicKey",
|
|
2857
|
-
* visitorId: 1,
|
|
2858
|
-
* url: "https://topia.io",
|
|
2859
|
-
* }
|
|
2860
|
-
* const topia = await new Topia({
|
|
2861
|
-
* apiDomain: "api.topia.io",
|
|
2862
|
-
* apiKey: "exampleKey",
|
|
2863
|
-
* interactiveKey: "key",
|
|
2864
|
-
* interactiveSecret: "secret",
|
|
2955
|
+
* // This class is extended by all controllers
|
|
2956
|
+
* export class World extends SDKController implements WorldInterface {
|
|
2957
|
+
* // World-specific implementation
|
|
2865
2958
|
* }
|
|
2866
|
-
* await new SDKController({ credentials, topia });
|
|
2867
2959
|
* ```
|
|
2868
2960
|
*/
|
|
2869
2961
|
declare abstract class SDKController implements SDKInterface {
|
|
2870
|
-
credentials: InteractiveCredentials
|
|
2962
|
+
credentials: InteractiveCredentials | undefined;
|
|
2871
2963
|
jwt?: string;
|
|
2872
2964
|
requestOptions: object;
|
|
2873
2965
|
topia: Topia;
|
|
2874
|
-
constructor(topia: Topia, credentials?: InteractiveCredentials
|
|
2966
|
+
constructor(topia: Topia, credentials?: InteractiveCredentials);
|
|
2967
|
+
/**
|
|
2968
|
+
* Returns the configured Axios instance for making API calls to Topia's Public API.
|
|
2969
|
+
*
|
|
2970
|
+
* @remarks
|
|
2971
|
+
* All HTTP requests to the Topia API should use this method to ensure proper
|
|
2972
|
+
* authentication headers and base URL configuration are applied.
|
|
2973
|
+
*
|
|
2974
|
+
* @keywords api, axios, http, request, client, public api
|
|
2975
|
+
*
|
|
2976
|
+
* @returns {AxiosInstance} The configured Axios client instance with authentication headers.
|
|
2977
|
+
*/
|
|
2875
2978
|
topiaPublicApi(): axios.AxiosInstance;
|
|
2979
|
+
/**
|
|
2980
|
+
* Standardized error handler for all SDK operations.
|
|
2981
|
+
*
|
|
2982
|
+
* @remarks
|
|
2983
|
+
* This method processes errors from API calls and formats them consistently across the SDK.
|
|
2984
|
+
* It extracts relevant error information including:
|
|
2985
|
+
* - HTTP status codes and response data
|
|
2986
|
+
* - Error messages from API responses
|
|
2987
|
+
* - Stack traces for debugging
|
|
2988
|
+
* - Request details (URL, method, parameters)
|
|
2989
|
+
*
|
|
2990
|
+
* All errors thrown by SDK methods flow through this handler to ensure consistent error format.
|
|
2991
|
+
*
|
|
2992
|
+
* @keywords error, exception, handler, debugging, api error, http error
|
|
2993
|
+
*
|
|
2994
|
+
* @param error - The error object from the failed operation (AxiosError, Error, or unknown)
|
|
2995
|
+
* @param message - Optional custom error message (defaults to generic message)
|
|
2996
|
+
* @param params - Optional parameters that were passed to the failed method
|
|
2997
|
+
* @param sdkMethod - Optional name of the SDK method that failed (e.g., "World.fetchDetails")
|
|
2998
|
+
*
|
|
2999
|
+
* @returns {object} Standardized error object with properties: data, message, method, params, sdkMethod, stack, status, success, url
|
|
3000
|
+
*/
|
|
2876
3001
|
errorHandler({ error, message, params, sdkMethod, }: {
|
|
2877
3002
|
error?: Error | AxiosError | unknown;
|
|
2878
3003
|
message?: string;
|
|
@@ -2921,7 +3046,7 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2921
3046
|
*
|
|
2922
3047
|
* @returns {Promise<object | ResponseType>} Returns the asset details or an error response.
|
|
2923
3048
|
*/
|
|
2924
|
-
fetchAssetById(): Promise<object | ResponseType
|
|
3049
|
+
fetchAssetById(): Promise<object | ResponseType>;
|
|
2925
3050
|
/**
|
|
2926
3051
|
* Updates platform asset details.
|
|
2927
3052
|
*
|
|
@@ -2949,7 +3074,7 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2949
3074
|
shouldUploadImages?: boolean;
|
|
2950
3075
|
tagJson: string;
|
|
2951
3076
|
topLayerURL?: string;
|
|
2952
|
-
}): Promise<object | ResponseType
|
|
3077
|
+
}): Promise<object | ResponseType>;
|
|
2953
3078
|
}
|
|
2954
3079
|
|
|
2955
3080
|
/**
|
|
@@ -2971,7 +3096,7 @@ declare class Ecosystem extends SDKController {
|
|
|
2971
3096
|
/**
|
|
2972
3097
|
* Retrieves the data object for a Topia ecosystem. Requires canUpdateEcosystemDataObjects permission to be set to true for the public key.
|
|
2973
3098
|
*
|
|
2974
|
-
* @keywords get, fetch, retrieve, load, data, object, state
|
|
3099
|
+
* @keywords get, fetch, retrieve, load, ecosystem, data, object, state, global, platform
|
|
2975
3100
|
*
|
|
2976
3101
|
* @category Data Objects
|
|
2977
3102
|
*
|
|
@@ -2980,9 +3105,9 @@ declare class Ecosystem extends SDKController {
|
|
|
2980
3105
|
* const dataObject = await ecosystem.fetchDataObject("exampleAppPublicKey", "exampleAppPublicKeyJWT");
|
|
2981
3106
|
* ```
|
|
2982
3107
|
*
|
|
2983
|
-
* @returns {Promise<
|
|
3108
|
+
* @returns {Promise<void | ResponseType>} Populates the dataObject property with ecosystem-wide data, or returns an error response.
|
|
2984
3109
|
*/
|
|
2985
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType
|
|
3110
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType>;
|
|
2986
3111
|
/**
|
|
2987
3112
|
* Sets the data object for a Topia ecosystem.
|
|
2988
3113
|
*
|
|
@@ -2991,7 +3116,7 @@ declare class Ecosystem extends SDKController {
|
|
|
2991
3116
|
*
|
|
2992
3117
|
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
2993
3118
|
*
|
|
2994
|
-
* @keywords set, assign, store, save, data, object, state
|
|
3119
|
+
* @keywords set, assign, store, save, ecosystem, data, object, state, global, platform
|
|
2995
3120
|
*
|
|
2996
3121
|
* @category Data Objects
|
|
2997
3122
|
*
|
|
@@ -3003,6 +3128,8 @@ declare class Ecosystem extends SDKController {
|
|
|
3003
3128
|
* });
|
|
3004
3129
|
* const { exampleKey } = ecosystem.dataObject;
|
|
3005
3130
|
* ```
|
|
3131
|
+
*
|
|
3132
|
+
* @returns {Promise<void | ResponseType>} Returns success or an error response.
|
|
3006
3133
|
*/
|
|
3007
3134
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
3008
3135
|
appPublicKey?: string;
|
|
@@ -3014,7 +3141,7 @@ declare class Ecosystem extends SDKController {
|
|
|
3014
3141
|
lockId: string;
|
|
3015
3142
|
releaseLock?: boolean;
|
|
3016
3143
|
};
|
|
3017
|
-
}): Promise<void | ResponseType
|
|
3144
|
+
}): Promise<void | ResponseType>;
|
|
3018
3145
|
/**
|
|
3019
3146
|
* Updates the data object for a Topia ecosystem.
|
|
3020
3147
|
*
|
|
@@ -3023,7 +3150,7 @@ declare class Ecosystem extends SDKController {
|
|
|
3023
3150
|
*
|
|
3024
3151
|
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
3025
3152
|
*
|
|
3026
|
-
* @keywords update, modify, change, edit, alter, data, object, state
|
|
3153
|
+
* @keywords update, modify, change, edit, alter, ecosystem, data, object, state, global, platform
|
|
3027
3154
|
*
|
|
3028
3155
|
* @category Data Objects
|
|
3029
3156
|
*
|
|
@@ -3041,6 +3168,8 @@ declare class Ecosystem extends SDKController {
|
|
|
3041
3168
|
* });
|
|
3042
3169
|
* const { exampleKey } = ecosystem.dataObject;
|
|
3043
3170
|
* ```
|
|
3171
|
+
*
|
|
3172
|
+
* @returns {Promise<void | ResponseType>} Returns success or an error response.
|
|
3044
3173
|
*/
|
|
3045
3174
|
updateDataObject(dataObject: object, options?: {
|
|
3046
3175
|
appPublicKey?: string;
|
|
@@ -3052,7 +3181,7 @@ declare class Ecosystem extends SDKController {
|
|
|
3052
3181
|
lockId: string;
|
|
3053
3182
|
releaseLock?: boolean;
|
|
3054
3183
|
};
|
|
3055
|
-
}): Promise<void | ResponseType
|
|
3184
|
+
}): Promise<void | ResponseType>;
|
|
3056
3185
|
/**
|
|
3057
3186
|
* Increments a specific value in the data object for a Topia ecosystem by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
3058
3187
|
*
|
|
@@ -3061,7 +3190,7 @@ declare class Ecosystem extends SDKController {
|
|
|
3061
3190
|
*
|
|
3062
3191
|
* Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
|
|
3063
3192
|
*
|
|
3064
|
-
* @keywords increment, increase, add, count, data, object, state
|
|
3193
|
+
* @keywords increment, increase, add, count, ecosystem, data, object, state, global, platform
|
|
3065
3194
|
*
|
|
3066
3195
|
* @category Data Objects
|
|
3067
3196
|
*
|
|
@@ -3072,6 +3201,8 @@ declare class Ecosystem extends SDKController {
|
|
|
3072
3201
|
* sharedAppJWT: "exampleAppPublicKeyJWT",}
|
|
3073
3202
|
* });
|
|
3074
3203
|
* ```
|
|
3204
|
+
*
|
|
3205
|
+
* @returns {Promise<void | ResponseType>} Returns success or an error response.
|
|
3075
3206
|
*/
|
|
3076
3207
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
3077
3208
|
appPublicKey?: string;
|
|
@@ -3083,31 +3214,44 @@ declare class Ecosystem extends SDKController {
|
|
|
3083
3214
|
lockId: string;
|
|
3084
3215
|
releaseLock?: boolean;
|
|
3085
3216
|
};
|
|
3086
|
-
}): Promise<void | ResponseType
|
|
3217
|
+
}): Promise<void | ResponseType>;
|
|
3087
3218
|
/**
|
|
3088
3219
|
* Retrieves all inventory items for a given keyholder (app public key).
|
|
3089
3220
|
*
|
|
3090
|
-
* @keywords get, fetch, retrieve, list, inventory, items, keyholder
|
|
3221
|
+
* @keywords get, fetch, retrieve, list, inventory, items, keyholder, ecosystem, catalog
|
|
3222
|
+
*
|
|
3223
|
+
* @category Inventory
|
|
3091
3224
|
*
|
|
3092
3225
|
* @example
|
|
3093
3226
|
* ```ts
|
|
3094
|
-
*
|
|
3227
|
+
* await ecosystem.fetchInventoryItems();
|
|
3228
|
+
* const items = ecosystem.inventoryItems;
|
|
3095
3229
|
* ```
|
|
3096
3230
|
*
|
|
3097
|
-
* @returns {Promise<
|
|
3231
|
+
* @returns {Promise<void>} Populates the inventoryItems property with an array of InventoryItem objects.
|
|
3098
3232
|
*/
|
|
3099
3233
|
fetchInventoryItems(): Promise<void>;
|
|
3100
3234
|
get inventoryItems(): InventoryItem[];
|
|
3101
3235
|
}
|
|
3102
3236
|
|
|
3103
3237
|
/**
|
|
3104
|
-
*
|
|
3238
|
+
* WebRTC connector for managing real-time video and audio connections in Topia worlds.
|
|
3239
|
+
*
|
|
3240
|
+
* @remarks
|
|
3241
|
+
* This class should NOT be instantiated directly. Use WebRTCConnectorFactory to create instances.
|
|
3242
|
+
* The WebRTCConnector provides access to Twilio configuration needed for establishing
|
|
3243
|
+
* peer-to-peer video and audio connections between visitors in a world.
|
|
3244
|
+
*
|
|
3245
|
+
* @see WebRTCConnectorFactory for proper instantiation
|
|
3246
|
+
*
|
|
3247
|
+
* @keywords webrtc, video, audio, twilio, real-time, communication, voice, peer
|
|
3105
3248
|
*
|
|
3106
3249
|
* @example
|
|
3107
3250
|
* ```ts
|
|
3108
|
-
*
|
|
3109
|
-
*
|
|
3110
|
-
* });
|
|
3251
|
+
* import { WebRTC } from "utils/topiaInit.ts";
|
|
3252
|
+
*
|
|
3253
|
+
* const webrtc = await WebRTC.create(urlSlug, { credentials });
|
|
3254
|
+
* const config = await webrtc.getTwilioConfig();
|
|
3111
3255
|
* ```
|
|
3112
3256
|
*/
|
|
3113
3257
|
declare class WebRTCConnector extends SDKController implements WebRTCConnectorInterface {
|
|
@@ -3115,14 +3259,27 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
|
|
|
3115
3259
|
urlSlug: string;
|
|
3116
3260
|
constructor(topia: Topia, urlSlug: string, options?: WebRTCConnectorOptionalInterface);
|
|
3117
3261
|
/**
|
|
3118
|
-
*
|
|
3262
|
+
* Retrieves the Twilio configuration for WebRTC connections in a world.
|
|
3263
|
+
*
|
|
3264
|
+
* @remarks
|
|
3265
|
+
* This method fetches the Twilio room configuration needed to establish peer-to-peer
|
|
3266
|
+
* video and audio connections between visitors. The configuration includes authentication
|
|
3267
|
+
* tokens and room settings. Call this before initializing WebRTC connections.
|
|
3268
|
+
*
|
|
3269
|
+
* @keywords get, fetch, retrieve, webrtc, twilio, configuration, video, audio, connection
|
|
3270
|
+
*
|
|
3271
|
+
* @category WebRTC
|
|
3119
3272
|
*
|
|
3120
3273
|
* @example
|
|
3121
3274
|
* ```ts
|
|
3122
3275
|
* await webRTCConnector.getTwilioConfig();
|
|
3276
|
+
* const { twilioConfig } = webRTCConnector;
|
|
3277
|
+
* console.log(twilioConfig); // Use for WebRTC setup
|
|
3123
3278
|
* ```
|
|
3279
|
+
*
|
|
3280
|
+
* @returns {Promise<void | ResponseType>} Populates twilioConfig property with Twilio room configuration, or returns an error response.
|
|
3124
3281
|
*/
|
|
3125
|
-
getTwilioConfig(): Promise<void | ResponseType
|
|
3282
|
+
getTwilioConfig(): Promise<void | ResponseType>;
|
|
3126
3283
|
}
|
|
3127
3284
|
|
|
3128
3285
|
/**
|
|
@@ -3211,7 +3368,7 @@ declare class WorldActivity extends SDKController {
|
|
|
3211
3368
|
* @returns
|
|
3212
3369
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
3213
3370
|
*/
|
|
3214
|
-
moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType
|
|
3371
|
+
moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType)[] | undefined>;
|
|
3215
3372
|
/**
|
|
3216
3373
|
* Teleport or walk a list of visitors currently in a world to various coordinates.
|
|
3217
3374
|
*
|
|
@@ -3240,7 +3397,7 @@ declare class WorldActivity extends SDKController {
|
|
|
3240
3397
|
* @returns
|
|
3241
3398
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
3242
3399
|
*/
|
|
3243
|
-
moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType
|
|
3400
|
+
moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType)[]>;
|
|
3244
3401
|
}
|
|
3245
3402
|
|
|
3246
3403
|
/**
|
|
@@ -3451,7 +3608,7 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
3451
3608
|
*
|
|
3452
3609
|
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties already fetched.
|
|
3453
3610
|
*/
|
|
3454
|
-
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials
|
|
3611
|
+
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials): Promise<DroppedAsset>;
|
|
3455
3612
|
/**
|
|
3456
3613
|
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
3457
3614
|
*
|
|
@@ -4033,4 +4190,4 @@ declare class WorldFactory extends SDKController {
|
|
|
4033
4190
|
}>;
|
|
4034
4191
|
}
|
|
4035
4192
|
|
|
4036
|
-
export { AnalyticType, AnimationMetaType, Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetLinkType, DroppedAssetMediaType, DroppedAssetMediaVolumeRadius, DroppedAssetOptionalInterface, DroppedAssetOptions, Ecosystem, EcosystemFactory, EcosystemInterface, EcosystemOptionalInterface, FireToastInterface, FrameType, InteractiveCredentials
|
|
4193
|
+
export { AnalyticType, AnimationMetaType, Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetLinkType, DroppedAssetMediaType, DroppedAssetMediaVolumeRadius, DroppedAssetOptionalInterface, DroppedAssetOptions, Ecosystem, EcosystemFactory, EcosystemInterface, EcosystemOptionalInterface, FireToastInterface, FrameType, InteractiveCredentials, InventoryItemInterface, InventoryItemOptionalInterface, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, RemoveClickableLinkInterface, ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, SetClickableLinkMultiInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateClickableLinkMultiInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserInventoryItemInterface, UserInventoryItemMetadataType, UserInventoryItemOptionalInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebRTCConnector, WebRTCConnectorFactory, WebRTCConnectorInterface, WebRTCConnectorOptionalInterface, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldActivityType, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
|