matelab-python-sdk 0.2.0a5__py3-none-any.whl → 0.2.0a6__py3-none-any.whl

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.
@@ -4,14 +4,14 @@
4
4
  # filename: openapi.yaml
5
5
  # version: 0.83.0
6
6
 
7
- from enum import Enum, StrEnum
7
+ from enum import StrEnum
8
8
  from typing import Annotated, Any, Literal
9
9
 
10
- from pydantic import ConfigDict, Field, RootModel, SecretStr, StrictBool, StrictFloat, StrictInt
10
+ from pydantic import ConfigDict, Field, RootModel, SecretStr, StrictBool, StrictFloat, StrictInt, confloat, conint
11
11
 
12
12
  from matelab._wire_validation import WireModel
13
13
 
14
- OPENAPI_INFO_VERSION = "2026.10.2"
14
+ OPENAPI_INFO_VERSION = "2026.10.3"
15
15
 
16
16
 
17
17
  class ResponseEnvelope(WireModel):
@@ -70,6 +70,9 @@ class ErrorDetail(RootModel[Any]):
70
70
 
71
71
 
72
72
  class ErrorResponse(WireModel):
73
+ model_config = ConfigDict(
74
+ json_schema_extra={"matelab-runtime-rules": {"properties": {"errs": {"not": {"type": "null"}}}}}
75
+ )
73
76
  code: Annotated[StrictInt, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"enum": [0, 10]}}})]
74
77
  msg: str
75
78
  """
@@ -236,6 +239,9 @@ class CloudDriveFileIdListItem(RootModel[StrictInt]):
236
239
 
237
240
  class CloudDriveFileIdList(RootModel[list[CloudDriveFileIdListItem]]):
238
241
  root: Annotated[list[CloudDriveFileIdListItem], Field(min_length=1)]
242
+ """
243
+ PHP converts entries with intval, removes duplicates and zero, then requires at least one remaining id.
244
+ """
239
245
 
240
246
 
241
247
  class DeleteCloudDriveFilesRequest(WireModel):
@@ -251,8 +257,8 @@ class DeleteCloudDriveFilesRequest(WireModel):
251
257
  "CloudDriveFileIdList": {
252
258
  "type": "array",
253
259
  "minItems": 1,
254
- "uniqueItems": True,
255
260
  "items": {"type": "integer", "minimum": 1},
261
+ "description": "PHP converts entries with intval, removes duplicates and zero, then requires at least one remaining id.",
256
262
  }
257
263
  },
258
264
  },
@@ -275,8 +281,8 @@ class TransferCloudDriveFilesRequest(WireModel):
275
281
  "CloudDriveFileIdList": {
276
282
  "type": "array",
277
283
  "minItems": 1,
278
- "uniqueItems": True,
279
284
  "items": {"type": "integer", "minimum": 1},
285
+ "description": "PHP converts entries with intval, removes duplicates and zero, then requires at least one remaining id.",
280
286
  }
281
287
  },
282
288
  },
@@ -289,7 +295,9 @@ class TransferCloudDriveFilesRequest(WireModel):
289
295
 
290
296
 
291
297
  class UploadAttachmentRequest(WireModel):
292
- model_config = ConfigDict(extra="forbid")
298
+ model_config = ConfigDict(
299
+ extra="forbid", json_schema_extra={"matelab-runtime-rules": {"properties": {"user": {"not": {"type": "null"}}}}}
300
+ )
293
301
  eln: Annotated[str, Field(min_length=1)]
294
302
  """
295
303
  Notebook title used to check write permission and select its data
@@ -445,38 +453,26 @@ class ShareMultipleTemplatesRequest(WireModel):
445
453
  Field(
446
454
  json_schema_extra={
447
455
  "contentMediaType": "application/json",
448
- "contentSchema": {
449
- "type": "array",
450
- "minItems": 1,
451
- "maxItems": 10,
452
- "uniqueItems": True,
453
- "items": {"type": "integer", "minimum": 1},
454
- },
456
+ "contentSchema": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 1}},
455
457
  },
456
458
  min_length=1,
457
459
  ),
458
460
  ]
459
461
  """
460
- JSON-encoded owned template-id list.
462
+ JSON-encoded owned template ids. PHP converts entries with intval, removes duplicates and zero, then checks the 1–10 count.
461
463
  """
462
464
  users: Annotated[
463
465
  str,
464
466
  Field(
465
467
  json_schema_extra={
466
468
  "contentMediaType": "application/json",
467
- "contentSchema": {
468
- "type": "array",
469
- "minItems": 1,
470
- "maxItems": 10,
471
- "uniqueItems": True,
472
- "items": {"type": "integer", "minimum": 1},
473
- },
469
+ "contentSchema": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 1}},
474
470
  },
475
471
  min_length=1,
476
472
  ),
477
473
  ]
478
474
  """
479
- JSON-encoded recipient user-id list.
475
+ JSON-encoded recipient user ids. PHP converts entries with intval, removes duplicates and zero, then checks the 1–10 count.
480
476
  """
481
477
 
482
478
 
@@ -551,8 +547,22 @@ class SaveTemplateContentRequest(WireModel):
551
547
  "items": {"$ref": "#/$defs/TemplateWriteModule"},
