@rtsdk/topia 0.8.5 → 0.9.0
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 +106 -11
- package/dist/index.cjs +236 -28
- package/dist/index.d.ts +222 -2
- package/dist/index.js +236 -28
- package/package.json +1 -1
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;
|
|
@@ -771,16 +787,33 @@ declare class User extends SDKController implements UserInterface {
|
|
|
771
787
|
/**
|
|
772
788
|
* @summary
|
|
773
789
|
* Returns all assets owned by User when an email address is provided.
|
|
790
|
+
*
|
|
791
|
+
* @usage
|
|
792
|
+
* ```ts
|
|
793
|
+
* await user.fetchAssets();
|
|
794
|
+
* const userAssets = user.assets;
|
|
795
|
+
* ```
|
|
774
796
|
*/
|
|
775
797
|
fetchAssets(): Promise<void | ResponseType$1>;
|
|
776
798
|
/**
|
|
777
799
|
* @summary
|
|
778
|
-
* Returns all platform assets
|
|
800
|
+
* Returns all platform assets.
|
|
801
|
+
*
|
|
802
|
+
* @usage
|
|
803
|
+
* ```ts
|
|
804
|
+
* const assets = await user.fetchPlatformAssets();
|
|
805
|
+
* ```
|
|
779
806
|
*/
|
|
780
807
|
fetchPlatformAssets(): Promise<object | ResponseType$1>;
|
|
781
808
|
/**
|
|
782
809
|
* @summary
|
|
783
|
-
* Returns all scenes owned by User
|
|
810
|
+
* Returns all scenes owned by User.
|
|
811
|
+
*
|
|
812
|
+
* @usage
|
|
813
|
+
* ```ts
|
|
814
|
+
* await user.fetchScenes();
|
|
815
|
+
* const userScenes = user.scenes;
|
|
816
|
+
* ```
|
|
784
817
|
*/
|
|
785
818
|
fetchScenes(): Promise<void | ResponseType$1>;
|
|
786
819
|
/**
|
|
@@ -849,6 +882,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
849
882
|
* ```
|
|
850
883
|
*/
|
|
851
884
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
885
|
+
analytics?: string[];
|
|
852
886
|
lock?: {
|
|
853
887
|
lockId: string;
|
|
854
888
|
releaseLock?: boolean;
|
|
@@ -868,6 +902,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
868
902
|
* ```
|
|
869
903
|
*/
|
|
870
904
|
updateDataObject(dataObject: object, options?: {
|
|
905
|
+
analytics?: string[];
|
|
871
906
|
lock?: {
|
|
872
907
|
lockId: string;
|
|
873
908
|
releaseLock?: boolean;
|
|
@@ -888,6 +923,7 @@ declare class User extends SDKController implements UserInterface {
|
|
|
888
923
|
* ```
|
|
889
924
|
*/
|
|
890
925
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
926
|
+
analytics?: string[];
|
|
891
927
|
lock?: {
|
|
892
928
|
lockId: string;
|
|
893
929
|
releaseLock?: boolean;
|
|
@@ -1035,6 +1071,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1035
1071
|
* ```
|
|
1036
1072
|
*/
|
|
1037
1073
|
setDataObject(dataObject: object | null | undefined, options?: {
|
|
1074
|
+
analytics?: string[];
|
|
1038
1075
|
lock?: {
|
|
1039
1076
|
lockId: string;
|
|
1040
1077
|
releaseLock?: boolean;
|
|
@@ -1054,6 +1091,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1054
1091
|
* ```
|
|
1055
1092
|
*/
|
|
1056
1093
|
updateDataObject(dataObject: object, options?: {
|
|
1094
|
+
analytics?: string[];
|
|
1057
1095
|
lock?: {
|
|
1058
1096
|
lockId: string;
|
|
1059
1097
|
releaseLock?: boolean;
|
|
@@ -1074,6 +1112,7 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1074
1112
|
* ```
|
|
1075
1113
|
*/
|
|
1076
1114
|
incrementDataObjectValue(path: string, amount: number, options?: {
|
|
1115
|
+
analytics?: string[];
|
|
1077
1116
|
lock?: {
|
|
1078
1117
|
lockId: string;
|
|
1079
1118
|
releaseLock?: boolean;
|
|
@@ -1563,7 +1602,18 @@ declare abstract class SDKController implements SDKInterface {
|
|
|
1563
1602
|
*/
|
|
1564
1603
|
declare class Asset extends SDKController implements AssetInterface {
|
|
1565
1604
|
readonly id?: string;
|
|
1605
|
+
urlSlug?: string;
|
|
1566
1606
|
constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
|
|
1607
|
+
/**
|
|
1608
|
+
* @summary
|
|
1609
|
+
* Retrieves platform asset details.
|
|
1610
|
+
*
|
|
1611
|
+
* @usage
|
|
1612
|
+
* ```ts
|
|
1613
|
+
* await asset.fetchAssetById();
|
|
1614
|
+
* const { assetName } = asset;
|
|
1615
|
+
* ```
|
|
1616
|
+
*/
|
|
1567
1617
|
fetchAssetById(): Promise<object | ResponseType$1>;
|
|
1568
1618
|
}
|
|
1569
1619
|
|
|
@@ -1650,21 +1700,89 @@ declare class WorldActivity extends SDKController {
|
|
|
1650
1700
|
moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType$1)[]>;
|
|
1651
1701
|
}
|
|
1652
1702
|
|
|
1703
|
+
/**
|
|
1704
|
+
* @usage
|
|
1705
|
+
* ```ts
|
|
1706
|
+
* const Asset = new AssetFactory(myTopiaInstance);
|
|
1707
|
+
* ```
|
|
1708
|
+
*/
|
|
1653
1709
|
declare class AssetFactory {
|
|
1654
1710
|
topia: Topia;
|
|
1655
1711
|
constructor(topia: Topia);
|
|
1712
|
+
/**
|
|
1713
|
+
* @summary
|
|
1714
|
+
* Instantiate a new instance of Asset class.
|
|
1715
|
+
*
|
|
1716
|
+
* @usage
|
|
1717
|
+
* ```
|
|
1718
|
+
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1719
|
+
* ```
|
|
1720
|
+
*/
|
|
1656
1721
|
create(id: string, options?: AssetOptionalInterface): Asset;
|
|
1657
1722
|
}
|
|
1658
1723
|
|
|
1724
|
+
/**
|
|
1725
|
+
* @usage
|
|
1726
|
+
* ```ts
|
|
1727
|
+
* const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
|
|
1728
|
+
* ```
|
|
1729
|
+
*/
|
|
1659
1730
|
declare class DroppedAssetFactory extends SDKController {
|
|
1660
1731
|
constructor(topia: Topia);
|
|
1732
|
+
/**
|
|
1733
|
+
* @summary
|
|
1734
|
+
* Instantiate a new instance of DroppedAsset class.
|
|
1735
|
+
*
|
|
1736
|
+
* @usage
|
|
1737
|
+
* ```
|
|
1738
|
+
* const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1739
|
+
* ```
|
|
1740
|
+
*/
|
|
1661
1741
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
1742
|
+
/**
|
|
1743
|
+
* @summary
|
|
1744
|
+
* Instantiate a new instance of DroppedAsset class and retrieve all properties.
|
|
1745
|
+
*
|
|
1746
|
+
* @usage
|
|
1747
|
+
* ```
|
|
1748
|
+
* const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1749
|
+
* ```
|
|
1750
|
+
*/
|
|
1662
1751
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
1752
|
+
/**
|
|
1753
|
+
* @summary
|
|
1754
|
+
* 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.
|
|
1755
|
+
*
|
|
1756
|
+
* @usage
|
|
1757
|
+
* ```
|
|
1758
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, { interactivePublicKey, interactiveSecret });
|
|
1759
|
+
* ```
|
|
1760
|
+
*/
|
|
1663
1761
|
getWithUniqueName(uniqueName: string, urlSlug: string, credentials: {
|
|
1664
1762
|
apiKey?: string;
|
|
1665
1763
|
interactivePublicKey?: string;
|
|
1666
1764
|
interactiveSecret?: string;
|
|
1667
1765
|
}): Promise<DroppedAsset>;
|
|
1766
|
+
/**
|
|
1767
|
+
* @summary
|
|
1768
|
+
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
1769
|
+
*
|
|
1770
|
+
* @usage
|
|
1771
|
+
* ```
|
|
1772
|
+
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1773
|
+
* const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
|
|
1774
|
+
assetScale: 1.5,
|
|
1775
|
+
flipped: true,
|
|
1776
|
+
layer0: "",
|
|
1777
|
+
layer1: "https://pathtoimage.png",
|
|
1778
|
+
interactivePublicKey,
|
|
1779
|
+
isInteractive: true,
|
|
1780
|
+
position: { x: 0, y: 0 },
|
|
1781
|
+
uniqueName: "exampleUniqueName",
|
|
1782
|
+
urlSlug,
|
|
1783
|
+
});
|
|
1784
|
+
* ```
|
|
1785
|
+
*/
|
|
1668
1786
|
drop(asset: Asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
|
|
1669
1787
|
assetScale?: number;
|
|
1670
1788
|
flipped?: boolean;
|
|
@@ -1688,35 +1806,137 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
1688
1806
|
}): Promise<DroppedAsset>;
|
|
1689
1807
|
}
|
|
1690
1808
|
|
|
1809
|
+
/**
|
|
1810
|
+
* @usage
|
|
1811
|
+
* ```ts
|
|
1812
|
+
* const Scene = new SceneFactory(myTopiaInstance);
|
|
1813
|
+
* ```
|
|
1814
|
+
*/
|
|
1691
1815
|
declare class SceneFactory {
|
|
1692
1816
|
topia: Topia;
|
|
1693
1817
|
constructor(topia: Topia);
|
|
1818
|
+
/**
|
|
1819
|
+
* @summary
|
|
1820
|
+
* Instantiate a new instance of Scene class.
|
|
1821
|
+
*
|
|
1822
|
+
* @usage
|
|
1823
|
+
* ```
|
|
1824
|
+
* const sceneInstance = await Scene.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1825
|
+
* ```
|
|
1826
|
+
*/
|
|
1694
1827
|
create(id: string, options?: SceneOptionalInterface): Scene;
|
|
1828
|
+
/**
|
|
1829
|
+
* @summary
|
|
1830
|
+
* Instantiate a new instance of Scene class and retrieve all properties.
|
|
1831
|
+
*
|
|
1832
|
+
* @usage
|
|
1833
|
+
* ```
|
|
1834
|
+
* const sceneInstance = await Scene.get(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1835
|
+
* ```
|
|
1836
|
+
*/
|
|
1695
1837
|
get(id: string, options?: SceneOptionalInterface): Promise<Scene>;
|
|
1696
1838
|
}
|
|
1697
1839
|
|
|
1840
|
+
/**
|
|
1841
|
+
* @usage
|
|
1842
|
+
* ```ts
|
|
1843
|
+
* const User = new UserFactory(myTopiaInstance);
|
|
1844
|
+
* ```
|
|
1845
|
+
*/
|
|
1698
1846
|
declare class UserFactory {
|
|
1699
1847
|
topia: Topia;
|
|
1700
1848
|
constructor(topia: Topia);
|
|
1849
|
+
/**
|
|
1850
|
+
* @summary
|
|
1851
|
+
* Instantiate a new instance of User class.
|
|
1852
|
+
*
|
|
1853
|
+
* @usage
|
|
1854
|
+
* ```
|
|
1855
|
+
* const userInstance = await User.create({ credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1856
|
+
* ```
|
|
1857
|
+
*/
|
|
1701
1858
|
create(options?: UserOptionalInterface): User;
|
|
1702
1859
|
}
|
|
1703
1860
|
|
|
1861
|
+
/**
|
|
1862
|
+
* @usage
|
|
1863
|
+
* ```ts
|
|
1864
|
+
* const Visitor = new VisitorFactory(myTopiaInstance);
|
|
1865
|
+
* ```
|
|
1866
|
+
*/
|
|
1704
1867
|
declare class VisitorFactory {
|
|
1705
1868
|
topia: Topia;
|
|
1706
1869
|
constructor(topia: Topia);
|
|
1870
|
+
/**
|
|
1871
|
+
* @summary
|
|
1872
|
+
* Instantiate a new instance of Visitor class.
|
|
1873
|
+
*
|
|
1874
|
+
* @usage
|
|
1875
|
+
* ```
|
|
1876
|
+
* const visitorInstance = await Visitor.create(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1877
|
+
* ```
|
|
1878
|
+
*/
|
|
1707
1879
|
create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
|
|
1880
|
+
/**
|
|
1881
|
+
* @summary
|
|
1882
|
+
* Instantiate a new instance of Visitor class and retrieve all properties.
|
|
1883
|
+
*
|
|
1884
|
+
* @usage
|
|
1885
|
+
* ```
|
|
1886
|
+
* const visitorInstance = await Visitor.get(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1887
|
+
* ```
|
|
1888
|
+
*/
|
|
1708
1889
|
get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
|
|
1709
1890
|
}
|
|
1710
1891
|
|
|
1892
|
+
/**
|
|
1893
|
+
* @usage
|
|
1894
|
+
* ```ts
|
|
1895
|
+
* const WorldActivity = new WorldActivityFactory(myTopiaInstance);
|
|
1896
|
+
* ```
|
|
1897
|
+
*/
|
|
1711
1898
|
declare class WorldActivityFactory {
|
|
1712
1899
|
topia: Topia;
|
|
1713
1900
|
constructor(topia: Topia);
|
|
1901
|
+
/**
|
|
1902
|
+
* @summary
|
|
1903
|
+
* Instantiate a new instance of WorldActivity class.
|
|
1904
|
+
*
|
|
1905
|
+
* @usage
|
|
1906
|
+
* ```
|
|
1907
|
+
* const worldActivityInstance = await WorldActivity.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1908
|
+
* ```
|
|
1909
|
+
*/
|
|
1714
1910
|
create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
|
|
1715
1911
|
}
|
|
1716
1912
|
|
|
1913
|
+
/**
|
|
1914
|
+
* @usage
|
|
1915
|
+
* ```ts
|
|
1916
|
+
* const World = new WorldFactory(myTopiaInstance);
|
|
1917
|
+
* ```
|
|
1918
|
+
*/
|
|
1717
1919
|
declare class WorldFactory extends SDKController {
|
|
1718
1920
|
constructor(topia: Topia);
|
|
1921
|
+
/**
|
|
1922
|
+
* @summary
|
|
1923
|
+
* Instantiate a new instance of World class.
|
|
1924
|
+
*
|
|
1925
|
+
* @usage
|
|
1926
|
+
* ```
|
|
1927
|
+
* const worldInstance = await World.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
1928
|
+
* ```
|
|
1929
|
+
*/
|
|
1719
1930
|
create(urlSlug: string, options?: WorldOptionalInterface): World;
|
|
1931
|
+
/**
|
|
1932
|
+
* @summary
|
|
1933
|
+
* Deletes an array of Dropped Assets from within a world and returns success: true
|
|
1934
|
+
*
|
|
1935
|
+
* @usage
|
|
1936
|
+
* ```
|
|
1937
|
+
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactiveNonce, interactivePublicKey, visitorId });
|
|
1938
|
+
* ```
|
|
1939
|
+
*/
|
|
1720
1940
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], credentials: {
|
|
1721
1941
|
apiKey?: string;
|
|
1722
1942
|
interactivePublicKey?: string;
|