@dossier-wiki/cloud-sdk 0.1.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/README.md +88 -0
- package/dist/api.d.ts +529 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +22 -0
- package/dist/api.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/service.d.ts +39 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +150 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +101 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +49 -0
- package/dist/types.js.map +1 -0
- package/dist/webhooks.d.ts +34 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +90 -0
- package/dist/webhooks.js.map +1 -0
- package/docs/REFERENCE.md +114 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @dossier-wiki/cloud-sdk
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the [Dossiers Cloud API](https://api.dossiers.wiki) — sanctions search, high-risk dossier search, screening requests, KYC sessions, document processing, and webhook handling.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @dossier-wiki/cloud-sdk
|
|
9
|
+
# or
|
|
10
|
+
bun add @dossier-wiki/cloud-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { DossiersAPIService } from '@dossier-wiki/cloud-sdk';
|
|
17
|
+
|
|
18
|
+
const dossiers = new DossiersAPIService({
|
|
19
|
+
apiKey: process.env.DOSSIERS_API_KEY!,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const hits = await dossiers.searchSanctions({
|
|
23
|
+
name: 'Acme Holdings',
|
|
24
|
+
threshold: 0.8,
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Webhooks
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import {
|
|
32
|
+
DossiersWebhookRouter,
|
|
33
|
+
DossiersWebhookEventTypes,
|
|
34
|
+
} from '@dossier-wiki/cloud-sdk';
|
|
35
|
+
|
|
36
|
+
const router = new DossiersWebhookRouter(process.env.DOSSIERS_WEBHOOK_SECRET!);
|
|
37
|
+
|
|
38
|
+
router.on(
|
|
39
|
+
DossiersWebhookEventTypes.DOCUMENT_VERIFICATION_INSTANCE_UPDATED,
|
|
40
|
+
async ({ data }) => {
|
|
41
|
+
if (data.status === 'completed') {
|
|
42
|
+
// ... handle completion
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// In any Fetch-API server (Hono, Bun.serve, Cloudflare Workers, etc.):
|
|
48
|
+
export default {
|
|
49
|
+
fetch: (req: Request) => router.handle(req),
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The router verifies the `x-webhook-signature` header (HMAC-SHA256 of the raw body) using the secret you pass to the constructor. Invalid signatures get a `401`; unhandled event types return `200 ok` so Dossiers does not retry.
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
new DossiersAPIService({
|
|
59
|
+
apiKey: '...', // required — issued in the Dossiers dashboard
|
|
60
|
+
baseUrl: '...', // optional — defaults to https://api.dossiers.wiki
|
|
61
|
+
fetch: customFetch, // optional — inject a fetch implementation (e.g. for testing)
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Error handling
|
|
66
|
+
|
|
67
|
+
All non-2xx responses throw `DossiersAPIError`:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { DossiersAPIError } from '@dossier-wiki/cloud-sdk';
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
await dossiers.getKycSession('missing-id');
|
|
74
|
+
} catch (err) {
|
|
75
|
+
if (err instanceof DossiersAPIError) {
|
|
76
|
+
console.log(err.status); // HTTP status
|
|
77
|
+
console.log(err.body); // parsed JSON or raw text
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## API reference
|
|
83
|
+
|
|
84
|
+
See [docs/REFERENCE.md](./docs/REFERENCE.md) for the full method list.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
export interface FileInput {
|
|
2
|
+
/** Base64 encoded file data (required if `url` is not provided). */
|
|
3
|
+
base64Data?: string;
|
|
4
|
+
/** URL to fetch the file from (required if `base64Data` is not provided). */
|
|
5
|
+
url?: string;
|
|
6
|
+
/** MIME type of the file (e.g. `image/jpeg`, `application/pdf`). */
|
|
7
|
+
mimeType: string;
|
|
8
|
+
/** Original filename. */
|
|
9
|
+
filename?: string;
|
|
10
|
+
}
|
|
11
|
+
export type SanctionSource = 'CASL' | 'dfat' | 'fcdo' | 'interpol' | 'ofac' | 'un';
|
|
12
|
+
export interface SanctionSearchInput {
|
|
13
|
+
/** Full name of the individual to search for. */
|
|
14
|
+
fullName: string;
|
|
15
|
+
/** Filter by specific sanctions sources. If omitted, all sources are searched. */
|
|
16
|
+
sources?: SanctionSource[];
|
|
17
|
+
/** ISO 3166-1 alpha-2 country codes to narrow results. */
|
|
18
|
+
countries?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Identification document numbers (NIC, passport, etc.) to match against any
|
|
21
|
+
* ID on a record. Matching is case-insensitive and substring-based.
|
|
22
|
+
*/
|
|
23
|
+
idNumbers?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface IdDocument {
|
|
26
|
+
/** Document type (e.g. `passport`, `national_id`). */
|
|
27
|
+
documentType?: string;
|
|
28
|
+
/** ISO 3166-1 alpha-2 country code of issuance. */
|
|
29
|
+
countryOfIssue?: string;
|
|
30
|
+
/** Document number or identifier. */
|
|
31
|
+
idNumber?: string;
|
|
32
|
+
/** Date of issue (format varies by source). */
|
|
33
|
+
dateOfIssue?: string;
|
|
34
|
+
/** Date of expiry (format varies by source). */
|
|
35
|
+
dateOfExpiry?: string;
|
|
36
|
+
/** Free-form supplementary details from the source list. */
|
|
37
|
+
additionalInfo?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Sanction {
|
|
40
|
+
/** Subject classification (e.g. `individual`, `entity`). */
|
|
41
|
+
entityType: string;
|
|
42
|
+
/** Primary name as published on the sanctions list. */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Honorifics or titles (e.g. `Mr.`, `Dr.`). */
|
|
45
|
+
titles?: string[];
|
|
46
|
+
/** Official designations (e.g. `Minister`, `General`). */
|
|
47
|
+
designations?: string[];
|
|
48
|
+
/** Dates of birth as published — may include multiple entries when sources disagree. */
|
|
49
|
+
dateOfBirth?: string[];
|
|
50
|
+
/** Places of birth as published. */
|
|
51
|
+
placeOfBirth?: string[];
|
|
52
|
+
/** Free-form remarks from the source list. */
|
|
53
|
+
comments?: string;
|
|
54
|
+
identificationDocuments?: IdDocument[];
|
|
55
|
+
/** Addresses as published. */
|
|
56
|
+
address?: string[];
|
|
57
|
+
/** Date the subject was first listed on the source. */
|
|
58
|
+
listedDate?: string;
|
|
59
|
+
/** Sanctions program codes (e.g. `SDGT`, `Security Council Resolution 1267`). */
|
|
60
|
+
sanctionsProgramme: string[];
|
|
61
|
+
/** Citizenship(s) as published. */
|
|
62
|
+
citizenship?: string[];
|
|
63
|
+
aliases?: string[];
|
|
64
|
+
/** Nationality as published. */
|
|
65
|
+
nationality?: string;
|
|
66
|
+
/** Associated countries (ISO 3166-1 alpha-2 where available). */
|
|
67
|
+
country?: string[];
|
|
68
|
+
/** URLs of associated images. */
|
|
69
|
+
image?: string[];
|
|
70
|
+
/** Originating sanctions list. */
|
|
71
|
+
source: SanctionSource;
|
|
72
|
+
/** External ID from the originating source. */
|
|
73
|
+
extId: string;
|
|
74
|
+
/** Source-specific extra fields not modeled above. */
|
|
75
|
+
additionalData?: Record<string, unknown>;
|
|
76
|
+
/** Verbatim original record from the source, when retained. */
|
|
77
|
+
originalData?: string;
|
|
78
|
+
/** Pagination cursor returned by the upstream search engine. */
|
|
79
|
+
sort?: [number, number];
|
|
80
|
+
}
|
|
81
|
+
/** Response from `POST /sanctions/search`. Costs 5 credits per request. */
|
|
82
|
+
export interface SanctionSearchResponse {
|
|
83
|
+
totalHits: number;
|
|
84
|
+
/** Echoed (normalized, lowercased) query terms used for the search. */
|
|
85
|
+
searchingFor: string[];
|
|
86
|
+
documents: Sanction[];
|
|
87
|
+
}
|
|
88
|
+
export interface DossierSearchInput {
|
|
89
|
+
/** Full name of the individual to search for. */
|
|
90
|
+
fullName: string;
|
|
91
|
+
/** When true, bypasses cached results and runs a fresh search. Default: false. */
|
|
92
|
+
noCache?: boolean;
|
|
93
|
+
/** When true, only returns high-risk profiles (PEP, sanctioned, adverse media). Default: true. */
|
|
94
|
+
onlyShowHighRiskProfiles?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface PersonIdentificationDocument {
|
|
97
|
+
/** Document type (e.g. `passport`, `national_id`). */
|
|
98
|
+
type: string;
|
|
99
|
+
/** Document number or identifier. */
|
|
100
|
+
number: string;
|
|
101
|
+
/** Additional details about the document. */
|
|
102
|
+
description: string;
|
|
103
|
+
/** IDs of source documents referencing this identification. */
|
|
104
|
+
referenceDocumentIds: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface AssociatesAndRelatives {
|
|
107
|
+
name: string;
|
|
108
|
+
relationship: string;
|
|
109
|
+
description: string;
|
|
110
|
+
referenceDocumentIds: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface PositionsHeld {
|
|
113
|
+
position: string;
|
|
114
|
+
organization: string;
|
|
115
|
+
period: string;
|
|
116
|
+
description: string;
|
|
117
|
+
asOfDate: string;
|
|
118
|
+
referenceDocumentIds: string[];
|
|
119
|
+
supportingText: string;
|
|
120
|
+
}
|
|
121
|
+
export interface DocumentMatch {
|
|
122
|
+
matchingQueries: string[];
|
|
123
|
+
matchingChunk: string;
|
|
124
|
+
}
|
|
125
|
+
export interface Document {
|
|
126
|
+
id: string;
|
|
127
|
+
originalUrl: string;
|
|
128
|
+
title: string;
|
|
129
|
+
body: string;
|
|
130
|
+
matches: DocumentMatch;
|
|
131
|
+
}
|
|
132
|
+
export interface PEPScorecard {
|
|
133
|
+
/** PEP likelihood score from 0.0 (unlikely) to 1.0 (certain). */
|
|
134
|
+
pepLikelihoodScore: number;
|
|
135
|
+
/** PEP category (e.g. "Head of State", "Senior Government Official"). */
|
|
136
|
+
category: string;
|
|
137
|
+
/** Step-by-step reasoning explaining how the PEP score was derived. */
|
|
138
|
+
reasoningSteps: string[];
|
|
139
|
+
}
|
|
140
|
+
export interface RiskScorecard {
|
|
141
|
+
/** PEP-specific scoring breakdown (present when PEP indicators are found). */
|
|
142
|
+
pepScorecard?: PEPScorecard;
|
|
143
|
+
/** Overall risk score from 0.0 (low risk) to 1.0 (high risk). */
|
|
144
|
+
overallRiskScore: number;
|
|
145
|
+
/** Narrative explanation of the risk assessment. */
|
|
146
|
+
riskReasoning: string;
|
|
147
|
+
/** Risk category (e.g. `high`, `medium`, `low`). */
|
|
148
|
+
riskCategory: string;
|
|
149
|
+
}
|
|
150
|
+
export interface IndividualDossier {
|
|
151
|
+
id: string;
|
|
152
|
+
fullName: string;
|
|
153
|
+
countries: string[];
|
|
154
|
+
otherNames: string[];
|
|
155
|
+
identificationDocuments: PersonIdentificationDocument[];
|
|
156
|
+
closeAssociatesOrFamilyMembers: AssociatesAndRelatives[];
|
|
157
|
+
dateOfBirth: string[];
|
|
158
|
+
tagline: string;
|
|
159
|
+
locations: string[];
|
|
160
|
+
keywords: string[];
|
|
161
|
+
positionsHeld: PositionsHeld[];
|
|
162
|
+
documentIds?: string[];
|
|
163
|
+
documents?: Document[];
|
|
164
|
+
individualSummary: string;
|
|
165
|
+
riskScorecard?: RiskScorecard;
|
|
166
|
+
cachedResult?: boolean;
|
|
167
|
+
/** ISO 8601 timestamp. */
|
|
168
|
+
createdAt: string;
|
|
169
|
+
}
|
|
170
|
+
export type DossierSearchResponse = IndividualDossier[];
|
|
171
|
+
export interface IdentificationDocumentInput {
|
|
172
|
+
/** Document type (e.g. `passport`, `national_id`, `drivers_license`). */
|
|
173
|
+
type?: string;
|
|
174
|
+
/** Document number or identifier. */
|
|
175
|
+
number?: string;
|
|
176
|
+
/** ISO 3166-1 alpha-2 country code of the issuing country. */
|
|
177
|
+
country?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface CreateScreeningRequestDto {
|
|
180
|
+
/** Full name of the individual to screen. */
|
|
181
|
+
fullName: string;
|
|
182
|
+
/** Your own reference ID (e.g. customer ID, case number). */
|
|
183
|
+
externalId?: string;
|
|
184
|
+
/** Identification document details to improve match accuracy. */
|
|
185
|
+
identificationDocument?: IdentificationDocumentInput;
|
|
186
|
+
/** Date of birth in `YYYY-MM-DD` format. */
|
|
187
|
+
dateOfBirth?: string;
|
|
188
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
189
|
+
country?: string;
|
|
190
|
+
}
|
|
191
|
+
export interface CreateScreeningRequestResponseDto {
|
|
192
|
+
/** Unique ID of the created screening request. */
|
|
193
|
+
requestId: string;
|
|
194
|
+
}
|
|
195
|
+
export type KycSessionState = 'home' | 'permission-granting' | 'dv-get-started' | 'dv-document-selection' | 'dv-document-upload' | 'dv-positioning-front' | 'dv-capturing-front' | 'dv-flip-prompt' | 'dv-positioning-back' | 'dv-capturing-back' | 'dv-complete' | 'lv-get-started' | 'lv-initializing' | 'lv-aligning' | 'lv-countdown' | 'lv-complete' | 'lv-timeout';
|
|
196
|
+
export type KycDocumentVerificationStatus = 'pending' | 'running' | 'completed' | 'failed';
|
|
197
|
+
export interface CreateKycSessionDTO {
|
|
198
|
+
/** External reference ID used to correlate the session with your records. */
|
|
199
|
+
externalId?: string;
|
|
200
|
+
/** Session expiry duration in milliseconds. Defaults to 1 hour. */
|
|
201
|
+
expiresInMs?: number;
|
|
202
|
+
/** Customer email — when set alongside `customerName`, an invitation email is sent. */
|
|
203
|
+
customerEmail?: string;
|
|
204
|
+
/** Customer display name, used in the invitation email greeting. */
|
|
205
|
+
customerName?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface KycSessionDataOutputDTO {
|
|
208
|
+
/** Selected country code. */
|
|
209
|
+
country?: string;
|
|
210
|
+
/** Selected document type. */
|
|
211
|
+
documentType?: string;
|
|
212
|
+
/** Document aspect ratio (width / height). */
|
|
213
|
+
documentRatio?: number;
|
|
214
|
+
/** Whether the document has both front and back sides. */
|
|
215
|
+
isDoubleSided?: boolean;
|
|
216
|
+
}
|
|
217
|
+
export interface KycDocumentVerificationDTO {
|
|
218
|
+
instanceId: string;
|
|
219
|
+
processorId: string;
|
|
220
|
+
status: KycDocumentVerificationStatus;
|
|
221
|
+
statusLabel?: string | null;
|
|
222
|
+
documentTypeId?: string | null;
|
|
223
|
+
/** Unix ms when verification was triggered. */
|
|
224
|
+
triggeredAt: number;
|
|
225
|
+
/** Unix ms when verification completed; `null` while in progress. */
|
|
226
|
+
completedAt?: number | null;
|
|
227
|
+
error?: string | null;
|
|
228
|
+
/** Full processing result (validation, extraction, post-processing). */
|
|
229
|
+
result?: Record<string, unknown> | null;
|
|
230
|
+
/** Per-stage progress entries. */
|
|
231
|
+
stageProgress?: string[] | null;
|
|
232
|
+
/** Chronological processing log with timestamps. */
|
|
233
|
+
processingLog?: string[] | null;
|
|
234
|
+
/** References to original, cropped, and detected face images. */
|
|
235
|
+
files?: string[] | null;
|
|
236
|
+
}
|
|
237
|
+
export interface KycFaceVerificationDTO {
|
|
238
|
+
/** Whether the face on the document matches the liveness frame. */
|
|
239
|
+
verified: boolean;
|
|
240
|
+
/** Distance between the two face embeddings (lower = more similar). */
|
|
241
|
+
distance: number;
|
|
242
|
+
/** Distance threshold used for the verification decision. */
|
|
243
|
+
threshold: number;
|
|
244
|
+
/** Face recognition model used. */
|
|
245
|
+
model: string;
|
|
246
|
+
/** Unix ms when the verification was performed. */
|
|
247
|
+
performedAt: number;
|
|
248
|
+
error?: string | null;
|
|
249
|
+
}
|
|
250
|
+
export interface KycSessionOutputDTO {
|
|
251
|
+
id: string;
|
|
252
|
+
organizationId: string;
|
|
253
|
+
externalId?: string;
|
|
254
|
+
customerName?: string;
|
|
255
|
+
customerEmail?: string;
|
|
256
|
+
state: KycSessionState;
|
|
257
|
+
data: KycSessionDataOutputDTO;
|
|
258
|
+
isInvalid: boolean;
|
|
259
|
+
isComplete: boolean;
|
|
260
|
+
/** Unix ms. */
|
|
261
|
+
createdAt: number;
|
|
262
|
+
/** Unix ms. `null` after completion. */
|
|
263
|
+
expiresAt?: number | null;
|
|
264
|
+
/** Unix ms. `null` if not yet completed. */
|
|
265
|
+
completedAt?: number | null;
|
|
266
|
+
documentVerification?: KycDocumentVerificationDTO | null;
|
|
267
|
+
faceVerification?: KycFaceVerificationDTO | null;
|
|
268
|
+
}
|
|
269
|
+
export interface CreateKycSessionOutputDTO {
|
|
270
|
+
session: KycSessionOutputDTO;
|
|
271
|
+
/** Short-lived JWT token for customer access to the session. */
|
|
272
|
+
token: string;
|
|
273
|
+
/** Full URL the customer should visit to complete KYC verification. */
|
|
274
|
+
sessionUrl: string;
|
|
275
|
+
}
|
|
276
|
+
export interface DateRange {
|
|
277
|
+
/** ISO 8601 start (inclusive). */
|
|
278
|
+
start?: string;
|
|
279
|
+
/** ISO 8601 end (inclusive). */
|
|
280
|
+
end?: string;
|
|
281
|
+
}
|
|
282
|
+
export interface KycSessionFiltersDTO {
|
|
283
|
+
/** Free-text search across session ID, external ID, customer name, and email. */
|
|
284
|
+
searchQuery?: string;
|
|
285
|
+
state?: KycSessionState;
|
|
286
|
+
isComplete?: boolean;
|
|
287
|
+
isInvalid?: boolean;
|
|
288
|
+
createdAt?: DateRange;
|
|
289
|
+
sortBy?: 'createdAt' | 'expiresAt' | 'completedAt';
|
|
290
|
+
sortOrder?: 'asc' | 'desc';
|
|
291
|
+
/** 1–100, default 50. */
|
|
292
|
+
limit?: number;
|
|
293
|
+
/** Default 0. */
|
|
294
|
+
offset?: number;
|
|
295
|
+
}
|
|
296
|
+
export interface PaginatedKycSessionsDTO {
|
|
297
|
+
sessions: KycSessionOutputDTO[];
|
|
298
|
+
/** Total before pagination. */
|
|
299
|
+
totalCount: number;
|
|
300
|
+
}
|
|
301
|
+
export interface DeleteSessionOutputDTO {
|
|
302
|
+
success: boolean;
|
|
303
|
+
}
|
|
304
|
+
export type DocumentProcessorId = 'INVOICE' | 'SRI_LANKA_ID' | 'SRI_LANKA_FORM1_COMPANY_REGISTRATION' | 'SRI_LANKA_FORM15_ANNUAL_RETURN';
|
|
305
|
+
export type DocumentProcessingInstanceStatus = 'pending' | 'running' | 'completed' | 'failed' | 'error';
|
|
306
|
+
/**
|
|
307
|
+
* Optional key-value context passed to the AI for cross-checking extracted
|
|
308
|
+
* fields against known values.
|
|
309
|
+
*
|
|
310
|
+
* INVOICE: `expectedVendor`, `expectedAmount`
|
|
311
|
+
* SRI_LANKA_ID: `name`, `dateOfBirth` (YYYY-MM-DD), `idNumber`, `address`
|
|
312
|
+
*/
|
|
313
|
+
export type DocumentProcessingInputData = Record<string, string | number | boolean | null>;
|
|
314
|
+
/**
|
|
315
|
+
* Open key/value bag stored on a document processing instance. Persisted as
|
|
316
|
+
* provided on the input and echoed back on every response shape. Not sent to
|
|
317
|
+
* the AI — useful for syncing with external systems (e.g. customer IDs).
|
|
318
|
+
*
|
|
319
|
+
* Example: `{ externalCustomerId: "testing-123" }`
|
|
320
|
+
*/
|
|
321
|
+
export type DocumentProcessingMetadata = Record<string, unknown>;
|
|
322
|
+
export interface InitiateDocumentProcessingInput {
|
|
323
|
+
processorId: DocumentProcessorId;
|
|
324
|
+
files: FileInput[];
|
|
325
|
+
/** Cross-check context for the AI (per-processor keys; see `DocumentProcessingInputData`). */
|
|
326
|
+
inputData?: DocumentProcessingInputData;
|
|
327
|
+
/** Arbitrary metadata stored on the instance but not sent to the AI. */
|
|
328
|
+
metadata?: DocumentProcessingMetadata;
|
|
329
|
+
/** Default `true`. Crop document images before validation/extraction. */
|
|
330
|
+
shouldCropImages?: boolean;
|
|
331
|
+
/** Default `true`. When `false`, the request waits for processing to finish. */
|
|
332
|
+
backgroundProcessing?: boolean;
|
|
333
|
+
}
|
|
334
|
+
export interface ListDocumentProcessingInstancesQuery {
|
|
335
|
+
processorId?: string;
|
|
336
|
+
status?: DocumentProcessingInstanceStatus;
|
|
337
|
+
limit?: number;
|
|
338
|
+
offset?: number;
|
|
339
|
+
includeFileUrls?: boolean;
|
|
340
|
+
}
|
|
341
|
+
/** Stage IDs emitted by the standard document processing pipeline. */
|
|
342
|
+
export type DocumentProcessingStageId = 'crop_and_detect_faces' | 'pre_validate_and_extract' | 'post_validation' | (string & {});
|
|
343
|
+
export type DocumentProcessingStageStatus = 'pending' | 'running' | 'success' | 'completed' | 'failed';
|
|
344
|
+
export interface DocumentProcessingFileObject {
|
|
345
|
+
/** Storage key for the file. */
|
|
346
|
+
key: string;
|
|
347
|
+
filename: string;
|
|
348
|
+
mimeType: string;
|
|
349
|
+
/** File size in bytes. */
|
|
350
|
+
size: number;
|
|
351
|
+
/** Signed URL with ~5-minute expiry. */
|
|
352
|
+
url: string;
|
|
353
|
+
/** ISO 8601 expiry of `url`. */
|
|
354
|
+
urlExpiresAt?: string;
|
|
355
|
+
/** ISO 8601 upload timestamp. */
|
|
356
|
+
uploadedAt?: string;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* One uploaded source document. The processor cropped each image (when crop
|
|
360
|
+
* is enabled) and ran face detection — both surfaced as separate variants.
|
|
361
|
+
*/
|
|
362
|
+
export interface DocumentProcessingFile {
|
|
363
|
+
/** Reference to the original uploaded file. Always present. */
|
|
364
|
+
original: DocumentProcessingFileObject;
|
|
365
|
+
/** Reference to the cropped variant. Absent when cropping was skipped. */
|
|
366
|
+
cropped?: DocumentProcessingFileObject;
|
|
367
|
+
/** Faces detected on the document, one entry per face. */
|
|
368
|
+
detectedFaces?: DocumentProcessingFileObject[];
|
|
369
|
+
}
|
|
370
|
+
export interface DocumentProcessingValidationRule {
|
|
371
|
+
id: string;
|
|
372
|
+
confidence: number;
|
|
373
|
+
errorLevel?: string;
|
|
374
|
+
}
|
|
375
|
+
export interface DocumentProcessingValidation {
|
|
376
|
+
status: string;
|
|
377
|
+
passed: boolean;
|
|
378
|
+
reasoning: string;
|
|
379
|
+
rulesPassed: DocumentProcessingValidationRule[];
|
|
380
|
+
rulesFailed?: DocumentProcessingValidationRule[];
|
|
381
|
+
rulesIgnored?: DocumentProcessingValidationRule[];
|
|
382
|
+
userErrorMessages?: string[];
|
|
383
|
+
}
|
|
384
|
+
export interface DocumentProcessingExtractedField<T = unknown> {
|
|
385
|
+
value: T;
|
|
386
|
+
originalText?: string;
|
|
387
|
+
originalTextLanguage?: string;
|
|
388
|
+
/** 0–1 confidence score. */
|
|
389
|
+
originalTextConfidence?: number;
|
|
390
|
+
isOriginalTextHandwritten?: boolean;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Multilingual variant — emitted for fields like `name`, `address`, `placeOfBirth`
|
|
394
|
+
* on documents printed in multiple scripts (e.g. LKA NIC in Sinhala/Tamil/English).
|
|
395
|
+
*/
|
|
396
|
+
export interface DocumentProcessingTransliteratedField {
|
|
397
|
+
enTransliterations: Array<{
|
|
398
|
+
transliteratedText: string;
|
|
399
|
+
confidence?: number;
|
|
400
|
+
}>;
|
|
401
|
+
originalTexts: Array<{
|
|
402
|
+
originalText: string;
|
|
403
|
+
/** ISO 639-3 code (e.g. `sin`, `tam`, `eng`). */
|
|
404
|
+
originalTextLanguage: string;
|
|
405
|
+
isOriginalTextHandwritten?: boolean;
|
|
406
|
+
originalTextConfidence?: number;
|
|
407
|
+
}>;
|
|
408
|
+
}
|
|
409
|
+
export type DocumentProcessingSchemaField = DocumentProcessingExtractedField | DocumentProcessingTransliteratedField;
|
|
410
|
+
/** Extracted document schema is processor-specific; default to a permissive map. */
|
|
411
|
+
export type DocumentProcessingExtractedSchema = Record<string, DocumentProcessingSchemaField>;
|
|
412
|
+
export interface DocumentProcessingPostProcessingRuleResult {
|
|
413
|
+
id: string;
|
|
414
|
+
passed: boolean;
|
|
415
|
+
confidence: number;
|
|
416
|
+
errorLevel: string;
|
|
417
|
+
message?: string;
|
|
418
|
+
}
|
|
419
|
+
export interface DocumentProcessingSchemaModification {
|
|
420
|
+
field: string;
|
|
421
|
+
value: unknown;
|
|
422
|
+
source: string;
|
|
423
|
+
sourceDescription: string;
|
|
424
|
+
}
|
|
425
|
+
export interface DocumentProcessingPostProcessing {
|
|
426
|
+
passed: boolean;
|
|
427
|
+
ruleResults: DocumentProcessingPostProcessingRuleResult[];
|
|
428
|
+
schemaModifications: DocumentProcessingSchemaModification[];
|
|
429
|
+
}
|
|
430
|
+
export interface DocumentProcessingStageRef {
|
|
431
|
+
stageId: DocumentProcessingStageId;
|
|
432
|
+
status: DocumentProcessingStageStatus;
|
|
433
|
+
}
|
|
434
|
+
export interface DocumentProcessingResult<TSchema extends DocumentProcessingExtractedSchema = DocumentProcessingExtractedSchema> {
|
|
435
|
+
documentTypeID: string;
|
|
436
|
+
validation: DocumentProcessingValidation;
|
|
437
|
+
extraction: DocumentProcessingValidation;
|
|
438
|
+
schema: TSchema;
|
|
439
|
+
/**
|
|
440
|
+
* Flattened, English-normalised mirror of `schema`. Keys are processor-specific
|
|
441
|
+
* (e.g. `name`, `idNumber`, `nicNumber`, `dateOfBirth`, `issuingCountry`).
|
|
442
|
+
*/
|
|
443
|
+
normalizedData?: Record<string, string | number | null> | null;
|
|
444
|
+
postProcessing: DocumentProcessingPostProcessing;
|
|
445
|
+
stages: DocumentProcessingStageRef[];
|
|
446
|
+
}
|
|
447
|
+
/** Subject (extracted name/identifier) surfaced on the list endpoint. */
|
|
448
|
+
export interface DocumentProcessingInstanceSubject {
|
|
449
|
+
name: string;
|
|
450
|
+
identifier: string;
|
|
451
|
+
}
|
|
452
|
+
/** Compact instance representation returned by `GET /document-processing`. */
|
|
453
|
+
export interface DocumentProcessingInstanceSummary {
|
|
454
|
+
instanceId: string;
|
|
455
|
+
processorId: string;
|
|
456
|
+
subject?: DocumentProcessingInstanceSubject;
|
|
457
|
+
status: DocumentProcessingInstanceStatus;
|
|
458
|
+
statusLabel: string;
|
|
459
|
+
/** ISO 8601. */
|
|
460
|
+
createdAt: string;
|
|
461
|
+
/** ISO 8601. */
|
|
462
|
+
updatedAt: string;
|
|
463
|
+
/** ISO 8601, null while still processing. */
|
|
464
|
+
completedAt: string | null;
|
|
465
|
+
/** Open key/value bag set at instance creation (e.g. `{ externalCustomerId: "..." }`). */
|
|
466
|
+
metadata?: DocumentProcessingMetadata | null;
|
|
467
|
+
}
|
|
468
|
+
/** Full instance returned by `POST /document-processing` and `GET /document-processing/{id}`. */
|
|
469
|
+
export interface DocumentProcessingInstance<TSchema extends DocumentProcessingExtractedSchema = DocumentProcessingExtractedSchema> {
|
|
470
|
+
instanceId: string;
|
|
471
|
+
processorId: DocumentProcessorId;
|
|
472
|
+
status: DocumentProcessingInstanceStatus;
|
|
473
|
+
statusLabel: string;
|
|
474
|
+
/** ISO 8601. */
|
|
475
|
+
createdAt: string;
|
|
476
|
+
/** ISO 8601. */
|
|
477
|
+
updatedAt: string;
|
|
478
|
+
/** ISO 8601, null while still processing. */
|
|
479
|
+
completedAt?: string | null;
|
|
480
|
+
/** Open key/value bag set at instance creation (e.g. `{ externalCustomerId: "..." }`). */
|
|
481
|
+
metadata?: DocumentProcessingMetadata | null;
|
|
482
|
+
/** Full processing result. Null until processing completes. */
|
|
483
|
+
result: DocumentProcessingResult<TSchema> | null;
|
|
484
|
+
files: DocumentProcessingFile[];
|
|
485
|
+
}
|
|
486
|
+
export interface ListDocumentProcessingInstancesResponse {
|
|
487
|
+
instances: DocumentProcessingInstanceSummary[];
|
|
488
|
+
count: number;
|
|
489
|
+
}
|
|
490
|
+
export interface DocumentProcessingStageData {
|
|
491
|
+
validation: DocumentProcessingValidation;
|
|
492
|
+
extraction: DocumentProcessingValidation;
|
|
493
|
+
schema: DocumentProcessingExtractedSchema;
|
|
494
|
+
}
|
|
495
|
+
export interface DocumentProcessingStageResponse {
|
|
496
|
+
stageId: DocumentProcessingStageId;
|
|
497
|
+
status: DocumentProcessingStageStatus;
|
|
498
|
+
data: DocumentProcessingStageData;
|
|
499
|
+
}
|
|
500
|
+
export interface DocumentProcessingDeleteResponse {
|
|
501
|
+
success: boolean;
|
|
502
|
+
message: string;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Processor descriptor returned by `GET /document-processing/processors`.
|
|
506
|
+
* The exact schema isn't published; we narrow `id` to the known enum and
|
|
507
|
+
* keep additional fields permissive.
|
|
508
|
+
*/
|
|
509
|
+
export interface DocumentProcessorTypeDTO {
|
|
510
|
+
id: DocumentProcessorId;
|
|
511
|
+
label?: string;
|
|
512
|
+
description?: string;
|
|
513
|
+
[key: string]: unknown;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Server-Sent Event payload emitted by `GET /document-processing/{id}/events`.
|
|
517
|
+
* Each event corresponds to a stage starting, completing, or failing.
|
|
518
|
+
*/
|
|
519
|
+
export interface DocumentProcessingEvent {
|
|
520
|
+
instanceId: string;
|
|
521
|
+
stageId: DocumentProcessingStageId;
|
|
522
|
+
status: DocumentProcessingStageStatus;
|
|
523
|
+
/** ISO 8601 timestamp of the stage transition. */
|
|
524
|
+
timestamp?: string;
|
|
525
|
+
error?: string | null;
|
|
526
|
+
/** Stage-specific payload, mirrors `DocumentProcessingStageData` when present. */
|
|
527
|
+
data?: DocumentProcessingStageData | null;
|
|
528
|
+
}
|
|
529
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"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AI,EAAE,2BAA2B,CAAC;CACrC;AAED,MAAM,WAAW,gCAAgC;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,mBAAmB,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,yBAAyB,CAAC;IACnC,MAAM,EAAE,6BAA6B,CAAC;IACtC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kFAAkF;IAClF,IAAI,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;CAC7C"}
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Dossiers REST API types — derived from https://api.dossiers.wiki/api-json
|
|
3
|
+
Base URL: https://api.dossiers.wiki
|
|
4
|
+
|
|
5
|
+
Endpoints:
|
|
6
|
+
POST /sanctions/search searchSanctions
|
|
7
|
+
POST /high-risk/search searchDossiers
|
|
8
|
+
POST /screening/request createScreeningRequest
|
|
9
|
+
POST /kyc-sessions createKycSession
|
|
10
|
+
GET /kyc-sessions listKycSessions
|
|
11
|
+
GET /kyc-sessions/{id} getKycSession
|
|
12
|
+
DELETE /kyc-sessions/{id} deleteKycSession
|
|
13
|
+
POST /document-processing initiateDocumentProcessing
|
|
14
|
+
GET /document-processing listDocumentProcessingInstances
|
|
15
|
+
GET /document-processing/processors listDocumentProcessors
|
|
16
|
+
GET /document-processing/{id} getDocumentProcessingInstance
|
|
17
|
+
GET /document-processing/{id}/stages/{stageId} getDocumentProcessingStage
|
|
18
|
+
GET /document-processing/{id}/events streamDocumentProcessingEvents (SSE)
|
|
19
|
+
DELETE /document-processing/{id} deleteDocumentProcessingInstance
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;EAmBE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './api';
|
|
3
|
+
export { DossiersWebhookRouter } from './webhooks';
|
|
4
|
+
export { DossiersAPIService, DossiersAPIError, DOSSIERS_API_BASE_URL } from './service';
|
|
5
|
+
export type { DossiersAPIServiceOptions } from './service';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACxF,YAAY,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC"}
|