552
548
  "$defs": {
553
549
  "TemplateWriteModule": {
550
+ "properties": {
551
+ "name": {"$ref": "#/$defs/TemplateWriteName"},
552
+ "type": {"not": {"const": "0"}},
553
+ },
554
554
  "allOf": [
555
555
  {"$ref": "#/$defs/TemplateModule"},
556
+ {
557
+ "if": {"properties": {"type": {"enum": ["form", "table"]}}, "required": ["type"]},
558
+ "then": {
559
+ "properties": {
560
+ "data": {
561
+ "items": {"properties": {"name": {"$ref": "#/$defs/TemplateWriteName"}}}
562
+ }
563
+ }
564
+ },
565
+ },
556
566
  {
557
567
  "if": {
558
568
  "properties": {
@@ -576,6 +586,14 @@ class SaveTemplateContentRequest(WireModel):
576
586
  ],
577
587
  "description": "Template-save input. Non-null styled JSON code must carry JSON text;\nthe decoded JSON may have any JSON type. This write-only constraint\ndoes not apply to raw code returned from record or template reads.\n",
578
588
  },
589
+ "TemplateWriteName": {
590
+ "type": "string",
591
+ "pattern": "[^ \\t\\n\\r\\u0000\\u000b]",
592
+ "not": {
593
+ "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
594
+ },
595
+ "description": "Template saving rejects names that are empty after PHP trim, numeric, or duplicates in their containing module, column or field list.",
596
+ },
579
597
  "TemplateModule": {
580
598
  "type": "object",
581
599
  "required": ["name", "type"],
@@ -583,16 +601,15 @@ class SaveTemplateContentRequest(WireModel):
583
601
  "name": {
584
602
  "type": "string",
585
603
  "minLength": 1,
586
- "pattern": ".*[^0-9.\\-+eE ].*",
587
- "description": "PHP trims the name, rejects an empty or purely numeric value, and\nrejects duplicate names across the module array.\n",
604
+ "description": "Stored module name. Record updates can create numeric names; template-save name checks apply only to TemplateWriteModule.",
588
605
  },
589
606
  "type": {"type": "string", "minLength": 1},
590
607
  "data": {
591
- "type": ["object", "array", "string", "number", "boolean", "null"],
608
+ "type": ["object", "array", "string", "integer", "number", "boolean", "null"],
592
609
  "description": "Runtime requirements depend on the target module type.",
593
610
  "nullable": True,
594
611
  },
595
- "language": {"type": "string"},
612
+ "language": {},
596
613
  "style": {},
597
614
  },
598
615
  "allOf": [
@@ -616,7 +633,11 @@ class SaveTemplateContentRequest(WireModel):
616
633
  },
617
634
  {
618
635
  "if": {
619
- "properties": {"type": {"const": "code"}, "language": {"const": "json"}},
636
+ "properties": {
637
+ "type": {"const": "code"},
638
+ "language": {"const": "json"},
639
+ "style": {"not": {"type": "null"}},
640
+ },
620
641
  "required": ["type", "language", "style"],
621
642
  },
622
643
  "then": {
@@ -637,12 +658,7 @@ class SaveTemplateContentRequest(WireModel):
637
658
  "type": "object",
638
659
  "required": ["name", "type", "data"],
639
660
  "properties": {
640
- "name": {
641
- "type": "string",
642
- "minLength": 1,
643
- "pattern": ".*[^0-9.\\-+eE ].*",
644
- "description": "PHP also rejects duplicate names within the table.",
645
- },
661
+ "name": {"type": "string", "minLength": 1},
646
662
  "type": {"type": "string"},
647
663
  "data": {"type": "array"},
648
664
  },
@@ -669,7 +685,7 @@ class SaveTemplateContentRequest(WireModel):
669
685
  "type": "array",
670
686
  "items": {
671
687
  "oneOf": [
672
- {"type": "number"},
688
+ {"type": ["integer", "number"]},
673
689
  {
674
690
  "type": "string",
675
691
  "pattern": "^[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?$",
@@ -739,14 +755,7 @@ class SaveTemplateContentRequest(WireModel):
739
755
  "TemplateFormItem": {
740
756
  "type": "object",
741
757
  "required": ["name"],
742
- "properties": {
743
- "name": {
744
- "type": "string",
745
- "minLength": 1,
746
- "pattern": ".*[^0-9.\\-+eE ].*",
747
- "description": "PHP also rejects duplicate names within the form.",
748
- }
749
- },
758
+ "properties": {"name": {"type": "string", "minLength": 1}},
750
759
  "additionalProperties": True,
751
760
  },
752
761
  },
@@ -782,6 +791,25 @@ class UpdateTemplateIntroRequest(WireModel):
782
791
  uid: Annotated[str, Field(min_length=1)]
783
792
 
784
793
 
794
+ class TemplateWriteName(RootModel[str]):
795
+ root: Annotated[
796
+ str,
797
+ Field(
798
+ json_schema_extra={
799
+ "matelab-runtime-rules": {
800
+ "not": {
801
+ "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
802
+ }
803
+ }
804
+ },
805
+ pattern="[^ \\t\\n\\r\\u0000\\u000b]",
806
+ ),
807
+ ]
808
+ """
809
+ Template saving rejects names that are empty after PHP trim, numeric, or duplicates in their containing module, column or field list.
810
+ """
811
+
812
+
785
813
  class TemplateModule(WireModel):
786
814
  model_config = ConfigDict(
787
815
  extra="allow",
@@ -804,7 +832,11 @@ class TemplateModule(WireModel):
804
832
  },
805
833
  {
806
834
  "if": {
807
- "properties": {"type": {"const": "code"}, "language": {"const": "json"}},
835
+ "properties": {
836
+ "type": {"const": "code"},
837
+ "language": {"const": "json"},
838
+ "style": {"not": {"type": "null"}},
839
+ },
808
840
  "required": ["type", "language", "style"],
809
841
  },
810
842
  "then": {
@@ -824,12 +856,7 @@ class TemplateModule(WireModel):
824
856
  "type": "object",
825
857
  "required": ["name", "type", "data"],
826
858
  "properties": {
827
- "name": {
828
- "type": "string",
829
- "minLength": 1,
830
- "pattern": ".*[^0-9.\\-+eE ].*",
831
- "description": "PHP also rejects duplicate names within the table.",
832
- },
859
+ "name": {"type": "string", "minLength": 1},
833
860
  "type": {"type": "string"},
834
861
  "data": {"type": "array"},
835
862
  },
@@ -856,7 +883,7 @@ class TemplateModule(WireModel):
856
883
  "type": "array",
857
884
  "items": {
858
885
  "oneOf": [
859
- {"type": "number"},
886
+ {"type": ["integer", "number"]},
860
887
  {
861
888
  "type": "string",
862
889
  "pattern": "^[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?$",
@@ -926,32 +953,23 @@ class TemplateModule(WireModel):
926
953
  "TemplateFormItem": {
927
954
  "type": "object",
928
955
  "required": ["name"],
929
- "properties": {
930
- "name": {
931
- "type": "string",
932
- "minLength": 1,
933
- "pattern": ".*[^0-9.\\-+eE ].*",
934
- "description": "PHP also rejects duplicate names within the form.",
935
- }
936
- },
956
+ "properties": {"name": {"type": "string", "minLength": 1}},
937
957
  "additionalProperties": True,
938
958
  },
939
959
  },
940
960
  }
941
961
  },
942
962
  )
943
- name: Annotated[str, Field(min_length=1, pattern=".*[^0-9.\\-+eE ].*")]
963
+ name: Annotated[str, Field(min_length=1)]
944
964
  """
945
- PHP trims the name, rejects an empty or purely numeric value, and
946
- rejects duplicate names across the module array.
947
-
965
+ Stored module name. Record updates can create numeric names; template-save name checks apply only to TemplateWriteModule.
948
966
  """
949
967
  type: Annotated[str, Field(min_length=1)]
950
- data: dict[str, Any] | list[Any] | str | StrictFloat | StrictBool | None = None
968
+ data: dict[str, Any] | list[Any] | str | StrictInt | StrictFloat | StrictBool | None = None
951
969
  """
952
970
  Runtime requirements depend on the target module type.
953
971
  """
954
- language: str | None = None
972
+ language: Any | None = None
955
973
  style: Any | None = None
956
974
 
957
975
 
@@ -980,7 +998,7 @@ class TemplateTableColumn(WireModel):
980
998
  "type": "array",
981
999
  "items": {
982
1000
  "oneOf": [
983
- {"type": "number"},
1001
+ {"type": ["integer", "number"]},
984
1002
  {
985
1003
  "type": "string",
986
1004
  "pattern": "^[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?$",
@@ -1048,10 +1066,7 @@ class TemplateTableColumn(WireModel):
1048
1066
  }
1049
1067
  },
1050
1068
  )
1051
- name: Annotated[str, Field(min_length=1, pattern=".*[^0-9.\\-+eE ].*")]
1052
- """
1053
- PHP also rejects duplicate names within the table.
1054
- """
1069
+ name: Annotated[str, Field(min_length=1)]
1055
1070
  type: str
1056
1071
  data: list[Any]
1057
1072
 
@@ -1074,10 +1089,7 @@ class RecordAttachment(WireModel):
1074
1089
 
1075
1090
  class TemplateFormItem(WireModel):
1076
1091
  model_config = ConfigDict(extra="allow")
1077
- name: Annotated[str, Field(min_length=1, pattern=".*[^0-9.\\-+eE ].*")]
1078
- """
1079
- PHP also rejects duplicate names within the form.
1080
- """
1092
+ name: Annotated[str, Field(min_length=1)]
1081
1093
 
1082
1094
 
1083
1095
  class TemplateContentResponse(WireModel):
@@ -1156,6 +1168,9 @@ class UpdateTemplateIntroResponse(WireModel):
1156
1168
 
1157
1169
 
1158
1170
  class TemplateListItem(WireModel):
1171
+ model_config = ConfigDict(
1172
+ json_schema_extra={"matelab-runtime-rules": {"properties": {"id": {"not": {"type": "null"}}}}}
1173
+ )
1159
1174
  id: Annotated[StrictInt | None, Field(ge=1)] = None
1160
1175
  template_id: Annotated[StrictInt, Field(ge=1)]
1161
1176
  template_name: Annotated[str | None, Field(...)]
@@ -1165,7 +1180,7 @@ class TemplateListItem(WireModel):
1165
1180
  class PendingTemplateListItem(WireModel):
1166
1181
  id: Annotated[StrictInt, Field(ge=1)]
1167
1182
  template_id: Annotated[StrictInt, Field(ge=1)]
1168
- template_name: Annotated[str | None, Field(...)]
1183
+ template_name: str
1169
1184
  comm: Annotated[str | None, Field(...)]
1170
1185
  userid: Annotated[StrictInt, Field(ge=0, le=0)]
1171
1186
  username: Annotated[str | None, Field(...)]
@@ -1174,7 +1189,7 @@ class PendingTemplateListItem(WireModel):
1174
1189
  class StoreTemplateListItem(WireModel):
1175
1190
  id: Annotated[StrictInt, Field(ge=1)]
1176
1191
  template_id: Annotated[StrictInt, Field(ge=1)]
1177
- template_name: Annotated[str | None, Field(...)]
1192
+ template_name: str
1178
1193
  comm: Annotated[str | None, Field(...)]
1179
1194
  pub: Annotated[StrictInt, Field(ge=2, le=2)]
1180
1195
  username: Annotated[str | None, Field(...)]
@@ -1213,12 +1228,15 @@ class DefaultTemplateListItem(WireModel):
1213
1228
  class OwnedTemplateListItem(WireModel):
1214
1229
  id: Annotated[StrictInt, Field(ge=1)]
1215
1230
  template_id: Annotated[StrictInt, Field(ge=1)]
1216
- template_name: Annotated[str | None, Field(...)]
1231
+ template_name: str
1217
1232
  comm: Annotated[str | None, Field(...)]
1218
1233
  intro: Annotated[str | None, Field(...)]
1219
1234
  version: Annotated[StrictInt, Field(ge=0)]
1220
1235
  datetime: Annotated[str | None, Field(...)]
1221
- keyword: list[Any]
1236
+ keyword: dict[str, Any] | list[Any] | str | StrictInt | StrictFloat | StrictBool
1237
+ """
1238
+ Stored JSON is decoded without type normalization; missing or JSON null becomes an empty array.
1239
+ """
1222
1240
  userid_from: Annotated[StrictInt, Field(ge=0)]
1223
1241
  username: Annotated[str | None, Field(...)]
1224
1242
  idphoto: Annotated[str | None, Field(...)]
@@ -1328,7 +1346,7 @@ class SaveNotebookRequest(WireModel):
1328
1346
  "required": ["uid", "path"],
1329
1347
  "properties": {
1330
1348
  "uid": {
1331
- "type": ["object", "array", "string", "number", "boolean"],
1349
+ "type": ["object", "array", "string", "integer", "number", "boolean"],
1332
1350
  "description": "Non-null display alias; PHP compares aliases loosely for uniqueness.",
1333
1351
  },
1334
1352
  "path": {"$ref": "#/$defs/ExtractionPath"},
@@ -1346,10 +1364,14 @@ class SaveNotebookRequest(WireModel):
1346
1364
  {"$ref": "#/$defs/ExtractionPathName"},
1347
1365
  ],
1348
1366
  "items": False,
1349
- "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or non-negative\nindices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1367
+ "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or numeric indices,\nincluding numeric-string indices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1350
1368
  },
1351
1369
  "ExtractionPathSelector": {
1352
- "oneOf": [{"$ref": "#/$defs/ExtractionPathName"}, {"type": "integer", "minimum": 0}]
1370
+ "oneOf": [
1371
+ {"type": "string", "pattern": "[^ \\t\\n\\r\\u0000\\u000b]"},
1372
+ {"type": ["integer", "number"], "exclusiveMinimum": -1},
1373
+ ],
1374
+ "description": "PHP treats numeric strings and numbers as indices, truncates them toward\nzero, and rejects a negative resulting index. Non-numeric strings select\nnames and must remain non-empty after PHP trim. Numeric-string range\nvalidation is performed by the Provider.\n",
1353
1375
  },
1354
1376
  "ExtractionPathName": {
1355
1377
  "type": "string",
@@ -1357,7 +1379,7 @@ class SaveNotebookRequest(WireModel):
1357
1379
  "not": {
1358
1380
  "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
1359
1381
  },
1360
- "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. Numeric selectors use JSON integers in this callable subset.\n",
1382
+ "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. The fourth extraction-path segment uses this name form.\n",
1361
1383
  },
1362
1384
  },
1363
1385
  },
@@ -1368,8 +1390,9 @@ class SaveNotebookRequest(WireModel):
1368
1390
  Optional JSON-encoded list-display configuration. Missing, explicit
1369
1391
  null, or empty string is normalized to null. A non-empty value is
1370
1392
  validated only when display is 1. Uids must be non-null and unique
1371
- under PHP's loose comparison; indices use JSON integers and the
1372
- fourth path segment is a non-numeric property name.
1393
+ under PHP's loose comparison; the fourth path segment is a
1394
+ non-numeric property name. Numeric selectors
1395
+ in the first three positions are converted to integers by PHP.
1373
1396
 
1374
1397
  """
1375
1398
  group_id: Annotated[StrictInt | None, Field(ge=0)] = 0
@@ -1389,20 +1412,15 @@ class AddNotebookShareRequest(WireModel):
1389
1412
  Field(
1390
1413
  json_schema_extra={
1391
1414
  "contentMediaType": "application/json",
1392
- "contentSchema": {
1393
- "type": "array",
1394
- "minItems": 1,
1395
- "uniqueItems": True,
1396
- "items": {"type": "integer", "minimum": 1},
1397
- },
1415
+ "contentSchema": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 1}},
1398
1416
  },
1399
1417
  min_length=1,
1400
1418
  ),
1401
1419
  ]
1402
1420
  """
1403
- JSON-encoded user-id list. The current contract requires at least one
1404
- positive unique user even though PHP silently filters zero and duplicate
1405
- values before applying its own self/already-shared filter.
1421
+ JSON-encoded user ids. PHP converts entries with intval, removes zero
1422
+ and duplicates, then applies its self/already-shared filter. An empty
1423
+ recipient list after these filters is rejected.
1406
1424
 
1407
1425
  """
1408
1426
 
@@ -1441,7 +1459,9 @@ class PublicRecordListRequest(WireModel):
1441
1459
  class CreateRecordRequest(WireModel):
1442
1460
  model_config = ConfigDict(extra="forbid")
1443
1461
  eln: Annotated[str, Field(min_length=1)]
1444
- title: Annotated[str, Field(max_length=100, min_length=1)]
1462
+ title: Annotated[
1463
+ str, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"const": "0"}}}, max_length=100, min_length=1)
1464
+ ]
1445
1465
  describe: Annotated[str | None, Field(max_length=256)] = ""
1446
1466
  """
1447
1467
  Missing or null becomes an empty summary.
@@ -1450,9 +1470,9 @@ class CreateRecordRequest(WireModel):
1450
1470
  """
1451
1471
  Missing, null, or empty asks the data server to generate a UID.
1452
1472
  """
1453
- user: Annotated[StrictInt | None, Field(ge=1)] = None
1473
+ user: conint(ge=0, strict=True) | str | None = None
1454
1474
  """
1455
- Missing or null selects the authenticated user's notebook.
1475
+ Owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user's notebook.
1456
1476
  """
1457
1477
  path: list[str] | None = None
1458
1478
  """
@@ -1462,9 +1482,13 @@ class CreateRecordRequest(WireModel):
1462
1482
 
1463
1483
  class ImportRecordItem(WireModel):
1464
1484
  model_config = ConfigDict(extra="forbid")
1465
- uid: Annotated[str, Field(max_length=45, min_length=1)]
1466
- title: Annotated[str, Field(max_length=100, min_length=1)]
1467
- data: dict[str, Any]
1485
+ uid: Annotated[
1486
+ str, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"const": "0"}}}, max_length=45, min_length=1)
1487
+ ]
1488
+ title: Annotated[
1489
+ str, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"const": "0"}}}, max_length=100, min_length=1)
1490
+ ]
1491
+ data: dict[str, Any] | list[Any]
1468
1492
  """
1469
1493
  Template-shaped values keyed by canonical module name. File fields
1470
1494
  and cells supplied by the request contain string references; omit a
@@ -1472,6 +1496,8 @@ class ImportRecordItem(WireModel):
1472
1496
  file entries and inline base64 are not callable on the current
1473
1497
  Provider. The selected template determines which values require
1474
1498
  file-reference validation; arbitrary text fields are unaffected.
1499
+ PHP also accepts a JSON list; entries without a matching module name
1500
+ are ignored and the corresponding template defaults remain unchanged.
1475
1501
 
1476
1502
  """
1477
1503
  keyword: str | None = ""
@@ -1552,17 +1578,42 @@ class ExtractionPathName(RootModel[str]):
1552
1578
  ]
1553
1579
  """
1554
1580
  A name that remains non-empty after PHP trim and is not a PHP numeric
1555
- string. Numeric selectors use JSON integers in this callable subset.
1581
+ string. The fourth extraction-path segment uses this name form.
1556
1582
 
1557
1583
  """
1558
1584
 
1559
1585
 
1560
- class ExtractionPathSelector1(RootModel[StrictInt]):
1561
- root: Annotated[StrictInt, Field(ge=0)]
1586
+ class ExtractionPathSelector1(RootModel[str]):
1587
+ root: Annotated[str, Field(pattern="[^ \\t\\n\\r\\u0000\\u000b]")]
1588
+ """
1589
+ PHP treats numeric strings and numbers as indices, truncates them toward
1590
+ zero, and rejects a negative resulting index. Non-numeric strings select
1591
+ names and must remain non-empty after PHP trim. Numeric-string range
1592
+ validation is performed by the Provider.
1562
1593
 
1594
+ """
1595
+
1596
+
1597
+ class ExtractionPathSelector2(RootModel[conint(gt=-1, strict=True) | confloat(gt=-1.0, strict=True)]):
1598
+ root: conint(gt=-1, strict=True) | confloat(gt=-1.0, strict=True)
1599
+ """
1600
+ PHP treats numeric strings and numbers as indices, truncates them toward
1601
+ zero, and rejects a negative resulting index. Non-numeric strings select
1602
+ names and must remain non-empty after PHP trim. Numeric-string range
1603
+ validation is performed by the Provider.
1604
+
1605
+ """
1606
+
1607
+
1608
+ class ExtractionPathSelector(RootModel[ExtractionPathSelector1 | ExtractionPathSelector2]):
1609
+ root: ExtractionPathSelector1 | ExtractionPathSelector2
1610
+ """
1611
+ PHP treats numeric strings and numbers as indices, truncates them toward
1612
+ zero, and rejects a negative resulting index. Non-numeric strings select
1613
+ names and must remain non-empty after PHP trim. Numeric-string range
1614
+ validation is performed by the Provider.
1563
1615
 
1564
- class ExtractionPathSelector(RootModel[ExtractionPathName | ExtractionPathSelector1]):
1565
- root: ExtractionPathName | ExtractionPathSelector1
1616
+ """
1566
1617
 
1567
1618
 
1568
1619
  class ExtractionPath(RootModel[list[ExtractionPathSelector | ExtractionPathName]]):
@@ -1580,7 +1631,11 @@ class ExtractionPath(RootModel[list[ExtractionPathSelector | ExtractionPathName]
1580
1631
  "items": False,
1581
1632
  "$defs": {
1582
1633
  "ExtractionPathSelector": {
1583
- "oneOf": [{"$ref": "#/$defs/ExtractionPathName"}, {"type": "integer", "minimum": 0}]
1634
+ "oneOf": [
1635
+ {"type": "string", "pattern": "[^ \\t\\n\\r\\u0000\\u000b]"},
1636
+ {"type": ["integer", "number"], "exclusiveMinimum": -1},
1637
+ ],
1638
+ "description": "PHP treats numeric strings and numbers as indices, truncates them toward\nzero, and rejects a negative resulting index. Non-numeric strings select\nnames and must remain non-empty after PHP trim. Numeric-string range\nvalidation is performed by the Provider.\n",
1584
1639
  },
1585
1640
  "ExtractionPathName": {
1586
1641
  "type": "string",
@@ -1588,7 +1643,7 @@ class ExtractionPath(RootModel[list[ExtractionPathSelector | ExtractionPathName]
1588
1643
  "not": {
1589
1644
  "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
1590
1645
  },
1591
- "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. Numeric selectors use JSON integers in this callable subset.\n",
1646
+ "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. The fourth extraction-path segment uses this name form.\n",
1592
1647
  },
1593
1648
  },
1594
1649
  }
@@ -1599,8 +1654,8 @@ class ExtractionPath(RootModel[list[ExtractionPathSelector | ExtractionPathName]
1599
1654
  ]
1600
1655
  """
1601
1656
  SQL extraction path used by search, quote and notebook list-display
1602
- requests. The first three segments select names or non-negative
1603
- indices; a fourth segment selects a non-numeric property name.
1657
+ requests. The first three segments select names or numeric indices,
1658
+ including numeric-string indices; a fourth segment selects a non-numeric property name.
1604
1659
  Selectors must address the current module structure; invalid SQL JSON
1605
1660
  paths still produce a business error.
1606
1661
 
@@ -1609,7 +1664,7 @@ class ExtractionPath(RootModel[list[ExtractionPathSelector | ExtractionPathName]
1609
1664
 
1610
1665
  class NotebookExtractionRequest(WireModel):
1611
1666
  model_config = ConfigDict(extra="forbid")
1612
- uid: dict[str, Any] | list[Any] | str | StrictFloat | StrictBool
1667
+ uid: dict[str, Any] | list[Any] | str | StrictInt | StrictFloat | StrictBool
1613
1668
  """
1614
1669
  Non-null display alias; PHP compares aliases loosely for uniqueness.
1615
1670
  """
@@ -1631,10 +1686,14 @@ class NotebookExtractionRequest(WireModel):
1631
1686
  {"$ref": "#/$defs/ExtractionPathName"},
1632
1687
  ],
1633
1688
  "items": False,
1634
- "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or non-negative\nindices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1689
+ "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or numeric indices,\nincluding numeric-string indices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1635
1690
  },
1636
1691
  "ExtractionPathSelector": {
1637
- "oneOf": [{"$ref": "#/$defs/ExtractionPathName"}, {"type": "integer", "minimum": 0}]
1692
+ "oneOf": [
1693
+ {"type": "string", "pattern": "[^ \\t\\n\\r\\u0000\\u000b]"},
1694
+ {"type": ["integer", "number"], "exclusiveMinimum": -1},
1695
+ ],
1696
+ "description": "PHP treats numeric strings and numbers as indices, truncates them toward\nzero, and rejects a negative resulting index. Non-numeric strings select\nnames and must remain non-empty after PHP trim. Numeric-string range\nvalidation is performed by the Provider.\n",
1638
1697
  },
1639
1698
  "ExtractionPathName": {
1640
1699
  "type": "string",
@@ -1642,7 +1701,7 @@ class NotebookExtractionRequest(WireModel):
1642
1701
  "not": {
1643
1702
  "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
1644
1703
  },
1645
- "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. Numeric selectors use JSON integers in this callable subset.\n",
1704
+ "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. The fourth extraction-path segment uses this name form.\n",
1646
1705
  },
1647
1706
  },
1648
1707
  }
@@ -1685,10 +1744,14 @@ class SearchExtractionRequest(WireModel):
1685
1744
  {"$ref": "#/$defs/ExtractionPathName"},
1686
1745
  ],
1687
1746
  "items": False,
1688
- "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or non-negative\nindices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1747
+ "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or numeric indices,\nincluding numeric-string indices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1689
1748
  },
1690
1749
  "ExtractionPathSelector": {
1691
- "oneOf": [{"$ref": "#/$defs/ExtractionPathName"}, {"type": "integer", "minimum": 0}]
1750
+ "oneOf": [
1751
+ {"type": "string", "pattern": "[^ \\t\\n\\r\\u0000\\u000b]"},
1752
+ {"type": ["integer", "number"], "exclusiveMinimum": -1},
1753
+ ],
1754
+ "description": "PHP treats numeric strings and numbers as indices, truncates them toward\nzero, and rejects a negative resulting index. Non-numeric strings select\nnames and must remain non-empty after PHP trim. Numeric-string range\nvalidation is performed by the Provider.\n",
1692
1755
  },
1693
1756
  "ExtractionPathName": {
1694
1757
  "type": "string",
@@ -1696,7 +1759,7 @@ class SearchExtractionRequest(WireModel):
1696
1759
  "not": {
1697
1760
  "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
1698
1761
  },
1699
- "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. Numeric selectors use JSON integers in this callable subset.\n",
1762
+ "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. The fourth extraction-path segment uses this name form.\n",
1700
1763
  },
1701
1764
  },
1702
1765
  }
