@robosystems/client 0.5.3 → 0.5.5

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.
@@ -921,6 +921,85 @@ export type ChangeTierOp = {
921
921
  */
922
922
  new_tier: 'ladybug-standard' | 'ladybug-large' | 'ladybug-xlarge';
923
923
  };
924
+ /**
925
+ * ChartLite
926
+ *
927
+ * Server-shaped chart projection — panel/series CONFIG, never values.
928
+ *
929
+ * The second real server-computed View arm (after ``rendering``). Values
930
+ * come from ``rendering.rows`` joined by ``element_id``; the x-axis is
931
+ * ``rendering.periods``. Renderers (report-components) turn one panel
932
+ * into one chart.
933
+ */
934
+ export type ChartLite = {
935
+ /**
936
+ * Panels
937
+ */
938
+ panels?: Array<ChartPanelLite>;
939
+ };
940
+ /**
941
+ * ChartPanelLite
942
+ *
943
+ * One chart panel — series sharing a y-axis format family.
944
+ *
945
+ * Mixed-unit catalogs are unplottable on one axis, so the server groups
946
+ * rows into panels by ``item_type`` family (NULL falls back to
947
+ * ``is_monetary``). The x-axis is always ``rendering.periods``.
948
+ */
949
+ export type ChartPanelLite = {
950
+ /**
951
+ * Label
952
+ *
953
+ * Panel heading — e.g. 'Monetary', 'Ratios'.
954
+ */
955
+ label?: string | null;
956
+ /**
957
+ * Item Type
958
+ *
959
+ * Format family shared by the panel's series (monetary | ratio | percent | multiple | days); None for the untyped fallback panel.
960
+ */
961
+ item_type?: string | null;
962
+ /**
963
+ * Kind
964
+ *
965
+ * Per-panel mark — 'line' or 'bar'.
966
+ */
967
+ kind?: string;
968
+ /**
969
+ * Series
970
+ */
971
+ series?: Array<ChartSeriesLite>;
972
+ };
973
+ /**
974
+ * ChartSeriesLite
975
+ *
976
+ * One plottable series in a chart panel.
977
+ *
978
+ * Carries structure and identity only — the values live in the sibling
979
+ * ``rendering.rows`` (join on ``element_id``), so the chart arm never
980
+ * duplicates the value matrix. ``key`` is the stable series identity for
981
+ * client state (colors, toggles); today it equals ``element_id``, and
982
+ * future axes (the forecast scenario) arrive as new fields on this
983
+ * model, never a new arm shape.
984
+ */
985
+ export type ChartSeriesLite = {
986
+ /**
987
+ * Key
988
+ *
989
+ * Stable series id — element_id today.
990
+ */
991
+ key: string;
992
+ /**
993
+ * Element Id
994
+ */
995
+ element_id: string;
996
+ /**
997
+ * Label
998
+ *
999
+ * Display name for legends.
1000
+ */
1001
+ label: string;
1002
+ };
924
1003
  /**
925
1004
  * CheckoutResponse
926
1005
  *
@@ -1113,6 +1192,132 @@ export type ClosePeriodResponse = {
1113
1192
  */
1114
1193
  evaluated_structure_ids?: Array<string>;
1115
1194
  };
