@thefittingroom/sdk 1.1.7 → 1.1.9

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.
@@ -13,8 +13,9 @@ export declare class TfrShop {
13
13
  submitTelephoneNumber(tel: string): Promise<void>;
14
14
  getColorwaySizeAssetFromSku(colorwaySizeAssetSku: string): Promise<types.FirestoreColorwaySizeAsset>;
15
15
  getMeasurementLocationsFromSku(sku: string): Promise<string[]>;
16
+ getStyleByBrandStyleId(brandStyleId: string): Promise<types.FirestoreStyleCategory>;
16
17
  private getColorwaySizeAssets;
17
- private getStyleCategory;
18
+ getStyle(styleId: number): Promise<types.FirestoreStyleCategory>;
18
19
  private getGetTaxonomy;
19
20
  private getMeasurementLocations;
20
21
  private fetchMeasurementLocations;
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * thefittingroom v1.1.7 (2024-05-16T23:59:30.970Z)
2
+ * thefittingroom v1.1.9 (2024-06-20T18:09:09.877Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  // Code generated by tygo. DO NOT EDIT.
@@ -22968,7 +22968,7 @@ class TfrShop {
22968
22968
  const asset = await this.getColorwaySizeAssetFromSku(sku);
22969
22969
  if (!asset)
22970
22970
  throw new Error('No colorway size asset found for sku');
22971
- const styleCategory = await this.getStyleCategory(asset.style_id);
22971
+ const styleCategory = await this.getStyle(asset.style_id);
22972
22972
  if (!styleCategory)
22973
22973
  throw new Error('Style category not found for style id');
22974
22974
  const taxonomy = await this.getGetTaxonomy(styleCategory.style_garment_category_id);
@@ -22978,6 +22978,15 @@ class TfrShop {
22978
22978
  return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
22979
22979
  });
22980
22980
  }
22981
+ async getStyleByBrandStyleId(brandStyleId) {
22982
+ try {
22983
+ const querySnapshot = await this.firebase.getDocs('styles', [rl('brand_style_id', '==', brandStyleId)]);
22984
+ return querySnapshot.docs[0].data();
22985
+ }
22986
+ catch (error) {
22987
+ return getFirebaseError(error);
22988
+ }
22989
+ }
22981
22990
  async getColorwaySizeAssets(styleId, skus) {
22982
22991
  const constraints = [rl('brand_id', '==', this.brandId)];
22983
22992
  if (styleId)
@@ -22997,7 +23006,7 @@ class TfrShop {
22997
23006
  return getFirebaseError(error);
22998
23007
  }
22999
23008
  }
23000
- async getStyleCategory(styleId) {
23009
+ async getStyle(styleId) {
23001
23010
  try {
23002
23011
  const doc = await this.firebase.getDoc('styles', String(styleId));
23003
23012
  return doc;