@@ -1736,10 +1799,14 @@ class QuoteRequest(WireModel):
1736
1799
  {"$ref": "#/$defs/ExtractionPathName"},
1737
1800
  ],
1738
1801
  "items": False,
1739
- "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or non-negative\nindices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1802
+ "description": "SQL extraction path used by search, quote and notebook list-display\nrequests. The first three segments select names or numeric indices,\nincluding numeric-string indices; a fourth segment selects a non-numeric property name.\nSelectors must address the current module structure; invalid SQL JSON\npaths still produce a business error.\n",
1740
1803
  },
1741
1804
  "ExtractionPathSelector": {
1742
- "oneOf": [{"$ref": "#/$defs/ExtractionPathName"}, {"type": "integer", "minimum": 0}]
1805
+ "oneOf": [
1806
+ {"type": "string", "pattern": "[^ \\t\\n\\r\\u0000\\u000b]"},
1807
+ {"type": ["integer", "number"], "exclusiveMinimum": -1},
1808
+ ],
1809
+ "description": "PHP treats numeric strings and numbers as indices, truncates them toward\nzero, and rejects a negative resulting index. Non-numeric strings select\nnames and must remain non-empty after PHP trim. Numeric-string range\nvalidation is performed by the Provider.\n",
1743
1810
  },
