@rtsdk/topia 0.19.1 → 0.19.2

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
@@ -41517,8 +41517,16 @@ class World extends SDKController {
41517
41517
  fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
41518
41518
  return __awaiter(this, void 0, void 0, function* () {
41519
41519
  try {
41520
- if (!sceneDropId)
41521
- throw this.errorHandler({ message: "A sceneDropId is required." });
41520
+ // Validate sceneDropId to prevent dangerous queries that could match unintended assets
41521
+ if (!sceneDropId ||
41522
+ typeof sceneDropId !== "string" ||
41523
+ sceneDropId.trim() === "" ||
41524
+ sceneDropId === "undefined" ||
41525
+ sceneDropId === "null") {
41526
+ throw this.errorHandler({
41527
+ message: "A valid sceneDropId is required. Received an empty, undefined, or invalid sceneDropId which could match unintended assets.",
41528
+ });
41529
+ }
41522
41530
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
41523
41531
  // create temp map and then update private property only once
41524
41532
  const droppedAssets = [];
package/dist/index.d.ts CHANGED
@@ -74,7 +74,7 @@ type DroppedAssetLinkType = {
74
74
  linkSamlQueryParams?: string;
75
75
  };
76
76
 
77
- type InteractiveCredentials$1 = {
77
+ type InteractiveCredentials = {
78
78
  apiKey?: string;
79
79
  assetId?: string;
80
80
  interactiveNonce?: string;
@@ -88,22 +88,22 @@ type InteractiveCredentials$1 = {
88
88
 
89
89
  type AssetOptions = {
90
90
  attributes?: AssetInterface | undefined;
91
- credentials?: InteractiveCredentials$1 | undefined;
91
+ credentials?: InteractiveCredentials | undefined;
92
92
  };
93
93
  type DroppedAssetOptions = {
94
94
  attributes?: DroppedAssetInterface | undefined;
95
- credentials?: InteractiveCredentials$1 | undefined;
95
+ credentials?: InteractiveCredentials | undefined;
96
96
  };
97
97
  type UserOptions = {
98
- credentials?: InteractiveCredentials$1 | undefined;
98
+ credentials?: InteractiveCredentials | undefined;
99
99
  };
100
100
  type VisitorOptions = {
101
101
  attributes?: VisitorInterface | undefined;
102
- credentials?: InteractiveCredentials$1 | undefined;
102
+ credentials?: InteractiveCredentials | undefined;
103
103
  };
104
104
  type WorldOptions = {
105
105
  attributes?: WorldDetailsInterface | undefined;
106
- credentials?: InteractiveCredentials$1 | undefined;
106
+ credentials?: InteractiveCredentials | undefined;
107
107
  };
108
108
 
109
109
  type ResponseType$1 = {
@@ -2218,7 +2218,7 @@ declare enum WorldActivityType {
2218
2218
  }
2219
2219
 
2220
2220
  interface SDKInterface {
2221
- credentials?: InteractiveCredentials$1;
2221
+ credentials?: InteractiveCredentials;
2222
2222
  jwt?: string;
2223
2223
  requestOptions: object;
2224
2224
  topia: Topia;
@@ -2255,7 +2255,7 @@ interface AssetInterface extends SDKInterface {
2255
2255
  }
2256
2256
  type AssetOptionalInterface = {
2257
2257
  attributes?: AssetInterface | object;
2258
- credentials?: InteractiveCredentials$1;
2258
+ credentials?: InteractiveCredentials;
2259
2259
  };
2260
2260
 
2261
2261
  interface DroppedAssetInterface extends AssetInterface {
@@ -2377,7 +2377,7 @@ interface DroppedAssetOptionalInterface {
2377
2377
  text?: string;
2378
2378
  urlSlug?: string;
2379
2379
  };
2380
- credentials?: InteractiveCredentials$1 | object;
2380
+ credentials?: InteractiveCredentials | object;
2381
2381
  }
2382
2382
  interface UpdateBroadcastInterface {
2383
2383
  assetBroadcast?: boolean;
@@ -2469,7 +2469,7 @@ interface EcosystemInterface {
2469
2469
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
2470
2470
  }
2471
2471
  interface EcosystemOptionalInterface {
2472
- credentials?: InteractiveCredentials$1;
2472
+ credentials?: InteractiveCredentials;
2473
2473
  }
2474
2474
 
2475
2475
  interface SceneInterface {
@@ -2497,7 +2497,7 @@ interface SceneInterface {
2497
2497
  }
2498
2498
  type SceneOptionalInterface = {
2499
2499
  attributes?: SceneInterface | object;
2500
- credentials?: InteractiveCredentials$1;
2500
+ credentials?: InteractiveCredentials;
2501
2501
  };
2502
2502
 
2503
2503
  interface FireToastInterface {
@@ -2545,7 +2545,7 @@ interface UserInterface {
2545
2545
  dataObject?: object | null;
2546
2546
  }
2547
2547
  interface UserOptionalInterface {
2548
- credentials?: InteractiveCredentials$1;
2548
+ credentials?: InteractiveCredentials;
2549
2549
  profileId?: string | null;
2550
2550
  visitorId?: number | null;
2551
2551
  urlSlug?: string;
@@ -2621,7 +2621,7 @@ interface VisitorInterface extends SDKInterface {
2621
2621
  }
2622
2622
  interface VisitorOptionalInterface {
2623
2623
  attributes?: VisitorInterface | object;
2624
- credentials?: InteractiveCredentials$1;
2624
+ credentials?: InteractiveCredentials;
2625
2625
  }
2626
2626
  interface MoveVisitorInterface {
2627
2627
  shouldTeleportVisitor: boolean;
@@ -2654,12 +2654,12 @@ interface WebRTCConnectorInterface {
2654
2654
  getTwilioConfig(): Promise<void | ResponseType$1>;
2655
2655
  }
2656
2656
  interface WebRTCConnectorOptionalInterface {
2657
- credentials?: InteractiveCredentials$1;
2657
+ credentials?: InteractiveCredentials;
2658
2658
  twilioConfig?: object;
2659
2659
  }
2660
2660
 
2661
2661
  interface WorldActivityOptionalInterface {
2662
- credentials?: InteractiveCredentials$1;
2662
+ credentials?: InteractiveCredentials;
2663
2663
  }
2664
2664
  interface MoveAllVisitorsInterface {
2665
2665
  shouldFetchVisitors?: boolean;
@@ -2749,13 +2749,13 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
2749
2749
  }
2750
2750
  interface WorldOptionalInterface {
2751
2751
  attributes?: WorldDetailsInterface | object;
2752
- credentials?: InteractiveCredentials$1;
2752
+ credentials?: InteractiveCredentials;
2753
2753
  }
2754
2754
  interface WorldWebhooksInterface {
2755
2755
  webhooks: Array<WebhookInterface>;
2756
2756
  }
2757
2757
 
2758
- type InteractiveCredentials = {
2758
+ type InteractiveCredentials$1 = {
2759
2759
  apiKey?: string;
2760
2760
  assetId?: string;
2761
2761
  interactiveNonce?: string;
@@ -2784,7 +2784,7 @@ interface InventoryItemInterface extends SDKInterface {
2784
2784
  }
2785
2785
  type InventoryItemOptionalInterface = {
2786
2786
  attributes?: InventoryItemInterface | object;
2787
- credentials?: InteractiveCredentials;
2787
+ credentials?: InteractiveCredentials$1;
2788
2788
  };
2789
2789
 
2790
2790
  /**
@@ -2803,7 +2803,7 @@ interface UserInventoryItemInterface extends InventoryItemInterface {
2803
2803
  }
2804
2804
  type UserInventoryItemOptionalInterface = {
2805
2805
  attributes?: UserInventoryItemInterface | object;
2806
- credentials?: InteractiveCredentials;
2806
+ credentials?: InteractiveCredentials$1;
2807
2807
  };
2808
2808
 
2809
2809
  /**
@@ -2859,11 +2859,11 @@ declare class Topia implements TopiaInterface {
2859
2859
  * ```
2860
2860
  */
2861
2861
  declare abstract class SDKController implements SDKInterface {
2862
- credentials: InteractiveCredentials$1 | undefined;
2862
+ credentials: InteractiveCredentials | undefined;
2863
2863
  jwt?: string;
2864
2864
  requestOptions: object;
2865
2865
  topia: Topia;
2866
- constructor(topia: Topia, credentials?: InteractiveCredentials$1);
2866
+ constructor(topia: Topia, credentials?: InteractiveCredentials);
2867
2867
  topiaPublicApi(): axios.AxiosInstance;
2868
2868
  errorHandler({ error, message, params, sdkMethod, }: {
2869
2869
  error?: Error | AxiosError | unknown;
@@ -3443,7 +3443,7 @@ declare class DroppedAssetFactory extends SDKController {
3443
3443
  *
3444
3444
  * @returns {Promise<DroppedAsset>} Returns a new DroppedAsset object with all properties already fetched.
3445
3445
  */
3446
- getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials$1): Promise<DroppedAsset>;
3446
+ getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: InteractiveCredentials): Promise<DroppedAsset>;
3447
3447
  /**
3448
3448
  * Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
3449
3449
  *
@@ -4025,4 +4025,4 @@ declare class WorldFactory extends SDKController {
4025
4025
  }>;
4026
4026
  }
4027
4027
 
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 };
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, 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 };
package/dist/index.js CHANGED
@@ -41515,8 +41515,16 @@ class World extends SDKController {
41515
41515
  fetchDroppedAssetsBySceneDropId({ sceneDropId, uniqueName, }) {
41516
41516
  return __awaiter(this, void 0, void 0, function* () {
41517
41517
  try {
41518
- if (!sceneDropId)
41519
- throw this.errorHandler({ message: "A sceneDropId is required." });
41518
+ // Validate sceneDropId to prevent dangerous queries that could match unintended assets
41519
+ if (!sceneDropId ||
41520
+ typeof sceneDropId !== "string" ||
41521
+ sceneDropId.trim() === "" ||
41522
+ sceneDropId === "undefined" ||
41523
+ sceneDropId === "null") {
41524
+ throw this.errorHandler({
41525
+ message: "A valid sceneDropId is required. Received an empty, undefined, or invalid sceneDropId which could match unintended assets.",
41526
+ });
41527
+ }
41520
41528
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
41521
41529
  // create temp map and then update private property only once
41522
41530
  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.02"
65
65
  }