1195
+ /**
1196
+ * ComputeMetricsRequest
1197
+ *
1198
+ * Request body for the ``compute-metrics`` operation.
1199
+ *
1200
+ * Resolves the ``Derive`` rules scoped to the metric block, binds each
1201
+ * rule's operands to the entity's most recent persisted report facts at
1202
+ * ``period_end``, evaluates, and upserts the period's standing
1203
+ * ``factset_type='metric'`` FactSet (re-running a period replaces its
1204
+ * facts). One standing FactSet per (structure, entity, period_end) — the
1205
+ * accumulating time series.
1206
+ */
1207
+ export type ComputeMetricsRequest = {
1208
+ /**
1209
+ * Structure Id
1210
+ *
1211
+ * Metric block structure (block_type='metric') to compute.
1212
+ */
1213
+ structure_id: string;
1214
+ /**
1215
+ * Period End
1216
+ *
1217
+ * Period end to compute at. Operands bind to report facts whose period_end matches exactly (instant balances as of this date; durations ending on it).
1218
+ */
1219
+ period_end: string;
1220
+ /**
1221
+ * Period Start
1222
+ *
1223
+ * Optional lower bound for duration-operand binding and the standing FactSet's period_start.
1224
+ */
1225
+ period_start?: string | null;
1226
+ /**
1227
+ * Entity Id
1228
+ *
1229
+ * Entity to compute for. Defaults to the graph's earliest-created entity (the primary entity for single-entity graphs).
1230
+ */
1231
+ entity_id?: string | null;
1232
+ };
1233
+ /**
1234
+ * ComputeMetricsResponse
1235
+ *
1236
+ * Response for the ``compute-metrics`` operation.
1237
+ */
1238
+ export type ComputeMetricsResponse = {
1239
+ /**
1240
+ * Structure Id
1241
+ */
1242
+ structure_id: string;
1243
+ /**
1244
+ * Entity Id
1245
+ */
1246
+ entity_id: string;
1247
+ /**
1248
+ * Period End
1249
+ */
1250
+ period_end: string;
1251
+ /**
1252
+ * Fact Set Id
1253
+ *
1254
+ * Standing metric FactSet for the period — None when every metric was skipped and no prior set existed.
1255
+ */
1256
+ fact_set_id?: string | null;
1257
+ /**
1258
+ * Computed
1259
+ */
1260
+ computed?: Array<ComputedMetricLite>;
1261
+ /**
1262
+ * Skipped
1263
+ */
1264
+ skipped?: Array<SkippedMetricLite>;
1265
+ };
1266
+ /**
1267
+ * ComputedMetricLite
1268
+ *
1269
+ * One metric computed by a ``compute-metrics`` run.
1270
+ */
1271
+ export type ComputedMetricLite = {
1272
+ /**
1273
+ * Rule Id
1274
+ *
1275
+ * Derive rule that produced the value.
1276
+ */
1277
+ rule_id: string;
1278
+ /**
1279
+ * Element Id
1280
+ *
1281
+ * Metric element the fact was written for.
1282
+ */
1283
+ element_id: string;
1284
+ /**
1285
+ * Element Qname
1286
+ *
1287
+ * Metric element qname (e.g. rs-metric:CurrentRatio).
1288
+ */
1289
+ element_qname?: string | null;
1290
+ /**
1291
+ * Name
1292
+ *
1293
+ * Metric display name.
1294
+ */
1295
+ name: string;
1296
+ /**
1297
+ * Value
1298
+ *
1299
+ * Computed value.
1300
+ */
1301
+ value: number;
1302
+ /**
1303
+ * Unit
1304
+ *
1305
+ * Fact unit — 'USD' for monetary, 'days' for days, else 'pure'.
1306
+ */
1307
+ unit: string;
1308
+ /**
1309
+ * Period Type
1310
+ *
1311
+ * 'instant' or 'duration'.
1312
+ */
1313
+ period_type: string;
1314
+ /**
1315
+ * Item Type
1316
+ *
1317
+ * Format family from the metric element (monetary | ratio | percent | multiple | days). None means untyped; fall back to unit.
1318
+ */
1319
+ item_type?: string | null;
1320
+ };
1116
1321
  /**
1117
1322
  * ConnectionLite
1118
1323
  *
@@ -3505,6 +3710,12 @@ export type ElementLite = {
3505
3710
  * Period Type
3506
3711
  */
3507
3712
  period_type?: string | null;
3713
+ /**
3714
+ * Item Type
3715
+ *
3716
+ * Value-domain vocabulary (monetary | ratio | percent | multiple | days | string | …). None means untyped; fall back to is_monetary.
3717
+ */
3718
+ item_type?: string | null;
3508
3719
  };
3509
3720
  /**
3510
3721
  * ElementUpdatePatch
@@ -7291,6 +7502,51 @@ export type OperationEnvelopeClosePeriodResponse = {
7291
7502
  */
7292
7503
  idempotentReplay?: boolean;
7293
7504
  };
