@rtsdk/topia 0.17.1 → 0.17.3
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 +55 -13
- package/dist/index.cjs +564 -364
- package/dist/index.d.ts +507 -333
- package/dist/index.js +564 -364
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -113,12 +113,11 @@ type ResponseType$1 = {
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* @summary
|
|
117
116
|
* Create an instance of Scene class with a given scene id and optional attributes and session credentials.
|
|
118
117
|
*
|
|
119
|
-
* @
|
|
118
|
+
* @example
|
|
120
119
|
* ```ts
|
|
121
|
-
* await new Scene(topia, "sceneId", {
|
|
120
|
+
* const scene = await new Scene(topia, "sceneId", {
|
|
122
121
|
* attributes: { name: "My Scene" },
|
|
123
122
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
124
123
|
* });
|
|
@@ -128,10 +127,9 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
128
127
|
readonly id: string;
|
|
129
128
|
constructor(topia: Topia, id: string, options?: SceneOptionalInterface);
|
|
130
129
|
/**
|
|
131
|
-
*
|
|
132
|
-
* Retrieves scene details.
|
|
130
|
+
* Retrieves scene details and assigns response data to the instance.
|
|
133
131
|
*
|
|
134
|
-
* @
|
|
132
|
+
* @example
|
|
135
133
|
* ```ts
|
|
136
134
|
* await scene.fetchSceneById();
|
|
137
135
|
* const { name } = scene;
|
|
@@ -141,12 +139,11 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
/**
|
|
144
|
-
* @summary
|
|
145
142
|
* Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.
|
|
146
143
|
*
|
|
147
|
-
* @
|
|
144
|
+
* @example
|
|
148
145
|
* ```ts
|
|
149
|
-
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
146
|
+
* const droppedAsset = await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
150
147
|
* attributes: { text: "My Dropped Asset" },
|
|
151
148
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
152
149
|
* });
|
|
@@ -166,10 +163,9 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
166
163
|
urlSlug: string;
|
|
167
164
|
constructor(topia: Topia, id: string, urlSlug: string, options?: DroppedAssetOptionalInterface);
|
|
168
165
|
/**
|
|
169
|
-
*
|
|
170
|
-
* Retrieves dropped asset details.
|
|
166
|
+
* Retrieves dropped asset details and assigns response data to the instance.
|
|
171
167
|
*
|
|
172
|
-
* @
|
|
168
|
+
* @example
|
|
173
169
|
* ```ts
|
|
174
170
|
* await droppedAsset.fetchDroppedAssetById();
|
|
175
171
|
* const { assetName } = droppedAsset;
|
|
@@ -177,10 +173,9 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
177
173
|
*/
|
|
178
174
|
fetchDroppedAssetById(): Promise<void | ResponseType$1>;
|
|
179
175
|
/**
|
|
180
|
-
*
|
|
181
|
-
* Updates dropped asset details.
|
|
176
|
+
* Updates dropped asset details and assigns the response data to the instance. Requires Public Key to have the `canUpdateDroppedAssets` permission.
|
|
182
177
|
*
|
|
183
|
-
* @
|
|
178
|
+
* @example
|
|
184
179
|
* ```ts
|
|
185
180
|
* const payload = {
|
|
186
181
|
* assetScale: 1,
|
|
@@ -209,36 +204,46 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
209
204
|
*/
|
|
210
205
|
updateDroppedAsset({ assetScale, audioRadius, audioSliderVolume, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isInteractive, isTextTopLayer, isVideo, interactivePublicKey, layer0, layer1, mediaLink, mediaName, mediaType, portalName, position, specialType, syncUserMedia, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }: UpdateDroppedAssetInterface): Promise<void | ResponseType$1>;
|
|
211
206
|
/**
|
|
212
|
-
*
|
|
213
|
-
* Delete dropped asset.
|
|
207
|
+
* Deletes the dropped asset (removes it from the world).
|
|
214
208
|
*
|
|
215
|
-
* @
|
|
209
|
+
* @example
|
|
216
210
|
* ```ts
|
|
217
211
|
* await droppedAsset.deleteDroppedAsset();
|
|
218
212
|
* ```
|
|
219
213
|
*/
|
|
220
214
|
deleteDroppedAsset(): Promise<void | ResponseType$1>;
|
|
221
215
|
/**
|
|
222
|
-
* @summary
|
|
223
216
|
* Retrieves the data object for a dropped asset.
|
|
224
217
|
*
|
|
225
|
-
* @
|
|
218
|
+
* @category Data Objects
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
226
221
|
* ```ts
|
|
227
222
|
* const dataObject = await droppedAsset.fetchDataObject();
|
|
228
223
|
* ```
|
|
224
|
+
*
|
|
225
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
229
226
|
*/
|
|
230
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
227
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
231
228
|
/**
|
|
232
|
-
*
|
|
233
|
-
* Sets the data object for a dropped asset.
|
|
229
|
+
* Sets the data object for a dropped asset and assigns the response data to the instance.
|
|
234
230
|
*
|
|
231
|
+
* @remarks
|
|
235
232
|
* 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
233
|
*
|
|
237
|
-
* @
|
|
234
|
+
* @category Data Objects
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
238
237
|
* ```ts
|
|
239
|
-
* await droppedAsset.setDataObject(
|
|
240
|
-
*
|
|
241
|
-
*
|
|
238
|
+
* await droppedAsset.setDataObject(
|
|
239
|
+
* { resetCount: 0 },
|
|
240
|
+
* {
|
|
241
|
+
* analytics: [{ analyticName: "resets"} ],
|
|
242
|
+
* lock: { lockId: `${assetId}-${resetCount}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
243
|
+
* },
|
|
244
|
+
* );
|
|
245
|
+
*
|
|
246
|
+
* const { resetCount } = droppedAsset.dataObject;
|
|
242
247
|
* ```
|
|
243
248
|
*/
|
|
244
249
|
setDataObject(dataObject: object, options?: {
|
|
@@ -253,16 +258,21 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
253
258
|
};
|
|
254
259
|
}): Promise<void | ResponseType$1>;
|
|
255
260
|
/**
|
|
256
|
-
*
|
|
257
|
-
* Updates the data object for a dropped asset.
|
|
261
|
+
* Updates the data object for a dropped asset and assigns the response data to the instance.
|
|
258
262
|
*
|
|
263
|
+
* @remarks
|
|
259
264
|
* 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
|
|
260
265
|
*
|
|
261
|
-
* @
|
|
266
|
+
* @category Data Objects
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
262
269
|
* ```ts
|
|
263
270
|
* await droppedAsset.updateDataObject({
|
|
264
|
-
*
|
|
271
|
+
* [`profiles.${profileId}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
272
|
+
* [`profileMapper.${profileId}`]: username,
|
|
265
273
|
* });
|
|
274
|
+
*
|
|
275
|
+
* const { profiles } = droppedAsset.dataObject;
|
|
266
276
|
* ```
|
|
267
277
|
*/
|
|
268
278
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -277,12 +287,14 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
277
287
|
};
|
|
278
288
|
}): Promise<void | ResponseType$1>;
|
|
279
289
|
/**
|
|
280
|
-
* @summary
|
|
281
290
|
* 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.
|
|
282
291
|
*
|
|
292
|
+
* @remarks
|
|
283
293
|
* 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
|
|
284
294
|
*
|
|
285
|
-
* @
|
|
295
|
+
* @category Data Objects
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
286
298
|
* ```ts
|
|
287
299
|
* await droppedAsset.incrementDataObjectValue("key", 1);
|
|
288
300
|
* ```
|
|
@@ -299,10 +311,9 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
299
311
|
};
|
|
300
312
|
}): Promise<void | ResponseType$1>;
|
|
301
313
|
/**
|
|
302
|
-
* @summary
|
|
303
314
|
* Updates broadcast options for a dropped asset.
|
|
304
315
|
*
|
|
305
|
-
* @
|
|
316
|
+
* @example
|
|
306
317
|
* ```ts
|
|
307
318
|
* await droppedAsset.updateBroadcast({
|
|
308
319
|
* assetBroadcast: true,
|
|
@@ -310,13 +321,14 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
310
321
|
* broadcasterEmail: "example@email.com"
|
|
311
322
|
* });
|
|
312
323
|
* ```
|
|
324
|
+
*
|
|
325
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
313
326
|
*/
|
|
314
327
|
updateBroadcast({ assetBroadcast, assetBroadcastAll, broadcasterEmail, }: UpdateBroadcastInterface): Promise<void | ResponseType$1>;
|
|
315
328
|
/**
|
|
316
|
-
* @summary
|
|
317
329
|
* Updates click options for a dropped asset.
|
|
318
330
|
*
|
|
319
|
-
* @
|
|
331
|
+
* @example
|
|
320
332
|
* ```ts
|
|
321
333
|
* await droppedAsset.updateClickType({
|
|
322
334
|
* "clickType": "portal",
|
|
@@ -331,13 +343,14 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
331
343
|
* "portalName": "community"
|
|
332
344
|
* });
|
|
333
345
|
* ```
|
|
346
|
+
*
|
|
347
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
334
348
|
*/
|
|
335
349
|
updateClickType({ clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, isForceLinkInIframe, isOpenLinkInDrawer, portalName, position, }: UpdateClickTypeInterface): Promise<void | ResponseType$1>;
|
|
336
350
|
/**
|
|
337
|
-
* @summary
|
|
338
351
|
* Adds an array of links to an asset. Maximum is 20 links.
|
|
339
352
|
*
|
|
340
|
-
* @
|
|
353
|
+
* @example
|
|
341
354
|
* ```ts
|
|
342
355
|
* await droppedAsset.setClickableLinkMulti({
|
|
343
356
|
* clickableLinks: [
|
|
@@ -356,14 +369,17 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
356
369
|
* ],
|
|
357
370
|
* });
|
|
358
371
|
* ```
|
|
372
|
+
*
|
|
373
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
359
374
|
*/
|
|
360
375
|
setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType$1>;
|
|
361
376
|
/**
|
|
362
|
-
* @summary
|
|
363
377
|
* Updates multiple clickable links for a dropped asset.
|
|
378
|
+
*
|
|
379
|
+
* @remarks
|
|
364
380
|
* Pass in an 'existingLinkId' to edit an existing link.
|
|
365
381
|
*
|
|
366
|
-
* @
|
|
382
|
+
* @example
|
|
367
383
|
* ```ts
|
|
368
384
|
* await droppedAsset.updateClickableLinkMulti({
|
|
369
385
|
* clickableLink: "https://example.com",
|
|
@@ -373,23 +389,25 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
373
389
|
* existingLinkId: "abcd"
|
|
374
390
|
* });
|
|
375
391
|
* ```
|
|
392
|
+
*
|
|
393
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
376
394
|
*/
|
|
377
395
|
updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType$1>;
|
|
378
396
|
/**
|
|
379
|
-
* @summary
|
|
380
397
|
* Removes a clickable link from a dropped asset.
|
|
381
398
|
*
|
|
382
|
-
* @
|
|
399
|
+
* @example
|
|
383
400
|
* ```ts
|
|
384
401
|
* await droppedAsset.removeClickableLink({ linkId: "link-id" });
|
|
385
402
|
* ```
|
|
403
|
+
*
|
|
404
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
386
405
|
*/
|
|
387
406
|
removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType$1>;
|
|
388
407
|
/**
|
|
389
|
-
* @summary
|
|
390
408
|
* Updates text and style of a dropped asset.
|
|
391
409
|
*
|
|
392
|
-
* @
|
|
410
|
+
* @example
|
|
393
411
|
* ```ts
|
|
394
412
|
* const style = {
|
|
395
413
|
* "textColor": "#abc123",
|
|
@@ -400,13 +418,14 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
400
418
|
* };
|
|
401
419
|
* await droppedAsset.updateCustomTextAsset(style, "hello world");
|
|
402
420
|
* ```
|
|
421
|
+
*
|
|
422
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
403
423
|
*/
|
|
404
424
|
updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType$1>;
|
|
405
425
|
/**
|
|
406
|
-
* @summary
|
|
407
426
|
* Updates media options for a dropped asset.
|
|
408
427
|
*
|
|
409
|
-
* @
|
|
428
|
+
* @example
|
|
410
429
|
* ```ts
|
|
411
430
|
* await droppedAsset.updateMediaType({
|
|
412
431
|
* "mediaType": "link",
|
|
@@ -419,23 +438,25 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
419
438
|
* "mediaName": "string"
|
|
420
439
|
* });
|
|
421
440
|
* ```
|
|
441
|
+
*
|
|
442
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
422
443
|
*/
|
|
423
444
|
updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType$1>;
|
|
424
445
|
/**
|
|
425
|
-
* @summary
|
|
426
446
|
* Updates mute zone options for a dropped asset.
|
|
427
447
|
*
|
|
428
|
-
* @
|
|
448
|
+
* @example
|
|
429
449
|
* ```ts
|
|
430
450
|
* await droppedAsset.updateMuteZone(true);
|
|
431
451
|
* ```
|
|
452
|
+
*
|
|
453
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
432
454
|
*/
|
|
433
455
|
updateMuteZone(isMutezone: boolean): Promise<void | ResponseType$1>;
|
|
434
456
|
/**
|
|
435
|
-
* @summary
|
|
436
457
|
* Updates landmark zone options for a dropped asset.
|
|
437
458
|
*
|
|
438
|
-
* @
|
|
459
|
+
* @example
|
|
439
460
|
* ```ts
|
|
440
461
|
* await droppedAsset.updateLandmarkZone({
|
|
441
462
|
* isLandmarkZoneEnabled: true,
|
|
@@ -443,6 +464,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
443
464
|
* landmarkZoneIsVisible: true,
|
|
444
465
|
*});
|
|
445
466
|
* ```
|
|
467
|
+
*
|
|
468
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
446
469
|
*/
|
|
447
470
|
updateLandmarkZone({ isLandmarkZoneEnabled, landmarkZoneName, landmarkZoneIsVisible, }: {
|
|
448
471
|
isLandmarkZoneEnabled: boolean;
|
|
@@ -450,30 +473,31 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
450
473
|
landmarkZoneIsVisible?: boolean;
|
|
451
474
|
}): Promise<void | ResponseType$1>;
|
|
452
475
|
/**
|
|
453
|
-
* @summary
|
|
454
476
|
* Updates webhook zone options for a dropped asset.
|
|
455
477
|
*
|
|
456
|
-
* @
|
|
478
|
+
* @example
|
|
457
479
|
* ```ts
|
|
458
480
|
* await droppedAsset.updateWebhookZone(true);
|
|
459
481
|
* ```
|
|
482
|
+
*
|
|
483
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
460
484
|
*/
|
|
461
485
|
updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType$1>;
|
|
462
486
|
/**
|
|
463
|
-
* @summary
|
|
464
487
|
* Moves a dropped asset to specified coordinates.
|
|
465
488
|
*
|
|
466
|
-
* @
|
|
489
|
+
* @example
|
|
467
490
|
* ```ts
|
|
468
|
-
* await droppedAsset.updatePosition(100,200);
|
|
491
|
+
* await droppedAsset.updatePosition(100, 200, 100);
|
|
469
492
|
* ```
|
|
493
|
+
*
|
|
494
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
470
495
|
*/
|
|
471
496
|
updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType$1>;
|
|
472
497
|
/**
|
|
473
|
-
* @summary
|
|
474
498
|
* Updates private zone options for a dropped asset.
|
|
475
499
|
*
|
|
476
|
-
* @
|
|
500
|
+
* @example
|
|
477
501
|
* ```ts
|
|
478
502
|
* await droppedAsset.updatePrivateZone({
|
|
479
503
|
* "isPrivateZone": false,
|
|
@@ -481,53 +505,58 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
481
505
|
* "privateZoneUserCap": 10
|
|
482
506
|
* });
|
|
483
507
|
* ```
|
|
508
|
+
*
|
|
509
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
484
510
|
*/
|
|
485
511
|
updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType$1>;
|
|
486
512
|
/**
|
|
487
|
-
* @summary
|
|
488
513
|
* Updates the size of a dropped asset.
|
|
489
514
|
*
|
|
490
|
-
* @
|
|
515
|
+
* @example
|
|
491
516
|
* ```ts
|
|
492
517
|
* await droppedAsset.assetScale(.5);
|
|
493
518
|
* ```
|
|
519
|
+
*
|
|
520
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
494
521
|
*/
|
|
495
522
|
updateScale(assetScale: number): Promise<void | ResponseType$1>;
|
|
496
523
|
/**
|
|
497
|
-
* @summary
|
|
498
524
|
* Flip an dropped asset.
|
|
499
525
|
*
|
|
500
|
-
* @
|
|
526
|
+
* @example
|
|
501
527
|
* ```ts
|
|
502
528
|
* await droppedAsset.flip(.5);
|
|
503
529
|
* ```
|
|
530
|
+
*
|
|
531
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
504
532
|
*/
|
|
505
533
|
flip(): Promise<void | ResponseType$1>;
|
|
506
534
|
/**
|
|
507
|
-
* @summary
|
|
508
535
|
* Change or remove media embedded in a dropped asset.
|
|
509
536
|
*
|
|
510
|
-
* @
|
|
537
|
+
* @example
|
|
511
538
|
* ```ts
|
|
512
539
|
* await droppedAsset.updateUploadedMediaSelected("LVWyxwNxI96eLjnXWwYO");
|
|
513
540
|
* ```
|
|
541
|
+
*
|
|
542
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
514
543
|
*/
|
|
515
544
|
updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType$1>;
|
|
516
545
|
/**
|
|
517
|
-
* @summary
|
|
518
546
|
* Change or remove top and bottom layers of a dropped asset.
|
|
519
547
|
*
|
|
520
|
-
* @
|
|
548
|
+
* @example
|
|
521
549
|
* ```ts
|
|
522
550
|
* await droppedAsset.updateWebImageLayers("","https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg");
|
|
523
551
|
* ```
|
|
552
|
+
*
|
|
553
|
+
* @returns {Promise<void | ResponseType>} Returns the updated dropped asset or an error.
|
|
524
554
|
*/
|
|
525
555
|
updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType$1>;
|
|
526
556
|
/**
|
|
527
|
-
* @summary
|
|
528
557
|
* Add a webhook to a dropped asset
|
|
529
558
|
*
|
|
530
|
-
* @
|
|
559
|
+
* @example
|
|
531
560
|
* ```ts
|
|
532
561
|
* await droppedAsset.addWebhook({
|
|
533
562
|
* dataObject: {},
|
|
@@ -539,6 +568,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
539
568
|
* url: "https://url.com",
|
|
540
569
|
* });
|
|
541
570
|
* ```
|
|
571
|
+
*
|
|
572
|
+
* @returns {Promise<void | ResponseType>} Returns the new `webhookId` or an error.
|
|
542
573
|
*/
|
|
543
574
|
addWebhook({ dataObject, description, isUniqueOnly, shouldSetClickType, shouldSetIsInteractive, title, type, url, }: {
|
|
544
575
|
dataObject: object;
|
|
@@ -551,10 +582,9 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
551
582
|
url: string;
|
|
552
583
|
}): Promise<void | AxiosResponse>;
|
|
553
584
|
/**
|
|
554
|
-
* @summary
|
|
555
585
|
* Set the interactive settings on a dropped asset
|
|
556
586
|
*
|
|
557
|
-
* @
|
|
587
|
+
* @example
|
|
558
588
|
* ```ts
|
|
559
589
|
* await droppedAsset.setInteractiveSettings({
|
|
560
590
|
* isInteractive: true,
|
|
@@ -567,10 +597,9 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
567
597
|
interactivePublicKey: string;
|
|
568
598
|
}): Promise<void | ResponseType$1>;
|
|
569
599
|
/**
|
|
570
|
-
* @summary
|
|
571
600
|
* Retrieve analytics for a dropped asset by day, week, month, quarter, or year
|
|
572
601
|
*
|
|
573
|
-
* @
|
|
602
|
+
* @example
|
|
574
603
|
* ```ts
|
|
575
604
|
* const analytics = await droppedAsset.fetchDroppedAssetAnalytics({
|
|
576
605
|
* periodType: "quarter",
|
|
@@ -578,6 +607,8 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
578
607
|
* year: 2023,
|
|
579
608
|
* });
|
|
580
609
|
* ```
|
|
610
|
+
*
|
|
611
|
+
* @returns {Promise<void | ResponseType>} Returns the analytics data or an error.
|
|
581
612
|
*/
|
|
582
613
|
fetchDroppedAssetAnalytics({ periodType, dateValue, year, }: {
|
|
583
614
|
periodType: "week" | "month" | "quarter" | "year";
|
|
@@ -587,12 +618,11 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
587
618
|
}
|
|
588
619
|
|
|
589
620
|
/**
|
|
590
|
-
* @summary
|
|
591
621
|
* Create an instance of World class with a given url slug and optional attributes and session credentials.
|
|
592
622
|
*
|
|
593
|
-
* @
|
|
623
|
+
* @example
|
|
594
624
|
* ```ts
|
|
595
|
-
* await new World(topia, "exampleWorld", {
|
|
625
|
+
* const world = await new World(topia, "exampleWorld", {
|
|
596
626
|
* attributes: { name: "Example World" },
|
|
597
627
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
598
628
|
* });
|
|
@@ -610,10 +640,9 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
610
640
|
[key: string]: DroppedAsset;
|
|
611
641
|
};
|
|
612
642
|
/**
|
|
613
|
-
* @summary
|
|
614
643
|
* Retrieves details of a world.
|
|
615
644
|
*
|
|
616
|
-
* @
|
|
645
|
+
* @example
|
|
617
646
|
* ```ts
|
|
618
647
|
* await world.fetchDetails();
|
|
619
648
|
* const { name } = world;
|
|
@@ -621,10 +650,9 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
621
650
|
*/
|
|
622
651
|
fetchDetails(): Promise<void | ResponseType$1>;
|
|
623
652
|
/**
|
|
624
|
-
* @summary
|
|
625
653
|
* Update details of a world.
|
|
626
654
|
*
|
|
627
|
-
* @
|
|
655
|
+
* @example
|
|
628
656
|
* ```ts
|
|
629
657
|
* await world.updateDetails({
|
|
630
658
|
* controls: {
|
|
@@ -640,14 +668,15 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
640
668
|
* spawnPosition: { x: 100, y: 100 },
|
|
641
669
|
* width: 2000
|
|
642
670
|
* });
|
|
671
|
+
*
|
|
672
|
+
* const { name, description } = world;
|
|
643
673
|
* ```
|
|
644
674
|
*/
|
|
645
675
|
updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType$1>;
|
|
646
676
|
/**
|
|
647
|
-
* @summary
|
|
648
677
|
* Set close world settings
|
|
649
678
|
*
|
|
650
|
-
* @
|
|
679
|
+
* @example
|
|
651
680
|
* ```ts
|
|
652
681
|
* await world.updateCloseWorldSettings({
|
|
653
682
|
* controls: {
|
|
@@ -664,16 +693,19 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
664
693
|
* width: 2000
|
|
665
694
|
* });
|
|
666
695
|
* ```
|
|
696
|
+
*
|
|
697
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
667
698
|
*/
|
|
668
699
|
updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }: {
|
|
669
700
|
closeWorldDescription: string;
|
|
670
701
|
isWorldClosed: boolean;
|
|
671
702
|
}): Promise<void | ResponseType$1>;
|
|
672
703
|
/**
|
|
673
|
-
* @summary
|
|
674
704
|
* Retrieve all assets dropped in a world.
|
|
675
705
|
*
|
|
676
|
-
* @
|
|
706
|
+
* @category Dropped Assets
|
|
707
|
+
*
|
|
708
|
+
* @example
|
|
677
709
|
* ```ts
|
|
678
710
|
* await world.fetchDroppedAssets();
|
|
679
711
|
* const assets = world.droppedAssets;
|
|
@@ -681,13 +713,16 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
681
713
|
*/
|
|
682
714
|
fetchDroppedAssets(): Promise<void | ResponseType$1>;
|
|
683
715
|
/**
|
|
684
|
-
* @summary
|
|
685
716
|
* Retrieve all assets dropped in a world matching uniqueName.
|
|
686
717
|
*
|
|
687
|
-
* @
|
|
718
|
+
* @category Dropped Assets
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
688
721
|
* ```ts
|
|
689
|
-
* const droppedAssets = await world.fetchDroppedAssetsWithUniqueName({
|
|
722
|
+
* const droppedAssets = await world.fetchDroppedAssetsWithUniqueName({ uniqueName: "exampleUniqueName", isPartial: true });
|
|
690
723
|
* ```
|
|
724
|
+
*
|
|
725
|
+
* @returns {Promise<DroppedAsset[]>} Returns an array of DroppedAsset instances.
|
|
691
726
|
*/
|
|
692
727
|
fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial, isReversed, }: {
|
|
693
728
|
uniqueName: string;
|
|
@@ -695,36 +730,30 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
695
730
|
isReversed?: boolean;
|
|
696
731
|
}): Promise<DroppedAsset[]>;
|
|
697
732
|
/**
|
|
698
|
-
* @summary
|
|
699
|
-
* Retrieve all landmark zone assets dropped in a world.
|
|
700
|
-
*
|
|
701
|
-
* @usage
|
|
702
|
-
* ```ts
|
|
703
|
-
* const zones = await world.fetchLandmarkZones("optionalLandmarkZoneName", "optionalSceneDropIdExample");
|
|
704
|
-
* ```
|
|
705
|
-
*/
|
|
706
|
-
fetchLandmarkZones(landmarkZoneName?: string, sceneDropId?: string): Promise<DroppedAsset[]>;
|
|
707
|
-
/**
|
|
708
|
-
* @summary
|
|
709
733
|
* Retrieve all assets dropped in a world matching sceneDropId.
|
|
710
734
|
*
|
|
711
|
-
* @
|
|
735
|
+
* @category Dropped Assets
|
|
736
|
+
*
|
|
737
|
+
* @example
|
|
712
738
|
* ```ts
|
|
713
739
|
* const droppedAssets = await world.fetchDroppedAssetsBySceneDropId({
|
|
714
740
|
* sceneDropId: "sceneDropIdExample",
|
|
715
741
|
* uniqueName: "optionalUniqueNameExample",
|
|
716
742
|
* });
|
|
717
743
|
* ```
|
|
744
|
+
*
|
|
745
|
+
* @returns {Promise<DroppedAsset[]>} Returns an array of DroppedAsset instances.
|
|
718
746
|
*/
|
|
719
747
|
fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }: {
|
|
720
748
|
sceneDropId: string;
|
|
721
749
|
uniqueName?: string;
|
|
722
750
|
}): Promise<DroppedAsset[]>;
|
|
723
751
|
/**
|
|
724
|
-
* @summary
|
|
725
752
|
* Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
|
|
726
753
|
*
|
|
727
|
-
* @
|
|
754
|
+
* @category Dropped Assets
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
728
757
|
* ```ts
|
|
729
758
|
* const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]];
|
|
730
759
|
* const style = {
|
|
@@ -737,37 +766,50 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
737
766
|
* await world.updateCustomText(droppedAssetsToUpdate, style);
|
|
738
767
|
* ```
|
|
739
768
|
*
|
|
740
|
-
* @
|
|
769
|
+
* @returns
|
|
741
770
|
* Updates each DroppedAsset instance and world.droppedAssets map.
|
|
742
771
|
*/
|
|
743
772
|
updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
|
|
773
|
+
/**
|
|
774
|
+
* Retrieve all landmark zone assets dropped in a world.
|
|
775
|
+
*
|
|
776
|
+
* @category Dropped Assets
|
|
777
|
+
*
|
|
778
|
+
* @example
|
|
779
|
+
* ```ts
|
|
780
|
+
* const zones = await world.fetchLandmarkZones("optionalLandmarkZoneName", "optionalSceneDropIdExample");
|
|
781
|
+
* ```
|
|
782
|
+
*
|
|
783
|
+
* @returns {Promise<DroppedAsset[]>} Returns an array of DroppedAsset instances.
|
|
784
|
+
*/
|
|
785
|
+
fetchLandmarkZones(landmarkZoneName?: string, sceneDropId?: string): Promise<DroppedAsset[]>;
|
|
744
786
|
/**
|
|
745
787
|
* @deprecated Use {@link fetchScenes} instead.
|
|
746
788
|
*
|
|
747
|
-
* @summary
|
|
748
789
|
* Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
|
|
749
790
|
*
|
|
750
|
-
* @
|
|
791
|
+
* @example
|
|
751
792
|
* ```ts
|
|
752
793
|
* await world.fetchSceneDropIds();
|
|
753
794
|
* ```
|
|
754
795
|
*
|
|
755
|
-
* @
|
|
796
|
+
* @returns
|
|
756
797
|
* ```ts
|
|
757
798
|
* { sceneDropIds: [] }
|
|
758
799
|
* ```
|
|
759
800
|
*/
|
|
760
801
|
fetchSceneDropIds(): Promise<object | ResponseType$1>;
|
|
761
802
|
/**
|
|
762
|
-
* @summary
|
|
763
803
|
* Fetch a list of all scene drop ids and dropped assets in a world
|
|
764
804
|
*
|
|
765
|
-
* @
|
|
805
|
+
* @category Scenes
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
766
808
|
* ```ts
|
|
767
809
|
* await world.fetchScenes();
|
|
768
810
|
* ```
|
|
769
811
|
*
|
|
770
|
-
* @
|
|
812
|
+
* @returns
|
|
771
813
|
* ```ts
|
|
772
814
|
* { "scenes": {
|
|
773
815
|
* "sceneDropId_1": {
|
|
@@ -788,10 +830,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
788
830
|
*/
|
|
789
831
|
fetchScenes(): Promise<object | ResponseType$1>;
|
|
790
832
|
/**
|
|
791
|
-
* @summary
|
|
792
833
|
* Drops a scene in a world and returns sceneDropId.
|
|
793
834
|
*
|
|
794
|
-
* @
|
|
835
|
+
* @category Scenes
|
|
836
|
+
*
|
|
837
|
+
* @example
|
|
795
838
|
* ```ts
|
|
796
839
|
* await world.dropScene({
|
|
797
840
|
* "sceneId": "string",
|
|
@@ -803,7 +846,7 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
803
846
|
* });
|
|
804
847
|
* ```
|
|
805
848
|
*
|
|
806
|
-
* @
|
|
849
|
+
* @returns
|
|
807
850
|
* ```ts
|
|
808
851
|
* { sceneDropId: sceneId-timestamp, success: true }
|
|
809
852
|
* ```
|
|
@@ -816,10 +859,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
816
859
|
sceneId: string;
|
|
817
860
|
}): Promise<ResponseType$1>;
|
|
818
861
|
/**
|
|
819
|
-
* @summary
|
|
820
862
|
* Replace the current scene of a world.
|
|
821
863
|
*
|
|
822
|
-
* @
|
|
864
|
+
* @category Scenes
|
|
865
|
+
*
|
|
866
|
+
* @example
|
|
823
867
|
* ```ts
|
|
824
868
|
* const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]]
|
|
825
869
|
* const style = {
|
|
@@ -831,26 +875,36 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
831
875
|
* }
|
|
832
876
|
* await world.replaceScene(SCENE_ID);
|
|
833
877
|
* ```
|
|
878
|
+
*
|
|
879
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
834
880
|
*/
|
|
835
881
|
replaceScene(sceneId: string): Promise<void | ResponseType$1>;
|
|
836
882
|
/**
|
|
837
|
-
* @summary
|
|
838
883
|
* Get all particles available
|
|
839
884
|
*
|
|
840
|
-
* @
|
|
885
|
+
* @category Particles
|
|
886
|
+
*
|
|
887
|
+
* @example
|
|
841
888
|
* ```ts
|
|
842
889
|
* await world.getAllParticles();
|
|
890
|
+
*
|
|
891
|
+
* @returns {Promise<ResponseType>} Returns an array of particles or an error response.
|
|
843
892
|
* ```
|
|
844
893
|
*/
|
|
845
894
|
getAllParticles(): Promise<object | ResponseType$1>;
|
|
846
895
|
/**
|
|
847
|
-
* @summary
|
|
848
896
|
* Trigger a particle effect at a position in the world
|
|
849
897
|
*
|
|
850
|
-
* @
|
|
898
|
+
* @category Particles
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
851
901
|
* ```ts
|
|
852
|
-
* await
|
|
902
|
+
* const droppedAsset = await DroppedAsset.get(assetId, urlSlug, { credentials });
|
|
903
|
+
*
|
|
904
|
+
* await world.triggerParticle({ name: "Flame", duration: 5, position: droppedAsset.position });
|
|
853
905
|
* ```
|
|
906
|
+
*
|
|
907
|
+
* @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
|
|
854
908
|
*/
|
|
855
909
|
triggerParticle({ id, name, duration, position, }: {
|
|
856
910
|
id?: string;
|
|
@@ -859,14 +913,15 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
859
913
|
position?: object;
|
|
860
914
|
}): Promise<ResponseType$1 | string>;
|
|
861
915
|
/**
|
|
862
|
-
* @summary
|
|
863
916
|
* Add an activity to a world
|
|
864
917
|
* excludeFromNotification is an array of visitorIds to exclude from the notification
|
|
865
918
|
*
|
|
866
|
-
* @
|
|
919
|
+
* @example
|
|
867
920
|
* ```ts
|
|
868
921
|
* await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
|
|
869
922
|
* ```
|
|
923
|
+
*
|
|
924
|
+
* @returns {Promise<ResponseType | string>} Returns the `activityId` or an error response.
|
|
870
925
|
*/
|
|
871
926
|
triggerActivity({ type, assetId, excludeFromNotification, }: {
|
|
872
927
|
type: WorldActivityType;
|
|
@@ -874,10 +929,9 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
874
929
|
excludeFromNotification?: (string | number)[];
|
|
875
930
|
}): Promise<ResponseType$1 | string>;
|
|
876
931
|
/**
|
|
877
|
-
* @summary
|
|
878
932
|
* Display a message via a toast to all visitors currently in a world.
|
|
879
933
|
*
|
|
880
|
-
* @
|
|
934
|
+
* @example
|
|
881
935
|
* ```ts
|
|
882
936
|
* await world.fireToast({
|
|
883
937
|
* groupId: "custom-message",
|
|
@@ -885,31 +939,40 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
885
939
|
* text: "Thank you for participating!",
|
|
886
940
|
* });
|
|
887
941
|
* ```
|
|
942
|
+
*
|
|
943
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
888
944
|
*/
|
|
889
945
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
890
946
|
/**
|
|
891
|
-
* @summary
|
|
892
947
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
893
948
|
*
|
|
894
|
-
* @
|
|
949
|
+
* @category Data Objects
|
|
950
|
+
*
|
|
951
|
+
* @example
|
|
895
952
|
* ```ts
|
|
896
953
|
* await world.fetchDataObject();
|
|
897
954
|
* const { dataObject } = world;
|
|
898
955
|
* ```
|
|
899
956
|
*/
|
|
900
|
-
fetchDataObject: (appPublicKey?: string, appJWT?: string) => Promise<void | ResponseType$1>;
|
|
957
|
+
fetchDataObject: (appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string) => Promise<void | ResponseType$1>;
|
|
901
958
|
/**
|
|
902
|
-
* @summary
|
|
903
959
|
* Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
|
|
904
960
|
*
|
|
961
|
+
* @remarks
|
|
905
962
|
* 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
|
|
906
963
|
*
|
|
907
|
-
* @
|
|
964
|
+
* @category Data Objects
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
908
967
|
* ```ts
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
968
|
+
await world.setDataObject(
|
|
969
|
+
{
|
|
970
|
+
...defaultGameData,
|
|
971
|
+
keyAssetId: droppedAsset.id,
|
|
972
|
+
},
|
|
973
|
+
{ lock: { lock: { lockId: `${keyAssetId}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` }, releaseLock: true } },
|
|
974
|
+
);
|
|
975
|
+
* const { profileMapper } = world.dataObject;
|
|
913
976
|
* ```
|
|
914
977
|
*/
|
|
915
978
|
setDataObject: (dataObject: object | null | undefined, options?: {
|
|
@@ -924,17 +987,20 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
924
987
|
};
|
|
925
988
|
}) => Promise<void | ResponseType$1>;
|
|
926
989
|
/**
|
|
927
|
-
* @summary
|
|
928
990
|
* Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
929
991
|
*
|
|
992
|
+
* @remarks
|
|
930
993
|
* 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
|
|
931
994
|
*
|
|
932
|
-
* @
|
|
995
|
+
* @category Data Objects
|
|
996
|
+
*
|
|
997
|
+
* @example
|
|
933
998
|
* ```ts
|
|
934
999
|
* await world.updateDataObject({
|
|
935
|
-
*
|
|
1000
|
+
* [`keyAssets.${keyAssetId}.itemsCollectedByUser.${profileId}`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
1001
|
+
* [`profileMapper.${profileId}`]: username,
|
|
936
1002
|
* });
|
|
937
|
-
* const {
|
|
1003
|
+
* const { profileMapper } = world.dataObject;
|
|
938
1004
|
* ```
|
|
939
1005
|
*/
|
|
940
1006
|
updateDataObject: (dataObject: object, options?: {
|
|
@@ -949,14 +1015,16 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
949
1015
|
};
|
|
950
1016
|
}) => Promise<void | ResponseType$1>;
|
|
951
1017
|
/**
|
|
952
|
-
* @summary
|
|
953
1018
|
* 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.
|
|
954
1019
|
*
|
|
1020
|
+
* @remarks
|
|
955
1021
|
* 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
|
|
956
1022
|
*
|
|
957
|
-
* @
|
|
1023
|
+
* @category Data Objects
|
|
1024
|
+
*
|
|
1025
|
+
* @example
|
|
958
1026
|
* ```ts
|
|
959
|
-
* await world.incrementDataObjectValue(
|
|
1027
|
+
* await world.incrementDataObjectValue([`keyAssets.${keyAssetId}.totalItemsCollected.count`], 1);
|
|
960
1028
|
* ```
|
|
961
1029
|
*/
|
|
962
1030
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -971,10 +1039,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
971
1039
|
};
|
|
972
1040
|
}): Promise<void | ResponseType$1>;
|
|
973
1041
|
/**
|
|
974
|
-
* @summary
|
|
975
1042
|
* Retrieve all webhooks in a world.
|
|
976
1043
|
*
|
|
977
|
-
* @
|
|
1044
|
+
* @category Webhooks
|
|
1045
|
+
*
|
|
1046
|
+
* @example
|
|
978
1047
|
* ```ts
|
|
979
1048
|
* await world.fetchWebhooks();
|
|
980
1049
|
* const webhooks = world.webhooks;
|
|
@@ -982,10 +1051,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
982
1051
|
*/
|
|
983
1052
|
fetchWebhooks(): Promise<void | ResponseType$1>;
|
|
984
1053
|
/**
|
|
985
|
-
* @summary
|
|
986
1054
|
* Retrieve world analytics by day, week, month, quarter, or year
|
|
987
1055
|
*
|
|
988
|
-
* @
|
|
1056
|
+
* @category Analytics
|
|
1057
|
+
*
|
|
1058
|
+
* @example
|
|
989
1059
|
* ```ts
|
|
990
1060
|
* const analytics = await world.fetchWorldAnalytics({
|
|
991
1061
|
* periodType: "week",
|
|
@@ -1002,12 +1072,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1002
1072
|
}
|
|
1003
1073
|
|
|
1004
1074
|
/**
|
|
1005
|
-
* @summary
|
|
1006
1075
|
* Create an instance of User class with optional session credentials.
|
|
1007
1076
|
*
|
|
1008
|
-
* @
|
|
1077
|
+
* @example
|
|
1009
1078
|
* ```ts
|
|
1010
|
-
* await new User(topia, {
|
|
1079
|
+
* const user = await new User(topia, {
|
|
1011
1080
|
* profileId: 1,
|
|
1012
1081
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
1013
1082
|
* });
|
|
@@ -1031,31 +1100,26 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1031
1100
|
get worlds(): {
|
|
1032
1101
|
[key: string]: World;
|
|
1033
1102
|
};
|
|
1034
|
-
/**
|
|
1035
|
-
* @summary
|
|
1036
|
-
* Verify user has valid interactive credentials
|
|
1037
|
-
*
|
|
1038
|
-
* @usage
|
|
1039
|
-
* ```ts
|
|
1040
|
-
* await user.checkInteractiveCredentials();
|
|
1041
|
-
* ```
|
|
1042
|
-
*/
|
|
1043
1103
|
checkInteractiveCredentials(): Promise<void | ResponseType$1>;
|
|
1044
1104
|
/**
|
|
1045
|
-
* @summary
|
|
1046
1105
|
* Returns all avatars owned by User
|
|
1047
1106
|
*
|
|
1048
|
-
* @
|
|
1107
|
+
* @category Avatars
|
|
1108
|
+
*
|
|
1109
|
+
* @example
|
|
1049
1110
|
* ```ts
|
|
1050
1111
|
* const avatars = await user.fetchAvatars();
|
|
1051
1112
|
* ```
|
|
1113
|
+
*
|
|
1114
|
+
* @returns {Promise<void | ResponseType>} Returns the avatars or an error.
|
|
1052
1115
|
*/
|
|
1053
1116
|
fetchAvatars(): Promise<void | ResponseType$1>;
|
|
1054
1117
|
/**
|
|
1055
|
-
* @summary
|
|
1056
1118
|
* Add a new avatar
|
|
1057
1119
|
*
|
|
1058
|
-
* @
|
|
1120
|
+
* @category Avatars
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1059
1123
|
* ```ts
|
|
1060
1124
|
* const animationMeta = {
|
|
1061
1125
|
* "emote": { "loop": false, "x": 0, "y": 0, "hideLoop": true }
|
|
@@ -1123,10 +1187,11 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1123
1187
|
*/
|
|
1124
1188
|
addAvatar(formData: FormData): Promise<void | ResponseType$1>;
|
|
1125
1189
|
/**
|
|
1126
|
-
* @summary
|
|
1127
1190
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1128
1191
|
*
|
|
1129
|
-
* @
|
|
1192
|
+
* @category Avatars
|
|
1193
|
+
*
|
|
1194
|
+
* @example
|
|
1130
1195
|
* ```ts
|
|
1131
1196
|
* const animationMeta = {
|
|
1132
1197
|
* "emote": { "loop": false, "x": 0, "y": 0, "hideLoop": true }
|
|
@@ -1194,20 +1259,22 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1194
1259
|
*/
|
|
1195
1260
|
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType$1>;
|
|
1196
1261
|
/**
|
|
1197
|
-
* @summary
|
|
1198
1262
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1199
1263
|
*
|
|
1200
|
-
* @
|
|
1264
|
+
* @category Avatars
|
|
1265
|
+
*
|
|
1266
|
+
* @example
|
|
1201
1267
|
* ```ts
|
|
1202
1268
|
* await user.deleteAvatar("exampleAvatarId");
|
|
1203
1269
|
* ```
|
|
1204
1270
|
*/
|
|
1205
1271
|
deleteAvatar(avatarId: string): Promise<void | ResponseType$1>;
|
|
1206
1272
|
/**
|
|
1207
|
-
* @summary
|
|
1208
1273
|
* Returns all assets owned by User when an email address is provided.
|
|
1209
1274
|
*
|
|
1210
|
-
* @
|
|
1275
|
+
* @category Assets
|
|
1276
|
+
*
|
|
1277
|
+
* @example
|
|
1211
1278
|
* ```ts
|
|
1212
1279
|
* await user.fetchAssets();
|
|
1213
1280
|
* const userAssets = user.assets;
|
|
@@ -1215,20 +1282,24 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1215
1282
|
*/
|
|
1216
1283
|
fetchAssets(): Promise<void | ResponseType$1>;
|
|
1217
1284
|
/**
|
|
1218
|
-
* @summary
|
|
1219
1285
|
* Returns all platform assets.
|
|
1220
1286
|
*
|
|
1221
|
-
* @
|
|
1287
|
+
* @category Assets
|
|
1288
|
+
*
|
|
1289
|
+
* @example
|
|
1222
1290
|
* ```ts
|
|
1223
1291
|
* const assets = await user.fetchPlatformAssets();
|
|
1224
1292
|
* ```
|
|
1293
|
+
*
|
|
1294
|
+
* @returns {Promise<object | ResponseType>} Returns the platform assets or an error response.
|
|
1225
1295
|
*/
|
|
1226
1296
|
fetchPlatformAssets(): Promise<object | ResponseType$1>;
|
|
1227
1297
|
/**
|
|
1228
|
-
* @summary
|
|
1229
1298
|
* Returns all scenes owned by User.
|
|
1230
1299
|
*
|
|
1231
|
-
* @
|
|
1300
|
+
* @category Scenes
|
|
1301
|
+
*
|
|
1302
|
+
* @example
|
|
1232
1303
|
* ```ts
|
|
1233
1304
|
* await user.fetchScenes();
|
|
1234
1305
|
* const userScenes = user.scenes;
|
|
@@ -1236,30 +1307,28 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1236
1307
|
*/
|
|
1237
1308
|
fetchScenes(): Promise<void | ResponseType$1>;
|
|
1238
1309
|
/**
|
|
1239
|
-
*
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
* and creates new map of Worlds accessible via user.worlds.
|
|
1310
|
+
* 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.
|
|
1311
|
+
*
|
|
1312
|
+
* @category Worlds
|
|
1243
1313
|
*
|
|
1244
|
-
* @
|
|
1314
|
+
* @example
|
|
1245
1315
|
* ```ts
|
|
1246
1316
|
* await user.fetchWorldsByKey();
|
|
1247
1317
|
* const userWorlds = user.worlds;
|
|
1248
1318
|
* ```
|
|
1249
1319
|
*
|
|
1250
|
-
* @
|
|
1320
|
+
* @returns
|
|
1251
1321
|
* ```ts
|
|
1252
1322
|
* { urlSlug: new World({ apiKey, worldArgs, urlSlug }) }
|
|
1253
1323
|
* ```
|
|
1254
1324
|
*/
|
|
1255
1325
|
fetchWorldsByKey(): Promise<void | ResponseType$1>;
|
|
1256
1326
|
/**
|
|
1257
|
-
*
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
* and creates new map of Worlds accessible via user.adminWorlds.
|
|
1327
|
+
* 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.
|
|
1328
|
+
*
|
|
1329
|
+
* @category Worlds
|
|
1261
1330
|
*
|
|
1262
|
-
* @
|
|
1331
|
+
* @example
|
|
1263
1332
|
* ```ts
|
|
1264
1333
|
* await user.fetchAdminWorldsByKey();
|
|
1265
1334
|
* const adminWorlds = user.adminWorlds;
|
|
@@ -1267,25 +1336,29 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1267
1336
|
*/
|
|
1268
1337
|
fetchAdminWorldsByKey(): Promise<void | ResponseType$1>;
|
|
1269
1338
|
/**
|
|
1270
|
-
* @summary
|
|
1271
1339
|
* Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
|
|
1272
1340
|
*
|
|
1273
|
-
* @
|
|
1341
|
+
* @category Dropped Assets
|
|
1342
|
+
*
|
|
1343
|
+
* @example
|
|
1274
1344
|
* ```ts
|
|
1275
1345
|
* await user.fetchInteractiveWorldsByKey("interactivePublicKeyExample");
|
|
1276
1346
|
* const interactiveWorlds = user.interactiveWorlds;
|
|
1277
1347
|
* ```
|
|
1348
|
+
*
|
|
1349
|
+
* @returns {Promise<object | ResponseType>} Returns the `urlSlugs` of worlds where the Public Key is found or an error response.
|
|
1278
1350
|
*/
|
|
1279
1351
|
fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType$1>;
|
|
1280
1352
|
/**
|
|
1281
|
-
* @summary
|
|
1282
1353
|
* Send an email
|
|
1283
1354
|
*
|
|
1284
|
-
* @
|
|
1355
|
+
* @example
|
|
1285
1356
|
* ```ts
|
|
1286
1357
|
* const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
|
|
1287
1358
|
* await user.sendEmail({ html, subject: "Example", to: "example@email.io" });
|
|
1288
1359
|
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* @returns {Promise<object | ResponseType>} Returns `{ success: true }` if the email is sent successfully or an error response.
|
|
1289
1362
|
*/
|
|
1290
1363
|
sendEmail({ html, subject, to, }: {
|
|
1291
1364
|
html: string;
|
|
@@ -1293,39 +1366,53 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1293
1366
|
to: string;
|
|
1294
1367
|
}): Promise<object | ResponseType$1>;
|
|
1295
1368
|
/**
|
|
1296
|
-
* @summary
|
|
1297
1369
|
* Get expressions
|
|
1298
1370
|
*
|
|
1299
|
-
* @
|
|
1371
|
+
* @category Expressions
|
|
1372
|
+
*
|
|
1373
|
+
* @example
|
|
1300
1374
|
* ```ts
|
|
1301
1375
|
* await user.getExpressions({ getUnlockablesOnly: true, });
|
|
1302
1376
|
* ```
|
|
1377
|
+
*
|
|
1378
|
+
* @returns {Promise<ResponseType>} Returns an array of expressions or an error response.
|
|
1303
1379
|
*/
|
|
1304
1380
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1305
1381
|
name?: string;
|
|
1306
1382
|
getUnlockablesOnly?: boolean;
|
|
1307
1383
|
}): Promise<ResponseType$1>;
|
|
1308
1384
|
/**
|
|
1309
|
-
* @summary
|
|
1310
1385
|
* Retrieves the data object for a user.
|
|
1311
1386
|
*
|
|
1312
|
-
* @
|
|
1387
|
+
* @category Data Objects
|
|
1388
|
+
*
|
|
1389
|
+
* @example
|
|
1313
1390
|
* ```ts
|
|
1314
1391
|
* const dataObject = await user.fetchDataObject();
|
|
1315
1392
|
* ```
|
|
1393
|
+
*
|
|
1394
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1316
1395
|
*/
|
|
1317
1396
|
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
1318
1397
|
/**
|
|
1319
|
-
* @summary
|
|
1320
1398
|
* Sets the data object for a user.
|
|
1321
1399
|
*
|
|
1400
|
+
* @remarks
|
|
1322
1401
|
* 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
|
|
1323
1402
|
*
|
|
1324
|
-
* @
|
|
1403
|
+
* @category Data Objects
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1325
1406
|
* ```ts
|
|
1326
|
-
* await user.setDataObject(
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1407
|
+
* await user.setDataObject(
|
|
1408
|
+
* { itemsCollected: 0 },
|
|
1409
|
+
* {
|
|
1410
|
+
* analytics: [{ analyticName: "resets"} ],
|
|
1411
|
+
* lock: { lockId: `${assetId}-${itemsCollected}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
1412
|
+
* },
|
|
1413
|
+
* );
|
|
1414
|
+
*
|
|
1415
|
+
* const { itemsCollected } = user.dataObject;
|
|
1329
1416
|
* ```
|
|
1330
1417
|
*/
|
|
1331
1418
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -1340,16 +1427,22 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1340
1427
|
};
|
|
1341
1428
|
}): Promise<void | ResponseType$1>;
|
|
1342
1429
|
/**
|
|
1343
|
-
* @summary
|
|
1344
1430
|
* Updates the data object for a user.
|
|
1345
1431
|
*
|
|
1432
|
+
* @remarks
|
|
1346
1433
|
* 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
|
|
1347
1434
|
*
|
|
1348
|
-
* @
|
|
1435
|
+
* @category Data Objects
|
|
1436
|
+
*
|
|
1437
|
+
* @example
|
|
1349
1438
|
* ```ts
|
|
1439
|
+
* const theme = "exampleTheme";
|
|
1440
|
+
*
|
|
1350
1441
|
* await user.updateDataObject({
|
|
1351
|
-
*
|
|
1442
|
+
* [`${theme}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
1352
1443
|
* });
|
|
1444
|
+
*
|
|
1445
|
+
* const { exampleTheme } = user.dataObject;
|
|
1353
1446
|
* ```
|
|
1354
1447
|
*/
|
|
1355
1448
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -1364,12 +1457,14 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1364
1457
|
};
|
|
1365
1458
|
}): Promise<void | ResponseType$1>;
|
|
1366
1459
|
/**
|
|
1367
|
-
* @summary
|
|
1368
1460
|
* 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.
|
|
1369
1461
|
*
|
|
1462
|
+
* @remarks
|
|
1370
1463
|
* 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
|
|
1371
1464
|
*
|
|
1372
|
-
* @
|
|
1465
|
+
* @category Data Objects
|
|
1466
|
+
*
|
|
1467
|
+
* @example
|
|
1373
1468
|
* ```ts
|
|
1374
1469
|
* await user.incrementDataObjectValue("key", 1);
|
|
1375
1470
|
* ```
|
|
@@ -1388,12 +1483,11 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1388
1483
|
}
|
|
1389
1484
|
|
|
1390
1485
|
/**
|
|
1391
|
-
* @summary
|
|
1392
1486
|
* Create an instance of Visitor class with a given id and optional attributes and session credentials.
|
|
1393
1487
|
*
|
|
1394
|
-
* @
|
|
1488
|
+
* @example
|
|
1395
1489
|
* ```ts
|
|
1396
|
-
* await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" } });
|
|
1490
|
+
* const visitor = await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" } });
|
|
1397
1491
|
* ```
|
|
1398
1492
|
*/
|
|
1399
1493
|
declare class Visitor extends User implements VisitorInterface {
|
|
@@ -1402,23 +1496,21 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1402
1496
|
user?: User;
|
|
1403
1497
|
constructor(topia: Topia, id: number, urlSlug: string, options?: VisitorOptionalInterface);
|
|
1404
1498
|
/**
|
|
1405
|
-
* @summary
|
|
1406
1499
|
* Get a single visitor from a world
|
|
1407
1500
|
*
|
|
1408
|
-
* @
|
|
1501
|
+
* @example
|
|
1409
1502
|
* ```ts
|
|
1410
1503
|
* await visitor.fetchVisitor();
|
|
1411
1504
|
* ```
|
|
1412
1505
|
*
|
|
1413
|
-
* @
|
|
1506
|
+
* @returns
|
|
1414
1507
|
* Returns details for a visitor in a world by id and urlSlug
|
|
1415
1508
|
*/
|
|
1416
1509
|
fetchVisitor(): Promise<void | ResponseType$1>;
|
|
1417
1510
|
/**
|
|
1418
|
-
* @summary
|
|
1419
1511
|
* Teleport or walk a visitor currently in a world to a single set of coordinates.
|
|
1420
1512
|
*
|
|
1421
|
-
* @
|
|
1513
|
+
* @example
|
|
1422
1514
|
* ```ts
|
|
1423
1515
|
* await visitor.moveVisitor({
|
|
1424
1516
|
* shouldTeleportVisitor: true,
|
|
@@ -1427,15 +1519,14 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1427
1519
|
* });
|
|
1428
1520
|
* ```
|
|
1429
1521
|
*
|
|
1430
|
-
* @
|
|
1431
|
-
*
|
|
1522
|
+
* @returns
|
|
1523
|
+
* Returns `{ success: true }` if the visitor was moved successfully.
|
|
1432
1524
|
*/
|
|
1433
1525
|
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
|
|
1434
1526
|
/**
|
|
1435
|
-
* @summary
|
|
1436
1527
|
* Display a message via a toast to a visitor currently in a world.
|
|
1437
1528
|
*
|
|
1438
|
-
* @
|
|
1529
|
+
* @example
|
|
1439
1530
|
* ```ts
|
|
1440
1531
|
* await visitor.fireToast({
|
|
1441
1532
|
* groupId: "custom-message",
|
|
@@ -1443,13 +1534,16 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1443
1534
|
* text: "Thank you for participating!",
|
|
1444
1535
|
* });
|
|
1445
1536
|
* ```
|
|
1537
|
+
*
|
|
1538
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1446
1539
|
*/
|
|
1447
1540
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
1448
1541
|
/**
|
|
1449
|
-
* @summary
|
|
1450
1542
|
* Open an iframe in a drawer or modal for a visitor currently in a world.
|
|
1451
1543
|
*
|
|
1452
|
-
* @
|
|
1544
|
+
* @category iframes
|
|
1545
|
+
*
|
|
1546
|
+
* @example
|
|
1453
1547
|
* ```ts
|
|
1454
1548
|
* await visitor.openIframe({
|
|
1455
1549
|
* droppedAssetId: "droppedAssetId",
|
|
@@ -1458,83 +1552,103 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1458
1552
|
* title: "Hello World",
|
|
1459
1553
|
* });
|
|
1460
1554
|
* ```
|
|
1555
|
+
*
|
|
1556
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1461
1557
|
*/
|
|
1462
1558
|
openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType$1>;
|
|
1463
1559
|
/**
|
|
1464
|
-
* @summary
|
|
1465
1560
|
* Reload an iframe for a visitor currently in a world.
|
|
1466
1561
|
*
|
|
1467
|
-
* @
|
|
1562
|
+
* @category iframes
|
|
1563
|
+
*
|
|
1564
|
+
* @example
|
|
1468
1565
|
* ```ts
|
|
1469
1566
|
* await visitor.reloadIframe("droppedAssetId");
|
|
1470
1567
|
* ```
|
|
1568
|
+
*
|
|
1569
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1471
1570
|
*/
|
|
1472
1571
|
reloadIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
|
|
1473
1572
|
/**
|
|
1474
|
-
* @summary
|
|
1475
1573
|
* Close an iframe for a visitor currently in a world.
|
|
1476
1574
|
*
|
|
1477
|
-
* @
|
|
1575
|
+
* @category iframes
|
|
1576
|
+
*
|
|
1577
|
+
* @example
|
|
1478
1578
|
* ```ts
|
|
1479
1579
|
* await visitor.closeIframe("droppedAssetId");
|
|
1480
1580
|
* ```
|
|
1581
|
+
*
|
|
1582
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1481
1583
|
*/
|
|
1482
1584
|
closeIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
|
|
1483
1585
|
/**
|
|
1484
|
-
* @summary
|
|
1485
1586
|
* Mute and turn video off for a visitor currently in a world.
|
|
1486
1587
|
*
|
|
1487
|
-
* @
|
|
1588
|
+
* @example
|
|
1488
1589
|
* ```ts
|
|
1489
1590
|
* await visitor.turnAVOff();
|
|
1490
1591
|
* ```
|
|
1592
|
+
*
|
|
1593
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1491
1594
|
*/
|
|
1492
1595
|
turnAVOff(): Promise<void | ResponseType$1>;
|
|
1493
1596
|
/**
|
|
1494
|
-
* @summary
|
|
1495
1597
|
* Get expressions
|
|
1496
1598
|
*
|
|
1497
|
-
* @
|
|
1599
|
+
* @category Expressions
|
|
1600
|
+
*
|
|
1601
|
+
* @example
|
|
1498
1602
|
* ```ts
|
|
1499
1603
|
* await visitor.getExpressions({ getUnlockablesOnly: true, });
|
|
1500
1604
|
* ```
|
|
1605
|
+
* @returns {Promise<ResponseType>} Returns an array of expressions or an error response.
|
|
1501
1606
|
*/
|
|
1502
1607
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1503
1608
|
name?: string;
|
|
1504
1609
|
getUnlockablesOnly?: boolean;
|
|
1505
1610
|
}): Promise<ResponseType$1>;
|
|
1506
1611
|
/**
|
|
1507
|
-
* @summary
|
|
1508
1612
|
* Grant expression to a visitor by id or name.
|
|
1509
1613
|
*
|
|
1510
|
-
* @
|
|
1614
|
+
* @category Expressions
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1511
1617
|
* ```ts
|
|
1512
1618
|
* await visitor.grantExpression({ id: "exampleExpressionId" });
|
|
1513
1619
|
* await visitor.grantExpression({ name: "exampleExpressionName" });
|
|
1514
1620
|
* ```
|
|
1621
|
+
*
|
|
1622
|
+
* @returns {Promise<ResponseType>} Returns `{ success: true }` if the expression was granted successfully or an error response.
|
|
1515
1623
|
*/
|
|
1516
1624
|
grantExpression({ id, name }: {
|
|
1517
1625
|
id?: string;
|
|
1518
1626
|
name?: string;
|
|
1519
1627
|
}): Promise<ResponseType$1>;
|
|
1520
1628
|
/**
|
|
1521
|
-
* @summary
|
|
1522
1629
|
* Get all particles available
|
|
1523
1630
|
*
|
|
1524
|
-
* @
|
|
1631
|
+
* @category Particle Effects
|
|
1632
|
+
*
|
|
1633
|
+
* @example
|
|
1525
1634
|
* ```ts
|
|
1526
1635
|
* await visitor.getAllParticles();
|
|
1527
1636
|
* ```
|
|
1637
|
+
*
|
|
1638
|
+
* @returns {Promise<ResponseType>} Returns an array of particles or an error response.
|
|
1528
1639
|
*/
|
|
1529
1640
|
getAllParticles(): Promise<ResponseType$1>;
|
|
1530
1641
|
/**
|
|
1531
|
-
* @summary
|
|
1532
1642
|
* Trigger a particle effect on a visitor
|
|
1533
1643
|
*
|
|
1534
|
-
* @
|
|
1644
|
+
* @category Particle Effects
|
|
1645
|
+
*
|
|
1646
|
+
* @example
|
|
1535
1647
|
* ```ts
|
|
1536
1648
|
* await visitor.triggerParticle({ name: "Flame" });
|
|
1537
1649
|
* ```
|
|
1650
|
+
*
|
|
1651
|
+
* @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
|
|
1538
1652
|
*/
|
|
1539
1653
|
triggerParticle({ id, name, duration, }: {
|
|
1540
1654
|
id?: string;
|
|
@@ -1542,26 +1656,37 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1542
1656
|
duration?: number;
|
|
1543
1657
|
}): Promise<ResponseType$1 | string>;
|
|
1544
1658
|
/**
|
|
1545
|
-
* @summary
|
|
1546
1659
|
* Retrieves the data object for a visitor.
|
|
1547
1660
|
*
|
|
1548
|
-
* @
|
|
1661
|
+
* @category Data Objects
|
|
1662
|
+
*
|
|
1663
|
+
* @example
|
|
1549
1664
|
* ```ts
|
|
1550
1665
|
* const dataObject = await visitor.fetchDataObject();
|
|
1551
1666
|
* ```
|
|
1667
|
+
*
|
|
1668
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1552
1669
|
*/
|
|
1553
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
1670
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
1554
1671
|
/**
|
|
1555
|
-
* @summary
|
|
1556
1672
|
* Sets the data object for a visitor.
|
|
1557
1673
|
*
|
|
1674
|
+
* @remarks
|
|
1558
1675
|
* 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
|
|
1559
1676
|
*
|
|
1560
|
-
* @
|
|
1677
|
+
* @category Data Objects
|
|
1678
|
+
*
|
|
1679
|
+
* @example
|
|
1561
1680
|
* ```ts
|
|
1562
|
-
* await visitor.setDataObject(
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
1681
|
+
* await visitor.setDataObject(
|
|
1682
|
+
* { itemsCollected: 0 },
|
|
1683
|
+
* {
|
|
1684
|
+
* analytics: [{ analyticName: "resets"} ],
|
|
1685
|
+
* lock: { lockId: `${assetId}-${itemsCollected}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
1686
|
+
* },
|
|
1687
|
+
* );
|
|
1688
|
+
*
|
|
1689
|
+
* const { itemsCollected } = visitor.dataObject;
|
|
1565
1690
|
* ```
|
|
1566
1691
|
*/
|
|
1567
1692
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -1576,16 +1701,22 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1576
1701
|
};
|
|
1577
1702
|
}): Promise<void | ResponseType$1>;
|
|
1578
1703
|
/**
|
|
1579
|
-
* @summary
|
|
1580
1704
|
* Updates the data object for a visitor.
|
|
1581
1705
|
*
|
|
1706
|
+
* @remarks
|
|
1582
1707
|
* 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
|
|
1583
1708
|
*
|
|
1584
|
-
* @
|
|
1709
|
+
* @category Data Objects
|
|
1710
|
+
*
|
|
1711
|
+
* @example
|
|
1585
1712
|
* ```ts
|
|
1713
|
+
* const theme = "exampleTheme";
|
|
1714
|
+
*
|
|
1586
1715
|
* await visitor.updateDataObject({
|
|
1587
|
-
*
|
|
1716
|
+
* [`${theme}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
1588
1717
|
* });
|
|
1718
|
+
*
|
|
1719
|
+
* const { exampleTheme } = visitor.dataObject;
|
|
1589
1720
|
* ```
|
|
1590
1721
|
*/
|
|
1591
1722
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -1600,12 +1731,14 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1600
1731
|
};
|
|
1601
1732
|
}): Promise<void | ResponseType$1>;
|
|
1602
1733
|
/**
|
|
1603
|
-
* @summary
|
|
1604
1734
|
* 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.
|
|
1605
1735
|
*
|
|
1736
|
+
* @remarks
|
|
1606
1737
|
* 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
|
|
1607
1738
|
*
|
|
1608
|
-
* @
|
|
1739
|
+
* @category Data Objects
|
|
1740
|
+
*
|
|
1741
|
+
* @example
|
|
1609
1742
|
* ```ts
|
|
1610
1743
|
* await visitor.incrementDataObjectValue("key", 1);
|
|
1611
1744
|
* ```
|
|
@@ -1622,20 +1755,18 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1622
1755
|
};
|
|
1623
1756
|
}): Promise<void | ResponseType$1>;
|
|
1624
1757
|
/**
|
|
1625
|
-
* @summary
|
|
1626
1758
|
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
1627
1759
|
*
|
|
1628
|
-
* @
|
|
1760
|
+
* @example
|
|
1629
1761
|
* ```ts
|
|
1630
1762
|
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
1631
1763
|
* ```
|
|
1632
1764
|
*/
|
|
1633
1765
|
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
|
|
1634
1766
|
/**
|
|
1635
|
-
* @summary
|
|
1636
1767
|
* Setup signal to visitor
|
|
1637
1768
|
*
|
|
1638
|
-
* @
|
|
1769
|
+
* @example
|
|
1639
1770
|
* ```ts
|
|
1640
1771
|
* await visitor.sendSignalToVisitor(iceServers);
|
|
1641
1772
|
* ```
|
|
@@ -1719,7 +1850,7 @@ type AssetOptionalInterface = {
|
|
|
1719
1850
|
interface DroppedAssetInterface extends AssetInterface {
|
|
1720
1851
|
fetchDroppedAssetById(): Promise<void | ResponseType$1>;
|
|
1721
1852
|
deleteDroppedAsset(): Promise<void | ResponseType$1>;
|
|
1722
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
1853
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
1723
1854
|
setDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
1724
1855
|
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
1725
1856
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
@@ -1907,7 +2038,7 @@ interface UpdatePrivateZoneInterface {
|
|
|
1907
2038
|
}
|
|
1908
2039
|
|
|
1909
2040
|
interface EcosystemInterface {
|
|
1910
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
2041
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
1911
2042
|
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
|
|
1912
2043
|
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
1913
2044
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
@@ -1981,7 +2112,7 @@ interface VisitorInterface extends SDKInterface {
|
|
|
1981
2112
|
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
|
|
1982
2113
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
1983
2114
|
openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType$1>;
|
|
1984
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
2115
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
1985
2116
|
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
|
|
1986
2117
|
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
1987
2118
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
@@ -2108,7 +2239,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
|
|
|
2108
2239
|
}): Promise<object | ResponseType$1>;
|
|
2109
2240
|
replaceScene(sceneId: string): Promise<void | ResponseType$1>;
|
|
2110
2241
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
2111
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
2242
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
2112
2243
|
setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
|
|
2113
2244
|
updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
|
|
2114
2245
|
incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
|
|
@@ -2123,10 +2254,9 @@ interface WorldWebhooksInterface {
|
|
|
2123
2254
|
}
|
|
2124
2255
|
|
|
2125
2256
|
/**
|
|
2126
|
-
* @summary
|
|
2127
2257
|
* Create a single instance of Topia axios used for all calls to the public API in all classes
|
|
2128
2258
|
*
|
|
2129
|
-
* @
|
|
2259
|
+
* @example
|
|
2130
2260
|
* ```ts
|
|
2131
2261
|
* const topia = await new Topia({
|
|
2132
2262
|
* apiDomain: "api.topia.io",
|
|
@@ -2155,10 +2285,9 @@ declare class Topia implements TopiaInterface {
|
|
|
2155
2285
|
}
|
|
2156
2286
|
|
|
2157
2287
|
/**
|
|
2158
|
-
* @summary
|
|
2159
2288
|
* Create an instance of SDKController class with credentials.
|
|
2160
2289
|
*
|
|
2161
|
-
* @
|
|
2290
|
+
* @example
|
|
2162
2291
|
* ```ts
|
|
2163
2292
|
* const credentials = {
|
|
2164
2293
|
* assetId: "exampleAsset",
|
|
@@ -2203,12 +2332,11 @@ declare abstract class SDKController implements SDKInterface {
|
|
|
2203
2332
|
}
|
|
2204
2333
|
|
|
2205
2334
|
/**
|
|
2206
|
-
* @summary
|
|
2207
2335
|
* Create an instance of Asset class with a given asset id and optional attributes and session credentials.
|
|
2208
2336
|
*
|
|
2209
|
-
* @
|
|
2337
|
+
* @example
|
|
2210
2338
|
* ```ts
|
|
2211
|
-
* await new Asset(topia, "id", {
|
|
2339
|
+
* const asset = await new Asset(topia, "id", {
|
|
2212
2340
|
* attributes: { assetName: "My Asset", isPublic: false },
|
|
2213
2341
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2214
2342
|
* });
|
|
@@ -2218,21 +2346,21 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2218
2346
|
readonly id?: string;
|
|
2219
2347
|
constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
|
|
2220
2348
|
/**
|
|
2221
|
-
*
|
|
2222
|
-
* Retrieves platform asset details.
|
|
2349
|
+
* Retrieves platform asset details and assigns response data to the instance.
|
|
2223
2350
|
*
|
|
2224
|
-
* @
|
|
2351
|
+
* @example
|
|
2225
2352
|
* ```ts
|
|
2226
2353
|
* await asset.fetchAssetById();
|
|
2227
2354
|
* const { assetName } = asset;
|
|
2228
2355
|
* ```
|
|
2356
|
+
*
|
|
2357
|
+
* @returns {Promise<object | ResponseType>} Returns the asset details or an error response.
|
|
2229
2358
|
*/
|
|
2230
2359
|
fetchAssetById(): Promise<object | ResponseType$1>;
|
|
2231
2360
|
/**
|
|
2232
|
-
* @summary
|
|
2233
2361
|
* Updates platform asset details.
|
|
2234
2362
|
*
|
|
2235
|
-
* @
|
|
2363
|
+
* @example
|
|
2236
2364
|
* ```ts
|
|
2237
2365
|
* await asset.updateAsset({
|
|
2238
2366
|
* assetName: "exampleAsset",
|
|
@@ -2258,12 +2386,11 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2258
2386
|
}
|
|
2259
2387
|
|
|
2260
2388
|
/**
|
|
2261
|
-
* @summary
|
|
2262
2389
|
* Create an instance of Ecosystem class with optional session credentials
|
|
2263
2390
|
*
|
|
2264
|
-
* @
|
|
2391
|
+
* @example
|
|
2265
2392
|
* ```ts
|
|
2266
|
-
* await new Ecosystem(topia, {
|
|
2393
|
+
* const ecosystem =await new Ecosystem(topia, {
|
|
2267
2394
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2268
2395
|
* });
|
|
2269
2396
|
* ```
|
|
@@ -2272,27 +2399,35 @@ declare class Ecosystem extends SDKController {
|
|
|
2272
2399
|
dataObject?: object | null | undefined;
|
|
2273
2400
|
constructor(topia: Topia, options?: EcosystemOptionalInterface);
|
|
2274
2401
|
/**
|
|
2275
|
-
* @summary
|
|
2276
2402
|
* Retrieves the data object for a Topia ecosystem. Requires canUpdateEcosystemDataObjects permission to be set to true for the public key.
|
|
2277
2403
|
*
|
|
2278
|
-
* @
|
|
2404
|
+
* @category Data Objects
|
|
2405
|
+
*
|
|
2406
|
+
* @example
|
|
2279
2407
|
* ```ts
|
|
2280
2408
|
* const dataObject = await ecosystem.fetchDataObject("exampleAppPublicKey", "exampleAppPublicKeyJWT");
|
|
2281
2409
|
* ```
|
|
2410
|
+
*
|
|
2411
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
2282
2412
|
*/
|
|
2283
|
-
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
2413
|
+
fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
|
|
2284
2414
|
/**
|
|
2285
|
-
* @summary
|
|
2286
2415
|
* Sets the data object for a Topia ecosystem.
|
|
2287
2416
|
*
|
|
2417
|
+
* @remarks
|
|
2418
|
+
* This method also allows you to set a data object on behalf of another Public Key. It requires `canUpdateEcosystemDataObjects` permission to be set to true for the Public Key.
|
|
2419
|
+
*
|
|
2288
2420
|
* 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
|
|
2289
2421
|
*
|
|
2290
|
-
* @
|
|
2422
|
+
* @category Data Objects
|
|
2423
|
+
*
|
|
2424
|
+
* @example
|
|
2291
2425
|
* ```ts
|
|
2292
2426
|
* await ecosystem.setDataObject({ "exampleKey": "exampleValue" }, {
|
|
2293
2427
|
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
2294
2428
|
* sharedAppJWT: "exampleAppPublicKeyJWT",}
|
|
2295
2429
|
* });
|
|
2430
|
+
* const { exampleKey } = ecosystem.dataObject;
|
|
2296
2431
|
* ```
|
|
2297
2432
|
*/
|
|
2298
2433
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -2307,17 +2442,28 @@ declare class Ecosystem extends SDKController {
|
|
|
2307
2442
|
};
|
|
2308
2443
|
}): Promise<void | ResponseType$1>;
|
|
2309
2444
|
/**
|
|
2310
|
-
* @summary
|
|
2311
2445
|
* Updates the data object for a Topia ecosystem.
|
|
2312
2446
|
*
|
|
2447
|
+
* @remarks
|
|
2448
|
+
* This method also allows you to update a data object on behalf of another Public Key. It requires `canUpdateEcosystemDataObjects` permission to be set to true for the Public Key.
|
|
2449
|
+
*
|
|
2313
2450
|
* 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
|
|
2314
2451
|
*
|
|
2315
|
-
* @
|
|
2452
|
+
* @category Data Objects
|
|
2453
|
+
*
|
|
2454
|
+
* @example
|
|
2316
2455
|
* ```ts
|
|
2317
|
-
* await ecosystem.updateDataObject({
|
|
2318
|
-
*
|
|
2319
|
-
*
|
|
2456
|
+
* await ecosystem.updateDataObject({
|
|
2457
|
+
* [`profiles.${profileId}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
2458
|
+
* [`profileMapper.${profileId}`]: username,
|
|
2459
|
+
* }, {
|
|
2460
|
+
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
2461
|
+
* sharedAppJWT: "exampleAppPublicKeyJWT",
|
|
2462
|
+
* analytics: [{ analyticName: "itemCollected", profileId, uniqueKey: profileId, urlSlug } ],
|
|
2463
|
+
* lock: { lockId: `${assetId}-${resetCount}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
2464
|
+
* }
|
|
2320
2465
|
* });
|
|
2466
|
+
* const { exampleKey } = ecosystem.dataObject;
|
|
2321
2467
|
* ```
|
|
2322
2468
|
*/
|
|
2323
2469
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -2332,12 +2478,16 @@ declare class Ecosystem extends SDKController {
|
|
|
2332
2478
|
};
|
|
2333
2479
|
}): Promise<void | ResponseType$1>;
|
|
2334
2480
|
/**
|
|
2335
|
-
* @summary
|
|
2336
2481
|
* Increments a specific value in the data object for a Topia ecosystem by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
2337
2482
|
*
|
|
2483
|
+
* @remarks
|
|
2484
|
+
* This method also allows you to increment a data object value on behalf of another Public Key. It requires `canUpdateEcosystemDataObjects` permission to be set to true for the Public Key.
|
|
2485
|
+
*
|
|
2338
2486
|
* 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
|
|
2339
2487
|
*
|
|
2340
|
-
* @
|
|
2488
|
+
* @category Data Objects
|
|
2489
|
+
*
|
|
2490
|
+
* @example
|
|
2341
2491
|
* ```ts
|
|
2342
2492
|
* await ecosystem.incrementDataObjectValue("key", 1, {
|
|
2343
2493
|
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
@@ -2359,12 +2509,11 @@ declare class Ecosystem extends SDKController {
|
|
|
2359
2509
|
}
|
|
2360
2510
|
|
|
2361
2511
|
/**
|
|
2362
|
-
* @summary
|
|
2363
2512
|
* Create an instance of WebRTCConnector class with optional session credentials.
|
|
2364
2513
|
*
|
|
2365
|
-
* @
|
|
2514
|
+
* @example
|
|
2366
2515
|
* ```ts
|
|
2367
|
-
* await new WebRTCConnector(topia, {
|
|
2516
|
+
* const webRTC = await new WebRTCConnector(topia, {
|
|
2368
2517
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2369
2518
|
* });
|
|
2370
2519
|
* ```
|
|
@@ -2374,10 +2523,9 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
|
|
|
2374
2523
|
urlSlug: string;
|
|
2375
2524
|
constructor(topia: Topia, urlSlug: string, options?: WebRTCConnectorOptionalInterface);
|
|
2376
2525
|
/**
|
|
2377
|
-
* @summary
|
|
2378
2526
|
* Get twilio
|
|
2379
2527
|
*
|
|
2380
|
-
* @
|
|
2528
|
+
* @example
|
|
2381
2529
|
* ```ts
|
|
2382
2530
|
* await webRTCConnector.getTwilioConfig();
|
|
2383
2531
|
* ```
|
|
@@ -2386,14 +2534,14 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
|
|
|
2386
2534
|
}
|
|
2387
2535
|
|
|
2388
2536
|
/**
|
|
2389
|
-
* @summary
|
|
2390
2537
|
* Create an instance of WorldActivity class with a given url slug and optional attributes and session credentials.
|
|
2391
2538
|
*
|
|
2539
|
+
* @remarks
|
|
2392
2540
|
* This class is responsible for all activity of a specified world including editing dropped assets, moving current visitors, etc.
|
|
2393
2541
|
*
|
|
2394
|
-
* @
|
|
2542
|
+
* @example
|
|
2395
2543
|
* ```ts
|
|
2396
|
-
* await new WorldActivity(topia, "exampleWorld", {
|
|
2544
|
+
* const activity = await new WorldActivity(topia, "exampleWorld", {
|
|
2397
2545
|
* attributes: { name: "Example World" },
|
|
2398
2546
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2399
2547
|
* });
|
|
@@ -2408,25 +2556,31 @@ declare class WorldActivity extends SDKController {
|
|
|
2408
2556
|
};
|
|
2409
2557
|
private fetchVisitors;
|
|
2410
2558
|
/**
|
|
2411
|
-
* @summary
|
|
2412
2559
|
* Retrieve all visitors currently in a world.
|
|
2413
2560
|
*
|
|
2414
|
-
* @
|
|
2561
|
+
* @category Visitors
|
|
2562
|
+
*
|
|
2563
|
+
* @example
|
|
2415
2564
|
* ```ts
|
|
2416
2565
|
* const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
|
|
2417
2566
|
* ```
|
|
2567
|
+
*
|
|
2568
|
+
* @returns {Promise<void | ResponseType>} Returns the an object containing current visitors keyed by visitorId or an error.
|
|
2418
2569
|
*/
|
|
2419
2570
|
currentVisitors(shouldIncludeAdminPermissions?: boolean): Promise<{
|
|
2420
2571
|
[key: string]: Visitor;
|
|
2421
2572
|
}>;
|
|
2422
2573
|
/**
|
|
2423
|
-
* @summary
|
|
2424
2574
|
* Retrieve all visitors currently in a Landmark Zone.
|
|
2425
2575
|
*
|
|
2426
|
-
* @
|
|
2576
|
+
* @category Visitors
|
|
2577
|
+
*
|
|
2578
|
+
* @example
|
|
2427
2579
|
* ```ts
|
|
2428
2580
|
* const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
|
|
2429
2581
|
* ```
|
|
2582
|
+
*
|
|
2583
|
+
* @returns {Promise<void | ResponseType>} Returns the an object containing current visitors keyed by visitorId or an error.
|
|
2430
2584
|
*/
|
|
2431
2585
|
fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }: {
|
|
2432
2586
|
droppedAssetId?: string;
|
|
@@ -2435,12 +2589,15 @@ declare class WorldActivity extends SDKController {
|
|
|
2435
2589
|
[key: string]: Visitor;
|
|
2436
2590
|
}>;
|
|
2437
2591
|
/**
|
|
2438
|
-
* @summary
|
|
2439
2592
|
* Move all visitors currently in a world to a single set of coordinates.
|
|
2593
|
+
*
|
|
2594
|
+
* @remarks
|
|
2440
2595
|
* Optionally refetch visitors, teleport or walk visitors to new location,
|
|
2441
2596
|
* and scatter visitors by any number so that they don't all move to the exact same location.
|
|
2442
2597
|
*
|
|
2443
|
-
* @
|
|
2598
|
+
* @category Visitors
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2444
2601
|
* ```ts
|
|
2445
2602
|
* await worldActivity.moveAllVisitors({
|
|
2446
2603
|
* shouldFetchVisitors: true,
|
|
@@ -2451,15 +2608,16 @@ declare class WorldActivity extends SDKController {
|
|
|
2451
2608
|
* });
|
|
2452
2609
|
* ```
|
|
2453
2610
|
*
|
|
2454
|
-
* @
|
|
2611
|
+
* @returns
|
|
2455
2612
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
2456
2613
|
*/
|
|
2457
2614
|
moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType$1)[] | undefined>;
|
|
2458
2615
|
/**
|
|
2459
|
-
* @summary
|
|
2460
2616
|
* Teleport or walk a list of visitors currently in a world to various coordinates.
|
|
2461
2617
|
*
|
|
2462
|
-
* @
|
|
2618
|
+
* @category Visitors
|
|
2619
|
+
*
|
|
2620
|
+
* @example
|
|
2463
2621
|
* ```ts
|
|
2464
2622
|
* const visitorsToMove = [
|
|
2465
2623
|
* {
|
|
@@ -2477,14 +2635,14 @@ declare class WorldActivity extends SDKController {
|
|
|
2477
2635
|
* await worldActivity.moveVisitors(visitorsToMove);
|
|
2478
2636
|
* ```
|
|
2479
2637
|
*
|
|
2480
|
-
* @
|
|
2638
|
+
* @returns
|
|
2481
2639
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
2482
2640
|
*/
|
|
2483
2641
|
moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType$1)[]>;
|
|
2484
2642
|
}
|
|
2485
2643
|
|
|
2486
2644
|
/**
|
|
2487
|
-
* @
|
|
2645
|
+
* @example
|
|
2488
2646
|
* ```ts
|
|
2489
2647
|
* const Asset = new AssetFactory(myTopiaInstance);
|
|
2490
2648
|
* ```
|
|
@@ -2492,20 +2650,20 @@ declare class WorldActivity extends SDKController {
|
|
|
2492
2650
|
declare class AssetFactory extends SDKController {
|
|
2493
2651
|
constructor(topia: Topia);
|
|
2494
2652
|
/**
|
|
2495
|
-
* @summary
|
|
2496
2653
|
* Instantiate a new instance of Asset class.
|
|
2497
2654
|
*
|
|
2498
|
-
* @
|
|
2655
|
+
* @example
|
|
2499
2656
|
* ```
|
|
2500
2657
|
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2501
2658
|
* ```
|
|
2659
|
+
*
|
|
2660
|
+
* @returns {Asset} Returns a new Asset object with the asset id.
|
|
2502
2661
|
*/
|
|
2503
2662
|
create(id: string, options?: AssetOptionalInterface): Asset;
|
|
2504
2663
|
/**
|
|
2505
|
-
* @summary
|
|
2506
2664
|
* Upload a new Asset and return a new instance of Asset class.
|
|
2507
2665
|
*
|
|
2508
|
-
* @
|
|
2666
|
+
* @example
|
|
2509
2667
|
* ```
|
|
2510
2668
|
* const assetPayload = {
|
|
2511
2669
|
* assetName: "exampleAssetName"
|
|
@@ -2517,12 +2675,14 @@ declare class AssetFactory extends SDKController {
|
|
|
2517
2675
|
* }
|
|
2518
2676
|
* const asset = await Asset.upload(assetPayload, apiKey);
|
|
2519
2677
|
* ```
|
|
2678
|
+
*
|
|
2679
|
+
* @returns {AssetType} Returns a new Asset object with the asset details.
|
|
2520
2680
|
*/
|
|
2521
2681
|
upload(assetPayload: AssetType, apiKey: string): Promise<Asset>;
|
|
2522
2682
|
}
|
|
2523
2683
|
|
|
2524
2684
|
/**
|
|
2525
|
-
* @
|
|
2685
|
+
* @example
|
|
2526
2686
|
* ```ts
|
|
2527
2687
|
* const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
|
|
2528
2688
|
* ```
|
|
@@ -2530,43 +2690,45 @@ declare class AssetFactory extends SDKController {
|
|
|
2530
2690
|
declare class DroppedAssetFactory extends SDKController {
|
|
2531
2691
|
constructor(topia: Topia);
|
|
2532
2692
|
/**
|
|
2533
|
-
* @summary
|
|
2534
2693
|
* Instantiate a new instance of DroppedAsset class.
|
|
2535
2694
|
*
|
|
2536
|
-
* @
|
|
2695
|
+
* @example
|
|
2537
2696
|
* ```
|
|
2538
2697
|
* const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2539
2698
|
* ```
|
|
2699
|
+
*
|
|
2700
|
+
* @returns {DroppedAsset} Returns a new DroppedAsset object.
|
|
2540
2701
|
*/
|
|
2541
2702
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
2542
2703
|
/**
|
|
2543
|
-
* @summary
|
|
2544
2704
|
* Instantiate a new instance of DroppedAsset class and retrieve all properties.
|
|
2545
2705
|
*
|
|
2546
|
-
* @
|
|
2706
|
+
* @example
|
|
2547
2707
|
* ```
|
|
2548
2708
|
* const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2549
2709
|
* ```
|
|
2710
|
+
*
|
|
2711
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2550
2712
|
*/
|
|
2551
2713
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
2552
2714
|
/**
|
|
2553
|
-
* @summary
|
|
2554
2715
|
* Searches dropped assets within a world by a provide `uniqueName`. If a single match is found, a new instance of DroppedAsset class is returned all properties.
|
|
2555
2716
|
*
|
|
2556
|
-
* @
|
|
2717
|
+
* @remarks
|
|
2718
|
+
* 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.
|
|
2719
|
+
*
|
|
2720
|
+
* @example
|
|
2557
2721
|
* ```
|
|
2558
2722
|
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
|
|
2559
2723
|
* ```
|
|
2560
2724
|
*
|
|
2561
|
-
* @
|
|
2562
|
-
* 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.
|
|
2725
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2563
2726
|
*/
|
|
2564
2727
|
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials): Promise<DroppedAsset>;
|
|
2565
2728
|
/**
|
|
2566
|
-
* @summary
|
|
2567
2729
|
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
2568
2730
|
*
|
|
2569
|
-
* @
|
|
2731
|
+
* @example
|
|
2570
2732
|
* ```
|
|
2571
2733
|
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2572
2734
|
* const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
|
|
@@ -2581,6 +2743,8 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2581
2743
|
urlSlug,
|
|
2582
2744
|
});
|
|
2583
2745
|
* ```
|
|
2746
|
+
*
|
|
2747
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2584
2748
|
*/
|
|
2585
2749
|
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, }: {
|
|
2586
2750
|
assetScale?: number;
|
|
@@ -2615,7 +2779,7 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2615
2779
|
}
|
|
2616
2780
|
|
|
2617
2781
|
/**
|
|
2618
|
-
* @
|
|
2782
|
+
* @example
|
|
2619
2783
|
* ```ts
|
|
2620
2784
|
* const Ecosystem = new EcosystemFactory(myTopiaInstance);
|
|
2621
2785
|
* ```
|
|
@@ -2624,19 +2788,20 @@ declare class EcosystemFactory {
|
|
|
2624
2788
|
topia: Topia;
|
|
2625
2789
|
constructor(topia: Topia);
|
|
2626
2790
|
/**
|
|
2627
|
-
* @summary
|
|
2628
2791
|
* Instantiate a new instance of Ecosystem class.
|
|
2629
2792
|
*
|
|
2630
|
-
* @
|
|
2793
|
+
* @example
|
|
2631
2794
|
* ```
|
|
2632
2795
|
* const ecosystemInstance = await Ecosystem.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId }});
|
|
2633
2796
|
* ```
|
|
2797
|
+
*
|
|
2798
|
+
* @returns {Ecosystem} Returns a new Ecosystem object.
|
|
2634
2799
|
*/
|
|
2635
2800
|
create(options?: EcosystemOptionalInterface): Ecosystem;
|
|
2636
2801
|
}
|
|
2637
2802
|
|
|
2638
2803
|
/**
|
|
2639
|
-
* @
|
|
2804
|
+
* @example
|
|
2640
2805
|
* ```ts
|
|
2641
2806
|
* const Scene = new SceneFactory(myTopiaInstance);
|
|
2642
2807
|
* ```
|
|
@@ -2645,29 +2810,31 @@ declare class SceneFactory {
|
|
|
2645
2810
|
topia: Topia;
|
|
2646
2811
|
constructor(topia: Topia);
|
|
2647
2812
|
/**
|
|
2648
|
-
* @summary
|
|
2649
2813
|
* Instantiate a new instance of Scene class.
|
|
2650
2814
|
*
|
|
2651
|
-
* @
|
|
2815
|
+
* @example
|
|
2652
2816
|
* ```
|
|
2653
2817
|
* const sceneInstance = await Scene.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2654
2818
|
* ```
|
|
2819
|
+
*
|
|
2820
|
+
* @returns {Scene} Returns a new Scene object.
|
|
2655
2821
|
*/
|
|
2656
2822
|
create(id: string, options?: SceneOptionalInterface): Scene;
|
|
2657
2823
|
/**
|
|
2658
|
-
* @summary
|
|
2659
2824
|
* Instantiate a new instance of Scene class and retrieve all properties.
|
|
2660
2825
|
*
|
|
2661
|
-
* @
|
|
2826
|
+
* @example
|
|
2662
2827
|
* ```
|
|
2663
2828
|
* const sceneInstance = await Scene.get(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2664
2829
|
* ```
|
|
2830
|
+
*
|
|
2831
|
+
* @returns {Promise<Scene>} Returns a new Scene object with all properties.
|
|
2665
2832
|
*/
|
|
2666
2833
|
get(id: string, options?: SceneOptionalInterface): Promise<Scene>;
|
|
2667
2834
|
}
|
|
2668
2835
|
|
|
2669
2836
|
/**
|
|
2670
|
-
* @
|
|
2837
|
+
* @example
|
|
2671
2838
|
* ```ts
|
|
2672
2839
|
* const User = new UserFactory(myTopiaInstance);
|
|
2673
2840
|
* ```
|
|
@@ -2676,19 +2843,20 @@ declare class UserFactory {
|
|
|
2676
2843
|
topia: Topia;
|
|
2677
2844
|
constructor(topia: Topia);
|
|
2678
2845
|
/**
|
|
2679
|
-
* @summary
|
|
2680
2846
|
* Instantiate a new instance of User class.
|
|
2681
2847
|
*
|
|
2682
|
-
* @
|
|
2848
|
+
* @example
|
|
2683
2849
|
* ```
|
|
2684
2850
|
* const userInstance = await User.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2685
2851
|
* ```
|
|
2852
|
+
*
|
|
2853
|
+
* @returns {User} Returns a new User object.
|
|
2686
2854
|
*/
|
|
2687
2855
|
create(options?: UserOptionalInterface): User;
|
|
2688
2856
|
}
|
|
2689
2857
|
|
|
2690
2858
|
/**
|
|
2691
|
-
* @
|
|
2859
|
+
* @example
|
|
2692
2860
|
* ```ts
|
|
2693
2861
|
* const Visitor = new VisitorFactory(myTopiaInstance);
|
|
2694
2862
|
* ```
|
|
@@ -2697,29 +2865,31 @@ declare class VisitorFactory {
|
|
|
2697
2865
|
topia: Topia;
|
|
2698
2866
|
constructor(topia: Topia);
|
|
2699
2867
|
/**
|
|
2700
|
-
* @summary
|
|
2701
2868
|
* Instantiate a new instance of Visitor class.
|
|
2702
2869
|
*
|
|
2703
|
-
* @
|
|
2870
|
+
* @example
|
|
2704
2871
|
* ```
|
|
2705
2872
|
* const visitorInstance = await Visitor.create(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2706
2873
|
* ```
|
|
2874
|
+
*
|
|
2875
|
+
* @returns {Visitor} Returns a new Visitor object.
|
|
2707
2876
|
*/
|
|
2708
2877
|
create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
|
|
2709
2878
|
/**
|
|
2710
|
-
* @summary
|
|
2711
2879
|
* Instantiate a new instance of Visitor class and retrieve all properties.
|
|
2712
2880
|
*
|
|
2713
|
-
* @
|
|
2881
|
+
* @example
|
|
2714
2882
|
* ```
|
|
2715
2883
|
* const visitorInstance = await Visitor.get(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2716
2884
|
* ```
|
|
2885
|
+
*
|
|
2886
|
+
* @returns {Promise<Visitor>} Returns a new Visitor object with all properties.
|
|
2717
2887
|
*/
|
|
2718
2888
|
get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
|
|
2719
2889
|
}
|
|
2720
2890
|
|
|
2721
2891
|
/**
|
|
2722
|
-
* @
|
|
2892
|
+
* @example
|
|
2723
2893
|
* ```ts
|
|
2724
2894
|
* const WebRTCConnector = new WebRTCConnectorFactory(myTopiaInstance);
|
|
2725
2895
|
* ```
|
|
@@ -2728,19 +2898,20 @@ declare class WebRTCConnectorFactory {
|
|
|
2728
2898
|
topia: Topia;
|
|
2729
2899
|
constructor(topia: Topia);
|
|
2730
2900
|
/**
|
|
2731
|
-
* @summary
|
|
2732
2901
|
* Instantiate a new instance of WebRTCConnector class.
|
|
2733
2902
|
*
|
|
2734
|
-
* @
|
|
2903
|
+
* @example
|
|
2735
2904
|
* ```
|
|
2736
2905
|
* const webRTCInstance = await WebRTCConnector.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId }, twilioConfig: {} });
|
|
2737
2906
|
* ```
|
|
2907
|
+
*
|
|
2908
|
+
* @returns {WebRTCConnector} Returns a new WebRTCConnector object.
|
|
2738
2909
|
*/
|
|
2739
2910
|
create(urlSlug: string, options?: WebRTCConnectorOptionalInterface): WebRTCConnector;
|
|
2740
2911
|
}
|
|
2741
2912
|
|
|
2742
2913
|
/**
|
|
2743
|
-
* @
|
|
2914
|
+
* @example
|
|
2744
2915
|
* ```ts
|
|
2745
2916
|
* const WorldActivity = new WorldActivityFactory(myTopiaInstance);
|
|
2746
2917
|
* ```
|
|
@@ -2749,19 +2920,20 @@ declare class WorldActivityFactory {
|
|
|
2749
2920
|
topia: Topia;
|
|
2750
2921
|
constructor(topia: Topia);
|
|
2751
2922
|
/**
|
|
2752
|
-
* @summary
|
|
2753
2923
|
* Instantiate a new instance of WorldActivity class.
|
|
2754
2924
|
*
|
|
2755
|
-
* @
|
|
2925
|
+
* @example
|
|
2756
2926
|
* ```
|
|
2757
2927
|
* const worldActivityInstance = await WorldActivity.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2758
2928
|
* ```
|
|
2929
|
+
*
|
|
2930
|
+
* @returns {WorldActivity} Returns a new WorldActivity object.
|
|
2759
2931
|
*/
|
|
2760
2932
|
create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
|
|
2761
2933
|
}
|
|
2762
2934
|
|
|
2763
2935
|
/**
|
|
2764
|
-
* @
|
|
2936
|
+
* @example
|
|
2765
2937
|
* ```ts
|
|
2766
2938
|
* const World = new WorldFactory(myTopiaInstance);
|
|
2767
2939
|
* ```
|
|
@@ -2769,23 +2941,25 @@ declare class WorldActivityFactory {
|
|
|
2769
2941
|
declare class WorldFactory extends SDKController {
|
|
2770
2942
|
constructor(topia: Topia);
|
|
2771
2943
|
/**
|
|
2772
|
-
* @summary
|
|
2773
2944
|
* Instantiate a new instance of World class.
|
|
2774
2945
|
*
|
|
2775
|
-
* @
|
|
2946
|
+
* @example
|
|
2776
2947
|
* ```
|
|
2777
2948
|
* const worldInstance = await World.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2778
2949
|
* ```
|
|
2950
|
+
*
|
|
2951
|
+
* @returns {World} Returns a new World object.
|
|
2779
2952
|
*/
|
|
2780
2953
|
create(urlSlug: string, options?: WorldOptionalInterface): World;
|
|
2781
2954
|
/**
|
|
2782
|
-
* @summary
|
|
2783
2955
|
* Deletes an array of Dropped Assets from within a world and returns success: true
|
|
2784
2956
|
*
|
|
2785
|
-
* @
|
|
2957
|
+
* @example
|
|
2786
2958
|
* ```
|
|
2787
2959
|
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], interactiveSecret, credentials);
|
|
2788
2960
|
* ```
|
|
2961
|
+
*
|
|
2962
|
+
* @returns {Promise<{ success: boolean }>} Returns `{ success: true }` or an error.
|
|
2789
2963
|
*/
|
|
2790
2964
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
|
|
2791
2965
|
apiKey?: string;
|