{"_id":"@arqam-formsoft/card-sdk","_rev":"1-6c9e11610732031abd321667097cf34f","name":"@arqam-formsoft/card-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@arqam-formsoft/card-sdk","version":"1.0.0","keywords":["sdk","card","api"],"author":{"name":"Arqam Shakil"},"license":"ISC","_id":"@arqam-formsoft/card-sdk@1.0.0","maintainers":[{"name":"arqam-formsoft","email":"arqam.shakil@formsoft-inc.com"}],"dist":{"shasum":"41c30f3ce91e6f20df02b95f5e0af90933f9cbbb","tarball":"https://registry.npmjs.org/@arqam-formsoft/card-sdk/-/card-sdk-1.0.0.tgz","fileCount":4,"integrity":"sha512-+LRt/cfppI/N+XUVwlj3m0RLUUIOYhw8Y7UopoUT6PN3dD+RA3Ty0aZhObMEln0H9BLAdss0QJLlnkxkEhDG4w==","signatures":[{"sig":"MEYCIQD8YfiT2rbcNXVLRRfZLx4P2loO0852uyQmnLhO8/85+AIhANdk1dv/5okBrFe3aaP/NpeKsTK3UaKfRX9cE5CnqVy2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3019},"main":"index.js","gitHead":"104aa9306ca774a26be1c67a57cf2a61d0a8185f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"arqam-formsoft","email":"arqam.shakil@formsoft-inc.com"},"_npmVersion":"10.9.2","description":"SDK for interacting with the Card API","directories":{},"_nodeVersion":"23.7.0","dependencies":{"axios":"^0.21.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/card-sdk_1.0.0_1740496967119_0.010756790622956869","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arqam-formsoft/card-sdk","version":"1.0.1","description":"SDK for interacting with the Card API","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["sdk","card","api"],"author":{"name":"Arqam Shakil"},"license":"ISC","dependencies":{"axios":"^0.21.1"},"_id":"@arqam-formsoft/card-sdk@1.0.1","gitHead":"104aa9306ca774a26be1c67a57cf2a61d0a8185f","_nodeVersion":"23.7.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-oryAkCUselWcUvGiA3+6ekg9uLIqFFvRAJ0dAnIiG3ELFjPSwVSuafXybKLsB6Hv2AooxikW1NvXlaBpsWQqcQ==","shasum":"0f09421a073524d5a8075571384cb535676e4f22","tarball":"https://registry.npmjs.org/@arqam-formsoft/card-sdk/-/card-sdk-1.0.1.tgz","fileCount":5,"unpackedSize":5312,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBncEL7QhEUbhXyPOU0x/G2/+gMseYM2r7IHtU7ednlhAiB1BnpTJ8AC45FdLuNo0IyX487yYW61+IZTM3opaYdbEg=="}]},"_npmUser":{"name":"arqam-formsoft","email":"arqam.shakil@formsoft-inc.com"},"directories":{},"maintainers":[{"name":"arqam-formsoft","email":"arqam.shakil@formsoft-inc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/card-sdk_1.0.1_1740497864041_0.11514318124634748"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-25T15:22:47.027Z","modified":"2025-02-25T15:37:44.353Z","1.0.0":"2025-02-25T15:22:47.276Z","1.0.1":"2025-02-25T15:37:44.202Z"},"author":{"name":"Arqam Shakil"},"license":"ISC","keywords":["sdk","card","api"],"description":"SDK for interacting with the Card API","maintainers":[{"name":"arqam-formsoft","email":"arqam.shakil@formsoft-inc.com"}],"readme":"# card-sdk\n\nSDK for interacting with the Card API.\n\n## Installation\n\nInstall the package using npm:\n\n```sh\nnpm install @arqam-formsoft/card-sdk\n```\n\n## Usage\n\nFirst, require the package and create an instance of the SDK with the base URL of your API:\n\n```javascript\nconst CardSDK = require('@arqam-formsoft/card-sdk');\n\nconst sdk = new CardSDK('http://localhost:8000');\n```\n\n## Functions\n\n### `createCard(card)`\n\nCreates a new card.\n\n**Parameters:**\n- `card` (Object): The card object to create. Example: `{ name: 'Test Card', number: 1234 }`\n\n**Returns:**\n- The created card object.\n\n**Example:**\n```javascript\nconst newCard = await sdk.createCard({ name: 'Test Card', number: 1234 });\nconsole.log('Created Card:', newCard);\n```\n\n### `getCard(id)`\n\nFetches a card by its ID.\n\n**Parameters:**\n- `id` (String): The ID of the card to fetch.\n\n**Returns:**\n- The card object.\n\n**Example:**\n```javascript\nconst card = await sdk.getCard('60d5f9b8f8d2e8b5b8f8b8f8');\nconsole.log('Fetched Card:', card);\n```\n\n### `getAllCards()`\n\nFetches all cards.\n\n**Returns:**\n- An array of card objects.\n\n**Example:**\n```javascript\nconst allCards = await sdk.getAllCards();\nconsole.log('All Cards:', allCards);\n```\n\n### `updateCard(id, card)`\n\nUpdates a card by its ID.\n\n**Parameters:**\n- `id` (String): The ID of the card to update.\n- `card` (Object): The card object with updated data. Example: `{ name: 'Updated Card', number: 5678 }`\n\n**Returns:**\n- The updated card object.\n\n**Example:**\n```javascript\nconst updatedCard = await sdk.updateCard('60d5f9b8f8d2e8b5b8f8b8f8', { name: 'Updated Card', number: 5678 });\nconsole.log('Updated Card:', updatedCard);\n```\n\n### `deleteCard(id)`\n\nDeletes a card by its ID.\n\n**Parameters:**\n- `id` (String): The ID of the card to delete.\n\n**Returns:**\n- A success message.\n\n**Example:**\n```javascript\nconst deleteResponse = await sdk.deleteCard('60d5f9b8f8d2e8b5b8f8b8f8');\nconsole.log('Deleted Card:', deleteResponse);\n```\n\n## Error Handling\n\nEach function throws an error if the request fails. You can catch these errors using a try-catch block:\n\n```javascript\ntry {\n\tconst newCard = await sdk.createCard({ name: 'Test Card', number: 1234 });\n\tconsole.log('Created Card:', newCard);\n} catch (error) {\n\tconsole.error('Error:', error);\n}\n```\n\n## License\n\nISC\n","readmeFilename":"README.md"}