@rtsdk/topia 0.12.6 → 0.13.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.cjs CHANGED
@@ -40955,7 +40955,7 @@ class World extends SDKController {
40955
40955
  const params = { allowNonAdmins, assetSuffix, position, sceneDropId, sceneId };
40956
40956
  try {
40957
40957
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, params, this.requestOptions);
40958
- return result;
40958
+ return result.data;
40959
40959
  }
40960
40960
  catch (error) {
40961
40961
  throw this.errorHandler({ error, params, sdkMethod: "World.dropScene" });
@@ -41032,7 +41032,7 @@ class World extends SDKController {
41032
41032
  if (!particleId)
41033
41033
  return "No particleId found.";
41034
41034
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
41035
- return result;
41035
+ return result.data;
41036
41036
  }
41037
41037
  catch (error) {
41038
41038
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "World.triggerParticle" });
@@ -41568,6 +41568,28 @@ class User extends SDKController {
41568
41568
  }
41569
41569
  });
41570
41570
  }
41571
+ /**
41572
+ * @summary
41573
+ * Send an email
41574
+ *
41575
+ * @usage
41576
+ * ```ts
41577
+ * const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
41578
+ * await user.sendEmail({ html, subject: "Example", to: "example@email.io" });
41579
+ * ```
41580
+ */
41581
+ sendEmail({ html, subject, to, }) {
41582
+ return __awaiter(this, void 0, void 0, function* () {
41583
+ const params = { html, subject, to };
41584
+ try {
41585
+ const response = yield this.topiaPublicApi().post(`/notifications/send-email`, params, this.requestOptions);
41586
+ return response.data;
41587
+ }
41588
+ catch (error) {
41589
+ throw this.errorHandler({ error, params, sdkMethod: "User.sendEmail" });
41590
+ }
41591
+ });
41592
+ }
41571
41593
  /**
41572
41594
  * @summary
41573
41595
  * Retrieves the data object for a user.
@@ -41884,7 +41906,7 @@ class Visitor extends User {
41884
41906
  expressionId = response.data[0].id;
41885
41907
  }
41886
41908
  const result = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/grant-expression/${expressionId}`, {}, this.requestOptions);
41887
- return result;
41909
+ return result.data;
41888
41910
  }
41889
41911
  catch (error) {
41890
41912
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.grantExpression" });
@@ -41934,7 +41956,7 @@ class Visitor extends User {
41934
41956
  if (!particleId)
41935
41957
  return "No particleId found.";
41936
41958
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
41937
- return result;
41959
+ return result.data;
41938
41960
  }
41939
41961
  catch (error) {
41940
41962
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.triggerParticle" });
package/dist/index.d.ts CHANGED
@@ -66,8 +66,9 @@ type WorldOptions = {
66
66
  };
67
67
 
68
68
  type ResponseType$1 = {
69
- message: string;
70
- success: boolean;
69
+ message?: string;
70
+ statusCode?: number;
71
+ success?: boolean;
71
72
  };
72
73
 
73
74
  /**
@@ -678,7 +679,7 @@ declare class World extends SDKController implements WorldInterface {
678
679
  position: object;
679
680
  sceneDropId?: string;
680
681
  sceneId: string;
681
- }): Promise<object | ResponseType$1>;
682
+ }): Promise<ResponseType$1>;
682
683
  /**
683
684
  * @summary
684
685
  * Replace the current scene of a world.
@@ -721,7 +722,7 @@ declare class World extends SDKController implements WorldInterface {
721
722
  name?: string;
722
723
  duration?: number;
723
724
  position?: object;
724
- }): Promise<object | ResponseType$1 | string>;
725
+ }): Promise<ResponseType$1 | string>;
725
726
  /**
726
727
  * @summary
727
728
  * Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
@@ -1100,6 +1101,21 @@ declare class User extends SDKController implements UserInterface {
1100
1101
  * ```
1101
1102
  */
1102
1103
  fetchInteractiveWorldsByKey(interactivePublicKey: string): Promise<object | ResponseType$1>;
