@robosystems/client 2.11.2 → 2.12.0
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 +24 -2
- package/artifacts/LedgerClient.js +42 -1
- package/artifacts/LedgerClient.ts +65 -1
- package/artifacts/graphql/generated/graphql.d.ts +49 -0
- package/artifacts/graphql/generated/graphql.js +80 -0
- package/artifacts/graphql/generated/graphql.ts +129 -0
- package/artifacts/graphql/queries/ledger/agent.d.ts +3 -1
- package/artifacts/graphql/queries/ledger/agent.js +13 -1
- package/artifacts/graphql/queries/ledger/agent.ts +13 -1
- package/artifacts/graphql/queries/ledger/agents.js +10 -0
- package/artifacts/graphql/queries/ledger/agents.ts +10 -0
- package/artifacts/graphql/queries/ledger/reconciliations.d.ts +4 -0
- package/artifacts/graphql/queries/ledger/reconciliations.js +33 -0
- package/artifacts/graphql/queries/ledger/reconciliations.ts +33 -0
- package/index.ts +2 -2
- package/package.json +1 -1
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +4 -3
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +14 -6
- package/sdk/sdk.gen.js +24 -7
- package/sdk/sdk.gen.ts +23 -6
- package/sdk/types.gen.d.ts +346 -9
- package/sdk/types.gen.ts +356 -9
- package/sdk.gen.d.ts +14 -6
- package/sdk.gen.js +24 -7
- package/sdk.gen.ts +23 -6
- package/types.gen.d.ts +346 -9
- package/types.gen.ts +356 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssociationResponse, AutoMapElementsOperation, BindTextBlockRequest, BindTextBlockResponse, BlockedSourceGraphResponse, BlockSourceGraphResult, ComputeMetricsRequest, ComputeMetricsResponse, CreateAgentRequest, CreateEntityRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateInformationBlockRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, FinancialStatementAnalysisResponse, InformationBlockEnvelope, InitializeChartOfAccountsRequest, JournalEntryResponse, LedgerAgentResponse, LinkBankAccountRequest, LinkBankAccountResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, LiveFinancialStatementResponse, OperationEnvelope, PreviewEventBlockResponse, PreviewReconciliationsRequest, PromoteObligationsRequest, PromoteObligationsResponse, PublishListMemberResponse, PublishListResponse, ReconcilingItemPlan, ReportResponse, ResolveReconcilingItemRequest, ResolveReconcilingItemResponse, RevokeReportShareResponse, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateInformationBlockRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest, ViewResponse } from '../types.gen';
|
|
1
|
+
import type { AssociationResponse, AutoMapElementsOperation, BindTextBlockRequest, BindTextBlockResponse, BlockedSourceGraphResponse, BlockSourceGraphResult, ComputeMetricsRequest, ComputeMetricsResponse, CreateAgentRequest, CreateEntityRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateInformationBlockRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, FinancialStatementAnalysisResponse, InformationBlockEnvelope, InitializeChartOfAccountsRequest, JournalEntryResponse, LearnClassificationDefaultsResponse, LedgerAgentResponse, LinkBankAccountRequest, LinkBankAccountResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, LiveFinancialStatementResponse, OperationEnvelope, PreviewEventBlockResponse, PreviewReconciliationsRequest, PromoteObligationsRequest, PromoteObligationsResponse, PublishListMemberResponse, PublishListResponse, ReconcilingItemPlan, ReportResponse, ResolveReconcilingItemRequest, ResolveReconcilingItemResponse, RevokeReportShareResponse, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateInformationBlockRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest, ViewResponse } from '../types.gen';
|
|
2
2
|
import type { TokenProvider } from './graphql/client';
|
|
3
3
|
import { ListLedgerBankAccountsQuery, type GetInformationBlockQuery, type GetLedgerAccountRollupsQuery, type GetLedgerAccountTreeQuery, type GetLedgerAgentQuery, type GetLedgerClosingBookStructuresQuery, type GetLedgerEntityQuery, type GetLedgerEventBlockQuery, 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 ListChartTemplatesQuery, type ListInformationBlocksQuery, type ListLedgerAccountsQuery, type ListLedgerAgentsQuery, type ListLedgerBlockedSourceGraphsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerEventBlocksQuery, type ListLedgerJournalEntriesQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReconciliationsQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery, type MappingCandidatesQuery, type ReportDownloadFormat, type ReportLifecycle } from './graphql/generated/graphql';
|
|
4
4
|
export { GraphQLError } from './graphql/client';
|
|
@@ -59,6 +59,10 @@ export type LedgerReconciliation = LedgerReconciliationList['reconciliations'][n
|
|
|
59
59
|
export type LedgerReconciliationRow = LedgerReconciliation['differences'][number];
|
|
60
60
|
/** One part of an account's independent balance: a schedule, or a statement. */
|
|
61
61
|
export type LedgerReconciliationComponent = LedgerReconciliation['components'][number];
|
|
62
|
+
/** A statement carried to the period's last day by the bank feed's own lines. */
|
|
63
|
+
export type LedgerReconciliationRollForward = NonNullable<LedgerReconciliation['rollForward']>;
|
|
64
|
+
/** How often an account's statement is issued. */
|
|
65
|
+
export type StatementCycle = 'monthly' | 'quarterly' | 'annual';
|
|
62
66
|
export type Report = NonNullable<GetLedgerReportQuery['report']>;
|
|
63
67
|
export type ReportPackage = NonNullable<GetLedgerReportPackageQuery['reportPackage']>;
|
|
64
68
|
export type ReportPackageItem = ReportPackage['items'][number];
|
|
@@ -306,6 +310,8 @@ export interface ReconciliationPolicyChanges {
|
|
|
306
310
|
materiality?: number;
|
|
307
311
|
reviewRequired?: boolean;
|
|
308
312
|
separateReviewer?: boolean;
|
|
313
|
+
/** Statement reconciliations only: how often the statement is issued. */
|
|
314
|
+
statementCycle?: StatementCycle;
|
|
309
315
|
}
|
|
310
316
|
export interface LedgerReconciliationPolicy {
|
|
311
317
|
structureId: string;
|
|
@@ -313,6 +319,8 @@ export interface LedgerReconciliationPolicy {
|
|
|
313
319
|
materiality: number;
|
|
314
320
|
reviewRequired: boolean;
|
|
315
321
|
separateReviewer: boolean;
|
|
322
|
+
/** Statement reconciliations only; null for any other. */
|
|
323
|
+
statementCycle: StatementCycle | null;
|
|
316
324
|
}
|
|
317
325
|
export interface CreateScheduleOptions {
|
|
318
326
|
name: string;
|
|
@@ -364,6 +372,8 @@ export interface CreateJournalEntryOptions {
|
|
|
364
372
|
*/
|
|
365
373
|
source?: string;
|
|
366
374
|
idempotencyKey?: string | null;
|
|
375
|
+
/** The entity whose books the entry goes into. Omitted: the group parent. */
|
|
376
|
+
entityId?: string | null;
|
|
367
377
|
}
|
|
368
378
|
interface LedgerClientConfig {
|
|
369
379
|
baseUrl: string;
|
|
@@ -926,9 +936,21 @@ export declare class LedgerClient {
|
|
|
926
936
|
createAgent(graphId: string, body: CreateAgentRequest, idempotencyKey?: string): Promise<LedgerAgentResponse>;
|
|
927
937
|
/**
|
|
928
938
|
* Update an agent. `metadata_patch` is a partial merge into the existing
|
|
929
|
-
* metadata object; all other fields replace.
|
|
939
|
+
* metadata object; all other fields replace. `classification_element_id`
|
|
940
|
+
* sets the account its bank lines are suggested (an empty string clears
|
|
941
|
+
* it) and `classification_mode: 'always_ask'` stops suggesting one; its
|
|
942
|
+
* open lines are re-suggested at once.
|
|
930
943
|
*/
|
|
931
944
|
updateAgent(graphId: string, body: UpdateAgentRequest): Promise<LedgerAgentResponse>;
|
|
945
|
+
/**
|
|
946
|
+
* Give each counterparty with committed bank lines and no default the
|
|
947
|
+
* account most of its lines went to, and re-suggest its open lines. Run
|
|
948
|
+
* once on books classified before defaults were learned; `dryRun` reports
|
|
949
|
+
* without writing.
|
|
950
|
+
*/
|
|
951
|
+
learnClassificationDefaults(graphId: string, options?: {
|
|
952
|
+
dryRun?: boolean;
|
|
953
|
+
}): Promise<LearnClassificationDefaultsResponse>;
|
|
932
954
|
/**
|
|
933
955
|
* Register a tenant-configurable event handler — DSL row in the
|
|
934
956
|
* `event_handlers` table that drives `create-event-block` for event
|
|
@@ -846,6 +846,7 @@ class LedgerClient {
|
|
|
846
846
|
materiality: changes.materiality,
|
|
847
847
|
review_required: changes.reviewRequired,
|
|
848
848
|
separate_reviewer: changes.separateReviewer,
|
|
849
|
+
statement_cycle: changes.statementCycle,
|
|
849
850
|
};
|
|
850
851
|
const envelope = await this.callOperation('Set reconciliation policy', (o) => (0, sdk_gen_1.setReconciliationPolicy)({ ...o, path: { graph_id: graphId }, body }));
|
|
851
852
|
const raw = envelope.result;
|
|
@@ -855,6 +856,7 @@ class LedgerClient {
|
|
|
855
856
|
materiality: raw.materiality,
|
|
856
857
|
reviewRequired: raw.review_required,
|
|
857
858
|
separateReviewer: raw.separate_reviewer,
|
|
859
|
+
statementCycle: raw.statement_cycle ?? null,
|
|
858
860
|
};
|
|
859
861
|
}
|
|
860
862
|
/**
|
|
@@ -893,6 +895,7 @@ class LedgerClient {
|
|
|
893
895
|
source: options.source ?? 'manual',
|
|
894
896
|
occurred_at: `${options.postingDate}T00:00:00Z`,
|
|
895
897
|
apply_handlers: true,
|
|
898
|
+
...(options.entityId ? { entity_id: options.entityId } : {}),
|
|
896
899
|
metadata: {
|
|
897
900
|
posting_date: options.postingDate,
|
|
898
901
|
memo: options.memo,
|
|
@@ -1006,12 +1009,29 @@ class LedgerClient {
|
|
|
1006
1009
|
}
|
|
1007
1010
|
/**
|
|
1008
1011
|
* Update an agent. `metadata_patch` is a partial merge into the existing
|
|
1009
|
-
* metadata object; all other fields replace.
|
|
1012
|
+
* metadata object; all other fields replace. `classification_element_id`
|
|
1013
|
+
* sets the account its bank lines are suggested (an empty string clears
|
|
1014
|
+
* it) and `classification_mode: 'always_ask'` stops suggesting one; its
|
|
1015
|
+
* open lines are re-suggested at once.
|
|
1010
1016
|
*/
|
|
1011
1017
|
async updateAgent(graphId, body) {
|
|
1012
1018
|
const envelope = await this.callOperation('Update agent', (o) => (0, sdk_gen_1.updateAgent)({ ...o, path: { graph_id: graphId }, body }));
|
|
1013
1019
|
return this.requireResult('Update agent', envelope.result);
|
|
1014
1020
|
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Give each counterparty with committed bank lines and no default the
|
|
1023
|
+
* account most of its lines went to, and re-suggest its open lines. Run
|
|
1024
|
+
* once on books classified before defaults were learned; `dryRun` reports
|
|
1025
|
+
* without writing.
|
|
1026
|
+
*/
|
|
1027
|
+
async learnClassificationDefaults(graphId, options) {
|
|
1028
|
+
const envelope = await this.callOperation('Learn classification defaults', (o) => (0, sdk_gen_1.learnClassificationDefaults)({
|
|
1029
|
+
...o,
|
|
1030
|
+
path: { graph_id: graphId },
|
|
1031
|
+
body: { dry_run: options?.dryRun ?? false },
|
|
1032
|
+
}));
|
|
1033
|
+
return this.requireResult('Learn classification defaults', envelope.result);
|
|
1034
|
+
}
|
|
1015
1035
|
// ── Event handlers (DSL handler registry) ────────────────────────────
|
|
1016
1036
|
/**
|
|
1017
1037
|
* Register a tenant-configurable event handler — DSL row in the
|
|
@@ -1477,12 +1497,30 @@ function reconciliationComponentToCamel(raw) {
|
|
|
1477
1497
|
return {
|
|
1478
1498
|
name: raw.name,
|
|
1479
1499
|
amount: raw.amount,
|
|
1500
|
+
kind: raw.kind ?? null,
|
|
1501
|
+
postingDate: raw.posting_date ?? null,
|
|
1502
|
+
entryId: raw.entry_id ?? null,
|
|
1480
1503
|
structureId: raw.structure_id ?? null,
|
|
1481
1504
|
eventId: raw.event_id ?? null,
|
|
1482
1505
|
documentId: raw.document_id ?? null,
|
|
1483
1506
|
note: raw.note ?? null,
|
|
1484
1507
|
};
|
|
1485
1508
|
}
|
|
1509
|
+
function reconciliationRollForwardToCamel(raw) {
|
|
1510
|
+
if (!raw)
|
|
1511
|
+
return null;
|
|
1512
|
+
return {
|
|
1513
|
+
statementAsOf: raw.statement_as_of,
|
|
1514
|
+
through: raw.through,
|
|
1515
|
+
bankLines: raw.bank_lines,
|
|
1516
|
+
bankActivity: raw.bank_activity,
|
|
1517
|
+
bankBalance: raw.bank_balance,
|
|
1518
|
+
ledgerBalance: raw.ledger_balance,
|
|
1519
|
+
outstanding: raw.outstanding,
|
|
1520
|
+
feedBalance: raw.feed_balance ?? null,
|
|
1521
|
+
feedBalanceReadOn: raw.feed_balance_read_on ?? null,
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1486
1524
|
function reconciliationRowToCamel(raw) {
|
|
1487
1525
|
return {
|
|
1488
1526
|
elementId: raw.element_id ?? null,
|
|
@@ -1496,6 +1534,7 @@ function reconciliationRowToCamel(raw) {
|
|
|
1496
1534
|
status: raw.status,
|
|
1497
1535
|
asOf: raw.as_of ?? null,
|
|
1498
1536
|
components: (raw.components ?? []).map(reconciliationComponentToCamel),
|
|
1537
|
+
rollForward: reconciliationRollForwardToCamel(raw.roll_forward),
|
|
1499
1538
|
};
|
|
1500
1539
|
}
|
|
1501
1540
|
/**
|
|
@@ -1511,6 +1550,7 @@ function reconciliationSummaryToCamel(raw) {
|
|
|
1511
1550
|
elementId: raw.element_id ?? null,
|
|
1512
1551
|
requiredForClose: raw.required_for_close,
|
|
1513
1552
|
materiality: raw.materiality,
|
|
1553
|
+
statementCycle: raw.statement_cycle ?? null,
|
|
1514
1554
|
period: raw.period,
|
|
1515
1555
|
asOf: raw.as_of,
|
|
1516
1556
|
status: raw.status,
|
|
@@ -1521,6 +1561,7 @@ function reconciliationSummaryToCamel(raw) {
|
|
|
1521
1561
|
independentBalance: raw.independent_balance ?? null,
|
|
1522
1562
|
balanceAsOf: raw.balance_as_of ?? null,
|
|
1523
1563
|
components: (raw.components ?? []).map(reconciliationComponentToCamel),
|
|
1564
|
+
rollForward: reconciliationRollForwardToCamel(raw.roll_forward),
|
|
1524
1565
|
source: raw.source ?? null,
|
|
1525
1566
|
comparedAt: raw.compared_at ?? null,
|
|
1526
1567
|
factSetId: raw.fact_set_id ?? null,
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
financialStatementAnalysis,
|
|
57
57
|
initializeChartOfAccounts,
|
|
58
58
|
initializeLedger,
|
|
59
|
+
learnClassificationDefaults,
|
|
59
60
|
linkBankAccount,
|
|
60
61
|
linkEntityTaxonomy,
|
|
61
62
|
liveFinancialStatement,
|
|
@@ -128,6 +129,7 @@ import type {
|
|
|
128
129
|
InitializeChartOfAccountsResponse,
|
|
129
130
|
InitializeLedgerRequest,
|
|
130
131
|
JournalEntryResponse,
|
|
132
|
+
LearnClassificationDefaultsResponse,
|
|
131
133
|
LedgerAgentResponse,
|
|
132
134
|
LedgerEntityResponse,
|
|
133
135
|
LinkBankAccountRequest,
|
|
@@ -147,6 +149,7 @@ import type {
|
|
|
147
149
|
ReconciliationListResponse,
|
|
148
150
|
ReconciliationPolicyResponse,
|
|
149
151
|
ReconciliationPreviewResponse,
|
|
152
|
+
ReconciliationRollForward,
|
|
150
153
|
ReconciliationRow,
|
|
151
154
|
ReconciliationSummary,
|
|
152
155
|
ReconcilingItemPlan,
|
|
@@ -358,6 +361,12 @@ export type LedgerReconciliationRow = LedgerReconciliation['differences'][number
|
|
|
358
361
|
/** One part of an account's independent balance: a schedule, or a statement. */
|
|
359
362
|
export type LedgerReconciliationComponent = LedgerReconciliation['components'][number]
|
|
360
363
|
|
|
364
|
+
/** A statement carried to the period's last day by the bank feed's own lines. */
|
|
365
|
+
export type LedgerReconciliationRollForward = NonNullable<LedgerReconciliation['rollForward']>
|
|
366
|
+
|
|
367
|
+
/** How often an account's statement is issued. */
|
|
368
|
+
export type StatementCycle = 'monthly' | 'quarterly' | 'annual'
|
|
369
|
+
|
|
361
370
|
// Reports + publish lists + statements
|
|
362
371
|
export type Report = NonNullable<GetLedgerReportQuery['report']>
|
|
363
372
|
export type ReportPackage = NonNullable<GetLedgerReportPackageQuery['reportPackage']>
|
|
@@ -725,6 +734,8 @@ export interface ReconciliationPolicyChanges {
|
|
|
725
734
|
materiality?: number
|
|
726
735
|
reviewRequired?: boolean
|
|
727
736
|
separateReviewer?: boolean
|
|
737
|
+
/** Statement reconciliations only: how often the statement is issued. */
|
|
738
|
+
statementCycle?: StatementCycle
|
|
728
739
|
}
|
|
729
740
|
|
|
730
741
|
export interface LedgerReconciliationPolicy {
|
|
@@ -733,6 +744,8 @@ export interface LedgerReconciliationPolicy {
|
|
|
733
744
|
materiality: number
|
|
734
745
|
reviewRequired: boolean
|
|
735
746
|
separateReviewer: boolean
|
|
747
|
+
/** Statement reconciliations only; null for any other. */
|
|
748
|
+
statementCycle: StatementCycle | null
|
|
736
749
|
}
|
|
737
750
|
|
|
738
751
|
export interface CreateScheduleOptions {
|
|
@@ -787,6 +800,8 @@ export interface CreateJournalEntryOptions {
|
|
|
787
800
|
*/
|
|
788
801
|
source?: string
|
|
789
802
|
idempotencyKey?: string | null
|
|
803
|
+
/** The entity whose books the entry goes into. Omitted: the group parent. */
|
|
804
|
+
entityId?: string | null
|
|
790
805
|
}
|
|
791
806
|
|
|
792
807
|
// ── Client ──────────────────────────────────────────────────────────────
|
|
@@ -2285,6 +2300,7 @@ export class LedgerClient {
|
|
|
2285
2300
|
materiality: changes.materiality,
|
|
2286
2301
|
review_required: changes.reviewRequired,
|
|
2287
2302
|
separate_reviewer: changes.separateReviewer,
|
|
2303
|
+
statement_cycle: changes.statementCycle,
|
|
2288
2304
|
}
|
|
2289
2305
|
const envelope = await this.callOperation('Set reconciliation policy', (o) =>
|
|
2290
2306
|
setReconciliationPolicy({ ...o, path: { graph_id: graphId }, body })
|
|
@@ -2296,6 +2312,7 @@ export class LedgerClient {
|
|
|
2296
2312
|
materiality: raw.materiality,
|
|
2297
2313
|
reviewRequired: raw.review_required,
|
|
2298
2314
|
separateReviewer: raw.separate_reviewer,
|
|
2315
|
+
statementCycle: raw.statement_cycle ?? null,
|
|
2299
2316
|
}
|
|
2300
2317
|
}
|
|
2301
2318
|
|
|
@@ -2347,6 +2364,7 @@ export class LedgerClient {
|
|
|
2347
2364
|
source: options.source ?? 'manual',
|
|
2348
2365
|
occurred_at: `${options.postingDate}T00:00:00Z`,
|
|
2349
2366
|
apply_handlers: true,
|
|
2367
|
+
...(options.entityId ? { entity_id: options.entityId } : {}),
|
|
2350
2368
|
metadata: {
|
|
2351
2369
|
posting_date: options.postingDate,
|
|
2352
2370
|
memo: options.memo,
|
|
@@ -2512,7 +2530,10 @@ export class LedgerClient {
|
|
|
2512
2530
|
|
|
2513
2531
|
/**
|
|
2514
2532
|
* Update an agent. `metadata_patch` is a partial merge into the existing
|
|
2515
|
-
* metadata object; all other fields replace.
|
|
2533
|
+
* metadata object; all other fields replace. `classification_element_id`
|
|
2534
|
+
* sets the account its bank lines are suggested (an empty string clears
|
|
2535
|
+
* it) and `classification_mode: 'always_ask'` stops suggesting one; its
|
|
2536
|
+
* open lines are re-suggested at once.
|
|
2516
2537
|
*/
|
|
2517
2538
|
async updateAgent(graphId: string, body: UpdateAgentRequest): Promise<LedgerAgentResponse> {
|
|
2518
2539
|
const envelope = await this.callOperation('Update agent', (o) =>
|
|
@@ -2521,6 +2542,26 @@ export class LedgerClient {
|
|
|
2521
2542
|
return this.requireResult('Update agent', envelope.result)
|
|
2522
2543
|
}
|
|
2523
2544
|
|
|
2545
|
+
/**
|
|
2546
|
+
* Give each counterparty with committed bank lines and no default the
|
|
2547
|
+
* account most of its lines went to, and re-suggest its open lines. Run
|
|
2548
|
+
* once on books classified before defaults were learned; `dryRun` reports
|
|
2549
|
+
* without writing.
|
|
2550
|
+
*/
|
|
2551
|
+
async learnClassificationDefaults(
|
|
2552
|
+
graphId: string,
|
|
2553
|
+
options?: { dryRun?: boolean }
|
|
2554
|
+
): Promise<LearnClassificationDefaultsResponse> {
|
|
2555
|
+
const envelope = await this.callOperation('Learn classification defaults', (o) =>
|
|
2556
|
+
learnClassificationDefaults({
|
|
2557
|
+
...o,
|
|
2558
|
+
path: { graph_id: graphId },
|
|
2559
|
+
body: { dry_run: options?.dryRun ?? false },
|
|
2560
|
+
})
|
|
2561
|
+
)
|
|
2562
|
+
return this.requireResult('Learn classification defaults', envelope.result)
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2524
2565
|
// ── Event handlers (DSL handler registry) ────────────────────────────
|
|
2525
2566
|
|
|
2526
2567
|
/**
|
|
@@ -3193,6 +3234,9 @@ function reconciliationComponentToCamel(
|
|
|
3193
3234
|
return {
|
|
3194
3235
|
name: raw.name,
|
|
3195
3236
|
amount: raw.amount,
|
|
3237
|
+
kind: raw.kind ?? null,
|
|
3238
|
+
postingDate: raw.posting_date ?? null,
|
|
3239
|
+
entryId: raw.entry_id ?? null,
|
|
3196
3240
|
structureId: raw.structure_id ?? null,
|
|
3197
3241
|
eventId: raw.event_id ?? null,
|
|
3198
3242
|
documentId: raw.document_id ?? null,
|
|
@@ -3200,6 +3244,23 @@ function reconciliationComponentToCamel(
|
|
|
3200
3244
|
}
|
|
3201
3245
|
}
|
|
3202
3246
|
|
|
3247
|
+
function reconciliationRollForwardToCamel(
|
|
3248
|
+
raw: ReconciliationRollForward | null | undefined
|
|
3249
|
+
): LedgerReconciliationRollForward | null {
|
|
3250
|
+
if (!raw) return null
|
|
3251
|
+
return {
|
|
3252
|
+
statementAsOf: raw.statement_as_of,
|
|
3253
|
+
through: raw.through,
|
|
3254
|
+
bankLines: raw.bank_lines,
|
|
3255
|
+
bankActivity: raw.bank_activity,
|
|
3256
|
+
bankBalance: raw.bank_balance,
|
|
3257
|
+
ledgerBalance: raw.ledger_balance,
|
|
3258
|
+
outstanding: raw.outstanding,
|
|
3259
|
+
feedBalance: raw.feed_balance ?? null,
|
|
3260
|
+
feedBalanceReadOn: raw.feed_balance_read_on ?? null,
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3203
3264
|
function reconciliationRowToCamel(raw: ReconciliationRow): LedgerReconciliationRow {
|
|
3204
3265
|
return {
|
|
3205
3266
|
elementId: raw.element_id ?? null,
|
|
@@ -3213,6 +3274,7 @@ function reconciliationRowToCamel(raw: ReconciliationRow): LedgerReconciliationR
|
|
|
3213
3274
|
status: raw.status,
|
|
3214
3275
|
asOf: raw.as_of ?? null,
|
|
3215
3276
|
components: (raw.components ?? []).map(reconciliationComponentToCamel),
|
|
3277
|
+
rollForward: reconciliationRollForwardToCamel(raw.roll_forward),
|
|
3216
3278
|
}
|
|
3217
3279
|
}
|
|
3218
3280
|
|
|
@@ -3229,6 +3291,7 @@ function reconciliationSummaryToCamel(raw: ReconciliationSummary): LedgerReconci
|
|
|
3229
3291
|
elementId: raw.element_id ?? null,
|
|
3230
3292
|
requiredForClose: raw.required_for_close,
|
|
3231
3293
|
materiality: raw.materiality,
|
|
3294
|
+
statementCycle: raw.statement_cycle ?? null,
|
|
3232
3295
|
period: raw.period,
|
|
3233
3296
|
asOf: raw.as_of,
|
|
3234
3297
|
status: raw.status,
|
|
@@ -3239,6 +3302,7 @@ function reconciliationSummaryToCamel(raw: ReconciliationSummary): LedgerReconci
|
|
|
3239
3302
|
independentBalance: raw.independent_balance ?? null,
|
|
3240
3303
|
balanceAsOf: raw.balance_as_of ?? null,
|
|
3241
3304
|
components: (raw.components ?? []).map(reconciliationComponentToCamel),
|
|
3305
|
+
rollForward: reconciliationRollForwardToCamel(raw.roll_forward),
|
|
3242
3306
|
source: raw.source ?? null,
|
|
3243
3307
|
comparedAt: raw.compared_at ?? null,
|
|
3244
3308
|
factSetId: raw.fact_set_id ?? null,
|
|
@@ -361,6 +361,16 @@ export type GetLedgerAgentQuery = {
|
|
|
361
361
|
createdAt: string | null;
|
|
362
362
|
updatedAt: string | null;
|
|
363
363
|
createdBy: string | null;
|
|
364
|
+
classification: {
|
|
365
|
+
elementId: string;
|
|
366
|
+
accountName: string | null;
|
|
367
|
+
mode: string;
|
|
368
|
+
confirmations: number;
|
|
369
|
+
overrides: number;
|
|
370
|
+
setBy: string | null;
|
|
371
|
+
setAt: string | null;
|
|
372
|
+
learnedFrom: string | null;
|
|
373
|
+
} | null;
|
|
364
374
|
} | null;
|
|
365
375
|
};
|
|
366
376
|
export type ListLedgerAgentsQueryVariables = Exact<{
|
|
@@ -390,6 +400,16 @@ export type ListLedgerAgentsQuery = {
|
|
|
390
400
|
createdAt: string | null;
|
|
391
401
|
updatedAt: string | null;
|
|
392
402
|
createdBy: string | null;
|
|
403
|
+
classification: {
|
|
404
|
+
elementId: string;
|
|
405
|
+
accountName: string | null;
|
|
406
|
+
mode: string;
|
|
407
|
+
confirmations: number;
|
|
408
|
+
overrides: number;
|
|
409
|
+
setBy: string | null;
|
|
410
|
+
setAt: string | null;
|
|
411
|
+
learnedFrom: string | null;
|
|
412
|
+
} | null;
|
|
393
413
|
}>;
|
|
394
414
|
};
|
|
395
415
|
export type ListLedgerBankAccountsQueryVariables = Exact<{
|
|
@@ -1439,6 +1459,7 @@ export type ListLedgerReconciliationsQuery = {
|
|
|
1439
1459
|
elementId: string | null;
|
|
1440
1460
|
requiredForClose: boolean;
|
|
1441
1461
|
materiality: number;
|
|
1462
|
+
statementCycle: string | null;
|
|
1442
1463
|
period: string;
|
|
1443
1464
|
asOf: string;
|
|
1444
1465
|
status: string;
|
|
@@ -1461,11 +1482,25 @@ export type ListLedgerReconciliationsQuery = {
|
|
|
1461
1482
|
components: Array<{
|
|
1462
1483
|
name: string;
|
|
1463
1484
|
amount: number;
|
|
1485
|
+
kind: string | null;
|
|
1486
|
+
postingDate: string | null;
|
|
1487
|
+
entryId: string | null;
|
|
1464
1488
|
structureId: string | null;
|
|
1465
1489
|
eventId: string | null;
|
|
1466
1490
|
documentId: string | null;
|
|
1467
1491
|
note: string | null;
|
|
1468
1492
|
}>;
|
|
1493
|
+
rollForward: {
|
|
1494
|
+
statementAsOf: string;
|
|
1495
|
+
through: string;
|
|
1496
|
+
bankLines: number;
|
|
1497
|
+
bankActivity: number;
|
|
1498
|
+
bankBalance: number;
|
|
1499
|
+
ledgerBalance: number;
|
|
1500
|
+
outstanding: number;
|
|
1501
|
+
feedBalance: number | null;
|
|
1502
|
+
feedBalanceReadOn: string | null;
|
|
1503
|
+
} | null;
|
|
1469
1504
|
differences: Array<{
|
|
1470
1505
|
elementId: string | null;
|
|
1471
1506
|
accountCode: string | null;
|
|
@@ -1480,11 +1515,25 @@ export type ListLedgerReconciliationsQuery = {
|
|
|
1480
1515
|
components: Array<{
|
|
1481
1516
|
name: string;
|
|
1482
1517
|
amount: number;
|
|
1518
|
+
kind: string | null;
|
|
1519
|
+
postingDate: string | null;
|
|
1520
|
+
entryId: string | null;
|
|
1483
1521
|
structureId: string | null;
|
|
1484
1522
|
eventId: string | null;
|
|
1485
1523
|
documentId: string | null;
|
|
1486
1524
|
note: string | null;
|
|
1487
1525
|
}>;
|
|
1526
|
+
rollForward: {
|
|
1527
|
+
statementAsOf: string;
|
|
1528
|
+
through: string;
|
|
1529
|
+
bankLines: number;
|
|
1530
|
+
bankActivity: number;
|
|
1531
|
+
bankBalance: number;
|
|
1532
|
+
ledgerBalance: number;
|
|
1533
|
+
outstanding: number;
|
|
1534
|
+
feedBalance: number | null;
|
|
1535
|
+
feedBalanceReadOn: string | null;
|
|
1536
|
+
} | null;
|
|
1488
1537
|
}>;
|
|
1489
1538
|
}>;
|
|
1490
1539
|
} | null;
|
|
@@ -1024,6 +1024,23 @@ exports.GetLedgerAgentDocument = {
|
|
|
1024
1024
|
{ kind: 'Field', name: { kind: 'Name', value: 'externalId' } },
|
|
1025
1025
|
{ kind: 'Field', name: { kind: 'Name', value: 'isActive' } },
|
|
1026
1026
|
{ kind: 'Field', name: { kind: 'Name', value: 'is1099Recipient' } },
|
|
1027
|
+
{
|
|
1028
|
+
kind: 'Field',
|
|
1029
|
+
name: { kind: 'Name', value: 'classification' },
|
|
1030
|
+
selectionSet: {
|
|
1031
|
+
kind: 'SelectionSet',
|
|
1032
|
+
selections: [
|
|
1033
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'elementId' } },
|
|
1034
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'accountName' } },
|
|
1035
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'mode' } },
|
|
1036
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'confirmations' } },
|
|
1037
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'overrides' } },
|
|
1038
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'setBy' } },
|
|
1039
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'setAt' } },
|
|
1040
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'learnedFrom' } },
|
|
1041
|
+
],
|
|
1042
|
+
},
|
|
1043
|
+
},
|
|
1027
1044
|
{ kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
|
|
1028
1045
|
{ kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
|
|
1029
1046
|
{ kind: 'Field', name: { kind: 'Name', value: 'createdBy' } },
|
|
@@ -1129,6 +1146,23 @@ exports.ListLedgerAgentsDocument = {
|
|
|
1129
1146
|
{ kind: 'Field', name: { kind: 'Name', value: 'externalId' } },
|
|
1130
1147
|
{ kind: 'Field', name: { kind: 'Name', value: 'isActive' } },
|
|
1131
1148
|
{ kind: 'Field', name: { kind: 'Name', value: 'is1099Recipient' } },
|
|
1149
|
+
{
|
|
1150
|
+
kind: 'Field',
|
|
1151
|
+
name: { kind: 'Name', value: 'classification' },
|
|
1152
|
+
selectionSet: {
|
|
1153
|
+
kind: 'SelectionSet',
|
|
1154
|
+
selections: [
|
|
1155
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'elementId' } },
|
|
1156
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'accountName' } },
|
|
1157
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'mode' } },
|
|
1158
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'confirmations' } },
|
|
1159
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'overrides' } },
|
|
1160
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'setBy' } },
|
|
1161
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'setAt' } },
|
|
1162
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'learnedFrom' } },
|
|
1163
|
+
],
|
|
1164
|
+
},
|
|
1165
|
+
},
|
|
1132
1166
|
{ kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
|
|
1133
1167
|
{ kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
|
|
1134
1168
|
{ kind: 'Field', name: { kind: 'Name', value: 'createdBy' } },
|
|
@@ -3979,6 +4013,7 @@ exports.ListLedgerReconciliationsDocument = {
|
|
|
3979
4013
|
{ kind: 'Field', name: { kind: 'Name', value: 'elementId' } },
|
|
3980
4014
|
{ kind: 'Field', name: { kind: 'Name', value: 'requiredForClose' } },
|
|
3981
4015
|
{ kind: 'Field', name: { kind: 'Name', value: 'materiality' } },
|
|
4016
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'statementCycle' } },
|
|
3982
4017
|
{ kind: 'Field', name: { kind: 'Name', value: 'period' } },
|
|
3983
4018
|
{ kind: 'Field', name: { kind: 'Name', value: 'asOf' } },
|
|
3984
4019
|
{ kind: 'Field', name: { kind: 'Name', value: 'status' } },
|
|
@@ -3996,6 +4031,9 @@ exports.ListLedgerReconciliationsDocument = {
|
|
|
3996
4031
|
selections: [
|
|
3997
4032
|
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
|
|
3998
4033
|
{ kind: 'Field', name: { kind: 'Name', value: 'amount' } },
|
|
4034
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'kind' } },
|
|
4035
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'postingDate' } },
|
|
4036
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'entryId' } },
|
|
3999
4037
|
{ kind: 'Field', name: { kind: 'Name', value: 'structureId' } },
|
|
4000
4038
|
{ kind: 'Field', name: { kind: 'Name', value: 'eventId' } },
|
|
4001
4039
|
{ kind: 'Field', name: { kind: 'Name', value: 'documentId' } },
|
|
@@ -4003,6 +4041,24 @@ exports.ListLedgerReconciliationsDocument = {
|
|
|
4003
4041
|
],
|
|
4004
4042
|
},
|
|
4005
4043
|
},
|
|
4044
|
+
{
|
|
4045
|
+
kind: 'Field',
|
|
4046
|
+
name: { kind: 'Name', value: 'rollForward' },
|
|
4047
|
+
selectionSet: {
|
|
4048
|
+
kind: 'SelectionSet',
|
|
4049
|
+
selections: [
|
|
4050
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'statementAsOf' } },
|
|
4051
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'through' } },
|
|
4052
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankLines' } },
|
|
4053
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankActivity' } },
|
|
4054
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankBalance' } },
|
|
4055
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'ledgerBalance' } },
|
|
4056
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'outstanding' } },
|
|
4057
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'feedBalance' } },
|
|
4058
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'feedBalanceReadOn' } },
|
|
4059
|
+
],
|
|
4060
|
+
},
|
|
4061
|
+
},
|
|
4006
4062
|
{ kind: 'Field', name: { kind: 'Name', value: 'source' } },
|
|
4007
4063
|
{ kind: 'Field', name: { kind: 'Name', value: 'comparedAt' } },
|
|
4008
4064
|
{ kind: 'Field', name: { kind: 'Name', value: 'factSetId' } },
|
|
@@ -4037,6 +4093,9 @@ exports.ListLedgerReconciliationsDocument = {
|
|
|
4037
4093
|
selections: [
|
|
4038
4094
|
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
|
|
4039
4095
|
{ kind: 'Field', name: { kind: 'Name', value: 'amount' } },
|
|
4096
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'kind' } },
|
|
4097
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'postingDate' } },
|
|
4098
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'entryId' } },
|
|
4040
4099
|
{ kind: 'Field', name: { kind: 'Name', value: 'structureId' } },
|
|
4041
4100
|
{ kind: 'Field', name: { kind: 'Name', value: 'eventId' } },
|
|
4042
4101
|
{ kind: 'Field', name: { kind: 'Name', value: 'documentId' } },
|
|
@@ -4044,6 +4103,27 @@ exports.ListLedgerReconciliationsDocument = {
|
|
|
4044
4103
|
],
|
|
4045
4104
|
},
|
|
4046
4105
|
},
|
|
4106
|
+
{
|
|
4107
|
+
kind: 'Field',
|
|
4108
|
+
name: { kind: 'Name', value: 'rollForward' },
|
|
4109
|
+
selectionSet: {
|
|
4110
|
+
kind: 'SelectionSet',
|
|
4111
|
+
selections: [
|
|
4112
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'statementAsOf' } },
|
|
4113
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'through' } },
|
|
4114
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankLines' } },
|
|
4115
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankActivity' } },
|
|
4116
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'bankBalance' } },
|
|
4117
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'ledgerBalance' } },
|
|
4118
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'outstanding' } },
|
|
4119
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'feedBalance' } },
|
|
4120
|
+
{
|
|
4121
|
+
kind: 'Field',
|
|
4122
|
+
name: { kind: 'Name', value: 'feedBalanceReadOn' },
|
|
4123
|
+
},
|
|
4124
|
+
],
|
|
4125
|
+
},
|
|
4126
|
+
},
|
|
4047
4127
|
],
|
|
4048
4128
|
},
|
|
4049
4129
|
},
|