@ikonintegration/mod-license-client 2.0.26 → 2.0.27
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/lib/operations/License.js +25 -25
- package/package.json +1 -1
|
@@ -3,63 +3,63 @@ export default class License {
|
|
|
3
3
|
this.api = API;
|
|
4
4
|
}
|
|
5
5
|
async assignLicense(externalID, assignedTo, body) {
|
|
6
|
-
const req = await this.api.newBaseRequest(
|
|
7
|
-
req.path =
|
|
6
|
+
const req = await this.api.newBaseRequest("POST");
|
|
7
|
+
req.path = "/license/" + externalID + "/assign/" + assignedTo;
|
|
8
8
|
req.body = { ...body };
|
|
9
9
|
return await req.exec();
|
|
10
10
|
}
|
|
11
11
|
async unassignLicense(externalID, activationKey) {
|
|
12
|
-
const req = await this.api.newBaseRequest(
|
|
13
|
-
req.path =
|
|
12
|
+
const req = await this.api.newBaseRequest("POST");
|
|
13
|
+
req.path = "/license/" + externalID + "/unassign/" + activationKey;
|
|
14
14
|
return await req.exec();
|
|
15
15
|
}
|
|
16
|
-
async redeemLicenseByProduct(productID, externalID) {
|
|
17
|
-
const req = await this.api.newBaseRequest(
|
|
18
|
-
req.path =
|
|
19
|
-
req.body = { productID, externalID };
|
|
16
|
+
async redeemLicenseByProduct(productID, externalID, sessionID) {
|
|
17
|
+
const req = await this.api.newBaseRequest("POST");
|
|
18
|
+
req.path = "/license/redeem/available";
|
|
19
|
+
req.body = { productID, externalID, sessionID };
|
|
20
20
|
return await req.exec();
|
|
21
21
|
}
|
|
22
22
|
async redeemLicense(activationCode, productID, externalID, referralID) {
|
|
23
|
-
const req = await this.api.newBaseRequest(
|
|
24
|
-
req.path =
|
|
25
|
-
req.body = { key: activationCode, productID, externalID
|
|
23
|
+
const req = await this.api.newBaseRequest("POST");
|
|
24
|
+
req.path = "/license/redeem";
|
|
25
|
+
req.body = { key: activationCode, productID, externalID, referralID };
|
|
26
26
|
return await req.exec();
|
|
27
27
|
}
|
|
28
28
|
async revokeLicense(licenseID) {
|
|
29
|
-
const req = await this.api.newBaseRequest(
|
|
30
|
-
req.path =
|
|
29
|
+
const req = await this.api.newBaseRequest("POST");
|
|
30
|
+
req.path = "/license/" + licenseID + "/revoke";
|
|
31
31
|
return await req.exec();
|
|
32
32
|
}
|
|
33
33
|
async revokeLicenses(licenseIDs) {
|
|
34
|
-
const req = await this.api.newBaseRequest(
|
|
35
|
-
req.path =
|
|
34
|
+
const req = await this.api.newBaseRequest("POST");
|
|
35
|
+
req.path = "/license/revoke/bulk";
|
|
36
36
|
req.body = { licenseIDs };
|
|
37
37
|
return await req.exec();
|
|
38
38
|
}
|
|
39
39
|
async getLicenseByID(licenseID) {
|
|
40
|
-
const req = await this.api.newBaseRequest(
|
|
40
|
+
const req = await this.api.newBaseRequest("GET");
|
|
41
41
|
req.path = `/license/${licenseID}`;
|
|
42
42
|
return await req.exec();
|
|
43
43
|
}
|
|
44
44
|
async getLicense(licenseID, externalID) {
|
|
45
|
-
const req = await this.api.newBaseRequest(
|
|
46
|
-
req.path =
|
|
45
|
+
const req = await this.api.newBaseRequest("GET");
|
|
46
|
+
req.path = "/license/" + licenseID + "/" + externalID;
|
|
47
47
|
return await req.exec();
|
|
48
48
|
}
|
|
49
49
|
async getLicensesByExternalID(externalID) {
|
|
50
|
-
const req = await this.api.newBaseRequest(
|
|
51
|
-
req.path =
|
|
50
|
+
const req = await this.api.newBaseRequest("GET");
|
|
51
|
+
req.path = "/licenses/" + externalID;
|
|
52
52
|
return await req.exec();
|
|
53
53
|
}
|
|
54
54
|
async getLicensesByExternalIDs(externalIDs) {
|
|
55
|
-
const req = await this.api.newBaseRequest(
|
|
56
|
-
req.path =
|
|
57
|
-
req.body = { IDs: externalIDs }
|
|
55
|
+
const req = await this.api.newBaseRequest("POST");
|
|
56
|
+
req.path = "/licenses/byIDs";
|
|
57
|
+
req.body = { IDs: externalIDs };
|
|
58
58
|
return await req.exec();
|
|
59
59
|
}
|
|
60
60
|
async getAvailableLicensesByExternalAndProductIDs(extID, productID, expanded = false) {
|
|
61
|
-
const req = await this.api.newBaseRequest(
|
|
62
|
-
req.path = `/licenses/${extID}/product/${productID}/available` + (expanded ?
|
|
61
|
+
const req = await this.api.newBaseRequest("GET");
|
|
62
|
+
req.path = `/licenses/${extID}/product/${productID}/available` + (expanded ? "?expanded=true" : "");
|
|
63
63
|
return await req.exec();
|
|
64
64
|
}
|
|
65
65
|
}
|