@rtsdk/topia 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -39729,14 +39729,14 @@ class Asset extends SDKController {
39729
39729
  this.id = id;
39730
39730
  Object.assign(this, options.attributes);
39731
39731
  }
39732
- fetchPlatformAssets() {
39732
+ fetchAssetById() {
39733
39733
  return __awaiter(this, void 0, void 0, function* () {
39734
39734
  try {
39735
- const response = yield this.topiaPublicApi().get("/assets/topia-assets", this.requestOptions);
39735
+ const response = yield this.topiaPublicApi().get(`/assets/${this.id}`, this.requestOptions);
39736
39736
  return response.data;
39737
39737
  }
39738
39738
  catch (error) {
39739
- throw this.errorHandler({ error, sdkMethod: "Asset.fetchPlatformAssets" });
39739
+ throw this.errorHandler({ error, sdkMethod: "Asset.fetchAssetById" });
39740
39740
  }
39741
39741
  });
39742
39742
  }
@@ -40189,7 +40189,6 @@ class DroppedAsset extends Asset {
40189
40189
  * @usage
40190
40190
  * ```ts
40191
40191
  * await droppedAsset.addWebhook({
40192
- * active: true,
40193
40192
  * dataObject: {},
40194
40193
  * description: "Webhook desc",
40195
40194
  * enteredBy: "you",
@@ -40197,7 +40196,6 @@ class DroppedAsset extends Asset {
40197
40196
  * title: "title",
40198
40197
  * type: "type",
40199
40198
  * url: "https://url.com",
40200
- * urlSlug: "world",
40201
40199
  * });
40202
40200
  * ```
40203
40201
  */
@@ -40519,6 +40517,42 @@ class World extends SDKController {
40519
40517
  }
40520
40518
  });
40521
40519
  }
40520
+ /**
40521
+ * @summary
40522
+ * Set close world settings
40523
+ *
40524
+ * @usage
40525
+ * ```ts
40526
+ * await world.updateCloseWorldSettings({
40527
+ * controls: {
40528
+ * allowMuteAll: true,
40529
+ * disableHideVideo: true,
40530
+ * isMobileDisabled: false,
40531
+ * isShowingCurrentGuests: false,
40532
+ * },
40533
+ * description: 'Welcome to my world.',
40534
+ * forceAuthOnLogin: false,
40535
+ * height: 2000,
40536
+ * name: 'Example',
40537
+ * spawnPosition: { x: 100, y: 100 },
40538
+ * width: 2000
40539
+ * });
40540
+ * ```
40541
+ */
40542
+ updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }) {
40543
+ return __awaiter(this, void 0, void 0, function* () {
40544
+ const params = {
40545
+ closeWorldDescription,
40546
+ isWorldClosed,
40547
+ };
40548
+ try {
40549
+ return yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-close-world-settings`, params, this.requestOptions);
40550
+ }
40551
+ catch (error) {
40552
+ throw this.errorHandler({ error, params, sdkMethod: "World.updateCloseWorldSettings" });
40553
+ }
40554
+ });
40555
+ }
40522
40556
  ////////// dropped assets
40523
40557
  /**
40524
40558
  * @summary
@@ -40650,6 +40684,7 @@ class World extends SDKController {
40650
40684
  return outcomes;
40651
40685
  });
40652
40686
  }
40687
+ // scenes
40653
40688
  /**
40654
40689
  * @deprecated Use {@link fetchScenes} instead.
40655
40690
  *
@@ -40710,7 +40745,7 @@ class World extends SDKController {
40710
40745
  return __awaiter(this, void 0, void 0, function* () {
40711
40746
  try {
40712
40747
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes-with-dropped-assets`, this.requestOptions);
40713
- this.scenes = response.data;
40748
+ this.scenes = response.data.scenes;
40714
40749
  return response.data;
40715
40750
  }
40716
40751
  catch (error) {
@@ -40940,6 +40975,21 @@ class User extends SDKController {
40940
40975
  }
40941
40976
  });
40942
40977
  }
