@rtsdk/topia 0.11.9 → 0.11.12

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 CHANGED
@@ -48,7 +48,7 @@ Topia offers a robust SDK and API that allows anyone to build custom apps or int
48
48
  - [Github](https://github.com/metaversecloud-com/sdk-quest)
49
49
  - [Demo](https://topia.io/quest-prod)
50
50
 
51
- Questions, comments, or have something exciting to share with the Topia team? Reach out to [developers@topia.io](mailto:developers@topia.io)!
51
+ Questions, comments, or have something exciting to share with the Topia team? Reach out to [apps@topia.io](mailto:apps@topia.io)!
52
52
  <br/>
53
53
 
54
54
  ## Authorization
package/dist/index.cjs CHANGED
@@ -40853,9 +40853,9 @@ class World extends SDKController {
40853
40853
  * { sceneDropId: sceneId-timestamp, success: true }
40854
40854
  * ```
40855
40855
  */
40856
- dropScene({ assetSuffix, position, sceneDropId, sceneId, }) {
40856
+ dropScene({ allowNonAdmins, assetSuffix, position, sceneDropId, sceneId, }) {
40857
40857
  return __awaiter(this, void 0, void 0, function* () {
40858
- const params = { assetSuffix, position, sceneDropId, sceneId };
40858
+ const params = { allowNonAdmins, assetSuffix, position, sceneDropId, sceneId };
40859
40859
  try {
40860
40860
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, params, this.requestOptions);
40861
40861
  return result;
@@ -40922,6 +40922,7 @@ class World extends SDKController {
40922
40922
  * ```
40923
40923
  */
40924
40924
  triggerParticle({ id, name, duration = 10, position = { x: 1, y: 1 }, }) {
40925
+ var _a;
40925
40926
  return __awaiter(this, void 0, void 0, function* () {
40926
40927
  if (!id && !name)
40927
40928
  throw "A particle name is required.";
@@ -40929,8 +40930,10 @@ class World extends SDKController {
40929
40930
  let particleId = id;
40930
40931
  if (name) {
40931
40932
  const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
40932
- particleId = response.data[0].id;
40933
+ particleId = (_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.id;
40933
40934
  }
40935
+ if (!particleId)
40936
+ return "No particleId found.";
40934
40937
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
40935
40938
  return result;
40936
40939
  }
@@ -41819,6 +41822,7 @@ class Visitor extends User {
41819
41822
  * ```
41820
41823
  */
41821
41824
  triggerParticle({ id, name, duration = 10, }) {
41825
+ var _a;
41822
41826
  return __awaiter(this, void 0, void 0, function* () {
41823
41827
  if (!id && !name)
41824
41828
  throw "A particle name is required.";
@@ -41826,8 +41830,10 @@ class Visitor extends User {
41826
41830
  let particleId = id;
41827
41831
  if (name) {
41828
41832
  const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
41829
- particleId = response.data[0].id;
41833
+ particleId = (_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.id;
41830
41834
  }
41835
+ if (!particleId)
41836
+ return "No particleId found.";
41831
41837
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
41832
41838
  return result;
41833
41839
  }
@@ -42041,7 +42047,7 @@ class WorldActivity extends SDKController {
42041
42047
  *
42042
42048
  * @usage
42043
42049
  * ```ts
42044
- * const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
42050
+ * const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
42045
42051
  * ```
42046
42052
  */
42047
42053
  fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }) {
package/dist/index.d.ts CHANGED
@@ -2,6 +2,14 @@ import * as axios from 'axios';
2
2
  import { AxiosResponse, AxiosInstance, AxiosError } from 'axios';
3
3
  import jwt from 'jsonwebtoken';
4
4
 
5
+ type AnalyticType = {
6
+ analyticName: string;
7
+ incrementBy?: number;
8
+ profileId?: string;
9
+ uniqueKey?: string;
10
+ urlSlug?: string;
11
+ };
12
+
5
13
  declare enum DroppedAssetClickType {
6
14
  NONE = "none",
7
15
  LINK = "link",
@@ -77,14 +85,6 @@ declare class Scene extends SDKController implements SceneInterface {
77
85
  fetchSceneById(): Promise<void | ResponseType$1>;
78
86
  }
79
87
 
80
- type AnalyticType = {
81
- analyticName: string;
82
- incrementBy?: number;
83
- profileId?: string;
84
- uniqueKey?: string;
85
- urlSlug?: string;
86
- };
87
-
88
88
  /**
89
89
  * @summary
90
90
  * Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.
@@ -659,7 +659,8 @@ declare class World extends SDKController implements WorldInterface {
659
659
  * { sceneDropId: sceneId-timestamp, success: true }
660
660
  * ```
661
661
  */
662
- dropScene({ assetSuffix, position, sceneDropId, sceneId, }: {
662
+ dropScene({ allowNonAdmins, assetSuffix, position, sceneDropId, sceneId, }: {
663
+ allowNonAdmins?: boolean;
663
664
  assetSuffix?: string;
664
665
  position: object;
665
666
  sceneDropId?: string;
@@ -707,7 +708,7 @@ declare class World extends SDKController implements WorldInterface {
707
708
  name?: string;
708
709
  duration?: number;
709
710
  position?: object;
710
- }): Promise<object | ResponseType$1>;
711
+ }): Promise<object | ResponseType$1 | string>;
711
712
  /**
712
713
  * @summary
713
714
  * Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
@@ -1295,7 +1296,7 @@ declare class Visitor extends User implements VisitorInterface {
1295
1296
  id?: string;
1296
1297
  name?: string;
1297
1298
  duration?: number;
1298
- }): Promise<object | ResponseType$1>;
1299
+ }): Promise<object | ResponseType$1 | string>;
1299
1300
  /**
1300
1301
  * @summary
1301
1302
  * Retrieves the data object for a visitor.
@@ -1915,7 +1916,7 @@ declare class WorldActivity extends SDKController {
1915
1916
  *
1916
1917
  * @usage
1917
1918
  * ```ts
1918
- * const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
1919
+ * const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
1919
1920
  * ```
1920
1921
  */
1921
1922
  fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }: {
package/dist/index.js CHANGED
@@ -40851,9 +40851,9 @@ class World extends SDKController {
40851
40851
  * { sceneDropId: sceneId-timestamp, success: true }
40852
40852
  * ```
40853
40853
  */
40854
- dropScene({ assetSuffix, position, sceneDropId, sceneId, }) {
40854
+ dropScene({ allowNonAdmins, assetSuffix, position, sceneDropId, sceneId, }) {
40855
40855
  return __awaiter(this, void 0, void 0, function* () {
40856
- const params = { assetSuffix, position, sceneDropId, sceneId };
40856
+ const params = { allowNonAdmins, assetSuffix, position, sceneDropId, sceneId };
40857
40857
  try {
40858
40858
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, params, this.requestOptions);
40859
40859
  return result;
@@ -40920,6 +40920,7 @@ class World extends SDKController {
40920
40920
  * ```
40921
40921
  */
40922
40922
  triggerParticle({ id, name, duration = 10, position = { x: 1, y: 1 }, }) {
40923
+ var _a;
40923
40924
  return __awaiter(this, void 0, void 0, function* () {
40924
40925
  if (!id && !name)
40925
40926
  throw "A particle name is required.";
@@ -40927,8 +40928,10 @@ class World extends SDKController {
40927
40928
  let particleId = id;
40928
40929
  if (name) {
40929
40930
  const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
40930
- particleId = response.data[0].id;
40931
+ particleId = (_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.id;
40931
40932
  }
40933
+ if (!particleId)
40934
+ return "No particleId found.";
40932
40935
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
40933
40936
  return result;
40934
40937
  }
@@ -41817,6 +41820,7 @@ class Visitor extends User {
41817
41820
  * ```
41818
41821
  */
41819
41822
  triggerParticle({ id, name, duration = 10, }) {
41823
+ var _a;
41820
41824
  return __awaiter(this, void 0, void 0, function* () {
41821
41825
  if (!id && !name)
41822
41826
  throw "A particle name is required.";
@@ -41824,8 +41828,10 @@ class Visitor extends User {
41824
41828
  let particleId = id;
41825
41829
  if (name) {
41826
41830
  const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
41827
- particleId = response.data[0].id;
41831
+ particleId = (_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.id;
41828
41832
  }
41833
+ if (!particleId)
41834
+ return "No particleId found.";
41829
41835
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
41830
41836
  return result;
41831
41837
  }
@@ -42039,7 +42045,7 @@ class WorldActivity extends SDKController {
42039
42045
  *
42040
42046
  * @usage
42041
42047
  * ```ts
42042
- * const visitors = await worldActivity.fetchVisitorsInZone("exampleDroppedAssetId");
42048
+ * const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
42043
42049
  * ```
42044
42050
  */
42045
42051
  fetchVisitorsInZone({ droppedAssetId, shouldIncludeAdminPermissions, }) {
package/package.json CHANGED
@@ -59,5 +59,5 @@
59
59
  "local-publish": "yarn build && yalc publish --push --no-scripts"
60
60
  },
61
61
  "type": "module",
62
- "version": "0.11.9"
62
+ "version": "0.11.12"
63
63
  }