0.6.38 • Published 6 years ago

@ecnova/sdk-js-system v0.6.38

Weekly downloads
-
License
-
Repository
github
Last release
6 years ago

sdk-js

for ECNOVA sdk

quick start:

import { gateway } from '@ecnova/sdk-js';

gateway.retailUserService.touchShoppingCart(params)

customized

import { SDK, defaultConfig, Request, IConfig, IRequest } from '@ecnova/sdk-js';

const gateway = new SDK(defaultConfig, new Request());
gateway.retailUserService.touchShoppingCart(params)

rewrite Request

export class MyRequest extends Request {
  constructor(config){
    super(config)
  }
}


// or in ts
export class MyRequest implements IRequest {
  // send
  send(endpoint: string, options: any);

  // set
  set(config: IConfig): IRequest;
}

rewrite Config

const MyConfig {
  endpoint: string,
  currency: string,
  language: string,
  timeout: number,
  namespace?: string,
  apiToken?: string,
  accessToken?: string,
}

// or in ts
const MyConfig: IConfig {
  endpoint: string,
  currency: string,
  language: string,
  timeout: number,
  namespace?: string,
  apiToken?: string,
  accessToken?: string,
}