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

jimmy-client

v1.0.0

Published

A node client for placing an order at your nearest Jimmy Johns!

Downloads

6

Readme

JimmyClient

A node client for placing an order at your nearest Jimmy Johns!

DISCLAIMER: This client was built by inspecting web traffic while ordering Jimmy John's online. This is not endorsed by Jimmy Johns nor is their API publicly documented - this means the client could potentially malfunction based on changes made to the Jimmy John's API. Please use carefully and be respectful of Jimmy John's site - don't issue large numbers of requests!

Installation

npm install --save jimmy-client

In your project, you can the access the client.

const JimmyClient = require('jimmy-client');
const orderDetails = {
    locationId: 0000,
    OrderType: JimmyClient.Order.OrderType.DELIVERY,
    ScheduleTime: 'ASAP'
};

//You must do this before you can access certain endpoints like menus and menu items. These are required properties.
JimmyClient.Order.start(orderDetails).then(order => {
    //Order is now available
});

Usage

Orders are session based so you don't need to track an order object. Changes made are to your session's current order.

Locations

There are two types of orders - pickup and delivery. You can find which locations are available to you based on your needs. For a delivery order, the location needs to actually service the delivery address. Alternatively, for pickup orders, you just need to know that there is a location nearby. The Location resource on the client provides both of these lookup types as well as the ability to look up a location by id. Below are examples of each.

Responses

Responses to location endpoints appear to be the same format - even if the search is by id or only returns a single locations. Currently, only the Locations property contains data needed to order.

{
    "Regions": [],
    "Districts": [],
    "Locations": [
        {
            "Id":6078,
            "Name":"#3006 475 South 11th Street",
            "Abbreviation":"#3006",
            "DistrictId":1798,
            "Phone":"409-239-7205",
            "DeliveryLeadTime":30,
            "PickupLeadTime":30,
            "LocationLocalTime":"2016-05-30T21:43:45.1668622Z",
            "LocationGMTTimeString":null,
            "LocationTimeZone":0,
            "AddressLine1":"475 South 11th Street",
            "AddressLine2":"",
            "City":"Beaumont",
            "State":"TX",
            "Zipcode":"77701",
            "StoreHours":"10:30 AM - 10:00 AM",
            "PickupMinOrderValue":"3.50",
            "DeliveryMinOrderValue":"3.00",
            "Distance":2.1218952842544239,
            "Latitude":30.073963165283203,
            "Longitude":-94.12957763671875,
            "MapUrl":"https://maps.googleapis.com/maps/api/staticmap?markers=color:red...",
            "IsOffline":false,
            "IsClosed":false,
            "PaymentTypes":[],
            "CardTypes":[],
            "ScheduleTimes":[],
            "LocationMessages":[]
        },
    ],
    "DeliveryStates": [],
    "LocationGeoCoordinates": null,
    "Pricing": null,
    "InfoItems": [],
    "UserMessages": []
}

Location search for delivery

You will need to provide the actual address of the delivery to the method. The example below shows all of the address properties you can supply, but at this time it is unclear which properties are required for the system to accurately lookup a location (e.g. are Lat/Long actually required?):

const deliveryAddress = {
    FriendlyName:"",
    Company:"",
    GateCode:"",
    DeliveryInstructions:"",
    SaveInstructions:true,
    CacheAddress:false,
    SaveAsDefault:false,
    Index:null,
    AddressLine1:"650 Pine St.",
    AddressLine2:"",
    City:"Beaumont",
    State:"TX",
    Zipcode:"77701",
    Country:null,
    DisplayText:null,
    Latitude: 30.08802,
    Longitude: -94.0981074
};

JimmyClient.Location.getLocationForDelivery(deliveryAddress).then(response => {
    //response.Locations is an array of locations that can be used
});

Location search for pickup

Pickup location searches are much more lenient - all you need is a rough area to find locations.

const area = {
    Region:"",
    District:"",
    Zipcode:"77707"
};

JimmyClient.Location.getLocationForPickup(area).then(response => {
    //response.Locations is an array and usually contains more results than deliveryAddress
});

In theory you can also search by region and district, but I can't find any examples of identifying either to even be able.


Location search by id

If you already have a location id but want the full location details you can search by id (e.g. a saved location in your system but want to show the details of the location).

const locationId = 6078;

JimmyClient.Location.getById(locationId).then(response => {
    //Once again, response.Location is an array, and should either have 1 or 0 entries.
});

Orders

The Order endpoint allows top-level order manipulations.

Starting an order

Some functions require to have an order started before accesing them (e.g. the menu endpoints). In any case, you will need to start the order eventually.

const orderDetails = {
    locationId: 0000,
    OrderType: JimmyClient.Order.OrderType.DELIVERY,
    ScheduleTime: 'ASAP'
};

//You must do this before you can access certain endpoints like menus and menu items. These are required properties.
JimmyClient.Order.start(orderDetails).then(order => {
    //Order is now available
});

Setting order delivery address

//See delivery location lookup for details about what the address should look like
const orderAddress = {
    ...
};

JimmyClient.Order.setDeliveryAddress(orderAddress).then(order => {
    //order should be accessable here.
});