1744
1811
  "ExtractionPathName": {
1745
1812
  "type": "string",
@@ -1747,7 +1814,7 @@ class QuoteRequest(WireModel):
1747
1814
  "not": {
1748
1815
  "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
1749
1816
  },
1750
- "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. Numeric selectors use JSON integers in this callable subset.\n",
1817
+ "description": "A name that remains non-empty after PHP trim and is not a PHP numeric\nstring. The fourth extraction-path segment uses this name form.\n",
1751
1818
  },
1752
1819
  },
1753
1820
  }
@@ -1819,7 +1886,9 @@ class Data(WireModel):
1819
1886
 
1820
1887
 
1821
1888
  class AppendFilesModuleStagedAttachmentOperation(WireModel):
1822
- model_config = ConfigDict(extra="forbid")
1889
+ model_config = ConfigDict(
1890
+ extra="forbid", json_schema_extra={"matelab-runtime-rules": {"properties": {"path": {"not": {"type": "null"}}}}}
1891
+ )
1823
1892
  module: Annotated[str, Field(min_length=1)]
1824
1893
  path: Annotated[list[PathItem3] | None, Field(min_length=1)] = None
1825
1894
  """
@@ -1895,14 +1964,6 @@ class DeleteWholeFileTableColumnOperation(WireModel):
1895
1964
  ]
1896
1965
 
1897
1966
 
1898
- class User2(RootModel[StrictInt]):
1899
- root: Annotated[StrictInt, Field(ge=1)] = None
1900
-
1901
-
1902
- class User3(RootModel[str]):
1903
- root: Annotated[str, Field(min_length=1)] = None
1904
-
1905
-
1906
1967
  class ModifyItem(WireModel):
1907
1968
  path: Annotated[list[str | StrictInt], Field(min_length=1)]
1908
1969
  data: Annotated[Any, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"type": "null"}}})]
@@ -1925,34 +1986,6 @@ class Type(StrEnum):
1925
1986
  code = "code"
1926
1987
 
1927
1988
 
1928
- class LanguageEnum(Enum):
1929
- json = "json"
1930
- python = "python"
1931
- javascript = "javascript"
1932
- html = "html"
1933
- css = "css"
1934
- xml = "xml"
1935
- php = "php"
1936
- java = "java"
1937
- cpp = "cpp"
1938
- sql = "sql"
1939
- latex = "latex"
1940
- other = "other"
1941
-
1942
-
1943
- class Language(RootModel[LanguageEnum | None]):
1944
- root: LanguageEnum | None = None
1945
-
1946
-
1947
- class StyleEnum(Enum):
1948
- ternary = "ternary"
1949
- echarts = "echarts"
1950
-
1951
-
1952
- class Style(RootModel[StyleEnum | None]):
1953
- root: StyleEnum | None = None
1954
-
1955
-
1956
1989
  class AddModuleOperation(WireModel):
1957
1990
  model_config = ConfigDict(
1958
1991
  extra="forbid",
@@ -1961,7 +1994,7 @@ class AddModuleOperation(WireModel):
1961
1994
  "allOf": [
1962
1995
  {
1963
1996
  "if": {"properties": {"type": {"enum": ["richtext", "code"]}}, "required": ["type"]},
1964
- "then": {"properties": {"data": {"default": ""}}},
1997
+ "then": {"properties": {"data": {"type": ["string", "null"], "default": "", "nullable": True}}},
1965
1998
  },
1966
1999
  {
1967
2000
  "if": {"properties": {"type": {"const": "code"}}, "required": ["type"]},
@@ -1988,13 +2021,28 @@ class AddModuleOperation(WireModel):
1988
2021
  },
1989
2022
  },
1990
2023
  },
2024
+ {
2025
+ "if": {
2026
+ "properties": {"type": {"const": "code"}, "language": {"const": "json"}},
2027
+ "required": ["type", "language"],
2028
+ },
2029
+ "then": {
2030
+ "properties": {
2031
+ "style": {
2032
+ "type": ["string", "null"],
2033
+ "enum": ["ternary", "echarts", None],
2034
+ "nullable": True,
2035
+ }
2036
+ }
2037
+ },
2038
+ },
1991
2039
  ]
1992
2040
  }
1993
2041
  },
1994
2042
  )
1995
2043
  name: Annotated[str, Field(min_length=1)]
1996
2044
  type: Type
1997
- data: str | None = None
2045
+ data: Any | None = None
1998
2046
  """
