@robosystems/client 0.5.8 → 0.5.9

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/types.gen.ts CHANGED
@@ -379,6 +379,129 @@ export type AvailableGraphTiersResponse = {
379
379
  tiers: Array<GraphTierInfo>;
380
380
  };
381
381
 
382
+ /**
383
+ * BackfillPeriodOutcome
384
+ *
385
+ * Per-month result of a plan-history backfill pass.
386
+ */
387
+ export type BackfillPeriodOutcome = {
388
+ /**
389
+ * Period
390
+ *
391
+ * The month, in YYYY-MM
392
+ */
393
+ period: string;
394
+ /**
395
+ * Status
396
+ *
397
+ * stamped: reopen → reclose completed. skipped_drafts: the month holds draft entries the backfill refuses to post — review via list-period-drafts, then close-period or re-run. failed: the reclose raised; processing halted (see detail).
398
+ */
399
+ status: string;
400
+ /**
401
+ * Statements Stamped
402
+ *
403
+ * Whether the reclose stamped canonical statement FactSets. False with a statement_stamp_note soft-skip when reporting isn't set up.
404
+ */
405
+ statements_stamped?: boolean;
406
+ /**
407
+ * Statement Stamp Note
408
+ *
409
+ * Soft-skip reason when statements_stamped is false
410
+ */
411
+ statement_stamp_note?: string | null;
412
+ /**
413
+ * Statement Rule Summary
414
+ *
415
+ * Statement-rule verification tally for the month's stamped sets (pass/fail/error/skipped); None when no rules ran.
416
+ */
417
+ statement_rule_summary?: {
418
+ [key: string]: number;
419
+ } | null;
420
+ /**
421
+ * Detail
422
+ *
423
+ * Human-readable detail for skipped/failed months
424
+ */
425
+ detail?: string | null;
426
+ };
427
+
428
+ /**
429
+ * BackfillPlanHistoryOperation
430
+ *
431
+ * Compile monthly statement history behind the close boundary.
432
+ */
433
+ export type BackfillPlanHistoryOperation = {
434
+ /**
435
+ * Start Period
436
+ *
437
+ * YYYY-MM period to backfill from. Clamped to the earliest month with ledger data; defaults to that month when omitted. Must be on or before `closed_through`.
438
+ */
439
+ start_period?: string | null;
440
+ /**
441
+ * Max Periods
442
+ *
443
+ * Maximum months to restamp in this call. Each month runs a full reopen → reclose cycle; keep chunks modest and loop on `remaining_periods`.
444
+ */
445
+ max_periods?: number;
446
+ /**
447
+ * Allow Stale Sync
448
+ *
449
+ * Override the sync-currency gate on each reclose. Historical months predate the last sync in the normal case, so this is rarely needed.
450
+ */
451
+ allow_stale_sync?: boolean;
452
+ /**
453
+ * Note
454
+ *
455
+ * Free-form note attached to each close audit event
456
+ */
457
+ note?: string | null;
458
+ };
459
+
460
+ /**
461
+ * BackfillPlanHistoryResponse
462
+ *
463
+ * Response from one chunked plan-history backfill call.
464
+ */
465
+ export type BackfillPlanHistoryResponse = {
466
+ fiscal_calendar: FiscalCalendarResponse;
467
+ /**
468
+ * Earliest Available Period
469
+ *
470
+ * First month with ledger data — the hard floor for backfill
471
+ */
472
+ earliest_available_period: string;
473
+ /**
474
+ * Effective Start Period
475
+ *
476
+ * The start actually used after clamping to earliest_available_period
477
+ */
478
+ effective_start_period: string;
479
+ /**
480
+ * Closed Through
481
+ *
482
+ * The close boundary the backfill runs up to (inclusive)
483
+ */
484
+ closed_through: string;
485
+ /**
486
+ * Period Rows Created
487
+ *
488
+ * FiscalPeriod rows seeded (baseline-closed) for months the calendar didn't cover yet
489
+ */
490
+ period_rows_created?: number;
491
+ /**
492
+ * Processed
493
+ *
494
+ * Months this call attempted, oldest first
495
+ */
496
+ processed?: Array<BackfillPeriodOutcome>;
497
+ /**
498
+ * Remaining Periods
499
+ *
500
+ * Months still lacking canonical statement sets that this call did not attempt (beyond max_periods, or after a failure halt). Loop until empty.
501
+ */
502
+ remaining_periods?: Array<string>;
503
+ };
504
+
382
505
  /**
383
506
  * BackupCreateRequest
384
507
  *
@@ -1230,6 +1353,34 @@ export type ClosePeriodResponse = {
1230
1353
  * ids of schedule Structures whose rules were evaluated during the close. Pairs with rule_summary.
1231
1354
  */
