@dalmore/api-contracts 1.0.5 → 1.0.6
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/package.json +4 -5
- package/src/common/types/account-contact.types.ts +98 -0
- package/src/common/types/account-detail.types.ts +27 -0
- package/src/common/types/account-integration.types.ts +143 -0
- package/src/common/types/account-manager.types.ts +124 -0
- package/src/common/types/account.types.ts +296 -0
- package/src/common/types/activity.types.ts +274 -0
- package/src/common/types/address.spec.ts +203 -0
- package/src/common/types/address.types.ts +41 -0
- package/src/common/types/aic.types.ts +246 -0
- package/src/common/types/aml.types.ts +18 -0
- package/src/common/types/api-key-logs.types.ts +66 -0
- package/src/common/types/api-keys.types.ts +69 -0
- package/src/common/types/asset.types.ts +338 -0
- package/src/common/types/auth.types.ts +370 -0
- package/src/common/types/batch-jobs.types.ts +151 -0
- package/src/common/types/bonus-tier.types.ts +147 -0
- package/src/common/types/cart.types.ts +18 -0
- package/src/common/types/checklist-items.types.ts +70 -0
- package/src/common/types/checklist.types.ts +97 -0
- package/src/common/types/common.types.spec.ts +336 -0
- package/src/common/types/common.types.ts +1520 -0
- package/src/common/types/comply-advantage-api.types.ts +316 -0
- package/src/common/types/comply-advantage.types.ts +25 -0
- package/src/common/types/contact-us.types.ts +107 -0
- package/src/common/types/contract-helpers.ts +205 -0
- package/src/common/types/countries.types.ts +375 -0
- package/src/common/types/covered-person.types.ts +274 -0
- package/src/common/types/dashboard.types.ts +799 -0
- package/src/common/types/data-record.types.ts +325 -0
- package/src/common/types/data-room.types.ts +242 -0
- package/src/common/types/default-theme-config.types.ts +87 -0
- package/src/common/types/disbursement-adjustment.types.ts +32 -0
- package/src/common/types/disbursement-approval-user.types.ts +100 -0
- package/src/common/types/disbursement-review.types.ts +110 -0
- package/src/common/types/disbursement-transaction.types.ts +72 -0
- package/src/common/types/disbursements.types.ts +310 -0
- package/src/common/types/domain-filter.types.ts +55 -0
- package/src/common/types/email-theme.types.ts +442 -0
- package/src/common/types/entity.types.ts +15 -0
- package/src/common/types/error-responses.types.ts +135 -0
- package/src/common/types/escrow-account.types.ts +104 -0
- package/src/common/types/exchange-api-key.types.ts +121 -0
- package/src/common/types/exchange-import.types.ts +36 -0
- package/src/common/types/exchange-provider.types.ts +329 -0
- package/src/common/types/file.types.ts +461 -0
- package/src/common/types/files.types.spec.ts +154 -0
- package/src/common/types/health.types.ts +29 -0
- package/src/common/types/index.ts +48 -0
- package/src/common/types/individuals.types.ts +554 -0
- package/src/common/types/investor-account.types.ts +1239 -0
- package/src/common/types/investorAccountIdSchema.type.ts +0 -0
- package/src/common/types/investors-offering.types.ts +65 -0
- package/src/common/types/invite.types.ts +133 -0
- package/src/common/types/issuer-bank-account.types.ts +107 -0
- package/src/common/types/issuer-offering.types.ts +306 -0
- package/src/common/types/issuer-payment-method.types.spec.ts +612 -0
- package/src/common/types/issuer-payment-method.types.ts +341 -0
- package/src/common/types/issuer.types.ts +312 -0
- package/src/common/types/job-item.types.ts +119 -0
- package/src/common/types/jobs.types.ts +171 -0
- package/src/common/types/kyb.types.ts +53 -0
- package/src/common/types/kyc.types.ts +188 -0
- package/src/common/types/legal-entity.types.ts +185 -0
- package/src/common/types/login-history.types.ts +46 -0
- package/src/common/types/mail-template.types.ts +436 -0
- package/src/common/types/north-cap-integration.types.ts +190 -0
- package/src/common/types/note.types.ts +109 -0
- package/src/common/types/notification.types.ts +58 -0
- package/src/common/types/notion-api.types.ts +374 -0
- package/src/common/types/notion-database.types.ts +125 -0
- package/src/common/types/notion-page.types.ts +267 -0
- package/src/common/types/offering-reports.types.ts +153 -0
- package/src/common/types/offering-submission.types.ts +314 -0
- package/src/common/types/offering.types.spec.ts +91 -0
- package/src/common/types/offering.types.ts +590 -0
- package/src/common/types/page-revision.types.ts +86 -0
- package/src/common/types/page.types.ts +436 -0
- package/src/common/types/password.type.ts +15 -0
- package/src/common/types/payment-methods.types.ts +298 -0
- package/src/common/types/phone.spec.ts +76 -0
- package/src/common/types/phone.type.ts +27 -0
- package/src/common/types/portfolio.types.ts +50 -0
- package/src/common/types/privacy-policy-and-tos.types.ts +231 -0
- package/src/common/types/queue.types.ts +112 -0
- package/src/common/types/registered-reps.types.ts +25 -0
- package/src/common/types/rejection-reasons.types.ts +56 -0
- package/src/common/types/reminder-config.types.ts +40 -0
- package/src/common/types/review.types.ts +133 -0
- package/src/common/types/role.types.ts +26 -0
- package/src/common/types/secondary-customer.types.ts +66 -0
- package/src/common/types/secondary-issuer.types.ts +50 -0
- package/src/common/types/secondary-order.types.ts +58 -0
- package/src/common/types/secondary-security.types.ts +60 -0
- package/src/common/types/secondary-trade.entity.ts +16 -0
- package/src/common/types/secondary-trade.types.ts +95 -0
- package/src/common/types/secure-request.types.ts +68 -0
- package/src/common/types/signer.types.ts +651 -0
- package/src/common/types/site-link.types.spec.ts +134 -0
- package/src/common/types/site-link.types.ts +166 -0
- package/src/common/types/site-settings.types.ts +726 -0
- package/src/common/types/site.types.ts +270 -0
- package/src/common/types/sms.types.ts +30 -0
- package/src/common/types/state-machine.types.ts +177 -0
- package/src/common/types/states.types.ts +163 -0
- package/src/common/types/subdoc-preview.types.ts +35 -0
- package/src/common/types/task.types.ts +258 -0
- package/src/common/types/trade-adjustment.type.ts +33 -0
- package/src/common/types/trade-line-item.type.ts +132 -0
- package/src/common/types/trade.types.ts +929 -0
- package/src/common/types/transaction.types.ts +198 -0
- package/src/common/types/trusted-contact.types.ts +122 -0
- package/src/common/types/typography.types.ts +75 -0
- package/src/common/types/user-manual.types.ts +290 -0
- package/src/common/types/user-setting.types.ts +133 -0
- package/src/common/types/user.types.ts +320 -0
- package/src/common/types/webhook.types.ts +588 -0
- package/src/common/types/zip.type.ts +36 -0
- package/src/contracts/clients/accounts/index.ts +61 -0
- package/src/contracts/clients/aic/index.ts +59 -0
- package/src/contracts/clients/api-key-logs/index.ts +53 -0
- package/src/contracts/clients/api-keys/index.ts +73 -0
- package/src/contracts/clients/assets/index.ts +102 -0
- package/src/contracts/clients/auth/index.ts +50 -0
- package/src/contracts/clients/files/index.ts +166 -0
- package/src/contracts/clients/files-public/index.ts +166 -0
- package/src/contracts/clients/index.ts +44 -0
- package/src/contracts/clients/individuals/index.ts +93 -0
- package/src/contracts/clients/investor-accounts/index.ts +93 -0
- package/src/contracts/clients/issuers/index.ts +94 -0
- package/src/contracts/clients/legal-entities/index.ts +93 -0
- package/src/contracts/clients/offerings/index.ts +117 -0
- package/src/contracts/clients/secure-requests/index.ts +34 -0
- package/src/contracts/clients/sites/index.ts +56 -0
- package/src/contracts/clients/trades/index.ts +122 -0
- package/index.d.mts +0 -17
- package/index.d.ts +0 -17
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
ComplianceReview,
|
|
4
|
+
IPaginationMeta,
|
|
5
|
+
PaginationOptionsZod,
|
|
6
|
+
SenderIdentityStatus,
|
|
7
|
+
TemplateStatus,
|
|
8
|
+
TemplateType,
|
|
9
|
+
} from './common.types';
|
|
10
|
+
import { TypeID } from 'typeid-js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Example error response:
|
|
14
|
+
* https://support.boldsign.com/kb/article/15855/resolving-locale-mismatch-errors-in-boldsign-esignature-api#error-description
|
|
15
|
+
*
|
|
16
|
+
* Example Success response:
|
|
17
|
+
* https://developers.boldsign.com/documents/send-document-from-template/?region=us#example-response
|
|
18
|
+
* https://developers.boldsign.com/documents/send-document/?region=us#example-response
|
|
19
|
+
*/
|
|
20
|
+
export const BoldSignCreateDocumentResponseZod = z.object({
|
|
21
|
+
errors: z.record(z.string(), z.array(z.string())),
|
|
22
|
+
type: z.string(),
|
|
23
|
+
title: z.string(),
|
|
24
|
+
status: z.number().openapi({
|
|
25
|
+
example: 400,
|
|
26
|
+
}),
|
|
27
|
+
traceId: z.string(),
|
|
28
|
+
documentId: z.string(),
|
|
29
|
+
});
|
|
30
|
+
export type BoldSignCreateDocumentResponseZod = z.infer<
|
|
31
|
+
typeof BoldSignCreateDocumentResponseZod
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Example error response:
|
|
36
|
+
* https://support.boldsign.com/kb/article/15855/resolving-locale-mismatch-errors-in-boldsign-esignature-api#error-description
|
|
37
|
+
*
|
|
38
|
+
* Example Success response:
|
|
39
|
+
* https://developers.boldsign.com/embedded-signing/get-embedded-signing-link/?region=us#example-response
|
|
40
|
+
*/
|
|
41
|
+
export const BoldSignGetEmbeddedDocumentLinkResponseZod = z.object({
|
|
42
|
+
errors: z.record(z.string(), z.array(z.string())),
|
|
43
|
+
type: z.string(),
|
|
44
|
+
title: z.string(),
|
|
45
|
+
status: z.number().openapi({
|
|
46
|
+
example: 400,
|
|
47
|
+
}),
|
|
48
|
+
traceId: z.string(),
|
|
49
|
+
signLink: z.string(),
|
|
50
|
+
});
|
|
51
|
+
export type BoldSignGetEmbeddedDocumentLinkResponseZod = z.infer<
|
|
52
|
+
typeof BoldSignGetEmbeddedDocumentLinkResponseZod
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Example error response:
|
|
57
|
+
* https://support.boldsign.com/kb/article/15855/resolving-locale-mismatch-errors-in-boldsign-esignature-api#error-description
|
|
58
|
+
*
|
|
59
|
+
* Example Success response:
|
|
60
|
+
* https://developers.boldsign.com/branding/create-brand/?region=us#example-response
|
|
61
|
+
* https://developers.boldsign.com/branding/update-brand/?region=us#example-response
|
|
62
|
+
*/
|
|
63
|
+
export const BoldSignUpsertBrandResponseZod = z.object({
|
|
64
|
+
errors: z.record(z.string(), z.array(z.string())),
|
|
65
|
+
type: z.string(),
|
|
66
|
+
title: z.string(),
|
|
67
|
+
status: z.number().openapi({
|
|
68
|
+
example: 400,
|
|
69
|
+
}),
|
|
70
|
+
traceId: z.string(),
|
|
71
|
+
brandId: z.string(),
|
|
72
|
+
});
|
|
73
|
+
export type BoldSignUpsertBrandResponseZod = z.infer<
|
|
74
|
+
typeof BoldSignUpsertBrandResponseZod
|
|
75
|
+
>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Example error response:
|
|
79
|
+
* https://support.boldsign.com/kb/article/15855/resolving-locale-mismatch-errors-in-boldsign-esignature-api#error-description
|
|
80
|
+
*
|
|
81
|
+
* Example Success response:
|
|
82
|
+
* https://developers.boldsign.com/branding/delete-brand/?region=us#example-response
|
|
83
|
+
*/
|
|
84
|
+
export const BoldSignDeleteBrandResponseZod = z.object({
|
|
85
|
+
errors: z.record(z.string(), z.array(z.string())),
|
|
86
|
+
type: z.string(),
|
|
87
|
+
title: z.string(),
|
|
88
|
+
status: z.number().openapi({
|
|
89
|
+
example: 400,
|
|
90
|
+
}),
|
|
91
|
+
traceId: z.string(),
|
|
92
|
+
message: z.string(),
|
|
93
|
+
});
|
|
94
|
+
export type BoldSignDeleteBrandResponseZod = z.infer<
|
|
95
|
+
typeof BoldSignDeleteBrandResponseZod
|
|
96
|
+
>;
|
|
97
|
+
|
|
98
|
+
export const SignerMessageResponseZod = z.object({
|
|
99
|
+
message: z.string(),
|
|
100
|
+
});
|
|
101
|
+
export type SignerMessageResponseZod = z.infer<typeof SignerMessageResponseZod>;
|
|
102
|
+
|
|
103
|
+
const BoundsSchema = z.object({
|
|
104
|
+
x: z.number(),
|
|
105
|
+
y: z.number(),
|
|
106
|
+
width: z.number(),
|
|
107
|
+
height: z.number(),
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const FormFieldSchema = z.object({
|
|
111
|
+
id: z.string(),
|
|
112
|
+
value: z.union([z.string(), z.number(), z.null()]).optional(),
|
|
113
|
+
name: z.string().optional(),
|
|
114
|
+
fieldType: z.string().optional(),
|
|
115
|
+
pageNumber: z.number().optional(),
|
|
116
|
+
bounds: BoundsSchema.optional(),
|
|
117
|
+
isRequired: z.boolean().optional(),
|
|
118
|
+
editableDateFieldSettings: z.record(z.string(), z.string()).optional(),
|
|
119
|
+
validationType: z.string().optional(),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const BaseSignerSchema = z.object({
|
|
123
|
+
signerType: z.literal('Signer'),
|
|
124
|
+
signerRole: z.string(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const TemplateSignerSchema = BaseSignerSchema.extend({
|
|
128
|
+
roleIndex: z.number(),
|
|
129
|
+
signerName: z.string(),
|
|
130
|
+
signerEmail: z.string().optional(),
|
|
131
|
+
signerOrder: z.number().optional(),
|
|
132
|
+
existingFormFields: z.array(FormFieldSchema),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const NonTemplateSignerSchema = BaseSignerSchema.extend({
|
|
136
|
+
name: z.string(),
|
|
137
|
+
emailAddress: z.string().optional(),
|
|
138
|
+
formFields: z.array(FormFieldSchema),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export const SignerDataSchema = z.union([
|
|
142
|
+
TemplateSignerSchema,
|
|
143
|
+
NonTemplateSignerSchema,
|
|
144
|
+
]);
|
|
145
|
+
|
|
146
|
+
const TemplateDetailFormFieldSchema = z.object({
|
|
147
|
+
id: z.string(),
|
|
148
|
+
fieldType: z.string(),
|
|
149
|
+
value: z.string(),
|
|
150
|
+
font: z.string(),
|
|
151
|
+
isRequired: z.boolean(),
|
|
152
|
+
isReadOnly: z.boolean(),
|
|
153
|
+
lineHeight: z.number(),
|
|
154
|
+
fontSize: z.number(),
|
|
155
|
+
fontHexColor: z.string(),
|
|
156
|
+
isUnderLineFont: z.boolean(),
|
|
157
|
+
isItalicFont: z.boolean(),
|
|
158
|
+
isBoldFont: z.boolean(),
|
|
159
|
+
groupName: z.string(),
|
|
160
|
+
placeholder: z.string(),
|
|
161
|
+
validationtype: z.string(),
|
|
162
|
+
validationCustomRegex: z.string(),
|
|
163
|
+
validationCustomRegexMessage: z.string().nullable(),
|
|
164
|
+
dateFormat: z.string(),
|
|
165
|
+
imageInfo: z.any().nullable(),
|
|
166
|
+
attachmentInfo: z.any().nullable(),
|
|
167
|
+
editableDateFieldSettings: z.any().nullable(),
|
|
168
|
+
conditionalRules: z.array(z.any()),
|
|
169
|
+
dropdownOptions: z.array(z.any()),
|
|
170
|
+
bounds: BoundsSchema,
|
|
171
|
+
pageNumber: z.number(),
|
|
172
|
+
dataSyncTag: z.string(),
|
|
173
|
+
textAlign: z.string(),
|
|
174
|
+
textDirection: z.string(),
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export type TemplateDetailFormFieldSchema = z.infer<
|
|
178
|
+
typeof TemplateDetailFormFieldSchema
|
|
179
|
+
>;
|
|
180
|
+
|
|
181
|
+
const RecipientNotificationSettingsSchema = z.object({
|
|
182
|
+
signatureRequest: z.boolean(),
|
|
183
|
+
declined: z.boolean(),
|
|
184
|
+
revoked: z.boolean(),
|
|
185
|
+
signed: z.boolean(),
|
|
186
|
+
completed: z.boolean(),
|
|
187
|
+
expired: z.boolean(),
|
|
188
|
+
reassigned: z.boolean(),
|
|
189
|
+
deleted: z.boolean(),
|
|
190
|
+
reminders: z.boolean(),
|
|
191
|
+
editRecipient: z.boolean(),
|
|
192
|
+
editDocument: z.boolean(),
|
|
193
|
+
viewed: z.boolean().optional(), // only present in the outer object
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const RoleSchema = z.object({
|
|
197
|
+
name: z.string(),
|
|
198
|
+
index: z.number(),
|
|
199
|
+
defaultSignerName: z.string(),
|
|
200
|
+
defaultSignerEmail: z.string(),
|
|
201
|
+
phoneNumber: z.string().nullable(),
|
|
202
|
+
signerOrder: z.number(),
|
|
203
|
+
signerType: z.string(),
|
|
204
|
+
hostEmail: z.string(),
|
|
205
|
+
hostName: z.string(),
|
|
206
|
+
language: z.number(),
|
|
207
|
+
allowRoleEdit: z.boolean(),
|
|
208
|
+
allowRoleDelete: z.boolean(),
|
|
209
|
+
enableAccessCode: z.boolean(),
|
|
210
|
+
enableEmailOTP: z.boolean(),
|
|
211
|
+
imposeAuthentication: z.string(),
|
|
212
|
+
deliveryMode: z.string(),
|
|
213
|
+
allowFieldConfiguration: z.boolean(),
|
|
214
|
+
formFields: z.array(TemplateDetailFormFieldSchema),
|
|
215
|
+
enableEditRecipients: z.boolean(),
|
|
216
|
+
enableDeleteRecipients: z.boolean(),
|
|
217
|
+
locale: z.string(),
|
|
218
|
+
recipientNotificationSettings: RecipientNotificationSettingsSchema,
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
export const TemplateRoleSchema = RoleSchema;
|
|
222
|
+
|
|
223
|
+
const FileDetailSchema = z.object({
|
|
224
|
+
documentName: z.string(),
|
|
225
|
+
order: z.number(),
|
|
226
|
+
pageCount: z.number(),
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const CreatedBySchema = z.object({
|
|
230
|
+
emailAddress: z.string(),
|
|
231
|
+
name: z.string(),
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
const DocumentInfoSchema = z.object({
|
|
235
|
+
language: z.number(),
|
|
236
|
+
title: z.string(),
|
|
237
|
+
description: z.string(),
|
|
238
|
+
locale: z.string(),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export const TemplateDataSchema = z.object({
|
|
242
|
+
templateId: z.string(),
|
|
243
|
+
title: z.string(),
|
|
244
|
+
description: z.string(),
|
|
245
|
+
documentTitle: z.string(),
|
|
246
|
+
documentMessage: z.string(),
|
|
247
|
+
files: z.array(FileDetailSchema),
|
|
248
|
+
roles: z.array(RoleSchema),
|
|
249
|
+
commonFields: z.array(z.any()),
|
|
250
|
+
cCDetails: z.array(z.any()),
|
|
251
|
+
brandId: z.string(),
|
|
252
|
+
allowMessageEditing: z.boolean(),
|
|
253
|
+
allowNewRoles: z.boolean(),
|
|
254
|
+
enableReassign: z.boolean(),
|
|
255
|
+
EnablePrintAndSign: z.boolean(),
|
|
256
|
+
enableSigningOrder: z.boolean(),
|
|
257
|
+
createdDate: z.number(),
|
|
258
|
+
createdBy: CreatedBySchema,
|
|
259
|
+
sharedTemplateDetail: z.array(z.any()),
|
|
260
|
+
documentInfo: z.array(DocumentInfoSchema),
|
|
261
|
+
labels: z.array(z.string()),
|
|
262
|
+
templateLabels: z.array(z.string()),
|
|
263
|
+
recipientNotificationSettings: RecipientNotificationSettingsSchema,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export type FormField = z.infer<typeof FormFieldSchema>;
|
|
267
|
+
export type SignerData = z.infer<typeof SignerDataSchema>;
|
|
268
|
+
export type TemplateDetailFormField = z.infer<
|
|
269
|
+
typeof TemplateDetailFormFieldSchema
|
|
270
|
+
>;
|
|
271
|
+
export type TemplateRole = z.infer<typeof TemplateRoleSchema>;
|
|
272
|
+
export type TemplateData = z.infer<typeof TemplateDataSchema>;
|
|
273
|
+
|
|
274
|
+
const DocumentFormFieldSchema = z.object({
|
|
275
|
+
id: z.string(),
|
|
276
|
+
type: z.string(),
|
|
277
|
+
value: z.string(),
|
|
278
|
+
font: z.string(),
|
|
279
|
+
isRequired: z.boolean(),
|
|
280
|
+
isReadOnly: z.boolean(),
|
|
281
|
+
lineHeight: z.number(),
|
|
282
|
+
fontSize: z.number(),
|
|
283
|
+
fontColor: z.string(),
|
|
284
|
+
isUnderline: z.boolean(),
|
|
285
|
+
isItalic: z.boolean(),
|
|
286
|
+
isBold: z.boolean(),
|
|
287
|
+
groupName: z.string(),
|
|
288
|
+
placeholder: z.string(),
|
|
289
|
+
validationtype: z.string(),
|
|
290
|
+
validationCustomRegex: z.string(),
|
|
291
|
+
validationCustomRegexMessage: z.string(),
|
|
292
|
+
dateFormat: z.string(),
|
|
293
|
+
imageInfo: z.null(),
|
|
294
|
+
attachmentInfo: z.null(),
|
|
295
|
+
fileInfo: z.null(),
|
|
296
|
+
editableDateFieldSettings: z.null(),
|
|
297
|
+
conditionalLogic: z.array(z.any()),
|
|
298
|
+
hyperlinkText: z.string(),
|
|
299
|
+
dropdownOptions: z.array(z.any()),
|
|
300
|
+
bounds: BoundsSchema,
|
|
301
|
+
pageNumber: z.number(),
|
|
302
|
+
dataSyncTag: z.string(),
|
|
303
|
+
textAlign: z.string(),
|
|
304
|
+
textDirection: z.string(),
|
|
305
|
+
characterSpacing: z.number(),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
const IdVerificationSchema = z.object({
|
|
309
|
+
type: z.string(),
|
|
310
|
+
maximumRetryCount: z.number(),
|
|
311
|
+
status: z.string(),
|
|
312
|
+
nameMatcher: z.string(),
|
|
313
|
+
requireLiveCapture: z.boolean(),
|
|
314
|
+
requireMatchingSelfie: z.boolean(),
|
|
315
|
+
holdForPrefill: z.boolean(),
|
|
316
|
+
prefillCompleted: z.boolean(),
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
const SignerDetailSchema = z.object({
|
|
320
|
+
signerName: z.string(),
|
|
321
|
+
signerRole: z.string(),
|
|
322
|
+
signerEmail: z.string(),
|
|
323
|
+
status: z.string(),
|
|
324
|
+
enableAccessCode: z.boolean(),
|
|
325
|
+
isAuthenticationFailed: z.boolean().nullable(),
|
|
326
|
+
enableEmailOTP: z.boolean(),
|
|
327
|
+
authenticationType: z.string(),
|
|
328
|
+
isDeliveryFailed: z.boolean(),
|
|
329
|
+
isViewed: z.boolean(),
|
|
330
|
+
order: z.number(),
|
|
331
|
+
signerType: z.string(),
|
|
332
|
+
hostEmail: z.string(),
|
|
333
|
+
hostName: z.string(),
|
|
334
|
+
isReassigned: z.boolean(),
|
|
335
|
+
privateMessage: z.string(),
|
|
336
|
+
allowFieldConfiguration: z.boolean(),
|
|
337
|
+
idVerification: IdVerificationSchema,
|
|
338
|
+
formFields: z.array(DocumentFormFieldSchema),
|
|
339
|
+
language: z.number(),
|
|
340
|
+
locale: z.string(),
|
|
341
|
+
recipientNotificationSettings: RecipientNotificationSettingsSchema,
|
|
342
|
+
authenticationRetryCount: z.number().nullable(),
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
const SenderDetailSchema = z.object({
|
|
346
|
+
name: z.string(),
|
|
347
|
+
privateMessage: z.null(),
|
|
348
|
+
emailAddress: z.string(),
|
|
349
|
+
isViewed: z.boolean(),
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
const FileSchema = z.object({
|
|
353
|
+
documentName: z.string(),
|
|
354
|
+
order: z.number(),
|
|
355
|
+
pageCount: z.number(),
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const ReminderSettingsSchema = z.object({
|
|
359
|
+
enableAutoReminder: z.boolean(),
|
|
360
|
+
reminderDays: z.number(),
|
|
361
|
+
reminderCount: z.number(),
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const DocumentHistorySchema = z.object({
|
|
365
|
+
id: z.string(),
|
|
366
|
+
name: z.string(),
|
|
367
|
+
email: z.string(),
|
|
368
|
+
toName: z.string(),
|
|
369
|
+
toEmail: z.string(),
|
|
370
|
+
ipaddress: z.string(),
|
|
371
|
+
action: z.string(),
|
|
372
|
+
timestamp: z.number(),
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
const DocumentSchema = z.object({
|
|
376
|
+
documentId: z.string(),
|
|
377
|
+
brandId: z.string(),
|
|
378
|
+
messageTitle: z.string(),
|
|
379
|
+
documentDescription: z.string(),
|
|
380
|
+
status: z.string(),
|
|
381
|
+
files: z.array(FileSchema),
|
|
382
|
+
senderDetail: SenderDetailSchema,
|
|
383
|
+
signerDetails: z.array(SignerDetailSchema),
|
|
384
|
+
behalfOf: z.null(),
|
|
385
|
+
ccDetails: z.array(z.any()),
|
|
386
|
+
reminderSettings: ReminderSettingsSchema,
|
|
387
|
+
reassign: z.array(z.any()),
|
|
388
|
+
documentHistory: z.array(DocumentHistorySchema),
|
|
389
|
+
activityBy: z.string(),
|
|
390
|
+
activityDate: z.number(),
|
|
391
|
+
activityAction: z.string(),
|
|
392
|
+
createdDate: z.number(),
|
|
393
|
+
expiryDays: z.number(),
|
|
394
|
+
expiryDate: z.null(),
|
|
395
|
+
enableSigningOrder: z.boolean(),
|
|
396
|
+
isDeleted: z.boolean(),
|
|
397
|
+
revokeMessage: z.string(),
|
|
398
|
+
declineMessage: z.string(),
|
|
399
|
+
applicationId: z.string(),
|
|
400
|
+
labels: z.array(z.any()),
|
|
401
|
+
disableEmails: z.boolean(),
|
|
402
|
+
disableExpiryAlert: z.boolean(),
|
|
403
|
+
hideDocumentId: z.boolean(),
|
|
404
|
+
enablePrintAndSign: z.boolean(),
|
|
405
|
+
enableReassign: z.boolean(),
|
|
406
|
+
recipientNotificationSettings: RecipientNotificationSettingsSchema,
|
|
407
|
+
scheduledSendTime: z.number(),
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
export type DocumentSchema = z.infer<typeof DocumentSchema>;
|
|
411
|
+
|
|
412
|
+
export const TemplateZod = z.object({
|
|
413
|
+
documentId: z.string(),
|
|
414
|
+
templateName: z.string(),
|
|
415
|
+
});
|
|
416
|
+
export type TemplateZod = z.infer<typeof TemplateZod>;
|
|
417
|
+
|
|
418
|
+
export const PageDetailZod = z.object({
|
|
419
|
+
totalRecordsCount: z.number(),
|
|
420
|
+
pageSize: z.number(),
|
|
421
|
+
totalPages: z.number(),
|
|
422
|
+
page: z.number(),
|
|
423
|
+
});
|
|
424
|
+
export type PageDetail = z.infer<typeof PageDetailZod>;
|
|
425
|
+
|
|
426
|
+
export const TemplatesPaginatedZod = z.object({
|
|
427
|
+
items: z.array(TemplateZod),
|
|
428
|
+
meta: IPaginationMeta,
|
|
429
|
+
});
|
|
430
|
+
export type TemplatesPaginatedZod = z.infer<typeof TemplatesPaginatedZod>;
|
|
431
|
+
export type SignerDetailSchema = z.infer<typeof SignerDetailSchema>;
|
|
432
|
+
|
|
433
|
+
export const SignerTemplateSchema = z.object({
|
|
434
|
+
id: z.string(),
|
|
435
|
+
tid: z.string().max(255),
|
|
436
|
+
name: z.string().max(255).nullable(),
|
|
437
|
+
type: z.nativeEnum(TemplateType),
|
|
438
|
+
status: z.nativeEnum(TemplateStatus),
|
|
439
|
+
complianceStatus: z.nativeEnum(ComplianceReview),
|
|
440
|
+
log: z.string().nullable(),
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
export type SignerTemplateZod = z.infer<typeof SignerTemplateSchema>;
|
|
444
|
+
|
|
445
|
+
export const SignerTemplatesPaginatedZod = z.object({
|
|
446
|
+
items: z.array(SignerTemplateSchema),
|
|
447
|
+
meta: IPaginationMeta,
|
|
448
|
+
});
|
|
449
|
+
export type SignerTemplatesPaginatedZod = z.infer<
|
|
450
|
+
typeof SignerTemplatesPaginatedZod
|
|
451
|
+
>;
|
|
452
|
+
|
|
453
|
+
export const SignerBrandSchema = z.object({
|
|
454
|
+
id: z.string(),
|
|
455
|
+
tid: z.string(),
|
|
456
|
+
brandName: z.string().nullable(),
|
|
457
|
+
brandLogoId: z.string().nullable(),
|
|
458
|
+
backgroundColor: z.string().nullable(),
|
|
459
|
+
buttonColor: z.string().nullable(),
|
|
460
|
+
buttonTextColor: z.string().nullable(),
|
|
461
|
+
complianceStatus: z.nativeEnum(ComplianceReview),
|
|
462
|
+
});
|
|
463
|
+
export type SignerBrandZod = z.infer<typeof SignerBrandSchema>;
|
|
464
|
+
|
|
465
|
+
export const SignerBrandsPaginatedZod = z.object({
|
|
466
|
+
items: z.array(SignerBrandSchema),
|
|
467
|
+
meta: IPaginationMeta,
|
|
468
|
+
});
|
|
469
|
+
export type SignerBrandsPaginatedZod = z.infer<typeof SignerBrandsPaginatedZod>;
|
|
470
|
+
|
|
471
|
+
export const SignerSenderIdentitySchema = z.object({
|
|
472
|
+
id: z.string(),
|
|
473
|
+
name: z.string().nullable(),
|
|
474
|
+
email: z.string().nullable(),
|
|
475
|
+
status: z.nativeEnum(SenderIdentityStatus),
|
|
476
|
+
complianceStatus: z.nativeEnum(ComplianceReview),
|
|
477
|
+
});
|
|
478
|
+
export type SignerSenderIdentityZod = z.infer<
|
|
479
|
+
typeof SignerSenderIdentitySchema
|
|
480
|
+
>;
|
|
481
|
+
|
|
482
|
+
export const SignerSenderIdentitiesPaginatedZod = z.object({
|
|
483
|
+
items: z.array(SignerSenderIdentitySchema),
|
|
484
|
+
meta: IPaginationMeta,
|
|
485
|
+
});
|
|
486
|
+
export type SignerSenderIdentitiesPaginatedZod = z.infer<
|
|
487
|
+
typeof SignerSenderIdentitiesPaginatedZod
|
|
488
|
+
>;
|
|
489
|
+
|
|
490
|
+
export const ValidatedTemplateResponse = z.object({
|
|
491
|
+
templateId: z.string().min(1).max(36),
|
|
492
|
+
errorMessage: z.string().min(1).max(255).optional(),
|
|
493
|
+
requiredVariables: z.record(z.string(), z.string()).optional(),
|
|
494
|
+
additionalVariables: z.record(z.string(), z.string()).optional(),
|
|
495
|
+
configCheck: z.string().min(1).max(5),
|
|
496
|
+
});
|
|
497
|
+
export type ValidatedTemplateResponse = z.infer<
|
|
498
|
+
typeof ValidatedTemplateResponse
|
|
499
|
+
>;
|
|
500
|
+
|
|
501
|
+
export const ValidatedTemplatesResponse = z.array(ValidatedTemplateResponse);
|
|
502
|
+
export type ValidatedTemplatesResponse = z.infer<
|
|
503
|
+
typeof ValidatedTemplatesResponse
|
|
504
|
+
>;
|
|
505
|
+
|
|
506
|
+
export const TemplatePathParams = z.object({
|
|
507
|
+
templateId: z.string().min(1).max(36),
|
|
508
|
+
});
|
|
509
|
+
export type TemplatePathParams = z.infer<typeof TemplatePathParams>;
|
|
510
|
+
|
|
511
|
+
export const brandIdSchema = z.string().refine(
|
|
512
|
+
(value) => {
|
|
513
|
+
try {
|
|
514
|
+
const tid = TypeID.fromString(value);
|
|
515
|
+
return tid.getType() === 'signer_brand';
|
|
516
|
+
} catch {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
message:
|
|
522
|
+
'Invalid brand ID format. Must be a valid TypeID with "signer_brand" prefix. ex: signer_brand_00041061050r3gg28a1c60t3gf',
|
|
523
|
+
},
|
|
524
|
+
);
|
|
525
|
+
|
|
526
|
+
export const BrandPathParams = z.object({
|
|
527
|
+
id: brandIdSchema,
|
|
528
|
+
});
|
|
529
|
+
export type BrandPathParams = z.infer<typeof BrandPathParams>;
|
|
530
|
+
|
|
531
|
+
export const senderIdentityIdSchema = z.string().refine(
|
|
532
|
+
(value) => {
|
|
533
|
+
try {
|
|
534
|
+
const tid = TypeID.fromString(value);
|
|
535
|
+
return tid.getType() === 'signer_sender_identity';
|
|
536
|
+
} catch {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
message:
|
|
542
|
+
'Invalid sender identity ID format. Must be a valid TypeID with "signer_sender_identity" prefix. ex: signer_sender_identity_00041061050r3gg28a1c60t3gf',
|
|
543
|
+
},
|
|
544
|
+
);
|
|
545
|
+
|
|
546
|
+
export const SenderIdentityPathParams = z.object({
|
|
547
|
+
id: senderIdentityIdSchema,
|
|
548
|
+
});
|
|
549
|
+
export type SenderIdentityPathParams = z.infer<typeof SenderIdentityPathParams>;
|
|
550
|
+
|
|
551
|
+
const BrandSchema = z.object({
|
|
552
|
+
brandId: z.string().uuid(),
|
|
553
|
+
brandLogo: z.string(),
|
|
554
|
+
brandName: z.string(),
|
|
555
|
+
backgroundColor: z.string(),
|
|
556
|
+
buttonColor: z.string(),
|
|
557
|
+
buttonTextColor: z.string(),
|
|
558
|
+
emailDisplayName: z.string(),
|
|
559
|
+
disclaimerTitle: z.string(),
|
|
560
|
+
disclaimerDescription: z.string(),
|
|
561
|
+
redirectUrl: z.string().url(),
|
|
562
|
+
isDefault: z.boolean(),
|
|
563
|
+
canHideTagLine: z.boolean(),
|
|
564
|
+
combineAuditTrail: z.boolean(),
|
|
565
|
+
emailSignedDocument: z.string(),
|
|
566
|
+
documentTimeZone: z.string(),
|
|
567
|
+
showBuiltInFormFields: z.boolean(),
|
|
568
|
+
allowCustomFieldCreation: z.boolean(),
|
|
569
|
+
showSharedCustomFields: z.boolean(),
|
|
570
|
+
hideDecline: z.boolean(),
|
|
571
|
+
hideSave: z.boolean(),
|
|
572
|
+
excludeAuditTrailFromEmail: z.boolean(),
|
|
573
|
+
|
|
574
|
+
documentExpirySettings: z.object({
|
|
575
|
+
expiryDateType: z.string(),
|
|
576
|
+
expiryValue: z.number(),
|
|
577
|
+
enableDefaultExpiryAlert: z.boolean(),
|
|
578
|
+
enableAutoReminder: z.boolean(),
|
|
579
|
+
reminderDays: z.number(),
|
|
580
|
+
reminderCount: z.number(),
|
|
581
|
+
}),
|
|
582
|
+
|
|
583
|
+
customDomainSettings: z.object({
|
|
584
|
+
domainName: z.string(),
|
|
585
|
+
fromName: z.string(),
|
|
586
|
+
}),
|
|
587
|
+
|
|
588
|
+
isDomainVerified: z.boolean(),
|
|
589
|
+
});
|
|
590
|
+
export type BrandSchema = z.infer<typeof BrandSchema>;
|
|
591
|
+
|
|
592
|
+
export const UpdateSignerTemplateZod = z.object({
|
|
593
|
+
complianceStatus: z.nativeEnum(ComplianceReview).optional(),
|
|
594
|
+
});
|
|
595
|
+
export type UpdateSignerTemplateZod = z.infer<typeof UpdateSignerTemplateZod>;
|
|
596
|
+
|
|
597
|
+
export const CreateSignerBrandZod = z.object({
|
|
598
|
+
brandName: z.string().min(1).max(255),
|
|
599
|
+
emailDisplayName: z.string().min(1).max(255),
|
|
600
|
+
backgroundColor: z.string().min(1).max(7),
|
|
601
|
+
buttonColor: z.string().min(1).max(7),
|
|
602
|
+
buttonTextColor: z.string().min(1).max(7),
|
|
603
|
+
accountId: z.string().min(1),
|
|
604
|
+
});
|
|
605
|
+
export type CreateSignerBrandZod = z.infer<typeof CreateSignerBrandZod>;
|
|
606
|
+
|
|
607
|
+
export const UpdateSignerBrandZod = z.object({
|
|
608
|
+
brandName: z.string().min(1).max(255).optional(),
|
|
609
|
+
brandLogoId: z.string().min(1).optional(),
|
|
610
|
+
emailDisplayName: z.string().min(1).max(255).optional(),
|
|
611
|
+
backgroundColor: z.string().min(1).max(7).optional(),
|
|
612
|
+
buttonColor: z.string().min(1).max(7).optional(),
|
|
613
|
+
buttonTextColor: z.string().min(1).max(7).optional(),
|
|
614
|
+
complianceStatus: z.nativeEnum(ComplianceReview).optional(),
|
|
615
|
+
});
|
|
616
|
+
export type UpdateSignerBrandZod = z.infer<typeof UpdateSignerBrandZod>;
|
|
617
|
+
|
|
618
|
+
export const CreateSignerSenderIdentityZod = z.object({
|
|
619
|
+
name: z.string().min(1).max(255),
|
|
620
|
+
email: z.string().email().openapi({ example: 'test@test.com' }),
|
|
621
|
+
});
|
|
622
|
+
export type CreateSignerSenderIdentityZod = z.infer<
|
|
623
|
+
typeof CreateSignerSenderIdentityZod
|
|
624
|
+
>;
|
|
625
|
+
|
|
626
|
+
export const UpdateSignerSenderIdentityZod = z.object({
|
|
627
|
+
name: z.string().min(1).max(255).optional(),
|
|
628
|
+
email: z.string().email().openapi({ example: 'test@test.com' }).optional(),
|
|
629
|
+
complianceStatus: z.nativeEnum(ComplianceReview).optional(),
|
|
630
|
+
status: z.nativeEnum(SenderIdentityStatus).optional(),
|
|
631
|
+
});
|
|
632
|
+
export type UpdateSignerSenderIdentityZod = z.infer<
|
|
633
|
+
typeof UpdateSignerSenderIdentityZod
|
|
634
|
+
>;
|
|
635
|
+
|
|
636
|
+
export const DocumentRecipientChangeBody = z.object({
|
|
637
|
+
newSignerName: z.string().min(1).max(255),
|
|
638
|
+
reason: z.string().min(1).max(255),
|
|
639
|
+
newSignerEmail: z.string().min(1).max(255),
|
|
640
|
+
oldSignerEmail: z.string().min(1).max(255),
|
|
641
|
+
order: z.number().optional(), // optional if not always provided
|
|
642
|
+
});
|
|
643
|
+
export type DocumentRecipientChangeBody = z.infer<
|
|
644
|
+
typeof DocumentRecipientChangeBody
|
|
645
|
+
>;
|
|
646
|
+
|
|
647
|
+
export const SignerPaginationQuery = PaginationOptionsZod.merge(
|
|
648
|
+
z.object({
|
|
649
|
+
status: z.nativeEnum(ComplianceReview).optional(),
|
|
650
|
+
}),
|
|
651
|
+
);
|