@blackcode_sa/metaestetics-api 1.12.41 → 1.12.43

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.
@@ -482,13 +482,13 @@ interface Product {
482
482
  composition?: string;
483
483
  indications?: string[];
484
484
  contraindications?: ContraindicationDynamic[];
485
- /** @deprecated Use assignedTechnologyIds instead */
485
+ /** Present only in subcollections - synced from technology metadata */
486
486
  technologyId?: string;
487
- /** @deprecated Will be removed in future version */
487
+ /** Present only in subcollections - synced from technology name */
488
488
  technologyName?: string;
489
- /** @deprecated Not needed in top-level collection */
489
+ /** Present only in subcollections - synced from technology categoryId */
490
490
  categoryId?: string;
491
- /** @deprecated Not needed in top-level collection */
491
+ /** Present only in subcollections - synced from technology subcategoryId */
492
492
  subcategoryId?: string;
493
493
  }
494
494
 
@@ -482,13 +482,13 @@ interface Product {
482
482
  composition?: string;
483
483
  indications?: string[];
484
484
  contraindications?: ContraindicationDynamic[];
485
- /** @deprecated Use assignedTechnologyIds instead */
485
+ /** Present only in subcollections - synced from technology metadata */
486
486
  technologyId?: string;
487
- /** @deprecated Will be removed in future version */
487
+ /** Present only in subcollections - synced from technology name */
488
488
  technologyName?: string;
489
- /** @deprecated Not needed in top-level collection */
489
+ /** Present only in subcollections - synced from technology categoryId */
490
490
  categoryId?: string;
491
- /** @deprecated Not needed in top-level collection */
491
+ /** Present only in subcollections - synced from technology subcategoryId */
492
492
  subcategoryId?: string;
493
493
  }
494
494
 
@@ -98,6 +98,18 @@ declare class BrandService extends BaseService {
98
98
  * Gets a brand by ID
99
99
  */
100
100
  getById(brandId: string): Promise<Brand | null>;
101
+ /**
102
+ * Exports brands to CSV string, suitable for Excel/Sheets.
103
+ * Includes headers and optional UTF-8 BOM.
104
+ * By default exports only active brands (set includeInactive to true to export all).
105
+ */
106
+ exportToCsv(options?: {
107
+ includeInactive?: boolean;
108
+ includeBom?: boolean;
109
+ }): Promise<string>;
110
+ private brandToCsvRow;
111
+ private formatDateIso;
112
+ private formatCsvValue;
101
113
  }
102
114
 
103
115
  /**
@@ -277,6 +289,18 @@ declare class CategoryService extends BaseService implements ICategoryService {
277
289
  * @returns Kategorija ili null ako ne postoji
278
290
  */
279
291
  getById(id: string): Promise<Category | null>;
292
+ /**
293
+ * Exports categories to CSV string, suitable for Excel/Sheets.
294
+ * Includes headers and optional UTF-8 BOM.
295
+ * By default exports only active categories (set includeInactive to true to export all).
296
+ */
297
+ exportToCsv(options?: {
298
+ includeInactive?: boolean;
299
+ includeBom?: boolean;
300
+ }): Promise<string>;
301
+ private categoryToCsvRow;
302
+ private formatDateIso;
303
+ private formatCsvValue;
280
304
  }
281
305
 
282
306
  /**
@@ -611,13 +635,13 @@ interface Product {
611
635
  composition?: string;
612
636
  indications?: string[];
613
637
  contraindications?: ContraindicationDynamic[];
614
- /** @deprecated Use assignedTechnologyIds instead */
638
+ /** Present only in subcollections - synced from technology metadata */
615
639
  technologyId?: string;
616
- /** @deprecated Will be removed in future version */
640
+ /** Present only in subcollections - synced from technology name */
617
641
  technologyName?: string;
618
- /** @deprecated Not needed in top-level collection */
642
+ /** Present only in subcollections - synced from technology categoryId */
619
643
  categoryId?: string;
620
- /** @deprecated Not needed in top-level collection */
644
+ /** Present only in subcollections - synced from technology subcategoryId */
621
645
  subcategoryId?: string;
622
646
  }
