@fedpulse/sdk 1.0.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.
Potentially problematic release.
This version of @fedpulse/sdk might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +331 -0
- package/dist/cjs/client.cjs +138 -0
- package/dist/cjs/errors.cjs +200 -0
- package/dist/cjs/http.cjs +449 -0
- package/dist/cjs/index.cjs +65 -0
- package/dist/cjs/resources/analytics.cjs +134 -0
- package/dist/cjs/resources/assistance.cjs +101 -0
- package/dist/cjs/resources/entities.cjs +149 -0
- package/dist/cjs/resources/exclusions.cjs +135 -0
- package/dist/cjs/resources/intelligence.cjs +96 -0
- package/dist/cjs/resources/opportunities.cjs +170 -0
- package/dist/cjs/resources/webhooks.cjs +262 -0
- package/dist/cjs/types/analytics.cjs +5 -0
- package/dist/cjs/types/assistance.cjs +5 -0
- package/dist/cjs/types/common.cjs +5 -0
- package/dist/cjs/types/entities.cjs +5 -0
- package/dist/cjs/types/exclusions.cjs +5 -0
- package/dist/cjs/types/index.cjs +5 -0
- package/dist/cjs/types/intelligence.cjs +5 -0
- package/dist/cjs/types/opportunities.cjs +5 -0
- package/dist/cjs/types/webhooks.cjs +5 -0
- package/dist/cjs/webhooks-verify.cjs +184 -0
- package/dist/esm/client.js +135 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/errors.js +187 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/http.js +445 -0
- package/dist/esm/http.js.map +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/resources/analytics.js +131 -0
- package/dist/esm/resources/analytics.js.map +1 -0
- package/dist/esm/resources/assistance.js +98 -0
- package/dist/esm/resources/assistance.js.map +1 -0
- package/dist/esm/resources/entities.js +146 -0
- package/dist/esm/resources/entities.js.map +1 -0
- package/dist/esm/resources/exclusions.js +132 -0
- package/dist/esm/resources/exclusions.js.map +1 -0
- package/dist/esm/resources/intelligence.js +93 -0
- package/dist/esm/resources/intelligence.js.map +1 -0
- package/dist/esm/resources/opportunities.js +167 -0
- package/dist/esm/resources/opportunities.js.map +1 -0
- package/dist/esm/resources/webhooks.js +259 -0
- package/dist/esm/resources/webhooks.js.map +1 -0
- package/dist/esm/types/analytics.js +5 -0
- package/dist/esm/types/analytics.js.map +1 -0
- package/dist/esm/types/assistance.js +5 -0
- package/dist/esm/types/assistance.js.map +1 -0
- package/dist/esm/types/common.js +5 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/entities.js +5 -0
- package/dist/esm/types/entities.js.map +1 -0
- package/dist/esm/types/exclusions.js +5 -0
- package/dist/esm/types/exclusions.js.map +1 -0
- package/dist/esm/types/index.js +5 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/intelligence.js +5 -0
- package/dist/esm/types/intelligence.js.map +1 -0
- package/dist/esm/types/opportunities.js +5 -0
- package/dist/esm/types/opportunities.js.map +1 -0
- package/dist/esm/types/webhooks.js +5 -0
- package/dist/esm/types/webhooks.js.map +1 -0
- package/dist/esm/webhooks-verify.js +179 -0
- package/dist/esm/webhooks-verify.js.map +1 -0
- package/dist/types/client.d.cts +136 -0
- package/dist/types/client.d.ts +136 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/errors.d.cts +139 -0
- package/dist/types/errors.d.ts +139 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/http.d.cts +137 -0
- package/dist/types/http.d.ts +137 -0
- package/dist/types/http.d.ts.map +1 -0
- package/dist/types/index.d.cts +39 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/resources/analytics.d.cts +94 -0
- package/dist/types/resources/analytics.d.ts +94 -0
- package/dist/types/resources/analytics.d.ts.map +1 -0
- package/dist/types/resources/assistance.d.cts +66 -0
- package/dist/types/resources/assistance.d.ts +66 -0
- package/dist/types/resources/assistance.d.ts.map +1 -0
- package/dist/types/resources/entities.d.cts +101 -0
- package/dist/types/resources/entities.d.ts +101 -0
- package/dist/types/resources/entities.d.ts.map +1 -0
- package/dist/types/resources/exclusions.d.cts +84 -0
- package/dist/types/resources/exclusions.d.ts +84 -0
- package/dist/types/resources/exclusions.d.ts.map +1 -0
- package/dist/types/resources/intelligence.d.cts +66 -0
- package/dist/types/resources/intelligence.d.ts +66 -0
- package/dist/types/resources/intelligence.d.ts.map +1 -0
- package/dist/types/resources/opportunities.d.cts +116 -0
- package/dist/types/resources/opportunities.d.ts +116 -0
- package/dist/types/resources/opportunities.d.ts.map +1 -0
- package/dist/types/resources/webhooks.d.cts +180 -0
- package/dist/types/resources/webhooks.d.ts +180 -0
- package/dist/types/resources/webhooks.d.ts.map +1 -0
- package/dist/types/types/analytics.d.cts +85 -0
- package/dist/types/types/analytics.d.ts +85 -0
- package/dist/types/types/analytics.d.ts.map +1 -0
- package/dist/types/types/assistance.d.cts +55 -0
- package/dist/types/types/assistance.d.ts +55 -0
- package/dist/types/types/assistance.d.ts.map +1 -0
- package/dist/types/types/common.d.cts +58 -0
- package/dist/types/types/common.d.ts +58 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/entities.d.cts +85 -0
- package/dist/types/types/entities.d.ts +85 -0
- package/dist/types/types/entities.d.ts.map +1 -0
- package/dist/types/types/exclusions.d.cts +81 -0
- package/dist/types/types/exclusions.d.ts +81 -0
- package/dist/types/types/exclusions.d.ts.map +1 -0
- package/dist/types/types/index.d.cts +12 -0
- package/dist/types/types/index.d.ts +12 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/intelligence.d.cts +104 -0
- package/dist/types/types/intelligence.d.ts +104 -0
- package/dist/types/types/intelligence.d.ts.map +1 -0
- package/dist/types/types/opportunities.d.cts +149 -0
- package/dist/types/types/opportunities.d.ts +149 -0
- package/dist/types/types/opportunities.d.ts.map +1 -0
- package/dist/types/types/webhooks.d.cts +106 -0
- package/dist/types/types/webhooks.d.ts +106 -0
- package/dist/types/types/webhooks.d.ts.map +1 -0
- package/dist/types/webhooks-verify.d.cts +102 -0
- package/dist/types/webhooks-verify.d.ts +102 -0
- package/dist/types/webhooks-verify.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/analytics endpoints (per-user API usage analytics):
|
|
5
|
+
* - summary GET /v1/analytics/summary
|
|
6
|
+
* - chart GET /v1/analytics/chart
|
|
7
|
+
* - endpoints GET /v1/analytics/endpoints
|
|
8
|
+
* - logs GET /v1/analytics/logs
|
|
9
|
+
* - logPages async generator over the logs endpoint
|
|
10
|
+
*
|
|
11
|
+
* All results are scoped to the authenticated user — no cross-user visibility.
|
|
12
|
+
*/
|
|
13
|
+
import type { HttpClient, ParsedResponse } from '../http.js';
|
|
14
|
+
import type { AnalyticsSummary, AnalyticsChart, AnalyticsEndpoints, AnalyticsLogs, AnalyticsSummaryParams, AnalyticsChartParams, AnalyticsEndpointsParams, AnalyticsLogsParams } from '../types/analytics.js';
|
|
15
|
+
export declare class AnalyticsResource {
|
|
16
|
+
private readonly http;
|
|
17
|
+
constructor(http: HttpClient);
|
|
18
|
+
/**
|
|
19
|
+
* Get KPI summary totals for the authenticated user.
|
|
20
|
+
*
|
|
21
|
+
* Returns: requests today, this month, in range, 4xx/5xx counts and rates.
|
|
22
|
+
* Analytics data is never cached — always returns live counts.
|
|
23
|
+
*
|
|
24
|
+
* @param params Optional key-scoping and time range.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const summary = await client.analytics.summary({ range: '7d' });
|
|
29
|
+
* console.log('Requests last 7d:', summary.data.requestsInRange);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
summary(params?: AnalyticsSummaryParams): Promise<ParsedResponse<AnalyticsSummary>>;
|
|
33
|
+
/**
|
|
34
|
+
* Get per-day request counts broken down by success / 4xx / 5xx.
|
|
35
|
+
*
|
|
36
|
+
* @param params Optional key-scoping and time range.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const chart = await client.analytics.chart({ range: '30d' });
|
|
41
|
+
* for (const day of chart.data.days) {
|
|
42
|
+
* console.log(day.date, day.total);
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
chart(params?: AnalyticsChartParams): Promise<ParsedResponse<AnalyticsChart>>;
|
|
47
|
+
/**
|
|
48
|
+
* Get top-10 endpoints by request volume and by P95 latency.
|
|
49
|
+
*
|
|
50
|
+
* @param params Optional key-scoping and time range.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const endpoints = await client.analytics.endpoints({ range: '7d' });
|
|
55
|
+
* console.log('Slowest endpoint:', endpoints.data.byLatency[0]?.endpoint);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
endpoints(params?: AnalyticsEndpointsParams): Promise<ParsedResponse<AnalyticsEndpoints>>;
|
|
59
|
+
/**
|
|
60
|
+
* Get paginated API request logs for the authenticated user.
|
|
61
|
+
*
|
|
62
|
+
* Supports cursor-based pagination via the `cursor` parameter.
|
|
63
|
+
* Maximum `limit` is 1000.
|
|
64
|
+
*
|
|
65
|
+
* @param params Filter and pagination parameters.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const logs = await client.analytics.logs({ limit: 50, status: '4xx' });
|
|
70
|
+
* for (const entry of logs.data.items) {
|
|
71
|
+
* console.log(entry.method, entry.endpoint, entry.statusCode);
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
logs(params?: AnalyticsLogsParams): Promise<ParsedResponse<AnalyticsLogs>>;
|
|
76
|
+
/**
|
|
77
|
+
* Async generator that automatically paginates through all log entries.
|
|
78
|
+
*
|
|
79
|
+
* Uses cursor-based pagination. Yields one page at a time.
|
|
80
|
+
*
|
|
81
|
+
* @param params Same parameters as `logs()`. Do not pass `cursor`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* for await (const page of client.analytics.logPages({ range: '7d' })) {
|
|
86
|
+
* for (const entry of page.data.items) {
|
|
87
|
+
* console.log(entry.requestId, entry.statusCode);
|
|
88
|
+
* }
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
logPages(params: Omit<AnalyticsLogsParams, 'cursor'>): AsyncGenerator<ParsedResponse<AnalyticsLogs>>;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/resources/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;;;;OAaG;IACG,OAAO,CACX,MAAM,GAAE,sBAA2B,GAClC,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAS5C;;;;;;;;;;;;OAYG;IACG,KAAK,CACT,MAAM,GAAE,oBAAyB,GAChC,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAS1C;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,GAAE,wBAA6B,GACpC,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAS9C;;;;;;;;;;;;;;;OAeG;IACG,IAAI,CACR,MAAM,GAAE,mBAAwB,GAC/B,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAczC;;;;;;;;;;;;;;;OAeG;IACI,QAAQ,CACb,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAC1C,cAAc,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;CAgBjD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistance Listings resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/assistance endpoints:
|
|
5
|
+
* - list GET /v1/assistance
|
|
6
|
+
* - stats GET /v1/assistance/stats
|
|
7
|
+
* - get GET /v1/assistance/:number (CFDA program number)
|
|
8
|
+
* - paginate auto-paginates over the list endpoint
|
|
9
|
+
*/
|
|
10
|
+
import type { HttpClient, ParsedResponse } from '../http.cjs';
|
|
11
|
+
import type { AssistanceListing, AssistanceStats, ListAssistanceParams, GetAssistanceStatsParams } from '../types/assistance.cjs';
|
|
12
|
+
export declare class AssistanceResource {
|
|
13
|
+
private readonly http;
|
|
14
|
+
constructor(http: HttpClient);
|
|
15
|
+
/**
|
|
16
|
+
* Search and filter federal assistance listings (CFDA programs).
|
|
17
|
+
*
|
|
18
|
+
* @param params Filter and pagination parameters.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const result = await client.assistance.list({ agency: 'Department of Energy' });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(params?: ListAssistanceParams): Promise<ParsedResponse<AssistanceListing[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get aggregated statistics for assistance listings.
|
|
28
|
+
*
|
|
29
|
+
* @param params Optional filter parameters.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const stats = await client.assistance.stats();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
stats(params?: GetAssistanceStatsParams): Promise<ParsedResponse<AssistanceStats>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a single assistance listing by its CFDA program number.
|
|
39
|
+
*
|
|
40
|
+
* @param programNumber CFDA program number in "XX.XXX" format (e.g. "17.002").
|
|
41
|
+
* @throws {NotFoundError} If the program number does not exist.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const listing = await client.assistance.get('84.048');
|
|
46
|
+
* console.log(listing.data.programTitle);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
get(programNumber: string): Promise<ParsedResponse<AssistanceListing>>;
|
|
50
|
+
/**
|
|
51
|
+
* Async generator that automatically paginates over all matching assistance listings.
|
|
52
|
+
*
|
|
53
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* for await (const page of client.assistance.paginate({ agency: 'HHS' })) {
|
|
58
|
+
* for (const listing of page.data) {
|
|
59
|
+
* console.log(listing.programNumber, listing.programTitle);
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
paginate(params: Omit<ListAssistanceParams, 'page'>): AsyncGenerator<ParsedResponse<AssistanceListing[]>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=assistance.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistance Listings resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/assistance endpoints:
|
|
5
|
+
* - list GET /v1/assistance
|
|
6
|
+
* - stats GET /v1/assistance/stats
|
|
7
|
+
* - get GET /v1/assistance/:number (CFDA program number)
|
|
8
|
+
* - paginate auto-paginates over the list endpoint
|
|
9
|
+
*/
|
|
10
|
+
import type { HttpClient, ParsedResponse } from '../http.js';
|
|
11
|
+
import type { AssistanceListing, AssistanceStats, ListAssistanceParams, GetAssistanceStatsParams } from '../types/assistance.js';
|
|
12
|
+
export declare class AssistanceResource {
|
|
13
|
+
private readonly http;
|
|
14
|
+
constructor(http: HttpClient);
|
|
15
|
+
/**
|
|
16
|
+
* Search and filter federal assistance listings (CFDA programs).
|
|
17
|
+
*
|
|
18
|
+
* @param params Filter and pagination parameters.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const result = await client.assistance.list({ agency: 'Department of Energy' });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(params?: ListAssistanceParams): Promise<ParsedResponse<AssistanceListing[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get aggregated statistics for assistance listings.
|
|
28
|
+
*
|
|
29
|
+
* @param params Optional filter parameters.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const stats = await client.assistance.stats();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
stats(params?: GetAssistanceStatsParams): Promise<ParsedResponse<AssistanceStats>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a single assistance listing by its CFDA program number.
|
|
39
|
+
*
|
|
40
|
+
* @param programNumber CFDA program number in "XX.XXX" format (e.g. "17.002").
|
|
41
|
+
* @throws {NotFoundError} If the program number does not exist.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const listing = await client.assistance.get('84.048');
|
|
46
|
+
* console.log(listing.data.programTitle);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
get(programNumber: string): Promise<ParsedResponse<AssistanceListing>>;
|
|
50
|
+
/**
|
|
51
|
+
* Async generator that automatically paginates over all matching assistance listings.
|
|
52
|
+
*
|
|
53
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* for await (const page of client.assistance.paginate({ agency: 'HHS' })) {
|
|
58
|
+
* for (const listing of page.data) {
|
|
59
|
+
* console.log(listing.programNumber, listing.programTitle);
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
paginate(params: Omit<ListAssistanceParams, 'page'>): AsyncGenerator<ParsedResponse<AssistanceListing[]>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=assistance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistance.d.ts","sourceRoot":"","sources":["../../../src/resources/assistance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;OASG;IACG,IAAI,CACR,MAAM,GAAE,oBAAyB,GAChC,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAO/C;;;;;;;;;OASG;IACG,KAAK,CACT,MAAM,GAAE,wBAA6B,GACpC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAO3C;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAa5E;;;;;;;;;;;;;OAaG;IACI,QAAQ,CACb,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GACzC,cAAc,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAmBvD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entities resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/entities endpoints:
|
|
5
|
+
* - list GET /v1/entities
|
|
6
|
+
* - get GET /v1/entities/:uei
|
|
7
|
+
* - opportunities GET /v1/entities/:uei/opportunities
|
|
8
|
+
* - exclusionCheck GET /v1/entities/:uei/exclusion-check
|
|
9
|
+
* - stats GET /v1/entities/stats
|
|
10
|
+
* - paginate auto-paginates over the list endpoint
|
|
11
|
+
*/
|
|
12
|
+
import type { HttpClient, ParsedResponse } from '../http.cjs';
|
|
13
|
+
import type { Entity, EntityStats, EntityExclusionCheckResult, ListEntitiesParams } from '../types/entities.cjs';
|
|
14
|
+
import type { Opportunity } from '../types/opportunities.cjs';
|
|
15
|
+
import type { PaginationParams } from '../types/common.cjs';
|
|
16
|
+
export declare class EntitiesResource {
|
|
17
|
+
private readonly http;
|
|
18
|
+
constructor(http: HttpClient);
|
|
19
|
+
/**
|
|
20
|
+
* Search and filter SAM.gov registered entities (vendors).
|
|
21
|
+
*
|
|
22
|
+
* @param params Filter and pagination parameters.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const result = await client.entities.list({
|
|
27
|
+
* naics: '541512',
|
|
28
|
+
* certification: '8A',
|
|
29
|
+
* state: 'VA',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
list(params?: ListEntitiesParams): Promise<ParsedResponse<Entity[]>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the full SAM.gov registration profile for a vendor by UEI.
|
|
36
|
+
*
|
|
37
|
+
* @param uei Unique Entity Identifier (12-char alphanumeric).
|
|
38
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const entity = await client.entities.get('ABCDEF123456');
|
|
43
|
+
* console.log(entity.data.legalBusinessName);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
get(uei: string): Promise<ParsedResponse<Entity>>;
|
|
47
|
+
/**
|
|
48
|
+
* Get awarded contract opportunities linked to a vendor.
|
|
49
|
+
*
|
|
50
|
+
* @param uei Unique Entity Identifier.
|
|
51
|
+
* @param params Pagination parameters.
|
|
52
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const contracts = await client.entities.opportunities('ABCDEF123456', { limit: 10 });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
opportunities(uei: string, params?: PaginationParams): Promise<ParsedResponse<Opportunity[]>>;
|
|
60
|
+
/**
|
|
61
|
+
* Check whether a vendor is currently excluded (debarred) from federal contracts.
|
|
62
|
+
*
|
|
63
|
+
* @param uei Unique Entity Identifier.
|
|
64
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const check = await client.entities.exclusionCheck('ABCDEF123456');
|
|
69
|
+
* if (check.data.excluded) {
|
|
70
|
+
* console.warn('Vendor is EXCLUDED!', check.data.exclusion);
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
exclusionCheck(uei: string): Promise<ParsedResponse<EntityExclusionCheckResult>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get aggregated entity registration statistics.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const stats = await client.entities.stats();
|
|
81
|
+
* console.log('Total registered entities:', stats.data.total);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
stats(): Promise<ParsedResponse<EntityStats>>;
|
|
85
|
+
/**
|
|
86
|
+
* Async generator that automatically paginates over all matching entities.
|
|
87
|
+
*
|
|
88
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* for await (const page of client.entities.paginate({ naics: '541512' })) {
|
|
93
|
+
* for (const entity of page.data) {
|
|
94
|
+
* console.log(entity.legalBusinessName);
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
paginate(params: Omit<ListEntitiesParams, 'page'>): AsyncGenerator<ParsedResponse<Entity[]>>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entities resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/entities endpoints:
|
|
5
|
+
* - list GET /v1/entities
|
|
6
|
+
* - get GET /v1/entities/:uei
|
|
7
|
+
* - opportunities GET /v1/entities/:uei/opportunities
|
|
8
|
+
* - exclusionCheck GET /v1/entities/:uei/exclusion-check
|
|
9
|
+
* - stats GET /v1/entities/stats
|
|
10
|
+
* - paginate auto-paginates over the list endpoint
|
|
11
|
+
*/
|
|
12
|
+
import type { HttpClient, ParsedResponse } from '../http.js';
|
|
13
|
+
import type { Entity, EntityStats, EntityExclusionCheckResult, ListEntitiesParams } from '../types/entities.js';
|
|
14
|
+
import type { Opportunity } from '../types/opportunities.js';
|
|
15
|
+
import type { PaginationParams } from '../types/common.js';
|
|
16
|
+
export declare class EntitiesResource {
|
|
17
|
+
private readonly http;
|
|
18
|
+
constructor(http: HttpClient);
|
|
19
|
+
/**
|
|
20
|
+
* Search and filter SAM.gov registered entities (vendors).
|
|
21
|
+
*
|
|
22
|
+
* @param params Filter and pagination parameters.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const result = await client.entities.list({
|
|
27
|
+
* naics: '541512',
|
|
28
|
+
* certification: '8A',
|
|
29
|
+
* state: 'VA',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
list(params?: ListEntitiesParams): Promise<ParsedResponse<Entity[]>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the full SAM.gov registration profile for a vendor by UEI.
|
|
36
|
+
*
|
|
37
|
+
* @param uei Unique Entity Identifier (12-char alphanumeric).
|
|
38
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const entity = await client.entities.get('ABCDEF123456');
|
|
43
|
+
* console.log(entity.data.legalBusinessName);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
get(uei: string): Promise<ParsedResponse<Entity>>;
|
|
47
|
+
/**
|
|
48
|
+
* Get awarded contract opportunities linked to a vendor.
|
|
49
|
+
*
|
|
50
|
+
* @param uei Unique Entity Identifier.
|
|
51
|
+
* @param params Pagination parameters.
|
|
52
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const contracts = await client.entities.opportunities('ABCDEF123456', { limit: 10 });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
opportunities(uei: string, params?: PaginationParams): Promise<ParsedResponse<Opportunity[]>>;
|
|
60
|
+
/**
|
|
61
|
+
* Check whether a vendor is currently excluded (debarred) from federal contracts.
|
|
62
|
+
*
|
|
63
|
+
* @param uei Unique Entity Identifier.
|
|
64
|
+
* @throws {NotFoundError} If the entity does not exist.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const check = await client.entities.exclusionCheck('ABCDEF123456');
|
|
69
|
+
* if (check.data.excluded) {
|
|
70
|
+
* console.warn('Vendor is EXCLUDED!', check.data.exclusion);
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
exclusionCheck(uei: string): Promise<ParsedResponse<EntityExclusionCheckResult>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get aggregated entity registration statistics.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const stats = await client.entities.stats();
|
|
81
|
+
* console.log('Total registered entities:', stats.data.total);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
stats(): Promise<ParsedResponse<EntityStats>>;
|
|
85
|
+
/**
|
|
86
|
+
* Async generator that automatically paginates over all matching entities.
|
|
87
|
+
*
|
|
88
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* for await (const page of client.entities.paginate({ naics: '541512' })) {
|
|
93
|
+
* for (const entity of page.data) {
|
|
94
|
+
* console.log(entity.legalBusinessName);
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
paginate(params: Omit<ListEntitiesParams, 'page'>): AsyncGenerator<ParsedResponse<Entity[]>>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/resources/entities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;;;;OAaG;IACG,IAAI,CACR,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;IAOpC;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAOvD;;;;;;;;;;;OAWG;IACG,aAAa,CACjB,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,gBAAqB,GAC5B,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;IAQzC;;;;;;;;;;;;;OAaG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IAStF;;;;;;;;OAQG;IACG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAInD;;;;;;;;;;;;;OAaG;IACI,QAAQ,CACb,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GACvC,cAAc,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;CAmB5C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exclusions resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/exclusions endpoints:
|
|
5
|
+
* - list GET /v1/exclusions
|
|
6
|
+
* - get GET /v1/exclusions/:exclusionId
|
|
7
|
+
* - check POST /v1/exclusions/check (bulk compliance)
|
|
8
|
+
* - stats GET /v1/exclusions/stats
|
|
9
|
+
* - paginate auto-paginates over the list endpoint
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpClient, ParsedResponse } from '../http.cjs';
|
|
12
|
+
import type { Exclusion, ExclusionsStats, ListExclusionsParams, BulkComplianceCheckParams, ComplianceCheckResult } from '../types/exclusions.cjs';
|
|
13
|
+
export declare class ExclusionsResource {
|
|
14
|
+
private readonly http;
|
|
15
|
+
constructor(http: HttpClient);
|
|
16
|
+
/**
|
|
17
|
+
* Search and filter the SAM.gov exclusions database.
|
|
18
|
+
*
|
|
19
|
+
* @param params Filter and pagination parameters.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const result = await client.exclusions.list({ uei: 'ABCDEF123456' });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
list(params?: ListExclusionsParams): Promise<ParsedResponse<Exclusion[]>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a single exclusion record by its unique ID.
|
|
29
|
+
*
|
|
30
|
+
* @param exclusionId Internal exclusion identifier.
|
|
31
|
+
* @throws {NotFoundError} If the exclusion record does not exist.
|
|
32
|
+
*/
|
|
33
|
+
get(exclusionId: string): Promise<ParsedResponse<Exclusion>>;
|
|
34
|
+
/**
|
|
35
|
+
* Bulk compliance check — verify up to 100 entities against the exclusions database.
|
|
36
|
+
*
|
|
37
|
+
* Each entity must include at least one of: `uei`, `cage`, or `name`.
|
|
38
|
+
* When `fuzzyMatch` is true (default), name matching uses trigram similarity.
|
|
39
|
+
*
|
|
40
|
+
* @param params List of entities and fuzzy-match flag.
|
|
41
|
+
* @returns Per-entity exclusion status with match confidence scores.
|
|
42
|
+
* @throws {ValidationError} If more than 100 entities are provided.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const result = await client.exclusions.check({
|
|
47
|
+
* entities: [
|
|
48
|
+
* { uei: 'ABCDEF123456' },
|
|
49
|
+
* { name: 'Acme Corporation' },
|
|
50
|
+
* ],
|
|
51
|
+
* });
|
|
52
|
+
* for (const item of result.data) {
|
|
53
|
+
* console.log(item.input.name, '->', item.excluded ? 'EXCLUDED' : 'OK');
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
check(params: BulkComplianceCheckParams): Promise<ParsedResponse<ComplianceCheckResult[]>>;
|
|
58
|
+
/**
|
|
59
|
+
* Get aggregated exclusion statistics.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const stats = await client.exclusions.stats();
|
|
64
|
+
* console.log('Total active exclusions:', stats.data.active);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
stats(): Promise<ParsedResponse<ExclusionsStats>>;
|
|
68
|
+
/**
|
|
69
|
+
* Async generator that automatically paginates over all matching exclusions.
|
|
70
|
+
*
|
|
71
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* for await (const page of client.exclusions.paginate({ agency: 'DEPT OF DEFENSE' })) {
|
|
76
|
+
* for (const exc of page.data) {
|
|
77
|
+
* console.log(exc.name, exc.effectiveDate);
|
|
78
|
+
* }
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
paginate(params: Omit<ListExclusionsParams, 'page'>): AsyncGenerator<ParsedResponse<Exclusion[]>>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=exclusions.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exclusions resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/exclusions endpoints:
|
|
5
|
+
* - list GET /v1/exclusions
|
|
6
|
+
* - get GET /v1/exclusions/:exclusionId
|
|
7
|
+
* - check POST /v1/exclusions/check (bulk compliance)
|
|
8
|
+
* - stats GET /v1/exclusions/stats
|
|
9
|
+
* - paginate auto-paginates over the list endpoint
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpClient, ParsedResponse } from '../http.js';
|
|
12
|
+
import type { Exclusion, ExclusionsStats, ListExclusionsParams, BulkComplianceCheckParams, ComplianceCheckResult } from '../types/exclusions.js';
|
|
13
|
+
export declare class ExclusionsResource {
|
|
14
|
+
private readonly http;
|
|
15
|
+
constructor(http: HttpClient);
|
|
16
|
+
/**
|
|
17
|
+
* Search and filter the SAM.gov exclusions database.
|
|
18
|
+
*
|
|
19
|
+
* @param params Filter and pagination parameters.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const result = await client.exclusions.list({ uei: 'ABCDEF123456' });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
list(params?: ListExclusionsParams): Promise<ParsedResponse<Exclusion[]>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a single exclusion record by its unique ID.
|
|
29
|
+
*
|
|
30
|
+
* @param exclusionId Internal exclusion identifier.
|
|
31
|
+
* @throws {NotFoundError} If the exclusion record does not exist.
|
|
32
|
+
*/
|
|
33
|
+
get(exclusionId: string): Promise<ParsedResponse<Exclusion>>;
|
|
34
|
+
/**
|
|
35
|
+
* Bulk compliance check — verify up to 100 entities against the exclusions database.
|
|
36
|
+
*
|
|
37
|
+
* Each entity must include at least one of: `uei`, `cage`, or `name`.
|
|
38
|
+
* When `fuzzyMatch` is true (default), name matching uses trigram similarity.
|
|
39
|
+
*
|
|
40
|
+
* @param params List of entities and fuzzy-match flag.
|
|
41
|
+
* @returns Per-entity exclusion status with match confidence scores.
|
|
42
|
+
* @throws {ValidationError} If more than 100 entities are provided.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const result = await client.exclusions.check({
|
|
47
|
+
* entities: [
|
|
48
|
+
* { uei: 'ABCDEF123456' },
|
|
49
|
+
* { name: 'Acme Corporation' },
|
|
50
|
+
* ],
|
|
51
|
+
* });
|
|
52
|
+
* for (const item of result.data) {
|
|
53
|
+
* console.log(item.input.name, '->', item.excluded ? 'EXCLUDED' : 'OK');
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
check(params: BulkComplianceCheckParams): Promise<ParsedResponse<ComplianceCheckResult[]>>;
|
|
58
|
+
/**
|
|
59
|
+
* Get aggregated exclusion statistics.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const stats = await client.exclusions.stats();
|
|
64
|
+
* console.log('Total active exclusions:', stats.data.active);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
stats(): Promise<ParsedResponse<ExclusionsStats>>;
|
|
68
|
+
/**
|
|
69
|
+
* Async generator that automatically paginates over all matching exclusions.
|
|
70
|
+
*
|
|
71
|
+
* @param params Same filter parameters as `list()`. Do not pass `page`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* for await (const page of client.exclusions.paginate({ agency: 'DEPT OF DEFENSE' })) {
|
|
76
|
+
* for (const exc of page.data) {
|
|
77
|
+
* console.log(exc.name, exc.effectiveDate);
|
|
78
|
+
* }
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
paginate(params: Omit<ListExclusionsParams, 'page'>): AsyncGenerator<ParsedResponse<Exclusion[]>>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=exclusions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exclusions.d.ts","sourceRoot":"","sources":["../../../src/resources/exclusions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;OASG;IACG,IAAI,CACR,MAAM,GAAE,oBAAyB,GAChC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;IAOvC;;;;;OAKG;IACG,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IASlE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,KAAK,CACT,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,cAAc,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAqBnD;;;;;;;;OAQG;IACG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAIvD;;;;;;;;;;;;;OAaG;IACI,QAAQ,CACb,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GACzC,cAAc,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;CAmB/C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intelligence resource client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps all /v1/intelligence endpoints:
|
|
5
|
+
* - entityProfile GET /v1/intelligence/entity/:uei
|
|
6
|
+
* - marketAnalysis GET /v1/intelligence/market/:naics
|
|
7
|
+
* - complianceCheck POST /v1/intelligence/compliance-check
|
|
8
|
+
*/
|
|
9
|
+
import type { HttpClient, ParsedResponse } from '../http.cjs';
|
|
10
|
+
import type { EntityIntelProfile, MarketAnalysis, CompliancePackage, ComplianceCheckRequestParams } from '../types/intelligence.cjs';
|
|
11
|
+
export declare class IntelligenceResource {
|
|
12
|
+
private readonly http;
|
|
13
|
+
constructor(http: HttpClient);
|
|
14
|
+
/**
|
|
15
|
+
* Get a comprehensive 360° intelligence profile for a vendor.
|
|
16
|
+
*
|
|
17
|
+
* Aggregates: contract history, agency relationships, certifications,
|
|
18
|
+
* exclusion status, and risk indicators into a single response.
|
|
19
|
+
*
|
|
20
|
+
* @param uei Unique Entity Identifier (12-char alphanumeric).
|
|
21
|
+
* @throws {NotFoundError} If the entity does not exist in SAM.gov.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const profile = await client.intelligence.entityProfile('ABCDEF123456');
|
|
26
|
+
* console.log('Contract count:', profile.data.contractCount);
|
|
27
|
+
* console.log('Risk:', profile.data.riskLevel);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
entityProfile(uei: string): Promise<ParsedResponse<EntityIntelProfile>>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a market analysis for a specific NAICS code.
|
|
33
|
+
*
|
|
34
|
+
* Returns: top awardees, top agencies, set-aside breakdown, active solicitations,
|
|
35
|
+
* total market size, and recent award trends.
|
|
36
|
+
*
|
|
37
|
+
* @param naics 2–6 digit NAICS code (more digits = more specific market segment).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const market = await client.intelligence.marketAnalysis('541512');
|
|
42
|
+
* console.log('Market size (cents):', market.data.totalMarketSize);
|
|
43
|
+
* console.log('Top awardee:', market.data.topAwardees[0]?.name);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
marketAnalysis(naics: string): Promise<ParsedResponse<MarketAnalysis>>;
|
|
47
|
+
/**
|
|
48
|
+
* Perform a full compliance check for a vendor.
|
|
49
|
+
*
|
|
50
|
+
* Returns: exclusion status, SAM.gov registration status, risk score,
|
|
51
|
+
* and risk indicators in one API call.
|
|
52
|
+
*
|
|
53
|
+
* @param params Object containing the UEI to check.
|
|
54
|
+
* @throws {NotFoundError} If the entity does not exist in SAM.gov.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const compliance = await client.intelligence.complianceCheck({ uei: 'ABCDEF123456' });
|
|
59
|
+
* if (compliance.data.excluded || compliance.data.riskLevel === 'high') {
|
|
60
|
+
* console.warn('Do not contract with this vendor.');
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
complianceCheck(params: ComplianceCheckRequestParams): Promise<ParsedResponse<CompliancePackage>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=intelligence.d.ts.map
|