itrm-tools 1.0.16 → 1.0.18

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.
@@ -0,0 +1,7 @@
1
+ import { AxiosRequestConfig } from "axios";
2
+ export declare class RequestAxiosCall {
3
+ static get(url: string, config?: AxiosRequestConfig<any>): Promise<unknown>;
4
+ static post(url: string, body: any, config?: AxiosRequestConfig): Promise<unknown>;
5
+ static put(url: string, body: any, config?: AxiosRequestConfig): Promise<unknown>;
6
+ static delete(url: string, config?: AxiosRequestConfig): Promise<unknown>;
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RequestAxiosCall = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const axios_retry_1 = __importDefault(require("axios-retry"));
18
+ (0, axios_retry_1.default)(axios_1.default, { retries: 3 });
19
+ class RequestAxiosCall {
20
+ static get(url, config) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ return new Promise((resolve, reject) => {
23
+ axios_1.default.get(url, config !== null && config !== void 0 ? config : { headers: { 'Content-Type': 'application/json' } })
24
+ .then(response => { resolve(response.data); })
25
+ .catch(err => { reject(err); });
26
+ });
27
+ });
28
+ }
29
+ static post(url, body, config) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ return new Promise((resolve, reject) => {
32
+ axios_1.default.post(url, body, config !== null && config !== void 0 ? config : { headers: { 'Content-Type': 'application/json' } })
33
+ .then(response => { resolve(response.data); })
34
+ .catch(err => { reject(err); });
35
+ });
36
+ });
37
+ }
38
+ static put(url, body, config) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ return new Promise((resolve, reject) => {
41
+ axios_1.default.put(url, body, config !== null && config !== void 0 ? config : { headers: { 'Content-Type': 'application/json' } })
42
+ .then(response => { resolve(response.data); })
43
+ .catch(err => { reject(err); });
44
+ });
45
+ });
46
+ }
47
+ static delete(url, config) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return new Promise((resolve, reject) => {
50
+ axios_1.default.delete(url, config !== null && config !== void 0 ? config : { headers: { 'Content-Type': 'application/json' } })
51
+ .then(response => { resolve(response.data); })
52
+ .catch(err => { reject(err); });
53
+ });
54
+ });
55
+ }
56
+ }
57
+ exports.RequestAxiosCall = RequestAxiosCall;
58
+ //# sourceMappingURL=RequestAxiosCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestAxiosCall.js","sourceRoot":"","sources":["../../../src/api/request/RequestAxiosCall.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAgE;AAChE,8DAAqC;AAErC,IAAA,qBAAU,EAAC,eAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAElC,MAAa,gBAAgB;IAClB,MAAM,CAAO,GAAG,CAAC,GAAW,EAAE,MAAgC;;YACjE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACnC,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;qBAC5E,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,C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;QACP,CAAC;KAAA;IAEM,MAAM,CAAO,MAAM,CAAC,GAAW,EAAE,MAA2B;;YAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACnC,eAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;qBAC/E,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,CAAC;qBAC5C,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AAhCD,4CAgCC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { ExpressStandardConfiguration as ExpressStandardConfiguration } from './
5
5
  export { APIRequest as APIRequest, RequestMethod as RequestMethod, RequestContext as RequestContext, GroupedParameters as GroupedParameters, APIRequestConfig as APIRequestConfig } from './api/APIRequest';
6
6
  export { APIRouter as APIRouter } from './api/APIRouter';
7
7
  export { SimpleAPIRouter as SimpleAPIRouter } from './api/route/SimpleAPIRouter';
8
+ export { RequestAxiosCall as RequestAxiosCall } from './api/request/RequestAxiosCall';
8
9
  export { GetRequest as GetRequest } from './api/request/GetRequest';
9
10
  export { PostRequest as PostRequest } from './api/request/PostRequest';
10
11
  export { PutRequest as PutRequest } from './api/request/PutRequest';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CoingeckoPriceFinder = exports.Coin = exports.LoggerWebSocket = exports.LoggerManager = exports.Logger = exports.SequelizeModelManager = exports.SequelizeConnection = exports.MongooseModelManager = exports.SimpleCheckableAPIRouter = exports.CheckableAPIRouter = exports.CheckablePutRequest = exports.CheckablePostRequest = exports.CheckableGetRequest = exports.CheckableDeleteRequest = exports.APIChecker = exports.CheckableAPIRequest = exports.DeleteRequest = exports.PutRequest = exports.PostRequest = exports.GetRequest = exports.SimpleAPIRouter = exports.APIRouter = exports.RequestContext = exports.RequestMethod = exports.APIRequest = exports.ExpressStandardConfiguration = exports.HttpsAPIService = exports.ITRMAPIServiceGlobal = exports.APIService = void 0;
