@robosystems/client 0.2.38 → 0.2.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions/LedgerClient.d.ts +139 -0
- package/extensions/LedgerClient.js +320 -0
- package/extensions/LedgerClient.ts +486 -0
- package/extensions/ReportClient.d.ts +109 -0
- package/extensions/ReportClient.js +182 -0
- package/extensions/ReportClient.ts +320 -0
- package/extensions/index.d.ts +9 -1
- package/extensions/index.js +25 -1
- package/extensions/index.ts +28 -0
- package/index.ts +2 -2
- package/package.json +1 -1
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +24 -3
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +138 -3
- package/sdk/sdk.gen.js +267 -3
- package/sdk/sdk.gen.ts +267 -3
- package/sdk/types.gen.d.ts +1530 -93
- package/sdk/types.gen.ts +1644 -79
- package/sdk-extensions/LedgerClient.d.ts +139 -0
- package/sdk-extensions/LedgerClient.js +320 -0
- package/sdk-extensions/LedgerClient.ts +486 -0
- package/sdk-extensions/ReportClient.d.ts +109 -0
- package/sdk-extensions/ReportClient.js +182 -0
- package/sdk-extensions/ReportClient.ts +320 -0
- package/sdk-extensions/index.d.ts +9 -1
- package/sdk-extensions/index.js +25 -1
- package/sdk-extensions/index.ts +28 -0
- package/sdk.gen.d.ts +138 -3
- package/sdk.gen.js +267 -3
- package/sdk.gen.ts +267 -3
- package/types.gen.d.ts +1530 -93
- package/types.gen.ts +1644 -79
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { AccountListResponse, AccountTreeResponse, LedgerSummaryResponse, LedgerTransactionDetailResponse, LedgerTransactionListResponse, MappingDetailResponse, TrialBalanceResponse } from '../types.gen';
|
|
2
|
+
export interface LedgerEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
legalName: string | null;
|
|
6
|
+
entityType: string | null;
|
|
7
|
+
industry: string | null;
|
|
8
|
+
status: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface MappingInfo {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
structureType: string;
|
|
15
|
+
taxonomyId: string;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface MappingCoverage {
|
|
19
|
+
totalCoaElements: number;
|
|
20
|
+
mappedCount: number;
|
|
21
|
+
unmappedCount: number;
|
|
22
|
+
coveragePercent: number;
|
|
23
|
+
highConfidence: number;
|
|
24
|
+
mediumConfidence: number;
|
|
25
|
+
lowConfidence: number;
|
|
26
|
+
}
|
|
27
|
+
export interface Structure {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
structureType: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class LedgerClient {
|
|
33
|
+
private config;
|
|
34
|
+
constructor(config: {
|
|
35
|
+
baseUrl: string;
|
|
36
|
+
credentials?: 'include' | 'same-origin' | 'omit';
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
token?: string;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Get the entity (company/organization) for this graph.
|
|
42
|
+
*/
|
|
43
|
+
getEntity(graphId: string): Promise<LedgerEntity | null>;
|
|
44
|
+
/**
|
|
45
|
+
* List accounts (flat).
|
|
46
|
+
*/
|
|
47
|
+
listAccounts(graphId: string): Promise<AccountListResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Get the account tree (hierarchical).
|
|
50
|
+
*/
|
|
51
|
+
getAccountTree(graphId: string): Promise<AccountTreeResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* List transactions with optional date filters.
|
|
54
|
+
*/
|
|
55
|
+
listTransactions(graphId: string, options?: {
|
|
56
|
+
startDate?: string;
|
|
57
|
+
endDate?: string;
|
|
58
|
+
limit?: number;
|
|
59
|
+
offset?: number;
|
|
60
|
+
}): Promise<LedgerTransactionListResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Get transaction detail with entries and line items.
|
|
63
|
+
*/
|
|
64
|
+
getTransaction(graphId: string, transactionId: string): Promise<LedgerTransactionDetailResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Get trial balance (CoA-level debits/credits).
|
|
67
|
+
*/
|
|
68
|
+
getTrialBalance(graphId: string, options?: {
|
|
69
|
+
startDate?: string;
|
|
70
|
+
endDate?: string;
|
|
71
|
+
}): Promise<TrialBalanceResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Get mapped trial balance (CoA rolled up to GAAP concepts).
|
|
74
|
+
*/
|
|
75
|
+
getMappedTrialBalance(graphId: string, options?: {
|
|
76
|
+
mappingId?: string;
|
|
77
|
+
startDate?: string;
|
|
78
|
+
endDate?: string;
|
|
79
|
+
}): Promise<unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Get ledger summary (account count, transaction count, date range).
|
|
82
|
+
*/
|
|
83
|
+
getSummary(graphId: string): Promise<LedgerSummaryResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Get the reporting taxonomy (US GAAP seed).
|
|
86
|
+
*/
|
|
87
|
+
getReportingTaxonomy(graphId: string): Promise<unknown>;
|
|
88
|
+
/**
|
|
89
|
+
* List reporting structures (IS, BS, CF) for a taxonomy.
|
|
90
|
+
*/
|
|
91
|
+
listStructures(graphId: string, taxonomyId?: string): Promise<Structure[]>;
|
|
92
|
+
/**
|
|
93
|
+
* List elements (CoA accounts, GAAP concepts, etc.).
|
|
94
|
+
*/
|
|
95
|
+
listElements(graphId: string, options?: {
|
|
96
|
+
taxonomyId?: string;
|
|
97
|
+
source?: string;
|
|
98
|
+
classification?: string;
|
|
99
|
+
isAbstract?: boolean;
|
|
100
|
+
limit?: number;
|
|
101
|
+
offset?: number;
|
|
102
|
+
}): Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* Create a new CoA→GAAP mapping structure.
|
|
105
|
+
* Returns the created mapping info.
|
|
106
|
+
*/
|
|
107
|
+
createMappingStructure(graphId: string, options?: {
|
|
108
|
+
name?: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
taxonomyId?: string;
|
|
111
|
+
}): Promise<MappingInfo>;
|
|
112
|
+
/**
|
|
113
|
+
* List available CoA→GAAP mapping structures.
|
|
114
|
+
*/
|
|
115
|
+
listMappings(graphId: string): Promise<MappingInfo[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Get mapping detail — all associations with element names.
|
|
118
|
+
*/
|
|
119
|
+
getMappingDetail(graphId: string, mappingId: string): Promise<MappingDetailResponse>;
|
|
120
|
+
/**
|
|
121
|
+
* Get mapping coverage — how many CoA elements are mapped.
|
|
122
|
+
*/
|
|
123
|
+
getMappingCoverage(graphId: string, mappingId: string): Promise<MappingCoverage>;
|
|
124
|
+
/**
|
|
125
|
+
* Create a manual mapping association (CoA element → GAAP element).
|
|
126
|
+
*/
|
|
127
|
+
createMapping(graphId: string, mappingId: string, fromElementId: string, toElementId: string, confidence?: number): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Delete a mapping association.
|
|
130
|
+
*/
|
|
131
|
+
deleteMapping(graphId: string, mappingId: string, associationId: string): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Trigger AI auto-mapping (MappingAgent).
|
|
134
|
+
* Returns immediately — the agent runs in the background.
|
|
135
|
+
*/
|
|
136
|
+
autoMap(graphId: string, mappingId: string): Promise<{
|
|
137
|
+
operationId?: string;
|
|
138
|
+
}>;
|
|
139
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LedgerClient = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Ledger Client for RoboSystems API
|
|
7
|
+
*
|
|
8
|
+
* High-level client for all ledger concerns: chart of accounts, transactions,
|
|
9
|
+
* trial balance, taxonomy, mappings, and AI auto-mapping. This is the
|
|
10
|
+
* operational backbone — reports consume these as inputs.
|
|
11
|
+
*/
|
|
12
|
+
const sdk_gen_1 = require("../sdk.gen");
|
|
13
|
+
// ── Client ──────────────────────────────────────────────────────────────
|
|
14
|
+
class LedgerClient {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
this.config = config;
|
|
17
|
+
}
|
|
18
|
+
// ── Entity ──────────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* Get the entity (company/organization) for this graph.
|
|
21
|
+
*/
|
|
22
|
+
async getEntity(graphId) {
|
|
23
|
+
const response = await (0, sdk_gen_1.getLedgerEntity)({
|
|
24
|
+
path: { graph_id: graphId },
|
|
25
|
+
});
|
|
26
|
+
if (response.response.status === 404)
|
|
27
|
+
return null;
|
|
28
|
+
if (response.error) {
|
|
29
|
+
throw new Error(`Get entity failed: ${JSON.stringify(response.error)}`);
|
|
30
|
+
}
|
|
31
|
+
const data = response.data;
|
|
32
|
+
return {
|
|
33
|
+
id: data.id,
|
|
34
|
+
name: data.name,
|
|
35
|
+
legalName: data.legal_name ?? null,
|
|
36
|
+
entityType: data.entity_type ?? null,
|
|
37
|
+
industry: data.industry ?? null,
|
|
38
|
+
status: data.status ?? null,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// ── Accounts (Chart of Accounts) ───────────────────────────────────
|
|
42
|
+
/**
|
|
43
|
+
* List accounts (flat).
|
|
44
|
+
*/
|
|
45
|
+
async listAccounts(graphId) {
|
|
46
|
+
const response = await (0, sdk_gen_1.listLedgerAccounts)({
|
|
47
|
+
path: { graph_id: graphId },
|
|
48
|
+
});
|
|
49
|
+
if (response.error) {
|
|
50
|
+
throw new Error(`List accounts failed: ${JSON.stringify(response.error)}`);
|
|
51
|
+
}
|
|
52
|
+
return response.data;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the account tree (hierarchical).
|
|
56
|
+
*/
|
|
57
|
+
async getAccountTree(graphId) {
|
|
58
|
+
const response = await (0, sdk_gen_1.getLedgerAccountTree)({
|
|
59
|
+
path: { graph_id: graphId },
|
|
60
|
+
});
|
|
61
|
+
if (response.error) {
|
|
62
|
+
throw new Error(`Get account tree failed: ${JSON.stringify(response.error)}`);
|
|
63
|
+
}
|
|
64
|
+
return response.data;
|
|
65
|
+
}
|
|
66
|
+
// ── Transactions ────────────────────────────────────────────────────
|
|
67
|
+
/**
|
|
68
|
+
* List transactions with optional date filters.
|
|
69
|
+
*/
|
|
70
|
+
async listTransactions(graphId, options) {
|
|
71
|
+
const response = await (0, sdk_gen_1.listLedgerTransactions)({
|
|
72
|
+
path: { graph_id: graphId },
|
|
73
|
+
query: {
|
|
74
|
+
start_date: options?.startDate,
|
|
75
|
+
end_date: options?.endDate,
|
|
76
|
+
limit: options?.limit,
|
|
77
|
+
offset: options?.offset,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
if (response.error) {
|
|
81
|
+
throw new Error(`List transactions failed: ${JSON.stringify(response.error)}`);
|
|
82
|
+
}
|
|
83
|
+
return response.data;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get transaction detail with entries and line items.
|
|
87
|
+
*/
|
|
88
|
+
async getTransaction(graphId, transactionId) {
|
|
89
|
+
const response = await (0, sdk_gen_1.getLedgerTransaction)({
|
|
90
|
+
path: { graph_id: graphId, transaction_id: transactionId },
|
|
91
|
+
});
|
|
92
|
+
if (response.error) {
|
|
93
|
+
throw new Error(`Get transaction failed: ${JSON.stringify(response.error)}`);
|
|
94
|
+
}
|
|
95
|
+
return response.data;
|
|
96
|
+
}
|
|
97
|
+
// ── Trial Balance ──────────────────────────────────────────────────
|
|
98
|
+
/**
|
|
99
|
+
* Get trial balance (CoA-level debits/credits).
|
|
100
|
+
*/
|
|
101
|
+
async getTrialBalance(graphId, options) {
|
|
102
|
+
const response = await (0, sdk_gen_1.getLedgerTrialBalance)({
|
|
103
|
+
path: { graph_id: graphId },
|
|
104
|
+
query: {
|
|
105
|
+
start_date: options?.startDate,
|
|
106
|
+
end_date: options?.endDate,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
if (response.error) {
|
|
110
|
+
throw new Error(`Get trial balance failed: ${JSON.stringify(response.error)}`);
|
|
111
|
+
}
|
|
112
|
+
return response.data;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get mapped trial balance (CoA rolled up to GAAP concepts).
|
|
116
|
+
*/
|
|
117
|
+
async getMappedTrialBalance(graphId, options) {
|
|
118
|
+
const response = await (0, sdk_gen_1.getMappedTrialBalance)({
|
|
119
|
+
path: { graph_id: graphId },
|
|
120
|
+
query: {
|
|
121
|
+
mapping_id: options?.mappingId,
|
|
122
|
+
start_date: options?.startDate,
|
|
123
|
+
end_date: options?.endDate,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
if (response.error) {
|
|
127
|
+
throw new Error(`Get mapped trial balance failed: ${JSON.stringify(response.error)}`);
|
|
128
|
+
}
|
|
129
|
+
return response.data;
|
|
130
|
+
}
|
|
131
|
+
// ── Summary ────────────────────────────────────────────────────────
|
|
132
|
+
/**
|
|
133
|
+
* Get ledger summary (account count, transaction count, date range).
|
|
134
|
+
*/
|
|
135
|
+
async getSummary(graphId) {
|
|
136
|
+
const response = await (0, sdk_gen_1.getLedgerSummary)({
|
|
137
|
+
path: { graph_id: graphId },
|
|
138
|
+
});
|
|
139
|
+
if (response.error) {
|
|
140
|
+
throw new Error(`Get summary failed: ${JSON.stringify(response.error)}`);
|
|
141
|
+
}
|
|
142
|
+
return response.data;
|
|
143
|
+
}
|
|
144
|
+
// ── Taxonomy ────────────────────────────────────────────────────────
|
|
145
|
+
/**
|
|
146
|
+
* Get the reporting taxonomy (US GAAP seed).
|
|
147
|
+
*/
|
|
148
|
+
async getReportingTaxonomy(graphId) {
|
|
149
|
+
const response = await (0, sdk_gen_1.getReportingTaxonomy)({
|
|
150
|
+
path: { graph_id: graphId },
|
|
151
|
+
});
|
|
152
|
+
if (response.error) {
|
|
153
|
+
throw new Error(`Get reporting taxonomy failed: ${JSON.stringify(response.error)}`);
|
|
154
|
+
}
|
|
155
|
+
return response.data;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* List reporting structures (IS, BS, CF) for a taxonomy.
|
|
159
|
+
*/
|
|
160
|
+
async listStructures(graphId, taxonomyId) {
|
|
161
|
+
const response = await (0, sdk_gen_1.listStructures)({
|
|
162
|
+
path: { graph_id: graphId },
|
|
163
|
+
query: taxonomyId ? { taxonomy_id: taxonomyId } : undefined,
|
|
164
|
+
});
|
|
165
|
+
if (response.error) {
|
|
166
|
+
throw new Error(`List structures failed: ${JSON.stringify(response.error)}`);
|
|
167
|
+
}
|
|
168
|
+
const data = response.data;
|
|
169
|
+
return (data.structures ?? []).map((s) => ({
|
|
170
|
+
id: s.id,
|
|
171
|
+
name: s.name,
|
|
172
|
+
structureType: s.structure_type,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* List elements (CoA accounts, GAAP concepts, etc.).
|
|
177
|
+
*/
|
|
178
|
+
async listElements(graphId, options) {
|
|
179
|
+
const response = await (0, sdk_gen_1.listElements)({
|
|
180
|
+
path: { graph_id: graphId },
|
|
181
|
+
query: {
|
|
182
|
+
taxonomy_id: options?.taxonomyId,
|
|
183
|
+
source: options?.source,
|
|
184
|
+
classification: options?.classification,
|
|
185
|
+
is_abstract: options?.isAbstract,
|
|
186
|
+
limit: options?.limit,
|
|
187
|
+
offset: options?.offset,
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
if (response.error) {
|
|
191
|
+
throw new Error(`List elements failed: ${JSON.stringify(response.error)}`);
|
|
192
|
+
}
|
|
193
|
+
return response.data;
|
|
194
|
+
}
|
|
195
|
+
// ── Mappings ────────────────────────────────────────────────────────
|
|
196
|
+
/**
|
|
197
|
+
* Create a new CoA→GAAP mapping structure.
|
|
198
|
+
* Returns the created mapping info.
|
|
199
|
+
*/
|
|
200
|
+
async createMappingStructure(graphId, options) {
|
|
201
|
+
const response = await (0, sdk_gen_1.createStructure)({
|
|
202
|
+
path: { graph_id: graphId },
|
|
203
|
+
body: {
|
|
204
|
+
name: options?.name ?? 'CoA to Reporting',
|
|
205
|
+
description: options?.description ?? 'Map Chart of Accounts to US GAAP reporting concepts',
|
|
206
|
+
structure_type: 'coa_mapping',
|
|
207
|
+
taxonomy_id: options?.taxonomyId ?? 'tax_usgaap_reporting',
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
if (response.error) {
|
|
211
|
+
throw new Error(`Create mapping structure failed: ${JSON.stringify(response.error)}`);
|
|
212
|
+
}
|
|
213
|
+
const data = response.data;
|
|
214
|
+
return {
|
|
215
|
+
id: data.id,
|
|
216
|
+
name: data.name,
|
|
217
|
+
description: data.description ?? null,
|
|
218
|
+
structureType: data.structure_type,
|
|
219
|
+
taxonomyId: data.taxonomy_id,
|
|
220
|
+
isActive: data.is_active ?? true,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* List available CoA→GAAP mapping structures.
|
|
225
|
+
*/
|
|
226
|
+
async listMappings(graphId) {
|
|
227
|
+
const response = await (0, sdk_gen_1.listMappings)({
|
|
228
|
+
path: { graph_id: graphId },
|
|
229
|
+
});
|
|
230
|
+
if (response.error) {
|
|
231
|
+
throw new Error(`List mappings failed: ${JSON.stringify(response.error)}`);
|
|
232
|
+
}
|
|
233
|
+
const data = response.data;
|
|
234
|
+
return (data.structures ?? []).map((s) => ({
|
|
235
|
+
id: s.id,
|
|
236
|
+
name: s.name,
|
|
237
|
+
description: s.description ?? null,
|
|
238
|
+
structureType: s.structure_type,
|
|
239
|
+
taxonomyId: s.taxonomy_id,
|
|
240
|
+
isActive: s.is_active ?? true,
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Get mapping detail — all associations with element names.
|
|
245
|
+
*/
|
|
246
|
+
async getMappingDetail(graphId, mappingId) {
|
|
247
|
+
const response = await (0, sdk_gen_1.getMappingDetail)({
|
|
248
|
+
path: { graph_id: graphId, mapping_id: mappingId },
|
|
249
|
+
});
|
|
250
|
+
if (response.error) {
|
|
251
|
+
throw new Error(`Get mapping detail failed: ${JSON.stringify(response.error)}`);
|
|
252
|
+
}
|
|
253
|
+
return response.data;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get mapping coverage — how many CoA elements are mapped.
|
|
257
|
+
*/
|
|
258
|
+
async getMappingCoverage(graphId, mappingId) {
|
|
259
|
+
const response = await (0, sdk_gen_1.getMappingCoverage)({
|
|
260
|
+
path: { graph_id: graphId, mapping_id: mappingId },
|
|
261
|
+
});
|
|
262
|
+
if (response.error) {
|
|
263
|
+
throw new Error(`Get mapping coverage failed: ${JSON.stringify(response.error)}`);
|
|
264
|
+
}
|
|
265
|
+
const data = response.data;
|
|
266
|
+
return {
|
|
267
|
+
totalCoaElements: data.total_coa_elements ?? 0,
|
|
268
|
+
mappedCount: data.mapped_count ?? 0,
|
|
269
|
+
unmappedCount: data.unmapped_count ?? 0,
|
|
270
|
+
coveragePercent: data.coverage_percent ?? 0,
|
|
271
|
+
highConfidence: data.high_confidence ?? 0,
|
|
272
|
+
mediumConfidence: data.medium_confidence ?? 0,
|
|
273
|
+
lowConfidence: data.low_confidence ?? 0,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Create a manual mapping association (CoA element → GAAP element).
|
|
278
|
+
*/
|
|
279
|
+
async createMapping(graphId, mappingId, fromElementId, toElementId, confidence) {
|
|
280
|
+
const response = await (0, sdk_gen_1.createMappingAssociation)({
|
|
281
|
+
path: { graph_id: graphId, mapping_id: mappingId },
|
|
282
|
+
body: {
|
|
283
|
+
from_element_id: fromElementId,
|
|
284
|
+
to_element_id: toElementId,
|
|
285
|
+
confidence: confidence ?? 1.0,
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
if (response.error) {
|
|
289
|
+
throw new Error(`Create mapping failed: ${JSON.stringify(response.error)}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Delete a mapping association.
|
|
294
|
+
*/
|
|
295
|
+
async deleteMapping(graphId, mappingId, associationId) {
|
|
296
|
+
const response = await (0, sdk_gen_1.deleteMappingAssociation)({
|
|
297
|
+
path: { graph_id: graphId, mapping_id: mappingId, association_id: associationId },
|
|
298
|
+
});
|
|
299
|
+
if (response.error) {
|
|
300
|
+
throw new Error(`Delete mapping failed: ${JSON.stringify(response.error)}`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Trigger AI auto-mapping (MappingAgent).
|
|
305
|
+
* Returns immediately — the agent runs in the background.
|
|
306
|
+
*/
|
|
307
|
+
async autoMap(graphId, mappingId) {
|
|
308
|
+
const response = await (0, sdk_gen_1.autoMapElements)({
|
|
309
|
+
path: { graph_id: graphId, mapping_id: mappingId },
|
|
310
|
+
});
|
|
311
|
+
if (response.error) {
|
|
312
|
+
throw new Error(`Auto-map failed: ${JSON.stringify(response.error)}`);
|
|
313
|
+
}
|
|
314
|
+
const data = response.data;
|
|
315
|
+
return {
|
|
316
|
+
operationId: data?.operation_id,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.LedgerClient = LedgerClient;
|