@rtsdk/topia 0.15.2 → 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.
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.
@@ -1523,6 +1538,12 @@ type VisitorsToMoveType = {
1523
1538
  };
1524
1539
  type VisitorsToMoveArrayType = Array<VisitorsToMoveType>;
1525
1540
 
1541
+ declare enum WorldActivityTypes {
1542
+ GAME_ON = "GAME_ON",
1543
+ GAME_WAITING = "GAME_WAITING",
1544
+ GAME_HIGH_SCORE = "GAME_HIGH_SCORE"
1545
+ }
1546
+
1526
1547
  interface SDKInterface {
1527
1548
  credentials?: InteractiveCredentials;
1528
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.
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.02"
63
+ "version": "0.15.03"
64
64
  }