40978
+ /**
40979
+ * @summary
40980
+ * Returns all platform assets
40981
+ */
40982
+ fetchPlatformAssets() {
40983
+ return __awaiter(this, void 0, void 0, function* () {
40984
+ try {
40985
+ const response = yield this.topiaPublicApi().get("/assets/topia-assets", this.requestOptions);
40986
+ return response.data;
40987
+ }
40988
+ catch (error) {
40989
+ throw this.errorHandler({ error, sdkMethod: "Asset.fetchPlatformAssets" });
40990
+ }
40991
+ });
40992
+ }
40943
40993
  /**
40944
40994
  * @summary
40945
40995
  * Returns all scenes owned by User
@@ -41687,12 +41737,20 @@ class DroppedAssetFactory extends SDKController {
41687
41737
  return droppedAsset;
41688
41738
  });
41689
41739
  }
41690
- getWithUniqueName(uniqueName, urlSlug, interactivePublicKey, interactiveSecret) {
41740
+ getWithUniqueName(uniqueName, urlSlug, credentials) {
41691
41741
  return __awaiter(this, void 0, void 0, function* () {
41692
- const params = { uniqueName, urlSlug, interactivePublicKey, interactiveSecret };
41742
+ const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
41743
+ const params = { apiKey, interactivePublicKey, interactiveSecret, uniqueName, urlSlug };
41693
41744
  try {
41694
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41695
- const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers: { interactiveJWT, publickey: interactivePublicKey } });
41745
+ const headers = {};
41746
+ if (apiKey) {
41747
+ headers.Authorization = apiKey;
41748
+ }
41749
+ else if (interactivePublicKey && interactiveSecret) {
41750
+ headers.interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41751
+ headers.publickey = interactivePublicKey;
41752
+ }
41753
+ const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers });
41696
41754
  const { id } = response.data;
41697
41755
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
41698
41756
  }
@@ -41701,9 +41759,9 @@ class DroppedAssetFactory extends SDKController {
41701
41759
  }
41702
41760
  });
41703
41761
  }
41704
- drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41762
+ drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41705
41763
  return __awaiter(this, void 0, void 0, function* () {
41706
- let specialType;
41764
+ let specialType = null;
41707
41765
  if (layer0 || layer1)
41708
41766
  specialType = "webImage";
41709
41767
  else if (text)
@@ -41803,23 +41861,30 @@ class WorldFactory extends SDKController {
41803
41861
  create(urlSlug, options) {
41804
41862
  return new World(this.topia, urlSlug, options);
41805
41863
  }
41806
- deleteDroppedAssets(urlSlug, droppedAssetIds, interactivePublicKey, interactiveSecret) {
41864
+ deleteDroppedAssets(urlSlug, droppedAssetIds, credentials) {
41807
41865
  return __awaiter(this, void 0, void 0, function* () {
41808
- const params = { droppedAssetIds, urlSlug, interactivePublicKey, interactiveSecret };
41866
+ const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
41867
+ const params = { apiKey, droppedAssetIds, interactivePublicKey, interactiveSecret, urlSlug };
41809
41868
  try {
41810
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41869
+ const headers = {};
41870
+ if (apiKey) {
41871
+ headers.Authorization = apiKey;
41872
+ }
41873
+ else if (interactivePublicKey && interactiveSecret) {
41874
+ headers.interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41875
+ headers.publickey = interactivePublicKey;
41876
+ }
41811
41877
  const promiseArray = [];
41812
41878
  for (const id of droppedAssetIds) {
41813
41879
  promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
41814
- headers: { interactiveJWT, publickey: interactivePublicKey },
41880
+ headers,
41815
41881
  }));
41816
41882
  }
41817
- const result = yield Promise.all(promiseArray);
41818
- console.log(result);
41883
+ yield Promise.all(promiseArray);
41819
41884
  return { success: true };
41820
41885
  }
41821
41886
  catch (error) {
41822
- throw this.errorHandler({ error, params, sdkMethod: "DroppedAssetFactory.getWithUniqueName" });
41887
+ throw this.errorHandler({ error, params, sdkMethod: "WorldFactory.deleteDroppedAssets" });
41823
41888
  }
41824
41889
  });
41825
41890
  }
package/dist/index.d.ts CHANGED
@@ -44,7 +44,7 @@ type WorldOptions = {
44
44
  credentials?: InteractiveCredentials | undefined;
45
45
  };
46
46
 
47
- type ResponseType = {
47
+ type ResponseType$1 = {
48
48
  message: string;
49
49
  success: boolean;
50
50
  };
@@ -64,7 +64,7 @@ type ResponseType = {
64
64
  declare class Scene extends SDKController implements SceneInterface {
65
65
  readonly id: string;
66
66
  constructor(topia: Topia, id: string, options?: SceneOptionalInterface);
67
- fetchSceneById(): Promise<void | ResponseType>;
67
+ fetchSceneById(): Promise<void | ResponseType$1>;
68
68
  }
69
69
 
70
70
  /**
@@ -81,12 +81,16 @@ declare class Scene extends SDKController implements SceneInterface {
81
81
  */
