@nicefer/types 1.0.216 → 1.0.218

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 (58) hide show
  1. package/dist/api.js +1 -0
  2. package/dist/api.js.map +1 -0
  3. package/dist/bag.js +1 -0
  4. package/dist/bag.js.map +1 -0
  5. package/dist/branch.js +1 -0
  6. package/dist/branch.js.map +1 -0
  7. package/dist/company.js +1 -0
  8. package/dist/company.js.map +1 -0
  9. package/dist/countries.js +5 -4
  10. package/dist/countries.js.map +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/orders.js +1 -0
  14. package/dist/orders.js.map +1 -0
  15. package/dist/org/event.js +1 -0
  16. package/dist/org/event.js.map +1 -0
  17. package/dist/org/index.d.ts +2 -3
  18. package/dist/org/index.js +2 -1
  19. package/dist/org/index.js.map +1 -0
  20. package/dist/org/radar.js +1 -0
  21. package/dist/org/radar.js.map +1 -0
  22. package/dist/payments.js +1 -0
  23. package/dist/payments.js.map +1 -0
  24. package/dist/product-category.js +1 -0
  25. package/dist/product-category.js.map +1 -0
  26. package/dist/products.js +1 -0
  27. package/dist/products.js.map +1 -0
  28. package/dist/replenishment.js +1 -0
  29. package/dist/replenishment.js.map +1 -0
  30. package/dist/stats.js +1 -0
  31. package/dist/stats.js.map +1 -0
  32. package/dist/translations.js +1 -0
  33. package/dist/translations.js.map +1 -0
  34. package/dist/users.js +1 -0
  35. package/dist/users.js.map +1 -0
  36. package/dist/warehouses.js +1 -0
  37. package/dist/warehouses.js.map +1 -0
  38. package/package.json +1 -12
  39. package/src/api.ts +12 -0
  40. package/src/bag.ts +45 -0
  41. package/src/branch.ts +22 -0
  42. package/src/company.ts +11 -0
  43. package/src/countries.ts +227 -0
  44. package/src/index.ts +19 -0
  45. package/src/orders.ts +112 -0
  46. package/src/org/event.ts +17 -0
  47. package/src/org/index.ts +2 -0
  48. package/src/org/radar.ts +86 -0
  49. package/src/payments.ts +79 -0
  50. package/src/product-category.ts +34 -0
  51. package/src/products.ts +129 -0
  52. package/src/replenishment.ts +114 -0
  53. package/src/stats.ts +18 -0
  54. package/src/translations.ts +3 -0
  55. package/src/users.ts +85 -0
  56. package/src/warehouses.ts +53 -0
  57. package/tsconfig.json +40 -0
  58. package/tsconfig.json.old +16 -0
package/dist/api.js CHANGED
@@ -1,3 +1,4 @@
1
1
  ;
2
2
  ;
3
3
  export {};
4
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAKC,CAAC;AAMD,CAAC","sourcesContent":["export interface ApiRequest {\r\n route: string;\r\n auth?: boolean;\r\n params?: any;\r\n page?: number\r\n};\r\n\r\nexport interface ApiResponse<Data, ErrorCodes = string> {\r\n ok: boolean;\r\n error?: ErrorCodes;\r\n data?: Data;\r\n};\r\n"]}
package/dist/bag.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=bag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bag.js","sourceRoot":"","sources":["../src/bag.ts"],"names":[],"mappings":"","sourcesContent":["import { OrderDiscountApplied } from \"./orders\";\r\nimport { PaymentInDB } from \"./payments\";\r\nimport { CategoryType } from \"./product-category\";\r\nimport { ProductVariantInDB } from \"./products\";\r\n\r\nexport interface Bag {\r\n subtotalPrice: number;\r\n subtotalWithDiscount: number;\r\n totalPrice: number;\r\n shippingPrice: number;\r\n discounts?: OrderDiscountApplied[];\r\n ccy: PaymentInDB['ccy'];\r\n products: ProductWithVariantInBag[];\r\n}\r\n\r\n/**\r\n * En la bolsa cada variante será independiente,\r\n * @example Si un producto tiene 3 variantes y el usuario\r\n * agrega cada variante, entonces se tomará como 3 productos independientes.\r\n */\r\nexport interface ProductWithVariantInBag {\r\n productId: string;\r\n productName: string;\r\n \r\n /** Heredado de {@link ProductInDB} */\r\n weightLbs: number;\r\n\r\n imgFullUrl: string | undefined;\r\n categoryType: CategoryType['type'];\r\n ccy: PaymentInDB['ccy'];\r\n\r\n variantId: string;\r\n warehouseId: string;\r\n\r\n selectedOptions: ProductVariantInDB['selectedOptions'];\r\n\r\n variantQty: number;\r\n variantPrice: number;\r\n variantPriceWithDiscount?: number;\r\n\r\n createdAt: string;\r\n updatedAt?: string;\r\n}\r\n\r\n\r\n"]}
package/dist/branch.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=branch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.js","sourceRoot":"","sources":["../src/branch.ts"],"names":[],"mappings":"","sourcesContent":["import { Country, Region } from \"./countries\";\r\n\r\nexport interface BranchInDB {\r\n id: string;\r\n name: string;\r\n address: string;\r\n secondLineAddress?: string;\r\n city: string;\r\n region: Region;\r\n zipcode: number;\r\n country: Country;\r\n status: 'active' | 'tmpClosed' | 'closed';\r\n createdAt: string;\r\n}\r\n\r\n/**\r\n * Enlace de la sucursal en otro documento\r\n */\r\nexport interface BranchFK {\r\n id: string;\r\n name: string;\r\n}\r\n"]}
package/dist/company.js CHANGED
@@ -1,2 +1,3 @@
1
1
  ;
2
2
  export {};
