Skip to content

Commit

Permalink
fix: cache deps and add status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrc committed May 6, 2024
1 parent e271bc6 commit efac52a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 42 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release & Publish
name: Publish

on:
push:
Expand All @@ -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:
Expand All @@ -36,6 +37,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
cache: "npm"
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
82 changes: 44 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit efac52a

Please sign in to comment.