@rtsdk/topia 0.17.6 → 0.17.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -117,9 +117,11 @@ type ResponseType$1 = {
117
117
  *
118
118
  * @example
119
119
  * ```ts
120
- * const scene = await new Scene(topia, "sceneId", {
120
+ * import { Scene } from "utils/topiaInit.ts";
121
+ *
122
+ * const scene = await Scene.get(exampleSceneId, {
121
123
  * attributes: { name: "My Scene" },
122
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
124
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
123
125
  * });
124
126
  * ```
125
127
  */
@@ -143,9 +145,10 @@ declare class Scene extends SDKController implements SceneInterface {
143
145
  *
144
146
  * @example
145
147
  * ```ts
146
- * const droppedAsset = await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
147
- * attributes: { text: "My Dropped Asset" },
148
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
148
+ * import { DroppedAsset } from "utils/topiaInit.ts";
149
+ *
150
+ * const droppedAsset = await DroppedAsset.get(exampleDroppedAssetId, exampleUrlSlug, {
151
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
149
152
  * });
150
153
  * ```
151
154
  */
@@ -622,9 +625,11 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
622
625
  *
623
626
  * @example
624
627
  * ```ts
625
- * const world = await new World(topia, "exampleWorld", {
628
+ * import { World } from "utils/topiaInit.ts";
629
+ *
630
+ * const world = await World.create(exampleUrlSlug, {
626
631
  * attributes: { name: "Example World" },
627
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
632
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
628
633
  * });
629
634
  * ```
630
635
  */
@@ -1076,9 +1081,11 @@ declare class World extends SDKController implements WorldInterface {
1076
1081
  *
1077
1082
  * @example
1078
1083
  * ```ts
1079
- * const user = await new User(topia, {
1080
- * profileId: 1,
1081
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
1084
+ * import { User } from "utils/topiaInit.ts";
1085
+ *
1086
+ * const user = await User.create({
1087
+ * profileId: "exampleProfileId",
1088
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", profileId: "exampleProfileId", visitorId: 1, urlSlug: "exampleUrlSlug" }
1082
1089
  * });
1083
1090
  * ```
1084
1091
  */
@@ -1487,7 +1494,9 @@ declare class User extends SDKController implements UserInterface {
1487
1494
  *
1488
1495
  * @example
1489
1496
  * ```ts
1490
- * const visitor = await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" } });
1497
+ * import { Visitor } from "utils/topiaInit.ts";
1498
+ *
1499
+ * const visitor = await Visitor.get(visitorId, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } }, credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", profileId: "exampleProfileId", visitorId: 1, urlSlug: "exampleUrlSlug" } });
1491
1500
  * ```
1492
1501
  */
1493
1502
  declare class Visitor extends User implements VisitorInterface {
@@ -1824,6 +1833,15 @@ interface SDKInterface {
1824
1833
 
1825
1834
  interface AssetInterface extends SDKInterface {
1826
1835
  fetchAssetById(): Promise<object | ResponseType>;
1836
+ updateAsset({ assetName, bottomLayerURL, creatorTags, isPublic, shouldUploadImages, tagJson, topLayerURL, }: {
1837
+ assetName: string;
1838
+ bottomLayerURL?: string;
1839
+ creatorTags: object;
1840
+ isPublic: boolean;
1841
+ shouldUploadImages?: boolean;
1842
+ tagJson: string;
1843
+ topLayerURL?: string;
1844
+ }): Promise<object | ResponseType>;
1827
1845
  addedOn?: string;
1828
1846
  assetName?: string;
1829
1847
  creatorTags?: object;
@@ -1859,10 +1877,16 @@ interface DroppedAssetInterface extends AssetInterface {
1859
1877
  updateCustomTextAsset(style: object | undefined | null, text: string | null | undefined): Promise<void | ResponseType$1>;
1860
1878
  updateMediaType({ audioRadius, audioSliderVolume, isVideo, mediaLink, mediaName, mediaType, portalName, syncUserMedia, }: UpdateMediaTypeInterface): Promise<void | ResponseType$1>;
1861
1879
  updateMuteZone(isMutezone: boolean): Promise<void | ResponseType$1>;
1880
+ updateLandmarkZone({ isLandmarkZoneEnabled, landmarkZoneName, landmarkZoneIsVisible, }: {
1881
+ isLandmarkZoneEnabled: boolean;
1882
+ landmarkZoneName?: string;
1883
+ landmarkZoneIsVisible?: boolean;
1884
+ }): Promise<void | ResponseType$1>;
1862
1885
  updateWebhookZone(isWebhookZoneEnabled: boolean): Promise<void | ResponseType$1>;
1863
1886
  updatePosition(x: number, y: number, yOrderAdjust?: number): Promise<void | ResponseType$1>;
1864
1887
  updatePrivateZone({ isPrivateZone, isPrivateZoneChatDisabled, privateZoneUserCap, }: UpdatePrivateZoneInterface): Promise<void | ResponseType$1>;
1865
1888
  updateScale(assetScale: number): Promise<void | ResponseType$1>;
1889
+ flip(): Promise<void | ResponseType$1>;
1866
1890
  updateUploadedMediaSelected(mediaId: string): Promise<void | ResponseType$1>;
1867
1891
  updateWebImageLayers(bottom: string, top: string): Promise<void | ResponseType$1>;
1868
1892
  addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }: {
@@ -1880,6 +1904,11 @@ interface DroppedAssetInterface extends AssetInterface {
1880
1904
  setClickableLinkMulti({ clickableLinks }: SetClickableLinkMultiInterface): Promise<void | ResponseType$1>;
1881
1905
  updateClickableLinkMulti({ clickableLink, clickableLinkTitle, isForceLinkInIframe, isOpenLinkInDrawer, existingLinkId, linkSamlQueryParams, }: UpdateClickableLinkMultiInterface): Promise<void | ResponseType$1>;
1882
1906
  removeClickableLink({ linkId }: RemoveClickableLinkInterface): Promise<void | ResponseType$1>;
1907
+ fetchDroppedAssetAnalytics({ periodType, dateValue, year, }: {
1908
+ periodType: "week" | "month" | "quarter" | "year";
1909
+ dateValue: number;
1910
+ year: number;
1911
+ }): Promise<void | ResponseType$1>;
1883
1912
  id?: string;
1884
1913
  assetId?: string;
1885
1914
  assetScale?: number | null;
@@ -2094,10 +2123,24 @@ interface TopiaInterface {
2094
2123
  }
2095
2124
 
2096
2125
  interface UserInterface {
2126
+ checkInteractiveCredentials(): Promise<void | ResponseType$1>;
2127
+ fetchAvatars(): Promise<void | ResponseType$1>;
2128
+ addAvatar(formData: FormData): Promise<void | ResponseType$1>;
2129
+ updateAvatar(avatarId: string, formData: FormData): Promise<void | ResponseType$1>;
2130
+ deleteAvatar(avatarId: string): Promise<void | ResponseType$1>;
2097
2131
  fetchAssets(): Promise<void | ResponseType$1>;
2098
2132
  fetchPlatformAssets(): Promise<object | ResponseType$1>;
2099
2133
  fetchScenes(): Promise<void | ResponseType$1>;
2100
2134
  fetchWorldsByKey(): Promise<void | ResponseType$1>;
2135
+ sendEmail({ html, subject, to }: {
2136
+ html: string;
2137
+ subject: string;
2138
+ to: string;
2139
+ }): Promise<object | ResponseType$1>;
2140
+ getExpressions({ name, getUnlockablesOnly }: {
2141
+ name?: string;
2142
+ getUnlockablesOnly?: boolean;
2143
+ }): Promise<ResponseType$1>;
2101
2144
  fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
2102
2145
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2103
2146
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
@@ -2115,17 +2158,30 @@ interface VisitorInterface extends SDKInterface {
2115
2158
  moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
2116
2159
  fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
2117
2160
  openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType$1>;
2161
+ reloadIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
2118
2162
  closeIframe(droppedAssetId: string): Promise<void | ResponseType$1>;
2119
- fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2120
- setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2121
- updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2122
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
2123
- updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
2163
+ turnAVOff(): Promise<void | ResponseType$1>;
2164
+ getExpressions({ name, getUnlockablesOnly }: {
2165
+ name?: string;
2166
+ getUnlockablesOnly?: boolean;
2167
+ }): Promise<ResponseType$1>;
2168
+ grantExpression({ id, name }: {
2169
+ id?: string;
2170
+ name?: string;
2171
+ }): Promise<ResponseType$1>;
2124
2172
  getAllParticles(): Promise<ResponseType$1>;
2125
2173
  triggerParticle({ id, name, duration, }: {
2126
2174
  id?: string;
2127
2175
  name?: string;
2128
2176
  duration?: number;
2177
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2178
+ setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2179
+ updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2180
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
2181
+ updatePublicKeyAnalytics(analytics?: AnalyticType[]): Promise<void | ResponseType$1>;
2182
+ sendSignalToVisitor(signal: any): Promise<void | (ResponseType$1 & {
2183
+ answerSignal: any;
2184
+ })>;
2129
2185
  }): Promise<ResponseType$1 | string>;
2130
2186
  color?: string;
2131
2187
  dataObject?: object | null | undefined;
@@ -2234,6 +2290,10 @@ interface WorldDetailsInterface {
2234
2290
  interface WorldInterface extends SDKInterface, WorldDetailsInterface {
2235
2291
  fetchDetails(): Promise<void | ResponseType$1>;
2236
2292
  updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldDetailsInterface): Promise<void | ResponseType$1>;
2293
+ updateCloseWorldSettings({ closeWorldDescription, isWorldClosed, }: {
2294
+ closeWorldDescription: string;
2295
+ isWorldClosed: boolean;
2296
+ }): Promise<void | ResponseType$1>;
2237
2297
  fetchDroppedAssets(): Promise<void | ResponseType$1>;
2238
2298
  fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial, isReversed, }: {
2239
2299
  uniqueName: string;
@@ -2245,17 +2305,15 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
2245
2305
  uniqueName?: string;
2246
2306
  }): Promise<DroppedAsset[]>;
2247
2307
  updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
2308
+ fetchLandmarkZones(landmarkZoneName?: string, sceneDropId?: string): Promise<DroppedAsset[]>;
2309
+ fetchSceneDropIds(): Promise<object | ResponseType$1>;
2310
+ fetchScenes(): Promise<object | ResponseType$1>;
2248
2311
  dropScene({ assetSuffix, position, sceneId, }: {
2249
2312
  assetSuffix: string;
2250
2313
  position: object;
2251
2314
  sceneId: string;
2252
2315
  }): Promise<object | ResponseType$1>;
2253
2316
  replaceScene(sceneId: string): Promise<void | ResponseType$1>;
2254
- fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
2255
- fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2256
- setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2257
- updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2258
- incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
2259
2317
  getAllParticles(): Promise<ResponseType$1>;
2260
2318
  triggerParticle({ id, name, duration, position, }: {
2261
2319
  id?: string;
@@ -2263,6 +2321,22 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
2263
2321
  duration?: number;
2264
2322
  position?: object;
2265
2323
  }): Promise<ResponseType$1 | string>;
2324
+ triggerActivity({ type, assetId, excludeFromNotification, }: {
2325
+ type: WorldActivityType;
2326
+ assetId: string;
2327
+ excludeFromNotification?: (string | number)[];
2328
+ }): Promise<ResponseType$1 | string>;
2329
+ fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
2330
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2331
+ setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2332
+ updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2333
+ incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
2334
+ fetchWebhooks(): Promise<void | ResponseType$1>;
2335
+ fetchWorldAnalytics({ periodType, dateValue, year, }: {
2336
+ periodType: "week" | "month" | "quarter" | "year";
2337
+ dateValue: number;
2338
+ year: number;
2339
+ }): Promise<void | ResponseType$1>;
2266
2340
  dataObject?: object | null;
2267
2341
  }
2268
2342
  interface WorldOptionalInterface {
@@ -2356,9 +2430,11 @@ declare abstract class SDKController implements SDKInterface {
2356
2430
  *
2357
2431
  * @example
2358
2432
  * ```ts
2359
- * const asset = await new Asset(topia, "id", {
2433
+ * import { Asset } from "utils/topiaInit.ts";
2434
+ *
2435
+ * const asset = await Asset.create(assetId, {
2360
2436
  * attributes: { assetName: "My Asset", isPublic: false },
2361
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
2437
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
2362
2438
  * });
2363
2439
  * ```
2364
2440
  */
@@ -2402,7 +2478,7 @@ declare class Asset extends SDKController implements AssetInterface {
2402
2478
  shouldUploadImages?: boolean;
2403
2479
  tagJson: string;
2404
2480
  topLayerURL?: string;
2405
- }): Promise<void | ResponseType$1>;
2481
+ }): Promise<object | ResponseType$1>;
2406
2482
  }
2407
2483
 
2408
2484
  /**
@@ -2410,8 +2486,10 @@ declare class Asset extends SDKController implements AssetInterface {
2410
2486
  *
2411
2487
  * @example
2412
2488
  * ```ts
2413
- * const ecosystem =await new Ecosystem(topia, {
2414
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
2489
+ * import { Ecosystem } from "utils/topiaInit.ts";
2490
+ *
2491
+ * const ecosystem = await Ecosystem.create({
2492
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
2415
2493
  * });
2416
2494
  * ```
2417
2495
  */
@@ -2534,7 +2612,7 @@ declare class Ecosystem extends SDKController {
2534
2612
  * @example
2535
2613
  * ```ts
2536
2614
  * const webRTC = await new WebRTCConnector(topia, {
2537
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
2615
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", profileId: "exampleProfileId", visitorId: 1, urlSlug: "exampleUrlSlug" }
2538
2616
  * });
2539
2617
  * ```
2540
2618
  */
@@ -2561,9 +2639,11 @@ declare class WebRTCConnector extends SDKController implements WebRTCConnectorIn
2561
2639
  *
2562
2640
  * @example
2563
2641
  * ```ts
2564
- * const activity = await new WorldActivity(topia, "exampleWorld", {
2642
+ * import { WorldActivity } from "utils/topiaInit.ts";
2643
+ *
2644
+ * const activity = await WorldActivity.create(urlSlug, {
2565
2645
  * attributes: { name: "Example World" },
2566
- * credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
2646
+ * credentials: { interactivePublicKey: "examplePublicKey", interactiveNonce: "exampleNonce", assetId: "exampleDroppedAssetId", visitorId: 1, urlSlug: "exampleUrlSlug" }
2567
2647
  * });
2568
2648
  * ```
2569
2649
  */