abbot-http-client 0.0.25 → 0.0.26
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/dist/index.cjs +31 -32
- package/dist/index.js +31 -32
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,9 @@ async function catchError(promise, errorToCatch) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
// src/http.ts
|
|
50
|
+
var import_axios2 = require("axios");
|
|
51
|
+
|
|
49
52
|
// src/encryption/secure.ts
|
|
50
53
|
var Secure = class {
|
|
51
54
|
static keySize = 16;
|
|
@@ -226,14 +229,13 @@ var CoreHttp = class {
|
|
|
226
229
|
const response = cryp.decrypt(error.response.data);
|
|
227
230
|
err.response = response;
|
|
228
231
|
return Promise.reject(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
// ),
|
|
232
|
+
new import_axios2.AxiosError(
|
|
233
|
+
err.message,
|
|
234
|
+
err.code,
|
|
235
|
+
err.config,
|
|
236
|
+
err.request,
|
|
237
|
+
err.response
|
|
238
|
+
)
|
|
237
239
|
);
|
|
238
240
|
} else {
|
|
239
241
|
err.response = {
|
|
@@ -243,14 +245,13 @@ var CoreHttp = class {
|
|
|
243
245
|
data: null
|
|
244
246
|
};
|
|
245
247
|
return Promise.reject(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
// ),
|
|
248
|
+
new import_axios2.AxiosError(
|
|
249
|
+
err.message,
|
|
250
|
+
err.code,
|
|
251
|
+
err.config,
|
|
252
|
+
err.request,
|
|
253
|
+
err.response
|
|
254
|
+
)
|
|
254
255
|
);
|
|
255
256
|
}
|
|
256
257
|
} else if (error.request) {
|
|
@@ -261,14 +262,13 @@ var CoreHttp = class {
|
|
|
261
262
|
data: null
|
|
262
263
|
};
|
|
263
264
|
return Promise.reject(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
// ),
|
|
265
|
+
new import_axios2.AxiosError(
|
|
266
|
+
err.message,
|
|
267
|
+
err.code,
|
|
268
|
+
err.config,
|
|
269
|
+
err.request,
|
|
270
|
+
err.response
|
|
271
|
+
)
|
|
272
272
|
);
|
|
273
273
|
} else {
|
|
274
274
|
err.response = {
|
|
@@ -278,14 +278,13 @@ var CoreHttp = class {
|
|
|
278
278
|
data: null
|
|
279
279
|
};
|
|
280
280
|
return Promise.reject(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
// ),
|
|
281
|
+
new import_axios2.AxiosError(
|
|
282
|
+
err.message,
|
|
283
|
+
err.code,
|
|
284
|
+
err.config,
|
|
285
|
+
err.request,
|
|
286
|
+
err.response
|
|
287
|
+
)
|
|
289
288
|
);
|
|
290
289
|
}
|
|
291
290
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@ async function catchError(promise, errorToCatch) {
|
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// src/http.ts
|
|
11
|
+
import { AxiosError } from "axios";
|
|
12
|
+
|
|
10
13
|
// src/encryption/secure.ts
|
|
11
14
|
var Secure = class {
|
|
12
15
|
static keySize = 16;
|
|
@@ -187,14 +190,13 @@ var CoreHttp = class {
|
|
|
187
190
|
const response = cryp.decrypt(error.response.data);
|
|
188
191
|
err.response = response;
|
|
189
192
|
return Promise.reject(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
// ),
|
|
193
|
+
new AxiosError(
|
|
194
|
+
err.message,
|
|
195
|
+
err.code,
|
|
196
|
+
err.config,
|
|
197
|
+
err.request,
|
|
198
|
+
err.response
|
|
199
|
+
)
|
|
198
200
|
);
|
|
199
201
|
} else {
|
|
200
202
|
err.response = {
|
|
@@ -204,14 +206,13 @@ var CoreHttp = class {
|
|
|
204
206
|
data: null
|
|
205
207
|
};
|
|
206
208
|
return Promise.reject(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
// ),
|
|
209
|
+
new AxiosError(
|
|
210
|
+
err.message,
|
|
211
|
+
err.code,
|
|
212
|
+
err.config,
|
|
213
|
+
err.request,
|
|
214
|
+
err.response
|
|
215
|
+
)
|
|
215
216
|
);
|
|
216
217
|
}
|
|
217
218
|
} else if (error.request) {
|
|
@@ -222,14 +223,13 @@ var CoreHttp = class {
|
|
|
222
223
|
data: null
|
|
223
224
|
};
|
|
224
225
|
return Promise.reject(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
// ),
|
|
226
|
+
new AxiosError(
|
|
227
|
+
err.message,
|
|
228
|
+
err.code,
|
|
229
|
+
err.config,
|
|
230
|
+
err.request,
|
|
231
|
+
err.response
|
|
232
|
+
)
|
|
233
233
|
);
|
|
234
234
|
} else {
|
|
235
235
|
err.response = {
|
|
@@ -239,14 +239,13 @@ var CoreHttp = class {
|
|
|
239
239
|
data: null
|
|
240
240
|
};
|
|
241
241
|
return Promise.reject(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// ),
|
|
242
|
+
new AxiosError(
|
|
243
|
+
err.message,
|
|
244
|
+
err.code,
|
|
245
|
+
err.config,
|
|
246
|
+
err.request,
|
|
247
|
+
err.response
|
|
248
|
+
)
|
|
250
249
|
);
|
|
251
250
|
}
|
|
252
251
|
}
|