@robosystems/client 2.27.0 → 2.29.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 +51 -4
- package/artifacts/LedgerClient.js +47 -2
- package/artifacts/LedgerClient.ts +129 -2
- package/artifacts/graphql/generated/graphql.d.ts +144 -0
- package/artifacts/graphql/generated/graphql.js +445 -2
- package/artifacts/graphql/generated/graphql.ts +589 -0
- package/artifacts/graphql/queries/ledger/allocationShare.d.ts +10 -0
- package/artifacts/graphql/queries/ledger/allocationShare.js +51 -0
- package/artifacts/graphql/queries/ledger/allocationShare.ts +51 -0
- package/artifacts/graphql/queries/ledger/eventHandlers.d.ts +11 -0
- package/artifacts/graphql/queries/ledger/eventHandlers.js +73 -0
- package/artifacts/graphql/queries/ledger/eventHandlers.ts +73 -0
- package/index.ts +2 -2
- package/package.json +1 -1
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +3 -2
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +11 -3
- package/sdk/sdk.gen.js +21 -4
- package/sdk/sdk.gen.ts +20 -3
- package/sdk/types.gen.d.ts +296 -308
- package/sdk/types.gen.ts +305 -317
- package/sdk.gen.d.ts +11 -3
- package/sdk.gen.js +21 -4
- package/sdk.gen.ts +20 -3
- package/types.gen.d.ts +296 -308
- package/types.gen.ts +305 -317
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AcceptSuggestionsRequest, AcceptSuggestionsResponse, AllocationOverrideResponse, AssociationResponse, AutoMapElementsOperation, BindTextBlockRequest, BindTextBlockResponse, BlockedSourceGraphResponse, BlockSourceGraphResult, ComputeMetricsRequest, ComputeMetricsResponse, ConsolidationProposal, ConsolidationWorksheetRequest, ConsolidationWorksheetResponse, CreateAgentRequest, CreateDimensionRequest, CreateEntityRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateInformationBlockRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, DimensionResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, FinancialStatementAnalysisResponse, InformationBlockEnvelope, InitializeChartOfAccountsRequest, JournalEntryResponse, LearnClassificationDefaultsResponse, LedgerAgentResponse, LinkBankAccountRequest, LinkBankAccountResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, LiveFinancialStatementResponse, OperationEnvelope, PreviewConsolidationEntriesResponse, PreviewEventBlockResponse, PreviewReconciliationsRequest, PromoteObligationsRequest, PromoteObligationsResponse, ProposeConsolidationEntriesResponse, PublishListMemberResponse, PublishListResponse, ReconcilingItemPlan, RecordOpeningBalanceRequest, ReportResponse, ResolveReconcilingItemRequest, ResolveReconcilingItemResponse, RevokeReportShareResponse, SetAllocationOverrideRequest, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateDimensionRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateInformationBlockRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest, ViewResponse } from '../types.gen';
|
|
1
|
+
import type { AcceptSuggestionsRequest, AcceptSuggestionsResponse, AcquisitionResponse, AllocationOverrideResponse, AssociationResponse, AutoMapElementsOperation, BindTextBlockRequest, BindTextBlockResponse, BlockedSourceGraphResponse, BlockSourceGraphResult, ComputeMetricsRequest, ComputeMetricsResponse, ConsolidationProposal, ConsolidationWorksheetRequest, ConsolidationWorksheetResponse, CreateAgentRequest, CreateDimensionRequest, CreateEntityRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateInformationBlockRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, DimensionResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, FinancialStatementAnalysisResponse, InformationBlockEnvelope, InitializeChartOfAccountsRequest, JournalEntryResponse, LearnClassificationDefaultsResponse, LedgerAgentResponse, LinkBankAccountRequest, LinkBankAccountResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, LiveFinancialStatementResponse, OperationEnvelope, PreviewConsolidationEntriesResponse, PreviewEventBlockResponse, PreviewReconciliationsRequest, PromoteObligationsRequest, PromoteObligationsResponse, ProposeConsolidationEntriesResponse, PublishListMemberResponse, PublishListResponse, ReconcilingItemPlan, RecordAcquisitionRequest, RecordOpeningBalanceRequest, ReportResponse, ResolveReconcilingItemRequest, ResolveReconcilingItemResponse, RevokeReportShareResponse, SetAllocationOverrideRequest, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateDimensionRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateInformationBlockRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest, ViewResponse } from '../types.gen';
|
|
2
2
|
import type { TokenProvider } from './graphql/client';
|
|
3
|
-
import { ListLedgerBankAccountsQuery, type AgedReceivablesQuery, type ClassificationStatsQuery, type DischargeCandidatesQuery, type FlowCandidatesQuery, type GetInformationBlockQuery, type GetLedgerAccountRegisterQuery, 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 ListInformationBlockSummariesQuery, type ListLedgerAccountsQuery, type ListLedgerAgentsQuery, type ListLedgerBlockedSourceGraphsQuery, type ListLedgerDimensionsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerEventBlocksQuery, type ListLedgerJournalEntriesQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReconciliationsQuery, type ListLedgerReportSharesQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery, type MappingCandidatesQuery, type OpenItemsForAgentQuery, type ReportDownloadFormat, type ReportLifecycle } from './graphql/generated/graphql';
|
|
3
|
+
import { ListLedgerBankAccountsQuery, type AgedReceivablesQuery, type ClassificationStatsQuery, type DischargeCandidatesQuery, type FlowCandidatesQuery, type GetInformationBlockQuery, type GetLedgerAccountRegisterQuery, type GetLedgerAccountRollupsQuery, type GetLedgerAccountTreeQuery, type GetLedgerAgentQuery, type GetLedgerAllocationShareQuery, 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 ListInformationBlockSummariesQuery, type ListLedgerAccountsQuery, type ListLedgerAgentsQuery, type ListLedgerAllocationOverridesQuery, type ListLedgerBlockedSourceGraphsQuery, type ListLedgerDimensionsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerEventBlocksQuery, type ListLedgerEventHandlersQuery, type ListLedgerJournalEntriesQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReconciliationsQuery, type ListLedgerReportSharesQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery, type MappingCandidatesQuery, type OpenItemsForAgentQuery, type ReportDownloadFormat, type ReportLifecycle } from './graphql/generated/graphql';
|
|
4
4
|
export { GraphQLError } from './graphql/client';
|
|
5
5
|
export type { ReportLifecycle };
|
|
6
6
|
export type LedgerEntity = NonNullable<GetLedgerEntityQuery['entity']>;
|
|
@@ -92,6 +92,21 @@ export type PublishListMember = PublishListDetail['members'][number];
|
|
|
92
92
|
export type BlockedSourceGraph = NonNullable<ListLedgerBlockedSourceGraphsQuery['blockedSourceGraphs']>['blockedSourceGraphs'][number];
|
|
93
93
|
/** One delivery of a report to a recipient graph, with its revocation state. */
|
|
94
94
|
export type ReportShare = NonNullable<ListLedgerReportSharesQuery['reportShares']>['reportShares'][number];
|
|
95
|
+
/**
|
|
96
|
+
* The outside owners' share of a member's result for one month, in cents:
|
|
97
|
+
* the pro-rata figure its ownership gives (`proRataAmount`), the override if
|
|
98
|
+
* one is set, and the share the consolidating entries use
|
|
99
|
+
* (`effectiveAmount`).
|
|
100
|
+
*/
|
|
101
|
+
export type LedgerAllocationShare = NonNullable<GetLedgerAllocationShareQuery['allocationShare']>;
|
|
102
|
+
/** A member's allocation override for one month. */
|
|
103
|
+
export type LedgerAllocationOverride = NonNullable<ListLedgerAllocationOverridesQuery['allocationOverrides']>['overrides'][number];
|
|
104
|
+
/**
|
|
105
|
+
* A rule that turns a matching event into GL rows. `awaitingApproval` marks
|
|
106
|
+
* an AI client's suggestion, which takes no part in matching until a person
|
|
107
|
+
* approves it with `updateEventHandler(..., { approve: true })`.
|
|
108
|
+
*/
|
|
109
|
+
export type LedgerEventHandler = NonNullable<ListLedgerEventHandlersQuery['eventHandlers']>['eventHandlers'][number];
|
|
95
110
|
/**
|
|
96
111
|
* Presigned-URL response for a Report bundle download.
|
|
97
112
|
*
|
|
@@ -1101,6 +1116,23 @@ export declare class LedgerClient {
|
|
|
1101
1116
|
* `clear: true` removes it. Only for a member consolidated in full.
|
|
1102
1117
|
*/
|
|
1103
1118
|
setAllocationOverride(graphId: string, body: SetAllocationOverrideRequest): Promise<AllocationOverrideResponse>;
|
|
1119
|
+
/**
|
|
1120
|
+
* The outside owners' share of a member's result for one month: the
|
|
1121
|
+
* pro-rata figure, the override if one is set, and the share the
|
|
1122
|
+
* consolidating entries use. Null when the ledger is not initialized.
|
|
1123
|
+
*/
|
|
1124
|
+
getAllocationShare(graphId: string, entityId: string, period: string): Promise<LedgerAllocationShare | null>;
|
|
1125
|
+
/** Every month a member's allocation override is set for, oldest first. */
|
|
1126
|
+
listAllocationOverrides(graphId: string, entityId: string): Promise<LedgerAllocationOverride[]>;
|
|
1127
|
+
/**
|
|
1128
|
+
* Record a member the parent bought from its outside owners: the
|
|
1129
|
+
* consideration paid the sellers, in cents, with the basis, and optionally
|
|
1130
|
+
* the outside owners' fair value and fair-value step-ups. Writes a draft in
|
|
1131
|
+
* the consolidation entity that its close posts; the excess over the
|
|
1132
|
+
* parent's share of the member's equity at acquisition goes to the
|
|
1133
|
+
* step-ups and goodwill. A bargain purchase needs `confirm_bargain_purchase`.
|
|
1134
|
+
*/
|
|
1135
|
+
recordAcquisition(graphId: string, body: RecordAcquisitionRequest): Promise<AcquisitionResponse>;
|
|
1104
1136
|
/**
|
|
1105
1137
|
* Create an event block directly. Use for support-class events
|
|
1106
1138
|
* (`event_class: 'support'`) with categories `approval`, `control`,
|
|
@@ -1183,8 +1215,23 @@ export declare class LedgerClient {
|
|
|
1183
1215
|
*/
|
|
1184
1216
|
createEventHandler(graphId: string, body: CreateEventHandlerRequest): Promise<EventHandlerResponse>;
|
|
1185
1217
|
/**
|
|
1186
|
-
*
|
|
1187
|
-
* AI
|
|
1218
|
+
* The graph's event handlers, highest priority first, active or not.
|
|
1219
|
+
* `awaitingApproval: true` narrows to the AI's suggestions no one has
|
|
1220
|
+
* approved; `false` to everything else.
|
|
1221
|
+
*/
|
|
1222
|
+
listEventHandlers(graphId: string, options?: {
|
|
1223
|
+
eventType?: string;
|
|
1224
|
+
isActive?: boolean;
|
|
1225
|
+
awaitingApproval?: boolean;
|
|
1226
|
+
limit?: number;
|
|
1227
|
+
offset?: number;
|
|
1228
|
+
}): Promise<LedgerEventHandler[]>;
|
|
1229
|
+
/** One event handler, or null. */
|
|
1230
|
+
getEventHandler(graphId: string, id: string): Promise<LedgerEventHandler | null>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Update a registered event handler. Pass `approve: true` to approve an
|
|
1233
|
+
* AI-suggested handler — a person's action: through an AI client it is
|
|
1234
|
+
* refused.
|
|
1188
1235
|
*/
|
|
1189
1236
|
updateEventHandler(graphId: string, body: UpdateEventHandlerRequest): Promise<EventHandlerResponse>;
|
|
1190
1237
|
/**
|
|
@@ -1145,6 +1145,31 @@ class LedgerClient {
|
|
|
1145
1145
|
const envelope = await this.callOperation('Set allocation override', (o) => (0, sdk_gen_1.setAllocationOverride)({ ...o, path: { graph_id: graphId }, body }));
|
|
1146
1146
|
return this.requireResult('Set allocation override', envelope.result);
|
|
1147
1147
|
}
|
|
1148
|
+
/**
|
|
1149
|
+
* The outside owners' share of a member's result for one month: the
|
|
1150
|
+
* pro-rata figure, the override if one is set, and the share the
|
|
1151
|
+
* consolidating entries use. Null when the ledger is not initialized.
|
|
1152
|
+
*/
|
|
1153
|
+
async getAllocationShare(graphId, entityId, period) {
|
|
1154
|
+
return this.gqlQuery(graphId, graphql_1.GetLedgerAllocationShareDocument, { entityId, period }, 'Get allocation share', (data) => data.allocationShare ?? null);
|
|
1155
|
+
}
|
|
1156
|
+
/** Every month a member's allocation override is set for, oldest first. */
|
|
1157
|
+
async listAllocationOverrides(graphId, entityId) {
|
|
1158
|
+
const list = await this.gqlQuery(graphId, graphql_1.ListLedgerAllocationOverridesDocument, { entityId }, 'List allocation overrides', (data) => data.allocationOverrides);
|
|
1159
|
+
return list?.overrides ?? [];
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Record a member the parent bought from its outside owners: the
|
|
1163
|
+
* consideration paid the sellers, in cents, with the basis, and optionally
|
|
1164
|
+
* the outside owners' fair value and fair-value step-ups. Writes a draft in
|
|
1165
|
+
* the consolidation entity that its close posts; the excess over the
|
|
1166
|
+
* parent's share of the member's equity at acquisition goes to the
|
|
1167
|
+
* step-ups and goodwill. A bargain purchase needs `confirm_bargain_purchase`.
|
|
1168
|
+
*/
|
|
1169
|
+
async recordAcquisition(graphId, body) {
|
|
1170
|
+
const envelope = await this.callOperation('Record acquisition', (o) => (0, sdk_gen_1.recordAcquisition)({ ...o, path: { graph_id: graphId }, body }));
|
|
1171
|
+
return this.requireResult('Record acquisition', envelope.result);
|
|
1172
|
+
}
|
|
1148
1173
|
// ── Event blocks (generic preview + status transitions) ──────────────
|
|
1149
1174
|
/**
|
|
1150
1175
|
* Create an event block directly. Use for support-class events
|
|
@@ -1260,8 +1285,28 @@ class LedgerClient {
|
|
|
1260
1285
|
return this.requireResult('Create event handler', envelope.result);
|
|
1261
1286
|
}
|
|
1262
1287
|
/**
|
|
1263
|
-
*
|
|
1264
|
-
* AI
|
|
1288
|
+
* The graph's event handlers, highest priority first, active or not.
|
|
1289
|
+
* `awaitingApproval: true` narrows to the AI's suggestions no one has
|
|
1290
|
+
* approved; `false` to everything else.
|
|
1291
|
+
*/
|
|
1292
|
+
async listEventHandlers(graphId, options) {
|
|
1293
|
+
const list = await this.gqlQuery(graphId, graphql_1.ListLedgerEventHandlersDocument, {
|
|
1294
|
+
eventType: options?.eventType ?? null,
|
|
1295
|
+
isActive: options?.isActive ?? null,
|
|
1296
|
+
awaitingApproval: options?.awaitingApproval ?? null,
|
|
1297
|
+
limit: options?.limit ?? 100,
|
|
1298
|
+
offset: options?.offset ?? 0,
|
|
1299
|
+
}, 'List event handlers', (data) => data.eventHandlers);
|
|
1300
|
+
return list?.eventHandlers ?? [];
|
|
1301
|
+
}
|
|
1302
|
+
/** One event handler, or null. */
|
|
1303
|
+
async getEventHandler(graphId, id) {
|
|
1304
|
+
return this.gqlQuery(graphId, graphql_1.GetLedgerEventHandlerDocument, { id }, 'Get event handler', (data) => data.eventHandler ?? null);
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Update a registered event handler. Pass `approve: true` to approve an
|
|
1308
|
+
* AI-suggested handler — a person's action: through an AI client it is
|
|
1309
|
+
* refused.
|
|
1265
1310
|
*/
|
|
1266
1311
|
async updateEventHandler(graphId, body) {
|
|
1267
1312
|
const envelope = await this.callOperation('Update event handler', (o) => (0, sdk_gen_1.updateEventHandler)({ ...o, path: { graph_id: graphId }, body }));
|
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
promoteObligations,
|
|
71
71
|
proposeConsolidationEntries,
|
|
72
72
|
rebuildSchedule,
|
|
73
|
+
recordAcquisition,
|
|
73
74
|
recordOpeningBalance,
|
|
74
75
|
recordStatementBalance,
|
|
75
76
|
refreshReconciliations,
|
|
@@ -98,6 +99,7 @@ import {
|
|
|
98
99
|
import type {
|
|
99
100
|
AcceptSuggestionsRequest,
|
|
100
101
|
AcceptSuggestionsResponse,
|
|
102
|
+
AcquisitionResponse,
|
|
101
103
|
AddPublishListMembersOperation,
|
|
102
104
|
AllocationOverrideResponse,
|
|
103
105
|
AssociationResponse,
|
|
@@ -171,6 +173,7 @@ import type {
|
|
|
171
173
|
ReconciliationRow,
|
|
172
174
|
ReconciliationSummary,
|
|
173
175
|
ReconcilingItemPlan,
|
|
176
|
+
RecordAcquisitionRequest,
|
|
174
177
|
RecordOpeningBalanceRequest,
|
|
175
178
|
RecordStatementBalanceRequest,
|
|
176
179
|
RefreshReconciliationsRequest,
|
|
@@ -211,9 +214,11 @@ import {
|
|
|
211
214
|
GetLedgerAccountRollupsDocument,
|
|
212
215
|
GetLedgerAccountTreeDocument,
|
|
213
216
|
GetLedgerAgentDocument,
|
|
217
|
+
GetLedgerAllocationShareDocument,
|
|
214
218
|
GetLedgerClosingBookStructuresDocument,
|
|
215
219
|
GetLedgerEntityDocument,
|
|
216
220
|
GetLedgerEventBlockDocument,
|
|
221
|
+
GetLedgerEventHandlerDocument,
|
|
217
222
|
GetLedgerFiscalCalendarDocument,
|
|
218
223
|
GetLedgerMappedTrialBalanceDocument,
|
|
219
224
|
GetLedgerMappingCoverageDocument,
|
|
@@ -234,6 +239,7 @@ import {
|
|
|
234
239
|
ListInformationBlockSummariesDocument,
|
|
235
240
|
ListLedgerAccountsDocument,
|
|
236
241
|
ListLedgerAgentsDocument,
|
|
242
|
+
ListLedgerAllocationOverridesDocument,
|
|
237
243
|
ListLedgerBankAccountsDocument,
|
|
238
244
|
ListLedgerBankAccountsQuery,
|
|
239
245
|
ListLedgerBlockedSourceGraphsDocument,
|
|
@@ -241,6 +247,7 @@ import {
|
|
|
241
247
|
ListLedgerElementsDocument,
|
|
242
248
|
ListLedgerEntitiesDocument,
|
|
243
249
|
ListLedgerEventBlocksDocument,
|
|
250
|
+
ListLedgerEventHandlersDocument,
|
|
244
251
|
ListLedgerJournalEntriesDocument,
|
|
245
252
|
ListLedgerMappingsDocument,
|
|
246
253
|
ListLedgerPublishListsDocument,
|
|
@@ -262,6 +269,7 @@ import {
|
|
|
262
269
|
type GetLedgerAccountRollupsQuery,
|
|
263
270
|
type GetLedgerAccountTreeQuery,
|
|
264
271
|
type GetLedgerAgentQuery,
|
|
272
|
+
type GetLedgerAllocationShareQuery,
|
|
265
273
|
type GetLedgerClosingBookStructuresQuery,
|
|
266
274
|
type GetLedgerEntityQuery,
|
|
267
275
|
type GetLedgerEventBlockQuery,
|
|
@@ -284,11 +292,13 @@ import {
|
|
|
284
292
|
type ListInformationBlockSummariesQuery,
|
|
285
293
|
type ListLedgerAccountsQuery,
|
|
286
294
|
type ListLedgerAgentsQuery,
|
|
295
|
+
type ListLedgerAllocationOverridesQuery,
|
|
287
296
|
type ListLedgerBlockedSourceGraphsQuery,
|
|
288
297
|
type ListLedgerDimensionsQuery,
|
|
289
298
|
type ListLedgerElementsQuery,
|
|
290
299
|
type ListLedgerEntitiesQuery,
|
|
291
300
|
type ListLedgerEventBlocksQuery,
|
|
301
|
+
type ListLedgerEventHandlersQuery,
|
|
292
302
|
type ListLedgerJournalEntriesQuery,
|
|
293
303
|
type ListLedgerMappingsQuery,
|
|
294
304
|
type ListLedgerPublishListsQuery,
|
|
@@ -457,6 +467,28 @@ export type ReportShare = NonNullable<
|
|
|
457
467
|
ListLedgerReportSharesQuery['reportShares']
|
|
458
468
|
>['reportShares'][number]
|
|
459
469
|
|
|
470
|
+
/**
|
|
471
|
+
* The outside owners' share of a member's result for one month, in cents:
|
|
472
|
+
* the pro-rata figure its ownership gives (`proRataAmount`), the override if
|
|
473
|
+
* one is set, and the share the consolidating entries use
|
|
474
|
+
* (`effectiveAmount`).
|
|
475
|
+
*/
|
|
476
|
+
export type LedgerAllocationShare = NonNullable<GetLedgerAllocationShareQuery['allocationShare']>
|
|
477
|
+
|
|
478
|
+
/** A member's allocation override for one month. */
|
|
479
|
+
export type LedgerAllocationOverride = NonNullable<
|
|
480
|
+
ListLedgerAllocationOverridesQuery['allocationOverrides']
|
|
481
|
+
>['overrides'][number]
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* A rule that turns a matching event into GL rows. `awaitingApproval` marks
|
|
485
|
+
* an AI client's suggestion, which takes no part in matching until a person
|
|
486
|
+
* approves it with `updateEventHandler(..., { approve: true })`.
|
|
487
|
+
*/
|
|
488
|
+
export type LedgerEventHandler = NonNullable<
|
|
489
|
+
ListLedgerEventHandlersQuery['eventHandlers']
|
|
490
|
+
>['eventHandlers'][number]
|
|
491
|
+
|
|
460
492
|
/**
|
|
461
493
|
* Presigned-URL response for a Report bundle download.
|
|
462
494
|
*
|
|
@@ -2879,6 +2911,58 @@ export class LedgerClient {
|
|
|
2879
2911
|
return this.requireResult('Set allocation override', envelope.result)
|
|
2880
2912
|
}
|
|
2881
2913
|
|
|
2914
|
+
/**
|
|
2915
|
+
* The outside owners' share of a member's result for one month: the
|
|
2916
|
+
* pro-rata figure, the override if one is set, and the share the
|
|
2917
|
+
* consolidating entries use. Null when the ledger is not initialized.
|
|
2918
|
+
*/
|
|
2919
|
+
async getAllocationShare(
|
|
2920
|
+
graphId: string,
|
|
2921
|
+
entityId: string,
|
|
2922
|
+
period: string
|
|
2923
|
+
): Promise<LedgerAllocationShare | null> {
|
|
2924
|
+
return this.gqlQuery(
|
|
2925
|
+
graphId,
|
|
2926
|
+
GetLedgerAllocationShareDocument,
|
|
2927
|
+
{ entityId, period },
|
|
2928
|
+
'Get allocation share',
|
|
2929
|
+
(data) => data.allocationShare ?? null
|
|
2930
|
+
)
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
/** Every month a member's allocation override is set for, oldest first. */
|
|
2934
|
+
async listAllocationOverrides(
|
|
2935
|
+
graphId: string,
|
|
2936
|
+
entityId: string
|
|
2937
|
+
): Promise<LedgerAllocationOverride[]> {
|
|
2938
|
+
const list = await this.gqlQuery(
|
|
2939
|
+
graphId,
|
|
2940
|
+
ListLedgerAllocationOverridesDocument,
|
|
2941
|
+
{ entityId },
|
|
2942
|
+
'List allocation overrides',
|
|
2943
|
+
(data) => data.allocationOverrides
|
|
2944
|
+
)
|
|
2945
|
+
return list?.overrides ?? []
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Record a member the parent bought from its outside owners: the
|
|
2950
|
+
* consideration paid the sellers, in cents, with the basis, and optionally
|
|
2951
|
+
* the outside owners' fair value and fair-value step-ups. Writes a draft in
|
|
2952
|
+
* the consolidation entity that its close posts; the excess over the
|
|
2953
|
+
* parent's share of the member's equity at acquisition goes to the
|
|
2954
|
+
* step-ups and goodwill. A bargain purchase needs `confirm_bargain_purchase`.
|
|
2955
|
+
*/
|
|
2956
|
+
async recordAcquisition(
|
|
2957
|
+
graphId: string,
|
|
2958
|
+
body: RecordAcquisitionRequest
|
|
2959
|
+
): Promise<AcquisitionResponse> {
|
|
2960
|
+
const envelope = await this.callOperation('Record acquisition', (o) =>
|
|
2961
|
+
recordAcquisition({ ...o, path: { graph_id: graphId }, body })
|
|
2962
|
+
)
|
|
2963
|
+
return this.requireResult('Record acquisition', envelope.result)
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2882
2966
|
// ── Event blocks (generic preview + status transitions) ──────────────
|
|
2883
2967
|
|
|
2884
2968
|
/**
|
|
@@ -3055,8 +3139,51 @@ export class LedgerClient {
|
|
|
3055
3139
|
}
|
|
3056
3140
|
|
|
3057
3141
|
/**
|
|
3058
|
-
*
|
|
3059
|
-
* AI
|
|
3142
|
+
* The graph's event handlers, highest priority first, active or not.
|
|
3143
|
+
* `awaitingApproval: true` narrows to the AI's suggestions no one has
|
|
3144
|
+
* approved; `false` to everything else.
|
|
3145
|
+
*/
|
|
3146
|
+
async listEventHandlers(
|
|
3147
|
+
graphId: string,
|
|
3148
|
+
options?: {
|
|
3149
|
+
eventType?: string
|
|
3150
|
+
isActive?: boolean
|
|
3151
|
+
awaitingApproval?: boolean
|
|
3152
|
+
limit?: number
|
|
3153
|
+
offset?: number
|
|
3154
|
+
}
|
|
3155
|
+
): Promise<LedgerEventHandler[]> {
|
|
3156
|
+
const list = await this.gqlQuery(
|
|
3157
|
+
graphId,
|
|
3158
|
+
ListLedgerEventHandlersDocument,
|
|
3159
|
+
{
|
|
3160
|
+
eventType: options?.eventType ?? null,
|
|
3161
|
+
isActive: options?.isActive ?? null,
|
|
3162
|
+
awaitingApproval: options?.awaitingApproval ?? null,
|
|
3163
|
+
limit: options?.limit ?? 100,
|
|
3164
|
+
offset: options?.offset ?? 0,
|
|
3165
|
+
},
|
|
3166
|
+
'List event handlers',
|
|
3167
|
+
(data) => data.eventHandlers
|
|
3168
|
+
)
|
|
3169
|
+
return list?.eventHandlers ?? []
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
/** One event handler, or null. */
|
|
3173
|
+
async getEventHandler(graphId: string, id: string): Promise<LedgerEventHandler | null> {
|
|
3174
|
+
return this.gqlQuery(
|
|
3175
|
+
graphId,
|
|
3176
|
+
GetLedgerEventHandlerDocument,
|
|
3177
|
+
{ id },
|
|
3178
|
+
'Get event handler',
|
|
3179
|
+
(data) => data.eventHandler ?? null
|
|
3180
|
+
)
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
/**
|
|
3184
|
+
* Update a registered event handler. Pass `approve: true` to approve an
|
|
3185
|
+
* AI-suggested handler — a person's action: through an AI client it is
|
|
3186
|
+
* refused.
|
|
3060
3187
|
*/
|
|
3061
3188
|
async updateEventHandler(
|
|
3062
3189
|
graphId: string,
|
|
@@ -839,6 +839,53 @@ export type ListLedgerAgentsQuery = {
|
|
|
839
839
|
}>;
|
|
840
840
|
}>;
|
|
841
841
|
};
|
|
842
|
+
export type AllocationOverrideFieldsFragment = {
|
|
843
|
+
period: string;
|
|
844
|
+
amount: number | null;
|
|
845
|
+
percentage: number | null;
|
|
846
|
+
basis: string | null;
|
|
847
|
+
setBy: string | null;
|
|
848
|
+
};
|
|
849
|
+
export type GetLedgerAllocationShareQueryVariables = Exact<{
|
|
850
|
+
entityId: string;
|
|
851
|
+
period: string;
|
|
852
|
+
}>;
|
|
853
|
+
export type GetLedgerAllocationShareQuery = {
|
|
854
|
+
allocationShare: {
|
|
855
|
+
entityId: string;
|
|
856
|
+
entityName: string;
|
|
857
|
+
period: string;
|
|
858
|
+
consolidationMethod: string;
|
|
859
|
+
ownershipPct: number | null;
|
|
860
|
+
outsidePct: number;
|
|
861
|
+
monthResult: number;
|
|
862
|
+
proRataAmount: number;
|
|
863
|
+
effectiveAmount: number;
|
|
864
|
+
closed: boolean;
|
|
865
|
+
override: {
|
|
866
|
+
period: string;
|
|
867
|
+
amount: number | null;
|
|
868
|
+
percentage: number | null;
|
|
869
|
+
basis: string | null;
|
|
870
|
+
setBy: string | null;
|
|
871
|
+
} | null;
|
|
872
|
+
} | null;
|
|
873
|
+
};
|
|
874
|
+
export type ListLedgerAllocationOverridesQueryVariables = Exact<{
|
|
875
|
+
entityId: string;
|
|
876
|
+
}>;
|
|
877
|
+
export type ListLedgerAllocationOverridesQuery = {
|
|
878
|
+
allocationOverrides: {
|
|
879
|
+
entityId: string;
|
|
880
|
+
overrides: Array<{
|
|
881
|
+
period: string;
|
|
882
|
+
amount: number | null;
|
|
883
|
+
percentage: number | null;
|
|
884
|
+
basis: string | null;
|
|
885
|
+
setBy: string | null;
|
|
886
|
+
}>;
|
|
887
|
+
} | null;
|
|
888
|
+
};
|
|
842
889
|
export type ListLedgerBankAccountsQueryVariables = Exact<{
|
|
843
890
|
entityId: string | null | undefined;
|
|
844
891
|
}>;
|
|
@@ -1167,6 +1214,97 @@ export type ListLedgerEventBlocksQuery = {
|
|
|
1167
1214
|
createdBy: string;
|
|
1168
1215
|
}>;
|
|
1169
1216
|
};
|
|
1217
|
+
export type EventHandlerFieldsFragment = {
|
|
1218
|
+
id: string;
|
|
1219
|
+
name: string;
|
|
1220
|
+
description: string | null;
|
|
1221
|
+
eventType: string;
|
|
1222
|
+
eventCategory: string | null;
|
|
1223
|
+
matchSource: string | null;
|
|
1224
|
+
matchAgentType: string | null;
|
|
1225
|
+
matchResourceType: string | null;
|
|
1226
|
+
matchMetadataExpression: unknown;
|
|
1227
|
+
transactionTemplate: unknown;
|
|
1228
|
+
priority: number;
|
|
1229
|
+
isActive: boolean;
|
|
1230
|
+
origin: string;
|
|
1231
|
+
suggestedBy: string | null;
|
|
1232
|
+
confidence: number | null;
|
|
1233
|
+
approvedBy: string | null;
|
|
1234
|
+
approvedAt: string | null;
|
|
1235
|
+
awaitingApproval: boolean;
|
|
1236
|
+
createdAt: string | null;
|
|
1237
|
+
updatedAt: string | null;
|
|
1238
|
+
createdBy: string | null;
|
|
1239
|
+
};
|
|
1240
|
+
export type ListLedgerEventHandlersQueryVariables = Exact<{
|
|
1241
|
+
eventType: string | null | undefined;
|
|
1242
|
+
isActive: boolean | null | undefined;
|
|
1243
|
+
awaitingApproval: boolean | null | undefined;
|
|
1244
|
+
limit?: number;
|
|
1245
|
+
offset?: number;
|
|
1246
|
+
}>;
|
|
1247
|
+
export type ListLedgerEventHandlersQuery = {
|
|
1248
|
+
eventHandlers: {
|
|
1249
|
+
eventHandlers: Array<{
|
|
1250
|
+
id: string;
|
|
1251
|
+
name: string;
|
|
1252
|
+
description: string | null;
|
|
1253
|
+
eventType: string;
|
|
1254
|
+
eventCategory: string | null;
|
|
1255
|
+
matchSource: string | null;
|
|
1256
|
+
matchAgentType: string | null;
|
|
1257
|
+
matchResourceType: string | null;
|
|
1258
|
+
matchMetadataExpression: unknown;
|
|
1259
|
+
transactionTemplate: unknown;
|
|
1260
|
+
priority: number;
|
|
1261
|
+
isActive: boolean;
|
|
1262
|
+
origin: string;
|
|
1263
|
+
suggestedBy: string | null;
|
|
1264
|
+
confidence: number | null;
|
|
1265
|
+
approvedBy: string | null;
|
|
1266
|
+
approvedAt: string | null;
|
|
1267
|
+
awaitingApproval: boolean;
|
|
1268
|
+
createdAt: string | null;
|
|
1269
|
+
updatedAt: string | null;
|
|
1270
|
+
createdBy: string | null;
|
|
1271
|
+
}>;
|
|
1272
|
+
pagination: {
|
|
1273
|
+
total: number;
|
|
1274
|
+
limit: number;
|
|
1275
|
+
offset: number;
|
|
1276
|
+
hasMore: boolean;
|
|
1277
|
+
};
|
|
1278
|
+
} | null;
|
|
1279
|
+
};
|
|
1280
|
+
export type GetLedgerEventHandlerQueryVariables = Exact<{
|
|
1281
|
+
id: string;
|
|
1282
|
+
}>;
|
|
1283
|
+
export type GetLedgerEventHandlerQuery = {
|
|
1284
|
+
eventHandler: {
|
|
1285
|
+
id: string;
|
|
1286
|
+
name: string;
|
|
1287
|
+
description: string | null;
|
|
1288
|
+
eventType: string;
|
|
1289
|
+
eventCategory: string | null;
|
|
1290
|
+
matchSource: string | null;
|
|
1291
|
+
matchAgentType: string | null;
|
|
1292
|
+
matchResourceType: string | null;
|
|
1293
|
+
matchMetadataExpression: unknown;
|
|
1294
|
+
transactionTemplate: unknown;
|
|
1295
|
+
priority: number;
|
|
1296
|
+
isActive: boolean;
|
|
1297
|
+
origin: string;
|
|
1298
|
+
suggestedBy: string | null;
|
|
1299
|
+
confidence: number | null;
|
|
1300
|
+
approvedBy: string | null;
|
|
1301
|
+
approvedAt: string | null;
|
|
1302
|
+
awaitingApproval: boolean;
|
|
1303
|
+
createdAt: string | null;
|
|
1304
|
+
updatedAt: string | null;
|
|
1305
|
+
createdBy: string | null;
|
|
1306
|
+
} | null;
|
|
1307
|
+
};
|
|
1170
1308
|
export type GetLedgerFiscalCalendarQueryVariables = Exact<{
|
|
1171
1309
|
entityId: string | null | undefined;
|
|
1172
1310
|
}>;
|
|
@@ -2875,6 +3013,8 @@ export declare const RegisterLineFieldsFragmentDoc: DocumentNode<RegisterLineFie
|
|
|
2875
3013
|
export declare const AgingBucketsFieldsFragmentDoc: DocumentNode<AgingBucketsFieldsFragment, unknown>;
|
|
2876
3014
|
export declare const OpenItemFieldsFragmentDoc: DocumentNode<OpenItemFieldsFragment, unknown>;
|
|
2877
3015
|
export declare const AgedBalancesFieldsFragmentDoc: DocumentNode<AgedBalancesFieldsFragment, unknown>;
|
|
3016
|
+
export declare const AllocationOverrideFieldsFragmentDoc: DocumentNode<AllocationOverrideFieldsFragment, unknown>;
|
|
3017
|
+
export declare const EventHandlerFieldsFragmentDoc: DocumentNode<EventHandlerFieldsFragment, unknown>;
|
|
2878
3018
|
export declare const GetInvestorHoldingsDocument: DocumentNode<GetInvestorHoldingsQuery, GetInvestorHoldingsQueryVariables>;
|
|
2879
3019
|
export declare const GetInvestorPortfolioBlockDocument: DocumentNode<GetInvestorPortfolioBlockQuery, GetInvestorPortfolioBlockQueryVariables>;
|
|
2880
3020
|
export declare const ListInvestorPortfoliosDocument: DocumentNode<ListInvestorPortfoliosQuery, ListInvestorPortfoliosQueryVariables>;
|
|
@@ -2892,6 +3032,8 @@ export declare const OpenItemsForAgentDocument: DocumentNode<OpenItemsForAgentQu
|
|
|
2892
3032
|
export declare const DischargeCandidatesDocument: DocumentNode<DischargeCandidatesQuery, DischargeCandidatesQueryVariables>;
|
|
2893
3033
|
export declare const GetLedgerAgentDocument: DocumentNode<GetLedgerAgentQuery, GetLedgerAgentQueryVariables>;
|
|
2894
3034
|
export declare const ListLedgerAgentsDocument: DocumentNode<ListLedgerAgentsQuery, ListLedgerAgentsQueryVariables>;
|
|
3035
|
+
export declare const GetLedgerAllocationShareDocument: DocumentNode<GetLedgerAllocationShareQuery, GetLedgerAllocationShareQueryVariables>;
|
|
3036
|
+
export declare const ListLedgerAllocationOverridesDocument: DocumentNode<ListLedgerAllocationOverridesQuery, ListLedgerAllocationOverridesQueryVariables>;
|
|
2895
3037
|
export declare const ListLedgerBankAccountsDocument: DocumentNode<ListLedgerBankAccountsQuery, ListLedgerBankAccountsQueryVariables>;
|
|
2896
3038
|
export declare const ListLedgerBlockedSourceGraphsDocument: DocumentNode<ListLedgerBlockedSourceGraphsQuery, ListLedgerBlockedSourceGraphsQueryVariables>;
|
|
2897
3039
|
export declare const ListChartTemplatesDocument: DocumentNode<ListChartTemplatesQuery, ListChartTemplatesQueryVariables>;
|
|
@@ -2903,6 +3045,8 @@ export declare const ListLedgerEntitiesDocument: DocumentNode<ListLedgerEntities
|
|
|
2903
3045
|
export declare const GetLedgerEntityDocument: DocumentNode<GetLedgerEntityQuery, GetLedgerEntityQueryVariables>;
|
|
2904
3046
|
export declare const GetLedgerEventBlockDocument: DocumentNode<GetLedgerEventBlockQuery, GetLedgerEventBlockQueryVariables>;
|
|
2905
3047
|
export declare const ListLedgerEventBlocksDocument: DocumentNode<ListLedgerEventBlocksQuery, ListLedgerEventBlocksQueryVariables>;
|
|
3048
|
+
export declare const ListLedgerEventHandlersDocument: DocumentNode<ListLedgerEventHandlersQuery, ListLedgerEventHandlersQueryVariables>;
|
|
3049
|
+
export declare const GetLedgerEventHandlerDocument: DocumentNode<GetLedgerEventHandlerQuery, GetLedgerEventHandlerQueryVariables>;
|
|
2906
3050
|
export declare const GetLedgerFiscalCalendarDocument: DocumentNode<GetLedgerFiscalCalendarQuery, GetLedgerFiscalCalendarQueryVariables>;
|
|
2907
3051
|
export declare const FlowCandidatesDocument: DocumentNode<FlowCandidatesQuery, FlowCandidatesQueryVariables>;
|
|
2908
3052
|
export declare const GetInformationBlockDocument: DocumentNode<GetInformationBlockQuery, GetInformationBlockQueryVariables>;
|