UNPKG

@stylusapparel/stylusop-api-node-wrapper

Version:

This is the official NodeJs wrapper for connecting to the StylusOP API

67 lines (65 loc) 2.23 kB
'use strict'; const { _errorConst } = require('./const'); const { PAGINATION_MAX_LIMIT } = require('./url').__defaults; module.exports = Object.freeze({ NOT_FOUND: { errorCode: _errorConst.NOT_FOUND, message: 'Resource Not Found', }, USER_MISSING: { errorCode: _errorConst.USER_MISSING, message: "Please add you StylusOP's account username in client configuration", }, TOKEN_MISSING: { errorCode: _errorConst.TOKEN_MISSING, message: 'Please add you stylus provided secret token in client configuration', }, TOKEN_EXPIRE: { errorCode: _errorConst.TOKEN_EXPIRE, message: 'Your token has been expired', }, TOKEN_INVALID: { errorCode: _errorConst.TOKEN_INVALID, message: 'Your token is not valid', }, UNKNOWN_ERROR: { errorCode: _errorConst.UNKNOWN_ERROR, message: 'Some unknown error occured', }, VERSION_ISSUE: { errorCode: _errorConst.VERSION_ISSUE, message: "We didn't found the api version. Please install the latest `stylus-order-wrapper-nodejs` npm and try again. If the issue still exist please contact our customer support", }, PAGINATION_LIMIT_ERROR: { errorCode: _errorConst.PAGINATION_LIMIT_ERROR, message: 'Maximum Item fetching limit is ' + PAGINATION_MAX_LIMIT + '. Please adjust your limit param', }, ORDER_ID_INVALID: { errorCode: _errorConst.ORDER_ID_INVALID, message: 'Order reference id is invalid', }, ORDER_PAYLOAD_INVALID: { errorCode: _errorConst.ORDER_PAYLOAD_INVALID, message: 'Order payload is invalid', }, ORDER_PRODUCT_INVALID: { errorCode: _errorConst.ORDER_PRODUCT_INVALID, message: 'Product is not found under this account', }, ORDER_ITEM_PROPERTY_INVALID: { errorCode: _errorConst.ORDER_ITEM_PROPERTY_INVALID, message: 'Order having item with wrong/unprocessed properties', }, ORDER_DUPLICATE: { errorCode: _errorConst.ORDER_DUPLICATE, message: 'Order is duplicate due to the item number is already exist', }, ORDER_STATUS_ISSUE: { errorCode: _errorConst.ORDER_STATUS_ISSUE, message: 'Order is not in a processable status', }, PRODUCT_NOT_FOUND: { errorCode: _errorConst.PRODUCT_NOT_FOUND, message: 'Product is not found under this account', }, });