@rtsdk/topia 0.11.10 → 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
@@ -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
  }
package/dist/index.d.ts CHANGED
@@ -708,7 +708,7 @@ declare class World extends SDKController implements WorldInterface {
708
708
  name?: string;
709
709
  duration?: number;
710
710
  position?: object;
711
- }): Promise<object | ResponseType$1>;
711
+ }): Promise<object | ResponseType$1 | string>;
712
712
  /**
713
713
  * @summary
714
714
  * Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
@@ -1296,7 +1296,7 @@ declare class Visitor extends User implements VisitorInterface {
1296
1296
  id?: string;
1297
1297
  name?: string;
1298
1298
  duration?: number;
1299
- }): Promise<object | ResponseType$1>;
1299
+ }): Promise<object | ResponseType$1 | string>;
1300
1300
  /**
1301
1301
  * @summary
1302
1302
  * Retrieves the data object for a visitor.
package/dist/index.js CHANGED
@@ -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
  }
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.10"
62
+ "version": "0.11.12"
63
63
  }