1232
1355
  evaluated_structure_ids?: Array<string>;
1356
+ /**
1357
+ * Statements Stamped
1358
+ *
1359
+ * Whether the close stamped the period's canonical statement FactSets (the close-time pivot). False when the tenant hasn't set up reporting yet — see statement_stamp_note.
1360
+ */
1361
+ statements_stamped?: boolean;
1362
+ /**
1363
+ * Statement Stamp Note
1364
+ *
1365
+ * Soft-skip reason when statements_stamped is false: no_coa_mapping | no_entity | no_statement_structures | no_taxonomy.
1366
+ */
1367
+ statement_stamp_note?: string | null;
1368
+ /**
1369
+ * Stamped Statement Sets
1370
+ *
1371
+ * structure_id -> fact_set_id for every canonical statement FactSet minted by this close (report_id NULL; replaced on reclose).
1372
+ */
1373
+ stamped_statement_sets?: {
1374
+ [key: string]: string;
1375
+ };
1376
+ /**
1377
+ * Statement Rule Summary
1378
+ *
1379
+ * Aggregated statement-rule verification outcome across the stamped structures — keys: pass/fail/error/skipped. None when no statement rules exist. Distinct from rule_summary (the schedule-rule pass).
1380
+ */
1381
+ statement_rule_summary?: {
1382
+ [key: string]: number;
1383
+ } | null;
1233
1384
  };
1234
1385
 
1235
1386
  /**
@@ -2199,6 +2350,12 @@ export type CreateForecastRequest = {
2199
2350
  * Lever assertions — at least one.
2200
2351
  */
2201
2352
  levers: Array<LeverAssertionRequest>;
2353
+ /**
2354
+ * Line Assertions
2355
+ *
2356
+ * Direct statement-line assertions (manual overrides). Each names a calc-DAG leaf and wins over driver rules and carry-forward for the months it asserts.
2357
+ */
2358
+ line_assertions?: Array<LineAssertionRequest>;
2202
2359
  /**
2203
2360
  * Entity Id
2204
2361
  *
@@ -3977,6 +4134,12 @@ export type ElementLite = {
3977
4134
  * Value-domain vocabulary (monetary | ratio | percent | multiple | days | string | …). None means untyped; fall back to is_monetary.
3978
4135
  */
3979
4136
  item_type?: string | null;
4137
+ /**
4138
+ * Documentation
4139
+ *
4140
+ * The element's documentation-role label — the catalog's authoritative value semantics (e.g. whether a percent driver is a growth rate or a rate-on-base fraction). None when the element carries no documentation label.
4141
+ */
4142
+ documentation?: string | null;
3980
4143
  };
3981
4144
 
3982
4145
  /**
@@ -5130,6 +5293,12 @@ export type ForecastMechanics = {
5130
5293
  * Expanded lever assertions (authoring order).
5131
5294
  */
5132
5295
  levers: Array<LeverAssertionLite>;