3
+ //# sourceMappingURL=company.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company.js","sourceRoot":"","sources":["../src/company.ts"],"names":[],"mappings":"AAUC,CAAC","sourcesContent":["export interface Company {\r\n id: string;\r\n displayName: string;\r\n verfied: boolean;\r\n createdAt: string;\r\n}\r\n\r\nexport interface CompanyFK {\r\n id: string;\r\n displayName: string;\r\n};"]}
package/dist/countries.js CHANGED
@@ -1,4 +1,4 @@
1
- export const Countries = [
1
+ export var Countries = [
2
2
  {
3
3
  id: 'HN',
4
4
  name: 'Honduras',
@@ -24,7 +24,7 @@ export const Countries = [
24
24
  ccy: 'USD'
25
25
  },
26
26
  ];
27
- export const Regions = {
27
+ export var Regions = {
28
28
  HN: [
29
29
  {
30
30
  id: "AT",
@@ -191,5 +191,6 @@ export function getRegionsByCountryId(id) {
191
191
  * @param c2
192
192
  * @returns
193
193
  */
194
- export const compareCountries = (c1, c2) => c1 && c2 ? c1.id === c2.id : false;
195
- export const compareRegions = (r1, r2) => r1 && r2 ? r1.id === r2.id : false;
194
+ export var compareCountries = function (c1, c2) { return c1 && c2 ? c1.id === c2.id : false; };
195
+ export var compareRegions = function (r1, r2) { return r1 && r2 ? r1.id === r2.id : false; };
196
+ //# sourceMappingURL=countries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.js","sourceRoot":"","sources":["../src/countries.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,IAAM,SAAS,GAAc;IAClC;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,KAAK;KACX;IAED;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,KAAK;KACX;IAED;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,KAAK;KACX;IAED;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,KAAK;KACX;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAA6C;IAC/D,EAAE,EAAE;QACF;YACE,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE;gBACN,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/C,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAClD,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC9C,EAAE,EAAE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AAC","sourcesContent":["import { PaymentInDB } from \"./payments\";\r\n\r\nexport interface Country {\r\n id: 'HN' | 'US' | 'SV' | 'CN';\r\n name: string;\r\n ccy: PaymentInDB['ccy'];\r\n code: number | null | undefined;\r\n}\r\n\r\nexport interface City {\r\n id: string;\r\n name: string;\r\n regionId: string;\r\n}\r\n\r\nexport interface Region {\r\n id: string;\r\n name: string;\r\n cities?: City[];\r\n}\r\n\r\nexport const Countries: Country[] = [\r\n {\r\n id: 'HN',\r\n name: 'Honduras',\r\n code: 504,\r\n ccy: 'HNL'\r\n },\r\n\r\n {\r\n id: 'SV',\r\n name: 'El Salvador',\r\n code: 503,\r\n ccy: 'USD'\r\n },\r\n\r\n {\r\n id: 'US',\r\n name: 'Estados Unidos',\r\n code: 1,\r\n ccy: 'USD',\r\n },\r\n\r\n {\r\n id: 'CN',\r\n name: 'China',\r\n code: 56,\r\n ccy: 'USD'\r\n },\r\n];\r\n\r\nexport const Regions: {[countryId in Country['id']]: Region[]} = {\r\n HN: [\r\n {\r\n id: \"AT\",\r\n name: \"Atlántida\",\r\n cities: [\r\n { id: \"LCB\", name: \"La Ceiba\", regionId: \"AT\" },\r\n { id: \"ELP\", name: \"El Porvenir\", regionId: \"AT\" },\r\n { id: \"ESP\", name: \"Esparta\", regionId: \"AT\" },\r\n { id: \"JUT\", name: \"Jutiapa\", regionId: \"AT\" },\r\n { id: \"LAM\", name: \"La Masica\", regionId: \"AT\" },\r\n { id: \"SFR\", name: \"San Francisco\", regionId: \"AT\" },\r\n { id: \"TEL\", name: \"Tela\", regionId: \"AT\" },\r\n { id: \"ARI\", name: \"Arizona\", regionId: \"AT\" }\r\n ]\r\n },\r\n {\r\n id: \"CH\",\r\n name: \"Choluteca\",\r\n cities: [\r\n\r\n ]\r\n },\r\n { id: \"CL\", name: \"Colón\" },\r\n { id: \"CM\", name: \"Comayagua\" },\r\n { id: \"CP\", name: \"Copán\" },\r\n { id: \"CR\", name: \"Cortés\" },\r\n { id: \"EP\", name: \"El Paraíso\" },\r\n {\r\n id: \"FM\",\r\n name: \"Francisco Morazán\",\r\n cities: [\r\n { id: \"TGU\", name: \"Tegucigalpa\", regionId: \"FM\" },\r\n { id: \"AMA\", name: \"Amarateca\", regionId: \"FM\" },\r\n { id: \"AZA\", name: \"Azacualpa\", regionId: \"FM\" },\r\n { id: \"CAR\", name: \"Carpinteron\", regionId: \"FM\" },\r\n { id: \"CEN\", name: \"Cerro Grande\", regionId: \"FM\" },\r\n { id: \"COA\", name: \"Coa Abajo\", regionId: \"FM\" },\r\n { id: \"COU\", name: \"Coa Arriba\", regionId: \"FM\" }, // id corregido\r\n { id: \"COF\", name: \"Cofradía\", regionId: \"FM\" },\r\n { id: \"CON\", name: \"Concepción de Río Grande\", regionId: \"FM\" },\r\n { id: \"ELN\", name: \"El Naranjal\", regionId: \"FM\" },\r\n { id: \"EPI\", name: \"El Piliguín\", regionId: \"FM\" },\r\n { id: \"TIZ\", name: \"El Tizatillo\", regionId: \"FM\" },\r\n { id: \"GER\", name: \"Germania\", regionId: \"FM\" },\r\n { id: \"GUA\", name: \"Guangololo\", regionId: \"FM\" },\r\n { id: \"GUS\", name: \"Guasculile\", regionId: \"FM\" },\r\n { id: \"JAC\", name: \"Jacaleapa\", regionId: \"FM\" },\r\n { id: \"JUT\", name: \"Jutiapa\", regionId: \"FM\" },\r\n { id: \"CAL\", name: \"La Calera\", regionId: \"FM\" },\r\n { id: \"CU2\", name: \"La Cuesta No.2\", regionId: \"FM\" },\r\n { id: \"MON\", name: \"La Montañita\", regionId: \"FM\" },\r\n { id: \"SAB\", name: \"La Sábana\", regionId: \"FM\" },\r\n { id: \"VEN\", name: \"La Venta\", regionId: \"FM\" },\r\n { id: \"CAS\", name: \"Las Casitas\", regionId: \"FM\" },\r\n { id: \"FLO\", name: \"Las Flores\", regionId: \"FM\" },\r\n { id: \"TAP\", name: \"Las Tapias\", regionId: \"FM\" },\r\n { id: \"JUT2\", name: \"Los Jutes\", regionId: \"FM\" },\r\n { id: \"MAT\", name: \"Mateo\", regionId: \"FM\" },\r\n { id: \"RED\", name: \"Monte Redondo\", regionId: \"FM\" },\r\n { id: \"NAL\", name: \"Nueva Aldea\", regionId: \"FM\" },\r\n { id: \"RAB\", name: \"Río Abajo\", regionId: \"FM\" },\r\n { id: \"RHO\", name: \"Río Hondo\", regionId: \"FM\" },\r\n { id: \"SOR\", name: \"San Francisco de Soroguara\", regionId: \"FM\" },\r\n { id: \"SJC\", name: \"San Juancito\", regionId: \"FM\" },\r\n { id: \"SJR\", name: \"San Juan del Rancho\", regionId: \"FM\" },\r\n { id: \"SRG\", name: \"San Juan del Río Grande\", regionId: \"FM\" },\r\n { id: \"SMT\", name: \"San Matías\", regionId: \"FM\" },\r\n { id: \"SCA\", name: \"Santa Cruz Abajo\", regionId: \"FM\" },\r\n { id: \"SCR\", name: \"Santa Cruz Arriba\", regionId: \"FM\" },\r\n { id: \"SAR\", name: \"Santa Rosa\", regionId: \"FM\" },\r\n { id: \"SRO\", name: \"Soroguara\", regionId: \"FM\" },\r\n { id: \"TAM\", name: \"Támara\", regionId: \"FM\" },\r\n { id: \"VNU\", name: \"Villa Nueva\", regionId: \"FM\" },\r\n { id: \"YAG\", name: \"Yaguacire\", regionId: \"FM\" },\r\n { id: \"ZAM\", name: \"Zambrano\", regionId: \"FM\" }\r\n ]\r\n },\r\n { id: \"GD\", name: \"Gracias a Dios\" },\r\n { id: \"IN\", name: \"Intibucá\" },\r\n { id: \"IB\", name: \"Islas de la Bahía\" },\r\n { id: \"LP\", name: \"La Paz\" },\r\n { id: \"LE\", name: \"Lempira\" },\r\n { id: \"OC\", name: \"Ocotepeque\" },\r\n { id: \"OL\", name: \"Olancho\" },\r\n { id: \"SB\", name: \"Santa Bárbara\" },\r\n { id: \"VA\", name: \"Valle\" },\r\n { id: \"YO\", name: \"Yoro\" }\r\n ],\r\n\r\n US: [\r\n { id: \"AL\", name: \"Alabama\" },\r\n { id: \"AK\", name: \"Alaska\" },\r\n { id: \"AZ\", name: \"Arizona\" },\r\n { id: \"AR\", name: \"Arkansas\" },\r\n { id: \"CA\", name: \"California\" },\r\n { id: \"CO\", name: \"Colorado\" },\r\n { id: \"CT\", name: \"Connecticut\" },\r\n { id: \"DE\", name: \"Delaware\" },\r\n { id: \"FL\", name: \"Florida\" },\r\n { id: \"GA\", name: \"Georgia\" },\r\n { id: \"HI\", name: \"Hawaii\" },\r\n { id: \"ID\", name: \"Idaho\" },\r\n { id: \"IL\", name: \"Illinois\" },\r\n { id: \"IN\", name: \"Indiana\" },\r\n { id: \"IA\", name: \"Iowa\" },\r\n { id: \"KS\", name: \"Kansas\" },\r\n { id: \"KY\", name: \"Kentucky\" },\r\n { id: \"LA\", name: \"Louisiana\" },\r\n { id: \"ME\", name: \"Maine\" },\r\n { id: \"MD\", name: \"Maryland\" },\r\n { id: \"MA\", name: \"Massachusetts\" },\r\n { id: \"MI\", name: \"Michigan\" },\r\n { id: \"MN\", name: \"Minnesota\" },\r\n { id: \"MS\", name: \"Mississippi\" },\r\n { id: \"MO\", name: \"Missouri\" },\r\n { id: \"MT\", name: \"Montana\" },\r\n { id: \"NE\", name: \"Nebraska\" },\r\n { id: \"NV\", name: \"Nevada\" },\r\n { id: \"NH\", name: \"New Hampshire\" },\r\n { id: \"NJ\", name: \"New Jersey\" },\r\n { id: \"NM\", name: \"New Mexico\" },\r\n { id: \"NY\", name: \"New York\" },\r\n { id: \"NC\", name: \"North Carolina\" },\r\n { id: \"ND\", name: \"North Dakota\" },\r\n { id: \"OH\", name: \"Ohio\" },\r\n { id: \"OK\", name: \"Oklahoma\" },\r\n { id: \"OR\", name: \"Oregon\" },\r\n { id: \"PA\", name: \"Pennsylvania\" },\r\n { id: \"RI\", name: \"Rhode Island\" },\r\n { id: \"SC\", name: \"South Carolina\" },\r\n { id: \"SD\", name: \"South Dakota\" },\r\n { id: \"TN\", name: \"Tennessee\" },\r\n { id: \"TX\", name: \"Texas\" },\r\n { id: \"UT\", name: \"Utah\" },\r\n { id: \"VT\", name: \"Vermont\" },\r\n { id: \"VA\", name: \"Virginia\" },\r\n { id: \"WA\", name: \"Washington\" },\r\n { id: \"WV\", name: \"West Virginia\" },\r\n { id: \"WI\", name: \"Wisconsin\" },\r\n { id: \"WY\", name: \"Wyoming\" }\r\n ],\r\n\r\n SV: [\r\n { id: \"AH\", name: \"Ahuachapán\" },\r\n { id: \"CA\", name: \"Cabañas\" },\r\n { id: \"CH\", name: \"Chalatenango\" },\r\n { id: \"CU\", name: \"Cuscatlán\" },\r\n { id: \"LI\", name: \"La Libertad\" },\r\n { id: \"PA\", name: \"La Paz\" },\r\n { id: \"ONU\", name: \"La Unión\" },\r\n { id: \"MO\", name: \"Morazán\" },\r\n { id: \"SM\", name: \"San Miguel\" },\r\n { id: \"SS\", name: \"San Salvador\" },\r\n { id: \"SV\", name: \"San Vicente\" },\r\n { id: \"SA\", name: \"Santa Ana\" },\r\n { id: \"SO\", name: \"Sonsonate\" },\r\n { id: \"US\", name: \"Usulutan\" }\r\n ],\r\n\r\n CN: []\r\n}\r\n\r\nexport function getRegionsByCountryId(id: 'HN' | 'US' | 'SV'): Region[] | any[] {\r\n return Regions[id];\r\n}\r\n\r\n/**\r\n * Usado en el atributo [compareWith] de los mat-select's\r\n * de los formularios que manejan paises y regiones.\r\n * @param c1 \r\n * @param c2 \r\n * @returns \r\n */\r\nexport const compareCountries = (c1: Country, c2: Country) => c1 && c2 ? c1.id === c2.id : false;\r\nexport const compareRegions = (r1: Region, r2: Region) => r1 && r2 ? r1.id === r2.id : false;"]}
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ export * from './users';
15
15
  export * from './warehouses';
16
16
  export * from './translations';
17
17
  export * from './company';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAe;AAEf,+BAA+B;AAC/B,uDAAuD;AACvD,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC","sourcesContent":["// src/index.ts\r\n\r\n/** ID único para un usuario */\r\n// export type UserId = string & { __brand: 'UserId' };\r\nexport * from './api';\r\nexport * from './bag';\r\nexport * from './branch';\r\nexport * from './countries';\r\nexport * from './orders';\r\nexport * from './stats';\r\nexport * from './payments';\r\nexport * from './product-category';\r\nexport * from './products';\r\nexport * from './replenishment';\r\nexport * from './users';\r\nexport * from './warehouses';\r\nexport * from './translations';\r\nexport * from './company';\r\n\r\n"]}
package/dist/orders.js CHANGED
@@ -7,3 +7,4 @@
7
7
  ;
8
8
  ;
9
9
  export {};
10
+ //# sourceMappingURL=orders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.js","sourceRoot":"","sources":["../src/orders.ts"],"names":[],"mappings":"AAO4E,CAAC;AAgB5E,CAAC;AAID,CAAC;AAMD,CAAC;AAUD,CAAC;AA2CD,CAAC;AAiBD,CAAC;AAQD,CAAC","sourcesContent":["import { PaymentIntent } from \"@stripe/stripe-js\";\r\nimport { ProductWithVariantInBag } from \"./bag\";\r\nimport { UserAddressInDB } from \"./users\";\r\nimport { Country } from \"./countries\";\r\nimport { CategoryType } from \"./product-category\";\r\nimport { DeliveryMethod } from \"./warehouses\";\r\n\r\nexport interface Gift { fullname: string; msg?: string | null | undefined; };\r\n\r\nexport interface OrderDiscount {\r\n id: string;\r\n name: string;\r\n subtitle: string;\r\n code: string;\r\n automatic?: boolean;\r\n amount: number;\r\n isPercent: boolean;\r\n condition: 'first_order' | 'delivery_free' | 'none' | 'student' | 'share_5_friends';\r\n conditionDescription: string;\r\n categoriesTypes?: CategoryType['type'][];\r\n minOrderAmount?: number;\r\n dueDate: string;\r\n public?: boolean;\r\n};\r\n\r\nexport interface OrderDiscountApplied extends OrderDiscount {\r\n amountInCurrentCcy?: number;\r\n};\r\n\r\nexport interface ProductPrepared {\r\n productId: string;\r\n variantId: string;\r\n qty: number;\r\n};\r\n\r\n/**\r\n * Indicará qué productos de {@link OrderInDB.products} fueron ordenados y cuales fueron preparados\r\n */\r\nexport interface ProductCheckedAfterPrepared {\r\n productId: string;\r\n variantId: string;\r\n qtyOrdered: number;\r\n qtyPrepared: number;\r\n};\r\n\r\nexport interface OrderInDB {\r\n id: string;\r\n customerName: string;\r\n customerId: string;\r\n customerCountry: Country;\r\n\r\n products: ProductWithVariantInBag[];\r\n /**\r\n * Indicará qué productos de {@link products} fueron preparados y cuantas unidades.\r\n */\r\n productsPrepared?: ProductPrepared[];\r\n\r\n subtotalPrice: number;\r\n subtotalWithDiscount: number;\r\n totalPrice: number;\r\n shippingPrice: number;\r\n discounts?: OrderDiscountApplied[];\r\n \r\n status: 'pending' | 'payment_error' | 'processing' | 'prepared' | 'shipped' | 'delivered' | 'canceled';\r\n orderDate: string;\r\n deliveryAddress: UserAddressInDB;\r\n paymentStatus?: PaymentIntent.Status,\r\n paymentMethod: 'credit_card' | 'paypal' | 'bank_transfer' | 'cash_on_delivery';\r\n shippingMethod: DeliveryMethod;\r\n gift?: Gift,\r\n notes?: string;\r\n}\r\n\r\nexport type OrderErrorCodes = 'ERR_CREATE_ORDER' | 'ERR_ORDER_INFO' | 'ERR_CHANGE_ORDER_STATUS';\r\n\r\n\r\n/**\r\n * Interfaz para comunicación con la API\r\n */\r\nexport interface ConfirmOrderPayload {\r\n orderReadyToPay: OrderReady;\r\n customerCountry: Country;\r\n paymentMethod: OrderInDB['paymentMethod'];\r\n shippingMethod: OrderInDB['shippingMethod'];\r\n deliveryAddress: OrderInDB['deliveryAddress'];\r\n gift?: Gift;\r\n};\r\n\r\n/**\r\n * Orden lista para que el usuario decida pagar\r\n */\r\nexport interface OrderReady {\r\n warehouseId: string;\r\n warehouseCountryId: Country['id'];\r\n products: ProductWithVariantInBag[];\r\n paymentMethod?: OrderInDB['paymentMethod'];\r\n shippingMethod?: DeliveryMethod;\r\n deliveryAddress?: UserAddressInDB;\r\n gift?: { fullname: string; msg?: string | null | undefined; };\r\n subtotalPrice: number;\r\n shippingPrice: number;\r\n subtotalWithDiscount: number;\r\n totalPrice: number;\r\n};\r\n\r\n\r\n/**\r\n * Ordenes listas para que el usuario decida pagar\r\n */\r\nexport interface OrdersReady {\r\n [warehouseId: string]: OrderReady;\r\n};\r\n"]}
package/dist/org/event.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/org/event.ts"],"names":[],"mappings":"","sourcesContent":["export interface NiceEvent {\r\n id: string;\r\n title: string;\r\n description: string;\r\n inPerson: boolean;\r\n organizerName: string;\r\n createdBy: {\r\n id: string;\r\n name: string;\r\n };\r\n location: string;\r\n coverUrl?: string;\r\n startDate: Date;\r\n endDate: Date;\r\n createdAt: string;\r\n updatedAt?: string;\r\n }"]}
@@ -1,3 +1,2 @@
1
- export interface PruebaOrg {
2
- name: string;
3
- }
1
+ export * from './event';
2
+ export { Donation } from './radar';
package/dist/org/index.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export * from './event';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/org/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './event';\r\nexport {Donation} from './radar';"]}
package/dist/org/radar.js CHANGED
@@ -1,3 +1,4 @@
1
1
  ;
2
2
  ;
3
3
  export {};
4
+ //# sourceMappingURL=radar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radar.js","sourceRoot":"","sources":["../../src/org/radar.ts"],"names":[],"mappings":"AAuDG,CAAC;AA8BD,CAAC","sourcesContent":["import { PaymentIntent } from \"@stripe/stripe-js\";\r\n\r\nexport type Currency = 'HNL' | 'EUR' | 'USD';\r\n export type DonationStatus = 'pending_pay' | 'pending' | 'payment_error' | 'processing' | 'resolve' | 'rejected' | 'expired' | 'used';\r\n \r\n /**\r\n * Tipos de donaciones usadas en el radar\r\n * \r\n * Valores posibles:\r\n * - `direct_donation`: Donación directa a una persona\r\n * - `event`: Evento\r\n * - `operating_expenses`: Gastos operativos\r\n */\r\n export type UsedIn = 'direct_donation' | 'event' | 'operating_expenses';\r\n \r\n /**\r\n * Tipos de movimientos del radar\r\n *\r\n * Valores posibles:\r\n * - `info`: Movimiento informativo\r\n * - `cash_converted_to_hnl`: Convertido a lempiras\r\n * - `cash_income`: Ingreso\r\n * - `cash_expense`: Gasto\r\n * - `cash_refund`: Reembolso\r\n * - `cash_reversion`: Reversión\r\n *\r\n * @remarks\r\n * El reembolso es para el cliente, mientras que la reversión\r\n * es para devolver el dinero a la donación original.\r\n */\r\n export type FlowType = 'info' | 'cash_converted_to_hnl' | 'cash_income' | 'cash_expense' | 'cash_refund' | 'cash_reversion';\r\n \r\n export interface Movement {\r\n id: string;\r\n title: string;\r\n desc?: string;\r\n /**\r\n * Tipos de donaciones usadas en el radar\r\n * \r\n * Valores posibles:\r\n * - `direct_donation`: Donación directa a una persona\r\n * - `event`: Evento\r\n * - `operating_expenses`: Gastos operativos\r\n */\r\n usedIn: UsedIn;\r\n icon: 'ok' | 'error' | 'info' | 'waiting';\r\n type: FlowType;\r\n \r\n /**\r\n * Monto involucrado en el movimiento,\r\n * se debe proporcionar `0` cuándo {@link FlowType} sea `none`.\r\n * Ej. `amount: 0`\r\n */\r\n amount: number;\r\n createdAt: string;\r\n };\r\n \r\n export interface DonationCharges {\r\n subtotal: number;\r\n fees: number;\r\n total: number;\r\n }\r\n \r\n /**\r\n * La donación se puede recibir en HNL, USD o EUR,\r\n * pero se deberá convertir a lempiras antes de ser usada.\r\n */\r\n export interface Donation {\r\n id: string;\r\n donorId: string;\r\n fullname: string,\r\n anonymous: boolean;\r\n charges: DonationCharges;\r\n \r\n /**\r\n * Cuándo se reciba en una moneda distinta de HNL, se convertirá a HNL.\r\n * De lo contrario será `undefined`\r\n */\r\n chargesInHNL?: DonationCharges;\r\n status: DonationStatus;\r\n mainCcy: Currency;\r\n paymentStatus?: PaymentIntent.Status;\r\n \r\n radar?: { [movementId: string]: Movement };\r\n createdAt?: string;\r\n };"]}
package/dist/payments.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.js","sourceRoot":"","sources":["../src/payments.ts"],"names":[],"mappings":"","sourcesContent":["import { Metadata, PaymentIntent } from \"@stripe/stripe-js\";\r\n\r\n\r\n/**\r\n * Payment como está registrado en la base de datos\r\n */\r\nexport interface PaymentInDB {\r\n /**\r\n * @property {string} `id`\r\n * mismo que `Stripe.PaymentIntent.id`\r\n */\r\n id: string;\r\n\r\n /**\r\n * @property {@link Issuer} `recipientMap`\r\n * Quién pagó\r\n */\r\n issuerMap: { id: string; displayName: string; };\r\n\r\n /**\r\n * @property {number} `amount`\r\n * Monto a pagar, incluyendo impuestos, tarifas y comisiones.\r\n */\r\n amount: number;\r\n\r\n /**\r\n * @property {number} `tax`\r\n * Impuesto de la transacción, basado en EEUU.\r\n */\r\n tax: 8.25;\r\n\r\n /**\r\n * @property ccy {@link PaymentCCY}\r\n * Moneda en la que se ejecutará el pago.\r\n */\r\n ccy: 'HNL' | 'USD' | 'EUR';\r\n\r\n /**\r\n * @property {Timestamp} `createdAt`\r\n * Fecha y hora en que se generó la transacción,\r\n * igual que `Stripe.PaymentIntent.created`.\r\n */\r\n createdAt: string;\r\n}\r\n\r\n\r\n/**\r\n * Parámetros que se enviarán al servidor,\r\n * y así registrar el PaymentIntent con stripe.\r\n */\r\nexport interface StripePaymentIntentParams {\r\n cardHolder: string | string | null | undefined;\r\n billingAddressLine1: string | string | null | undefined;\r\n billingAddressCity: string | string | null | undefined;\r\n amount: number;\r\n currency: string;\r\n metadata: PaymentInStripeMetadata;\r\n}\r\n\r\nexport interface PaymentInStripeMetadata {\r\n /** Ej. users/{userId}/orders/{orderId} */\r\n refDB: string;\r\n issuerId: string;\r\n issuerName: string;\r\n}\r\n\r\n/**\r\n * Respuesta de la API Ivife cuándo se busca un PaymentIntent por su {@link StripeMetadata.refId}\r\n */\r\nexport interface StripePaymentIntentResponse {\r\n metadata: PaymentInStripeMetadata | Metadata;\r\n status: PaymentIntent.Status;\r\n amount: number;\r\n amount_capturable: number;\r\n amount_received: number;\r\n currency: string;\r\n}\r\n\r\nexport type PaymentErrorCodes = 'ERR_PAYMENT' | 'ERR_REINTENT_PAYMENT' | 'authentication_required' | 'requires_action';"]}
@@ -1,2 +1,3 @@
1
1
  ;
2
2
  export {};
3
+ //# sourceMappingURL=product-category.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-category.js","sourceRoot":"","sources":["../src/product-category.ts"],"names":[],"mappings":"AAiCC,CAAC","sourcesContent":["import { Country } from \"./countries\";\r\nimport { Translations } from \"./translations\";\r\n\r\nexport interface Category {\r\n id: string;\r\n title: string;\r\n translations?: Translations<string>;\r\n icon?: string;\r\n subcategories?: SubCategory[];\r\n hidden?: boolean;\r\n adultsOnly?: boolean;\r\n}\r\n\r\nexport interface SubCategory {\r\n id: string;\r\n title: string;\r\n translations?: Translations<string>;\r\n}\r\n\r\nexport interface CategoryType {\r\n title: string;\r\n type: 'clothes' |'gifts' | 'perfumes' | 'electric' | 'electronics' | 'handmade-jewelry' | 'jewelry' | 'home' | 'beauty' | 'health' | 'books' | 'shoes' | 'bags';\r\n translations?: Translations<string>;\r\n icon?: string;\r\n categories: Category[];\r\n countries: Country['id'][];\r\n hidden?: boolean;\r\n}\r\n\r\n\r\nexport interface ProductCategoryInDB {\r\n id: string;\r\n subcategory: string\r\n};"]}
package/dist/products.js CHANGED
@@ -4,3 +4,4 @@
4
4
  ;
5
5
  ;
6
6
  export {};
7
+ //# sourceMappingURL=products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.js","sourceRoot":"","sources":["../src/products.ts"],"names":[],"mappings":"AAMmF,CAAC;AAChB,CAAC;AAQpE,CAAC;AA6CgE,CAAC;AAyDlE,CAAC","sourcesContent":["import { CompanyFK } from \"./company\";\r\nimport { Country } from \"./countries\";\r\nimport { CategoryType, ProductCategoryInDB } from \"./product-category\";\r\nimport { RProduct, RSupplier } from \"./replenishment\";\r\nimport { Translations } from \"./translations\";\r\n\r\nexport interface ProductFirstOptionTypeValue { value: string; codeColor?: string; };\r\nexport interface ProductOptionValue { value: string, code?: string };\r\n\r\ntype clothesOptions = 'talla' | 'color';\r\ntype giftsOptions = 'color' | 'tipo de flor';\r\n\r\nexport interface ProductOptionToSelect {\r\n option: clothesOptions | giftsOptions;\r\n valuesAllowed: ProductOptionValue[];\r\n};\r\n\r\n/**\r\n * Igual que store-product-in-db.ts del proyecto `Zavafa`\r\n */\r\nexport interface ProductInDB {\r\n id: string; // ID único del producto principal\r\n name: string; // Nombre del producto\r\n nameTranslations?: Translations<string>;\r\n description: string; // Descripcion del producto\r\n descriptionTranslations?: Translations<string>;\r\n category: ProductCategoryInDB; // Categoría del producto (ej. \"Electrónica\", \"Ropa\")\r\n brand: string | null | undefined; // Marca del producto (opcional)\r\n coverImg?: ProductVariantImage;\r\n type: CategoryType['type'];\r\n soldBy: CompanyFK;\r\n adultsOnly?: boolean; // Indica si el producto es para adultos\r\n shipmentsTo?: { [countryId in Country['id']]: boolean }; // Países(s) a donde se envia el producto\r\n\r\n countries?: { [key: string]: boolean }; // Países(s) donde se almacena el producto\r\n warrantyInDays?: number;\r\n\r\n /**\r\n * Opciones con las que se identificará cada variante de este producto,\r\n * serán establecidas por el usuario.\r\n * \r\n * Máximo 2.\r\n * @example: Talla, Color, Onzas, etc. Y todos sus valores posibles.\r\n */\r\n optionsToSelect: ProductOptionToSelect[]; // Máximo 2 opciones\r\n /** Peso en libras */\r\n weightLbs?: number;\r\n status: 'active' | 'inactive' | 'discontinued'; // Estado del producto\r\n tags: string[]; // Etiquetas por las cuáles los usuarios pueden buscar este producto\r\n createdAt: any; // Fecha de creación en formato ISO 8601\r\n updatedAt?: string; // Última actualización en formato ISO 8601\r\n \r\n createdBy: { id: string; displayName: string; }; // Usuario que creó el producto\r\n updatedBy?: { id: string; displayName: string; }; // Usuario que actualizó el producto\r\n}\r\n\r\n\r\n/**\r\n * /products/{productId}/variants/{sku}\r\n */\r\nexport interface ProductVariantImage { url: string, path: string };\r\nexport interface ProductVariantInDB {\r\n /** Este es el SKU */\r\n id?: string; \r\n supplier: RSupplier;\r\n supplierVariantId: RProduct['supplierVariantId'];\r\n productId?: string;\r\n images?: ProductVariantImage[];\r\n barcode?: string;\r\n\r\n /**\r\n * Packages dónde está la variante\r\n */\r\n inPackages?: { packageId: string; orderId: string }[];\r\n\r\n /**\r\n * Warehouses dónde está disponible esta variante.\r\n * Cada ```key``` del objeto es el id del warehouse y su valor será {@link VariantWarehouseFK}.\r\n * \r\n * @note Se usa esta nueva manera para poder usar los FieldValue (serverTimestamp, etc) de Firestore,\r\n * ya que en los arrays no funcionan.\r\n */\r\n warehouses: {\r\n [key: string]: VariantWarehouseFK\r\n };\r\n\r\n /**\r\n * Opciones de la variante, por ejemplo una prenda tiene color y talla.\r\n * Obligatoriamente tiene que tener al menos una opción.\r\n * \r\n * @note {@link secondOptionType} NO puede ser de tipo 'color'\r\n */\r\n selectedOptions: {\r\n option: ProductOptionToSelect['option'];\r\n value: { value: string; code?: string };\r\n }[];\r\n}\r\n\r\n/**\r\n * La forma en que se enlaza información del producto en determinada warehouse,\r\n * esta información va adentro de la variante.\r\n * \r\n * /products/{id}/variants/{id}\r\n */\r\nexport interface VariantWarehouseFK {\r\n id: string;\r\n name: string;\r\n stock: number; // Cantidad disponible en inventario\r\n price: number; // Precio de esta variante (puede ser diferente del basePrice)\r\n priceUSD: number; // Precio de esta variante (puede ser diferente del basePrice)\r\n lastPrice?: number; // Último precio de esta variante usado para descuentos o reducciones de precio\r\n lastPriceUSD?: number; // Último precio de esta variante usado para descuentos o reducciones de precio\r\n supplierPriceUSD: number;\r\n supplierPriceHNL: number;\r\n profitMarginUSD: number;\r\n profitMarginHNL: number;\r\n profitMarginPercent: number;\r\n};\r\n\r\n/**\r\n * Para poder mostrar las variantes agrupadas\r\n * \r\n * Ej. Verde / S, Verde / M, etc\r\n */\r\nexport interface ProductGroupVariant {\r\n variant: ProductVariantInDB,\r\n /** Indica si la información se cargó desde el servidor o se creó automaticamente */\r\n dataFromServer: boolean;\r\n}"]}
@@ -3,3 +3,4 @@
3
3
  ;
4
4
  ;
5
5
  export {};
6
+ //# sourceMappingURL=replenishment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replenishment.js","sourceRoot":"","sources":["../src/replenishment.ts"],"names":[],"mappings":"AAOC,CAAC;AAyBD,CAAC;AA+BD,CAAC;AAqBD,CAAC","sourcesContent":["import { ProductVariantInDB } from \"./products\";\r\nimport { WarehouseInDB } from \"./warehouses\";\r\n\r\n\r\nexport interface RSupplier {\r\n id: string;\r\n name: string;\r\n};\r\n\r\n/**\r\n * Productos de la orden de reabastecimiento realizada al proveedor\r\n */\r\nexport interface RProduct {\r\n id?: string;\r\n productId: string;\r\n variantId: string;\r\n packageId: string;\r\n selectedOptions: ProductVariantInDB['selectedOptions'];\r\n newStock: number;\r\n supplier: RSupplier;\r\n\r\n /** Id que usa el proveedor para manejar este producto en su sistema */\r\n supplierVariantId: string;\r\n /**\r\n * Fecha de registro de el paquete en el sistema\r\n */\r\n createdAt?: string;\r\n /**\r\n * Si no tiene rPackageId se considera un\r\n * producto de la misma orden pero huérfano\r\n */\r\n rPackageId?: string;\r\n};\r\n\r\nexport interface ROrder {\r\n /**\r\n * Id único interno\r\n */\r\n id?: string;\r\n\r\n /**\r\n * Número de orden del proveedor\r\n * \r\n * Este es el número de orden con el que\r\n * el proveedor da seguimiento a la orden.\r\n */\r\n supplierOrderId: string;\r\n supplier: RSupplier;\r\n totalValue: number;\r\n packsQty: number;\r\n\r\n /**\r\n * Almacén final que recibirá la orden.\r\n * Es donde se pondrán en venta los productos o desde dónde\r\n * se distribuirán al resto de almacenes.\r\n */\r\n warehouseDestination: Pick<WarehouseInDB, 'id' | 'name'>;\r\n \r\n /**\r\n * Moneda siempre será USD\r\n */\r\n ccy: 'USD';\r\n createdAt: string;\r\n};\r\n\r\nexport interface RPackageHistory {\r\n title: string;\r\n /**\r\n * Si esta en el JSON, entonces ya se llegó al `ROrder['warehouseDestination']` requerido.\r\n */\r\n warehouseDestination?: ROrder['warehouseDestination'];\r\n mode: 'on-the-way' | 'arrived' | 'info';\r\n \r\n /**\r\n * Nombre de la empresa que realiza el envío desde {@link from}\r\n * @example UPS, FedEx, SerCargo, etc\r\n */\r\n shippingCompany?: string | null;\r\n trackingURL?: string | null;\r\n icon?: string;\r\n /**\r\n * Fecha en la que se registró el evento\r\n */\r\n createdAt: string;\r\n};\r\n\r\nexport interface RPackage {\r\n id: string;\r\n\r\n /**\r\n * Id de {@link ROrder}\r\n */\r\n orderId: string;\r\n itemsQty: number;\r\n historyTracking: RPackageHistory[],\r\n\r\n /**\r\n * Detalles adicionales sobre el paquete\r\n */\r\n notes?: string;\r\n\r\n /**\r\n * Usuario que registró el paquete\r\n */\r\n createdBy: {\r\n id: string;\r\n displayName: string;\r\n };\r\n\r\n /**\r\n * Fecha de registro de el paquete en el sistema\r\n */\r\n createdAt: string;\r\n}\r\n"]}
package/dist/stats.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../src/stats.ts"],"names":[],"mappings":"","sourcesContent":["export interface OrdersStats {\r\n total?: number;\r\n canceled?: number;\r\n delivered?: number;\r\n}\r\n\r\n// export interface Stats {\r\n// orders?: OrdersStats;\r\n// }\r\n\r\nexport interface UserStats {\r\n orders?: {\r\n total?: number;\r\n canceled?: number;\r\n delivered?: number;\r\n };\r\n qtyReferrals?: number;\r\n}"]}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=translations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"","sourcesContent":["export interface Translations<T = any> {\r\n [key: string]: T;\r\n}"]}
package/dist/users.js CHANGED
@@ -1,3 +1,4 @@
1
1
  ;
2
2
  ;
3
3
  export {};
4
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAcC,CAAC;AAiDD,CAAC","sourcesContent":["import { Country } from \"./countries\";\r\n\r\nexport interface User {\r\n uid: string;\r\n displayName: string;\r\n email: string;\r\n stripeCustomerId?: string;\r\n userDevices?: UserDevice[];\r\n phoneNumber?: string;\r\n photoURL?: string;\r\n referralBy?: {uid: string, displayName: string, referredAt: string};\r\n tags: string[];\r\n createdAt: string;\r\n updatedAt?: string;\r\n};\r\n\r\nexport interface UserDevice {\r\n id: string;\r\n \r\n FCMToken?: string;\r\n /**\r\n * ios | android | web\r\n */\r\n platform: string;\r\n /**\r\n * Iphone 12 | Pixel 5\r\n */\r\n model: string; \r\n /**\r\n * ios | android\r\n */\r\n operatingSystem: string;\r\n /**\r\n * 13 | 10\r\n */\r\n osVersion: string;\r\n /**\r\n * Apple | Google | Microsoft | Samsung\r\n */\r\n manufacturer: string;\r\n /**\r\n * ``true`` si es un emulador\r\n */\r\n isVirtual: boolean;\r\n /**\r\n * ``es`` | ``en``\r\n */\r\n language: string;\r\n /**\r\n * Versión de la app\r\n */\r\n appVersion: string;\r\n appBuild: string;\r\n lastLogin: string;\r\n ipSecurity?: {\r\n ip: string;\r\n type: 'IPv4' | 'IPv6';\r\n country: string;\r\n country_code: string;\r\n region: string;\r\n city: string;\r\n isp: string;\r\n }\r\n};\r\n\r\nexport interface UserAddressInDB {\r\n id: string;\r\n isDefault?: boolean;\r\n fullname: string;\r\n phone: string;\r\n address: string;\r\n references: string;\r\n region: string;\r\n city: string;\r\n country: Country | null | undefined;\r\n}\r\n\r\nexport interface UserSearch {\r\n id: string;\r\n displayName: string;\r\n uid?: string;\r\n k: string;\r\n tags: string[];\r\n createdAt: string;\r\n}"]}
@@ -1,2 +1,3 @@
1
1
  ;
2
2
  export {};
3
+ //# sourceMappingURL=warehouses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warehouses.js","sourceRoot":"","sources":["../src/warehouses.ts"],"names":[],"mappings":"AA4BC,CAAC","sourcesContent":["import { Country, Region } from \"./countries\";\r\n\r\nexport interface WarehouseInDB {\r\n id?: string; // maxLength: 36 (UUID estándar)\r\n name: string; // maxLength: 100 (nombre comercial)\r\n address: string; // maxLength: 150 (calle y número)\r\n secondLineAddress?: string | null; // maxLength: 100 (complemento opcional)\r\n city: string; // maxLength: 80 (ciudades grandes pueden ser largas)\r\n region?: Region | null; \r\n zipcode: number; // maxLength: 10 (ZIP/Postal code)\r\n country: Country; \r\n status: 'active' | 'tmpClosed' | 'closed'; // No necesita maxLength (valores fijos)\r\n /**\r\n * `key` es el id del país al que se entrega. Ej. `US`\r\n */\r\n shipmentsTo: {[countryId in Country['id']]: WarehouseDeliveryTime};\r\n createdAt: string; // ISO 8601 (maxLength: 24, e.g., \"2025-03-15T12:00:00Z\")\r\n}\r\n\r\n/**\r\n * Tiempo de entrega en días hábiles de un país a otro\r\n */\r\nexport interface WarehouseDeliveryTime {\r\n countryId: Country['id'];\r\n countryName: string;\r\n deliveryMethods: {\r\n [deliveryMethodId in DeliveryMethod['id']]: DeliveryMethod\r\n };\r\n};\r\n\r\nexport interface DeliveryMethod {\r\n id: 'standard' | 'express' | 'weekend';\r\n name: string;\r\n /**\r\n * Número de días hábiles que tarda la entrega,\r\n * se calcula y llena en `client`.\r\n */\r\n deliveryRange?: string;\r\n inBusinessDays: `${number}-${number}`; // Ej. \"3-5\"\r\n deliveryFeeInUSD: number;\r\n deliveryFeeInHNL: number;\r\n /**\r\n * El cargo en {@link deliveryFeeInUSD} y {@link deliveryFeeInHNL}\r\n * permitirá un máximo de lo indicado aquí. Si se supera el máximo,\r\n * se cobrará \r\n */\r\n maxLbPerFee: number;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n"]}
package/package.json CHANGED
@@ -1,17 +1,7 @@
1
1
  {
2
2
  "name": "@nicefer/types",
3
- "version": "1.0.216",
3
+ "version": "1.0.218",
4
4
  "description": "Tipos compartidos para Nicefer",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "exports": {
12
- ".": "./dist/index.js",
13
- "./*": "./dist/*.js"
14
- },
15
5
  "scripts": {
16
6
  "build": "tsc",
17
7
  "deploy": "tsc & npm version patch & npm publish --access public",
@@ -20,7 +10,6 @@
20
10
  "keywords": [],
21
11
  "author": "Alejandro Villatoro",
22
12
  "license": "ISC",
23
- "type": "commonjs",
24
13
  "devDependencies": {
25
14
  "@stripe/stripe-js": "^7.8.0",
26
15
  "typescript": "^5.9.2"
package/src/api.ts ADDED
@@ -0,0 +1,12 @@
1
+ export interface ApiRequest {
2
+ route: string;
3
+ auth?: boolean;
4
+ params?: any;
5
+ page?: number
6
+ };
7
+
8
+ export interface ApiResponse<Data, ErrorCodes = string> {
9
+ ok: boolean;
10
+ error?: ErrorCodes;
11
+ data?: Data;
12
+ };
package/src/bag.ts ADDED
@@ -0,0 +1,45 @@
1
+ import { OrderDiscountApplied } from "./orders";
2
+ import { PaymentInDB } from "./payments";
3
+ import { CategoryType } from "./product-category";
4
+ import { ProductVariantInDB } from "./products";
5
+
6
+ export interface Bag {
7
+ subtotalPrice: number;
8
+ subtotalWithDiscount: number;
9
+ totalPrice: number;
10
+ shippingPrice: number;
11
+ discounts?: OrderDiscountApplied[];
12
+ ccy: PaymentInDB['ccy'];
13
+ products: ProductWithVariantInBag[];
14
+ }
15
+
16
+ /**
17
+ * En la bolsa cada variante será independiente,
18
+ * @example Si un producto tiene 3 variantes y el usuario
19
+ * agrega cada variante, entonces se tomará como 3 productos independientes.
20
+ */
21
+ export interface ProductWithVariantInBag {
22
+ productId: string;
23
+ productName: string;
24
+
25
+ /** Heredado de {@link ProductInDB} */
26
+ weightLbs: number;
27
+
28
+ imgFullUrl: string | undefined;
29
+ categoryType: CategoryType['type'];
30
+ ccy: PaymentInDB['ccy'];
31
+
32
+ variantId: string;
33
+ warehouseId: string;
34
+
35
+ selectedOptions: ProductVariantInDB['selectedOptions'];
36
+
37
+ variantQty: number;
38
+ variantPrice: number;
39
+ variantPriceWithDiscount?: number;
40
+
41
+ createdAt: string;
42
+ updatedAt?: string;
43
+ }
44
+
45
+
package/src/branch.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { Country, Region } from "./countries";
2
+
3
+ export interface BranchInDB {
4
+ id: string;
5
+ name: string;
6
+ address: string;
7
+ secondLineAddress?: string;
8
+ city: string;
9
+ region: Region;
10
+ zipcode: number;
11
+ country: Country;
12
+ status: 'active' | 'tmpClosed' | 'closed';
13
+ createdAt: string;
14
+ }
15
+
16
+ /**
17
+ * Enlace de la sucursal en otro documento
18
+ */
19
+ export interface BranchFK {
20
+ id: string;
21
+ name: string;
22
+ }
package/src/company.ts ADDED
@@ -0,0 +1,11 @@
1
+ export interface Company {
2
+ id: string;
3
+ displayName: string;
4
+ verfied: boolean;
5
+ createdAt: string;
6
+ }
7
+
8
+ export interface CompanyFK {
9
+ id: string;
10
+ displayName: string;
11
+ };