{"_id":"@appitude/lcms-storage","_rev":"6-b87fc6b3ad86671c66e7c634cdcfcef5","name":"@appitude/lcms-storage","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.1":{"name":"@appitude/lcms-storage","version":"0.1.1","keywords":["lcms","storage","assets","upload","cdn","files","typescript"],"author":{"name":"Appitude","email":"support@appitudeio.com"},"license":"MIT","_id":"@appitude/lcms-storage@0.1.1","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/appitudeio/lcms-storage-node#readme","bugs":{"url":"https://github.com/appitudeio/lcms-storage-node/issues"},"dist":{"shasum":"9ef56b3bc836f642212bd21615df0980a0e76311","tarball":"https://registry.npmjs.org/@appitude/lcms-storage/-/lcms-storage-0.1.1.tgz","fileCount":9,"integrity":"sha512-3cpkzdofzHVl305DFMS/AHrCJPuKJJL1FNPbWdbM3nghCmfvg+hDs6/nFEZtUt++wfpOm0B8aWy6SgotZa2aFw==","signatures":[{"sig":"MEUCIQCNI/B6IC6oFObEYmHmRds3ZDybYEMZ9iWuyPTol0jMTwIgMt6nLCJdbSYcK3nbT/uUootAuQlqYMp06Ep/YNmyP7o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19961},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"ce04b85f703f2fc3d5719609cf66f4d057d69f34","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"oakleaf","email":"mathiaseklof@gmail.com"},"repository":{"url":"git+https://github.com/appitudeio/lcms-storage-node.git","type":"git"},"_npmVersion":"11.6.0","description":"Official TypeScript/JavaScript SDK for LCMS Storage - Asset management and CDN platform","directories":{},"_nodeVersion":"24.10.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/lcms-storage_0.1.1_1763297501350_0.35044057047079824","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@appitude/lcms-storage","version":"0.2.1","keywords":["lcms","storage","assets","upload","cdn","typescript"],"author":{"name":"Appitude","email":"support@appitudeio.com"},"license":"MIT","_id":"@appitude/lcms-storage@0.2.1","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/appitudeio/lcms-storage-node#readme","bugs":{"url":"https://github.com/appitudeio/lcms-storage-node/issues"},"dist":{"shasum":"baa7d9e8cdde8be4eb99967a4e9d3bc698fe715f","tarball":"https://registry.npmjs.org/@appitude/lcms-storage/-/lcms-storage-0.2.1.tgz","fileCount":9,"integrity":"sha512-PBVD6rACAqRhSQl6WFzzVExO1xSB2P071LefAVGblB6zbb+9crNAs4zCmrtoFuPWh4EoGr7ZY+fMiN/neIWXJQ==","signatures":[{"sig":"MEUCIQCVYCX2hYym/RIz/gUbWYs0wdkWbfFIM2ZPjr2jOrq8gAIgKjxo4BKw3wgurPwAGwRuJeS4vq7Uf3fakTNIgqdbWl8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19913},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"70f23c2a93f32c15e1f1cc4ae00a69358b4a3c2e","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:44cb6716-7854-481b-bb2c-eb99053eab96"}},"repository":{"url":"git+https://github.com/appitudeio/lcms-storage-node.git","type":"git"},"_npmVersion":"11.11.1","description":"Official TypeScript/JavaScript SDK for LCMS Storage","directories":{},"_nodeVersion":"20.20.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/lcms-storage_0.2.1_1773857056738_0.8311329820786946","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@appitude/lcms-storage","version":"0.2.2","description":"Official TypeScript/JavaScript SDK for LCMS Storage","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["lcms","storage","assets","upload","cdn","typescript"],"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"author":{"name":"Appitude","email":"support@appitudeio.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/appitudeio/lcms-storage-node.git"},"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.0.0"},"gitHead":"10e43376f417018e06726228c1852ffef6458e94","_id":"@appitude/lcms-storage@0.2.2","bugs":{"url":"https://github.com/appitudeio/lcms-storage-node/issues"},"homepage":"https://github.com/appitudeio/lcms-storage-node#readme","_nodeVersion":"20.20.1","_npmVersion":"11.11.1","dist":{"integrity":"sha512-hkc3UfzsG0aq8IxB2j1mZdFH9lVgoHKI/8pHHAnR72NOHgdaIlLEcLeLvNhTGNcfVMBLp/GHgh+ZspevdqvMOA==","shasum":"29ffffa6ad3f4719ba9751a104fbc89ca3534afa","tarball":"https://registry.npmjs.org/@appitude/lcms-storage/-/lcms-storage-0.2.2.tgz","fileCount":9,"unpackedSize":19912,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAYHeKIiPVueaN1TqCrYxS0xHgx4d5zHG2eSst+rPzRSAiBLoBaVww7Flj/IzSIvjRnF7TgJM6glUbzoJ9wolblbUA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:44cb6716-7854-481b-bb2c-eb99053eab96"}},"directories":{},"maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lcms-storage_0.2.2_1773860858020_0.029102982530259558"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-16T12:51:41.199Z","modified":"2026-03-18T19:07:39.005Z","0.1.0":"2025-11-13T17:30:33.812Z","0.1.1":"2025-11-16T12:51:41.543Z","0.2.1":"2026-03-18T18:04:16.930Z","0.2.2":"2026-03-18T19:07:38.848Z"},"bugs":{"url":"https://github.com/appitudeio/lcms-storage-node/issues"},"author":{"name":"Appitude","email":"support@appitudeio.com"},"license":"MIT","homepage":"https://github.com/appitudeio/lcms-storage-node#readme","keywords":["lcms","storage","assets","upload","cdn","typescript"],"repository":{"type":"git","url":"git+https://github.com/appitudeio/lcms-storage-node.git"},"description":"Official TypeScript/JavaScript SDK for LCMS Storage","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"readme":"# LCMS Storage - TypeScript/Node.js SDK\n\nOfficial TypeScript/JavaScript SDK for LCMS Storage - Asset management and CDN platform.\n\n## Features\n\n- Upload files to LCMS Storage from file paths or Buffers\n- Delete assets from storage\n- List directory contents\n- Generate asset URLs with automatic CDN delivery\n- Full TypeScript support with type definitions\n- Zero dependencies (uses native fetch API)\n- Works in Node.js 18+ and modern browsers\n\n## Requirements\n\n- Node.js 18.0 or higher\n- npm or yarn\n\n## Installation\n\n```bash\nnpm install @appitudeio/lcms-storage\n```\n\n## Quick Start\n\n```typescript\nimport { Storage } from '@appitudeio/lcms-storage';\n\n// Initialize client\nconst storage = new Storage('your-domain.com', 'your_api_key');\n\n// Upload a file\nconst response = await storage.upload('/path/to/local/image.jpg', '/uploads/image.jpg');\nconsole.log('Uploaded to:', response.url.asset);\n\n// List directory contents\nconst listing = await storage.list('/uploads');\nfor (const item of listing.items) {\n  console.log(`${item.key} - ${item.url}`);\n}\n\n// Delete file\nawait storage.delete('/uploads/old-image.jpg');\n```\n\n## API Reference\n\n### Constructor\n\n```typescript\nconst storage = new Storage(domain: string, apiKey: string);\n```\n\nInitialize the LCMS Storage client with your domain and API key.\n\n---\n\n### upload()\n\n```typescript\nasync upload(\n  filePathOrBuffer: string | Buffer,\n  remotePath: string,\n  contentType?: string\n): Promise<UploadResponse>\n```\n\nUpload a file to LCMS Storage.\n\n**Examples:**\n```typescript\n// Upload from file path (MIME type auto-detected)\nconst response = await storage.upload('/tmp/photo.jpg', '/gallery/photo.jpg');\n\n// Upload from Buffer (contentType required)\nimport { readFileSync } from 'fs';\nconst buffer = readFileSync('/tmp/photo.jpg');\nconst response = await storage.upload(buffer, '/gallery/photo.jpg', 'image/jpeg');\n\n// Check response\nif (response.success) {\n  console.log('Uploaded:', response.url.asset);\n}\n```\n\n---\n\n### delete()\n\n```typescript\nasync delete(path: string): Promise<void>\n```\n\nDelete a file from LCMS Storage.\n\n**Example:**\n```typescript\nawait storage.delete('/gallery/old-photo.jpg');\n```\n\n---\n\n### list()\n\n```typescript\nasync list(path: string = ''): Promise<ListResponse>\n```\n\nList contents of a directory.\n\n**Example:**\n```typescript\nconst listing = await storage.list('/gallery');\n\nconsole.log('Directory:', listing.path);\nconsole.log('Total files:', listing.count());\n\n// List files\nfor (const item of listing.items) {\n  console.log(`${item.key} - ${item.size} bytes`);\n  console.log(`URL: ${item.url}`);\n}\n\n// List subdirectories\nfor (const prefix of listing.prefixes) {\n  console.log(`Subdirectory: ${prefix}`);\n}\n\n// Check if empty\nif (listing.isEmpty()) {\n  console.log('Directory is empty');\n}\n```\n\n---\n\n## Response Objects\n\n### UploadResponse\n\n**Properties:**\n- `boolean success` - Whether upload was successful\n- `string message` - Success or error message\n- `object url` - Contains 'asset' and 'upload' URLs\n\n**Methods:**\n- `toObject(): Record<string, any>`\n- `toJson(): string`\n\n### ListResponse\n\n**Properties:**\n- `boolean success` - Whether the operation was successful\n- `string message` - Success or error message\n- `string path` - Directory path that was listed\n- `string assetBaseUrl` - Base URL for accessing assets\n- `ListItem[] items` - Array of file items with 'key', 'size', 'lastModified', 'url'\n- `string[] prefixes` - Array of subdirectory prefixes\n\n**Methods:**\n- `count(): number` - Number of items\n- `isEmpty(): boolean` - Whether directory is empty\n- `toObject(): Record<string, any>`\n- `toJson(): string`\n\n---\n\n## Error Handling\n\n```typescript\ntry {\n  const response = await storage.upload('/path/to/file.jpg', '/uploads/file.jpg');\n  if (response.success) {\n    console.log('Success:', response.url.asset);\n  } else {\n    console.log('Upload failed:', response.message);\n  }\n} catch (error) {\n  console.error('Upload error:', error.message);\n}\n```\n\n---\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n\n---\n\n## Support\n\nFor issues and questions:\n- GitHub Issues: [lcms-storage-node/issues](https://github.com/appitudeio/lcms-storage-node/issues)\n- Email: support@appitudeio.com\n\n---\n\n## Related\n\n- [LCMS Storage PHP SDK](https://github.com/appitudeio/LCMS-Storage-php)\n- [LCMS Documentation](https://docs.logicalcms.com)\n","readmeFilename":"README.md"}