@robosystems/client 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/InvestorClient.js +7 -7
- package/artifacts/InvestorClient.ts +13 -13
- package/artifacts/LedgerClient.d.ts +2 -2
- package/artifacts/LedgerClient.js +48 -48
- package/artifacts/LedgerClient.ts +91 -91
- package/client/client.gen.js +109 -126
- package/client/client.gen.ts +129 -139
- package/client/types.gen.d.ts +7 -4
- package/client/types.gen.ts +10 -5
- package/client/utils.gen.d.ts +7 -3
- package/client/utils.gen.js +6 -6
- package/client/utils.gen.ts +11 -11
- package/core/bodySerializer.gen.d.ts +4 -4
- package/core/bodySerializer.gen.ts +6 -8
- package/core/params.gen.js +5 -5
- package/core/params.gen.ts +5 -5
- package/core/serverSentEvents.gen.d.ts +1 -1
- package/core/serverSentEvents.gen.js +4 -6
- package/core/serverSentEvents.gen.ts +4 -5
- package/core/types.gen.d.ts +1 -1
- package/core/types.gen.ts +1 -1
- package/core/utils.gen.js +1 -1
- package/core/utils.gen.ts +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/sdk/client/client.gen.js +109 -126
- package/sdk/client/client.gen.ts +129 -139
- package/sdk/client/types.gen.d.ts +7 -4
- package/sdk/client/types.gen.ts +10 -5
- package/sdk/client/utils.gen.d.ts +7 -3
- package/sdk/client/utils.gen.js +6 -6
- package/sdk/client/utils.gen.ts +11 -11
- package/sdk/core/bodySerializer.gen.d.ts +4 -4
- package/sdk/core/bodySerializer.gen.ts +6 -8
- package/sdk/core/params.gen.js +5 -5
- package/sdk/core/params.gen.ts +5 -5
- package/sdk/core/serverSentEvents.gen.d.ts +1 -1
- package/sdk/core/serverSentEvents.gen.js +4 -6
- package/sdk/core/serverSentEvents.gen.ts +4 -5
- package/sdk/core/types.gen.d.ts +1 -1
- package/sdk/core/types.gen.ts +1 -1
- package/sdk/core/utils.gen.js +1 -1
- package/sdk/core/utils.gen.ts +1 -1
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +68 -68
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +80 -80
- package/sdk/sdk.gen.js +154 -154
- package/sdk/sdk.gen.ts +89 -89
- package/sdk/types.gen.d.ts +374 -385
- package/sdk/types.gen.ts +379 -390
- package/sdk.gen.d.ts +80 -80
- package/sdk.gen.js +154 -154
- package/sdk.gen.ts +89 -89
- package/types.gen.d.ts +374 -385
- package/types.gen.ts +379 -390
|
@@ -34,7 +34,7 @@ class InvestorClient {
|
|
|
34
34
|
* securities — use `createSecurity` first.
|
|
35
35
|
*/
|
|
36
36
|
async createPortfolioBlock(graphId, body) {
|
|
37
|
-
const envelope = await this.callOperation('Create portfolio block', (0, sdk_gen_1.
|
|
37
|
+
const envelope = await this.callOperation('Create portfolio block', (0, sdk_gen_1.createPortfolioBlock)({ path: { graph_id: graphId }, body }));
|
|
38
38
|
return rawToPortfolioBlock(envelope.result);
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -48,7 +48,7 @@ class InvestorClient {
|
|
|
48
48
|
portfolio_id: portfolioId,
|
|
49
49
|
...updates,
|
|
50
50
|
};
|
|
51
|
-
const envelope = await this.callOperation('Update portfolio block', (0, sdk_gen_1.
|
|
51
|
+
const envelope = await this.callOperation('Update portfolio block', (0, sdk_gen_1.updatePortfolioBlock)({ path: { graph_id: graphId }, body }));
|
|
52
52
|
return rawToPortfolioBlock(envelope.result);
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -62,7 +62,7 @@ class InvestorClient {
|
|
|
62
62
|
portfolio_id: portfolioId,
|
|
63
63
|
confirm_active_positions: options?.confirmActivePositions ?? false,
|
|
64
64
|
};
|
|
65
|
-
const envelope = await this.callOperation('Delete portfolio block', (0, sdk_gen_1.
|
|
65
|
+
const envelope = await this.callOperation('Delete portfolio block', (0, sdk_gen_1.deletePortfolioBlock)({ path: { graph_id: graphId }, body }));
|
|
66
66
|
return envelope.result ?? { deleted: true };
|
|
67
67
|
}
|
|
68
68
|
// ── Securities ──────────────────────────────────────────────────────
|
|
@@ -85,12 +85,12 @@ class InvestorClient {
|
|
|
85
85
|
* matching entity in the target graph.
|
|
86
86
|
*/
|
|
87
87
|
async createSecurity(graphId, body) {
|
|
88
|
-
const envelope = await this.callOperation('Create security', (0, sdk_gen_1.
|
|
88
|
+
const envelope = await this.callOperation('Create security', (0, sdk_gen_1.createSecurity)({ path: { graph_id: graphId }, body }));
|
|
89
89
|
return rawToInvestorSecurity(envelope.result);
|
|
90
90
|
}
|
|
91
91
|
/** Update a security's metadata. Only provided fields are applied. */
|
|
92
92
|
async updateSecurity(graphId, securityId, updates) {
|
|
93
|
-
const envelope = await this.callOperation('Update security', (0, sdk_gen_1.
|
|
93
|
+
const envelope = await this.callOperation('Update security', (0, sdk_gen_1.updateSecurity)({
|
|
94
94
|
path: { graph_id: graphId },
|
|
95
95
|
body: {
|
|
96
96
|
...updates,
|
|
@@ -101,7 +101,7 @@ class InvestorClient {
|
|
|
101
101
|
}
|
|
102
102
|
/** Soft-delete a security (sets is_active=false). */
|
|
103
103
|
async deleteSecurity(graphId, securityId) {
|
|
104
|
-
const envelope = await this.callOperation('Delete security', (0, sdk_gen_1.
|
|
104
|
+
const envelope = await this.callOperation('Delete security', (0, sdk_gen_1.deleteSecurity)({
|
|
105
105
|
path: { graph_id: graphId },
|
|
106
106
|
body: { security_id: securityId },
|
|
107
107
|
}));
|
|
@@ -147,7 +147,7 @@ class InvestorClient {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
// Generic over the SDK call's response shape so typed ops (e.g.
|
|
150
|
-
// `
|
|
150
|
+
// `createPortfolioBlock`, which returns
|
|
151
151
|
// `OperationEnvelopePortfolioBlockEnvelope`) flow through with a typed
|
|
152
152
|
// `envelope.result` instead of being widened to `unknown`. Untyped ops
|
|
153
153
|
// continue to land as `OperationEnvelope` automatically.
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
import type { TypedDocumentNode } from '@graphql-typed-document-node/core'
|
|
26
26
|
import { ClientError } from 'graphql-request'
|
|
27
27
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
createPortfolioBlock,
|
|
29
|
+
createSecurity,
|
|
30
|
+
deletePortfolioBlock,
|
|
31
|
+
deleteSecurity,
|
|
32
|
+
updatePortfolioBlock,
|
|
33
|
+
updateSecurity,
|
|
34
34
|
} from '../sdk.gen'
|
|
35
35
|
import type {
|
|
36
36
|
CreatePortfolioBlockRequest,
|
|
@@ -156,7 +156,7 @@ export class InvestorClient {
|
|
|
156
156
|
): Promise<InvestorPortfolioBlock> {
|
|
157
157
|
const envelope = await this.callOperation(
|
|
158
158
|
'Create portfolio block',
|
|
159
|
-
|
|
159
|
+
createPortfolioBlock({ path: { graph_id: graphId }, body })
|
|
160
160
|
)
|
|
161
161
|
return rawToPortfolioBlock(envelope.result as unknown as RawPortfolioBlockResponse)
|
|
162
162
|
}
|
|
@@ -181,7 +181,7 @@ export class InvestorClient {
|
|
|
181
181
|
}
|
|
182
182
|
const envelope = await this.callOperation(
|
|
183
183
|
'Update portfolio block',
|
|
184
|
-
|
|
184
|
+
updatePortfolioBlock({ path: { graph_id: graphId }, body })
|
|
185
185
|
)
|
|
186
186
|
return rawToPortfolioBlock(envelope.result as unknown as RawPortfolioBlockResponse)
|
|
187
187
|
}
|
|
@@ -203,7 +203,7 @@ export class InvestorClient {
|
|
|
203
203
|
}
|
|
204
204
|
const envelope = await this.callOperation(
|
|
205
205
|
'Delete portfolio block',
|
|
206
|
-
|
|
206
|
+
deletePortfolioBlock({ path: { graph_id: graphId }, body })
|
|
207
207
|
)
|
|
208
208
|
return envelope.result ?? { deleted: true }
|
|
209
209
|
}
|
|
@@ -254,7 +254,7 @@ export class InvestorClient {
|
|
|
254
254
|
async createSecurity(graphId: string, body: CreateSecurityRequest): Promise<InvestorSecurity> {
|
|
255
255
|
const envelope = await this.callOperation(
|
|
256
256
|
'Create security',
|
|
257
|
-
|
|
257
|
+
createSecurity({ path: { graph_id: graphId }, body })
|
|
258
258
|
)
|
|
259
259
|
return rawToInvestorSecurity(envelope.result as unknown as RawSecurityResponse)
|
|
260
260
|
}
|
|
@@ -267,7 +267,7 @@ export class InvestorClient {
|
|
|
267
267
|
): Promise<InvestorSecurity> {
|
|
268
268
|
const envelope = await this.callOperation(
|
|
269
269
|
'Update security',
|
|
270
|
-
|
|
270
|
+
updateSecurity({
|
|
271
271
|
path: { graph_id: graphId },
|
|
272
272
|
body: {
|
|
273
273
|
...updates,
|
|
@@ -282,7 +282,7 @@ export class InvestorClient {
|
|
|
282
282
|
async deleteSecurity(graphId: string, securityId: string): Promise<{ deleted: boolean }> {
|
|
283
283
|
const envelope = await this.callOperation(
|
|
284
284
|
'Delete security',
|
|
285
|
-
|
|
285
|
+
deleteSecurity({
|
|
286
286
|
path: { graph_id: graphId },
|
|
287
287
|
body: { security_id: securityId },
|
|
288
288
|
})
|
|
@@ -370,7 +370,7 @@ export class InvestorClient {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
// Generic over the SDK call's response shape so typed ops (e.g.
|
|
373
|
-
// `
|
|
373
|
+
// `createPortfolioBlock`, which returns
|
|
374
374
|
// `OperationEnvelopePortfolioBlockEnvelope`) flow through with a typed
|
|
375
375
|
// `envelope.result` instead of being widened to `unknown`. Untyped ops
|
|
376
376
|
// continue to land as `OperationEnvelope` automatically.
|
|
@@ -666,11 +666,11 @@ export declare class LedgerClient {
|
|
|
666
666
|
/** Remove a single member from a publish list. */
|
|
667
667
|
removePublishListMember(graphId: string, listId: string, memberId: string): Promise<DeleteResult>;
|
|
668
668
|
/**
|
|
669
|
-
* Await an SDK-generated
|
|
669
|
+
* Await an SDK-generated command call, throw a readable error on
|
|
670
670
|
* non-2xx, and return the parsed envelope on success.
|
|
671
671
|
*
|
|
672
672
|
* Generic over the SDK call's response shape so typed ops (e.g.
|
|
673
|
-
* `
|
|
673
|
+
* `createEventBlock`, which returns
|
|
674
674
|
* `OperationEnvelopeEventBlockEnvelope`) flow through with a typed
|
|
675
675
|
* `envelope.result` instead of being widened to `unknown`. Untyped
|
|
676
676
|
* ops continue to land as `OperationEnvelope` automatically.
|
|
@@ -28,7 +28,7 @@ class LedgerClient {
|
|
|
28
28
|
* Returns the updated entity.
|
|
29
29
|
*/
|
|
30
30
|
async updateEntity(graphId, updates) {
|
|
31
|
-
const envelope = await this.callOperation('Update entity', (0, sdk_gen_1.
|
|
31
|
+
const envelope = await this.callOperation('Update entity', (0, sdk_gen_1.updateEntity)({
|
|
32
32
|
path: { graph_id: graphId },
|
|
33
33
|
body: updates,
|
|
34
34
|
}));
|
|
@@ -149,7 +149,7 @@ class LedgerClient {
|
|
|
149
149
|
* Idempotent — returns existing linkage if already present.
|
|
150
150
|
*/
|
|
151
151
|
async linkEntityTaxonomy(graphId, body) {
|
|
152
|
-
const envelope = await this.callOperation('Link entity taxonomy', (0, sdk_gen_1.
|
|
152
|
+
const envelope = await this.callOperation('Link entity taxonomy', (0, sdk_gen_1.linkEntityTaxonomy)({ path: { graph_id: graphId }, body }));
|
|
153
153
|
return this.requireResult('Link entity taxonomy', envelope.result);
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
@@ -158,17 +158,17 @@ class LedgerClient {
|
|
|
158
158
|
*/
|
|
159
159
|
async createTaxonomyBlock(graphId, body, idempotencyKey) {
|
|
160
160
|
const headers = idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : undefined;
|
|
161
|
-
const envelope = await this.callOperation('Create taxonomy block', (0, sdk_gen_1.
|
|
161
|
+
const envelope = await this.callOperation('Create taxonomy block', (0, sdk_gen_1.createTaxonomyBlock)({ path: { graph_id: graphId }, body, headers }));
|
|
162
162
|
return this.requireResult('Create taxonomy block', envelope.result);
|
|
163
163
|
}
|
|
164
164
|
/** Update a taxonomy block — add/update/remove elements, structures, associations, or rules. */
|
|
165
165
|
async updateTaxonomyBlock(graphId, body) {
|
|
166
|
-
const envelope = await this.callOperation('Update taxonomy block', (0, sdk_gen_1.
|
|
166
|
+
const envelope = await this.callOperation('Update taxonomy block', (0, sdk_gen_1.updateTaxonomyBlock)({ path: { graph_id: graphId }, body }));
|
|
167
167
|
return this.requireResult('Update taxonomy block', envelope.result);
|
|
168
168
|
}
|
|
169
169
|
/** Delete a taxonomy block. Cascades through elements, structures, and associations. */
|
|
170
170
|
async deleteTaxonomyBlock(graphId, body) {
|
|
171
|
-
const envelope = await this.callOperation('Delete taxonomy block', (0, sdk_gen_1.
|
|
171
|
+
const envelope = await this.callOperation('Delete taxonomy block', (0, sdk_gen_1.deleteTaxonomyBlock)({ path: { graph_id: graphId }, body }));
|
|
172
172
|
return (envelope.result ?? { deleted: true });
|
|
173
173
|
}
|
|
174
174
|
/** List elements (CoA accounts, GAAP concepts, etc.) with filters. */
|
|
@@ -221,12 +221,12 @@ class LedgerClient {
|
|
|
221
221
|
}
|
|
222
222
|
/** Create a manual mapping association between two elements. */
|
|
223
223
|
async createMappingAssociation(graphId, body) {
|
|
224
|
-
const envelope = await this.callOperation('Create mapping association', (0, sdk_gen_1.
|
|
224
|
+
const envelope = await this.callOperation('Create mapping association', (0, sdk_gen_1.createMappingAssociation)({ path: { graph_id: graphId }, body }));
|
|
225
225
|
return this.requireResult('Create mapping association', envelope.result);
|
|
226
226
|
}
|
|
227
227
|
/** Delete a mapping association. */
|
|
228
228
|
async deleteMappingAssociation(graphId, body) {
|
|
229
|
-
const envelope = await this.callOperation('Delete mapping association', (0, sdk_gen_1.
|
|
229
|
+
const envelope = await this.callOperation('Delete mapping association', (0, sdk_gen_1.deleteMappingAssociation)({ path: { graph_id: graphId }, body }));
|
|
230
230
|
return (envelope.result ?? { deleted: true });
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
@@ -235,7 +235,7 @@ class LedgerClient {
|
|
|
235
235
|
* via `/v1/operations/{operationId}/stream`.
|
|
236
236
|
*/
|
|
237
237
|
async autoMapElements(graphId, body) {
|
|
238
|
-
const envelope = await this.callOperation('Auto-map elements', (0, sdk_gen_1.
|
|
238
|
+
const envelope = await this.callOperation('Auto-map elements', (0, sdk_gen_1.autoMapElements)({ path: { graph_id: graphId }, body }));
|
|
239
239
|
return { operationId: envelope.operationId, status: envelope.status };
|
|
240
240
|
}
|
|
241
241
|
// ── Information Blocks ─────────────────────────────────────────────
|
|
@@ -275,7 +275,7 @@ class LedgerClient {
|
|
|
275
275
|
* generic entry.
|
|
276
276
|
*/
|
|
277
277
|
async createInformationBlock(graphId, body, options) {
|
|
278
|
-
const envelope = await this.callOperation('Create information block', (0, sdk_gen_1.
|
|
278
|
+
const envelope = await this.callOperation('Create information block', (0, sdk_gen_1.createInformationBlock)({
|
|
279
279
|
path: { graph_id: graphId },
|
|
280
280
|
body,
|
|
281
281
|
headers: options?.idempotencyKey
|
|
@@ -289,7 +289,7 @@ class LedgerClient {
|
|
|
289
289
|
* `update-information-block`.
|
|
290
290
|
*/
|
|
291
291
|
async updateInformationBlock(graphId, body) {
|
|
292
|
-
const envelope = await this.callOperation('Update information block', (0, sdk_gen_1.
|
|
292
|
+
const envelope = await this.callOperation('Update information block', (0, sdk_gen_1.updateInformationBlock)({ path: { graph_id: graphId }, body }));
|
|
293
293
|
return this.requireResult('Update information block', envelope.result);
|
|
294
294
|
}
|
|
295
295
|
/**
|
|
@@ -298,7 +298,7 @@ class LedgerClient {
|
|
|
298
298
|
* associations tied to the block.
|
|
299
299
|
*/
|
|
300
300
|
async deleteInformationBlock(graphId, body) {
|
|
301
|
-
const envelope = await this.callOperation('Delete information block', (0, sdk_gen_1.
|
|
301
|
+
const envelope = await this.callOperation('Delete information block', (0, sdk_gen_1.deleteInformationBlock)({ path: { graph_id: graphId }, body }));
|
|
302
302
|
return (envelope.result ?? { deleted: true });
|
|
303
303
|
}
|
|
304
304
|
async createSchedule(graphId, options) {
|
|
@@ -328,7 +328,7 @@ class LedgerClient {
|
|
|
328
328
|
: undefined,
|
|
329
329
|
},
|
|
330
330
|
};
|
|
331
|
-
const envelope = await this.callOperation('Create schedule', (0, sdk_gen_1.
|
|
331
|
+
const envelope = await this.callOperation('Create schedule', (0, sdk_gen_1.createInformationBlock)({ path: { graph_id: graphId }, body }));
|
|
332
332
|
const raw = envelope.result;
|
|
333
333
|
return {
|
|
334
334
|
structureId: raw.structure_id,
|
|
@@ -345,7 +345,7 @@ class LedgerClient {
|
|
|
345
345
|
block_type: 'schedule',
|
|
346
346
|
payload: { structure_id: structureId, ...options },
|
|
347
347
|
};
|
|
348
|
-
const envelope = await this.callOperation('Update schedule', (0, sdk_gen_1.
|
|
348
|
+
const envelope = await this.callOperation('Update schedule', (0, sdk_gen_1.updateInformationBlock)({ path: { graph_id: graphId }, body }));
|
|
349
349
|
return this.requireResult('Update schedule', envelope.result);
|
|
350
350
|
}
|
|
351
351
|
/** Permanently delete a schedule (cascades through facts + associations). */
|
|
@@ -354,7 +354,7 @@ class LedgerClient {
|
|
|
354
354
|
block_type: 'schedule',
|
|
355
355
|
payload: { structure_id: structureId },
|
|
356
356
|
};
|
|
357
|
-
const envelope = await this.callOperation('Delete schedule', (0, sdk_gen_1.
|
|
357
|
+
const envelope = await this.callOperation('Delete schedule', (0, sdk_gen_1.deleteInformationBlock)({ path: { graph_id: graphId }, body }));
|
|
358
358
|
return (envelope.result ?? { deleted: true });
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
@@ -372,7 +372,7 @@ class LedgerClient {
|
|
|
372
372
|
*/
|
|
373
373
|
async rebuildSchedule(graphId, structureId, options) {
|
|
374
374
|
const body = { structure_id: structureId };
|
|
375
|
-
const envelope = await this.callOperation('Rebuild schedule', (0, sdk_gen_1.
|
|
375
|
+
const envelope = await this.callOperation('Rebuild schedule', (0, sdk_gen_1.rebuildSchedule)({
|
|
376
376
|
path: { graph_id: graphId },
|
|
377
377
|
body,
|
|
378
378
|
headers: options?.idempotencyKey
|
|
@@ -414,12 +414,12 @@ class LedgerClient {
|
|
|
414
414
|
reason: options.reason ?? 'asset_disposed_event',
|
|
415
415
|
},
|
|
416
416
|
};
|
|
417
|
-
const envelope = await this.callOperation('Dispose schedule', (0, sdk_gen_1.
|
|
417
|
+
const envelope = await this.callOperation('Dispose schedule', (0, sdk_gen_1.createEventBlock)({ path: { graph_id: graphId }, body }));
|
|
418
418
|
return this.requireResult('Dispose schedule', envelope.result);
|
|
419
419
|
}
|
|
420
420
|
/** Evaluate taxonomy rules against facts in a structure. */
|
|
421
421
|
async evaluateRules(graphId, body) {
|
|
422
|
-
const envelope = await this.callOperation('Evaluate rules', (0, sdk_gen_1.
|
|
422
|
+
const envelope = await this.callOperation('Evaluate rules', (0, sdk_gen_1.evaluateRules)({ path: { graph_id: graphId }, body }));
|
|
423
423
|
return this.requireResult('Evaluate rules', envelope.result);
|
|
424
424
|
}
|
|
425
425
|
// ── Period close ────────────────────────────────────────────────────
|
|
@@ -456,7 +456,7 @@ class LedgerClient {
|
|
|
456
456
|
memo: memo ?? null,
|
|
457
457
|
},
|
|
458
458
|
};
|
|
459
|
-
const envelope = await this.callOperation('Create closing entry', (0, sdk_gen_1.
|
|
459
|
+
const envelope = await this.callOperation('Create closing entry', (0, sdk_gen_1.createEventBlock)({ path: { graph_id: graphId }, body }));
|
|
460
460
|
return this.requireResult('Create closing entry', envelope.result);
|
|
461
461
|
}
|
|
462
462
|
// ── Closing book ───────────────────────────────────────────────────
|
|
@@ -478,7 +478,7 @@ class LedgerClient {
|
|
|
478
478
|
auto_seed_schedules: options?.autoSeedSchedules,
|
|
479
479
|
note: options?.note ?? null,
|
|
480
480
|
};
|
|
481
|
-
const envelope = await this.callOperation('Initialize ledger', (0, sdk_gen_1.
|
|
481
|
+
const envelope = await this.callOperation('Initialize ledger', (0, sdk_gen_1.initializeLedger)({ path: { graph_id: graphId }, body }));
|
|
482
482
|
const raw = envelope.result;
|
|
483
483
|
return {
|
|
484
484
|
fiscalCalendar: rawFiscalCalendarToCamel(raw.fiscal_calendar),
|
|
@@ -489,7 +489,7 @@ class LedgerClient {
|
|
|
489
489
|
/** Set the user-controlled close target (YYYY-MM). */
|
|
490
490
|
async setCloseTarget(graphId, period, note) {
|
|
491
491
|
const body = { period, note: note ?? null };
|
|
492
|
-
const envelope = await this.callOperation('Set close target', (0, sdk_gen_1.
|
|
492
|
+
const envelope = await this.callOperation('Set close target', (0, sdk_gen_1.setCloseTarget)({ path: { graph_id: graphId }, body }));
|
|
493
493
|
return rawFiscalCalendarToCamel(envelope.result);
|
|
494
494
|
}
|
|
495
495
|
/** Close a fiscal period — the final commit action. */
|
|
@@ -499,7 +499,7 @@ class LedgerClient {
|
|
|
499
499
|
note: options?.note ?? null,
|
|
500
500
|
allow_stale_sync: options?.allowStaleSync,
|
|
501
501
|
};
|
|
502
|
-
const envelope = await this.callOperation('Close period', (0, sdk_gen_1.
|
|
502
|
+
const envelope = await this.callOperation('Close period', (0, sdk_gen_1.closePeriod)({ path: { graph_id: graphId }, body }));
|
|
503
503
|
const raw = envelope.result;
|
|
504
504
|
return {
|
|
505
505
|
period: raw.period,
|
|
@@ -517,7 +517,7 @@ class LedgerClient {
|
|
|
517
517
|
reason,
|
|
518
518
|
note: note ?? null,
|
|
519
519
|
};
|
|
520
|
-
const envelope = await this.callOperation('Reopen period', (0, sdk_gen_1.
|
|
520
|
+
const envelope = await this.callOperation('Reopen period', (0, sdk_gen_1.reopenPeriod)({ path: { graph_id: graphId }, body }));
|
|
521
521
|
return rawFiscalCalendarToCamel(envelope.result);
|
|
522
522
|
}
|
|
523
523
|
// ── Journal entries (native accounting writes) ──────────────────────
|
|
@@ -560,18 +560,18 @@ class LedgerClient {
|
|
|
560
560
|
const headers = options.idempotencyKey
|
|
561
561
|
? { 'Idempotency-Key': options.idempotencyKey }
|
|
562
562
|
: undefined;
|
|
563
|
-
const envelope = await this.callOperation('Create journal entry', (0, sdk_gen_1.
|
|
563
|
+
const envelope = await this.callOperation('Create journal entry', (0, sdk_gen_1.createEventBlock)({ path: { graph_id: graphId }, body, headers }));
|
|
564
564
|
return this.requireResult('Create journal entry', envelope.result);
|
|
565
565
|
}
|
|
566
566
|
/** Update a draft journal entry. Posted entries are immutable. */
|
|
567
567
|
async updateJournalEntry(graphId, body) {
|
|
568
|
-
const envelope = await this.callOperation('Update journal entry', (0, sdk_gen_1.
|
|
568
|
+
const envelope = await this.callOperation('Update journal entry', (0, sdk_gen_1.updateJournalEntry)({ path: { graph_id: graphId }, body }));
|
|
569
569
|
return this.requireResult('Update journal entry', envelope.result);
|
|
570
570
|
}
|
|
571
571
|
/** Hard-delete a draft journal entry. Posted entries must be reversed. */
|
|
572
572
|
async deleteJournalEntry(graphId, entryId) {
|
|
573
573
|
const body = { entry_id: entryId };
|
|
574
|
-
const envelope = await this.callOperation('Delete journal entry', (0, sdk_gen_1.
|
|
574
|
+
const envelope = await this.callOperation('Delete journal entry', (0, sdk_gen_1.deleteJournalEntry)({ path: { graph_id: graphId }, body }));
|
|
575
575
|
return (envelope.result ?? { deleted: true });
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
@@ -597,7 +597,7 @@ class LedgerClient {
|
|
|
597
597
|
reason: options?.reason ?? null,
|
|
598
598
|
},
|
|
599
599
|
};
|
|
600
|
-
const envelope = await this.callOperation('Reverse journal entry', (0, sdk_gen_1.
|
|
600
|
+
const envelope = await this.callOperation('Reverse journal entry', (0, sdk_gen_1.createEventBlock)({ path: { graph_id: graphId }, body }));
|
|
601
601
|
return this.requireResult('Reverse journal entry', envelope.result);
|
|
602
602
|
}
|
|
603
603
|
// ── Event blocks (generic preview + status transitions) ──────────────
|
|
@@ -610,7 +610,7 @@ class LedgerClient {
|
|
|
610
610
|
* handler would do.
|
|
611
611
|
*/
|
|
612
612
|
async previewEventBlock(graphId, body) {
|
|
613
|
-
const envelope = await this.callOperation('Preview event block', (0, sdk_gen_1.
|
|
613
|
+
const envelope = await this.callOperation('Preview event block', (0, sdk_gen_1.previewEventBlock)({ path: { graph_id: graphId }, body }));
|
|
614
614
|
return this.requireResult('Preview event block', envelope.result);
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
@@ -620,7 +620,7 @@ class LedgerClient {
|
|
|
620
620
|
* `description` / `effective_at` / `metadata`.
|
|
621
621
|
*/
|
|
622
622
|
async updateEventBlock(graphId, body) {
|
|
623
|
-
const envelope = await this.callOperation('Update event block', (0, sdk_gen_1.
|
|
623
|
+
const envelope = await this.callOperation('Update event block', (0, sdk_gen_1.updateEventBlock)({ path: { graph_id: graphId }, body }));
|
|
624
624
|
return this.requireResult('Update event block', envelope.result);
|
|
625
625
|
}
|
|
626
626
|
// ── Agents (REA counterparties) ───────────────────────────────────────
|
|
@@ -632,7 +632,7 @@ class LedgerClient {
|
|
|
632
632
|
*/
|
|
633
633
|
async createAgent(graphId, body, idempotencyKey) {
|
|
634
634
|
const headers = idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : undefined;
|
|
635
|
-
const envelope = await this.callOperation('Create agent', (0, sdk_gen_1.
|
|
635
|
+
const envelope = await this.callOperation('Create agent', (0, sdk_gen_1.createAgent)({ path: { graph_id: graphId }, body, headers }));
|
|
636
636
|
return this.requireResult('Create agent', envelope.result);
|
|
637
637
|
}
|
|
638
638
|
/**
|
|
@@ -640,7 +640,7 @@ class LedgerClient {
|
|
|
640
640
|
* metadata object; all other fields replace.
|
|
641
641
|
*/
|
|
642
642
|
async updateAgent(graphId, body) {
|
|
643
|
-
const envelope = await this.callOperation('Update agent', (0, sdk_gen_1.
|
|
643
|
+
const envelope = await this.callOperation('Update agent', (0, sdk_gen_1.updateAgent)({ path: { graph_id: graphId }, body }));
|
|
644
644
|
return this.requireResult('Update agent', envelope.result);
|
|
645
645
|
}
|
|
646
646
|
// ── Event handlers (DSL handler registry) ────────────────────────────
|
|
@@ -651,7 +651,7 @@ class LedgerClient {
|
|
|
651
651
|
* `transaction_template` describing the GL rows to produce.
|
|
652
652
|
*/
|
|
653
653
|
async createEventHandler(graphId, body) {
|
|
654
|
-
const envelope = await this.callOperation('Create event handler', (0, sdk_gen_1.
|
|
654
|
+
const envelope = await this.callOperation('Create event handler', (0, sdk_gen_1.createEventHandler)({ path: { graph_id: graphId }, body }));
|
|
655
655
|
return this.requireResult('Create event handler', envelope.result);
|
|
656
656
|
}
|
|
657
657
|
/**
|
|
@@ -659,7 +659,7 @@ class LedgerClient {
|
|
|
659
659
|
* AI-suggested handler from unapproved to active.
|
|
660
660
|
*/
|
|
661
661
|
async updateEventHandler(graphId, body) {
|
|
662
|
-
const envelope = await this.callOperation('Update event handler', (0, sdk_gen_1.
|
|
662
|
+
const envelope = await this.callOperation('Update event handler', (0, sdk_gen_1.updateEventHandler)({ path: { graph_id: graphId }, body }));
|
|
663
663
|
return this.requireResult('Update event handler', envelope.result);
|
|
664
664
|
}
|
|
665
665
|
// ── Financial statements (graph-backed) ──────────────────────────────
|
|
@@ -670,7 +670,7 @@ class LedgerClient {
|
|
|
670
670
|
* dashboards.
|
|
671
671
|
*/
|
|
672
672
|
async liveFinancialStatement(graphId, body) {
|
|
673
|
-
const envelope = await this.callOperation('Live financial statement', (0, sdk_gen_1.
|
|
673
|
+
const envelope = await this.callOperation('Live financial statement', (0, sdk_gen_1.liveFinancialStatement)({ path: { graph_id: graphId }, body }));
|
|
674
674
|
return (envelope.result ?? {});
|
|
675
675
|
}
|
|
676
676
|
/**
|
|
@@ -680,7 +680,7 @@ class LedgerClient {
|
|
|
680
680
|
* server auto-resolve via `fiscal_year` + `period_type`.
|
|
681
681
|
*/
|
|
682
682
|
async financialStatementAnalysis(graphId, body) {
|
|
683
|
-
const envelope = await this.callOperation('Financial statement analysis', (0, sdk_gen_1.
|
|
683
|
+
const envelope = await this.callOperation('Financial statement analysis', (0, sdk_gen_1.financialStatementAnalysis)({ path: { graph_id: graphId }, body }));
|
|
684
684
|
return (envelope.result ?? {});
|
|
685
685
|
}
|
|
686
686
|
// ── Fact grid (graph-backed analytical query) ─────────────────────
|
|
@@ -692,7 +692,7 @@ class LedgerClient {
|
|
|
692
692
|
* tenant graphs (after materialization) and the SEC shared repository.
|
|
693
693
|
*/
|
|
694
694
|
async buildFactGrid(graphId, body) {
|
|
695
|
-
const envelope = await this.callOperation('Build fact grid', (0, sdk_gen_1.
|
|
695
|
+
const envelope = await this.callOperation('Build fact grid', (0, sdk_gen_1.buildFactGrid)({ path: { graph_id: graphId }, body }));
|
|
696
696
|
return (envelope.result ?? {});
|
|
697
697
|
}
|
|
698
698
|
// ── Reports, statements, and publish lists ──────────────────────────────
|
|
@@ -736,7 +736,7 @@ class LedgerClient {
|
|
|
736
736
|
if (options.periods && options.periods.length > 0) {
|
|
737
737
|
body.periods = options.periods;
|
|
738
738
|
}
|
|
739
|
-
const envelope = await this.callOperation('Create report', (0, sdk_gen_1.
|
|
739
|
+
const envelope = await this.callOperation('Create report', (0, sdk_gen_1.createReport)({ path: { graph_id: graphId }, body }));
|
|
740
740
|
return {
|
|
741
741
|
operationId: envelope.operationId,
|
|
742
742
|
status: envelope.status,
|
|
@@ -774,7 +774,7 @@ class LedgerClient {
|
|
|
774
774
|
* subscribe via SSE for progress.
|
|
775
775
|
*/
|
|
776
776
|
async regenerateReport(graphId, reportId, periodStart, periodEnd) {
|
|
777
|
-
const envelope = await this.callOperation('Regenerate report', (0, sdk_gen_1.
|
|
777
|
+
const envelope = await this.callOperation('Regenerate report', (0, sdk_gen_1.regenerateReport)({
|
|
778
778
|
path: { graph_id: graphId },
|
|
779
779
|
body: {
|
|
780
780
|
report_id: reportId,
|
|
@@ -790,7 +790,7 @@ class LedgerClient {
|
|
|
790
790
|
}
|
|
791
791
|
/** Delete a report and its generated facts. */
|
|
792
792
|
async deleteReport(graphId, reportId) {
|
|
793
|
-
const envelope = await this.callOperation('Delete report', (0, sdk_gen_1.
|
|
793
|
+
const envelope = await this.callOperation('Delete report', (0, sdk_gen_1.deleteReport)({
|
|
794
794
|
path: { graph_id: graphId },
|
|
795
795
|
body: { report_id: reportId },
|
|
796
796
|
}));
|
|
@@ -842,7 +842,7 @@ class LedgerClient {
|
|
|
842
842
|
* target graph receives a snapshot copy of the report's facts.
|
|
843
843
|
*/
|
|
844
844
|
async shareReport(graphId, reportId, publishListId) {
|
|
845
|
-
const envelope = await this.callOperation('Share report', (0, sdk_gen_1.
|
|
845
|
+
const envelope = await this.callOperation('Share report', (0, sdk_gen_1.shareReport)({
|
|
846
846
|
path: { graph_id: graphId },
|
|
847
847
|
body: {
|
|
848
848
|
report_id: reportId,
|
|
@@ -862,7 +862,7 @@ class LedgerClient {
|
|
|
862
862
|
*/
|
|
863
863
|
async fileReport(graphId, reportId) {
|
|
864
864
|
const body = { report_id: reportId };
|
|
865
|
-
const envelope = await this.callOperation('File report', (0, sdk_gen_1.
|
|
865
|
+
const envelope = await this.callOperation('File report', (0, sdk_gen_1.fileReport)({ path: { graph_id: graphId }, body }));
|
|
866
866
|
return {
|
|
867
867
|
operationId: envelope.operationId,
|
|
868
868
|
status: envelope.status,
|
|
@@ -879,7 +879,7 @@ class LedgerClient {
|
|
|
879
879
|
report_id: reportId,
|
|
880
880
|
target_status: targetStatus,
|
|
881
881
|
};
|
|
882
|
-
const envelope = await this.callOperation('Transition filing status', (0, sdk_gen_1.
|
|
882
|
+
const envelope = await this.callOperation('Transition filing status', (0, sdk_gen_1.transitionFilingStatus)({ path: { graph_id: graphId }, body }));
|
|
883
883
|
return {
|
|
884
884
|
operationId: envelope.operationId,
|
|
885
885
|
status: envelope.status,
|
|
@@ -905,7 +905,7 @@ class LedgerClient {
|
|
|
905
905
|
name,
|
|
906
906
|
description: description ?? null,
|
|
907
907
|
};
|
|
908
|
-
const envelope = await this.callOperation('Create publish list', (0, sdk_gen_1.
|
|
908
|
+
const envelope = await this.callOperation('Create publish list', (0, sdk_gen_1.createPublishList)({ path: { graph_id: graphId }, body }));
|
|
909
909
|
return this.requireResult('Create publish list', envelope.result);
|
|
910
910
|
}
|
|
911
911
|
/** Get a single publish list with its full member list. */
|
|
@@ -914,7 +914,7 @@ class LedgerClient {
|
|
|
914
914
|
}
|
|
915
915
|
/** Update a publish list's name or description. */
|
|
916
916
|
async updatePublishList(graphId, listId, updates) {
|
|
917
|
-
const envelope = await this.callOperation('Update publish list', (0, sdk_gen_1.
|
|
917
|
+
const envelope = await this.callOperation('Update publish list', (0, sdk_gen_1.updatePublishList)({
|
|
918
918
|
path: { graph_id: graphId },
|
|
919
919
|
body: {
|
|
920
920
|
list_id: listId,
|
|
@@ -926,7 +926,7 @@ class LedgerClient {
|
|
|
926
926
|
}
|
|
927
927
|
/** Delete a publish list. */
|
|
928
928
|
async deletePublishList(graphId, listId) {
|
|
929
|
-
const envelope = await this.callOperation('Delete publish list', (0, sdk_gen_1.
|
|
929
|
+
const envelope = await this.callOperation('Delete publish list', (0, sdk_gen_1.deletePublishList)({
|
|
930
930
|
path: { graph_id: graphId },
|
|
931
931
|
body: { list_id: listId },
|
|
932
932
|
}));
|
|
@@ -934,7 +934,7 @@ class LedgerClient {
|
|
|
934
934
|
}
|
|
935
935
|
/** Add target graphs as members of a publish list. */
|
|
936
936
|
async addPublishListMembers(graphId, listId, targetGraphIds) {
|
|
937
|
-
const envelope = await this.callOperation('Add publish list members', (0, sdk_gen_1.
|
|
937
|
+
const envelope = await this.callOperation('Add publish list members', (0, sdk_gen_1.addPublishListMembers)({
|
|
938
938
|
path: { graph_id: graphId },
|
|
939
939
|
body: {
|
|
940
940
|
list_id: listId,
|
|
@@ -945,7 +945,7 @@ class LedgerClient {
|
|
|
945
945
|
}
|
|
946
946
|
/** Remove a single member from a publish list. */
|
|
947
947
|
async removePublishListMember(graphId, listId, memberId) {
|
|
948
|
-
const envelope = await this.callOperation('Remove publish list member', (0, sdk_gen_1.
|
|
948
|
+
const envelope = await this.callOperation('Remove publish list member', (0, sdk_gen_1.removePublishListMember)({
|
|
949
949
|
path: { graph_id: graphId },
|
|
950
950
|
body: { list_id: listId, member_id: memberId },
|
|
951
951
|
}));
|
|
@@ -953,11 +953,11 @@ class LedgerClient {
|
|
|
953
953
|
}
|
|
954
954
|
// ── Internal helpers ────────────────────────────────────────────────
|
|
955
955
|
/**
|
|
956
|
-
* Await an SDK-generated
|
|
956
|
+
* Await an SDK-generated command call, throw a readable error on
|
|
957
957
|
* non-2xx, and return the parsed envelope on success.
|
|
958
958
|
*
|
|
959
959
|
* Generic over the SDK call's response shape so typed ops (e.g.
|
|
960
|
-
* `
|
|
960
|
+
* `createEventBlock`, which returns
|
|
961
961
|
* `OperationEnvelopeEventBlockEnvelope`) flow through with a typed
|
|
962
962
|
* `envelope.result` instead of being widened to `unknown`. Untyped
|
|
963
963
|
* ops continue to land as `OperationEnvelope` automatically.
|