@robosystems/client 2.8.0 → 2.8.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/artifacts/LedgerClient.d.ts +56 -17
- package/artifacts/LedgerClient.js +68 -25
- package/artifacts/LedgerClient.ts +113 -29
- package/artifacts/graphql/generated/graphql.d.ts +22 -5
- package/artifacts/graphql/generated/graphql.js +177 -0
- package/artifacts/graphql/generated/graphql.ts +209 -5
- package/artifacts/graphql/queries/ledger/accountRollups.js +12 -2
- package/artifacts/graphql/queries/ledger/accountRollups.ts +12 -2
- package/artifacts/graphql/queries/ledger/accountTree.js +2 -2
- package/artifacts/graphql/queries/ledger/accountTree.ts +2 -2
- package/artifacts/graphql/queries/ledger/accounts.js +8 -1
- package/artifacts/graphql/queries/ledger/accounts.ts +8 -1
- package/artifacts/graphql/queries/ledger/closingBookStructures.js +2 -2
- package/artifacts/graphql/queries/ledger/closingBookStructures.ts +2 -2
- package/artifacts/graphql/queries/ledger/entities.js +1 -0
- package/artifacts/graphql/queries/ledger/entities.ts +1 -0
- package/artifacts/graphql/queries/ledger/entity.js +4 -2
- package/artifacts/graphql/queries/ledger/entity.ts +4 -2
- package/artifacts/graphql/queries/ledger/eventBlocks.js +2 -0
- package/artifacts/graphql/queries/ledger/eventBlocks.ts +2 -0
- package/artifacts/graphql/queries/ledger/fiscalCalendar.js +3 -2
- package/artifacts/graphql/queries/ledger/fiscalCalendar.ts +3 -2
- package/artifacts/graphql/queries/ledger/journalEntries.js +2 -0
- package/artifacts/graphql/queries/ledger/journalEntries.ts +2 -0
- package/artifacts/graphql/queries/ledger/periodCloseStatus.js +2 -2
- package/artifacts/graphql/queries/ledger/periodCloseStatus.ts +2 -2
- package/artifacts/graphql/queries/ledger/periodDrafts.js +2 -2
- package/artifacts/graphql/queries/ledger/periodDrafts.ts +2 -2
- package/artifacts/graphql/queries/ledger/reconciliations.js +2 -2
- package/artifacts/graphql/queries/ledger/reconciliations.ts +2 -2
- package/artifacts/graphql/queries/ledger/report.js +1 -0
- package/artifacts/graphql/queries/ledger/report.ts +1 -0
- package/artifacts/graphql/queries/ledger/reports.js +3 -2
- package/artifacts/graphql/queries/ledger/reports.ts +3 -2
- package/artifacts/graphql/queries/ledger/summary.js +3 -2
- package/artifacts/graphql/queries/ledger/summary.ts +3 -2
- package/artifacts/graphql/queries/ledger/transactions.js +2 -0
- package/artifacts/graphql/queries/ledger/transactions.ts +2 -0
- package/artifacts/graphql/queries/ledger/trialBalance.js +2 -2
- package/artifacts/graphql/queries/ledger/trialBalance.ts +2 -2
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
closePeriod,
|
|
37
37
|
computeMetrics,
|
|
38
38
|
createAgent,
|
|
39
|
+
createEntity,
|
|
39
40
|
createEventBlock,
|
|
40
41
|
createEventHandler,
|
|
41
42
|
createInformationBlock,
|
|
@@ -95,6 +96,7 @@ import type {
|
|
|
95
96
|
ComputeMetricsRequest,
|
|
96
97
|
ComputeMetricsResponse,
|
|
97
98
|
CreateAgentRequest,
|
|
99
|
+
CreateEntityRequest,
|
|
98
100
|
CreateEventBlockRequest,
|
|
99
101
|
CreateEventHandlerRequest,
|
|
100
102
|
CreateInformationBlockRequest,
|
|
@@ -421,6 +423,7 @@ interface RawObligationDetail {
|
|
|
421
423
|
|
|
422
424
|
interface RawFiscalCalendar {
|
|
423
425
|
graph_id: string
|
|
426
|
+
entity_id?: string | null
|
|
424
427
|
fiscal_year_start_month: number
|
|
425
428
|
closed_through: string | null
|
|
426
429
|
close_target: string | null
|
|
@@ -557,6 +560,8 @@ export type LedgerEntryType = 'standard' | 'adjusting' | 'closing' | 'reversing'
|
|
|
557
560
|
// ── Caller-facing option interfaces ────────────────────────────────────
|
|
558
561
|
|
|
559
562
|
export interface InitializeLedgerOptions {
|
|
563
|
+
/** The entity whose calendar is seeded. Omitted: the group parent. */
|
|
564
|
+
entityId?: string | null
|
|
560
565
|
closedThrough?: string | null
|
|
561
566
|
fiscalYearStartMonth?: number
|
|
562
567
|
earliestDataPeriod?: string | null
|
|
@@ -568,6 +573,8 @@ export interface InitializeLedgerOptions {
|
|
|
568
573
|
export type ChartTemplateKey = InitializeChartOfAccountsRequest['template']
|
|
569
574
|
|
|
570
575
|
export interface InitializeChartOfAccountsOptions {
|
|
576
|
+
/** The entity the chart belongs to. Omitted: the group parent. */
|
|
577
|
+
entityId?: string | null
|
|
571
578
|
/**
|
|
572
579
|
* Legal form for the equity mapping: `corporation`, `llc` or `partnership`.
|
|
573
580
|
* Defaults to the graph's primary entity, then to corporation.
|
|
@@ -591,7 +598,17 @@ export interface InitializeChartOfAccountsResult {
|
|
|
591
598
|
unresolved: string[]
|
|
592
599
|
}
|
|
593
600
|
|
|
594
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Which of the graph's entities a call is about. Omitted, it is the group
|
|
603
|
+
* parent: the entity the graph's own source connection books for. Every
|
|
604
|
+
* graph has one; a graph with subsidiaries has more, and each keeps its own
|
|
605
|
+
* books, chart and calendar.
|
|
606
|
+
*/
|
|
607
|
+
export interface EntityScopeOptions {
|
|
608
|
+
entityId?: string | null
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export interface ClosePeriodOptions extends EntityScopeOptions {
|
|
595
612
|
note?: string | null
|
|
596
613
|
allowStaleSync?: boolean
|
|
597
614
|
/**
|
|
@@ -777,20 +794,24 @@ export class LedgerClient {
|
|
|
777
794
|
// ── Entity ──────────────────────────────────────────────────────────
|
|
778
795
|
|
|
779
796
|
/**
|
|
780
|
-
* Get
|
|
781
|
-
* Returns null when the ledger has no entity yet.
|
|
797
|
+
* Get an entity of this graph: the group parent, or the one `entityId`
|
|
798
|
+
* names. Returns null when the ledger has no entity yet.
|
|
782
799
|
*/
|
|
783
|
-
async getEntity(graphId: string): Promise<LedgerEntity | null> {
|
|
800
|
+
async getEntity(graphId: string, options?: EntityScopeOptions): Promise<LedgerEntity | null> {
|
|
784
801
|
return this.gqlQuery(
|
|
785
802
|
graphId,
|
|
786
803
|
GetLedgerEntityDocument,
|
|
787
|
-
|
|
804
|
+
{ entityId: options?.entityId ?? null },
|
|
788
805
|
'Get entity',
|
|
789
806
|
(data) => data.entity
|
|
790
807
|
)
|
|
791
808
|
}
|
|
792
809
|
|
|
793
|
-
/**
|
|
810
|
+
/**
|
|
811
|
+
* List the graph's entities, optionally filtered by source system. The
|
|
812
|
+
* group parent is the row with `isParent`; a subsidiary names its
|
|
813
|
+
* `parentEntityId` and may carry an `ownershipPct`.
|
|
814
|
+
*/
|
|
794
815
|
async listEntities(
|
|
795
816
|
graphId: string,
|
|
796
817
|
options?: { source?: string }
|
|
@@ -823,14 +844,30 @@ export class LedgerClient {
|
|
|
823
844
|
return entityResponseToCamel(raw)
|
|
824
845
|
}
|
|
825
846
|
|
|
847
|
+
/**
|
|
848
|
+
* Create an entity in this graph. A graph's first entity becomes the group
|
|
849
|
+
* parent; every later one is a subsidiary of the parent unless
|
|
850
|
+
* `parent_entity_id` names another entity. The `ticker` prefixes the
|
|
851
|
+
* entity's account names and is unique in the graph (derived from the
|
|
852
|
+
* name's initials when omitted). Returns the entity in the shape
|
|
853
|
+
* `getEntity` returns.
|
|
854
|
+
*/
|
|
855
|
+
async createEntity(graphId: string, body: CreateEntityRequest): Promise<LedgerEntity> {
|
|
856
|
+
const envelope = await this.callOperation('Create entity', (o) =>
|
|
857
|
+
createEntity({ ...o, path: { graph_id: graphId }, body })
|
|
858
|
+
)
|
|
859
|
+
const raw = this.requireResult('Create entity', envelope.result)
|
|
860
|
+
return entityResponseToCamel(raw)
|
|
861
|
+
}
|
|
862
|
+
|
|
826
863
|
// ── Summary ────────────────────────────────────────────────────────
|
|
827
864
|
|
|
828
865
|
/** Ledger rollup counts + QB sync metadata. */
|
|
829
|
-
async getSummary(graphId: string): Promise<LedgerSummary | null> {
|
|
866
|
+
async getSummary(graphId: string, options?: EntityScopeOptions): Promise<LedgerSummary | null> {
|
|
830
867
|
return this.gqlQuery(
|
|
831
868
|
graphId,
|
|
832
869
|
GetLedgerSummaryDocument,
|
|
833
|
-
|
|
870
|
+
{ entityId: options?.entityId ?? null },
|
|
834
871
|
'Get summary',
|
|
835
872
|
(data) => data.summary
|
|
836
873
|
)
|
|
@@ -846,6 +883,7 @@ export class LedgerClient {
|
|
|
846
883
|
isActive?: boolean
|
|
847
884
|
limit?: number
|
|
848
885
|
offset?: number
|
|
886
|
+
entityId?: string | null
|
|
849
887
|
}
|
|
850
888
|
): Promise<LedgerAccountList | null> {
|
|
851
889
|
return this.gqlQuery(
|
|
@@ -856,6 +894,7 @@ export class LedgerClient {
|
|
|
856
894
|
isActive: options?.isActive ?? null,
|
|
857
895
|
limit: options?.limit ?? 100,
|
|
858
896
|
offset: options?.offset ?? 0,
|
|
897
|
+
entityId: options?.entityId ?? null,
|
|
859
898
|
},
|
|
860
899
|
'List accounts',
|
|
861
900
|
(data) => data.accounts
|
|
@@ -863,11 +902,14 @@ export class LedgerClient {
|
|
|
863
902
|
}
|
|
864
903
|
|
|
865
904
|
/** Hierarchical Chart of Accounts (up to 4 levels deep). */
|
|
866
|
-
async getAccountTree(
|
|
905
|
+
async getAccountTree(
|
|
906
|
+
graphId: string,
|
|
907
|
+
options?: EntityScopeOptions
|
|
908
|
+
): Promise<LedgerAccountTree | null> {
|
|
867
909
|
return this.gqlQuery(
|
|
868
910
|
graphId,
|
|
869
911
|
GetLedgerAccountTreeDocument,
|
|
870
|
-
|
|
912
|
+
{ entityId: options?.entityId ?? null },
|
|
871
913
|
'Get account tree',
|
|
872
914
|
(data) => data.accountTree
|
|
873
915
|
)
|
|
@@ -876,7 +918,7 @@ export class LedgerClient {
|
|
|
876
918
|
/** Accounts rolled up to reporting concepts via a mapping structure. */
|
|
877
919
|
async getAccountRollups(
|
|
878
920
|
graphId: string,
|
|
879
|
-
options?: { mappingId?: string; startDate?: string; endDate?: string }
|
|
921
|
+
options?: { mappingId?: string; startDate?: string; endDate?: string; entityId?: string | null }
|
|
880
922
|
): Promise<LedgerAccountRollups | null> {
|
|
881
923
|
return this.gqlQuery(
|
|
882
924
|
graphId,
|
|
@@ -885,6 +927,7 @@ export class LedgerClient {
|
|
|
885
927
|
mappingId: options?.mappingId ?? null,
|
|
886
928
|
startDate: options?.startDate ?? null,
|
|
887
929
|
endDate: options?.endDate ?? null,
|
|
930
|
+
entityId: options?.entityId ?? null,
|
|
888
931
|
},
|
|
889
932
|
'Get account rollups',
|
|
890
933
|
(data) => data.accountRollups
|
|
@@ -902,6 +945,7 @@ export class LedgerClient {
|
|
|
902
945
|
endDate?: string
|
|
903
946
|
limit?: number
|
|
904
947
|
offset?: number
|
|
948
|
+
entityId?: string | null
|
|
905
949
|
}
|
|
906
950
|
): Promise<LedgerTransactionList | null> {
|
|
907
951
|
return this.gqlQuery(
|
|
@@ -913,6 +957,7 @@ export class LedgerClient {
|
|
|
913
957
|
endDate: options?.endDate ?? null,
|
|
914
958
|
limit: options?.limit ?? 100,
|
|
915
959
|
offset: options?.offset ?? 0,
|
|
960
|
+
entityId: options?.entityId ?? null,
|
|
916
961
|
},
|
|
917
962
|
'List transactions',
|
|
918
963
|
(data) => data.transactions
|
|
@@ -945,6 +990,7 @@ export class LedgerClient {
|
|
|
945
990
|
transactionId?: string
|
|
946
991
|
limit?: number
|
|
947
992
|
offset?: number
|
|
993
|
+
entityId?: string | null
|
|
948
994
|
}
|
|
949
995
|
): Promise<LedgerJournalEntryList | null> {
|
|
950
996
|
return this.gqlQuery(
|
|
@@ -959,6 +1005,7 @@ export class LedgerClient {
|
|
|
959
1005
|
transactionId: options?.transactionId ?? null,
|
|
960
1006
|
limit: options?.limit ?? 100,
|
|
961
1007
|
offset: options?.offset ?? 0,
|
|
1008
|
+
entityId: options?.entityId ?? null,
|
|
962
1009
|
},
|
|
963
1010
|
'List journal entries',
|
|
964
1011
|
(data) => data.journalEntries
|
|
@@ -997,6 +1044,7 @@ export class LedgerClient {
|
|
|
997
1044
|
isReconcilingItem?: boolean
|
|
998
1045
|
limit?: number
|
|
999
1046
|
offset?: number
|
|
1047
|
+
entityId?: string | null
|
|
1000
1048
|
}
|
|
1001
1049
|
): Promise<LedgerEventBlock[]> {
|
|
1002
1050
|
return this.gqlQuery(
|
|
@@ -1011,6 +1059,7 @@ export class LedgerClient {
|
|
|
1011
1059
|
isReconcilingItem: options?.isReconcilingItem ?? null,
|
|
1012
1060
|
limit: options?.limit ?? 50,
|
|
1013
1061
|
offset: options?.offset ?? 0,
|
|
1062
|
+
entityId: options?.entityId ?? null,
|
|
1014
1063
|
},
|
|
1015
1064
|
'List event blocks',
|
|
1016
1065
|
(data) => data.eventBlocks
|
|
@@ -1076,7 +1125,7 @@ export class LedgerClient {
|
|
|
1076
1125
|
/** Trial balance by raw CoA account. */
|
|
1077
1126
|
async getTrialBalance(
|
|
1078
1127
|
graphId: string,
|
|
1079
|
-
options?: { startDate?: string; endDate?: string }
|
|
1128
|
+
options?: { startDate?: string; endDate?: string; entityId?: string | null }
|
|
1080
1129
|
): Promise<LedgerTrialBalance | null> {
|
|
1081
1130
|
return this.gqlQuery(
|
|
1082
1131
|
graphId,
|
|
@@ -1084,6 +1133,7 @@ export class LedgerClient {
|
|
|
1084
1133
|
{
|
|
1085
1134
|
startDate: options?.startDate ?? null,
|
|
1086
1135
|
endDate: options?.endDate ?? null,
|
|
1136
|
+
entityId: options?.entityId ?? null,
|
|
1087
1137
|
},
|
|
1088
1138
|
'Get trial balance',
|
|
1089
1139
|
(data) => data.trialBalance
|
|
@@ -1727,23 +1777,28 @@ export class LedgerClient {
|
|
|
1727
1777
|
async getPeriodCloseStatus(
|
|
1728
1778
|
graphId: string,
|
|
1729
1779
|
periodStart: string,
|
|
1730
|
-
periodEnd: string
|
|
1780
|
+
periodEnd: string,
|
|
1781
|
+
options?: EntityScopeOptions
|
|
1731
1782
|
): Promise<LedgerPeriodCloseStatus | null> {
|
|
1732
1783
|
return this.gqlQuery(
|
|
1733
1784
|
graphId,
|
|
1734
1785
|
GetLedgerPeriodCloseStatusDocument,
|
|
1735
|
-
{ periodStart, periodEnd },
|
|
1786
|
+
{ periodStart, periodEnd, entityId: options?.entityId ?? null },
|
|
1736
1787
|
'Get period close status',
|
|
1737
1788
|
(data) => data.periodCloseStatus
|
|
1738
1789
|
)
|
|
1739
1790
|
}
|
|
1740
1791
|
|
|
1741
1792
|
/** All draft entries in a period, fully expanded for review pre-close. */
|
|
1742
|
-
async listPeriodDrafts(
|
|
1793
|
+
async listPeriodDrafts(
|
|
1794
|
+
graphId: string,
|
|
1795
|
+
period: string,
|
|
1796
|
+
options?: EntityScopeOptions
|
|
1797
|
+
): Promise<LedgerPeriodDrafts | null> {
|
|
1743
1798
|
return this.gqlQuery(
|
|
1744
1799
|
graphId,
|
|
1745
1800
|
GetLedgerPeriodDraftsDocument,
|
|
1746
|
-
{ period },
|
|
1801
|
+
{ period, entityId: options?.entityId ?? null },
|
|
1747
1802
|
'List period drafts',
|
|
1748
1803
|
(data) => data.periodDrafts
|
|
1749
1804
|
)
|
|
@@ -1790,11 +1845,14 @@ export class LedgerClient {
|
|
|
1790
1845
|
// ── Closing book ───────────────────────────────────────────────────
|
|
1791
1846
|
|
|
1792
1847
|
/** Grouped closing book structures for the close-screen sidebar. */
|
|
1793
|
-
async getClosingBookStructures(
|
|
1848
|
+
async getClosingBookStructures(
|
|
1849
|
+
graphId: string,
|
|
1850
|
+
options?: EntityScopeOptions
|
|
1851
|
+
): Promise<LedgerClosingBookStructures | null> {
|
|
1794
1852
|
return this.gqlQuery(
|
|
1795
1853
|
graphId,
|
|
1796
1854
|
GetLedgerClosingBookStructuresDocument,
|
|
1797
|
-
|
|
1855
|
+
{ entityId: options?.entityId ?? null },
|
|
1798
1856
|
'Get closing book structures',
|
|
1799
1857
|
(data) => data.closingBookStructures
|
|
1800
1858
|
)
|
|
@@ -1802,12 +1860,18 @@ export class LedgerClient {
|
|
|
1802
1860
|
|
|
1803
1861
|
// ── Fiscal Calendar ────────────────────────────────────────────────
|
|
1804
1862
|
|
|
1805
|
-
/**
|
|
1806
|
-
|
|
1863
|
+
/**
|
|
1864
|
+
* Current fiscal calendar state — pointers, gap, closeable status — for the
|
|
1865
|
+
* group parent, or for the entity `entityId` names.
|
|
1866
|
+
*/
|
|
1867
|
+
async getFiscalCalendar(
|
|
1868
|
+
graphId: string,
|
|
1869
|
+
options?: EntityScopeOptions
|
|
1870
|
+
): Promise<LedgerFiscalCalendar | null> {
|
|
1807
1871
|
return this.gqlQuery(
|
|
1808
1872
|
graphId,
|
|
1809
1873
|
GetLedgerFiscalCalendarDocument,
|
|
1810
|
-
|
|
1874
|
+
{ entityId: options?.entityId ?? null },
|
|
1811
1875
|
'Get fiscal calendar',
|
|
1812
1876
|
(data) => data.fiscalCalendar
|
|
1813
1877
|
)
|
|
@@ -1819,6 +1883,7 @@ export class LedgerClient {
|
|
|
1819
1883
|
options?: InitializeLedgerOptions
|
|
1820
1884
|
): Promise<InitializeLedgerResult> {
|
|
1821
1885
|
const body: InitializeLedgerRequest = {
|
|
1886
|
+
entity_id: options?.entityId ?? null,
|
|
1822
1887
|
closed_through: options?.closedThrough ?? null,
|
|
1823
1888
|
fiscal_year_start_month: options?.fiscalYearStartMonth,
|
|
1824
1889
|
earliest_data_period: options?.earliestDataPeriod ?? null,
|
|
@@ -1862,6 +1927,7 @@ export class LedgerClient {
|
|
|
1862
1927
|
): Promise<InitializeChartOfAccountsResult> {
|
|
1863
1928
|
const body: InitializeChartOfAccountsRequest = {
|
|
1864
1929
|
template,
|
|
1930
|
+
entity_id: options?.entityId ?? null,
|
|
1865
1931
|
entity_type: options?.entityType ?? null,
|
|
1866
1932
|
name: options?.name ?? null,
|
|
1867
1933
|
}
|
|
@@ -1885,16 +1951,24 @@ export class LedgerClient {
|
|
|
1885
1951
|
async setCloseTarget(
|
|
1886
1952
|
graphId: string,
|
|
1887
1953
|
period: string,
|
|
1888
|
-
note?: string | null
|
|
1954
|
+
note?: string | null,
|
|
1955
|
+
options?: EntityScopeOptions
|
|
1889
1956
|
): Promise<LedgerFiscalCalendar> {
|
|
1890
|
-
const body: SetCloseTargetOperation = {
|
|
1957
|
+
const body: SetCloseTargetOperation = {
|
|
1958
|
+
period,
|
|
1959
|
+
note: note ?? null,
|
|
1960
|
+
entity_id: options?.entityId ?? null,
|
|
1961
|
+
}
|
|
1891
1962
|
const envelope = await this.callOperation('Set close target', (o) =>
|
|
1892
1963
|
setCloseTarget({ ...o, path: { graph_id: graphId }, body })
|
|
1893
1964
|
)
|
|
1894
1965
|
return rawFiscalCalendarToCamel(envelope.result as unknown as RawFiscalCalendar)
|
|
1895
1966
|
}
|
|
1896
1967
|
|
|
1897
|
-
/**
|
|
1968
|
+
/**
|
|
1969
|
+
* Close a fiscal period — the final commit action — on the group parent,
|
|
1970
|
+
* or on the entity `entityId` names. Each entity closes on its own.
|
|
1971
|
+
*/
|
|
1898
1972
|
async closePeriod(
|
|
1899
1973
|
graphId: string,
|
|
1900
1974
|
period: string,
|
|
@@ -1902,6 +1976,7 @@ export class LedgerClient {
|
|
|
1902
1976
|
): Promise<ClosePeriodResult> {
|
|
1903
1977
|
const body: ClosePeriodOperation = {
|
|
1904
1978
|
period,
|
|
1979
|
+
entity_id: options?.entityId ?? null,
|
|
1905
1980
|
note: options?.note ?? null,
|
|
1906
1981
|
allow_stale_sync: options?.allowStaleSync,
|
|
1907
1982
|
allow_stranded_obligations: options?.allowStrandedObligations,
|
|
@@ -1930,12 +2005,14 @@ export class LedgerClient {
|
|
|
1930
2005
|
graphId: string,
|
|
1931
2006
|
period: string,
|
|
1932
2007
|
reason: string,
|
|
1933
|
-
note?: string | null
|
|
2008
|
+
note?: string | null,
|
|
2009
|
+
options?: EntityScopeOptions
|
|
1934
2010
|
): Promise<LedgerFiscalCalendar> {
|
|
1935
2011
|
const body: ReopenPeriodOperation = {
|
|
1936
2012
|
period,
|
|
1937
2013
|
reason,
|
|
1938
2014
|
note: note ?? null,
|
|
2015
|
+
entity_id: options?.entityId ?? null,
|
|
1939
2016
|
}
|
|
1940
2017
|
const envelope = await this.callOperation('Reopen period', (o) =>
|
|
1941
2018
|
reopenPeriod({ ...o, path: { graph_id: graphId }, body })
|
|
@@ -1951,12 +2028,13 @@ export class LedgerClient {
|
|
|
1951
2028
|
*/
|
|
1952
2029
|
async listReconciliations(
|
|
1953
2030
|
graphId: string,
|
|
1954
|
-
period: string
|
|
2031
|
+
period: string,
|
|
2032
|
+
options?: EntityScopeOptions
|
|
1955
2033
|
): Promise<LedgerReconciliationList | null> {
|
|
1956
2034
|
return this.gqlQuery(
|
|
1957
2035
|
graphId,
|
|
1958
2036
|
ListLedgerReconciliationsDocument,
|
|
1959
|
-
{ period },
|
|
2037
|
+
{ period, entityId: options?.entityId ?? null },
|
|
1960
2038
|
'List reconciliations',
|
|
1961
2039
|
(data) => data.reconciliations
|
|
1962
2040
|
)
|
|
@@ -2453,12 +2531,15 @@ export class LedgerClient {
|
|
|
2453
2531
|
*/
|
|
2454
2532
|
async listReports(
|
|
2455
2533
|
graphId: string,
|
|
2456
|
-
options: { lifecycle?: ReportLifecycle } = {}
|
|
2534
|
+
options: { lifecycle?: ReportLifecycle; entityId?: string | null } = {}
|
|
2457
2535
|
): Promise<ReportListItem[]> {
|
|
2458
2536
|
const list = await this.gqlQuery(
|
|
2459
2537
|
graphId,
|
|
2460
2538
|
ListLedgerReportsDocument,
|
|
2461
|
-
|
|
2539
|
+
{
|
|
2540
|
+
...(options.lifecycle ? { lifecycle: options.lifecycle } : {}),
|
|
2541
|
+
entityId: options.entityId ?? null,
|
|
2542
|
+
},
|
|
2462
2543
|
'List reports',
|
|
2463
2544
|
(data) => data.reports
|
|
2464
2545
|
)
|
|
@@ -2930,6 +3011,7 @@ function rawObligationDetailToCamel(raw: RawObligationDetail) {
|
|
|
2930
3011
|
function rawFiscalCalendarToCamel(raw: RawFiscalCalendar): LedgerFiscalCalendar {
|
|
2931
3012
|
return {
|
|
2932
3013
|
graphId: raw.graph_id,
|
|
3014
|
+
entityId: raw.entity_id ?? null,
|
|
2933
3015
|
fiscalYearStartMonth: raw.fiscal_year_start_month,
|
|
2934
3016
|
closedThrough: raw.closed_through ?? null,
|
|
2935
3017
|
closeTarget: raw.close_target ?? null,
|
|
@@ -3082,11 +3164,13 @@ function entityResponseToCamel(raw: LedgerEntityResponse): LedgerEntity {
|
|
|
3082
3164
|
lei: raw.lei ?? null,
|
|
3083
3165
|
industry: raw.industry ?? null,
|
|
3084
3166
|
entityType: raw.entity_type ?? null,
|
|
3167
|
+
reportingStyleId: raw.reporting_style_id ?? null,
|
|
3085
3168
|
phone: raw.phone ?? null,
|
|
3086
3169
|
website: raw.website ?? null,
|
|
3087
3170
|
status: raw.status ?? null,
|
|
3088
3171
|
isParent: raw.is_parent ?? null,
|
|
3089
3172
|
parentEntityId: raw.parent_entity_id ?? null,
|
|
3173
|
+
ownershipPct: raw.ownership_pct ?? null,
|
|
3090
3174
|
source: raw.source ?? null,
|
|
3091
3175
|
sourceId: raw.source_id ?? null,
|
|
3092
3176
|
sourceGraphId: raw.source_graph_id ?? null,
|
|
@@ -231,6 +231,7 @@ export type GetLedgerAccountRollupsQueryVariables = Exact<{
|
|
|
231
231
|
mappingId: string | null | undefined;
|
|
232
232
|
startDate: string | null | undefined;
|
|
233
233
|
endDate: string | null | undefined;
|
|
234
|
+
entityId: string | null | undefined;
|
|
234
235
|
}>;
|
|
235
236
|
export type GetLedgerAccountRollupsQuery = {
|
|
236
237
|
accountRollups: {
|
|
@@ -257,7 +258,7 @@ export type GetLedgerAccountRollupsQuery = {
|
|
|
257
258
|
} | null;
|
|
258
259
|
};
|
|
259
260
|
export type GetLedgerAccountTreeQueryVariables = Exact<{
|
|
260
|
-
|
|
261
|
+
entityId: string | null | undefined;
|
|
261
262
|
}>;
|
|
262
263
|
export type GetLedgerAccountTreeQuery = {
|
|
263
264
|
accountTree: {
|
|
@@ -309,6 +310,7 @@ export type ListLedgerAccountsQueryVariables = Exact<{
|
|
|
309
310
|
isActive: boolean | null | undefined;
|
|
310
311
|
limit?: number;
|
|
311
312
|
offset?: number;
|
|
313
|
+
entityId: string | null | undefined;
|
|
312
314
|
}>;
|
|
313
315
|
export type ListLedgerAccountsQuery = {
|
|
314
316
|
accounts: {
|
|
@@ -424,7 +426,7 @@ export type ListChartTemplatesQuery = {
|
|
|
424
426
|
}>;
|
|
425
427
|
};
|
|
426
428
|
export type GetLedgerClosingBookStructuresQueryVariables = Exact<{
|
|
427
|
-
|
|
429
|
+
entityId: string | null | undefined;
|
|
428
430
|
}>;
|
|
429
431
|
export type GetLedgerClosingBookStructuresQuery = {
|
|
430
432
|
closingBookStructures: {
|
|
@@ -496,6 +498,7 @@ export type ListLedgerEntitiesQuery = {
|
|
|
496
498
|
status: string;
|
|
497
499
|
isParent: boolean;
|
|
498
500
|
parentEntityId: string | null;
|
|
501
|
+
ownershipPct: number | null;
|
|
499
502
|
source: string;
|
|
500
503
|
sourceGraphId: string | null;
|
|
501
504
|
connectionId: string | null;
|
|
@@ -504,7 +507,7 @@ export type ListLedgerEntitiesQuery = {
|
|
|
504
507
|
}>;
|
|
505
508
|
};
|
|
506
509
|
export type GetLedgerEntityQueryVariables = Exact<{
|
|
507
|
-
|
|
510
|
+
entityId: string | null | undefined;
|
|
508
511
|
}>;
|
|
509
512
|
export type GetLedgerEntityQuery = {
|
|
510
513
|
entity: {
|
|
@@ -524,11 +527,13 @@ export type GetLedgerEntityQuery = {
|
|
|
524
527
|
lei: string | null;
|
|
525
528
|
industry: string | null;
|
|
526
529
|
entityType: string | null;
|
|
530
|
+
reportingStyleId: string | null;
|
|
527
531
|
phone: string | null;
|
|
528
532
|
website: string | null;
|
|
529
533
|
status: string;
|
|
530
534
|
isParent: boolean;
|
|
531
535
|
parentEntityId: string | null;
|
|
536
|
+
ownershipPct: number | null;
|
|
532
537
|
source: string;
|
|
533
538
|
sourceId: string | null;
|
|
534
539
|
sourceGraphId: string | null;
|
|
@@ -582,6 +587,7 @@ export type ListLedgerEventBlocksQueryVariables = Exact<{
|
|
|
582
587
|
isReconcilingItem: boolean | null | undefined;
|
|
583
588
|
limit?: number;
|
|
584
589
|
offset?: number;
|
|
590
|
+
entityId: string | null | undefined;
|
|
585
591
|
}>;
|
|
586
592
|
export type ListLedgerEventBlocksQuery = {
|
|
587
593
|
eventBlocks: Array<{
|
|
@@ -612,11 +618,12 @@ export type ListLedgerEventBlocksQuery = {
|
|
|
612
618
|
}>;
|
|
613
619
|
};
|
|
614
620
|
export type GetLedgerFiscalCalendarQueryVariables = Exact<{
|
|
615
|
-
|
|
621
|
+
entityId: string | null | undefined;
|
|
616
622
|
}>;
|
|
617
623
|
export type GetLedgerFiscalCalendarQuery = {
|
|
618
624
|
fiscalCalendar: {
|
|
619
625
|
graphId: string;
|
|
626
|
+
entityId: string | null;
|
|
620
627
|
fiscalYearStartMonth: number;
|
|
621
628
|
closedThrough: string | null;
|
|
622
629
|
closeTarget: string | null;
|
|
@@ -1139,6 +1146,7 @@ export type ListLedgerJournalEntriesQueryVariables = Exact<{
|
|
|
1139
1146
|
transactionId: string | null | undefined;
|
|
1140
1147
|
limit?: number;
|
|
1141
1148
|
offset?: number;
|
|
1149
|
+
entityId: string | null | undefined;
|
|
1142
1150
|
}>;
|
|
1143
1151
|
export type ListLedgerJournalEntriesQuery = {
|
|
1144
1152
|
journalEntries: {
|
|
@@ -1271,6 +1279,7 @@ export type ListLedgerMappingsQuery = {
|
|
|
1271
1279
|
export type GetLedgerPeriodCloseStatusQueryVariables = Exact<{
|
|
1272
1280
|
periodStart: string;
|
|
1273
1281
|
periodEnd: string;
|
|
1282
|
+
entityId: string | null | undefined;
|
|
1274
1283
|
}>;
|
|
1275
1284
|
export type GetLedgerPeriodCloseStatusQuery = {
|
|
1276
1285
|
periodCloseStatus: {
|
|
@@ -1292,6 +1301,7 @@ export type GetLedgerPeriodCloseStatusQuery = {
|
|
|
1292
1301
|
};
|
|
1293
1302
|
export type GetLedgerPeriodDraftsQueryVariables = Exact<{
|
|
1294
1303
|
period: string;
|
|
1304
|
+
entityId: string | null | undefined;
|
|
1295
1305
|
}>;
|
|
1296
1306
|
export type GetLedgerPeriodDraftsQuery = {
|
|
1297
1307
|
periodDrafts: {
|
|
@@ -1377,6 +1387,7 @@ export type ListLedgerPublishListsQuery = {
|
|
|
1377
1387
|
};
|
|
1378
1388
|
export type ListLedgerReconciliationsQueryVariables = Exact<{
|
|
1379
1389
|
period: string;
|
|
1390
|
+
entityId: string | null | undefined;
|
|
1380
1391
|
}>;
|
|
1381
1392
|
export type ListLedgerReconciliationsQuery = {
|
|
1382
1393
|
reconciliations: {
|
|
@@ -1448,6 +1459,7 @@ export type GetLedgerReportQuery = {
|
|
|
1448
1459
|
report: {
|
|
1449
1460
|
id: string;
|
|
1450
1461
|
name: string;
|
|
1462
|
+
entityId: string | null;
|
|
1451
1463
|
taxonomyId: string;
|
|
1452
1464
|
generationStatus: string;
|
|
1453
1465
|
periodType: string;
|
|
@@ -1691,12 +1703,14 @@ export type GetLedgerReportingTaxonomyQuery = {
|
|
|
1691
1703
|
};
|
|
1692
1704
|
export type ListLedgerReportsQueryVariables = Exact<{
|
|
1693
1705
|
lifecycle?: ReportLifecycle;
|
|
1706
|
+
entityId: string | null | undefined;
|
|
1694
1707
|
}>;
|
|
1695
1708
|
export type ListLedgerReportsQuery = {
|
|
1696
1709
|
reports: {
|
|
1697
1710
|
reports: Array<{
|
|
1698
1711
|
id: string;
|
|
1699
1712
|
name: string;
|
|
1713
|
+
entityId: string | null;
|
|
1700
1714
|
taxonomyId: string;
|
|
1701
1715
|
generationStatus: string;
|
|
1702
1716
|
filingStatus: string;
|
|
@@ -1776,11 +1790,12 @@ export type ListLedgerStructuresQuery = {
|
|
|
1776
1790
|
} | null;
|
|
1777
1791
|
};
|
|
1778
1792
|
export type GetLedgerSummaryQueryVariables = Exact<{
|
|
1779
|
-
|
|
1793
|
+
entityId: string | null | undefined;
|
|
1780
1794
|
}>;
|
|
1781
1795
|
export type GetLedgerSummaryQuery = {
|
|
1782
1796
|
summary: {
|
|
1783
1797
|
graphId: string;
|
|
1798
|
+
entityId: string | null;
|
|
1784
1799
|
accountCount: number;
|
|
1785
1800
|
transactionCount: number;
|
|
1786
1801
|
entryCount: number;
|
|
@@ -1859,6 +1874,7 @@ export type ListLedgerTransactionsQueryVariables = Exact<{
|
|
|
1859
1874
|
endDate: string | null | undefined;
|
|
1860
1875
|
limit?: number;
|
|
1861
1876
|
offset?: number;
|
|
1877
|
+
entityId: string | null | undefined;
|
|
1862
1878
|
}>;
|
|
1863
1879
|
export type ListLedgerTransactionsQuery = {
|
|
1864
1880
|
transactions: {
|
|
@@ -1888,6 +1904,7 @@ export type ListLedgerTransactionsQuery = {
|
|
|
1888
1904
|
export type GetLedgerTrialBalanceQueryVariables = Exact<{
|
|
1889
1905
|
startDate: string | null | undefined;
|
|
1890
1906
|
endDate: string | null | undefined;
|
|
1907
|
+
entityId: string | null | undefined;
|
|
1891
1908
|
}>;
|
|
1892
1909
|
export type GetLedgerTrialBalanceQuery = {
|
|
1893
1910
|
trialBalance: {
|