@island-project/fetcher v1.0.3
Island Project Fetcher
Installation
To install fetcher, first install Node JS then run the following command:
npm i @island-project/fetcher
NOTE: You may need elevated permissions to run this command
Fetcher Reference
Fetcher allows for easy HTTP requests through its included services. The services currently provided include:
- Cart Item
- Cart
- Customer
- Inventory
- Product
Cart Item Service
To use the Cart Item Service, first instantiate an object of type CartItemService.
const fetcher = require('fetcher')
let cartItemService = new fetcher.CartItemService();
The Cart Item Service includes the following methods:
cartItemService.getAllCartItems()
cartItemService.getCartItem(cartId)
cartItemService.addCartItem(cartId, inventoryId, quantity)
cartItemService.deleteCartItem(cartId)
Cart Service
To use the Cart Service, first instantiate an object of type CartService.
const fetcher = require('fetcher')
let cartService = new fetcher.CartService();
The Cart Service includes the following methods:
cartService.getAllCarts()
cartService.getCart(cartId)
cartService.addCart(customerId)
cartService.deleteCart(cartId)
Customer Service
To use the Customer Service, first instantiate an object of type CustomerService.
const fetcher = require('fetcher')
let customerService = new fetcher.CustomerService();
The Customer Service includes the following methods:
customerService.getAllCustomers()
customerService.getCustomer(customerId)
customerService.addCustomer(firstName, lastName, dateOfBirth, gender, phoneNumber, email, password, newsletterSubscriber)
customerService.deleteCustomer(customerId)
Inventory Service
To use the Inventory Service, first instantiate an object of type InventoryService.
const fetcher = require('fetcher')
let inventoryService = new fetcher.InventoryService();
The Inventory Service includes the following methods:
inventoryService.getAllInventories()
inventoryService.getInventory(inventoryId)
inventoryService.addInventory(productId, distributionCenterId, quantity, gender)
inventoryService.deleteInventory(inventoryId)
Product Service
To use the Product Service, first instantiate an object of type ProductService.
const fetcher = require('fetcher')
let productService = new fetcher.ProductService();
The Product Service includes the following methods:
productService.getAllProducts()
productService.getProduct(productId)
productService.addProduct(productType, name, cost, productImage, isOnSale)
productService.deleteProduct(productId)