@us-legal-tools/courtlistener-sdk
Version:
TypeScript SDK and MCP server for CourtListener API
489 lines (484 loc) • 14.7 kB
JavaScript
var __create = Object.create;
var __getProtoOf = Object.getPrototypeOf;
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __toESM = (mod, isNodeMode, target) => {
target = mod != null ? __create(__getProtoOf(mod)) : {};
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
for (let key of __getOwnPropNames(mod))
if (!__hasOwnProp.call(to, key))
__defProp(to, key, {
get: () => mod[key],
enumerable: true
});
return to;
};
var __moduleCache = /* @__PURE__ */ new WeakMap;
var __toCommonJS = (from) => {
var entry = __moduleCache.get(from), desc;
if (entry)
return entry;
entry = __defProp({}, "__esModule", { value: true });
if (from && typeof from === "object" || typeof from === "function")
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
}));
__moduleCache.set(from, entry);
return entry;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: (newValue) => all[name] = () => newValue
});
};
// src/index.ts
var exports_src = {};
__export(exports_src, {
postRecapFetch: () => postRecapFetch,
postDocketAlerts: () => postDocketAlerts,
postCitationLookup: () => postCitationLookup,
postAlerts: () => postAlerts,
getVisualizationsId: () => getVisualizationsId,
getVisualizations: () => getVisualizations,
getSpouseIncomeId: () => getSpouseIncomeId,
getSpouseIncome: () => getSpouseIncome,
getSearch: () => getSearch,
getSchoolsId: () => getSchoolsId,
getSchools: () => getSchools,
getReimbursementsId: () => getReimbursementsId,
getReimbursements: () => getReimbursements,
getRecapId: () => getRecapId,
getRecap: () => getRecap,
getProcessingQueue: () => getProcessingQueue,
getPositionsId: () => getPositionsId,
getPositions: () => getPositions,
getPoliticalAffiliationsId: () => getPoliticalAffiliationsId,
getPoliticalAffiliations: () => getPoliticalAffiliations,
getPeopleId: () => getPeopleId,
getPeople: () => getPeople,
getPacerDocIds: () => getPacerDocIds,
getOriginalProceedingsPanels: () => getOriginalProceedingsPanels,
getOpinionsId: () => getOpinionsId,
getOpinions: () => getOpinions,
getNonInvestmentIncomeId: () => getNonInvestmentIncomeId,
getNonInvestmentIncome: () => getNonInvestmentIncome,
getJudgePositionsId: () => getJudgePositionsId,
getJudgePositions: () => getJudgePositions,
getInvestmentsId: () => getInvestmentsId,
getInvestments: () => getInvestments,
getGiftsId: () => getGiftsId,
getGifts: () => getGifts,
getFinancialDisclosuresId: () => getFinancialDisclosuresId,
getFinancialDisclosures: () => getFinancialDisclosures,
getDocketsId: () => getDocketsId,
getDockets: () => getDockets,
getDocketAlerts: () => getDocketAlerts,
getDebtsId: () => getDebtsId,
getDebts: () => getDebts,
getCourtsId: () => getCourtsId,
getCourts: () => getCourts,
getClustersId: () => getClustersId,
getClusters: () => getClusters,
getCitationsId: () => getCitationsId,
getCitations: () => getCitations,
getAudioId: () => getAudioId,
getAudio: () => getAudio,
getAlerts: () => getAlerts,
getAgreementsId: () => getAgreementsId,
getAgreements: () => getAgreements,
get: () => get,
default: () => src_default,
customInstance: () => customInstance
});
module.exports = __toCommonJS(exports_src);
// src/api/client.ts
var import_axios = __toESM(require("axios"));
var customInstance = (config, options) => {
const authToken = process.env.COURTLISTENER_API_TOKEN;
const source = import_axios.default.CancelToken.source();
const promise = import_axios.default({
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"
};
//# debugId=A528C52FE0ACD42B64756E2164756E21
//# sourceMappingURL=index.js.map