@retaila/shared-types 1.0.2

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/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # @retaila/shared-types
2
+
3
+ Tipos compartidos para el proyecto Retail.
4
+
5
+ ## Instalación
6
+
7
+ ```bash
8
+ npm install @retaila/shared-types
9
+ ```
10
+
11
+ ## Desarrollo
12
+
13
+ ### Publicar nueva versión
14
+
15
+ ```bash
16
+ # Compilar
17
+ npm run build
18
+
19
+ # Publicar (patch/minor/major)
20
+ npm run publish:patch
21
+ npm run publish:minor
22
+ npm run publish:major
23
+ ```
24
+
25
+ ## Uso
26
+
27
+ ```typescript
28
+ import { Product, User, Order } from '@retaila/shared-types';
29
+ ```
30
+
31
+ ## Nueva Estructura Organizada por Entidad
32
+
33
+ ```
34
+ src/
35
+ ├── common/ # Tipos base compartidos (BaseEntity, etc.)
36
+ ├── product/ # Todo relacionado con productos
37
+ │ ├── types.ts # Interfaces de Product, ProductVariant, etc.
38
+ │ ├── dto.ts # DTOs para operaciones CRUD de productos
39
+ │ └── index.ts # Exportaciones de productos
40
+ ├── user/ # Todo relacionado con usuarios
41
+ │ ├── types.ts # Interfaces de User, UserAddress
42
+ │ ├── dto.ts # DTOs para operaciones CRUD de usuarios
43
+ │ └── index.ts # Exportaciones de usuarios
44
+ ├── order/ # Todo relacionado con pedidos
45
+ │ ├── types.ts # Interfaces de Order, OrderItem, etc.
46
+ │ ├── dto.ts # DTOs para operaciones CRUD de pedidos
47
+ │ └── index.ts # Exportaciones de pedidos
48
+ ├── account/ # Todo relacionado con cuentas
49
+ │ ├── types.ts # Interfaces de Account, AccountSettings
50
+ │ ├── dto.ts # DTOs para operaciones CRUD de cuentas
51
+ │ └── index.ts # Exportaciones de cuentas
52
+ └── api/ # Tipos específicos de API
53
+ ```
54
+
55
+ ## Entidades Disponibles
56
+
57
+ ### Product
58
+ - **Product**: Producto con variantes, atributos y categorías
59
+ - **ProductVariant**: Variantes de productos
60
+ - **ProductCategory**: Categorías de productos
61
+ - **ProductAttribute**: Atributos de productos
62
+ - **ProductMedia**: Medios de productos
63
+
64
+ **Enums**: ProductStatus, ProductType, WeightUnit, DimensionUnit, AttributeType, MediaType
65
+
66
+ ### User
67
+ - **User**: Usuario del sistema
68
+ - **UserAddress**: Direcciones de usuario
69
+
70
+ **Enums**: AddressType
71
+
72
+ ### Order
73
+ - **Order**: Pedido con items y direcciones
74
+ - **OrderItem**: Items de pedido
75
+ - **OrderAddress**: Direcciones de pedido
76
+
77
+ **Enums**: OrderStatus, PaymentStatus
78
+
79
+ ### Account
80
+ - **Account**: Cuenta/tienda
81
+ - **AccountSettings**: Configuraciones de cuenta
82
+ - **NotificationSettings**: Configuraciones de notificaciones
83
+ - **SeoSettings**: Configuraciones SEO
84
+
85
+ ## Cómo Funciona
86
+
87
+ Este paquete proporciona tipos TypeScript que se incorporan directamente en el build de cada aplicación:
88
+
89
+ 1. **Instalación**: `npm install file:../shared-types`
90
+ 2. **Importación**: `import { Product } from '@retail/shared-types'`
91
+ 3. **Build**: TypeScript automáticamente incluye los tipos en el build de la aplicación
92
+ 4. **No build separado**: No es necesario compilar este paquete
93
+
94
+ ## Ventajas de la Nueva Estructura
95
+
96
+ - **Organización por dominio**: Cada entidad tiene su propia carpeta con todos sus tipos relacionados
97
+ - **Fácil navegación**: Es más fácil encontrar tipos específicos de una entidad
98
+ - **Escalabilidad**: Fácil agregar nuevas entidades sin afectar las existentes
99
+ - **Mantenimiento**: Cambios en una entidad están contenidos en su carpeta
100
+ - **Importaciones más claras**: `import { Product } from '@retail/shared-types'` importa todo lo relacionado con productos
101
+
102
+ ## Contribución
103
+
104
+ 1. Agregar nuevos tipos en la carpeta de la entidad correspondiente
105
+ 2. Exportar desde el index.ts de la entidad
106
+ 3. Los cambios se reflejan inmediatamente en las aplicaciones que usen este paquete
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // shared-types/src/account/index.ts - Account entity exports
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ // Types
19
+ __exportStar(require("./types"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":";AAAA,6DAA6D;;;;;;;;;;;;;;;;AAE7D,QAAQ;AACR,0CAAwB"}
@@ -0,0 +1,28 @@
1
+ export interface Account {
2
+ id: string;
3
+ name: string;
4
+ address?: string;
5
+ logoId?: string;
6
+ currency: string;
7
+ instagram?: string;
8
+ facebook?: string;
9
+ whatsapp?: string;
10
+ phone?: string;
11
+ email: string;
12
+ timezone: string;
13
+ hasDelivery: boolean;
14
+ status: string;
15
+ themeConfig?: ThemeConfig;
16
+ privateKey?: string;
17
+ demo: boolean;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ deletedAt?: Date;
21
+ }
22
+ export interface ThemeConfig {
23
+ backgroundColor: string;
24
+ textColor: string;
25
+ primaryColor: string;
26
+ secondaryColor: string;
27
+ }
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/account/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // shared-types/src/account/types.ts - Account entity types
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/account/types.ts"],"names":[],"mappings":";AAAA,2DAA2D"}
@@ -0,0 +1,16 @@
1
+ export interface BaseEntity {
2
+ id: string;
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ deletedAt?: Date;
6
+ }
7
+ export interface BaseEntityWithAccount extends BaseEntity {
8
+ accountId: string;
9
+ }
10
+ export interface BaseEntityWithUser extends BaseEntity {
11
+ userId: string;
12
+ }
13
+ export interface BaseEntityWithAccountAndUser extends BaseEntityWithAccount {
14
+ userId: string;
15
+ }
16
+ //# sourceMappingURL=BaseEntity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEntity.d.ts","sourceRoot":"","sources":["../../src/common/BaseEntity.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACrD,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IAClD,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACvE,MAAM,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // shared-types/src/common/BaseEntity.ts - Base entity interface for all entities
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=BaseEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEntity.js","sourceRoot":"","sources":["../../src/common/BaseEntity.ts"],"names":[],"mappings":";AAAA,iFAAiF"}
@@ -0,0 +1,2 @@
1
+ export * from './BaseEntity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // shared-types/src/common/index.ts - Common types exports
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./BaseEntity"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA,0DAA0D;;;;;;;;;;;;;;;;AAE1D,+CAA6B"}
@@ -0,0 +1,3 @@
1
+ export * from './common';
2
+ export * from './account';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // shared-types/src/index.ts - Main exports for shared types package
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ // Common types
19
+ __exportStar(require("./common"), exports);
20
+ // Entity-specific exports
21
+ __exportStar(require("./account"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oEAAoE;;;;;;;;;;;;;;;;AAEpE,eAAe;AACf,2CAAyB;AAEzB,0BAA0B;AAC1B,4CAA0B"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@retaila/shared-types",
3
+ "version": "1.0.2",
4
+ "description": "Tipos compartidos para el proyecto Retail",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist/**/*"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "prepublishOnly": "npm run build",
13
+ "publish:patch": "npm version patch && npm publish",
14
+ "publish:minor": "npm version minor && npm publish",
15
+ "publish:major": "npm version major && npm publish"
16
+ },
17
+ "keywords": [
18
+ "typescript",
19
+ "types",
20
+ "retail",
21
+ "shared"
22
+ ],
23
+ "author": "Retail Team",
24
+ "license": "MIT",
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "registry": "https://registry.npmjs.org/"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.3.3"
31
+ }
32
+ }