{"_id":"@empleado-juan/commons","_rev":"5-5faafb00225acdc3e06c03e0913cda3a","name":"@empleado-juan/commons","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@empleado-juan/commons","version":"1.0.0","keywords":["shared","types","enums","validators"],"author":{"name":"Empleado Juan Team"},"license":"MIT","_id":"@empleado-juan/commons@1.0.0","maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"dist":{"shasum":"e3e6fac6adfb11a256910f490e2b00d454df8297","tarball":"https://registry.npmjs.org/@empleado-juan/commons/-/commons-1.0.0.tgz","fileCount":34,"integrity":"sha512-8ahxObD7nLyzLTmPyD+2EoOIpLxq/uW+tNs6msq4H/Y9MmCmzQ8dqlhQYUe4dbgZIeQLlSpN90hdZsnqjlNRMQ==","signatures":[{"sig":"MEQCICmvMvYujXaDfjghtsUELONls9YCyIrowfCRfgOkkHhaAiBLDK5PPLbzm87RhAgzclZcEXCnneCHKwHtO8BRPE0Xuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33734},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"},"_npmVersion":"11.7.0","description":"Shared code between frontend and backend services","directories":{},"_nodeVersion":"20.19.4","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/commons_1.0.0_1769915495190_0.277915355809246","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@empleado-juan/commons","version":"1.0.1","keywords":["shared","types","enums","validators"],"author":{"name":"Empleado Juan Team"},"license":"MIT","_id":"@empleado-juan/commons@1.0.1","maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"dist":{"shasum":"71b2df3c05dc838dea3fae33380849cdcdfba4b4","tarball":"https://registry.npmjs.org/@empleado-juan/commons/-/commons-1.0.1.tgz","fileCount":35,"integrity":"sha512-zvbDs5oXxavjnKWOhCWnWCLq69JSk+iC+JilqTTFrgMcSpEQvcuSe1BA0KHw+a9j8L+/tlQZJqog61sV3PN1eA==","signatures":[{"sig":"MEYCIQDnsZBiWjOqGMTxSMtVBid3umzj98lLBecUwM9K9sF6UwIhAJkHq3hDD8+TME3df7ZGcvJgff9cMqlJAINz9obvfJOf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37326},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"},"_npmVersion":"11.7.0","description":"Shared code between frontend and backend services","directories":{},"_nodeVersion":"20.19.4","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/commons_1.0.1_1769947585904_0.8042219275972138","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@empleado-juan/commons","version":"1.0.2","keywords":["shared","types","enums","validators"],"author":{"name":"Empleado Juan Team"},"license":"MIT","_id":"@empleado-juan/commons@1.0.2","maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"dist":{"shasum":"0bd10be3aa519486b7765fc9f2000f022e2cb92a","tarball":"https://registry.npmjs.org/@empleado-juan/commons/-/commons-1.0.2.tgz","fileCount":35,"integrity":"sha512-LEiAjEJVPsMi5NVtJGYkeFx6GF0RGL3IFirXkwkBkfi+lAbk/i5JnepSOHvwvvOIFFvgjUpZbAxFp/JVZabbxw==","signatures":[{"sig":"MEYCIQC4PlsYgAkpXJ48QiuIB8SZZqFrWRG2B1apUHYs4qVR4gIhAI5YedZ+bo9E8X9w9eVw2L9yj6JXEispitxbjGA314/g","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37432},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"},"_npmVersion":"11.7.0","description":"Shared code between frontend and backend services","directories":{},"_nodeVersion":"20.19.4","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/commons_1.0.2_1769964439273_0.8432754683910457","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@empleado-juan/commons","version":"1.0.3","keywords":["shared","types","enums","validators"],"author":{"name":"Empleado Juan Team"},"license":"MIT","_id":"@empleado-juan/commons@1.0.3","maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"dist":{"shasum":"7df3099cecef876c42287d9a7ab137c03f3be887","tarball":"https://registry.npmjs.org/@empleado-juan/commons/-/commons-1.0.3.tgz","fileCount":35,"integrity":"sha512-D7Kty5ryrJOXzlUJ6UlfuFDYiU9N+2+R5bULmRDYlqiglTfy+Ki/n796zCaEXHmD8pgm+LnHZDkGJXRUgK0LVw==","signatures":[{"sig":"MEQCIBVqgdfsZQHuxf6UvVhq4Whcdn7M1pwSVnOPyshSeN8TAiAejDL2nwPLM2lEec666Z1bqb108GmpXF1JSt8ywluJhw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42140},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"},"_npmVersion":"11.7.0","description":"Shared code between frontend and backend services","directories":{},"_nodeVersion":"20.19.4","dependencies":{"zod":"^3.24.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/commons_1.0.3_1769978079703_0.32425488676597936","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@empleado-juan/commons","version":"1.0.4","description":"Shared code between frontend and backend services","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsc","dev":"tsc --watch","clean":"rm -rf dist"},"keywords":["shared","types","enums","validators"],"author":{"name":"Empleado Juan Team"},"license":"MIT","dependencies":{"zod":"^3.24.1"},"devDependencies":{"typescript":"^5.7.2"},"_id":"@empleado-juan/commons@1.0.4","_nodeVersion":"20.19.4","_npmVersion":"11.7.0","dist":{"integrity":"sha512-KG8684g85+6v0DSw7J6qDKSDQhn60o+rEV6YDT4e24RNi3ZUCaGom4PfFYhjvQyb/XrKGVTEJ2p+o6C29d4pZw==","shasum":"58f11d97d06097fe9fbd257c8ac4a24fe5bcdcd8","tarball":"https://registry.npmjs.org/@empleado-juan/commons/-/commons-1.0.4.tgz","fileCount":35,"unpackedSize":42482,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDNLQUnFhyot6UbAVd4GEtSkMZoPV51yYzPqIflG3YkfgIhAP4DtKJ0LXUnQQJTePPoRv9Ek2He6Pnl6NTC4o99ha3Y"}]},"_npmUser":{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"},"directories":{},"maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/commons_1.0.4_1770031877262_0.24098822228027195"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-01T03:11:35.046Z","modified":"2026-02-02T11:31:17.532Z","1.0.0":"2026-02-01T03:11:35.357Z","1.0.1":"2026-02-01T12:06:26.068Z","1.0.2":"2026-02-01T16:47:19.413Z","1.0.3":"2026-02-01T20:34:39.878Z","1.0.4":"2026-02-02T11:31:17.408Z"},"author":{"name":"Empleado Juan Team"},"license":"MIT","keywords":["shared","types","enums","validators"],"description":"Shared code between frontend and backend services","maintainers":[{"name":"elempleadojuan","email":"elempleadojuan@gmail.com"}],"readme":"# @empleado-juan/commons\n\n[![npm version](https://badge.fury.io/js/%40empleado-juan%2Fcommons.svg)](https://www.npmjs.com/package/@empleado-juan/commons)\n\nPaquete de código compartido entre frontend y backend para el sistema Empleado Juan Control.\n\n## Instalación\n\n```bash\nnpm install @empleado-juan/commons\n```\n\n## Características\n\n- ✅ **TypeScript**: Tipos completamente tipados\n- ✅ **Tree-shakeable**: Solo importa lo que necesitas\n- ✅ **Zero dependencies**: No trae dependencias extra\n- ✅ **ESM + CommonJS**: Compatible con ambos formatos\n\n## Contenido\n\n### 📦 Types\n\nInterfaces TypeScript compartidas:\n\n```typescript\nimport type {\n  AttendanceRecord,\n  EmployeeData,\n  LicenseStatus,\n  EventMessage,\n  HeartbeatMetrics\n} from '@empleado-juan/commons';\n\n// Ejemplo de uso\nconst attendance: AttendanceRecord = {\n  id: '123',\n  employeeId: 'emp-456',\n  timestamp: new Date(),\n  eventType: 'CHECK_IN',\n  branchId: 'branch-1'\n};\n```\n\n### 🏷️ Enums\n\nEnumeraciones del dominio:\n\n```typescript\nimport {\n  AttendanceEventType,\n  PaymentType,\n  LicenseValidationReason,\n  MessageBrokerType\n} from '@empleado-juan/commons';\n\n// Ejemplo de uso\nif (record.eventType === AttendanceEventType.CHECK_IN) {\n  console.log('Empleado ingresó');\n}\n\nconst paymentType = PaymentType.BIWEEKLY;\n```\n\n**Enums disponibles**:\n- `AttendanceEventType`: CHECK_IN, CHECK_OUT, BREAK_START, BREAK_END, etc.\n- `PaymentType`: MONTHLY, BIWEEKLY, WEEKLY\n- `ContractType`: FULL_TIME, PART_TIME, CONTRACTOR, TEMPORARY\n- `LicenseValidationReason`: VALID, EXPIRED, INVALID, etc.\n- `MessageBrokerType`: RABBITMQ, KAFKA, SQS\n\n### 🔧 Constants\n\nConstantes del sistema:\n\n```typescript\nimport { LICENSE_CONSTANTS } from '@empleado-juan/commons';\n\n// Ejemplo de uso\nconst cacheTTL = LICENSE_CONSTANTS.CACHE_TTL; // 5 minutos\nconst gracePeriod = LICENSE_CONSTANTS.GRACE_PERIOD; // 24 horas\n```\n\n### 📡 Event Topics\n\nDefinición de eventos del sistema:\n\n```typescript\nimport { EVENT_TOPICS } from '@empleado-juan/commons';\n\n// Ejemplo de uso\nconst topic = EVENT_TOPICS.ATTENDANCE_CREATED; // 'attendance-created'\nconst empTopic = EVENT_TOPICS.EMPLOYEE_UPDATED; // 'employee-updated'\n```\n\n**Topics disponibles**:\n- `ATTENDANCE_CREATED`, `ATTENDANCE_UPDATED`\n- `EMPLOYEE_CREATED`, `EMPLOYEE_UPDATED`, `EMPLOYEE_DELETED`\n- `COMPENSATION_CREATED`, `COMPENSATION_UPDATED`\n- `SCHEDULE_CREATED`, `SCHEDULE_UPDATED`\n\n## Ejemplos de Uso\n\n### Frontend (React/Next.js)\n\n```typescript\nimport { AttendanceEventType, type EmployeeData } from '@empleado-juan/commons';\n\nfunction EmployeeCard({ employee }: { employee: EmployeeData }) {\n  return (\n    <div>\n      <h3>{employee.firstName} {employee.lastName}</h3>\n      <p>Status: {employee.isActive ? 'Activo' : 'Inactivo'}</p>\n    </div>\n  );\n}\n```\n\n### Backend (Node.js)\n\n```typescript\nimport { EVENT_TOPICS, type EventMessage } from '@empleado-juan/commons';\n\nasync function publishEvent(topic: string, data: any) {\n  const message: EventMessage = {\n    key: data.id,\n    value: data,\n    headers: {\n      'event-type': topic,\n      'timestamp': new Date().toISOString()\n    }\n  };\n\n  await messageQueue.send(EVENT_TOPICS.EMPLOYEE_CREATED, message);\n}\n```\n\n## Desarrollo\n\n### Setup\n\n```bash\ngit clone <repo>\ncd commons\nnpm install\n```\n\n### Build\n\n```bash\nnpm run build\n```\n\n### Publish\n\n```bash\n# Incrementar versión\nnpm version patch|minor|major\n\n# Compilar\nnpm run build\n\n# Publicar\nnpm publish --access public\n```\n\n## License\n\nMIT © Empleado Juan Team\n","readmeFilename":"README.md"}