@us-legal-tools/ecfr-sdk
Version:
TypeScript SDK and MCP server for the eCFR (Electronic Code of Federal Regulations) API
189 lines (184 loc) • 6.3 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, {
getApiVersionerV1VersionsTitleTitleJson: () => getApiVersionerV1VersionsTitleTitleJson,
getApiVersionerV1TitlesJson: () => getApiVersionerV1TitlesJson,
getApiVersionerV1StructureDateTitleTitleJson: () => getApiVersionerV1StructureDateTitleTitleJson,
getApiVersionerV1FullDateTitleTitleXml: () => getApiVersionerV1FullDateTitleTitleXml,
getApiVersionerV1AncestryDateTitleTitleJson: () => getApiVersionerV1AncestryDateTitleTitleJson,
getApiSearchV1Summary: () => getApiSearchV1Summary,
getApiSearchV1Suggestions: () => getApiSearchV1Suggestions,
getApiSearchV1Results: () => getApiSearchV1Results,
getApiSearchV1CountsTitles: () => getApiSearchV1CountsTitles,
getApiSearchV1CountsHierarchy: () => getApiSearchV1CountsHierarchy,
getApiSearchV1CountsDaily: () => getApiSearchV1CountsDaily,
getApiSearchV1Count: () => getApiSearchV1Count,
getApiAdminV1CorrectionsTitleTitleJson: () => getApiAdminV1CorrectionsTitleTitleJson,
getApiAdminV1CorrectionsJson: () => getApiAdminV1CorrectionsJson,
getApiAdminV1AgenciesJson: () => getApiAdminV1AgenciesJson,
customInstance: () => customInstance,
VERSION: () => VERSION
});
module.exports = __toCommonJS(exports_src);
// package.json
var version = "0.8.2";
// src/api/client.ts
var import_axios = __toESM(require("axios"));
var customInstance = (config, options) => {
const source = import_axios.default.CancelToken.source();
const promise = import_axios.default({
...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 getApiAdminV1AgenciesJson = (options) => {
return customInstance({
url: `https://www.ecfr.gov/api/admin/v1/agencies.json`,
method: "GET"
}, options);
};
var getApiAdminV1CorrectionsJson = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/admin/v1/corrections.json`,
method: "GET",
params
}, options);
};
var getApiAdminV1CorrectionsTitleTitleJson = (title, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/admin/v1/corrections/title/${title}.json`,
method: "GET"
}, options);
};
var getApiSearchV1Results = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/results`,
method: "GET",
params
}, options);
};
var getApiSearchV1Count = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/count`,
method: "GET",
params
}, options);
};
var getApiSearchV1Summary = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/summary`,
method: "GET",
params
}, options);
};
var getApiSearchV1CountsDaily = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/counts/daily`,
method: "GET",
params
}, options);
};
var getApiSearchV1CountsTitles = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/counts/titles`,
method: "GET",
params
}, options);
};
var getApiSearchV1CountsHierarchy = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/counts/hierarchy`,
method: "GET",
params
}, options);
};
var getApiSearchV1Suggestions = (params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/search/v1/suggestions`,
method: "GET",
params
}, options);
};
var getApiVersionerV1AncestryDateTitleTitleJson = (date, title, params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/versioner/v1/ancestry/${date}/title-${title}.json`,
method: "GET",
params
}, options);
};
var getApiVersionerV1FullDateTitleTitleXml = (date, title, params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/versioner/v1/full/${date}/title-${title}.xml`,
method: "GET",
params
}, options);
};
var getApiVersionerV1StructureDateTitleTitleJson = (date, title, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/versioner/v1/structure/${date}/title-${title}.json`,
method: "GET"
}, options);
};
var getApiVersionerV1TitlesJson = (options) => {
return customInstance({
url: `https://www.ecfr.gov/api/versioner/v1/titles.json`,
method: "GET"
}, options);
};
var getApiVersionerV1VersionsTitleTitleJson = (title, params, options) => {
return customInstance({
url: `https://www.ecfr.gov/api/versioner/v1/versions/title-${title}.json`,
method: "GET",
params
}, options);
};
// src/index.ts
var VERSION = version;
//# debugId=87A394750FA6F5EF64756E2164756E21
//# sourceMappingURL=index.js.map