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

node-saddlecreek

v2.1.0

Published

This is a Node.js Moudle that will allow you to hook into Saddle Creek's Inventory & Fulfillment API Endpoints

Downloads

4

Readme

Node-SaddleCreek

ProLog/ProWares SOAP XML API Wrapper

This is a Node.js Module will allow you to hook into Saddle Creek's Inventory, Fulfillment, & ASN API Endpoints


Setup

There two way for setting up the warehouse connector:

var warehouse = require('<...>/warehouse')
warehouse.settings({ ... });


var warehouse = require('<...>/warehouse').settings({ ... });

The settings object could contain these properties:

{ 
  uselocalWsdl: true, // if FALSE it fallbacks to remoteWsdl 
  localWsdl: 'local/uri/of/wsdl/file',
  remoteWsdl: 'http://remote.url/wsdl/provider',
  credentials: {
    SystemId: 'xxxxxxxxx',  // For testing use '999system'
    Password: 'xxxxxx'      // For testing use 'prolog'
  },
  debugLogs: false  // Only use it during development 
}

Recommended to use a local Wsdl file, think what would happen if your server restart in a moment when the remote WSDL server is not online. It will never get connected! One caveat I think on this subject is, if ProLog company decides to change specification, the local file has no way to know this happened. The remote way is no a total warranty neither as all this connector would fail anyway if they introduce several changes in the future.


Methods

####warehouse.getInventoryStatus( productArray, callback );

######Arguments productArray: Accepts 'productId' or [ 'productId1', 'productId2', ... ]

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null
  • Result Object { 'Product', 'QuantityAvailable', 'QuantityOnHand', 'QuantityAllocated', 'QuantityExpected', 'QuantityFrozen' }

####warehouse.createOrders( orderObjArray, callback);

######Arguments orderObjArray: Accepts {orderObject} or [ {orderObject}, {orderObject}, ... ] and is required Expected orderObject to be in this form:

  {
      "OrderNumber": "",
      "CustomerNumber": "",
      "CustomerPO": "",
      "CustomerOrderNumber": "",
      "OrderDate": "date-time",
      "Delay": 15,
      "AutoAllocate": true,
      "PartialShip": true,
      "SplitShip": false,
      "ShippingService": "",
      "BillThirdParty": false,
      "SaturdayDelivery": false,
      "Residential": true,
      "InsurePackages": false,
      "InsureThreshold": 100.00,
      "PackingListTemplate": "",
      "PackingListComment": "",
      "AccountNumber": "",
      "EmailConfirmationAddress": "",
      "OrderProcessingVariation": "",
      "Subtotal": 0.00,
      "Shipping": 0.00,
      "Handling": 0.00,
      "Discount": 0.00,
      "Tax": 0.00,
      "Total": 0.00,
      "ref1": "",
      "ref2": "",
      "ref3": "",
      "ref4": "",
      "ref5": "",
      "OrderLines": [
          {
              "Product": "",
              "Quantity": 1,
              "Description": "",
              "Price": 0.00,
              "DeclaredValue": 0.00,
              "Allocations": [{
                  "Warehouse": "",
                  "Quantity": 1
              }],
              "ref1": "",
              "ref2": "",
              "ref3": ""
          }
      ],
      "BillingAddress": {
          "FirstName": "", 
          "LastName": "",
          "CompanyName": "", 
          "Address1": "",
          "Address2": "",
          "City": "",
          "State": "",
          "PostalCode": "",
          "Country": "",
          "PhoneNumber": ""
      },
      "ShippingAddress": {
          "FirstName": "",
          "LastName": "",
          "CompanyName": "",
          "Address1": "",
          "Address2": "",
          "City": "",
          "State": "",
          "PostalCode": "",
          "Country": "",
          "PhoneNumber": "" 
      }
  }
 

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null --> Note: Albeit the error object contains validation error info, it is not normalized therefore is not suitable to client side validation, suggested a client side validation
  • Result Object ( an object representing the raw response from the service intended for debugging use, remember that with the sole fact that the err argument is null is enough to know that the order was sent successfuly note: if one item fails they the whole batch is aborted this is prologs response)

####warehouse.getTrackingStatus( orderNumberArray, callback );