623
647
  /**
@@ -1585,9 +1609,8 @@ declare class ProductService extends BaseService implements IProductService {
1585
1609
  technologyId?: string;
1586
1610
  }): Promise<number>;
1587
1611
  /**
1588
- * Gets counts of active products grouped by technology.
1589
- * NOTE: Only counts top-level collection to avoid duplication during migration.
1590
- * Categories/subcategories not available in top-level structure.
1612
+ * Gets counts of active products grouped by category, subcategory, and technology.
1613
+ * Queries technology subcollections which have the legacy fields synced by Cloud Functions.
1591
1614
  */
1592
1615
  getProductCounts(): Promise<{
1593
1616
  byCategory: Record<string, number>;
@@ -1661,6 +1684,18 @@ declare class ProductService extends BaseService implements IProductService {
1661
1684
  * Gets all products for a brand (from top-level collection)
1662
1685
  */
1663
1686
  getByBrand(brandId: string): Promise<Product[]>;
1687
+ /**
1688
+ * Exports products to CSV string, suitable for Excel/Sheets.
1689
+ * Includes headers and optional UTF-8 BOM.
1690
+ * By default exports only active products (set includeInactive to true to export all).
1691
+ */
1692
+ exportToCsv(options?: {
1693
+ includeInactive?: boolean;
1694
+ includeBom?: boolean;
1695
+ }): Promise<string>;
1696
+ private productToCsvRow;
1697
+ private formatDateIso;
1698
+ private formatCsvValue;
1664
1699
  }
1665
1700
 
1666
1701
  /**
@@ -1741,6 +1776,18 @@ declare class RequirementService extends BaseService {
1741
1776
  * @returns Zahtev ili null ako ne postoji
1742
1777
  */
1743
1778
  getById(id: string): Promise<Requirement | null>;
1779
+ /**
1780
+ * Exports requirements to CSV string, suitable for Excel/Sheets.
1781
+ * Includes headers and optional UTF-8 BOM.
1782
+ * By default exports only active requirements (set includeInactive to true to export all).
1783
+ */
1784
+ exportToCsv(options?: {
1785
+ includeInactive?: boolean;
1786
+ includeBom?: boolean;
1787
+ }): Promise<string>;
1788
+ private requirementToCsvRow;
1789
+ private formatDateIso;
1790
+ private formatCsvValue;
1744
1791
  }
1745
1792
 
1746
1793
  /**
@@ -1851,6 +1898,18 @@ declare class SubcategoryService extends BaseService {
1851
1898
  * @returns Podkategorija ili null ako ne postoji
1852
1899
  */
1853
1900
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1901
+ /**
1902
+ * Exports subcategories to CSV string, suitable for Excel/Sheets.
1903
+ * Includes headers and optional UTF-8 BOM.
1904
+ * By default exports only active subcategories (set includeInactive to true to export all).
1905
+ */
1906
+ exportToCsv(options?: {
1907
+ includeInactive?: boolean;
1908
+ includeBom?: boolean;
1909
+ }): Promise<string>;
1910
+ private subcategoryToCsvRow;
1911
+ private formatDateIso;
1912
+ private formatCsvValue;
1854
1913
  }
1855
1914
 
1856
1915
  /**
@@ -2171,6 +2230,28 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2171
2230
  totalAssigned: number;
2172
2231
  byBrand: Record<string, number>;
2173
2232
  }>;
2233
+ /**
2234
+ * Updates products in technology subcollection when technology metadata changes
2235
+ * @param technologyId - ID of the technology
2236
+ * @param updates - Fields to update (categoryId, subcategoryId, technologyName)
2237
+ */
2238
+ private updateProductsInSubcollection;
2239
+ /**
2240
+ * Exports technologies to CSV string, suitable for Excel/Sheets.
2241
+ * Includes headers and optional UTF-8 BOM.
2242
+ * By default exports only active technologies (set includeInactive to true to export all).
2243
+ * Includes product names from subcollections.
2244
+ */
2245
+ exportToCsv(options?: {
2246
+ includeInactive?: boolean;
2247
+ includeBom?: boolean;
2248
+ }): Promise<string>;
2249
+ /**
2250
+ * Gets product names from the technology's product subcollection
2251
+ */
2252
+ private getProductNamesForTechnology;
2253
+ private technologyToCsvRow;
2254
+ private formatCsvValue;
2174
2255
  }
2175
2256
 
2176
2257
  /**
@@ -2290,6 +2371,23 @@ declare class ConstantsService extends BaseService {
2290
2371
  * @returns {Promise<void>}
2291
2372
  */
2292
2373
  deleteContraindication(contraindicationId: string): Promise<void>;
