@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
49 lines (48 loc) • 2.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RcsbQueryGroupAlignment = exports.RcsbQueryAlignment = void 0;
const tslib_1 = require("tslib");
const QueryAlignments_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryAlignments.graphql"));
const QueryGroupAlignments_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryGroupAlignments.graphql"));
const QueryGroupAlignmentsNoLogo_graphql_1 = tslib_1.__importDefault(require("../RcsbQueries/Borrego/QueryGroupAlignmentsNoLogo.graphql"));
class RcsbQueryAlignment {
constructor(getClient) {
this.getClient = getClient;
}
request(requestConfig) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
try {
const result = yield this.getClient().request({
queryId: requestConfig.queryId,
from: requestConfig.from,
to: requestConfig.to,
range: requestConfig.range
}, QueryAlignments_graphql_1.default);
return result.alignments;
}
catch (error) {
console.error(error);
throw error;
}
});
}
}
exports.RcsbQueryAlignment = RcsbQueryAlignment;
class RcsbQueryGroupAlignment {
constructor(getClient) {
this.getClient = getClient;
}
request(requestConfig) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
try {
const result = yield this.getClient().request({ group: requestConfig.group, groupId: requestConfig.groupId, filter: requestConfig.filter, first: requestConfig.page.first, after: requestConfig.page.after }, requestConfig.excludeLogo ? QueryGroupAlignmentsNoLogo_graphql_1.default : QueryGroupAlignments_graphql_1.default);
return result.group_alignments;
}
catch (error) {
console.error(error);
throw error;
}
});
}
}
exports.RcsbQueryGroupAlignment = RcsbQueryGroupAlignment;