{"_id":"@10d3/printflow","_rev":"4-d6cc8787d0b3ffc01399bb65671da372","name":"@10d3/printflow","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@10d3/printflow","version":"1.0.0","keywords":["apliiq","api-client","print-on-demand","ecommerce","typescript","pod","custom-apparel","order-management"],"author":{"name":"10d3","email":"ffast2000@gmail.com"},"license":"MIT","_id":"@10d3/printflow@1.0.0","maintainers":[{"name":"10d3","email":"ffast2000@gmail.com"}],"homepage":"https://github.com/10d3/printflow#readme","bugs":{"url":"https://github.com/10d3/printflow/issues"},"dist":{"shasum":"0deaa4adbcd125b7a255a0c3c4c279694ba42c72","tarball":"https://registry.npmjs.org/@10d3/printflow/-/printflow-1.0.0.tgz","fileCount":10,"integrity":"sha512-XVd2fTXE8CD8lF9ZNcs43KQkjaDIvAHBp9EPqGU4GoBS3bu8MCCIjceCTGLxodbgkcFClKN4RULuvI8S3GG1mA==","signatures":[{"sig":"MEQCICL8kQ7l7fW2S4RJyIIbEiFBN+0WlRomp+XDe8pUQJcFAiBV2DwrrZYyC+YBruRjrX9PihgDkvuBLoYADoK+EH0RBA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27889},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"src/index.ts","gitHead":"1dd47482372d9ae081ff9b29ac11e06995ff0df9","private":false,"scripts":{"dev":"bun run src/index.ts","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"10d3","email":"ffast2000@gmail.com"},"repository":{"url":"git+https://github.com/10d3/printflow.git","type":"git"},"_npmVersion":"10.7.0","description":"TypeScript client for Apliiq's Print-on-Demand API","directories":{},"_nodeVersion":"20.15.0","dependencies":{"zod":"^3.24.2","axios":"^1.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/printflow_1.0.0_1741208943207_0.812492809774165","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@10d3/printflow","version":"1.0.1","keywords":["apliiq","api-client","print-on-demand","ecommerce","typescript","pod","custom-apparel","order-management"],"author":{"name":"10d3","email":"ffast2000@gmail.com"},"license":"MIT","_id":"@10d3/printflow@1.0.1","maintainers":[{"name":"10d3","email":"ffast2000@gmail.com"}],"homepage":"https://github.com/10d3/printflow#readme","bugs":{"url":"https://github.com/10d3/printflow/issues"},"dist":{"shasum":"dd4e317adde5ebb75f770c10a8af38a4f456fa9b","tarball":"https://registry.npmjs.org/@10d3/printflow/-/printflow-1.0.1.tgz","fileCount":10,"integrity":"sha512-HwfjWDyInj7IJirFt6iuZSWJ8pUaTed5EPnCZNp6IIKRMAecRHn5PJCBJ1U1gffoBXgITHIfwDzaDXS4T0zOHw==","signatures":[{"sig":"MEUCICChx2jYLp5ceO9ZsI124ojH8xjo2lMv2qrDuEpyR1kfAiEA2DXBEITtOM1gzSoLbesMOIgfa02EjdPNPh3BN0IhN4w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29437},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"src/index.ts","gitHead":"762164bae7f40ae7c4aff5f1f1276e4004bdeae9","private":false,"scripts":{"dev":"bun run src/index.ts","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"10d3","email":"ffast2000@gmail.com"},"repository":{"url":"git+https://github.com/10d3/printflow.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript client for Apliiq's Print-on-Demand API","directories":{},"_nodeVersion":"18.20.7","dependencies":{"zod":"^3.24.2","axios":"^1.8.1","lru-cache":"^11.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/printflow_1.0.1_1741209773426_0.21094461234419448","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@10d3/printflow","version":"1.0.2","keywords":["apliiq","api-client","print-on-demand","ecommerce","typescript","pod","custom-apparel","order-management"],"author":{"name":"10d3","email":"ffast2000@gmail.com"},"license":"MIT","_id":"@10d3/printflow@1.0.2","maintainers":[{"name":"10d3","email":"ffast2000@gmail.com"}],"homepage":"https://github.com/10d3/printflow#readme","bugs":{"url":"https://github.com/10d3/printflow/issues"},"dist":{"shasum":"aedaf4022b1367a89e5fc5af66b8568f2192d67e","tarball":"https://registry.npmjs.org/@10d3/printflow/-/printflow-1.0.2.tgz","fileCount":10,"integrity":"sha512-leIAD5gnEQWtKUMHlbQBtpDMwlw5dEpod1ppKYur9ixGnQMy2IS+7njjSMdHPhNvnzVtngApTuiO+nuuRRNpDQ==","signatures":[{"sig":"MEQCICPYNuryIQxTAlNNRnzUVHcmG5CP7gD16EnlfdyKXME4AiBEzC9EaF6Qw1zczjCuvbzFrS1IXqhoXA5nBdHX65Z4tw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28241},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"src/index.ts","gitHead":"d6e772113b120df95bb9ff1708c5b5bd522e5982","private":false,"scripts":{"dev":"bun run src/index.ts","build":"tsc","prepublish":"npm run build"},"_npmUser":{"name":"10d3","email":"ffast2000@gmail.com"},"repository":{"url":"git+https://github.com/10d3/printflow.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript client for Apliiq's Print-on-Demand API","directories":{},"_nodeVersion":"18.20.7","dependencies":{"zod":"^3.24.2","axios":"^1.8.1","lru-cache":"^11.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/printflow_1.0.2_1741380369490_0.5321870130517508","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@10d3/printflow","module":"src/index.ts","type":"module","main":"dist/index.js","types":"dist/index.d.ts","private":false,"scripts":{"build":"tsc","prepublish":"npm run build","dev":"bun run src/index.ts"},"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"keywords":["apliiq","api-client","print-on-demand","ecommerce","typescript","pod","custom-apparel","order-management"],"dependencies":{"axios":"^1.8.1","lru-cache":"^11.0.2","zod":"^3.24.2"},"author":{"name":"10d3","email":"ffast2000@gmail.com"},"license":"MIT","description":"[![npm version](https://img.shields.io/npm/v/@10d3/printflow.svg?style=flat-square)](https://www.npmjs.com/package/@10d3/printflow) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE) [![GitHub Repository](https:","repository":{"type":"git","url":"git+https://github.com/10d3/printflow.git"},"version":"1.0.3","publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"_id":"@10d3/printflow@1.0.3","gitHead":"3eee70a532aa907bc5833f7243ce695942fd737a","bugs":{"url":"https://github.com/10d3/printflow/issues"},"homepage":"https://github.com/10d3/printflow#readme","_nodeVersion":"18.20.7","_npmVersion":"10.8.2","dist":{"integrity":"sha512-F5QI0t4svbcoITJSMz206enNos7K502fo2E/drxx4iYBsixI81HSKuh0ADrsW9ad4dgFBxD4UaZyzAkLwwxSUA==","shasum":"99d55aef1545621ff25792a7c5d29f2088d5f8e7","tarball":"https://registry.npmjs.org/@10d3/printflow/-/printflow-1.0.3.tgz","fileCount":10,"unpackedSize":35913,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFtXJQMk1h7YZK+tWMOFk9vQHLxg2WicBcuV/ZtmOGk0AiEA1p8lYoERdzQhfSfFDfzWmgy9LuUmV9E63HYCS8Joe0o="}]},"_npmUser":{"name":"10d3","email":"ffast2000@gmail.com"},"directories":{},"maintainers":[{"name":"10d3","email":"ffast2000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/printflow_1.0.3_1741414429606_0.012898648458541606"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-05T21:09:03.108Z","modified":"2025-03-08T06:13:49.955Z","1.0.0":"2025-03-05T21:09:03.357Z","1.0.1":"2025-03-05T21:22:53.599Z","1.0.2":"2025-03-07T20:46:09.680Z","1.0.3":"2025-03-08T06:13:49.811Z"},"bugs":{"url":"https://github.com/10d3/printflow/issues"},"author":{"name":"10d3","email":"ffast2000@gmail.com"},"license":"MIT","homepage":"https://github.com/10d3/printflow#readme","keywords":["apliiq","api-client","print-on-demand","ecommerce","typescript","pod","custom-apparel","order-management"],"repository":{"type":"git","url":"git+https://github.com/10d3/printflow.git"},"description":"[![npm version](https://img.shields.io/npm/v/@10d3/printflow.svg?style=flat-square)](https://www.npmjs.com/package/@10d3/printflow) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE) [![GitHub Repository](https:","maintainers":[{"name":"10d3","email":"ffast2000@gmail.com"}],"readme":"# @10d3/printflow\n\n[![npm version](https://img.shields.io/npm/v/@10d3/printflow.svg?style=flat-square)](https://www.npmjs.com/package/@10d3/printflow)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)\n[![GitHub Repository](https://img.shields.io/badge/GitHub-Repository-brightgreen)](https://github.com/10d3/printflow)\n\nModern TypeScript SDK for integrating with Apliiq's Print-on-Demand API. Handle product catalog management, order processing, and inventory tracking with full type safety and caching support.\n\n## Features\n\n- **Full TypeScript Support** - Built with TypeScript 5 and Zod validation\n- **Intelligent Caching** - LRU caching with customizable TTL strategies\n- **Security** - HMAC authentication for API requests\n- **Error Handling** - Structured error classes with context details\n- **ESM Support** - Modern module system for better tree-shaking\n\n## Installation\n\n```bash\nnpm install @10d3/printflow\n# or\nbun add @10d3/printflow\n```\n\n## Configuration\n\nCreate a client instance with your Apliiq credentials:\n\n```typescript\nimport { ApliiqClient } from '@10d3/printflow';\n\nconst client = new ApliiqClient({\n  appId: 'YOUR_APP_ID',\n  sharedSecret: 'YOUR_SHARED_SECRET',\n  endpoint: 'https://api.apliiq.com/v1', // Optional\n  timeout: 15000, // 15 seconds\n  cache: {\n    enabled: true,\n    max: 1000,\n    ttl: 300000, // 5 minutes\n    products: {\n      ttl: 60000, // 1 minute per product\n      batchTTL: 180000 // 3 minutes for product lists\n    }\n  }\n});\n```\n\n## Usage\n\n### Product API\n\n<Tabs> <Tab label=\"Get All Products\">\n\n```typescript\nasync function listProducts() {\n  try {\n    const products = await client.getProducts();\n    console.log('Available products:', products);\n  } catch (error) {\n    console.error('Failed to fetch products:', error.message);\n  }\n}\n```\n</Tab> <Tab label=\"Get Single Product\">\n\n```typescript\nasync function listProducts() {\n  try {\n    const products = await client.getProducts();\n    console.log('Available products:', products);\n  } catch (error) {\n    console.error('Failed to fetch products:', error.message);\n  }\n}\n```\n</Tab></Tabs>\n\n### Order API\n\n#### Create Order\n\n```typescript\ntry {\n  const orderResponse = await client.createOrder({\n    number: 1006,\n    name: \"#1006\",\n    order_number: 1006,\n    line_items: [\n      {\n        id: \"1511138222\",\n        title: \"cotton heritage polly pocket\",\n        quantity: 1,\n        price: \"45.50\",\n        sku: \"APQ-1998244S7A1\",\n      },\n    ],\n    shipping_address: {\n      first_name: \"john\",\n      last_name: \"smith\",\n      address1: \"1692 Avenue du Mont-Royal Est\",\n      city: \"los angeles\",\n      zip: \"90013\",\n      province: \"California\",\n      country: \"United States\",\n      country_code: \"US\",\n      province_code: \"CA\",\n    },\n  });\n  console.log(\"Order created:\", orderResponse.id);\n} catch (error) {\n  if (error instanceof ApliiqError) {\n    console.error(`Order failed: ${error.message}`);\n  }\n}\n```\n\n## Caching\n\nThe client includes built-in LRU caching support for product data:\n\n```typescript\nconst client = new ApliiqClient({\n  appId: \"your-app-id\",\n  sharedSecret: \"your-shared-secret\",\n  cache: {\n    enabled: true, // Enable caching\n    max: 1000, // Maximum number of items (default: 1000)\n    ttl: 300000, // Time-to-live in ms (default: 5 minutes)\n  },\n});\n\n// Get cache statistics\nconst stats = client.getCacheStats(); // Returns: { size: number }\n\n// Clear entire cache\nclient.clearCache();\n\n// Clear specific product\nclient.clearProductCache(123);\n\n// Clear all products\nclient.clearProductsCache();\n```\n\n## TypeScript Types\n\nThe client provides built-in type definitions for all API operations:\n\n```typescript\nimport {\n  ApliiqConfig,\n  Product,\n  ApliiqOrder,\n  ApliiqOrderResponse,\n} from \"apliiq-client\";\n\n// Configuration type\nconst config: ApliiqConfig = {\n  appId: \"your-app-id\",\n  sharedSecret: \"your-shared-secret\",\n  cache: {\n    enabled: true,\n    max: 1000,\n    ttl: 300000,\n  },\n};\n\n// Product type\nconst product: Product = await client.getProduct(162);\n// {\n//   Id: number;\n//   Name: string;\n//   SKU: string;\n//   Colors: Array<{ Id: number; Name: string }>;\n//   Sizes: Array<{ Id: number; Name: string; Weight: string; PlusSize_Fee: number }>;\n//   // ... other properties\n// }\n\n// Order type\nconst order: ApliiqOrder = {\n  number: 1006,\n  name: \"#1006\",\n  order_number: 1006,\n  line_items: [\n    {\n      id: \"1511138222\",\n      title: \"cotton heritage polly pocket\",\n      quantity: 1,\n      price: \"45.50\",\n      sku: \"APQ-1998244S7A1\",\n    },\n  ],\n  shipping_address: {\n    first_name: \"john\",\n    last_name: \"smith\",\n    address1: \"1692 Avenue du Mont-Royal Est\",\n    city: \"los angeles\",\n    zip: \"90013\",\n    province: \"California\",\n    country: \"United States\",\n    country_code: \"US\",\n    province_code: \"CA\",\n  },\n};\n\n// Order response type\nconst response: ApliiqOrderResponse = await client.createOrder(order);\n// { id: number }\n```\n\nAll types include full TypeScript intellisense support and runtime validation through Zod schemas.\n\n## Error Handling\n\n```typescript\ntry {\n  await client.createOrder(/* ... */);\n} catch (error) {\n  if (error instanceof ApliiqError) {\n    console.error(`API Error (${error.statusCode}): ${error.message}`);\n    if (error.details) console.error(\"Details:\", error.details);\n  }\n}\n```\n\n### Common Error Scenarios\n\n- Validation Errors: Zod schema validation failures\n- 401 Unauthorized: Invalid HMAC signature\n- 202 Accepted: Order received but not yet processed\n\n## Response Examples\n\n### Product Response\n\n```json\n{\n  \"Id\": 162,\n  \"Name\": \"womens t shirt\",\n  \"SKU\": \"6004\",\n  \"Price\": 6,\n  \"Sizes\": [\n    {\n      \"Id\": 6,\n      \"Name\": \"s\",\n      \"Weight\": \"16 oz\",\n      \"PlusSize_Fee\": 0\n    }\n  ],\n  \"Colors\": [\n    {\n      \"Id\": 50,\n      \"Name\": \"black\"\n    }\n  ]\n}\n```\n\n### Order Response\n\n```json\n{\n  \"id\": 567890\n}\n```\n\n## Rate Limiting\n\nThe API currently doesn't specify rate limits. It's recommended to implement retry logic for production use.\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build project\nnpm run build\n\n# Run tests\nnpm test\n```\n\n## Contribution\n\n- Clone repository\n\n```bash\ngit clone https://github.com/10d3/printflow.git\n```\n\n- Install dep\n\n```bash\nbun install\n```\n\n- Build the project\n\n```bash\nbun run build\n```\n\n- Submit PR with tests\n\n## License\n\nMIT - See [LICENSE](LICENSE) © [10d3](https://github.com/10d3)\n\n## Documentation\n\nFor complete API documentation, visit [Apliiq API Docs](https://help.apliiq.com/portal/en/kb/help/api)\n","readmeFilename":"README.md"}