82
82
  declare class DroppedAsset extends Asset implements DroppedAssetInterface {
83
83
  #private;
84
- dataObject?: object | null;
85
84
  readonly id?: string | undefined;
86
- text?: string | null | undefined;
87
- urlSlug: string;
85
+ dataObject?: object | null;
88
86
  isInteractive?: boolean | null;
89
87
  interactivePublicKey?: string | null;
88
+ position?: {
89
+ x: number;
90
+ y: number;
91
+ };
92
+ text?: string | null | undefined;
93
+ urlSlug: string;
90
94
  constructor(topia: Topia, id: string, urlSlug: string, options?: DroppedAssetOptionalInterface);
91
95
  /**
92
96
  * @summary
@@ -98,7 +102,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
98
102
  * const { assetName } = droppedAsset;
99
103
  * ```
100
104
  */
101
- fetchDroppedAssetById(): Promise<void | ResponseType>;
105
+ fetchDroppedAssetById(): Promise<void | ResponseType$1>;
102
106
  /**
103
107
  * @summary
104
108
  * Delete dropped asset.
@@ -108,7 +112,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
108
112
  * await droppedAsset.deleteDroppedAsset();
109
113
  * ```
110
114
  */
111
- deleteDroppedAsset(): Promise<void | ResponseType>;
115
+ deleteDroppedAsset(): Promise<void | ResponseType$1>;
112
116
  /**
113
117
  * @summary
114
118
  * Retrieves the data object for a dropped asset.
@@ -118,7 +122,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
118
122
  * const dataObject = await droppedAsset.fetchDataObject();
119
123
  * ```
120
124
  */
121
- fetchDataObject(): Promise<void | ResponseType>;
125
+ fetchDataObject(): Promise<void | ResponseType$1>;
122
126
  /**
123
127
  * @summary
124
128
  * Sets the data object for a dropped asset.
@@ -137,7 +141,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
137
141
  lockId: string;
138
142
  releaseLock?: boolean;
139
143
  };
140
- }): Promise<void | ResponseType>;
144
+ }): Promise<void | ResponseType$1>;
141
145
  /**
142
146
  * @summary
143
147
  * Updates the data object for a dropped asset.
@@ -156,7 +160,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
156
160
  lockId: string;
157
161
  releaseLock?: boolean;
158
162
  };
159
- }): Promise<void | ResponseType>;
163
+ }): Promise<void | ResponseType$1>;
160
164
  /**
161
165
  * @summary
162
166
  * Increments a specific value in the data object for a dropped asset by the amount specified. Must have valid interactive credentials from a visitor in the world.
@@ -176,7 +180,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
176
180
  lockId: string;
177
181
  releaseLock?: boolean;
178
182
  };
179
- }): Promise<void | ResponseType>;
183
+ }): Promise<void | ResponseType$1>;
180
184
  /**
181
185
  * @summary
182
186
  * Updates broadcast options for a dropped asset.
@@ -190,7 +194,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
190
194
  * });
191
195
  * ```
192
196
  */
193
- updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType>;
197
+ updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType$1>;
194
198
  /**
195
199
  * @summary
196
200
  * Updates click options for a dropped asset.
@@ -211,7 +215,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
211
215
  * });
212
216
  * ```
213
217
  */
214
- updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType>;
218
+ updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType$1>;
215
219
  /**
216
220
  * @summary
217
221
  * Updates text and style of a dropped asset.
@@ -228,7 +232,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
228
232
  * await droppedAsset.updateCustomTextAsset(style, "hello world");
229
233
  * ```
230
234
  */
231
- updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType>;
235
+ updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType$1>;
232
236
  /**
233
237
  * @summary
234
238
  * Updates media options for a dropped asset.
@@ -247,7 +251,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
247
251
  * });
248
252
  * ```
249
253
  */
250
- updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType>;
254
+ updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType$1>;
251
255
  /**
252
256
  * @summary
253
257
  * Updates mute zone options for a dropped asset.
@@ -257,7 +261,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
257
261
  * await droppedAsset.updateMuteZone(true);
258
262
  * ```
259
263
  */
260
- updateMuteZone(isMutezone: boolean): Promise<void | ResponseType>;
264
+ updateMuteZone(isMutezone: boolean): Promise<void | ResponseType$1>;
261
265
  /**
262
266
  * @summary
263
267
  * Updates webhook zone options for a dropped asset.
@@ -267,7 +271,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
267
271
  * await droppedAsset.updateWebhookZone(true);
268
272
  * ```
269
273
  */
270
- updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType>;
274
+ updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType$1>;
271
275
  /**
272
276
  * @summary
273
277
  * Moves a dropped asset to specified coordinates.
@@ -277,7 +281,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
277
281
  * await droppedAsset.updatePosition(100,200);
278
282
  * ```
279
283
  */
280
- updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType>;
284
+ updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType$1>;
281
285
  /**
282
286
  * @summary
283
287
  * Updates private zone options for a dropped asset.
@@ -291,7 +295,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
291
295
  * });
292
296
  * ```
293
297
  */
294
- updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType>;
298
+ updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType$1>;
295
299
  /**
296
300
  * @summary
297
301
  * Updates the size of a dropped asset.
@@ -301,7 +305,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
301
305
  * await droppedAsset.assetScale(.5);
302
306
  * ```
303
307
  */
304
- updateScale(assetScale: number): Promise<void | ResponseType>;
308
+ updateScale(assetScale: number): Promise<void | ResponseType$1>;
305
309
  /**
306
310
  * @summary
307
311
  * Flip an dropped asset.
@@ -311,7 +315,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
311
315
  * await droppedAsset.flip(.5);
312
316
  * ```
313
317
  */
314
- flip(): Promise<void | ResponseType>;
318
+ flip(): Promise<void | ResponseType$1>;
315
319
  /**
316
320
  * @summary
317
321
  * Change or remove media embedded in a dropped asset.
@@ -321,7 +325,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
321
325
  * await droppedAsset.updateUploadedMediaSelected("LVWyxwNxI96eLjnXWwYO");
322
326
  * ```
323
327
  */
324
- updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType>;
328
+ updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType$1>;
325
329
  /**
326
330
  * @summary
327
331
  * Change or remove top and bottom layers of a dropped asset.
@@ -331,7 +335,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
331
335
  * await droppedAsset.updateWebImageLayers("","https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg");
332
336
  * ```
333
337
  */
334
- updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType>;
338
+ updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType$1>;
335
339
  /**
336
340
  * @summary
337
341
  * Add a webhook to a dropped asset
@@ -339,7 +343,6 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
339
343
  * @usage
340
344
  * ```ts
341
345
  * await droppedAsset.addWebhook({
342
- * active: true,
343
346
  * dataObject: {},
344
347
  * description: "Webhook desc",
345
348
  * enteredBy: "you",
@@ -347,7 +350,6 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
347
350
  * title: "title",
348
351
  * type: "type",
349
352
  * url: "https://url.com",
350
- * urlSlug: "world",
351
353
  * });
352
354
  * ```
353
355
  */
@@ -376,7 +378,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
376
378
  setInteractiveSettings({ isInteractive, interactivePublicKey, }: {
377
379
  isInteractive?: boolean;
378
380
  interactivePublicKey: string;
379
- }): Promise<void | ResponseType>;
381
+ }): Promise<void | ResponseType$1>;
380
382
  /**
381
383
  * @summary
382
384
  * Retrieve analytics for a dropped asset by day, week, month, quarter, or year
@@ -394,7 +396,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
394
396
  periodType: "week" | "month" | "quarter" | "year";
395
397
  dateValue: number;
396
398
  year: number;
397
- }): Promise<void | ResponseType>;
399
+ }): Promise<void | ResponseType$1>;
398
400
  }
399
401
 
400
402
  /**
@@ -430,7 +432,7 @@ declare class World extends SDKController implements WorldInterface {
430
432
  * const { name } = world;
431
433
  * ```
432
434
  */
433
- fetchDetails(): Promise<void | ResponseType>;
435
+ fetchDetails(): Promise<void | ResponseType$1>;
434
436
  /**
435
437
  * @summary
436
438
  * Update details of a world.
@@ -453,7 +455,33 @@ declare class World extends SDKController implements WorldInterface {
453
455
  * });
454
456
  * ```
455
457
  */
456
- updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType>;
458
+ updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType$1>;
459
+ /**
460
+ * @summary
461
+ * Set close world settings
462
+ *
463
+ * @usage
464
+ * ```ts
465
+ * await world.updateCloseWorldSettings({
466
+ * controls: {
467
+ * allowMuteAll: true,
468
+ * disableHideVideo: true,
469
+ * isMobileDisabled: false,
470
+ * isShowingCurrentGuests: false,
471
+ * },
472
+ * description: 'Welcome to my world.',
473
+ * forceAuthOnLogin: false,
474
+ * height: 2000,
475
+ * name: 'Example',
476
+ * spawnPosition: { x: 100, y: 100 },
477
+ * width: 2000
478
+ * });
479
+ * ```
480
+ */
481
+ updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }: {
482
+ closeWorldDescription: string;
483
+ isWorldClosed: boolean;
484
+ }): Promise<void | ResponseType$1>;
457
485
  /**
458
486
  * @summary
459
487
  * Retrieve all assets dropped in a world.
@@ -464,7 +492,7 @@ declare class World extends SDKController implements WorldInterface {
464
492
  * const assets = world.droppedAssets;
465
493
  * ```
466
494
  */
