@rtsdk/topia 0.8.5 → 0.9.1

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
@@ -64,6 +64,16 @@ type ResponseType$1 = {
64
64
  declare class Scene extends SDKController implements SceneInterface {
65
65
  readonly id: string;
66
66
  constructor(topia: Topia, id: string, options?: SceneOptionalInterface);
67
+ /**
68
+ * @summary
69
+ * Retrieves scene details.
70
+ *
71
+ * @usage
72
+ * ```ts
73
+ * await scene.fetchSceneById();
74
+ * const { name } = scene;
75
+ * ```
76
+ */
67
77
  fetchSceneById(): Promise<void | ResponseType$1>;
68
78
  }
69
79
 
@@ -137,6 +147,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
137
147
  * ```
138
148
  */
139
149
  setDataObject(dataObject: object, options?: {
150
+ analytics?: string[];
140
151
  lock?: {
141
152
  lockId: string;
142
153
  releaseLock?: boolean;
@@ -156,6 +167,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
156
167
  * ```
157
168
  */
158
169
  updateDataObject(dataObject: object, options?: {
170
+ analytics?: string[];
159
171
  lock?: {
160
172
  lockId: string;
161
173
  releaseLock?: boolean;
@@ -176,6 +188,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
176
188
  * ```
177
189
  */
178
190
  incrementDataObjectValue(path: string, amount: number, options?: {
191
+ analytics?: string[];
179
192
  lock?: {
180
193
  lockId: string;
181
194
  releaseLock?: boolean;
@@ -662,6 +675,7 @@ declare class World extends SDKController implements WorldInterface {
662
675
  * ```
663
676
  */
664
677
  setDataObject: (dataObject: object | null | undefined, options?: {
678
+ analytics?: string[];
665
679
  lock?: {
666
680
  lockId: string;
667
681
  releaseLock?: boolean;
@@ -682,6 +696,7 @@ declare class World extends SDKController implements WorldInterface {
682
696
  * ```
683
697
  */
684
698
  updateDataObject: (dataObject: object, options?: {
699
+ analytics?: string[];
685
700
  lock?: {
686
701
  lockId: string;
687
702
  releaseLock?: boolean;
@@ -702,6 +717,7 @@ declare class World extends SDKController implements WorldInterface {
702
717
  * ```
703
718
  */
704
719
  incrementDataObjectValue(path: string, amount: number, options?: {
720
+ analytics?: string[];
705
721
  lock?: {
706
722
  lockId: string;
707
723
  releaseLock?: boolean;
@@ -768,19 +784,46 @@ declare class User extends SDKController implements UserInterface {
768
784
  get worlds(): {
769
785
  [key: string]: World;
770
786
  };
787
+ /**
788
+ * @summary
789
+ * Verify user has valid interactive credentials
790
+ *
791
+ * @usage
792
+ * ```ts
793
+ * await user.checkInteractiveCredentials();
794
+ * ```
795
+ */
796
+ checkInteractiveCredentials(): Promise<void | ResponseType$1>;
771
797
  /**
772
798
  * @summary
773
799
  * Returns all assets owned by User when an email address is provided.
800
+ *
801
+ * @usage
802
+ * ```ts
803
+ * await user.fetchAssets();
804
+ * const userAssets = user.assets;
805
+ * ```
774
806
  */
775
807
  fetchAssets(): Promise<void | ResponseType$1>;
776
808
  /**
777
809
  * @summary
778
- * Returns all platform assets
810
+ * Returns all platform assets.
811
+ *
812
+ * @usage
813
+ * ```ts
814
+ * const assets = await user.fetchPlatformAssets();
815
+ * ```
779
816
  */
780
817
  fetchPlatformAssets(): Promise<object | ResponseType$1>;
781
818
  /**
782
819
  * @summary
783
- * Returns all scenes owned by User
820
+ * Returns all scenes owned by User.
821
+ *
822
+ * @usage
823
+ * ```ts
824
+ * await user.fetchScenes();
825
+ * const userScenes = user.scenes;
826
+ * ```
784
827
  */
785
828
  fetchScenes(): Promise<void | ResponseType$1>;
786
829
  /**
@@ -849,6 +892,7 @@ declare class User extends SDKController implements UserInterface {
849
892
  * ```
850
893
  */
851
894
  setDataObject(dataObject: object | null | undefined, options?: {
895
+ analytics?: string[];
852
896
  lock?: {
853
897
  lockId: string;
854
898
  releaseLock?: boolean;
@@ -868,6 +912,7 @@ declare class User extends SDKController implements UserInterface {
868
912
  * ```
869
913
  */
870
914
  updateDataObject(dataObject: object, options?: {
915
+ analytics?: string[];
871
916
  lock?: {
872
917
  lockId: string;
873
918
  releaseLock?: boolean;
@@ -888,6 +933,7 @@ declare class User extends SDKController implements UserInterface {
888
933
  * ```
889
934
  */
890
935
  incrementDataObjectValue(path: string, amount: number, options?: {
936
+ analytics?: string[];
891
937
  lock?: {
892
938
  lockId: string;
893
939
  releaseLock?: boolean;
@@ -1035,6 +1081,7 @@ declare class Visitor extends User implements VisitorInterface {
1035
1081
  * ```
1036
1082
  */
1037
1083
  setDataObject(dataObject: object | null | undefined, options?: {
1084
+ analytics?: string[];
1038
1085
  lock?: {
1039
1086
  lockId: string;
1040
1087
  releaseLock?: boolean;
@@ -1054,6 +1101,7 @@ declare class Visitor extends User implements VisitorInterface {
1054
1101
  * ```
1055
1102
  */
1056
1103
  updateDataObject(dataObject: object, options?: {
1104
+ analytics?: string[];
1057
1105
  lock?: {
1058
1106
  lockId: string;
1059
1107
  releaseLock?: boolean;
@@ -1074,6 +1122,7 @@ declare class Visitor extends User implements VisitorInterface {
1074
1122
  * ```
1075
1123
  */
1076
1124
  incrementDataObjectValue(path: string, amount: number, options?: {
1125
+ analytics?: string[];
1077
1126
  lock?: {
1078
1127
  lockId: string;
1079
1128
  releaseLock?: boolean;
@@ -1563,7 +1612,18 @@ declare abstract class SDKController implements SDKInterface {
1563
1612
  */
1564
1613
  declare class Asset extends SDKController implements AssetInterface {
1565
1614
  readonly id?: string;
1615
+ urlSlug?: string;
1566
1616
  constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
1617
+ /**
1618
+ * @summary
1619
+ * Retrieves platform asset details.
1620
+ *
1621
+ * @usage
1622
+ * ```ts
1623
+ * await asset.fetchAssetById();
1624
+ * const { assetName } = asset;
1625
+ * ```
1626
+ */
1567
1627
  fetchAssetById(): Promise<object | ResponseType$1>;
1568
1628
  }
1569
1629
 
@@ -1650,21 +1710,89 @@ declare class WorldActivity extends SDKController {
1650
1710
  moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType$1)[]>;
1651
1711
  }
1652
1712
 
1713
+ /**
1714
+ * @usage
1715
+ * ```ts
1716
+ * const Asset = new AssetFactory(myTopiaInstance);
1717
+ * ```
1718
+ */
1653
1719
  declare class AssetFactory {
1654
1720
  topia: Topia;
1655
1721
  constructor(topia: Topia);
1722
+ /**
1723
+ * @summary
1724
+ * Instantiate a new instance of Asset class.
1725
+ *
1726
+ * @usage
1727
+ * ```
1728
+ * const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1729
+ * ```
1730
+ */
1656
1731
  create(id: string, options?: AssetOptionalInterface): Asset;
1657
1732
  }
1658
1733
 
1734
+ /**
1735
+ * @usage
1736
+ * ```ts
1737
+ * const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
1738
+ * ```
1739
+ */
1659
1740
  declare class DroppedAssetFactory extends SDKController {
1660
1741
  constructor(topia: Topia);
1742
+ /**
1743
+ * @summary
1744
+ * Instantiate a new instance of DroppedAsset class.
1745
+ *
1746
+ * @usage
1747
+ * ```
1748
+ * const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1749
+ * ```
1750
+ */
1661
1751
  create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
1752
+ /**
1753
+ * @summary
1754
+ * Instantiate a new instance of DroppedAsset class and retrieve all properties.
1755
+ *
1756
+ * @usage
1757
+ * ```
1758
+ * const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1759
+ * ```
1760
+ */
1662
1761
  get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
1762
+ /**
1763
+ * @summary
1764
+ * 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.
1765
+ *
1766
+ * @usage
1767
+ * ```
1768
+ * const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, { interactivePublicKey, interactiveSecret });
1769
+ * ```
1770
+ */
1663
1771
  getWithUniqueName(uniqueName: string, urlSlug: string, credentials: {
1664
1772
  apiKey?: string;
1665
1773
  interactivePublicKey?: string;
1666
1774
  interactiveSecret?: string;
1667
1775
  }): Promise<DroppedAsset>;
1776
+ /**
1777
+ * @summary
1778
+ * Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
1779
+ *
1780
+ * @usage
1781
+ * ```
1782
+ * const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1783
+ * const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
1784
+ assetScale: 1.5,
1785
+ flipped: true,
1786
+ layer0: "",
1787
+ layer1: "https://pathtoimage.png",
1788
+ interactivePublicKey,
1789
+ isInteractive: true,
1790
+ position: { x: 0, y: 0 },
1791
+ uniqueName: "exampleUniqueName",
1792
+ urlSlug,
1793
+ });
1794
+ * ```
1795
+ */
1668
1796
  drop(asset: Asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
1669
1797
  assetScale?: number;
1670
1798
  flipped?: boolean;
@@ -1688,35 +1816,137 @@ declare class DroppedAssetFactory extends SDKController {
1688
1816
  }): Promise<DroppedAsset>;
1689
1817
  }
1690
1818
 
1819
+ /**
1820
+ * @usage
1821
+ * ```ts
1822
+ * const Scene = new SceneFactory(myTopiaInstance);
1823
+ * ```
1824
+ */
1691
1825
  declare class SceneFactory {
1692
1826
  topia: Topia;
1693
1827
  constructor(topia: Topia);
1828
+ /**
1829
+ * @summary
1830
+ * Instantiate a new instance of Scene class.
1831
+ *
1832
+ * @usage
1833
+ * ```
1834
+ * const sceneInstance = await Scene.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1835
+ * ```
1836
+ */
1694
1837
  create(id: string, options?: SceneOptionalInterface): Scene;
1838
+ /**
1839
+ * @summary
1840
+ * Instantiate a new instance of Scene class and retrieve all properties.
1841
+ *
1842
+ * @usage
1843
+ * ```
1844
+ * const sceneInstance = await Scene.get(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1845
+ * ```
1846
+ */
1695
1847
  get(id: string, options?: SceneOptionalInterface): Promise<Scene>;
1696
1848
  }
1697
1849
 
1850
+ /**
1851
+ * @usage
1852
+ * ```ts
1853
+ * const User = new UserFactory(myTopiaInstance);
1854
+ * ```
1855
+ */
1698
1856
  declare class UserFactory {
1699
1857
  topia: Topia;
1700
1858
  constructor(topia: Topia);
1859
+ /**
1860
+ * @summary
1861
+ * Instantiate a new instance of User class.
1862
+ *
1863
+ * @usage
1864
+ * ```
1865
+ * const userInstance = await User.create({ credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1866
+ * ```
1867
+ */
1701
1868
  create(options?: UserOptionalInterface): User;
1702
1869
  }
1703
1870
 
1871
+ /**
1872
+ * @usage
1873
+ * ```ts
1874
+ * const Visitor = new VisitorFactory(myTopiaInstance);
1875
+ * ```
1876
+ */
1704
1877
  declare class VisitorFactory {
1705
1878
  topia: Topia;
1706
1879
  constructor(topia: Topia);
1880
+ /**
1881
+ * @summary
1882
+ * Instantiate a new instance of Visitor class.
1883
+ *
1884
+ * @usage
1885
+ * ```
1886
+ * const visitorInstance = await Visitor.create(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1887
+ * ```
1888
+ */
1707
1889
  create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
1890
+ /**
1891
+ * @summary
1892
+ * Instantiate a new instance of Visitor class and retrieve all properties.
1893
+ *
1894
+ * @usage
1895
+ * ```
1896
+ * const visitorInstance = await Visitor.get(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1897
+ * ```
1898
+ */
1708
1899
  get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
1709
1900
  }
1710
1901
 
1902
+ /**
1903
+ * @usage
1904
+ * ```ts
1905
+ * const WorldActivity = new WorldActivityFactory(myTopiaInstance);
1906
+ * ```
1907
+ */
1711
1908
  declare class WorldActivityFactory {
1712
1909
  topia: Topia;
1713
1910
  constructor(topia: Topia);
1911
+ /**
1912
+ * @summary
1913
+ * Instantiate a new instance of WorldActivity class.
1914
+ *
1915
+ * @usage
1916
+ * ```
1917
+ * const worldActivityInstance = await WorldActivity.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1918
+ * ```
1919
+ */
1714
1920
  create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
1715
1921
  }
1716
1922
 
1923
+ /**
1924
+ * @usage
1925
+ * ```ts
1926
+ * const World = new WorldFactory(myTopiaInstance);
1927
+ * ```
1928
+ */
1717
1929
  declare class WorldFactory extends SDKController {
1718
1930
  constructor(topia: Topia);
1931
+ /**
1932
+ * @summary
1933
+ * Instantiate a new instance of World class.
1934
+ *
1935
+ * @usage
1936
+ * ```
1937
+ * const worldInstance = await World.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
1938
+ * ```
1939
+ */
1719
1940
  create(urlSlug: string, options?: WorldOptionalInterface): World;
1941
+ /**
1942
+ * @summary
1943
+ * Deletes an array of Dropped Assets from within a world and returns success: true
1944
+ *
1945
+ * @usage
1946
+ * ```
1947
+ * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactivePublicKey, interactiveSecret });
1948
+ * ```
1949
+ */
1720
1950
  deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], credentials: {
1721
1951
  apiKey?: string;
1722
1952
  interactivePublicKey?: string;