@robosystems/client 0.3.14 → 0.3.15

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.
@@ -3,14 +3,20 @@
3
3
  /**
4
4
  * Investor Client for RoboSystems API
5
5
  *
6
- * High-level facade for the RoboInvestor domain: portfolios, securities,
7
- * positions, and portfolio holdings aggregation. Follows the same
8
- * hybrid transport pattern as `LedgerClient`:
6
+ * High-level facade for the RoboInvestor domain: portfolios (via the
7
+ * Portfolio Block molecule), securities (Master Data CRUD), positions
8
+ * (folded into Portfolio Block writes), and portfolio holdings
9
+ * aggregation. Same hybrid transport pattern as `LedgerClient`:
9
10
  *
10
11
  * - **Reads** go through GraphQL at `/extensions/{graph_id}/graphql`.
11
12
  * - **Writes** go through named operations at
12
13
  * `/extensions/roboinvestor/{graph_id}/operations/{operation_name}`.
13
14
  *
15
+ * Portfolio + position writes flow through the **Portfolio Block**
16
+ * envelope ops (`create-portfolio-block`, `update-portfolio-block`,
17
+ * `delete-portfolio-block`); atom-level CRUD on portfolios/positions
18
+ * has been retired. Securities remain Master Data CRUD.
19
+ *
14
20
  * Every write returns an `OperationEnvelope`; this facade unwraps
15
21
  * `envelope.result` and returns a typed shape derived from the GraphQL
16
22
  * codegen output (which is the source of truth for read payload types).
@@ -19,37 +25,35 @@
19
25
  import type { TypedDocumentNode } from '@graphql-typed-document-node/core'
20
26
  import { ClientError } from 'graphql-request'
21
27
  import {
22
- opCreatePortfolio,
23
- opCreatePosition,
28
+ opCreatePortfolioBlock,
24
29
  opCreateSecurity,
25
- opDeletePortfolio,
26
- opDeletePosition,
30
+ opDeletePortfolioBlock,
27
31
  opDeleteSecurity,
28
- opUpdatePortfolio,
29
- opUpdatePosition,
32
+ opUpdatePortfolioBlock,
30
33
  opUpdateSecurity,
31
34
  } from '../sdk.gen'
32
35
  import type {
33
- CreatePortfolioRequest,
34
- CreatePositionRequest,
36
+ CreatePortfolioBlockRequest,
35
37
  CreateSecurityRequest,
38
+ DeletePortfolioBlockOperation,
36
39
  OperationEnvelope,
37
- UpdatePortfolioOperation,
38
- UpdatePositionOperation,
40
+ PortfolioBlockPortfolioPatch,
41
+ PortfolioBlockPositions,
42
+ UpdatePortfolioBlockOperation,
39
43
  UpdateSecurityOperation,
40
44
  } from '../types.gen'
41
45
  import type { TokenProvider } from './graphql/client'
42
46
  import { GraphQLClientCache } from './graphql/client'
43
47
  import {
44
48
  GetInvestorHoldingsDocument,
45
- GetInvestorPortfolioDocument,
49
+ GetInvestorPortfolioBlockDocument,
46
50
  GetInvestorPositionDocument,
47
51
  GetInvestorSecurityDocument,
48
52
  ListInvestorPortfoliosDocument,
49
53
  ListInvestorPositionsDocument,
50
54
  ListInvestorSecuritiesDocument,
51
55
  type GetInvestorHoldingsQuery,
52
- type GetInvestorPortfolioQuery,
56
+ type GetInvestorPortfolioBlockQuery,
53
57
  type GetInvestorPositionQuery,
54
58
  type GetInvestorSecurityQuery,
55
59
  type ListInvestorPortfoliosQuery,
@@ -61,7 +65,11 @@ import {
61
65
 
62
66
  export type InvestorPortfolioList = NonNullable<ListInvestorPortfoliosQuery['portfolios']>
63
67
  export type InvestorPortfolioSummary = InvestorPortfolioList['portfolios'][number]
64
- export type InvestorPortfolio = NonNullable<GetInvestorPortfolioQuery['portfolio']>
68
+
69
+ export type InvestorPortfolioBlock = NonNullable<GetInvestorPortfolioBlockQuery['portfolioBlock']>
70
+ export type InvestorPositionBlock = InvestorPortfolioBlock['positions'][number]
71
+ export type InvestorSecurityLite = InvestorPositionBlock['security']
72
+ export type InvestorEntityLite = InvestorPortfolioBlock['owner']
65
73
 
66
74
  export type InvestorSecurityList = NonNullable<ListInvestorSecuritiesQuery['securities']>
67
75
  export type InvestorSecuritySummary = InvestorSecurityList['securities'][number]
@@ -99,7 +107,7 @@ export class InvestorClient {
99
107
  this.gql = new GraphQLClientCache(config)
100
108
  }
101
109
 
102
- // ── Portfolios ──────────────────────────────────────────────────────
110
+ // ── Portfolios (reads) ──────────────────────────────────────────────
103
111
 
104
112
  /** List portfolios with pagination. */