467
- fetchDroppedAssets(): Promise<void | ResponseType>;
495
+ fetchDroppedAssets(): Promise<void | ResponseType$1>;
468
496
  /**
469
497
  * @summary
470
498
  * Retrieve all assets dropped in a world matching uniqueName.
@@ -534,7 +562,7 @@ declare class World extends SDKController implements WorldInterface {
534
562
  * { sceneDropIds: [] }
535
563
  * ```
536
564
  */
537
- fetchSceneDropIds(): Promise<object | ResponseType>;
565
+ fetchSceneDropIds(): Promise<object | ResponseType$1>;
538
566
  /**
539
567
  * @summary
540
568
  * Fetch a list of all scene drop ids and dropped assets in a world
@@ -563,7 +591,7 @@ declare class World extends SDKController implements WorldInterface {
563
591
  * }
564
592
  * ```
565
593
  */
566
- fetchScenes(): Promise<object | ResponseType>;
594
+ fetchScenes(): Promise<object | ResponseType$1>;
567
595
  /**
568
596
  * @summary
569
597
  * Drops a scene in a world and returns sceneDropId.
@@ -589,7 +617,7 @@ declare class World extends SDKController implements WorldInterface {
589
617
  assetSuffix: string;
590
618
  position: object;
591
619
  sceneId: string;
592
- }): Promise<object | ResponseType>;
620
+ }): Promise<object | ResponseType$1>;
593
621
  /**
594
622
  * @summary
595
623
  * Replace the current scene of a world.
@@ -607,7 +635,7 @@ declare class World extends SDKController implements WorldInterface {
607
635
  * await world.replaceScene(SCENE_ID);
608
636
  * ```
609
637
  */
610
- replaceScene(sceneId: string): Promise<void | ResponseType>;
638
+ replaceScene(sceneId: string): Promise<void | ResponseType$1>;
611
639
  /**
612
640
  * @summary
613
641
  * Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
@@ -618,7 +646,7 @@ declare class World extends SDKController implements WorldInterface {
618
646
  * const { dataObject } = world;
619
647
  * ```
620
648
  */
621
- fetchDataObject: () => Promise<void | ResponseType>;
649
+ fetchDataObject: () => Promise<void | ResponseType$1>;
622
650
  /**
623
651
  * @summary
624
652
  * Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
@@ -638,7 +666,7 @@ declare class World extends SDKController implements WorldInterface {
638
666
  lockId: string;
639
667
  releaseLock?: boolean;
640
668
  };
641
- }) => Promise<void | ResponseType>;
669
+ }) => Promise<void | ResponseType$1>;
642
670
  /**
643
671
  * @summary
644
672
  * Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
@@ -658,7 +686,7 @@ declare class World extends SDKController implements WorldInterface {
658
686
  lockId: string;
659
687
  releaseLock?: boolean;
660
688
  };
661
- }) => Promise<void | ResponseType>;
689
+ }) => Promise<void | ResponseType$1>;
662
690
  /**
663
691
  * @summary
664
692
  * Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
@@ -678,7 +706,7 @@ declare class World extends SDKController implements WorldInterface {
678
706
  lockId: string;
679
707
  releaseLock?: boolean;
680
708
  };
681
- }): Promise<void | ResponseType>;
709
+ }): Promise<void | ResponseType$1>;
682
710
  /**
683
711
  * @summary
684
712
  * Retrieve all webhooks in a world.
@@ -689,7 +717,7 @@ declare class World extends SDKController implements WorldInterface {
689
717
  * const webhooks = world.webhooks;
690
718
  * ```
691
719
  */
692
- fetchWebhooks(): Promise<void | ResponseType>;
720
+ fetchWebhooks(): Promise<void | ResponseType$1>;
693
721
  /**
694
722
  * @summary
695
723
  * Retrieve world analytics by day, week, month, quarter, or year
@@ -707,7 +735,7 @@ declare class World extends SDKController implements WorldInterface {
707
735
  periodType: "week" | "month" | "quarter" | "year";
708
736
  dateValue: number;
709
737
  year: number;
710
- }): Promise<void | ResponseType>;
738
+ }): Promise<void | ResponseType$1>;
711
739
  }
712
740
 
713
741
  /**
@@ -744,12 +772,17 @@ declare class User extends SDKController implements UserInterface {
744
772
  * @summary
745
773
  * Returns all assets owned by User when an email address is provided.
746
774
  */
747
- fetchAssets(): Promise<void | ResponseType>;
775
+ fetchAssets(): Promise<void | ResponseType$1>;
776
+ /**
777
+ * @summary
778
+ * Returns all platform assets
779
+ */
780
+ fetchPlatformAssets(): Promise<object | ResponseType$1>;
748
781
  /**
749
782
  * @summary
750
783
  * Returns all scenes owned by User
751
784
  */
752
- fetchScenes(): Promise<void | ResponseType>;
785
+ fetchScenes(): Promise<void | ResponseType$1>;
753
786
  /**
754
787
  * @summary
755
788
  * Retrieves all worlds owned by user with matching API Key,
@@ -767,7 +800,7 @@ declare class User extends SDKController implements UserInterface {
767
800
  * { urlSlug: new World({ apiKey, worldArgs, urlSlug }) }
768
801
  * ```
769
802
  */
770
- fetchWorldsByKey(): Promise<void | ResponseType>;
803
+ fetchWorldsByKey(): Promise<void | ResponseType$1>;
771
804
  /**
772
805
  * @summary
773
806
  * Retrieves all worlds a user with matching API Key is an admin in,
@@ -780,7 +813,7 @@ declare class User extends SDKController implements UserInterface {
780
813
  * const adminWorlds = user.adminWorlds;
781
814
  * ```
782
815
  */
783
- fetchAdminWorldsByKey(): Promise<void | ResponseType>;
816
+ fetchAdminWorldsByKey(): Promise<void | ResponseType$1>;
784
817
  /**
785
818
  * @summary
786
819
  * Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
@@ -791,7 +824,7 @@ declare class User extends SDKController implements UserInterface {
791
824
  * const interactiveWorlds = user.interactiveWorlds;
792
825
  * ```
793
826
  */
