@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.
package/types.gen.ts CHANGED
@@ -951,6 +951,88 @@ export type ChangeTierOp = {
951
951
  new_tier: 'ladybug-standard' | 'ladybug-large' | 'ladybug-xlarge';
952
952
  };
953
953
 
954
+ /**
955
+ * ChartLite
956
+ *
957
+ * Server-shaped chart projection — panel/series CONFIG, never values.
958
+ *
959
+ * The second real server-computed View arm (after ``rendering``). Values
960
+ * come from ``rendering.rows`` joined by ``element_id``; the x-axis is
961
+ * ``rendering.periods``. Renderers (report-components) turn one panel
962
+ * into one chart.
963
+ */
964
+ export type ChartLite = {
965
+ /**
966
+ * Panels
967
+ */
968
+ panels?: Array<ChartPanelLite>;
969
+ };
970
+
971
+ /**
972
+ * ChartPanelLite
973
+ *
974
+ * One chart panel — series sharing a y-axis format family.
975
+ *
976
+ * Mixed-unit catalogs are unplottable on one axis, so the server groups
977
+ * rows into panels by ``item_type`` family (NULL falls back to
978
+ * ``is_monetary``). The x-axis is always ``rendering.periods``.
979
+ */
980
+ export type ChartPanelLite = {
981
+ /**
982
+ * Label
983
+ *
984
+ * Panel heading — e.g. 'Monetary', 'Ratios'.
985
+ */
986
+ label?: string | null;
987
+ /**
988
+ * Item Type
989
+ *
990
+ * Format family shared by the panel's series (monetary | ratio | percent | multiple | days); None for the untyped fallback panel.
991
+ */
992
+ item_type?: string | null;
993
+ /**
994
+ * Kind
995
+ *
996
+ * Per-panel mark — 'line' or 'bar'.
997
+ */
998
+ kind?: string;
999
+ /**
1000
+ * Series
1001
+ */
1002
+ series?: Array<ChartSeriesLite>;
1003
+ };
1004
+
1005
+ /**
1006
+ * ChartSeriesLite
1007
+ *
1008
+ * One plottable series in a chart panel.
1009
+ *
1010
+ * Carries structure and identity only — the values live in the sibling
1011
+ * ``rendering.rows`` (join on ``element_id``), so the chart arm never
1012
+ * duplicates the value matrix. ``key`` is the stable series identity for
1013
+ * client state (colors, toggles); today it equals ``element_id``, and
1014
+ * future axes (the forecast scenario) arrive as new fields on this
1015
+ * model, never a new arm shape.
1016
+ */
1017
+ export type ChartSeriesLite = {
1018
+ /**
1019
+ * Key
1020
+ *
1021
+ * Stable series id — element_id today.
1022
+ */
1023
+ key: string;
1024
+ /**
1025
+ * Element Id
1026
+ */
1027
+ element_id: string;
1028
+ /**
1029
+ * Label
1030
+ *
1031
+ * Display name for legends.
1032
+ */
1033
+ label: string;
1034
+ };
1035
+
954
1036
  /**
955
1037
  * CheckoutResponse
956
1038
  *
@@ -1148,6 +1230,135 @@ export type ClosePeriodResponse = {
1148
1230
  evaluated_structure_ids?: Array<string>;
1149
1231
  };
1150
1232
 
1233
+ /**
1234
+ * ComputeMetricsRequest
1235
+ *
1236
+ * Request body for the ``compute-metrics`` operation.
1237
+ *
1238
+ * Resolves the ``Derive`` rules scoped to the metric block, binds each
1239
+ * rule's operands to the entity's most recent persisted report facts at
1240
+ * ``period_end``, evaluates, and upserts the period's standing
1241
+ * ``factset_type='metric'`` FactSet (re-running a period replaces its
1242
+ * facts). One standing FactSet per (structure, entity, period_end) — the
1243
+ * accumulating time series.
1244
+ */
1245
+ export type ComputeMetricsRequest = {
1246
+ /**
1247
+ * Structure Id
1248
+ *
1249
+ * Metric block structure (block_type='metric') to compute.
1250
+ */
1251
+ structure_id: string;
1252
+ /**
1253
+ * Period End
1254
+ *
1255
+ * 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).
1256
+ */
1257
+ period_end: string;
1258
+ /**
1259
+ * Period Start
1260
+ *
1261
+ * Optional lower bound for duration-operand binding and the standing FactSet's period_start.
1262
+ */
1263
+ period_start?: string | null;
1264
+ /**
1265
+ * Entity Id
1266
+ *
1267
+ * Entity to compute for. Defaults to the graph's earliest-created entity (the primary entity for single-entity graphs).
1268
+ */
1269
+ entity_id?: string | null;
1270
+ };
1271
+
1272
+ /**
1273
+ * ComputeMetricsResponse
1274
+ *
1275
+ * Response for the ``compute-metrics`` operation.
1276
+ */
1277
+ export type ComputeMetricsResponse = {
1278
+ /**
1279
+ * Structure Id
1280
+ */
1281
+ structure_id: string;
1282
+ /**
1283
+ * Entity Id
1284
+ */
1285
+ entity_id: string;
1286
+ /**
1287
+ * Period End
1288
+ */
1289
+ period_end: string;
1290
+ /**
1291
+ * Fact Set Id
1292
+ *
1293
+ * Standing metric FactSet for the period — None when every metric was skipped and no prior set existed.
1294
+ */
1295
+ fact_set_id?: string | null;
1296
+ /**
1297
+ * Computed
1298
+ */
1299
+ computed?: Array<ComputedMetricLite>;
1300
+ /**
1301
+ * Skipped
1302
+ */
1303
+ skipped?: Array<SkippedMetricLite>;
1304
+ };
1305
+
1306
+ /**
1307
+ * ComputedMetricLite
1308
+ *
1309
+ * One metric computed by a ``compute-metrics`` run.
1310
+ */
1311
+ export type ComputedMetricLite = {
1312
+ /**
1313
+ * Rule Id
1314
+ *
1315
+ * Derive rule that produced the value.
1316
+ */
1317
+ rule_id: string;
1318
+ /**
1319
+ * Element Id
1320
+ *
1321
+ * Metric element the fact was written for.
1322
+ */
1323
+ element_id: string;
1324
+ /**
1325
+ * Element Qname
1326
+ *
1327
+ * Metric element qname (e.g. rs-metric:CurrentRatio).
1328
+ */
1329
+ element_qname?: string | null;
1330
+ /**
1331
+ * Name
1332
+ *
1333
+ * Metric display name.
1334
+ */
1335
+ name: string;
1336
+ /**
1337
+ * Value
1338
+ *
1339
+ * Computed value.
1340
+ */
1341
+ value: number;
1342
+ /**
1343
+ * Unit
1344
+ *
1345
+ * Fact unit — 'USD' for monetary, 'days' for days, else 'pure'.
1346
+ */
1347
+ unit: string;
1348
+ /**
1349
+ * Period Type
1350
+ *
1351
+ * 'instant' or 'duration'.
1352
+ */
1353
+ period_type: string;
1354
+ /**
1355
+ * Item Type
1356
+ *
1357
+ * Format family from the metric element (monetary | ratio | percent | multiple | days). None means untyped; fall back to unit.
1358
+ */
1359
+ item_type?: string | null;
1360
+ };
1361
+
1151
1362
  /**
1152
1363
  * ConnectionLite
1153
1364
  *
@@ -3598,6 +3809,12 @@ export type ElementLite = {
3598
3809
  * Period Type
3599
3810
  */
