@robosystems/client 0.3.12 → 0.3.14

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.
Files changed (46) hide show
  1. package/artifacts/LedgerClient.d.ts +22 -1
  2. package/artifacts/LedgerClient.js +40 -0
  3. package/artifacts/LedgerClient.ts +67 -0
  4. package/artifacts/graphql/generated/graphql.d.ts +350 -32
  5. package/artifacts/graphql/generated/graphql.js +584 -24
  6. package/artifacts/graphql/generated/graphql.ts +927 -61
  7. package/artifacts/graphql/queries/ledger/accountRollups.js +1 -1
  8. package/artifacts/graphql/queries/ledger/accountRollups.ts +1 -1
  9. package/artifacts/graphql/queries/ledger/accountTree.js +4 -4
  10. package/artifacts/graphql/queries/ledger/accountTree.ts +4 -4
  11. package/artifacts/graphql/queries/ledger/accounts.js +0 -1
  12. package/artifacts/graphql/queries/ledger/accounts.ts +0 -1
  13. package/artifacts/graphql/queries/ledger/elements.js +0 -1
  14. package/artifacts/graphql/queries/ledger/elements.ts +0 -1
  15. package/artifacts/graphql/queries/ledger/informationBlock.js +110 -0
  16. package/artifacts/graphql/queries/ledger/informationBlock.ts +110 -0
  17. package/artifacts/graphql/queries/ledger/mappedTrialBalance.js +1 -1
  18. package/artifacts/graphql/queries/ledger/mappedTrialBalance.ts +1 -1
  19. package/artifacts/graphql/queries/ledger/reportPackage.d.ts +11 -0
  20. package/artifacts/graphql/queries/ledger/reportPackage.js +151 -0
  21. package/artifacts/graphql/queries/ledger/reportPackage.ts +149 -0
  22. package/artifacts/graphql/queries/ledger/statement.js +1 -1
  23. package/artifacts/graphql/queries/ledger/statement.ts +1 -1
  24. package/artifacts/graphql/queries/ledger/trialBalance.js +1 -1
  25. package/artifacts/graphql/queries/ledger/trialBalance.ts +1 -1
  26. package/artifacts/graphql/queries/ledger/unmappedElements.js +1 -1
  27. package/artifacts/graphql/queries/ledger/unmappedElements.ts +1 -1
  28. package/artifacts/graphql/queries/library/arcs.js +3 -3
  29. package/artifacts/graphql/queries/library/arcs.ts +3 -3
  30. package/artifacts/graphql/queries/library/elements.js +3 -3
  31. package/artifacts/graphql/queries/library/elements.ts +3 -3
  32. package/index.ts +2 -2
  33. package/package.json +1 -1
  34. package/sdk/index.d.ts +2 -2
  35. package/sdk/index.js +4 -2
  36. package/sdk/index.ts +2 -2
  37. package/sdk/sdk.gen.d.ts +17 -1
  38. package/sdk/sdk.gen.js +36 -2
  39. package/sdk/sdk.gen.ts +35 -1
  40. package/sdk/types.gen.d.ts +199 -11
  41. package/sdk/types.gen.ts +211 -11
  42. package/sdk.gen.d.ts +17 -1
  43. package/sdk.gen.js +36 -2
  44. package/sdk.gen.ts +35 -1
  45. package/types.gen.d.ts +199 -11
  46. package/types.gen.ts +211 -11
@@ -1,6 +1,6 @@
1
1
  import type { AutoMapElementsOperation, CreateAgentRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteMappingAssociationOperation, DeleteTaxonomyBlockRequest, EvaluateRulesRequest, FinancialStatementAnalysisRequest, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, OperationEnvelope, UpdateAgentRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest } from '../types.gen';
2
2
  import type { TokenProvider } from './graphql/client';
