repzo 1.0.104 → 1.0.106
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/index.d.ts +642 -1280
- package/lib/index.js +1683 -2691
- package/lib/types/index.d.ts +10254 -11221
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/types/index.ts +2 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
export default class Repzo {
|
|
14
14
|
private svAPIEndpoint: string;
|
|
15
15
|
headers: Headers;
|
|
16
|
+
private timeout: number;
|
|
16
17
|
constructor(apiKey: string, options?: Options) {
|
|
17
18
|
this.svAPIEndpoint =
|
|
18
19
|
!options?.env || options?.env == "production"
|
|
@@ -29,6 +30,11 @@ export default class Repzo {
|
|
|
29
30
|
Accept: "application/json",
|
|
30
31
|
};
|
|
31
32
|
if (options?.headers) Object.assign(this.headers, options.headers);
|
|
33
|
+
if (options?.timeout) {
|
|
34
|
+
this.timeout = options.timeout;
|
|
35
|
+
} else {
|
|
36
|
+
this.timeout = 180000;
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
private _end_points = {
|
|
@@ -107,6 +113,7 @@ export default class Repzo {
|
|
|
107
113
|
let res = await axios.get(`${baseUrl}/${path}`, {
|
|
108
114
|
params,
|
|
109
115
|
headers: this.headers,
|
|
116
|
+
timeout: this.timeout,
|
|
110
117
|
});
|
|
111
118
|
return res.data;
|
|
112
119
|
}
|
|
@@ -120,6 +127,7 @@ export default class Repzo {
|
|
|
120
127
|
let res = await axios.post(`${baseUrl}/${path}`, body, {
|
|
121
128
|
params,
|
|
122
129
|
headers: this.headers,
|
|
130
|
+
timeout: this.timeout,
|
|
123
131
|
});
|
|
124
132
|
return res.data;
|
|
125
133
|
}
|
|
@@ -133,6 +141,7 @@ export default class Repzo {
|
|
|
133
141
|
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
134
142
|
params,
|
|
135
143
|
headers: this.headers,
|
|
144
|
+
timeout: this.timeout,
|
|
136
145
|
});
|
|
137
146
|
return res.data;
|
|
138
147
|
}
|
|
@@ -146,6 +155,7 @@ export default class Repzo {
|
|
|
146
155
|
let res = await axios.put(`${baseUrl}/${path}`, body, {
|
|
147
156
|
params,
|
|
148
157
|
headers: this.headers,
|
|
158
|
+
timeout: this.timeout,
|
|
149
159
|
});
|
|
150
160
|
return res.data;
|
|
151
161
|
}
|
|
@@ -154,6 +164,7 @@ export default class Repzo {
|
|
|
154
164
|
let res = await axios.delete(`${baseUrl}/${path}`, {
|
|
155
165
|
params,
|
|
156
166
|
headers: this.headers,
|
|
167
|
+
timeout: this.timeout,
|
|
157
168
|
});
|
|
158
169
|
return res.data;
|
|
159
170
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface Data {
|
|
|
8
8
|
export interface Options {
|
|
9
9
|
env?: "staging" | "local" | "production";
|
|
10
10
|
headers?: { [key: string]: string };
|
|
11
|
+
timeout?: number | undefined;
|
|
11
12
|
}
|
|
12
13
|
export interface Headers {
|
|
13
14
|
"api-key": string;
|
|
@@ -42,7 +43,7 @@ interface ClientCreator {
|
|
|
42
43
|
name?: string;
|
|
43
44
|
client?: string;
|
|
44
45
|
}
|
|
45
|
-
interface SerialNumber {
|
|
46
|
+
export interface SerialNumber {
|
|
46
47
|
identifier: string;
|
|
47
48
|
formatted: string;
|
|
48
49
|
count: number;
|