@or-sdk/library-categories 0.1.0-beta.818.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/CHANGELOG.md +0 -0
- package/README.md +0 -0
- package/dist/cjs/LibraryCategories.js +72 -0
- package/dist/cjs/LibraryCategories.js.map +1 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/LibraryCategories.js +33 -0
- package/dist/esm/LibraryCategories.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/types/LibraryCategories.d.ts +8 -0
- package/dist/types/LibraryCategories.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +11 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +30 -0
- package/src/LibraryCategories.ts +33 -0
- package/src/index.ts +2 -0
- package/src/types.ts +25 -0
- package/tsconfig.dev.json +8 -0
- package/tsconfig.esm.json +12 -0
- package/tsconfig.json +7 -0
- package/tsconfig.types.json +10 -0
package/CHANGELOG.md
ADDED
|
File without changes
|
package/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.LibraryCategories = void 0;
|
|
40
|
+
var providers_1 = require("@or-sdk/providers");
|
|
41
|
+
var base_1 = require("@or-sdk/base");
|
|
42
|
+
var LibraryCategories = (function () {
|
|
43
|
+
function LibraryCategories(params) {
|
|
44
|
+
var token = params.token, eventManagerUrl = params.eventManagerUrl, discoveryUrl = params.discoveryUrl, providersAccountId = params.providersAccountId;
|
|
45
|
+
this.providers = new providers_1.Providers({
|
|
46
|
+
token: token,
|
|
47
|
+
eventManagerUrl: eventManagerUrl,
|
|
48
|
+
discoveryUrl: discoveryUrl,
|
|
49
|
+
providersAccountId: providersAccountId,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
LibraryCategories.prototype.ListCategories = function (type) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
var categories;
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
switch (_a.label) {
|
|
57
|
+
case 0: return [4, this.providers.makeRequest({
|
|
58
|
+
method: 'GET',
|
|
59
|
+
route: 'library-categories',
|
|
60
|
+
params: { type: type },
|
|
61
|
+
})];
|
|
62
|
+
case 1:
|
|
63
|
+
categories = _a.sent();
|
|
64
|
+
return [2, (0, base_1.makeList)(categories)];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return LibraryCategories;
|
|
70
|
+
}());
|
|
71
|
+
exports.LibraryCategories = LibraryCategories;
|
|
72
|
+
//# sourceMappingURL=LibraryCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryCategories.js","sourceRoot":"","sources":["../../src/LibraryCategories.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qCAA8C;AAG9C;IAGE,2BAAY,MAA+B;QAEvC,IAAA,KAAK,GAIH,MAAM,MAJH,EACL,eAAe,GAGb,MAAM,gBAHO,EACf,YAAY,GAEV,MAAM,aAFI,EACZ,kBAAkB,GAChB,MAAM,mBADU,CACT;QAEX,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC;YAC7B,KAAK,OAAA;YACL,eAAe,iBAAA;YACf,YAAY,cAAA;YACZ,kBAAkB,oBAAA;SACnB,CAAC,CAAC;IACL,CAAC;IAEY,0CAAc,GAA3B,UAA4B,IAAY;;;;;4BACnB,WAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAoB;4BACrE,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,oBAAoB;4BAC3B,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE;yBACjB,CAAC,EAAA;;wBAJI,UAAU,GAAG,SAIjB;wBAEF,WAAO,IAAA,eAAQ,EAAkB,UAAU,CAAC,EAAC;;;;KAC9C;IACH,wBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,8CAAiB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.LibraryCategories = void 0;
|
|
18
|
+
var LibraryCategories_1 = require("./LibraryCategories");
|
|
19
|
+
Object.defineProperty(exports, "LibraryCategories", { enumerable: true, get: function () { return LibraryCategories_1.LibraryCategories; } });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { Providers } from '@or-sdk/providers';
|
|
11
|
+
import { makeList } from '@or-sdk/base';
|
|
12
|
+
export class LibraryCategories {
|
|
13
|
+
constructor(params) {
|
|
14
|
+
const { token, eventManagerUrl, discoveryUrl, providersAccountId, } = params;
|
|
15
|
+
this.providers = new Providers({
|
|
16
|
+
token,
|
|
17
|
+
eventManagerUrl,
|
|
18
|
+
discoveryUrl,
|
|
19
|
+
providersAccountId,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
ListCategories(type) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const categories = yield this.providers.makeRequest({
|
|
25
|
+
method: 'GET',
|
|
26
|
+
route: 'library-categories',
|
|
27
|
+
params: { type },
|
|
28
|
+
});
|
|
29
|
+
return makeList(categories);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=LibraryCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryCategories.js","sourceRoot":"","sources":["../../src/LibraryCategories.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAG9C,MAAM,OAAO,iBAAiB;IAG5B,YAAY,MAA+B;QACzC,MAAM,EACJ,KAAK,EACL,eAAe,EACf,YAAY,EACZ,kBAAkB,GACnB,GAAG,MAAM,CAAC;QAEX,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;YAC7B,KAAK;YACL,eAAe;YACf,YAAY;YACZ,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC;IAEY,cAAc,CAAC,IAAY;;YACtC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAoB;gBACrE,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,oBAAoB;gBAC3B,MAAM,EAAE,EAAE,IAAI,EAAE;aACjB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAkB,UAAU,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { List } from '@or-sdk/base';
|
|
2
|
+
import { LibraryCategoriesConfig, LibraryCategory } from './types';
|
|
3
|
+
export declare class LibraryCategories {
|
|
4
|
+
private readonly providers;
|
|
5
|
+
constructor(params: LibraryCategoriesConfig);
|
|
6
|
+
ListCategories(type: string): Promise<List<LibraryCategory>>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=LibraryCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryCategories.d.ts","sourceRoot":"","sources":["../../src/LibraryCategories.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEnE,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,MAAM,EAAE,uBAAuB;IAgB9B,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;CAS1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Token } from '@or-sdk/base';
|
|
2
|
+
export type LibraryCategoriesConfig = {
|
|
3
|
+
token: Token;
|
|
4
|
+
eventManagerUrl?: string;
|
|
5
|
+
providersAccountId?: string;
|
|
6
|
+
discoveryUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export type LibraryCategory = {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,uBAAuB,GAAG;IAIpC,KAAK,EAAE,KAAK,CAAC;IAKb,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAE;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@or-sdk/library-categories",
|
|
3
|
+
"version": "0.1.0-beta.818.0",
|
|
4
|
+
"main": "dist/cjs/index.js",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "pnpm clean && pnpm build:esm && pnpm build:cjs",
|
|
9
|
+
"build:cjs": "tsc --project tsconfig.json",
|
|
10
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
11
|
+
"build:types": "tsc --project tsconfig.types.json",
|
|
12
|
+
"build:watch": "concurrently -r --hide 1,2 \"pnpm build:watch:cjs\" \"pnpm build:watch:esm\" \"pnpm build:watch:types\"",
|
|
13
|
+
"build:watch:cjs": "tsc --project tsconfig.json -w",
|
|
14
|
+
"build:watch:esm": "tsc --project tsconfig.esm.json -w",
|
|
15
|
+
"build:watch:types": "tsc --project tsconfig.types.json -w",
|
|
16
|
+
"clean": "rm -rf ./dist",
|
|
17
|
+
"dev": "pnpm build:watch:esm"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@or-sdk/base": "^0.27.0",
|
|
21
|
+
"@or-sdk/providers": "^0.2.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"concurrently": "^6.4.0",
|
|
25
|
+
"typescript": "^4.4.4"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Providers } from '@or-sdk/providers';
|
|
2
|
+
import { makeList, List } from '@or-sdk/base';
|
|
3
|
+
import { LibraryCategoriesConfig, LibraryCategory } from './types';
|
|
4
|
+
|
|
5
|
+
export class LibraryCategories {
|
|
6
|
+
private readonly providers: Providers;
|
|
7
|
+
|
|
8
|
+
constructor(params: LibraryCategoriesConfig) {
|
|
9
|
+
const {
|
|
10
|
+
token,
|
|
11
|
+
eventManagerUrl,
|
|
12
|
+
discoveryUrl,
|
|
13
|
+
providersAccountId,
|
|
14
|
+
} = params;
|
|
15
|
+
|
|
16
|
+
this.providers = new Providers({
|
|
17
|
+
token,
|
|
18
|
+
eventManagerUrl,
|
|
19
|
+
discoveryUrl,
|
|
20
|
+
providersAccountId,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async ListCategories(type: string): Promise<List<LibraryCategory>> {
|
|
25
|
+
const categories = await this.providers.makeRequest<LibraryCategory[]>({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
route: 'library-categories',
|
|
28
|
+
params: { type },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return makeList<LibraryCategory>(categories);
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/index.ts
ADDED
package/src/types.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Token } from '@or-sdk/base';
|
|
2
|
+
|
|
3
|
+
export type LibraryCategoriesConfig = {
|
|
4
|
+
/**
|
|
5
|
+
* token
|
|
6
|
+
*/
|
|
7
|
+
token: Token;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Url of OneReach Event Manager api
|
|
11
|
+
*/
|
|
12
|
+
eventManagerUrl?: string;
|
|
13
|
+
|
|
14
|
+
providersAccountId?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Url of OneReach service discovery api
|
|
18
|
+
*/
|
|
19
|
+
discoveryUrl?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type LibraryCategory ={
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
25
|
+
|
package/tsconfig.json
ADDED