@or-sdk/idw-public 1.2.2-beta.1946.0 → 1.2.2-beta.1968.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.
- package/dist/cjs/IdwPublic.js +57 -4
- package/dist/cjs/IdwPublic.js.map +1 -1
- package/dist/cjs/types/exceptions.js +27 -0
- package/dist/cjs/types/exceptions.js.map +1 -0
- package/dist/esm/IdwPublic.js +22 -4
- package/dist/esm/IdwPublic.js.map +1 -1
- package/dist/esm/types/exceptions.js +3 -0
- package/dist/esm/types/exceptions.js.map +1 -0
- package/dist/types/IdwPublic.d.ts.map +1 -1
- package/dist/types/types/exceptions.d.ts +3 -0
- package/dist/types/types/exceptions.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/IdwPublic.ts +19 -7
- package/src/types/exceptions.ts +1 -0
package/dist/cjs/IdwPublic.js
CHANGED
|
@@ -1,8 +1,45 @@
|
|
|
1
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 __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.IdwPublic = void 0;
|
|
4
40
|
var providers_1 = require("@or-sdk/providers");
|
|
5
41
|
var constants_1 = require("./constants");
|
|
42
|
+
var exceptions_1 = require("./types/exceptions");
|
|
6
43
|
var IdwPublic = (function () {
|
|
7
44
|
function IdwPublic(_a) {
|
|
8
45
|
var serviceDiscoveryUrl = _a.serviceDiscoveryUrl, emUrl = _a.emUrl, _b = _a.providerAccountId, providerAccountId = _b === void 0 ? undefined : _b, _c = _a.idwProviderNameSpace, idwProviderNameSpace = _c === void 0 ? constants_1.IDW_PROVIDER_NAME_SPACE : _c;
|
|
@@ -15,10 +52,26 @@ var IdwPublic = (function () {
|
|
|
15
52
|
this.idwProviderNameSpace = idwProviderNameSpace;
|
|
16
53
|
}
|
|
17
54
|
IdwPublic.prototype.getIdwInfoWithStatistic = function (params) {
|
|
18
|
-
return this
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var idwInfo, _a;
|
|
57
|
+
return __generator(this, function (_b) {
|
|
58
|
+
switch (_b.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
_b.trys.push([0, 2, , 3]);
|
|
61
|
+
return [4, this.provider.makeRequest({
|
|
62
|
+
route: this.buildRoute('public'),
|
|
63
|
+
method: 'GET',
|
|
64
|
+
params: params,
|
|
65
|
+
})];
|
|
66
|
+
case 1:
|
|
67
|
+
idwInfo = _b.sent();
|
|
68
|
+
return [2, idwInfo];
|
|
69
|
+
case 2:
|
|
70
|
+
_a = _b.sent();
|
|
71
|
+
throw new exceptions_1.IdwNotFound();
|
|
72
|
+
case 3: return [2];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
22
75
|
});
|
|
23
76
|
};
|
|
24
77
|
IdwPublic.prototype.getChannels = function (params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdwPublic.js","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdwPublic.js","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,+CAA8C;AAC9C,yCAAsD;AACtD,iDAAiD;AAEj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KAAK,CAAE,CAAC;IACjD,CAAC;IAEH,gBAAC;AAAD,CAAC,AA/DD,IA+DC;AA/DY,8BAAS"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.IdwNotFound = void 0;
|
|
19
|
+
var IdwNotFound = (function (_super) {
|
|
20
|
+
__extends(IdwNotFound, _super);
|
|
21
|
+
function IdwNotFound() {
|
|
22
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
}
|
|
24
|
+
return IdwNotFound;
|
|
25
|
+
}(Error));
|
|
26
|
+
exports.IdwNotFound = IdwNotFound;
|
|
27
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../../src/types/exceptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAiC,+BAAK;IAAtC;;IAAwC,CAAC;IAAD,kBAAC;AAAD,CAAC,AAAzC,CAAiC,KAAK,GAAG;AAA5B,kCAAW"}
|
package/dist/esm/IdwPublic.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
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
|
+
};
|
|
1
10
|
import { Providers } from '@or-sdk/providers';
|
|
2
11
|
import { IDW_PROVIDER_NAME_SPACE } from './constants';
|
|
12
|
+
import { IdwNotFound } from './types/exceptions';
|
|
3
13
|
export class IdwPublic {
|
|
4
14
|
constructor({ serviceDiscoveryUrl, emUrl, providerAccountId = undefined, idwProviderNameSpace = IDW_PROVIDER_NAME_SPACE, }) {
|
|
5
15
|
this.provider = new Providers({
|
|
@@ -11,10 +21,18 @@ export class IdwPublic {
|
|
|
11
21
|
this.idwProviderNameSpace = idwProviderNameSpace;
|
|
12
22
|
}
|
|
13
23
|
getIdwInfoWithStatistic(params) {
|
|
14
|
-
return this
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
try {
|
|
26
|
+
const idwInfo = yield this.provider.makeRequest({
|
|
27
|
+
route: this.buildRoute('public'),
|
|
28
|
+
method: 'GET',
|
|
29
|
+
params,
|
|
30
|
+
});
|
|
31
|
+
return idwInfo;
|
|
32
|
+
}
|
|
33
|
+
catch (_a) {
|
|
34
|
+
throw new IdwNotFound();
|
|
35
|
+
}
|
|
18
36
|
});
|
|
19
37
|
}
|
|
20
38
|
getChannels(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdwPublic.js","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdwPublic.js","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":";;;;;;;;;AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,SAAS;IAIpB,YACE,EACE,mBAAmB,EACnB,KAAK,EACL,iBAAiB,GAAG,SAAS,EAC7B,oBAAoB,GAAG,uBAAuB,GAC9B;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,SAAS,CAAC;YAE5B,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;YACf,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;YACrC,YAAY,EAAE,mBAAmB;SAClC,CAAC,CAAC;QACH,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAKK,uBAAuB,CAAC,MAAuB;;YACnD,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;oBAC9C,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;oBAChC,MAAM,EAAE,KAAK;oBACb,MAAM;iBACP,CAAC,CAAC;gBACH,OAAO,OAAqC,CAAC;aAC9C;YAAC,WAAM;gBACN,MAAM,IAAI,WAAW,EAAE,CAAC;aACzB;QACH,CAAC;KAAA;IAKD,WAAW,CAAC,MAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;YACzC,MAAM,EAAE,KAAK;YACb,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAKD,SAAS,CAAC,MAAuB;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YACvC,MAAM,EAAE,KAAK;YACb,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAEO,UAAU,CAAC,KAAa;QAC9B,OAAO,GAAG,IAAI,CAAC,oBAAoB,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CAEF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../../src/types/exceptions.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdwPublic.d.ts","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IdwPublic.d.ts","sourceRoot":"","sources":["../../src/IdwPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;gBAG5C,EACE,mBAAmB,EACnB,KAAK,EACL,iBAA6B,EAC7B,oBAA8C,GAC/C,EAAE,eAAe;IAcd,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAgB3F,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAWjE,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAQ7D,OAAO,CAAC,UAAU;CAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../../src/types/exceptions.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.2-beta.
|
|
2
|
+
"version": "1.2.2-beta.1968.0",
|
|
3
3
|
"name": "@or-sdk/idw-public",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@or-sdk/providers": "^0.2.
|
|
27
|
+
"@or-sdk/providers": "^0.2.6"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/IdwPublic.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
IDWPublicConfig,
|
|
3
|
+
IdwPublicChannel,
|
|
4
|
+
IdwPublicInfoWithStatistic,
|
|
5
|
+
IdwPublicParams,
|
|
6
|
+
IdwPublicSkill,
|
|
7
|
+
} from './types';
|
|
2
8
|
import { Providers } from '@or-sdk/providers';
|
|
3
9
|
import { IDW_PROVIDER_NAME_SPACE } from './constants';
|
|
10
|
+
import { IdwNotFound } from './types/exceptions';
|
|
4
11
|
|
|
5
12
|
export class IdwPublic {
|
|
6
13
|
private readonly provider: Providers;
|
|
@@ -26,12 +33,17 @@ export class IdwPublic {
|
|
|
26
33
|
/**
|
|
27
34
|
* Get extended public info about IDW with statistic
|
|
28
35
|
*/
|
|
29
|
-
getIdwInfoWithStatistic(params: IdwPublicParams): Promise<IdwPublicInfoWithStatistic> {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
async getIdwInfoWithStatistic(params: IdwPublicParams): Promise<IdwPublicInfoWithStatistic> {
|
|
37
|
+
try {
|
|
38
|
+
const idwInfo = await this.provider.makeRequest({
|
|
39
|
+
route: this.buildRoute('public'),
|
|
40
|
+
method: 'GET',
|
|
41
|
+
params,
|
|
42
|
+
});
|
|
43
|
+
return idwInfo as IdwPublicInfoWithStatistic;
|
|
44
|
+
} catch {
|
|
45
|
+
throw new IdwNotFound();
|
|
46
|
+
}
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class IdwNotFound extends Error {}
|