1999
2047
  Initial content for richtext and code modules. Omitted or null becomes
2000
2048
  an empty string; every explicit string, including empty and "0", is
@@ -2002,36 +2050,36 @@ class AddModuleOperation(WireModel):
2002
2050
  Other module types initialize an empty array and ignore this field.
2003
2051
 
2004
2052
  """
2005
- language: Language | None = None
2006
- style: Style | None = None
2053
+ language: Any = None
2054
+ """
2055
+ Required and validated only for code modules; ignored by other module types.
2056
+ """
2057
+ style: Any = None
2058
+ """
2059
+ Validated only for JSON code modules; ignored by other languages and module types.
2060
+ """
2007
2061
 
2008
2062
 
2009
2063
  class Module(RootModel[str]):
2010
2064
  root: Annotated[str, Field(min_length=1)]
2011
2065
 
2012
2066
 
2013
- class Type1Enum(Enum):
2014
- text = "text"
2015
- richtext = "richtext"
2016
- multiline = "multiline"
2017
- number = "number"
2018
- date = "date"
2019
- time = "time"
2020
- file = "file"
2021
- bool = "bool"
2022
-
2023
-
2024
- class Type1(RootModel[Type1Enum | None]):
2025
- root: Type1Enum | None = None
2026
-
2027
-
2028
2067
  class AddValueOperation(WireModel):
2029
2068
  model_config = ConfigDict(extra="forbid")
2030
2069
  module: Module | StrictInt
2031
- name: Annotated[str | None, Field(min_length=1)] = None
2032
- type: Type1 | None = None
2033
- row: Annotated[StrictInt | None, Field(ge=-1, le=0)] = None
2034
- data: dict[str, Any] | list[Any] | str | StrictFloat | StrictBool | None = None
2070
+ name: Any = None
2071
+ """
2072
+ Non-empty string required when adding a form field or table column; ignored when adding a table row or files entry.
2073
+ """
2074
+ type: Any = None
2075
+ """
2076
+ Field/column type checked against the target module's supported types. Ignored when adding a table row or files entry.
2077
+ """
2078
+ row: Any = None
2079
+ """
2080
+ For a table, a non-null value must be integer 0 (prepend) or -1 (append); null or omission adds a column. Ignored by other module types.
2081
+ """
2082
+ data: dict[str, Any] | list[Any] | str | StrictInt | StrictFloat | StrictBool | None = None
2035
2083
  """
2036
2084
  Runtime requirements depend on the target module type.
2037
2085
  """
@@ -2045,7 +2093,10 @@ class DeleteRecordsRequest(WireModel):
2045
2093
  model_config = ConfigDict(extra="forbid")
2046
2094
  eln: Annotated[str, Field(min_length=1)]
2047
2095
  uids: Annotated[list[Uid1], Field(min_length=1)]
2048
- user: Annotated[StrictInt | None, Field(ge=1)] = None
2096
+ user: conint(ge=0, strict=True) | str | None = None
2097
+ """
2098
+ Owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user.
2099
+ """
2049
2100
 
2050
2101
 
2051
2102
  class PublicRecordItem(WireModel):
@@ -2392,7 +2443,7 @@ class ElnNotebook(WireModel):
2392
2443
  trans_username: str
2393
2444
  owner: StrictBool
2394
2445
  userid: Annotated[StrictInt, Field(ge=1)]
2395
- types: list[Any] | dict[str, Any] | str | StrictFloat | StrictBool
2446
+ types: list[Any] | dict[str, Any] | str | StrictInt | StrictFloat | StrictBool
2396
2447
  """
2397
2448
  Decoded stored JSON. Missing, invalid or JSON null falls back to
2398
2449
  an empty array; other JSON values are returned unchanged. The
@@ -2470,9 +2521,9 @@ class ListRecordsRequest(WireModel):
2470
2521
  """
2471
2522
  Exact `showtext` from an owned or shared notebook.
2472
2523
  """
2473
- user: Annotated[StrictInt | None, Field(ge=1)] = None
2524
+ user: conint(ge=0, strict=True) | str | None = None
2474
2525
  """
2475
- Owner userid for a shared notebook; omitted for an owned notebook.
2526
+ Owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user's notebook.
2476
2527
  """
2477
2528
  date_start: str | None = ""
