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

@things-factory/integration-marketplace

v7.0.1-alpha.57

Published

Module to manage integration with e-commerce marketplace.

Downloads

4,283

Readme

Marketplace Integration module

  • support 10+ marketplace platforms
    • lazada https://open.lazada.com
    • shopee https://open.shopee.com
    • zalora
    • taobao https://open.taobao.com
    • shopify https://shopify.dev
    • qoo10 https://api.qoo10.sg/GMKT.INC.Front.QApiService/document/QAPIGuideIndex.aspx
    • amazon
    • lelong
    • shopclues
    • magento
    • flipkart
    • woocommerce https://woocommerce.github.io/woocommerce-rest-api-docs/
  • unified API
    • By integrating different APIs of various platforms, one standard API can be used.

Integration Structure

development

TDD (Test Driven Development)

  • using frameworks
    • chai(https://www.chaijs.com/)
    • mocha(https://mochajs.org/)
    • should(https://github.com/shouldjs/should.js)
  • usages
# test all tests
$ yarn test
# test specific modules test
$ DEBUG=things-factory:* NODE_ENV=development npx mocha -r ts-node/register ./test/store-api/*spec.ts
# test specific test
$ DEBUG=things-factory:* NODE_ENV=development npx mocha -r ts-node/register ./test/store-api/get-store-products-spec.ts

debug module

  • https://www.npmjs.com/package/debug

Platform-specific features

lazada

  • 등록된 callback 주소의 hostname 과 동일한 callback address 를 사용할 수 있다. (need to confirm)
  • accessToken이 digital sign 시에 사용된다. digital sign은 payload에 포함된다. (request header 사용안함.)
  • country-code 별로 endpoint가 다르다.
  • API별 고정 path를 사용한다.
  • get/post 를 사용한다.

shopee

  • callback address에 특별한 제한이 없다.
  • binding cancel API가 정의되어있다. (binding cancel callback으로 결과를 redirect 받을 수 있다.)
  • accessToken이 따로 발행되지 않는다. payload digital sign 만 하고 request header에 포함한다. (Authorization)
  • API별 고정 path를 사용한다.
  • post 만 사용한다.

shopify

  • country-code 를 사용하지 않는다.
  • application callback whitelist에 등록된 주소 이외는 사용할 수 없다. 대신 callback에 포함된 nonce나 hostname을 이용해서 redirect 할 수 있다.
  • request 마다 digital sign을 할 필요없이, accessToken 만 request header에 포함하면 된다. (X-Shopify-Access-Token)
  • 마지막으로 발행된 accessToken 만 유효하다.
  • restful과 graphql을 모두 지원한다.
  • restful 스타일을 비교적 철저히 따른다.
    • path에 resource id를 사용한다.
    • get/post/put/delete method를 의미에 적합하게 모두 사용한다.

zalora

  • application 등록 기능 없음. seller apiKey를 사용해야 함.
  • 따라서, oauth2 인증을 통해서 apiKey를 가져오는 방법을 발견하지 못함.
  • apiKey가 digital sign 시에 사용된다. digital sign은 payload에 포함된다. (request header 사용안함.)
  • country-code 별로 endpoint가 다르다.
  • API별 action 코드가 querystring(Action 키)에 지정된다.
  • 'get', 'post' 메쏘드 만을 사용한다.
  • post인 경우에는 query string과 request body(XML 포맷)을 동시에 사용한다.
  • response 는 XML 또는 JSON 포맷을 지정할 수 있는데, querystring(Format 키)에 지정한다.

woocommerce

  • ...ing