3
- import { type GetInformationBlockQuery, type GetLedgerAccountRollupsQuery, type GetLedgerAccountTreeQuery, type GetLedgerClosingBookStructuresQuery, type GetLedgerEntityQuery, type GetLedgerFiscalCalendarQuery, type GetLedgerMappedTrialBalanceQuery, type GetLedgerMappingCoverageQuery, type GetLedgerMappingQuery, type GetLedgerPeriodCloseStatusQuery, type GetLedgerPeriodDraftsQuery, type GetLedgerPublishListQuery, type GetLedgerReportingTaxonomyQuery, type GetLedgerReportQuery, type GetLedgerStatementQuery, type GetLedgerSummaryQuery, type GetLedgerTransactionQuery, type GetLedgerTrialBalanceQuery, type ListInformationBlocksQuery, type ListLedgerAccountsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery } from './graphql/generated/graphql';
3
+ import { type GetInformationBlockQuery, type GetLedgerAccountRollupsQuery, type GetLedgerAccountTreeQuery, type GetLedgerClosingBookStructuresQuery, type GetLedgerEntityQuery, type GetLedgerFiscalCalendarQuery, type GetLedgerMappedTrialBalanceQuery, type GetLedgerMappingCoverageQuery, type GetLedgerMappingQuery, type GetLedgerPeriodCloseStatusQuery, type GetLedgerPeriodDraftsQuery, type GetLedgerPublishListQuery, type GetLedgerReportingTaxonomyQuery, type GetLedgerReportPackageQuery, type GetLedgerReportQuery, type GetLedgerStatementQuery, type GetLedgerSummaryQuery, type GetLedgerTransactionQuery, type GetLedgerTrialBalanceQuery, type ListInformationBlocksQuery, type ListLedgerAccountsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery } from './graphql/generated/graphql';
4
4
  export type LedgerEntity = NonNullable<GetLedgerEntityQuery['entity']>;
5
5
  export type LedgerEntitySummary = ListLedgerEntitiesQuery['entities'][number];
6
6
  export type LedgerSummary = NonNullable<GetLedgerSummaryQuery['summary']>;
@@ -39,6 +39,8 @@ export type LedgerClosingBookStructures = NonNullable<GetLedgerClosingBookStruct
39
39
  export type LedgerFiscalCalendar = NonNullable<GetLedgerFiscalCalendarQuery['fiscalCalendar']>;
40
40
  export type LedgerFiscalPeriod = LedgerFiscalCalendar['periods'][number];
41
41
  export type Report = NonNullable<GetLedgerReportQuery['report']>;
42
+ export type ReportPackage = NonNullable<GetLedgerReportPackageQuery['reportPackage']>;
43
+ export type ReportPackageItem = ReportPackage['items'][number];
42
44
  export type ReportListItem = NonNullable<ListLedgerReportsQuery['reports']>['reports'][number];
43
45
  export type StatementData = NonNullable<GetLedgerStatementQuery['statement']>;
44
46
  export type StatementPeriod = StatementData['periods'][number];
