{"_id":"@dmitryrechkin/request-sender-nylas","_rev":"1-51f3e417e5b61e2badd8d50b7cedca05","name":"@dmitryrechkin/request-sender-nylas","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@dmitryrechkin/request-sender-nylas","version":"1.0.0","_id":"@dmitryrechkin/request-sender-nylas@1.0.0","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"dist":{"shasum":"7dca096e0ee13cf2581dc1dc969a50672a2a86db","tarball":"https://registry.npmjs.org/@dmitryrechkin/request-sender-nylas/-/request-sender-nylas-1.0.0.tgz","fileCount":11,"integrity":"sha512-2PkHTSUtaHa2qTxv9XfMrEJqgTUuH3PZkALdpdrYkpvb6TlD1J4wPDnEJlrKjnFAZqxt6fIFvqi1MNJ835bOuQ==","signatures":[{"sig":"MEQCICsRTg8qtJxw5HigtKk2vIs1vDXyXgGsvMMMKed4yS56AiAywotvqGePiomJQ9FfcefYpSqv56KXgC8To8lxOnqJAA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44185},"main":"dist/index.js","type":"module","_from":"file:dmitryrechkin-request-sender-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/a06739128e96bb61ed87129671cb8a07/dmitryrechkin-request-sender-nylas-1.0.0.tgz","_integrity":"sha512-2PkHTSUtaHa2qTxv9XfMrEJqgTUuH3PZkALdpdrYkpvb6TlD1J4wPDnEJlrKjnFAZqxt6fIFvqi1MNJ835bOuQ==","_npmVersion":"10.8.2","description":"**Request Sender Nylas is a TypeScript library that provides an implementation of the `RequestSenderInterface` specifically for interacting with the Nylas API.** This library builds on the foundation provided by `Request Sender Core`, making it easy to se","directories":{},"_nodeVersion":"22.5.1","dependencies":{"@dmitryrechkin/request-sender-core":"^1.0.0"},"_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/request-sender-nylas_1.0.0_1724872888999_0.5597721431956435","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@dmitryrechkin/request-sender-nylas","type":"module","version":"1.0.1","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/request-sender-core":"^1.0.0"},"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/request-sender-nylas@1.0.1","description":"**Request Sender Nylas is a TypeScript library that provides an implementation of the `RequestSenderInterface` specifically for interacting with the Nylas API.** This library builds on the foundation provided by `Request Sender Core`, making it easy to se","_integrity":"sha512-0CWqGLScUnGiGmg4GXmTxEd6gbcrobABk7fmLNkjh12N3yCrKVgfWFnPtWv6JHFBYUoPm3Up6EiK4HrcbVqYdA==","_resolved":"/private/var/folders/67/qcbb1q556vbfzygwbkm5glcr0000gn/T/e2e49d9ad246ec4a3d9786f689a6dcc6/dmitryrechkin-request-sender-nylas-1.0.1.tgz","_from":"file:dmitryrechkin-request-sender-nylas-1.0.1.tgz","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-0CWqGLScUnGiGmg4GXmTxEd6gbcrobABk7fmLNkjh12N3yCrKVgfWFnPtWv6JHFBYUoPm3Up6EiK4HrcbVqYdA==","shasum":"a87ff3581e0bf94c4c69c8a70fb7837fb881adf3","tarball":"https://registry.npmjs.org/@dmitryrechkin/request-sender-nylas/-/request-sender-nylas-1.0.1.tgz","fileCount":13,"unpackedSize":44539,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1NoOJg0GNor/ioid1GPLvjWrI3AsJSQI7GuMuf8A0igIgazMuc8Hd94XV/q3QPB/+3NQrjZUheSeQeIDxV6Tsjn0="}]},"_npmUser":{"name":"dmitryrechkin","email":"rechkin@gmail.com"},"directories":{},"maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request-sender-nylas_1.0.1_1724873072175_0.6935120202317402"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-28T19:21:28.895Z","modified":"2024-08-28T19:24:32.536Z","1.0.0":"2024-08-28T19:21:29.194Z","1.0.1":"2024-08-28T19:24:32.349Z"},"description":"**Request Sender Nylas is a TypeScript library that provides an implementation of the `RequestSenderInterface` specifically for interacting with the Nylas API.** This library builds on the foundation provided by `Request Sender Core`, making it easy to se","maintainers":[{"name":"dmitryrechkin","email":"rechkin@gmail.com"}],"readme":"# Request Sender Nylas\n\n**Request Sender Nylas is a TypeScript library that provides an implementation of the `RequestSenderInterface` specifically for interacting with the Nylas API.** This library builds on the foundation provided by `Request Sender Core`, making it easy to send authenticated requests to the Nylas API using a consistent interface.\n\n## Installation\n\nInstall the package using pnpm:\n\n```bash\npnpm add @dmitryrechkin/request-sender-nylas\n```\n\n## Features\n\n- **Nylas-Specific Implementation**: Extends the `HttpRequestSender` class to add authentication headers and handle Nylas-specific API requirements.\n- **Factory Pattern Support**: Easily create instances of `NylasRequestSender` using the factory pattern, enabling dynamic instantiation based on your application’s needs.\n- **Simple Integration**: Easily integrate with the Nylas API by providing API key, grant ID, and other required authentication details.\n\n## Usage\n\n### Sending a Request to the Nylas API\n\n```typescript\nimport { NylasRequestSender } from '@dmitryrechkin/request-sender-nylas';\nimport { TypeNylasAuthentication } from './Type/NylasAuthentication';\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 response = await nylasSender.send('/events', {\n    method: 'GET'\n});\n\nconst data = await response.json();\nconsole.log('Nylas API response data:', data);\n```\n\n### Using the Nylas Request Sender Factory\n\nThe factory pattern allows you to create instances of `NylasRequestSender` dynamically, which can be useful for dependency injection or when you need multiple senders with different configurations.\n\n#### Creating a Factory\n\n```typescript\nimport { NylasRequestSenderFactory } from '@dmitryrechkin/request-sender-nylas';\nimport { TypeNylasAuthentication } from './Type/NylasAuthentication';\n\nconst factory = new NylasRequestSenderFactory();\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 = factory.create(auth); // Create a new NylasRequestSender instance\n\nconst response = await nylasSender.send('/events', {\n    method: 'POST',\n    body: JSON.stringify({ ... }),\n});\n\nconsole.log('Response status:', response.status);\n```\n\n## When to Use\n\n`Request Sender Nylas` is ideal for projects that integrate with the Nylas API, particularly when you need to:\n\n- **Standardize Request Handling**: Use the same interface for sending requests to Nylas as you do with other services, making your codebase more consistent.\n- **Simplify API Integration**: Reduce boilerplate code by using a pre-built implementation that handles authentication and other Nylas-specific requirements.\n- **Enable Dynamic Request Sending**: Leverage the factory pattern to create request senders on the fly, tailored to different authentication or configuration settings.\n\n## Installation & Setup\n\nInstall the package using pnpm:\n\n```bash\npnpm add @dmitryrechkin/request-sender-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### Specialized for Nylas API Integration\n\nThe `Request Sender Nylas` library extends the `Request Sender Core` to provide a specialized implementation for the Nylas API. By building on top of a unified interface, this library ensures that you can easily integrate Nylas-specific functionality while maintaining consistency across your codebase.\n\n- **Simplified API Calls**: By abstracting the Nylas-specific logic, you can focus on your application's business logic without worrying about the details of API integration.\n- **Extensible Design**: The use of the factory pattern allows for dynamic creation of request sender instances, making your application more modular and adaptable to different environments.\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"}