roavatar-renderer 1.5.11 → 1.5.12

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.d.ts CHANGED
@@ -341,6 +341,7 @@ export declare const API: {
341
341
  */
342
342
  GetRBX: (url: string, headers?: HeadersInit, contentRepresentationPriorityList?: any) => Promise<Response | RBX>;
343
343
  GetMesh: (url: string, headers?: HeadersInit, readOnly?: boolean) => Promise<FileMesh | Response>;
344
+ GetAssetTypeId: (assetId: string | number) => Promise<number | Response>;
344
345
  IsLayered: (id: number) => Promise<boolean | Response>;
345
346
  };
346
347
  Catalog: {
package/dist/index.js CHANGED
@@ -33766,6 +33766,23 @@ class Outfit {
33766
33766
  }
33767
33767
  }
33768
33768
  await Promise.all(assetPromises);
33769
+ const assetDeliveryPromises = [];
33770
+ for (const asset of assetsToAdd) {
33771
+ const assetId = asset.id;
33772
+ if (assetId && !this.getAssetId(assetId)) {
33773
+ assetDeliveryPromises.push(new Promise((resolve) => {
33774
+ API.Asset.GetAssetTypeId(assetId).then((assetTypeId) => {
33775
+ if (!(assetTypeId instanceof Response)) {
33776
+ if (Number(assetTypeId) === assetTypeId) {
33777
+ this.addAsset(assetId, assetTypeId, `${AssetTypes[assetTypeId] || "Asset"} (${assetId})`);
33778
+ resolve(void 0);
33779
+ }
33780
+ }
33781
+ });
33782
+ }));
33783
+ }
33784
+ }
33785
+ await Promise.all(assetDeliveryPromises);
33769
33786
  for (const assetToAdd of assetsToAdd) {
33770
33787
  let asset = void 0;
33771
33788
  for (const assetIn of this.assets) {
@@ -36348,6 +36365,14 @@ const API = {
36348
36365
  }
36349
36366
  }
36350
36367
  },
36368
+ GetAssetTypeId: async function(assetId) {
36369
+ const response = await RBLXGet("https://assetdelivery.roblox.com/v2/asset?id=" + assetId);
36370
+ if (response.status !== 200) {
36371
+ return response;
36372
+ }
36373
+ const body = await response.json();
36374
+ return body.assetTypeId;
36375
+ },
36351
36376
  IsLayered: async function(id) {
36352
36377
  const cached = CACHE.IsLayered.get(id);
36353
36378
  if (cached !== void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.5.11",
3
+ "version": "1.5.12",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",