1104
+ /**
1105
+ * @summary
1106
+ * Send an email
1107
+ *
1108
+ * @usage
1109
+ * ```ts
1110
+ * const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
1111
+ * await user.sendEmail({ html, subject: "Example", to: "example@email.io" });
1112
+ * ```
1113
+ */
1114
+ sendEmail({ html, subject, to, }: {
1115
+ html: string;
1116
+ subject: string;
1117
+ to: string;
1118
+ }): Promise<object | ResponseType$1>;
1103
1119
  /**
1104
1120
  * @summary
1105
1121
  * Retrieves the data object for a user.
@@ -1285,7 +1301,7 @@ declare class Visitor extends User implements VisitorInterface {
1285
1301
  grantExpression({ id, name }: {
1286
1302
  id?: string;
1287
1303
  name?: string;
1288
- }): Promise<object | ResponseType$1>;
1304
+ }): Promise<ResponseType$1>;
1289
1305
  /**
1290
1306
  * @summary
1291
1307
  * Get all particles available
@@ -1295,7 +1311,7 @@ declare class Visitor extends User implements VisitorInterface {
1295
1311
  * await visitor.getAllParticles();
1296
1312
  * ```
1297
1313
  */
1298
- getAllParticles(): Promise<object | ResponseType$1>;
1314
+ getAllParticles(): Promise<ResponseType$1>;
1299
1315
  /**
1300
1316
  * @summary
1301
1317
  * Trigger a particle effect on a visitor
@@ -1309,7 +1325,7 @@ declare class Visitor extends User implements VisitorInterface {
1309
1325
  id?: string;
1310
1326
  name?: string;
1311
1327
  duration?: number;
1312
- }): Promise<object | ResponseType$1 | string>;
1328
+ }): Promise<ResponseType$1 | string>;
1313
1329
  /**
1314
1330
  * @summary
1315
1331
  * Retrieves the data object for a visitor.
package/dist/index.js CHANGED
@@ -40953,7 +40953,7 @@ class World extends SDKController {
40953
40953
  const params = { allowNonAdmins, assetSuffix, position, sceneDropId, sceneId };
40954
40954
  try {
40955
40955
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/drop-scene`, params, this.requestOptions);
40956
- return result;
40956
+ return result.data;
40957
40957
  }
40958
40958
  catch (error) {
40959
40959
  throw this.errorHandler({ error, params, sdkMethod: "World.dropScene" });
@@ -41030,7 +41030,7 @@ class World extends SDKController {
41030
41030
  if (!particleId)
41031
41031
  return "No particleId found.";
41032
41032
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
41033
- return result;
41033
+ return result.data;
41034
41034
  }
41035
41035
  catch (error) {
41036
41036
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "World.triggerParticle" });
@@ -41566,6 +41566,28 @@ class User extends SDKController {
41566
41566
  }
41567
41567
  });
41568
41568
  }
41569
+ /**
41570
+ * @summary
41571
+ * Send an email
41572
+ *
41573
+ * @usage
41574
+ * ```ts
41575
+ * const html = `<p><b>Hello World!</b></p><p>This email is being sent from via SDK.</p>`
41576
+ * await user.sendEmail({ html, subject: "Example", to: "example@email.io" });
41577
+ * ```
41578
+ */
41579
+ sendEmail({ html, subject, to, }) {
41580
+ return __awaiter(this, void 0, void 0, function* () {
41581
+ const params = { html, subject, to };
41582
+ try {
41583
+ const response = yield this.topiaPublicApi().post(`/notifications/send-email`, params, this.requestOptions);
41584
+ return response.data;
41585
+ }
41586
+ catch (error) {
41587
+ throw this.errorHandler({ error, params, sdkMethod: "User.sendEmail" });
41588
+ }
41589
+ });
41590
+ }
41569
41591
  /**
41570
41592
  * @summary
41571
41593
  * Retrieves the data object for a user.
@@ -41882,7 +41904,7 @@ class Visitor extends User {
41882
41904
  expressionId = response.data[0].id;
41883
41905
  }
41884
41906
  const result = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/grant-expression/${expressionId}`, {}, this.requestOptions);
41885
- return result;
41907
+ return result.data;
41886
41908
  }
41887
41909
  catch (error) {
41888
41910
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.grantExpression" });
@@ -41932,7 +41954,7 @@ class Visitor extends User {
41932
41954
  if (!particleId)
41933
41955
  return "No particleId found.";
41934
41956
  const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
41935
- return result;
41957
+ return result.data;
41936
41958
  }
41937
41959
  catch (error) {
41938
41960
  throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.triggerParticle" });
package/package.json CHANGED
@@ -60,5 +60,5 @@
60
60
  "yalc-push": "yarn build && yalc publish --push --dev --no-scripts"
61
61
  },
62
62
  "type": "module",
63
- "version": "0.12.06"
63
+ "version": "0.13.01"
64
64
  }