@or-sdk/idw 4.5.0-beta.1816.0 → 4.5.0-beta.1819.0

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.
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IDW_PROVIDER_NAME_SPACE = exports.VERSION_PROP = exports.SERVICE_KEY = exports.GRAPH_NAME = void 0;
4
- exports.GRAPH_NAME = 'idw';
3
+ exports.IDW_PROVIDER_NAME_SPACE = exports.SERVICE_KEY = void 0;
5
4
  exports.SERVICE_KEY = 'idw';
6
- exports.VERSION_PROP = 'idwMigrationVersion';
7
5
  exports.IDW_PROVIDER_NAME_SPACE = 'idw-provider';
8
6
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,YAAY,GAAG,qBAAqB,CAAC;AACrC,QAAA,uBAAuB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,uBAAuB,GAAG,cAAc,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -14,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.IdwPublic = exports.IdwApi = void 0;
17
+ exports.IdwApi = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  var idwApi_1 = require("./idwApi");
20
20
  Object.defineProperty(exports, "IdwApi", { enumerable: true, get: function () { return idwApi_1.IdwApi; } });
21
- var idwPublic_1 = require("./idwPublic");
22
- Object.defineProperty(exports, "IdwPublic", { enumerable: true, get: function () { return idwPublic_1.IdwPublic; } });
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,yCAAwC;AAA/B,sGAAA,SAAS,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
@@ -1,5 +1,3 @@
1
- export const GRAPH_NAME = 'idw';
2
1
  export const SERVICE_KEY = 'idw';
3
- export const VERSION_PROP = 'idwMigrationVersion';
4
2
  export const IDW_PROVIDER_NAME_SPACE = 'idw-provider';
5
3
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AACjC,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './types';
2
2
  export { IdwApi } from './idwApi';
3
- export { IdwPublic } from './idwPublic';
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -1,5 +1,3 @@
1
- export declare const GRAPH_NAME = "idw";
2
1
  export declare const SERVICE_KEY = "idw";
3
- export declare const VERSION_PROP = "idwMigrationVersion";
4
2
  export declare const IDW_PROVIDER_NAME_SPACE = "idw-provider";
5
3
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAQ,CAAC;AAChC,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,YAAY,wBAAwB,CAAC;AAClD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,uBAAuB,iBAAiB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export * from './types';
2
2
  export { IdwApi } from './idwApi';
