@ikonintegration/mod-license-client 0.4.3 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@ const API = new SMLicense({
17
17
  port: 9090, //isOptional
18
18
  endpoint: SharedModules_LicenseEndpoint,
19
19
  //Must be specified when using service routes
20
- apiKey: config.examProvider.key, //API token on IDM.AppID format (generate from APIKey at https://runkit.com/gwdp/idm-appid)
20
+ apiKey: config.examProvider.key, //API token on IDM.AppID format (generate from APIKey at https://runkit.com/gwdp/idm-appid-v1)
21
21
  //Must be specified when using admin or user routes
22
22
  authorizationToken: '', -- optional, IDM JWT for shared module admins and user routes -- Accepts a function to be called async and return the token
23
23
  namespace: ''
@@ -47,10 +47,12 @@ The following header must be specified in every request!
47
47
  **Order:**
48
48
  - API.order.getProviderFromProduct(productObject) - Return provider from product
49
49
  - API.order.isMonerisEnabledForProduct(productObject) - Return of Moneris is enabled for this provider.
50
+ - API.order.preOrder(orderObj) - Admin and users
50
51
  - API.order.beginOrder(orderObj, provider) - Admin and users
51
52
  - API.order.completeOrder(orderObj, provider) - Admin and users
52
53
  - API.order.refundOrder(orderObj, provider) - Admin and users
53
54
  - API.order.cancelOrder(orderObj, provider) - Admin and users
55
+ - API.order.getOrderByID(orderID) - Admin, users and services
54
56
  - API.order.getOrder(externalID, orderID) - Admin, users and services
55
57
  - API.order.getOrdersByExternalID(externalID) - Admin, users and services
56
58
  - API.order.getOrdersFromToTimestamp(from, to /*timestamps*/) - Admin and services
@@ -61,6 +63,7 @@ The following header must be specified in every request!
61
63
 
62
64
  **License:**
63
65
  - API.license.redeemLicense(activationCode, productID) - Service only
66
+ - API.license.redeemLicenseByProduct(productID, externalID) - Service only
64
67
  - API.license.revokeLicense(licenseID) - Admin only
65
68
  - API.license.revokeLicenses(licenseIDs) - Admin only
66
69
  - API.license.getLicense(licenseID, externalID) - Admin, users and services
@@ -2,6 +2,12 @@ export default class License {
2
2
  constructor(API) {
3
3
  this.api = API;
4
4
  }
5
+ async redeemLicenseByProduct(productID, externalID) {
6
+ const req = await this.api.newBaseRequest('POST');
7
+ req.path = '/license/redeem/available';
8
+ req.body = { productID, externalID };
9
+ return await req.exec();
10
+ }
5
11
  async redeemLicense(activationCode, productID, externalID) {
6
12
  const req = await this.api.newBaseRequest('POST');
7
13
  req.path = '/license/redeem';
@@ -9,6 +9,12 @@ export default class Order {
9
9
  return (this.getProviderFromProduct(product).indexOf('moneris') != -1);
10
10
  }
11
11
  //CC/Skip order
12
+ async preOrder(orderObj) {
13
+ const req = await this.api.newBaseRequest('POST');
14
+ req.path = `/order/pre/common`;
15
+ req.body = orderObj;
16
+ return await req.exec();
17
+ }
12
18
  async beginOrder(orderObj, provider) {
13
19
  const req = await this.api.newBaseRequest('POST');
14
20
  req.path = `/order/begin/${provider}`;
@@ -53,6 +59,11 @@ export default class Order {
53
59
  return await req.exec();
54
60
  }
55
61
  //Get order(s)
62
+ async getOrderByID(orderID) {
63
+ const req = await this.api.newBaseRequest('GET');
64
+ req.path = `/order/${orderID}`;
65
+ return await req.exec();
66
+ }
56
67
  async getOrder(externalID, orderID) {
57
68
  const req = await this.api.newBaseRequest('GET');
58
69
  req.path = `/order/${externalID}/${orderID}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonintegration/mod-license-client",
3
- "version": "0.4.3",
3
+ "version": "0.4.6",
4
4
  "description": "Shared module license API client",
5
5
  "main": "index.js",
6
6
  "scripts": {