@robosystems/client 0.3.29 → 0.3.30

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.
@@ -1,4 +1,4 @@
1
- import type { AssociationResponse, AutoMapElementsOperation, CreateAgentRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, InformationBlockEnvelope, JournalEntryResponse, LedgerAgentResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, OperationEnvelope, PreviewEventBlockResponse, PublishListMemberResponse, PublishListResponse, ReportResponse, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest } from '../types.gen';
1
+ import type { AssociationResponse, AutoMapElementsOperation, CreateAgentRequest, CreateEventBlockRequest, CreateEventHandlerRequest, CreateInformationBlockRequest, CreateMappingAssociationOperation, CreateTaxonomyBlockRequest, CreateViewRequest, DeleteInformationBlockRequest, DeleteInformationBlockResponse, DeleteMappingAssociationOperation, DeleteResult, DeleteTaxonomyBlockRequest, DeleteTaxonomyBlockResponse, EntityTaxonomyResponse, EvaluateRulesRequest, EvaluateRulesResponse, EventBlockEnvelope, EventHandlerResponse, FinancialStatementAnalysisRequest, InformationBlockEnvelope, JournalEntryResponse, LedgerAgentResponse, LinkEntityTaxonomyRequest, LiveFinancialStatementRequest, OperationEnvelope, PreviewEventBlockResponse, PublishListMemberResponse, PublishListResponse, ReportResponse, ShareReportResponse, TaxonomyBlockEnvelope, UpdateAgentRequest, UpdateEntityRequest, UpdateEventBlockRequest, UpdateEventHandlerRequest, UpdateInformationBlockRequest, UpdateJournalEntryRequest, UpdateTaxonomyBlockRequest } from '../types.gen';
2
2
  import type { TokenProvider } from './graphql/client';
3
3
  import { 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 ListInformationBlocksQuery, type ListLedgerAccountsQuery, type ListLedgerAgentsQuery, type ListLedgerElementsQuery, type ListLedgerEntitiesQuery, type ListLedgerEventBlocksQuery, type ListLedgerMappingsQuery, type ListLedgerPublishListsQuery, type ListLedgerReportsQuery, type ListLedgerStructuresQuery, type ListLedgerTaxonomiesQuery, type ListLedgerTransactionsQuery, type ListLedgerUnmappedElementsQuery } from './graphql/generated/graphql';
4
4
  export type LedgerEntity = NonNullable<GetLedgerEntityQuery['entity']>;
@@ -345,6 +345,30 @@ export declare class LedgerClient {
345
345
  offset?: number;
346
346
  }): Promise<InformationBlockList>;
347
347
  /** Create a new schedule with pre-generated monthly facts. */
348
+ /**
349
+ * Create an Information Block of any registered block_type.
350
+ *
351
+ * Generic wrapper over `create-information-block`. Pass a typed
352
+ * `CreateInformationBlockRequest` body — the discriminator routes
353
+ * server-side to the correct dispatch handler. Convenience methods
354
+ * exist for specific block types (e.g. `createSchedule`); for
355
+ * block types without one (currently `rollforward`), use this
356
+ * generic entry.
357
+ */
358
+ createInformationBlock(graphId: string, body: CreateInformationBlockRequest, options?: {
359
+ idempotencyKey?: string;
360
+ }): Promise<InformationBlockEnvelope>;
361
+ /**
362
+ * Update an Information Block in place. Generic wrapper over
363
+ * `update-information-block`.
364
+ */
365
+ updateInformationBlock(graphId: string, body: UpdateInformationBlockRequest): Promise<InformationBlockEnvelope>;
366
+ /**
367
+ * Delete an Information Block. Generic wrapper over
368
+ * `delete-information-block`. Cascades through any facts /
369
+ * associations tied to the block.
370
+ */
371
+ deleteInformationBlock(graphId: string, body: DeleteInformationBlockRequest): Promise<DeleteInformationBlockResponse>;
348
372
  createSchedule(graphId: string, options: CreateScheduleOptions): Promise<ScheduleCreated>;
349
373
  /** Update mutable fields on a schedule (name, entry_template, metadata). */