2374
+ /**
2375
+ * Exports treatment benefits to CSV string, suitable for Excel/Sheets.
2376
+ * Includes headers and optional UTF-8 BOM.
2377
+ */
2378
+ exportBenefitsToCsv(options?: {
2379
+ includeBom?: boolean;
2380
+ }): Promise<string>;
2381
+ /**
2382
+ * Exports contraindications to CSV string, suitable for Excel/Sheets.
2383
+ * Includes headers and optional UTF-8 BOM.
2384
+ */
2385
+ exportContraindicationsToCsv(options?: {
2386
+ includeBom?: boolean;
2387
+ }): Promise<string>;
2388
+ private benefitToCsvRow;
2389
+ private contraindicationToCsvRow;
2390
+ private formatCsvValue;
2293
2391
  }
2294
2392
 
2295
2393
  declare const documentElementSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -98,6 +98,18 @@ declare class BrandService extends BaseService {
98
98
  * Gets a brand by ID
99
99
  */
100
100
  getById(brandId: string): Promise<Brand | null>;
101
+ /**
102
+ * Exports brands to CSV string, suitable for Excel/Sheets.
103
+ * Includes headers and optional UTF-8 BOM.
104
+ * By default exports only active brands (set includeInactive to true to export all).
105
+ */
106
+ exportToCsv(options?: {
107
+ includeInactive?: boolean;
108
+ includeBom?: boolean;
109
+ }): Promise<string>;
110
+ private brandToCsvRow;
111
+ private formatDateIso;
112
+ private formatCsvValue;
101
113
  }
102
114
 
103
115
  /**
@@ -277,6 +289,18 @@ declare class CategoryService extends BaseService implements ICategoryService {
277
289
  * @returns Kategorija ili null ako ne postoji
278
290
  */
279
291
  getById(id: string): Promise<Category | null>;
292
+ /**
293
+ * Exports categories to CSV string, suitable for Excel/Sheets.
294
+ * Includes headers and optional UTF-8 BOM.
295
+ * By default exports only active categories (set includeInactive to true to export all).
296
+ */
297
+ exportToCsv(options?: {
298
+ includeInactive?: boolean;
299
+ includeBom?: boolean;
300
+ }): Promise<string>;
301
+ private categoryToCsvRow;
302
+ private formatDateIso;
303
+ private formatCsvValue;
280
304
  }
281
305
 
282
306
  /**
@@ -611,13 +635,13 @@ interface Product {
611
635
  composition?: string;
612
636
  indications?: string[];
613
637
  contraindications?: ContraindicationDynamic[];
614
- /** @deprecated Use assignedTechnologyIds instead */
638
+ /** Present only in subcollections - synced from technology metadata */
615
639
  technologyId?: string;
616
- /** @deprecated Will be removed in future version */
640
+ /** Present only in subcollections - synced from technology name */
617
641
  technologyName?: string;
618
- /** @deprecated Not needed in top-level collection */
642
+ /** Present only in subcollections - synced from technology categoryId */
619
643
  categoryId?: string;
620
- /** @deprecated Not needed in top-level collection */
644
+ /** Present only in subcollections - synced from technology subcategoryId */
621
645
  subcategoryId?: string;
622
646
  }
623
647
  /**
@@ -1585,9 +1609,8 @@ declare class ProductService extends BaseService implements IProductService {
1585
1609
  technologyId?: string;
1586
1610
  }): Promise<number>;
1587
1611
  /**
1588
- * Gets counts of active products grouped by technology.
1589
- * NOTE: Only counts top-level collection to avoid duplication during migration.
1590
- * Categories/subcategories not available in top-level structure.
1612
+ * Gets counts of active products grouped by category, subcategory, and technology.
1613
+ * Queries technology subcollections which have the legacy fields synced by Cloud Functions.
1591
1614
  */