794
- fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType>;
827
+ fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType$1>;
795
828
  /**
796
829
  * @summary
797
830
  * Retrieves the data object for a user.
@@ -801,7 +834,7 @@ declare class User extends SDKController implements UserInterface {
801
834
  * const dataObject = await user.fetchDataObject();
802
835
  * ```
803
836
  */
804
- fetchDataObject(): Promise<void | ResponseType>;
837
+ fetchDataObject(): Promise<void | ResponseType$1>;
805
838
  /**
806
839
  * @summary
807
840
  * Sets the data object for a user.
@@ -820,7 +853,7 @@ declare class User extends SDKController implements UserInterface {
820
853
  lockId: string;
821
854
  releaseLock?: boolean;
822
855
  };
823
- }): Promise<void | ResponseType>;
856
+ }): Promise<void | ResponseType$1>;
824
857
  /**
825
858
  * @summary
826
859
  * Updates the data object for a user.
@@ -839,7 +872,7 @@ declare class User extends SDKController implements UserInterface {
839
872
  lockId: string;
840
873
  releaseLock?: boolean;
841
874
  };
842
- }): Promise<void | ResponseType>;
875
+ }): Promise<void | ResponseType$1>;
843
876
  /**
844
877
  * @summary
845
878
  * 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.
@@ -859,7 +892,7 @@ declare class User extends SDKController implements UserInterface {
859
892
  lockId: string;
860
893
  releaseLock?: boolean;
861
894
  };
862
- }): Promise<void | ResponseType>;
895
+ }): Promise<void | ResponseType$1>;
863
896
  }
864
897
 
865
898
  /**
@@ -888,7 +921,7 @@ declare class Visitor extends User implements VisitorInterface {
888
921
  * @result
889
922
  * Returns details for a visitor in a world by id and urlSlug
890
923
  */
891
- fetchVisitor(): Promise<void | ResponseType>;
924
+ fetchVisitor(): Promise<void | ResponseType$1>;
892
925
  /**
893
926
  * @summary
894
927
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
@@ -905,7 +938,7 @@ declare class Visitor extends User implements VisitorInterface {
905
938
  * @result
906
939
  * Updates each Visitor instance and world.visitors map.
907
940
  */
908
- moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
941
+ moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
909
942
  /**
910
943
  * @summary
911
944
  * Display a message via a toast to a visitor currently in a world.
@@ -919,7 +952,7 @@ declare class Visitor extends User implements VisitorInterface {
919
952
  * });
920
953
  * ```
921
954
  */
922
- fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
955
+ fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
923
956
  /**
924
957
  * @summary
925
958
  * Open an iframe in a drawer or modal for a visitor currently in a world.
@@ -934,7 +967,7 @@ declare class Visitor extends User implements VisitorInterface {
934
967
  * });
935
968
  * ```
936
969
  */
937
- openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType>;
970
+ openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType$1>;
938
971
  /**
939
972
  * @summary
940
973
  * Reload an iframe for a visitor currently in a world.
@@ -944,7 +977,7 @@ declare class Visitor extends User implements VisitorInterface {
944
977
  * await visitor.reloadIframe("droppedAssetId");
945
978
  * ```
946
979
  */
947
- reloadIframe(droppedAssetId: string): Promise<void | ResponseType>;
980
+ reloadIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
948
981
  /**
949
982
  * @summary
950
983
  * Close an iframe for a visitor currently in a world.
@@ -954,7 +987,7 @@ declare class Visitor extends User implements VisitorInterface {
954
987
  * await visitor.closeIframe("droppedAssetId");
955
988
  * ```
956
989
  */
957
- closeIframe(droppedAssetId: string): Promise<void | ResponseType>;
990
+ closeIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
958
991
  /**
959
992
  * @summary
960
993
  * Mute and turn video off for a visitor currently in a world.
@@ -964,7 +997,7 @@ declare class Visitor extends User implements VisitorInterface {
964
997
  * await visitor.turnAVOff();
965
998
  * ```
966
999
  */
967
- turnAVOff(): Promise<void | ResponseType>;
1000
+ turnAVOff(): Promise<void | ResponseType$1>;
968
1001
  /**
969
1002
  * @summary
970
1003
  * Grant expression to a visitor by id or name.
@@ -977,7 +1010,7 @@ declare class Visitor extends User implements VisitorInterface {
977
1010
  grantExpression({ id, name }: {
978
1011
  id?: string;
979
1012
  name?: string;
980
- }): Promise<object | ResponseType>;
1013
+ }): Promise<object | ResponseType$1>;
981
1014
  /**
982
1015
  * @summary
983
1016
  * Retrieves the data object for a visitor.
@@ -987,7 +1020,7 @@ declare class Visitor extends User implements VisitorInterface {
987
1020
  * const dataObject = await visitor.fetchDataObject();
988
1021
  * ```
989
1022
  */