3600
3811
  period_type?: string | null;
3812
+ /**
3813
+ * Item Type
3814
+ *
3815
+ * Value-domain vocabulary (monetary | ratio | percent | multiple | days | string | …). None means untyped; fall back to is_monetary.
3816
+ */
3817
+ item_type?: string | null;
3601
3818
  };
3602
3819
 
3603
3820
  /**
@@ -7467,6 +7684,52 @@ export type OperationEnvelopeClosePeriodResponse = {
7467
7684
  idempotentReplay?: boolean;
7468
7685
  };
7469
7686
 
7687
+ /**
7688
+ * OperationEnvelope[ComputeMetricsResponse]
7689
+ */
7690
+ export type OperationEnvelopeComputeMetricsResponse = {
7691
+ /**
7692
+ * Operation
7693
+ *
7694
+ * Kebab-case operation name
7695
+ */
7696
+ operation: string;
7697
+ /**
7698
+ * Operationid
7699
+ *
7700
+ * op_-prefixed ULID for audit and SSE correlation
7701
+ */
7702
+ operationId: string;
7703
+ /**
7704
+ * Status
7705
+ *
7706
+ * Operation lifecycle state
7707
+ */
7708
+ status: 'completed' | 'pending' | 'failed';
7709
+ /**
7710
+ * Command-specific result payload
7711
+ */
7712
+ result?: ComputeMetricsResponse | null;
7713
+ /**
7714
+ * At
7715
+ *
7716
+ * ISO-8601 UTC timestamp
7717
+ */
7718
+ at: string;
7719
+ /**
7720
+ * Createdby
7721
+ *
7722
+ * User ID that initiated the operation (null for legacy callers)
7723
+ */
7724
+ createdBy?: string | null;
7725
+ /**
7726
+ * Idempotentreplay
7727
+ *
7728
+ * True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.
7729
+ */
7730
+ idempotentReplay?: boolean;
7731
+ };
7732
+
7470
7733
  /**
7471
7734
  * OperationEnvelope[DeleteInformationBlockResponse]
7472
7735
  */
