@rtsdk/topia 0.19.9 → 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
@@ -47,6 +47,18 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
47
  PERFORMANCE OF THIS SOFTWARE.
48
48
  ***************************************************************************** */
49
49
 
50
+ function __rest(s, e) {
51
+ var t = {};
52
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
+ t[p] = s[p];
54
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
+ t[p[i]] = s[p[i]];
58
+ }
59
+ return t;
60
+ }
61
+
50
62
  function __awaiter(thisArg, _arguments, P, generator) {
51
63
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
52
64
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -40030,7 +40042,8 @@ class DroppedAsset extends Asset {
40030
40042
  _DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
40031
40043
  try {
40032
40044
  const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/${updateType}`, Object.assign({}, payload), this.requestOptions);
40033
- Object.assign(this, response.data);
40045
+ const _c = response.data, { urlSlug: _slug, id: _id } = _c, data = __rest(_c, ["urlSlug", "id"]);
40046
+ Object.assign(this, data);
40034
40047
  return response.data;
40035
40048
  }
40036
40049
  catch (error) {
@@ -40058,8 +40071,7 @@ class DroppedAsset extends Asset {
40058
40071
  return __awaiter(this, void 0, void 0, function* () {
40059
40072
  try {
40060
40073
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}`, this.requestOptions);
40061
- const droppedAssetDetails = response.data;
40062
- droppedAssetDetails.urlSlug = this.urlSlug;
40074
+ const _a = response.data, { urlSlug: _slug, id: _id } = _a, droppedAssetDetails = __rest(_a, ["urlSlug", "id"]);
40063
40075
  Object.assign(this, droppedAssetDetails);
40064
40076
  }
40065
40077
  catch (error) {
@@ -40135,7 +40147,7 @@ class DroppedAsset extends Asset {
40135
40147
  const filteredParams = removeUndefined(params);
40136
40148
  try {
40137
40149
  const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}`, filteredParams, this.requestOptions);
40138
- const droppedAssetDetails = response.data;
40150
+ const _a = response.data, { urlSlug: _slug, id: _id } = _a, droppedAssetDetails = __rest(_a, ["urlSlug", "id"]);
40139
40151
  Object.assign(this, droppedAssetDetails);
40140
40152
  }
40141
40153
  catch (error) {
@@ -43023,6 +43035,7 @@ AI RULES for code assistants
43023
43035
 
43024
43036
  AVAILABLE METHODS:
43025
43037
  - fetchVisitor(): Retrieves visitor details from the world
43038
+ - fetchUserGroupDataObject(): Gets the world's user group data objects (requires canReceiveUserGroupDataObjects on the public key)
43026
43039
  - fetchDataObject(): Gets visitor's data object
43027
43040
  - setDataObject(dataObject, options?): Sets visitor's entire data object
43028
43041
  - updateDataObject(dataObject, options?): Updates specific fields in visitor data
@@ -43105,6 +43118,36 @@ class Visitor extends User {
43105
43118
  }
43106
43119
  });
43107
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
+ }
43108
43151
  /**
43109
43152
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
43110
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
@@ -45,6 +45,18 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
46
  ***************************************************************************** */
47
47
 
48
+ function __rest(s, e) {
49
+ var t = {};
50
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ }
59
+
48
60
  function __awaiter(thisArg, _arguments, P, generator) {
49
61
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
62
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -40028,7 +40040,8 @@ class DroppedAsset extends Asset {
40028
40040
  _DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
40029
40041
  try {
40030
40042
  const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/${updateType}`, Object.assign({}, payload), this.requestOptions);
40031
- Object.assign(this, response.data);
40043
+ const _c = response.data, { urlSlug: _slug, id: _id } = _c, data = __rest(_c, ["urlSlug", "id"]);
40044
+ Object.assign(this, data);
40032
40045
  return response.data;
40033
40046
  }
40034
40047
  catch (error) {
@@ -40056,8 +40069,7 @@ class DroppedAsset extends Asset {
40056
40069
  return __awaiter(this, void 0, void 0, function* () {
40057
40070
  try {
40058
40071
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}`, this.requestOptions);
40059
- const droppedAssetDetails = response.data;
40060
- droppedAssetDetails.urlSlug = this.urlSlug;
40072
+ const _a = response.data, { urlSlug: _slug, id: _id } = _a, droppedAssetDetails = __rest(_a, ["urlSlug", "id"]);
40061
40073
  Object.assign(this, droppedAssetDetails);
40062
40074
  }
40063
40075
  catch (error) {
@@ -40133,7 +40145,7 @@ class DroppedAsset extends Asset {
40133
40145
  const filteredParams = removeUndefined(params);
40134
40146
  try {
40135
40147
  const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}`, filteredParams, this.requestOptions);
40136
- const droppedAssetDetails = response.data;
40148
+ const _a = response.data, { urlSlug: _slug, id: _id } = _a, droppedAssetDetails = __rest(_a, ["urlSlug", "id"]);
40137
40149
  Object.assign(this, droppedAssetDetails);
40138
40150
  }
40139
40151
  catch (error) {
@@ -43021,6 +43033,7 @@ AI RULES for code assistants
43021
43033
 
43022
43034
  AVAILABLE METHODS:
43023
43035
  - fetchVisitor(): Retrieves visitor details from the world
43036
+ - fetchUserGroupDataObject(): Gets the world's user group data objects (requires canReceiveUserGroupDataObjects on the public key)
43024
43037
  - fetchDataObject(): Gets visitor's data object
43025
43038
  - setDataObject(dataObject, options?): Sets visitor's entire data object
43026
43039
  - updateDataObject(dataObject, options?): Updates specific fields in visitor data
@@ -43103,6 +43116,36 @@ class Visitor extends User {
43103
43116
  }
43104
43117
  });
43105
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
+ }
43106
43149
  /**
43107
43150
  * Teleport or walk a visitor currently in a world to a single set of coordinates.
43108
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.19.9"
64
+ "version": "0.21.0"
65
65
  }