5296
+ /**
5297
+ * Line Assertions
5298
+ *
5299
+ * Direct statement-line assertions (authoring order) — manual overrides that win over driver rules and carry-forward for the months they name.
5300
+ */
5301
+ line_assertions?: Array<LineAssertionLite>;
5133
5302
  /**
5134
5303
  * Computed Months
5135
5304
  *
@@ -7090,13 +7259,21 @@ export type LeverAssertionLite = {
7090
7259
  * One lever's asserted values for the scenario.
7091
7260
  *
7092
7261
  * ``qname`` must resolve to an ``rs-driver:*`` catalog element (the
7093
- * create handler rejects anything else). Value conventions follow the
7094
- * catalog: percent levers are decimals per month (0.03 = 3%/month),
7095
- * days levers are day counts.
7262
+ * create handler rejects anything else). Each lever's value semantics
7263
+ * are defined by its catalog element's documentation — surfaced as
7264
+ * ``documentation`` on the elements bundled in the forecast block's
7265
+ * envelope (``get-information-block``). Percent levers are decimals but
7266
+ * their *meaning* varies by lever: growth levers are month-over-month
7267
+ * rates (``RevenueGrowthRate`` 0.03 = +3%/month, compounding), while
7268
+ * rate-on-base levers are fractions of the same month's base
7269
+ * (``CostOfRevenueRate`` 0.62 = cost of revenue at 62% of that month's
7270
+ * revenues — not a growth rate). Days levers (``DaysSalesOutstanding``,
7271
+ * ``DaysPayableOutstanding``) are day counts.
7096
7272
  *
7097
7273
  * ``value`` is a uniform fill across the whole horizon;
7098
7274
  * ``values_by_period`` overrides individual months (``"YYYY-MM"``
7099
- * keys). At least one of the two must be provided. Months covered by
7275
+ * keys) — e.g. a margin-compression ramp asserts a different rate each
7276
+ * month. At least one of the two must be provided. Months covered by
7100
7277
  * neither carry no assertion — the lever's rule is inactive for that
7101
7278
  * month and its target falls to the engine's carry-forward default.
7102
7279
  */
@@ -7123,6 +7300,108 @@ export type LeverAssertionRequest = {
7123
7300
  } | null;
7124
7301
  };
7125
7302
 
