@rtsdk/topia 0.15.1 → 0.15.3

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
@@ -39811,6 +39811,13 @@ var DroppedAssetMediaType;
39811
39811
  DroppedAssetMediaType["LINK"] = "link";
39812
39812
  })(DroppedAssetMediaType || (DroppedAssetMediaType = {}));
39813
39813
 
39814
+ var WorldActivityTypes;
39815
+ (function (WorldActivityTypes) {
39816
+ WorldActivityTypes["GAME_ON"] = "GAME_ON";
39817
+ WorldActivityTypes["GAME_WAITING"] = "GAME_WAITING";
39818
+ WorldActivityTypes["GAME_HIGH_SCORE"] = "GAME_HIGH_SCORE";
39819
+ })(WorldActivityTypes || (WorldActivityTypes = {}));
39820
+
39814
39821
  const getBrowserWarning = () => {
39815
39822
  if (typeof window !== "undefined") {
39816
39823
  console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
@@ -41104,6 +41111,27 @@ class World extends SDKController {
41104
41111
  }
41105
41112
  });
41106
41113
  }
41114
+ /**
41115
+ * @summary
41116
+ * Add an activity to a world
41117
+ * excludeFromNotification is an array of visitorIds to exclude from the notification
41118
+ *
41119
+ * @usage
41120
+ * ```ts
41121
+ * await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
41122
+ * ```
41123
+ */
41124
+ triggerActivity({ type, assetId, excludeFromNotification }) {
41125
+ return __awaiter(this, void 0, void 0, function* () {
41126
+ try {
41127
+ const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/set-activity`, { type, assetId, excludeFromNotification }, this.requestOptions);
41128
+ return result.data;
41129
+ }
41130
+ catch (error) {
41131
+ throw this.errorHandler({ error, params: { type }, sdkMethod: "World.triggerActivity" });
41132
+ }
41133
+ });
41134
+ }
41107
41135
  /**
41108
41136
  * @summary
41109
41137
  * Display a message via a toast to all visitors currently in a world.
@@ -41698,7 +41726,7 @@ class User extends SDKController {
41698
41726
  let query = `?getUnlockablesOnly=${getUnlockablesOnly}`;
41699
41727
  if (name)
41700
41728
  query += `&name=${name}`;
41701
- const result = yield this.topiaPublicApi().get(`/expressions?getUnlockablesOnly=${getUnlockablesOnly}`, this.requestOptions);
41729
+ const result = yield this.topiaPublicApi().get(`/expressions${query}`, this.requestOptions);
41702
41730
  return result.data;
41703
41731
  }
41704
41732
  catch (error) {
@@ -42002,6 +42030,29 @@ class Visitor extends User {
42002
42030
  }
42003
42031
  });
42004
42032
  }
42033
+ /**
42034
+ * @summary
42035
+ * Get expressions
42036
+ *
42037
+ * @usage
42038
+ * ```ts
42039
+ * await visitor.getExpressions({ getUnlockablesOnly: true, });
42040
+ * ```
42041
+ */
42042
+ getExpressions({ name, getUnlockablesOnly, }) {
42043
+ return __awaiter(this, void 0, void 0, function* () {
42044
+ try {
42045
+ let query = `?getUnlockablesOnly=${getUnlockablesOnly}`;
42046
+ if (name)
42047
+ query += `&name=${name}`;
42048
+ const result = yield this.topiaPublicApi().get(`/expressions${query}`, this.requestOptions);
42049
+ return result.data;
42050
+ }
42051
+ catch (error) {
42052
+ throw this.errorHandler({ error, params: { name, getUnlockablesOnly }, sdkMethod: "Visitors.getExpressions" });
42053
+ }
42054
+ });
42055
+ }
42005
42056
  /**
42006
42057
  * @summary
42007
42058
  * Grant expression to a visitor by id or name.
package/dist/index.d.ts CHANGED
@@ -755,6 +755,21 @@ declare class World extends SDKController implements WorldInterface {
755
755
  duration?: number;
756
756
  position?: object;
757
757
  }): Promise<ResponseType$1 | string>;
758
+ /**
759
+ * @summary
760
+ * Add an activity to a world
761
+ * excludeFromNotification is an array of visitorIds to exclude from the notification
762
+ *
763
+ * @usage
764
+ * ```ts
765
+ * await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
766
+ * ```
767
+ */
768
+ triggerActivity({ type, assetId, excludeFromNotification }: {
769
+ type: WorldActivityTypes;
770
+ assetId: string;
771
+ excludeFromNotification?: (string | number)[];
772
+ }): Promise<ResponseType$1 | string>;
758
773
  /**
759
774
  * @summary
760
775
  * Display a message via a toast to all visitors currently in a world.
@@ -1348,6 +1363,19 @@ declare class Visitor extends User implements VisitorInterface {
1348
1363
  * ```
1349
1364
  */
1350
1365
  turnAVOff(): Promise<void | ResponseType$1>;
1366
+ /**
1367
+ * @summary
1368
+ * Get expressions
1369
+ *
1370
+ * @usage
1371
+ * ```ts
1372
+ * await visitor.getExpressions({ getUnlockablesOnly: true, });
1373
+ * ```
1374
+ */
1375
+ getExpressions({ name, getUnlockablesOnly, }: {
1376
+ name?: string;
1377
+ getUnlockablesOnly?: boolean;
1378
+ }): Promise<ResponseType$1>;
1351
1379
  /**
1352
1380
  * @summary
1353
1381
  * Grant expression to a visitor by id or name.
@@ -1510,6 +1538,12 @@ type VisitorsToMoveType = {
1510
1538
  };
1511
1539
  type VisitorsToMoveArrayType = Array<VisitorsToMoveType>;
1512
1540
 
1541
+ declare enum WorldActivityTypes {
1542
+ GAME_ON = "GAME_ON",
1543
+ GAME_WAITING = "GAME_WAITING",
1544
+ GAME_HIGH_SCORE = "GAME_HIGH_SCORE"
1545
+ }
1546
+
1513
1547
  interface SDKInterface {
1514
1548
  credentials?: InteractiveCredentials;
1515
1549
  jwt?: string;
package/dist/index.js CHANGED
@@ -39809,6 +39809,13 @@ var DroppedAssetMediaType;
39809
39809
  DroppedAssetMediaType["LINK"] = "link";
39810
39810
  })(DroppedAssetMediaType || (DroppedAssetMediaType = {}));
39811
39811
 
39812
+ var WorldActivityTypes;
39813
+ (function (WorldActivityTypes) {
39814
+ WorldActivityTypes["GAME_ON"] = "GAME_ON";
39815
+ WorldActivityTypes["GAME_WAITING"] = "GAME_WAITING";
39816
+ WorldActivityTypes["GAME_HIGH_SCORE"] = "GAME_HIGH_SCORE";
39817
+ })(WorldActivityTypes || (WorldActivityTypes = {}));
39818
+
39812
39819
  const getBrowserWarning = () => {
39813
39820
  if (typeof window !== "undefined") {
39814
39821
  console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
@@ -41102,6 +41109,27 @@ class World extends SDKController {
41102
41109
  }
41103
41110
  });
41104
41111
  }
41112
+ /**
41113
+ * @summary
41114
+ * Add an activity to a world
41115
+ * excludeFromNotification is an array of visitorIds to exclude from the notification
41116
+ *
41117
+ * @usage
41118
+ * ```ts
41119
+ * await world.triggerActivity({ type: "GAME_ON", assetId: "abc123" });
41120
+ * ```
41121
+ */
41122
+ triggerActivity({ type, assetId, excludeFromNotification }) {
41123
+ return __awaiter(this, void 0, void 0, function* () {
41124
+ try {
41125
+ const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/set-activity`, { type, assetId, excludeFromNotification }, this.requestOptions);
41126
+ return result.data;
41127
+ }
41128
+ catch (error) {
41129
+ throw this.errorHandler({ error, params: { type }, sdkMethod: "World.triggerActivity" });
41130
+ }
41131
+ });
41132
+ }
41105
41133
  /**
41106
41134
  * @summary
41107
41135
  * Display a message via a toast to all visitors currently in a world.
@@ -41696,7 +41724,7 @@ class User extends SDKController {
41696
41724
  let query = `?getUnlockablesOnly=${getUnlockablesOnly}`;
41697
41725
  if (name)
41698
41726
  query += `&name=${name}`;
41699
- const result = yield this.topiaPublicApi().get(`/expressions?getUnlockablesOnly=${getUnlockablesOnly}`, this.requestOptions);
41727
+ const result = yield this.topiaPublicApi().get(`/expressions${query}`, this.requestOptions);
41700
41728
  return result.data;
41701
41729
  }
41702
41730
  catch (error) {
@@ -42000,6 +42028,29 @@ class Visitor extends User {
42000
42028
  }
42001
42029
  });
42002
42030
  }
42031
+ /**
42032
+ * @summary
42033
+ * Get expressions
42034
+ *
42035
+ * @usage
42036
+ * ```ts
42037
+ * await visitor.getExpressions({ getUnlockablesOnly: true, });
42038
+ * ```
42039
+ */
42040
+ getExpressions({ name, getUnlockablesOnly, }) {
42041
+ return __awaiter(this, void 0, void 0, function* () {
42042
+ try {
42043
+ let query = `?getUnlockablesOnly=${getUnlockablesOnly}`;
42044
+ if (name)
42045
+ query += `&name=${name}`;
42046
+ const result = yield this.topiaPublicApi().get(`/expressions${query}`, this.requestOptions);
42047
+ return result.data;
42048
+ }
42049
+ catch (error) {
42050
+ throw this.errorHandler({ error, params: { name, getUnlockablesOnly }, sdkMethod: "Visitors.getExpressions" });
42051
+ }
42052
+ });
42053
+ }
42003
42054
  /**
42004
42055
  * @summary
42005
42056
  * Grant expression to a visitor by id or name.
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.15.01"
63
+ "version": "0.15.03"
64
64
  }