@bluealba/pae-core 0.0.3
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/README.md +9 -0
- package/dist/src/authentication/auth-user.interface.d.ts +13 -0
- package/dist/src/authentication/auth-user.interface.d.ts.map +1 -0
- package/dist/src/authentication/auth-user.interface.js +3 -0
- package/dist/src/authentication/auth-user.interface.js.map +1 -0
- package/dist/src/authentication/index.d.ts +2 -0
- package/dist/src/authentication/index.d.ts.map +1 -0
- package/dist/src/authentication/index.js +18 -0
- package/dist/src/authentication/index.js.map +1 -0
- package/dist/src/authorization/allowed-resources.interface.d.ts +7 -0
- package/dist/src/authorization/allowed-resources.interface.d.ts.map +1 -0
- package/dist/src/authorization/allowed-resources.interface.js +3 -0
- package/dist/src/authorization/allowed-resources.interface.js.map +1 -0
- package/dist/src/authorization/application.model.d.ts +7 -0
- package/dist/src/authorization/application.model.d.ts.map +1 -0
- package/dist/src/authorization/application.model.js +14 -0
- package/dist/src/authorization/application.model.js.map +1 -0
- package/dist/src/authorization/authorization-repository.interface.d.ts +9 -0
- package/dist/src/authorization/authorization-repository.interface.d.ts.map +1 -0
- package/dist/src/authorization/authorization-repository.interface.js +3 -0
- package/dist/src/authorization/authorization-repository.interface.js.map +1 -0
- package/dist/src/authorization/authorization.service.d.ts +13 -0
- package/dist/src/authorization/authorization.service.d.ts.map +1 -0
- package/dist/src/authorization/authorization.service.js +32 -0
- package/dist/src/authorization/authorization.service.js.map +1 -0
- package/dist/src/authorization/constants.d.ts +3 -0
- package/dist/src/authorization/constants.d.ts.map +1 -0
- package/dist/src/authorization/constants.js +6 -0
- package/dist/src/authorization/constants.js.map +1 -0
- package/dist/src/authorization/index.d.ts +6 -0
- package/dist/src/authorization/index.d.ts.map +1 -0
- package/dist/src/authorization/index.js +26 -0
- package/dist/src/authorization/index.js.map +1 -0
- package/dist/src/authorization/operation.model.d.ts +10 -0
- package/dist/src/authorization/operation.model.d.ts.map +1 -0
- package/dist/src/authorization/operation.model.js +19 -0
- package/dist/src/authorization/operation.model.js.map +1 -0
- package/dist/src/authorization/repositories/http.repository.d.ts +15 -0
- package/dist/src/authorization/repositories/http.repository.d.ts.map +1 -0
- package/dist/src/authorization/repositories/http.repository.js +157 -0
- package/dist/src/authorization/repositories/http.repository.js.map +1 -0
- package/dist/src/authorization/repositories/index.d.ts +2 -0
- package/dist/src/authorization/repositories/index.d.ts.map +1 -0
- package/dist/src/authorization/repositories/index.js +18 -0
- package/dist/src/authorization/repositories/index.js.map +1 -0
- package/dist/src/authorization/rule.model.d.ts +11 -0
- package/dist/src/authorization/rule.model.d.ts.map +1 -0
- package/dist/src/authorization/rule.model.js +18 -0
- package/dist/src/authorization/rule.model.js.map +1 -0
- package/dist/src/authorization/utilities/filter-app-operations.d.ts +3 -0
- package/dist/src/authorization/utilities/filter-app-operations.d.ts.map +1 -0
- package/dist/src/authorization/utilities/filter-app-operations.js +8 -0
- package/dist/src/authorization/utilities/filter-app-operations.js.map +1 -0
- package/dist/src/authorization/utilities/get-operations.utility.d.ts +8 -0
- package/dist/src/authorization/utilities/get-operations.utility.d.ts.map +1 -0
- package/dist/src/authorization/utilities/get-operations.utility.js +33 -0
- package/dist/src/authorization/utilities/get-operations.utility.js.map +1 -0
- package/dist/src/authorization/utilities/get-route-operations.d.ts +4 -0
- package/dist/src/authorization/utilities/get-route-operations.d.ts.map +1 -0
- package/dist/src/authorization/utilities/get-route-operations.js +45 -0
- package/dist/src/authorization/utilities/get-route-operations.js.map +1 -0
- package/dist/src/authorization/utilities/index.d.ts +2 -0
- package/dist/src/authorization/utilities/index.d.ts.map +1 -0
- package/dist/src/authorization/utilities/index.js +6 -0
- package/dist/src/authorization/utilities/index.js.map +1 -0
- package/dist/src/authorization/utilities/is-authorized.utility.d.ts +6 -0
- package/dist/src/authorization/utilities/is-authorized.utility.d.ts.map +1 -0
- package/dist/src/authorization/utilities/is-authorized.utility.js +21 -0
- package/dist/src/authorization/utilities/is-authorized.utility.js.map +1 -0
- package/dist/src/catalog/authorization.interface.d.ts +11 -0
- package/dist/src/catalog/authorization.interface.d.ts.map +1 -0
- package/dist/src/catalog/authorization.interface.js +3 -0
- package/dist/src/catalog/authorization.interface.js.map +1 -0
- package/dist/src/catalog/catalog-repository.interface.d.ts +5 -0
- package/dist/src/catalog/catalog-repository.interface.d.ts.map +1 -0
- package/dist/src/catalog/catalog-repository.interface.js +3 -0
- package/dist/src/catalog/catalog-repository.interface.js.map +1 -0
- package/dist/src/catalog/catalog.service.d.ts +10 -0
- package/dist/src/catalog/catalog.service.d.ts.map +1 -0
- package/dist/src/catalog/catalog.service.js +32 -0
- package/dist/src/catalog/catalog.service.js.map +1 -0
- package/dist/src/catalog/index.d.ts +6 -0
- package/dist/src/catalog/index.d.ts.map +1 -0
- package/dist/src/catalog/index.js +23 -0
- package/dist/src/catalog/index.js.map +1 -0
- package/dist/src/catalog/module-metadata.interface.d.ts +47 -0
- package/dist/src/catalog/module-metadata.interface.d.ts.map +1 -0
- package/dist/src/catalog/module-metadata.interface.js +3 -0
- package/dist/src/catalog/module-metadata.interface.js.map +1 -0
- package/dist/src/catalog/repositories/http.repository.d.ts +9 -0
- package/dist/src/catalog/repositories/http.repository.d.ts.map +1 -0
- package/dist/src/catalog/repositories/http.repository.js +40 -0
- package/dist/src/catalog/repositories/http.repository.js.map +1 -0
- package/dist/src/catalog/repositories/index.d.ts +2 -0
- package/dist/src/catalog/repositories/index.d.ts.map +1 -0
- package/dist/src/catalog/repositories/index.js +18 -0
- package/dist/src/catalog/repositories/index.js.map +1 -0
- package/dist/src/catalog/service-config.interface.d.ts +17 -0
- package/dist/src/catalog/service-config.interface.d.ts.map +1 -0
- package/dist/src/catalog/service-config.interface.js +3 -0
- package/dist/src/catalog/service-config.interface.js.map +1 -0
- package/dist/src/catalog/ui-config.interface.d.ts +27 -0
- package/dist/src/catalog/ui-config.interface.d.ts.map +1 -0
- package/dist/src/catalog/ui-config.interface.js +3 -0
- package/dist/src/catalog/ui-config.interface.js.map +1 -0
- package/dist/src/catalog/ui-types.constants.d.ts +2 -0
- package/dist/src/catalog/ui-types.constants.d.ts.map +1 -0
- package/dist/src/catalog/ui-types.constants.js +5 -0
- package/dist/src/catalog/ui-types.constants.js.map +1 -0
- package/dist/src/catalog/versions/enrichAppWithVersionMetadata.d.ts +8 -0
- package/dist/src/catalog/versions/enrichAppWithVersionMetadata.d.ts.map +1 -0
- package/dist/src/catalog/versions/enrichAppWithVersionMetadata.js +50 -0
- package/dist/src/catalog/versions/enrichAppWithVersionMetadata.js.map +1 -0
- package/dist/src/catalog/versions/fetchRuntimeMetadata.d.ts +13 -0
- package/dist/src/catalog/versions/fetchRuntimeMetadata.d.ts.map +1 -0
- package/dist/src/catalog/versions/fetchRuntimeMetadata.js +45 -0
- package/dist/src/catalog/versions/fetchRuntimeMetadata.js.map +1 -0
- package/dist/src/gateway/gateway.service.d.ts +7 -0
- package/dist/src/gateway/gateway.service.d.ts.map +1 -0
- package/dist/src/gateway/gateway.service.js +13 -0
- package/dist/src/gateway/gateway.service.js.map +1 -0
- package/dist/src/gateway/get-from-header.d.ts +3 -0
- package/dist/src/gateway/get-from-header.d.ts.map +1 -0
- package/dist/src/gateway/get-from-header.js +11 -0
- package/dist/src/gateway/get-from-header.js.map +1 -0
- package/dist/src/gateway/headers.d.ts +5 -0
- package/dist/src/gateway/headers.d.ts.map +1 -0
- package/dist/src/gateway/headers.js +8 -0
- package/dist/src/gateway/headers.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +24 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/pae/config.interface.d.ts +15 -0
- package/dist/src/pae/config.interface.d.ts.map +1 -0
- package/dist/src/pae/config.interface.js +3 -0
- package/dist/src/pae/config.interface.js.map +1 -0
- package/dist/src/pae/index.d.ts +2 -0
- package/dist/src/pae/index.d.ts.map +1 -0
- package/dist/src/pae/index.js +18 -0
- package/dist/src/pae/index.js.map +1 -0
- package/dist/src/pae/pae.d.ts +17 -0
- package/dist/src/pae/pae.d.ts.map +1 -0
- package/dist/src/pae/pae.js +110 -0
- package/dist/src/pae/pae.js.map +1 -0
- package/dist/src/user/group.interface.d.ts +2 -0
- package/dist/src/user/group.interface.d.ts.map +1 -0
- package/dist/src/user/group.interface.js +3 -0
- package/dist/src/user/group.interface.js.map +1 -0
- package/dist/src/user/repositories/http.repository.d.ts +8 -0
- package/dist/src/user/repositories/http.repository.d.ts.map +1 -0
- package/dist/src/user/repositories/http.repository.js +39 -0
- package/dist/src/user/repositories/http.repository.js.map +1 -0
- package/dist/src/user/repositories/index.d.ts +2 -0
- package/dist/src/user/repositories/index.d.ts.map +1 -0
- package/dist/src/user/repositories/index.js +18 -0
- package/dist/src/user/repositories/index.js.map +1 -0
- package/dist/src/user/user-repository.interface.d.ts +5 -0
- package/dist/src/user/user-repository.interface.d.ts.map +1 -0
- package/dist/src/user/user-repository.interface.js +3 -0
- package/dist/src/user/user-repository.interface.js.map +1 -0
- package/dist/src/user/user.service.d.ts +7 -0
- package/dist/src/user/user.service.d.ts.map +1 -0
- package/dist/src/user/user.service.js +25 -0
- package/dist/src/user/user.service.js.map +1 -0
- package/dist/src/utilities.d.ts +3 -0
- package/dist/src/utilities.d.ts.map +1 -0
- package/dist/src/utilities.js +19 -0
- package/dist/src/utilities.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleMetadata } from "../module-metadata.interface";
|
|
2
|
+
type AppVersionMetadata = {
|
|
3
|
+
displayName: string;
|
|
4
|
+
version: string;
|
|
5
|
+
} | null;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches the version metadata for the given ModuleMetadata.
|
|
8
|
+
* Or returns null in case it cannot fetch it.
|
|
9
|
+
*/
|
|
10
|
+
declare const fetchRuntimeMetadata: (module: ModuleMetadata, sessionCookie: string) => Promise<AppVersionMetadata>;
|
|
11
|
+
export declare const getDisplayName: (module: ModuleMetadata, data?: any) => string;
|
|
12
|
+
export default fetchRuntimeMetadata;
|
|
13
|
+
//# sourceMappingURL=fetchRuntimeMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchRuntimeMetadata.d.ts","sourceRoot":"","sources":["../../../../src/catalog/versions/fetchRuntimeMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D,KAAK,kBAAkB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAA;AAEzE;;;GAGG;AACH,QAAA,MAAM,oBAAoB,WAAkB,cAAc,iBAAiB,MAAM,KAAG,QAAQ,kBAAkB,CAuB7G,CAAA;AAMD,eAAO,MAAM,cAAc,WAAY,cAAc,SAAS,GAAG,WACT,CAAA;AAExD,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getDisplayName = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Fetches the version metadata for the given ModuleMetadata.
|
|
15
|
+
* Or returns null in case it cannot fetch it.
|
|
16
|
+
*/
|
|
17
|
+
const fetchRuntimeMetadata = (module, sessionCookie) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const url = getURL(module);
|
|
19
|
+
try {
|
|
20
|
+
const response = yield fetch(url, {
|
|
21
|
+
headers: {
|
|
22
|
+
Cookie: sessionCookie,
|
|
23
|
+
'x-forwarded-user': 'orchestrator-service',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
console.error(`Failed to fetch version for ${module.name} from ${url}. Status ${response.statusText}`);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const data = yield response.json();
|
|
31
|
+
return {
|
|
32
|
+
version: data.version,
|
|
33
|
+
displayName: (0, exports.getDisplayName)(module, data)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(`Failed to fetch version for ${module.name} from ${url}: ${e.message}`);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const getURL = (module) => `${module.service.protocol || 'http'}://${module.service.host}:${module.service.port}/version`;
|
|
42
|
+
const getDisplayName = (module, data) => { var _a, _b; return (_b = (_a = module.displayName) !== null && _a !== void 0 ? _a : data === null || data === void 0 ? void 0 : data.displayName) !== null && _b !== void 0 ? _b : module.name; };
|
|
43
|
+
exports.getDisplayName = getDisplayName;
|
|
44
|
+
exports.default = fetchRuntimeMetadata;
|
|
45
|
+
//# sourceMappingURL=fetchRuntimeMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchRuntimeMetadata.js","sourceRoot":"","sources":["../../../../src/catalog/versions/fetchRuntimeMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAO,MAAsB,EAAE,aAAqB,EAA+B,EAAE;IAChH,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,OAAO,EAAE;gBACP,MAAM,EAAE,aAAa;gBACrB,kBAAkB,EAAE,sBAAsB;aAC3C;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,IAAI,SAAS,GAAG,YAAY,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACvG,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAA,sBAAc,EAAC,MAAM,EAAE,IAAI,CAAC;SAC1C,CAAA;IACH,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACtF,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,MAAsB,EAAE,EAAE,CACxC,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC;AAG1F,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAE,IAAU,EAAE,EAAE,eACnE,OAAA,MAAA,MAAA,MAAM,CAAC,WAAW,mCAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,MAAM,CAAC,IAAI,CAAA,EAAA,CAAA;AAD3C,QAAA,cAAc,kBAC6B;AAExD,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.service.d.ts","sourceRoot":"","sources":["../../../src/gateway/gateway.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,cAAc;IACzB,IAAI,KAAK;;MAIR;CAEF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GatewayService = void 0;
|
|
4
|
+
const get_from_header_1 = require("./get-from-header");
|
|
5
|
+
class GatewayService {
|
|
6
|
+
get utils() {
|
|
7
|
+
return {
|
|
8
|
+
getFromHeader: get_from_header_1.getFromHeader
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.GatewayService = GatewayService;
|
|
13
|
+
//# sourceMappingURL=gateway.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.service.js","sourceRoot":"","sources":["../../../src/gateway/gateway.service.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAElD,MAAa,cAAc;IACzB,IAAI,KAAK;QACP,OAAO;YACL,aAAa,EAAb,+BAAa;SACd,CAAA;IACH,CAAC;CAEF;AAPD,wCAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-from-header.d.ts","sourceRoot":"","sources":["../../../src/gateway/get-from-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,OAAO,SAChD,GAAG,KAAG,CAAC,CAIrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFromHeader = void 0;
|
|
4
|
+
const headers_1 = require("./headers");
|
|
5
|
+
function getFromHeader(resource) {
|
|
6
|
+
return (req) => {
|
|
7
|
+
return req.headers[headers_1.HEADERS[resource]];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.getFromHeader = getFromHeader;
|
|
11
|
+
//# sourceMappingURL=get-from-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-from-header.js","sourceRoot":"","sources":["../../../src/gateway/get-from-header.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAEpC,SAAgB,aAAa,CAAI,QAA8B;IAC7D,OAAO,CAAC,GAAQ,EAAK,EAAE;QACrB,OAAO,GAAG,CAAC,OAAO,CAAC,iBAAO,CAAC,QAAQ,CAAC,CAAM,CAAC;IAC7C,CAAC,CAAA;AAEH,CAAC;AALD,sCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../src/gateway/headers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;CAInB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../../src/gateway/headers.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACrB,QAAQ,EAAE,kBAAkB;IAC5B,cAAc,EAAE,QAAQ;CAEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.PAE = void 0;
|
|
18
|
+
var pae_1 = require("./pae");
|
|
19
|
+
Object.defineProperty(exports, "PAE", { enumerable: true, get: function () { return pae_1.PAE; } });
|
|
20
|
+
__exportStar(require("./catalog"), exports);
|
|
21
|
+
__exportStar(require("./utilities"), exports);
|
|
22
|
+
__exportStar(require("./authorization"), exports);
|
|
23
|
+
__exportStar(require("./authentication"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,4CAA0B;AAC1B,8CAA4B;AAC5B,kDAAgC;AAChC,mDAAiC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
catalogService: CatalogServiceConfig;
|
|
3
|
+
userService: UserServiceConfig;
|
|
4
|
+
authzService: AuthzServiceConfig;
|
|
5
|
+
}
|
|
6
|
+
export interface ServiceConfig {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CatalogServiceConfig extends ServiceConfig {
|
|
10
|
+
}
|
|
11
|
+
export interface UserServiceConfig extends ServiceConfig {
|
|
12
|
+
}
|
|
13
|
+
export interface AuthzServiceConfig extends ServiceConfig {
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=config.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.interface.d.ts","sourceRoot":"","sources":["../../../src/pae/config.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,oBAAoB,CAAC;IACrC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,YAAY,EAAE,kBAAkB,CAAC;CAClC;AAGD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,aAAa;CAAI;AAC/D,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CAAI;AAC5D,MAAM,WAAW,kBAAmB,SAAQ,aAAa;CAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../../src/pae/config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pae/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./pae"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pae/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Config } from './config.interface';
|
|
2
|
+
import { CatalogService } from '../catalog';
|
|
3
|
+
import { UserService } from '../user/user.service';
|
|
4
|
+
import { AuthorizationService } from '../authorization';
|
|
5
|
+
import { GatewayService } from '../gateway/gateway.service';
|
|
6
|
+
export declare class PAE {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(config?: Partial<Config>);
|
|
9
|
+
get catalogService(): CatalogService;
|
|
10
|
+
get userService(): UserService;
|
|
11
|
+
get authzService(): AuthorizationService;
|
|
12
|
+
get gatewayService(): GatewayService;
|
|
13
|
+
registerUsername(username: string): void;
|
|
14
|
+
registerSessionCookie(sessionCookie: string): void;
|
|
15
|
+
configure(config: Partial<Config>): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pae.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pae.d.ts","sourceRoot":"","sources":["../../../src/pae/pae.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAA4C,cAAc,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAA+B,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAgB5D,qBAAa,GAAG;;gBAIF,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAapC,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,YAAY,IAAI,oBAAoB,CAEvC;IAED,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAMjC,qBAAqB,CAAC,aAAa,EAAE,MAAM;IAM3C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CAwBlC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
+
};
|
|
36
|
+
var _PAE_container, _PAE_config;
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.PAE = void 0;
|
|
39
|
+
const awilix = __importStar(require("awilix"));
|
|
40
|
+
const catalog_1 = require("../catalog");
|
|
41
|
+
const user_service_1 = require("../user/user.service");
|
|
42
|
+
const authorization_1 = require("../authorization");
|
|
43
|
+
const repositories_1 = require("../user/repositories");
|
|
44
|
+
const BASE_CONFIG = {
|
|
45
|
+
catalogService: {
|
|
46
|
+
baseUrl: '',
|
|
47
|
+
},
|
|
48
|
+
userService: {
|
|
49
|
+
baseUrl: '',
|
|
50
|
+
},
|
|
51
|
+
authzService: {
|
|
52
|
+
baseUrl: '',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
class PAE {
|
|
56
|
+
constructor(config) {
|
|
57
|
+
_PAE_container.set(this, void 0);
|
|
58
|
+
_PAE_config.set(this, void 0);
|
|
59
|
+
__classPrivateFieldSet(this, _PAE_config, BASE_CONFIG, "f");
|
|
60
|
+
__classPrivateFieldSet(this, _PAE_container, awilix.createContainer({
|
|
61
|
+
injectionMode: awilix.InjectionMode.CLASSIC
|
|
62
|
+
}), "f");
|
|
63
|
+
if (config) {
|
|
64
|
+
this.configure(config);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
get catalogService() {
|
|
68
|
+
return __classPrivateFieldGet(this, _PAE_container, "f").resolve('catalogService');
|
|
69
|
+
}
|
|
70
|
+
get userService() {
|
|
71
|
+
return __classPrivateFieldGet(this, _PAE_container, "f").resolve('userService');
|
|
72
|
+
}
|
|
73
|
+
get authzService() {
|
|
74
|
+
return __classPrivateFieldGet(this, _PAE_container, "f").resolve('authzService');
|
|
75
|
+
}
|
|
76
|
+
get gatewayService() {
|
|
77
|
+
return __classPrivateFieldGet(this, _PAE_container, "f").resolve('gatewayService');
|
|
78
|
+
}
|
|
79
|
+
registerUsername(username) {
|
|
80
|
+
__classPrivateFieldGet(this, _PAE_container, "f").register({
|
|
81
|
+
username: awilix.asValue(username)
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
registerSessionCookie(sessionCookie) {
|
|
85
|
+
__classPrivateFieldGet(this, _PAE_container, "f").register({
|
|
86
|
+
sessionCookie: awilix.asValue(sessionCookie)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
configure(config) {
|
|
90
|
+
__classPrivateFieldSet(this, _PAE_config, Object.assign(Object.assign({}, __classPrivateFieldGet(this, _PAE_config, "f")), config), "f");
|
|
91
|
+
__classPrivateFieldGet(this, _PAE_container, "f").register({
|
|
92
|
+
userServiceUrl: awilix.asValue(__classPrivateFieldGet(this, _PAE_config, "f").userService.baseUrl),
|
|
93
|
+
userRepository: awilix.asClass(repositories_1.UserHttpRepository),
|
|
94
|
+
userService: awilix.asClass(user_service_1.UserService),
|
|
95
|
+
sessionCookie: awilix.asValue(''),
|
|
96
|
+
authzServiceUrl: awilix.asValue(__classPrivateFieldGet(this, _PAE_config, "f").authzService.baseUrl),
|
|
97
|
+
authzRepository: awilix.asClass(authorization_1.AuthorizationHttpRepository),
|
|
98
|
+
authzService: awilix.asClass(authorization_1.AuthorizationService),
|
|
99
|
+
catalogServiceUrl: awilix.asValue(__classPrivateFieldGet(this, _PAE_config, "f").catalogService.baseUrl),
|
|
100
|
+
catalogRepository: awilix.asClass(catalog_1.CatalogHttpRepository),
|
|
101
|
+
catalogService: awilix.asClass(catalog_1.CatalogService),
|
|
102
|
+
});
|
|
103
|
+
Object.keys(__classPrivateFieldGet(this, _PAE_container, "f").registrations).forEach((key) => {
|
|
104
|
+
console.log(key, __classPrivateFieldGet(this, _PAE_container, "f").registrations[key].resolve(__classPrivateFieldGet(this, _PAE_container, "f")));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.PAE = PAE;
|
|
109
|
+
_PAE_container = new WeakMap(), _PAE_config = new WeakMap();
|
|
110
|
+
//# sourceMappingURL=pae.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pae.js","sourceRoot":"","sources":["../../../src/pae/pae.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.interface.d.ts","sourceRoot":"","sources":["../../../src/user/group.interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.interface.js","sourceRoot":"","sources":["../../../src/user/group.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Group } from "../group.interface";
|
|
2
|
+
import { UserRepository } from "../user-repository.interface";
|
|
3
|
+
export declare class UserHttpRepository implements UserRepository {
|
|
4
|
+
private readonly userServiceUrl;
|
|
5
|
+
constructor(userServiceUrl: string);
|
|
6
|
+
findGroupsByUsername(username: string): Promise<Group[]>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=http.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.repository.d.ts","sourceRoot":"","sources":["../../../../src/user/repositories/http.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qBAAa,kBAAmB,YAAW,cAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,MAAM;IAE7C,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAoB/D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserHttpRepository = void 0;
|
|
13
|
+
class UserHttpRepository {
|
|
14
|
+
constructor(userServiceUrl) {
|
|
15
|
+
this.userServiceUrl = userServiceUrl;
|
|
16
|
+
}
|
|
17
|
+
findGroupsByUsername(username) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a;
|
|
20
|
+
try {
|
|
21
|
+
const url = new URL(`${this.userServiceUrl}/profile/${username}`);
|
|
22
|
+
url.searchParams.append('loadGroups', 'true');
|
|
23
|
+
const response = yield fetch(url, {
|
|
24
|
+
headers: {
|
|
25
|
+
'x-forwarded-user': username
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const data = yield response.json();
|
|
29
|
+
return (_a = data.groups) !== null && _a !== void 0 ? _a : [];
|
|
30
|
+
}
|
|
31
|
+
catch (_b) {
|
|
32
|
+
console.error('Error fetching groups');
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.UserHttpRepository = UserHttpRepository;
|
|
39
|
+
//# sourceMappingURL=http.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.repository.js","sourceRoot":"","sources":["../../../../src/user/repositories/http.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,kBAAkB;IAC7B,YAA6B,cAAsB;QAAtB,mBAAc,GAAd,cAAc,CAAQ;IAAI,CAAC;IAElD,oBAAoB,CAAC,QAAgB;;;YACzC,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,YAAY,QAAQ,EAAE,CAAC,CAAC;gBAClE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;gBAE9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;oBAChC,OAAO,EAAE;wBACP,kBAAkB,EAAE,QAAQ;qBAC7B;iBACF,CAAC,CAAC;gBAEH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAEnC,OAAO,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE,CAAC;YAE3B,CAAC;YAAC,WAAM,CAAC;gBACP,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBACvC,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;KAAA;CACF;AAvBD,gDAuBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/user/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./http.repository"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/user/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-repository.interface.d.ts","sourceRoot":"","sources":["../../../src/user/user-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-repository.interface.js","sourceRoot":"","sources":["../../../src/user/user-repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UserRepository } from "./user-repository.interface";
|
|
2
|
+
export declare class UserService {
|
|
3
|
+
readonly userRepository: UserRepository;
|
|
4
|
+
constructor(userRepository: UserRepository);
|
|
5
|
+
findGroups(username: string): Promise<string[]>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=user.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.service.d.ts","sourceRoot":"","sources":["../../../src/user/user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,qBAAa,WAAW;aAEJ,cAAc,EAAE,cAAc;gBAA9B,cAAc,EAAE,cAAc;IAG1C,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAMtD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UserService = void 0;
|
|
13
|
+
class UserService {
|
|
14
|
+
constructor(userRepository) {
|
|
15
|
+
this.userRepository = userRepository;
|
|
16
|
+
}
|
|
17
|
+
findGroups(username) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const groups = yield this.userRepository.findGroupsByUsername(username);
|
|
20
|
+
return groups;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.UserService = UserService;
|
|
25
|
+
//# sourceMappingURL=user.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../src/user/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,WAAW;IACtB,YACkB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAC5C,CAAC;IAEC,UAAU,CAAC,QAAgB;;YAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAExE,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;CAEF;AAXD,kCAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/utilities.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,OAAO,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CASpE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fromEnv = exports.createBundleFile = void 0;
|
|
4
|
+
function createBundleFile(moduleFullName) {
|
|
5
|
+
return `${moduleFullName.replace('@', '').replace('/', '-')}.js`;
|
|
6
|
+
}
|
|
7
|
+
exports.createBundleFile = createBundleFile;
|
|
8
|
+
function fromEnv(key, defaultValue) {
|
|
9
|
+
const value = process.env[key];
|
|
10
|
+
if (!value) {
|
|
11
|
+
if (defaultValue) {
|
|
12
|
+
return defaultValue;
|
|
13
|
+
}
|
|
14
|
+
throw new Error(`Environment variable ${key} is required`);
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
exports.fromEnv = fromEnv;
|
|
19
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../src/utilities.ts"],"names":[],"mappings":";;;AAAA,SAAgB,gBAAgB,CAAC,cAAsB;IACrD,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC;AACnE,CAAC;AAFD,4CAEC;AAED,SAAgB,OAAO,CAAa,GAAW,EAAE,YAAgB;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAG,CAAC,KAAK,EAAE,CAAC;QACV,IAAG,YAAY,EAAE,CAAC;YAChB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,cAAc,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAqB,CAAC;AAC/B,CAAC;AATD,0BASC"}
|