@cliwant/mcp-sam-gov 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.ja.md +240 -231
- package/README.ko.md +240 -231
- package/README.md +725 -706
- package/dist/cbp-border.d.ts +51 -0
- package/dist/cbp-border.d.ts.map +1 -0
- package/dist/cbp-border.js +123 -0
- package/dist/cbp-border.js.map +1 -0
- package/dist/datagov-catalog.d.ts.map +1 -1
- package/dist/datagov-catalog.js +16 -2
- package/dist/datagov-catalog.js.map +1 -1
- package/dist/ecfr.d.ts +2 -2
- package/dist/ecfr.d.ts.map +1 -1
- package/dist/ecfr.js +24 -10
- package/dist/ecfr.js.map +1 -1
- package/dist/edgar.d.ts.map +1 -1
- package/dist/edgar.js +26 -6
- package/dist/edgar.js.map +1 -1
- package/dist/epa-envirofacts.d.ts.map +1 -1
- package/dist/epa-envirofacts.js +14 -1
- package/dist/epa-envirofacts.js.map +1 -1
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -1
- package/dist/far.d.ts.map +1 -1
- package/dist/far.js +3 -1
- package/dist/far.js.map +1 -1
- package/dist/federal-register.d.ts +2 -2
- package/dist/federal-register.d.ts.map +1 -1
- package/dist/federal-register.js +26 -10
- package/dist/federal-register.js.map +1 -1
- package/dist/feedback.d.ts +64 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +131 -0
- package/dist/feedback.js.map +1 -0
- package/dist/fema.d.ts +36 -0
- package/dist/fema.d.ts.map +1 -1
- package/dist/fema.js +124 -0
- package/dist/fema.js.map +1 -1
- package/dist/gov-domains.d.ts +66 -0
- package/dist/gov-domains.d.ts.map +1 -0
- package/dist/gov-domains.js +211 -0
- package/dist/gov-domains.js.map +1 -0
- package/dist/nist-controls.d.ts +48 -0
- package/dist/nist-controls.d.ts.map +1 -0
- package/dist/nist-controls.js +174 -0
- package/dist/nist-controls.js.map +1 -0
- package/dist/nws-weather.d.ts +57 -0
- package/dist/nws-weather.d.ts.map +1 -0
- package/dist/nws-weather.js +131 -0
- package/dist/nws-weather.js.map +1 -0
- package/dist/openfda-drugsfda.d.ts +72 -0
- package/dist/openfda-drugsfda.d.ts.map +1 -0
- package/dist/openfda-drugsfda.js +230 -0
- package/dist/openfda-drugsfda.js.map +1 -0
- package/dist/openfda.d.ts.map +1 -1
- package/dist/openfda.js +31 -8
- package/dist/openfda.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +374 -11
- package/dist/server.js.map +1 -1
- package/dist/treasury.d.ts +2 -0
- package/dist/treasury.d.ts.map +1 -1
- package/dist/treasury.js +7 -0
- package/dist/treasury.js.map +1 -1
- package/dist/usaspending.d.ts +32 -1
- package/dist/usaspending.d.ts.map +1 -1
- package/dist/usaspending.js +143 -16
- package/dist/usaspending.js.map +1 -1
- package/package.json +111 -111
- package/src/attachments.ts +652 -652
- package/src/bea.ts +372 -372
- package/src/bls.ts +1943 -1943
- package/src/cache.ts +73 -73
- package/src/cbp-border.ts +177 -0
- package/src/census-economic.ts +431 -431
- package/src/census.ts +735 -735
- package/src/ckan.ts +495 -495
- package/src/clinicaltrials.ts +923 -923
- package/src/cms-facility.ts +379 -379
- package/src/cms-hospital.ts +344 -344
- package/src/cms-supplier.ts +527 -527
- package/src/cms-utilization.ts +389 -389
- package/src/cms.ts +634 -634
- package/src/coerce.ts +47 -47
- package/src/courtlistener.ts +465 -465
- package/src/cpsc.ts +333 -333
- package/src/datagov-catalog.ts +312 -296
- package/src/datagov.ts +907 -907
- package/src/datagovKey.ts +68 -68
- package/src/datasource.ts +721 -721
- package/src/disclosure.ts +61 -61
- package/src/dol.ts +515 -515
- package/src/ecfr.ts +248 -231
- package/src/echo.ts +496 -496
- package/src/edgar.ts +3046 -3014
- package/src/epa-envirofacts.ts +358 -342
- package/src/errors.ts +324 -303
- package/src/fac.ts +529 -529
- package/src/far.ts +1009 -1007
- package/src/fdic.ts +2052 -2052
- package/src/federal-register.ts +725 -706
- package/src/feedback.ts +160 -0
- package/src/fema.ts +680 -541
- package/src/fpds.ts +620 -620
- package/src/fred.ts +464 -464
- package/src/gao.ts +744 -744
- package/src/gov-domains.ts +237 -0
- package/src/govinfo.ts +497 -497
- package/src/grants.ts +290 -290
- package/src/gsa-csv.ts +992 -992
- package/src/gsa-perdiem.ts +361 -361
- package/src/integrity.ts +928 -928
- package/src/keys.ts +268 -268
- package/src/lda.ts +385 -385
- package/src/meta.ts +292 -292
- package/src/nhtsa.ts +352 -352
- package/src/nih.ts +375 -375
- package/src/nist-controls.ts +219 -0
- package/src/nonprofit.ts +460 -460
- package/src/nppes.ts +834 -834
- package/src/nsf.ts +706 -706
- package/src/nvd.ts +1124 -1124
- package/src/nws-weather.ts +167 -0
- package/src/ofac.ts +1166 -1166
- package/src/openfda-device.ts +356 -356
- package/src/openfda-drugsfda.ts +313 -0
- package/src/openfda.ts +518 -495
- package/src/pricing.ts +1075 -1075
- package/src/sam-gov/client.ts +774 -774
- package/src/sam-gov/index.ts +32 -32
- package/src/sam-gov/types.ts +152 -152
- package/src/sba.ts +357 -357
- package/src/server.ts +6688 -6297
- package/src/snapshot.ts +223 -223
- package/src/socrata.ts +532 -532
- package/src/treasury.ts +582 -575
- package/src/usaspending.ts +2852 -2680
- package/src/usitc.ts +420 -420
package/src/sam-gov/index.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vendored copy of @cliwant/mcp-sam-gov/sam-gov.
|
|
3
|
-
*
|
|
4
|
-
* Why vendored: when `@cliwant/mcp-sam-gov` is installed via
|
|
5
|
-
* `npm install -g github:owner/repo`, npm cannot resolve a nested
|
|
6
|
-
* github dep on Windows reliably (it tries to cd into a non-existent
|
|
7
|
-
* directory during the install transaction). Inlining the source
|
|
8
|
-
* eliminates the nested-github-dep issue entirely and keeps install
|
|
9
|
-
* a pure copy.
|
|
10
|
-
*
|
|
11
|
-
* When both packages are published to npm, this file can become a
|
|
12
|
-
* one-line re-export of the upstream package without any consumer
|
|
13
|
-
* changes (the public API surface is identical).
|
|
14
|
-
*
|
|
15
|
-
* Canonical home: https://github.com/cliwant/mcp-sam-gov
|
|
16
|
-
*/
|
|
17
|
-
export {
|
|
18
|
-
SamGovClient,
|
|
19
|
-
daysUntilResponse,
|
|
20
|
-
applyResponseDeadlineWindow,
|
|
21
|
-
} from "./client.js";
|
|
22
|
-
export type {
|
|
23
|
-
SamOpportunity,
|
|
24
|
-
SamSearchFilters,
|
|
25
|
-
SamSearchResult,
|
|
26
|
-
SamProcurementType,
|
|
27
|
-
SamSetAside,
|
|
28
|
-
SamLocation,
|
|
29
|
-
SamPointOfContact,
|
|
30
|
-
EntitySearchResult,
|
|
31
|
-
SamGovClientOptions,
|
|
32
|
-
} from "./types.js";
|
|
1
|
+
/**
|
|
2
|
+
* Vendored copy of @cliwant/mcp-sam-gov/sam-gov.
|
|
3
|
+
*
|
|
4
|
+
* Why vendored: when `@cliwant/mcp-sam-gov` is installed via
|
|
5
|
+
* `npm install -g github:owner/repo`, npm cannot resolve a nested
|
|
6
|
+
* github dep on Windows reliably (it tries to cd into a non-existent
|
|
7
|
+
* directory during the install transaction). Inlining the source
|
|
8
|
+
* eliminates the nested-github-dep issue entirely and keeps install
|
|
9
|
+
* a pure copy.
|
|
10
|
+
*
|
|
11
|
+
* When both packages are published to npm, this file can become a
|
|
12
|
+
* one-line re-export of the upstream package without any consumer
|
|
13
|
+
* changes (the public API surface is identical).
|
|
14
|
+
*
|
|
15
|
+
* Canonical home: https://github.com/cliwant/mcp-sam-gov
|
|
16
|
+
*/
|
|
17
|
+
export {
|
|
18
|
+
SamGovClient,
|
|
19
|
+
daysUntilResponse,
|
|
20
|
+
applyResponseDeadlineWindow,
|
|
21
|
+
} from "./client.js";
|
|
22
|
+
export type {
|
|
23
|
+
SamOpportunity,
|
|
24
|
+
SamSearchFilters,
|
|
25
|
+
SamSearchResult,
|
|
26
|
+
SamProcurementType,
|
|
27
|
+
SamSetAside,
|
|
28
|
+
SamLocation,
|
|
29
|
+
SamPointOfContact,
|
|
30
|
+
EntitySearchResult,
|
|
31
|
+
SamGovClientOptions,
|
|
32
|
+
} from "./types.js";
|
package/src/sam-gov/types.ts
CHANGED
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core types for the @cliwant/mcp-sam-gov/sam-gov client. Mirrors the shapes
|
|
3
|
-
* returned by SAM.gov's two endpoint layers (authenticated v2 and
|
|
4
|
-
* the keyless public HAL endpoints) under one normalized contract.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export type SamProcurementType =
|
|
8
|
-
| "u" // Justification
|
|
9
|
-
| "p" // Pre-solicitation
|
|
10
|
-
| "a" // Award Notice
|
|
11
|
-
| "r" // Sources Sought
|
|
12
|
-
| "s" // Special Notice
|
|
13
|
-
| "o" // Solicitation
|
|
14
|
-
| "g" // Sale of Surplus
|
|
15
|
-
| "k" // Combined Synopsis
|
|
16
|
-
| "i"; // Intent to Bundle
|
|
17
|
-
|
|
18
|
-
export type SamSetAside =
|
|
19
|
-
| "SBA"
|
|
20
|
-
| "SBP"
|
|
21
|
-
| "8A"
|
|
22
|
-
| "8AN"
|
|
23
|
-
| "HZC"
|
|
24
|
-
| "HZS"
|
|
25
|
-
| "SDVOSBC"
|
|
26
|
-
| "SDVOSBS"
|
|
27
|
-
| "WOSB"
|
|
28
|
-
| "WOSBSS"
|
|
29
|
-
| "EDWOSB"
|
|
30
|
-
| "EDWOSBSS"
|
|
31
|
-
| "LAS"
|
|
32
|
-
| "IEE"
|
|
33
|
-
| "ISBEE"
|
|
34
|
-
| "BICiv"
|
|
35
|
-
| "VSA"
|
|
36
|
-
| "VSS";
|
|
37
|
-
|
|
38
|
-
export type SamLocation = {
|
|
39
|
-
streetAddress?: string;
|
|
40
|
-
streetAddress2?: string;
|
|
41
|
-
city?: { code?: string; name?: string };
|
|
42
|
-
state?: { code?: string; name?: string };
|
|
43
|
-
zip?: string;
|
|
44
|
-
country?: { code?: string; name?: string };
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type SamPointOfContact = {
|
|
48
|
-
type?: string;
|
|
49
|
-
title?: string;
|
|
50
|
-
fullName?: string;
|
|
51
|
-
email?: string;
|
|
52
|
-
phone?: string;
|
|
53
|
-
fax?: string | null;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type SamOpportunity = {
|
|
57
|
-
noticeId: string;
|
|
58
|
-
title: string;
|
|
59
|
-
solicitationNumber?: string;
|
|
60
|
-
fullParentPathName?: string;
|
|
61
|
-
fullParentPathCode?: string;
|
|
62
|
-
postedDate?: string;
|
|
63
|
-
type?: string;
|
|
64
|
-
baseType?: string;
|
|
65
|
-
archiveType?: string;
|
|
66
|
-
archiveDate?: string | null;
|
|
67
|
-
typeOfSetAsideDescription?: string | null;
|
|
68
|
-
typeOfSetAside?: string | null;
|
|
69
|
-
responseDeadLine?: string | null;
|
|
70
|
-
naicsCode?: string | null;
|
|
71
|
-
classificationCode?: string | null;
|
|
72
|
-
active?: "Yes" | "No";
|
|
73
|
-
pointOfContact?: SamPointOfContact[] | null;
|
|
74
|
-
description?: string;
|
|
75
|
-
placeOfPerformance?: SamLocation | null;
|
|
76
|
-
uiLink?: string;
|
|
77
|
-
resourceLinks?: string[] | null;
|
|
78
|
-
/**
|
|
79
|
-
* Which enrichment sub-fetches DEGRADED on an outage (subset of
|
|
80
|
-
* ["attachments", "organization"]). Set ONLY when a sub-fetch's HTTP call
|
|
81
|
-
* failed (non-200 / network / timeout) — the corresponding field
|
|
82
|
-
* (`resourceLinks` / `fullParentPathName`) is then empty but UNKNOWN, NOT
|
|
83
|
-
* confirmed-absent. Additive + optional: a healthy notice (incl. a genuine
|
|
84
|
-
* 200-empty attachment list or empty org path) NEVER sets it. Tool wrappers
|
|
85
|
-
* read it to emit an honest `_meta.degraded` + a disclosing note instead of
|
|
86
|
-
* a silent "no attachments"/"no organization" lie.
|
|
87
|
-
*/
|
|
88
|
-
enrichmentDegraded?: string[];
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type SamSearchFilters = {
|
|
92
|
-
query?: string;
|
|
93
|
-
/** MM/DD/YYYY (auth endpoint convention). */
|
|
94
|
-
postedFrom?: string;
|
|
95
|
-
postedTo?: string;
|
|
96
|
-
ptype?: SamProcurementType[];
|
|
97
|
-
ncode?: string;
|
|
98
|
-
setAside?: SamSetAside[];
|
|
99
|
-
organizationName?: string;
|
|
100
|
-
state?: string;
|
|
101
|
-
zip?: string;
|
|
102
|
-
responseDeadlineFrom?: string;
|
|
103
|
-
responseDeadlineTo?: string;
|
|
104
|
-
active?: boolean;
|
|
105
|
-
limit?: number;
|
|
106
|
-
offset?: number;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export type SamSearchResult = {
|
|
110
|
-
totalRecords: number;
|
|
111
|
-
limit: number;
|
|
112
|
-
offset: number;
|
|
113
|
-
opportunitiesData: SamOpportunity[];
|
|
114
|
-
/**
|
|
115
|
-
* Set ONLY when the search could not run at all (every access tier threw:
|
|
116
|
-
* HAL down / network / 5xx-after-retry). It disambiguates a TOTAL OUTAGE
|
|
117
|
-
* from a GENUINE zero — both otherwise present as
|
|
118
|
-
* `{ totalRecords: 0, opportunitiesData: [] }`. Additive + optional:
|
|
119
|
-
* existing readers that ignore it are unaffected; a healthy search (incl.
|
|
120
|
-
* a real 0 or an empty page past the end) NEVER sets it. Tool wrappers use
|
|
121
|
-
* it to emit an honest `_meta` (`complete:false`, `totalAvailable:null`,
|
|
122
|
-
* a disclosing note) instead of the silent "0 notices, complete" lie.
|
|
123
|
-
*/
|
|
124
|
-
degraded?: { reason: string };
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export type EntitySearchResult = {
|
|
128
|
-
entities: Array<{
|
|
129
|
-
ueiSAM: string;
|
|
130
|
-
legalBusinessName: string;
|
|
131
|
-
cageCode?: string;
|
|
132
|
-
physicalAddress?: { city?: string; stateOrProvinceCode?: string };
|
|
133
|
-
naics?: string[];
|
|
134
|
-
setAsides?: string[];
|
|
135
|
-
activeRegistration?: boolean;
|
|
136
|
-
}>;
|
|
137
|
-
totalRecords: number;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export type SamGovClientOptions = {
|
|
141
|
-
/** SAM.gov public API key. Optional — keyless public endpoints
|
|
142
|
-
* cover ~95% of opportunity discovery without one. Set when you
|
|
143
|
-
* need the higher rate limit + the full historical archive. */
|
|
144
|
-
apiKey?: string;
|
|
145
|
-
/** Override the User-Agent the client sends to SAM.gov. */
|
|
146
|
-
userAgent?: string;
|
|
147
|
-
/** Override the underlying fetch (e.g. with `node-fetch` polyfill or
|
|
148
|
-
* a wrapper for caching/retries). Defaults to global `fetch`. */
|
|
149
|
-
fetch?: typeof fetch;
|
|
150
|
-
/** Optional logger (defaults to a noop). */
|
|
151
|
-
logger?: { warn?: (msg: string, err?: unknown) => void };
|
|
152
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the @cliwant/mcp-sam-gov/sam-gov client. Mirrors the shapes
|
|
3
|
+
* returned by SAM.gov's two endpoint layers (authenticated v2 and
|
|
4
|
+
* the keyless public HAL endpoints) under one normalized contract.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type SamProcurementType =
|
|
8
|
+
| "u" // Justification
|
|
9
|
+
| "p" // Pre-solicitation
|
|
10
|
+
| "a" // Award Notice
|
|
11
|
+
| "r" // Sources Sought
|
|
12
|
+
| "s" // Special Notice
|
|
13
|
+
| "o" // Solicitation
|
|
14
|
+
| "g" // Sale of Surplus
|
|
15
|
+
| "k" // Combined Synopsis
|
|
16
|
+
| "i"; // Intent to Bundle
|
|
17
|
+
|
|
18
|
+
export type SamSetAside =
|
|
19
|
+
| "SBA"
|
|
20
|
+
| "SBP"
|
|
21
|
+
| "8A"
|
|
22
|
+
| "8AN"
|
|
23
|
+
| "HZC"
|
|
24
|
+
| "HZS"
|
|
25
|
+
| "SDVOSBC"
|
|
26
|
+
| "SDVOSBS"
|
|
27
|
+
| "WOSB"
|
|
28
|
+
| "WOSBSS"
|
|
29
|
+
| "EDWOSB"
|
|
30
|
+
| "EDWOSBSS"
|
|
31
|
+
| "LAS"
|
|
32
|
+
| "IEE"
|
|
33
|
+
| "ISBEE"
|
|
34
|
+
| "BICiv"
|
|
35
|
+
| "VSA"
|
|
36
|
+
| "VSS";
|
|
37
|
+
|
|
38
|
+
export type SamLocation = {
|
|
39
|
+
streetAddress?: string;
|
|
40
|
+
streetAddress2?: string;
|
|
41
|
+
city?: { code?: string; name?: string };
|
|
42
|
+
state?: { code?: string; name?: string };
|
|
43
|
+
zip?: string;
|
|
44
|
+
country?: { code?: string; name?: string };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type SamPointOfContact = {
|
|
48
|
+
type?: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
fullName?: string;
|
|
51
|
+
email?: string;
|
|
52
|
+
phone?: string;
|
|
53
|
+
fax?: string | null;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type SamOpportunity = {
|
|
57
|
+
noticeId: string;
|
|
58
|
+
title: string;
|
|
59
|
+
solicitationNumber?: string;
|
|
60
|
+
fullParentPathName?: string;
|
|
61
|
+
fullParentPathCode?: string;
|
|
62
|
+
postedDate?: string;
|
|
63
|
+
type?: string;
|
|
64
|
+
baseType?: string;
|
|
65
|
+
archiveType?: string;
|
|
66
|
+
archiveDate?: string | null;
|
|
67
|
+
typeOfSetAsideDescription?: string | null;
|
|
68
|
+
typeOfSetAside?: string | null;
|
|
69
|
+
responseDeadLine?: string | null;
|
|
70
|
+
naicsCode?: string | null;
|
|
71
|
+
classificationCode?: string | null;
|
|
72
|
+
active?: "Yes" | "No";
|
|
73
|
+
pointOfContact?: SamPointOfContact[] | null;
|
|
74
|
+
description?: string;
|
|
75
|
+
placeOfPerformance?: SamLocation | null;
|
|
76
|
+
uiLink?: string;
|
|
77
|
+
resourceLinks?: string[] | null;
|
|
78
|
+
/**
|
|
79
|
+
* Which enrichment sub-fetches DEGRADED on an outage (subset of
|
|
80
|
+
* ["attachments", "organization"]). Set ONLY when a sub-fetch's HTTP call
|
|
81
|
+
* failed (non-200 / network / timeout) — the corresponding field
|
|
82
|
+
* (`resourceLinks` / `fullParentPathName`) is then empty but UNKNOWN, NOT
|
|
83
|
+
* confirmed-absent. Additive + optional: a healthy notice (incl. a genuine
|
|
84
|
+
* 200-empty attachment list or empty org path) NEVER sets it. Tool wrappers
|
|
85
|
+
* read it to emit an honest `_meta.degraded` + a disclosing note instead of
|
|
86
|
+
* a silent "no attachments"/"no organization" lie.
|
|
87
|
+
*/
|
|
88
|
+
enrichmentDegraded?: string[];
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type SamSearchFilters = {
|
|
92
|
+
query?: string;
|
|
93
|
+
/** MM/DD/YYYY (auth endpoint convention). */
|
|
94
|
+
postedFrom?: string;
|
|
95
|
+
postedTo?: string;
|
|
96
|
+
ptype?: SamProcurementType[];
|
|
97
|
+
ncode?: string;
|
|
98
|
+
setAside?: SamSetAside[];
|
|
99
|
+
organizationName?: string;
|
|
100
|
+
state?: string;
|
|
101
|
+
zip?: string;
|
|
102
|
+
responseDeadlineFrom?: string;
|
|
103
|
+
responseDeadlineTo?: string;
|
|
104
|
+
active?: boolean;
|
|
105
|
+
limit?: number;
|
|
106
|
+
offset?: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type SamSearchResult = {
|
|
110
|
+
totalRecords: number;
|
|
111
|
+
limit: number;
|
|
112
|
+
offset: number;
|
|
113
|
+
opportunitiesData: SamOpportunity[];
|
|
114
|
+
/**
|
|
115
|
+
* Set ONLY when the search could not run at all (every access tier threw:
|
|
116
|
+
* HAL down / network / 5xx-after-retry). It disambiguates a TOTAL OUTAGE
|
|
117
|
+
* from a GENUINE zero — both otherwise present as
|
|
118
|
+
* `{ totalRecords: 0, opportunitiesData: [] }`. Additive + optional:
|
|
119
|
+
* existing readers that ignore it are unaffected; a healthy search (incl.
|
|
120
|
+
* a real 0 or an empty page past the end) NEVER sets it. Tool wrappers use
|
|
121
|
+
* it to emit an honest `_meta` (`complete:false`, `totalAvailable:null`,
|
|
122
|
+
* a disclosing note) instead of the silent "0 notices, complete" lie.
|
|
123
|
+
*/
|
|
124
|
+
degraded?: { reason: string };
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type EntitySearchResult = {
|
|
128
|
+
entities: Array<{
|
|
129
|
+
ueiSAM: string;
|
|
130
|
+
legalBusinessName: string;
|
|
131
|
+
cageCode?: string;
|
|
132
|
+
physicalAddress?: { city?: string; stateOrProvinceCode?: string };
|
|
133
|
+
naics?: string[];
|
|
134
|
+
setAsides?: string[];
|
|
135
|
+
activeRegistration?: boolean;
|
|
136
|
+
}>;
|
|
137
|
+
totalRecords: number;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type SamGovClientOptions = {
|
|
141
|
+
/** SAM.gov public API key. Optional — keyless public endpoints
|
|
142
|
+
* cover ~95% of opportunity discovery without one. Set when you
|
|
143
|
+
* need the higher rate limit + the full historical archive. */
|
|
144
|
+
apiKey?: string;
|
|
145
|
+
/** Override the User-Agent the client sends to SAM.gov. */
|
|
146
|
+
userAgent?: string;
|
|
147
|
+
/** Override the underlying fetch (e.g. with `node-fetch` polyfill or
|
|
148
|
+
* a wrapper for caching/retries). Defaults to global `fetch`. */
|
|
149
|
+
fetch?: typeof fetch;
|
|
150
|
+
/** Optional logger (defaults to a noop). */
|
|
151
|
+
logger?: { warn?: (msg: string, err?: unknown) => void };
|
|
152
|
+
};
|