990
- fetchDataObject(): Promise<void | ResponseType>;
1023
+ fetchDataObject(): Promise<void | ResponseType$1>;
991
1024
  /**
992
1025
  * @summary
993
1026
  * Sets the data object for a visitor.
@@ -1006,7 +1039,7 @@ declare class Visitor extends User implements VisitorInterface {
1006
1039
  lockId: string;
1007
1040
  releaseLock?: boolean;
1008
1041
  };
1009
- }): Promise<void | ResponseType>;
1042
+ }): Promise<void | ResponseType$1>;
1010
1043
  /**
1011
1044
  * @summary
1012
1045
  * Updates the data object for a visitor.
@@ -1025,7 +1058,7 @@ declare class Visitor extends User implements VisitorInterface {
1025
1058
  lockId: string;
1026
1059
  releaseLock?: boolean;
1027
1060
  };
1028
- }): Promise<void | ResponseType>;
1061
+ }): Promise<void | ResponseType$1>;
1029
1062
  /**
1030
1063
  * @summary
1031
1064
  * Increments a specific value in the data object for a visitor by the amount specified. Must have valid interactive credentials from a visitor in the world.
@@ -1045,7 +1078,7 @@ declare class Visitor extends User implements VisitorInterface {
1045
1078
  lockId: string;
1046
1079
  releaseLock?: boolean;
1047
1080
  };
1048
- }): Promise<void | ResponseType>;
1081
+ }): Promise<void | ResponseType$1>;
1049
1082
  }
1050
1083
 
1051
1084
  type VisitorType = {
@@ -1089,7 +1122,7 @@ interface SDKInterface {
1089
1122
  }
1090
1123
 
1091
1124
  interface AssetInterface extends SDKInterface {
1092
- fetchPlatformAssets(): Promise<object>;
1125
+ fetchAssetById(): Promise<object | ResponseType>;
1093
1126
  addedOn?: string;
1094
1127
  assetName?: string;
1095
1128
  creatorTags?: object;
@@ -1114,23 +1147,23 @@ type AssetOptionalInterface = {
1114
1147
  };
1115
1148
 
1116
1149
  interface DroppedAssetInterface extends AssetInterface {
1117
- fetchDroppedAssetById(): Promise<void | ResponseType>;
1118
- deleteDroppedAsset(): Promise<void | ResponseType>;
1119
- fetchDataObject(): Promise<void | ResponseType>;
1120
- setDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
1121
- updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
1122
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
1123
- updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType>;
1124
- updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType>;
1125
- updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType>;
1126
- updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType>;
1127
- updateMuteZone(isMutezone: boolean): Promise<void | ResponseType>;
1128
- updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType>;
1129
- updatePosition(x: number, y: number, yOrderAdjust: number): Promise<void | ResponseType>;
1130
- updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType>;
1131
- updateScale(assetScale: number): Promise<void | ResponseType>;
1132
- updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType>;
1133
- updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType>;
1150
+ fetchDroppedAssetById(): Promise<void | ResponseType$1>;
1151
+ deleteDroppedAsset(): Promise<void | ResponseType$1>;
1152
+ fetchDataObject(): Promise<void | ResponseType$1>;
1153
+ setDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1154
+ updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1155
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
1156
+ updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType$1>;
1157
+ updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType$1>;
1158
+ updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType$1>;
1159
+ updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType$1>;
1160
+ updateMuteZone(isMutezone: boolean): Promise<void | ResponseType$1>;
1161
+ updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType$1>;
1162
+ updatePosition(x: number, y: number, yOrderAdjust: number): Promise<void | ResponseType$1>;
1163
+ updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType$1>;
1164
+ updateScale(assetScale: number): Promise<void | ResponseType$1>;
1165
+ updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType$1>;
1166
+ updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType$1>;
1134
1167
  addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }: {
1135
1168
  dataObject: object;
1136
1169
  description: string;
@@ -1142,7 +1175,7 @@ interface DroppedAssetInterface extends AssetInterface {
1142
1175
  setInteractiveSettings({ isInteractive, interactivePublicKey, }: {
1143
1176
  isInteractive?: boolean;
1144
1177
  interactivePublicKey: string;
1145
- }): Promise<void | ResponseType>;
1178
+ }): Promise<void | ResponseType$1>;
1146
1179
  id?: string;
1147
1180
  assetId?: string;
1148
1181
  assetScale?: number | null;
@@ -1247,7 +1280,7 @@ interface UpdatePrivateZoneInterface {
1247
1280
  }
1248
1281
 
1249
1282
  interface SceneInterface {
1250
- fetchSceneById(): Promise<void | ResponseType>;
1283
+ fetchSceneById(): Promise<void | ResponseType$1>;
1251
1284
  id: string;
1252
1285
  background?: null;
1253
1286
  description?: string;
@@ -1284,12 +1317,13 @@ interface TopiaInterface {
1284
1317
  }
1285
1318
 
1286
1319
  interface UserInterface {
1287
- fetchAssets(): Promise<void | ResponseType>;
1288
- fetchScenes(): Promise<void | ResponseType>;
1289
- fetchWorldsByKey(): Promise<void | ResponseType>;
1290
- fetchDataObject(): Promise<void | ResponseType>;
1291
- setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
1292
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
1320
+ fetchAssets(): Promise<void | ResponseType$1>;
1321
+ fetchPlatformAssets(): Promise<object | ResponseType$1>;
1322
+ fetchScenes(): Promise<void | ResponseType$1>;
1323
+ fetchWorldsByKey(): Promise<void | ResponseType$1>;
1324
+ fetchDataObject(): Promise<void | ResponseType$1>;
1325
+ setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
1326
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
1293
1327
  dataObject?: object | null;
1294
1328
  }
1295
1329
  interface UserOptionalInterface {
@@ -1300,14 +1334,14 @@ interface UserOptionalInterface {
1300
1334
  }
1301
1335
 
1302
1336
  interface VisitorInterface extends SDKInterface {
1303
- fetchVisitor(): Promise<void | ResponseType>;
1304
- moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
1305
- fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
1306
- openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType>;
1307
- fetchDataObject(): Promise<void | ResponseType>;
1308
- setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
1309
- updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
1310
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
1337
+ fetchVisitor(): Promise<void | ResponseType$1>;
1338
+ moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
1339
+ fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
1340
+ openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType$1>;
1341
+ fetchDataObject(): Promise<void | ResponseType$1>;
1342
+ setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
1343
+ updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1344
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
1311
1345
  color?: string;
1312
1346
  dataObject?: object | null | undefined;
1313
1347
  displayName?: string;
@@ -1408,9 +1442,9 @@ interface WorldDetailsInterface {
1408
1442
  width?: number;
1409
1443
  }
1410
1444
  interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1411
- fetchDetails(): Promise<void | ResponseType>;
1412
- updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType>;
1413
- fetchDroppedAssets(): Promise<void | ResponseType>;
1445
+ fetchDetails(): Promise<void | ResponseType$1>;
1446
+ updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType$1>;
1447
+ fetchDroppedAssets(): Promise<void | ResponseType$1>;
1414
1448
  fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial, isReversed, }: {
1415
1449
  uniqueName: string;
1416
1450
  isPartial?: boolean;
@@ -1421,12 +1455,12 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1421
1455
  assetSuffix: string;
1422
1456
  position: object;
1423
1457
  sceneId: string;
1424
- }): Promise<object | ResponseType>;
1425
- replaceScene(sceneId: string): Promise<void | ResponseType>;
1426
- fetchDataObject(): Promise<void | ResponseType>;
1427
- setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
1428
- updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
1429
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
1458
+ }): Promise<object | ResponseType$1>;
1459
+ replaceScene(sceneId: string): Promise<void | ResponseType$1>;
1460
+ fetchDataObject(): Promise<void | ResponseType$1>;
1461
+ setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
1462
+ updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1463
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
1430
1464
  dataObject?: object | null;
1431
1465
  }
1432
1466
  interface WorldOptionalInterface {
@@ -1489,7 +1523,7 @@ declare class Topia implements TopiaInterface {
1489
1523
  * await new SDKController({ credentials, topia });
1490
1524
  * ```
1491
1525
  */