7505
+ /**
7506
+ * OperationEnvelope[ComputeMetricsResponse]
7507
+ */
7508
+ export type OperationEnvelopeComputeMetricsResponse = {
7509
+ /**
7510
+ * Operation
7511
+ *
7512
+ * Kebab-case operation name
7513
+ */
7514
+ operation: string;
7515
+ /**
7516
+ * Operationid
7517
+ *
7518
+ * op_-prefixed ULID for audit and SSE correlation
7519
+ */
7520
+ operationId: string;
7521
+ /**
7522
+ * Status
7523
+ *
7524
+ * Operation lifecycle state
7525
+ */
7526
+ status: 'completed' | 'pending' | 'failed';
7527
+ /**
7528
+ * Command-specific result payload
7529
+ */
7530
+ result?: ComputeMetricsResponse | null;
7531
+ /**
7532
+ * At
7533
+ *
7534
+ * ISO-8601 UTC timestamp
7535
+ */
7536
+ at: string;
7537
+ /**
7538
+ * Createdby
7539
+ *
7540
+ * User ID that initiated the operation (null for legacy callers)
7541
+ */
7542
+ createdBy?: string | null;
7543
+ /**
7544
+ * Idempotentreplay
7545
+ *
7546
+ * True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.
7547
+ */
7548
+ idempotentReplay?: boolean;
7549
+ };
7294
7550
  /**
7295
7551
  * OperationEnvelope[DeleteInformationBlockResponse]
7296
7552
  */
