@rtsdk/topia 0.17.1 → 0.17.2
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 +549 -359
- package/dist/index.d.ts +496 -324
- package/dist/index.js +549 -359
- 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
227
|
fetchDataObject(appPublicKey?: string, appJWT?: 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,34 @@ 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
902
|
* await world.triggerParticle({ name: "Flame" });
|
|
853
903
|
* ```
|
|
904
|
+
*
|
|
905
|
+
* @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
|
|
854
906
|
*/
|
|
855
907
|
triggerParticle({ id, name, duration, position, }: {
|
|
856
908
|
id?: string;
|
|
@@ -859,14 +911,15 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
859
911
|
position?: object;
|
|
860
912
|
}): Promise<ResponseType$1 | string>;
|
|
861
913
|
/**
|
|
862
|
-
* @summary
|
|
863
914
|
* Add an activity to a world
|
|
864
915
|
* excludeFromNotification is an array of visitorIds to exclude from the notification
|
|
865
916
|
*
|
|
866
|
-
* @
|
|
917
|
+
* @example
|
|
867
918
|
* ```ts
|
|
868
919
|
* await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
|
|
869
920
|
* ```
|
|
921
|
+
*
|
|
922
|
+
* @returns {Promise<ResponseType | string>} Returns the `activityId` or an error response.
|
|
870
923
|
*/
|
|
871
924
|
triggerActivity({ type, assetId, excludeFromNotification, }: {
|
|
872
925
|
type: WorldActivityType;
|
|
@@ -874,10 +927,9 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
874
927
|
excludeFromNotification?: (string | number)[];
|
|
875
928
|
}): Promise<ResponseType$1 | string>;
|
|
876
929
|
/**
|
|
877
|
-
* @summary
|
|
878
930
|
* Display a message via a toast to all visitors currently in a world.
|
|
879
931
|
*
|
|
880
|
-
* @
|
|
932
|
+
* @example
|
|
881
933
|
* ```ts
|
|
882
934
|
* await world.fireToast({
|
|
883
935
|
* groupId: "custom-message",
|
|
@@ -885,13 +937,16 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
885
937
|
* text: "Thank you for participating!",
|
|
886
938
|
* });
|
|
887
939
|
* ```
|
|
940
|
+
*
|
|
941
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
888
942
|
*/
|
|
889
943
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
890
944
|
/**
|
|
891
|
-
* @summary
|
|
892
945
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
893
946
|
*
|
|
894
|
-
* @
|
|
947
|
+
* @category Data Objects
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
895
950
|
* ```ts
|
|
896
951
|
* await world.fetchDataObject();
|
|
897
952
|
* const { dataObject } = world;
|
|
@@ -899,17 +954,23 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
899
954
|
*/
|
|
900
955
|
fetchDataObject: (appPublicKey?: string, appJWT?: string) => Promise<void | ResponseType$1>;
|
|
901
956
|
/**
|
|
902
|
-
* @summary
|
|
903
957
|
* Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
|
|
904
958
|
*
|
|
959
|
+
* @remarks
|
|
905
960
|
* 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
961
|
*
|
|
907
|
-
* @
|
|
962
|
+
* @category Data Objects
|
|
963
|
+
*
|
|
964
|
+
* @example
|
|
908
965
|
* ```ts
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
966
|
+
await world.setDataObject(
|
|
967
|
+
{
|
|
968
|
+
...defaultGameData,
|
|
969
|
+
keyAssetId: droppedAsset.id,
|
|
970
|
+
},
|
|
971
|
+
{ lock: { lock: { lockId: `${keyAssetId}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` }, releaseLock: true } },
|
|
972
|
+
);
|
|
973
|
+
* const { profileMapper } = world.dataObject;
|
|
913
974
|
* ```
|
|
914
975
|
*/
|
|
915
976
|
setDataObject: (dataObject: object | null | undefined, options?: {
|
|
@@ -924,17 +985,20 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
924
985
|
};
|
|
925
986
|
}) => Promise<void | ResponseType$1>;
|
|
926
987
|
/**
|
|
927
|
-
* @summary
|
|
928
988
|
* Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
929
989
|
*
|
|
990
|
+
* @remarks
|
|
930
991
|
* 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
992
|
*
|
|
932
|
-
* @
|
|
993
|
+
* @category Data Objects
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
933
996
|
* ```ts
|
|
934
997
|
* await world.updateDataObject({
|
|
935
|
-
*
|
|
998
|
+
* [`keyAssets.${keyAssetId}.itemsCollectedByUser.${profileId}`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
999
|
+
* [`profileMapper.${profileId}`]: username,
|
|
936
1000
|
* });
|
|
937
|
-
* const {
|
|
1001
|
+
* const { profileMapper } = world.dataObject;
|
|
938
1002
|
* ```
|
|
939
1003
|
*/
|
|
940
1004
|
updateDataObject: (dataObject: object, options?: {
|
|
@@ -949,14 +1013,16 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
949
1013
|
};
|
|
950
1014
|
}) => Promise<void | ResponseType$1>;
|
|
951
1015
|
/**
|
|
952
|
-
* @summary
|
|
953
1016
|
* 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
1017
|
*
|
|
1018
|
+
* @remarks
|
|
955
1019
|
* 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
1020
|
*
|
|
957
|
-
* @
|
|
1021
|
+
* @category Data Objects
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
958
1024
|
* ```ts
|
|
959
|
-
* await world.incrementDataObjectValue(
|
|
1025
|
+
* await world.incrementDataObjectValue([`keyAssets.${keyAssetId}.totalItemsCollected.count`], 1);
|
|
960
1026
|
* ```
|
|
961
1027
|
*/
|
|
962
1028
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
@@ -971,10 +1037,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
971
1037
|
};
|
|
972
1038
|
}): Promise<void | ResponseType$1>;
|
|
973
1039
|
/**
|
|
974
|
-
* @summary
|
|
975
1040
|
* Retrieve all webhooks in a world.
|
|
976
1041
|
*
|
|
977
|
-
* @
|
|
1042
|
+
* @category Webhooks
|
|
1043
|
+
*
|
|
1044
|
+
* @example
|
|
978
1045
|
* ```ts
|
|
979
1046
|
* await world.fetchWebhooks();
|
|
980
1047
|
* const webhooks = world.webhooks;
|
|
@@ -982,10 +1049,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
982
1049
|
*/
|
|
983
1050
|
fetchWebhooks(): Promise<void | ResponseType$1>;
|
|
984
1051
|
/**
|
|
985
|
-
* @summary
|
|
986
1052
|
* Retrieve world analytics by day, week, month, quarter, or year
|
|
987
1053
|
*
|
|
988
|
-
* @
|
|
1054
|
+
* @category Analytics
|
|
1055
|
+
*
|
|
1056
|
+
* @example
|
|
989
1057
|
* ```ts
|
|
990
1058
|
* const analytics = await world.fetchWorldAnalytics({
|
|
991
1059
|
* periodType: "week",
|
|
@@ -1002,12 +1070,11 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
1002
1070
|
}
|
|
1003
1071
|
|
|
1004
1072
|
/**
|
|
1005
|
-
* @summary
|
|
1006
1073
|
* Create an instance of User class with optional session credentials.
|
|
1007
1074
|
*
|
|
1008
|
-
* @
|
|
1075
|
+
* @example
|
|
1009
1076
|
* ```ts
|
|
1010
|
-
* await new User(topia, {
|
|
1077
|
+
* const user = await new User(topia, {
|
|
1011
1078
|
* profileId: 1,
|
|
1012
1079
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
1013
1080
|
* });
|
|
@@ -1031,31 +1098,26 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1031
1098
|
get worlds(): {
|
|
1032
1099
|
[key: string]: World;
|
|
1033
1100
|
};
|
|
1034
|
-
/**
|
|
1035
|
-
* @summary
|
|
1036
|
-
* Verify user has valid interactive credentials
|
|
1037
|
-
*
|
|
1038
|
-
* @usage
|
|
1039
|
-
* ```ts
|
|
1040
|
-
* await user.checkInteractiveCredentials();
|
|
1041
|
-
* ```
|
|
1042
|
-
*/
|
|
1043
1101
|
checkInteractiveCredentials(): Promise<void | ResponseType$1>;
|
|
1044
1102
|
/**
|
|
1045
|
-
* @summary
|
|
1046
1103
|
* Returns all avatars owned by User
|
|
1047
1104
|
*
|
|
1048
|
-
* @
|
|
1105
|
+
* @category Avatars
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1049
1108
|
* ```ts
|
|
1050
1109
|
* const avatars = await user.fetchAvatars();
|
|
1051
1110
|
* ```
|
|
1111
|
+
*
|
|
1112
|
+
* @returns {Promise<void | ResponseType>} Returns the avatars or an error.
|
|
1052
1113
|
*/
|
|
1053
1114
|
fetchAvatars(): Promise<void | ResponseType$1>;
|
|
1054
1115
|
/**
|
|
1055
|
-
* @summary
|
|
1056
1116
|
* Add a new avatar
|
|
1057
1117
|
*
|
|
1058
|
-
* @
|
|
1118
|
+
* @category Avatars
|
|
1119
|
+
*
|
|
1120
|
+
* @example
|
|
1059
1121
|
* ```ts
|
|
1060
1122
|
* const animationMeta = {
|
|
1061
1123
|
* "emote": { "loop": false, "x": 0, "y": 0, "hideLoop": true }
|
|
@@ -1123,10 +1185,11 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1123
1185
|
*/
|
|
1124
1186
|
addAvatar(formData: FormData): Promise<void | ResponseType$1>;
|
|
1125
1187
|
/**
|
|
1126
|
-
* @summary
|
|
1127
1188
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1128
1189
|
*
|
|
1129
|
-
* @
|
|
1190
|
+
* @category Avatars
|
|
1191
|
+
*
|
|
1192
|
+
* @example
|
|
1130
1193
|
* ```ts
|
|
1131
1194
|
* const animationMeta = {
|
|
1132
1195
|
* "emote": { "loop": false, "x": 0, "y": 0, "hideLoop": true }
|
|
@@ -1194,20 +1257,22 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1194
1257
|
*/
|
|
1195
1258
|
updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType$1>;
|
|
1196
1259
|
/**
|
|
1197
|
-
* @summary
|
|
1198
1260
|
* Update avatar and sprite sheet records and upload files to existing sprite sheet and avatar storage buckets
|
|
1199
1261
|
*
|
|
1200
|
-
* @
|
|
1262
|
+
* @category Avatars
|
|
1263
|
+
*
|
|
1264
|
+
* @example
|
|
1201
1265
|
* ```ts
|
|
1202
1266
|
* await user.deleteAvatar("exampleAvatarId");
|
|
1203
1267
|
* ```
|
|
1204
1268
|
*/
|
|
1205
1269
|
deleteAvatar(avatarId: string): Promise<void | ResponseType$1>;
|
|
1206
1270
|
/**
|
|
1207
|
-
* @summary
|
|
1208
1271
|
* Returns all assets owned by User when an email address is provided.
|
|
1209
1272
|
*
|
|
1210
|
-
* @
|
|
1273
|
+
* @category Assets
|
|
1274
|
+
*
|
|
1275
|
+
* @example
|
|
1211
1276
|
* ```ts
|
|
1212
1277
|
* await user.fetchAssets();
|
|
1213
1278
|
* const userAssets = user.assets;
|
|
@@ -1215,20 +1280,24 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1215
1280
|
*/
|
|
1216
1281
|
fetchAssets(): Promise<void | ResponseType$1>;
|
|
1217
1282
|
/**
|
|
1218
|
-
* @summary
|
|
1219
1283
|
* Returns all platform assets.
|
|
1220
1284
|
*
|
|
1221
|
-
* @
|
|
1285
|
+
* @category Assets
|
|
1286
|
+
*
|
|
1287
|
+
* @example
|
|
1222
1288
|
* ```ts
|
|
1223
1289
|
* const assets = await user.fetchPlatformAssets();
|
|
1224
1290
|
* ```
|
|
1291
|
+
*
|
|
1292
|
+
* @returns {Promise<object | ResponseType>} Returns the platform assets or an error response.
|
|
1225
1293
|
*/
|
|
1226
1294
|
fetchPlatformAssets(): Promise<object | ResponseType$1>;
|
|
1227
1295
|
/**
|
|
1228
|
-
* @summary
|
|
1229
1296
|
* Returns all scenes owned by User.
|
|
1230
1297
|
*
|
|
1231
|
-
* @
|
|
1298
|
+
* @category Scenes
|
|
1299
|
+
*
|
|
1300
|
+
* @example
|
|
1232
1301
|
* ```ts
|
|
1233
1302
|
* await user.fetchScenes();
|
|
1234
1303
|
* const userScenes = user.scenes;
|
|
@@ -1236,30 +1305,28 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1236
1305
|
*/
|
|
1237
1306
|
fetchScenes(): Promise<void | ResponseType$1>;
|
|
1238
1307
|
/**
|
|
1239
|
-
*
|
|
1240
|
-
* Retrieves all worlds owned by user with matching API Key,
|
|
1241
|
-
* creates a new World object for each,
|
|
1242
|
-
* and creates new map of Worlds accessible via user.worlds.
|
|
1308
|
+
* 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.
|
|
1243
1309
|
*
|
|
1244
|
-
* @
|
|
1310
|
+
* @category Worlds
|
|
1311
|
+
*
|
|
1312
|
+
* @example
|
|
1245
1313
|
* ```ts
|
|
1246
1314
|
* await user.fetchWorldsByKey();
|
|
1247
1315
|
* const userWorlds = user.worlds;
|
|
1248
1316
|
* ```
|
|
1249
1317
|
*
|
|
1250
|
-
* @
|
|
1318
|
+
* @returns
|
|
1251
1319
|
* ```ts
|
|
1252
1320
|
* { urlSlug: new World({ apiKey, worldArgs, urlSlug }) }
|
|
1253
1321
|
* ```
|
|
1254
1322
|
*/
|
|
1255
1323
|
fetchWorldsByKey(): Promise<void | ResponseType$1>;
|
|
1256
1324
|
/**
|
|
1257
|
-
*
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
* and creates new map of Worlds accessible via user.adminWorlds.
|
|
1325
|
+
* 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.
|
|
1326
|
+
*
|
|
1327
|
+
* @category Worlds
|
|
1261
1328
|
*
|
|
1262
|
-
* @
|
|
1329
|
+
* @example
|
|
1263
1330
|
* ```ts
|
|
1264
1331
|
* await user.fetchAdminWorldsByKey();
|
|
1265
1332
|
* const adminWorlds = user.adminWorlds;
|
|
@@ -1267,25 +1334,29 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1267
1334
|
*/
|
|
1268
1335
|
fetchAdminWorldsByKey(): Promise<void | ResponseType$1>;
|
|
1269
1336
|
/**
|
|
1270
|
-
* @summary
|
|
1271
1337
|
* Retrieves ids of all dropped assets in all worlds with a matching interactivePublicKey.
|
|
1272
1338
|
*
|
|
1273
|
-
* @
|
|
1339
|
+
* @category Dropped Assets
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1274
1342
|
* ```ts
|
|
1275
1343
|
* await user.fetchInteractiveWorldsByKey("interactivePublicKeyExample");
|
|
1276
1344
|
* const interactiveWorlds = user.interactiveWorlds;
|
|
1277
1345
|
* ```
|
|
1346
|
+
*
|
|
1347
|
+
* @returns {Promise<object | ResponseType>} Returns the `urlSlugs` of worlds where the Public Key is found or an error response.
|
|
1278
1348
|
*/
|
|
1279
1349
|
fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType$1>;
|
|
1280
1350
|
/**
|
|
1281
|
-
* @summary
|
|
1282
1351
|
* Send an email
|
|
1283
1352
|
*
|
|
1284
|
-
* @
|
|
1353
|
+
* @example
|
|
1285
1354
|
* ```ts
|
|
1286
1355
|
* const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
|
|
1287
1356
|
* await user.sendEmail({ html, subject: "Example", to: "example@email.io" });
|
|
1288
1357
|
* ```
|
|
1358
|
+
*
|
|
1359
|
+
* @returns {Promise<object | ResponseType>} Returns `{ success: true }` if the email is sent successfully or an error response.
|
|
1289
1360
|
*/
|
|
1290
1361
|
sendEmail({ html, subject, to, }: {
|
|
1291
1362
|
html: string;
|
|
@@ -1293,39 +1364,53 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1293
1364
|
to: string;
|
|
1294
1365
|
}): Promise<object | ResponseType$1>;
|
|
1295
1366
|
/**
|
|
1296
|
-
* @summary
|
|
1297
1367
|
* Get expressions
|
|
1298
1368
|
*
|
|
1299
|
-
* @
|
|
1369
|
+
* @category Expressions
|
|
1370
|
+
*
|
|
1371
|
+
* @example
|
|
1300
1372
|
* ```ts
|
|
1301
1373
|
* await user.getExpressions({ getUnlockablesOnly: true, });
|
|
1302
1374
|
* ```
|
|
1375
|
+
*
|
|
1376
|
+
* @returns {Promise<ResponseType>} Returns an array of expressions or an error response.
|
|
1303
1377
|
*/
|
|
1304
1378
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1305
1379
|
name?: string;
|
|
1306
1380
|
getUnlockablesOnly?: boolean;
|
|
1307
1381
|
}): Promise<ResponseType$1>;
|
|
1308
1382
|
/**
|
|
1309
|
-
* @summary
|
|
1310
1383
|
* Retrieves the data object for a user.
|
|
1311
1384
|
*
|
|
1312
|
-
* @
|
|
1385
|
+
* @category Data Objects
|
|
1386
|
+
*
|
|
1387
|
+
* @example
|
|
1313
1388
|
* ```ts
|
|
1314
1389
|
* const dataObject = await user.fetchDataObject();
|
|
1315
1390
|
* ```
|
|
1391
|
+
*
|
|
1392
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1316
1393
|
*/
|
|
1317
1394
|
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
1318
1395
|
/**
|
|
1319
|
-
* @summary
|
|
1320
1396
|
* Sets the data object for a user.
|
|
1321
1397
|
*
|
|
1398
|
+
* @remarks
|
|
1322
1399
|
* 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
1400
|
*
|
|
1324
|
-
* @
|
|
1401
|
+
* @category Data Objects
|
|
1402
|
+
*
|
|
1403
|
+
* @example
|
|
1325
1404
|
* ```ts
|
|
1326
|
-
* await user.setDataObject(
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1405
|
+
* await user.setDataObject(
|
|
1406
|
+
* { itemsCollected: 0 },
|
|
1407
|
+
* {
|
|
1408
|
+
* analytics: [{ analyticName: "resets"} ],
|
|
1409
|
+
* lock: { lockId: `${assetId}-${itemsCollected}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
1410
|
+
* },
|
|
1411
|
+
* );
|
|
1412
|
+
*
|
|
1413
|
+
* const { itemsCollected } = user.dataObject;
|
|
1329
1414
|
* ```
|
|
1330
1415
|
*/
|
|
1331
1416
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -1340,16 +1425,22 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1340
1425
|
};
|
|
1341
1426
|
}): Promise<void | ResponseType$1>;
|
|
1342
1427
|
/**
|
|
1343
|
-
* @summary
|
|
1344
1428
|
* Updates the data object for a user.
|
|
1345
1429
|
*
|
|
1430
|
+
* @remarks
|
|
1346
1431
|
* 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
1432
|
*
|
|
1348
|
-
* @
|
|
1433
|
+
* @category Data Objects
|
|
1434
|
+
*
|
|
1435
|
+
* @example
|
|
1349
1436
|
* ```ts
|
|
1437
|
+
* const theme = "exampleTheme";
|
|
1438
|
+
*
|
|
1350
1439
|
* await user.updateDataObject({
|
|
1351
|
-
*
|
|
1440
|
+
* [`${theme}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
1352
1441
|
* });
|
|
1442
|
+
*
|
|
1443
|
+
* const { exampleTheme } = user.dataObject;
|
|
1353
1444
|
* ```
|
|
1354
1445
|
*/
|
|
1355
1446
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -1364,12 +1455,14 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1364
1455
|
};
|
|
1365
1456
|
}): Promise<void | ResponseType$1>;
|
|
1366
1457
|
/**
|
|
1367
|
-
* @summary
|
|
1368
1458
|
* 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
1459
|
*
|
|
1460
|
+
* @remarks
|
|
1370
1461
|
* 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
1462
|
*
|
|
1372
|
-
* @
|
|
1463
|
+
* @category Data Objects
|
|
1464
|
+
*
|
|
1465
|
+
* @example
|
|
1373
1466
|
* ```ts
|
|
1374
1467
|
* await user.incrementDataObjectValue("key", 1);
|
|
1375
1468
|
* ```
|
|
@@ -1388,12 +1481,11 @@ declare class User extends SDKController implements UserInterface {
|
|
|
1388
1481
|
}
|
|
1389
1482
|
|
|
1390
1483
|
/**
|
|
1391
|
-
* @summary
|
|
1392
1484
|
* Create an instance of Visitor class with a given id and optional attributes and session credentials.
|
|
1393
1485
|
*
|
|
1394
|
-
* @
|
|
1486
|
+
* @example
|
|
1395
1487
|
* ```ts
|
|
1396
|
-
* await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" } });
|
|
1488
|
+
* const visitor = await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" } });
|
|
1397
1489
|
* ```
|
|
1398
1490
|
*/
|
|
1399
1491
|
declare class Visitor extends User implements VisitorInterface {
|
|
@@ -1402,23 +1494,21 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1402
1494
|
user?: User;
|
|
1403
1495
|
constructor(topia: Topia, id: number, urlSlug: string, options?: VisitorOptionalInterface);
|
|
1404
1496
|
/**
|
|
1405
|
-
* @summary
|
|
1406
1497
|
* Get a single visitor from a world
|
|
1407
1498
|
*
|
|
1408
|
-
* @
|
|
1499
|
+
* @example
|
|
1409
1500
|
* ```ts
|
|
1410
1501
|
* await visitor.fetchVisitor();
|
|
1411
1502
|
* ```
|
|
1412
1503
|
*
|
|
1413
|
-
* @
|
|
1504
|
+
* @returns
|
|
1414
1505
|
* Returns details for a visitor in a world by id and urlSlug
|
|
1415
1506
|
*/
|
|
1416
1507
|
fetchVisitor(): Promise<void | ResponseType$1>;
|
|
1417
1508
|
/**
|
|
1418
|
-
* @summary
|
|
1419
1509
|
* Teleport or walk a visitor currently in a world to a single set of coordinates.
|
|
1420
1510
|
*
|
|
1421
|
-
* @
|
|
1511
|
+
* @example
|
|
1422
1512
|
* ```ts
|
|
1423
1513
|
* await visitor.moveVisitor({
|
|
1424
1514
|
* shouldTeleportVisitor: true,
|
|
@@ -1427,15 +1517,14 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1427
1517
|
* });
|
|
1428
1518
|
* ```
|
|
1429
1519
|
*
|
|
1430
|
-
* @
|
|
1431
|
-
*
|
|
1520
|
+
* @returns
|
|
1521
|
+
* Returns `{ success: true }` if the visitor was moved successfully.
|
|
1432
1522
|
*/
|
|
1433
1523
|
moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
|
|
1434
1524
|
/**
|
|
1435
|
-
* @summary
|
|
1436
1525
|
* Display a message via a toast to a visitor currently in a world.
|
|
1437
1526
|
*
|
|
1438
|
-
* @
|
|
1527
|
+
* @example
|
|
1439
1528
|
* ```ts
|
|
1440
1529
|
* await visitor.fireToast({
|
|
1441
1530
|
* groupId: "custom-message",
|
|
@@ -1443,13 +1532,16 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1443
1532
|
* text: "Thank you for participating!",
|
|
1444
1533
|
* });
|
|
1445
1534
|
* ```
|
|
1535
|
+
*
|
|
1536
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1446
1537
|
*/
|
|
1447
1538
|
fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
|
|
1448
1539
|
/**
|
|
1449
|
-
* @summary
|
|
1450
1540
|
* Open an iframe in a drawer or modal for a visitor currently in a world.
|
|
1451
1541
|
*
|
|
1452
|
-
* @
|
|
1542
|
+
* @category iframes
|
|
1543
|
+
*
|
|
1544
|
+
* @example
|
|
1453
1545
|
* ```ts
|
|
1454
1546
|
* await visitor.openIframe({
|
|
1455
1547
|
* droppedAssetId: "droppedAssetId",
|
|
@@ -1458,83 +1550,103 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1458
1550
|
* title: "Hello World",
|
|
1459
1551
|
* });
|
|
1460
1552
|
* ```
|
|
1553
|
+
*
|
|
1554
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1461
1555
|
*/
|
|
1462
1556
|
openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType$1>;
|
|
1463
1557
|
/**
|
|
1464
|
-
* @summary
|
|
1465
1558
|
* Reload an iframe for a visitor currently in a world.
|
|
1466
1559
|
*
|
|
1467
|
-
* @
|
|
1560
|
+
* @category iframes
|
|
1561
|
+
*
|
|
1562
|
+
* @example
|
|
1468
1563
|
* ```ts
|
|
1469
1564
|
* await visitor.reloadIframe("droppedAssetId");
|
|
1470
1565
|
* ```
|
|
1566
|
+
*
|
|
1567
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1471
1568
|
*/
|
|
1472
1569
|
reloadIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
|
|
1473
1570
|
/**
|
|
1474
|
-
* @summary
|
|
1475
1571
|
* Close an iframe for a visitor currently in a world.
|
|
1476
1572
|
*
|
|
1477
|
-
* @
|
|
1573
|
+
* @category iframes
|
|
1574
|
+
*
|
|
1575
|
+
* @example
|
|
1478
1576
|
* ```ts
|
|
1479
1577
|
* await visitor.closeIframe("droppedAssetId");
|
|
1480
1578
|
* ```
|
|
1579
|
+
*
|
|
1580
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1481
1581
|
*/
|
|
1482
1582
|
closeIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
|
|
1483
1583
|
/**
|
|
1484
|
-
* @summary
|
|
1485
1584
|
* Mute and turn video off for a visitor currently in a world.
|
|
1486
1585
|
*
|
|
1487
|
-
* @
|
|
1586
|
+
* @example
|
|
1488
1587
|
* ```ts
|
|
1489
1588
|
* await visitor.turnAVOff();
|
|
1490
1589
|
* ```
|
|
1590
|
+
*
|
|
1591
|
+
* @returns {Promise<void | ResponseType>} Returns `{ success: true }` or an error.
|
|
1491
1592
|
*/
|
|
1492
1593
|
turnAVOff(): Promise<void | ResponseType$1>;
|
|
1493
1594
|
/**
|
|
1494
|
-
* @summary
|
|
1495
1595
|
* Get expressions
|
|
1496
1596
|
*
|
|
1497
|
-
* @
|
|
1597
|
+
* @category Expressions
|
|
1598
|
+
*
|
|
1599
|
+
* @example
|
|
1498
1600
|
* ```ts
|
|
1499
1601
|
* await visitor.getExpressions({ getUnlockablesOnly: true, });
|
|
1500
1602
|
* ```
|
|
1603
|
+
* @returns {Promise<ResponseType>} Returns an array of expressions or an error response.
|
|
1501
1604
|
*/
|
|
1502
1605
|
getExpressions({ name, getUnlockablesOnly, }: {
|
|
1503
1606
|
name?: string;
|
|
1504
1607
|
getUnlockablesOnly?: boolean;
|
|
1505
1608
|
}): Promise<ResponseType$1>;
|
|
1506
1609
|
/**
|
|
1507
|
-
* @summary
|
|
1508
1610
|
* Grant expression to a visitor by id or name.
|
|
1509
1611
|
*
|
|
1510
|
-
* @
|
|
1612
|
+
* @category Expressions
|
|
1613
|
+
*
|
|
1614
|
+
* @example
|
|
1511
1615
|
* ```ts
|
|
1512
1616
|
* await visitor.grantExpression({ id: "exampleExpressionId" });
|
|
1513
1617
|
* await visitor.grantExpression({ name: "exampleExpressionName" });
|
|
1514
1618
|
* ```
|
|
1619
|
+
*
|
|
1620
|
+
* @returns {Promise<ResponseType>} Returns `{ success: true }` if the expression was granted successfully or an error response.
|
|
1515
1621
|
*/
|
|
1516
1622
|
grantExpression({ id, name }: {
|
|
1517
1623
|
id?: string;
|
|
1518
1624
|
name?: string;
|
|
1519
1625
|
}): Promise<ResponseType$1>;
|
|
1520
1626
|
/**
|
|
1521
|
-
* @summary
|
|
1522
1627
|
* Get all particles available
|
|
1523
1628
|
*
|
|
1524
|
-
* @
|
|
1629
|
+
* @category Particle Effects
|
|
1630
|
+
*
|
|
1631
|
+
* @example
|
|
1525
1632
|
* ```ts
|
|
1526
1633
|
* await visitor.getAllParticles();
|
|
1527
1634
|
* ```
|
|
1635
|
+
*
|
|
1636
|
+
* @returns {Promise<ResponseType>} Returns an array of particles or an error response.
|
|
1528
1637
|
*/
|
|
1529
1638
|
getAllParticles(): Promise<ResponseType$1>;
|
|
1530
1639
|
/**
|
|
1531
|
-
* @summary
|
|
1532
1640
|
* Trigger a particle effect on a visitor
|
|
1533
1641
|
*
|
|
1534
|
-
* @
|
|
1642
|
+
* @category Particle Effects
|
|
1643
|
+
*
|
|
1644
|
+
* @example
|
|
1535
1645
|
* ```ts
|
|
1536
1646
|
* await visitor.triggerParticle({ name: "Flame" });
|
|
1537
1647
|
* ```
|
|
1648
|
+
*
|
|
1649
|
+
* @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
|
|
1538
1650
|
*/
|
|
1539
1651
|
triggerParticle({ id, name, duration, }: {
|
|
1540
1652
|
id?: string;
|
|
@@ -1542,26 +1654,37 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1542
1654
|
duration?: number;
|
|
1543
1655
|
}): Promise<ResponseType$1 | string>;
|
|
1544
1656
|
/**
|
|
1545
|
-
* @summary
|
|
1546
1657
|
* Retrieves the data object for a visitor.
|
|
1547
1658
|
*
|
|
1548
|
-
* @
|
|
1659
|
+
* @category Data Objects
|
|
1660
|
+
*
|
|
1661
|
+
* @example
|
|
1549
1662
|
* ```ts
|
|
1550
1663
|
* const dataObject = await visitor.fetchDataObject();
|
|
1551
1664
|
* ```
|
|
1665
|
+
*
|
|
1666
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
1552
1667
|
*/
|
|
1553
1668
|
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
1554
1669
|
/**
|
|
1555
|
-
* @summary
|
|
1556
1670
|
* Sets the data object for a visitor.
|
|
1557
1671
|
*
|
|
1672
|
+
* @remarks
|
|
1558
1673
|
* 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
1674
|
*
|
|
1560
|
-
* @
|
|
1675
|
+
* @category Data Objects
|
|
1676
|
+
*
|
|
1677
|
+
* @example
|
|
1561
1678
|
* ```ts
|
|
1562
|
-
* await visitor.setDataObject(
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
1679
|
+
* await visitor.setDataObject(
|
|
1680
|
+
* { itemsCollected: 0 },
|
|
1681
|
+
* {
|
|
1682
|
+
* analytics: [{ analyticName: "resets"} ],
|
|
1683
|
+
* lock: { lockId: `${assetId}-${itemsCollected}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
1684
|
+
* },
|
|
1685
|
+
* );
|
|
1686
|
+
*
|
|
1687
|
+
* const { itemsCollected } = visitor.dataObject;
|
|
1565
1688
|
* ```
|
|
1566
1689
|
*/
|
|
1567
1690
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -1576,16 +1699,22 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1576
1699
|
};
|
|
1577
1700
|
}): Promise<void | ResponseType$1>;
|
|
1578
1701
|
/**
|
|
1579
|
-
* @summary
|
|
1580
1702
|
* Updates the data object for a visitor.
|
|
1581
1703
|
*
|
|
1704
|
+
* @remarks
|
|
1582
1705
|
* 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
1706
|
*
|
|
1584
|
-
* @
|
|
1707
|
+
* @category Data Objects
|
|
1708
|
+
*
|
|
1709
|
+
* @example
|
|
1585
1710
|
* ```ts
|
|
1711
|
+
* const theme = "exampleTheme";
|
|
1712
|
+
*
|
|
1586
1713
|
* await visitor.updateDataObject({
|
|
1587
|
-
*
|
|
1714
|
+
* [`${theme}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
1588
1715
|
* });
|
|
1716
|
+
*
|
|
1717
|
+
* const { exampleTheme } = visitor.dataObject;
|
|
1589
1718
|
* ```
|
|
1590
1719
|
*/
|
|
1591
1720
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -1600,12 +1729,14 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1600
1729
|
};
|
|
1601
1730
|
}): Promise<void | ResponseType$1>;
|
|
1602
1731
|
/**
|
|
1603
|
-
* @summary
|
|
1604
1732
|
* 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
1733
|
*
|
|
1734
|
+
* @remarks
|
|
1606
1735
|
* 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
1736
|
*
|
|
1608
|
-
* @
|
|
1737
|
+
* @category Data Objects
|
|
1738
|
+
*
|
|
1739
|
+
* @example
|
|
1609
1740
|
* ```ts
|
|
1610
1741
|
* await visitor.incrementDataObjectValue("key", 1);
|
|
1611
1742
|
* ```
|
|
@@ -1622,20 +1753,18 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1622
1753
|
};
|
|
1623
1754
|
}): Promise<void | ResponseType$1>;
|
|
1624
1755
|
/**
|
|
1625
|
-
* @summary
|
|
1626
1756
|
* Update analytics for a given public key. Must have valid interactive credentials from a visitor in the world.
|
|
1627
1757
|
*
|
|
1628
|
-
* @
|
|
1758
|
+
* @example
|
|
1629
1759
|
* ```ts
|
|
1630
1760
|
* await visitor.updatePublicKeyAnalytics([{ analyticName: "joins", profileId, uniqueKey: profileId, urlSlug }]);
|
|
1631
1761
|
* ```
|
|
1632
1762
|
*/
|
|
1633
1763
|
updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
|
|
1634
1764
|
/**
|
|
1635
|
-
* @summary
|
|
1636
1765
|
* Setup signal to visitor
|
|
1637
1766
|
*
|
|
1638
|
-
* @
|
|
1767
|
+
* @example
|
|
1639
1768
|
* ```ts
|
|
1640
1769
|
* await visitor.sendSignalToVisitor(iceServers);
|
|
1641
1770
|
* ```
|
|
@@ -2123,10 +2252,9 @@ interface WorldWebhooksInterface {
|
|
|
2123
2252
|
}
|
|
2124
2253
|
|
|
2125
2254
|
/**
|
|
2126
|
-
* @summary
|
|
2127
2255
|
* Create a single instance of Topia axios used for all calls to the public API in all classes
|
|
2128
2256
|
*
|
|
2129
|
-
* @
|
|
2257
|
+
* @example
|
|
2130
2258
|
* ```ts
|
|
2131
2259
|
* const topia = await new Topia({
|
|
2132
2260
|
* apiDomain: "api.topia.io",
|
|
@@ -2155,10 +2283,9 @@ declare class Topia implements TopiaInterface {
|
|
|
2155
2283
|
}
|
|
2156
2284
|
|
|
2157
2285
|
/**
|
|
2158
|
-
* @summary
|
|
2159
2286
|
* Create an instance of SDKController class with credentials.
|
|
2160
2287
|
*
|
|
2161
|
-
* @
|
|
2288
|
+
* @example
|
|
2162
2289
|
* ```ts
|
|
2163
2290
|
* const credentials = {
|
|
2164
2291
|
* assetId: "exampleAsset",
|
|
@@ -2203,12 +2330,11 @@ declare abstract class SDKController implements SDKInterface {
|
|
|
2203
2330
|
}
|
|
2204
2331
|
|
|
2205
2332
|
/**
|
|
2206
|
-
* @summary
|
|
2207
2333
|
* Create an instance of Asset class with a given asset id and optional attributes and session credentials.
|
|
2208
2334
|
*
|
|
2209
|
-
* @
|
|
2335
|
+
* @example
|
|
2210
2336
|
* ```ts
|
|
2211
|
-
* await new Asset(topia, "id", {
|
|
2337
|
+
* const asset = await new Asset(topia, "id", {
|
|
2212
2338
|
* attributes: { assetName: "My Asset", isPublic: false },
|
|
2213
2339
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2214
2340
|
* });
|
|
@@ -2218,21 +2344,21 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2218
2344
|
readonly id?: string;
|
|
2219
2345
|
constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
|
|
2220
2346
|
/**
|
|
2221
|
-
*
|
|
2222
|
-
* Retrieves platform asset details.
|
|
2347
|
+
* Retrieves platform asset details and assigns response data to the instance.
|
|
2223
2348
|
*
|
|
2224
|
-
* @
|
|
2349
|
+
* @example
|
|
2225
2350
|
* ```ts
|
|
2226
2351
|
* await asset.fetchAssetById();
|
|
2227
2352
|
* const { assetName } = asset;
|
|
2228
2353
|
* ```
|
|
2354
|
+
*
|
|
2355
|
+
* @returns {Promise<object | ResponseType>} Returns the asset details or an error response.
|
|
2229
2356
|
*/
|
|
2230
2357
|
fetchAssetById(): Promise<object | ResponseType$1>;
|
|
2231
2358
|
/**
|
|
2232
|
-
* @summary
|
|
2233
2359
|
* Updates platform asset details.
|
|
2234
2360
|
*
|
|
2235
|
-
* @
|
|
2361
|
+
* @example
|
|
2236
2362
|
* ```ts
|
|
2237
2363
|
* await asset.updateAsset({
|
|
2238
2364
|
* assetName: "exampleAsset",
|
|
@@ -2258,12 +2384,11 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
2258
2384
|
}
|
|
2259
2385
|
|
|
2260
2386
|
/**
|
|
2261
|
-
* @summary
|
|
2262
2387
|
* Create an instance of Ecosystem class with optional session credentials
|
|
2263
2388
|
*
|
|
2264
|
-
* @
|
|
2389
|
+
* @example
|
|
2265
2390
|
* ```ts
|
|
2266
|
-
* await new Ecosystem(topia, {
|
|
2391
|
+
* const ecosystem =await new Ecosystem(topia, {
|
|
2267
2392
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2268
2393
|
* });
|
|
2269
2394
|
* ```
|
|
@@ -2272,27 +2397,35 @@ declare class Ecosystem extends SDKController {
|
|
|
2272
2397
|
dataObject?: object | null | undefined;
|
|
2273
2398
|
constructor(topia: Topia, options?: EcosystemOptionalInterface);
|
|
2274
2399
|
/**
|
|
2275
|
-
* @summary
|
|
2276
2400
|
* Retrieves the data object for a Topia ecosystem. Requires canUpdateEcosystemDataObjects permission to be set to true for the public key.
|
|
2277
2401
|
*
|
|
2278
|
-
* @
|
|
2402
|
+
* @category Data Objects
|
|
2403
|
+
*
|
|
2404
|
+
* @example
|
|
2279
2405
|
* ```ts
|
|
2280
2406
|
* const dataObject = await ecosystem.fetchDataObject("exampleAppPublicKey", "exampleAppPublicKeyJWT");
|
|
2281
2407
|
* ```
|
|
2408
|
+
*
|
|
2409
|
+
* @returns {Promise<object | ResponseType>} Returns the data object or an error response.
|
|
2282
2410
|
*/
|
|
2283
2411
|
fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
|
|
2284
2412
|
/**
|
|
2285
|
-
* @summary
|
|
2286
2413
|
* Sets the data object for a Topia ecosystem.
|
|
2287
2414
|
*
|
|
2415
|
+
* @remarks
|
|
2416
|
+
* 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.
|
|
2417
|
+
*
|
|
2288
2418
|
* 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
2419
|
*
|
|
2290
|
-
* @
|
|
2420
|
+
* @category Data Objects
|
|
2421
|
+
*
|
|
2422
|
+
* @example
|
|
2291
2423
|
* ```ts
|
|
2292
2424
|
* await ecosystem.setDataObject({ "exampleKey": "exampleValue" }, {
|
|
2293
2425
|
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
2294
2426
|
* sharedAppJWT: "exampleAppPublicKeyJWT",}
|
|
2295
2427
|
* });
|
|
2428
|
+
* const { exampleKey } = ecosystem.dataObject;
|
|
2296
2429
|
* ```
|
|
2297
2430
|
*/
|
|
2298
2431
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
@@ -2307,17 +2440,28 @@ declare class Ecosystem extends SDKController {
|
|
|
2307
2440
|
};
|
|
2308
2441
|
}): Promise<void | ResponseType$1>;
|
|
2309
2442
|
/**
|
|
2310
|
-
* @summary
|
|
2311
2443
|
* Updates the data object for a Topia ecosystem.
|
|
2312
2444
|
*
|
|
2445
|
+
* @remarks
|
|
2446
|
+
* 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.
|
|
2447
|
+
*
|
|
2313
2448
|
* 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
2449
|
*
|
|
2315
|
-
* @
|
|
2450
|
+
* @category Data Objects
|
|
2451
|
+
*
|
|
2452
|
+
* @example
|
|
2316
2453
|
* ```ts
|
|
2317
|
-
* await ecosystem.updateDataObject({
|
|
2318
|
-
*
|
|
2319
|
-
*
|
|
2454
|
+
* await ecosystem.updateDataObject({
|
|
2455
|
+
* [`profiles.${profileId}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
|
|
2456
|
+
* [`profileMapper.${profileId}`]: username,
|
|
2457
|
+
* }, {
|
|
2458
|
+
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
2459
|
+
* sharedAppJWT: "exampleAppPublicKeyJWT",
|
|
2460
|
+
* analytics: [{ analyticName: "itemCollected", profileId, uniqueKey: profileId, urlSlug } ],
|
|
2461
|
+
* lock: { lockId: `${assetId}-${resetCount}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
|
|
2462
|
+
* }
|
|
2320
2463
|
* });
|
|
2464
|
+
* const { exampleKey } = ecosystem.dataObject;
|
|
2321
2465
|
* ```
|
|
2322
2466
|
*/
|
|
2323
2467
|
updateDataObject(dataObject: object, options?: {
|
|
@@ -2332,12 +2476,16 @@ declare class Ecosystem extends SDKController {
|
|
|
2332
2476
|
};
|
|
2333
2477
|
}): Promise<void | ResponseType$1>;
|
|
2334
2478
|
/**
|
|
2335
|
-
* @summary
|
|
2336
2479
|
* 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
2480
|
*
|
|
2481
|
+
* @remarks
|
|
2482
|
+
* 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.
|
|
2483
|
+
*
|
|
2338
2484
|
* 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
2485
|
*
|
|
2340
|
-
* @
|
|
2486
|
+
* @category Data Objects
|
|
2487
|
+
*
|
|
2488
|
+
* @example
|
|
2341
2489
|
* ```ts
|
|
2342
2490
|
* await ecosystem.incrementDataObjectValue("key", 1, {
|
|
2343
2491
|
* sharedAppPublicKey: "exampleAppPublicKey",
|
|
@@ -2359,12 +2507,11 @@ declare class Ecosystem extends SDKController {
|
|
|
2359
2507
|
}
|
|
2360
2508
|
|
|
2361
2509
|
/**
|
|
2362
|
-
* @summary
|
|
2363
2510
|
* Create an instance of WebRTCConnector class with optional session credentials.
|
|
2364
2511
|
*
|
|
2365
|
-
* @
|
|
2512
|
+
* @example
|
|
2366
2513
|
* ```ts
|
|
2367
|
-
* await new WebRTCConnector(topia, {
|
|
2514
|
+
* const webRTC = await new WebRTCConnector(topia, {
|
|
2368
2515
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2369
2516
|
* });
|
|
2370
2517
|
* ```
|
|
@@ -2374,10 +2521,9 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
|
|
|
2374
2521
|
urlSlug: string;
|
|
2375
2522
|
constructor(topia: Topia, urlSlug: string, options?: WebRTCConnectorOptionalInterface);
|
|
2376
2523
|
/**
|
|
2377
|
-
* @summary
|
|
2378
2524
|
* Get twilio
|
|
2379
2525
|
*
|
|
2380
|
-
* @
|
|
2526
|
+
* @example
|
|
2381
2527
|
* ```ts
|
|
2382
2528
|
* await webRTCConnector.getTwilioConfig();
|
|
2383
2529
|
* ```
|
|
@@ -2386,14 +2532,14 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
|
|
|
2386
2532
|
}
|
|
2387
2533
|
|
|
2388
2534
|
/**
|
|
2389
|
-
* @summary
|
|
2390
2535
|
* Create an instance of WorldActivity class with a given url slug and optional attributes and session credentials.
|
|
2391
2536
|
*
|
|
2537
|
+
* @remarks
|
|
2392
2538
|
* This class is responsible for all activity of a specified world including editing dropped assets, moving current visitors, etc.
|
|
2393
2539
|
*
|
|
2394
|
-
* @
|
|
2540
|
+
* @example
|
|
2395
2541
|
* ```ts
|
|
2396
|
-
* await new WorldActivity(topia, "exampleWorld", {
|
|
2542
|
+
* const activity = await new WorldActivity(topia, "exampleWorld", {
|
|
2397
2543
|
* attributes: { name: "Example World" },
|
|
2398
2544
|
* credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
|
|
2399
2545
|
* });
|
|
@@ -2408,25 +2554,31 @@ declare class WorldActivity extends SDKController {
|
|
|
2408
2554
|
};
|
|
2409
2555
|
private fetchVisitors;
|
|
2410
2556
|
/**
|
|
2411
|
-
* @summary
|
|
2412
2557
|
* Retrieve all visitors currently in a world.
|
|
2413
2558
|
*
|
|
2414
|
-
* @
|
|
2559
|
+
* @category Visitors
|
|
2560
|
+
*
|
|
2561
|
+
* @example
|
|
2415
2562
|
* ```ts
|
|
2416
2563
|
* const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
|
|
2417
2564
|
* ```
|
|
2565
|
+
*
|
|
2566
|
+
* @returns {Promise<void | ResponseType>} Returns the an object containing current visitors keyed by visitorId or an error.
|
|
2418
2567
|
*/
|
|
2419
2568
|
currentVisitors(shouldIncludeAdminPermissions?: boolean): Promise<{
|
|
2420
2569
|
[key: string]: Visitor;
|
|
2421
2570
|
}>;
|
|
2422
2571
|
/**
|
|
2423
|
-
* @summary
|
|
2424
2572
|
* Retrieve all visitors currently in a Landmark Zone.
|
|
2425
2573
|
*
|
|
2426
|
-
* @
|
|
2574
|
+
* @category Visitors
|
|
2575
|
+
*
|
|
2576
|
+
* @example
|
|
2427
2577
|
* ```ts
|
|
2428
2578
|
* const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
|
|
2429
2579
|
* ```
|
|
2580
|
+
*
|
|
2581
|
+
* @returns {Promise<void | ResponseType>} Returns the an object containing current visitors keyed by visitorId or an error.
|
|
2430
2582
|
*/
|
|
2431
2583
|
fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }: {
|
|
2432
2584
|
droppedAssetId?: string;
|
|
@@ -2435,12 +2587,15 @@ declare class WorldActivity extends SDKController {
|
|
|
2435
2587
|
[key: string]: Visitor;
|
|
2436
2588
|
}>;
|
|
2437
2589
|
/**
|
|
2438
|
-
* @summary
|
|
2439
2590
|
* Move all visitors currently in a world to a single set of coordinates.
|
|
2591
|
+
*
|
|
2592
|
+
* @remarks
|
|
2440
2593
|
* Optionally refetch visitors, teleport or walk visitors to new location,
|
|
2441
2594
|
* and scatter visitors by any number so that they don't all move to the exact same location.
|
|
2442
2595
|
*
|
|
2443
|
-
* @
|
|
2596
|
+
* @category Visitors
|
|
2597
|
+
*
|
|
2598
|
+
* @example
|
|
2444
2599
|
* ```ts
|
|
2445
2600
|
* await worldActivity.moveAllVisitors({
|
|
2446
2601
|
* shouldFetchVisitors: true,
|
|
@@ -2451,15 +2606,16 @@ declare class WorldActivity extends SDKController {
|
|
|
2451
2606
|
* });
|
|
2452
2607
|
* ```
|
|
2453
2608
|
*
|
|
2454
|
-
* @
|
|
2609
|
+
* @returns
|
|
2455
2610
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
2456
2611
|
*/
|
|
2457
2612
|
moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType$1)[] | undefined>;
|
|
2458
2613
|
/**
|
|
2459
|
-
* @summary
|
|
2460
2614
|
* Teleport or walk a list of visitors currently in a world to various coordinates.
|
|
2461
2615
|
*
|
|
2462
|
-
* @
|
|
2616
|
+
* @category Visitors
|
|
2617
|
+
*
|
|
2618
|
+
* @example
|
|
2463
2619
|
* ```ts
|
|
2464
2620
|
* const visitorsToMove = [
|
|
2465
2621
|
* {
|
|
@@ -2477,14 +2633,14 @@ declare class WorldActivity extends SDKController {
|
|
|
2477
2633
|
* await worldActivity.moveVisitors(visitorsToMove);
|
|
2478
2634
|
* ```
|
|
2479
2635
|
*
|
|
2480
|
-
* @
|
|
2636
|
+
* @returns
|
|
2481
2637
|
* Updates each Visitor instance and worldActivity.visitors map.
|
|
2482
2638
|
*/
|
|
2483
2639
|
moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType$1)[]>;
|
|
2484
2640
|
}
|
|
2485
2641
|
|
|
2486
2642
|
/**
|
|
2487
|
-
* @
|
|
2643
|
+
* @example
|
|
2488
2644
|
* ```ts
|
|
2489
2645
|
* const Asset = new AssetFactory(myTopiaInstance);
|
|
2490
2646
|
* ```
|
|
@@ -2492,20 +2648,20 @@ declare class WorldActivity extends SDKController {
|
|
|
2492
2648
|
declare class AssetFactory extends SDKController {
|
|
2493
2649
|
constructor(topia: Topia);
|
|
2494
2650
|
/**
|
|
2495
|
-
* @summary
|
|
2496
2651
|
* Instantiate a new instance of Asset class.
|
|
2497
2652
|
*
|
|
2498
|
-
* @
|
|
2653
|
+
* @example
|
|
2499
2654
|
* ```
|
|
2500
2655
|
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2501
2656
|
* ```
|
|
2657
|
+
*
|
|
2658
|
+
* @returns {Asset} Returns a new Asset object with the asset id.
|
|
2502
2659
|
*/
|
|
2503
2660
|
create(id: string, options?: AssetOptionalInterface): Asset;
|
|
2504
2661
|
/**
|
|
2505
|
-
* @summary
|
|
2506
2662
|
* Upload a new Asset and return a new instance of Asset class.
|
|
2507
2663
|
*
|
|
2508
|
-
* @
|
|
2664
|
+
* @example
|
|
2509
2665
|
* ```
|
|
2510
2666
|
* const assetPayload = {
|
|
2511
2667
|
* assetName: "exampleAssetName"
|
|
@@ -2517,12 +2673,14 @@ declare class AssetFactory extends SDKController {
|
|
|
2517
2673
|
* }
|
|
2518
2674
|
* const asset = await Asset.upload(assetPayload, apiKey);
|
|
2519
2675
|
* ```
|
|
2676
|
+
*
|
|
2677
|
+
* @returns {AssetType} Returns a new Asset object with the asset details.
|
|
2520
2678
|
*/
|
|
2521
2679
|
upload(assetPayload: AssetType, apiKey: string): Promise<Asset>;
|
|
2522
2680
|
}
|
|
2523
2681
|
|
|
2524
2682
|
/**
|
|
2525
|
-
* @
|
|
2683
|
+
* @example
|
|
2526
2684
|
* ```ts
|
|
2527
2685
|
* const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
|
|
2528
2686
|
* ```
|
|
@@ -2530,43 +2688,45 @@ declare class AssetFactory extends SDKController {
|
|
|
2530
2688
|
declare class DroppedAssetFactory extends SDKController {
|
|
2531
2689
|
constructor(topia: Topia);
|
|
2532
2690
|
/**
|
|
2533
|
-
* @summary
|
|
2534
2691
|
* Instantiate a new instance of DroppedAsset class.
|
|
2535
2692
|
*
|
|
2536
|
-
* @
|
|
2693
|
+
* @example
|
|
2537
2694
|
* ```
|
|
2538
2695
|
* const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2539
2696
|
* ```
|
|
2697
|
+
*
|
|
2698
|
+
* @returns {DroppedAsset} Returns a new DroppedAsset object.
|
|
2540
2699
|
*/
|
|
2541
2700
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
2542
2701
|
/**
|
|
2543
|
-
* @summary
|
|
2544
2702
|
* Instantiate a new instance of DroppedAsset class and retrieve all properties.
|
|
2545
2703
|
*
|
|
2546
|
-
* @
|
|
2704
|
+
* @example
|
|
2547
2705
|
* ```
|
|
2548
2706
|
* const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2549
2707
|
* ```
|
|
2708
|
+
*
|
|
2709
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2550
2710
|
*/
|
|
2551
2711
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
2552
2712
|
/**
|
|
2553
|
-
* @summary
|
|
2554
2713
|
* 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
2714
|
*
|
|
2556
|
-
* @
|
|
2715
|
+
* @remarks
|
|
2716
|
+
* 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.
|
|
2717
|
+
*
|
|
2718
|
+
* @example
|
|
2557
2719
|
* ```
|
|
2558
2720
|
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
|
|
2559
2721
|
* ```
|
|
2560
2722
|
*
|
|
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.
|
|
2723
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2563
2724
|
*/
|
|
2564
2725
|
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials): Promise<DroppedAsset>;
|
|
2565
2726
|
/**
|
|
2566
|
-
* @summary
|
|
2567
2727
|
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
2568
2728
|
*
|
|
2569
|
-
* @
|
|
2729
|
+
* @example
|
|
2570
2730
|
* ```
|
|
2571
2731
|
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2572
2732
|
* const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
|
|
@@ -2581,6 +2741,8 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2581
2741
|
urlSlug,
|
|
2582
2742
|
});
|
|
2583
2743
|
* ```
|
|
2744
|
+
*
|
|
2745
|
+
* @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties.
|
|
2584
2746
|
*/
|
|
2585
2747
|
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
2748
|
assetScale?: number;
|
|
@@ -2615,7 +2777,7 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2615
2777
|
}
|
|
2616
2778
|
|
|
2617
2779
|
/**
|
|
2618
|
-
* @
|
|
2780
|
+
* @example
|
|
2619
2781
|
* ```ts
|
|
2620
2782
|
* const Ecosystem = new EcosystemFactory(myTopiaInstance);
|
|
2621
2783
|
* ```
|
|
@@ -2624,19 +2786,20 @@ declare class EcosystemFactory {
|
|
|
2624
2786
|
topia: Topia;
|
|
2625
2787
|
constructor(topia: Topia);
|
|
2626
2788
|
/**
|
|
2627
|
-
* @summary
|
|
2628
2789
|
* Instantiate a new instance of Ecosystem class.
|
|
2629
2790
|
*
|
|
2630
|
-
* @
|
|
2791
|
+
* @example
|
|
2631
2792
|
* ```
|
|
2632
2793
|
* const ecosystemInstance = await Ecosystem.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId }});
|
|
2633
2794
|
* ```
|
|
2795
|
+
*
|
|
2796
|
+
* @returns {Ecosystem} Returns a new Ecosystem object.
|
|
2634
2797
|
*/
|
|
2635
2798
|
create(options?: EcosystemOptionalInterface): Ecosystem;
|
|
2636
2799
|
}
|
|
2637
2800
|
|
|
2638
2801
|
/**
|
|
2639
|
-
* @
|
|
2802
|
+
* @example
|
|
2640
2803
|
* ```ts
|
|
2641
2804
|
* const Scene = new SceneFactory(myTopiaInstance);
|
|
2642
2805
|
* ```
|
|
@@ -2645,29 +2808,31 @@ declare class SceneFactory {
|
|
|
2645
2808
|
topia: Topia;
|
|
2646
2809
|
constructor(topia: Topia);
|
|
2647
2810
|
/**
|
|
2648
|
-
* @summary
|
|
2649
2811
|
* Instantiate a new instance of Scene class.
|
|
2650
2812
|
*
|
|
2651
|
-
* @
|
|
2813
|
+
* @example
|
|
2652
2814
|
* ```
|
|
2653
2815
|
* const sceneInstance = await Scene.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2654
2816
|
* ```
|
|
2817
|
+
*
|
|
2818
|
+
* @returns {Scene} Returns a new Scene object.
|
|
2655
2819
|
*/
|
|
2656
2820
|
create(id: string, options?: SceneOptionalInterface): Scene;
|
|
2657
2821
|
/**
|
|
2658
|
-
* @summary
|
|
2659
2822
|
* Instantiate a new instance of Scene class and retrieve all properties.
|
|
2660
2823
|
*
|
|
2661
|
-
* @
|
|
2824
|
+
* @example
|
|
2662
2825
|
* ```
|
|
2663
2826
|
* const sceneInstance = await Scene.get(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2664
2827
|
* ```
|
|
2828
|
+
*
|
|
2829
|
+
* @returns {Promise<Scene>} Returns a new Scene object with all properties.
|
|
2665
2830
|
*/
|
|
2666
2831
|
get(id: string, options?: SceneOptionalInterface): Promise<Scene>;
|
|
2667
2832
|
}
|
|
2668
2833
|
|
|
2669
2834
|
/**
|
|
2670
|
-
* @
|
|
2835
|
+
* @example
|
|
2671
2836
|
* ```ts
|
|
2672
2837
|
* const User = new UserFactory(myTopiaInstance);
|
|
2673
2838
|
* ```
|
|
@@ -2676,19 +2841,20 @@ declare class UserFactory {
|
|
|
2676
2841
|
topia: Topia;
|
|
2677
2842
|
constructor(topia: Topia);
|
|
2678
2843
|
/**
|
|
2679
|
-
* @summary
|
|
2680
2844
|
* Instantiate a new instance of User class.
|
|
2681
2845
|
*
|
|
2682
|
-
* @
|
|
2846
|
+
* @example
|
|
2683
2847
|
* ```
|
|
2684
2848
|
* const userInstance = await User.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2685
2849
|
* ```
|
|
2850
|
+
*
|
|
2851
|
+
* @returns {User} Returns a new User object.
|
|
2686
2852
|
*/
|
|
2687
2853
|
create(options?: UserOptionalInterface): User;
|
|
2688
2854
|
}
|
|
2689
2855
|
|
|
2690
2856
|
/**
|
|
2691
|
-
* @
|
|
2857
|
+
* @example
|
|
2692
2858
|
* ```ts
|
|
2693
2859
|
* const Visitor = new VisitorFactory(myTopiaInstance);
|
|
2694
2860
|
* ```
|
|
@@ -2697,29 +2863,31 @@ declare class VisitorFactory {
|
|
|
2697
2863
|
topia: Topia;
|
|
2698
2864
|
constructor(topia: Topia);
|
|
2699
2865
|
/**
|
|
2700
|
-
* @summary
|
|
2701
2866
|
* Instantiate a new instance of Visitor class.
|
|
2702
2867
|
*
|
|
2703
|
-
* @
|
|
2868
|
+
* @example
|
|
2704
2869
|
* ```
|
|
2705
2870
|
* const visitorInstance = await Visitor.create(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2706
2871
|
* ```
|
|
2872
|
+
*
|
|
2873
|
+
* @returns {Visitor} Returns a new Visitor object.
|
|
2707
2874
|
*/
|
|
2708
2875
|
create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
|
|
2709
2876
|
/**
|
|
2710
|
-
* @summary
|
|
2711
2877
|
* Instantiate a new instance of Visitor class and retrieve all properties.
|
|
2712
2878
|
*
|
|
2713
|
-
* @
|
|
2879
|
+
* @example
|
|
2714
2880
|
* ```
|
|
2715
2881
|
* const visitorInstance = await Visitor.get(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2716
2882
|
* ```
|
|
2883
|
+
*
|
|
2884
|
+
* @returns {Promise<Visitor>} Returns a new Visitor object with all properties.
|
|
2717
2885
|
*/
|
|
2718
2886
|
get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
|
|
2719
2887
|
}
|
|
2720
2888
|
|
|
2721
2889
|
/**
|
|
2722
|
-
* @
|
|
2890
|
+
* @example
|
|
2723
2891
|
* ```ts
|
|
2724
2892
|
* const WebRTCConnector = new WebRTCConnectorFactory(myTopiaInstance);
|
|
2725
2893
|
* ```
|
|
@@ -2728,19 +2896,20 @@ declare class WebRTCConnectorFactory {
|
|
|
2728
2896
|
topia: Topia;
|
|
2729
2897
|
constructor(topia: Topia);
|
|
2730
2898
|
/**
|
|
2731
|
-
* @summary
|
|
2732
2899
|
* Instantiate a new instance of WebRTCConnector class.
|
|
2733
2900
|
*
|
|
2734
|
-
* @
|
|
2901
|
+
* @example
|
|
2735
2902
|
* ```
|
|
2736
2903
|
* const webRTCInstance = await WebRTCConnector.create({ credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId }, twilioConfig: {} });
|
|
2737
2904
|
* ```
|
|
2905
|
+
*
|
|
2906
|
+
* @returns {WebRTCConnector} Returns a new WebRTCConnector object.
|
|
2738
2907
|
*/
|
|
2739
2908
|
create(urlSlug: string, options?: WebRTCConnectorOptionalInterface): WebRTCConnector;
|
|
2740
2909
|
}
|
|
2741
2910
|
|
|
2742
2911
|
/**
|
|
2743
|
-
* @
|
|
2912
|
+
* @example
|
|
2744
2913
|
* ```ts
|
|
2745
2914
|
* const WorldActivity = new WorldActivityFactory(myTopiaInstance);
|
|
2746
2915
|
* ```
|
|
@@ -2749,19 +2918,20 @@ declare class WorldActivityFactory {
|
|
|
2749
2918
|
topia: Topia;
|
|
2750
2919
|
constructor(topia: Topia);
|
|
2751
2920
|
/**
|
|
2752
|
-
* @summary
|
|
2753
2921
|
* Instantiate a new instance of WorldActivity class.
|
|
2754
2922
|
*
|
|
2755
|
-
* @
|
|
2923
|
+
* @example
|
|
2756
2924
|
* ```
|
|
2757
2925
|
* const worldActivityInstance = await WorldActivity.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2758
2926
|
* ```
|
|
2927
|
+
*
|
|
2928
|
+
* @returns {WorldActivity} Returns a new WorldActivity object.
|
|
2759
2929
|
*/
|
|
2760
2930
|
create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
|
|
2761
2931
|
}
|
|
2762
2932
|
|
|
2763
2933
|
/**
|
|
2764
|
-
* @
|
|
2934
|
+
* @example
|
|
2765
2935
|
* ```ts
|
|
2766
2936
|
* const World = new WorldFactory(myTopiaInstance);
|
|
2767
2937
|
* ```
|
|
@@ -2769,23 +2939,25 @@ declare class WorldActivityFactory {
|
|
|
2769
2939
|
declare class WorldFactory extends SDKController {
|
|
2770
2940
|
constructor(topia: Topia);
|
|
2771
2941
|
/**
|
|
2772
|
-
* @summary
|
|
2773
2942
|
* Instantiate a new instance of World class.
|
|
2774
2943
|
*
|
|
2775
|
-
* @
|
|
2944
|
+
* @example
|
|
2776
2945
|
* ```
|
|
2777
2946
|
* const worldInstance = await World.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
|
|
2778
2947
|
* ```
|
|
2948
|
+
*
|
|
2949
|
+
* @returns {World} Returns a new World object.
|
|
2779
2950
|
*/
|
|
2780
2951
|
create(urlSlug: string, options?: WorldOptionalInterface): World;
|
|
2781
2952
|
/**
|
|
2782
|
-
* @summary
|
|
2783
2953
|
* Deletes an array of Dropped Assets from within a world and returns success: true
|
|
2784
2954
|
*
|
|
2785
|
-
* @
|
|
2955
|
+
* @example
|
|
2786
2956
|
* ```
|
|
2787
2957
|
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], interactiveSecret, credentials);
|
|
2788
2958
|
* ```
|
|
2959
|
+
*
|
|
2960
|
+
* @returns {Promise<{ success: boolean }>} Returns `{ success: true }` or an error.
|
|
2789
2961
|
*/
|
|
2790
2962
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
|
|
2791
2963
|
apiKey?: string;
|