2478
2529
  """
@@ -2657,16 +2708,17 @@ class StageTemporaryFileRequest(WireModel):
2657
2708
  extra="forbid",
2658
2709
  json_schema_extra={
2659
2710
  "matelab-runtime-rules": {
2711
+ "properties": {"file": {"not": {"type": "null"}}},
2660
2712
  "allOf": [
2661
2713
  {
2662
2714
  "if": {"required": ["abort"], "properties": {"abort": {"const": 1}}},
2663
2715
  "then": {
2664
2716
  "required": ["tempid"],
2665
- "properties": {"tempid": {"type": "string", "minLength": 1, "maxLength": 100}},
2717
+ "properties": {"tempid": {"type": "string", "minLength": 1, "maxLength": 45}},
2666
2718
  },
2667
2719
  "else": {"required": ["file"]},
2668
2720
  }
2669
- ]
2721
+ ],
2670
2722
  }
2671
2723
  },
2672
2724
  )
@@ -2677,7 +2729,7 @@ class StageTemporaryFileRequest(WireModel):
2677
2729
  temporary row id. Never stage more than one file under one uid.
2678
2730
 
2679
2731
  """
2680
- tempid: Annotated[str, Field(max_length=100)] = ""
2732
+ tempid: Annotated[str, Field(max_length=45)] = ""
2681
2733
  """
2682
2734
  Resumable upload-session key repeated for every fragment. Missing or
2683
2735
  empty makes PHP generate one and return it on a non-final response;
@@ -2691,10 +2743,19 @@ class StageTemporaryFileRequest(WireModel):
2691
2743
  last: Annotated[StrictInt, Field(ge=0, le=1)] = 0
2692
2744
  """
2693
2745
  One marks the final fragment; missing/null/non-integer input is coerced to zero by PHP.
2746
+ """
2747
+ offset: Annotated[StrictInt, Field(ge=0)] = 0
2748
+ """
2749
+ Start at zero; subsequent fragments use the previous successful
2750
+ response's cumulative byte offset. Missing defaults to zero and
2751
+ replaces incomplete bytes. This is not a fragment sequence number.
2752
+ PHP applies intval to supplied values and defaults missing/null to
2753
+ zero; this contract admits only canonical non-negative integers.
2754
+
2694
2755
  """
2695
2756
  abort: Annotated[StrictInt, Field(ge=0, le=1)] = 0
2696
2757
  """
2697
- One cancels and cleans the matching caller-owned upload session.
2758
+ One removes incomplete bytes; completed staging rows and bytes remain.
2698
2759
  """
2699
2760
  file: bytes | None = None
2700
2761
  """
@@ -2723,7 +2784,11 @@ class StagedTemporaryFileFragmentResponse(WireModel):
2723
2784
 
2724
2785
  """
2725
2786
  hash: Sha256
2726
- tempid: Annotated[str, Field(max_length=100, min_length=1)]
2787
+ tempid: Annotated[str, Field(max_length=45, min_length=1)]
2788
+ offset: Annotated[StrictInt, Field(ge=0)]
2789
+ """
2790
+ Total bytes acknowledged for this incomplete upload; use as the next request offset.
2791
+ """
2727
2792
 
2728
2793
 
2729
2794
  class StagedTemporaryFileResponse(WireModel):
@@ -2757,7 +2822,7 @@ class StagedTemporaryFileResponse(WireModel):
2757
2822
  """
2758
2823
  Provider-built legacy query string for the temporary file.
2759
2824
  """
2760
- name: Annotated[str, Field(max_length=100, min_length=1)]
2825
+ name: Annotated[str, Field(max_length=45, min_length=1)]
2761
2826
  """
2762
2827
  The upload-session tempid.
2763
2828
  """
@@ -2770,10 +2835,12 @@ class StagedTemporaryFileResponse(WireModel):
2770
2835
 
2771
2836
 
2772
2837
  class ExtractLiteratureMetadataRequest1(WireModel):
2773
- model_config = ConfigDict(extra="forbid")
2838
+ model_config = ConfigDict(
2839
+ extra="forbid", json_schema_extra={"matelab-runtime-rules": {"properties": {"doi": {"not": {"type": "null"}}}}}
2840
+ )
2774
2841
  id: Annotated[StrictInt, Field(ge=1)]
2775
2842
  """
2776
- Caller-owned upload_temp id; zero selects DOI mode.
2843
+ Caller-owned upload_temp id used only when doi is empty. A non-empty doi takes precedence over any id.
2777
2844
  """
2778
2845
  doi: Literal[""] = ""
2779
2846
  """
@@ -2783,9 +2850,9 @@ class ExtractLiteratureMetadataRequest1(WireModel):
2783
2850
 
2784
2851
  class ExtractLiteratureMetadataRequest2(WireModel):
2785
2852
  model_config = ConfigDict(extra="forbid")
2786
- id: Annotated[StrictInt, Field(ge=0, le=0)] = 0
2853
+ id: Annotated[StrictInt, Field(ge=0)] = 0
2787
2854
  """
2788
- Caller-owned upload_temp id; zero selects DOI mode.
2855
+ Caller-owned upload_temp id used only when doi is empty. A non-empty doi takes precedence over any id.
2789
2856
  """
2790
2857
  doi: Annotated[str, Field(min_length=1, pattern="^10\\.[0-9]+/\\S+$")]
2791
2858
  """
@@ -2808,7 +2875,14 @@ class ExtractedLiteratureAuthor(WireModel):
2808
2875
 
2809
2876
 
2810
2877
  class SaveLiteratureItemRequest1(WireModel):
2811
- model_config = ConfigDict(extra="forbid")
2878
+ model_config = ConfigDict(
2879
+ extra="forbid",
2880
+ json_schema_extra={
2881
+ "matelab-runtime-rules": {
2882
+ "properties": {"id": {"not": {"type": "null"}}, "store_id": {"not": {"type": "null"}}}
2883
+ }
2884
+ },
2885
+ )
2812
2886
  id: Annotated[StrictInt, Field(ge=0, le=0)] = 0
2813
2887
  """
2814
2888
  Missing or zero creates; a positive id selects metadata replacement.
@@ -2867,7 +2941,7 @@ class SaveLiteratureItemRequest1(WireModel):
2867
2941
  "type": "object",
2868
2942
  "required": [],
2869
2943
  "properties": {
2870
- "year": {"type": ["number", "null"], "default": None, "nullable": True},
2944
+ "year": {"type": ["integer", "number", "null"], "default": None, "nullable": True},
2871
2945
  "volume": {"type": ["string", "null"], "default": None, "nullable": True},
2872
2946
  "issue": {"type": ["string", "null"], "default": None, "nullable": True},
2873
2947
  "page": {"type": ["string", "null"], "default": None, "nullable": True},
@@ -2942,7 +3016,7 @@ class SaveLiteratureItemRequest2(WireModel):
2942
3016
  "type": "object",
2943
3017
  "required": [],
2944
3018
  "properties": {
2945
- "year": {"type": ["number", "null"], "default": None, "nullable": True},
3019
+ "year": {"type": ["integer", "number", "null"], "default": None, "nullable": True},
2946
3020
  "volume": {"type": ["string", "null"], "default": None, "nullable": True},
2947
3021
  "issue": {"type": ["string", "null"], "default": None, "nullable": True},
2948
3022
  "page": {"type": ["string", "null"], "default": None, "nullable": True},
@@ -2968,36 +3042,29 @@ class ShareLiteratureItemsRequest(WireModel):
2968
3042
  Field(
2969
3043
  json_schema_extra={
2970
3044
  "contentMediaType": "application/json",
2971
- "contentSchema": {
2972
- "type": "array",
2973
- "minItems": 1,
2974
- "uniqueItems": True,
2975
- "items": {"type": "integer", "minimum": 1},
2976
- },
3045
+ "contentSchema": {"type": "array", "minItems": 1, "items": {"type": "integer", "minimum": 1}},
2977
3046
  },
2978
3047
  min_length=1,
2979
3048
  ),
2980
3049
  ]
2981
3050
  """
2982
- JSON-encoded ids from the caller's readable literature list.
3051
+ JSON-encoded ids from the caller's readable literature list. PHP converts entries with intval, removes duplicates and zero, then requires a non-empty result.
2983
3052
  """
2984
3053
  users: Annotated[
2985
3054
  str,
2986
3055
  Field(
2987
3056
  json_schema_extra={
2988
3057
  "contentMediaType": "application/json",
2989
- "contentSchema": {
2990
- "type": "array",
2991
- "minItems": 1,
2992
- "uniqueItems": True,
2993
- "items": {"type": "integer", "minimum": 1},
2994
- },
2995
- },
2996
- min_length=1,
3058
+ "contentSchema": {"type": "array", "items": {"type": "integer", "minimum": 1}},
3059
+ }
2997
3060
  ),
2998
- ]
3061
+ ] = ""
2999
3062
  """
3000
- JSON-encoded, existing, non-self recipient user ids returned by searchUsers.
3063
+ JSON-encoded, existing, non-self recipient user ids returned by
3064
+ searchUsers. PHP converts entries with intval and removes duplicates
3065
+ and zero. Missing, empty or an empty list sends no copies and still
3066
+ returns success.
3067
+
3001
3068
  """
