synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
70 lines (69 loc) • 1.96 kB
JavaScript
import { TABLE_QUERY_ASYNC_GET as u, TABLE_QUERY_ASYNC_START as c } from "../../../utils/APIConstants.js";
import { getEndpoint as n, BackendDestinationEnum as r } from "../../../utils/functions/getEndpoint.js";
import { uniqueId as m } from "lodash-es";
import { http as l, HttpResponse as i } from "msw";
import p from "../../query/defaultFileViewColumnModels.js";
import { generateAsyncJobHandlers as s } from "./asyncJobHandlers.js";
import { getTableQueryResult as d } from "./tableQueryService.js";
function _(t = n(r.REPO_ENDPOINT), o = ":id") {
return s(
c(o),
(e) => u(o, e),
// Get the table query result from the service
(e) => d(e),
t
);
}
function O(t, o = n(r.REPO_ENDPOINT)) {
return s(
"/repo/v1/column/view/scope/async/start",
(e) => `/repo/v1/column/view/scope/async/get/${e}`,
t,
o
);
}
function P(t = n(r.REPO_ENDPOINT)) {
return [
l.get(`${t}/repo/v1/column/tableview/defaults`, () => i.json(
{
concreteType: "org.sagebionetworks.repo.model.table.ColumnModel",
list: p
},
{ status: 200 }
))
];
}
function R(t = n(r.REPO_ENDPOINT)) {
return l.post(
`${t}/repo/v1/column/batch`,
async ({ request: o }) => {
const { list: e } = await o.json();
return e.forEach((a) => {
a.id || (a.id = m());
}), i.json(
{
concreteType: "org.sagebionetworks.repo.model.table.ColumnModel",
list: e
},
{ status: 201 }
);
}
);
}
function v(t, o = n(r.REPO_ENDPOINT), e) {
return s(
"/repo/v1/entity/:entityId/table/transaction/async/start",
(a) => `/repo/v1/entity/:entityId/table/transaction/async/get/${a}`,
t,
o,
e
);
}
export {
O as getAnnotationColumnHandlers,
R as getCreateColumnModelBatchHandler,
P as getDefaultColumnHandlers,
_ as getHandlersForTableQuery,
v as getTableTransactionHandlers
};
//# sourceMappingURL=tableQueryHandlers.js.map