@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.
- package/dist/admin/index.d.mts +4 -4
- package/dist/admin/index.d.ts +4 -4
- package/dist/backoffice/index.d.mts +105 -7
- package/dist/backoffice/index.d.ts +105 -7
- package/dist/backoffice/index.js +552 -8
- package/dist/backoffice/index.mjs +566 -21
- package/dist/index.d.mts +93 -7
- package/dist/index.d.ts +93 -7
- package/dist/index.js +493 -8
- package/dist/index.mjs +493 -8
- package/package.json +1 -1
- package/src/backoffice/services/brand.service.ts +86 -0
- package/src/backoffice/services/category.service.ts +84 -0
- package/src/backoffice/services/constants.service.ts +77 -0
- package/src/backoffice/services/product.service.ts +113 -10
- package/src/backoffice/services/requirement.service.ts +76 -0
- package/src/backoffice/services/subcategory.service.ts +87 -0
- package/src/backoffice/services/technology.service.ts +178 -0
- package/src/backoffice/types/product.types.ts +7 -6
package/dist/index.d.mts
CHANGED
|
@@ -595,13 +595,13 @@ interface Product {
|
|
|
595
595
|
composition?: string;
|
|
596
596
|
indications?: string[];
|
|
597
597
|
contraindications?: ContraindicationDynamic[];
|
|
598
|
-
/**
|
|
598
|
+
/** Present only in subcollections - synced from technology metadata */
|
|
599
599
|
technologyId?: string;
|
|
600
|
-
/**
|
|
600
|
+
/** Present only in subcollections - synced from technology name */
|
|
601
601
|
technologyName?: string;
|
|
602
|
-
/**
|
|
602
|
+
/** Present only in subcollections - synced from technology categoryId */
|
|
603
603
|
categoryId?: string;
|
|
604
|
-
/**
|
|
604
|
+
/** Present only in subcollections - synced from technology subcategoryId */
|
|
605
605
|
subcategoryId?: string;
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
@@ -1183,6 +1183,18 @@ declare class BrandService extends BaseService {
|
|
|
1183
1183
|
* Gets a brand by ID
|
|
1184
1184
|
*/
|
|
1185
1185
|
getById(brandId: string): Promise<Brand | null>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Exports brands to CSV string, suitable for Excel/Sheets.
|
|
1188
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1189
|
+
* By default exports only active brands (set includeInactive to true to export all).
|
|
1190
|
+
*/
|
|
1191
|
+
exportToCsv(options?: {
|
|
1192
|
+
includeInactive?: boolean;
|
|
1193
|
+
includeBom?: boolean;
|
|
1194
|
+
}): Promise<string>;
|
|
1195
|
+
private brandToCsvRow;
|
|
1196
|
+
private formatDateIso;
|
|
1197
|
+
private formatCsvValue;
|
|
1186
1198
|
}
|
|
1187
1199
|
|
|
1188
1200
|
/**
|
|
@@ -1284,6 +1296,18 @@ declare class CategoryService extends BaseService implements ICategoryService {
|
|
|
1284
1296
|
* @returns Kategorija ili null ako ne postoji
|
|
1285
1297
|
*/
|
|
1286
1298
|
getById(id: string): Promise<Category | null>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Exports categories to CSV string, suitable for Excel/Sheets.
|
|
1301
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1302
|
+
* By default exports only active categories (set includeInactive to true to export all).
|
|
1303
|
+
*/
|
|
1304
|
+
exportToCsv(options?: {
|
|
1305
|
+
includeInactive?: boolean;
|
|
1306
|
+
includeBom?: boolean;
|
|
1307
|
+
}): Promise<string>;
|
|
1308
|
+
private categoryToCsvRow;
|
|
1309
|
+
private formatDateIso;
|
|
1310
|
+
private formatCsvValue;
|
|
1287
1311
|
}
|
|
1288
1312
|
|
|
1289
1313
|
/**
|
|
@@ -1597,9 +1621,8 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1597
1621
|
technologyId?: string;
|
|
1598
1622
|
}): Promise<number>;
|
|
1599
1623
|
/**
|
|
1600
|
-
* Gets counts of active products grouped by technology.
|
|
1601
|
-
*
|
|
1602
|
-
* Categories/subcategories not available in top-level structure.
|
|
1624
|
+
* Gets counts of active products grouped by category, subcategory, and technology.
|
|
1625
|
+
* Queries technology subcollections which have the legacy fields synced by Cloud Functions.
|
|
1603
1626
|
*/
|
|
1604
1627
|
getProductCounts(): Promise<{
|
|
1605
1628
|
byCategory: Record<string, number>;
|
|
@@ -1673,6 +1696,18 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1673
1696
|
* Gets all products for a brand (from top-level collection)
|
|
1674
1697
|
*/
|
|
1675
1698
|
getByBrand(brandId: string): Promise<Product[]>;
|
|
1699
|
+
/**
|
|
1700
|
+
* Exports products to CSV string, suitable for Excel/Sheets.
|
|
1701
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1702
|
+
* By default exports only active products (set includeInactive to true to export all).
|
|
1703
|
+
*/
|
|
1704
|
+
exportToCsv(options?: {
|
|
1705
|
+
includeInactive?: boolean;
|
|
1706
|
+
includeBom?: boolean;
|
|
1707
|
+
}): Promise<string>;
|
|
1708
|
+
private productToCsvRow;
|
|
1709
|
+
private formatDateIso;
|
|
1710
|
+
private formatCsvValue;
|
|
1676
1711
|
}
|
|
1677
1712
|
|
|
1678
1713
|
/**
|
|
@@ -1783,6 +1818,18 @@ declare class SubcategoryService extends BaseService {
|
|
|
1783
1818
|
* @returns Podkategorija ili null ako ne postoji
|
|
1784
1819
|
*/
|
|
1785
1820
|
getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
|
|
1821
|
+
/**
|
|
1822
|
+
* Exports subcategories to CSV string, suitable for Excel/Sheets.
|
|
1823
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1824
|
+
* By default exports only active subcategories (set includeInactive to true to export all).
|
|
1825
|
+
*/
|
|
1826
|
+
exportToCsv(options?: {
|
|
1827
|
+
includeInactive?: boolean;
|
|
1828
|
+
includeBom?: boolean;
|
|
1829
|
+
}): Promise<string>;
|
|
1830
|
+
private subcategoryToCsvRow;
|
|
1831
|
+
private formatDateIso;
|
|
1832
|
+
private formatCsvValue;
|
|
1786
1833
|
}
|
|
1787
1834
|
|
|
1788
1835
|
/**
|
|
@@ -2404,6 +2451,28 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
|
|
|
2404
2451
|
totalAssigned: number;
|
|
2405
2452
|
byBrand: Record<string, number>;
|
|
2406
2453
|
}>;
|
|
2454
|
+
/**
|
|
2455
|
+
* Updates products in technology subcollection when technology metadata changes
|
|
2456
|
+
* @param technologyId - ID of the technology
|
|
2457
|
+
* @param updates - Fields to update (categoryId, subcategoryId, technologyName)
|
|
2458
|
+
*/
|
|
2459
|
+
private updateProductsInSubcollection;
|
|
2460
|
+
/**
|
|
2461
|
+
* Exports technologies to CSV string, suitable for Excel/Sheets.
|
|
2462
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2463
|
+
* By default exports only active technologies (set includeInactive to true to export all).
|
|
2464
|
+
* Includes product names from subcollections.
|
|
2465
|
+
*/
|
|
2466
|
+
exportToCsv(options?: {
|
|
2467
|
+
includeInactive?: boolean;
|
|
2468
|
+
includeBom?: boolean;
|
|
2469
|
+
}): Promise<string>;
|
|
2470
|
+
/**
|
|
2471
|
+
* Gets product names from the technology's product subcollection
|
|
2472
|
+
*/
|
|
2473
|
+
private getProductNamesForTechnology;
|
|
2474
|
+
private technologyToCsvRow;
|
|
2475
|
+
private formatCsvValue;
|
|
2407
2476
|
}
|
|
2408
2477
|
|
|
2409
2478
|
/**
|
|
@@ -2523,6 +2592,23 @@ declare class ConstantsService extends BaseService {
|
|
|
2523
2592
|
* @returns {Promise<void>}
|
|
2524
2593
|
*/
|
|
2525
2594
|
deleteContraindication(contraindicationId: string): Promise<void>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Exports treatment benefits to CSV string, suitable for Excel/Sheets.
|
|
2597
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2598
|
+
*/
|
|
2599
|
+
exportBenefitsToCsv(options?: {
|
|
2600
|
+
includeBom?: boolean;
|
|
2601
|
+
}): Promise<string>;
|
|
2602
|
+
/**
|
|
2603
|
+
* Exports contraindications to CSV string, suitable for Excel/Sheets.
|
|
2604
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2605
|
+
*/
|
|
2606
|
+
exportContraindicationsToCsv(options?: {
|
|
2607
|
+
includeBom?: boolean;
|
|
2608
|
+
}): Promise<string>;
|
|
2609
|
+
private benefitToCsvRow;
|
|
2610
|
+
private contraindicationToCsvRow;
|
|
2611
|
+
private formatCsvValue;
|
|
2526
2612
|
}
|
|
2527
2613
|
|
|
2528
2614
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -595,13 +595,13 @@ interface Product {
|
|
|
595
595
|
composition?: string;
|
|
596
596
|
indications?: string[];
|
|
597
597
|
contraindications?: ContraindicationDynamic[];
|
|
598
|
-
/**
|
|
598
|
+
/** Present only in subcollections - synced from technology metadata */
|
|
599
599
|
technologyId?: string;
|
|
600
|
-
/**
|
|
600
|
+
/** Present only in subcollections - synced from technology name */
|
|
601
601
|
technologyName?: string;
|
|
602
|
-
/**
|
|
602
|
+
/** Present only in subcollections - synced from technology categoryId */
|
|
603
603
|
categoryId?: string;
|
|
604
|
-
/**
|
|
604
|
+
/** Present only in subcollections - synced from technology subcategoryId */
|
|
605
605
|
subcategoryId?: string;
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
@@ -1183,6 +1183,18 @@ declare class BrandService extends BaseService {
|
|
|
1183
1183
|
* Gets a brand by ID
|
|
1184
1184
|
*/
|
|
1185
1185
|
getById(brandId: string): Promise<Brand | null>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Exports brands to CSV string, suitable for Excel/Sheets.
|
|
1188
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1189
|
+
* By default exports only active brands (set includeInactive to true to export all).
|
|
1190
|
+
*/
|
|
1191
|
+
exportToCsv(options?: {
|
|
1192
|
+
includeInactive?: boolean;
|
|
1193
|
+
includeBom?: boolean;
|
|
1194
|
+
}): Promise<string>;
|
|
1195
|
+
private brandToCsvRow;
|
|
1196
|
+
private formatDateIso;
|
|
1197
|
+
private formatCsvValue;
|
|
1186
1198
|
}
|
|
1187
1199
|
|
|
1188
1200
|
/**
|
|
@@ -1284,6 +1296,18 @@ declare class CategoryService extends BaseService implements ICategoryService {
|
|
|
1284
1296
|
* @returns Kategorija ili null ako ne postoji
|
|
1285
1297
|
*/
|
|
1286
1298
|
getById(id: string): Promise<Category | null>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Exports categories to CSV string, suitable for Excel/Sheets.
|
|
1301
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1302
|
+
* By default exports only active categories (set includeInactive to true to export all).
|
|
1303
|
+
*/
|
|
1304
|
+
exportToCsv(options?: {
|
|
1305
|
+
includeInactive?: boolean;
|
|
1306
|
+
includeBom?: boolean;
|
|
1307
|
+
}): Promise<string>;
|
|
1308
|
+
private categoryToCsvRow;
|
|
1309
|
+
private formatDateIso;
|
|
1310
|
+
private formatCsvValue;
|
|
1287
1311
|
}
|
|
1288
1312
|
|
|
1289
1313
|
/**
|
|
@@ -1597,9 +1621,8 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1597
1621
|
technologyId?: string;
|
|
1598
1622
|
}): Promise<number>;
|
|
1599
1623
|
/**
|
|
1600
|
-
* Gets counts of active products grouped by technology.
|
|
1601
|
-
*
|
|
1602
|
-
* Categories/subcategories not available in top-level structure.
|
|
1624
|
+
* Gets counts of active products grouped by category, subcategory, and technology.
|
|
1625
|
+
* Queries technology subcollections which have the legacy fields synced by Cloud Functions.
|
|
1603
1626
|
*/
|
|
1604
1627
|
getProductCounts(): Promise<{
|
|
1605
1628
|
byCategory: Record<string, number>;
|
|
@@ -1673,6 +1696,18 @@ declare class ProductService extends BaseService implements IProductService {
|
|
|
1673
1696
|
* Gets all products for a brand (from top-level collection)
|
|
1674
1697
|
*/
|
|
1675
1698
|
getByBrand(brandId: string): Promise<Product[]>;
|
|
1699
|
+
/**
|
|
1700
|
+
* Exports products to CSV string, suitable for Excel/Sheets.
|
|
1701
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1702
|
+
* By default exports only active products (set includeInactive to true to export all).
|
|
1703
|
+
*/
|
|
1704
|
+
exportToCsv(options?: {
|
|
1705
|
+
includeInactive?: boolean;
|
|
1706
|
+
includeBom?: boolean;
|
|
1707
|
+
}): Promise<string>;
|
|
1708
|
+
private productToCsvRow;
|
|
1709
|
+
private formatDateIso;
|
|
1710
|
+
private formatCsvValue;
|
|
1676
1711
|
}
|
|
1677
1712
|
|
|
1678
1713
|
/**
|
|
@@ -1783,6 +1818,18 @@ declare class SubcategoryService extends BaseService {
|
|
|
1783
1818
|
* @returns Podkategorija ili null ako ne postoji
|
|
1784
1819
|
*/
|
|
1785
1820
|
getById(categoryId: string, subcategoryId: string): Promise<Subcategory | null>;
|
|
1821
|
+
/**
|
|
1822
|
+
* Exports subcategories to CSV string, suitable for Excel/Sheets.
|
|
1823
|
+
* Includes headers and optional UTF-8 BOM.
|
|
1824
|
+
* By default exports only active subcategories (set includeInactive to true to export all).
|
|
1825
|
+
*/
|
|
1826
|
+
exportToCsv(options?: {
|
|
1827
|
+
includeInactive?: boolean;
|
|
1828
|
+
includeBom?: boolean;
|
|
1829
|
+
}): Promise<string>;
|
|
1830
|
+
private subcategoryToCsvRow;
|
|
1831
|
+
private formatDateIso;
|
|
1832
|
+
private formatCsvValue;
|
|
1786
1833
|
}
|
|
1787
1834
|
|
|
1788
1835
|
/**
|
|
@@ -2404,6 +2451,28 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
|
|
|
2404
2451
|
totalAssigned: number;
|
|
2405
2452
|
byBrand: Record<string, number>;
|
|
2406
2453
|
}>;
|
|
2454
|
+
/**
|
|
2455
|
+
* Updates products in technology subcollection when technology metadata changes
|
|
2456
|
+
* @param technologyId - ID of the technology
|
|
2457
|
+
* @param updates - Fields to update (categoryId, subcategoryId, technologyName)
|
|
2458
|
+
*/
|
|
2459
|
+
private updateProductsInSubcollection;
|
|
2460
|
+
/**
|
|
2461
|
+
* Exports technologies to CSV string, suitable for Excel/Sheets.
|
|
2462
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2463
|
+
* By default exports only active technologies (set includeInactive to true to export all).
|
|
2464
|
+
* Includes product names from subcollections.
|
|
2465
|
+
*/
|
|
2466
|
+
exportToCsv(options?: {
|
|
2467
|
+
includeInactive?: boolean;
|
|
2468
|
+
includeBom?: boolean;
|
|
2469
|
+
}): Promise<string>;
|
|
2470
|
+
/**
|
|
2471
|
+
* Gets product names from the technology's product subcollection
|
|
2472
|
+
*/
|
|
2473
|
+
private getProductNamesForTechnology;
|
|
2474
|
+
private technologyToCsvRow;
|
|
2475
|
+
private formatCsvValue;
|
|
2407
2476
|
}
|
|
2408
2477
|
|
|
2409
2478
|
/**
|
|
@@ -2523,6 +2592,23 @@ declare class ConstantsService extends BaseService {
|
|
|
2523
2592
|
* @returns {Promise<void>}
|
|
2524
2593
|
*/
|
|
2525
2594
|
deleteContraindication(contraindicationId: string): Promise<void>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Exports treatment benefits to CSV string, suitable for Excel/Sheets.
|
|
2597
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2598
|
+
*/
|
|
2599
|
+
exportBenefitsToCsv(options?: {
|
|
2600
|
+
includeBom?: boolean;
|
|
2601
|
+
}): Promise<string>;
|
|
2602
|
+
/**
|
|
2603
|
+
* Exports contraindications to CSV string, suitable for Excel/Sheets.
|
|
2604
|
+
* Includes headers and optional UTF-8 BOM.
|
|
2605
|
+
*/
|
|
2606
|
+
exportContraindicationsToCsv(options?: {
|
|
2607
|
+
includeBom?: boolean;
|
|
2608
|
+
}): Promise<string>;
|
|
2609
|
+
private benefitToCsvRow;
|
|
2610
|
+
private contraindicationToCsvRow;
|
|
2611
|
+
private formatCsvValue;
|
|
2526
2612
|
}
|
|
2527
2613
|
|
|
2528
2614
|
/**
|