1592
1615
  getProductCounts(): Promise<{
1593
1616
  byCategory: Record<string, number>;
@@ -1661,6 +1684,18 @@ declare class ProductService extends BaseService implements IProductService {
1661
1684
  * Gets all products for a brand (from top-level collection)
1662
1685
  */
1663
1686
  getByBrand(brandId: string): Promise<Product[]>;
1687
+ /**
1688
+ * Exports products to CSV string, suitable for Excel/Sheets.
1689
+ * Includes headers and optional UTF-8 BOM.
1690
+ * By default exports only active products (set includeInactive to true to export all).
1691
+ */
1692
+ exportToCsv(options?: {
1693
+ includeInactive?: boolean;
1694
+ includeBom?: boolean;
1695
+ }): Promise<string>;
1696
+ private productToCsvRow;
1697
+ private formatDateIso;
1698
+ private formatCsvValue;
1664
1699
  }
1665
1700
 
1666
1701
  /**
@@ -1741,6 +1776,18 @@ declare class RequirementService extends BaseService {
1741
1776
  * @returns Zahtev ili null ako ne postoji
1742
1777
  */
1743
1778
  getById(id: string): Promise<Requirement | null>;
1779
+ /**
1780
+ * Exports requirements to CSV string, suitable for Excel/Sheets.
1781
+ * Includes headers and optional UTF-8 BOM.
1782
+ * By default exports only active requirements (set includeInactive to true to export all).
1783
+ */
1784
+ exportToCsv(options?: {
1785
+ includeInactive?: boolean;
1786
+ includeBom?: boolean;
1787
+ }): Promise<string>;
1788
+ private requirementToCsvRow;
1789
+ private formatDateIso;
1790
+ private formatCsvValue;
1744
1791
  }
1745
1792
 
1746
1793
  /**
@@ -1851,6 +1898,18 @@ declare class SubcategoryService extends BaseService {
1851
1898
  * @returns Podkategorija ili null ako ne postoji
1852
1899
  */
1853
1900
  getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
1901
+ /**
1902
+ * Exports subcategories to CSV string, suitable for Excel/Sheets.
1903
+ * Includes headers and optional UTF-8 BOM.
1904
+ * By default exports only active subcategories (set includeInactive to true to export all).
1905
+ */
1906
+ exportToCsv(options?: {
1907
+ includeInactive?: boolean;
1908
+ includeBom?: boolean;
1909
+ }): Promise<string>;
1910
+ private subcategoryToCsvRow;
1911
+ private formatDateIso;
1912
+ private formatCsvValue;
1854
1913
  }
1855
1914
 
1856
1915
  /**
@@ -2171,6 +2230,28 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
2171
2230
  totalAssigned: number;
2172
2231
  byBrand: Record<string, number>;
2173
2232
  }>;
2233
+ /**
2234
+ * Updates products in technology subcollection when technology metadata changes
2235
+ * @param technologyId - ID of the technology
2236
+ * @param updates - Fields to update (categoryId, subcategoryId, technologyName)
2237
+ */
2238
+ private updateProductsInSubcollection;
2239
+ /**
2240
+ * Exports technologies to CSV string, suitable for Excel/Sheets.
2241
+ * Includes headers and optional UTF-8 BOM.
2242
+ * By default exports only active technologies (set includeInactive to true to export all).
2243
+ * Includes product names from subcollections.
2244
+ */
2245
+ exportToCsv(options?: {
2246
+ includeInactive?: boolean;
2247
+ includeBom?: boolean;
2248
+ }): Promise<string>;
2249
+ /**
2250
+ * Gets product names from the technology's product subcollection
2251
+ */
2252
+ private getProductNamesForTechnology;
2253
+ private technologyToCsvRow;
2254
+ private formatCsvValue;
2174
2255
  }
2175
2256
 
2176
2257
  /**
@@ -2290,6 +2371,23 @@ declare class ConstantsService extends BaseService {
2290
2371
  * @returns {Promise<void>}
2291
2372
  */
2292
2373
  deleteContraindication(contraindicationId: string): Promise<void>;
2374
+ /**
2375
+ * Exports treatment benefits to CSV string, suitable for Excel/Sheets.
2376
+ * Includes headers and optional UTF-8 BOM.
2377
+ */
2378
+ exportBenefitsToCsv(options?: {
2379
+ includeBom?: boolean;
2380
+ }): Promise<string>;
2381
+ /**
2382
+ * Exports contraindications to CSV string, suitable for Excel/Sheets.
2383
+ * Includes headers and optional UTF-8 BOM.
2384
+ */
2385
+ exportContraindicationsToCsv(options?: {
2386
+ includeBom?: boolean;
2387
+ }): Promise<string>;
2388
+ private benefitToCsvRow;
2389
+ private contraindicationToCsvRow;
2390
+ private formatCsvValue;
2293
2391
  }
2294
2392
 
2295
2393
  declare const documentElementSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{