@dalmore/api-contracts 1.0.6 → 1.0.8
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
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Type-safe API contracts for Dalmore Client Portal, powered by [ts-rest](https://ts-rest.com/).
|
|
4
4
|
|
|
5
|
+
This package provides **full end-to-end type inference** by shipping TypeScript source files alongside compiled JavaScript.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -27,13 +29,27 @@ const client = initClient(clientsContract, {
|
|
|
27
29
|
},
|
|
28
30
|
});
|
|
29
31
|
|
|
30
|
-
// Fully typed API calls
|
|
32
|
+
// Fully typed API calls with complete autocomplete
|
|
31
33
|
const { status, body } = await client.accounts.getAccounts();
|
|
32
34
|
|
|
33
|
-
// Access nested endpoints
|
|
35
|
+
// Access nested endpoints with full type inference
|
|
34
36
|
const trade = await client.trades.getTrade({ params: { id: 'trade_123' } });
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
## TypeScript Configuration
|
|
40
|
+
|
|
41
|
+
For optimal type inference, ensure your `tsconfig.json` includes:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"compilerOptions": {
|
|
46
|
+
"skipLibCheck": true, // Recommended for faster compilation
|
|
47
|
+
"moduleResolution": "node",
|
|
48
|
+
"esModuleInterop": true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
37
53
|
## Available Endpoints
|
|
38
54
|
|
|
39
55
|
The `clientsContract` includes:
|
package/package.json
CHANGED
|
@@ -166,7 +166,7 @@ export interface BaseDataRecordStructure extends IBaseEntityType {
|
|
|
166
166
|
data?: BaseDataRecordStructure[] | undefined;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
export const DataRecordStructureZod
|
|
169
|
+
export const DataRecordStructureZod = z
|
|
170
170
|
.lazy(() =>
|
|
171
171
|
IBaseEntity.extend({
|
|
172
172
|
name: z.string().min(1).max(255),
|
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
investorAccountIdSchema,
|
|
35
35
|
InvestorAccountExportFilters,
|
|
36
36
|
ComplianceInvestorAccountExportFilters,
|
|
37
|
-
RegisteredInvestorUserRawZod,
|
|
38
37
|
} from './investor-account.types';
|
|
39
38
|
import {
|
|
40
39
|
tradeLineItemIdSchema,
|
|
@@ -45,17 +44,8 @@ import { TransactionZod } from './transaction.types';
|
|
|
45
44
|
import { accountIdSchema } from './account.types';
|
|
46
45
|
import { userIdSchema } from './user.types';
|
|
47
46
|
import { issuerIdSchema } from './issuer.types';
|
|
48
|
-
import {
|
|
49
|
-
|
|
50
|
-
SecondaryCustomer,
|
|
51
|
-
} from './secondary-customer.types';
|
|
52
|
-
import {
|
|
53
|
-
SecondaryTrade,
|
|
54
|
-
SecondaryTradeFiltersZod,
|
|
55
|
-
} from './secondary-trade.types';
|
|
56
|
-
import { InvestorAccount } from '../../investor-accounts/entities/investor-account.entity';
|
|
57
|
-
import { Trade } from '../../trades/entities/trade.entity';
|
|
58
|
-
|
|
47
|
+
import { GetSecondaryCustomerFiltersZod } from './secondary-customer.types';
|
|
48
|
+
import { SecondaryTradeFiltersZod } from './secondary-trade.types';
|
|
59
49
|
extendZodWithOpenApi(z);
|
|
60
50
|
export const CheckResultsSchema = z.object({
|
|
61
51
|
fundingStatus: z.boolean(),
|
|
@@ -920,10 +910,3 @@ export type BulkExportFilters =
|
|
|
920
910
|
| ComplianceTradeExportFilters
|
|
921
911
|
| SecondaryCustomerExportFilters
|
|
922
912
|
| SecondaryTradeExportFilters;
|
|
923
|
-
|
|
924
|
-
export type BulkExportResponse =
|
|
925
|
-
| InvestorAccount[]
|
|
926
|
-
| RegisteredInvestorUserRawZod[]
|
|
927
|
-
| Trade[]
|
|
928
|
-
| SecondaryCustomer[]
|
|
929
|
-
| SecondaryTrade[];
|