{"_id":"@dmitryrechkin/calendar-nylas","_rev":"3-6d87aa156400baa3489f26040dc90183","name":"@dmitryrechkin/calendar-nylas","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@dmitryrechkin/calendar-nylas","version":"1.0.0","_id":"@dmitryrechkin/calendar-nylas@1.0.0","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"dist":{"shasum":"c1292afcfe028b0ba721d146c1c93e7aaf5b70ff","tarball":"https://registry.npmjs.org/@dmitryrechkin/calendar-nylas/-/calendar-nylas-1.0.0.tgz","fileCount":33,"integrity":"sha512-cSxKkXRwEPVyrgbSGKSC20LwdzfSmQOE6e1FDOhJEPHb6roMWgDG73XpAqPeXcWy5U1LER3ByuP1TIFgJ1WAUA==","signatures":[{"sig":"MEUCIHgqOktSjgq2jrpI6NdHeT3OW17B1NS64A6zjv2pK5RMAiEAykTCxnp3x+6yB+1v8/4Y5M2U7XmEG/zSYi/Zwu2ihHw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140203},"main":"dist/index.js","type":"module","_from":"file:dmitryrechkin-calendar-nylas-1.0.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run","build":"shx rm -rf dist && tsc && fix-esm-import-path dist","check":"tsc --noEmit","format":"eslint --fix .","package:publish":"pnpm publish --access public"},"_npmUser":{"name":"dmitryrechkin","email":"rechkin@gmail.com"},"_resolved":"/private/var/folders/67/qcbb1q556vbfzygwbkm5glcr0000gn/T/262f959785cc2c0d8046752995b33367/dmitryrechkin-calendar-nylas-1.0.0.tgz","_integrity":"sha512-cSxKkXRwEPVyrgbSGKSC20LwdzfSmQOE6e1FDOhJEPHb6roMWgDG73XpAqPeXcWy5U1LER3ByuP1TIFgJ1WAUA==","_npmVersion":"10.8.2","description":"**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and de","directories":{},"_nodeVersion":"22.5.1","dependencies":{"zod":"^3.23.8","@dmitryrechkin/calendar-core":"^1.0.0","@dmitryrechkin/foundation-core":"^1.0.0","@dmitryrechkin/request-sender-core":"^1.0.0","@dmitryrechkin/request-sender-nylas":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","dotenv":"^16.4.5","eslint":"^8.0.0","vitest":"^0.24.5","typescript":"^5.5.3","tsconfig-paths":"^4.2.0","fix-esm-import-path":"^1.0.1","eslint-plugin-unused-imports":"^3.0.0","@dmitryrechkin/eslint-standard":"^1.0.7"},"_npmOperationalInternal":{"tmp":"tmp/calendar-nylas_1.0.0_1724875046783_0.8120516276247549","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@dmitryrechkin/calendar-nylas","version":"1.0.1","_id":"@dmitryrechkin/calendar-nylas@1.0.1","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"dist":{"shasum":"f755ab5505e7b8ad8e3ac35012cd9494a765a1fc","tarball":"https://registry.npmjs.org/@dmitryrechkin/calendar-nylas/-/calendar-nylas-1.0.1.tgz","fileCount":33,"integrity":"sha512-0UzFra9Kg0K5xtMT4UHzbDT32T2lNCSpYRKytaEo2dAGN7sB09UhD++2ZFtPTywrSzdZ/TT5RMqhYiDwrXVw2g==","signatures":[{"sig":"MEUCIC7o09+dnTy6IUFuJvMAkhzJlQeIujRslencZI+dmIqzAiEAkDgSjG6WO/HyqBpjJ1mLk8PtssrBYQBTpmf8LyoZPyI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140253},"main":"dist/index.js","type":"module","_from":"file:dmitryrechkin-calendar-nylas-1.0.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run","build":"shx rm -rf dist && tsc && fix-esm-import-path dist","check":"tsc --noEmit","format":"eslint --fix .","package:publish":"pnpm publish --access public"},"_npmUser":{"name":"dmitryrechkin","email":"rechkin@gmail.com"},"_resolved":"/private/var/folders/67/qcbb1q556vbfzygwbkm5glcr0000gn/T/a76d24b4a2305f09edd6dd7a7ea5e6b2/dmitryrechkin-calendar-nylas-1.0.1.tgz","_integrity":"sha512-0UzFra9Kg0K5xtMT4UHzbDT32T2lNCSpYRKytaEo2dAGN7sB09UhD++2ZFtPTywrSzdZ/TT5RMqhYiDwrXVw2g==","_npmVersion":"10.8.2","description":"**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and de","directories":{},"_nodeVersion":"22.5.1","dependencies":{"zod":"^3.23.8","@dmitryrechkin/calendar-core":"^1.0.0","@dmitryrechkin/foundation-core":"^1.0.0","@dmitryrechkin/request-sender-core":"^1.0.0","@dmitryrechkin/request-sender-nylas":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","dotenv":"^16.4.5","eslint":"^8.0.0","vitest":"^0.24.5","typescript":"^5.5.3","tsconfig-paths":"^4.2.0","fix-esm-import-path":"^1.0.1","eslint-plugin-unused-imports":"^3.0.0","@dmitryrechkin/eslint-standard":"^1.0.7"},"_npmOperationalInternal":{"tmp":"tmp/calendar-nylas_1.0.1_1724994300256_0.6141402773094065","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@dmitryrechkin/calendar-nylas","version":"1.0.2","_id":"@dmitryrechkin/calendar-nylas@1.0.2","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"dist":{"shasum":"284bd6eb14547e1faa8be2b0b0216d163cdfa5aa","tarball":"https://registry.npmjs.org/@dmitryrechkin/calendar-nylas/-/calendar-nylas-1.0.2.tgz","fileCount":33,"integrity":"sha512-ilP/0zjsLcpawyT66T9o2/vrHTtLS8wVcl1Kxy6tNUbLG6318KHFsm2wdBUIWhPIEMK8yR0DMqEeVfpicTLTuQ==","signatures":[{"sig":"MEYCIQC/8VsxvsfxepeLUnufiZ5XpDlkp8/DjhP0+ooF0gOmygIhAOb7XlaT9ruYpMfOrBB3LQ/qAEos39TepBfKiFTIGIun","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":140520},"main":"dist/index.js","type":"module","_from":"file:dmitryrechkin-calendar-nylas-1.0.2.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run","build":"shx rm -rf dist && tsc && fix-esm-import-path dist","check":"tsc --noEmit","format":"eslint --fix .","package:publish":"pnpm publish --access public"},"_npmUser":{"name":"dmitryrechkin","email":"rechkin@gmail.com"},"_resolved":"/private/var/folders/67/qcbb1q556vbfzygwbkm5glcr0000gn/T/d6cb601fe8ff00dd81e7842e72784ad1/dmitryrechkin-calendar-nylas-1.0.2.tgz","_integrity":"sha512-ilP/0zjsLcpawyT66T9o2/vrHTtLS8wVcl1Kxy6tNUbLG6318KHFsm2wdBUIWhPIEMK8yR0DMqEeVfpicTLTuQ==","_npmVersion":"10.8.2","description":"**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and de","directories":{},"_nodeVersion":"22.5.1","dependencies":{"zod":"^3.23.8","@dmitryrechkin/calendar-core":"^1.0.0","@dmitryrechkin/foundation-core":"^1.0.0","@dmitryrechkin/request-sender-core":"^1.0.0","@dmitryrechkin/request-sender-nylas":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","dotenv":"^16.4.5","eslint":"^8.0.0","vitest":"^0.24.5","typescript":"^5.5.3","tsconfig-paths":"^4.2.0","fix-esm-import-path":"^1.0.1","eslint-plugin-unused-imports":"^3.0.0","@dmitryrechkin/eslint-standard":"^1.0.7"},"_npmOperationalInternal":{"tmp":"tmp/calendar-nylas_1.0.2_1724997791899_0.6992943720742046","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@dmitryrechkin/calendar-nylas","type":"module","version":"1.0.3","main":"dist/index.js","types":"dist/index.d.ts","devDependencies":{"fix-esm-import-path":"^1.0.1","@dmitryrechkin/eslint-standard":"^1.0.7","dotenv":"^16.4.5","eslint":"^8.0.0","eslint-plugin-unused-imports":"^3.0.0","tsconfig-paths":"^4.2.0","typescript":"^5.5.3","vitest":"^0.24.5","shx":"^0.3.4"},"dependencies":{"@dmitryrechkin/foundation-core":"^1.0.0","@dmitryrechkin/request-sender-core":"^1.0.0","@dmitryrechkin/request-sender-nylas":"^1.0.1","@dmitryrechkin/calendar-core":"^1.0.0","zod":"^3.23.8"},"scripts":{"lint":"eslint .","format":"eslint --fix .","test":"vitest run","check":"tsc --noEmit","build":"shx rm -rf dist && tsc && fix-esm-import-path dist","package:publish":"pnpm publish --access public"},"_id":"@dmitryrechkin/calendar-nylas@1.0.3","description":"**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and de","_integrity":"sha512-gnBh59wXx3V3C3acjhirg0GTR8U6oHL/y+6/pZQ9J1jth/8NZXeuMD0luUFLnwUyr1GizRgED3YfLnyL+/928A==","_resolved":"/private/var/folders/67/qcbb1q556vbfzygwbkm5glcr0000gn/T/cffa01fbb777662a0f25afa82afad482/dmitryrechkin-calendar-nylas-1.0.3.tgz","_from":"file:dmitryrechkin-calendar-nylas-1.0.3.tgz","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-gnBh59wXx3V3C3acjhirg0GTR8U6oHL/y+6/pZQ9J1jth/8NZXeuMD0luUFLnwUyr1GizRgED3YfLnyL+/928A==","shasum":"7e86ba3b7b4fe3f129fe074e9e87f0c0be68217e","tarball":"https://registry.npmjs.org/@dmitryrechkin/calendar-nylas/-/calendar-nylas-1.0.3.tgz","fileCount":33,"unpackedSize":140514,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHhMFJsxDHtEnhjecQmbGWAM7KW+pZPKMue7tnv2IAIAiEA6Q5M4mkLsC6QT4/rIWkEuWcnDp21dLFJCFgBPfh0aC4="}]},"_npmUser":{"name":"dmitryrechkin","email":"rechkin@gmail.com"},"directories":{},"maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-nylas_1.0.3_1724998146098_0.8738867554204859"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-28T19:57:26.693Z","modified":"2024-08-30T06:09:06.362Z","1.0.0":"2024-08-28T19:57:26.970Z","1.0.1":"2024-08-30T05:05:00.420Z","1.0.2":"2024-08-30T06:03:12.107Z","1.0.3":"2024-08-30T06:09:06.207Z"},"description":"**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and de","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"readme":"# Calendar Nylas\n\n**Calendar Nylas is a TypeScript library that integrates with the Nylas API to manage calendar events and availability.** This package provides a set of tools and actions to interact with Nylas calendars, making it easy to create, retrieve, update, and delete calendar events, as well as check availability within the Nylas ecosystem.\n\n## Installation\n\nInstall the package using pnpm:\n\n```bash\npnpm add @dmitryrechkin/calendar-nylas\n```\n\n## Features\n\n- **Calendar Management**: Create, retrieve, update, and delete calendar events with ease.\n- **Availability Checking**: Check calendar availability to prevent scheduling conflicts.\n- **Nylas API Integration**: Seamlessly interact with the Nylas API, utilizing built-in authentication and request handling.\n- **Action-Based Design**: Perform specific calendar operations using dedicated actions, keeping your codebase clean and modular.\n- **Platform Independent**: Unlike the original Nylas package, this library is designed to work in serverless environments such as Cloudflare Workers. It avoids dependencies on Node.js-specific modules, ensuring compatibility with various serverless platforms.\n\n## Usage\n\n### Creating a Calendar Event\n\n```typescript\nimport { CreateCalendarEventAction } from '@dmitryrechkin/calendar-nylas';\nimport { NylasRequestSender } from '@dmitryrechkin/request-sender-nylas';\nimport { TypeNylasAuthentication } from '@dmitryrechkin/request-sender-nylas';\n\nconst auth: TypeNylasAuthentication = {\n    apiKey: 'your-nylas-api-key',\n    apiUrl: 'https://api.nylas.com',\n    grantId: 'your-grant-id'\n};\n\nconst nylasSender = new NylasRequestSender(auth);\nconst createEventAction = new CreateCalendarEventAction(nylasSender);\n\nconst eventData = {\n    title: 'Team Meeting',\n    when: {\n        start_time: 1710499200, // Unix timestamp\n        end_time: 1710502800   // Unix timestamp\n    },\n    location: 'Conference Room A',\n    participants: ['email@example.com']\n};\n\nconst response = await createEventAction.execute(eventData);\nconsole.log('Created event ID:', response.data?.id);\n```\n\n### Retrieving Calendar Events\n\n```typescript\nimport { GetCalendarEventsAction } from '@dmitryrechkin/calendar-nylas';\nimport { NylasRequestSender } from '@dmitryrechkin/request-sender-nylas';\n\nconst nylasSender = new NylasRequestSender(auth);\nconst getEventsAction = new GetCalendarEventsAction(nylasSender);\n\nconst response = await getEventsAction.execute({ calendar_id: 'your-calendar-id' });\nconsole.log('Retrieved events:', response.data);\n```\n\n### Checking Calendar Availability\n\n```typescript\nimport { GetCalendarsAvailabilityAction } from '@dmitryrechkin/calendar-nylas';\nimport { NylasRequestSender } from '@dmitryrechkin/request-sender-nylas';\n\nconst nylasSender = new NylasRequestSender(auth);\nconst availabilityAction = new GetCalendarsAvailabilityAction(nylasSender);\n\nconst availabilityResponse = await availabilityAction.execute({\n    calendar_id: 'your-calendar-id',\n    start_time: 1710499200, // Unix timestamp\n    end_time: 1710502800   // Unix timestamp\n});\n\nconsole.log('Availability:', availabilityResponse.data);\n```\n\n### Deleting a Calendar Event\n\n```typescript\nimport { DeleteCalendarEventAction } from '@dmitryrechkin/calendar-nylas';\nimport { NylasRequestSender } from '@dmitryrechkin/request-sender-nylas';\n\nconst nylasSender = new NylasRequestSender(auth);\nconst deleteEventAction = new DeleteCalendarEventAction(nylasSender);\n\nconst deleteResponse = await deleteEventAction.execute({ event_id: 'your-event-id' });\nconsole.log('Deleted event status:', deleteResponse.success);\n```\n\n## When to Use\n\n`Calendar Nylas` is perfect for applications that need to integrate with Nylas for managing calendar events and checking availability. It provides a clean, action-based API that simplifies the complexities of interacting with Nylas, allowing you to focus on building features rather than managing API calls.\n\n## Installation & Setup\n\nInstall the package using pnpm:\n\n```bash\npnpm add @dmitryrechkin/calendar-nylas\n```\n\nEnsure your project is set up to handle TypeScript and supports ES modules, as this library is built with modern JavaScript standards.\n\n## Rationale\n\n### Platform Independence for Serverless Environments\n\nThe `Calendar Nylas` library was created to address a significant limitation of the original Nylas package: its dependency on Node.js-specific modules, which makes it incompatible with serverless environments such as Cloudflare Workers. This library is platform-independent, meaning it can be used in serverless platforms without any issues, making it a better fit for modern, cloud-based applications.\n\n### Action-Based Design for Clean Code\n\nThe `Calendar Nylas` library is designed with an action-based approach, meaning each calendar operation is encapsulated within a specific action class. This design promotes clean, modular code, making it easier to maintain and extend your application.\n\n- **Focused Actions**: Each action class focuses on a specific operation, such as creating or deleting events, making your code more readable and maintainable.\n- **Seamless Integration**: By leveraging the `NylasRequestSender` class from `Request Sender Nylas`, you can easily handle authentication and request sending without writing boilerplate code.\n- **Scalable and Extensible**: The action-based architecture allows you to easily add new calendar-related features as your application grows.\n\n## Contributing\n\nContributions are welcome! Feel free to fork this project and submit pull requests. Before submitting, please ensure your code passes all linting and unit tests.\n\nYou can run unit tests using:\n\n```bash\npnpm test\n```","readmeFilename":"README.md"}