1492
- declare class SDKController implements SDKInterface {
1526
+ declare abstract class SDKController implements SDKInterface {
1493
1527
  credentials: InteractiveCredentials | undefined;
1494
1528
  jwt?: string;
1495
1529
  requestOptions: object;
@@ -1530,7 +1564,7 @@ declare class SDKController implements SDKInterface {
1530
1564
  declare class Asset extends SDKController implements AssetInterface {
1531
1565
  readonly id?: string;
1532
1566
  constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
1533
- fetchPlatformAssets(): Promise<object | ResponseType>;
1567
+ fetchAssetById(): Promise<object | ResponseType$1>;
1534
1568
  }
1535
1569
 
1536
1570
  /**
@@ -1587,7 +1621,7 @@ declare class WorldActivity extends SDKController {
1587
1621
  * @result
1588
1622
  * Updates each Visitor instance and worldActivity.visitors map.
1589
1623
  */
1590
- moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType)[] | undefined>;
1624
+ moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType$1)[] | undefined>;
1591
1625
  /**
1592
1626
  * @summary
1593
1627
  * Teleport or walk a list of visitors currently in a world to various coordinates.
@@ -1613,7 +1647,7 @@ declare class WorldActivity extends SDKController {
1613
1647
  * @result
1614
1648
  * Updates each Visitor instance and worldActivity.visitors map.
1615
1649
  */
1616
- moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType)[]>;
1650
+ moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType$1)[]>;
1617
1651
  }
1618
1652
 
1619
1653
  declare class AssetFactory {
@@ -1626,7 +1660,11 @@ declare class DroppedAssetFactory extends SDKController {
1626
1660
  constructor(topia: Topia);
1627
1661
  create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
1628
1662
  get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
1629
- getWithUniqueName(uniqueName: string, urlSlug: string, interactivePublicKey: string, interactiveSecret: string): Promise<DroppedAsset>;
1663
+ getWithUniqueName(uniqueName: string, urlSlug: string, credentials: {
1664
+ apiKey?: string;
1665
+ interactivePublicKey?: string;
1666
+ interactiveSecret?: string;
1667
+ }): Promise<DroppedAsset>;
1630
1668
  drop(asset: Asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
1631
1669
  assetScale?: number;
1632
1670
  flipped?: boolean;
@@ -1679,9 +1717,13 @@ declare class WorldActivityFactory {
1679
1717
  declare class WorldFactory extends SDKController {
1680
1718
  constructor(topia: Topia);
1681
1719
  create(urlSlug: string, options?: WorldOptionalInterface): World;
1682
- deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactivePublicKey: string, interactiveSecret: string): Promise<{
1720
+ deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], credentials: {
1721
+ apiKey?: string;
1722
+ interactivePublicKey?: string;
1723
+ interactiveSecret?: string;
1724
+ }): Promise<{
1683
1725
  success: boolean;
1684
1726
  }>;
1685
1727
  }
1686
1728
 
1687
- export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
1729
+ export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
package/dist/index.js CHANGED
@@ -39727,14 +39727,14 @@ class Asset extends SDKController {
39727
39727
  this.id = id;
39728
39728
  Object.assign(this, options.attributes);
39729
39729
  }
39730
- fetchPlatformAssets() {
39730
+ fetchAssetById() {
39731
39731
  return __awaiter(this, void 0, void 0, function* () {
39732
39732
  try {
39733
- const response = yield this.topiaPublicApi().get("/assets/topia-assets", this.requestOptions);
39733
+ const response = yield this.topiaPublicApi().get(`/assets/${this.id}`, this.requestOptions);
39734
39734
  return response.data;
39735
39735
  }
39736
39736
  catch (error) {
39737
- throw this.errorHandler({ error, sdkMethod: "Asset.fetchPlatformAssets" });
39737
+ throw this.errorHandler({ error, sdkMethod: "Asset.fetchAssetById" });
39738
39738
  }
39739
39739
  });
39740
39740
  }
@@ -40187,7 +40187,6 @@ class DroppedAsset extends Asset {
40187
40187
  * @usage
40188
40188
  * ```ts
40189
40189
  * await droppedAsset.addWebhook({
40190
- * active: true,
40191
40190
  * dataObject: {},
40192
40191
  * description: "Webhook desc",
40193
40192
  * enteredBy: "you",
@@ -40195,7 +40194,6 @@ class DroppedAsset extends Asset {
40195
40194
  * title: "title",
40196
40195
  * type: "type",
40197
40196
  * url: "https://url.com",
40198
- * urlSlug: "world",
40199
40197
  * });
40200
40198
  * ```
40201
40199
  */
@@ -40517,6 +40515,42 @@ class World extends SDKController {
40517
40515
  }
40518
40516
  });
40519
40517
  }
40518
+ /**
40519
+ * @summary
40520
+ * Set close world settings
40521
+ *
40522
+ * @usage
40523
+ * ```ts
40524
+ * await world.updateCloseWorldSettings({
40525
+ * controls: {
40526
+ * allowMuteAll: true,
40527
+ * disableHideVideo: true,
40528
+ * isMobileDisabled: false,
40529
+ * isShowingCurrentGuests: false,
40530
+ * },
40531
+ * description: 'Welcome to my world.',
40532
+ * forceAuthOnLogin: false,
40533
+ * height: 2000,
40534
+ * name: 'Example',
40535
+ * spawnPosition: { x: 100, y: 100 },
40536
+ * width: 2000
40537
+ * });
40538
+ * ```
40539
+ */
40540
+ updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }) {
40541
+ return __awaiter(this, void 0, void 0, function* () {
40542
+ const params = {
40543
+ closeWorldDescription,
40544
+ isWorldClosed,
40545
+ };
40546
+ try {
40547
+ return yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-close-world-settings`, params, this.requestOptions);
40548
+ }
40549
+ catch (error) {
40550
+ throw this.errorHandler({ error, params, sdkMethod: "World.updateCloseWorldSettings" });
40551
+ }
40552
+ });
40553
+ }
40520
40554
  ////////// dropped assets
40521
40555
  /**
40522
40556
  * @summary
@@ -40648,6 +40682,7 @@ class World extends SDKController {
40648
40682
  return outcomes;
40649
40683
  });
40650
40684
  }
40685
+ // scenes
40651
40686
  /**
40652
40687
  * @deprecated Use {@link fetchScenes} instead.
40653
40688
  *
@@ -40708,7 +40743,7 @@ class World extends SDKController {
40708
40743
  return __awaiter(this, void 0, void 0, function* () {
40709
40744
  try {
40710
40745
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/scenes-with-dropped-assets`, this.requestOptions);
40711
- this.scenes = response.data;
40746
+ this.scenes = response.data.scenes;
40712
40747
  return response.data;
40713
40748
  }
40714
40749
  catch (error) {
@@ -40938,6 +40973,21 @@ class User extends SDKController {
40938
40973
  }
40939
40974
  });
40940
40975
  }
