@dalmore/api-contracts 1.0.3 → 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/README.md +34 -60
- package/index.mjs +1001 -18638
- package/package.json +5 -53
- package/src/common/types/address.spec.ts +203 -0
- package/src/common/types/batch-jobs.types.ts +1 -0
- package/src/common/types/common.types.spec.ts +336 -0
- package/src/common/types/files.types.spec.ts +154 -0
- package/src/common/types/issuer-payment-method.types.spec.ts +612 -0
- package/src/common/types/offering.types.spec.ts +91 -0
- package/src/common/types/phone.spec.ts +76 -0
- package/src/common/types/queue.types.ts +1 -0
- package/src/common/types/reminder-config.types.ts +40 -0
- package/src/common/types/site-link.types.spec.ts +134 -0
- package/src/common/types/trade.types.ts +2 -4
- package/clients/index.mjs +0 -10970
- package/compliance/index.mjs +0 -20016
- package/compliance-apikey/index.mjs +0 -9795
- package/helpers/index.mjs +0 -146
- package/investors/index.mjs +0 -12844
- package/issuers/index.mjs +0 -16168
- package/secondaries/index.mjs +0 -10282
- package/src/common/helpers/index.ts +0 -205
- package/src/contracts/compliance/account-contacts/index.ts +0 -82
- package/src/contracts/compliance/account-managers/index.ts +0 -142
- package/src/contracts/compliance/accounts/index.ts +0 -187
- package/src/contracts/compliance/activities/index.ts +0 -55
- package/src/contracts/compliance/aic/index.ts +0 -60
- package/src/contracts/compliance/api-keys/index.ts +0 -91
- package/src/contracts/compliance/assets/index.ts +0 -122
- package/src/contracts/compliance/auth/index.ts +0 -134
- package/src/contracts/compliance/batch-jobs/index.ts +0 -62
- package/src/contracts/compliance/bonus-tiers/index.ts +0 -55
- package/src/contracts/compliance/checklist/index.ts +0 -87
- package/src/contracts/compliance/checklist-items/index.ts +0 -86
- package/src/contracts/compliance/covered-persons/index.ts +0 -97
- package/src/contracts/compliance/dashboard/index.ts +0 -111
- package/src/contracts/compliance/data-records/index.ts +0 -116
- package/src/contracts/compliance/data-rooms/index.ts +0 -113
- package/src/contracts/compliance/default-theme-configs/index.ts +0 -95
- package/src/contracts/compliance/disbursement/index.ts +0 -165
- package/src/contracts/compliance/disbursement-approval-users/index.ts +0 -84
- package/src/contracts/compliance/disbursement-transactions/index.ts +0 -37
- package/src/contracts/compliance/domain-filters/index.ts +0 -117
- package/src/contracts/compliance/email-themes/index.ts +0 -284
- package/src/contracts/compliance/escrow-accounts/index.ts +0 -85
- package/src/contracts/compliance/exchange-api-keys/index.ts +0 -129
- package/src/contracts/compliance/exchange-imports/index.ts +0 -137
- package/src/contracts/compliance/files/index.ts +0 -267
- package/src/contracts/compliance/files-public/index.ts +0 -188
- package/src/contracts/compliance/health/index.ts +0 -26
- package/src/contracts/compliance/index.ts +0 -147
- package/src/contracts/compliance/individuals/index.ts +0 -57
- package/src/contracts/compliance/investor-accounts/index.ts +0 -141
- package/src/contracts/compliance/invites/index.ts +0 -137
- package/src/contracts/compliance/issuer-bank-accounts/index.ts +0 -81
- package/src/contracts/compliance/issuer-payment-methods/index.ts +0 -81
- package/src/contracts/compliance/issuers/index.ts +0 -97
- package/src/contracts/compliance/job-items/index.ts +0 -58
- package/src/contracts/compliance/jobs/index.ts +0 -59
- package/src/contracts/compliance/kyb/index.ts +0 -54
- package/src/contracts/compliance/kyc/index.ts +0 -77
- package/src/contracts/compliance/legal-entities/index.ts +0 -57
- package/src/contracts/compliance/login-histories/index.ts +0 -37
- package/src/contracts/compliance/notes/index.ts +0 -69
- package/src/contracts/compliance/notion-databases/index.ts +0 -107
- package/src/contracts/compliance/notion-pages/index.ts +0 -105
- package/src/contracts/compliance/offering-reports/index.ts +0 -149
- package/src/contracts/compliance/offerings/index.ts +0 -233
- package/src/contracts/compliance/pages/index.ts +0 -178
- package/src/contracts/compliance/payment-methods/index.ts +0 -57
- package/src/contracts/compliance/rejection-reasons/index.ts +0 -32
- package/src/contracts/compliance/review/index.ts +0 -169
- package/src/contracts/compliance/roles/index.ts +0 -34
- package/src/contracts/compliance/secondary-customers/index.ts +0 -77
- package/src/contracts/compliance/secondary-orders/index.ts +0 -60
- package/src/contracts/compliance/secondary-trades/index.ts +0 -100
- package/src/contracts/compliance/secure-requests/index.ts +0 -54
- package/src/contracts/compliance/signer/index.ts +0 -369
- package/src/contracts/compliance/site-links/index.ts +0 -128
- package/src/contracts/compliance/site-settings/index.ts +0 -669
- package/src/contracts/compliance/sites/index.ts +0 -56
- package/src/contracts/compliance/state-machine/index.ts +0 -94
- package/src/contracts/compliance/tasks/index.ts +0 -91
- package/src/contracts/compliance/third-parties/index.ts +0 -52
- package/src/contracts/compliance/trade-line-items/index.ts +0 -59
- package/src/contracts/compliance/trades/index.ts +0 -230
- package/src/contracts/compliance/transactions/index.ts +0 -161
- package/src/contracts/compliance/user-manuals/index.ts +0 -271
- package/src/contracts/compliance/user-settings/index.ts +0 -189
- package/src/contracts/compliance/users/index.ts +0 -200
- package/src/contracts/compliance/webhooks/index.ts +0 -41
- package/src/contracts/compliance-apikey/accounts/index.ts +0 -58
- package/src/contracts/compliance-apikey/index.ts +0 -14
- package/src/contracts/index.ts +0 -6
- package/src/contracts/investors/account-contacts/index.ts +0 -58
- package/src/contracts/investors/aic/index.ts +0 -59
- package/src/contracts/investors/assets/index.ts +0 -61
- package/src/contracts/investors/auth/index.ts +0 -116
- package/src/contracts/investors/bonus-tiers/index.ts +0 -37
- package/src/contracts/investors/cart/index.ts +0 -75
- package/src/contracts/investors/contact-us/index.ts +0 -48
- package/src/contracts/investors/data-records/index.ts +0 -113
- package/src/contracts/investors/data-rooms/index.ts +0 -96
- package/src/contracts/investors/files/index.ts +0 -167
- package/src/contracts/investors/files-public/index.ts +0 -185
- package/src/contracts/investors/index.ts +0 -72
- package/src/contracts/investors/individuals/index.ts +0 -99
- package/src/contracts/investors/investor-accounts/index.ts +0 -110
- package/src/contracts/investors/issuer-payment-methods/index.ts +0 -36
- package/src/contracts/investors/issuers/index.ts +0 -30
- package/src/contracts/investors/legal-entities/index.ts +0 -93
- package/src/contracts/investors/notes/index.ts +0 -69
- package/src/contracts/investors/offerings/index.ts +0 -93
- package/src/contracts/investors/pages/index.ts +0 -88
- package/src/contracts/investors/payment-methods/index.ts +0 -149
- package/src/contracts/investors/portfolios/index.ts +0 -53
- package/src/contracts/investors/sites/index.ts +0 -96
- package/src/contracts/investors/tasks/index.ts +0 -111
- package/src/contracts/investors/trade-line-items/index.ts +0 -75
- package/src/contracts/investors/trades/index.ts +0 -114
- package/src/contracts/investors/transactions/index.ts +0 -37
- package/src/contracts/investors/trusted-contacts/index.ts +0 -93
- package/src/contracts/investors/user-manuals/index.ts +0 -62
- package/src/contracts/investors/user-settings/index.ts +0 -170
- package/src/contracts/investors/users/index.ts +0 -45
- package/src/contracts/investors/webhooks/index.ts +0 -30
- package/src/contracts/issuers/account-contacts/index.ts +0 -76
- package/src/contracts/issuers/account-integrations/index.ts +0 -97
- package/src/contracts/issuers/accounts/index.ts +0 -97
- package/src/contracts/issuers/activities/index.ts +0 -54
- package/src/contracts/issuers/aic/index.ts +0 -39
- package/src/contracts/issuers/api-key-logs/index.ts +0 -53
- package/src/contracts/issuers/api-keys/index.ts +0 -93
- package/src/contracts/issuers/assets/index.ts +0 -122
- package/src/contracts/issuers/auth/index.ts +0 -152
- package/src/contracts/issuers/bonus-tiers/index.ts +0 -55
- package/src/contracts/issuers/contact-us/index.ts +0 -48
- package/src/contracts/issuers/covered-persons/index.ts +0 -136
- package/src/contracts/issuers/dashboard/index.ts +0 -72
- package/src/contracts/issuers/data-records/index.ts +0 -257
- package/src/contracts/issuers/data-rooms/index.ts +0 -134
- package/src/contracts/issuers/disbursement-approval-users/index.ts +0 -82
- package/src/contracts/issuers/disbursement-transactions/index.ts +0 -53
- package/src/contracts/issuers/disbursements/index.ts +0 -153
- package/src/contracts/issuers/email-themes/index.ts +0 -242
- package/src/contracts/issuers/escrow-accounts/index.ts +0 -81
- package/src/contracts/issuers/exchange-api-keys/index.ts +0 -144
- package/src/contracts/issuers/files/index.ts +0 -166
- package/src/contracts/issuers/files-public/index.ts +0 -166
- package/src/contracts/issuers/health/index.ts +0 -24
- package/src/contracts/issuers/index.ts +0 -112
- package/src/contracts/issuers/investor-accounts/index.ts +0 -148
- package/src/contracts/issuers/invites/index.ts +0 -129
- package/src/contracts/issuers/issuer/index.ts +0 -94
- package/src/contracts/issuers/issuer-bank-accounts/index.ts +0 -81
- package/src/contracts/issuers/issuer-payment-methods/index.ts +0 -136
- package/src/contracts/issuers/kyc/index.ts +0 -38
- package/src/contracts/issuers/login-histories/index.ts +0 -51
- package/src/contracts/issuers/notes/index.ts +0 -69
- package/src/contracts/issuers/offerings/index.ts +0 -206
- package/src/contracts/issuers/pages/index.ts +0 -138
- package/src/contracts/issuers/payment-methods/index.ts +0 -61
- package/src/contracts/issuers/portfolios/index.ts +0 -36
- package/src/contracts/issuers/rejection-reasons/index.ts +0 -32
- package/src/contracts/issuers/review/index.ts +0 -63
- package/src/contracts/issuers/secondary-customers/index.ts +0 -55
- package/src/contracts/issuers/secondary-orders/index.ts +0 -57
- package/src/contracts/issuers/secondary-trades/index.ts +0 -57
- package/src/contracts/issuers/secure-requests/index.ts +0 -34
- package/src/contracts/issuers/site-links/index.ts +0 -116
- package/src/contracts/issuers/site-settings/index.ts +0 -585
- package/src/contracts/issuers/sites/index.ts +0 -32
- package/src/contracts/issuers/tasks/index.ts +0 -111
- package/src/contracts/issuers/trades/index.ts +0 -132
- package/src/contracts/issuers/transactions/index.ts +0 -158
- package/src/contracts/issuers/user-manuals/index.ts +0 -62
- package/src/contracts/issuers/user-settings/index.ts +0 -170
- package/src/contracts/issuers/users/index.ts +0 -126
- package/src/contracts/secondaries/accounts/index.ts +0 -58
- package/src/contracts/secondaries/index.ts +0 -23
- package/src/contracts/secondaries/secondary-customers/index.ts +0 -55
- package/src/contracts/secondaries/secondary-issuers/index.ts +0 -94
- package/src/contracts/secondaries/secondary-orders/index.ts +0 -56
- package/src/contracts/secondaries/secondary-securities/index.ts +0 -95
- package/src/contracts/secondaries/secondary-trades/index.ts +0 -56
- package/types/index.mjs +0 -10320
package/helpers/index.mjs
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { HttpStatus } from '@nestjs/common';
|
|
2
|
-
import parsePhoneNumberFromString from 'libphonenumber-js';
|
|
3
|
-
import { err, ok } from 'neverthrow';
|
|
4
|
-
|
|
5
|
-
// src/common/types/contract-helpers.ts
|
|
6
|
-
var validateUSZipCode = (zipCode) => {
|
|
7
|
-
const regex = /^[0-9]{5}(?:-[0-9]{4})?$/;
|
|
8
|
-
return regex.test(zipCode);
|
|
9
|
-
};
|
|
10
|
-
var validateCanadaZipCode = (zipCode) => {
|
|
11
|
-
const regex = /^[A-Za-z]\d[A-Za-z] \d[A-Za-z]\d$/;
|
|
12
|
-
return regex.test(zipCode);
|
|
13
|
-
};
|
|
14
|
-
function normalizeShortDate(input) {
|
|
15
|
-
const [month, day, year] = input.split("/");
|
|
16
|
-
if (!month || !day || !year) {
|
|
17
|
-
throw new Error("Invalid date format");
|
|
18
|
-
}
|
|
19
|
-
const paddedMonth = month.padStart(2, "0");
|
|
20
|
-
const paddedDay = day.padStart(2, "0");
|
|
21
|
-
const fullYear = year.length === 2 ? `20${year}` : year;
|
|
22
|
-
return `${paddedMonth}/${paddedDay}/${fullYear}`;
|
|
23
|
-
}
|
|
24
|
-
function slugify(input, exclude = false) {
|
|
25
|
-
if (exclude) {
|
|
26
|
-
const excludeWords = ["llc", "inc", "corp", "co"];
|
|
27
|
-
const negativeWordsList = [
|
|
28
|
-
"www",
|
|
29
|
-
"api",
|
|
30
|
-
"admin",
|
|
31
|
-
"dashboard",
|
|
32
|
-
"auth",
|
|
33
|
-
"cdn",
|
|
34
|
-
"static",
|
|
35
|
-
"blog",
|
|
36
|
-
"support",
|
|
37
|
-
"status",
|
|
38
|
-
"mail",
|
|
39
|
-
"smtp",
|
|
40
|
-
"ftp",
|
|
41
|
-
"ssh",
|
|
42
|
-
"login",
|
|
43
|
-
"register",
|
|
44
|
-
"signup",
|
|
45
|
-
"account",
|
|
46
|
-
"accounts",
|
|
47
|
-
"user",
|
|
48
|
-
"users",
|
|
49
|
-
"profile",
|
|
50
|
-
"settings",
|
|
51
|
-
"help",
|
|
52
|
-
"docs",
|
|
53
|
-
"documentation",
|
|
54
|
-
"developer",
|
|
55
|
-
"developers",
|
|
56
|
-
"app",
|
|
57
|
-
"apps",
|
|
58
|
-
"test",
|
|
59
|
-
"demo",
|
|
60
|
-
"staging",
|
|
61
|
-
"dev",
|
|
62
|
-
"prod",
|
|
63
|
-
"production",
|
|
64
|
-
"beta",
|
|
65
|
-
"alpha",
|
|
66
|
-
"portal",
|
|
67
|
-
"portals",
|
|
68
|
-
"client",
|
|
69
|
-
"clients",
|
|
70
|
-
"investor",
|
|
71
|
-
"investors",
|
|
72
|
-
"issuer",
|
|
73
|
-
"issuers",
|
|
74
|
-
"compliance",
|
|
75
|
-
"offering",
|
|
76
|
-
"offerings",
|
|
77
|
-
"trade",
|
|
78
|
-
"trades"
|
|
79
|
-
];
|
|
80
|
-
let slug = input.toLowerCase().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
81
|
-
excludeWords.forEach((word) => {
|
|
82
|
-
slug = slug.replace(new RegExp(`-${word}$`, "i"), "");
|
|
83
|
-
});
|
|
84
|
-
if (negativeWordsList.includes(slug)) {
|
|
85
|
-
return "new-account";
|
|
86
|
-
}
|
|
87
|
-
return slug;
|
|
88
|
-
}
|
|
89
|
-
return input.toLowerCase().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
90
|
-
}
|
|
91
|
-
var authHeader = {
|
|
92
|
-
Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
|
|
93
|
-
};
|
|
94
|
-
var generateCurlExample = (method, path, options) => {
|
|
95
|
-
const baseUrl = "https://dalmore-client-portal-api-prod.onrender.com/api/v1";
|
|
96
|
-
let curl = `curl -X ${method.toUpperCase()} '${baseUrl}${path}`;
|
|
97
|
-
if (options.query) {
|
|
98
|
-
const queryString = new URLSearchParams(options.query).toString();
|
|
99
|
-
curl += `?${queryString}`;
|
|
100
|
-
}
|
|
101
|
-
curl += "'";
|
|
102
|
-
if (options.headers) {
|
|
103
|
-
Object.entries(options.headers).forEach(([key, value]) => {
|
|
104
|
-
curl += ` \\
|
|
105
|
-
--header '${key}: ${value}'`;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if (options.body) {
|
|
109
|
-
curl += ` \\
|
|
110
|
-
--header 'Content-Type: application/json'`;
|
|
111
|
-
curl += ` \\
|
|
112
|
-
--data '${JSON.stringify(options.body)}'`;
|
|
113
|
-
}
|
|
114
|
-
if (options.formData) {
|
|
115
|
-
Object.entries(options.formData).forEach(([key, value]) => {
|
|
116
|
-
curl += ` \\
|
|
117
|
-
--form '${key}=${value}'`;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return curl;
|
|
121
|
-
};
|
|
122
|
-
var generateApiDescription = (summary, method, path, options) => {
|
|
123
|
-
const curlExample = generateCurlExample(method, path, options);
|
|
124
|
-
return `${summary}
|
|
125
|
-
|
|
126
|
-
### Example curl request
|
|
127
|
-
|
|
128
|
-
\`\`\`bash
|
|
129
|
-
${curlExample}
|
|
130
|
-
\`\`\``;
|
|
131
|
-
};
|
|
132
|
-
function normalizePhoneNumber(phoneNumber, countryCode) {
|
|
133
|
-
const parsedPhoneNumber = parsePhoneNumberFromString(
|
|
134
|
-
phoneNumber,
|
|
135
|
-
countryCode
|
|
136
|
-
);
|
|
137
|
-
if (!parsedPhoneNumber || !parsedPhoneNumber.isValid()) {
|
|
138
|
-
return err({
|
|
139
|
-
status: HttpStatus.BAD_REQUEST,
|
|
140
|
-
message: "Invalid phone number. Only numbers"
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return ok(parsedPhoneNumber);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { authHeader, generateApiDescription, normalizePhoneNumber, normalizeShortDate, slugify, validateCanadaZipCode, validateUSZipCode };
|