@rtsdk/topia 0.1.0 → 0.1.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.
Files changed (101) hide show
  1. package/dist/index.cjs +0 -13
  2. package/dist/index.js +1 -14
  3. package/dist/types/example.d.ts +6 -0
  4. package/dist/types/src/__mocks__/assets.d.ts +99 -0
  5. package/dist/{src/__mocks__/index.js → types/src/__mocks__/index.d.ts} +4 -4
  6. package/dist/types/src/__mocks__/scenes.d.ts +79 -0
  7. package/dist/types/src/__mocks__/visitors.d.ts +83 -0
  8. package/dist/types/src/__mocks__/worlds.d.ts +73 -0
  9. package/dist/types/src/controllers/Asset.d.ts +20 -0
  10. package/dist/types/src/controllers/DroppedAsset.d.ts +285 -0
  11. package/dist/types/src/controllers/SDKController.d.ts +48 -0
  12. package/dist/types/src/controllers/Scene.d.ts +19 -0
  13. package/dist/types/src/controllers/Topia.d.ts +33 -0
  14. package/dist/types/src/controllers/User.d.ts +58 -0
  15. package/dist/types/src/controllers/Visitor.d.ts +50 -0
  16. package/dist/types/src/controllers/World.d.ts +143 -0
  17. package/dist/types/src/controllers/WorldActivity.d.ts +83 -0
  18. package/dist/{src/interfaces/AssetInterfaces.js → types/src/controllers/__tests__/asset.test.d.ts} +1 -1
  19. package/dist/{src/interfaces/DroppedAssetInterfaces.js → types/src/controllers/__tests__/droppedAsset.test.d.ts} +1 -1
  20. package/dist/{src/interfaces/SDKInterfaces.js → types/src/controllers/__tests__/scene.test.d.ts} +1 -1
  21. package/dist/{src/interfaces/SceneInterfaces.js → types/src/controllers/__tests__/user.test.d.ts} +1 -1
  22. package/dist/types/src/controllers/__tests__/visitor.test.d.ts +1 -0
  23. package/dist/types/src/controllers/__tests__/world.test.d.ts +1 -0
  24. package/dist/types/src/controllers/__tests__/worldActivity.test.d.ts +1 -0
  25. package/dist/{src/controllers/index.js → types/src/controllers/index.d.ts} +9 -9
  26. package/dist/types/src/factories/AssetFactory.d.ts +8 -0
  27. package/dist/types/src/factories/DroppedAssetFactory.d.ts +16 -0
  28. package/dist/types/src/factories/SceneFactory.d.ts +9 -0
  29. package/dist/types/src/factories/UserFactory.d.ts +8 -0
  30. package/dist/types/src/factories/VisitorFactory.d.ts +9 -0
  31. package/dist/types/src/factories/WorldActivityFactory.d.ts +8 -0
  32. package/dist/types/src/factories/WorldFactory.d.ts +8 -0
  33. package/dist/{src/factories/index.js → types/src/factories/index.d.ts} +7 -7
  34. package/dist/types/src/index.d.ts +4 -0
  35. package/dist/types/src/interfaces/AssetInterfaces.d.ts +26 -0
  36. package/dist/types/src/interfaces/DroppedAssetInterfaces.d.ts +102 -0
  37. package/dist/types/src/interfaces/SDKInterfaces.d.ts +8 -0
  38. package/dist/types/src/interfaces/SceneInterfaces.d.ts +27 -0
  39. package/dist/types/src/interfaces/TopiaInterfaces.d.ts +10 -0
  40. package/dist/types/src/interfaces/UserInterfaces.d.ts +6 -0
  41. package/dist/types/src/interfaces/VisitorInterfaces.d.ts +37 -0
  42. package/dist/types/src/interfaces/WorldActivityInterfaces.d.ts +11 -0
  43. package/dist/types/src/interfaces/WorldInterfaces.d.ts +32 -0
  44. package/dist/{src/interfaces/index.js → types/src/interfaces/index.d.ts} +9 -9
  45. package/dist/types/src/types/DroppedAssetTypes.d.ts +10 -0
  46. package/dist/types/src/types/InteractiveCredentialsTypes.d.ts +8 -0
  47. package/dist/types/src/types/OptionsTypes.d.ts +21 -0
  48. package/dist/types/src/types/ResponseTypes.d.ts +4 -0
  49. package/dist/types/src/types/VisitorTypes.d.ts +33 -0
  50. package/dist/{src/types/index.js → types/src/types/index.d.ts} +5 -4
  51. package/dist/types/src/utils/__tests__/removeUndefined.test.d.ts +1 -0
  52. package/dist/types/src/utils/__tests__/scatterVisitors.test.d.ts +1 -0
  53. package/dist/types/src/utils/getBrowserWarning.d.ts +1 -0
  54. package/dist/{src/utils/index.js → types/src/utils/index.d.ts} +3 -3
  55. package/dist/types/src/utils/removeUndefined.d.ts +8 -0
  56. package/dist/types/src/utils/scatterVisitors.d.ts +4 -0
  57. package/package.json +3 -2
  58. package/dist/example.js +0 -32
  59. package/dist/src/__mocks__/assets.js +0 -249
  60. package/dist/src/__mocks__/scenes.js +0 -104
  61. package/dist/src/__mocks__/visitors.js +0 -83
  62. package/dist/src/__mocks__/worlds.js +0 -52
  63. package/dist/src/controllers/Asset.js +0 -39
  64. package/dist/src/controllers/DroppedAsset.js +0 -461
  65. package/dist/src/controllers/SDKController.js +0 -85
  66. package/dist/src/controllers/Scene.js +0 -39
  67. package/dist/src/controllers/Topia.js +0 -39
  68. package/dist/src/controllers/User.js +0 -139
  69. package/dist/src/controllers/Visitor.js +0 -92
  70. package/dist/src/controllers/World.js +0 -256
  71. package/dist/src/controllers/WorldActivity.js +0 -162
  72. package/dist/src/controllers/__tests__/asset.test.js +0 -37
  73. package/dist/src/controllers/__tests__/droppedAsset.test.js +0 -98
  74. package/dist/src/controllers/__tests__/scene.test.js +0 -38
  75. package/dist/src/controllers/__tests__/user.test.js +0 -49
  76. package/dist/src/controllers/__tests__/visitor.test.js +0 -47
  77. package/dist/src/controllers/__tests__/world.test.js +0 -51
  78. package/dist/src/controllers/__tests__/worldActivity.test.js +0 -63
  79. package/dist/src/factories/AssetFactory.js +0 -11
  80. package/dist/src/factories/DroppedAssetFactory.js +0 -42
  81. package/dist/src/factories/SceneFactory.js +0 -27
  82. package/dist/src/factories/UserFactory.js +0 -10
  83. package/dist/src/factories/VisitorFactory.js +0 -26
  84. package/dist/src/factories/WorldActivityFactory.js +0 -10
  85. package/dist/src/factories/WorldFactory.js +0 -10
  86. package/dist/src/index.js +0 -28
  87. package/dist/src/interfaces/TopiaInterfaces.js +0 -1
  88. package/dist/src/interfaces/UserInterfaces.js +0 -1
  89. package/dist/src/interfaces/VisitorInterfaces.js +0 -1
  90. package/dist/src/interfaces/WorldActivityInterfaces.js +0 -1
  91. package/dist/src/interfaces/WorldInterfaces.js +0 -1
  92. package/dist/src/types/DroppedAssetTypes.js +0 -12
  93. package/dist/src/types/InteractiveCredentialsTypes.js +0 -1
  94. package/dist/src/types/OptionsTypes.js +0 -1
  95. package/dist/src/types/ResponseTypes.js +0 -1
  96. package/dist/src/types/VisitorTypes.js +0 -1
  97. package/dist/src/utils/__tests__/removeUndefined.test.js +0 -10
  98. package/dist/src/utils/__tests__/scatterVisitors.test.js +0 -11
  99. package/dist/src/utils/getBrowserWarning.js +0 -5
  100. package/dist/src/utils/removeUndefined.js +0 -11
  101. package/dist/src/utils/scatterVisitors.js +0 -8
