UNPKG

@us-legal-tools/courtlistener-sdk

Version:

TypeScript SDK and MCP server for CourtListener API

444 lines (441 loc) 11.9 kB
// src/api/client.ts import axios from "axios"; var customInstance = (config, options) => { const authToken = process.env.COURTLISTENER_API_TOKEN; const source = axios.CancelToken.source(); const promise = axios({ baseURL: "https://www.courtlistener.com/api/rest/v4", timeout: 30000, headers: { "Content-Type": "application/json", "User-Agent": "@us-legal-tools/courtlistener-sdk/1.5.1", ...authToken && { Authorization: `Token ${authToken}` } }, ...config, ...options, cancelToken: source.token }).then(({ data }) => data); promise.cancel = () => { source.cancel("Query was cancelled by React Query"); }; return promise; }; // src/api/generated/endpoints.ts var get = (options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/`, method: "GET" }, options); }; var getSearch = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/search/`, method: "GET", params }, options); }; var postCitationLookup = (postCitationLookupBody, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/citation-lookup/`, method: "POST", headers: { "Content-Type": "application/json" }, data: postCitationLookupBody }, options); }; var getDockets = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/dockets/`, method: "GET", params }, options); }; var getDocketsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/dockets/${id}/`, method: "GET" }, options); }; var getClusters = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/clusters/`, method: "GET", params }, options); }; var getClustersId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/clusters/${id}/`, method: "GET" }, options); }; var getOpinions = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/opinions/`, method: "GET", params }, options); }; var getOpinionsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/opinions/${id}/`, method: "GET" }, options); }; var getCourts = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/courts/`, method: "GET", params }, options); }; var getCourtsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/courts/${id}/`, method: "GET" }, options); }; var getPeople = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/people/`, method: "GET", params }, options); }; var getPeopleId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/people/${id}/`, method: "GET" }, options); }; var getAudio = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/audio/`, method: "GET", params }, options); }; var getAudioId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/audio/${id}/`, method: "GET" }, options); }; var getFinancialDisclosures = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/financial-disclosures/`, method: "GET", params }, options); }; var getFinancialDisclosuresId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/financial-disclosures/${id}/`, method: "GET" }, options); }; var getInvestments = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/investments/`, method: "GET", params }, options); }; var getInvestmentsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/investments/${id}/`, method: "GET" }, options); }; var getPositions = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/positions/`, method: "GET", params }, options); }; var getPositionsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/positions/${id}/`, method: "GET" }, options); }; var getAgreements = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/agreements/`, method: "GET", params }, options); }; var getAgreementsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/agreements/${id}/`, method: "GET" }, options); }; var getNonInvestmentIncome = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/non-investment-income/`, method: "GET", params }, options); }; var getNonInvestmentIncomeId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/non-investment-income/${id}/`, method: "GET" }, options); }; var getSpouseIncome = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/spouse-income/`, method: "GET", params }, options); }; var getSpouseIncomeId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/spouse-income/${id}/`, method: "GET" }, options); }; var getReimbursements = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/reimbursements/`, method: "GET", params }, options); }; var getReimbursementsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/reimbursements/${id}/`, method: "GET" }, options); }; var getGifts = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/gifts/`, method: "GET", params }, options); }; var getGiftsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/gifts/${id}/`, method: "GET" }, options); }; var getDebts = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/debts/`, method: "GET", params }, options); }; var getDebtsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/debts/${id}/`, method: "GET" }, options); }; var getAlerts = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/alerts/`, method: "GET", params }, options); }; var postAlerts = (postAlertsBody, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/alerts/`, method: "POST", headers: { "Content-Type": "application/json" }, data: postAlertsBody }, options); }; var getProcessingQueue = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/processing-queue/`, method: "GET", params }, options); }; var getRecap = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/recap/`, method: "GET", params }, options); }; var getRecapId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/recap/${id}/`, method: "GET" }, options); }; var getPacerDocIds = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/pacer-doc-ids/`, method: "GET", params }, options); }; var postRecapFetch = (postRecapFetchBody, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/recap-fetch/`, method: "POST", headers: { "Content-Type": "application/json" }, data: postRecapFetchBody }, options); }; var getDocketAlerts = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/docket-alerts/`, method: "GET", params }, options); }; var postDocketAlerts = (postDocketAlertsBody, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/docket-alerts/`, method: "POST", headers: { "Content-Type": "application/json" }, data: postDocketAlertsBody }, options); }; var getOriginalProceedingsPanels = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/original-proceedings-panels/`, method: "GET", params }, options); }; var getJudgePositions = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/judge-positions/`, method: "GET", params }, options); }; var getJudgePositionsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/judge-positions/${id}/`, method: "GET" }, options); }; var getSchools = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/schools/`, method: "GET", params }, options); }; var getSchoolsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/schools/${id}/`, method: "GET" }, options); }; var getPoliticalAffiliations = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/political-affiliations/`, method: "GET", params }, options); }; var getPoliticalAffiliationsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/political-affiliations/${id}/`, method: "GET" }, options); }; var getCitations = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/citations/`, method: "GET", params }, options); }; var getCitationsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/citations/${id}/`, method: "GET" }, options); }; var getVisualizations = (params, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/visualizations/`, method: "GET", params }, options); }; var getVisualizationsId = (id, options) => { return customInstance({ url: `https://www.courtlistener.com/api/rest/v4/visualizations/${id}/`, method: "GET" }, options); }; // src/index.ts var src_default = { name: "CourtListener SDK", version: "1.0.0", description: "TypeScript SDK and MCP server for the CourtListener API" }; export { postRecapFetch, postDocketAlerts, postCitationLookup, postAlerts, getVisualizationsId, getVisualizations, getSpouseIncomeId, getSpouseIncome, getSearch, getSchoolsId, getSchools, getReimbursementsId, getReimbursements, getRecapId, getRecap, getProcessingQueue, getPositionsId, getPositions, getPoliticalAffiliationsId, getPoliticalAffiliations, getPeopleId, getPeople, getPacerDocIds, getOriginalProceedingsPanels, getOpinionsId, getOpinions, getNonInvestmentIncomeId, getNonInvestmentIncome, getJudgePositionsId, getJudgePositions, getInvestmentsId, getInvestments, getGiftsId, getGifts, getFinancialDisclosuresId, getFinancialDisclosures, getDocketsId, getDockets, getDocketAlerts, getDebtsId, getDebts, getCourtsId, getCourts, getClustersId, getClusters, getCitationsId, getCitations, getAudioId, getAudio, getAlerts, getAgreementsId, getAgreements, get, src_default as default, customInstance }; //# debugId=6D959A472C0CFBBC64756E2164756E21 //# sourceMappingURL=index.mjs.map