######Arguments orderNumberArray: Accepts 'orderId' or [ 'orderId', 'orderId', ... ] and is required

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null
  • Result is an array of Objects with following form:
     {
             'OrderNumber': '...',
             'Status': '...',
             'ShippingService': '...',
             'Shipments': [
               {
               'Status': '...',
               'ShippedDate': DateTime,
               'Packages': [
                 {
                   'TrackingNumber': '...',
                   'ShippedDate': DateTime,
                   'Weight': '##.##',
                   'Cost' : '##.##'      
                 }
            ]
             }
        ]
      };

Important:

  • If there aren't shipment then order.Shipments won't exist in the response
  • If there aren't packages then order.Shipments.Packages won't exist neither

####warehouse.createASN( ASN, callback);

######Arguments ASN: Accepts {ASN Object} required Expected ASN Object to be in this form:


               {
                   "ASNNumber": "", // req
                   "PONumber": "",
                   "Notes": "",
                   "ExpectedDate": DateTime, // req
                   "Warehouse": "", // req
                   "Carrier": "", // req
                   "Lines": [{
                       "Sku": "", // req
                       "QuantityExpected": 0 // req
                   }]
               }
               

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null

  • Result is an array of Objects with following form:

{
    "ProLogCode": "", 
    "ProLogMessage": ""
}


####warehouse.getASNStatus( type, asnNameString, callback );

######Arguments type: This Field tells the warehouse if the asn you are providing in the second argument is of type ASN or of type PO Accepts 'ASN' or 'PO' and is required

asn: Accepts 'Client ASN' or 'SC ASN' or 'Client PO' and is required

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null

  • Result Object with following form:


   {
       "ASNNumber": "",
       "PONumber": "",
       "Status": "COMPLETE", // possible values: WORKING, EXPECTED, OPEN, COMPLETE, CANCELLED 
       "Notes": "",
       "Lines": [{
               "Sku": "",
               "Product": "",
               "QuantityExpected": 0,
               "QuantityReceived": 0,
               "QuantityStocked": 0
           }, {
               "Sku": "",
               "Product": "",
               "QuantityExpected": 0,
               "QuantityReceived": 0,
               "QuantityStocked": 0
           }]
   }

####warehouse.deleteOrder( OrderNumber, callback);

######Arguments OrderNumber: Accepts String with the order number required Expected ASN Object to be in this form:

callback ( err, result ): Accepts only function and is required Arguments passed:

  • Error Object or null
  • Result is an array of Objects with following form:
{
    "ProLogCode": "", //possible values: SUCCESS, AUTHENTICATION_FAILURE, INVALID_ARGS, INTERNAL_ERROR, ORDER_CANNOT_BE_FOUND, ORDER_CANNOT_BE_DELETED
    "ProLogMessage": ""
}

######Addtional Notes

  • This enpoint according to saddle creek customer service does not exist (and probably should not be used) but it's in the wsdl file and as seen in the testing it does in fact work.
  • Orders can only be deleted if they are still in the OPEN state.
  • Orders can't be deleted if they are staged. (probably haven't tested)

####warehouse.validate.Order(order);

######Arguments A superficial Validation (schema validation) see createOrder() for format ######Arguments

order: Accepts order Object required

Returns: Either 'SUCCESS' or Array of issues

####warehouse.validate.ASN(ASN); A superficial Validation (schema validation) see createASN() for format ######Arguments

ASN: Accepts ASN Object required

Returns: Either 'SUCCESS' or Array of issues

Implemented API Point (Based on the wsdl file)

  • [x] PLGetInventory
  • [x] PLSubmitOrder
  • [x] PLGetOrderStatus
  • [x] PLSubmitASN
  • [x] PLGetASNStatus

The Following api points according to Saddle Creek Don't exist. They are however disclosed in the wsdl file so ##USE AT YOUR OWN RISK##

  • [ ] PLCreateSKU
  • [ ] PLGetSKUData
  • [ ] PLCreateProduct
  • [ ] PLUpdateOrder
  • [x] PLDeleteOrder

Tests

  • [x] getInventoryStatus()
  • [x] createOrders()
  • [x] getTrackingStatus()
  • [x] createASN()
  • [x] getASNStatus()
  • [x] deleteOrder()