7303
+ /**
7304
+ * LineAssertionLite
7305
+ *
7306
+ * One statement line's persisted direct assertion inside
7307
+ * ``ForecastMechanics``.
7308
+ *
7309
+ * The manual-override sibling of :class:`LeverAssertionLite`: a lever
7310
+ * asserts a *driver* whose rule derives a line; a line assertion pins
7311
+ * the **line itself** (a calc-DAG leaf) to typed values for the months
7312
+ * it names — winning over driver rules and carry-forward for exactly
7313
+ * those months (a displaced rule surfaces in the compute response's
7314
+ * ``skipped`` list). Subtotals stay calc-DAG-derived, so a manual line
7315
+ * still articulates through RollUps, RE, balancing cash, and derived
7316
+ * CF, and stays verification-gated.
7317
+ *
7318
+ * Same persistence doctrine as levers: values are duplicated as
7319
+ * authored facts in the scenario's lever FactSet (facts are what
7320
+ * ``compute-forecast`` binds); this mechanics copy is the
7321
+ * operator-legible round-trip shape.
7322
+ */
7323
+ export type LineAssertionLite = {
7324
+ /**
7325
+ * Qname
7326
+ *
7327
+ * Asserted statement-leaf qname.
7328
+ */
7329
+ qname: string;
7330
+ /**
7331
+ * Element Id
7332
+ *
7333
+ * Resolved tenant element id.
7334
+ */
7335
+ element_id: string;
7336
+ /**
7337
+ * Item Type
7338
+ *
7339
+ * Format family from the element (monetary | ...).
7340
+ */
7341
+ item_type?: string | null;
7342
+ /**
7343
+ * Period Type
7344
+ *
7345
+ * The element's period type — duration assertions pin IS lines; instant assertions pin BS lines through the roll.
7346
+ */
7347
+ period_type?: string;
7348
+ /**
7349
+ * Values By Period
7350
+ *
7351
+ * Expanded per-month assertions keyed by ``YYYY-MM``.
7352
+ */
7353
+ values_by_period: {
7354
+ [key: string]: number;
7355
+ };
7356
+ };
7357
+
7358
+ /**
7359
+ * LineAssertionRequest
7360
+ *
7361
+ * One statement line's directly asserted values for the scenario.
7362
+ *
7363
+ * The manual-override half of the authored surface: where a lever
7364
+ * asserts a *driver* (growth %, DSO) whose rule derives the line, a
7365
+ * line assertion asserts the **line itself** — an rs-gaap (or tenant
7366
+ * extension) statement leaf pinned to typed values for the months it
7367
+ * names. Assertions win over driver rules and carry-forward for those
7368
+ * months (a displaced rule lands in ``skipped``, legibly); months the
7369
+ * assertion doesn't name keep the engine's normal derivation.
7370
+ *
7371
+ * **Leaves only** — subtotals stay calc-DAG-derived, so a manually set
7372
+ * line still articulates through RollUps, RE, balancing cash, and the
7373
+ * derived CF, and stays verification-gated (the whole pitch vs a
7374
+ * spreadsheet cell). The create handler rejects calc-parent qnames.
7375
+ *
7376
+ * Value/period grammar is identical to levers: ``value`` is a uniform
7377
+ * fill across the horizon, ``values_by_period`` overrides individual
7378
+ * months. The canonical uses: zero out a base-month one-off so
7379
+ * carry-forward stops replicating it, or hold a line at a known budget
7380
+ * number no driver models.
7381
+ */
7382
+ export type LineAssertionRequest = {
7383
+ /**
7384
+ * Qname
7385
+ *
7386
+ * QName of the statement leaf to assert (e.g. ``rs-gaap:NonoperatingIncomeExpense``). Must be a calc-DAG leaf; rs-driver concepts belong in ``levers``.
7387
+ */
7388
+ qname: string;
7389
+ /**
7390
+ * Value
7391
+ *
7392
+ * Uniform value asserted for every month of the horizon.
7393
+ */
7394
+ value?: number | null;
7395
+ /**
7396
+ * Values By Period
7397
+ *
7398
+ * Per-month overrides keyed by ``YYYY-MM``. Wins over ``value`` for the months it names.
7399
+ */
7400
+ values_by_period?: {
7401
+ [key: string]: number;
7402
+ } | null;
7403
+ };
7404
+
7126
7405
  /**
7127
7406
  * LineItemMetadataPredicate
7128
7407
  *
@@ -7905,6 +8184,52 @@ export type OperationEnvelopeAssociationResponse = {
7905
8184
  idempotentReplay?: boolean;
7906
8185
  };
7907
8186
 
8187
+ /**
8188
+ * OperationEnvelope[BackfillPlanHistoryResponse]
8189
+ */
8190
+ export type OperationEnvelopeBackfillPlanHistoryResponse = {
8191
+ /**
8192
+ * Operation
8193
+ *
8194
+ * Kebab-case operation name
8195
+ */
8196
+ operation: string;
8197
+ /**
8198
+ * Operationid
8199
+ *
8200
+ * op_-prefixed ULID for audit and SSE correlation
8201
+ */
8202
+ operationId: string;
8203
+ /**
8204
+ * Status
8205
+ *
8206
+ * Operation lifecycle state
8207
+ */
8208
+ status: 'completed' | 'pending' | 'failed';
8209
+ /**
8210
+ * Command-specific result payload
8211
+ */
8212
+ result?: BackfillPlanHistoryResponse | null;
8213
+ /**
8214
+ * At
8215
+ *
8216
+ * ISO-8601 UTC timestamp
8217
+ */
8218
+ at: string;
8219
+ /**
8220
+ * Createdby
8221
+ *
8222
+ * User ID that initiated the operation (null for legacy callers)
8223
+ */
8224
+ createdBy?: string | null;
8225
+ /**
8226
+ * Idempotentreplay
8227
+ *
8228
+ * True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.
8229
+ */
8230
+ idempotentReplay?: boolean;
8231
+ };
8232
+
7908
8233
  /**
7909
8234
  * OperationEnvelope[BindTextBlockResponse]
7910
8235
  */