3
+ exports.CoingeckoPriceFinder = exports.Coin = exports.LoggerWebSocket = exports.LoggerManager = exports.Logger = exports.SequelizeModelManager = exports.SequelizeConnection = exports.MongooseModelManager = exports.SimpleCheckableAPIRouter = exports.CheckableAPIRouter = exports.CheckablePutRequest = exports.CheckablePostRequest = exports.CheckableGetRequest = exports.CheckableDeleteRequest = exports.APIChecker = exports.CheckableAPIRequest = exports.DeleteRequest = exports.PutRequest = exports.PostRequest = exports.GetRequest = exports.RequestAxiosCall = exports.SimpleAPIRouter = exports.APIRouter = exports.RequestContext = exports.RequestMethod = exports.APIRequest = exports.ExpressStandardConfiguration = exports.HttpsAPIService = exports.ITRMAPIServiceGlobal = exports.APIService = void 0;
4
4
  var APIService_1 = require("./api/APIService");
5
5
  Object.defineProperty(exports, "APIService", { enumerable: true, get: function () { return APIService_1.APIService; } });
6
6
  Object.defineProperty(exports, "ITRMAPIServiceGlobal", { enumerable: true, get: function () { return APIService_1.ITRMAPIServiceGlobal; } });
@@ -16,6 +16,8 @@ var APIRouter_1 = require("./api/APIRouter");
16
16
  Object.defineProperty(exports, "APIRouter", { enumerable: true, get: function () { return APIRouter_1.APIRouter; } });
17
17
  var SimpleAPIRouter_1 = require("./api/route/SimpleAPIRouter");
18
18
  Object.defineProperty(exports, "SimpleAPIRouter", { enumerable: true, get: function () { return SimpleAPIRouter_1.SimpleAPIRouter; } });
19
+ var RequestAxiosCall_1 = require("./api/request/RequestAxiosCall");
20
+ Object.defineProperty(exports, "RequestAxiosCall", { enumerable: true, get: function () { return RequestAxiosCall_1.RequestAxiosCall; } });
19
21
  var GetRequest_1 = require("./api/request/GetRequest");
20
22
  Object.defineProperty(exports, "GetRequest", { enumerable: true, get: function () { return GetRequest_1.GetRequest; } });
21
23
  var PostRequest_1 = require("./api/request/PostRequest");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0L;AAA3I,wGAAA,UAAU,OAAc;AAA4C,kHAAA,oBAAoB,OAAwB;AAC/J,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;AAE3C,2FAA0H;AAAjH,4IAAA,4BAA4B,OAAgC;AACrE,+CAA4M;AAAnM,wGAAA,UAAU,OAAc;AAAE,2GAAA,aAAa,OAAiB;AAAE,4GAAA,cAAc,OAAkB;AACnG,6CAAyD;AAAhD,sGAAA,SAAS,OAAa;AAC/B,+DAAgF;AAAvE,kHAAA,eAAe,OAAmB;AAC3C,uDAAoE;AAA3D,wGAAA,UAAU,OAAc;AACjC,yDAAuE;AAA9D,0GAAA,WAAW,OAAe;AACnC,uDAAoE;AAA3D,wGAAA,UAAU,OAAc;AACjC,6DAA6E;AAApE,8GAAA,aAAa,OAAiB;AACvC,uEAA6F;AAApF,0HAAA,mBAAmB,OAAuB;AACnD,qDAAoL;AAA3F,wGAAA,UAAU,OAAc;AACjH,qFAA8G;AAArG,gIAAA,sBAAsB,OAA0B;AACzD,+EAAqG;AAA5F,0HAAA,mBAAmB,OAAuB;AACnD,iFAAwG;AAA/F,4HAAA,oBAAoB,OAAwB;AACrD,+EAAqG;AAA5F,0HAAA,mBAAmB,OAAuB;AACnD,qEAA0F;AAAjF,wHAAA,kBAAkB,OAAsB;AACjD,uFAAkH;AAAzG,oIAAA,wBAAwB,OAA4B;AAE7D,iFAAwG;AAA/F,4HAAA,oBAAoB,OAAwB;AACrD,gFAAsG;AAA7F,0HAAA,mBAAmB,OAAuB;AACnD,oFAA4G;AAAnG,8HAAA,qBAAqB,OAAyB;AAE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AA7F,0HAAA,mBAAmB,OAAuB;AACnD,oFAA4G;AAAnG,8HAAA,qBAAqB,OAAyB;AAEvD,uCAAgD;AAAvC,gGAAA,MAAM,OAAU;AACzB,qDAAqE;AAA5D,8GAAA,aAAa,OAAiB;AACvC,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;AAE3C,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,8EAA6E;AAApE,4HAAA,oBAAoB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itrm-tools",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,6 +47,7 @@
47
47
  "@types/express": "^4.17.15",
48
48
  "@types/ws": "^8.5.4",
49
49
  "axios": "^1.2.2",
50
+ "axios-retry": "^3.4.0",
50
51
  "cors": "^2.8.5",
51
52
  "express": "^4.18.2",
52
53
  "https": "^1.0.0",