intgate 1.0.0 → 1.0.1
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 +7 -0
- package/dist/client.js +12 -2
- package/dist/types.d.ts +4 -4
- package/package.json +1 -1
- package/src/client.ts +16 -2
- package/src/types.ts +4 -4
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ async function verifyLicense() {
|
|
|
75
75
|
|
|
76
76
|
## API Reference
|
|
77
77
|
|
|
78
|
+
|
|
78
79
|
### Initialize Client
|
|
79
80
|
|
|
80
81
|
```typescript
|
|
@@ -86,8 +87,14 @@ const client = new IntGateClient(
|
|
|
86
87
|
);
|
|
87
88
|
```
|
|
88
89
|
|
|
90
|
+
> **Note:** Configure which fields are returned during license verification by navigating to:
|
|
91
|
+
> Dashboard → Team → Settings → Returned Fields (https://license.intserver.com/dashboard/team/settings?tab=security)
|
|
92
|
+
>
|
|
93
|
+
> If no fields are configured, the `data` object will be empty but the library will handle this gracefully.
|
|
94
|
+
|
|
89
95
|
### Verify License
|
|
90
96
|
|
|
97
|
+
|
|
91
98
|
Validates a license key and returns license information, customer data, and product details.
|
|
92
99
|
|
|
93
100
|
```typescript
|
package/dist/client.js
CHANGED
|
@@ -68,7 +68,12 @@ class IntGateClient extends events_1.EventEmitter {
|
|
|
68
68
|
const url = `${this.baseUrl}/client/teams/${this.teamId}/verification/verify`;
|
|
69
69
|
try {
|
|
70
70
|
const response = await this.axiosInstance.post(url, payload);
|
|
71
|
-
|
|
71
|
+
const result = response.data;
|
|
72
|
+
// Handle null data field (occurs when no returned fields are configured in Team Settings)
|
|
73
|
+
if (result && result.data === null) {
|
|
74
|
+
result.data = {};
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
72
77
|
}
|
|
73
78
|
catch (error) {
|
|
74
79
|
this.handleError(error);
|
|
@@ -109,7 +114,12 @@ class IntGateClient extends events_1.EventEmitter {
|
|
|
109
114
|
const url = `${this.baseUrl}/client/teams/${this.teamId}/verification/heartbeat`;
|
|
110
115
|
try {
|
|
111
116
|
const response = await this.axiosInstance.post(url, payload);
|
|
112
|
-
|
|
117
|
+
const result = response.data;
|
|
118
|
+
// Handle null data field (occurs when no returned fields are configured in Team Settings)
|
|
119
|
+
if (result && result.data === null) {
|
|
120
|
+
result.data = {};
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
113
123
|
}
|
|
114
124
|
catch (error) {
|
|
115
125
|
this.handleError(error);
|
package/dist/types.d.ts
CHANGED
|
@@ -39,15 +39,15 @@ export interface VerificationResult {
|
|
|
39
39
|
}
|
|
40
40
|
export interface VerifyLicenseResponse {
|
|
41
41
|
data: {
|
|
42
|
-
license
|
|
43
|
-
customers
|
|
44
|
-
products
|
|
42
|
+
license?: License;
|
|
43
|
+
customers?: Customer[];
|
|
44
|
+
products?: Product[];
|
|
45
45
|
};
|
|
46
46
|
result: VerificationResult;
|
|
47
47
|
}
|
|
48
48
|
export interface HeartbeatResponse {
|
|
49
49
|
data: {
|
|
50
|
-
license
|
|
50
|
+
license?: {
|
|
51
51
|
ipLimit: number;
|
|
52
52
|
hwidLimit: number;
|
|
53
53
|
expirationType: string;
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -76,7 +76,14 @@ export class IntGateClient extends EventEmitter {
|
|
|
76
76
|
|
|
77
77
|
try {
|
|
78
78
|
const response = await this.axiosInstance.post<VerifyLicenseResponse>(url, payload);
|
|
79
|
-
|
|
79
|
+
const result = response.data;
|
|
80
|
+
|
|
81
|
+
// Handle null data field (occurs when no returned fields are configured in Team Settings)
|
|
82
|
+
if (result && result.data === null) {
|
|
83
|
+
result.data = {};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return result;
|
|
80
87
|
} catch (error) {
|
|
81
88
|
this.handleError(error);
|
|
82
89
|
}
|
|
@@ -116,7 +123,14 @@ export class IntGateClient extends EventEmitter {
|
|
|
116
123
|
|
|
117
124
|
try {
|
|
118
125
|
const response = await this.axiosInstance.post<HeartbeatResponse>(url, payload);
|
|
119
|
-
|
|
126
|
+
const result = response.data;
|
|
127
|
+
|
|
128
|
+
// Handle null data field (occurs when no returned fields are configured in Team Settings)
|
|
129
|
+
if (result && result.data === null) {
|
|
130
|
+
result.data = {};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return result;
|
|
120
134
|
} catch (error) {
|
|
121
135
|
this.handleError(error);
|
|
122
136
|
}
|
package/src/types.ts
CHANGED
|
@@ -46,16 +46,16 @@ export interface VerificationResult {
|
|
|
46
46
|
|
|
47
47
|
export interface VerifyLicenseResponse {
|
|
48
48
|
data: {
|
|
49
|
-
license
|
|
50
|
-
customers
|
|
51
|
-
products
|
|
49
|
+
license?: License;
|
|
50
|
+
customers?: Customer[];
|
|
51
|
+
products?: Product[];
|
|
52
52
|
};
|
|
53
53
|
result: VerificationResult;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface HeartbeatResponse {
|
|
57
57
|
data: {
|
|
58
|
-
license
|
|
58
|
+
license?: {
|
|
59
59
|
ipLimit: number;
|
|
60
60
|
hwidLimit: number;
|
|
61
61
|
expirationType: string;
|