3002
3069
  comm: Annotated[StrictInt, Field(ge=0, le=1)] = 0
3003
3070
  """
@@ -3049,7 +3116,7 @@ class ReferenceItem(RootModel[str]):
3049
3116
 
3050
3117
  class LiteratureCitationInfoInput(WireModel):
3051
3118
  model_config = ConfigDict(extra="forbid")
3052
- year: StrictFloat | None = None
3119
+ year: StrictInt | StrictFloat | None = None
3053
3120
  volume: str | None = None
3054
3121
  issue: str | None = None
3055
3122
  page: str | None = None
@@ -3064,7 +3131,7 @@ class LiteratureContent1(RootModel[list[Any]]):
3064
3131
 
3065
3132
  class LiteratureCitationInfo(WireModel):
3066
3133
  model_config = ConfigDict(extra="allow")
3067
- year: StrictFloat | None = None
3134
+ year: StrictInt | StrictFloat | None = None
3068
3135
  volume: str | None = None
3069
3136
  issue: str | None = None
3070
3137
  page: str | None = None
@@ -3074,7 +3141,7 @@ class Name(RootModel[list[str]]):
3074
3141
  root: Annotated[list[str], Field(max_length=2, min_length=2)]
3075
3142
 
3076
3143
 
3077
- class Type2(StrEnum):
3144
+ class Type1(StrEnum):
3078
3145
  richtext = "richtext"
3079
3146
  text = "text"
3080
3147
  object = "object"
@@ -3087,9 +3154,12 @@ class Comm(RootModel[list[str]]):
3087
3154
 
3088
3155
 
3089
3156
  class LiteratureNestedFieldDefinition(WireModel):
3157
+ model_config = ConfigDict(
3158
+ json_schema_extra={"matelab-runtime-rules": {"properties": {"width": {"not": {"type": "null"}}}}}
3159
+ )
3090
3160
  name: str | Name
3091
3161
  id: Annotated[str, Field(min_length=1)]
3092
- type: Type2
3162
+ type: Type1
3093
3163
  width: Annotated[StrictInt | None, Field(ge=1)] = None
3094
3164
 
3095
3165
 
@@ -3104,6 +3174,9 @@ class Logical(StrEnum):
3104
3174
 
3105
3175
 
3106
3176
  class LiteratureFieldCondition(WireModel):
3177
+ model_config = ConfigDict(
3178
+ json_schema_extra={"matelab-runtime-rules": {"properties": {"logical": {"not": {"type": "null"}}}}}
3179
+ )
3107
3180
  conditions: Annotated[list[Condition], Field(min_length=1)]
3108
3181
  logical: Logical | None = None
3109
3182
 
@@ -3118,7 +3191,9 @@ class LiteratureComment(WireModel):
3118
3191
 
3119
3192
 
3120
3193
  class SaveLiteratureCommentRequest1(WireModel):
3121
- model_config = ConfigDict(extra="forbid")
3194
+ model_config = ConfigDict(
3195
+ extra="forbid", json_schema_extra={"matelab-runtime-rules": {"properties": {"id": {"not": {"type": "null"}}}}}
3196
+ )
3122
3197
  id: Annotated[StrictInt, Field(ge=0, le=0)] = 0
3123
3198
  """
3124
3199
  Missing or zero creates; a positive id selects an owner-only edit.
@@ -3232,7 +3307,7 @@ class SubmitTemplateToStoreResponse(RootModel[BasicSuccessResponse | ErrorRespon
3232
3307
 
3233
3308
 
3234
3309
  class SearchUsersParametersQuery(WireModel):
3235
- keyword: Annotated[str, Field(max_length=100, min_length=2, pattern=".*\\S.*")]
3310
+ keyword: Annotated[str, Field(pattern="[^\\x00-\\x7f]|[\\s\\S]{2}")]
3236
3311
  all: Annotated[StrictInt, Field(ge=0, le=1)] = 0
3237
3312
 
3238
3313
 
@@ -3301,7 +3376,7 @@ class ListNotebookRecordPageParametersQuery(WireModel):
3301
3376
  class ListDeletedRecordPageParametersQuery(WireModel):
3302
3377
  eln: Annotated[StrictInt, Field(ge=1)]
3303
3378
  page: Annotated[StrictInt, Field(ge=1)] = 1
3304
- page_size: Annotated[StrictInt, Field(ge=1)] = 24
3379
+ page_size: Annotated[StrictInt, Field(ge=0)] = 24
3305
3380
 
3306
3381
 
3307
3382
  class RestoreDeletedRecordsResponse(RootModel[BasicSuccessResponse | ErrorResponse]):
@@ -3376,11 +3451,7 @@ class ListLiteratureItemsParametersQuery(WireModel):
3376
3451
  Field(
3377
3452
  json_schema_extra={
3378
3453
  "contentMediaType": "application/json",
3379
- "contentSchema": {
3380
- "type": "array",
3381
- "uniqueItems": True,
3382
- "items": {"type": "integer", "minimum": 1, "maximum": 3},
3383
- },
3454
+ "contentSchema": {"type": "array", "items": {"type": "integer", "minimum": 1, "maximum": 3}},
3384
3455
  }
3385
3456
  ),
3386
3457
  ] = ""
@@ -3389,11 +3460,7 @@ class ListLiteratureItemsParametersQuery(WireModel):
3389
3460
  Field(
3390
3461
  json_schema_extra={
3391
3462
  "contentMediaType": "application/json",
3392
- "contentSchema": {
3393
- "type": "array",
3394
- "uniqueItems": True,
3395
- "items": {"type": "integer", "minimum": 1, "maximum": 5},
3396
- },
3463
+ "contentSchema": {"type": "array", "items": {"type": "integer", "minimum": 1, "maximum": 5}},
3397
3464
  }
3398
3465
  ),
3399
3466
  ] = ""
@@ -3402,7 +3469,7 @@ class ListLiteratureItemsParametersQuery(WireModel):
3402
3469
  Field(
3403
3470
  json_schema_extra={
3404
3471
  "contentMediaType": "application/json",
3405
- "contentSchema": {"type": "array", "uniqueItems": True, "items": {"type": "string"}},
3472
+ "contentSchema": {"type": "array", "items": {"type": "string"}},
3406
3473
  }
3407
3474
  ),
3408
3475
  ] = ""
@@ -3537,6 +3604,9 @@ class CloudDriveFileListResponse(WireModel):
3537
3604
 
3538
3605
 
3539
3606
  class AppMenu(WireModel):
3607
+ model_config = ConfigDict(
3608
+ json_schema_extra={"matelab-runtime-rules": {"properties": {"order": {"not": {"type": "null"}}}}}
3609
+ )
3540
3610
  uid: str
3541
3611
  order: StrictInt | None = None