@@ -10412,6 +10675,12 @@ export type RenderingRowLite = {
10412
10675
  * Balance Type
10413
10676
  */
10414
10677
  balance_type?: string | null;
10678
+ /**
10679
+ * Item Type
10680
+ *
10681
+ * 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.
10682
+ */
10683
+ item_type?: string | null;
10415
10684
  /**
10416
10685
  * Values
10417
10686
  */
@@ -11831,6 +12100,42 @@ export type ShareResultItem = {
11831
12100
  fact_count?: number;
11832
12101
  };
11833
12102
 
12103
+ /**
12104
+ * SkippedMetricLite
12105
+ *
12106
+ * One metric a ``compute-metrics`` run could not compute.
12107
+ *
12108
+ * Soft-fail by design: a missing operand fact (e.g. InterestExpense for a
12109
+ * debt-free entity) or an undefined ratio (division by zero) skips the
12110
+ * metric with a reason — it never errors the run.
12111
+ */
12112
+ export type SkippedMetricLite = {
12113
+ /**
12114
+ * Rule Id
12115
+ *
12116
+ * Derive rule that was skipped.
12117
+ */
12118
+ rule_id: string;
12119
+ /**
12120
+ * Element Qname
12121
+ *
12122
+ * Metric element qname the rule targets.
12123
+ */
12124
+ element_qname?: string | null;
12125
+ /**
12126
+ * Reason
12127
+ *
12128
+ * Why the metric was skipped.
12129
+ */
12130
+ reason: string;
12131
+ /**
12132
+ * Missing
12133
+ *
12134
+ * Operand qnames with no bound fact at the period, when applicable.
12135
+ */
12136
+ missing?: Array<string>;
12137
+ };
12138
+
11834
12139
  /**
11835
12140
  * SqlStatementRequest
11836
12141
  */
@@ -12020,6 +12325,11 @@ export type StructureSummary = {
12020
12325
  * StructureUpdatePatch
12021
12326
  *
12022
12327
  * Partial-update patch for a single structure, keyed by structure_id.
12328
+ *
12329
+ * ``concept_arrangement`` makes a mis-CAP'd structure repairable in
12330
+ * place (e.g. promoting a ``set`` note to ``roll_up`` so it gains a
12331
+ * footing rule); ``block_type`` stays immutable — it drives block-type
12332
+ * routing, so changing it is a re-create, not an edit.
12023
12333
  */
12024
12334
  export type StructureUpdatePatch = {
12025
12335
  /**
@@ -12040,6 +12350,10 @@ export type StructureUpdatePatch = {
12040
12350
  * Role Uri
12041
12351
  */
12042
12352
  role_uri?: string | null;
12353
+ /**
12354
+ * Concept Arrangement
12355
+ */
12356
+ 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;
12043
12357
  /**
12044
12358
  * Metadata
12045
12359
  */
@@ -12787,9 +13101,9 @@ export type TaxonomyBlockRuleRequest = {
12787
13101
  /**
12788
13102
  * Rule Pattern
12789
13103
  *
12790
- * One of 11 cm:BusinessRulePattern mechanisms.
13104
+ * 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.
12791
13105
  */
12792
- rule_pattern: 'Adjustment' | 'CoExists' | 'EqualTo' | 'Exists' | 'GreaterThan' | 'GreaterThanOrEqualToZero' | 'LessThan' | 'RollForward' | 'RollUp' | 'SumEquals' | 'Variance';
13106
+ rule_pattern: 'Adjustment' | 'CoExists' | 'Derive' | 'EqualTo' | 'Exists' | 'GreaterThan' | 'GreaterThanOrEqualToZero' | 'LessThan' | 'RollForward' | 'RollUp' | 'SumEquals' | 'Variance';
12793
13107
  /**
12794
13108
  * Expression
12795
13109
  *
@@ -14311,7 +14625,9 @@ export type ViewConfig = {
14311
14625
  * mode; missing projections (those still in backlog) render as empty
14312
14626
  * states without breaking the dispatcher.
14313
14627
  *
14314
- * Today: ``rendering`` is computed for the statement family.
14628
+ * Today: ``rendering`` is computed for the statement family, and
14629
+ * ``chart`` (the 7th arm — panel/series config over the rendering's
14630
+ * rows and periods) for metric blocks.
14315
14631
  * Other arms (``fact_table``, ``model_structure``, ``verification_results``,
14316
14632
  * ``report_elements``, ``business_rules``) come online as their backend
14317
14633
  * support lands; ``fact_table`` is trivially derivable from
@@ -14320,6 +14636,7 @@ export type ViewConfig = {
14320
14636
  */
14321
14637
  export type ViewProjections = {
14322
14638
  rendering?: RenderingLite | null;
14639
+ chart?: ChartLite | null;
14323
14640
  };
14324
14641
 
14325
14642
  /**
@@ -22022,6 +22339,70 @@ export type EvaluateRulesResponses = {
22022
22339
 
22023
22340
  export type EvaluateRulesResponse2 = EvaluateRulesResponses[keyof EvaluateRulesResponses];
22024
22341
 
22342
+ export type ComputeMetricsData = {
22343
+ body: ComputeMetricsRequest;
22344
+ headers?: {
22345
+ /**
22346
+ * Idempotency-Key
22347
+ */
22348
+ 'Idempotency-Key'?: string | null;
22349
+ };
22350
+ path: {
22351
+ /**
22352
+ * Graph Id
22353
+ */
22354
+ graph_id: string;
22355
+ };
22356
+ query?: never;
22357
+ url: '/extensions/roboledger/{graph_id}/operations/compute-metrics';
22358
+ };
22359
+
22360
+ export type ComputeMetricsErrors = {
22361
+ /**
22362
+ * Invalid request
22363
+ */
22364
+ 400: ErrorResponse;
22365
+ /**
22366
+ * Authentication required
22367
+ */
22368
+ 401: ErrorResponse;
22369
+ /**
22370
+ * Access denied
22371
+ */
22372
+ 403: ErrorResponse;
22373
+ /**
22374
+ * Resource not found
22375
+ */
22376
+ 404: ErrorResponse;
22377
+ /**
22378
+ * Idempotency-Key conflict — key reused with different body
22379
+ */
22380
+ 409: ErrorResponse;
22381
+ /**
22382
+ * Validation error
22383
+ */
22384
+ 422: ErrorResponse;
22385
+ /**
22386
+ * Rate limit exceeded
22387
+ */
22388
+ 429: ErrorResponse;
22389
+ /**
22390
+ * Internal server error
22391
+ */
22392
+ 500: ErrorResponse;
22393
+ };
22394
+
22395
+ export type ComputeMetricsError = ComputeMetricsErrors[keyof ComputeMetricsErrors];
22396
+
22397
+ export type ComputeMetricsResponses = {
22398
+ /**
22399
+ * Successful Response
22400
+ */
22401
+ 200: OperationEnvelopeComputeMetricsResponse;
22402
+ };
22403
+
22404
+ export type ComputeMetricsResponse2 = ComputeMetricsResponses[keyof ComputeMetricsResponses];
22405
+
22025
22406
  export type BindTextBlockData = {
22026
22407
  body: BindTextBlockRequest;
22027
22408
  headers?: {