105
113
  async listPortfolios(
@@ -118,56 +126,85 @@ export class InvestorClient {
118
126
  )
119
127
  }
120
128
 
121
- /** Get a single portfolio by id. Returns null if it doesn't exist. */
122
- async getPortfolio(graphId: string, portfolioId: string): Promise<InvestorPortfolio | null> {
129
+ /**
130
+ * Get the Portfolio Block molecule envelope with portfolio,
131
+ * positions, securities, and entity references in a single read.
132
+ * Returns null if the portfolio doesn't exist.
133
+ */
134
+ async getPortfolioBlock(
135
+ graphId: string,
136
+ portfolioId: string
137
+ ): Promise<InvestorPortfolioBlock | null> {
123
138
  return this.gqlQuery(
124
139
  graphId,
125
- GetInvestorPortfolioDocument,
140
+ GetInvestorPortfolioBlockDocument,
126
141
  { portfolioId },
127
- 'Get portfolio',
128
- (data) => data.portfolio
142
+ 'Get portfolio block',
143
+ (data) => data.portfolioBlock
129
144
  )
130
145
  }
131
146
 
132
- /** Create a new portfolio. Returns the created portfolio. */
133
- async createPortfolio(graphId: string, body: CreatePortfolioRequest): Promise<InvestorPortfolio> {
147
+ // ── Portfolio Block (writes) ────────────────────────────────────────
148
+
149
+ /**
150
+ * Create a portfolio (with optional initial positions) atomically.
151
+ * Each position references an existing security; this op never mints
152
+ * securities — use `createSecurity` first.
153
+ */
154
+ async createPortfolioBlock(
155
+ graphId: string,
156
+ body: CreatePortfolioBlockRequest
157
+ ): Promise<InvestorPortfolioBlock> {
134
158
  const envelope = await this.callOperation(
135
- 'Create portfolio',
136
- opCreatePortfolio({ path: { graph_id: graphId }, body })
159
+ 'Create portfolio block',
160
+ opCreatePortfolioBlock({ path: { graph_id: graphId }, body })
137
161
  )
138
- return rawToInvestorPortfolio(envelope.result as unknown as RawPortfolioResponse)
162
+ return rawToPortfolioBlock(envelope.result as unknown as RawPortfolioBlockResponse)
139
163
  }
140
164
 
141
- /** Update a portfolio's metadata. Only provided fields are applied. */
142
- async updatePortfolio(
165
+ /**
166
+ * Patch portfolio fields and apply position deltas (`add`, `update`,
167
+ * `dispose`) atomically. All deltas roll back together on failure.
168
+ * Pass only the fields/deltas you want changed — anything omitted
169
+ * is left untouched.
170
+ */
171
+ async updatePortfolioBlock(
143
172
  graphId: string,
144
173
  portfolioId: string,
145
- updates: Omit<UpdatePortfolioOperation, 'portfolio_id'>
146
- ): Promise<InvestorPortfolio> {
174
+ updates: {
175
+ portfolio?: PortfolioBlockPortfolioPatch
176
+ positions?: PortfolioBlockPositions
177
+ }
178
+ ): Promise<InvestorPortfolioBlock> {
179
+ const body: UpdatePortfolioBlockOperation = {
180
+ portfolio_id: portfolioId,
181
+ ...updates,
182
+ }
147
183
  const envelope = await this.callOperation(
148
- 'Update portfolio',
149
- opUpdatePortfolio({
150
- path: { graph_id: graphId },
151
- body: {
152
- ...updates,
153
- portfolio_id: portfolioId,
154
- } as UpdatePortfolioOperation,
155
- })
184
+ 'Update portfolio block',
185
+ opUpdatePortfolioBlock({ path: { graph_id: graphId }, body })
156
186
  )
157
- return rawToInvestorPortfolio(envelope.result as unknown as RawPortfolioResponse)
187
+ return rawToPortfolioBlock(envelope.result as unknown as RawPortfolioBlockResponse)
158
188
  }
159
189
 
160
190
  /**
161
- * Delete a portfolio. Fails with 409 if the portfolio still has active
162
- * positions dispose those first.
191
+ * Cascade-delete the portfolio plus all of its positions. When the
192
+ * portfolio still has active positions, the request must include
193
+ * `confirmActivePositions: true` — safety belt to prevent accidental
194
+ * cascade. Disposed-only portfolios delete without the flag.
163
195
  */
164
- async deletePortfolio(graphId: string, portfolioId: string): Promise<{ deleted: boolean }> {
196
+ async deletePortfolioBlock(
197
+ graphId: string,
198
+ portfolioId: string,
199
+ options?: { confirmActivePositions?: boolean }
200
+ ): Promise<{ deleted: boolean }> {
201
+ const body: DeletePortfolioBlockOperation = {
202
+ portfolio_id: portfolioId,
203
+ confirm_active_positions: options?.confirmActivePositions ?? false,
204
+ }
165
205
  const envelope = await this.callOperation(
166
- 'Delete portfolio',
167
- opDeletePortfolio({
168
- path: { graph_id: graphId },
169
- body: { portfolio_id: portfolioId },
170
- })
206
+ 'Delete portfolio block',
207
+ opDeletePortfolioBlock({ path: { graph_id: graphId }, body })
171
208
  )
172
209
  return (envelope.result ?? { deleted: true }) as { deleted: boolean }
173
210
  }
@@ -254,7 +291,7 @@ export class InvestorClient {
254
291
  return (envelope.result ?? { deleted: true }) as { deleted: boolean }
255
292
  }
256
293
 
257
- // ── Positions ───────────────────────────────────────────────────────
294
+ // ── Positions (reads only — writes folded into Portfolio Block) ─────
258
295
 
259
296
  /** List positions with pagination and filters. */
260
297
  async listPositions(
@@ -293,46 +330,6 @@ export class InvestorClient {
293
330
  )
294
331
  }
295
332
 
296
- /** Create a new position. */
297
- async createPosition(graphId: string, body: CreatePositionRequest): Promise<InvestorPosition> {
298
- const envelope = await this.callOperation(
299
- 'Create position',
300
- opCreatePosition({ path: { graph_id: graphId }, body })
301
- )
302
- return rawToInvestorPosition(envelope.result as unknown as RawPositionResponse)
303
- }
304
-
305
- /** Update a position. Only provided fields are applied. */
306
- async updatePosition(
307
- graphId: string,
308
- positionId: string,
309
- updates: Omit<UpdatePositionOperation, 'position_id'>
310
- ): Promise<InvestorPosition> {
311
- const envelope = await this.callOperation(
312
- 'Update position',
313
- opUpdatePosition({
314
- path: { graph_id: graphId },
315
- body: {
316
- ...updates,
317
- position_id: positionId,
318
- } as UpdatePositionOperation,
319
- })
320
- )
321
- return rawToInvestorPosition(envelope.result as unknown as RawPositionResponse)
322
- }
323
-
324
- /** Delete (dispose) a position. */
325
- async deletePosition(graphId: string, positionId: string): Promise<{ deleted: boolean }> {
326
- const envelope = await this.callOperation(
327
- 'Delete position',
328
- opDeletePosition({
329
- path: { graph_id: graphId },
330
- body: { position_id: positionId },
331
- })
332
- )
333
- return (envelope.result ?? { deleted: true }) as { deleted: boolean }
334
- }
335
-
336
333
  // ── Holdings (aggregation) ─────────────────────────────────────────
337
334
 
338
335
  /**
@@ -390,27 +387,13 @@ export class InvestorClient {
390
387
 
391
388
  // ── Module-private conversion helpers ─────────────────────────────────
392
389
  //
393
- // The RoboInvestor write operations (create/update portfolio, security,
394
- // position) return Pydantic-serialized envelopes where `result` is in
395
- // snake_case. The GraphQL-derived `InvestorPortfolio` / `InvestorSecurity`
396
- // / `InvestorPosition` types are in camelCase (matching the read path).
397
- //
398
- // These helpers are the single place where we bridge the two naming
399
- // conventions on the write path, mirroring the `rawFiscalCalendarToCamel`
400
- // / `rawToClosingEntry` pattern in `LedgerClient`. Keeping the unsafe
401
- // `as unknown as` cast localized to these helpers means a backend schema
402
- // drift surfaces here rather than silently at every call site.
403
-
404
- interface RawPortfolioResponse {
405
- id: string
406
- name: string
407
- description: string | null
408
- strategy: string | null
409
- inception_date: string | null
410
- base_currency: string
411
- created_at: string
412
- updated_at: string
413
- }
390
+ // The RoboInvestor write operations return Pydantic-serialized envelopes
391
+ // where `result` is in snake_case. The GraphQL-derived `Investor*` types
392
+ // are in camelCase (matching the read path). These helpers are the single
393
+ // place where we bridge the two naming conventions on the write path,
394
+ // mirroring the equivalent helpers in `LedgerClient`. Keeping the unsafe
395
+ // `as unknown as` cast localized here means a backend schema drift surfaces
396
+ // in one place rather than silently at every call site.
414
397
 
415
398
  interface RawSecurityResponse {
416
399
  id: string
@@ -428,40 +411,50 @@ interface RawSecurityResponse {
428
411
  updated_at: string
429
412
  }
430
413
 
431
- interface RawPositionResponse {
414
+ interface RawEntityLite {
415
+ id: string
416
+ name: string
417
+ source_graph_id: string | null
418
+ }
419
+
420
+ interface RawSecurityLite {
421
+ id: string
422
+ name: string
423
+ security_type: string
424
+ security_subtype: string | null
425
+ is_active: boolean
426
+ issuer: RawEntityLite | null
427
+ source_graph_id: string | null
428
+ }
429
+
430
+ interface RawPositionBlock {
432
431
  id: string
433
- portfolio_id: string
434
- security_id: string
435
- security_name: string | null
436
- entity_name: string | null
437
432
  quantity: number
438
433
  quantity_type: string
439
- cost_basis: number
440
434
  cost_basis_dollars: number
441
- currency: string
442
- current_value: number | null
443
435
  current_value_dollars: number | null
444
436
  valuation_date: string | null
445
437
  valuation_source: string | null
446
438
  acquisition_date: string | null
447
- disposition_date: string | null
448
439
  status: string
449
440
  notes: string | null
450
- created_at: string
451
- updated_at: string
441
+ security: RawSecurityLite
452
442
  }
453
443
 
454
- function rawToInvestorPortfolio(raw: RawPortfolioResponse): InvestorPortfolio {
455
- return {
456
- id: raw.id,
457
- name: raw.name,
458
- description: raw.description,
459
- strategy: raw.strategy,
460
- inceptionDate: raw.inception_date,
461
- baseCurrency: raw.base_currency,
462
- createdAt: raw.created_at,
463
- updatedAt: raw.updated_at,
464
- }
444
+ interface RawPortfolioBlockResponse {
445
+ id: string
446
+ name: string
447
+ description: string | null
448
+ strategy: string | null
449
+ inception_date: string | null
450
+ base_currency: string
451
+ owner: RawEntityLite | null
452
+ positions: RawPositionBlock[]
453
+ total_cost_basis_dollars: number
454
+ total_current_value_dollars: number | null
455
+ active_position_count: number
456
+ created_at: string
457
+ updated_at: string
465
458
  }
466
459
 
467
460
  function rawToInvestorSecurity(raw: RawSecurityResponse): InvestorSecurity {
@@ -482,26 +475,56 @@ function rawToInvestorSecurity(raw: RawSecurityResponse): InvestorSecurity {
482
475
  }
483
476
  }
484
477
 
485
- function rawToInvestorPosition(raw: RawPositionResponse): InvestorPosition {
478
+ function rawToEntityLite(raw: RawEntityLite | null): InvestorEntityLite {
479
+ if (raw === null) return null
480
+ return {
481
+ id: raw.id,
482
+ name: raw.name,
483
+ sourceGraphId: raw.source_graph_id,
484
+ }
485
+ }
486
+
487
+ function rawToSecurityLite(raw: RawSecurityLite): InvestorSecurityLite {
488
+ return {
489
+ id: raw.id,
490
+ name: raw.name,
491
+ securityType: raw.security_type,
492
+ securitySubtype: raw.security_subtype,
493
+ isActive: raw.is_active,
494
+ issuer: rawToEntityLite(raw.issuer),
495
+ sourceGraphId: raw.source_graph_id,
496
+ }
497
+ }
498
+
499
+ function rawToPositionBlock(raw: RawPositionBlock): InvestorPositionBlock {
486
500
  return {
487
501
  id: raw.id,
488
- portfolioId: raw.portfolio_id,
489
- securityId: raw.security_id,
490
- securityName: raw.security_name,
491
- entityName: raw.entity_name,
492
502
  quantity: raw.quantity,
493
503
  quantityType: raw.quantity_type,
494
- costBasis: raw.cost_basis,
495
504
  costBasisDollars: raw.cost_basis_dollars,
496
- currency: raw.currency,
497
- currentValue: raw.current_value,
498
505
  currentValueDollars: raw.current_value_dollars,
499
506
  valuationDate: raw.valuation_date,
500
507
  valuationSource: raw.valuation_source,
501
508
  acquisitionDate: raw.acquisition_date,
502
- dispositionDate: raw.disposition_date,
503
509
  status: raw.status,
504
510
  notes: raw.notes,
511
+ security: rawToSecurityLite(raw.security),
512
+ }
513
+ }
514
+
515
+ function rawToPortfolioBlock(raw: RawPortfolioBlockResponse): InvestorPortfolioBlock {
516
+ return {
517
+ id: raw.id,
518
+ name: raw.name,
519
+ description: raw.description,
520
+ strategy: raw.strategy,
521
+ inceptionDate: raw.inception_date,
522
+ baseCurrency: raw.base_currency,
523
+ owner: rawToEntityLite(raw.owner),
524
+ positions: raw.positions.map(rawToPositionBlock),
525
+ totalCostBasisDollars: raw.total_cost_basis_dollars,
526
+ totalCurrentValueDollars: raw.total_current_value_dollars,
527
+ activePositionCount: raw.active_position_count,
505
528
  createdAt: raw.created_at,
506
529
  updatedAt: raw.updated_at,
507
530
  }
@@ -229,6 +229,11 @@ export type ElementList = {
229
229
  elements: Array<Element>;
230
230
  pagination: PaginationInfo;
231
231
  };
232
+ export type EntityLite = {
233
+ id: Scalars['String']['output'];
234
+ name: Scalars['String']['output'];
235
+ sourceGraphId: Maybe<Scalars['String']['output']>;
236
+ };
232
237
  export type FactRow = {
233
238
  depth: Scalars['Int']['output'];
234
239
  elementId: Scalars['String']['output'];
@@ -750,6 +755,21 @@ export type Portfolio = {
750
755
  strategy: Maybe<Scalars['String']['output']>;
751
756
  updatedAt: Scalars['DateTime']['output'];
752
757
  };
758
+ export type PortfolioBlock = {
759
+ activePositionCount: Scalars['Int']['output'];
760
+ baseCurrency: Scalars['String']['output'];
761
+ createdAt: Scalars['DateTime']['output'];
762
+ description: Maybe<Scalars['String']['output']>;
763
+ id: Scalars['String']['output'];
764
+ inceptionDate: Maybe<Scalars['Date']['output']>;
765
+ name: Scalars['String']['output'];
766
+ owner: Maybe<EntityLite>;
767
+ positions: Array<PositionBlock>;
768
+ strategy: Maybe<Scalars['String']['output']>;
769
+ totalCostBasisDollars: Scalars['Float']['output'];
770
+ totalCurrentValueDollars: Maybe<Scalars['Float']['output']>;
771
+ updatedAt: Scalars['DateTime']['output'];
772
+ };
753
773
  export type PortfolioList = {
754
774
  pagination: PaginationInfo;
755
775
  portfolios: Array<Portfolio>;
@@ -776,6 +796,19 @@ export type Position = {
776
796
  valuationDate: Maybe<Scalars['Date']['output']>;
777
797
  valuationSource: Maybe<Scalars['String']['output']>;
778
798
  };
799
+ export type PositionBlock = {
800
+ acquisitionDate: Maybe<Scalars['Date']['output']>;
801
+ costBasisDollars: Scalars['Float']['output'];
802
+ currentValueDollars: Maybe<Scalars['Float']['output']>;
803
+ id: Scalars['String']['output'];
804
+ notes: Maybe<Scalars['String']['output']>;
805
+ quantity: Scalars['Float']['output'];
806
+ quantityType: Scalars['String']['output'];
807
+ security: SecurityLite;
808
+ status: Scalars['String']['output'];
809
+ valuationDate: Maybe<Scalars['Date']['output']>;
810
+ valuationSource: Maybe<Scalars['String']['output']>;
811
+ };
779
812
  export type PositionList = {
780
813
  pagination: PaginationInfo;
781
814
  positions: Array<Position>;
@@ -844,7 +877,7 @@ export type Query = {
844
877
  mappings: Maybe<StructureList>;
845
878
  periodCloseStatus: Maybe<PeriodCloseStatus>;
846
879
  periodDrafts: Maybe<PeriodDrafts>;
847
- portfolio: Maybe<Portfolio>;
880
+ portfolioBlock: Maybe<PortfolioBlock>;
848
881
  portfolios: Maybe<PortfolioList>;
849
882
  position: Maybe<Position>;
850
883
  positions: Maybe<PositionList>;
@@ -986,7 +1019,7 @@ export type QueryPeriodCloseStatusArgs = {
986
1019
  export type QueryPeriodDraftsArgs = {
987
1020
  period: Scalars['String']['input'];
988
1021
  };
989
- export type QueryPortfolioArgs = {
1022
+ export type QueryPortfolioBlockArgs = {
990
1023
  portfolioId: Scalars['String']['input'];
991
1024
  };
992
1025
  export type QueryPortfoliosArgs = {
@@ -1100,22 +1133,22 @@ export type ReportList = {
1100
1133
  };
1101
1134
  export type ReportPackage = {
1102
1135
  aiGenerated: Scalars['Boolean']['output'];
1103
- createdAt: Scalars['String']['output'];
1136
+ createdAt: Scalars['DateTime']['output'];
1104
1137
  createdBy: Scalars['String']['output'];
1105
1138
  description: Maybe<Scalars['String']['output']>;
1106
1139
  entityName: Maybe<Scalars['String']['output']>;
1107
- filedAt: Maybe<Scalars['String']['output']>;
1140
+ filedAt: Maybe<Scalars['DateTime']['output']>;
1108
1141
  filedBy: Maybe<Scalars['String']['output']>;
1109
1142
  filingStatus: Scalars['String']['output'];
1110
1143
  generationStatus: Scalars['String']['output'];
1111
1144
  id: Scalars['ID']['output'];
1112
1145
  items: Array<ReportPackageItem>;
1113
- lastGenerated: Maybe<Scalars['String']['output']>;
1146
+ lastGenerated: Maybe<Scalars['DateTime']['output']>;
1114
1147
  name: Scalars['String']['output'];
1115
- periodEnd: Maybe<Scalars['String']['output']>;
1116
- periodStart: Maybe<Scalars['String']['output']>;
1148
+ periodEnd: Maybe<Scalars['Date']['output']>;
1149
+ periodStart: Maybe<Scalars['Date']['output']>;
1117
1150
  periodType: Scalars['String']['output'];
1118
- sharedAt: Maybe<Scalars['String']['output']>;
1151
+ sharedAt: Maybe<Scalars['DateTime']['output']>;
1119
1152
  sourceGraphId: Maybe<Scalars['String']['output']>;
1120
1153
  sourceReportId: Maybe<Scalars['String']['output']>;
1121
1154
  supersededById: Maybe<Scalars['String']['output']>;
@@ -1147,6 +1180,15 @@ export type SecurityList = {
1147
1180
  pagination: PaginationInfo;
1148
1181
  securities: Array<Security>;
1149
1182
  };
1183
+ export type SecurityLite = {
1184
+ id: Scalars['String']['output'];
1185
+ isActive: Scalars['Boolean']['output'];
1186
+ issuer: Maybe<EntityLite>;
1187
+ name: Scalars['String']['output'];
1188
+ securitySubtype: Maybe<Scalars['String']['output']>;
1189
+ securityType: Scalars['String']['output'];
1190
+ sourceGraphId: Maybe<Scalars['String']['output']>;
1191
+ };
1150
1192
  export type Statement = {
1151
1193
  periods: Array<PeriodSpec>;
1152
1194
  reportId: Scalars['String']['output'];
@@ -1314,19 +1356,52 @@ export type GetInvestorHoldingsQuery = {
1314
1356
  }>;
1315
1357
  } | null;
1316
1358
  };
1317
- export type GetInvestorPortfolioQueryVariables = Exact<{
1359
+ export type GetInvestorPortfolioBlockQueryVariables = Exact<{
1318
1360
  portfolioId: Scalars['String']['input'];
1319
1361
  }>;
1320
- export type GetInvestorPortfolioQuery = {
1321
- portfolio: {
1362
+ export type GetInvestorPortfolioBlockQuery = {
1363
+ portfolioBlock: {
1322
1364
  id: string;
1323
1365
  name: string;
1324
1366
  description: string | null;
1325
1367
  strategy: string | null;
1326
1368
  inceptionDate: any | null;
1327
1369
  baseCurrency: string;
1370
+ totalCostBasisDollars: number;
1371
+ totalCurrentValueDollars: number | null;
1372
+ activePositionCount: number;
1328
1373
  createdAt: any;
1329
1374
  updatedAt: any;
1375
+ owner: {
1376
+ id: string;
1377
+ name: string;
1378
+ sourceGraphId: string | null;
1379
+ } | null;
1380
+ positions: Array<{
1381
+ id: string;
1382
+ quantity: number;
1383
+ quantityType: string;
1384
+ costBasisDollars: number;
1385
+ currentValueDollars: number | null;
1386
+ valuationDate: any | null;
1387
+ valuationSource: string | null;
1388
+ acquisitionDate: any | null;
1389
+ status: string;
1390
+ notes: string | null;
1391
+ security: {
1392
+ id: string;
1393
+ name: string;
1394
+ securityType: string;
1395
+ securitySubtype: string | null;
1396
+ isActive: boolean;
1397
+ sourceGraphId: string | null;
1398
+ issuer: {
1399
+ id: string;
1400
+ name: string;
1401
+ sourceGraphId: string | null;
1402
+ } | null;
1403
+ };
1404
+ }>;
1330
1405
  } | null;
1331
1406
  };
1332
1407
  export type ListInvestorPortfoliosQueryVariables = Exact<{
@@ -2169,21 +2244,21 @@ export type GetLedgerReportPackageQuery = {
2169
2244
  description: string | null;
2170
2245
  taxonomyId: string;
2171
2246
  periodType: string;
2172
- periodStart: string | null;
2173
- periodEnd: string | null;
2247
+ periodStart: any | null;
2248
+ periodEnd: any | null;
2174
2249
  generationStatus: string;
2175
- lastGenerated: string | null;
2250
+ lastGenerated: any | null;
2176
2251
  filingStatus: string;
2177
- filedAt: string | null;
2252
+ filedAt: any | null;
2178
2253
  filedBy: string | null;
2179
2254
  supersedesId: string | null;
2180
2255
  supersededById: string | null;
2181
2256
  sourceGraphId: string | null;
2182
2257
  sourceReportId: string | null;
2183
- sharedAt: string | null;
2258
+ sharedAt: any | null;
2184
2259
  entityName: string | null;
2185
2260
  aiGenerated: boolean;
2186
- createdAt: string;
2261
+ createdAt: any;
2187
2262
  createdBy: string;
2188
2263
  items: Array<{
2189
2264
  factSetId: string;
@@ -2771,7 +2846,7 @@ export type GetLibraryTaxonomyQuery = {
2771
2846
  } | null;
2772
2847
  };
2773
2848
  export declare const GetInvestorHoldingsDocument: DocumentNode<GetInvestorHoldingsQuery, GetInvestorHoldingsQueryVariables>;
2774
- export declare const GetInvestorPortfolioDocument: DocumentNode<GetInvestorPortfolioQuery, GetInvestorPortfolioQueryVariables>;
2849
+ export declare const GetInvestorPortfolioBlockDocument: DocumentNode<GetInvestorPortfolioBlockQuery, GetInvestorPortfolioBlockQueryVariables>;
2775
2850
  export declare const ListInvestorPortfoliosDocument: DocumentNode<ListInvestorPortfoliosQuery, ListInvestorPortfoliosQueryVariables>;
2776
2851
  export declare const GetInvestorPositionDocument: DocumentNode<GetInvestorPositionQuery, GetInvestorPositionQueryVariables>;
2777
2852
  export declare const ListInvestorPositionsDocument: DocumentNode<ListInvestorPositionsQuery, ListInvestorPositionsQueryVariables>;