3
- export { IdwPublic } from './idwPublic';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { Token } from '@or-sdk/base';
2
- export type IDWBaseConfig = IDWPublicConfig & {
3
- token: Token;
4
- };
5
- export type IDWPublicConfig = {
2
+ export type IDWBaseConfig = {
6
3
  providerAccountId: string;
7
4
  emUrl: string;
5
+ token: Token;
8
6
  };
9
7
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAI5C,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAI5B,iBAAiB,EAAE,MAAM,CAAC;IAI1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG;IAI1B,iBAAiB,EAAE,MAAM,CAAC;IAI1B,KAAK,EAAE,MAAM,CAAC;IAId,KAAK,EAAE,KAAK,CAAC;CACd,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.5.0-beta.1816.0",
2
+ "version": "4.5.0-beta.1819.0",
3
3
  "name": "@or-sdk/idw",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
package/src/constants.ts CHANGED
@@ -1,4 +1,2 @@
1
- export const GRAPH_NAME = 'idw';
2
1
  export const SERVICE_KEY = 'idw';
3
- export const VERSION_PROP = 'idwMigrationVersion';
4
2
  export const IDW_PROVIDER_NAME_SPACE = 'idw-provider';
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './types';
2
2
  export { IdwApi } from './idwApi';
3
- export { IdwPublic } from './idwPublic';
@@ -1,13 +1,6 @@
1
1
  import { Token } from '@or-sdk/base';
2
2
 
3
- export type IDWBaseConfig = IDWPublicConfig & {
4
- /**
5
- * token
6
- */
7
- token: Token;
8
- };
9
-
10
- export type IDWPublicConfig = {
3
+ export type IDWBaseConfig = {
11
4
  /**
12
5
  * onereach account ID
13
6
  */
@@ -16,4 +9,8 @@ export type IDWPublicConfig = {
16
9
  * Event Manager url
17
10
  */
18
11
  emUrl: string;
12
+ /**
13
+ * token
14
+ */
15
+ token: Token;
19
16
  };
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.IdwPublic = void 0;
54
- var axios_1 = __importDefault(require("axios"));
55
- var base_1 = require("@or-sdk/base");
56
- var helpers_1 = require("./helpers");
57
- var IdwPublic = (function () {
58
- function IdwPublic(_a) {
59
- var providerAccountId = _a.providerAccountId, emUrl = _a.emUrl;
60
- this.axios = axios_1.default.create();
61
- this.providerAccountId = providerAccountId;
62
- this.emUrl = emUrl;
63
- }
64
- IdwPublic.prototype.getIdwInfoWithStatistic = function () {
65
- return this.makeRequest({
66
- route: (0, helpers_1.buildRoute)('public'),
67
- method: 'GET',
68
- });
69
- };
70
- IdwPublic.prototype.providerUrl = function () {
71
- return "/http/".concat(this.providerAccountId);
72
- };
73
- IdwPublic.prototype.makeRequest = function (params) {
74
- return __awaiter(this, void 0, void 0, function () {
75
- var conf, data;
76
- return __generator(this, function (_a) {
77
- switch (_a.label) {
78
- case 0:
79
- conf = {
80
- url: "".concat(this.emUrl, "/").concat(this.providerUrl, "/").concat((0, base_1.normalizeRoute)(params.route)),
81
- method: params.method || 'GET',
82
- data: params.data,
83
- params: params.params,
84
- headers: __assign({ 'Content-Type': 'application/json;charset=UTF-8' }, (params.customHeaders && params.customHeaders)),
85
- signal: params.signal,
86
- };
87
- return [4, this.axios(conf)
88
- .catch(function (e) { throw (0, base_1.parseAxiosError)(e); })];
89
- case 1:
90
- data = (_a.sent()).data;
91
- return [2, data];
92
- }
93
- });
94
- });
95
- };
96
- return IdwPublic;
97
- }());
98
- exports.IdwPublic = IdwPublic;
99
- //# sourceMappingURL=idwPublic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idwPublic.js","sourceRoot":"","sources":["../../src/idwPublic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkD;AAElD,qCAA6E;AAC7E,qCAAuC;AAGvC;IAKE,mBAAY,EAA6C;YAA3C,iBAAiB,uBAAA,EAAE,KAAK,WAAA;QAJrB,UAAK,GAAG,eAAK,CAAC,MAAM,EAAE,CAAC;QAKtC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAKD,2CAAuB,GAAvB;QACE,OAAO,IAAI,CAAC,WAAW,CAAC;YACtB,KAAK,EAAE,IAAA,oBAAU,EAAC,QAAQ,CAAC;YAC3B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAGO,+BAAW,GAAnB;QACE,OAAO,gBAAS,IAAI,CAAC,iBAAiB,CAAE,CAAC;IAC3C,CAAC;IAEa,+BAAW,GAAzB,UAA6B,MAAoB;;;;;;wBACzC,IAAI,GAAuB;4BAC/B,GAAG,EAAE,UAAG,IAAI,CAAC,KAAK,cAAI,IAAI,CAAC,WAAW,cAAI,IAAA,qBAAc,EAAC,MAAM,CAAC,KAAK,CAAC,CAAE;4BACxE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,KAAK;4BAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;4BACjB,MAAM,EAAE,MAAM,CAAC,MAAM;4BACrB,OAAO,aACL,cAAc,EAAE,gCAAgC,IAC7C,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,CAClD;4BACD,MAAM,EAAE,MAAM,CAAC,MAAM;yBACtB,CAAC;wBACe,WAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;iCACpC,KAAK,CAAC,UAAA,CAAC,IAAK,MAAM,IAAA,sBAAe,EAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,EAAA;;wBADlC,IAAI,GAAK,CAAA,SACyB,CAAA,KAD9B;wBAGZ,WAAO,IAAI,EAAC;;;;KACb;IACH,gBAAC;AAAD,CAAC,AA1CD,IA0CC;AA1CY,8BAAS"}
@@ -1,44 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import axios from 'axios';
11
- import { normalizeRoute, parseAxiosError } from '@or-sdk/base';
12
- import { buildRoute } from './helpers';
13
- export class IdwPublic {
14
- constructor({ providerAccountId, emUrl }) {
15
- this.axios = axios.create();
16
- this.providerAccountId = providerAccountId;
17
- this.emUrl = emUrl;
18
- }
19
- getIdwInfoWithStatistic() {
20
- return this.makeRequest({
21
- route: buildRoute('public'),
22
- method: 'GET',
23
- });
24
- }
25
- providerUrl() {
26
- return `/http/${this.providerAccountId}`;
27
- }
28
- makeRequest(params) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- const conf = {
31
- url: `${this.emUrl}/${this.providerUrl}/${normalizeRoute(params.route)}`,
32
- method: params.method || 'GET',
33
- data: params.data,
34
- params: params.params,
35
- headers: Object.assign({ 'Content-Type': 'application/json;charset=UTF-8' }, (params.customHeaders && params.customHeaders)),
36
- signal: params.signal,
37
- };
38
- const { data } = yield this.axios(conf)
39
- .catch(e => { throw parseAxiosError(e); });
40
- return data;
41
- });
42
- }
43
- }
44
- //# sourceMappingURL=idwPublic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idwPublic.js","sourceRoot":"","sources":["../../src/idwPublic.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,cAAc,EAAgB,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,MAAM,OAAO,SAAS;IAKpB,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAmB;QAJxC,UAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAKtC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAKD,uBAAuB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC;YACtB,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;YAC3B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAGO,WAAW;QACjB,OAAO,SAAS,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3C,CAAC;IAEa,WAAW,CAAI,MAAoB;;YAC/C,MAAM,IAAI,GAAuB;gBAC/B,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;gBACxE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,KAAK;gBAC9B,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,kBACL,cAAc,EAAE,gCAAgC,IAC7C,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,CAClD;gBACD,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC;YACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;iBACpC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAE,MAAM,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;YAE3C,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF"}
@@ -1,11 +0,0 @@
1
- import { IdwInfoWithStatistic, IDWPublicConfig } from './types';
2
- export declare class IdwPublic {
3
- private readonly axios;
4
- private readonly providerAccountId;
5
- private readonly emUrl;
6
- constructor({ providerAccountId, emUrl }: IDWPublicConfig);
7
- getIdwInfoWithStatistic(): Promise<IdwInfoWithStatistic>;
8
- private providerUrl;
9
- private makeRequest;
10
- }
11
- //# sourceMappingURL=idwPublic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idwPublic.d.ts","sourceRoot":"","sources":["../../src/idwPublic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAKhE,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE,eAAe;IAQzD,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAQxD,OAAO,CAAC,WAAW;YAIL,WAAW;CAiB1B"}
package/src/idwPublic.ts DELETED
@@ -1,49 +0,0 @@
1
- import axios, { AxiosRequestConfig } from 'axios';
2
- import { IdwInfoWithStatistic, IDWPublicConfig } from './types';
3
- import { normalizeRoute, CalApiParams, parseAxiosError } from '@or-sdk/base';
4
- import { buildRoute } from './helpers';
5
-
6
-
7
- export class IdwPublic {
8
- private readonly axios = axios.create();
9
- private readonly providerAccountId: string;
10
- private readonly emUrl: string;
11
-
12
- constructor({ providerAccountId, emUrl }: IDWPublicConfig) {
13
- this.providerAccountId = providerAccountId;
14
- this.emUrl = emUrl;
15
- }
16
-
17
- /**
18
- * Get extended public info about IDW with statistic
19
- */
20
- getIdwInfoWithStatistic(): Promise<IdwInfoWithStatistic> {
21
- return this.makeRequest({
22
- route: buildRoute('public'),
23
- method: 'GET',
24
- });
25
- }
26
-
27
-
28
- private providerUrl() {
29
- return `/http/${this.providerAccountId}`;
30
- }
31
-
32
- private async makeRequest<T>(params: CalApiParams): Promise<T> {
33
- const conf: AxiosRequestConfig = {
34
- url: `${this.emUrl}/${this.providerUrl}/${normalizeRoute(params.route)}`,
35
- method: params.method || 'GET',
36
- data: params.data,
37
- params: params.params,
38
- headers: {
39
- 'Content-Type': 'application/json;charset=UTF-8',
40
- ...(params.customHeaders && params.customHeaders),
41
- },
42
- signal: params.signal,
43
- };
44
- const { data } = await this.axios(conf)
45
- .catch(e => {throw parseAxiosError(e);});
46
-
47
- return data;
48
- }
49
- }