@ikonintegration/mod-license-client 0.4.5 → 0.4.8

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
@@ -52,7 +52,6 @@ The following header must be specified in every request!
52
52
  - API.order.completeOrder(orderObj, provider) - Admin and users
53
53
  - API.order.refundOrder(orderObj, provider) - Admin and users
54
54
  - API.order.cancelOrder(orderObj, provider) - Admin and users
55
- - API.order.getOrderByID(orderID) - Admin, users and services
56
55
  - API.order.getOrder(externalID, orderID) - Admin, users and services
57
56
  - API.order.getOrdersByExternalID(externalID) - Admin, users and services
58
57
  - API.order.getOrdersFromToTimestamp(from, to /*timestamps*/) - Admin and services
@@ -63,8 +62,10 @@ The following header must be specified in every request!
63
62
 
64
63
  **License:**
65
64
  - API.license.redeemLicense(activationCode, productID) - Service only
65
+ - API.license.redeemLicenseByProduct(productID, externalID) - Service only
66
66
  - API.license.revokeLicense(licenseID) - Admin only
67
67
  - API.license.revokeLicenses(licenseIDs) - Admin only
68
+ - API.license.getLicenseByID(licenseID) - Admin, users and services
68
69
  - API.license.getLicense(licenseID, externalID) - Admin, users and services
69
70
  - API.license.getLicensesByExternalID(externalID) - Admin, users and services
70
71
  - API.license.getLicensesByExternalIDs(externalIDs) - Admin and services
@@ -2,10 +2,11 @@ export default class Key {
2
2
  constructor(API) {
3
3
  this.api = API;
4
4
  }
5
- async getAvailableKeys(externalID, licensesCount) {
5
+ async getAvailableKeys(externalID, licensesCount, productID) {
6
6
  const req = await this.api.newBaseRequest('GET');
7
7
  req.path = '/keys/' + externalID;
8
8
  req.appendQueryParam('numberOfLicenses', licensesCount);
9
+ if (productID) req.appendQueryParam('productID', productID);
9
10
  return await req.exec();
10
11
  }
11
12
  async getKey(activationKey) {
@@ -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';
@@ -19,6 +25,11 @@ export default class License {
19
25
  req.body = { licenseIDs };
20
26
  return await req.exec();
21
27
  }
28
+ async getLicenseByID(licenseID) {
29
+ const req = await this.api.newBaseRequest('GET');
30
+ req.path = `/license/${licenseID}`;
31
+ return await req.exec();
32
+ }
22
33
  async getLicense(licenseID, externalID) {
23
34
  const req = await this.api.newBaseRequest('GET');
24
35
  req.path = '/license/' + licenseID + '/' + externalID;
@@ -59,11 +59,6 @@ export default class Order {
59
59
  return await req.exec();
60
60
  }
61
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
- }
67
62
  async getOrder(externalID, orderID) {
68
63
  const req = await this.api.newBaseRequest('GET');
69
64
  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.5",
3
+ "version": "0.4.8",
4
4
  "description": "Shared module license API client",
5
5
  "main": "index.js",
6
6
  "scripts": {