@rtsdk/topia 0.17.8 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.cjs +1082 -85
- package/dist/index.d.ts +957 -110
- package/dist/index.js +1082 -85
- 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$1 = {
|
|
78
78
|
apiKey?: string;
|
|
79
79
|
assetId?: string;
|
|
80
80
|
interactiveNonce?: string;
|
|
@@ -88,22 +88,22 @@ type InteractiveCredentials = {
|
|
|
88
88
|
|
|
89
89
|
type AssetOptions = {
|
|
90
90
|
attributes?: AssetInterface | undefined;
|
|
91
|
-
credentials?: InteractiveCredentials | undefined;
|
|
91
|
+
credentials?: InteractiveCredentials$1 | undefined;
|
|
92
92
|
};
|
|
93
93
|
type DroppedAssetOptions = {
|
|
94
94
|
attributes?: DroppedAssetInterface | undefined;
|
|
95
|
-
credentials?: InteractiveCredentials | undefined;
|
|
95
|
+
credentials?: InteractiveCredentials$1 | undefined;
|
|
96
96
|
};
|
|
97
97
|
type UserOptions = {
|
|
98
|
-
credentials?: InteractiveCredentials | undefined;
|
|
98
|
+
credentials?: InteractiveCredentials$1 | undefined;
|
|
99
99
|
};
|
|
100
100
|
type VisitorOptions = {
|
|
101
101
|
attributes?: VisitorInterface | undefined;
|
|
102
|
-
credentials?: InteractiveCredentials | undefined;
|
|
102
|
+
credentials?: InteractiveCredentials$1 | undefined;
|
|
103
103
|
};
|
|
104
104
|
type WorldOptions = {
|
|
105
105
|
attributes?: WorldDetailsInterface | undefined;
|
|
106
|
-
credentials?: InteractiveCredentials | undefined;
|
|
106
|
+
credentials?: InteractiveCredentials$1 | undefined;
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
type ResponseType$1 = {
|
|
@@ -131,6 +131,8 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
131
131
|
/**
|
|
132
132
|
* Retrieves scene details and assigns response data to the instance.
|
|
133
133
|
*
|
|
134
|
+
* @keywords get, fetch, retrieve, load, details, info, information, scene
|
|
135
|
+
*
|
|
134
136
|
* @example
|
|
135
137
|
* ```ts
|
|
136
138
|
* await scene.fetchSceneById();
|
|
@@ -168,6 +170,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
168
170
|
/**
|
|
169
171
|
* Retrieves dropped asset details and assigns response data to the instance.
|
|
170
172
|
*
|
|
173
|
+
* @keywords get, fetch, retrieve, load, details, info, information
|
|
174
|
+
*
|
|
171
175
|
* @example
|
|
172
176
|
* ```ts
|
|
173
177
|
* await droppedAsset.fetchDroppedAssetById();
|
|
@@ -178,6 +182,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
178
182
|
/**
|
|
179
183
|
* Updates dropped asset details and assigns the response data to the instance. Requires Public Key to have the `canUpdateDroppedAssets` permission.
|
|
180
184
|
*
|
|
185
|
+
* @keywords update, modify, change, edit, alter, transform
|
|
186
|
+
*
|
|
181
187
|
* @example
|
|
182
188
|
* ```ts
|
|
183
189
|
* const payload = {
|
|
@@ -209,6 +215,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
209
215
|
/**
|
|
210
216
|
* Deletes the dropped asset (removes it from the world).
|
|
211
217
|
*
|
|
218
|
+
* @keywords remove, delete, erase, destroy, eliminate
|
|
219
|
+
*
|
|
212
220
|
* @example
|
|
213
221
|
* ```ts
|
|
214
222
|
* await droppedAsset.deleteDroppedAsset();
|
|
@@ -218,6 +226,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
218
226
|
/**
|
|
219
227
|
* Retrieves the data object for a dropped asset.
|
|
220
228
|
*
|
|
229
|
+
* @keywords get, fetch, retrieve, load, data, object, state
|
|
230
|
+
*
|
|
221
231
|
* @category Data Objects
|
|
222
232
|
*
|
|
223
233
|
* @example
|
|
@@ -234,6 +244,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
234
244
|
* @remarks
|
|
235
245
|
* 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
|
|
236
246
|
*
|
|
247
|
+
* @keywords set, assign, store, save, data, object, state
|
|
248
|
+
*
|
|
237
249
|
* @category Data Objects
|
|
238
250
|
*
|
|
239
251
|
* @example
|
|
@@ -266,6 +278,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
266
278
|
* @remarks
|
|
267
279
|
* 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
|
|
268
280
|
*
|
|
281
|
+
* @keywords update, modify, change, edit, alter, data, object, state
|
|
282
|
+
*
|
|
269
283
|
* @category Data Objects
|
|
270
284
|
*
|
|
271
285
|
* @example
|
|
@@ -295,6 +309,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
295
309
|
* @remarks
|
|
296
310
|
* 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
|
|
297
311
|
*
|
|
312
|
+
* @keywords increment, increase, add, count, data, object, state
|
|
313
|
+
*
|
|
298
314
|
* @category Data Objects
|
|
299
315
|
*
|
|
300
316
|
* @example
|
|
@@ -316,6 +332,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
316
332
|
/**
|
|
317
333
|
* Updates broadcast options for a dropped asset.
|
|
318
334
|
*
|
|
335
|
+
* @keywords broadcast, dropped asset settings
|
|
336
|
+
*
|
|
319
337
|
* @example
|
|
320
338
|
* ```ts
|
|
321
339
|
* await droppedAsset.updateBroadcast({
|
|
@@ -331,6 +349,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
331
349
|
/**
|
|
332
350
|
* Updates click options for a dropped asset.
|
|
333
351
|
*
|
|
352
|
+
* @keywords click, link, interaction, url, dropped asset settings
|
|
353
|
+
*
|
|
334
354
|
* @example
|
|
335
355
|
* ```ts
|
|
336
356
|
* await droppedAsset.updateClickType({
|
|
@@ -353,6 +373,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
353
373
|
/**
|
|
354
374
|
* Adds an array of links to an asset. Maximum is 20 links.
|
|
355
375
|
*
|
|
376
|
+
* @keywords links, multiple, clickable, urls, hyperlinks, dropped asset settings
|
|
377
|
+
*
|
|
356
378
|
* @example
|
|
357
379
|
* ```ts
|
|
358
380
|
* await droppedAsset.setClickableLinkMulti({
|
|
@@ -382,6 +404,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
382
404
|
* @remarks
|
|
383
405
|
* Pass in an 'existingLinkId' to edit an existing link.
|
|
384
406
|
*
|
|
407
|
+
* @keywords links, multiple, clickable, urls, dropped asset settings
|
|
408
|
+
*
|
|
385
409
|
* @example
|
|
386
410
|
* ```ts
|
|
387
411
|
* await droppedAsset.updateClickableLinkMulti({
|
|
@@ -399,6 +423,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
399
423
|
/**
|
|
400
424
|
* Removes a clickable link from a dropped asset.
|
|
401
425
|
*
|
|
426
|
+
* @keywords remove, delete, link, clickable, url, erase, dropped asset settings
|
|
427
|
+
*
|
|
402
428
|
* @example
|
|
403
429
|
* ```ts
|
|
404
430
|
* await droppedAsset.removeClickableLink({ linkId: "link-id" });
|
|
@@ -410,6 +436,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
410
436
|
/**
|
|
411
437
|
* Updates text and style of a dropped asset.
|
|
412
438
|
*
|
|
439
|
+
* @keywords text, style, dropped asset settings
|
|
440
|
+
*
|
|
413
441
|
* @example
|
|
414
442
|
* ```ts
|
|
415
443
|
* const style = {
|
|
@@ -428,6 +456,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
428
456
|
/**
|
|
429
457
|
* Updates media options for a dropped asset.
|
|
430
458
|
*
|
|
459
|
+
* @keywords media, video, audio, dropped asset settings
|
|
460
|
+
*
|
|
431
461
|
* @example
|
|
432
462
|
* ```ts
|
|
433
463
|
* await droppedAsset.updateMediaType({
|
|
@@ -448,6 +478,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
448
478
|
/**
|
|
449
479
|
* Updates mute zone options for a dropped asset.
|
|
450
480
|
*
|
|
481
|
+
* @keywords mute, zone, dropped asset settings
|
|
482
|
+
*
|
|
451
483
|
* @example
|
|
452
484
|
* ```ts
|
|
453
485
|
* await droppedAsset.updateMuteZone(true);
|
|
@@ -459,6 +491,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
459
491
|
/**
|
|
460
492
|
* Updates landmark zone options for a dropped asset.
|
|
461
493
|
*
|
|
494
|
+
* @keywords landmark, zone, dropped asset settings
|
|
495
|
+
*
|
|
462
496
|
* @example
|
|
463
497
|
* ```ts
|
|
464
498
|
* await droppedAsset.updateLandmarkZone({
|
|
@@ -478,6 +512,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
478
512
|
/**
|
|
479
513
|
* Updates webhook zone options for a dropped asset.
|
|
480
514
|
*
|
|
515
|
+
* @keywords webhook, zone, dropped asset settings
|
|
516
|
+
*
|
|
481
517
|
* @example
|
|
482
518
|
* ```ts
|
|
483
519
|
* await droppedAsset.updateWebhookZone(true);
|
|
@@ -489,6 +525,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
489
525
|
/**
|
|
490
526
|
* Moves a dropped asset to specified coordinates.
|
|
491
527
|
*
|
|
528
|
+
* @keywords position, dropped asset settings
|
|
529
|
+
*
|
|
492
530
|
* @example
|
|
493
531
|
* ```ts
|
|
494
532
|
* await droppedAsset.updatePosition(100, 200, 100);
|
|
@@ -500,6 +538,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
500
538
|
/**
|
|
501
539
|
* Updates private zone options for a dropped asset.
|
|
502
540
|
*
|
|
541
|
+
* @keywords private, zone, dropped asset settings
|
|
542
|
+
*
|
|
503
543
|
* @example
|
|
504
544
|
* ```ts
|
|
505
545
|
* await droppedAsset.updatePrivateZone({
|
|
@@ -515,6 +555,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
515
555
|
/**
|
|
516
556
|
* Updates the size of a dropped asset.
|
|
517
557
|
*
|
|
558
|
+
* @keywords size, scale, dropped asset settings
|
|
559
|
+
*
|
|
518
560
|
* @example
|
|
519
561
|
* ```ts
|
|
520
562
|
* await droppedAsset.assetScale(.5);
|
|
@@ -526,6 +568,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
526
568
|
/**
|
|
527
569
|
* Flip an dropped asset.
|
|
528
570
|
*
|
|
571
|
+
* @keywords flip, layout, dropped asset settings
|
|
572
|
+
*
|
|
529
573
|
* @example
|
|
530
574
|
* ```ts
|
|
531
575
|
* await droppedAsset.flip(.5);
|
|
@@ -537,6 +581,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
537
581
|
/**
|
|
538
582
|
* Change or remove media embedded in a dropped asset.
|
|
539
583
|
*
|
|
584
|
+
* @keywords media, update, dropped asset settings
|
|
585
|
+
*
|
|
540
586
|
* @example
|
|
541
587
|
* ```ts
|
|
542
588
|
* await droppedAsset.updateUploadedMediaSelected("LVWyxwNxI96eLjnXWwYO");
|
|
@@ -548,6 +594,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
548
594
|
/**
|
|
549
595
|
* Change or remove top and bottom layers of a dropped asset.
|
|
550
596
|
*
|
|
597
|
+
* @keywords layers, images, urls, dropped asset settings
|
|
598
|
+
*
|
|
551
599
|
* @example
|
|
552
600
|
* ```ts
|
|
553
601
|
* await droppedAsset.updateWebImageLayers("","https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg");
|
|
@@ -559,6 +607,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
559
607
|
/**
|
|
560
608
|
* Add a webhook to a dropped asset
|
|
561
609
|
*
|
|
610
|
+
* @keywords webhook, dropped asset settings
|
|
611
|
+
*
|
|
562
612
|
* @example
|
|
563
613
|
* ```ts
|
|
564
614
|
* await droppedAsset.addWebhook({
|
|
@@ -587,6 +637,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
587
637
|
/**
|
|
588
638
|
* Set the interactive settings on a dropped asset
|
|
589
639
|
*
|
|
640
|
+
* @keywords interactive, dropped asset settings
|
|
641
|
+
*
|
|
590
642
|
* @example
|
|
591
643
|
* ```ts
|
|
592
644
|
* await droppedAsset.setInteractiveSettings({
|
|
@@ -602,6 +654,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
602
654
|
/**
|
|
603
655
|
* Retrieve analytics for a dropped asset by day, week, month, quarter, or year
|
|
604
656
|
*
|
|
657
|
+
* @keywords get, fetch, retrieve, load, analytics
|
|
658
|
+
*
|
|
605
659
|
* @example
|
|
606
660
|
* ```ts
|
|
607
661
|
* const analytics = await droppedAsset.fetchDroppedAssetAnalytics({
|
|
@@ -647,6 +701,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
647
701
|
/**
|
|
648
702
|
* Retrieves details of a world.
|
|
649
703
|
*
|
|
704
|
+
* @keywords get, fetch, retrieve, details, info, information, world
|
|
705
|
+
*
|
|
650
706
|
* @example
|
|
651
707
|
* ```ts
|
|
652
708
|
* await world.fetchDetails();
|
|
@@ -657,6 +713,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
657
713
|
/**
|
|
658
714
|
* Update details of a world.
|
|
659
715
|
*
|
|
716
|
+
* @keywords update, modify, change, edit, world, settings, details
|
|
717
|
+
*
|
|
660
718
|
* @example
|
|
661
719
|
* ```ts
|
|
662
720
|
* await world.updateDetails({
|
|
@@ -681,6 +739,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
681
739
|
/**
|
|
682
740
|
* Set close world settings
|
|
683
741
|
*
|
|
742
|
+
* @keywords update, modify, change, edit, world, settings, details, close, closed
|
|
743
|
+
*
|
|
684
744
|
* @example
|
|
685
745
|
* ```ts
|
|
686
746
|
* await world.updateCloseWorldSettings({
|
|
@@ -708,6 +768,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
708
768
|
/**
|
|
709
769
|
* Retrieve all assets dropped in a world.
|
|
710
770
|
*
|
|
771
|
+
* @keywords get, fetch, retrieve, list, current, dropped assets
|
|
772
|
+
*
|
|
711
773
|
* @category Dropped Assets
|
|
712
774
|
*
|
|
713
775
|
* @example
|
|
@@ -720,6 +782,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
720
782
|
/**
|
|
721
783
|
* Retrieve all assets dropped in a world matching uniqueName.
|
|
722
784
|
*
|
|
785
|
+
* @keywords get, fetch, retrieve, list, current, dropped assets, uniqueName
|
|
786
|
+
*
|
|
723
787
|
* @category Dropped Assets
|
|
724
788
|
*
|
|
725
789
|
* @example
|
|
@@ -737,6 +801,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
737
801
|
/**
|
|
738
802
|
* Retrieve all assets dropped in a world matching sceneDropId.
|
|
739
803
|
*
|
|
804
|
+
* @keywords get, fetch, retrieve, list, current, dropped assets, sceneDropId
|
|
805
|
+
*
|
|
740
806
|
* @category Dropped Assets
|
|
741
807
|
*
|
|
742
808
|
* @example
|
|
@@ -756,6 +822,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
756
822
|
/**
|
|
757
823
|
* Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
|
|
758
824
|
*
|
|
825
|
+
* @keywords update, modify, change, edit, dropped assets, custom text, style, text
|
|
826
|
+
*
|
|
759
827
|
* @category Dropped Assets
|
|
760
828
|
*
|
|
761
829
|
* @example
|
|
@@ -778,6 +846,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
778
846
|
/**
|
|
779
847
|
* Retrieve all landmark zone assets dropped in a world.
|
|
780
848
|
*
|
|
849
|
+
* @keywords get, fetch, retrieve, list, landmark, zones, dropped assets
|
|
850
|
+
*
|
|
781
851
|
* @category Dropped Assets
|
|
782
852
|
*
|
|
783
853
|
* @example
|
|
@@ -807,6 +877,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
807
877
|
/**
|
|
808
878
|
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
809
879
|
*
|
|
880
|
+
* @keywords get, fetch, retrieve, list, scenes
|
|
881
|
+
*
|
|
810
882
|
* @category Scenes
|
|
811
883
|
*
|
|
812
884
|
* @example
|
|
@@ -837,6 +909,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
837
909
|
/**
|
|
838
910
|
* Drops a scene in a world and returns sceneDropId.
|
|
839
911
|
*
|
|
912
|
+
* @keywords drop, add, place, scene
|
|
913
|
+
*
|
|
840
914
|
* @category Scenes
|
|
841
915
|
*
|
|
842
916
|
* @example
|
|
@@ -866,6 +940,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
866
940
|
/**
|
|
867
941
|
* Replace the current scene of a world.
|
|
868
942
|
*
|
|
943
|
+
* @keywords replace, change, scene
|
|
944
|
+
*
|
|
869
945
|
* @category Scenes
|
|
870
946
|
*
|
|
871
947
|
* @example
|
|
@@ -887,6 +963,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
887
963
|
/**
|
|
888
964
|
* Get all particles available
|
|
889
965
|
*
|
|
966
|
+
* @keywords get, fetch, retrieve, list, particles
|
|
967
|
+
*
|
|
890
968
|
* @category Particles
|
|
891
969
|
*
|
|
892
970
|
* @example
|
|
@@ -900,6 +978,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
900
978
|
/**
|
|
901
979
|
* Trigger a particle effect at a position in the world
|
|
902
980
|
*
|
|
981
|
+
* @keywords trigger, start, play, particle, effect
|
|
982
|
+
*
|
|
903
983
|
* @category Particles
|
|
904
984
|
*
|
|
905
985
|
* @example
|
|
@@ -921,6 +1001,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
921
1001
|
* Add an activity to a world
|
|
922
1002
|
* excludeFromNotification is an array of visitorIds to exclude from the notification
|
|
923
1003
|
*
|
|
1004
|
+
* @keywords start, trigger, activity
|
|
1005
|
+
*
|
|
924
1006
|
* @example
|
|
925
1007
|
* ```ts
|
|
926
1008
|
* await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
|
|
@@ -936,6 +1018,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
936
1018
|
/**
|
|
937
1019
|
* Display a message via a toast to all visitors currently in a world.
|
|
938
1020
|
*
|
|
1021
|
+
* @keywords send, display, show, toast, message, notification
|
|
1022
|
+
*
|
|
939
1023
|
* @example
|
|
940
1024
|
* ```ts
|
|
941
1025
|
* await world.fireToast({
|
|
@@ -951,6 +1035,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
951
1035
|
/**
|
|
952
1036
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
953
1037
|
*
|
|
1038
|
+
* @keywords get, fetch, retrieve, load, data, object, state
|
|
1039
|
+
*
|
|
954
1040
|
* @category Data Objects
|
|
955
1041
|
*
|
|
956
1042
|
* @example
|
|
@@ -966,6 +1052,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
966
1052
|
* @remarks
|
|
967
1053
|
* 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
|
|
968
1054
|
*
|
|
1055
|
+
* @keywords set, assign, store, save, data, object, state
|
|
1056
|
+
*
|
|
969
1057
|
* @category Data Objects
|
|
970
1058
|
*
|
|
971
1059
|
* @example
|
|
@@ -997,6 +1085,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
997
1085
|
* @remarks
|
|
998
1086
|
* 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
|
|
999
1087
|
*
|
|
1088
|
+
* @keywords update, modify, change, edit, alter, data, object, state
|
|
1089
|
+
*
|
|
1000
1090
|
* @category Data Objects
|
|
1001
1091
|
*
|
|
1002
1092
|
* @example
|
|
@@ -1025,6 +1115,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1025
1115
|
* @remarks
|
|
1026
1116
|
* 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
|
|
1027
1117
|
*
|
|
1118
|
+
* @keywords increment, increase, add, count, data, object, state
|
|
1119
|
+
*
|
|
1028
1120
|
* @category Data Objects
|
|
1029
1121
|
*
|
|
1030
1122
|
* @example
|
|
@@ -1046,6 +1138,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1046
1138
|
/**
|
|
1047
1139
|
* Retrieve all webhooks in a world.
|
|
1048
1140
|
*
|
|
1141
|
+
* @keywords get, fetch, retrieve, list, current, webhooks
|
|
1142
|
+
*
|
|
1049
1143
|
* @category Webhooks
|
|
1050
1144
|
*
|
|
1051
1145
|
* @example
|
|
@@ -1058,6 +1152,8 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1058
1152
|
/**
|
|
1059
1153
|
* Retrieve world analytics by day, week, month, quarter, or year
|
|
1060
1154
|
*
|
|
1155
|
+
* @keywords get, fetch, retrieve, analytics, stats, statistics, data, metrics
|
|
1156
|
+
*
|
|
1061
1157
|
* @category Analytics
|
|
1062
1158
|
*
|
|
1063
1159
|
* @example
|
|
@@ -1076,6 +1172,38 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1076
1172
|
}): Promise<void | ResponseType$1>;
|
|
1077
1173
|
}
|
|
1078
1174
|
|
|
1175
|
+
/**
|
|
1176
|
+
* Controller for a user's owned inventory item.
|
|
1177
|
+
*
|
|
1178
|
+
* @remarks
|
|
1179
|
+
* This class should be instantiated via UserInventoryItemFactory only.
|
|
1180
|
+
*
|
|
1181
|
+
* @property inventoryItemId - The root inventory item's id
|
|
1182
|
+
*/
|
|
1183
|
+
declare class UserInventoryItem extends InventoryItem implements UserInventoryItemInterface {
|
|
1184
|
+
userItemId: string;
|
|
1185
|
+
user_id: string;
|
|
1186
|
+
item_id: string;
|
|
1187
|
+
quantity: number;
|
|
1188
|
+
created_at?: Date;
|
|
1189
|
+
updated_at?: Date;
|
|
1190
|
+
metadata?: object | null;
|
|
1191
|
+
grant_source: string;
|
|
1192
|
+
type: string;
|
|
1193
|
+
constructor(topia: Topia, id: string, options?: UserInventoryItemOptionalInterface);
|
|
1194
|
+
/**
|
|
1195
|
+
* Fetches the user inventory item details from the platform and assigns them to this instance.
|
|
1196
|
+
*
|
|
1197
|
+
* @example
|
|
1198
|
+
* ```ts
|
|
1199
|
+
* await userInventoryItem.fetchUserInventoryItemById();
|
|
1200
|
+
* ```
|
|
1201
|
+
*
|
|
1202
|
+
* @returns {Promise<void>} Returns when the item has been fetched and assigned.
|
|
1203
|
+
*/
|
|
1204
|
+
fetchUserInventoryItemById(): Promise<void>;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1079
1207
|
/**
|
|
1080
1208
|
* Create an instance of User class with optional session credentials.
|
|
1081
1209
|
*
|
|
@@ -1111,6 +1239,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1111
1239
|
/**
|
|
1112
1240
|
* Returns all avatars owned by User
|
|
1113
1241
|
*
|
|
1242
|
+
* @keywords get, fetch, retrieve, list, avatars, characters
|
|
1243
|
+
*
|
|
1114
1244
|
* @category Avatars
|
|
1115
1245
|
*
|
|
1116
1246
|
* @example
|
|
@@ -1124,6 +1254,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1124
1254
|
/**
|
|
1125
1255
|
* Add a new avatar
|
|
1126
1256
|
*
|
|
1257
|
+
* @keywords add, create, upload, avatar, character
|
|
1258
|
+
*
|
|
1127
1259
|
* @category Avatars
|
|
1128
1260
|
*
|
|
1129
1261
|
* @example
|
|
@@ -1196,6 +1328,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1196
1328
|
/**
|
|
1197
1329
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1198
1330
|
*
|
|
1331
|
+
* @keywords update, modify, change, edit, avatar, character
|
|
1332
|
+
*
|
|
1199
1333
|
* @category Avatars
|
|
1200
1334
|
*
|
|
1201
1335
|
* @example
|
|
@@ -1268,6 +1402,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1268
1402
|
/**
|
|
1269
1403
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1270
1404
|
*
|
|
1405
|
+
* @keywords delete, remove, erase, destroy, eliminate, avatar
|
|
1406
|
+
*
|
|
1271
1407
|
* @category Avatars
|
|
1272
1408
|
*
|
|
1273
1409
|
* @example
|
|
@@ -1279,6 +1415,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1279
1415
|
/**
|
|
1280
1416
|
* Returns all assets owned by User when an email address is provided.
|
|
1281
1417
|
*
|
|
1418
|
+
* @keywords get, fetch, retrieve, list, user assets, objects
|
|
1419
|
+
*
|
|
1282
1420
|
* @category Assets
|
|
1283
1421
|
*
|
|
1284
1422
|
* @example
|
|
@@ -1291,6 +1429,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1291
1429
|
/**
|
|
1292
1430
|
* Returns all platform assets.
|
|
1293
1431
|
*
|
|
1432
|
+
* @keywords get, fetch, retrieve, list, platform assets, objects
|
|
1433
|
+
*
|
|
1294
1434
|
* @category Assets
|
|
1295
1435
|
*
|
|
1296
1436
|
* @example
|
|
@@ -1304,6 +1444,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1304
1444
|
/**
|
|
1305
1445
|
* Returns all scenes owned by User.
|
|
1306
1446
|
*
|
|
1447
|
+
* @keywords get, fetch, retrieve, list, user scenes
|
|
1448
|
+
*
|
|
1307
1449
|
* @category Scenes
|
|
1308
1450
|
*
|
|
1309
1451
|
* @example
|
|
@@ -1316,6 +1458,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1316
1458
|
/**
|
|
1317
1459
|
* 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.
|
|
1318
1460
|
*
|
|
1461
|
+
* @keywords get, fetch, retrieve, list, user worlds
|
|
1462
|
+
*
|
|
1319
1463
|
* @category Worlds
|
|
1320
1464
|
*
|
|
1321
1465
|
* @example
|
|
@@ -1333,6 +1477,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1333
1477
|
/**
|
|
1334
1478
|
* 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.
|
|
1335
1479
|
*
|
|
1480
|
+
* @keywords get, fetch, retrieve, list, admin worlds, user worlds
|
|
1481
|
+
*
|
|
1336
1482
|
* @category Worlds
|
|
1337
1483
|
*
|
|
1338
1484
|
* @example
|
|
@@ -1345,6 +1491,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1345
1491
|
/**
|
|
1346
1492
|
* Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
|
|
1347
1493
|
*
|
|
1494
|
+
* @keywords get, fetch, retrieve, list, interactive worlds, public key
|
|
1495
|
+
*
|
|
1348
1496
|
* @category Dropped Assets
|
|
1349
1497
|
*
|
|
1350
1498
|
* @example
|
|
@@ -1359,6 +1507,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1359
1507
|
/**
|
|
1360
1508
|
* Send an email
|
|
1361
1509
|
*
|
|
1510
|
+
* @keywords send, email, message, notify
|
|
1511
|
+
*
|
|
1362
1512
|
* @example
|
|
1363
1513
|
* ```ts
|
|
1364
1514
|
* const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
|
|
@@ -1375,6 +1525,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1375
1525
|
/**
|
|
1376
1526
|
* Get expressions
|
|
1377
1527
|
*
|
|
1528
|
+
* @keywords get, fetch, retrieve, list, expressions, emotes
|
|
1529
|
+
*
|
|
1378
1530
|
* @category Expressions
|
|
1379
1531
|
*
|
|
1380
1532
|
* @example
|
|
@@ -1391,6 +1543,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1391
1543
|
/**
|
|
1392
1544
|
* Retrieves the data object for a user.
|
|
1393
1545
|
*
|
|
1546
|
+
* @keywords get, fetch, retrieve, load, data, object, state
|
|
1547
|
+
*
|
|
1394
1548
|
* @category Data Objects
|
|
1395
1549
|
*
|
|
1396
1550
|
* @example
|
|
@@ -1404,6 +1558,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1404
1558
|
/**
|
|
1405
1559
|
* Sets the data object for a user.
|
|
1406
1560
|
*
|
|
1561
|
+
* @keywords set, assign, store, save, data, object, state
|
|
1562
|
+
*
|
|
1407
1563
|
* @remarks
|
|
1408
1564
|
* 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
|
|
1409
1565
|
*
|
|
@@ -1436,6 +1592,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1436
1592
|
/**
|
|
1437
1593
|
* Updates the data object for a user.
|
|
1438
1594
|
*
|
|
1595
|
+
* @keywords update, modify, change, edit, alter, data, object, state
|
|
1596
|
+
*
|
|
1439
1597
|
* @remarks
|
|
1440
1598
|
* 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
|
|
1441
1599
|
*
|
|
@@ -1466,6 +1624,8 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1466
1624
|
/**
|
|
1467
1625
|
* 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.
|
|
1468
1626
|
*
|
|
1627
|
+
* @keywords increment, increase, add, count, data, object, state
|
|
1628
|
+
*
|
|
1469
1629
|
* @remarks
|
|
1470
1630
|
* 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
|
|
1471
1631
|
*
|
|
@@ -1487,6 +1647,53 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1487
1647
|
releaseLock?: boolean;
|
|
1488
1648
|
};
|
|
1489
1649
|
}): Promise<void | ResponseType$1>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Retrieves all inventory items owned by this visitor and app's key.
|
|
1652
|
+
*
|
|
1653
|
+
* @keywords get, fetch, retrieve, list, inventory, items, visitor
|
|
1654
|
+
*
|
|
1655
|
+
* @example
|
|
1656
|
+
* ```ts
|
|
1657
|
+
* const items = await visitor.fetchInventoryItems();
|
|
1658
|
+
* ```
|
|
1659
|
+
*
|
|
1660
|
+
* @returns {Promise<void>} Returns an array of InventoryItem objects.
|
|
1661
|
+
*/
|
|
1662
|
+
fetchInventoryItems(): Promise<void>;
|
|
1663
|
+
get inventoryItems(): UserInventoryItem[];
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* InventoryItem represents an item in a user's inventory.
|
|
1668
|
+
*
|
|
1669
|
+
* @remarks
|
|
1670
|
+
* This class should be instantiated via InventoryFactory only.
|
|
1671
|
+
*
|
|
1672
|
+
* @keywords inventory, item, asset, object
|
|
1673
|
+
*/
|
|
1674
|
+
declare class InventoryItem extends SDKController implements InventoryItemInterface {
|
|
1675
|
+
id: string;
|
|
1676
|
+
name?: string;
|
|
1677
|
+
description?: string;
|
|
1678
|
+
type?: string;
|
|
1679
|
+
created_at?: Date;
|
|
1680
|
+
updated_at?: Date;
|
|
1681
|
+
metadata?: object | null;
|
|
1682
|
+
image_path?: string;
|
|
1683
|
+
interactive_key_id?: string;
|
|
1684
|
+
status?: string;
|
|
1685
|
+
constructor(topia: Topia, id: string, options?: InventoryItemOptionalInterface);
|
|
1686
|
+
/**
|
|
1687
|
+
* Fetches the inventory item details from the platform and assigns them to this instance.
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* await item.fetchInventoryItemById();
|
|
1692
|
+
* ```
|
|
1693
|
+
*
|
|
1694
|
+
* @returns {Promise<InventoryItem>} Returns when the item has been fetched and assigned.
|
|
1695
|
+
*/
|
|
1696
|
+
fetchInventoryItemById(): Promise<InventoryItem>;
|
|
1490
1697
|
}
|
|
1491
1698
|
|
|
1492
1699
|
/**
|
|
@@ -1500,6 +1707,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1500
1707
|
* ```
|
|
1501
1708
|
*/
|
|
1502
1709
|
declare class Visitor extends User implements VisitorInterface {
|
|
1710
|
+
#private;
|
|
1503
1711
|
readonly id: number;
|
|
1504
1712
|
urlSlug: string;
|
|
1505
1713
|
user?: User;
|
|
@@ -1507,6 +1715,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1507
1715
|
/**
|
|
1508
1716
|
* Get a single visitor from a world
|
|
1509
1717
|
*
|
|
1718
|
+
* @keywords get, fetch, retrieve, load, visitor, details
|
|
1719
|
+
*
|
|
1510
1720
|
* @example
|
|
1511
1721
|
* ```ts
|
|
1512
1722
|
* await visitor.fetchVisitor();
|
|
@@ -1519,6 +1729,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1519
1729
|
/**
|
|
1520
1730
|
* Teleport or walk a visitor currently in a world to a single set of coordinates.
|
|
1521
1731
|
*
|
|
1732
|
+
* @keywords move, teleport, walk, position, coordinate, location, place
|
|
1733
|
+
*
|
|
1522
1734
|
* @example
|
|
1523
1735
|
* ```ts
|
|
1524
1736
|
* await visitor.moveVisitor({
|
|
@@ -1535,6 +1747,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1535
1747
|
/**
|
|
1536
1748
|
* Display a message via a toast to a visitor currently in a world.
|
|
1537
1749
|
*
|
|
1750
|
+
* @keywords toast, message, notification, alert, display, show, popup
|
|
1751
|
+
*
|
|
1538
1752
|
* @example
|
|
1539
1753
|
* ```ts
|
|
1540
1754
|
* await visitor.fireToast({
|
|
@@ -1550,6 +1764,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1550
1764
|
/**
|
|
1551
1765
|
* Open an iframe in a drawer or modal for a visitor currently in a world.
|
|
1552
1766
|
*
|
|
1767
|
+
* @keywords open, iframe, drawer, modal, link, url, website, web page
|
|
1768
|
+
*
|
|
1553
1769
|
* @category iframes
|
|
1554
1770
|
*
|
|
1555
1771
|
* @example
|
|
@@ -1568,6 +1784,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1568
1784
|
/**
|
|
1569
1785
|
* Reload an iframe for a visitor currently in a world.
|
|
1570
1786
|
*
|
|
1787
|
+
* @keywords reload, iframe, drawer, modal, link, url, website, web page
|
|
1788
|
+
*
|
|
1571
1789
|
* @category iframes
|
|
1572
1790
|
*
|
|
1573
1791
|
* @example
|
|
@@ -1581,6 +1799,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1581
1799
|
/**
|
|
1582
1800
|
* Close an iframe for a visitor currently in a world.
|
|
1583
1801
|
*
|
|
1802
|
+
* @keywords close, iframe, drawer, modal
|
|
1803
|
+
*
|
|
1584
1804
|
* @category iframes
|
|
1585
1805
|
*
|
|
1586
1806
|
* @example
|
|
@@ -1594,6 +1814,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1594
1814
|
/**
|
|
1595
1815
|
* Mute and turn video off for a visitor currently in a world.
|
|
1596
1816
|
*
|
|
1817
|
+
* @keywords mute, video, av, turn off, disable
|
|
1818
|
+
*
|
|
1597
1819
|
* @example
|
|
1598
1820
|
* ```ts
|
|
1599
1821
|
* await visitor.turnAVOff();
|
|
@@ -1605,6 +1827,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1605
1827
|
/**
|
|
1606
1828
|
* Get expressions
|
|
1607
1829
|
*
|
|
1830
|
+
* @keywords get, fetch, retrieve, list, expressions, emotes
|
|
1831
|
+
*
|
|
1608
1832
|
* @category Expressions
|
|
1609
1833
|
*
|
|
1610
1834
|
* @example
|
|
@@ -1620,6 +1844,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1620
1844
|
/**
|
|
1621
1845
|
* Grant expression to a visitor by id or name.
|
|
1622
1846
|
*
|
|
1847
|
+
* @keywords grant, give, add, expression, emote
|
|
1848
|
+
*
|
|
1623
1849
|
* @category Expressions
|
|
1624
1850
|
*
|
|
1625
1851
|
* @example
|
|
@@ -1637,6 +1863,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1637
1863
|
/**
|
|
1638
1864
|
* Get all particles available
|
|
1639
1865
|
*
|
|
1866
|
+
* @keywords get, fetch, retrieve, list, particles, effects
|
|
1867
|
+
*
|
|
1640
1868
|
* @category Particle Effects
|
|
1641
1869
|
*
|
|
1642
1870
|
* @example
|
|
@@ -1650,6 +1878,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1650
1878
|
/**
|
|
1651
1879
|
* Trigger a particle effect on a visitor
|
|
1652
1880
|
*
|
|
1881
|
+
* @keywords trigger, particle, effect, spawn, start, play
|
|
1882
|
+
*
|
|
1653
1883
|
* @category Particle Effects
|
|
1654
1884
|
*
|
|
1655
1885
|
* @example
|
|
@@ -1667,6 +1897,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1667
1897
|
/**
|
|
1668
1898
|
* Retrieves the data object for a visitor.
|
|
1669
1899
|
*
|
|
1900
|
+
* @keywords get, fetch, retrieve, load, data, object, state
|
|
1901
|
+
*
|
|
1670
1902
|
* @category Data Objects
|
|
1671
1903
|
*
|
|
1672
1904
|
* @example
|
|
@@ -1680,6 +1912,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1680
1912
|
/**
|
|
1681
1913
|
* Sets the data object for a visitor.
|
|
1682
1914
|
*
|
|
1915
|
+
* @keywords set, assign, store, save, data, object, state
|
|
1916
|
+
*
|
|
1683
1917
|
* @remarks
|
|
1684
1918
|
* 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
|
|
1685
1919
|
*
|
|
@@ -1715,6 +1949,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1715
1949
|
* @remarks
|
|
1716
1950
|
* 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
|
|
1717
1951
|
*
|
|
1952
|
+
* @keywords update, modify, change, edit, alter, data, object, state
|
|
1953
|
+
*
|
|
1718
1954
|
* @category Data Objects
|
|
1719
1955
|
*
|
|
1720
1956
|
* @example
|
|
@@ -1745,6 +1981,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1745
1981
|
* @remarks
|
|
1746
1982
|
* 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
|
|
1747
1983
|
*
|
|
1984
|
+
* @keywords increment, increase, add, count, data, object, state
|
|
1985
|
+
*
|
|
1748
1986
|
* @category Data Objects
|
|
1749
1987
|
*
|
|
1750
1988
|
* @example
|
|
@@ -1766,6 +2004,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1766
2004
|
/**
|
|
1767
2005
|
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
1768
2006
|
*
|
|
2007
|
+
* @keywords update, modify, change, edit, analytics, analytic, stats, statistics, data
|
|
2008
|
+
*
|
|
1769
2009
|
* @example
|
|
1770
2010
|
* ```ts
|
|
1771
2011
|
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
@@ -1775,6 +2015,8 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1775
2015
|
/**
|
|
1776
2016
|
* Setup signal to visitor
|
|
1777
2017
|
*
|
|
2018
|
+
* @keywords signal, webrtc, answer, connect, p2p
|
|
2019
|
+
*
|
|
1778
2020
|
* @example
|
|
1779
2021
|
* ```ts
|
|
1780
2022
|
* await visitor.sendSignalToVisitor(iceServers);
|
|
@@ -1783,6 +2025,61 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1783
2025
|
sendSignalToVisitor(signal: any): Promise<void | (ResponseType$1 & {
|
|
1784
2026
|
answerSignal: any;
|
|
1785
2027
|
})>;
|
|
2028
|
+
/**
|
|
2029
|
+
* Retrieves all inventory items owned by this visitor and app's key.
|
|
2030
|
+
*
|
|
2031
|
+
* @keywords get, fetch, retrieve, list, inventory, items, visitor
|
|
2032
|
+
*
|
|
2033
|
+
* @example
|
|
2034
|
+
* ```ts
|
|
2035
|
+
* const items = await visitor.fetchInventoryItems();
|
|
2036
|
+
* ```
|
|
2037
|
+
*
|
|
2038
|
+
* @returns {Promise<void>} Returns an array of InventoryItem objects.
|
|
2039
|
+
*/
|
|
2040
|
+
fetchInventoryItem(item: InventoryItem): Promise<UserInventoryItem>;
|
|
2041
|
+
/**
|
|
2042
|
+
* Retrieves all inventory items owned by this visitor and app's key.
|
|
2043
|
+
*
|
|
2044
|
+
* @keywords get, fetch, retrieve, list, inventory, items, visitor
|
|
2045
|
+
*
|
|
2046
|
+
* @example
|
|
2047
|
+
* ```ts
|
|
2048
|
+
* const items = await visitor.fetchInventoryItems();
|
|
2049
|
+
* ```
|
|
2050
|
+
*
|
|
2051
|
+
* @returns {Promise<void>} Returns an array of InventoryItem objects.
|
|
2052
|
+
*/
|
|
2053
|
+
fetchInventoryItems(): Promise<void>;
|
|
2054
|
+
get inventoryItems(): UserInventoryItem[];
|
|
2055
|
+
/**
|
|
2056
|
+
* Grants an inventory item to this visitor.
|
|
2057
|
+
*
|
|
2058
|
+
* @param itemId The ID of the inventory item to grant.
|
|
2059
|
+
* @param quantity The quantity to grant (default 1).
|
|
2060
|
+
*
|
|
2061
|
+
* @example
|
|
2062
|
+
* ```ts
|
|
2063
|
+
* await visitor.grantInventoryItem("item-id-123", 2);
|
|
2064
|
+
* ```
|
|
2065
|
+
*
|
|
2066
|
+
* @returns {Promise<UserInventoryItem>} Returns the updated inventory or a response object.
|
|
2067
|
+
*/
|
|
2068
|
+
grantInventoryItem(item: InventoryItem, quantity?: number): Promise<UserInventoryItem>;
|
|
2069
|
+
/**
|
|
2070
|
+
* Modifies the quantity of an inventory item in this visitor's inventory.
|
|
2071
|
+
*
|
|
2072
|
+
* @param itemId The ID of the inventory item to modify.
|
|
2073
|
+
* @param quantity The new quantity to set.
|
|
2074
|
+
*
|
|
2075
|
+
* @example
|
|
2076
|
+
* ```ts
|
|
2077
|
+
* await visitor.modifyInventoryItemQuantity("item-id-123", 5);
|
|
2078
|
+
* ```
|
|
2079
|
+
*
|
|
2080
|
+
* @returns {Promise<UserInventoryItem>} Returns the updated inventory or a response object.
|
|
2081
|
+
*/
|
|
2082
|
+
modifyInventoryItemQuantity(item: UserInventoryItem, quantity: number): Promise<UserInventoryItem>;
|
|
1786
2083
|
}
|
|
1787
2084
|
|
|
1788
2085
|
type VisitorType = {
|
|
@@ -1825,7 +2122,7 @@ declare enum WorldActivityType {
|
|
|
1825
2122
|
}
|
|
1826
2123
|
|
|
1827
2124
|
interface SDKInterface {
|
|
1828
|
-
credentials?: InteractiveCredentials;
|
|
2125
|
+
credentials?: InteractiveCredentials$1;
|
|
1829
2126
|
jwt?: string;
|
|
1830
2127
|
requestOptions: object;
|
|
1831
2128
|
topia: Topia;
|
|
@@ -1862,7 +2159,7 @@ interface AssetInterface extends SDKInterface {
|
|
|
1862
2159
|
}
|
|
1863
2160
|
type AssetOptionalInterface = {
|
|
1864
2161
|
attributes?: AssetInterface | object;
|
|
1865
|
-
credentials?: InteractiveCredentials;
|
|
2162
|
+
credentials?: InteractiveCredentials$1;
|
|
1866
2163
|
};
|
|
1867
2164
|
|
|
1868
2165
|
interface DroppedAssetInterface extends AssetInterface {
|
|
@@ -1984,7 +2281,7 @@ interface DroppedAssetOptionalInterface {
|
|
|
1984
2281
|
text?: string;
|
|
1985
2282
|
urlSlug?: string;
|
|
1986
2283
|
};
|
|
1987
|
-
credentials?: InteractiveCredentials | object;
|
|
2284
|
+
credentials?: InteractiveCredentials$1 | object;
|
|
1988
2285
|
}
|
|
1989
2286
|
interface UpdateBroadcastInterface {
|
|
1990
2287
|
assetBroadcast?: boolean;
|
|
@@ -2076,7 +2373,7 @@ interface EcosystemInterface {
|
|
|
2076
2373
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
2077
2374
|
}
|
|
2078
2375
|
interface EcosystemOptionalInterface {
|
|
2079
|
-
credentials?: InteractiveCredentials;
|
|
2376
|
+
credentials?: InteractiveCredentials$1;
|
|
2080
2377
|
}
|
|
2081
2378
|
|
|
2082
2379
|
interface SceneInterface {
|
|
@@ -2104,7 +2401,7 @@ interface SceneInterface {
|
|
|
2104
2401
|
}
|
|
2105
2402
|
type SceneOptionalInterface = {
|
|
2106
2403
|
attributes?: SceneInterface | object;
|
|
2107
|
-
credentials?: InteractiveCredentials;
|
|
2404
|
+
credentials?: InteractiveCredentials$1;
|
|
2108
2405
|
};
|
|
2109
2406
|
|
|
2110
2407
|
interface FireToastInterface {
|
|
@@ -2147,7 +2444,7 @@ interface UserInterface {
|
|
|
2147
2444
|
dataObject?: object | null;
|
|
2148
2445
|
}
|
|
2149
2446
|
interface UserOptionalInterface {
|
|
2150
|
-
credentials?: InteractiveCredentials;
|
|
2447
|
+
credentials?: InteractiveCredentials$1;
|
|
2151
2448
|
profileId?: string | null;
|
|
2152
2449
|
visitorId?: number | null;
|
|
2153
2450
|
urlSlug?: string;
|
|
@@ -2170,19 +2467,24 @@ interface VisitorInterface extends SDKInterface {
|
|
|
2170
2467
|
name?: string;
|
|
2171
2468
|
}): Promise<ResponseType$1>;
|
|
2172
2469
|
getAllParticles(): Promise<ResponseType$1>;
|
|
2470
|
+
fetchInventoryItems(): Promise<void>;
|
|
2471
|
+
inventoryItems: UserInventoryItem[];
|
|
2472
|
+
grantInventoryItem(item: InventoryItem, quantity: number): Promise<UserInventoryItem>;
|
|
2473
|
+
modifyInventoryItemQuantity(item: UserInventoryItem, quantity: number): Promise<UserInventoryItem>;
|
|
2474
|
+
fetchInventoryItem(item: InventoryItem): Promise<UserInventoryItem>;
|
|
2173
2475
|
triggerParticle({ id, name, duration, }: {
|
|
2174
2476
|
id?: string;
|
|
2175
2477
|
name?: string;
|
|
2176
2478
|
duration?: number;
|
|
2177
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
2178
|
-
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
|
|
2179
|
-
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
2180
|
-
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
2181
|
-
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
|
|
2182
|
-
sendSignalToVisitor(signal: any): Promise<void | (ResponseType$1 & {
|
|
2183
|
-
answerSignal: any;
|
|
2184
|
-
})>;
|
|
2185
2479
|
}): Promise<ResponseType$1 | string>;
|
|
2480
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
2481
|
+
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
|
|
2482
|
+
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
2483
|
+
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
2484
|
+
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
|
|
2485
|
+
sendSignalToVisitor(signal: any): Promise<void | (ResponseType$1 & {
|
|
2486
|
+
answerSignal: any;
|
|
2487
|
+
})>;
|
|
2186
2488
|
color?: string;
|
|
2187
2489
|
dataObject?: object | null | undefined;
|
|
2188
2490
|
displayName?: string;
|
|
@@ -2213,7 +2515,7 @@ interface VisitorInterface extends SDKInterface {
|
|
|
2213
2515
|
}
|
|
2214
2516
|
interface VisitorOptionalInterface {
|
|
2215
2517
|
attributes?: VisitorInterface | object;
|
|
2216
|
-
credentials?: InteractiveCredentials;
|
|
2518
|
+
credentials?: InteractiveCredentials$1;
|
|
2217
2519
|
}
|
|
2218
2520
|
interface MoveVisitorInterface {
|
|
2219
2521
|
shouldTeleportVisitor: boolean;
|
|
@@ -2246,12 +2548,12 @@ interface WebRTCConnectorInterface {
|
|
|
2246
2548
|
getTwilioConfig(): Promise<void | ResponseType$1>;
|
|
2247
2549
|
}
|
|
2248
2550
|
interface WebRTCConnectorOptionalInterface {
|
|
2249
|
-
credentials?: InteractiveCredentials;
|
|
2551
|
+
credentials?: InteractiveCredentials$1;
|
|
2250
2552
|
twilioConfig?: object;
|
|
2251
2553
|
}
|
|
2252
2554
|
|
|
2253
2555
|
interface WorldActivityOptionalInterface {
|
|
2254
|
-
credentials?: InteractiveCredentials;
|
|
2556
|
+
credentials?: InteractiveCredentials$1;
|
|
2255
2557
|
}
|
|
2256
2558
|
interface MoveAllVisitorsInterface {
|
|
2257
2559
|
shouldFetchVisitors?: boolean;
|
|
@@ -2341,12 +2643,62 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
|
|
|
2341
2643
|
}
|
|
2342
2644
|
interface WorldOptionalInterface {
|
|
2343
2645
|
attributes?: WorldDetailsInterface | object;
|
|
2344
|
-
credentials?: InteractiveCredentials;
|
|
2646
|
+
credentials?: InteractiveCredentials$1;
|
|
2345
2647
|
}
|
|
2346
2648
|
interface WorldWebhooksInterface {
|
|
2347
2649
|
webhooks: Array<WebhookInterface>;
|
|
2348
2650
|
}
|
|
2349
2651
|
|
|
2652
|
+
type InteractiveCredentials = {
|
|
2653
|
+
apiKey?: string;
|
|
2654
|
+
assetId?: string;
|
|
2655
|
+
interactiveNonce?: string;
|
|
2656
|
+
interactivePublicKey?: string;
|
|
2657
|
+
profileId?: string | null;
|
|
2658
|
+
urlSlug?: string;
|
|
2659
|
+
visitorId?: number;
|
|
2660
|
+
iframeId?: string;
|
|
2661
|
+
gameEngineId?: string;
|
|
2662
|
+
};
|
|
2663
|
+
|
|
2664
|
+
/**
|
|
2665
|
+
* Interface for an inventory item.
|
|
2666
|
+
*/
|
|
2667
|
+
interface InventoryItemInterface extends SDKInterface {
|
|
2668
|
+
id: string;
|
|
2669
|
+
name?: string;
|
|
2670
|
+
description?: string;
|
|
2671
|
+
type?: string;
|
|
2672
|
+
created_at?: Date;
|
|
2673
|
+
updated_at?: Date;
|
|
2674
|
+
metadata?: object | null;
|
|
2675
|
+
image_path?: string;
|
|
2676
|
+
interactive_key_id?: string;
|
|
2677
|
+
status?: string;
|
|
2678
|
+
}
|
|
2679
|
+
type InventoryItemOptionalInterface = {
|
|
2680
|
+
attributes?: InventoryItemInterface | object;
|
|
2681
|
+
credentials?: InteractiveCredentials;
|
|
2682
|
+
};
|
|
2683
|
+
|
|
2684
|
+
/**
|
|
2685
|
+
* Interface for a user-owned inventory item.
|
|
2686
|
+
*/
|
|
2687
|
+
interface UserInventoryItemInterface extends InventoryItemInterface {
|
|
2688
|
+
userItemId: string;
|
|
2689
|
+
user_id: string;
|
|
2690
|
+
item_id: string;
|
|
2691
|
+
quantity: number;
|
|
2692
|
+
created_at?: Date;
|
|
2693
|
+
updated_at?: Date;
|
|
2694
|
+
metadata?: object | null;
|
|
2695
|
+
grant_source: string;
|
|
2696
|
+
}
|
|
2697
|
+
type UserInventoryItemOptionalInterface = {
|
|
2698
|
+
attributes?: UserInventoryItemInterface | object;
|
|
2699
|
+
credentials?: InteractiveCredentials;
|
|
2700
|
+
};
|
|
2701
|
+
|
|
2350
2702
|
/**
|
|
2351
2703
|
* Create a single instance of Topia axios used for all calls to the public API in all classes
|
|
2352
2704
|
*
|
|
@@ -2400,11 +2752,11 @@ declare class Topia implements TopiaInterface {
|
|
|
2400
2752
|
* ```
|
|
2401
2753
|
*/
|
|
2402
2754
|
declare abstract class SDKController implements SDKInterface {
|
|
2403
|
-
credentials: InteractiveCredentials | undefined;
|
|
2755
|
+
credentials: InteractiveCredentials$1 | undefined;
|
|
2404
2756
|
jwt?: string;
|
|
2405
2757
|
requestOptions: object;
|
|
2406
2758
|
topia: Topia;
|
|
2407
|
-
constructor(topia: Topia, credentials?: InteractiveCredentials);
|
|
2759
|
+
constructor(topia: Topia, credentials?: InteractiveCredentials$1);
|
|
2408
2760
|
topiaPublicApi(): axios.AxiosInstance;
|
|
2409
2761
|
errorHandler({ error, message, params, sdkMethod, }: {
|
|
2410
2762
|
error?: Error | AxiosError | unknown;
|
|
@@ -2444,6 +2796,8 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2444
2796
|
/**
|
|
2445
2797
|
* Retrieves platform asset details and assigns response data to the instance.
|
|
2446
2798
|
*
|
|
2799
|
+
* @keywords get, fetch, retrieve, load, details, info, information
|
|
2800
|
+
*
|
|
2447
2801
|
* @example
|
|
2448
2802
|
* ```ts
|
|
2449
2803
|
* await asset.fetchAssetById();
|
|
@@ -2456,6 +2810,8 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2456
2810
|
/**
|
|
2457
2811
|
* Updates platform asset details.
|
|
2458
2812
|
*
|
|
2813
|
+
* @keywords update, modify, change, edit, alter, transform
|
|
2814
|
+
*
|
|
2459
2815
|
* @example
|
|
2460
2816
|
* ```ts
|
|
2461
2817
|
* await asset.updateAsset({
|
|
@@ -2494,11 +2850,14 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2494
2850
|
* ```
|
|
2495
2851
|
*/
|
|
2496
2852
|
declare class Ecosystem extends SDKController {
|
|
2853
|
+
#private;
|
|
2497
2854
|
dataObject?: object | null | undefined;
|
|
2498
2855
|
constructor(topia: Topia, options?: EcosystemOptionalInterface);
|
|
2499
2856
|
/**
|
|
2500
2857
|
* Retrieves the data object for a Topia ecosystem. Requires canUpdateEcosystemDataObjects permission to be set to true for the public key.
|
|
2501
2858
|
*
|
|
2859
|
+
* @keywords get, fetch, retrieve, load, data, object, state
|
|
2860
|
+
*
|
|
2502
2861
|
* @category Data Objects
|
|
2503
2862
|
*
|
|
2504
2863
|
* @example
|
|
@@ -2517,6 +2876,8 @@ declare class Ecosystem extends SDKController {
|
|
|
2517
2876
|
*
|
|
2518
2877
|
* 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
|
|
2519
2878
|
*
|
|
2879
|
+
* @keywords set, assign, store, save, data, object, state
|
|
2880
|
+
*
|
|
2520
2881
|
* @category Data Objects
|
|
2521
2882
|
*
|
|
2522
2883
|
* @example
|
|
@@ -2547,6 +2908,8 @@ declare class Ecosystem extends SDKController {
|
|
|
2547
2908
|
*
|
|
2548
2909
|
* 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
|
|
2549
2910
|
*
|
|
2911
|
+
* @keywords update, modify, change, edit, alter, data, object, state
|
|
2912
|
+
*
|
|
2550
2913
|
* @category Data Objects
|
|
2551
2914
|
*
|
|
2552
2915
|
* @example
|
|
@@ -2583,6 +2946,8 @@ declare class Ecosystem extends SDKController {
|
|
|
2583
2946
|
*
|
|
2584
2947
|
* 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
|
|
2585
2948
|
*
|
|
2949
|
+
* @keywords increment, increase, add, count, data, object, state
|
|
2950
|
+
*
|
|
2586
2951
|
* @category Data Objects
|
|
2587
2952
|
*
|
|
2588
2953
|
* @example
|
|
@@ -2604,6 +2969,20 @@ declare class Ecosystem extends SDKController {
|
|
|
2604
2969
|
releaseLock?: boolean;
|
|
2605
2970
|
};
|
|
2606
2971
|
}): Promise<void | ResponseType$1>;
|
|
2972
|
+
/**
|
|
2973
|
+
* Retrieves all inventory items for a given keyholder (app public key).
|
|
2974
|
+
*
|
|
2975
|
+
* @keywords get, fetch, retrieve, list, inventory, items, keyholder
|
|
2976
|
+
*
|
|
2977
|
+
* @example
|
|
2978
|
+
* ```ts
|
|
2979
|
+
* const items = await ecosystem.fetchInventoryItems("appPublicKey", "appJWT");
|
|
2980
|
+
* ```
|
|
2981
|
+
*
|
|
2982
|
+
* @returns {Promise<object[]>} Returns an array of InventoryItem objects.
|
|
2983
|
+
*/
|
|
2984
|
+
fetchInventoryItems(): Promise<void>;
|
|
2985
|
+
get inventoryItems(): InventoryItem[];
|
|
2607
2986
|
}
|
|
2608
2987
|
|
|
2609
2988
|
/**
|
|
@@ -2658,6 +3037,8 @@ declare class WorldActivity extends SDKController {
|
|
|
2658
3037
|
/**
|
|
2659
3038
|
* Retrieve all visitors currently in a world.
|
|
2660
3039
|
*
|
|
3040
|
+
* @keywords get, fetch, retrieve, list, current, visitors, users, players
|
|
3041
|
+
*
|
|
2661
3042
|
* @category Visitors
|
|
2662
3043
|
*
|
|
2663
3044
|
* @example
|
|
@@ -2673,6 +3054,8 @@ declare class WorldActivity extends SDKController {
|
|
|
2673
3054
|
/**
|
|
2674
3055
|
* Retrieve all visitors currently in a Landmark Zone.
|
|
2675
3056
|
*
|
|
3057
|
+
* @keywords get, fetch, retrieve, list, zone, area, landmark, visitors, users
|
|
3058
|
+
*
|
|
2676
3059
|
* @category Visitors
|
|
2677
3060
|
*
|
|
2678
3061
|
* @example
|
|
@@ -2695,6 +3078,8 @@ declare class WorldActivity extends SDKController {
|
|
|
2695
3078
|
* Optionally refetch visitors, teleport or walk visitors to new location,
|
|
2696
3079
|
* and scatter visitors by any number so that they don't all move to the exact same location.
|
|
2697
3080
|
*
|
|
3081
|
+
* @keywords move, teleport, position, coordinate, visitors, users, relocate
|
|
3082
|
+
*
|
|
2698
3083
|
* @category Visitors
|
|
2699
3084
|
*
|
|
2700
3085
|
* @example
|
|
@@ -2715,6 +3100,8 @@ declare class WorldActivity extends SDKController {
|
|
|
2715
3100
|
/**
|
|
2716
3101
|
* Teleport or walk a list of visitors currently in a world to various coordinates.
|
|
2717
3102
|
*
|
|
3103
|
+
* @keywords move, teleport, position, coordinate, visitor, user, relocate
|
|
3104
|
+
*
|
|
2718
3105
|
* @category Visitors
|
|
2719
3106
|
*
|
|
2720
3107
|
* @example
|
|
@@ -2742,109 +3129,270 @@ declare class WorldActivity extends SDKController {
|
|
|
2742
3129
|
}
|
|
2743
3130
|
|
|
2744
3131
|
/**
|
|
3132
|
+
* Factory for creating Asset instances. Use this factory to create or upload assets in the Topia platform.
|
|
3133
|
+
*
|
|
3134
|
+
* @remarks
|
|
3135
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3136
|
+
*
|
|
3137
|
+
* @keywords asset, factory, create, upload, instantiate, topia
|
|
3138
|
+
*
|
|
2745
3139
|
* @example
|
|
2746
3140
|
* ```ts
|
|
2747
|
-
*
|
|
3141
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3142
|
+
* import { Topia, AssetFactory } from "@rtsdk/topia";
|
|
3143
|
+
* const topia = new Topia({ config });
|
|
3144
|
+
* export const Asset = new AssetFactory(topia);
|
|
2748
3145
|
* ```
|
|
2749
3146
|
*/
|
|
2750
3147
|
declare class AssetFactory extends SDKController {
|
|
2751
3148
|
constructor(topia: Topia);
|
|
2752
3149
|
/**
|
|
2753
|
-
* Instantiate a new instance of Asset class.
|
|
3150
|
+
* Instantiate a new instance of Asset class with the specified asset id.
|
|
3151
|
+
*
|
|
3152
|
+
* @remarks
|
|
3153
|
+
* This method creates a new Asset controller instance that can be used to interact with an existing asset.
|
|
3154
|
+
* It does not create a new asset in the database.
|
|
3155
|
+
*
|
|
3156
|
+
* @keywords create, instantiate, asset, initialize, get, instance
|
|
2754
3157
|
*
|
|
2755
3158
|
* @example
|
|
2756
|
-
* ```
|
|
2757
|
-
*
|
|
3159
|
+
* ```ts
|
|
3160
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3161
|
+
* import { Asset } from "utils/topiaInit.ts";
|
|
3162
|
+
*
|
|
3163
|
+
* // Create an Asset instance with credentials
|
|
3164
|
+
* const assetInstance = await Asset.create(assetId, {
|
|
3165
|
+
* credentials: {
|
|
3166
|
+
* interactiveNonce,
|
|
3167
|
+
* interactivePublicKey,
|
|
3168
|
+
* assetId,
|
|
3169
|
+
* urlSlug,
|
|
3170
|
+
* visitorId
|
|
3171
|
+
* }
|
|
3172
|
+
* });
|
|
3173
|
+
*
|
|
3174
|
+
* // Use the instance to interact with the asset
|
|
3175
|
+
* await assetInstance.fetchAssetById();
|
|
2758
3176
|
* ```
|
|
2759
3177
|
*
|
|
2760
3178
|
* @returns {Asset} Returns a new Asset object with the asset id.
|
|
2761
3179
|
*/
|
|
2762
3180
|
create(id: string, options?: AssetOptionalInterface): Asset;
|
|
2763
3181
|
/**
|
|
2764
|
-
* Upload a new Asset and return a new instance of Asset class.
|
|
3182
|
+
* Upload a new Asset to the Topia platform and return a new instance of Asset class.
|
|
3183
|
+
*
|
|
3184
|
+
* @remarks
|
|
3185
|
+
* This method both creates a new asset in the database and returns an Asset controller instance.
|
|
3186
|
+
* A valid API key with appropriate permissions is required.
|
|
3187
|
+
*
|
|
3188
|
+
* @keywords upload, create, new, asset, add, store
|
|
2765
3189
|
*
|
|
2766
3190
|
* @example
|
|
2767
|
-
* ```
|
|
3191
|
+
* ```ts
|
|
3192
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3193
|
+
* import { Asset } from "utils/topiaInit.ts";
|
|
3194
|
+
*
|
|
3195
|
+
* // Prepare the asset payload
|
|
2768
3196
|
* const assetPayload = {
|
|
2769
|
-
* assetName: "
|
|
2770
|
-
* bottomLayerURL: "https://example.
|
|
3197
|
+
* assetName: "My Decorative Asset",
|
|
3198
|
+
* bottomLayerURL: "https://example.com/bottom-layer.png",
|
|
2771
3199
|
* creatorTags: { "decorations": true },
|
|
2772
3200
|
* tagJson: "[{"label":"decorations","value":"decorations"}]",
|
|
2773
3201
|
* isPublic: true,
|
|
2774
|
-
* topLayerURL: "https://example.
|
|
2775
|
-
* }
|
|
3202
|
+
* topLayerURL: "https://example.com/top-layer.png"
|
|
3203
|
+
* };
|
|
3204
|
+
*
|
|
3205
|
+
* // Upload the asset using your API key
|
|
2776
3206
|
* const asset = await Asset.upload(assetPayload, apiKey);
|
|
3207
|
+
*
|
|
3208
|
+
* // Access the new asset's properties
|
|
3209
|
+
* console.log(asset.id);
|
|
2777
3210
|
* ```
|
|
2778
3211
|
*
|
|
2779
|
-
* @returns {
|
|
3212
|
+
* @returns {Asset} Returns a new Asset object with the asset details.
|
|
2780
3213
|
*/
|
|
2781
3214
|
upload(assetPayload: AssetType, apiKey: string): Promise<Asset>;
|
|
2782
3215
|
}
|
|
2783
3216
|
|
|
2784
3217
|
/**
|
|
3218
|
+
* Factory for creating and retrieving DroppedAsset instances. Use this factory to work with assets that have been placed in a Topia world.
|
|
3219
|
+
*
|
|
3220
|
+
* @remarks
|
|
3221
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3222
|
+
*
|
|
3223
|
+
* @keywords dropped asset, factory, create, get, retrieve, instantiate, topia
|
|
3224
|
+
*
|
|
2785
3225
|
* @example
|
|
2786
3226
|
* ```ts
|
|
2787
|
-
*
|
|
3227
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3228
|
+
* import { Topia, DroppedAssetFactory } from "@rtsdk/topia";
|
|
3229
|
+
* const topia = new Topia({ config });
|
|
3230
|
+
* export const DroppedAsset = new DroppedAssetFactory(topia);
|
|
2788
3231
|
* ```
|
|
2789
3232
|
*/
|
|
2790
3233
|
declare class DroppedAssetFactory extends SDKController {
|
|
2791
3234
|
constructor(topia: Topia);
|
|
2792
3235
|
/**
|
|
2793
|
-
* Instantiate a new instance of DroppedAsset class.
|
|
3236
|
+
* Instantiate a new instance of DroppedAsset class for an existing dropped asset in a world.
|
|
3237
|
+
*
|
|
3238
|
+
* @remarks
|
|
3239
|
+
* This method creates a controller instance for an existing dropped asset but does not fetch its properties.
|
|
3240
|
+
* Use this when you need a lightweight instance and will fetch properties separately if needed or when you already have the properties.
|
|
3241
|
+
*
|
|
3242
|
+
* @keywords create, instantiate, dropped asset, initialize, instance
|
|
2794
3243
|
*
|
|
2795
3244
|
* @example
|
|
2796
|
-
* ```
|
|
2797
|
-
*
|
|
3245
|
+
* ```ts
|
|
3246
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3247
|
+
* import { DroppedAsset } from "utils/topiaInit.ts";
|
|
3248
|
+
*
|
|
3249
|
+
* // Create a DroppedAsset instance with credentials
|
|
3250
|
+
* const droppedAssetInstance = DroppedAsset.create(
|
|
3251
|
+
* assetId,
|
|
3252
|
+
* urlSlug,
|
|
3253
|
+
* {
|
|
3254
|
+
* credentials: {
|
|
3255
|
+
* interactiveNonce,
|
|
3256
|
+
* interactivePublicKey,
|
|
3257
|
+
* assetId,
|
|
3258
|
+
* urlSlug,
|
|
3259
|
+
* visitorId
|
|
3260
|
+
* }
|
|
3261
|
+
* }
|
|
3262
|
+
* );
|
|
3263
|
+
*
|
|
3264
|
+
* // Later fetch its properties if needed
|
|
3265
|
+
* await droppedAssetInstance.fetchDroppedAssetById();
|
|
2798
3266
|
* ```
|
|
2799
3267
|
*
|
|
2800
|
-
* @returns {DroppedAsset} Returns a new DroppedAsset object.
|
|
3268
|
+
* @returns {DroppedAsset} Returns a new DroppedAsset object without fetching its properties.
|
|
2801
3269
|
*/
|
|
2802
3270
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
2803
3271
|
/**
|
|
2804
|
-
* Instantiate a new instance of DroppedAsset class and
|
|
3272
|
+
* Instantiate a new instance of DroppedAsset class and automatically fetch all its properties.
|
|
3273
|
+
*
|
|
3274
|
+
* @remarks
|
|
3275
|
+
* This method creates a controller instance and immediately fetches all properties of the dropped asset.
|
|
3276
|
+
* It's a convenience method that combines creating an instance and calling fetchDroppedAssetById().
|
|
3277
|
+
*
|
|
3278
|
+
* @keywords get, fetch, retrieve, dropped asset, load, instance
|
|
2805
3279
|
*
|
|
2806
3280
|
* @example
|
|
2807
|
-
* ```
|
|
2808
|
-
*
|
|
3281
|
+
* ```ts
|
|
3282
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3283
|
+
* import { DroppedAsset } from "utils/topiaInit.ts";
|
|
3284
|
+
*
|
|
3285
|
+
* // Get a fully populated DroppedAsset instance
|
|
3286
|
+
* const droppedAssetInstance = await DroppedAsset.get(
|
|
3287
|
+
* assetId,
|
|
3288
|
+
* urlSlug,
|
|
3289
|
+
* {
|
|
3290
|
+
* credentials: {
|
|
3291
|
+
* interactiveNonce,
|
|
3292
|
+
* interactivePublicKey,
|
|
3293
|
+
* assetId,
|
|
3294
|
+
* urlSlug,
|
|
3295
|
+
* visitorId
|
|
3296
|
+
* }
|
|
3297
|
+
* }
|
|
3298
|
+
* );
|
|
3299
|
+
*
|
|
3300
|
+
* // The properties are already loaded, so you can use them immediately
|
|
3301
|
+
* console.log(droppedAssetInstance.position);
|
|
2809
3302
|
* ```
|
|
2810
3303
|
*
|
|
2811
|
-
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
3304
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties already fetched.
|
|
2812
3305
|
*/
|
|
2813
3306
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
2814
3307
|
/**
|
|
2815
|
-
* Searches
|
|
3308
|
+
* Searches for and retrieves a dropped asset by its unique name within a world.
|
|
2816
3309
|
*
|
|
2817
3310
|
* @remarks
|
|
2818
|
-
* This method leverages the handleGetDroppedAssetByUniqueName endpoint in the Public API and assumes there is exactly one dropped asset with matching uniqueName for the given urlSlug.
|
|
3311
|
+
* This method leverages the handleGetDroppedAssetByUniqueName endpoint in the Public API and assumes there is exactly one dropped asset with the matching uniqueName for the given urlSlug.
|
|
3312
|
+
* Use this when you need to find a dropped asset by its uniqueName rather than its id.
|
|
3313
|
+
*
|
|
3314
|
+
* @keywords find, search, unique name, retrieve, locate, lookup, dropped asset
|
|
2819
3315
|
*
|
|
2820
3316
|
* @example
|
|
2821
|
-
* ```
|
|
2822
|
-
*
|
|
3317
|
+
* ```ts
|
|
3318
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3319
|
+
* import { DroppedAsset } from "utils/topiaInit.ts";
|
|
3320
|
+
*
|
|
3321
|
+
* // Find and retrieve a dropped asset by its unique name
|
|
3322
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName(
|
|
3323
|
+
* "banner-sign-northeast",
|
|
3324
|
+
* "my-world-slug",
|
|
3325
|
+
* "your-interactive-secret",
|
|
3326
|
+
* {
|
|
3327
|
+
* apiKey: "your-api-key",
|
|
3328
|
+
* interactivePublicKey: "your-public-key",
|
|
3329
|
+
* // other credentials...
|
|
3330
|
+
* }
|
|
3331
|
+
* );
|
|
3332
|
+
*
|
|
3333
|
+
* // The properties are already loaded, so you can use them immediately
|
|
3334
|
+
* console.log(droppedAssetInstance.position);
|
|
2823
3335
|
* ```
|
|
2824
3336
|
*
|
|
2825
|
-
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
3337
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties already fetched.
|
|
2826
3338
|
*/
|
|
2827
|
-
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials): Promise<DroppedAsset>;
|
|
3339
|
+
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials$1): Promise<DroppedAsset>;
|
|
2828
3340
|
/**
|
|
2829
3341
|
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
2830
3342
|
*
|
|
3343
|
+
* @remarks
|
|
3344
|
+
* This method places an existing Asset into a world at specified coordinates, effectively "dropping" it into the environment.
|
|
3345
|
+
* You can customize various properties of the dropped asset during placement, such as scale, position, interactive settings, and visual layers.
|
|
3346
|
+
*
|
|
3347
|
+
* @keywords drop, place, add, create, position, asset, deploy
|
|
3348
|
+
*
|
|
2831
3349
|
* @example
|
|
2832
|
-
* ```
|
|
2833
|
-
*
|
|
2834
|
-
*
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
3350
|
+
* ```ts
|
|
3351
|
+
* // Import the pre-initialized factories from your app's initialization file
|
|
3352
|
+
* import { Asset, DroppedAsset } from "utils/topiaInit.ts";
|
|
3353
|
+
*
|
|
3354
|
+
* // First get an asset instance
|
|
3355
|
+
* const assetInstance = Asset.create("asset-id-123", {
|
|
3356
|
+
* credentials: {
|
|
3357
|
+
* interactiveNonce,
|
|
3358
|
+
* interactivePublicKey,
|
|
3359
|
+
* assetId,
|
|
3360
|
+
* urlSlug,
|
|
3361
|
+
* visitorId
|
|
3362
|
+
* }
|
|
3363
|
+
* });
|
|
3364
|
+
*
|
|
3365
|
+
* // Then drop (place) the asset in a world
|
|
3366
|
+
* const droppedAssetInstance = await DroppedAsset.drop(
|
|
3367
|
+
* assetInstance,
|
|
3368
|
+
* {
|
|
3369
|
+
* // Basic positioning and appearance
|
|
3370
|
+
* position: { x: 250, y: 350 },
|
|
3371
|
+
* assetScale: 1.5,
|
|
3372
|
+
* flipped: true,
|
|
3373
|
+
* uniqueName: "welcome-sign",
|
|
3374
|
+
* urlSlug: "my-world-slug",
|
|
3375
|
+
*
|
|
3376
|
+
* // For web images (optional)
|
|
3377
|
+
* layer0: "https://example.com/background.png",
|
|
3378
|
+
* layer1: "https://example.com/foreground.png",
|
|
3379
|
+
*
|
|
3380
|
+
* // For interactive assets (optional)
|
|
3381
|
+
* interactivePublicKey: "your-public-key",
|
|
3382
|
+
* isInteractive: true,
|
|
3383
|
+
*
|
|
3384
|
+
* // For clickable assets (optional)
|
|
3385
|
+
* clickType: "link",
|
|
3386
|
+
* clickableLink: "https://example.com",
|
|
3387
|
+
* clickableLinkTitle: "Visit Example"
|
|
3388
|
+
* }
|
|
3389
|
+
* );
|
|
3390
|
+
*
|
|
3391
|
+
* // The dropped asset is ready to use
|
|
3392
|
+
* console.log(droppedAssetInstance.id);
|
|
2845
3393
|
* ```
|
|
2846
3394
|
*
|
|
2847
|
-
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object
|
|
3395
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object representing the placed asset in the world.
|
|
2848
3396
|
*/
|
|
2849
3397
|
drop(asset: Asset, { assetScale, clickType, clickableDisplayTextDescription, clickableDisplayTextHeadline, clickableLink, clickableLinkTitle, flipped, interactivePublicKey, isInteractive, isForceLinkInIframe, isOpenLinkInDrawer, isTextTopLayer, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textFontFamily, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
|
|
2850
3398
|
assetScale?: number;
|
|
@@ -2879,45 +3427,113 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2879
3427
|
}
|
|
2880
3428
|
|
|
2881
3429
|
/**
|
|
3430
|
+
* Factory for creating Ecosystem instances. Use this factory to work with ecosystem-wide data and operations.
|
|
3431
|
+
*
|
|
3432
|
+
* @remarks
|
|
3433
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3434
|
+
* The Ecosystem controller provides methods to interact with data shared across multiple worlds.
|
|
3435
|
+
*
|
|
3436
|
+
* @keywords ecosystem, factory, create, multi-world, global, shared data, platform
|
|
3437
|
+
*
|
|
2882
3438
|
* @example
|
|
2883
3439
|
* ```ts
|
|
2884
|
-
*
|
|
3440
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3441
|
+
* import { Topia, EcosystemFactory } from "@rtsdk/topia";
|
|
3442
|
+
* const topia = new Topia({ config });
|
|
3443
|
+
* export const Ecosystem = new EcosystemFactory(topia);
|
|
2885
3444
|
* ```
|
|
2886
3445
|
*/
|
|
2887
3446
|
declare class EcosystemFactory {
|
|
2888
3447
|
topia: Topia;
|
|
2889
3448
|
constructor(topia: Topia);
|
|
2890
3449
|
/**
|
|
2891
|
-
* Instantiate a new instance of Ecosystem class.
|
|
3450
|
+
* Instantiate a new instance of Ecosystem class for interacting with ecosystem-wide data.
|
|
3451
|
+
*
|
|
3452
|
+
* @remarks
|
|
3453
|
+
* This method creates a controller instance for accessing and managing data that spans multiple worlds.
|
|
3454
|
+
* Use this for cross-world data sharing, global data objects, and ecosystem-wide operations.
|
|
3455
|
+
*
|
|
3456
|
+
* @keywords create, instantiate, ecosystem, initialize, global, shared data, platform
|
|
2892
3457
|
*
|
|
2893
3458
|
* @example
|
|
2894
|
-
* ```
|
|
2895
|
-
*
|
|
3459
|
+
* ```ts
|
|
3460
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3461
|
+
* import { Ecosystem } from "utils/topiaInit.ts";
|
|
3462
|
+
*
|
|
3463
|
+
* // Create an Ecosystem instance with credentials
|
|
3464
|
+
* const ecosystemInstance = Ecosystem.create({
|
|
3465
|
+
* credentials: {
|
|
3466
|
+
* interactiveNonce,
|
|
3467
|
+
* interactivePublicKey,
|
|
3468
|
+
* assetId,
|
|
3469
|
+
* urlSlug,
|
|
3470
|
+
* visitorId
|
|
3471
|
+
* }
|
|
3472
|
+
* });
|
|
3473
|
+
*
|
|
3474
|
+
* // Work with ecosystem-wide data objects
|
|
3475
|
+
* await ecosystemInstance.fetchDataObject("global-leaderboard");
|
|
3476
|
+
* await ecosystemInstance.setDataObject("global-leaderboard", { scores: [...] });
|
|
2896
3477
|
* ```
|
|
2897
3478
|
*
|
|
2898
|
-
* @returns {Ecosystem} Returns a new Ecosystem object.
|
|
3479
|
+
* @returns {Ecosystem} Returns a new Ecosystem object for interacting with ecosystem-wide data.
|
|
2899
3480
|
*/
|
|
2900
3481
|
create(options?: EcosystemOptionalInterface): Ecosystem;
|
|
2901
3482
|
}
|
|
2902
3483
|
|
|
2903
3484
|
/**
|
|
3485
|
+
* Factory for creating Scene instances. Use this factory to work with scenes in the Topia platform.
|
|
3486
|
+
*
|
|
3487
|
+
* @remarks
|
|
3488
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3489
|
+
* Scenes represent the template or blueprint for a world's design and layout.
|
|
3490
|
+
*
|
|
3491
|
+
* @keywords scene, factory, create, template, blueprint, layout, design
|
|
3492
|
+
*
|
|
2904
3493
|
* @example
|
|
2905
3494
|
* ```ts
|
|
2906
|
-
*
|
|
3495
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3496
|
+
* import { Topia, SceneFactory } from "@rtsdk/topia";
|
|
3497
|
+
* const topia = new Topia({ config });
|
|
3498
|
+
* export const Scene = new SceneFactory(topia);
|
|
2907
3499
|
* ```
|
|
2908
3500
|
*/
|
|
2909
3501
|
declare class SceneFactory {
|
|
2910
3502
|
topia: Topia;
|
|
2911
3503
|
constructor(topia: Topia);
|
|
2912
3504
|
/**
|
|
2913
|
-
* Instantiate a new instance of Scene class.
|
|
3505
|
+
* Instantiate a new instance of Scene class for an existing scene in the platform.
|
|
3506
|
+
*
|
|
3507
|
+
* @remarks
|
|
3508
|
+
* This method creates a controller instance for working with a scene but does not fetch its properties.
|
|
3509
|
+
* Use this when you need to interact with a specific scene by its id.
|
|
3510
|
+
*
|
|
3511
|
+
* @keywords create, instantiate, scene, initialize, instance, template
|
|
2914
3512
|
*
|
|
2915
3513
|
* @example
|
|
2916
|
-
* ```
|
|
2917
|
-
*
|
|
3514
|
+
* ```ts
|
|
3515
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3516
|
+
* import { Scene } from "utils/topiaInit.ts";
|
|
3517
|
+
*
|
|
3518
|
+
* // Create a Scene instance with credentials
|
|
3519
|
+
* const sceneInstance = Scene.create(
|
|
3520
|
+
* "scene-id-123",
|
|
3521
|
+
* {
|
|
3522
|
+
* credentials: {
|
|
3523
|
+
* interactiveNonce,
|
|
3524
|
+
* interactivePublicKey,
|
|
3525
|
+
* assetId,
|
|
3526
|
+
* urlSlug,
|
|
3527
|
+
* visitorId
|
|
3528
|
+
* }
|
|
3529
|
+
* }
|
|
3530
|
+
* );
|
|
3531
|
+
*
|
|
3532
|
+
* // Fetch scene details if needed
|
|
3533
|
+
* await sceneInstance.fetchSceneById();
|
|
2918
3534
|
* ```
|
|
2919
3535
|
*
|
|
2920
|
-
* @returns {Scene} Returns a new Scene object.
|
|
3536
|
+
* @returns {Scene} Returns a new Scene object for interacting with the specified scene.
|
|
2921
3537
|
*/
|
|
2922
3538
|
create(id: string, options?: SceneOptionalInterface): Scene;
|
|
2923
3539
|
/**
|
|
@@ -2934,132 +3550,363 @@ declare class SceneFactory {
|
|
|
2934
3550
|
}
|
|
2935
3551
|
|
|
2936
3552
|
/**
|
|
3553
|
+
* Factory for creating User instances. Use this factory to work with user data in the Topia platform.
|
|
3554
|
+
*
|
|
3555
|
+
* @remarks
|
|
3556
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3557
|
+
* The User controller allows you to interact with user-specific information and operations.
|
|
3558
|
+
*
|
|
3559
|
+
* @keywords user, factory, create, account, profile, member, visitor
|
|
3560
|
+
*
|
|
2937
3561
|
* @example
|
|
2938
3562
|
* ```ts
|
|
2939
|
-
*
|
|
3563
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3564
|
+
* import { Topia, UserFactory } from "@rtsdk/topia";
|
|
3565
|
+
* const topia = new Topia({ config });
|
|
3566
|
+
* export const User = new UserFactory(topia);
|
|
2940
3567
|
* ```
|
|
2941
3568
|
*/
|
|
2942
3569
|
declare class UserFactory {
|
|
2943
3570
|
topia: Topia;
|
|
2944
3571
|
constructor(topia: Topia);
|
|
2945
3572
|
/**
|
|
2946
|
-
* Instantiate a new instance of User class.
|
|
3573
|
+
* Instantiate a new instance of User class for working with user data.
|
|
3574
|
+
*
|
|
3575
|
+
* @remarks
|
|
3576
|
+
* This method creates a controller instance for interacting with user-specific operations.
|
|
3577
|
+
* The User controller doesn't require an id since it represents the currently authenticated user.
|
|
3578
|
+
*
|
|
3579
|
+
* @keywords create, instantiate, user, initialize, account, profile, member
|
|
2947
3580
|
*
|
|
2948
3581
|
* @example
|
|
2949
|
-
* ```
|
|
2950
|
-
*
|
|
3582
|
+
* ```ts
|
|
3583
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3584
|
+
* import { User } from "utils/topiaInit.ts";
|
|
3585
|
+
*
|
|
3586
|
+
* // Create a User instance with credentials
|
|
3587
|
+
* const userInstance = User.create({
|
|
3588
|
+
* credentials: {
|
|
3589
|
+
* interactiveNonce,
|
|
3590
|
+
* interactivePublicKey,
|
|
3591
|
+
* assetId,
|
|
3592
|
+
* urlSlug,
|
|
3593
|
+
* visitorId
|
|
3594
|
+
* }
|
|
3595
|
+
* });
|
|
3596
|
+
*
|
|
3597
|
+
* // Use methods on the user instance
|
|
3598
|
+
* await userInstance.checkInteractiveCredentials();
|
|
3599
|
+
* const avatars = await userInstance.fetchAvatars();
|
|
2951
3600
|
* ```
|
|
2952
3601
|
*
|
|
2953
|
-
* @returns {User} Returns a new User object.
|
|
3602
|
+
* @returns {User} Returns a new User object for interacting with user data.
|
|
2954
3603
|
*/
|
|
2955
3604
|
create(options?: UserOptionalInterface): User;
|
|
2956
3605
|
}
|
|
2957
3606
|
|
|
2958
3607
|
/**
|
|
3608
|
+
* Factory for creating Visitor instances. Use this factory to work with visitors in Topia worlds.
|
|
3609
|
+
*
|
|
3610
|
+
* @remarks
|
|
3611
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3612
|
+
* The Visitor controller represents a specific visitor/avatar instance in a world.
|
|
3613
|
+
*
|
|
3614
|
+
* @keywords visitor, factory, create, get, avatar, user, participant
|
|
3615
|
+
*
|
|
2959
3616
|
* @example
|
|
2960
3617
|
* ```ts
|
|
2961
|
-
*
|
|
3618
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3619
|
+
* import { Topia, VisitorFactory } from "@rtsdk/topia";
|
|
3620
|
+
* const topia = new Topia({ config });
|
|
3621
|
+
* export const Visitor = new VisitorFactory(topia);
|
|
2962
3622
|
* ```
|
|
2963
3623
|
*/
|
|
2964
3624
|
declare class VisitorFactory {
|
|
2965
3625
|
topia: Topia;
|
|
2966
3626
|
constructor(topia: Topia);
|
|
2967
3627
|
/**
|
|
2968
|
-
* Instantiate a new instance of Visitor class.
|
|
3628
|
+
* Instantiate a new instance of Visitor class for an existing visitor in a world.
|
|
3629
|
+
*
|
|
3630
|
+
* @remarks
|
|
3631
|
+
* This method creates a controller instance for a visitor but does not fetch its properties.
|
|
3632
|
+
* Use this when you need a lightweight instance and will fetch properties separately or when you already have the properties.
|
|
3633
|
+
*
|
|
3634
|
+
* @keywords create, instantiate, visitor, initialize, avatar, instance
|
|
2969
3635
|
*
|
|
2970
3636
|
* @example
|
|
2971
|
-
* ```
|
|
2972
|
-
*
|
|
3637
|
+
* ```ts
|
|
3638
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3639
|
+
* import { Visitor } from "utils/topiaInit.ts";
|
|
3640
|
+
*
|
|
3641
|
+
* // Create a Visitor instance with credentials
|
|
3642
|
+
* const visitorInstance = Visitor.create(
|
|
3643
|
+
* 12345, // visitor id
|
|
3644
|
+
* "my-world-slug",
|
|
3645
|
+
* {
|
|
3646
|
+
* credentials: {
|
|
3647
|
+
* interactiveNonce,
|
|
3648
|
+
* interactivePublicKey,
|
|
3649
|
+
* assetId,
|
|
3650
|
+
* urlSlug,
|
|
3651
|
+
* visitorId
|
|
3652
|
+
* }
|
|
3653
|
+
* }
|
|
3654
|
+
* );
|
|
3655
|
+
*
|
|
3656
|
+
* // Later fetch visitor properties if needed
|
|
3657
|
+
* await visitorInstance.fetchVisitor();
|
|
2973
3658
|
* ```
|
|
2974
3659
|
*
|
|
2975
|
-
* @returns {Visitor} Returns a new Visitor object.
|
|
3660
|
+
* @returns {Visitor} Returns a new Visitor object without fetching its properties.
|
|
2976
3661
|
*/
|
|
2977
3662
|
create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
|
|
2978
3663
|
/**
|
|
2979
|
-
* Instantiate a new instance of Visitor class and
|
|
3664
|
+
* Instantiate a new instance of Visitor class and automatically fetch all its properties.
|
|
3665
|
+
*
|
|
3666
|
+
* @remarks
|
|
3667
|
+
* This method creates a controller instance and immediately fetches all properties of the visitor.
|
|
3668
|
+
* It's a convenience method that combines creating an instance and calling fetchVisitor().
|
|
3669
|
+
*
|
|
3670
|
+
* @keywords get, fetch, retrieve, visitor, load, avatar, instance
|
|
2980
3671
|
*
|
|
2981
3672
|
* @example
|
|
2982
|
-
* ```
|
|
2983
|
-
*
|
|
3673
|
+
* ```ts
|
|
3674
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3675
|
+
* import { Visitor } from "utils/topiaInit.ts";
|
|
3676
|
+
*
|
|
3677
|
+
* // Get a fully populated Visitor instance
|
|
3678
|
+
* const visitorInstance = await Visitor.get(
|
|
3679
|
+
* 12345, // visitor id
|
|
3680
|
+
* "my-world-slug",
|
|
3681
|
+
* {
|
|
3682
|
+
* credentials: {
|
|
3683
|
+
* interactiveNonce,
|
|
3684
|
+
* interactivePublicKey,
|
|
3685
|
+
* assetId,
|
|
3686
|
+
* urlSlug,
|
|
3687
|
+
* visitorId
|
|
3688
|
+
* }
|
|
3689
|
+
* }
|
|
3690
|
+
* );
|
|
3691
|
+
*
|
|
3692
|
+
* // The properties are already loaded, so you can use them immediately
|
|
3693
|
+
* console.log(visitorInstance.username);
|
|
3694
|
+
* console.log(visitorInstance.position);
|
|
2984
3695
|
* ```
|
|
2985
3696
|
*
|
|
2986
|
-
* @returns {Promise<Visitor>} Returns a new Visitor object with all properties.
|
|
3697
|
+
* @returns {Promise<Visitor>} Returns a new Visitor object with all properties already fetched.
|
|
2987
3698
|
*/
|
|
2988
3699
|
get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
|
|
2989
3700
|
}
|
|
2990
3701
|
|
|
2991
3702
|
/**
|
|
3703
|
+
* Factory for creating WebRTCConnector instances. Use this factory to establish WebRTC connections for audio/video in Topia worlds.
|
|
3704
|
+
*
|
|
3705
|
+
* @remarks
|
|
3706
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3707
|
+
* The WebRTCConnector provides methods to set up and manage real-time audio/video communication.
|
|
3708
|
+
*
|
|
3709
|
+
* @keywords webrtc, factory, create, audio, video, communication, real-time, conference
|
|
3710
|
+
*
|
|
2992
3711
|
* @example
|
|
2993
3712
|
* ```ts
|
|
2994
|
-
*
|
|
3713
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3714
|
+
* import { Topia, WebRTCConnectorFactory } from "@rtsdk/topia";
|
|
3715
|
+
* const topia = new Topia({ config });
|
|
3716
|
+
* export const WebRTCConnector = new WebRTCConnectorFactory(topia);
|
|
2995
3717
|
* ```
|
|
2996
3718
|
*/
|
|
2997
3719
|
declare class WebRTCConnectorFactory {
|
|
2998
3720
|
topia: Topia;
|
|
2999
3721
|
constructor(topia: Topia);
|
|
3000
3722
|
/**
|
|
3001
|
-
* Instantiate a new instance of WebRTCConnector class.
|
|
3723
|
+
* Instantiate a new instance of WebRTCConnector class for managing audio/video communication.
|
|
3724
|
+
*
|
|
3725
|
+
* @remarks
|
|
3726
|
+
* This method creates a controller instance for establishing and managing WebRTC connections.
|
|
3727
|
+
* Use this for implementing real-time audio/video communication features in Topia worlds.
|
|
3728
|
+
*
|
|
3729
|
+
* @keywords create, instantiate, webrtc, initialize, audio, video, communication, stream
|
|
3002
3730
|
*
|
|
3003
3731
|
* @example
|
|
3004
|
-
* ```
|
|
3005
|
-
*
|
|
3732
|
+
* ```ts
|
|
3733
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3734
|
+
* import { WebRTCConnector } from "utils/topiaInit.ts";
|
|
3735
|
+
*
|
|
3736
|
+
* // Create a WebRTCConnector instance with credentials and configuration
|
|
3737
|
+
* const webRTCInstance = WebRTCConnector.create(
|
|
3738
|
+
* "my-world-slug",
|
|
3739
|
+
* {
|
|
3740
|
+
* credentials: {
|
|
3741
|
+
* interactiveNonce,
|
|
3742
|
+
* interactivePublicKey,
|
|
3743
|
+
* assetId,
|
|
3744
|
+
* urlSlug,
|
|
3745
|
+
* visitorId
|
|
3746
|
+
* },
|
|
3747
|
+
* twilioConfig: {
|
|
3748
|
+
* // Twilio configuration options
|
|
3749
|
+
* }
|
|
3750
|
+
* }
|
|
3751
|
+
* );
|
|
3752
|
+
*
|
|
3753
|
+
* // Use the instance to establish connections
|
|
3754
|
+
* await webRTCInstance.connect();
|
|
3006
3755
|
* ```
|
|
3007
3756
|
*
|
|
3008
|
-
* @returns {WebRTCConnector} Returns a new WebRTCConnector object.
|
|
3757
|
+
* @returns {WebRTCConnector} Returns a new WebRTCConnector object for managing audio/video communication.
|
|
3009
3758
|
*/
|
|
3010
3759
|
create(urlSlug: string, options?: WebRTCConnectorOptionalInterface): WebRTCConnector;
|
|
3011
3760
|
}
|
|
3012
3761
|
|
|
3013
3762
|
/**
|
|
3763
|
+
* Factory for creating WorldActivity instances. Use this factory to monitor and manage visitor activity in Topia worlds.
|
|
3764
|
+
*
|
|
3765
|
+
* @remarks
|
|
3766
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3767
|
+
* The WorldActivity controller provides methods to interact with real-time visitor activities and movements.
|
|
3768
|
+
*
|
|
3769
|
+
* @keywords world activity, factory, create, visitors, movement, tracking, presence, real-time
|
|
3770
|
+
*
|
|
3014
3771
|
* @example
|
|
3015
3772
|
* ```ts
|
|
3016
|
-
*
|
|
3773
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3774
|
+
* import { Topia, WorldActivityFactory } from "@rtsdk/topia";
|
|
3775
|
+
* const topia = new Topia({ config });
|
|
3776
|
+
* export const WorldActivity = new WorldActivityFactory(topia);
|
|
3017
3777
|
* ```
|
|
3018
3778
|
*/
|
|
3019
3779
|
declare class WorldActivityFactory {
|
|
3020
3780
|
topia: Topia;
|
|
3021
3781
|
constructor(topia: Topia);
|
|
3022
3782
|
/**
|
|
3023
|
-
* Instantiate a new instance of WorldActivity class.
|
|
3783
|
+
* Instantiate a new instance of WorldActivity class for monitoring visitor activity in a specific world.
|
|
3784
|
+
*
|
|
3785
|
+
* @remarks
|
|
3786
|
+
* This method creates a controller instance for tracking and managing visitor activity in a world.
|
|
3787
|
+
* Use this to fetch current visitors, move visitors, or monitor specific zones within a world.
|
|
3788
|
+
*
|
|
3789
|
+
* @keywords create, instantiate, world activity, initialize, visitors, tracking, presence
|
|
3024
3790
|
*
|
|
3025
3791
|
* @example
|
|
3026
|
-
* ```
|
|
3027
|
-
*
|
|
3792
|
+
* ```ts
|
|
3793
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3794
|
+
* import { WorldActivity } from "utils/topiaInit.ts";
|
|
3795
|
+
*
|
|
3796
|
+
* // Create a WorldActivity instance with credentials
|
|
3797
|
+
* const worldActivityInstance = WorldActivity.create(
|
|
3798
|
+
* "my-world-slug",
|
|
3799
|
+
* {
|
|
3800
|
+
* credentials: {
|
|
3801
|
+
* interactiveNonce,
|
|
3802
|
+
* interactivePublicKey,
|
|
3803
|
+
* assetId,
|
|
3804
|
+
* urlSlug,
|
|
3805
|
+
* visitorId
|
|
3806
|
+
* }
|
|
3807
|
+
* }
|
|
3808
|
+
* );
|
|
3809
|
+
*
|
|
3810
|
+
* // Get current visitors in the world
|
|
3811
|
+
* const visitors = await worldActivityInstance.currentVisitors();
|
|
3812
|
+
* console.log(`There are ${visitors.length} visitors in the world`);
|
|
3813
|
+
*
|
|
3814
|
+
* // Check visitors in a specific zone
|
|
3815
|
+
* const zoneVisitors = await worldActivityInstance.fetchVisitorsInZone("stage-area");
|
|
3028
3816
|
* ```
|
|
3029
3817
|
*
|
|
3030
|
-
* @returns {WorldActivity} Returns a new WorldActivity object.
|
|
3818
|
+
* @returns {WorldActivity} Returns a new WorldActivity object for tracking and managing visitor activity.
|
|
3031
3819
|
*/
|
|
3032
3820
|
create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
|
|
3033
3821
|
}
|
|
3034
3822
|
|
|
3035
3823
|
/**
|
|
3824
|
+
* Factory for creating World instances. Use this factory to interact with Topia worlds.
|
|
3825
|
+
*
|
|
3826
|
+
* @remarks
|
|
3827
|
+
* This factory should be instantiated once per application and reused across your codebase.
|
|
3828
|
+
* The World controller provides methods to manage world settings, retrieve world details, and perform world-level operations.
|
|
3829
|
+
*
|
|
3830
|
+
* @keywords world, factory, create, virtual space, environment, room, topia
|
|
3831
|
+
*
|
|
3036
3832
|
* @example
|
|
3037
3833
|
* ```ts
|
|
3038
|
-
*
|
|
3834
|
+
* // In your initialization file (e.g., utils/topiaInit.ts)
|
|
3835
|
+
* import { Topia, WorldFactory } from "@rtsdk/topia";
|
|
3836
|
+
* const topia = new Topia({ config });
|
|
3837
|
+
* export const World = new WorldFactory(topia);
|
|
3039
3838
|
* ```
|
|
3040
3839
|
*/
|
|
3041
3840
|
declare class WorldFactory extends SDKController {
|
|
3042
3841
|
constructor(topia: Topia);
|
|
3043
3842
|
/**
|
|
3044
|
-
* Instantiate a new instance of World class.
|
|
3843
|
+
* Instantiate a new instance of World class for interacting with a specific Topia world.
|
|
3844
|
+
*
|
|
3845
|
+
* @remarks
|
|
3846
|
+
* This method creates a controller instance for a world identified by its URL slug.
|
|
3847
|
+
* The world controller can be used to fetch details, update world settings, and perform other world-level operations.
|
|
3848
|
+
*
|
|
3849
|
+
* @keywords create, instantiate, world, initialize, virtual space, environment, room
|
|
3045
3850
|
*
|
|
3046
3851
|
* @example
|
|
3047
|
-
* ```
|
|
3048
|
-
*
|
|
3852
|
+
* ```ts
|
|
3853
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3854
|
+
* import { World } from "utils/topiaInit.ts";
|
|
3855
|
+
*
|
|
3856
|
+
* // Create a World instance with credentials
|
|
3857
|
+
* const worldInstance = World.create(
|
|
3858
|
+
* "my-world-slug",
|
|
3859
|
+
* {
|
|
3860
|
+
* credentials: {
|
|
3861
|
+
* interactiveNonce,
|
|
3862
|
+
* interactivePublicKey,
|
|
3863
|
+
* assetId,
|
|
3864
|
+
* urlSlug,
|
|
3865
|
+
* visitorId
|
|
3866
|
+
* }
|
|
3867
|
+
* }
|
|
3868
|
+
* );
|
|
3869
|
+
*
|
|
3870
|
+
* // Fetch world details
|
|
3871
|
+
* await worldInstance.fetchDetails();
|
|
3872
|
+
* console.log(worldInstance.name);
|
|
3049
3873
|
* ```
|
|
3050
3874
|
*
|
|
3051
|
-
* @returns {World} Returns a new World object.
|
|
3875
|
+
* @returns {World} Returns a new World object for interacting with the specified world.
|
|
3052
3876
|
*/
|
|
3053
3877
|
create(urlSlug: string, options?: WorldOptionalInterface): World;
|
|
3054
3878
|
/**
|
|
3055
|
-
* Deletes
|
|
3879
|
+
* Deletes multiple dropped assets from a world in a single operation.
|
|
3880
|
+
*
|
|
3881
|
+
* @remarks
|
|
3882
|
+
* This method provides a convenient way to delete multiple dropped assets at once rather than
|
|
3883
|
+
* deleting them one by one. Requires appropriate permissions via interactive credentials.
|
|
3884
|
+
*
|
|
3885
|
+
* @keywords delete, remove, dropped assets, multiple, batch, cleanup, world
|
|
3056
3886
|
*
|
|
3057
3887
|
* @example
|
|
3058
|
-
* ```
|
|
3059
|
-
*
|
|
3888
|
+
* ```ts
|
|
3889
|
+
* // Import the pre-initialized factory from your app's initialization file
|
|
3890
|
+
* import { World } from "utils/topiaInit.ts";
|
|
3891
|
+
*
|
|
3892
|
+
* // Delete multiple dropped assets from a world
|
|
3893
|
+
* const result = await World.deleteDroppedAssets(
|
|
3894
|
+
* "my-world-slug",
|
|
3895
|
+
* ["asset-id-123", "asset-id-456", "asset-id-789"],
|
|
3896
|
+
* "your-interactive-secret",
|
|
3897
|
+
* {
|
|
3898
|
+
* apiKey: "your-api-key",
|
|
3899
|
+
* interactivePublicKey: "your-public-key",
|
|
3900
|
+
* visitorId: 12345
|
|
3901
|
+
* }
|
|
3902
|
+
* );
|
|
3903
|
+
*
|
|
3904
|
+
* if (result.success) {
|
|
3905
|
+
* console.log("Assets successfully deleted");
|
|
3906
|
+
* }
|
|
3060
3907
|
* ```
|
|
3061
3908
|
*
|
|
3062
|
-
* @returns {Promise<{ success: boolean }>} Returns `{ success: true }`
|
|
3909
|
+
* @returns {Promise<{ success: boolean }>} Returns `{ success: true }` if all assets were deleted successfully.
|
|
3063
3910
|
*/
|
|
3064
3911
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
|
|
3065
3912
|
apiKey?: string;
|
|
@@ -3071,4 +3918,4 @@ declare class WorldFactory extends SDKController {
|
|
|
3071
3918
|
}>;
|
|
3072
3919
|
}
|
|
3073
3920
|
|
|
3074
|
-
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, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, RemoveClickableLinkInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, SetClickableLinkMultiInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateClickableLinkMultiInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, 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 };
|
|
3921
|
+
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$1 as InteractiveCredentials, InventoryItemInterface, InventoryItemOptionalInterface, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, RemoveClickableLinkInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, SetClickableLinkMultiInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateClickableLinkMultiInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserInventoryItemInterface, 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 };
|