{"_rev":"35-dc8e20384443fa9d10f7bbaaf920e9ae","time":{"created":"2025-09-15T19:20:43.630Z","modified":"2025-09-15T19:20:44.248Z","1.0.0":"2024-01-17T23:34:55.968Z","0.0.1":"2024-01-18T10:22:45.551Z","0.0.2":"2024-01-18T10:59:46.157Z","0.0.3":"2024-01-18T11:02:56.654Z","0.0.4":"2024-01-18T11:04:14.484Z","0.0.5":"2024-02-18T14:04:33.130Z","0.0.6":"2024-03-11T12:00:39.433Z","0.0.7":"2024-03-11T14:16:45.666Z","1.0.2":"2024-03-16T18:29:13.636Z","1.0.3":"2024-03-16T20:26:02.579Z","1.0.4":"2024-03-20T00:14:37.663Z","1.0.5":"2024-03-20T00:15:05.452Z","1.0.7":"2024-06-17T21:55:37.653Z","1.0.8":"2024-11-25T18:23:11.405Z","1.0.9":"2024-11-26T06:19:37.041Z","1.0.10":"2024-11-26T06:31:57.948Z","1.0.11":"2024-11-26T06:38:24.154Z","1.0.13":"2024-11-28T10:35:24.801Z","1.0.15":"2024-11-28T14:04:19.756Z","1.0.17":"2025-01-21T22:49:20.447Z","1.0.18":"2025-01-21T22:59:48.255Z","1.0.19":"2025-01-21T23:02:10.613Z","1.0.20":"2025-01-21T23:05:14.023Z","1.0.21":"2025-01-22T00:11:11.349Z","1.0.22":"2025-01-22T00:13:57.966Z","1.0.24":"2025-02-05T09:41:49.984Z","1.0.25":"2025-02-05T09:44:08.244Z","1.0.26":"2025-02-06T18:41:25.220Z","1.0.27":"2025-02-07T09:57:19.476Z","1.0.29":"2025-02-11T17:26:22.693Z","1.0.30":"2025-02-22T15:03:28.816Z","1.1.1":"2025-02-22T15:03:54.546Z","1.3.3":"2025-09-15T19:20:43.875Z"},"_id":"genuka","name":"genuka","dist-tags":{"latest":"1.3.3"},"versions":{"1.3.3":{"name":"genuka","version":"1.3.3","description":"Javascript(TS) Package to use Genuka API for a StoreFront website","main":"./dist/index.ts","module":"./dist/index.mjs","types":"./dist/index.d.ts","type":"module","scripts":{"test":"test","build":"tsup","clean":"rm -r dist","deploy":"tsup && npm version patch && npm publish","updateLink":"npm run clean && tsc && npm rm genuka -g && npm run build && rm -rf node_modules/.cache/  && npm link"},"repository":{"type":"git","url":"git+https://gitlab.com/genuka/genuka-package.git"},"keywords":["JS","Genuka","Ecommerce","Accountant","Delivery","Orders","Customers"],"author":{"name":"Genuka SARL."},"license":"ISC","bugs":{"url":"https://gitlab.com/genuka/genuka-package/issues"},"homepage":"https://gitlab.com/genuka/genuka-package#readme","dependencies":{"@types/jest":"^29.5.11","@types/node":"^20.11.4","axios":"^1.6.5","jest":"^29.7.0","ts-node":"^10.9.2","typescript":"^5.3.3","uuid":"^11.1.0"},"devDependencies":{"tsup":"^8.0.1","tsx":"^4.20.5"},"packageManager":"yarn@4.5.1+sha512.341db9396b6e289fecc30cd7ab3af65060e05ebff4b3b47547b278b9e67b08f485ecd8c79006b405446262142c7a38154445ef7f17c1d5d1de7d90bf9ce7054d","_id":"genuka@1.3.3","gitHead":"f09f8c4cb8fbcdeb122a35c3a0ed71f107d24a44","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-33zFrPRbgUUrVMhLZVrkBgQsG9Nmps4vDDs3j1lmA+5+mnt/ALLPNwGw2WDqiZj8eCVtMtqUbJOtwMW17X6few==","shasum":"6d8b10d3e6dd3cee0e185574762ed9a0fda186d8","tarball":"https://registry.npmjs.org/genuka/-/genuka-1.3.3.tgz","fileCount":13,"unpackedSize":588625,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEEOwboc4ommu2jgLVbIANIfv4J6DTmxBc65gTu0pMCCAiAYdehP8LZL8zTQeNL5PXZGDThkdwzAQO9PAO1639bXpw=="}]},"_npmUser":{"name":"wdjopa","email":"it@genuka.com"},"directories":{},"maintainers":[{"name":"wdjopa","email":"it@genuka.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/genuka_1.3.3_1757964043631_0.1683332813849805"},"_hasShrinkwrap":false}},"maintainers":[{"name":"wdjopa","email":"it@genuka.com"}],"description":"Javascript(TS) Package to use Genuka API for a StoreFront website","homepage":"https://gitlab.com/genuka/genuka-package#readme","keywords":["JS","Genuka","Ecommerce","Accountant","Delivery","Orders","Customers"],"repository":{"type":"git","url":"git+https://gitlab.com/genuka/genuka-package.git"},"author":{"name":"Genuka SARL."},"bugs":{"url":"https://gitlab.com/genuka/genuka-package/issues"},"license":"ISC","readme":"# Genuka JS SDK\n\nThe Genuka JavaScript SDK allows developers to easily integrate the features of the Genuka platform into their web applications. This SDK provides methods to manage companies, shops, products, pages, blogs, articles, collections, customers, addresses, orders, carts, and payment methods.\n\n## Installation\n\n```bash\nnpm install genuka\n```\n\nor\n\n```bash\nyarn add genuka\n```\n\n## Usage\n\nTo start using the SDK, you must first import it into your project and initialize it with your company information.\n\n```javascript\nimport genuka from \"genuka\";\n\n// Initialize the instance with your company's domain\ngenuka.initialize({ domain: \"your.domain.com\" });\n```\n\n### Company\n\n#### Initialization\n\nInitialize your company information before using the SDK.\n\n```javascript\nawait genuka.initialize({ domain: \"domain_or_subdomain.genuka.com\" });\n```\n\n#### Retrieving Company Details\n\nTo retrieve your company details:\n\n```javascript\nconst company = await genuka.company.retrieve();\n```\n\n### Shops\n\n#### Listing Shops\n\nList all available shops:\n\n```javascript\nconst shops = await genuka.shops.list();\n```\n\n#### Shop Details\n\nTo retrieve the details of a specific shop by its ID:\n\n```javascript\nconst shop = await genuka.shops.retrieve({ id: \"01hhfzx7ftzrqjxhx8fbb6ddfs\" });\n```\n\n### Products\n\n#### Counting Products\n\nTo count all available products:\n\n```javascript\nconst productsCount = await genuka.products.count();\n```\n\n#### Listing Products\n\nList all products:\n\n```javascript\nconst products = await genuka.products.list();\n```\n\n#### Product Details\n\nTo retrieve the details of a specific product by its ID:\n\n```javascript\nconst product = await genuka.products.retrieve({\n  id: \"01hkav9sz3qsj4tfdn3yd7214p\",\n});\n```\n\n### Customers\n\n#### Logging in a Customer\n\nTo log in a customer:\n\n```javascript\nconst { token, customer } = await genuka.customers.login({\n  email: \"customer@email.com\",\n  password: \"password\",\n});\nGenuka.setToken(token);\n```\n\n#### Retrieving Customer Details\n\nTo retrieve the details of the current customer:\n\n```javascript\nconst customerDetails = await genuka.customers.retrieve();\n```\n\nSure, here are detailed sections of the documentation for the `orders` and `carts` parts of your Genuka package.\n\n---\n\n### Orders\n\n#### List All Orders for a Customer\n\nTo list all orders for a customer, you must first log in the customer and then use the `list` method:\n\n```javascript\n// Log in the customer\nconst { token } = await genuka.customers.login({\n  email: \"customer2@email.com\",\n  password: \"password\",\n});\ngenuka.setToken(token);\n\n// List all orders for the customer\nconst orders = await genuka.orders.list();\n```\n\n#### Create an Order\n\nTo create a new order, use the `create` method. You must provide details about the customer, shipping, billing, and products included in the order:\n\n```javascript\nconst order = await genuka.orders.create({\n  customer: {\n    first_name: \"John\",\n    last_name: \"Doe\",\n    phone: \"123456789\",\n    email: \"customer@email.com\",\n  },\n  shipping: {\n    mode: \"delivery\",\n    amount: 0,\n    address: {\n      first_name: \"John\",\n      last_name: \"Doe\",\n      phone: \"123456789\",\n      line1: \"line1\",\n      line2: \"line2\",\n      city: \"city\",\n      state: \"state\",\n      postal_code: \"postal_code\",\n      country: \"country\",\n    },\n  },\n  billing: {\n    method: \"cash\",\n    address: {\n      first_name: \"John\",\n      last_name: \"Doe\",\n      phone: \"123456789\",\n      line1: \"line1\",\n      line2: \"line2\",\n      city: \"city\",\n      state: \"state\",\n      postal_code: \"postal_code\",\n      country: \"country\",\n    },\n  },\n  products: [\n    {\n      title: \"My product here\",\n      price: 2000,\n      quantity: 1,\n    },\n  ],\n});\n```\n\n(Note: Add more details and available configurations as needed for your API.)\n\n### Carts\n\n#### Add to Cart\n\nTo add a product to the cart, use the `add` method by providing the necessary details:\n\n```javascript\ngenuka.cart.add({\n  product_id: \"product_id\",\n  variant_id: \"variant_id\",\n  quantity: 1,\n  price: 2000,\n});\n```\n\n#### Retrieve Cart\n\nTo retrieve the current contents of the cart:\n\n```javascript\nconst cart = genuka.cart.retrieve();\n```\n\n#### Update Cart Item\n\nTo update the quantity of a specific item in the cart:\n\n```javascript\ngenuka.cart.update(\"variant_id\", {\n  quantity: 2,\n});\nconst updatedCart = genuka.cart.retrieve();\n```\n\n#### Remove from Cart\n\nTo remove an item from the cart:\n\n```javascript\ngenuka.cart.remove(\"variant_id\");\nconst cartAfterRemoval = genuka.cart.retrieve();\n```\n\n#### Clear Cart\n\nTo empty the cart:\n\n```javascript\ngenuka.cart.clear();\nconst emptyCart = genuka.cart.retrieve();\n```\n\n(Note: This is a basic example for the most important sections. You should continue this pattern for all other methods and classes you have defined, such as `pages`, `blogs`, `articles`, `collections`, `addresses`, and `paymentMethods`.)\n\n## Contribution\n\nIf you wish to contribute to this SDK, please contact us via Whatsapp (+237 6 95 76 25 95) or send an email to wdjopa@lamater.tech. We welcome contributions in the form of pull requests, bug reports, and suggestions for new features.\n","readmeFilename":"README.md"}