dymo-api 1.0.20 → 1.0.21
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/package.json +1 -1
- package/src/private-api.ts +3 -3
package/package.json
CHANGED
package/src/private-api.ts
CHANGED
|
@@ -50,9 +50,9 @@ export const sendEmail = async (token: string | null, data: Interfaces.SendEmail
|
|
|
50
50
|
export const getRandom = async (token: string | null, data: Interfaces.SRNG): Promise<any> => {
|
|
51
51
|
if (token === null) throw customError(3000, "Invalid private token.");
|
|
52
52
|
if (!data.min || !data.max) throw customError(1500, "Both 'min' and 'max' parameters must be defined.");
|
|
53
|
-
if (data.min >= data.max) throw customError(1500, "
|
|
54
|
-
if (data.min < -1000000000 || data.min > 1000000000) throw customError(1500, "
|
|
55
|
-
if (data.max < -1000000000 || data.max > 1000000000) throw customError(1500, "
|
|
53
|
+
if (data.min >= data.max) throw customError(1500, "'min' must be less than 'max'.");
|
|
54
|
+
if (data.min < -1000000000 || data.min > 1000000000) throw customError(1500, "'min' must be an integer in the interval [-1000000000}, 1000000000].");
|
|
55
|
+
if (data.max < -1000000000 || data.max > 1000000000) throw customError(1500, "'max' must be an integer in the interval [-1000000000}, 1000000000].");
|
|
56
56
|
try {
|
|
57
57
|
const response = await axios.post(`${BASE_URL}/v1/private/srng`, data, { headers: { "Authorization": token } });
|
|
58
58
|
return response.data;
|