@robosystems/client 0.2.49 → 0.3.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/extensions/InvestorClient.d.ts +98 -0
- package/extensions/InvestorClient.js +223 -0
- package/extensions/InvestorClient.ts +508 -0
- package/extensions/LedgerClient.d.ts +190 -309
- package/extensions/LedgerClient.js +268 -587
- package/extensions/LedgerClient.ts +784 -903
- package/extensions/ReportClient.d.ts +82 -113
- package/extensions/ReportClient.js +124 -211
- package/extensions/ReportClient.ts +305 -358
- package/extensions/config.d.ts +19 -0
- package/extensions/config.js +1 -1
- package/extensions/config.ts +22 -2
- package/extensions/graphql/client.d.ts +82 -0
- package/extensions/graphql/client.js +149 -0
- package/extensions/graphql/client.ts +189 -0
- package/extensions/graphql/generated/graphql.d.ts +1786 -0
- package/extensions/graphql/generated/graphql.js +2671 -0
- package/extensions/graphql/generated/graphql.ts +4491 -0
- package/extensions/graphql/queries/investor/holdings.d.ts +8 -0
- package/extensions/graphql/queries/investor/holdings.js +36 -0
- package/extensions/graphql/queries/investor/holdings.ts +34 -0
- package/extensions/graphql/queries/investor/portfolio.d.ts +4 -0
- package/extensions/graphql/queries/investor/portfolio.js +21 -0
- package/extensions/graphql/queries/investor/portfolio.ts +19 -0
- package/extensions/graphql/queries/investor/portfolios.d.ts +4 -0
- package/extensions/graphql/queries/investor/portfolios.js +29 -0
- package/extensions/graphql/queries/investor/portfolios.ts +27 -0
- package/extensions/graphql/queries/investor/position.d.ts +4 -0
- package/extensions/graphql/queries/investor/position.js +33 -0
- package/extensions/graphql/queries/investor/position.ts +31 -0
- package/extensions/graphql/queries/investor/positions.d.ts +8 -0
- package/extensions/graphql/queries/investor/positions.js +57 -0
- package/extensions/graphql/queries/investor/positions.ts +55 -0
- package/extensions/graphql/queries/investor/securities.d.ts +8 -0
- package/extensions/graphql/queries/investor/securities.js +50 -0
- package/extensions/graphql/queries/investor/securities.ts +48 -0
- package/extensions/graphql/queries/investor/security.d.ts +4 -0
- package/extensions/graphql/queries/investor/security.js +26 -0
- package/extensions/graphql/queries/investor/security.ts +24 -0
- package/extensions/graphql/queries/ledger/accountRollups.d.ts +7 -0
- package/extensions/graphql/queries/ledger/accountRollups.js +36 -0
- package/extensions/graphql/queries/ledger/accountRollups.ts +34 -0
- package/extensions/graphql/queries/ledger/accountTree.d.ts +11 -0
- package/extensions/graphql/queries/ledger/accountTree.js +61 -0
- package/extensions/graphql/queries/ledger/accountTree.ts +59 -0
- package/extensions/graphql/queries/ledger/accounts.d.ts +8 -0
- package/extensions/graphql/queries/ledger/accounts.js +45 -0
- package/extensions/graphql/queries/ledger/accounts.ts +43 -0
- package/extensions/graphql/queries/ledger/closingBookStructures.d.ts +6 -0
- package/extensions/graphql/queries/ledger/closingBookStructures.js +27 -0
- package/extensions/graphql/queries/ledger/closingBookStructures.ts +25 -0
- package/extensions/graphql/queries/ledger/elements.d.ts +6 -0
- package/extensions/graphql/queries/ledger/elements.js +56 -0
- package/extensions/graphql/queries/ledger/elements.ts +54 -0
- package/extensions/graphql/queries/ledger/entities.d.ts +7 -0
- package/extensions/graphql/queries/ledger/entities.js +31 -0
- package/extensions/graphql/queries/ledger/entities.ts +29 -0
- package/extensions/graphql/queries/ledger/entity.d.ts +14 -0
- package/extensions/graphql/queries/ledger/entity.js +55 -0
- package/extensions/graphql/queries/ledger/entity.ts +54 -0
- package/extensions/graphql/queries/ledger/fiscalCalendar.d.ts +8 -0
- package/extensions/graphql/queries/ledger/fiscalCalendar.js +35 -0
- package/extensions/graphql/queries/ledger/fiscalCalendar.ts +33 -0
- package/extensions/graphql/queries/ledger/mappedTrialBalance.d.ts +9 -0
- package/extensions/graphql/queries/ledger/mappedTrialBalance.js +29 -0
- package/extensions/graphql/queries/ledger/mappedTrialBalance.ts +27 -0
- package/extensions/graphql/queries/ledger/mapping.d.ts +5 -0
- package/extensions/graphql/queries/ledger/mapping.js +35 -0
- package/extensions/graphql/queries/ledger/mapping.ts +33 -0
- package/extensions/graphql/queries/ledger/mappingCoverage.d.ts +5 -0
- package/extensions/graphql/queries/ledger/mappingCoverage.js +22 -0
- package/extensions/graphql/queries/ledger/mappingCoverage.ts +20 -0
- package/extensions/graphql/queries/ledger/mappings.d.ts +6 -0
- package/extensions/graphql/queries/ledger/mappings.js +23 -0
- package/extensions/graphql/queries/ledger/mappings.ts +21 -0
- package/extensions/graphql/queries/ledger/periodCloseStatus.d.ts +6 -0
- package/extensions/graphql/queries/ledger/periodCloseStatus.js +29 -0
- package/extensions/graphql/queries/ledger/periodCloseStatus.ts +27 -0
- package/extensions/graphql/queries/ledger/periodDrafts.d.ts +8 -0
- package/extensions/graphql/queries/ledger/periodDrafts.js +45 -0
- package/extensions/graphql/queries/ledger/periodDrafts.ts +43 -0
- package/extensions/graphql/queries/ledger/publishList.d.ts +5 -0
- package/extensions/graphql/queries/ledger/publishList.js +29 -0
- package/extensions/graphql/queries/ledger/publishList.ts +27 -0
- package/extensions/graphql/queries/ledger/publishLists.d.ts +5 -0
- package/extensions/graphql/queries/ledger/publishLists.js +29 -0
- package/extensions/graphql/queries/ledger/publishLists.ts +27 -0
- package/extensions/graphql/queries/ledger/report.d.ts +5 -0
- package/extensions/graphql/queries/ledger/report.js +40 -0
- package/extensions/graphql/queries/ledger/report.ts +38 -0
- package/extensions/graphql/queries/ledger/reportingTaxonomy.d.ts +6 -0
- package/extensions/graphql/queries/ledger/reportingTaxonomy.js +27 -0
- package/extensions/graphql/queries/ledger/reportingTaxonomy.ts +25 -0
- package/extensions/graphql/queries/ledger/reports.d.ts +8 -0
- package/extensions/graphql/queries/ledger/reports.js +45 -0
- package/extensions/graphql/queries/ledger/reports.ts +43 -0
- package/extensions/graphql/queries/ledger/scheduleFacts.d.ts +7 -0
- package/extensions/graphql/queries/ledger/scheduleFacts.js +24 -0
- package/extensions/graphql/queries/ledger/scheduleFacts.ts +22 -0
- package/extensions/graphql/queries/ledger/schedules.d.ts +6 -0
- package/extensions/graphql/queries/ledger/schedules.js +24 -0
- package/extensions/graphql/queries/ledger/schedules.ts +22 -0
- package/extensions/graphql/queries/ledger/statement.d.ts +9 -0
- package/extensions/graphql/queries/ledger/statement.js +43 -0
- package/extensions/graphql/queries/ledger/statement.ts +41 -0
- package/extensions/graphql/queries/ledger/structures.d.ts +5 -0
- package/extensions/graphql/queries/ledger/structures.js +22 -0
- package/extensions/graphql/queries/ledger/structures.ts +20 -0
- package/extensions/graphql/queries/ledger/summary.d.ts +7 -0
- package/extensions/graphql/queries/ledger/summary.js +25 -0
- package/extensions/graphql/queries/ledger/summary.ts +23 -0
- package/extensions/graphql/queries/ledger/taxonomies.d.ts +5 -0
- package/extensions/graphql/queries/ledger/taxonomies.js +28 -0
- package/extensions/graphql/queries/ledger/taxonomies.ts +26 -0
- package/extensions/graphql/queries/ledger/transaction.d.ts +6 -0
- package/extensions/graphql/queries/ledger/transaction.js +49 -0
- package/extensions/graphql/queries/ledger/transaction.ts +47 -0
- package/extensions/graphql/queries/ledger/transactions.d.ts +7 -0
- package/extensions/graphql/queries/ledger/transactions.js +49 -0
- package/extensions/graphql/queries/ledger/transactions.ts +47 -0
- package/extensions/graphql/queries/ledger/trialBalance.d.ts +7 -0
- package/extensions/graphql/queries/ledger/trialBalance.js +28 -0
- package/extensions/graphql/queries/ledger/trialBalance.ts +26 -0
- package/extensions/graphql/queries/ledger/unmappedElements.d.ts +8 -0
- package/extensions/graphql/queries/ledger/unmappedElements.js +29 -0
- package/extensions/graphql/queries/ledger/unmappedElements.ts +27 -0
- package/extensions/hooks.d.ts +1 -1
- package/extensions/index.d.ts +18 -1
- package/extensions/index.js +26 -1
- package/extensions/index.ts +49 -2
- package/index.ts +2 -2
- package/package.json +14 -5
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +38 -73
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +100 -325
- package/sdk/sdk.gen.js +228 -592
- package/sdk/sdk.gen.ts +193 -556
- package/sdk/types.gen.d.ts +4522 -7708
- package/sdk/types.gen.ts +4569 -7983
- package/sdk.gen.d.ts +100 -325
- package/sdk.gen.js +228 -592
- package/sdk.gen.ts +193 -556
- package/types.gen.d.ts +4522 -7708
- package/types.gen.ts +4569 -7983
- package/extensions/AgentClient.test.ts +0 -403
- package/extensions/LedgerClient.test.ts +0 -1655
- package/extensions/OperationClient.test.ts +0 -365
- package/extensions/QueryClient.test.ts +0 -432
- package/extensions/ReportClient.test.ts +0 -828
- package/extensions/SSEClient.test.ts +0 -375
- package/extensions/config.test.ts +0 -199
- package/extensions/hooks.test.ts +0 -373
- package/extensions/index.test.ts +0 -420
- package/sdk-extensions/AgentClient.d.ts +0 -82
- package/sdk-extensions/AgentClient.js +0 -218
- package/sdk-extensions/AgentClient.test.ts +0 -403
- package/sdk-extensions/AgentClient.ts +0 -321
- package/sdk-extensions/LedgerClient.d.ts +0 -416
- package/sdk-extensions/LedgerClient.js +0 -737
- package/sdk-extensions/LedgerClient.test.ts +0 -1655
- package/sdk-extensions/LedgerClient.ts +0 -1249
- package/sdk-extensions/OperationClient.d.ts +0 -65
- package/sdk-extensions/OperationClient.js +0 -251
- package/sdk-extensions/OperationClient.test.ts +0 -365
- package/sdk-extensions/OperationClient.ts +0 -324
- package/sdk-extensions/QueryClient.d.ts +0 -52
- package/sdk-extensions/QueryClient.js +0 -313
- package/sdk-extensions/QueryClient.test.ts +0 -432
- package/sdk-extensions/QueryClient.ts +0 -420
- package/sdk-extensions/README.md +0 -901
- package/sdk-extensions/ReportClient.d.ts +0 -151
- package/sdk-extensions/ReportClient.js +0 -278
- package/sdk-extensions/ReportClient.test.ts +0 -828
- package/sdk-extensions/ReportClient.ts +0 -486
- package/sdk-extensions/SSEClient.d.ts +0 -62
- package/sdk-extensions/SSEClient.js +0 -154
- package/sdk-extensions/SSEClient.test.ts +0 -375
- package/sdk-extensions/SSEClient.ts +0 -210
- package/sdk-extensions/config.d.ts +0 -57
- package/sdk-extensions/config.js +0 -152
- package/sdk-extensions/config.test.ts +0 -199
- package/sdk-extensions/config.ts +0 -175
- package/sdk-extensions/hooks.d.ts +0 -110
- package/sdk-extensions/hooks.js +0 -384
- package/sdk-extensions/hooks.test.ts +0 -373
- package/sdk-extensions/hooks.ts +0 -459
- package/sdk-extensions/index.d.ts +0 -63
- package/sdk-extensions/index.js +0 -164
- package/sdk-extensions/index.test.ts +0 -420
- package/sdk-extensions/index.ts +0 -203
|
@@ -1,86 +1,54 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
taxonomyId: string;
|
|
45
|
-
totalPeriods: number;
|
|
46
|
-
totalFacts: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ScheduleFact {
|
|
49
|
-
elementId: string;
|
|
50
|
-
elementName: string;
|
|
51
|
-
value: number;
|
|
52
|
-
periodStart: string;
|
|
53
|
-
periodEnd: string;
|
|
54
|
-
}
|
|
55
|
-
export interface PeriodCloseItem {
|
|
56
|
-
structureId: string;
|
|
57
|
-
structureName: string;
|
|
58
|
-
amount: number;
|
|
59
|
-
status: string;
|
|
60
|
-
entryId: string | null;
|
|
1
|
+
import type { AutoMapElementsOperation, CreateMappingAssociationOperation, CreateStructureRequest, CreateTaxonomyRequest, DeleteMappingAssociationOperation, OperationEnvelope, UpdateEntityRequest } from '../types.gen';
|
|
2
|
+
import type { TokenProvider } from './graphql/client';
|
|
3
|
+
import { type GetLedgerAccountRollupsQuery, type GetLedgerAccountTreeQuery, type GetLedgerClosingBookStructuresQuery, type GetLedgerEntityQuery, type GetLedgerFiscalCalendarQuery, type GetLedgerMappedTrialBalanceQuery, type GetLedgerMappingCoverageQuery, type GetLedgerMappingQuery, type GetLedgerPeriodCloseStatusQuery, type GetLedgerPeriodDraftsQuery, type GetLedgerReportingTaxonomyQuery, type GetLedgerScheduleFactsQuery, type GetLedgerSummaryQuery, type GetLedgerTransactionQuery, type GetLedgerTrialBalanceQuery, type ListLedgerAccountsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerMappingsQuery, type ListLedgerSchedulesQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery } from './graphql/generated/graphql';
|
|
4
|
+
export type LedgerEntity = NonNullable<GetLedgerEntityQuery['entity']>;
|
|
5
|
+
export type LedgerEntitySummary = ListLedgerEntitiesQuery['entities'][number];
|
|
6
|
+
export type LedgerSummary = NonNullable<GetLedgerSummaryQuery['summary']>;
|
|
7
|
+
export type LedgerAccountList = NonNullable<ListLedgerAccountsQuery['accounts']>;
|
|
8
|
+
export type LedgerAccount = LedgerAccountList['accounts'][number];
|
|
9
|
+
export type LedgerAccountTree = NonNullable<GetLedgerAccountTreeQuery['accountTree']>;
|
|
10
|
+
export type LedgerAccountRollups = NonNullable<GetLedgerAccountRollupsQuery['accountRollups']>;
|
|
11
|
+
export type LedgerTrialBalance = NonNullable<GetLedgerTrialBalanceQuery['trialBalance']>;
|
|
12
|
+
export type LedgerMappedTrialBalance = NonNullable<GetLedgerMappedTrialBalanceQuery['mappedTrialBalance']>;
|
|
13
|
+
export type LedgerTransactionList = NonNullable<ListLedgerTransactionsQuery['transactions']>;
|
|
14
|
+
export type LedgerTransactionListItem = LedgerTransactionList['transactions'][number];
|
|
15
|
+
export type LedgerTransaction = NonNullable<GetLedgerTransactionQuery['transaction']>;
|
|
16
|
+
export type LedgerReportingTaxonomy = NonNullable<GetLedgerReportingTaxonomyQuery['reportingTaxonomy']>;
|
|
17
|
+
export type LedgerTaxonomyList = NonNullable<ListLedgerTaxonomiesQuery['taxonomies']>;
|
|
18
|
+
export type LedgerTaxonomy = LedgerTaxonomyList['taxonomies'][number];
|
|
19
|
+
export type LedgerElementList = NonNullable<ListLedgerElementsQuery['elements']>;
|
|
20
|
+
export type LedgerElement = LedgerElementList['elements'][number];
|
|
21
|
+
export type LedgerUnmappedElement = ListLedgerUnmappedElementsQuery['unmappedElements'][number];
|
|
22
|
+
export type LedgerStructureList = NonNullable<ListLedgerStructuresQuery['structures']>;
|
|
23
|
+
export type LedgerStructure = LedgerStructureList['structures'][number];
|
|
24
|
+
export type LedgerMappingList = NonNullable<ListLedgerMappingsQuery['mappings']>;
|
|
25
|
+
export type LedgerMappingInfo = LedgerMappingList['structures'][number];
|
|
26
|
+
export type LedgerMapping = NonNullable<GetLedgerMappingQuery['mapping']>;
|
|
27
|
+
export type LedgerMappingCoverage = NonNullable<GetLedgerMappingCoverageQuery['mappingCoverage']>;
|
|
28
|
+
export type LedgerScheduleList = NonNullable<ListLedgerSchedulesQuery['schedules']>;
|
|
29
|
+
export type LedgerSchedule = LedgerScheduleList['schedules'][number];
|
|
30
|
+
export type LedgerScheduleFacts = NonNullable<GetLedgerScheduleFactsQuery['scheduleFacts']>;
|
|
31
|
+
export type LedgerScheduleFact = LedgerScheduleFacts['facts'][number];
|
|
32
|
+
export type LedgerPeriodCloseStatus = NonNullable<GetLedgerPeriodCloseStatusQuery['periodCloseStatus']>;
|
|
33
|
+
export type LedgerPeriodCloseItem = LedgerPeriodCloseStatus['schedules'][number];
|
|
34
|
+
export type LedgerPeriodDrafts = NonNullable<GetLedgerPeriodDraftsQuery['periodDrafts']>;
|
|
35
|
+
export type LedgerDraftEntry = LedgerPeriodDrafts['drafts'][number];
|
|
36
|
+
export type LedgerDraftLineItem = LedgerDraftEntry['lineItems'][number];
|
|
37
|
+
export type LedgerClosingBookStructures = NonNullable<GetLedgerClosingBookStructuresQuery['closingBookStructures']>;
|
|
38
|
+
export type LedgerFiscalCalendar = NonNullable<GetLedgerFiscalCalendarQuery['fiscalCalendar']>;
|
|
39
|
+
export type LedgerFiscalPeriod = LedgerFiscalCalendar['periods'][number];
|
|
40
|
+
export interface InitializeLedgerResult {
|
|
41
|
+
fiscalCalendar: LedgerFiscalCalendar;
|
|
42
|
+
periodsCreated: number;
|
|
43
|
+
warnings: string[];
|
|
61
44
|
}
|
|
62
|
-
export interface
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
totalDraft: number;
|
|
68
|
-
totalPosted: number;
|
|
45
|
+
export interface ClosePeriodResult {
|
|
46
|
+
period: string;
|
|
47
|
+
entriesPosted: number;
|
|
48
|
+
targetAutoAdvanced: boolean;
|
|
49
|
+
fiscalCalendar: LedgerFiscalCalendar;
|
|
69
50
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Outcome of an idempotent `createClosingEntry` call.
|
|
72
|
-
*
|
|
73
|
-
* - `created` — no prior draft, new draft created
|
|
74
|
-
* - `unchanged` — prior draft matches current schedule fact, no-op
|
|
75
|
-
* - `regenerated` — prior draft was stale, replaced with a fresh one
|
|
76
|
-
* - `removed` — prior draft existed but schedule no longer covers this period
|
|
77
|
-
* - `skipped` — no prior draft and no in-scope fact; nothing to do
|
|
78
|
-
*/
|
|
79
51
|
export type ClosingEntryOutcome = 'created' | 'unchanged' | 'regenerated' | 'removed' | 'skipped';
|
|
80
|
-
/**
|
|
81
|
-
* Result of an idempotent closing-entry call. `entry_id`, `amount`, and
|
|
82
|
-
* related fields are null for `removed` and `skipped` outcomes.
|
|
83
|
-
*/
|
|
84
52
|
export interface ClosingEntry {
|
|
85
53
|
outcome: ClosingEntryOutcome;
|
|
86
54
|
entryId: string | null;
|
|
@@ -92,28 +60,20 @@ export interface ClosingEntry {
|
|
|
92
60
|
amount: number | null;
|
|
93
61
|
reason: string | null;
|
|
94
62
|
}
|
|
95
|
-
export
|
|
96
|
-
|
|
63
|
+
export interface ScheduleCreated {
|
|
64
|
+
structureId: string;
|
|
97
65
|
name: string;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
closedAt: string | null;
|
|
66
|
+
taxonomyId: string;
|
|
67
|
+
totalPeriods: number;
|
|
68
|
+
totalFacts: number;
|
|
102
69
|
}
|
|
103
|
-
export interface
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
gapPeriods: number;
|
|
109
|
-
catchUpSequence: string[];
|
|
110
|
-
closeableNow: boolean;
|
|
111
|
-
blockers: string[];
|
|
112
|
-
lastCloseAt: string | null;
|
|
113
|
-
initializedAt: string | null;
|
|
114
|
-
lastSyncAt: string | null;
|
|
115
|
-
periods: FiscalPeriodSummary[];
|
|
70
|
+
export interface TruncateScheduleResult {
|
|
71
|
+
structureId: string;
|
|
72
|
+
newEndDate: string;
|
|
73
|
+
factsDeleted: number;
|
|
74
|
+
reason: string;
|
|
116
75
|
}
|
|
76
|
+
export type LedgerEntryType = 'standard' | 'adjusting' | 'closing' | 'reversing';
|
|
117
77
|
export interface InitializeLedgerOptions {
|
|
118
78
|
closedThrough?: string | null;
|
|
119
79
|
fiscalYearStartMonth?: number;
|
|
@@ -121,53 +81,10 @@ export interface InitializeLedgerOptions {
|
|
|
121
81
|
autoSeedSchedules?: boolean;
|
|
122
82
|
note?: string | null;
|
|
123
83
|
}
|
|
124
|
-
export interface InitializeLedgerResult {
|
|
125
|
-
fiscalCalendar: FiscalCalendarState;
|
|
126
|
-
periodsCreated: number;
|
|
127
|
-
warnings: string[];
|
|
128
|
-
}
|
|
129
84
|
export interface ClosePeriodOptions {
|
|
130
85
|
note?: string | null;
|
|
131
86
|
allowStaleSync?: boolean;
|
|
132
87
|
}
|
|
133
|
-
export interface ClosePeriodResult {
|
|
134
|
-
period: string;
|
|
135
|
-
entriesPosted: number;
|
|
136
|
-
targetAutoAdvanced: boolean;
|
|
137
|
-
fiscalCalendar: FiscalCalendarState;
|
|
138
|
-
}
|
|
139
|
-
export interface DraftLineItemView {
|
|
140
|
-
lineItemId: string;
|
|
141
|
-
elementId: string;
|
|
142
|
-
elementCode: string | null;
|
|
143
|
-
elementName: string;
|
|
144
|
-
debitAmount: number;
|
|
145
|
-
creditAmount: number;
|
|
146
|
-
description: string | null;
|
|
147
|
-
}
|
|
148
|
-
export interface DraftEntryView {
|
|
149
|
-
entryId: string;
|
|
150
|
-
postingDate: string;
|
|
151
|
-
type: string;
|
|
152
|
-
memo: string | null;
|
|
153
|
-
provenance: string | null;
|
|
154
|
-
sourceStructureId: string | null;
|
|
155
|
-
sourceStructureName: string | null;
|
|
156
|
-
lineItems: DraftLineItemView[];
|
|
157
|
-
totalDebit: number;
|
|
158
|
-
totalCredit: number;
|
|
159
|
-
balanced: boolean;
|
|
160
|
-
}
|
|
161
|
-
export interface PeriodDraftsView {
|
|
162
|
-
period: string;
|
|
163
|
-
periodStart: string;
|
|
164
|
-
periodEnd: string;
|
|
165
|
-
draftCount: number;
|
|
166
|
-
totalDebit: number;
|
|
167
|
-
totalCredit: number;
|
|
168
|
-
allBalanced: boolean;
|
|
169
|
-
drafts: DraftEntryView[];
|
|
170
|
-
}
|
|
171
88
|
export interface ManualClosingLineItem {
|
|
172
89
|
elementId: string;
|
|
173
90
|
debitAmount?: number;
|
|
@@ -184,12 +101,6 @@ export interface TruncateScheduleOptions {
|
|
|
184
101
|
newEndDate: string;
|
|
185
102
|
reason: string;
|
|
186
103
|
}
|
|
187
|
-
export interface TruncateScheduleResult {
|
|
188
|
-
structureId: string;
|
|
189
|
-
newEndDate: string;
|
|
190
|
-
factsDeleted: number;
|
|
191
|
-
reason: string;
|
|
192
|
-
}
|
|
193
104
|
export interface CreateScheduleOptions {
|
|
194
105
|
name: string;
|
|
195
106
|
elementIds: string[];
|
|
@@ -211,69 +122,87 @@ export interface CreateScheduleOptions {
|
|
|
211
122
|
assetElementId?: string;
|
|
212
123
|
};
|
|
213
124
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
token?: string;
|
|
221
|
-
});
|
|
125
|
+
interface LedgerClientConfig {
|
|
126
|
+
baseUrl: string;
|
|
127
|
+
credentials?: 'include' | 'same-origin' | 'omit';
|
|
128
|
+
headers?: Record<string, string>;
|
|
129
|
+
/** Static credential — use `tokenProvider` instead if the JWT rotates. */
|
|
130
|
+
token?: string;
|
|
222
131
|
/**
|
|
223
|
-
*
|
|
132
|
+
* Dynamic credential callback. When set, invoked on every GraphQL
|
|
133
|
+
* request so refreshes flow through automatically.
|
|
224
134
|
*/
|
|
225
|
-
|
|
135
|
+
tokenProvider?: TokenProvider;
|
|
136
|
+
}
|
|
137
|
+
export declare class LedgerClient {
|
|
138
|
+
private config;
|
|
226
139
|
/**
|
|
227
|
-
*
|
|
140
|
+
* Per-graph GraphQL client cache. The first call for a given graph
|
|
141
|
+
* creates a `GraphQLClient` bound to `/extensions/{graph_id}/graphql`;
|
|
142
|
+
* subsequent calls reuse it.
|
|
228
143
|
*/
|
|
229
|
-
|
|
144
|
+
private gql;
|
|
145
|
+
constructor(config: LedgerClientConfig);
|
|
230
146
|
/**
|
|
231
|
-
* Get the
|
|
147
|
+
* Get the entity (company/organization) for this graph.
|
|
148
|
+
* Returns null when the ledger has no entity yet.
|
|
232
149
|
*/
|
|
233
|
-
|
|
150
|
+
getEntity(graphId: string): Promise<LedgerEntity | null>;
|
|
151
|
+
/** List all entities for this graph, optionally filtered by source system. */
|
|
152
|
+
listEntities(graphId: string, options?: {
|
|
153
|
+
source?: string;
|
|
154
|
+
}): Promise<LedgerEntitySummary[]>;
|
|
234
155
|
/**
|
|
235
|
-
*
|
|
156
|
+
* Update the entity for this graph. Only non-null fields are applied.
|
|
157
|
+
* Returns the updated entity.
|
|
236
158
|
*/
|
|
159
|
+
updateEntity(graphId: string, updates: UpdateEntityRequest): Promise<LedgerEntity>;
|
|
160
|
+
/** Ledger rollup counts + QB sync metadata. */
|
|
161
|
+
getSummary(graphId: string): Promise<LedgerSummary | null>;
|
|
162
|
+
/** List CoA accounts with optional filters and pagination. */
|
|
163
|
+
listAccounts(graphId: string, options?: {
|
|
164
|
+
classification?: string;
|
|
165
|
+
isActive?: boolean;
|
|
166
|
+
limit?: number;
|
|
167
|
+
offset?: number;
|
|
168
|
+
}): Promise<LedgerAccountList | null>;
|
|
169
|
+
/** Hierarchical Chart of Accounts (up to 4 levels deep). */
|
|
170
|
+
getAccountTree(graphId: string): Promise<LedgerAccountTree | null>;
|
|
171
|
+
/** Accounts rolled up to reporting concepts via a mapping structure. */
|
|
172
|
+
getAccountRollups(graphId: string, options?: {
|
|
173
|
+
mappingId?: string;
|
|
174
|
+
startDate?: string;
|
|
175
|
+
endDate?: string;
|
|
176
|
+
}): Promise<LedgerAccountRollups | null>;
|
|
177
|
+
/** List transactions with optional type + date filters and pagination. */
|
|
237
178
|
listTransactions(graphId: string, options?: {
|
|
179
|
+
type?: string;
|
|
238
180
|
startDate?: string;
|
|
239
181
|
endDate?: string;
|
|
240
182
|
limit?: number;
|
|
241
183
|
offset?: number;
|
|
242
|
-
}): Promise<
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
getTransaction(graphId: string, transactionId: string): Promise<LedgerTransactionDetailResponse>;
|
|
247
|
-
/**
|
|
248
|
-
* Get trial balance (CoA-level debits/credits).
|
|
249
|
-
*/
|
|
184
|
+
}): Promise<LedgerTransactionList | null>;
|
|
185
|
+
/** Get transaction detail with entries + line items. */
|
|
186
|
+
getTransaction(graphId: string, transactionId: string): Promise<LedgerTransaction | null>;
|
|
187
|
+
/** Trial balance by raw CoA account. */
|
|
250
188
|
getTrialBalance(graphId: string, options?: {
|
|
251
189
|
startDate?: string;
|
|
252
190
|
endDate?: string;
|
|
253
|
-
}): Promise<
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
*/
|
|
257
|
-
getMappedTrialBalance(graphId: string, options?: {
|
|
258
|
-
mappingId?: string;
|
|
191
|
+
}): Promise<LedgerTrialBalance | null>;
|
|
192
|
+
/** Trial balance rolled up to GAAP reporting concepts via a mapping. */
|
|
193
|
+
getMappedTrialBalance(graphId: string, mappingId: string, options?: {
|
|
259
194
|
startDate?: string;
|
|
260
195
|
endDate?: string;
|
|
261
|
-
}): Promise<
|
|
262
|
-
/**
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* List reporting structures (IS, BS, CF) for a taxonomy.
|
|
272
|
-
*/
|
|
273
|
-
listStructures(graphId: string, taxonomyId?: string): Promise<Structure[]>;
|
|
274
|
-
/**
|
|
275
|
-
* List elements (CoA accounts, GAAP concepts, etc.).
|
|
276
|
-
*/
|
|
196
|
+
}): Promise<LedgerMappedTrialBalance | null>;
|
|
197
|
+
/** Get the locked US GAAP reporting taxonomy for this graph. */
|
|
198
|
+
getReportingTaxonomy(graphId: string): Promise<LedgerReportingTaxonomy | null>;
|
|
199
|
+
/** List active taxonomies with optional type filter. */
|
|
200
|
+
listTaxonomies(graphId: string, options?: {
|
|
201
|
+
taxonomyType?: string;
|
|
202
|
+
}): Promise<LedgerTaxonomy[]>;
|
|
203
|
+
/** Create a new taxonomy (used for CoA + mapping taxonomies). */
|
|
204
|
+
createTaxonomy(graphId: string, body: CreateTaxonomyRequest): Promise<Record<string, unknown>>;
|
|
205
|
+
/** List elements (CoA accounts, GAAP concepts, etc.) with filters. */
|
|
277
206
|
listElements(graphId: string, options?: {
|
|
278
207
|
taxonomyId?: string;
|
|
279
208
|
source?: string;
|
|
@@ -281,136 +210,88 @@ export declare class LedgerClient {
|
|
|
281
210
|
isAbstract?: boolean;
|
|
282
211
|
limit?: number;
|
|
283
212
|
offset?: number;
|
|
284
|
-
}): Promise<
|
|
285
|
-
/**
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
description?: string;
|
|
213
|
+
}): Promise<LedgerElementList | null>;
|
|
214
|
+
/** CoA elements not yet mapped to a reporting concept. */
|
|
215
|
+
listUnmappedElements(graphId: string, options?: {
|
|
216
|
+
mappingId?: string;
|
|
217
|
+
}): Promise<LedgerUnmappedElement[]>;
|
|
218
|
+
/** List reporting structures (IS, BS, CF, schedules) with optional filters. */
|
|
219
|
+
listStructures(graphId: string, options?: {
|
|
292
220
|
taxonomyId?: string;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
getMappingCoverage(graphId: string, mappingId: string): Promise<
|
|
306
|
-
/**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
* Delete a mapping association.
|
|
312
|
-
*/
|
|
313
|
-
deleteMapping(graphId: string, mappingId: string, associationId: string): Promise<void>;
|
|
314
|
-
/**
|
|
315
|
-
* Trigger AI auto-mapping (MappingAgent).
|
|
316
|
-
* Returns immediately — the agent runs in the background.
|
|
317
|
-
*/
|
|
318
|
-
autoMap(graphId: string, mappingId: string): Promise<{
|
|
319
|
-
operationId?: string;
|
|
221
|
+
structureType?: string;
|
|
222
|
+
}): Promise<LedgerStructure[]>;
|
|
223
|
+
/**
|
|
224
|
+
* Create a new structure. Most common use is a CoA→reporting mapping
|
|
225
|
+
* structure; also used for custom statement + schedule structures.
|
|
226
|
+
*/
|
|
227
|
+
createStructure(graphId: string, body: CreateStructureRequest): Promise<LedgerMappingInfo>;
|
|
228
|
+
/** List active CoA→reporting mapping structures. */
|
|
229
|
+
listMappings(graphId: string): Promise<LedgerMappingInfo[]>;
|
|
230
|
+
/** Get a mapping structure with all its associations. */
|
|
231
|
+
getMapping(graphId: string, mappingId: string): Promise<LedgerMapping | null>;
|
|
232
|
+
/** Mapping coverage stats — how many CoA elements are mapped. */
|
|
233
|
+
getMappingCoverage(graphId: string, mappingId: string): Promise<LedgerMappingCoverage | null>;
|
|
234
|
+
/** Create a manual mapping association between two elements. */
|
|
235
|
+
createMappingAssociation(graphId: string, body: CreateMappingAssociationOperation): Promise<Record<string, unknown>>;
|
|
236
|
+
/** Delete a mapping association. */
|
|
237
|
+
deleteMappingAssociation(graphId: string, body: DeleteMappingAssociationOperation): Promise<{
|
|
238
|
+
deleted: boolean;
|
|
320
239
|
}>;
|
|
321
240
|
/**
|
|
322
|
-
*
|
|
241
|
+
* Trigger the AI MappingAgent. Returns the operation id — async; the
|
|
242
|
+
* agent runs in the background. Consumers can subscribe to progress
|
|
243
|
+
* via `/v1/operations/{operationId}/stream`.
|
|
323
244
|
*/
|
|
245
|
+
autoMapElements(graphId: string, body: AutoMapElementsOperation): Promise<{
|
|
246
|
+
operationId: string;
|
|
247
|
+
status: OperationEnvelope['status'];
|
|
248
|
+
}>;
|
|
249
|
+
/** List all schedule structures with metadata. */
|
|
250
|
+
listSchedules(graphId: string): Promise<LedgerSchedule[]>;
|
|
251
|
+
/** Schedule facts optionally filtered by period window. */
|
|
252
|
+
getScheduleFacts(graphId: string, structureId: string, options?: {
|
|
253
|
+
periodStart?: string;
|
|
254
|
+
periodEnd?: string;
|
|
255
|
+
}): Promise<LedgerScheduleFact[]>;
|
|
256
|
+
/** Create a new schedule with pre-generated monthly facts. */
|
|
324
257
|
createSchedule(graphId: string, options: CreateScheduleOptions): Promise<ScheduleCreated>;
|
|
258
|
+
/** Truncate a schedule — end it early at `newEndDate`. */
|
|
259
|
+
truncateSchedule(graphId: string, structureId: string, options: TruncateScheduleOptions): Promise<TruncateScheduleResult>;
|
|
260
|
+
/** Close status for all schedules in a fiscal period. */
|
|
261
|
+
getPeriodCloseStatus(graphId: string, periodStart: string, periodEnd: string): Promise<LedgerPeriodCloseStatus | null>;
|
|
262
|
+
/** All draft entries in a period, fully expanded for review pre-close. */
|
|
263
|
+
listPeriodDrafts(graphId: string, period: string): Promise<LedgerPeriodDrafts | null>;
|
|
325
264
|
/**
|
|
326
|
-
*
|
|
327
|
-
|
|
328
|
-
listSchedules(graphId: string): Promise<Schedule[]>;
|
|
329
|
-
/**
|
|
330
|
-
* Get facts for a schedule, optionally filtered by period.
|
|
331
|
-
*/
|
|
332
|
-
getScheduleFacts(graphId: string, structureId: string, periodStart?: string, periodEnd?: string): Promise<ScheduleFact[]>;
|
|
333
|
-
/**
|
|
334
|
-
* Get close status for all schedules in a fiscal period.
|
|
335
|
-
*/
|
|
336
|
-
getPeriodCloseStatus(graphId: string, periodStart: string, periodEnd: string): Promise<PeriodCloseStatus>;
|
|
337
|
-
/**
|
|
338
|
-
* Idempotently create (or refresh) a draft closing entry from a schedule's
|
|
339
|
-
* facts for a period. The `outcome` field describes what actually happened:
|
|
340
|
-
*
|
|
341
|
-
* - `created` — new draft
|
|
342
|
-
* - `unchanged` — existing draft still matches the schedule; no-op
|
|
343
|
-
* - `regenerated` — existing draft was stale; replaced
|
|
344
|
-
* - `removed` — schedule no longer covers this period; stale draft deleted
|
|
345
|
-
* - `skipped` — no existing draft and no in-scope fact; nothing to do
|
|
265
|
+
* Idempotently create (or refresh) a draft closing entry from a
|
|
266
|
+
* schedule for a period. See `ClosingEntryOutcome` for semantics.
|
|
346
267
|
*/
|
|
347
268
|
createClosingEntry(graphId: string, structureId: string, postingDate: string, periodStart: string, periodEnd: string, memo?: string): Promise<ClosingEntry>;
|
|
348
269
|
/**
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* and period close grouped into categories.
|
|
352
|
-
*/
|
|
353
|
-
getClosingBookStructures(graphId: string): Promise<ClosingBookStructuresResponse>;
|
|
354
|
-
/**
|
|
355
|
-
* Get account rollups — CoA accounts grouped by reporting element with balances.
|
|
356
|
-
* Shows how company-specific accounts roll up to standardized reporting lines.
|
|
357
|
-
*/
|
|
358
|
-
getAccountRollups(graphId: string, options?: {
|
|
359
|
-
mappingId?: string;
|
|
360
|
-
startDate?: string;
|
|
361
|
-
endDate?: string;
|
|
362
|
-
}): Promise<AccountRollupsResponse>;
|
|
363
|
-
/**
|
|
364
|
-
* Initialize the fiscal calendar for a graph. Creates FiscalPeriod rows
|
|
365
|
-
* for the data window, sets `closed_through` / `close_target`, and emits
|
|
366
|
-
* an `initialized` audit event. Fails with 409 if already initialized.
|
|
270
|
+
* Create a manual balanced closing entry (not tied to a schedule).
|
|
271
|
+
* Used for disposals, adjustments, and one-off closing events.
|
|
367
272
|
*/
|
|
273
|
+
createManualClosingEntry(graphId: string, options: CreateManualClosingEntryOptions): Promise<ClosingEntry>;
|
|
274
|
+
/** Grouped closing book structures for the close-screen sidebar. */
|
|
275
|
+
getClosingBookStructures(graphId: string): Promise<LedgerClosingBookStructures | null>;
|
|
276
|
+
/** Current fiscal calendar state — pointers, gap, closeable status. */
|
|
277
|
+
getFiscalCalendar(graphId: string): Promise<LedgerFiscalCalendar | null>;
|
|
278
|
+
/** One-time ledger initialization — seed fiscal calendar + periods. */
|
|
368
279
|
initializeLedger(graphId: string, options?: InitializeLedgerOptions): Promise<InitializeLedgerResult>;
|
|
369
|
-
/**
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
getFiscalCalendar(graphId: string): Promise<FiscalCalendarState>;
|
|
373
|
-
/**
|
|
374
|
-
* Set the close target for a graph. Validates that the target is not in
|
|
375
|
-
* the future and not before `closed_through`.
|
|
376
|
-
*/
|
|
377
|
-
setCloseTarget(graphId: string, period: string, note?: string | null): Promise<FiscalCalendarState>;
|
|
378
|
-
/**
|
|
379
|
-
* Close a fiscal period — the final commit action.
|
|
380
|
-
*
|
|
381
|
-
* Validates closeable gates, transitions all draft entries in the period
|
|
382
|
-
* to `posted`, marks the FiscalPeriod closed, and advances `closed_through`
|
|
383
|
-
* (auto-advancing `close_target` when reached).
|
|
384
|
-
*/
|
|
280
|
+
/** Set the user-controlled close target (YYYY-MM). */
|
|
281
|
+
setCloseTarget(graphId: string, period: string, note?: string | null): Promise<LedgerFiscalCalendar>;
|
|
282
|
+
/** Close a fiscal period — the final commit action. */
|
|
385
283
|
closePeriod(graphId: string, period: string, options?: ClosePeriodOptions): Promise<ClosePeriodResult>;
|
|
284
|
+
/** Reopen a closed fiscal period. Requires a reason for the audit log. */
|
|
285
|
+
reopenPeriod(graphId: string, period: string, reason: string, note?: string | null): Promise<LedgerFiscalCalendar>;
|
|
386
286
|
/**
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* `closing` so the user can post adjustments and re-close.
|
|
390
|
-
*/
|
|
391
|
-
reopenPeriod(graphId: string, period: string, reason: string, note?: string | null): Promise<FiscalCalendarState>;
|
|
392
|
-
/**
|
|
393
|
-
* List all draft entries in a fiscal period for review before close.
|
|
394
|
-
* Fully expanded with line items, element metadata, and per-entry balance.
|
|
395
|
-
*
|
|
396
|
-
* Pure read — call repeatedly without side effects.
|
|
287
|
+
* Run a typed GraphQL query against the per-graph endpoint and
|
|
288
|
+
* translate ClientError into a readable facade error.
|
|
397
289
|
*/
|
|
398
|
-
|
|
290
|
+
private gqlQuery;
|
|
399
291
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
* produced. Historical posted facts are preserved.
|
|
403
|
-
*
|
|
404
|
-
* `new_end_date` must be a month-end date (service enforces this).
|
|
292
|
+
* Await an SDK-generated `opXxx(...)` call, throw a readable error on
|
|
293
|
+
* non-2xx, and return the `OperationEnvelope` on success.
|
|
405
294
|
*/
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Create a manual draft closing entry with arbitrary balanced line items.
|
|
409
|
-
* Not tied to a schedule — used for disposals, adjustments, and other
|
|
410
|
-
* one-off closing events.
|
|
411
|
-
*
|
|
412
|
-
* Line items must sum to balanced debits/credits. Rejects entries
|
|
413
|
-
* targeting an already-closed period.
|
|
414
|
-
*/
|
|
415
|
-
createManualClosingEntry(graphId: string, options: CreateManualClosingEntryOptions): Promise<ClosingEntry>;
|
|
295
|
+
private callOperation;
|
|
416
296
|
}
|
|
297
|
+
export {};
|