@rtsdk/topia 0.20.1 → 0.21.0

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
@@ -43035,6 +43035,7 @@ AI RULES for code assistants
43035
43035
 
43036
43036
  AVAILABLE METHODS:
43037
43037
  - fetchVisitor(): Retrieves visitor details from the world
43038
+ - fetchUserGroupDataObject(): Gets the world's user group data objects (requires canReceiveUserGroupDataObjects on the public key)
43038
43039
  - fetchDataObject(): Gets visitor's data object
43039
43040
  - setDataObject(dataObject, options?): Sets visitor's entire data object
43040
43041
  - updateDataObject(dataObject, options?): Updates specific fields in visitor data
@@ -43117,6 +43118,36 @@ class Visitor extends User {
43117
43118
  }
43118
43119
  });
43119
43120
  }
43121
+ /**
43122
+ * Get the user group data objects available to this visitor's world.
43123
+ *
43124
+ * The interactive public key must have `canReceiveUserGroupDataObjects` set on it
43125
+ * (granted by the Topia team to first-party SDK apps).
43126
+ *
43127
+ * Mirrors the array delivered as `userGroupDataObjects` in the asset-click webhook
43128
+ * payload (worldUserGroups branch).
43129
+ *
43130
+ * @keywords get, fetch, user group, data object, group
43131
+ *
43132
+ * @example
43133
+ * ```ts
43134
+ * const { userGroupDataObjects } = await visitor.fetchUserGroupDataObject();
43135
+ * ```
43136
+ *
43137
+ * @returns
43138
+ * Returns `{ success: true, userGroupDataObjects: object[] }` or an error.
43139
+ */
43140
+ fetchUserGroupDataObject() {
43141
+ return __awaiter(this, void 0, void 0, function* () {
43142
+ try {
43143
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/user-group-data-object`, this.requestOptions);
43144
+ return response.data;
43145
+ }
43146
+ catch (error) {
43147
+ throw this.errorHandler({ error, sdkMethod: "Visitor.fetchUserGroupDataObject" });
43148
+ }
43149
+ });
43150
+ }
43120
43151
  /**
43121
43152
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
43122
43153
  *
package/dist/index.d.ts CHANGED
@@ -1790,6 +1790,26 @@ declare class Visitor extends User implements VisitorInterface {
1790
1790
  * Returns details for a visitor in a world by id and urlSlug
1791
1791
  */
1792
1792
  fetchVisitor(): Promise<void | ResponseType>;
1793
+ /**
1794
+ * Get the user group data objects available to this visitor's world.
1795
+ *
1796
+ * The interactive public key must have `canReceiveUserGroupDataObjects` set on it
1797
+ * (granted by the Topia team to first-party SDK apps).
1798
+ *
1799
+ * Mirrors the array delivered as `userGroupDataObjects` in the asset-click webhook
1800
+ * payload (worldUserGroups branch).
1801
+ *
1802
+ * @keywords get, fetch, user group, data object, group
1803
+ *
1804
+ * @example
1805
+ * ```ts
1806
+ * const { userGroupDataObjects } = await visitor.fetchUserGroupDataObject();
1807
+ * ```
1808
+ *
1809
+ * @returns
1810
+ * Returns `{ success: true, userGroupDataObjects: object[] }` or an error.
1811
+ */
1812
+ fetchUserGroupDataObject(): Promise<void | ResponseType>;
1793
1813
  /**
1794
1814
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
1795
1815
  *
@@ -2682,6 +2702,7 @@ interface UserOptionalInterface {
2682
2702
 
2683
2703
  interface VisitorInterface extends SDKInterface {
2684
2704
  fetchVisitor(): Promise<void | ResponseType>;
2705
+ fetchUserGroupDataObject(): Promise<void | ResponseType>;
2685
2706
  moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType>;
2686
2707
  fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType>;
2687
2708
  openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType>;
package/dist/index.js CHANGED
@@ -43033,6 +43033,7 @@ AI RULES for code assistants
43033
43033
 
43034
43034
  AVAILABLE METHODS:
43035
43035
  - fetchVisitor(): Retrieves visitor details from the world
43036
+ - fetchUserGroupDataObject(): Gets the world's user group data objects (requires canReceiveUserGroupDataObjects on the public key)
43036
43037
  - fetchDataObject(): Gets visitor's data object
43037
43038
  - setDataObject(dataObject, options?): Sets visitor's entire data object
43038
43039
  - updateDataObject(dataObject, options?): Updates specific fields in visitor data
@@ -43115,6 +43116,36 @@ class Visitor extends User {
43115
43116
  }
43116
43117
  });
43117
43118
  }
43119
+ /**
43120
+ * Get the user group data objects available to this visitor's world.
43121
+ *
43122
+ * The interactive public key must have `canReceiveUserGroupDataObjects` set on it
43123
+ * (granted by the Topia team to first-party SDK apps).
43124
+ *
43125
+ * Mirrors the array delivered as `userGroupDataObjects` in the asset-click webhook
43126
+ * payload (worldUserGroups branch).
43127
+ *
43128
+ * @keywords get, fetch, user group, data object, group
43129
+ *
43130
+ * @example
43131
+ * ```ts
43132
+ * const { userGroupDataObjects } = await visitor.fetchUserGroupDataObject();
43133
+ * ```
43134
+ *
43135
+ * @returns
43136
+ * Returns `{ success: true, userGroupDataObjects: object[] }` or an error.
43137
+ */
43138
+ fetchUserGroupDataObject() {
43139
+ return __awaiter(this, void 0, void 0, function* () {
43140
+ try {
43141
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/user-group-data-object`, this.requestOptions);
43142
+ return response.data;
43143
+ }
43144
+ catch (error) {
43145
+ throw this.errorHandler({ error, sdkMethod: "Visitor.fetchUserGroupDataObject" });
43146
+ }
43147
+ });
43148
+ }
43118
43149
  /**
43119
43150
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
43120
43151
  *
package/package.json CHANGED
@@ -61,5 +61,5 @@
61
61
  "yalc-push": "yarn build && yalc publish --push --dev --no-scripts"
62
62
  },
63
63
  "type": "module",
64
- "version": "0.20.1"
64
+ "version": "0.21.0"
65
65
  }