diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4f7b629..d194cc9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Release & Publish +name: Publish on: push: @@ -20,8 +20,9 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + cache: "npm" - name: Install modules - run: npm install + run: npm ci - name: Run tests run: npm run test release: @@ -36,6 +37,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + cache: "npm" tag_name: ${{ github.ref }} release_name: ${{ github.ref }} draft: false @@ -49,10 +51,11 @@ jobs: - name: Setup .npmrc file to publish to npm uses: actions/setup-node@v1 with: + cache: "npm" node-version: "14.x" registry-url: "https://registry.npmjs.org" - name: Install modules - run: npm install + run: npm ci - name: Build run: npm run build - name: Publish to npm diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b99b07d..bee7836 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,8 +35,9 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v1 with: + cache: "npm" node-version: ${{ matrix.node }} - name: Install modules - run: npm install + run: npm ci - name: Run tests run: npm run test diff --git a/README.md b/README.md index 5d3c1c4..a004246 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![Maintainability](https://api.codeclimate.com/v1/badges/30f7421ca372f94a0eb5/maintainability)](https://codeclimate.com/github/manishrc/promostandards-sdk-js/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/30f7421ca372f94a0eb5/test_coverage)](https://codeclimate.com/github/manishrc/promostandards-sdk-js/test_coverage) +[![Test](https://github.com/manishrc/promostandards-sdk-js/actions/workflows/test.yml/badge.svg)](https://github.com/manishrc/promostandards-sdk-js/actions/workflows/test.yml) [![npm (scoped)](https://img.shields.io/npm/v/promostandards-sdk-js.svg)](https://www.npmjs.com/package/promostandards-sdk-js) -[![Build Status](https://travis-ci.org/manishrc/promostandards-sdk-js.svg?branch=master)](https://travis-ci.org/manishrc/promostandards-sdk-js) **NOTE:** This project is under early development and will have unstable API until 1.0.0 @@ -12,70 +12,76 @@ `npm install promostandards-sdk-js --save` ## Usage + ```javascript -const { PromoStandards } = require('promostandards-sdk-js'); +const { PromoStandards } = require("promostandards-sdk-js"); // Initialize client with supplier infomation const supplier = new PromoStandards.Client({ - id: 'account_id', - password: 'password', - endpoints: [ - { - type: 'ProductData', - version: '1.0.0', - url: 'supplier.com/product-data.svc' - } - ] + id: "account_id", + password: "password", + endpoints: [ + { + type: "ProductData", + version: "1.0.0", + url: "supplier.com/product-data.svc", + }, + ], }); // Get product data for item_id -supplier.productData.getProduct({ - productId: 'item_id', // Product ID - localizationCountry: 'US', // or `CA` for Canada - localizationLanguage: 'en', // or `fr` for French -}).then(result => console.log(result)); - +supplier.productData + .getProduct({ + productId: "item_id", // Product ID + localizationCountry: "US", // or `CA` for Canada + localizationLanguage: "en", // or `fr` for French + }) + .then((result) => console.log(result)); ``` ## TODO + #### Service API + - [x] Product Data - - [x] getProduct - - [x] getProductDateModified - - [x] getProductSellable - - [x] getProductDateModified + - [x] getProduct + - [x] getProductDateModified + - [x] getProductSellable + - [x] getProductDateModified - [ ] Inventory Interface Standards - - [ ] getFilterValues - - [ ] getInventoryLevels + - [ ] getFilterValues + - [ ] getInventoryLevels - [x] Media Content Standards - - [x] getMediaContent - - [x] getMediaDateModified + - [x] getMediaContent + - [x] getMediaDateModified - [ ] Order Shipment Notification - - [ ] getOrderShipmentNotification + - [ ] getOrderShipmentNotification - [ ] Product Configuration, Decoration, and Pricing - - [ ] getAvailableLocations - - [ ] getDecorationColors - - [ ] getFobPoints - - [ ] getAvailableCharges - - [ ] GetConfigurationAndPricing + - [ ] getAvailableLocations + - [ ] getDecorationColors + - [ ] getFobPoints + - [ ] getAvailableCharges + - [ ] GetConfigurationAndPricing - [ ] Order Status Standards - - [ ] getOrderStatusDetails - - [ ] getOrderStatusTypes + - [ ] getOrderStatusDetails + - [ ] getOrderStatusTypes - [ ] Purchase Order - - [ ] sendPO - - [ ] getSupportedOrderTypes + - [ ] sendPO + - [ ] getSupportedOrderTypes #### Meta API + - [ ] Get List of Companies - [ ] Get List of Service Types - [ ] Get List of Services - [ ] Get Endpoint: - - [ ] Get List of Endpoints by Company - - [ ] Get Endpoint by Company and Service Type - - [ ] Get Endpoint by Version, Company and Service Type + - [ ] Get List of Endpoints by Company + - [ ] Get Endpoint by Company and Service Type + - [ ] Get Endpoint by Version, Company and Service Type - [ ] Get Stats #### Other features + - [x] Initialise a client with supplier information - [x] Choose JSON or XML Response - [ ] Support Promise & callback interface