UNPKG

@stylusapparel/opv3-merchant-api-nodejs

Version:

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

87 lines (85 loc) 2.76 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', }, MERCHANT_MISSING: { errorCode: _errorConst.MERCHANT_MISSING, message: "Please add you StylusOP's merchant name 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', }, IN_PRODUCTION: { errorCode: _errorConst.IN_PRODUCTION, message: 'Order is already in production', }, PRODUCT_NOT_FOUND: { errorCode: _errorConst.PRODUCT_NOT_FOUND, message: 'Product is not found under this account', }, PRODUCT_VARIANT_NOT_FOUND: { errorCode: _errorConst.PRODUCT_VARIANT_NOT_FOUND, message: 'Product variant is not found under this account', }, INVENTORY_NOT_FOUND: { errorCode: _errorConst.INVENTORY_NOT_FOUND, message: 'Inventory not found', }, SHIPMENT_NOT_FOUND: { errorCode: _errorConst.SHIPMENT_NOT_FOUND, message: 'Shipment not found', }, FACILITY_NOT_FOUND: { errorCode: _errorConst.FACILITY_NOT_FOUND, message: 'Facility not found for this variant', }, });