UNPKG

@rcsb/rcsb-saguaro-app

Version:
32 lines 1.19 kB
import { __awaiter } from "tslib"; import { rcsbClient } from "../../RcsbGraphQL/RcsbClient"; import { Assertions } from "../../RcsbUtils/Helpers/Assertions"; var assertDefined = Assertions.assertDefined; export class AssemblyInterfacesCollector { constructor() { this.rcsbFvQuery = rcsbClient; } collect(requestConfig) { return __awaiter(this, void 0, void 0, function* () { try { const result = yield this.rcsbFvQuery.requestAssemblyInterfaces(requestConfig); return result.map(r => parseAssemblyInterfaces(r)); } catch (error) { console.log(error); throw error; } }); } } function parseAssemblyInterfaces(assemblyInterfaces) { var _a, _b; return { rcsbId: assemblyInterfaces.rcsb_id, interfaceIds: (_b = (_a = assemblyInterfaces.interfaces) === null || _a === void 0 ? void 0 : _a.map(i => { assertDefined(i === null || i === void 0 ? void 0 : i.rcsb_id); return i.rcsb_id; })) !== null && _b !== void 0 ? _b : [] }; } //# sourceMappingURL=AssemblyInterfacesCollector.js.map