@@ -0,0 +1,48 @@
1
+ import { Topia } from "controllers/Topia";
2
+ import { SDKInterface } from "interfaces";
3
+ import { InteractiveCredentials } from "types";
4
+ import { AxiosError } from "axios";
5
+ /**
6
+ * @summary
7
+ * Create an instance of SDKController class with credentials.
8
+ *
9
+ * @usage
10
+ * ```ts
11
+ * const credentials = {
12
+ * assetId: "exampleAsset",
13
+ * interactiveNonce: "exampleNonce"
14
+ * interactivePublicKey: "examplePublicKey",
15
+ * visitorId: 1,
16
+ * url: "https://topia.io",
17
+ * }
18
+ * const topia = await new Topia({
19
+ * apiDomain: "api.topia.io",
20
+ * apiKey: "exampleKey",
21
+ * interactiveKey: "key",
22
+ * interactiveSecret: "secret",
23
+ * }
24
+ * await new SDKController({ credentials, topia });
25
+ * ```
26
+ */
27
+ export declare class SDKController implements SDKInterface {
28
+ credentials: InteractiveCredentials | undefined;
29
+ jwt?: string;
30
+ requestOptions: object;
31
+ topia: Topia;
32
+ constructor(topia: Topia, credentials?: InteractiveCredentials);
33
+ topiaPublicApi(): import("axios").AxiosInstance;
34
+ errorHandler({ error, message, }: {
35
+ error?: Error | AxiosError | unknown;
36
+ message?: string;
37
+ }): {
38
+ data: {};
39
+ message: string;
40
+ method: string;
41
+ stack: string;
42
+ stackTrace: Error;
43
+ status: number;
44
+ success: boolean;
45
+ url: string;
46
+ };
47
+ }
48
+ export default SDKController;
@@ -0,0 +1,19 @@
1
+ import { SDKController } from "controllers/SDKController";
2
+ import { Topia } from "controllers/Topia";
3
+ import { SceneInterface, SceneOptionalInterface } from "interfaces";
4
+ import { ResponseType } from "types";
5
+ /**
6
+ * @summary
7
+ * Create an instance of Scene class with a given scene id and optional attributes and session credentials.
8
+ *
9
+ * @usage
10
+ * ```ts
11
+ * await new Scene(topia, "sceneId", { attributes: { name: "My Scene" } });
12
+ * ```
13
+ */
14
+ export declare class Scene extends SDKController implements SceneInterface {
15
+ readonly id: string;
16
+ constructor(topia: Topia, id: string, options?: SceneOptionalInterface);
17
+ fetchSceneById(): Promise<void | ResponseType>;
18
+ }
19
+ export default Scene;
@@ -0,0 +1,33 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { TopiaInterface } from "interfaces";
3
+ import jwt from "jsonwebtoken";
4
+ /**
5
+ * @summary
6
+ * Create a single instance of Topia axios used for all calls to the public API in all classes
7
+ *
8
+ * @usage
9
+ * ```ts
10
+ * const topia = await new Topia({
11
+ * apiDomain: "api.topia.io",
12
+ * apiKey: "exampleKey",
13
+ * interactiveKey: "key",
14
+ * interactiveSecret: "secret",
15
+ * });
16
+ * ```
17
+ */
18
+ export declare class Topia implements TopiaInterface {
19
+ axios: AxiosInstance;
20
+ apiDomain?: string;
21
+ apiKey?: string;
22
+ apiProtocol?: string;
23
+ interactiveKey?: string;
24
+ interactiveSecret?: jwt.Secret;
25
+ constructor({ apiDomain, apiKey, apiProtocol, interactiveKey, interactiveSecret, }: {
26
+ apiDomain?: string;
27
+ apiKey?: string;
28
+ apiProtocol?: string;
29
+ interactiveKey?: string;
30
+ interactiveSecret?: jwt.Secret;
31
+ });
32
+ }
33
+ export default Topia;
@@ -0,0 +1,58 @@
1
+ import { Asset } from "controllers/Asset";
2
+ import { Scene } from "controllers/Scene";
3
+ import { SDKController } from "controllers/SDKController";
4
+ import { Topia } from "controllers/Topia";
5
+ import { World } from "controllers/World";
6
+ import { UserOptionalInterface } from "interfaces";
7
+ import { ResponseType } from "types";
8
+ /**
9
+ * @summary
10
+ * Create an instance of User class with optional session credentials.
11
+ *
12
+ * @usage
13
+ * ```ts
14
+ * await new User(topia, { interactiveNonce: "exampleNonce", interactivePublicKey: "examplePublicKey", visitorId: 1 });
15
+ * ```
16
+ */
17
+ export declare class User extends SDKController {
18
+ #private;
19
+ constructor(topia: Topia, options?: UserOptionalInterface);
20
+ get assets(): {
21
+ [key: string]: Asset;
22
+ };
23
+ get scenes(): {
24
+ [key: string]: Scene;
25
+ };
26
+ get worlds(): {
27
+ [key: string]: World;
28
+ };
29
+ /**
30
+ * @summary
31
+ * Returns all assets owned by User when an email address is provided.
32
+ */
33
+ fetchAssets(): Promise<void | ResponseType>;
34
+ /**
35
+ * @summary
36
+ * Returns all scenes owned by User
37
+ */
38
+ fetchScenes(): Promise<void | ResponseType>;
39
+ /**
40
+ * @summary
41
+ * Retrieves all worlds owned by user with matching API Key,
42
+ * creates a new World object for each,
43
+ * and creates new map of Worlds accessible via user.worlds.
44
+ *
45
+ * @usage
46
+ * ```ts
47
+ * await user.fetchWorldsByKey();
48
+ * const userWorlds = user.worlds;
49
+ * ```
50
+ *
51
+ * @result
52
+ * ```ts
53
+ * { urlSlug: new World({ apiKey, worldArgs, urlSlug }) }
54
+ * ```
55
+ */
56
+ fetchWorldsByKey(): Promise<void | ResponseType>;
57
+ }
58
+ export default User;
@@ -0,0 +1,50 @@
1
+ import { Topia } from "controllers/Topia";
2
+ import { User } from "controllers/User";
3
+ import { MoveVisitorInterface, VisitorInterface, VisitorOptionalInterface } from "interfaces";
4
+ import { ResponseType } from "types";
5
+ /**
6
+ * @summary
7
+ * Create an instance of Visitor class with a given id and optional attributes and session credentials.
8
+ *
9
+ * @usage
10
+ * ```ts
11
+ * await new Visitor(topia, id, urlSlug, { attributes: { moveTo: { x: 0, y: 0 } } });
12
+ * ```
13
+ */
14
+ export declare class Visitor extends User implements VisitorInterface {
15
+ readonly id: number;
16
+ urlSlug: string;
17
+ user?: User;
18
+ constructor(topia: Topia, id: number, urlSlug: string, options?: VisitorOptionalInterface);
19
+ /**
20
+ * @summary
21
+ * Get a single visitor from a world
22
+ *
23
+ * @usage
24
+ * ```ts
25
+ * await visitor.fetchVisitor();
26
+ * ```
27
+ *
28
+ * @result
29
+ * Returns details for a visitor in a world by id and urlSlug
30
+ */
31
+ fetchVisitor(): Promise<void | ResponseType>;
32
+ /**
33
+ * @summary
34
+ * Teleport or walk a visitor currently in a world to a single set of coordinates.
35
+ *
36
+ * @usage
37
+ * ```ts
38
+ * await visitor.moveVisitor({
39
+ * shouldTeleportVisitor: true,
40
+ * x: 100,
41
+ * y: 100,
42
+ * });
43
+ * ```
44
+ *
45
+ * @result
46
+ * Updates each Visitor instance and world.visitors map.
47
+ */
48
+ moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
49
+ }
50
+ export default Visitor;
@@ -0,0 +1,143 @@
1
+ import { DroppedAsset } from "controllers/DroppedAsset";
2
+ import { SDKController } from "controllers/SDKController";
3
+ import { Topia } from "controllers/Topia";
4
+ import { WorldInterface, WorldOptionalInterface } from "interfaces";
5
+ import { ResponseType } from "types";
6
+ /**
7
+ * @summary
8
+ * Create an instance of World class with a given url slug and optional attributes and session credentials.
9
+ *
10
+ * @usage
11
+ * ```ts
12
+ * await new World(topia, "exampleWorld", { attributes: { name: "Example World" } });
13
+ * ```
14
+ */
15
+ export declare class World extends SDKController implements WorldInterface {
16
+ #private;
17
+ urlSlug: string;
18
+ constructor(topia: Topia, urlSlug: string, options?: WorldOptionalInterface);
19
+ get droppedAssets(): {
20
+ [key: string]: DroppedAsset;
21
+ };
22
+ /**
23
+ * @summary
24
+ * Retrieves details of a world.
25
+ *
26
+ * @usage
27
+ * ```ts
28
+ * await world.fetchDetails();
29
+ * const { name } = world;
30
+ * ```
31
+ */
32
+ fetchDetails(): Promise<void | ResponseType>;
33
+ /**
34
+ * @summary
35
+ * Update details of a world.
36
+ *
37
+ * @usage
38
+ * ```ts
39
+ * await world.updateDetails({
40
+ * controls: {
41
+ * allowMuteAll: true,
42
+ * disableHideVideo: true,
43
+ * isMobileDisabled: false,
44
+ * isShowingCurrentGuests: false,
45
+ * },
46
+ * description: 'Welcome to my world.',
47
+ * forceAuthOnLogin: false,
48
+ * height: 2000,
49
+ * name: 'Example',
50
+ * spawnPosition: { x: 100, y: 100 },
51
+ * width: 2000
52
+ * });
53
+ * ```
54
+ */
55
+ updateDetails({ controls, description, forceAuthOnLogin, height, name, spawnPosition, width, }: WorldInterface): Promise<void | ResponseType>;
56
+ /**
57
+ * @summary
58
+ * Retrieve all assets dropped in a world.
59
+ *
60
+ * @usage
61
+ * ```ts
62
+ * await world.fetchDroppedAssets();
63
+ * const assets = world.droppedAssets;
64
+ * ```
65
+ */
66
+ fetchDroppedAssets(): Promise<void | ResponseType>;
67
+ /**
68
+ * @summary
69
+ * Retrieve all assets dropped in a world matching uniqueName.
70
+ *
71
+ * @usage
72
+ * ```ts
73
+ * await world.fetchDroppedAssets();
74
+ * const assets = world.droppedAssets;
75
+ * ```
76
+ */
77
+ fetchDroppedAssetsWithUniqueName({ uniqueName, isPartial, isReversed, }: {
78
+ uniqueName: string;
79
+ isPartial?: boolean;
80
+ isReversed?: boolean;
81
+ }): Promise<DroppedAsset[]>;
82
+ /**
83
+ * @summary
84
+ * Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
85
+ *
86
+ * @usage
87
+ * ```ts
88
+ * const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]];
89
+ * const style = {
90
+ * "textColor": "#abc123",
91
+ * "textFontFamily": "Arial",
92
+ * "textSize": 40,
93
+ * "textWeight": "normal",
94
+ * "textWidth": 200
95
+ * };
96
+ * await world.updateCustomText(droppedAssetsToUpdate, style);
97
+ * ```
98
+ *
99
+ * @result
100
+ * Updates each DroppedAsset instance and world.droppedAssets map.
101
+ */
102
+ updateCustomTextDroppedAssets(droppedAssetsToUpdate: Array<DroppedAsset>, style: object): Promise<object>;
103
+ /**
104
+ * @summary
105
+ * Drop a scene in a world.
106
+ *
107
+ * @usage
108
+ * ```ts
109
+ * await world.dropScene({
110
+ * "sceneId": "string",
111
+ * "position": {
112
+ * "x": 0,
113
+ * "y": 0
114
+ * },
115
+ * "assetSuffix": "string"
116
+ * });
117
+ * ```
118
+ */
119
+ dropScene({ assetSuffix, position, sceneId, }: {
120
+ assetSuffix: string;
121
+ position: object;
122
+ sceneId: string;
123
+ }): Promise<void | ResponseType>;
124
+ /**
125
+ * @summary
126
+ * Replace the current scene of a world.
127
+ *
128
+ * @usage
129
+ * ```ts
130
+ * const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]]
131
+ * const style = {
132
+ * "textColor": "#abc123",
133
+ * "textFontFamily": "Arial",
134
+ * "textSize": 40,
135
+ * "textWeight": "normal",
136
+ * "textWidth": 200
137
+ * }
138
+ * await world.replaceScene(SCENE_ID);
139
+ * ```
140
+ */
141
+ replaceScene(sceneId: string): Promise<void | ResponseType>;
142
+ }
143
+ export default World;
@@ -0,0 +1,83 @@
1
+ import { SDKController } from "controllers/SDKController";
2
+ import { Topia } from "controllers/Topia";
3
+ import { Visitor } from "controllers/Visitor";
4
+ import { MoveAllVisitorsInterface, WorldActivityOptionalInterface } from "interfaces";
5
+ import { ResponseType, VisitorsToMoveArrayType } from "types";
6
+ /**
7
+ * @summary
8
+ * Create an instance of WorldActivity class with a given url slug and optional attributes and session credentials.
9
+ *
10
+ * This class is responsible for all activity of a specified world including editing dropped assets, moving current visitors, etc.
11
+ *
12
+ * @usage
13
+ * ```ts
14
+ * await new WorldActivity(topia, "exampleWorld", { attributes: { name: "Example World" } });
15
+ * ```
16
+ */
17
+ export declare class WorldActivity extends SDKController {
18
+ #private;
19
+ urlSlug: string;
20
+ constructor(topia: Topia, urlSlug: string, options?: WorldActivityOptionalInterface);
21
+ get visitors(): {
22
+ [key: string]: Visitor;
23
+ };
24
+ private fetchVisitors;
25
+ /**
26
+ * @summary
27
+ * Retrieve all visitors currently in a world.
28
+ *
29
+ * @usage
30
+ * ```ts
31
+ * const visitors = await world.currentVisitors();
32
+ * ```
33
+ */
34
+ currentVisitors(): Promise<unknown>;
35
+ /**
36
+ * @summary
37
+ * Move all visitors currently in a world to a single set of coordinates.
38
+ * Optionally refetch visitors, teleport or walk visitors to new location,
39
+ * and scatter visitors by any number so that they don't all move to the exact same location.
40
+ *
41
+ * @usage
42
+ * ```ts
43
+ * await world.moveAllVisitors({
44
+ * shouldFetchVisitors: true,
45
+ * shouldTeleportVisitors: true,
46
+ * scatterVisitorsBy: 40,
47
+ * x: 100,
48
+ * y: 100,
49
+ * });
50
+ * ```
51
+ *
52
+ * @result
53
+ * Updates each Visitor instance and world.visitors map.
54
+ */
55
+ moveAllVisitors({ shouldFetchVisitors, shouldTeleportVisitors, scatterVisitorsBy, x, y, }: MoveAllVisitorsInterface): Promise<(void | ResponseType)[] | undefined>;
56
+ /**
57
+ * @summary
58
+ * Teleport or walk a list of visitors currently in a world to various coordinates.
59
+ *
60
+ * @usage
61
+ * ```ts
62
+ * const visitorsToMove = [
63
+ * {
64
+ * visitorObj: world.visitors["1"],
65
+ * shouldTeleportVisitor: true,
66
+ * x: 100,
67
+ * y: 100
68
+ * }, {
69
+ * visitorObj: world.visitors["2"],
70
+ * shouldTeleportVisitor: false,
71
+ * x: 100,
72
+ * y: 100
73
+ * }
74
+ * ];
75
+ * await world.moveVisitors(visitorsToMove);
76
+ * ```
77
+ *
78
+ * @result
79
+ * Updates each Visitor instance and world.visitors map.
80
+ */
81
+ moveVisitors(visitorsToMove: VisitorsToMoveArrayType): Promise<(void | ResponseType)[]>;
82
+ }
83
+ export default WorldActivity;
@@ -1,9 +1,9 @@
1
- export { Asset } from "./Asset";
2
- export { DroppedAsset } from "./DroppedAsset";
3
- export { Scene } from "./Scene";
4
- export { SDKController } from "./SDKController";
5
- export { User } from "./User";
6
- export { Visitor } from "./Visitor";
7
- export { World } from "./World";
8
- export { WorldActivity } from "./WorldActivity";
9
- export { Topia } from "./Topia";
1
+ export { Asset } from "./Asset";
2
+ export { DroppedAsset } from "./DroppedAsset";
3
+ export { Scene } from "./Scene";
4
+ export { SDKController } from "./SDKController";
5
+ export { User } from "./User";
6
+ export { Visitor } from "./Visitor";
7
+ export { World } from "./World";
8
+ export { WorldActivity } from "./WorldActivity";
9
+ export { Topia } from "./Topia";
@@ -0,0 +1,8 @@
1
+ import { Asset, Topia } from "controllers";
2
+ import { AssetOptionalInterface } from "interfaces";
3
+ export declare class AssetFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(id: string, options?: AssetOptionalInterface): Asset;
7
+ }
8
+ export default AssetFactory;
@@ -0,0 +1,16 @@
1
+ import { DroppedAsset, Topia, Asset, SDKController } from "controllers";
2
+ import { DroppedAssetOptionalInterface } from "interfaces";
3
+ export declare class DroppedAssetFactory extends SDKController {
4
+ constructor(topia: Topia);
5
+ create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
6
+ get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
7
+ drop(asset: Asset, { position: { x, y }, uniqueName, urlSlug, }: {
8
+ position: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ uniqueName?: string;
13
+ urlSlug: string;
14
+ }): Promise<DroppedAsset>;
15
+ }
16
+ export default DroppedAssetFactory;
@@ -0,0 +1,9 @@
1
+ import { Scene, Topia } from "controllers";
2
+ import { SceneOptionalInterface } from "interfaces";
3
+ export declare class SceneFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(id: string, options?: SceneOptionalInterface): Scene;
7
+ get(id: string, options?: SceneOptionalInterface): Promise<Scene>;
8
+ }
9
+ export default SceneFactory;
@@ -0,0 +1,8 @@
1
+ import { Topia, User } from "controllers";
2
+ import { UserOptionalInterface } from "interfaces";
3
+ export declare class UserFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(options?: UserOptionalInterface): User;
7
+ }
8
+ export default UserFactory;
@@ -0,0 +1,9 @@
1
+ import { Topia, Visitor } from "controllers";
2
+ import { VisitorOptionalInterface } from "interfaces";
3
+ export declare class VisitorFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(id: number, urlSlug: string, options?: VisitorOptionalInterface): Visitor;
7
+ get(id: number, urlSlug: string, options?: VisitorOptionalInterface): Promise<Visitor>;
8
+ }
9
+ export default VisitorFactory;
@@ -0,0 +1,8 @@
1
+ import { Topia, WorldActivity } from "controllers";
2
+ import { WorldOptionalInterface } from "interfaces";
3
+ export declare class WorldActivityFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
7
+ }
8
+ export default WorldActivityFactory;
@@ -0,0 +1,8 @@
1
+ import { Topia, World } from "controllers";
2
+ import { WorldOptionalInterface } from "interfaces";
3
+ export declare class WorldFactory {
4
+ topia: Topia;
5
+ constructor(topia: Topia);
6
+ create(urlSlug: string, options?: WorldOptionalInterface): World;
7
+ }
8
+ export default WorldFactory;
@@ -1,7 +1,7 @@
1
- export { AssetFactory } from "./AssetFactory";
2
- export { DroppedAssetFactory } from "./DroppedAssetFactory";
3
- export { SceneFactory } from "./SceneFactory";
4
- export { UserFactory } from "./UserFactory";
5
- export { VisitorFactory } from "./VisitorFactory";
6
- export { WorldActivityFactory } from "./WorldActivityFactory";
7
- export { WorldFactory } from "./WorldFactory";
1
+ export { AssetFactory } from "./AssetFactory";
2
+ export { DroppedAssetFactory } from "./DroppedAssetFactory";
3
+ export { SceneFactory } from "./SceneFactory";
4
+ export { UserFactory } from "./UserFactory";
5
+ export { VisitorFactory } from "./VisitorFactory";
6
+ export { WorldActivityFactory } from "./WorldActivityFactory";
7
+ export { WorldFactory } from "./WorldFactory";
@@ -0,0 +1,4 @@
1
+ export { Topia } from "controllers";
2
+ export { AssetFactory, DroppedAssetFactory, SceneFactory, UserFactory, VisitorFactory, WorldActivityFactory, WorldFactory, } from "factories";
3
+ export type { AssetOptions, DroppedAssetClickType, DroppedAssetMediaType, DroppedAssetOptions, InteractiveCredentials, ResponseType, UserOptions, VisitorOptions, VisitorType, VisitorsToMoveType, VisitorsToMoveArrayType, WorldOptions, } from "types";
4
+ export * from "interfaces";
@@ -0,0 +1,26 @@
1
+ import { InteractiveCredentials } from "types";
2
+ import { SDKInterface } from "interfaces/SDKInterfaces";
3
+ export interface AssetInterface extends SDKInterface {
4
+ fetchPlatformAssets(): Promise<object>;
5
+ addedOn?: string;
6
+ assetName?: string;
7
+ creatorTags?: object;
8
+ readonly id?: string;
9
+ isPublic?: boolean;
10
+ library?: string;
11
+ originalAssetId?: string;
12
+ originalKit?: string;
13
+ ownerId?: string;
14
+ ownerName?: string;
15
+ platformAsset?: boolean;
16
+ purchased?: boolean;
17
+ purchaseDate?: string;
18
+ purchasedFrom?: string;
19
+ specialType?: string | null;
20
+ transactionId?: string;
21
+ type?: string;
22
+ }
23
+ export type AssetOptionalInterface = {
24
+ attributes?: AssetInterface | object;
25
+ credentials?: InteractiveCredentials | object;
26
+ };