@vigilhq/types 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.
@@ -0,0 +1,153 @@
1
+ export type EntityType = "individual" | "organization" | "vessel" | "aircraft";
2
+ export type ScreeningStatus = "clear" | "match" | "review" | "error";
3
+ export type RiskLevel = "low" | "medium" | "high" | "critical";
4
+ export type Recommendation = "approve" | "review" | "block";
5
+ export type ScreeningContext = "onboarding" | "transaction" | "monitoring";
6
+ export type OrgPlan = "free" | "starter" | "professional" | "business" | "enterprise";
7
+ export type UserRole = "owner" | "admin" | "member";
8
+ export type ApiKeyEnvironment = "live" | "test";
9
+ export type ActorType = "user" | "api_key" | "system";
10
+ export interface ScreenRequest {
11
+ entity: string;
12
+ context?: ScreeningContext;
13
+ entity_type?: EntityType;
14
+ date_of_birth?: string;
15
+ nationality?: string;
16
+ id_number?: string;
17
+ }
18
+ export interface MatchDetail {
19
+ entity_id: string;
20
+ source: string;
21
+ source_entity_id: string;
22
+ matched_name: string;
23
+ entity_type: EntityType;
24
+ score: number;
25
+ programs: string[];
26
+ aliases: string[];
27
+ date_of_birth?: string | null;
28
+ nationality?: string | null;
29
+ match_reasons: string[];
30
+ }
31
+ export interface SanctionsResult {
32
+ match: boolean;
33
+ lists_checked: number;
34
+ last_updated: string;
35
+ }
36
+ export interface PepResult {
37
+ match: boolean;
38
+ }
39
+ export interface ScreenResponse {
40
+ id: string;
41
+ status: ScreeningStatus;
42
+ risk_score: number;
43
+ risk_level: RiskLevel;
44
+ sanctions: SanctionsResult;
45
+ pep: PepResult;
46
+ matches: MatchDetail[];
47
+ recommendation: Recommendation;
48
+ screening_time_ms: number;
49
+ created_at: string;
50
+ narrative?: {
51
+ summary: string;
52
+ detail: string;
53
+ recommendation_text: string;
54
+ /** Full human-readable paragraph for compliance reports and dashboards. */
55
+ full_narrative: string;
56
+ };
57
+ adverse_media?: {
58
+ available: boolean;
59
+ message?: string;
60
+ hits?: unknown[];
61
+ checked_at?: string;
62
+ };
63
+ }
64
+ export interface BatchScreenRequest {
65
+ entities: ScreenRequest[];
66
+ }
67
+ export interface BatchScreenResponse {
68
+ job_id: string;
69
+ status: "queued" | "processing" | "completed" | "failed";
70
+ total: number;
71
+ completed: number;
72
+ results?: ScreenResponse[];
73
+ }
74
+ export interface CreateApiKeyRequest {
75
+ name: string;
76
+ environment?: ApiKeyEnvironment;
77
+ }
78
+ export interface ApiKeyResponse {
79
+ id: string;
80
+ name: string;
81
+ key_prefix: string;
82
+ environment: ApiKeyEnvironment;
83
+ created_at: string;
84
+ last_used_at: string | null;
85
+ revoked_at: string | null;
86
+ }
87
+ export interface ApiKeyCreatedResponse extends ApiKeyResponse {
88
+ key: string;
89
+ }
90
+ export interface WatchlistSourceResponse {
91
+ id: string;
92
+ code: string;
93
+ name: string;
94
+ url: string;
95
+ update_frequency: string | null;
96
+ last_ingested_at: string | null;
97
+ entity_count: number;
98
+ is_active: boolean;
99
+ }
100
+ export interface CreateWebhookRequest {
101
+ url: string;
102
+ events: string[];
103
+ secret?: string;
104
+ }
105
+ export interface WebhookResponse {
106
+ id: string;
107
+ url: string;
108
+ events: string[];
109
+ is_active: boolean;
110
+ created_at: string;
111
+ }
112
+ export interface MonitorEntityRequest {
113
+ entity: string;
114
+ entity_type?: EntityType;
115
+ metadata?: Record<string, unknown>;
116
+ }
117
+ export interface MonitoredEntityResponse {
118
+ id: string;
119
+ entity: string;
120
+ entity_type: EntityType | null;
121
+ last_checked_at: string | null;
122
+ last_result: ScreenResponse | null;
123
+ created_at: string;
124
+ }
125
+ export interface OrgResponse {
126
+ id: string;
127
+ name: string;
128
+ plan: OrgPlan;
129
+ created_at: string;
130
+ }
131
+ export interface UsageResponse {
132
+ period: string;
133
+ checks_count: number;
134
+ matches_count: number;
135
+ plan: OrgPlan;
136
+ limit: number;
137
+ }
138
+ export interface PaginatedResponse<T> {
139
+ data: T[];
140
+ total: number;
141
+ page: number;
142
+ per_page: number;
143
+ has_more: boolean;
144
+ }
145
+ export interface ApiError {
146
+ error: {
147
+ code: string;
148
+ message: string;
149
+ details?: Record<string, unknown>;
150
+ };
151
+ }
152
+ export declare const PLAN_LIMITS: Record<OrgPlan, number>;
153
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAE3E,MAAM,MAAM,OAAO,GACf,MAAM,GACN,SAAS,GACT,cAAc,GACd,UAAU,GACV,YAAY,CAAC;AAEjB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAItD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,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AM,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAM/C,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ // Plan limits
2
+ export const PLAN_LIMITS = {
3
+ free: 100,
4
+ starter: 10_000,
5
+ professional: 100_000,
6
+ business: 100_000,
7
+ enterprise: Infinity,
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkMA,cAAc;AACd,MAAM,CAAC,MAAM,WAAW,GAA4B;IAClD,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,MAAM;IACf,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,QAAQ;CACrB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@vigilhq/types",
3
+ "version": "0.1.0",
4
+ "description": "Shared TypeScript types for the Vigil compliance screening API",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "typecheck": "tsc --noEmit",
18
+ "clean": "rm -rf dist"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.7.0"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/ymatagne/vigil",
32
+ "directory": "packages/types"
33
+ },
34
+ "keywords": [
35
+ "vigil",
36
+ "sanctions",
37
+ "compliance",
38
+ "types",
39
+ "typescript"
40
+ ]
41
+ }