@rtsdk/topia 0.19.1 → 0.19.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
@@ -41039,7 +41039,7 @@ class UserInventoryItem extends InventoryItem {
41039
41039
  super(topia, item_id, { attributes: options.attributes, credentials: options.credentials });
41040
41040
  Object.assign(this, options.attributes);
41041
41041
  this.userItemId = id;
41042
- const { user_id = "", quantity = 0, grant_source = "unknown", type = "unknown", metadata = {}, created_at = new Date(), updated_at = new Date(), profile_id = null, } = options.attributes;
41042
+ const { user_id = "", quantity = 0, grant_source = "unknown", type = "unknown", metadata = {}, created_at = new Date(), updated_at = new Date(), profile_id = null, item = { id: "", name: "", description: "", type: "", metadata: null, image_url: "" }, } = options.attributes;
41043
41043
  this.item_id = item_id;
41044
41044
  this.quantity = quantity;
41045
41045
  this.grant_source = grant_source;
@@ -41049,6 +41049,7 @@ class UserInventoryItem extends InventoryItem {
41049
41049
  this.created_at = created_at;
41050
41050
  this.updated_at = updated_at;
41051
41051
  this.profile_id = profile_id;
41052
+ this.item = item;
41052
41053
  }
41053
41054
  /**
41054
41055
  * Fetches the user inventory item details from the platform and assigns them to this instance.
@@ -41517,8 +41518,16 @@ class World extends SDKController {
41517
41518
  fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
41518
41519
  return __awaiter(this, void 0, void 0, function* () {
41519
41520
  try {
41520
- if (!sceneDropId)
41521
- throw this.errorHandler({ message: "A sceneDropId is required." });
41521
+ // Validate sceneDropId to prevent dangerous queries that could match unintended assets
41522
+ if (!sceneDropId ||
41523
+ typeof sceneDropId !== "string" ||
41524
+ sceneDropId.trim() === "" ||
41525
+ sceneDropId === "undefined" ||
41526
+ sceneDropId === "null") {
41527
+ throw this.errorHandler({
41528
+ message: "A valid sceneDropId is required. Received an empty, undefined, or invalid sceneDropId which could match unintended assets.",
41529
+ });
41530
+ }
41522
41531
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
41523
41532
  // create temp map and then update private property only once
41524
41533
  const droppedAssets = [];
package/dist/index.d.ts CHANGED
@@ -1206,6 +1206,7 @@ declare class UserInventoryItem extends InventoryItem implements UserInventoryIt
1206
1206
  grant_source: string;
1207
1207
  type: string;
1208
1208
  profile_id?: string | null;
1209
+ item: UserInventoryItemMetadataType;
1209
1210
  constructor(topia: Topia, id: string, options?: UserInventoryItemOptionalInterface);
1210
1211
  /**
1211
1212
  * Fetches the user inventory item details from the platform and assigns them to this instance.
@@ -2791,20 +2792,27 @@ type InventoryItemOptionalInterface = {
2791
2792
  * Interface for a user-owned inventory item.
2792
2793
  */
2793
2794
  interface UserInventoryItemInterface extends InventoryItemInterface {
2794
- userItemId: string;
2795
2795
  user_id: string;
2796
2796
  item_id: string;
2797
2797
  quantity: number;
2798
2798
  created_at?: Date;
2799
2799
  updated_at?: Date;
2800
- metadata?: object | null;
2801
2800
  grant_source: string;
2802
2801
  profile_id?: string | null;
2802
+ item: UserInventoryItemMetadataType;
2803
2803
  }
2804
2804
  type UserInventoryItemOptionalInterface = {
2805
2805
  attributes?: UserInventoryItemInterface | object;
2806
2806
  credentials?: InteractiveCredentials;
2807
2807
  };
2808
+ type UserInventoryItemMetadataType = {
2809
+ id: string;
2810
+ name: string;
2811
+ description: string;
2812
+ type: string;
2813
+ metadata: object | null;
2814
+ image_url: string;
2815
+ };
2808
2816
 
2809
2817
  /**
2810
2818
  * Create a single instance of Topia axios used for all calls to the public API in all classes
@@ -4025,4 +4033,4 @@ declare class WorldFactory extends SDKController {
4025
4033
  }>;
4026
4034
  }
4027
4035
 
4028
- export { AnalyticType, AnimationMetaType, Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetLinkType, DroppedAssetMediaType, DroppedAssetMediaVolumeRadius, DroppedAssetOptionalInterface, DroppedAssetOptions, Ecosystem, EcosystemFactory, EcosystemInterface, EcosystemOptionalInterface, FireToastInterface, FrameType, InteractiveCredentials$1 as InteractiveCredentials, InventoryItemInterface, InventoryItemOptionalInterface, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, RemoveClickableLinkInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, SetClickableLinkMultiInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateClickableLinkMultiInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserInventoryItemInterface, UserInventoryItemOptionalInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebRTCConnector, WebRTCConnectorFactory, WebRTCConnectorInterface, WebRTCConnectorOptionalInterface, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldActivityType, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
4036
+ export { AnalyticType, AnimationMetaType, Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetLinkType, DroppedAssetMediaType, DroppedAssetMediaVolumeRadius, DroppedAssetOptionalInterface, DroppedAssetOptions, Ecosystem, EcosystemFactory, EcosystemInterface, EcosystemOptionalInterface, FireToastInterface, FrameType, InteractiveCredentials$1 as InteractiveCredentials, InventoryItemInterface, InventoryItemOptionalInterface, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, RemoveClickableLinkInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, SetClickableLinkMultiInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateClickableLinkMultiInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserInventoryItemInterface, UserInventoryItemMetadataType, UserInventoryItemOptionalInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebRTCConnector, WebRTCConnectorFactory, WebRTCConnectorInterface, WebRTCConnectorOptionalInterface, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldActivityType, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
package/dist/index.js CHANGED
@@ -41037,7 +41037,7 @@ class UserInventoryItem extends InventoryItem {
41037
41037
  super(topia, item_id, { attributes: options.attributes, credentials: options.credentials });
41038
41038
  Object.assign(this, options.attributes);
41039
41039
  this.userItemId = id;
41040
- const { user_id = "", quantity = 0, grant_source = "unknown", type = "unknown", metadata = {}, created_at = new Date(), updated_at = new Date(), profile_id = null, } = options.attributes;
41040
+ const { user_id = "", quantity = 0, grant_source = "unknown", type = "unknown", metadata = {}, created_at = new Date(), updated_at = new Date(), profile_id = null, item = { id: "", name: "", description: "", type: "", metadata: null, image_url: "" }, } = options.attributes;
41041
41041
  this.item_id = item_id;
41042
41042
  this.quantity = quantity;
41043
41043
  this.grant_source = grant_source;
@@ -41047,6 +41047,7 @@ class UserInventoryItem extends InventoryItem {
41047
41047
  this.created_at = created_at;
41048
41048
  this.updated_at = updated_at;
41049
41049
  this.profile_id = profile_id;
41050
+ this.item = item;
41050
41051
  }
41051
41052
  /**
41052
41053
  * Fetches the user inventory item details from the platform and assigns them to this instance.
@@ -41515,8 +41516,16 @@ class World extends SDKController {
41515
41516
  fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
41516
41517
  return __awaiter(this, void 0, void 0, function* () {
41517
41518
  try {
41518
- if (!sceneDropId)
41519
- throw this.errorHandler({ message: "A sceneDropId is required." });
41519
+ // Validate sceneDropId to prevent dangerous queries that could match unintended assets
41520
+ if (!sceneDropId ||
41521
+ typeof sceneDropId !== "string" ||
41522
+ sceneDropId.trim() === "" ||
41523
+ sceneDropId === "undefined" ||
41524
+ sceneDropId === "null") {
41525
+ throw this.errorHandler({
41526
+ message: "A valid sceneDropId is required. Received an empty, undefined, or invalid sceneDropId which could match unintended assets.",
41527
+ });
41528
+ }
41520
41529
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
41521
41530
  // create temp map and then update private property only once
41522
41531
  const droppedAssets = [];
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.01"
64
+ "version": "0.19.03"
65
65
  }