40976
+ /**
40977
+ * @summary
40978
+ * Returns all platform assets
40979
+ */
40980
+ fetchPlatformAssets() {
40981
+ return __awaiter(this, void 0, void 0, function* () {
40982
+ try {
40983
+ const response = yield this.topiaPublicApi().get("/assets/topia-assets", this.requestOptions);
40984
+ return response.data;
40985
+ }
40986
+ catch (error) {
40987
+ throw this.errorHandler({ error, sdkMethod: "Asset.fetchPlatformAssets" });
40988
+ }
40989
+ });
40990
+ }
40941
40991
  /**
40942
40992
  * @summary
40943
40993
  * Returns all scenes owned by User
@@ -41685,12 +41735,20 @@ class DroppedAssetFactory extends SDKController {
41685
41735
  return droppedAsset;
41686
41736
  });
41687
41737
  }
41688
- getWithUniqueName(uniqueName, urlSlug, interactivePublicKey, interactiveSecret) {
41738
+ getWithUniqueName(uniqueName, urlSlug, credentials) {
41689
41739
  return __awaiter(this, void 0, void 0, function* () {
41690
- const params = { uniqueName, urlSlug, interactivePublicKey, interactiveSecret };
41740
+ const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
41741
+ const params = { apiKey, interactivePublicKey, interactiveSecret, uniqueName, urlSlug };
41691
41742
  try {
41692
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41693
- const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers: { interactiveJWT, publickey: interactivePublicKey } });
41743
+ const headers = {};
41744
+ if (apiKey) {
41745
+ headers.Authorization = apiKey;
41746
+ }
41747
+ else if (interactivePublicKey && interactiveSecret) {
41748
+ headers.interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41749
+ headers.publickey = interactivePublicKey;
41750
+ }
41751
+ const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers });
41694
41752
  const { id } = response.data;
41695
41753
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
41696
41754
  }
@@ -41699,9 +41757,9 @@ class DroppedAssetFactory extends SDKController {
41699
41757
  }
41700
41758
  });
41701
41759
  }
41702
- drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41760
+ drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41703
41761
  return __awaiter(this, void 0, void 0, function* () {
41704
- let specialType;
41762
+ let specialType = null;
41705
41763
  if (layer0 || layer1)
41706
41764
  specialType = "webImage";
41707
41765
  else if (text)
@@ -41801,23 +41859,30 @@ class WorldFactory extends SDKController {
41801
41859
  create(urlSlug, options) {
41802
41860
  return new World(this.topia, urlSlug, options);
41803
41861
  }
41804
- deleteDroppedAssets(urlSlug, droppedAssetIds, interactivePublicKey, interactiveSecret) {
41862
+ deleteDroppedAssets(urlSlug, droppedAssetIds, credentials) {
41805
41863
  return __awaiter(this, void 0, void 0, function* () {
41806
- const params = { droppedAssetIds, urlSlug, interactivePublicKey, interactiveSecret };
41864
+ const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
41865
+ const params = { apiKey, droppedAssetIds, interactivePublicKey, interactiveSecret, urlSlug };
41807
41866
  try {
41808
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41867
+ const headers = {};
41868
+ if (apiKey) {
41869
+ headers.Authorization = apiKey;
41870
+ }
41871
+ else if (interactivePublicKey && interactiveSecret) {
41872
+ headers.interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41873
+ headers.publickey = interactivePublicKey;
41874
+ }
41809
41875
  const promiseArray = [];
41810
41876
  for (const id of droppedAssetIds) {
41811
41877
  promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
41812
- headers: { interactiveJWT, publickey: interactivePublicKey },
41878
+ headers,
41813
41879
  }));
41814
41880
  }
41815
- const result = yield Promise.all(promiseArray);
41816
- console.log(result);
41881
+ yield Promise.all(promiseArray);
41817
41882
  return { success: true };
41818
41883
  }
41819
41884
  catch (error) {
41820
- throw this.errorHandler({ error, params, sdkMethod: "DroppedAssetFactory.getWithUniqueName" });
41885
+ throw this.errorHandler({ error, params, sdkMethod: "WorldFactory.deleteDroppedAssets" });
41821
41886
  }
41822
41887
  });
41823
41888
  }
package/package.json CHANGED
@@ -59,5 +59,5 @@
59
59
  "local-publish": "yarn build && yalc publish --push --no-scripts"
60
60
  },
61
61
  "type": "module",
62
- "version": "0.8.4"
62
+ "version": "0.8.5"
63
63
  }