3542
3612
  """
@@ -3643,8 +3713,17 @@ class TemplateWriteModule(TemplateModule):
3643
3713
  model_config = ConfigDict(
3644
3714
  json_schema_extra={
3645
3715
  "matelab-runtime-rules": {
3716
+ "properties": {"name": {"not": {"type": "null"}}},
3646
3717
  "allOf": [
3647
3718
  {"$ref": "#/$defs/TemplateModule"},
3719
+ {
3720
+ "if": {"properties": {"type": {"enum": ["form", "table"]}}, "required": ["type"]},
3721
+ "then": {
3722
+ "properties": {
3723
+ "data": {"items": {"properties": {"name": {"$ref": "#/$defs/TemplateWriteName"}}}}
3724
+ }
3725
+ },
3726
+ },
3648
3727
  {
3649
3728
  "if": {
3650
3729
  "properties": {
@@ -3670,16 +3749,15 @@ class TemplateWriteModule(TemplateModule):
3670
3749
  "name": {
3671
3750
  "type": "string",
3672
3751
  "minLength": 1,
3673
- "pattern": ".*[^0-9.\\-+eE ].*",
3674
- "description": "PHP trims the name, rejects an empty or purely numeric value, and\nrejects duplicate names across the module array.\n",
3752
+ "description": "Stored module name. Record updates can create numeric names; template-save name checks apply only to TemplateWriteModule.",
3675
3753
  },
3676
3754
  "type": {"type": "string", "minLength": 1},
3677
3755
  "data": {
3678
- "type": ["object", "array", "string", "number", "boolean", "null"],
3756
+ "type": ["object", "array", "string", "integer", "number", "boolean", "null"],
3679
3757
  "description": "Runtime requirements depend on the target module type.",
3680
3758
  "nullable": True,
3681
3759
  },
3682
- "language": {"type": "string"},
3760
+ "language": {},
3683
3761
  "style": {},
3684
3762
  },
3685
3763
  "allOf": [
@@ -3703,7 +3781,11 @@ class TemplateWriteModule(TemplateModule):
3703
3781
  },
3704
3782
  {
3705
3783
  "if": {
3706
- "properties": {"type": {"const": "code"}, "language": {"const": "json"}},
3784
+ "properties": {
3785
+ "type": {"const": "code"},
3786
+ "language": {"const": "json"},
3787
+ "style": {"not": {"type": "null"}},
3788
+ },
3707
3789
  "required": ["type", "language", "style"],
3708
3790
  },
3709
3791
  "then": {
@@ -3724,12 +3806,7 @@ class TemplateWriteModule(TemplateModule):
3724
3806
  "type": "object",
3725
3807
  "required": ["name", "type", "data"],
3726
3808
  "properties": {
3727
- "name": {
3728
- "type": "string",
3729
- "minLength": 1,
3730
- "pattern": ".*[^0-9.\\-+eE ].*",
3731
- "description": "PHP also rejects duplicate names within the table.",
3732
- },
3809
+ "name": {"type": "string", "minLength": 1},
3733
3810
  "type": {"type": "string"},
3734
3811
  "data": {"type": "array"},
3735
3812
  },
@@ -3756,7 +3833,7 @@ class TemplateWriteModule(TemplateModule):
3756
3833
  "type": "array",
3757
3834
  "items": {
3758
3835
  "oneOf": [
3759
- {"type": "number"},
3836
+ {"type": ["integer", "number"]},
3760
3837
  {
3761
3838
  "type": "string",
3762
3839
  "pattern": "^[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?$",
@@ -3826,20 +3903,42 @@ class TemplateWriteModule(TemplateModule):
3826
3903
  "TemplateFormItem": {
3827
3904
  "type": "object",
3828
3905
  "required": ["name"],
3829
- "properties": {
3830
- "name": {
3831
- "type": "string",
3832
- "minLength": 1,
3833
- "pattern": ".*[^0-9.\\-+eE ].*",
3834
- "description": "PHP also rejects duplicate names within the form.",
3835
- }
3836
- },
3906
+ "properties": {"name": {"type": "string", "minLength": 1}},
3837
3907
  "additionalProperties": True,
3838
3908
  },
3909
+ "TemplateWriteName": {
3910
+ "type": "string",
3911
+ "pattern": "[^ \\t\\n\\r\\u0000\\u000b]",
3912
+ "not": {
3913
+ "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
3914
+ },
3915
+ "description": "Template saving rejects names that are empty after PHP trim, numeric, or duplicates in their containing module, column or field list.",
3916
+ },
3839
3917
  },
3840
3918
  }
3841
3919
  }
3842
3920
  )
3921
+ name: Annotated[
3922
+ TemplateWriteName,
3923
+ Field(
3924
+ json_schema_extra={
3925
+ "matelab-runtime-rules": {
3926
+ "$ref": "#/$defs/TemplateWriteName",
3927
+ "$defs": {
3928
+ "TemplateWriteName": {
3929
+ "type": "string",
3930
+ "pattern": "[^ \\t\\n\\r\\u0000\\u000b]",
3931
+ "not": {
3932
+ "pattern": "^[ \\t\\n\\r\\f\\v]*[+-]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?[ \\t\\n\\r\\f\\v]*$"
3933
+ },
3934
+ "description": "Template saving rejects names that are empty after PHP trim, numeric, or duplicates in their containing module, column or field list.",
3935
+ }
3936
+ },
3937
+ }
3938
+ }
3939
+ ),
3940
+ ]
3941
+ type: Annotated[str, Field(json_schema_extra={"matelab-runtime-rules": {"not": {"const": "0"}}}, min_length=1)]
3843
3942
 
3844
3943
 
3845
3944
  class TemplateListResponse(WireModel):
@@ -3963,13 +4062,13 @@ class ImportRecordsRequest(WireModel):
3963
4062
  eln: Annotated[str, Field(min_length=1)]
3964
4063
  template: Annotated[str, Field(min_length=1)]
3965
4064
  dataset: Annotated[list[ImportRecordItem], Field(max_length=100, min_length=1)]
3966
- user: Annotated[StrictInt | None, Field(ge=1)] = None
4065
+ user: conint(ge=0, strict=True) | str | None = None
3967
4066
  """
3968
- Missing or null selects the authenticated user.
4067
+ Owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user.
3969
4068
  """
3970
- template_user: Annotated[StrictInt | None, Field(ge=1)] = None
4069
+ template_user: conint(ge=0, strict=True) | str | None = None
3971
4070
  """
3972
- Missing or null selects the authenticated user.
4071
+ Template owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user.
3973
4072
  """
3974
4073
 
3975
4074
 
@@ -4050,7 +4149,10 @@ class UpdateRecordRequest(WireModel):
4050
4149
  model_config = ConfigDict(extra="forbid")
4051
4150
  eln: Annotated[str, Field(min_length=1)]
4052
4151
  uid: Annotated[str, Field(min_length=1)]
4053
- user: User2 | User3 | None = None
4152
+ user: conint(ge=0, strict=True) | str | None = None
4153
+ """
4154
+ Owner userid, canonical numeric-id string, or email. Missing, null, zero, or empty selects the authenticated user.
4155
+ """
4054
4156
  password: str | None = ""
4055
4157
  quote: list[QuoteRequest] | None = None
4056
4158
  del_: Annotated[list[PathOperation] | None, Field(alias="del")] = None
@@ -4119,6 +4221,14 @@ class RecordPageResponse(WireModel):
4119
4221
 
4120
4222
 
4121
4223
  class DeletedRecordPageResponse(WireModel):
4224
+ model_config = ConfigDict(
4225
+ json_schema_extra={
4226
+ "matelab-runtime-rules": {
4227
+ "properties": {"count": {"not": {"type": "null"}}, "page": {"not": {"type": "null"}}},
4228
+ "dependentRequired": {"count": ["page"], "page": ["count"]},
4229
+ }
4230
+ }
4231
+ )
4122
4232
  code: Annotated[StrictInt, Field(ge=0, le=0)]
4123
4233
  msg: str
4124
4234
  """
@@ -4140,8 +4250,8 @@ class DeletedRecordPageResponse(WireModel):
4140
4250
  """
4141
4251
  items: list[DeletedRecordItem]
4142
4252
  eln: DeletedRecordNotebook
4143
- count: Annotated[StrictInt, Field(ge=0)]
4144
- page: Annotated[StrictInt, Field(ge=1)]
4253
+ count: Annotated[StrictInt | None, Field(ge=0)] = None
4254
+ page: Annotated[StrictInt | None, Field(ge=1)] = None
4145
4255
 
4146
4256
 
4147
4257
  class RecordComment(WireModel):
@@ -4430,10 +4540,26 @@ class LiteratureContentObject(WireModel):
4430
4540
 
4431
4541
 
4432
4542
  class LiteratureFieldDefinition(WireModel):
4543
+ model_config = ConfigDict(
4544
+ json_schema_extra={
4545
+ "matelab-runtime-rules": {
4546
+ "properties": {
4547
+ "group": {"not": {"type": "null"}},
4548
+ "required": {"not": {"type": "null"}},
4549
+ "comm": {"not": {"type": "null"}},
4550
+ "print": {"not": {"type": "null"}},
4551
+ "template": {"not": {"type": "null"}},
4552
+ "show": {"not": {"type": "null"}},
4553
+ "width": {"not": {"type": "null"}},
4554
+ "condition": {"not": {"type": "null"}},
4555
+ }
4556
+ }
4557
+ }
4558
+ )
4433
4559
  group: str | None = None
4434
4560
  name: str | Name
4435
4561
  id: Annotated[str, Field(min_length=1)]
4436
- type: Type2
4562
+ type: Type1
4437
4563
  required: StrictBool | None = None
4438
4564
  comm: str | Comm | None = None
4439
4565
  print: str | None = None