@@ -10161,6 +10417,12 @@ export type RenderingRowLite = {
10161
10417
  * Balance Type
10162
10418
  */
10163
10419
  balance_type?: string | null;
10420
+ /**
10421
+ * Item Type
10422
+ *
10423
+ * Value-domain format family from the element (monetary | ratio | percent | multiple | days | …). Drives per-row value formatting; None falls back to is_monetary on the element.
10424
+ */
10425
+ item_type?: string | null;
10164
10426
  /**
10165
10427
  * Values
10166
10428
  */
@@ -11542,6 +11804,41 @@ export type ShareResultItem = {
11542
11804
  */
11543
11805
  fact_count?: number;
11544
11806
  };
11807
+ /**
11808
+ * SkippedMetricLite
11809
+ *
11810
+ * One metric a ``compute-metrics`` run could not compute.
11811
+ *
11812
+ * Soft-fail by design: a missing operand fact (e.g. InterestExpense for a
11813
+ * debt-free entity) or an undefined ratio (division by zero) skips the
11814
+ * metric with a reason — it never errors the run.
11815
+ */
11816
+ export type SkippedMetricLite = {
11817
+ /**
11818
+ * Rule Id
11819
+ *
11820
+ * Derive rule that was skipped.
11821
+ */
11822
+ rule_id: string;
11823
+ /**
11824
+ * Element Qname
11825
+ *
11826
+ * Metric element qname the rule targets.
11827
+ */
11828
+ element_qname?: string | null;
11829
+ /**
11830
+ * Reason
11831
+ *
11832
+ * Why the metric was skipped.
11833
+ */
11834
+ reason: string;
11835
+ /**
11836
+ * Missing
11837
+ *
11838
+ * Operand qnames with no bound fact at the period, when applicable.
11839
+ */
11840
+ missing?: Array<string>;
11841
+ };
11545
11842
  /**
11546
11843
  * SqlStatementRequest
11547
11844
  */
@@ -11725,6 +12022,11 @@ export type StructureSummary = {
11725
12022
  * StructureUpdatePatch
11726
12023
  *
11727
12024
  * Partial-update patch for a single structure, keyed by structure_id.
12025
+ *
12026
+ * ``concept_arrangement`` makes a mis-CAP'd structure repairable in
12027
+ * place (e.g. promoting a ``set`` note to ``roll_up`` so it gains a
12028
+ * footing rule); ``block_type`` stays immutable — it drives block-type
12029
+ * routing, so changing it is a re-create, not an edit.
11728
12030
  */
11729
12031
  export type StructureUpdatePatch = {
11730
12032
  /**
@@ -11745,6 +12047,10 @@ export type StructureUpdatePatch = {
11745
12047
  * Role Uri
11746
12048
  */
11747
12049
  role_uri?: string | null;
12050
+ /**
12051
+ * Concept Arrangement
12052
+ */
12053
+ concept_arrangement?: 'set' | 'roll_up' | 'roll_forward' | 'roll_forward_info' | 'adjustment' | 'variance' | 'arithmetic' | 'text_block' | 'level1_textblock' | 'level2_textblock' | 'level3_textblock' | 'level4_detail' | 'table_equivalent_textblock' | 'grid' | 'compound_fact' | null;
11748
12054
  /**
11749
12055
  * Metadata
11750
12056
  */
@@ -12477,9 +12783,9 @@ export type TaxonomyBlockRuleRequest = {
12477
12783
  /**
12478
12784
  * Rule Pattern
12479
12785
  *
12480
- * One of 11 cm:BusinessRulePattern mechanisms.
12786
+ * One of the cm:BusinessRulePattern mechanisms. 'Derive' rules COMPUTE a value from bound operand facts (compute-metrics) rather than verify one — the tenant-authored-metric pattern.
12481
12787
  */
12482
- rule_pattern: 'Adjustment' | 'CoExists' | 'EqualTo' | 'Exists' | 'GreaterThan' | 'GreaterThanOrEqualToZero' | 'LessThan' | 'RollForward' | 'RollUp' | 'SumEquals' | 'Variance';
12788
+ rule_pattern: 'Adjustment' | 'CoExists' | 'Derive' | 'EqualTo' | 'Exists' | 'GreaterThan' | 'GreaterThanOrEqualToZero' | 'LessThan' | 'RollForward' | 'RollUp' | 'SumEquals' | 'Variance';
12483
12789
  /**
12484
12790
  * Expression
12485
12791
  *
@@ -13960,7 +14266,9 @@ export type ViewConfig = {
13960
14266
  * mode; missing projections (those still in backlog) render as empty
13961
14267
  * states without breaking the dispatcher.
13962
14268
  *
13963
- * Today: ``rendering`` is computed for the statement family.
14269
+ * Today: ``rendering`` is computed for the statement family, and
14270
+ * ``chart`` (the 7th arm — panel/series config over the rendering's
14271
+ * rows and periods) for metric blocks.
13964
14272
  * Other arms (``fact_table``, ``model_structure``, ``verification_results``,
13965
14273
  * ``report_elements``, ``business_rules``) come online as their backend
13966
14274
  * support lands; ``fact_table`` is trivially derivable from
@@ -13969,6 +14277,7 @@ export type ViewConfig = {
13969
14277
  */
13970
14278
  export type ViewProjections = {
13971
14279
  rendering?: RenderingLite | null;
14280
+ chart?: ChartLite | null;
13972
14281
  };
13973
14282
  /**
13974
14283
  * _CreateLegacyArm
@@ -21004,6 +21313,65 @@ export type EvaluateRulesResponses = {
21004
21313
  200: OperationEnvelopeEvaluateRulesResponse;
21005
21314
  };
21006
21315
  export type EvaluateRulesResponse2 = EvaluateRulesResponses[keyof EvaluateRulesResponses];
21316
+ export type ComputeMetricsData = {
21317
+ body: ComputeMetricsRequest;
21318
+ headers?: {
21319
+ /**
21320
+ * Idempotency-Key
21321
+ */
21322
+ 'Idempotency-Key'?: string | null;
21323
+ };
21324
+ path: {
21325
+ /**
21326
+ * Graph Id
21327
+ */
21328
+ graph_id: string;
21329
+ };
21330
+ query?: never;
21331
+ url: '/extensions/roboledger/{graph_id}/operations/compute-metrics';
21332
+ };
21333
+ export type ComputeMetricsErrors = {
21334
+ /**
21335
+ * Invalid request
21336
+ */
21337
+ 400: ErrorResponse;
21338
+ /**
21339
+ * Authentication required
21340
+ */
21341
+ 401: ErrorResponse;
21342
+ /**
21343
+ * Access denied
21344
+ */
21345
+ 403: ErrorResponse;
21346
+ /**
21347
+ * Resource not found
21348
+ */
21349
+ 404: ErrorResponse;
21350
+ /**
21351
+ * Idempotency-Key conflict — key reused with different body
21352
+ */
21353
+ 409: ErrorResponse;
21354
+ /**
21355
+ * Validation error
21356
+ */
21357
+ 422: ErrorResponse;
21358
+ /**
21359
+ * Rate limit exceeded
21360
+ */
21361
+ 429: ErrorResponse;
21362
+ /**
21363
+ * Internal server error
21364
+ */
21365
+ 500: ErrorResponse;
21366
+ };
21367
+ export type ComputeMetricsError = ComputeMetricsErrors[keyof ComputeMetricsErrors];
21368
+ export type ComputeMetricsResponses = {
21369
+ /**
21370
+ * Successful Response
21371
+ */
21372
+ 200: OperationEnvelopeComputeMetricsResponse;
21373
+ };
21374
+ export type ComputeMetricsResponse2 = ComputeMetricsResponses[keyof ComputeMetricsResponses];
21007
21375
  export type BindTextBlockData = {
21008
21376
  body: BindTextBlockRequest;
21009
21377
  headers?: {