@edgeiq/edgeiq-api-js 1.1.6 → 1.1.9
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.
|
@@ -91,19 +91,19 @@ var handleOtherErrors = function (error) {
|
|
|
91
91
|
action = constants_1.MethodsActions.put;
|
|
92
92
|
break;
|
|
93
93
|
case 'post':
|
|
94
|
-
if (path.indexOf(constants_1.BaseEndpoints.gatewayCommand) !== -1) {
|
|
94
|
+
if (path && path.indexOf(constants_1.BaseEndpoints.gatewayCommand) !== -1) {
|
|
95
95
|
return Promise.reject(createError(constants_1.ResponseErrorsMessages.issueCommand, constants_1.ResponseErrorsNames.issueCommand));
|
|
96
96
|
}
|
|
97
|
-
else if (path.indexOf(constants_1.BaseEndpoints.gatewayCsvUpload) !== -1) {
|
|
97
|
+
else if (path && path.indexOf(constants_1.BaseEndpoints.gatewayCsvUpload) !== -1) {
|
|
98
98
|
return Promise.reject(createError(constants_1.ResponseErrorsMessages.csvUpload, constants_1.ResponseErrorsNames.csvUpload));
|
|
99
99
|
}
|
|
100
|
-
else if (path.indexOf(constants_1.BaseEndpoints.file) !== -1) {
|
|
100
|
+
else if (path && path.indexOf(constants_1.BaseEndpoints.file) !== -1) {
|
|
101
101
|
return Promise.reject(createError(constants_1.ResponseErrorsMessages.fileUpload, constants_1.ResponseErrorsNames.fileUpload));
|
|
102
102
|
}
|
|
103
103
|
if (error.response.data.messages) {
|
|
104
104
|
var text = error.response.data.messages[0];
|
|
105
105
|
if (model === constants_1.BaseEndpoints.device) {
|
|
106
|
-
if (text.indexOf(constants_1.ErrorParts.deviceExists) !== -1) {
|
|
106
|
+
if (text && text.indexOf(constants_1.ErrorParts.deviceExists) !== -1) {
|
|
107
107
|
error.response.data = createError(text, constants_1.ResponseErrorsNames.duplicatedDevice);
|
|
108
108
|
}
|
|
109
109
|
else if (error.response.data.messages[0] === constants_1.ErrorParts.uniqueIdError) {
|
|
@@ -113,10 +113,10 @@ var handleOtherErrors = function (error) {
|
|
|
113
113
|
else if (model === constants_1.BaseEndpoints.deviceConfig) {
|
|
114
114
|
error.response.data = createError(error.response.data.messages.join('\n'), constants_1.ResponseErrorsNames.deviceConfig);
|
|
115
115
|
}
|
|
116
|
-
else if (text.indexOf(constants_1.ErrorParts.uniqueConstraint) !== -1) {
|
|
116
|
+
else if (text && text.indexOf(constants_1.ErrorParts.uniqueConstraint) !== -1) {
|
|
117
117
|
error.response.data = createError(constants_1.ResponseErrorsMessages.uniqueConstraint(model), constants_1.ResponseErrorsNames.uniqueConstraint);
|
|
118
118
|
}
|
|
119
|
-
else if (text.indexOf(constants_1.ErrorParts.duplicateKey) !== -1) {
|
|
119
|
+
else if (text && text.indexOf(constants_1.ErrorParts.duplicateKey) !== -1) {
|
|
120
120
|
error.response.data = createError(text, constants_1.ResponseErrorsNames.duplicateKey);
|
|
121
121
|
}
|
|
122
122
|
else if (error.response.data.error === constants_1.ResponseErrorsNames.createError) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Base, Filter, Filters, Pagination } from '../models';
|
|
2
2
|
export interface DeviceTransferRequestInput {
|
|
3
|
-
transferred_at?: string;
|
|
4
|
-
from_company_id: string;
|
|
5
3
|
to_company_id: string;
|
|
6
|
-
|
|
4
|
+
device_type_id: string;
|
|
5
|
+
escrow_device_ids: string[];
|
|
6
|
+
transferred_at?: string;
|
|
7
|
+
from_company_id?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
device_template_id?: string;
|
|
7
10
|
errors?: {
|
|
8
11
|
[key: string]: string;
|
|
9
12
|
};
|
|
10
|
-
device_type_id: string;
|
|
11
|
-
device_template_id: string;
|
|
12
|
-
escrow_device_ids: string[];
|
|
13
13
|
}
|
|
14
14
|
export interface DeviceTransferRequest extends DeviceTransferRequestInput, Base {
|
|
15
15
|
}
|
package/dist/stats/models.d.ts
CHANGED