@thefittingroom/sdk 1.1.14 → 1.2.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/esm/api/shop.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class TfrShop {
|
|
|
12
12
|
getRecommendedSizes(styleId: string): Promise<SizeRecommendation>;
|
|
13
13
|
submitTelephoneNumber(tel: string): Promise<void>;
|
|
14
14
|
getColorwaySizeAssetFromSku(colorwaySizeAssetSku: string): Promise<types.FirestoreColorwaySizeAsset>;
|
|
15
|
-
getMeasurementLocationsFromSku(sku: string): Promise<string[]>;
|
|
15
|
+
getMeasurementLocationsFromSku(sku: string, filledLocations?: string[]): Promise<string[]>;
|
|
16
16
|
getStyleByBrandStyleId(brandStyleId: string): Promise<types.FirestoreStyleCategory>;
|
|
17
17
|
private getColorwaySizeAssets;
|
|
18
18
|
getStyle(styleId: number): Promise<types.FirestoreStyleCategory>;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* thefittingroom v1.
|
|
2
|
+
* thefittingroom v1.2.0 (2024-06-27T17:07:39.802Z)
|
|
3
3
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
// Code generated by tygo. DO NOT EDIT.
|
|
@@ -22964,7 +22964,7 @@ class TfrShop {
|
|
|
22964
22964
|
throw new NoColorwaySizeAssetsFoundError();
|
|
22965
22965
|
return Array.from(assets.values())[0];
|
|
22966
22966
|
}
|
|
22967
|
-
async getMeasurementLocationsFromSku(sku) {
|
|
22967
|
+
async getMeasurementLocationsFromSku(sku, filledLocations = []) {
|
|
22968
22968
|
const asset = await this.getColorwaySizeAssetFromSku(sku);
|
|
22969
22969
|
if (!asset)
|
|
22970
22970
|
throw new Error('No colorway size asset found for sku');
|
|
@@ -22974,7 +22974,10 @@ class TfrShop {
|
|
|
22974
22974
|
const taxonomy = await this.getGetTaxonomy(styleCategory.style_garment_category_id);
|
|
22975
22975
|
if (!taxonomy)
|
|
22976
22976
|
throw new Error('Taxonomy not found for style garment category id');
|
|
22977
|
-
|
|
22977
|
+
const filteredLocations = !filledLocations.length
|
|
22978
|
+
? taxonomy.garment_measurement_locations.female
|
|
22979
|
+
: taxonomy.garment_measurement_locations.female.filter((location) => !filledLocations.includes(location));
|
|
22980
|
+
return filteredLocations.map((location) => {
|
|
22978
22981
|
return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
|
|
22979
22982
|
});
|
|
22980
22983
|
}
|