350
374
  updateSchedule(graphId: string, structureId: string, options: {
@@ -254,6 +254,43 @@ class LedgerClient {
254
254
  }
255
255
  // ── Schedules ──────────────────────────────────────────────────────
256
256
  /** Create a new schedule with pre-generated monthly facts. */
257
+ /**
258
+ * Create an Information Block of any registered block_type.
259
+ *
260
+ * Generic wrapper over `create-information-block`. Pass a typed
261
+ * `CreateInformationBlockRequest` body — the discriminator routes
262
+ * server-side to the correct dispatch handler. Convenience methods
263
+ * exist for specific block types (e.g. `createSchedule`); for
264
+ * block types without one (currently `rollforward`), use this
265
+ * generic entry.
266
+ */
267
+ async createInformationBlock(graphId, body, options) {
268
+ const envelope = await this.callOperation('Create information block', (0, sdk_gen_1.opCreateInformationBlock)({
269
+ path: { graph_id: graphId },
270
+ body,
271
+ headers: options?.idempotencyKey
272
+ ? { 'Idempotency-Key': options.idempotencyKey }
273
+ : undefined,
274
+ }));
275
+ return this.requireResult('Create information block', envelope.result);
276
+ }
277
+ /**
278
+ * Update an Information Block in place. Generic wrapper over
279
+ * `update-information-block`.
280
+ */
281
+ async updateInformationBlock(graphId, body) {
282
+ const envelope = await this.callOperation('Update information block', (0, sdk_gen_1.opUpdateInformationBlock)({ path: { graph_id: graphId }, body }));
283
+ return this.requireResult('Update information block', envelope.result);
284
+ }
285
+ /**
286
+ * Delete an Information Block. Generic wrapper over
287
+ * `delete-information-block`. Cascades through any facts /
288
+ * associations tied to the block.
289
+ */
290
+ async deleteInformationBlock(graphId, body) {
291
+ const envelope = await this.callOperation('Delete information block', (0, sdk_gen_1.opDeleteInformationBlock)({ path: { graph_id: graphId }, body }));
292
+ return (envelope.result ?? { deleted: true });
293
+ }
257
294
  async createSchedule(graphId, options) {
258
295
  const body = {
259
296
  block_type: 'schedule',
@@ -1050,6 +1050,65 @@ export class LedgerClient {
1050
1050
  // ── Schedules ──────────────────────────────────────────────────────
1051
1051
 
1052
1052
  /** Create a new schedule with pre-generated monthly facts. */
1053
+ /**
1054
+ * Create an Information Block of any registered block_type.
1055
+ *
1056
+ * Generic wrapper over `create-information-block`. Pass a typed
1057
+ * `CreateInformationBlockRequest` body — the discriminator routes
1058
+ * server-side to the correct dispatch handler. Convenience methods
1059
+ * exist for specific block types (e.g. `createSchedule`); for
1060
+ * block types without one (currently `rollforward`), use this
1061
+ * generic entry.
1062
+ */
1063
+ async createInformationBlock(
1064
+ graphId: string,
1065
+ body: CreateInformationBlockRequest,
1066
+ options?: { idempotencyKey?: string }
1067
+ ): Promise<InformationBlockEnvelope> {
1068
+ const envelope = await this.callOperation(
1069
+ 'Create information block',
1070
+ opCreateInformationBlock({
1071
+ path: { graph_id: graphId },
1072
+ body,
1073
+ headers: options?.idempotencyKey
1074
+ ? { 'Idempotency-Key': options.idempotencyKey }
1075
+ : undefined,
1076
+ })
1077
+ )
1078
+ return this.requireResult('Create information block', envelope.result)
1079
+ }
1080
+
1081
+ /**
1082
+ * Update an Information Block in place. Generic wrapper over
1083
+ * `update-information-block`.
1084
+ */
1085
+ async updateInformationBlock(
1086
+ graphId: string,
1087
+ body: UpdateInformationBlockRequest
1088
+ ): Promise<InformationBlockEnvelope> {
1089
+ const envelope = await this.callOperation(
1090
+ 'Update information block',
1091
+ opUpdateInformationBlock({ path: { graph_id: graphId }, body })
1092
+ )
1093
+ return this.requireResult('Update information block', envelope.result)
1094
+ }
1095
+
1096
+ /**
1097
+ * Delete an Information Block. Generic wrapper over
1098
+ * `delete-information-block`. Cascades through any facts /
1099
+ * associations tied to the block.
1100
+ */
1101
+ async deleteInformationBlock(
1102
+ graphId: string,
1103
+ body: DeleteInformationBlockRequest
1104
+ ): Promise<DeleteInformationBlockResponse> {
1105
+ const envelope = await this.callOperation(
1106
+ 'Delete information block',
1107
+ opDeleteInformationBlock({ path: { graph_id: graphId }, body })
1108
+ )
1109
+ return (envelope.result ?? { deleted: true }) as DeleteInformationBlockResponse
1110
+ }
1111
+
1053
1112
  async createSchedule(graphId: string, options: CreateScheduleOptions): Promise<ScheduleCreated> {
1054
1113
  const body: CreateInformationBlockRequest = {
1055
1114
  block_type: 'schedule',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/client",
3
- "version": "0.3.29",
3
+ "version": "0.3.30",
4
4
  "description": "TypeScript client library for RoboSystems Financial Knowledge Graph API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",