UNPKG

@rcsb/rcsb-saguaro-app

Version:
62 lines (61 loc) 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RcsbQueryGroupAnnotations = exports.RcsbQueryGroupAnnotationsSumary = exports.RcsbQueryAnnotations = void 0; const tslib_1 = require("tslib"); const QueryAnnotations_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryAnnotations.graphql")); const QueryGroupAnnotationsSummary_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryGroupAnnotationsSummary.graphql")); const QueryGroupAnnotations_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryGroupAnnotations.graphql")); class RcsbQueryAnnotations { constructor(getClient) { this.getClient = getClient; } request(requestConfig) { return tslib_1.__awaiter(this, void 0, void 0, function* () { try { const annotationsResponse = yield this.getClient().request(requestConfig, QueryAnnotations_graphql_1.default); return annotationsResponse.annotations; } catch (error) { console.error(error); throw error; } }); } } exports.RcsbQueryAnnotations = RcsbQueryAnnotations; class RcsbQueryGroupAnnotationsSumary { constructor(getClient) { this.getClient = getClient; } request(requestConfig) { return tslib_1.__awaiter(this, void 0, void 0, function* () { try { const annotationsResponse = yield this.getClient().request(requestConfig, QueryGroupAnnotationsSummary_graphql_1.default); return annotationsResponse.group_annotations_summary; } catch (error) { console.error(error); throw error; } }); } } exports.RcsbQueryGroupAnnotationsSumary = RcsbQueryGroupAnnotationsSumary; class RcsbQueryGroupAnnotations { constructor(getClient) { this.getClient = getClient; } request(requestConfig) { return tslib_1.__awaiter(this, void 0, void 0, function* () { try { const annotationsResponse = yield this.getClient().request(requestConfig, QueryGroupAnnotations_graphql_1.default); return annotationsResponse.group_annotations; } catch (error) { console.error(error); throw error; } }); } } exports.RcsbQueryGroupAnnotations = RcsbQueryGroupAnnotations;