npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

visit-library-api-wrapper

v0.1.317

Published

``` install npm install visit-library-api-wrapper

Downloads

34

Readme

visit-library-api-wrapper

Project setup

install
npm install visit-library-api-wrapper

import
import ProductService from "../../../node_modules/visit-library-api-wrapper/src/services/ProductService"
import OrderService from "../../../node_modules/visit-library-api-wrapper/src/services/OrderService"
import BookingsService from "../../../node_modules/visit-library-api-wrapper/src/services/BookingsService"

*** imported ***
import OrderBookingService from "../../../node_modules/visit-library-api-wrapper/src/services/OrderBookingService"

fetch data
await ProductService.getProducts({after: 'Put Date', until: 'Put Date', language: 'en', apikey: 'Put Your ApiKey Here'})
this will return customize product list.

calculate price
pass product slots in comma separately
ProductService.calculatePrice([
    {productCode: '', tourId: '', articleCode: '', quantity:[{name: 'ADULT', value: 0}, {name: 'CHILD2', value: 0}, {name: 'CHILD1', value: 0}]}, 
    {productCode: '', tourId: '', articleCode: '', quantity:[{name: 'ADULT', value: 0}, {name: 'CHILD2', value: 0}, {name: 'CHILD1', value: 0}]}
    ])
this will return total price of that product

ProductService.js

methods
getProducts: return the product list.
calculatePrice: return the total price for product.

OrderBookingService.js

3 main function [Create, Update, Delete -> BookingRequest]

Create Booking Request:
OrderBookingService.createOrderBookingRequest({language: 'en', apikey: '9AC4296C21B68B3FE8899D4E15D19A8A', quoteId: quoteId, orderId: orderId, body: body})
* mandatory quoteId, body
optional orderId

body Format As Follows :

{
"articles": [
    {
      "productSlotIndex": 1,
      "articleCode": "A40-999-252-002",
      "categoryCode": "ADULT",
      "quantity": 3,
      "complementValues": [
      ],
      "cookie": "null"
    }
  ],
  "participants": [
  ],
  "complementsValues": [
  ],
  "cookie": "null"
}
Get Booking Request:
OrderBookingService.getBookingRequest({bookingId: bookingId, apikey: '9AC4296C21B68B3FE8899D4E15D19A8A'})
* mandatory bookingId
Delete Booking Request:
OrderBookingService.deleteBookingRequest({bookingId: bookingId, apikey: '9AC4296C21B68B3FE8899D4E15D19A8A'})
* mandatory bookingId
Get Price Request:
ProductService.findQuoteAndPrice({productCode: productCode, articles: articels, quotes: quotes, prices: prices})
* mandatory all fields,

productCode
article should be formatted following manner

[{"articleCode":"A40-999-252-002","tourId":"5b5ec9ab1fbc3614c836cc8a:1-1","priceLevel":null,"prices":[]},{"articleCode":"A30-999-231-002","tourId":"5b5ec98f1fbc3614c836c9d7:1-1","priceLevel":null,"prices":[]}]

* if there is a article that without tours, you can simpily input tourId as null

for quotes and prices can get it from getProduct API.
Get Price Request:
For all product search query pass site_id that replace apiKey
Update Customer Information:
OrderService.updateCustomerInfo({site_id: this.inputSiteId, orderId: orderId, customer: customer})

Customer Format:
{
  "type": "company",
  "customerNumber": "string",
  "firstName": "string",
  "lastName": "string",
  "phone": "string",
  "mobile": "string",
  "email": "string",
  "address": {
    "city": "string",
    "state": "string",
    "country": "string",
    "countryCode": "string",
    "streetAddress1": "string",
    "streetAddress2": "string",
    "streetAddress3": "string",
    "postalCode": "string"
  },
  "company": "string",
  "department": "string"
}