@nicefer/types 1.0.218 → 2.0.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.
Files changed (110) hide show
  1. package/dist/{api.d.ts → types/api.d.ts} +1 -0
  2. package/dist/types/api.d.ts.map +1 -0
  3. package/dist/types/api.js +3 -0
  4. package/dist/{bag.d.ts → types/bag.d.ts} +1 -0
  5. package/dist/types/bag.d.ts.map +1 -0
  6. package/dist/types/bag.js +1 -0
  7. package/dist/{branch.d.ts → types/branch.d.ts} +1 -0
  8. package/dist/types/branch.d.ts.map +1 -0
  9. package/dist/types/branch.js +1 -0
  10. package/dist/{company.d.ts → types/company.d.ts} +1 -0
  11. package/dist/types/company.d.ts.map +1 -0
  12. package/dist/types/company.js +2 -0
  13. package/dist/{countries.d.ts → types/countries.d.ts} +1 -0
  14. package/dist/types/countries.d.ts.map +1 -0
  15. package/dist/{countries.js → types/countries.js} +4 -5
  16. package/dist/{index.d.ts → types/index.d.ts} +1 -0
  17. package/dist/types/index.d.ts.map +1 -0
  18. package/{src/index.ts → dist/types/index.js} +17 -19
  19. package/dist/{orders.d.ts → types/orders.d.ts} +1 -0
  20. package/dist/types/orders.d.ts.map +1 -0
  21. package/dist/types/orders.js +9 -0
  22. package/dist/{payments.d.ts → types/payments.d.ts} +1 -0
  23. package/dist/types/payments.d.ts.map +1 -0
  24. package/dist/types/payments.js +1 -0
  25. package/dist/{product-category.d.ts → types/product-category.d.ts} +1 -0
  26. package/dist/types/product-category.d.ts.map +1 -0
  27. package/dist/types/product-category.js +2 -0
  28. package/dist/{products.d.ts → types/products.d.ts} +1 -0
  29. package/dist/types/products.d.ts.map +1 -0
  30. package/dist/types/products.js +6 -0
  31. package/dist/{replenishment.d.ts → types/replenishment.d.ts} +1 -0
  32. package/dist/types/replenishment.d.ts.map +1 -0
  33. package/dist/types/replenishment.js +5 -0
  34. package/dist/{stats.d.ts → types/stats.d.ts} +1 -0
  35. package/dist/types/stats.d.ts.map +1 -0
  36. package/dist/types/stats.js +1 -0
  37. package/dist/{translations.d.ts → types/translations.d.ts} +1 -0
  38. package/dist/types/translations.d.ts.map +1 -0
  39. package/dist/types/translations.js +1 -0
  40. package/dist/{users.d.ts → types/users.d.ts} +1 -0
  41. package/dist/types/users.d.ts.map +1 -0
  42. package/dist/types/users.js +3 -0
  43. package/dist/{warehouses.d.ts → types/warehouses.d.ts} +1 -0
  44. package/dist/types/warehouses.d.ts.map +1 -0
  45. package/dist/types/warehouses.js +2 -0
  46. package/dist/{org → types-org}/event.d.ts +1 -0
  47. package/dist/types-org/event.d.ts.map +1 -0
  48. package/dist/types-org/event.js +1 -0
  49. package/dist/types-org/index.d.ts +3 -0
  50. package/dist/types-org/index.d.ts.map +1 -0
  51. package/dist/types-org/index.js +2 -0
  52. package/dist/{org → types-org}/radar.d.ts +1 -0
  53. package/dist/types-org/radar.d.ts.map +1 -0
  54. package/dist/types-org/radar.js +3 -0
  55. package/package.json +11 -1
  56. package/dist/api.js +0 -4
  57. package/dist/api.js.map +0 -1
  58. package/dist/bag.js +0 -2
  59. package/dist/bag.js.map +0 -1
  60. package/dist/branch.js +0 -2
  61. package/dist/branch.js.map +0 -1
  62. package/dist/company.js +0 -3
  63. package/dist/company.js.map +0 -1
  64. package/dist/countries.js.map +0 -1
  65. package/dist/index.js +0 -18
  66. package/dist/index.js.map +0 -1
  67. package/dist/orders.js +0 -10
  68. package/dist/orders.js.map +0 -1
  69. package/dist/org/event.js +0 -2
  70. package/dist/org/event.js.map +0 -1
  71. package/dist/org/index.d.ts +0 -2
  72. package/dist/org/index.js +0 -2
  73. package/dist/org/index.js.map +0 -1
  74. package/dist/org/radar.js +0 -4
  75. package/dist/org/radar.js.map +0 -1
  76. package/dist/payments.js +0 -2
  77. package/dist/payments.js.map +0 -1
  78. package/dist/product-category.js +0 -3
  79. package/dist/product-category.js.map +0 -1
  80. package/dist/products.js +0 -7
  81. package/dist/products.js.map +0 -1
  82. package/dist/replenishment.js +0 -6
  83. package/dist/replenishment.js.map +0 -1
  84. package/dist/stats.js +0 -2
  85. package/dist/stats.js.map +0 -1
  86. package/dist/translations.js +0 -2
  87. package/dist/translations.js.map +0 -1
  88. package/dist/users.js +0 -4
  89. package/dist/users.js.map +0 -1
  90. package/dist/warehouses.js +0 -3
  91. package/dist/warehouses.js.map +0 -1
  92. package/src/api.ts +0 -12
  93. package/src/bag.ts +0 -45
  94. package/src/branch.ts +0 -22
  95. package/src/company.ts +0 -11
  96. package/src/countries.ts +0 -227
  97. package/src/orders.ts +0 -112
  98. package/src/org/event.ts +0 -17
  99. package/src/org/index.ts +0 -2
  100. package/src/org/radar.ts +0 -86
  101. package/src/payments.ts +0 -79
  102. package/src/product-category.ts +0 -34
  103. package/src/products.ts +0 -129
  104. package/src/replenishment.ts +0 -114
  105. package/src/stats.ts +0 -18
  106. package/src/translations.ts +0 -3
  107. package/src/users.ts +0 -85
  108. package/src/warehouses.ts +0 -53
  109. package/tsconfig.json +0 -40
  110. package/tsconfig.json.old +0 -16
