@inflexa-ai/harness 0.42.0 → 0.42.2

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.
@@ -0,0 +1,586 @@
1
+ /**
2
+ * Pure async client functions for the Amass Data Platform API: RegulatoryCore
3
+ * (the FDA and EMA authorizations, with the parsed sections of their labels,
4
+ * reviews, SmPCs and EPARs) and PatentCore (patents).
5
+ *
6
+ * The schemas mirror the published OpenAPI document
7
+ * (`https://api.amass.tech/api/doc/openapi.json`). A live key verified them on
8
+ * 2026-09-30, and the golden fixtures under `__fixtures__/amass/` hold those
9
+ * answers.
10
+ *
11
+ * Absence policy: a base field is always present, and an absent value is an
12
+ * explicit `null` (`therapeuticIndication`, `grantDate`). A field that only an
13
+ * `include` parameter adds (`fdaDetails`, `emaDetails`, `claims`,
14
+ * `description`) is an omitted key when the request does not ask for it. Thus
15
+ * a base field carries `.nullable()`, and an include field carries
16
+ * `.nullable().optional()`. A lookup item omits `amassIds` when it carries
17
+ * `error`, and omits `error` when it carries `amassIds`.
18
+ *
19
+ * A response enum is a plain string here. Amass grows those vocabularies, and
20
+ * one unknown value would otherwise reject a whole search. The input filters
21
+ * of the tools carry the enums of the OpenAPI document.
22
+ *
23
+ * Status policy: only a 404 and a lookup item with `NOT_FOUND` are an absence.
24
+ * `isUnexpectedApiError` reads every 4xx as an absence, which would turn a
25
+ * rejected key (401) or a refused organization (403) into "no such record".
26
+ * Thus this client classifies each status itself.
27
+ *
28
+ * Every call spends credits: a search costs 5 credits for each 20 records of
29
+ * `limit`, and a get, a lookup (whatever its item count) or a 404 costs 1.
30
+ */
31
+ import { type ResultAsync } from "neverthrow";
32
+ import { z } from "zod";
33
+ import { type ApiError } from "./api-utils.js";
34
+ /** The error channel of the client. `invalid_input` is the one outcome that the caller can repair. */
35
+ export type AmassError = {
36
+ readonly type: "invalid_input";
37
+ readonly status: number;
38
+ readonly message: string;
39
+ } | {
40
+ readonly type: "unauthorized";
41
+ readonly message: string;
42
+ } | {
43
+ readonly type: "forbidden";
44
+ readonly message: string;
45
+ } | {
46
+ readonly type: "rejected";
47
+ readonly status: number | null;
48
+ readonly code: string;
49
+ readonly message: string;
50
+ } | {
51
+ readonly type: "api";
52
+ readonly error: ApiError;
53
+ };
54
+ /** Render an `AmassError` as a one-line message for the model or for a throw. */
55
+ export declare function describeAmassError(e: AmassError): string;
56
+ export declare const AmassErrorEnvelopeSchema: z.ZodObject<{
57
+ error: z.ZodObject<{
58
+ status: z.ZodNumber;
59
+ code: z.ZodString;
60
+ message: z.ZodString;
61
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
62
+ }, z.core.$strip>;
63
+ }, z.core.$strip>;
64
+ export declare const AmassLookupResponseSchema: z.ZodObject<{
65
+ data: z.ZodArray<z.ZodObject<{
66
+ input: z.ZodRecord<z.ZodString, z.ZodString>;
67
+ amassIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ error: z.ZodOptional<z.ZodObject<{
69
+ code: z.ZodString;
70
+ message: z.ZodString;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>;
74
+ export type LookupItem = Readonly<Record<string, string>>;
75
+ /**
76
+ * The lookup forms of an FDA application number. Amass stores the number with its
77
+ * prefix (`NDA021588`) and answers `NOT_FOUND` for the bare `021588`. A bare number
78
+ * thus goes as all three prefixes, in one request at the price of one.
79
+ */
80
+ export declare function fdaApplicationForms(input: string): string[];
81
+ /**
82
+ * The lookup form of an NDC. Amass stores the two-segment product NDC (`0078-0401`)
83
+ * and answers `NOT_FOUND` for the package NDC (`0078-0401-05`).
84
+ */
85
+ export declare function productNdcOf(input: string): string;
86
+ export declare const REGULATORY_AGENCIES: readonly ["FDA", "EMA"];
87
+ export declare const REGULATORY_MOLECULE_TYPES: readonly ["SMALL_MOLECULE", "ANTIBODY", "PROTEIN", "ENZYME", "OLIGONUCLEOTIDE", "GENE", "CELL", "ANTIBODY_DRUG_CONJUGATE", "VACCINE_COMPONENT", "VACCINE", "OLIGOSACCHARIDE", "UNKNOWN"];
88
+ export declare const REGULATORY_AUTHORIZATION_STATUSES: readonly ["ACTIVE", "APPROVED_NOT_MARKETED", "CONDITIONAL", "SUSPENDED", "WITHDRAWN_VOLUNTARY", "WITHDRAWN_FORCED", "REVOKED", "LAPSED_SUNSET", "REFUSED", "WITHDRAWN_DURING_REVIEW", "EXPIRED", "UNKNOWN"];
89
+ export declare const REGULATORY_DESIGNATIONS: readonly ["PRIORITY_REVIEW", "BREAKTHROUGH_THERAPY", "FAST_TRACK", "RMAT", "ACCELERATED_APPROVAL", "ACCELERATED_ASSESSMENT", "PRIME", "CONDITIONAL_MA", "EXCEPTIONAL_CIRCUMSTANCES"];
90
+ declare const FdaDetailsSchema: z.ZodObject<{
91
+ applicationNumber: z.ZodNullable<z.ZodString>;
92
+ prescriptionClass: z.ZodNullable<z.ZodString>;
93
+ submissionClassCode: z.ZodNullable<z.ZodString>;
94
+ labelDate: z.ZodNullable<z.ZodString>;
95
+ labelUrl: z.ZodNullable<z.ZodString>;
96
+ ndc: z.ZodArray<z.ZodString>;
97
+ splSetId: z.ZodArray<z.ZodString>;
98
+ withdrawalDate: z.ZodNullable<z.ZodString>;
99
+ withdrawalReason: z.ZodNullable<z.ZodString>;
100
+ withdrawalSourceUrl: z.ZodNullable<z.ZodString>;
101
+ }, z.core.$strip>;
102
+ declare const EmaDetailsSchema: z.ZodObject<{
103
+ productNumber: z.ZodNullable<z.ZodString>;
104
+ category: z.ZodNullable<z.ZodString>;
105
+ opinionStatus: z.ZodNullable<z.ZodString>;
106
+ isBiosimilar: z.ZodNullable<z.ZodBoolean>;
107
+ isAdvancedTherapy: z.ZodNullable<z.ZodBoolean>;
108
+ isGenericOrHybrid: z.ZodNullable<z.ZodBoolean>;
109
+ additionalMonitoring: z.ZodNullable<z.ZodBoolean>;
110
+ pharmacotherapeuticGroup: z.ZodNullable<z.ZodString>;
111
+ patientSafety: z.ZodNullable<z.ZodString>;
112
+ latestProcedure: z.ZodNullable<z.ZodString>;
113
+ revisionNumber: z.ZodNullable<z.ZodNumber>;
114
+ smpcUrl: z.ZodNullable<z.ZodString>;
115
+ smpcDate: z.ZodNullable<z.ZodString>;
116
+ opinionAdoptedDate: z.ZodNullable<z.ZodString>;
117
+ europeanCommissionDecisionDate: z.ZodNullable<z.ZodString>;
118
+ withdrawalOfApplicationDate: z.ZodNullable<z.ZodString>;
119
+ refusalOfMarketingAuthorisationDate: z.ZodNullable<z.ZodString>;
120
+ withdrawalExpiryRevocationLapseDate: z.ZodNullable<z.ZodString>;
121
+ firstPublishedDate: z.ZodNullable<z.ZodString>;
122
+ }, z.core.$strip>;
123
+ declare const RegulatoryBaseSchema: z.ZodObject<{
124
+ amassId: z.ZodString;
125
+ agency: z.ZodString;
126
+ name: z.ZodNullable<z.ZodString>;
127
+ activeSubstance: z.ZodNullable<z.ZodString>;
128
+ moleculeType: z.ZodNullable<z.ZodString>;
129
+ authorizationStatus: z.ZodNullable<z.ZodString>;
130
+ procedureType: z.ZodNullable<z.ZodString>;
131
+ therapeuticIndication: z.ZodNullable<z.ZodString>;
132
+ marketingAuthorisationHolder: z.ZodNullable<z.ZodString>;
133
+ authorizationDate: z.ZodNullable<z.ZodString>;
134
+ firstAuthorizationDate: z.ZodNullable<z.ZodString>;
135
+ sourceUrl: z.ZodNullable<z.ZodString>;
136
+ isOrphan: z.ZodNullable<z.ZodBoolean>;
137
+ designations: z.ZodArray<z.ZodObject<{
138
+ axis: z.ZodString;
139
+ type: z.ZodString;
140
+ agency: z.ZodString;
141
+ nativeName: z.ZodNullable<z.ZodString>;
142
+ basis: z.ZodNullable<z.ZodString>;
143
+ indication: z.ZodNullable<z.ZodString>;
144
+ postMarketingObligation: z.ZodNullable<z.ZodBoolean>;
145
+ }, z.core.$strip>>;
146
+ authorizationsByAgency: z.ZodArray<z.ZodObject<{
147
+ amassId: z.ZodString;
148
+ agency: z.ZodString;
149
+ name: z.ZodNullable<z.ZodString>;
150
+ authorizationStatus: z.ZodNullable<z.ZodString>;
151
+ }, z.core.$strip>>;
152
+ fdaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
153
+ applicationNumber: z.ZodNullable<z.ZodString>;
154
+ prescriptionClass: z.ZodNullable<z.ZodString>;
155
+ submissionClassCode: z.ZodNullable<z.ZodString>;
156
+ labelDate: z.ZodNullable<z.ZodString>;
157
+ labelUrl: z.ZodNullable<z.ZodString>;
158
+ ndc: z.ZodArray<z.ZodString>;
159
+ splSetId: z.ZodArray<z.ZodString>;
160
+ withdrawalDate: z.ZodNullable<z.ZodString>;
161
+ withdrawalReason: z.ZodNullable<z.ZodString>;
162
+ withdrawalSourceUrl: z.ZodNullable<z.ZodString>;
163
+ }, z.core.$strip>>>;
164
+ emaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
165
+ productNumber: z.ZodNullable<z.ZodString>;
166
+ category: z.ZodNullable<z.ZodString>;
167
+ opinionStatus: z.ZodNullable<z.ZodString>;
168
+ isBiosimilar: z.ZodNullable<z.ZodBoolean>;
169
+ isAdvancedTherapy: z.ZodNullable<z.ZodBoolean>;
170
+ isGenericOrHybrid: z.ZodNullable<z.ZodBoolean>;
171
+ additionalMonitoring: z.ZodNullable<z.ZodBoolean>;
172
+ pharmacotherapeuticGroup: z.ZodNullable<z.ZodString>;
173
+ patientSafety: z.ZodNullable<z.ZodString>;
174
+ latestProcedure: z.ZodNullable<z.ZodString>;
175
+ revisionNumber: z.ZodNullable<z.ZodNumber>;
176
+ smpcUrl: z.ZodNullable<z.ZodString>;
177
+ smpcDate: z.ZodNullable<z.ZodString>;
178
+ opinionAdoptedDate: z.ZodNullable<z.ZodString>;
179
+ europeanCommissionDecisionDate: z.ZodNullable<z.ZodString>;
180
+ withdrawalOfApplicationDate: z.ZodNullable<z.ZodString>;
181
+ refusalOfMarketingAuthorisationDate: z.ZodNullable<z.ZodString>;
182
+ withdrawalExpiryRevocationLapseDate: z.ZodNullable<z.ZodString>;
183
+ firstPublishedDate: z.ZodNullable<z.ZodString>;
184
+ }, z.core.$strip>>>;
185
+ }, z.core.$strip>;
186
+ export declare const RegulatorySearchResponseSchema: z.ZodObject<{
187
+ data: z.ZodArray<z.ZodObject<{
188
+ amassId: z.ZodString;
189
+ agency: z.ZodString;
190
+ name: z.ZodNullable<z.ZodString>;
191
+ activeSubstance: z.ZodNullable<z.ZodString>;
192
+ moleculeType: z.ZodNullable<z.ZodString>;
193
+ authorizationStatus: z.ZodNullable<z.ZodString>;
194
+ procedureType: z.ZodNullable<z.ZodString>;
195
+ therapeuticIndication: z.ZodNullable<z.ZodString>;
196
+ marketingAuthorisationHolder: z.ZodNullable<z.ZodString>;
197
+ authorizationDate: z.ZodNullable<z.ZodString>;
198
+ firstAuthorizationDate: z.ZodNullable<z.ZodString>;
199
+ sourceUrl: z.ZodNullable<z.ZodString>;
200
+ isOrphan: z.ZodNullable<z.ZodBoolean>;
201
+ designations: z.ZodArray<z.ZodObject<{
202
+ axis: z.ZodString;
203
+ type: z.ZodString;
204
+ agency: z.ZodString;
205
+ nativeName: z.ZodNullable<z.ZodString>;
206
+ basis: z.ZodNullable<z.ZodString>;
207
+ indication: z.ZodNullable<z.ZodString>;
208
+ postMarketingObligation: z.ZodNullable<z.ZodBoolean>;
209
+ }, z.core.$strip>>;
210
+ authorizationsByAgency: z.ZodArray<z.ZodObject<{
211
+ amassId: z.ZodString;
212
+ agency: z.ZodString;
213
+ name: z.ZodNullable<z.ZodString>;
214
+ authorizationStatus: z.ZodNullable<z.ZodString>;
215
+ }, z.core.$strip>>;
216
+ fdaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
217
+ applicationNumber: z.ZodNullable<z.ZodString>;
218
+ prescriptionClass: z.ZodNullable<z.ZodString>;
219
+ submissionClassCode: z.ZodNullable<z.ZodString>;
220
+ labelDate: z.ZodNullable<z.ZodString>;
221
+ labelUrl: z.ZodNullable<z.ZodString>;
222
+ ndc: z.ZodArray<z.ZodString>;
223
+ splSetId: z.ZodArray<z.ZodString>;
224
+ withdrawalDate: z.ZodNullable<z.ZodString>;
225
+ withdrawalReason: z.ZodNullable<z.ZodString>;
226
+ withdrawalSourceUrl: z.ZodNullable<z.ZodString>;
227
+ }, z.core.$strip>>>;
228
+ emaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
229
+ productNumber: z.ZodNullable<z.ZodString>;
230
+ category: z.ZodNullable<z.ZodString>;
231
+ opinionStatus: z.ZodNullable<z.ZodString>;
232
+ isBiosimilar: z.ZodNullable<z.ZodBoolean>;
233
+ isAdvancedTherapy: z.ZodNullable<z.ZodBoolean>;
234
+ isGenericOrHybrid: z.ZodNullable<z.ZodBoolean>;
235
+ additionalMonitoring: z.ZodNullable<z.ZodBoolean>;
236
+ pharmacotherapeuticGroup: z.ZodNullable<z.ZodString>;
237
+ patientSafety: z.ZodNullable<z.ZodString>;
238
+ latestProcedure: z.ZodNullable<z.ZodString>;
239
+ revisionNumber: z.ZodNullable<z.ZodNumber>;
240
+ smpcUrl: z.ZodNullable<z.ZodString>;
241
+ smpcDate: z.ZodNullable<z.ZodString>;
242
+ opinionAdoptedDate: z.ZodNullable<z.ZodString>;
243
+ europeanCommissionDecisionDate: z.ZodNullable<z.ZodString>;
244
+ withdrawalOfApplicationDate: z.ZodNullable<z.ZodString>;
245
+ refusalOfMarketingAuthorisationDate: z.ZodNullable<z.ZodString>;
246
+ withdrawalExpiryRevocationLapseDate: z.ZodNullable<z.ZodString>;
247
+ firstPublishedDate: z.ZodNullable<z.ZodString>;
248
+ }, z.core.$strip>>>;
249
+ documentSections: z.ZodArray<z.ZodObject<{
250
+ documentSectionId: z.ZodString;
251
+ amassId: z.ZodString;
252
+ docType: z.ZodString;
253
+ path: z.ZodNullable<z.ZodString>;
254
+ title: z.ZodNullable<z.ZodString>;
255
+ textType: z.ZodNullable<z.ZodString>;
256
+ sourceUrl: z.ZodNullable<z.ZodString>;
257
+ sourceDate: z.ZodNullable<z.ZodString>;
258
+ matchedText: z.ZodNullable<z.ZodString>;
259
+ }, z.core.$strip>>;
260
+ }, z.core.$strip>>;
261
+ }, z.core.$strip>;
262
+ export declare const RegulatoryRecordResponseSchema: z.ZodObject<{
263
+ data: z.ZodObject<{
264
+ amassId: z.ZodString;
265
+ agency: z.ZodString;
266
+ name: z.ZodNullable<z.ZodString>;
267
+ activeSubstance: z.ZodNullable<z.ZodString>;
268
+ moleculeType: z.ZodNullable<z.ZodString>;
269
+ authorizationStatus: z.ZodNullable<z.ZodString>;
270
+ procedureType: z.ZodNullable<z.ZodString>;
271
+ therapeuticIndication: z.ZodNullable<z.ZodString>;
272
+ marketingAuthorisationHolder: z.ZodNullable<z.ZodString>;
273
+ authorizationDate: z.ZodNullable<z.ZodString>;
274
+ firstAuthorizationDate: z.ZodNullable<z.ZodString>;
275
+ sourceUrl: z.ZodNullable<z.ZodString>;
276
+ isOrphan: z.ZodNullable<z.ZodBoolean>;
277
+ designations: z.ZodArray<z.ZodObject<{
278
+ axis: z.ZodString;
279
+ type: z.ZodString;
280
+ agency: z.ZodString;
281
+ nativeName: z.ZodNullable<z.ZodString>;
282
+ basis: z.ZodNullable<z.ZodString>;
283
+ indication: z.ZodNullable<z.ZodString>;
284
+ postMarketingObligation: z.ZodNullable<z.ZodBoolean>;
285
+ }, z.core.$strip>>;
286
+ authorizationsByAgency: z.ZodArray<z.ZodObject<{
287
+ amassId: z.ZodString;
288
+ agency: z.ZodString;
289
+ name: z.ZodNullable<z.ZodString>;
290
+ authorizationStatus: z.ZodNullable<z.ZodString>;
291
+ }, z.core.$strip>>;
292
+ fdaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
293
+ applicationNumber: z.ZodNullable<z.ZodString>;
294
+ prescriptionClass: z.ZodNullable<z.ZodString>;
295
+ submissionClassCode: z.ZodNullable<z.ZodString>;
296
+ labelDate: z.ZodNullable<z.ZodString>;
297
+ labelUrl: z.ZodNullable<z.ZodString>;
298
+ ndc: z.ZodArray<z.ZodString>;
299
+ splSetId: z.ZodArray<z.ZodString>;
300
+ withdrawalDate: z.ZodNullable<z.ZodString>;
301
+ withdrawalReason: z.ZodNullable<z.ZodString>;
302
+ withdrawalSourceUrl: z.ZodNullable<z.ZodString>;
303
+ }, z.core.$strip>>>;
304
+ emaDetails: z.ZodOptional<z.ZodNullable<z.ZodObject<{
305
+ productNumber: z.ZodNullable<z.ZodString>;
306
+ category: z.ZodNullable<z.ZodString>;
307
+ opinionStatus: z.ZodNullable<z.ZodString>;
308
+ isBiosimilar: z.ZodNullable<z.ZodBoolean>;
309
+ isAdvancedTherapy: z.ZodNullable<z.ZodBoolean>;
310
+ isGenericOrHybrid: z.ZodNullable<z.ZodBoolean>;
311
+ additionalMonitoring: z.ZodNullable<z.ZodBoolean>;
312
+ pharmacotherapeuticGroup: z.ZodNullable<z.ZodString>;
313
+ patientSafety: z.ZodNullable<z.ZodString>;
314
+ latestProcedure: z.ZodNullable<z.ZodString>;
315
+ revisionNumber: z.ZodNullable<z.ZodNumber>;
316
+ smpcUrl: z.ZodNullable<z.ZodString>;
317
+ smpcDate: z.ZodNullable<z.ZodString>;
318
+ opinionAdoptedDate: z.ZodNullable<z.ZodString>;
319
+ europeanCommissionDecisionDate: z.ZodNullable<z.ZodString>;
320
+ withdrawalOfApplicationDate: z.ZodNullable<z.ZodString>;
321
+ refusalOfMarketingAuthorisationDate: z.ZodNullable<z.ZodString>;
322
+ withdrawalExpiryRevocationLapseDate: z.ZodNullable<z.ZodString>;
323
+ firstPublishedDate: z.ZodNullable<z.ZodString>;
324
+ }, z.core.$strip>>>;
325
+ documentSections: z.ZodArray<z.ZodObject<{
326
+ documentSectionId: z.ZodString;
327
+ amassId: z.ZodString;
328
+ docType: z.ZodString;
329
+ path: z.ZodNullable<z.ZodString>;
330
+ title: z.ZodNullable<z.ZodString>;
331
+ textType: z.ZodNullable<z.ZodString>;
332
+ sourceUrl: z.ZodNullable<z.ZodString>;
333
+ sourceDate: z.ZodNullable<z.ZodString>;
334
+ }, z.core.$strip>>;
335
+ }, z.core.$strip>;
336
+ }, z.core.$strip>;
337
+ export declare const RegulatorySectionResponseSchema: z.ZodObject<{
338
+ data: z.ZodObject<{
339
+ documentSectionId: z.ZodString;
340
+ amassId: z.ZodString;
341
+ docType: z.ZodString;
342
+ path: z.ZodNullable<z.ZodString>;
343
+ title: z.ZodNullable<z.ZodString>;
344
+ textType: z.ZodNullable<z.ZodString>;
345
+ sourceUrl: z.ZodNullable<z.ZodString>;
346
+ sourceDate: z.ZodNullable<z.ZodString>;
347
+ content: z.ZodNullable<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ }, z.core.$strip>;
350
+ type RegulatoryBase = z.infer<typeof RegulatoryBaseSchema>;
351
+ /** The sections of one source document. The document fields appear once, not on every section. */
352
+ export interface SectionGroup<S> {
353
+ readonly docType: string;
354
+ readonly sourceUrl: string | null;
355
+ readonly sourceDate: string | null;
356
+ readonly sections: S[];
357
+ }
358
+ /** One entry of a table of contents. */
359
+ export interface SectionEntry {
360
+ readonly documentSectionId: string;
361
+ readonly path: string | null;
362
+ readonly title: string | null;
363
+ }
364
+ /** One matched section of a search, with the excerpt that drove the match. */
365
+ export interface MatchedSectionEntry extends SectionEntry {
366
+ readonly matchedText: string | null;
367
+ }
368
+ /** The fields of an authorization that both the search and the details answer carry. */
369
+ export interface AuthorizationSummary {
370
+ readonly amassId: string;
371
+ readonly agency: string;
372
+ readonly name: string | null;
373
+ readonly activeSubstance: string | null;
374
+ readonly moleculeType: string | null;
375
+ readonly authorizationStatus: string | null;
376
+ readonly procedureType: string | null;
377
+ readonly therapeuticIndication: string | null;
378
+ readonly marketingAuthorisationHolder: string | null;
379
+ readonly authorizationDate: string | null;
380
+ readonly firstAuthorizationDate: string | null;
381
+ readonly isOrphan: boolean | null;
382
+ readonly designations: RegulatoryBase["designations"];
383
+ readonly otherAuthorizations: RegulatoryBase["authorizationsByAgency"];
384
+ readonly sourceUrl: string | null;
385
+ }
386
+ /** The matched sections that a search row keeps. The count still reports all of them. */
387
+ export declare const MAX_MATCHED_SECTIONS = 5;
388
+ export interface AuthorizationSearchRow extends AuthorizationSummary {
389
+ readonly matchedSectionCount: number;
390
+ readonly matchedDocuments: SectionGroup<MatchedSectionEntry>[];
391
+ }
392
+ export declare function mapRegulatorySearchRow(record: z.infer<typeof RegulatorySearchResponseSchema>["data"][number]): AuthorizationSearchRow;
393
+ export interface AuthorizationRecord extends AuthorizationSummary {
394
+ readonly fdaDetails: z.infer<typeof FdaDetailsSchema> | null;
395
+ readonly emaDetails: z.infer<typeof EmaDetailsSchema> | null;
396
+ readonly sectionCount: number;
397
+ readonly documents: SectionGroup<SectionEntry>[];
398
+ }
399
+ export declare function mapRegulatoryRecord(record: z.infer<typeof RegulatoryRecordResponseSchema>["data"]): AuthorizationRecord;
400
+ export interface RegulatorySection {
401
+ readonly amassId: string;
402
+ readonly documentSectionId: string;
403
+ readonly docType: string;
404
+ readonly path: string | null;
405
+ readonly title: string | null;
406
+ readonly sourceUrl: string | null;
407
+ readonly sourceDate: string | null;
408
+ readonly content: string | null;
409
+ }
410
+ export interface RegulatorySearchParams {
411
+ readonly query: string;
412
+ readonly limit: number;
413
+ readonly agency?: readonly string[];
414
+ readonly authorizationStatus?: readonly string[];
415
+ readonly moleculeType?: readonly string[];
416
+ readonly hasDesignation?: readonly string[];
417
+ readonly isOrphan?: boolean;
418
+ readonly minAuthorizationDate?: string;
419
+ readonly maxAuthorizationDate?: string;
420
+ readonly amassId?: string;
421
+ }
422
+ export declare function searchRegulatoryRecords(params: RegulatorySearchParams, headers: Record<string, string>): ResultAsync<AuthorizationSearchRow[], AmassError>;
423
+ /** One authorization with its table of contents, or `null` when Amass holds no such ID. */
424
+ export declare function getRegulatoryRecord(amassId: string, headers: Record<string, string>): ResultAsync<AuthorizationRecord | null, AmassError>;
425
+ /** The full text of one document section, or `null` when Amass holds no such section. */
426
+ export declare function getRegulatorySection(amassId: string, documentSectionId: string, headers: Record<string, string>): ResultAsync<RegulatorySection | null, AmassError>;
427
+ /** The identifiers that the RegulatoryCore lookup accepts. Exactly one is set. */
428
+ export interface RegulatoryIdentifier {
429
+ readonly fdaApplicationNumber?: string;
430
+ readonly emaProductNumber?: string;
431
+ readonly ndc?: string;
432
+ readonly splSetId?: string;
433
+ }
434
+ export declare function regulatoryLookupItems(id: RegulatoryIdentifier): LookupItem[];
435
+ export declare function lookupRegulatoryIds(id: RegulatoryIdentifier, headers: Record<string, string>): ResultAsync<string[], AmassError>;
436
+ declare const PatentBaseSchema: z.ZodObject<{
437
+ amassId: z.ZodString;
438
+ publicationNumber: z.ZodNullable<z.ZodString>;
439
+ url: z.ZodNullable<z.ZodString>;
440
+ applicationNumber: z.ZodNullable<z.ZodString>;
441
+ countryCode: z.ZodNullable<z.ZodString>;
442
+ kindCode: z.ZodNullable<z.ZodString>;
443
+ familyId: z.ZodNullable<z.ZodString>;
444
+ familyMembers: z.ZodArray<z.ZodString>;
445
+ title: z.ZodNullable<z.ZodString>;
446
+ abstract: z.ZodNullable<z.ZodString>;
447
+ language: z.ZodNullable<z.ZodString>;
448
+ nonEnglishFallback: z.ZodNullable<z.ZodBoolean>;
449
+ cpcCodes: z.ZodArray<z.ZodString>;
450
+ inventors: z.ZodArray<z.ZodString>;
451
+ assignees: z.ZodArray<z.ZodString>;
452
+ publicationDate: z.ZodNullable<z.ZodString>;
453
+ filingDate: z.ZodNullable<z.ZodString>;
454
+ grantDate: z.ZodNullable<z.ZodString>;
455
+ priorityDate: z.ZodNullable<z.ZodString>;
456
+ citedPatents: z.ZodArray<z.ZodString>;
457
+ hasClaims: z.ZodNullable<z.ZodBoolean>;
458
+ hasDescription: z.ZodNullable<z.ZodBoolean>;
459
+ nplCount: z.ZodNullable<z.ZodNumber>;
460
+ citedByCount: z.ZodNullable<z.ZodNumber>;
461
+ claims: z.ZodOptional<z.ZodNullable<z.ZodString>>;
462
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
463
+ }, z.core.$strip>;
464
+ export declare const PatentSearchResponseSchema: z.ZodObject<{
465
+ data: z.ZodArray<z.ZodObject<{
466
+ amassId: z.ZodString;
467
+ publicationNumber: z.ZodNullable<z.ZodString>;
468
+ url: z.ZodNullable<z.ZodString>;
469
+ applicationNumber: z.ZodNullable<z.ZodString>;
470
+ countryCode: z.ZodNullable<z.ZodString>;
471
+ kindCode: z.ZodNullable<z.ZodString>;
472
+ familyId: z.ZodNullable<z.ZodString>;
473
+ familyMembers: z.ZodArray<z.ZodString>;
474
+ title: z.ZodNullable<z.ZodString>;
475
+ abstract: z.ZodNullable<z.ZodString>;
476
+ language: z.ZodNullable<z.ZodString>;
477
+ nonEnglishFallback: z.ZodNullable<z.ZodBoolean>;
478
+ cpcCodes: z.ZodArray<z.ZodString>;
479
+ inventors: z.ZodArray<z.ZodString>;
480
+ assignees: z.ZodArray<z.ZodString>;
481
+ publicationDate: z.ZodNullable<z.ZodString>;
482
+ filingDate: z.ZodNullable<z.ZodString>;
483
+ grantDate: z.ZodNullable<z.ZodString>;
484
+ priorityDate: z.ZodNullable<z.ZodString>;
485
+ citedPatents: z.ZodArray<z.ZodString>;
486
+ hasClaims: z.ZodNullable<z.ZodBoolean>;
487
+ hasDescription: z.ZodNullable<z.ZodBoolean>;
488
+ nplCount: z.ZodNullable<z.ZodNumber>;
489
+ citedByCount: z.ZodNullable<z.ZodNumber>;
490
+ claims: z.ZodOptional<z.ZodNullable<z.ZodString>>;
491
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
492
+ }, z.core.$strip>>;
493
+ }, z.core.$strip>;
494
+ export declare const PatentRecordResponseSchema: z.ZodObject<{
495
+ data: z.ZodObject<{
496
+ amassId: z.ZodString;
497
+ publicationNumber: z.ZodNullable<z.ZodString>;
498
+ url: z.ZodNullable<z.ZodString>;
499
+ applicationNumber: z.ZodNullable<z.ZodString>;
500
+ countryCode: z.ZodNullable<z.ZodString>;
501
+ kindCode: z.ZodNullable<z.ZodString>;
502
+ familyId: z.ZodNullable<z.ZodString>;
503
+ familyMembers: z.ZodArray<z.ZodString>;
504
+ title: z.ZodNullable<z.ZodString>;
505
+ abstract: z.ZodNullable<z.ZodString>;
506
+ language: z.ZodNullable<z.ZodString>;
507
+ nonEnglishFallback: z.ZodNullable<z.ZodBoolean>;
508
+ cpcCodes: z.ZodArray<z.ZodString>;
509
+ inventors: z.ZodArray<z.ZodString>;
510
+ assignees: z.ZodArray<z.ZodString>;
511
+ publicationDate: z.ZodNullable<z.ZodString>;
512
+ filingDate: z.ZodNullable<z.ZodString>;
513
+ grantDate: z.ZodNullable<z.ZodString>;
514
+ priorityDate: z.ZodNullable<z.ZodString>;
515
+ citedPatents: z.ZodArray<z.ZodString>;
516
+ hasClaims: z.ZodNullable<z.ZodBoolean>;
517
+ hasDescription: z.ZodNullable<z.ZodBoolean>;
518
+ nplCount: z.ZodNullable<z.ZodNumber>;
519
+ citedByCount: z.ZodNullable<z.ZodNumber>;
520
+ claims: z.ZodOptional<z.ZodNullable<z.ZodString>>;
521
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
522
+ }, z.core.$strip>;
523
+ }, z.core.$strip>;
524
+ type PatentBase = z.infer<typeof PatentBaseSchema>;
525
+ /** A patent with its citation counts. The citation lists stay out: a cited patent can carry thousands. */
526
+ export interface PatentSummary {
527
+ readonly amassId: string;
528
+ readonly publicationNumber: string | null;
529
+ readonly applicationNumber: string | null;
530
+ readonly countryCode: string | null;
531
+ readonly kindCode: string | null;
532
+ readonly familyId: string | null;
533
+ readonly familyMemberCount: number;
534
+ readonly title: string | null;
535
+ readonly abstract: string | null;
536
+ readonly assignees: string[];
537
+ readonly inventors: string[];
538
+ readonly cpcCodes: string[];
539
+ readonly publicationDate: string | null;
540
+ readonly filingDate: string | null;
541
+ readonly grantDate: string | null;
542
+ readonly priorityDate: string | null;
543
+ readonly citedPatentCount: number;
544
+ readonly citedByCount: number | null;
545
+ readonly nplCount: number | null;
546
+ readonly hasClaims: boolean | null;
547
+ readonly hasDescription: boolean | null;
548
+ readonly url: string | null;
549
+ }
550
+ export declare function mapPatentSummary(record: PatentBase): PatentSummary;
551
+ export interface PatentRecord extends PatentSummary {
552
+ readonly familyMembers: string[];
553
+ readonly language: string | null;
554
+ readonly nonEnglishFallback: boolean | null;
555
+ readonly claims?: string | null;
556
+ readonly description?: string | null;
557
+ }
558
+ export declare function mapPatentRecord(record: PatentBase): PatentRecord;
559
+ export interface PatentSearchParams {
560
+ readonly query: string;
561
+ readonly limit: number;
562
+ readonly assignee?: readonly string[];
563
+ readonly inventor?: string;
564
+ readonly cpcCodes?: readonly string[];
565
+ readonly countryCode?: readonly string[];
566
+ readonly minPublicationDate?: string;
567
+ readonly maxPublicationDate?: string;
568
+ readonly minFilingDate?: string;
569
+ readonly maxFilingDate?: string;
570
+ readonly minPriorityDate?: string;
571
+ readonly maxPriorityDate?: string;
572
+ readonly minGrantDate?: string;
573
+ readonly maxGrantDate?: string;
574
+ }
575
+ export declare function searchPatentRecords(params: PatentSearchParams, headers: Record<string, string>): ResultAsync<PatentSummary[], AmassError>;
576
+ export declare function getPatentRecord(amassId: string, include: {
577
+ readonly claims: boolean;
578
+ readonly description: boolean;
579
+ }, headers: Record<string, string>): ResultAsync<PatentRecord | null, AmassError>;
580
+ /** The identifiers that the PatentCore lookup accepts. Exactly one is set. */
581
+ export interface PatentIdentifier {
582
+ readonly publicationNumber?: string;
583
+ readonly applicationNumber?: string;
584
+ }
585
+ export declare function lookupPatentIds(id: PatentIdentifier, headers: Record<string, string>): ResultAsync<string[], AmassError>;
586
+ export {};