@dalmore/api-contracts 1.0.1 → 1.0.3
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 +12 -7
- package/clients/index.mjs +10970 -0
- package/compliance/index.mjs +20016 -0
- package/compliance-apikey/index.mjs +9795 -0
- package/helpers/index.mjs +146 -0
- package/index.mjs +28607 -0
- package/investors/index.mjs +12844 -0
- package/issuers/index.mjs +16168 -0
- package/package.json +42 -31
- package/secondaries/index.mjs +10282 -0
- package/src/common/helpers/index.ts +205 -0
- package/{common → src/common}/types/batch-jobs.types.ts +0 -1
- package/{common → src/common}/types/common.types.ts +1 -1
- package/src/common/types/contract-helpers.ts +205 -0
- package/{common → src/common}/types/page.types.ts +1 -1
- package/{common → src/common}/types/queue.types.ts +0 -1
- package/{common → src/common}/types/trade.types.ts +4 -2
- package/{common → src/common}/types/zip.type.ts +1 -1
- package/types/index.mjs +10320 -0
- package/common/helpers/index.ts +0 -88
- package/common/types/contract-helpers.ts +0 -88
- package/common/types/reminder-config.types.ts +0 -40
- /package/{common → src/common}/types/account-contact.types.ts +0 -0
- /package/{common → src/common}/types/account-detail.types.ts +0 -0
- /package/{common → src/common}/types/account-integration.types.ts +0 -0
- /package/{common → src/common}/types/account-manager.types.ts +0 -0
- /package/{common → src/common}/types/account.types.ts +0 -0
- /package/{common → src/common}/types/activity.types.ts +0 -0
- /package/{common → src/common}/types/address.types.ts +0 -0
- /package/{common → src/common}/types/aic.types.ts +0 -0
- /package/{common → src/common}/types/aml.types.ts +0 -0
- /package/{common → src/common}/types/api-key-logs.types.ts +0 -0
- /package/{common → src/common}/types/api-keys.types.ts +0 -0
- /package/{common → src/common}/types/asset.types.ts +0 -0
- /package/{common → src/common}/types/auth.types.ts +0 -0
- /package/{common → src/common}/types/bonus-tier.types.ts +0 -0
- /package/{common → src/common}/types/cart.types.ts +0 -0
- /package/{common → src/common}/types/checklist-items.types.ts +0 -0
- /package/{common → src/common}/types/checklist.types.ts +0 -0
- /package/{common → src/common}/types/comply-advantage-api.types.ts +0 -0
- /package/{common → src/common}/types/comply-advantage.types.ts +0 -0
- /package/{common → src/common}/types/contact-us.types.ts +0 -0
- /package/{common → src/common}/types/countries.types.ts +0 -0
- /package/{common → src/common}/types/covered-person.types.ts +0 -0
- /package/{common → src/common}/types/dashboard.types.ts +0 -0
- /package/{common → src/common}/types/data-record.types.ts +0 -0
- /package/{common → src/common}/types/data-room.types.ts +0 -0
- /package/{common → src/common}/types/default-theme-config.types.ts +0 -0
- /package/{common → src/common}/types/disbursement-adjustment.types.ts +0 -0
- /package/{common → src/common}/types/disbursement-approval-user.types.ts +0 -0
- /package/{common → src/common}/types/disbursement-review.types.ts +0 -0
- /package/{common → src/common}/types/disbursement-transaction.types.ts +0 -0
- /package/{common → src/common}/types/disbursements.types.ts +0 -0
- /package/{common → src/common}/types/domain-filter.types.ts +0 -0
- /package/{common → src/common}/types/email-theme.types.ts +0 -0
- /package/{common → src/common}/types/entity.types.ts +0 -0
- /package/{common → src/common}/types/error-responses.types.ts +0 -0
- /package/{common → src/common}/types/escrow-account.types.ts +0 -0
- /package/{common → src/common}/types/exchange-api-key.types.ts +0 -0
- /package/{common → src/common}/types/exchange-import.types.ts +0 -0
- /package/{common → src/common}/types/exchange-provider.types.ts +0 -0
- /package/{common → src/common}/types/file.types.ts +0 -0
- /package/{common → src/common}/types/health.types.ts +0 -0
- /package/{common → src/common}/types/index.ts +0 -0
- /package/{common → src/common}/types/individuals.types.ts +0 -0
- /package/{common → src/common}/types/investor-account.types.ts +0 -0
- /package/{common → src/common}/types/investorAccountIdSchema.type.ts +0 -0
- /package/{common → src/common}/types/investors-offering.types.ts +0 -0
- /package/{common → src/common}/types/invite.types.ts +0 -0
- /package/{common → src/common}/types/issuer-bank-account.types.ts +0 -0
- /package/{common → src/common}/types/issuer-offering.types.ts +0 -0
- /package/{common → src/common}/types/issuer-payment-method.types.ts +0 -0
- /package/{common → src/common}/types/issuer.types.ts +0 -0
- /package/{common → src/common}/types/job-item.types.ts +0 -0
- /package/{common → src/common}/types/jobs.types.ts +0 -0
- /package/{common → src/common}/types/kyb.types.ts +0 -0
- /package/{common → src/common}/types/kyc.types.ts +0 -0
- /package/{common → src/common}/types/legal-entity.types.ts +0 -0
- /package/{common → src/common}/types/login-history.types.ts +0 -0
- /package/{common → src/common}/types/mail-template.types.ts +0 -0
- /package/{common → src/common}/types/north-cap-integration.types.ts +0 -0
- /package/{common → src/common}/types/note.types.ts +0 -0
- /package/{common → src/common}/types/notification.types.ts +0 -0
- /package/{common → src/common}/types/notion-api.types.ts +0 -0
- /package/{common → src/common}/types/notion-database.types.ts +0 -0
- /package/{common → src/common}/types/notion-page.types.ts +0 -0
- /package/{common → src/common}/types/offering-reports.types.ts +0 -0
- /package/{common → src/common}/types/offering-submission.types.ts +0 -0
- /package/{common → src/common}/types/offering.types.ts +0 -0
- /package/{common → src/common}/types/page-revision.types.ts +0 -0
- /package/{common → src/common}/types/password.type.ts +0 -0
- /package/{common → src/common}/types/payment-methods.types.ts +0 -0
- /package/{common → src/common}/types/phone.type.ts +0 -0
- /package/{common → src/common}/types/portfolio.types.ts +0 -0
- /package/{common → src/common}/types/privacy-policy-and-tos.types.ts +0 -0
- /package/{common → src/common}/types/registered-reps.types.ts +0 -0
- /package/{common → src/common}/types/rejection-reasons.types.ts +0 -0
- /package/{common → src/common}/types/review.types.ts +0 -0
- /package/{common → src/common}/types/role.types.ts +0 -0
- /package/{common → src/common}/types/secondary-customer.types.ts +0 -0
- /package/{common → src/common}/types/secondary-issuer.types.ts +0 -0
- /package/{common → src/common}/types/secondary-order.types.ts +0 -0
- /package/{common → src/common}/types/secondary-security.types.ts +0 -0
- /package/{common → src/common}/types/secondary-trade.entity.ts +0 -0
- /package/{common → src/common}/types/secondary-trade.types.ts +0 -0
- /package/{common → src/common}/types/secure-request.types.ts +0 -0
- /package/{common → src/common}/types/signer.types.ts +0 -0
- /package/{common → src/common}/types/site-link.types.ts +0 -0
- /package/{common → src/common}/types/site-settings.types.ts +0 -0
- /package/{common → src/common}/types/site.types.ts +0 -0
- /package/{common → src/common}/types/sms.types.ts +0 -0
- /package/{common → src/common}/types/state-machine.types.ts +0 -0
- /package/{common → src/common}/types/states.types.ts +0 -0
- /package/{common → src/common}/types/subdoc-preview.types.ts +0 -0
- /package/{common → src/common}/types/task.types.ts +0 -0
- /package/{common → src/common}/types/trade-adjustment.type.ts +0 -0
- /package/{common → src/common}/types/trade-line-item.type.ts +0 -0
- /package/{common → src/common}/types/transaction.types.ts +0 -0
- /package/{common → src/common}/types/trusted-contact.types.ts +0 -0
- /package/{common → src/common}/types/typography.types.ts +0 -0
- /package/{common → src/common}/types/user-manual.types.ts +0 -0
- /package/{common → src/common}/types/user-setting.types.ts +0 -0
- /package/{common → src/common}/types/user.types.ts +0 -0
- /package/{common → src/common}/types/webhook.types.ts +0 -0
- /package/{contracts → src/contracts}/clients/accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/aic/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/api-key-logs/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/api-keys/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/assets/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/auth/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/files/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/files-public/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/individuals/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/investor-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/issuers/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/legal-entities/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/offerings/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/secure-requests/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/sites/index.ts +0 -0
- /package/{contracts → src/contracts}/clients/trades/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/account-contacts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/account-managers/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/activities/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/aic/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/api-keys/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/assets/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/auth/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/batch-jobs/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/bonus-tiers/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/checklist/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/checklist-items/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/covered-persons/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/dashboard/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/data-records/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/data-rooms/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/default-theme-configs/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/disbursement/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/disbursement-approval-users/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/disbursement-transactions/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/domain-filters/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/email-themes/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/escrow-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/exchange-api-keys/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/exchange-imports/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/files/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/files-public/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/health/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/individuals/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/investor-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/invites/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/issuer-bank-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/issuer-payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/issuers/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/job-items/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/jobs/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/kyb/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/kyc/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/legal-entities/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/login-histories/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/notes/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/notion-databases/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/notion-pages/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/offering-reports/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/offerings/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/pages/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/rejection-reasons/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/review/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/roles/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/secondary-customers/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/secondary-orders/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/secondary-trades/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/secure-requests/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/signer/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/site-links/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/site-settings/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/sites/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/state-machine/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/tasks/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/third-parties/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/trade-line-items/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/trades/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/transactions/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/user-manuals/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/user-settings/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/users/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance/webhooks/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance-apikey/accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/compliance-apikey/index.ts +0 -0
- /package/{contracts → src/contracts}/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/account-contacts/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/aic/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/assets/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/auth/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/bonus-tiers/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/cart/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/contact-us/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/data-records/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/data-rooms/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/files/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/files-public/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/individuals/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/investor-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/issuer-payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/issuers/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/legal-entities/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/notes/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/offerings/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/pages/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/portfolios/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/sites/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/tasks/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/trade-line-items/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/trades/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/transactions/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/trusted-contacts/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/user-manuals/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/user-settings/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/users/index.ts +0 -0
- /package/{contracts → src/contracts}/investors/webhooks/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/account-contacts/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/account-integrations/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/activities/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/aic/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/api-key-logs/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/api-keys/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/assets/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/auth/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/bonus-tiers/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/contact-us/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/covered-persons/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/dashboard/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/data-records/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/data-rooms/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/disbursement-approval-users/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/disbursement-transactions/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/disbursements/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/email-themes/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/escrow-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/exchange-api-keys/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/files/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/files-public/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/health/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/investor-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/invites/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/issuer/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/issuer-bank-accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/issuer-payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/kyc/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/login-histories/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/notes/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/offerings/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/pages/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/payment-methods/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/portfolios/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/rejection-reasons/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/review/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/secondary-customers/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/secondary-orders/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/secondary-trades/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/secure-requests/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/site-links/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/site-settings/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/sites/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/tasks/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/trades/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/transactions/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/user-manuals/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/user-settings/index.ts +0 -0
- /package/{contracts → src/contracts}/issuers/users/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/accounts/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/secondary-customers/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/secondary-issuers/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/secondary-orders/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/secondary-securities/index.ts +0 -0
- /package/{contracts → src/contracts}/secondaries/secondary-trades/index.ts +0 -0
package/common/helpers/index.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contract helpers - minimal subset for API contracts package
|
|
3
|
-
* This file is copied directly to @dalmore/api-contracts
|
|
4
|
-
*/
|
|
5
|
-
import { HttpStatus } from '@nestjs/common';
|
|
6
|
-
import parsePhoneNumberFromString, {
|
|
7
|
-
CountryCode,
|
|
8
|
-
PhoneNumber,
|
|
9
|
-
} from 'libphonenumber-js';
|
|
10
|
-
import { err, ok, Result } from 'neverthrow';
|
|
11
|
-
import { ErrorResult } from '../types/common.types';
|
|
12
|
-
|
|
13
|
-
type CurlOptions = {
|
|
14
|
-
query?: Record<string, string>;
|
|
15
|
-
headers?: Record<string, string>;
|
|
16
|
-
body?: Record<string, unknown>;
|
|
17
|
-
formData?: Record<string, string>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const authHeader: CurlOptions['headers'] = {
|
|
21
|
-
Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const generateCurlExample = (
|
|
25
|
-
method: string,
|
|
26
|
-
path: string,
|
|
27
|
-
options: CurlOptions,
|
|
28
|
-
) => {
|
|
29
|
-
const baseUrl = 'https://dalmore-client-portal-api-prod.onrender.com/api/v1';
|
|
30
|
-
let curl = `curl -X ${method.toUpperCase()} '${baseUrl}${path}`;
|
|
31
|
-
if (options.query) {
|
|
32
|
-
const queryString = new URLSearchParams(options.query).toString();
|
|
33
|
-
curl += `?${queryString}`;
|
|
34
|
-
}
|
|
35
|
-
curl += "'";
|
|
36
|
-
if (options.headers) {
|
|
37
|
-
Object.entries(options.headers).forEach(([key, value]) => {
|
|
38
|
-
curl += ` \\\n --header '${key}: ${value}'`;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (options.body) {
|
|
42
|
-
curl += ` \\\n --header 'Content-Type: application/json'`;
|
|
43
|
-
curl += ` \\\n --data '${JSON.stringify(options.body)}'`;
|
|
44
|
-
}
|
|
45
|
-
if (options.formData) {
|
|
46
|
-
Object.entries(options.formData).forEach(([key, value]) => {
|
|
47
|
-
curl += ` \\\n --form '${key}=${value}'`;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return curl;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const generateApiDescription = (
|
|
54
|
-
summary: string,
|
|
55
|
-
method: string,
|
|
56
|
-
path: string,
|
|
57
|
-
options: CurlOptions,
|
|
58
|
-
) => {
|
|
59
|
-
const curlExample = generateCurlExample(method, path, options);
|
|
60
|
-
return `${summary}
|
|
61
|
-
|
|
62
|
-
### Example curl request
|
|
63
|
-
|
|
64
|
-
\`\`\`bash
|
|
65
|
-
${curlExample}
|
|
66
|
-
\`\`\``;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Normalizes a phone number to E.164 format
|
|
71
|
-
*/
|
|
72
|
-
export function normalizePhoneNumber(
|
|
73
|
-
phoneNumber: string,
|
|
74
|
-
countryCode: CountryCode,
|
|
75
|
-
): Result<PhoneNumber, ErrorResult> {
|
|
76
|
-
const parsedPhoneNumber = parsePhoneNumberFromString(
|
|
77
|
-
phoneNumber,
|
|
78
|
-
countryCode,
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
if (!parsedPhoneNumber || !parsedPhoneNumber.isValid()) {
|
|
82
|
-
return err({
|
|
83
|
-
status: HttpStatus.BAD_REQUEST,
|
|
84
|
-
message: 'Invalid phone number. Only numbers',
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return ok(parsedPhoneNumber);
|
|
88
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contract helpers - minimal subset for API contracts package
|
|
3
|
-
* This file is copied directly to @dalmore/api-contracts
|
|
4
|
-
*/
|
|
5
|
-
import { HttpStatus } from '@nestjs/common';
|
|
6
|
-
import parsePhoneNumberFromString, {
|
|
7
|
-
CountryCode,
|
|
8
|
-
PhoneNumber,
|
|
9
|
-
} from 'libphonenumber-js';
|
|
10
|
-
import { err, ok, Result } from 'neverthrow';
|
|
11
|
-
import { ErrorResult } from './common.types';
|
|
12
|
-
|
|
13
|
-
type CurlOptions = {
|
|
14
|
-
query?: Record<string, string>;
|
|
15
|
-
headers?: Record<string, string>;
|
|
16
|
-
body?: Record<string, unknown>;
|
|
17
|
-
formData?: Record<string, string>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const authHeader: CurlOptions['headers'] = {
|
|
21
|
-
Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const generateCurlExample = (
|
|
25
|
-
method: string,
|
|
26
|
-
path: string,
|
|
27
|
-
options: CurlOptions,
|
|
28
|
-
) => {
|
|
29
|
-
const baseUrl = 'https://dalmore-client-portal-api-prod.onrender.com/api/v1';
|
|
30
|
-
let curl = `curl -X ${method.toUpperCase()} '${baseUrl}${path}`;
|
|
31
|
-
if (options.query) {
|
|
32
|
-
const queryString = new URLSearchParams(options.query).toString();
|
|
33
|
-
curl += `?${queryString}`;
|
|
34
|
-
}
|
|
35
|
-
curl += "'";
|
|
36
|
-
if (options.headers) {
|
|
37
|
-
Object.entries(options.headers).forEach(([key, value]) => {
|
|
38
|
-
curl += ` \\\n --header '${key}: ${value}'`;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (options.body) {
|
|
42
|
-
curl += ` \\\n --header 'Content-Type: application/json'`;
|
|
43
|
-
curl += ` \\\n --data '${JSON.stringify(options.body)}'`;
|
|
44
|
-
}
|
|
45
|
-
if (options.formData) {
|
|
46
|
-
Object.entries(options.formData).forEach(([key, value]) => {
|
|
47
|
-
curl += ` \\\n --form '${key}=${value}'`;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return curl;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const generateApiDescription = (
|
|
54
|
-
summary: string,
|
|
55
|
-
method: string,
|
|
56
|
-
path: string,
|
|
57
|
-
options: CurlOptions,
|
|
58
|
-
) => {
|
|
59
|
-
const curlExample = generateCurlExample(method, path, options);
|
|
60
|
-
return `${summary}
|
|
61
|
-
|
|
62
|
-
### Example curl request
|
|
63
|
-
|
|
64
|
-
\`\`\`bash
|
|
65
|
-
${curlExample}
|
|
66
|
-
\`\`\``;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Normalizes a phone number to E.164 format
|
|
71
|
-
*/
|
|
72
|
-
export function normalizePhoneNumber(
|
|
73
|
-
phoneNumber: string,
|
|
74
|
-
countryCode: CountryCode,
|
|
75
|
-
): Result<PhoneNumber, ErrorResult> {
|
|
76
|
-
const parsedPhoneNumber = parsePhoneNumberFromString(
|
|
77
|
-
phoneNumber,
|
|
78
|
-
countryCode,
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
if (!parsedPhoneNumber || !parsedPhoneNumber.isValid()) {
|
|
82
|
-
return err({
|
|
83
|
-
status: HttpStatus.BAD_REQUEST,
|
|
84
|
-
message: 'Invalid phone number. Only numbers',
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return ok(parsedPhoneNumber);
|
|
88
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Job } from 'bullmq';
|
|
2
|
-
import { QueryRunner } from 'typeorm';
|
|
3
|
-
import { Site } from '../../sites/entities/site.entity';
|
|
4
|
-
import { ProcessTradeCancellationReminderDto } from '../../workers/dto.worker';
|
|
5
|
-
|
|
6
|
-
export enum ReminderType {
|
|
7
|
-
DAILY = 'daily',
|
|
8
|
-
CUMULATIVE = 'cumulative',
|
|
9
|
-
WARNING = 'warning',
|
|
10
|
-
CANCEL = 'cancel',
|
|
11
|
-
SKIP = 'skip', // for days with no action
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface ReminderConfig {
|
|
15
|
-
day: number;
|
|
16
|
-
type: ReminderType;
|
|
17
|
-
daysLeft?: number; // for warning type
|
|
18
|
-
createTask?: boolean; // for daily type
|
|
19
|
-
priority?: 'low' | 'medium' | 'high' | 'urgent';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ReminderTemplate {
|
|
23
|
-
subject: (params: ReminderTemplateParams) => string;
|
|
24
|
-
description: (params: ReminderTemplateParams) => string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ReminderTemplateParams {
|
|
28
|
-
day: number;
|
|
29
|
-
offeringName: string;
|
|
30
|
-
daysLeft?: number;
|
|
31
|
-
userName: string;
|
|
32
|
-
tradeStatus: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ReminderContext {
|
|
36
|
-
queryRunner: QueryRunner;
|
|
37
|
-
job: Job<ProcessTradeCancellationReminderDto>;
|
|
38
|
-
site: Site;
|
|
39
|
-
logContext: any;
|
|
40
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|