{"_id":"@brandcast_app/zoomshift-api-client","_rev":"3-8892986993c8c6d32a6c806e34fd861b","name":"@brandcast_app/zoomshift-api-client","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@brandcast_app/zoomshift-api-client","version":"0.1.0","keywords":["zoomshift","employee-scheduling","shift-management","workforce-management","api-client","typescript","javascript","reverse-engineered","scheduling","calendar","shifts"],"author":{"name":"BrandCast Team"},"license":"MIT","_id":"@brandcast_app/zoomshift-api-client@0.1.0","maintainers":[{"name":"jamieeduncan","email":"jamie@brandcast.app"}],"homepage":"https://github.com/jduncan-rva/zoomshift-api-client#readme","bugs":{"url":"https://github.com/jduncan-rva/zoomshift-api-client/issues"},"dist":{"shasum":"71149b0b0c86f8916e48010e88fbb0f3556fc4b6","tarball":"https://registry.npmjs.org/@brandcast_app/zoomshift-api-client/-/zoomshift-api-client-0.1.0.tgz","fileCount":9,"integrity":"sha512-dkd39J13icIv6K1BivK3SQ7TTaoZP1g5ZRzFkCzxwHH1azeJ3ud6v/QFnd4e9fjt14ujuhcOBfJL6BF42jc6pA==","signatures":[{"sig":"MEUCICPfiHJQgEZjUixOXaToPX/ig5Nruhd4Gipn3SvjPkrqAiEAo7OhchJPYZLZ1M2/sdLY90mmzfxGJEOrlldfti41lhg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29704},"jest":{"preset":"ts-jest","testMatch":["**/__tests__/**/*.test.ts"],"testEnvironment":"node","collectCoverageFrom":["src/**/*.ts","!src/**/*.d.ts"]},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"935ac3c38bd48ff3df7a4d42ecca1f73da67fd63","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc","clean":"rm -rf dist","prepare":"npm run build","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"jamieeduncan","email":"jamie@brandcast.app"},"repository":{"url":"git+https://github.com/jduncan-rva/zoomshift-api-client.git","type":"git"},"_npmVersion":"10.9.3","description":"Unofficial TypeScript/JavaScript client for ZoomShift employee scheduling API (reverse-engineered)","directories":{},"_nodeVersion":"22.18.0","dependencies":{"axios":"^1.7.0","jsdom":"^22.0.0","tough-cookie":"^4.1.0","axios-cookiejar-support":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@types/jsdom":"^21.1.0","@types/tough-cookie":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoomshift-api-client_0.1.0_1762843487738_0.4926758299981522","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1":{"name":"@brandcast_app/zoomshift-api-client","version":"0.1.1","keywords":["zoomshift","employee-scheduling","shift-management","workforce-management","api-client","typescript","javascript","reverse-engineered","scheduling","calendar","shifts"],"author":{"name":"BrandCast Team"},"license":"MIT","_id":"@brandcast_app/zoomshift-api-client@0.1.1","maintainers":[{"name":"jamieeduncan","email":"jamie@brandcast.app"}],"homepage":"https://github.com/jduncan-rva/zoomshift-api-client#readme","bugs":{"url":"https://github.com/jduncan-rva/zoomshift-api-client/issues"},"dist":{"shasum":"5196ffdd6e3c43f8d62596f0123168097f926344","tarball":"https://registry.npmjs.org/@brandcast_app/zoomshift-api-client/-/zoomshift-api-client-0.1.1.tgz","fileCount":9,"integrity":"sha512-R3LJZM+TCsMWdklUNqe7/a/60WwY+0paTZeZ3g4ulV1yeP5Rcb429E91nu8wduCvl5CpRglnRDa7KqtpyMeuFw==","signatures":[{"sig":"MEYCIQD84r3Q/lSVlDd1+K3eD7ZizY6zEVxdhG9ueLPodgXqQQIhAPJF57plMRKlg2v8XLVtxaM9VSrse8daQ5fp/DbCy026","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29607},"jest":{"preset":"ts-jest","testMatch":["**/__tests__/**/*.test.ts"],"testEnvironment":"node","collectCoverageFrom":["src/**/*.ts","!src/**/*.d.ts"]},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"8098251886644e0384c0bb37aef32edc11cb6eb4","scripts":{"dev":"tsc --watch","test":"jest","build":"tsc","clean":"rm -rf dist","prepare":"npm run build","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"jamieeduncan","email":"jamie@brandcast.app"},"repository":{"url":"git+https://github.com/jduncan-rva/zoomshift-api-client.git","type":"git"},"_npmVersion":"11.6.2","description":"Unofficial TypeScript/JavaScript client for ZoomShift employee scheduling API (reverse-engineered)","directories":{},"_nodeVersion":"25.2.1","dependencies":{"axios":"^1.7.0","cheerio":"^1.1.2","tough-cookie":"^4.1.0","axios-cookiejar-support":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@types/tough-cookie":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoomshift-api-client_0.1.1_1767981510363_0.13702231388551467","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2025-11-11T06:44:47.647Z","modified":"2026-04-12T12:32:18.176Z","0.1.0":"2025-11-11T06:44:47.950Z","0.1.1":"2026-01-09T17:58:30.513Z"},"bugs":{"url":"https://github.com/jduncan-rva/zoomshift-api-client/issues"},"author":{"name":"BrandCast Team"},"license":"MIT","homepage":"https://github.com/jduncan-rva/zoomshift-api-client#readme","keywords":["zoomshift","employee-scheduling","shift-management","workforce-management","api-client","typescript","javascript","reverse-engineered","scheduling","calendar","shifts"],"repository":{"url":"git+https://github.com/jduncan-rva/zoomshift-api-client.git","type":"git"},"description":"Unofficial TypeScript/JavaScript client for ZoomShift employee scheduling API (reverse-engineered)","maintainers":[{"name":"jamieeduncan","email":"jamie@brandcast.app"}],"readme":"# ZoomShift API Client\n\n[![npm version](https://badge.fury.io/js/%40brandcast_app%2Fzoomshift-api-client.svg)](https://badge.fury.io/js/%40brandcast_app%2Fzoomshift-api-client)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nUnofficial TypeScript/JavaScript client for the ZoomShift employee scheduling API.\n\n## ⚠️ Important Disclaimer\n\n**This is an UNOFFICIAL client library.** ZoomShift does not provide a public API, and this library is based on reverse engineering their internal endpoints.\n\n**Use at your own risk:**\n- The API may change without notice\n- Your account could be suspended for using unofficial clients\n- This library is provided AS-IS with no warranties\n- Not affiliated with or endorsed by ZoomShift\n\n## Features\n\n- 🔐 Cookie-based session authentication with CSRF token handling\n- 📅 Fetch employee shift schedules for date ranges\n- 🔍 Filter shifts by employee or location\n- 📦 TypeScript support with full type definitions\n- 🛡️ Error handling and type safety\n- 🐛 Optional debug logging\n\n## Installation\n\n```bash\nnpm install @brandcast_app/zoomshift-api-client\n```\n\nor\n\n```bash\nyarn add @brandcast_app/zoomshift-api-client\n```\n\n## Quick Start\n\n```typescript\nimport { ZoomShiftClient } from '@brandcast_app/zoomshift-api-client';\n\n// Create a client instance\nconst client = new ZoomShiftClient({\n  debug: true, // Optional: enable debug logging\n  timeout: 30000, // Optional: request timeout in ms (default: 30000)\n});\n\n// Authenticate with ZoomShift\nconst auth = await client.authenticate(\n  'your@email.com',\n  'your-password',\n  '58369' // Your schedule ID (found in ZoomShift URL)\n);\n\nconsole.log('Authenticated:', auth.authenticated);\n\n// Get shifts for a date range\nconst shifts = await client.getShifts({\n  startDate: '2025-10-10',\n  endDate: '2025-10-17',\n});\n\nconsole.log(`Found ${shifts.length} shifts:`);\n\nfor (const shift of shifts) {\n  console.log(`${shift.employeeName} - ${shift.role}`);\n  console.log(`  ${shift.startTime} to ${shift.endTime}`);\n  console.log(`  Duration: ${shift.duration} hours`);\n}\n```\n\n## API Reference\n\n### Constructor\n\n#### `new ZoomShiftClient(options?)`\n\nCreate a new ZoomShift API client.\n\n**Parameters:**\n- `options` (optional) - Configuration options\n  - `debug?: boolean` - Enable debug logging (default: false)\n  - `timeout?: number` - Request timeout in milliseconds (default: 30000)\n  - `userAgent?: string` - Custom user agent string\n\n```typescript\nconst client = new ZoomShiftClient({\n  debug: true,\n  timeout: 30000,\n});\n```\n\n### Methods\n\n#### `authenticate(email, password, scheduleId): Promise<ZoomShiftAuthResponse>`\n\nAuthenticate with ZoomShift using email, password, and schedule ID.\n\n**Parameters:**\n- `email: string` - Your ZoomShift account email\n- `password: string` - Your ZoomShift account password\n- `scheduleId: string` - Your schedule ID (found in ZoomShift URL)\n\n**Returns:** `Promise<ZoomShiftAuthResponse>`\n```typescript\n{\n  authenticated: boolean;\n  scheduleId: string;\n  userName: string;\n}\n```\n\n**Example:**\n```typescript\nconst auth = await client.authenticate(\n  'manager@example.com',\n  'mypassword',\n  '58369'\n);\n```\n\n**Finding Your Schedule ID:**\nYour schedule ID is in the ZoomShift URL:\n```\nhttps://app.zoomshift.com/58369/dashboard\n                            ^^^^^ This is your schedule ID\n```\n\n#### `getShifts(request): Promise<ZoomShiftShift[]>`\n\nGet employee shifts for a date range with optional filters.\n\n**Parameters:**\n- `request: GetShiftsRequest`\n  - `startDate: string` - Start date (YYYY-MM-DD format)\n  - `endDate: string` - End date (YYYY-MM-DD format)\n  - `employeeId?: string` - (Optional) Filter by employee ID\n  - `location?: string` - (Optional) Filter by location\n\n**Returns:** `Promise<ZoomShiftShift[]>`\n\n**Example:**\n```typescript\n// Get all shifts for next week\nconst shifts = await client.getShifts({\n  startDate: '2025-10-10',\n  endDate: '2025-10-17',\n});\n\n// Get shifts for specific employee\nconst employeeShifts = await client.getShifts({\n  startDate: '2025-10-10',\n  endDate: '2025-10-17',\n  employeeId: '12345',\n});\n\n// Get shifts for specific location\nconst storeShifts = await client.getShifts({\n  startDate: '2025-10-10',\n  endDate: '2025-10-17',\n  location: 'Main Store',\n});\n```\n\n#### `isAuthenticated(): boolean`\n\nCheck if the client is currently authenticated.\n\n```typescript\nif (client.isAuthenticated()) {\n  console.log('Client is ready to make API calls');\n}\n```\n\n#### `getScheduleId(): string | null`\n\nGet the current schedule ID.\n\n```typescript\nconst scheduleId = client.getScheduleId();\nconsole.log('Using schedule:', scheduleId);\n```\n\n## Type Definitions\n\n### ZoomShiftShift\n\n```typescript\ninterface ZoomShiftShift {\n  id: string;\n  employeeName: string;\n  employeeId: string;\n  role: string;\n  startTime: string;        // ISO 8601 format\n  endTime: string;          // ISO 8601 format\n  duration: number;         // hours\n  breakDuration?: number;   // hours\n  location?: string;\n  notes?: string;\n  status: 'scheduled' | 'in_progress' | 'completed' | 'cancelled';\n}\n```\n\n### ZoomShiftAuthResponse\n\n```typescript\ninterface ZoomShiftAuthResponse {\n  authenticated: boolean;\n  scheduleId: string;\n  userName: string;\n}\n```\n\n### GetShiftsRequest\n\n```typescript\ninterface GetShiftsRequest {\n  startDate: string;  // YYYY-MM-DD\n  endDate: string;    // YYYY-MM-DD\n  employeeId?: string;\n  location?: string;\n}\n```\n\n### ZoomShiftError\n\n```typescript\ninterface ZoomShiftError {\n  code: string;\n  message: string;\n  details?: unknown;\n}\n```\n\n## Error Handling\n\nThe client throws `ZoomShiftError` objects with descriptive error codes:\n\n```typescript\ntry {\n  await client.authenticate('user@example.com', 'wrong-password', '58369');\n} catch (error) {\n  const zsError = error as ZoomShiftError;\n  console.error('Error code:', zsError.code);\n  console.error('Error message:', zsError.message);\n\n  // Handle specific errors\n  switch (zsError.code) {\n    case 'AUTH_FAILED':\n      console.error('Invalid credentials');\n      break;\n    case 'SESSION_EXPIRED':\n      console.error('Please re-authenticate');\n      break;\n    default:\n      console.error('Unknown error');\n  }\n}\n```\n\n**Common Error Codes:**\n- `CSRF_TOKEN_MISSING` - Failed to extract CSRF token\n- `AUTH_FAILED` - Invalid credentials\n- `NOT_AUTHENTICATED` - Must call authenticate() first\n- `SESSION_EXPIRED` - Session expired, need to re-authenticate\n- `FETCH_FAILED` - Failed to fetch shifts\n- `AUTH_REQUEST_FAILED` - Network error during authentication\n- `AUTH_UNKNOWN_ERROR` - Unknown authentication error\n\n## Complete Example\n\n```typescript\nimport { ZoomShiftClient } from '@brandcast_app/zoomshift-api-client';\n\nasync function main() {\n  // Create client with debug logging\n  const client = new ZoomShiftClient({ debug: true });\n\n  try {\n    // Authenticate\n    console.log('Authenticating...');\n    const auth = await client.authenticate(\n      'manager@example.com',\n      'mypassword',\n      '58369'\n    );\n    console.log('✓ Authenticated successfully');\n\n    // Get shifts for next 7 days\n    const today = new Date();\n    const nextWeek = new Date(today);\n    nextWeek.setDate(nextWeek.getDate() + 7);\n\n    const formatDate = (date: Date) => date.toISOString().split('T')[0];\n\n    console.log('Fetching shifts...');\n    const shifts = await client.getShifts({\n      startDate: formatDate(today),\n      endDate: formatDate(nextWeek),\n    });\n\n    console.log(`✓ Found ${shifts.length} shifts`);\n\n    // Display shifts grouped by day\n    const shiftsByDay = new Map<string, typeof shifts>();\n\n    for (const shift of shifts) {\n      const day = shift.startTime.split('T')[0];\n      if (!shiftsByDay.has(day)) {\n        shiftsByDay.set(day, []);\n      }\n      shiftsByDay.get(day)!.push(shift);\n    }\n\n    for (const [day, dayShifts] of shiftsByDay) {\n      console.log(`\\n${day}:`);\n      for (const shift of dayShifts) {\n        const start = new Date(shift.startTime).toLocaleTimeString();\n        const end = new Date(shift.endTime).toLocaleTimeString();\n        console.log(`  ${shift.employeeName} (${shift.role})`);\n        console.log(`    ${start} - ${end} (${shift.duration}h)`);\n      }\n    }\n\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\nmain();\n```\n\n## Development\n\n### Building\n\n```bash\nnpm install\nnpm run build\n```\n\n### Testing\n\n```bash\nnpm test\n```\n\n### Watch Mode\n\n```bash\nnpm run dev\n```\n\n## Credits\n\nInspired by reverse engineering work similar to the [py-cozi](https://github.com/Wetzel402/py-cozi) Python library.\n\n## Legal\n\nThis is an unofficial library and is not affiliated with, endorsed by, or connected to ZoomShift. Use at your own risk. The developers of this library are not responsible for any issues that may arise from its use.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Support\n\n- 🐛 [Report Issues](https://github.com/jduncan-rva/zoomshift-api-client/issues)\n\n## Changelog\n\n### 0.1.0 (Initial Release)\n\n- ✨ Initial implementation\n- 🔐 Cookie-based authentication with CSRF token handling\n- 📅 Fetch shifts for date ranges\n- 🔍 Filter by employee and location\n- 📦 Full TypeScript support\n- 🐛 Debug logging option\n\n---\n\n**Status**: 🚧 Pre-alpha - API under active development\n","readmeFilename":"README.md"}