@dalmore/api-contracts 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.
- package/README.md +79 -0
- package/common/types/account-contact.types.ts +98 -0
- package/common/types/account-detail.types.ts +27 -0
- package/common/types/account-integration.types.ts +143 -0
- package/common/types/account-manager.types.ts +114 -0
- package/common/types/account.types.ts +239 -0
- package/common/types/activity.types.ts +236 -0
- package/common/types/address.types.ts +41 -0
- package/common/types/aic.types.ts +246 -0
- package/common/types/aml.types.ts +18 -0
- package/common/types/api-key-logs.types.ts +66 -0
- package/common/types/api-keys.types.ts +69 -0
- package/common/types/asset.types.ts +335 -0
- package/common/types/auth.types.ts +343 -0
- package/common/types/batch-jobs.types.ts +151 -0
- package/common/types/bonus-tier.types.ts +115 -0
- package/common/types/cart.types.ts +18 -0
- package/common/types/checklist-items.types.ts +70 -0
- package/common/types/checklist.types.ts +97 -0
- package/common/types/common.types.ts +1501 -0
- package/common/types/comply-advantage-api.types.ts +316 -0
- package/common/types/comply-advantage.types.ts +25 -0
- package/common/types/contact-us.types.ts +107 -0
- package/common/types/countries.types.ts +375 -0
- package/common/types/covered-person.types.ts +274 -0
- package/common/types/dashboard.types.ts +799 -0
- package/common/types/data-record.types.ts +325 -0
- package/common/types/data-room.types.ts +242 -0
- package/common/types/default-theme-config.types.ts +87 -0
- package/common/types/disbursement-adjustment.types.ts +32 -0
- package/common/types/disbursement-approval-user.types.ts +100 -0
- package/common/types/disbursement-review.types.ts +110 -0
- package/common/types/disbursement-transaction.types.ts +72 -0
- package/common/types/disbursements.types.ts +310 -0
- package/common/types/domain-filter.types.ts +55 -0
- package/common/types/email-theme.types.ts +442 -0
- package/common/types/entity.types.ts +15 -0
- package/common/types/error-responses.types.ts +135 -0
- package/common/types/escrow-account.types.ts +104 -0
- package/common/types/exchange-api-key.types.ts +121 -0
- package/common/types/exchange-import.types.ts +36 -0
- package/common/types/exchange-provider.types.ts +329 -0
- package/common/types/file.types.ts +461 -0
- package/common/types/health.types.ts +29 -0
- package/common/types/index.ts +48 -0
- package/common/types/individuals.types.ts +554 -0
- package/common/types/investor-account.types.ts +1168 -0
- package/common/types/investorAccountIdSchema.type.ts +0 -0
- package/common/types/investors-offering.types.ts +65 -0
- package/common/types/invite.types.ts +133 -0
- package/common/types/issuer-bank-account.types.ts +107 -0
- package/common/types/issuer-offering.types.ts +306 -0
- package/common/types/issuer-payment-method.types.ts +341 -0
- package/common/types/issuer.types.ts +312 -0
- package/common/types/job-item.types.ts +119 -0
- package/common/types/jobs.types.ts +171 -0
- package/common/types/kyb.types.ts +53 -0
- package/common/types/kyc.types.ts +188 -0
- package/common/types/legal-entity.types.ts +185 -0
- package/common/types/login-history.types.ts +46 -0
- package/common/types/mail-template.types.ts +436 -0
- package/common/types/north-cap-integration.types.ts +190 -0
- package/common/types/note.types.ts +109 -0
- package/common/types/notification.types.ts +58 -0
- package/common/types/notion-api.types.ts +374 -0
- package/common/types/notion-database.types.ts +125 -0
- package/common/types/notion-page.types.ts +267 -0
- package/common/types/offering-reports.types.ts +153 -0
- package/common/types/offering-submission.types.ts +314 -0
- package/common/types/offering.types.ts +590 -0
- package/common/types/page-revision.types.ts +86 -0
- package/common/types/page.types.ts +436 -0
- package/common/types/password.type.ts +15 -0
- package/common/types/payment-methods.types.ts +298 -0
- package/common/types/phone.type.ts +27 -0
- package/common/types/portfolio.types.ts +50 -0
- package/common/types/privacy-policy-and-tos.types.ts +231 -0
- package/common/types/queue.types.ts +112 -0
- package/common/types/registered-reps.types.ts +25 -0
- package/common/types/rejection-reasons.types.ts +56 -0
- package/common/types/reminder-config.types.ts +40 -0
- package/common/types/review.types.ts +133 -0
- package/common/types/role.types.ts +26 -0
- package/common/types/secondary-customer.types.ts +66 -0
- package/common/types/secondary-issuer.types.ts +50 -0
- package/common/types/secondary-order.types.ts +58 -0
- package/common/types/secondary-security.types.ts +60 -0
- package/common/types/secondary-trade.entity.ts +16 -0
- package/common/types/secondary-trade.types.ts +87 -0
- package/common/types/secure-request.types.ts +68 -0
- package/common/types/signer.types.ts +651 -0
- package/common/types/site-link.types.ts +166 -0
- package/common/types/site-settings.types.ts +726 -0
- package/common/types/site.types.ts +270 -0
- package/common/types/sms.types.ts +30 -0
- package/common/types/state-machine.types.ts +177 -0
- package/common/types/states.types.ts +163 -0
- package/common/types/subdoc-preview.types.ts +35 -0
- package/common/types/task.types.ts +258 -0
- package/common/types/trade-adjustment.type.ts +33 -0
- package/common/types/trade-line-item.type.ts +132 -0
- package/common/types/trade.types.ts +849 -0
- package/common/types/transaction.types.ts +198 -0
- package/common/types/trusted-contact.types.ts +122 -0
- package/common/types/typography.types.ts +75 -0
- package/common/types/user-manual.types.ts +290 -0
- package/common/types/user-setting.types.ts +133 -0
- package/common/types/user.types.ts +318 -0
- package/common/types/webhook.types.ts +588 -0
- package/common/types/zip.type.ts +36 -0
- package/contracts/clients/accounts/index.ts +58 -0
- package/contracts/clients/aic/index.ts +59 -0
- package/contracts/clients/api-key-logs/index.ts +53 -0
- package/contracts/clients/api-keys/index.ts +73 -0
- package/contracts/clients/assets/index.ts +102 -0
- package/contracts/clients/auth/index.ts +33 -0
- package/contracts/clients/files/index.ts +166 -0
- package/contracts/clients/files-public/index.ts +166 -0
- package/contracts/clients/index.ts +42 -0
- package/contracts/clients/individuals/index.ts +93 -0
- package/contracts/clients/investor-accounts/index.ts +93 -0
- package/contracts/clients/issuers/index.ts +94 -0
- package/contracts/clients/legal-entities/index.ts +93 -0
- package/contracts/clients/offerings/index.ts +116 -0
- package/contracts/clients/secure-requests/index.ts +34 -0
- package/contracts/clients/trades/index.ts +122 -0
- package/contracts/compliance/account-contacts/index.ts +82 -0
- package/contracts/compliance/account-managers/index.ts +140 -0
- package/contracts/compliance/accounts/index.ts +185 -0
- package/contracts/compliance/activities/index.ts +55 -0
- package/contracts/compliance/aic/index.ts +60 -0
- package/contracts/compliance/api-keys/index.ts +91 -0
- package/contracts/compliance/assets/index.ts +122 -0
- package/contracts/compliance/auth/index.ts +134 -0
- package/contracts/compliance/batch-jobs/index.ts +62 -0
- package/contracts/compliance/checklist/index.ts +87 -0
- package/contracts/compliance/checklist-items/index.ts +86 -0
- package/contracts/compliance/covered-persons/index.ts +97 -0
- package/contracts/compliance/dashboard/index.ts +111 -0
- package/contracts/compliance/data-records/index.ts +116 -0
- package/contracts/compliance/data-rooms/index.ts +113 -0
- package/contracts/compliance/default-theme-configs/index.ts +95 -0
- package/contracts/compliance/disbursement/index.ts +165 -0
- package/contracts/compliance/disbursement-approval-users/index.ts +84 -0
- package/contracts/compliance/disbursement-transactions/index.ts +37 -0
- package/contracts/compliance/domain-filters/index.ts +117 -0
- package/contracts/compliance/email-themes/index.ts +284 -0
- package/contracts/compliance/escrow-accounts/index.ts +85 -0
- package/contracts/compliance/exchange-api-keys/index.ts +129 -0
- package/contracts/compliance/exchange-imports/index.ts +137 -0
- package/contracts/compliance/files/index.ts +267 -0
- package/contracts/compliance/files-public/index.ts +188 -0
- package/contracts/compliance/health/index.ts +26 -0
- package/contracts/compliance/index.ts +145 -0
- package/contracts/compliance/individuals/index.ts +57 -0
- package/contracts/compliance/investor-accounts/index.ts +137 -0
- package/contracts/compliance/invites/index.ts +137 -0
- package/contracts/compliance/issuer-bank-accounts/index.ts +81 -0
- package/contracts/compliance/issuer-payment-methods/index.ts +81 -0
- package/contracts/compliance/issuers/index.ts +97 -0
- package/contracts/compliance/job-items/index.ts +58 -0
- package/contracts/compliance/jobs/index.ts +59 -0
- package/contracts/compliance/kyb/index.ts +54 -0
- package/contracts/compliance/kyc/index.ts +77 -0
- package/contracts/compliance/legal-entities/index.ts +57 -0
- package/contracts/compliance/login-histories/index.ts +37 -0
- package/contracts/compliance/notes/index.ts +69 -0
- package/contracts/compliance/notion-databases/index.ts +107 -0
- package/contracts/compliance/notion-pages/index.ts +105 -0
- package/contracts/compliance/offering-reports/index.ts +149 -0
- package/contracts/compliance/offerings/index.ts +233 -0
- package/contracts/compliance/pages/index.ts +178 -0
- package/contracts/compliance/payment-methods/index.ts +57 -0
- package/contracts/compliance/rejection-reasons/index.ts +32 -0
- package/contracts/compliance/review/index.ts +169 -0
- package/contracts/compliance/roles/index.ts +34 -0
- package/contracts/compliance/secondary-customers/index.ts +77 -0
- package/contracts/compliance/secondary-orders/index.ts +60 -0
- package/contracts/compliance/secondary-trades/index.ts +100 -0
- package/contracts/compliance/secure-requests/index.ts +54 -0
- package/contracts/compliance/signer/index.ts +369 -0
- package/contracts/compliance/site-links/index.ts +128 -0
- package/contracts/compliance/site-settings/index.ts +669 -0
- package/contracts/compliance/sites/index.ts +56 -0
- package/contracts/compliance/state-machine/index.ts +94 -0
- package/contracts/compliance/tasks/index.ts +91 -0
- package/contracts/compliance/third-parties/index.ts +52 -0
- package/contracts/compliance/trade-line-items/index.ts +59 -0
- package/contracts/compliance/trades/index.ts +230 -0
- package/contracts/compliance/transactions/index.ts +161 -0
- package/contracts/compliance/user-manuals/index.ts +271 -0
- package/contracts/compliance/user-settings/index.ts +189 -0
- package/contracts/compliance/users/index.ts +200 -0
- package/contracts/compliance/webhooks/index.ts +41 -0
- package/contracts/compliance-apikey/accounts/index.ts +58 -0
- package/contracts/compliance-apikey/index.ts +14 -0
- package/contracts/index.ts +6 -0
- package/contracts/investors/account-contacts/index.ts +58 -0
- package/contracts/investors/aic/index.ts +59 -0
- package/contracts/investors/assets/index.ts +61 -0
- package/contracts/investors/auth/index.ts +116 -0
- package/contracts/investors/bonus-tiers/index.ts +37 -0
- package/contracts/investors/cart/index.ts +75 -0
- package/contracts/investors/contact-us/index.ts +48 -0
- package/contracts/investors/data-records/index.ts +113 -0
- package/contracts/investors/data-rooms/index.ts +96 -0
- package/contracts/investors/files/index.ts +167 -0
- package/contracts/investors/files-public/index.ts +185 -0
- package/contracts/investors/index.ts +72 -0
- package/contracts/investors/individuals/index.ts +99 -0
- package/contracts/investors/investor-accounts/index.ts +110 -0
- package/contracts/investors/issuer-payment-methods/index.ts +36 -0
- package/contracts/investors/issuers/index.ts +30 -0
- package/contracts/investors/legal-entities/index.ts +93 -0
- package/contracts/investors/notes/index.ts +69 -0
- package/contracts/investors/offerings/index.ts +93 -0
- package/contracts/investors/pages/index.ts +88 -0
- package/contracts/investors/payment-methods/index.ts +149 -0
- package/contracts/investors/portfolios/index.ts +53 -0
- package/contracts/investors/sites/index.ts +96 -0
- package/contracts/investors/tasks/index.ts +111 -0
- package/contracts/investors/trade-line-items/index.ts +75 -0
- package/contracts/investors/trades/index.ts +114 -0
- package/contracts/investors/transactions/index.ts +37 -0
- package/contracts/investors/trusted-contacts/index.ts +93 -0
- package/contracts/investors/user-manuals/index.ts +62 -0
- package/contracts/investors/user-settings/index.ts +170 -0
- package/contracts/investors/users/index.ts +45 -0
- package/contracts/investors/webhooks/index.ts +30 -0
- package/contracts/issuers/account-contacts/index.ts +76 -0
- package/contracts/issuers/account-integrations/index.ts +97 -0
- package/contracts/issuers/accounts/index.ts +92 -0
- package/contracts/issuers/activities/index.ts +54 -0
- package/contracts/issuers/aic/index.ts +39 -0
- package/contracts/issuers/api-key-logs/index.ts +53 -0
- package/contracts/issuers/api-keys/index.ts +93 -0
- package/contracts/issuers/assets/index.ts +122 -0
- package/contracts/issuers/auth/index.ts +152 -0
- package/contracts/issuers/bonus-tiers/index.ts +37 -0
- package/contracts/issuers/contact-us/index.ts +48 -0
- package/contracts/issuers/covered-persons/index.ts +136 -0
- package/contracts/issuers/dashboard/index.ts +72 -0
- package/contracts/issuers/data-records/index.ts +257 -0
- package/contracts/issuers/data-rooms/index.ts +134 -0
- package/contracts/issuers/disbursement-approval-users/index.ts +82 -0
- package/contracts/issuers/disbursement-transactions/index.ts +53 -0
- package/contracts/issuers/disbursements/index.ts +153 -0
- package/contracts/issuers/email-themes/index.ts +242 -0
- package/contracts/issuers/escrow-accounts/index.ts +81 -0
- package/contracts/issuers/exchange-api-keys/index.ts +144 -0
- package/contracts/issuers/files/index.ts +166 -0
- package/contracts/issuers/files-public/index.ts +166 -0
- package/contracts/issuers/health/index.ts +24 -0
- package/contracts/issuers/index.ts +112 -0
- package/contracts/issuers/investor-accounts/index.ts +126 -0
- package/contracts/issuers/invites/index.ts +129 -0
- package/contracts/issuers/issuer/index.ts +94 -0
- package/contracts/issuers/issuer-bank-accounts/index.ts +81 -0
- package/contracts/issuers/issuer-payment-methods/index.ts +136 -0
- package/contracts/issuers/kyc/index.ts +38 -0
- package/contracts/issuers/login-histories/index.ts +51 -0
- package/contracts/issuers/notes/index.ts +69 -0
- package/contracts/issuers/offerings/index.ts +206 -0
- package/contracts/issuers/pages/index.ts +138 -0
- package/contracts/issuers/payment-methods/index.ts +61 -0
- package/contracts/issuers/portfolios/index.ts +36 -0
- package/contracts/issuers/rejection-reasons/index.ts +32 -0
- package/contracts/issuers/review/index.ts +63 -0
- package/contracts/issuers/secondary-customers/index.ts +55 -0
- package/contracts/issuers/secondary-orders/index.ts +57 -0
- package/contracts/issuers/secondary-trades/index.ts +57 -0
- package/contracts/issuers/secure-requests/index.ts +34 -0
- package/contracts/issuers/site-links/index.ts +116 -0
- package/contracts/issuers/site-settings/index.ts +585 -0
- package/contracts/issuers/sites/index.ts +32 -0
- package/contracts/issuers/tasks/index.ts +111 -0
- package/contracts/issuers/trades/index.ts +132 -0
- package/contracts/issuers/transactions/index.ts +158 -0
- package/contracts/issuers/user-manuals/index.ts +62 -0
- package/contracts/issuers/user-settings/index.ts +170 -0
- package/contracts/issuers/users/index.ts +126 -0
- package/contracts/secondaries/accounts/index.ts +58 -0
- package/contracts/secondaries/index.ts +23 -0
- package/contracts/secondaries/secondary-customers/index.ts +55 -0
- package/contracts/secondaries/secondary-issuers/index.ts +94 -0
- package/contracts/secondaries/secondary-orders/index.ts +56 -0
- package/contracts/secondaries/secondary-securities/index.ts +95 -0
- package/contracts/secondaries/secondary-trades/index.ts +56 -0
- package/package.json +74 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ComplyAdvantageStatus } from './comply-advantage.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* POST /searches - Create a new search
|
|
6
|
+
* @see https://docs.complyadvantage.com/api-docs/#creating-searches
|
|
7
|
+
*/
|
|
8
|
+
export const CreateSearchRequestSchema = z.object({
|
|
9
|
+
search_term: z.union([
|
|
10
|
+
z.string(),
|
|
11
|
+
z.object({
|
|
12
|
+
first_name: z.string().optional(),
|
|
13
|
+
middle_names: z.string().optional(),
|
|
14
|
+
last_name: z.string(),
|
|
15
|
+
}),
|
|
16
|
+
]),
|
|
17
|
+
client_ref: z.string().max(255).optional(),
|
|
18
|
+
search_profile: z.string().optional(),
|
|
19
|
+
fuzziness: z.number().min(0).max(1).optional(),
|
|
20
|
+
offset: z.number().int().optional(),
|
|
21
|
+
limit: z.number().int().max(100).optional(),
|
|
22
|
+
filters: z
|
|
23
|
+
.object({
|
|
24
|
+
types: z.array(z.string()).optional(),
|
|
25
|
+
birth_year: z.union([z.string(), z.number()]).optional(),
|
|
26
|
+
remove_deceased: z.union([z.literal('0'), z.literal('1')]).optional(),
|
|
27
|
+
country_codes: z.array(z.string()).optional(),
|
|
28
|
+
entity_type: z
|
|
29
|
+
.enum(['person', 'company', 'organisation', 'vessel', 'aircraft'])
|
|
30
|
+
.optional(),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
tags: z.record(z.string()).optional(),
|
|
34
|
+
share_url: z.union([z.literal(0), z.literal(1)]).optional(),
|
|
35
|
+
exact_match: z.boolean().optional(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type CreateSearchRequest = z.infer<typeof CreateSearchRequestSchema>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Entity model returned in search results
|
|
42
|
+
* @see https://docs.complyadvantage.com/api-docs/#concepts
|
|
43
|
+
*/
|
|
44
|
+
export const EntitySchema = z
|
|
45
|
+
.object({
|
|
46
|
+
id: z.string(),
|
|
47
|
+
entity_type: z.string().optional(),
|
|
48
|
+
last_updated_utc: z.string().optional(),
|
|
49
|
+
name: z.string(),
|
|
50
|
+
first_name: z.string().optional(),
|
|
51
|
+
middle_name: z.string().optional(),
|
|
52
|
+
last_name: z.string().optional(),
|
|
53
|
+
sources: z.array(z.string()).optional(),
|
|
54
|
+
types: z.array(z.string()).optional(),
|
|
55
|
+
fields: z
|
|
56
|
+
.array(
|
|
57
|
+
z.object({
|
|
58
|
+
name: z.string(),
|
|
59
|
+
tag: z.string().optional(),
|
|
60
|
+
value: z.string(),
|
|
61
|
+
source: z.string().optional(),
|
|
62
|
+
locale: z.string().optional(),
|
|
63
|
+
}),
|
|
64
|
+
)
|
|
65
|
+
.optional(),
|
|
66
|
+
aka: z
|
|
67
|
+
.array(
|
|
68
|
+
z.object({
|
|
69
|
+
name: z.string(),
|
|
70
|
+
}),
|
|
71
|
+
)
|
|
72
|
+
.optional(),
|
|
73
|
+
associates: z
|
|
74
|
+
.array(
|
|
75
|
+
z.object({
|
|
76
|
+
name: z.string(),
|
|
77
|
+
association: z.string().optional(),
|
|
78
|
+
}),
|
|
79
|
+
)
|
|
80
|
+
.optional(),
|
|
81
|
+
media: z
|
|
82
|
+
.array(
|
|
83
|
+
z.object({
|
|
84
|
+
date: z.string().optional(),
|
|
85
|
+
snippet: z.string().optional(),
|
|
86
|
+
title: z.string().optional(),
|
|
87
|
+
url: z.string(),
|
|
88
|
+
pdf_url: z.string().optional(),
|
|
89
|
+
}),
|
|
90
|
+
)
|
|
91
|
+
.optional(),
|
|
92
|
+
source_notes: z
|
|
93
|
+
.record(
|
|
94
|
+
z.object({
|
|
95
|
+
aml_types: z.array(z.string()).optional(),
|
|
96
|
+
country_codes: z.array(z.string()).optional(),
|
|
97
|
+
listing_started_utc: z.string().optional(),
|
|
98
|
+
listing_ended_utc: z.string().optional(),
|
|
99
|
+
name: z.string().optional(),
|
|
100
|
+
source_id: z.string().optional(),
|
|
101
|
+
url: z.string().optional(),
|
|
102
|
+
}),
|
|
103
|
+
)
|
|
104
|
+
.optional(),
|
|
105
|
+
keywords: z.array(z.string()).optional(),
|
|
106
|
+
assets: z
|
|
107
|
+
.array(
|
|
108
|
+
z.object({
|
|
109
|
+
public_url: z.string().optional(),
|
|
110
|
+
source: z.string().optional(),
|
|
111
|
+
type: z.string().optional(),
|
|
112
|
+
url: z.string(),
|
|
113
|
+
}),
|
|
114
|
+
)
|
|
115
|
+
.optional(),
|
|
116
|
+
})
|
|
117
|
+
.passthrough();
|
|
118
|
+
|
|
119
|
+
export type Entity = z.infer<typeof EntitySchema>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Hit model - individual search result entity with metadata
|
|
123
|
+
* @see https://docs.complyadvantage.com/api-docs/#creating-searches
|
|
124
|
+
*/
|
|
125
|
+
export const HitSchema = z.object({
|
|
126
|
+
doc: EntitySchema,
|
|
127
|
+
is_whitelisted: z.boolean().optional(),
|
|
128
|
+
match_types: z.array(z.string()),
|
|
129
|
+
match_types_details: z.any().optional(),
|
|
130
|
+
score: z.number(),
|
|
131
|
+
match_status: z.nativeEnum(ComplyAdvantageStatus).optional(),
|
|
132
|
+
risk_level: z.enum(['low', 'medium', 'high', 'unknown']).optional(),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export type Hit = z.infer<typeof HitSchema>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Search profile information
|
|
139
|
+
* @see https://docs.complyadvantage.com/api-docs/#creating-searches
|
|
140
|
+
*/
|
|
141
|
+
export const SearchProfileSchema = z.object({
|
|
142
|
+
name: z.string(),
|
|
143
|
+
slug: z.string(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export type SearchProfile = z.infer<typeof SearchProfileSchema>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* User information
|
|
150
|
+
* @see https://docs.complyadvantage.com/api-docs/#other-endpoints
|
|
151
|
+
*/
|
|
152
|
+
export const UserSchema = z.object({
|
|
153
|
+
id: z.number(),
|
|
154
|
+
email: z.string(),
|
|
155
|
+
name: z.string(),
|
|
156
|
+
phone: z.string().nullable(),
|
|
157
|
+
created_at: z.string(),
|
|
158
|
+
user_is_active: z.boolean().optional(),
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export type User = z.infer<typeof UserSchema>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* POST /searches response - Create search response
|
|
165
|
+
* @see https://docs.complyadvantage.com/api-docs/#creating-searches
|
|
166
|
+
*/
|
|
167
|
+
export const CreateSearchResponseSchema = z.object({
|
|
168
|
+
status: z.enum(['success', 'failure']),
|
|
169
|
+
code: z.number().optional(),
|
|
170
|
+
content: z.object({
|
|
171
|
+
data: z.object({
|
|
172
|
+
id: z.number(),
|
|
173
|
+
ref: z.string(),
|
|
174
|
+
searcher_id: z.number(),
|
|
175
|
+
assignee_id: z.number(),
|
|
176
|
+
search_profile: SearchProfileSchema.optional(),
|
|
177
|
+
filters: z
|
|
178
|
+
.object({
|
|
179
|
+
entity_type: z.string().optional(),
|
|
180
|
+
types: z.array(z.string()).optional(),
|
|
181
|
+
birth_year: z.union([z.string(), z.number()]).optional(),
|
|
182
|
+
passport: z.string().optional(),
|
|
183
|
+
exact_match: z.boolean().optional(),
|
|
184
|
+
fuzziness: z.number().optional(),
|
|
185
|
+
country_codes: z.array(z.string()).optional(),
|
|
186
|
+
remove_deceased: z.number().optional(),
|
|
187
|
+
})
|
|
188
|
+
.optional(),
|
|
189
|
+
match_status: z.nativeEnum(ComplyAdvantageStatus),
|
|
190
|
+
risk_level: z.enum(['low', 'medium', 'high', 'unknown']),
|
|
191
|
+
search_term: z.string(),
|
|
192
|
+
submitted_term: z.string().optional(),
|
|
193
|
+
client_ref: z.string().optional(),
|
|
194
|
+
total_hits: z.number(),
|
|
195
|
+
total_matches: z.number(),
|
|
196
|
+
updated_at: z.string(),
|
|
197
|
+
created_at: z.string(),
|
|
198
|
+
tags: z.record(z.string()).optional(),
|
|
199
|
+
labels: z
|
|
200
|
+
.array(
|
|
201
|
+
z.object({
|
|
202
|
+
type: z.string(),
|
|
203
|
+
name: z.string(),
|
|
204
|
+
value: z.string(),
|
|
205
|
+
}),
|
|
206
|
+
)
|
|
207
|
+
.optional(),
|
|
208
|
+
blacklist_filters: z
|
|
209
|
+
.object({
|
|
210
|
+
blacklist_ids: z.array(z.string()),
|
|
211
|
+
})
|
|
212
|
+
.optional(),
|
|
213
|
+
total_blacklist_hits: z.number().optional(),
|
|
214
|
+
limit: z.number().optional(),
|
|
215
|
+
offset: z.number().optional(),
|
|
216
|
+
share_url: z.string().optional(),
|
|
217
|
+
searcher: UserSchema.optional(),
|
|
218
|
+
assignee: UserSchema.optional(),
|
|
219
|
+
hits: z.array(HitSchema).optional(),
|
|
220
|
+
blacklist_hits: z.array(z.any()).optional(),
|
|
221
|
+
}),
|
|
222
|
+
}),
|
|
223
|
+
message: z.string().optional(),
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
export type CreateSearchResponse = z.infer<typeof CreateSearchResponseSchema>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* GET /searches/{ref}/entities/comply - Get search entities response
|
|
230
|
+
* @see https://docs.complyadvantage.com/api-docs/#get-searchesrefentitiesentity_provider
|
|
231
|
+
*/
|
|
232
|
+
export const GetSearchEntitiesResponseSchema = z.array(HitSchema);
|
|
233
|
+
|
|
234
|
+
export type GetSearchEntitiesResponse = z.infer<
|
|
235
|
+
typeof GetSearchEntitiesResponseSchema
|
|
236
|
+
>;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* GET /searches/{ref}/details - Get search details response
|
|
240
|
+
* @see https://docs.complyadvantage.com/api-docs/#get-searchesiddetails
|
|
241
|
+
*/
|
|
242
|
+
export const GetSearchDetailsResponseSchema = z.object({
|
|
243
|
+
code: z.number(),
|
|
244
|
+
status: z.enum(['success', 'failure']),
|
|
245
|
+
content: z.object({
|
|
246
|
+
data: z.object({
|
|
247
|
+
id: z.number(),
|
|
248
|
+
ref: z.string(),
|
|
249
|
+
searcher_id: z.number(),
|
|
250
|
+
assignee_id: z.number(),
|
|
251
|
+
filters: z
|
|
252
|
+
.object({
|
|
253
|
+
country_codes: z.array(z.string()).optional(),
|
|
254
|
+
remove_deceased: z.number().optional(),
|
|
255
|
+
types: z.array(z.string()).optional(),
|
|
256
|
+
exact_match: z.boolean().optional(),
|
|
257
|
+
fuzziness: z.number().optional(),
|
|
258
|
+
birth_year: z.union([z.string(), z.number()]).optional(),
|
|
259
|
+
entity_type: z.string().optional(),
|
|
260
|
+
})
|
|
261
|
+
.optional(),
|
|
262
|
+
match_status: z.nativeEnum(ComplyAdvantageStatus),
|
|
263
|
+
risk_level: z.enum(['low', 'medium', 'high', 'unknown']),
|
|
264
|
+
search_term: z.string(),
|
|
265
|
+
submitted_term: z.string().optional(),
|
|
266
|
+
client_ref: z.string().optional(),
|
|
267
|
+
total_hits: z.number(),
|
|
268
|
+
total_matches: z.number(),
|
|
269
|
+
updated_at: z.string(),
|
|
270
|
+
created_at: z.string(),
|
|
271
|
+
tags: z.record(z.string()).optional(),
|
|
272
|
+
labels: z
|
|
273
|
+
.array(
|
|
274
|
+
z.object({
|
|
275
|
+
type: z.string(),
|
|
276
|
+
name: z.string(),
|
|
277
|
+
value: z.string(),
|
|
278
|
+
}),
|
|
279
|
+
)
|
|
280
|
+
.optional(),
|
|
281
|
+
blacklist_filters: z
|
|
282
|
+
.object({
|
|
283
|
+
blacklist_ids: z.array(z.string()),
|
|
284
|
+
})
|
|
285
|
+
.optional(),
|
|
286
|
+
total_blacklist_hits: z.number().optional(),
|
|
287
|
+
limit: z.number().optional(),
|
|
288
|
+
offset: z.number().optional(),
|
|
289
|
+
search_profile: SearchProfileSchema.optional(),
|
|
290
|
+
searcher: UserSchema.optional(),
|
|
291
|
+
assignee: UserSchema.optional(),
|
|
292
|
+
hits: z.array(HitSchema),
|
|
293
|
+
blacklist_hits: z.array(z.any()).optional(),
|
|
294
|
+
share_url: z.string().optional(),
|
|
295
|
+
}),
|
|
296
|
+
}),
|
|
297
|
+
message: z.string().optional(),
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
export type GetSearchDetailsResponse = z.infer<
|
|
301
|
+
typeof GetSearchDetailsResponseSchema
|
|
302
|
+
>;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* PATCH /searches/{ref} - Update search request
|
|
306
|
+
* @see https://docs.complyadvantage.com/api-docs/#patch-searchesid
|
|
307
|
+
*/
|
|
308
|
+
export const UpdateSearchRequestSchema = z.object({
|
|
309
|
+
match_status: z.nativeEnum(ComplyAdvantageStatus).optional(),
|
|
310
|
+
risk_level: z.enum(['low', 'medium', 'high', 'unknown']).optional(),
|
|
311
|
+
assignee_id: z.number().optional(),
|
|
312
|
+
limit: z.number().int().max(100).optional(),
|
|
313
|
+
tags: z.record(z.string()).optional(),
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
export type UpdateSearchRequest = z.infer<typeof UpdateSearchRequestSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export enum ComplyAdvantageStatus {
|
|
4
|
+
FALSE_POSITIVE = 'false_positive',
|
|
5
|
+
TRUE_POSITIVE = 'true_positive',
|
|
6
|
+
POTENTIAL_MATCH = 'potential_match',
|
|
7
|
+
NO_MATCH = 'no_match',
|
|
8
|
+
UNKNOWN = 'unknown',
|
|
9
|
+
TRUE_POSITIVE_APPROVE = 'true_positive_approve',
|
|
10
|
+
TRUE_POSITIVE_REJECT = 'true_positive_reject',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ComplyAdvantageResponseSchema = z.object({
|
|
14
|
+
status: z.enum(['success', 'failure']),
|
|
15
|
+
content: z.object({
|
|
16
|
+
data: z.object({
|
|
17
|
+
match_status: z.nativeEnum(ComplyAdvantageStatus),
|
|
18
|
+
}),
|
|
19
|
+
}),
|
|
20
|
+
message: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type ComplyAdvantageResponseSchema = z.infer<
|
|
24
|
+
typeof ComplyAdvantageResponseSchema
|
|
25
|
+
>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { extendZodWithOpenApi } from '@anatine/zod-openapi';
|
|
3
|
+
import { TypeID } from 'typeid-js';
|
|
4
|
+
import { BaseContactUsOptions, createUrlSchema } from './common.types';
|
|
5
|
+
extendZodWithOpenApi(z);
|
|
6
|
+
|
|
7
|
+
export const contactUsIdSchema = z.string().refine(
|
|
8
|
+
(value) => {
|
|
9
|
+
try {
|
|
10
|
+
const tid = TypeID.fromString(value);
|
|
11
|
+
return tid.getType() === 'contact_us';
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
message: `Invalid contact_us ID format. Must be a valid TypeID with "contact_us" prefix. Example: contact_us_01j5y5ghx5fg68d663j1fvy2x7`,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export enum InvestorContactOptions {
|
|
22
|
+
ISSUER = BaseContactUsOptions.ISSUER,
|
|
23
|
+
TECHNICAL_SUPPORT = BaseContactUsOptions.TECHNICAL_SUPPORT,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum PublicIssuerContactOptions {
|
|
27
|
+
TECHNICAL_SUPPORT = BaseContactUsOptions.TECHNICAL_SUPPORT,
|
|
28
|
+
SALES = BaseContactUsOptions.SALES,
|
|
29
|
+
ACCOUNT_MANAGER = BaseContactUsOptions.ACCOUNT_MANAGER,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export enum IssuerContactOptions {
|
|
33
|
+
TECHNICAL_SUPPORT = BaseContactUsOptions.TECHNICAL_SUPPORT,
|
|
34
|
+
ACCOUNT_MANAGER = BaseContactUsOptions.ACCOUNT_MANAGER,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const PostContactUsZod = z.object({
|
|
38
|
+
contactOption: z
|
|
39
|
+
.nativeEnum(IssuerContactOptions)
|
|
40
|
+
.openapi({ example: IssuerContactOptions.TECHNICAL_SUPPORT }),
|
|
41
|
+
subject: z.string().min(1).max(60).openapi({ example: 'subject' }),
|
|
42
|
+
message: z.string().min(1).max(1000).openapi({ example: 'message' }),
|
|
43
|
+
});
|
|
44
|
+
export type PostContactUsZod = z.infer<typeof PostContactUsZod>;
|
|
45
|
+
|
|
46
|
+
export const PostContactUsResponse = z.object({
|
|
47
|
+
message: z.string(),
|
|
48
|
+
});
|
|
49
|
+
export type PostContactUsResponse = z.infer<typeof PostContactUsResponse>;
|
|
50
|
+
export const InvestorPostContactUsZod = PostContactUsZod.extend({
|
|
51
|
+
contactOption: z.nativeEnum(InvestorContactOptions).openapi({
|
|
52
|
+
example: InvestorContactOptions.TECHNICAL_SUPPORT,
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
export type InvestorPostContactUsZod = z.infer<typeof InvestorPostContactUsZod>;
|
|
56
|
+
|
|
57
|
+
export const PublicInvestorContactUsZod = PostContactUsZod.extend({
|
|
58
|
+
email: z.string().email().openapi({ example: 'email@example.com' }),
|
|
59
|
+
firstName: z.string().min(1).max(100).openapi({ example: 'John' }),
|
|
60
|
+
lastName: z.string().min(1).max(100).openapi({ example: 'Doe' }),
|
|
61
|
+
contactOption: z.nativeEnum(InvestorContactOptions).openapi({
|
|
62
|
+
example: InvestorContactOptions.TECHNICAL_SUPPORT,
|
|
63
|
+
}),
|
|
64
|
+
url: createUrlSchema({ strict: true }).openapi({
|
|
65
|
+
example: 'test-dev.test.com',
|
|
66
|
+
}),
|
|
67
|
+
turnstileToken: z
|
|
68
|
+
.string()
|
|
69
|
+
.min(1)
|
|
70
|
+
.max(10000)
|
|
71
|
+
.openapi({ example: '0.WdnEAAAAAIjVJHV...8V1ffXx0Q' }),
|
|
72
|
+
});
|
|
73
|
+
export type PublicInvestorContactUsZod = z.infer<
|
|
74
|
+
typeof PublicInvestorContactUsZod
|
|
75
|
+
>;
|
|
76
|
+
|
|
77
|
+
export const PublicIssuerContactUsZod = PostContactUsZod.extend({
|
|
78
|
+
email: z.string().email().openapi({ example: 'email@example.com' }),
|
|
79
|
+
firstName: z.string().min(1).max(100).openapi({ example: 'John' }),
|
|
80
|
+
lastName: z.string().min(1).max(100).openapi({ example: 'Doe' }),
|
|
81
|
+
contactOption: z.nativeEnum(PublicIssuerContactOptions).openapi({
|
|
82
|
+
example: PublicIssuerContactOptions.TECHNICAL_SUPPORT,
|
|
83
|
+
}),
|
|
84
|
+
turnstileToken: z
|
|
85
|
+
.string()
|
|
86
|
+
.min(1)
|
|
87
|
+
.max(10000)
|
|
88
|
+
.openapi({ example: '0.WdnEAAAAAIjVJHV...8V1ffXx0Q' }),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export type PublicIssuerContactUsZod = z.infer<typeof PublicIssuerContactUsZod>;
|
|
92
|
+
|
|
93
|
+
export const HandleContactOptionZod = z.object({
|
|
94
|
+
email: z.string().email().openapi({ example: 'email@example.com' }),
|
|
95
|
+
accountId: z.string().optional().nullable().openapi({ example: 'accountId' }),
|
|
96
|
+
senderName: z
|
|
97
|
+
.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.nullable()
|
|
100
|
+
.openapi({ example: 'senderName' }),
|
|
101
|
+
senderEmail: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.nullable()
|
|
105
|
+
.openapi({ example: 'senderEmail' }),
|
|
106
|
+
});
|
|
107
|
+
export type HandleContactOptionZod = z.infer<typeof HandleContactOptionZod>;
|