@decafhub/decaf-client-extras 0.0.1
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/.editorconfig +9 -0
- package/.env.example +4 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +23 -0
- package/.github/workflows/release-please.yml +47 -0
- package/.github/workflows/test.yml +29 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +10 -0
- package/commons/-currency.d.ts +42 -0
- package/commons/-currency.js +50 -0
- package/commons/-date-type.d.ts +11 -0
- package/commons/-date-type.js +10 -0
- package/commons/-id.d.ts +58 -0
- package/commons/-id.js +2 -0
- package/commons/index.d.ts +3 -0
- package/commons/index.js +19 -0
- package/es/commons/-currency.d.ts +42 -0
- package/es/commons/-currency.js +44 -0
- package/es/commons/-date-type.d.ts +11 -0
- package/es/commons/-date-type.js +7 -0
- package/es/commons/-id.d.ts +58 -0
- package/es/commons/-id.js +1 -0
- package/es/commons/index.d.ts +3 -0
- package/es/commons/index.js +3 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/reports/index.d.ts +1 -0
- package/es/reports/index.js +1 -0
- package/es/reports/valuation/-remote-valuation-report-consolidated.d.ts +69 -0
- package/es/reports/valuation/-remote-valuation-report-consolidated.js +56 -0
- package/es/reports/valuation/-remote-valuation-report-portfolio.d.ts +150 -0
- package/es/reports/valuation/-remote-valuation-report-portfolio.js +134 -0
- package/es/reports/valuation/-remote-valuation-report-shared.d.ts +233 -0
- package/es/reports/valuation/-remote-valuation-report-shared.js +127 -0
- package/es/reports/valuation/-valuation-report-consolidated.d.ts +35 -0
- package/es/reports/valuation/-valuation-report-consolidated.js +1 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-machinery.d.ts +10 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-machinery.js +116 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-types.d.ts +23 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-types.js +1 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-utils.d.ts +1 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/-utils.js +12 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/index.d.ts +2 -0
- package/es/reports/valuation/-valuation-report-holdings-tree/index.js +2 -0
- package/es/reports/valuation/-valuation-report-portfolio.d.ts +79 -0
- package/es/reports/valuation/-valuation-report-portfolio.js +1 -0
- package/es/reports/valuation/-valuation-report-shared.d.ts +189 -0
- package/es/reports/valuation/-valuation-report-shared.js +6 -0
- package/es/reports/valuation/index.d.ts +8 -0
- package/es/reports/valuation/index.js +6 -0
- package/index.d.ts +3 -0
- package/index.js +32 -0
- package/jest.config.js +6 -0
- package/package.json +79 -0
- package/postinstall.sh +16 -0
- package/release-please-config.json +9 -0
- package/reports/index.d.ts +1 -0
- package/reports/index.js +27 -0
- package/reports/valuation/-remote-valuation-report-consolidated.d.ts +69 -0
- package/reports/valuation/-remote-valuation-report-consolidated.js +113 -0
- package/reports/valuation/-remote-valuation-report-portfolio.d.ts +150 -0
- package/reports/valuation/-remote-valuation-report-portfolio.js +191 -0
- package/reports/valuation/-remote-valuation-report-shared.d.ts +233 -0
- package/reports/valuation/-remote-valuation-report-shared.js +145 -0
- package/reports/valuation/-valuation-report-consolidated.d.ts +35 -0
- package/reports/valuation/-valuation-report-consolidated.js +2 -0
- package/reports/valuation/-valuation-report-holdings-tree/-machinery.d.ts +10 -0
- package/reports/valuation/-valuation-report-holdings-tree/-machinery.js +189 -0
- package/reports/valuation/-valuation-report-holdings-tree/-types.d.ts +23 -0
- package/reports/valuation/-valuation-report-holdings-tree/-types.js +2 -0
- package/reports/valuation/-valuation-report-holdings-tree/-utils.d.ts +1 -0
- package/reports/valuation/-valuation-report-holdings-tree/-utils.js +16 -0
- package/reports/valuation/-valuation-report-holdings-tree/index.d.ts +2 -0
- package/reports/valuation/-valuation-report-holdings-tree/index.js +20 -0
- package/reports/valuation/-valuation-report-portfolio.d.ts +79 -0
- package/reports/valuation/-valuation-report-portfolio.js +2 -0
- package/reports/valuation/-valuation-report-shared.d.ts +189 -0
- package/reports/valuation/-valuation-report-shared.js +11 -0
- package/reports/valuation/index.d.ts +8 -0
- package/reports/valuation/index.js +25 -0
- package/shell.nix +21 -0
- package/src/commons/-currency.ts +55 -0
- package/src/commons/-date-type.ts +12 -0
- package/src/commons/-id.ts +72 -0
- package/src/commons/index.ts +3 -0
- package/src/index.test.ts +67 -0
- package/src/index.ts +3 -0
- package/src/reports/index.ts +1 -0
- package/src/reports/valuation/-remote-valuation-report-consolidated.ts +121 -0
- package/src/reports/valuation/-remote-valuation-report-portfolio.ts +294 -0
- package/src/reports/valuation/-remote-valuation-report-shared.ts +313 -0
- package/src/reports/valuation/-valuation-report-consolidated.ts +46 -0
- package/src/reports/valuation/-valuation-report-holdings-tree/-machinery.ts +171 -0
- package/src/reports/valuation/-valuation-report-holdings-tree/-types.ts +25 -0
- package/src/reports/valuation/-valuation-report-holdings-tree/-utils.ts +15 -0
- package/src/reports/valuation/-valuation-report-holdings-tree/index.ts +2 -0
- package/src/reports/valuation/-valuation-report-portfolio.ts +92 -0
- package/src/reports/valuation/-valuation-report-shared.ts +217 -0
- package/src/reports/valuation/index.ts +8 -0
- package/tsconfig.es.json +13 -0
- package/tsconfig.json +36 -0
- package/typedoc.json +8 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Decimal, Maybe, SDate, SDateTime } from '@telostat/prelude';
|
|
2
|
+
import { AccountId, ArtifactId, ArtifactTypeId, CurrencyCode, DateType, PortfolioId } from '../../commons';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Type definition for base valuation report.
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseValuationReport {
|
|
8
|
+
asof: SDateTime;
|
|
9
|
+
date: SDate;
|
|
10
|
+
dateType: DateType;
|
|
11
|
+
currency: CurrencyCode;
|
|
12
|
+
accounts: ValuationReportAccounts;
|
|
13
|
+
holdings: ValuationReportHolding[];
|
|
14
|
+
accruals: ValuationReportAccrual[];
|
|
15
|
+
fxRates: ValuationReportFxRate[];
|
|
16
|
+
figures: {
|
|
17
|
+
investment: Decimal;
|
|
18
|
+
valuation: {
|
|
19
|
+
net: Decimal;
|
|
20
|
+
abs: Decimal;
|
|
21
|
+
};
|
|
22
|
+
accrued: Decimal;
|
|
23
|
+
liabilities: Decimal;
|
|
24
|
+
gav: Decimal;
|
|
25
|
+
nav: Decimal;
|
|
26
|
+
aum: Decimal;
|
|
27
|
+
pnl: Decimal;
|
|
28
|
+
pnlToInvestment?: Maybe<Decimal>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Type definition for account reference in valuation reports.
|
|
34
|
+
*/
|
|
35
|
+
export interface ValuationReportAccount {
|
|
36
|
+
id: AccountId;
|
|
37
|
+
guid: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Type definition for portfolio reference in valuation reports.
|
|
43
|
+
*/
|
|
44
|
+
export interface ValuationReportPortfolio {
|
|
45
|
+
id: PortfolioId;
|
|
46
|
+
guid: string;
|
|
47
|
+
name: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Type definition for accounts which valuation report is compiled from.
|
|
52
|
+
*/
|
|
53
|
+
export interface ValuationReportAccounts {
|
|
54
|
+
custody: ValuationReportAccount[];
|
|
55
|
+
journal: ValuationReportAccount[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The definition for valuation report holding classification.
|
|
60
|
+
*/
|
|
61
|
+
export type ValuationReportHoldingClassification = ValuationReportHoldingClassificationNode[];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Type definition for valuation report holding classification node.
|
|
65
|
+
*/
|
|
66
|
+
export interface ValuationReportHoldingClassificationNode {
|
|
67
|
+
name: string;
|
|
68
|
+
order: string | number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Type definition for base valuation report holding (shared by
|
|
73
|
+
* [[ValuationReportHolding]] and [[ValuationReportChildHolding]]).
|
|
74
|
+
*/
|
|
75
|
+
export interface BaseValuationReportHolding {
|
|
76
|
+
artifact: ValuationReportArtifact;
|
|
77
|
+
quantity: Decimal;
|
|
78
|
+
investment: ValuationReportHoldingFiguresInvestment;
|
|
79
|
+
valuation: ValuationReportHoldingFiguresValuation;
|
|
80
|
+
valuePercentage: Maybe<Decimal>;
|
|
81
|
+
netExposurePercentage: Maybe<Decimal>;
|
|
82
|
+
absExposurePercentage: Maybe<Decimal>;
|
|
83
|
+
change: Maybe<Decimal>;
|
|
84
|
+
pnl: Decimal;
|
|
85
|
+
pnlToInvestment: Maybe<Decimal>;
|
|
86
|
+
opendate: SDate;
|
|
87
|
+
lastdate: SDate;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Type definition for valuation report holding investment figures.
|
|
92
|
+
*/
|
|
93
|
+
export interface ValuationReportHoldingFiguresInvestment {
|
|
94
|
+
px: ValuationReportFigureOrgRef;
|
|
95
|
+
txncosts: Maybe<ValuationReportFigureOrgRef>;
|
|
96
|
+
accrued: Maybe<ValuationReportFigureOrgRef>;
|
|
97
|
+
value: ValuationReportFigureOrgRef;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Type definition for valuation report holding valuation figures.
|
|
102
|
+
*/
|
|
103
|
+
export interface ValuationReportHoldingFiguresValuation {
|
|
104
|
+
px: ValuationReportFigureOrgRef;
|
|
105
|
+
accrued: Maybe<ValuationReportFigureOrgRef>;
|
|
106
|
+
value: {
|
|
107
|
+
net: ValuationReportFigureOrgRef;
|
|
108
|
+
abs: ValuationReportFigureOrgRef;
|
|
109
|
+
};
|
|
110
|
+
exposure: {
|
|
111
|
+
net: ValuationReportFigureOrgRef;
|
|
112
|
+
abs: ValuationReportFigureOrgRef;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Type definition for valuation report figure value that is reported both in
|
|
118
|
+
* original currency and reference currency.
|
|
119
|
+
*/
|
|
120
|
+
export interface ValuationReportFigureOrgRef {
|
|
121
|
+
org: Decimal;
|
|
122
|
+
ref: Decimal;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Type definition for a valuation holding.
|
|
127
|
+
*/
|
|
128
|
+
export interface ValuationReportHolding extends BaseValuationReportHolding {
|
|
129
|
+
classification: ValuationReportHoldingClassification;
|
|
130
|
+
accounts: ValuationReportAccount[];
|
|
131
|
+
children: Maybe<ValuationReportChildHolding[]>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Type definition for a valuation holding child.
|
|
136
|
+
*/
|
|
137
|
+
export interface ValuationReportChildHolding extends BaseValuationReportHolding {
|
|
138
|
+
account: ValuationReportAccount;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function isValuationHolding(
|
|
142
|
+
x: ValuationReportHolding | ValuationReportChildHolding
|
|
143
|
+
): x is ValuationReportHolding {
|
|
144
|
+
return 'accounts' in x;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function isValuationChildHolding(
|
|
148
|
+
x: ValuationReportHolding | ValuationReportChildHolding
|
|
149
|
+
): x is ValuationReportChildHolding {
|
|
150
|
+
return 'account' in x;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Valuation accrual.
|
|
155
|
+
*/
|
|
156
|
+
export interface ValuationReportAccrual {
|
|
157
|
+
name: string;
|
|
158
|
+
value: Decimal;
|
|
159
|
+
accounts: ValuationReportAccrualByAccount[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Valuation accrual by account.
|
|
164
|
+
*/
|
|
165
|
+
export interface ValuationReportAccrualByAccount {
|
|
166
|
+
account: ValuationReportAccount;
|
|
167
|
+
value: Decimal;
|
|
168
|
+
accruals: ValuationReportAccrualByCurrency[];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Valuation accrual by account by currency.
|
|
173
|
+
*/
|
|
174
|
+
export interface ValuationReportAccrualByCurrency {
|
|
175
|
+
artifact: ValuationReportArtifact;
|
|
176
|
+
ccy: CurrencyCode;
|
|
177
|
+
value: ValuationReportFigureOrgRef;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Type definition of the FINREA artifact type.
|
|
182
|
+
*/
|
|
183
|
+
export interface ValuationReportArtifactType {
|
|
184
|
+
id: ArtifactTypeId;
|
|
185
|
+
name: string;
|
|
186
|
+
order: number;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Type definition for the artifact as reported in the valuation.
|
|
191
|
+
*/
|
|
192
|
+
export interface ValuationReportArtifact {
|
|
193
|
+
id: ArtifactId;
|
|
194
|
+
guid: string;
|
|
195
|
+
type: ValuationReportArtifactType;
|
|
196
|
+
stype: Maybe<string>;
|
|
197
|
+
symbol: string;
|
|
198
|
+
name: Maybe<string>;
|
|
199
|
+
ccy: Maybe<CurrencyCode>;
|
|
200
|
+
quantity: Decimal;
|
|
201
|
+
country: Maybe<string>;
|
|
202
|
+
issuer: Maybe<string>;
|
|
203
|
+
sector: Maybe<string>;
|
|
204
|
+
mic: Maybe<string>;
|
|
205
|
+
ticker: Maybe<string>;
|
|
206
|
+
isin: Maybe<string>;
|
|
207
|
+
figi: Maybe<string>;
|
|
208
|
+
expiry: Maybe<SDate>;
|
|
209
|
+
underlyingId: Maybe<ArtifactId>;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface ValuationReportFxRate {
|
|
213
|
+
ccy1: CurrencyCode;
|
|
214
|
+
ccy2: CurrencyCode;
|
|
215
|
+
value: Decimal;
|
|
216
|
+
asof: SDate;
|
|
217
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { fetchConsolidatedValuationReport } from './-remote-valuation-report-consolidated';
|
|
2
|
+
export type { ConsolidatedValuationReportQuery } from './-remote-valuation-report-consolidated';
|
|
3
|
+
export { fetchPortfolioValuationReport } from './-remote-valuation-report-portfolio';
|
|
4
|
+
export type { PortfolioValuationReportQuery } from './-remote-valuation-report-portfolio';
|
|
5
|
+
export * from './-valuation-report-consolidated';
|
|
6
|
+
export * from './-valuation-report-holdings-tree';
|
|
7
|
+
export * from './-valuation-report-portfolio';
|
|
8
|
+
export * from './-valuation-report-shared';
|
package/tsconfig.es.json
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": [],
|
|
6
|
+
"moduleResolution": "Node",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"outDir": "./lib",
|
|
9
|
+
"rootDir": "./src/",
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"noImplicitThis": true,
|
|
12
|
+
"noUnusedParameters": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"alwaysStrict": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"baseUrl": "./src/",
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"emitDecoratorMetadata": true,
|
|
19
|
+
"downlevelIteration": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"noUncheckedIndexedAccess": true,
|
|
23
|
+
"esModuleInterop": true,
|
|
24
|
+
"skipLibCheck": true
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src/**/*.d.ts",
|
|
28
|
+
"src/**/*.ts"
|
|
29
|
+
],
|
|
30
|
+
"exclude": [
|
|
31
|
+
"docs",
|
|
32
|
+
"lib",
|
|
33
|
+
"node_modules",
|
|
34
|
+
"**/*.test.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|