@@ -14262,11 +14587,13 @@ export type UpdateEventHandlerRequest = {
14262
14587
  *
14263
14588
  * Update a forecast block in place.
14264
14589
  *
14265
- * Mutable: name, scenario_kind, horizon_months, base_period, levers.
14266
- * ``levers`` is a **full replace** when provided (partial lever edits
14267
- * would make the asserted set ambiguous). Updating does NOT recompute —
14268
- * previously computed scenario months go stale until the next
14269
- * ``compute-forecast`` run (the compute-metrics drift semantics).
14590
+ * Mutable: name, scenario_kind, horizon_months, base_period, levers,
14591
+ * line_assertions. ``levers`` and ``line_assertions`` are each a
14592
+ * **full replace** when provided (partial edits would make the asserted
14593
+ * set ambiguous); replacing one leaves the other as stored. Updating
14594
+ * does NOT recompute — previously computed scenario months go stale
14595
+ * until the next ``compute-forecast`` run (the compute-metrics drift
14596
+ * semantics).
14270
14597
  */
14271
14598
  export type UpdateForecastRequest = {
14272
14599
  /**
@@ -14297,6 +14624,12 @@ export type UpdateForecastRequest = {
14297
14624
  * Full replacement of the lever set when provided.
14298
14625
  */
14299
14626
  levers?: Array<LeverAssertionRequest> | null;
14627
+ /**
14628
+ * Line Assertions
14629
+ *
14630
+ * Full replacement of the line-assertion set when provided. Pass an empty list to clear every assertion.
14631
+ */
14632
+ line_assertions?: Array<LineAssertionRequest> | null;
14300
14633
  };
14301
14634
 
14302
14635
  /**
@@ -15332,7 +15665,7 @@ export type UpdateForecastArm = {
15332
15665
  */
15333
15666
  block_type: 'forecast';
15334
15667
  /**
15335
- * Forecast update payload.
15668
+ * Forecast update payload. Updating does NOT recompute — lever, horizon, or base-period changes leave the scenario's computed months stale until the next `compute-forecast` run.
15336
15669
  */
15337
15670
  payload: UpdateForecastRequest;
15338
15671
  };
@@ -24045,6 +24378,70 @@ export type ReopenPeriodResponses = {
24045
24378
 
24046
24379
  export type ReopenPeriodResponse = ReopenPeriodResponses[keyof ReopenPeriodResponses];
24047
24380
 
24381
+ export type BackfillPlanHistoryData = {
24382
+ body: BackfillPlanHistoryOperation;
24383
+ headers?: {
24384
+ /**
24385
+ * Idempotency-Key
24386
+ */
24387
+ 'Idempotency-Key'?: string | null;
24388
+ };
24389
+ path: {
24390
+ /**
24391
+ * Graph Id
24392
+ */
24393
+ graph_id: string;
24394
+ };
24395
+ query?: never;
24396
+ url: '/extensions/roboledger/{graph_id}/operations/backfill-plan-history';
24397
+ };
24398
+
24399
+ export type BackfillPlanHistoryErrors = {
24400
+ /**
24401
+ * Invalid request
24402
+ */
24403
+ 400: ErrorResponse;
24404
+ /**
24405
+ * Authentication required
24406
+ */
24407
+ 401: ErrorResponse;
24408
+ /**
24409
+ * Access denied
24410
+ */
24411
+ 403: ErrorResponse;
24412
+ /**
24413
+ * Resource not found
24414
+ */
24415
+ 404: ErrorResponse;
24416
+ /**
24417
+ * Idempotency-Key conflict — key reused with different body
24418
+ */
24419
+ 409: ErrorResponse;
24420
+ /**
24421
+ * Validation error
24422
+ */
24423
+ 422: ErrorResponse;
24424
+ /**
24425
+ * Rate limit exceeded
24426
+ */
24427
+ 429: ErrorResponse;
24428
+ /**
24429
+ * Internal server error
24430
+ */
24431
+ 500: ErrorResponse;
24432
+ };
24433
+
24434
+ export type BackfillPlanHistoryError = BackfillPlanHistoryErrors[keyof BackfillPlanHistoryErrors];
24435
+
24436
+ export type BackfillPlanHistoryResponses = {
24437
+ /**
24438
+ * Successful Response
24439
+ */
24440
+ 200: OperationEnvelopeBackfillPlanHistoryResponse;
24441
+ };
24442
+
24443
+ export type BackfillPlanHistoryResponse2 = BackfillPlanHistoryResponses[keyof BackfillPlanHistoryResponses];
24444
+
24048
24445
  export type CreateReportData = {
24049
24446
  body: CreateReportRequest;
24050
24447
  headers?: {