@@ -446,6 +448,13 @@ export declare class LedgerClient {
446
448
  listReports(graphId: string): Promise<ReportListItem[]>;
447
449
  /** Get a single report with its period list + available structures. */
448
450
  getReport(graphId: string, reportId: string): Promise<Report | null>;
451
+ /**
452
+ * Rehydrate a Report as a package — Report metadata + N
453
+ * `InformationBlock` envelopes (one per attached FactSet). Drives the
454
+ * package viewer; returns everything needed to render BS + IS (and any
455
+ * other statements the Report generated) without per-section fetches.
456
+ */
457
+ getReportPackage(graphId: string, reportId: string): Promise<ReportPackage | null>;
449
458
  /**
450
459
  * Render a financial statement — facts viewed through a structure.
451
460
  *
@@ -464,6 +473,18 @@ export declare class LedgerClient {
464
473
  * Each target graph receives a snapshot copy of the report's facts.
465
474
  */
466
475
  shareReport(graphId: string, reportId: string, publishListId: string): Promise<ReportOperationAck>;
476
+ /**
477
+ * Transition a Report's filing_status to 'filed' — locks the package.
478
+ * Allowed from 'draft' or 'under_review'. Stamps filed_at + filed_by
479
+ * from the auth context + server clock.
480
+ */
481
+ fileReport(graphId: string, reportId: string): Promise<ReportOperationAck>;
482
+ /**
483
+ * Move a Report along the non-file legs of the filing lifecycle
484
+ * (draft ↔ under_review, filed → archived). Use ``fileReport`` to
485
+ * reach 'filed' so the audit fields land cleanly.
486
+ */
487
+ transitionFilingStatus(graphId: string, reportId: string, targetStatus: string): Promise<ReportOperationAck>;
467
488
  /** Check if a report was received via sharing (vs locally created). */
468
489
  isSharedReport(report: Report): boolean;
469
490
  /** List publish lists with pagination. */
@@ -624,6 +624,15 @@ class LedgerClient {
624
624
  async getReport(graphId, reportId) {
625
625
  return this.gqlQuery(graphId, graphql_1.GetLedgerReportDocument, { reportId }, 'Get report', (data) => data.report);
626
626
  }
627
+ /**
628
+ * Rehydrate a Report as a package — Report metadata + N
629
+ * `InformationBlock` envelopes (one per attached FactSet). Drives the
630
+ * package viewer; returns everything needed to render BS + IS (and any
631
+ * other statements the Report generated) without per-section fetches.
632
+ */
633
+ async getReportPackage(graphId, reportId) {
634
+ return this.gqlQuery(graphId, graphql_1.GetLedgerReportPackageDocument, { reportId }, 'Get report package', (data) => data.reportPackage);
635
+ }
627
636
  /**
628
637
  * Render a financial statement — facts viewed through a structure.
629
638
  *
@@ -676,6 +685,37 @@ class LedgerClient {
676
685
  result: envelope.result ?? null,
677
686
  };
678
687
  }
688
+ /**
689
+ * Transition a Report's filing_status to 'filed' — locks the package.
690
+ * Allowed from 'draft' or 'under_review'. Stamps filed_at + filed_by
691
+ * from the auth context + server clock.
692
+ */
693
+ async fileReport(graphId, reportId) {
694
+ const body = { report_id: reportId };
695
+ const envelope = await this.callOperation('File report', (0, sdk_gen_1.opFileReport)({ path: { graph_id: graphId }, body }));
696
+ return {
697
+ operationId: envelope.operationId,
698
+ status: envelope.status,
699
+ result: envelope.result ?? null,
700
+ };
701
+ }
702
+ /**
703
+ * Move a Report along the non-file legs of the filing lifecycle
704
+ * (draft ↔ under_review, filed → archived). Use ``fileReport`` to
705
+ * reach 'filed' so the audit fields land cleanly.
706
+ */
707
+ async transitionFilingStatus(graphId, reportId, targetStatus) {
708
+ const body = {
709
+ report_id: reportId,
710
+ target_status: targetStatus,
711
+ };
712
+ const envelope = await this.callOperation('Transition filing status', (0, sdk_gen_1.opTransitionFilingStatus)({ path: { graph_id: graphId }, body }));
713
+ return {
714
+ operationId: envelope.operationId,
715
+ status: envelope.status,
716
+ result: envelope.result ?? null,
717
+ };
718
+ }
679
719
  /** Check if a report was received via sharing (vs locally created). */
680
720
  isSharedReport(report) {
681
721
  return report.sourceGraphId !== null;
@@ -44,6 +44,7 @@ import {
44
44
  opDeleteReport,
45
45
  opDeleteTaxonomyBlock,
46
46
  opEvaluateRules,
47
+ opFileReport,
47
48
  opFinancialStatementAnalysis,
48
49
  opInitializeLedger,
49
50
  opLinkEntityTaxonomy,
@@ -54,6 +55,7 @@ import {
54
55
  opReopenPeriod,
55
56
  opSetCloseTarget,
56
57
  opShareReport,
58
+ opTransitionFilingStatus,
57
59
  opUpdateAgent,
58
60
  opUpdateEntity,
59
61
  opUpdateEventBlock,
@@ -81,6 +83,7 @@ import type {
81
83
  DeleteMappingAssociationOperation,
82
84
  DeleteTaxonomyBlockRequest,
83
85
  EvaluateRulesRequest,
86
+ FileReportRequest,
84
87
  FinancialStatementAnalysisRequest,
85
88
  InitializeLedgerRequest,
86
89
  LinkEntityTaxonomyRequest,
@@ -88,6 +91,7 @@ import type {
88
91
  OperationEnvelope,
89
92
  ReopenPeriodOperation,
90
93
  SetCloseTargetOperation,
94
+ TransitionFilingStatusRequest,
91
95
  UpdateAgentRequest,
92
96
  UpdateEntityRequest,
93
97
  UpdateEventBlockRequest,
@@ -114,6 +118,7 @@ import {
114
118
  GetLedgerPublishListDocument,
115
119
  GetLedgerReportDocument,
116
120
  GetLedgerReportingTaxonomyDocument,
121
+ GetLedgerReportPackageDocument,
117
122
  GetLedgerStatementDocument,
118
123
  GetLedgerSummaryDocument,
119
124
  GetLedgerTransactionDocument,
@@ -142,6 +147,7 @@ import {
142
147
  type GetLedgerPeriodDraftsQuery,
143
148
  type GetLedgerPublishListQuery,
144
149
  type GetLedgerReportingTaxonomyQuery,
150
+ type GetLedgerReportPackageQuery,
145
151
  type GetLedgerReportQuery,
146
152
  type GetLedgerStatementQuery,
147
153
  type GetLedgerSummaryQuery,
@@ -227,6 +233,8 @@ export type LedgerFiscalPeriod = LedgerFiscalCalendar['periods'][number]
227
233
 
228
234
  // Reports + publish lists + statements
229
235
  export type Report = NonNullable<GetLedgerReportQuery['report']>
236
+ export type ReportPackage = NonNullable<GetLedgerReportPackageQuery['reportPackage']>
237
+ export type ReportPackageItem = ReportPackage['items'][number]
230
238
  export type ReportListItem = NonNullable<ListLedgerReportsQuery['reports']>['reports'][number]
231
239
  export type StatementData = NonNullable<GetLedgerStatementQuery['statement']>
232
240
  export type StatementPeriod = StatementData['periods'][number]
@@ -1532,6 +1540,22 @@ export class LedgerClient {
1532
1540
  )
1533
1541
  }
1534
1542
 
1543
+ /**
1544
+ * Rehydrate a Report as a package — Report metadata + N
1545
+ * `InformationBlock` envelopes (one per attached FactSet). Drives the
1546
+ * package viewer; returns everything needed to render BS + IS (and any
1547
+ * other statements the Report generated) without per-section fetches.
1548
+ */
1549
+ async getReportPackage(graphId: string, reportId: string): Promise<ReportPackage | null> {
1550
+ return this.gqlQuery(
1551
+ graphId,
1552
+ GetLedgerReportPackageDocument,
1553
+ { reportId },
1554
+ 'Get report package',
1555
+ (data) => data.reportPackage
1556
+ )
1557
+ }
1558
+
1535
1559
  /**
1536
1560
  * Render a financial statement — facts viewed through a structure.
1537
1561
  *
@@ -1616,6 +1640,49 @@ export class LedgerClient {
1616
1640
  }
1617
1641
  }
1618
1642
 
1643
+ /**
1644
+ * Transition a Report's filing_status to 'filed' — locks the package.
1645
+ * Allowed from 'draft' or 'under_review'. Stamps filed_at + filed_by
1646
+ * from the auth context + server clock.
1647
+ */
1648
+ async fileReport(graphId: string, reportId: string): Promise<ReportOperationAck> {
1649
+ const body: FileReportRequest = { report_id: reportId }
1650
+ const envelope = await this.callOperation(
1651
+ 'File report',
1652
+ opFileReport({ path: { graph_id: graphId }, body })
1653
+ )
1654
+ return {
1655
+ operationId: envelope.operationId,
1656
+ status: envelope.status,
1657
+ result: (envelope.result as Record<string, unknown> | null) ?? null,
1658
+ }
1659
+ }
1660
+
1661
+ /**
1662
+ * Move a Report along the non-file legs of the filing lifecycle
1663
+ * (draft ↔ under_review, filed → archived). Use ``fileReport`` to
1664
+ * reach 'filed' so the audit fields land cleanly.
1665
+ */
1666
+ async transitionFilingStatus(
1667
+ graphId: string,
1668
+ reportId: string,
1669
+ targetStatus: string
1670
+ ): Promise<ReportOperationAck> {
1671
+ const body: TransitionFilingStatusRequest = {
1672
+ report_id: reportId,
1673
+ target_status: targetStatus,
1674
+ }
1675
+ const envelope = await this.callOperation(
1676
+ 'Transition filing status',
1677
+ opTransitionFilingStatus({ path: { graph_id: graphId }, body })
1678
+ )
1679
+ return {
1680
+ operationId: envelope.operationId,
1681
+ status: envelope.status,
1682
+ result: (envelope.result as Record<string, unknown> | null) ?? null,
1683
+ }
1684
+ }
1685
+
1619
1686
  /** Check if a report was received via sharing (vs locally created). */
1620
1687
  isSharedReport(report: Report): boolean {
1621
1688
  return report.sourceGraphId !== null