@@ -1,34 +0,0 @@
1
- import { Country } from "./countries";
2
- import { Translations } from "./translations";
3
-
4
- export interface Category {
5
- id: string;
6
- title: string;
7
- translations?: Translations<string>;
8
- icon?: string;
9
- subcategories?: SubCategory[];
10
- hidden?: boolean;
11
- adultsOnly?: boolean;
12
- }
13
-
14
- export interface SubCategory {
15
- id: string;
16
- title: string;
17
- translations?: Translations<string>;
18
- }
19
-
20
- export interface CategoryType {
21
- title: string;
22
- type: 'clothes' |'gifts' | 'perfumes' | 'electric' | 'electronics' | 'handmade-jewelry' | 'jewelry' | 'home' | 'beauty' | 'health' | 'books' | 'shoes' | 'bags';
23
- translations?: Translations<string>;
24
- icon?: string;
25
- categories: Category[];
26
- countries: Country['id'][];
27
- hidden?: boolean;
28
- }
29
-
30
-
31
- export interface ProductCategoryInDB {
32
- id: string;
33
- subcategory: string
34
- };
package/src/products.ts DELETED
@@ -1,129 +0,0 @@
1
- import { CompanyFK } from "./company";
2
- import { Country } from "./countries";
3
- import { CategoryType, ProductCategoryInDB } from "./product-category";
4
- import { RProduct, RSupplier } from "./replenishment";
5
- import { Translations } from "./translations";
6
-
7
- export interface ProductFirstOptionTypeValue { value: string; codeColor?: string; };
8
- export interface ProductOptionValue { value: string, code?: string };
9
-
10
- type clothesOptions = 'talla' | 'color';
11
- type giftsOptions = 'color' | 'tipo de flor';
12
-
13
- export interface ProductOptionToSelect {
14
- option: clothesOptions | giftsOptions;
15
- valuesAllowed: ProductOptionValue[];
16
- };
17
-
18
- /**
19
- * Igual que store-product-in-db.ts del proyecto `Zavafa`
20
- */
21
- export interface ProductInDB {
22
- id: string; // ID único del producto principal
23
- name: string; // Nombre del producto
24
- nameTranslations?: Translations<string>;
25
- description: string; // Descripcion del producto
26
- descriptionTranslations?: Translations<string>;
27
- category: ProductCategoryInDB; // Categoría del producto (ej. "Electrónica", "Ropa")
28
- brand: string | null | undefined; // Marca del producto (opcional)
29
- coverImg?: ProductVariantImage;
30
- type: CategoryType['type'];
31
- soldBy: CompanyFK;
32
- adultsOnly?: boolean; // Indica si el producto es para adultos
33
- shipmentsTo?: { [countryId in Country['id']]: boolean }; // Países(s) a donde se envia el producto
34
-
35
- countries?: { [key: string]: boolean }; // Países(s) donde se almacena el producto
36
- warrantyInDays?: number;
37
-
38
- /**
39
- * Opciones con las que se identificará cada variante de este producto,
40
- * serán establecidas por el usuario.
41
- *
42
- * Máximo 2.
43
- * @example: Talla, Color, Onzas, etc. Y todos sus valores posibles.
44
- */
45
- optionsToSelect: ProductOptionToSelect[]; // Máximo 2 opciones
46
- /** Peso en libras */
47
- weightLbs?: number;
48
- status: 'active' | 'inactive' | 'discontinued'; // Estado del producto
49
- tags: string[]; // Etiquetas por las cuáles los usuarios pueden buscar este producto
50
- createdAt: any; // Fecha de creación en formato ISO 8601
51
- updatedAt?: string; // Última actualización en formato ISO 8601
52
-
53
- createdBy: { id: string; displayName: string; }; // Usuario que creó el producto
54
- updatedBy?: { id: string; displayName: string; }; // Usuario que actualizó el producto
55
- }
56
-
57
-
58
- /**
59
- * /products/{productId}/variants/{sku}
60
- */
61
- export interface ProductVariantImage { url: string, path: string };
62
- export interface ProductVariantInDB {
63
- /** Este es el SKU */
64
- id?: string;
65
- supplier: RSupplier;
66
- supplierVariantId: RProduct['supplierVariantId'];
67
- productId?: string;
68
- images?: ProductVariantImage[];
69
- barcode?: string;
70
-
71
- /**
72
- * Packages dónde está la variante
73
- */
74
- inPackages?: { packageId: string; orderId: string }[];
75
-
76
- /**
77
- * Warehouses dónde está disponible esta variante.
78
- * Cada ```key``` del objeto es el id del warehouse y su valor será {@link VariantWarehouseFK}.
79
- *
80
- * @note Se usa esta nueva manera para poder usar los FieldValue (serverTimestamp, etc) de Firestore,
81
- * ya que en los arrays no funcionan.
82
- */
83
- warehouses: {
84
- [key: string]: VariantWarehouseFK
85
- };
86
-
87
- /**
88
- * Opciones de la variante, por ejemplo una prenda tiene color y talla.
89
- * Obligatoriamente tiene que tener al menos una opción.
90
- *
91
- * @note {@link secondOptionType} NO puede ser de tipo 'color'
92
- */
93
- selectedOptions: {
94
- option: ProductOptionToSelect['option'];
95
- value: { value: string; code?: string };
96
- }[];
97
- }
98
-
99
- /**
100
- * La forma en que se enlaza información del producto en determinada warehouse,
101
- * esta información va adentro de la variante.
102
- *
103
- * /products/{id}/variants/{id}
104
- */
105
- export interface VariantWarehouseFK {
106
- id: string;
107
- name: string;
108
- stock: number; // Cantidad disponible en inventario
109
- price: number; // Precio de esta variante (puede ser diferente del basePrice)
110
- priceUSD: number; // Precio de esta variante (puede ser diferente del basePrice)
111
- lastPrice?: number; // Último precio de esta variante usado para descuentos o reducciones de precio
112
- lastPriceUSD?: number; // Último precio de esta variante usado para descuentos o reducciones de precio
113
- supplierPriceUSD: number;
114
- supplierPriceHNL: number;
115
- profitMarginUSD: number;
116
- profitMarginHNL: number;
117
- profitMarginPercent: number;
118
- };
119
-
120
- /**
121
- * Para poder mostrar las variantes agrupadas
122
- *
123
- * Ej. Verde / S, Verde / M, etc
124
- */
125
- export interface ProductGroupVariant {
126
- variant: ProductVariantInDB,
127
- /** Indica si la información se cargó desde el servidor o se creó automaticamente */
128
- dataFromServer: boolean;
129
- }
@@ -1,114 +0,0 @@
1
- import { ProductVariantInDB } from "./products";
2
- import { WarehouseInDB } from "./warehouses";
3
-
4
-
5
- export interface RSupplier {
6
- id: string;
7
- name: string;
8
- };
9
-
10
- /**
11
- * Productos de la orden de reabastecimiento realizada al proveedor
12
- */
13
- export interface RProduct {
14
- id?: string;
15
- productId: string;
16
- variantId: string;
17
- packageId: string;
18
- selectedOptions: ProductVariantInDB['selectedOptions'];
19
- newStock: number;
20
- supplier: RSupplier;
21
-
22
- /** Id que usa el proveedor para manejar este producto en su sistema */
23
- supplierVariantId: string;
24
- /**
25
- * Fecha de registro de el paquete en el sistema
26
- */
27
- createdAt?: string;
28
- /**
29
- * Si no tiene rPackageId se considera un
30
- * producto de la misma orden pero huérfano
31
- */
32
- rPackageId?: string;
33
- };
34
-
35
- export interface ROrder {
36
- /**
37
- * Id único interno
38
- */
39
- id?: string;
40
-
41
- /**
42
- * Número de orden del proveedor
43
- *
44
- * Este es el número de orden con el que
45
- * el proveedor da seguimiento a la orden.
46
- */
47
- supplierOrderId: string;
48
- supplier: RSupplier;
49
- totalValue: number;
50
- packsQty: number;
51
-
52
- /**
53
- * Almacén final que recibirá la orden.
54
- * Es donde se pondrán en venta los productos o desde dónde
55
- * se distribuirán al resto de almacenes.
56
- */
57
- warehouseDestination: Pick<WarehouseInDB, 'id' | 'name'>;
58
-
59
- /**
60
- * Moneda siempre será USD
61
- */
62
- ccy: 'USD';
63
- createdAt: string;
64
- };
65
-
66
- export interface RPackageHistory {
67
- title: string;
68
- /**
69
- * Si esta en el JSON, entonces ya se llegó al `ROrder['warehouseDestination']` requerido.
70
- */
71
- warehouseDestination?: ROrder['warehouseDestination'];
72
- mode: 'on-the-way' | 'arrived' | 'info';
73
-
74
- /**
75
- * Nombre de la empresa que realiza el envío desde {@link from}
76
- * @example UPS, FedEx, SerCargo, etc
77
- */
78
- shippingCompany?: string | null;
79
- trackingURL?: string | null;
80
- icon?: string;
81
- /**
82
- * Fecha en la que se registró el evento
83
- */
84
- createdAt: string;
85
- };
86
-
87
- export interface RPackage {
88
- id: string;
89
-
90
- /**
91
- * Id de {@link ROrder}
92
- */
93
- orderId: string;
94
- itemsQty: number;
95
- historyTracking: RPackageHistory[],
96
-
97
- /**
98
- * Detalles adicionales sobre el paquete
99
- */
100
- notes?: string;
101
-
102
- /**
103
- * Usuario que registró el paquete
104
- */
105
- createdBy: {
106
- id: string;
107
- displayName: string;
108
- };
109
-
110
- /**
111
- * Fecha de registro de el paquete en el sistema
112
- */
113
- createdAt: string;
114
- }
package/src/stats.ts DELETED
@@ -1,18 +0,0 @@
1
- export interface OrdersStats {
2
- total?: number;
3
- canceled?: number;
4
- delivered?: number;
5
- }
6
-
7
- // export interface Stats {
8
- // orders?: OrdersStats;
9
- // }
10
-
11
- export interface UserStats {
12
- orders?: {
13
- total?: number;
14
- canceled?: number;
15
- delivered?: number;
16
- };
17
- qtyReferrals?: number;
18
- }
@@ -1,3 +0,0 @@
1
- export interface Translations<T = any> {
2
- [key: string]: T;
3
- }
package/src/users.ts DELETED
@@ -1,85 +0,0 @@
1
- import { Country } from "./countries";
2
-
3
- export interface User {
4
- uid: string;
5
- displayName: string;
6
- email: string;
7
- stripeCustomerId?: string;
8
- userDevices?: UserDevice[];
9
- phoneNumber?: string;
10
- photoURL?: string;
11
- referralBy?: {uid: string, displayName: string, referredAt: string};
12
- tags: string[];
13
- createdAt: string;
14
- updatedAt?: string;
15
- };
16
-
17
- export interface UserDevice {
18
- id: string;
19
-
20
- FCMToken?: string;
21
- /**
22
- * ios | android | web
23
- */
24
- platform: string;
25
- /**
26
- * Iphone 12 | Pixel 5
27
- */
28
- model: string;
29
- /**
30
- * ios | android
31
- */
32
- operatingSystem: string;
33
- /**
34
- * 13 | 10
35
- */
36
- osVersion: string;
37
- /**
38
- * Apple | Google | Microsoft | Samsung
39
- */
40
- manufacturer: string;
41
- /**
42
- * ``true`` si es un emulador
43
- */
44
- isVirtual: boolean;
45
- /**
46
- * ``es`` | ``en``
47
- */
48
- language: string;
49
- /**
50
- * Versión de la app
51
- */
52
- appVersion: string;
53
- appBuild: string;
54
- lastLogin: string;
55
- ipSecurity?: {
56
- ip: string;
57
- type: 'IPv4' | 'IPv6';
58
- country: string;
59
- country_code: string;
60
- region: string;
61
- city: string;
62
- isp: string;
63
- }
64
- };
65
-
66
- export interface UserAddressInDB {
67
- id: string;
68
- isDefault?: boolean;
69
- fullname: string;
70
- phone: string;
71
- address: string;
72
- references: string;
73
- region: string;
74
- city: string;
75
- country: Country | null | undefined;
76
- }
77
-
78
- export interface UserSearch {
79
- id: string;
80
- displayName: string;
81
- uid?: string;
82
- k: string;
83
- tags: string[];
84
- createdAt: string;
85
- }
package/src/warehouses.ts DELETED
@@ -1,53 +0,0 @@
1
- import { Country, Region } from "./countries";
2
-
3
- export interface WarehouseInDB {
4
- id?: string; // maxLength: 36 (UUID estándar)
5
- name: string; // maxLength: 100 (nombre comercial)
6
- address: string; // maxLength: 150 (calle y número)
7
- secondLineAddress?: string | null; // maxLength: 100 (complemento opcional)
8
- city: string; // maxLength: 80 (ciudades grandes pueden ser largas)
9
- region?: Region | null;
10
- zipcode: number; // maxLength: 10 (ZIP/Postal code)
11
- country: Country;
12
- status: 'active' | 'tmpClosed' | 'closed'; // No necesita maxLength (valores fijos)
13
- /**
14
- * `key` es el id del país al que se entrega. Ej. `US`
15
- */
16
- shipmentsTo: {[countryId in Country['id']]: WarehouseDeliveryTime};
17
- createdAt: string; // ISO 8601 (maxLength: 24, e.g., "2025-03-15T12:00:00Z")
18
- }
19
-
20
- /**
21
- * Tiempo de entrega en días hábiles de un país a otro
22
- */
23
- export interface WarehouseDeliveryTime {
24
- countryId: Country['id'];
25
- countryName: string;
26
- deliveryMethods: {
27
- [deliveryMethodId in DeliveryMethod['id']]: DeliveryMethod
28
- };
29
- };
30
-
31
- export interface DeliveryMethod {
32
- id: 'standard' | 'express' | 'weekend';
33
- name: string;
34
- /**
35
- * Número de días hábiles que tarda la entrega,
36
- * se calcula y llena en `client`.
37
- */
38
- deliveryRange?: string;
39
- inBusinessDays: `${number}-${number}`; // Ej. "3-5"
40
- deliveryFeeInUSD: number;
41
- deliveryFeeInHNL: number;
42
- /**
43
- * El cargo en {@link deliveryFeeInUSD} y {@link deliveryFeeInHNL}
44
- * permitirá un máximo de lo indicado aquí. Si se supera el máximo,
45
- * se cobrará
46
- */
47
- maxLbPerFee: number;
48
- }
49
-
50
-
51
-
52
-
53
-
package/tsconfig.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": "./",
4
- "outDir": "./dist",
5
- "module": "es2015",
6
- "moduleResolution": "bundler",
7
- "declaration": true,
8
- "sourceMap": true,
9
- "inlineSources": true,
10
- "emitDecoratorMetadata": true,
11
- "experimentalDecorators": true,
12
- "importHelpers": true,
13
- "types": [],
14
- "lib": [
15
- "dom",
16
- "es2018"
17
- ],
18
- "paths": {
19
- "nicefer": [
20
- "src/index"
21
- ],
22
- "org": [
23
- "src/org"
24
- ]
25
- },
26
- },
27
- "angularCompilerOptions": {
28
- "annotateForClosureCompiler": true,
29
- "skipTemplateCodegen": true,
30
- "strictMetadataEmit": true,
31
- "fullTemplateTypeCheck": true,
32
- "strictInjectionParameters": true,
33
- "enableResourceInlining": true
34
- },
35
- "exclude": [
36
- "src/test.ts",
37
- "**/*.spec.ts",
38
- "dist"
39
- ]
40
- }
package/tsconfig.json.old DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "node",
6
- "esModuleInterop": true,
7
- "emitDeclarationOnly": false,
8
- "outDir": "./dist",
9
- "rootDir": "./src",
10
- "strict": true,
11
- "declaration": true,
12
- "skipLibCheck": true
13
- },
14
- "include": ["src/**/*"],
15
- "exclude": ["node_modules", "dist"]
16
- }