@kubun/protocol 0.3.3 → 0.3.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.
@@ -85,6 +85,10 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
85
85
  };
86
86
  additionalProperties: boolean;
87
87
  title: string;
88
+ } | {
89
+ type: "object";
90
+ additionalProperties: true;
91
+ title: "JSONObject";
88
92
  };
89
93
  };
90
94
  };
@@ -164,6 +168,10 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
164
168
  };
165
169
  additionalProperties: boolean;
166
170
  title: string;
171
+ } | {
172
+ type: "object";
173
+ additionalProperties: true;
174
+ title: "JSONObject";
167
175
  };
168
176
  };
169
177
  };
@@ -243,6 +251,10 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
243
251
  };
244
252
  additionalProperties: boolean;
245
253
  title: string;
254
+ } | {
255
+ type: "object";
256
+ additionalProperties: true;
257
+ title: "JSONObject";
246
258
  };
247
259
  };
248
260
  };
@@ -517,6 +529,24 @@ export declare const clusterModel: {
517
529
  };
518
530
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
519
531
  readonly additionalProperties: false;
532
+ }, {
533
+ readonly type: "object";
534
+ readonly properties: {
535
+ readonly type: {
536
+ readonly type: "string";
537
+ readonly const: "object";
538
+ };
539
+ readonly title: {
540
+ readonly type: "string";
541
+ readonly const: "JSONObject";
542
+ };
543
+ readonly additionalProperties: {
544
+ readonly type: "boolean";
545
+ readonly const: true;
546
+ };
547
+ };
548
+ readonly required: readonly ["type", "title", "additionalProperties"];
549
+ readonly additionalProperties: false;
520
550
  }];
521
551
  }];
522
552
  };
@@ -822,6 +852,24 @@ export declare const clusterModel: {
822
852
  };
823
853
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
824
854
  readonly additionalProperties: false;
855
+ }, {
856
+ readonly type: "object";
857
+ readonly properties: {
858
+ readonly type: {
859
+ readonly type: "string";
860
+ readonly const: "object";
861
+ };
862
+ readonly title: {
863
+ readonly type: "string";
864
+ readonly const: "JSONObject";
865
+ };
866
+ readonly additionalProperties: {
867
+ readonly type: "boolean";
868
+ readonly const: true;
869
+ };
870
+ };
871
+ readonly required: readonly ["type", "title", "additionalProperties"];
872
+ readonly additionalProperties: false;
825
873
  }];
826
874
  }];
827
875
  };
@@ -1133,6 +1181,24 @@ export declare const clusterModel: {
1133
1181
  };
1134
1182
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
1135
1183
  readonly additionalProperties: false;
1184
+ }, {
1185
+ readonly type: "object";
1186
+ readonly properties: {
1187
+ readonly type: {
1188
+ readonly type: "string";
1189
+ readonly const: "object";
1190
+ };
1191
+ readonly title: {
1192
+ readonly type: "string";
1193
+ readonly const: "JSONObject";
1194
+ };
1195
+ readonly additionalProperties: {
1196
+ readonly type: "boolean";
1197
+ readonly const: true;
1198
+ };
1199
+ };
1200
+ readonly required: readonly ["type", "title", "additionalProperties"];
1201
+ readonly additionalProperties: false;
1136
1202
  }];
1137
1203
  }];
1138
1204
  };
@@ -1278,6 +1344,10 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1278
1344
  };
1279
1345
  additionalProperties: boolean;
1280
1346
  title: string;
1347
+ } | {
1348
+ type: "object";
1349
+ additionalProperties: true;
1350
+ title: "JSONObject";
1281
1351
  };
1282
1352
  };
1283
1353
  };
@@ -1357,6 +1427,10 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1357
1427
  };
1358
1428
  additionalProperties: boolean;
1359
1429
  title: string;
1430
+ } | {
1431
+ type: "object";
1432
+ additionalProperties: true;
1433
+ title: "JSONObject";
1360
1434
  };
1361
1435
  };
1362
1436
  };
@@ -1436,6 +1510,10 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1436
1510
  };
1437
1511
  additionalProperties: boolean;
1438
1512
  title: string;
1513
+ } | {
1514
+ type: "object";
1515
+ additionalProperties: true;
1516
+ title: "JSONObject";
1439
1517
  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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcE,CAAA;AAC3B,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAA;AAEjE,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,oBAAoB,CA0BzE;AAED,qBAAa,cAAc;;IAGzB,IAAI,OAAO,IAAI,qBAAqB,CAEnC;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,KAAK,IAAI,YAAY;IAgBrB,GAAG,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa;IAmBzD,GAAG,CAAC,UAAU,EAAE,gBAAgB,GAAG,eAAe;IAqDlD,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC;CAOhE"}
@@ -1,15 +1,52 @@
1
1
  import { toB64 } from '@enkaku/codec';
2
2
  import { assertType, createValidator } from '@enkaku/schema';
3
- import { DocumentModelID, ScalarModelID, ShapeModelID, digestJSON } from '@kubun/id';
3
+ import { DocumentModelID, digestJSON, ScalarModelID, ShapeModelID } from '@kubun/id';
4
+ import { pascalCase } from 'change-case';
4
5
  import { documentModel, documentModelsCluster } from './document.js';
5
6
  import { binaryStringValue } from './value.js';
7
+ const JSONObjectSchema = {
8
+ type: 'object',
9
+ title: 'JSONObject',
10
+ additionalProperties: true
11
+ };
6
12
  export const REFERENCE_PREFIX = '#/$defs/';
7
13
  function toReference(id) {
8
14
  return `${REFERENCE_PREFIX}${id}`;
9
15
  }
16
+ function resolveReference(root, ref) {
17
+ if (!ref.startsWith('#')) {
18
+ throw new Error(`Invalid reference format: ${ref}`);
19
+ }
20
+ // Handle #/$defs/ references
21
+ if (ref.startsWith(REFERENCE_PREFIX)) {
22
+ const key = ref.slice(REFERENCE_PREFIX.length);
23
+ const resolved = root.$defs?.[key];
24
+ if (resolved == null) {
25
+ throw new Error(`Reference not found: ${ref}`);
26
+ }
27
+ return resolved;
28
+ }
29
+ // Handle other JSON Schema references like #/properties/, #/items/, etc.
30
+ const segments = ref.split('/').slice(1);
31
+ // biome-ignore lint/suspicious/noExplicitAny: mixed type
32
+ let current = root;
33
+ for (const segment of segments){
34
+ if (current == null || typeof current !== 'object') {
35
+ throw new Error(`Invalid reference path: ${ref}`);
36
+ }
37
+ current = current[segment];
38
+ if (current == null) {
39
+ throw new Error(`Reference not found: ${ref}`);
40
+ }
41
+ }
42
+ return current;
43
+ }
10
44
  function addScalar(refs, schema) {
11
45
  const id = ScalarModelID.create(schema);
12
- refs[id.toString()] = schema;
46
+ refs[id.toString()] = schema.title == null ? schema : {
47
+ ...schema,
48
+ title: pascalCase(schema.title)
49
+ };
13
50
  return toReference(id);
14
51
  }
15
52
  function addShape(refs, schema) {
@@ -17,9 +54,10 @@ function addShape(refs, schema) {
17
54
  refs[id.toString()] = schema;
18
55
  return toReference(id);
19
56
  }
20
- function encodeSchema(refs, schema) {
57
+ function encodeSchema(root, refs, schema) {
21
58
  if (schema.$ref != null) {
22
- return schema.$ref;
59
+ const resolvedSchema = resolveReference(root, schema.$ref);
60
+ return encodeSchema(root, refs, resolvedSchema);
23
61
  }
24
62
  const type = schema.type;
25
63
  if (type == null) {
@@ -36,18 +74,16 @@ function encodeSchema(refs, schema) {
36
74
  }
37
75
  return addShape(refs, {
38
76
  ...schema,
77
+ title: pascalCase(schema.title),
39
78
  items: {
40
- $ref: encodeSchema(refs, schema.items)
79
+ $ref: encodeSchema(root, refs, schema.items)
41
80
  }
42
81
  });
43
82
  }
44
83
  case 'object':
45
84
  {
46
85
  if (schema.additionalProperties) {
47
- return addScalar(refs, {
48
- type: 'string',
49
- title: 'JSONObject'
50
- });
86
+ return addShape(refs, JSONObjectSchema);
51
87
  }
52
88
  if (schema.title == null) {
53
89
  throw new Error('Invalid object schema: missing title');
@@ -59,12 +95,12 @@ function encodeSchema(refs, schema) {
59
95
  const properties = {};
60
96
  for (const [key, value] of entries){
61
97
  properties[key] = {
62
- $ref: encodeSchema(refs, value)
98
+ $ref: encodeSchema(root, refs, value)
63
99
  };
64
100
  }
65
101
  return addShape(refs, {
66
102
  type: 'object',
67
- title: schema.title,
103
+ title: pascalCase(schema.title),
68
104
  properties,
69
105
  required: schema.required ?? [],
70
106
  additionalProperties: false
@@ -83,7 +119,7 @@ function normalizeDocumentSchema(schema) {
83
119
  const refs = schema.$defs ?? {};
84
120
  for (const [key, value] of entries){
85
121
  properties[key] = {
86
- $ref: encodeSchema(refs, value)
122
+ $ref: encodeSchema(schema, refs, value)
87
123
  };
88
124
  }
89
125
  return {
@@ -199,6 +235,7 @@ export class ClusterBuilder {
199
235
  return model;
200
236
  }
201
237
  add(inputModel) {
238
+ const inputSchema = inputModel.schema ?? {};
202
239
  const interfaceIDs = inputModel.interfaces ?? [];
203
240
  const interfaces = new Set();
204
241
  const schemaProperties = {};
@@ -221,10 +258,10 @@ export class ClusterBuilder {
221
258
  for (const interfaceID of interfaceIDs){
222
259
  interfaces.add(interfaceID);
223
260
  }
224
- for (const requiredKey of inputModel.schema?.required ?? []){
261
+ for (const requiredKey of inputSchema.required ?? []){
225
262
  schemaRequired.add(requiredKey);
226
263
  }
227
- Object.assign(schemaProperties, inputModel.schema?.properties ?? {});
264
+ Object.assign(schemaProperties, inputSchema.properties ?? {});
228
265
  Object.assign(fieldsMeta, inputModel.fieldsMeta ?? {});
229
266
  const index = this.#cluster.length;
230
267
  const model = {
@@ -233,11 +270,15 @@ export class ClusterBuilder {
233
270
  ...inputModel,
234
271
  interfaces: Array.from(interfaces),
235
272
  schema: normalizeDocumentSchema({
273
+ ...inputSchema,
236
274
  type: 'object',
237
275
  properties: schemaProperties,
238
276
  required: Array.from(schemaRequired),
239
277
  additionalProperties: false,
240
- $defs: schemaReferences
278
+ $defs: {
279
+ ...inputSchema.$defs,
280
+ ...schemaReferences
281
+ }
241
282
  }),
242
283
  fieldsMeta: normalizeFieldsMeta(fieldsMeta)
243
284
  };
@@ -262,6 +262,24 @@ export declare const documentModelSchema: {
262
262
  };
263
263
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
264
264
  readonly additionalProperties: false;
265
+ }, {
266
+ readonly type: "object";
267
+ readonly properties: {
268
+ readonly type: {
269
+ readonly type: "string";
270
+ readonly const: "object";
271
+ };
272
+ readonly title: {
273
+ readonly type: "string";
274
+ readonly const: "JSONObject";
275
+ };
276
+ readonly additionalProperties: {
277
+ readonly type: "boolean";
278
+ readonly const: true;
279
+ };
280
+ };
281
+ readonly required: readonly ["type", "title", "additionalProperties"];
282
+ readonly additionalProperties: false;
265
283
  }];
266
284
  }];
267
285
  };
@@ -545,6 +563,24 @@ export declare const documentModelBase: {
545
563
  };
546
564
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
547
565
  readonly additionalProperties: false;
566
+ }, {
567
+ readonly type: "object";
568
+ readonly properties: {
569
+ readonly type: {
570
+ readonly type: "string";
571
+ readonly const: "object";
572
+ };
573
+ readonly title: {
574
+ readonly type: "string";
575
+ readonly const: "JSONObject";
576
+ };
577
+ readonly additionalProperties: {
578
+ readonly type: "boolean";
579
+ readonly const: true;
580
+ };
581
+ };
582
+ readonly required: readonly ["type", "title", "additionalProperties"];
583
+ readonly additionalProperties: false;
548
584
  }];
549
585
  }];
550
586
  };
@@ -851,6 +887,24 @@ export declare const documentModelDefault: {
851
887
  };
852
888
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
853
889
  readonly additionalProperties: false;
890
+ }, {
891
+ readonly type: "object";
892
+ readonly properties: {
893
+ readonly type: {
894
+ readonly type: "string";
895
+ readonly const: "object";
896
+ };
897
+ readonly title: {
898
+ readonly type: "string";
899
+ readonly const: "JSONObject";
900
+ };
901
+ readonly additionalProperties: {
902
+ readonly type: "boolean";
903
+ readonly const: true;
904
+ };
905
+ };
906
+ readonly required: readonly ["type", "title", "additionalProperties"];
907
+ readonly additionalProperties: false;
854
908
  }];
855
909
  }];
856
910
  };
@@ -1157,6 +1211,24 @@ export declare const documentModelInterface: {
1157
1211
  };
1158
1212
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
1159
1213
  readonly additionalProperties: false;
1214
+ }, {
1215
+ readonly type: "object";
1216
+ readonly properties: {
1217
+ readonly type: {
1218
+ readonly type: "string";
1219
+ readonly const: "object";
1220
+ };
1221
+ readonly title: {
1222
+ readonly type: "string";
1223
+ readonly const: "JSONObject";
1224
+ };
1225
+ readonly additionalProperties: {
1226
+ readonly type: "boolean";
1227
+ readonly const: true;
1228
+ };
1229
+ };
1230
+ readonly required: readonly ["type", "title", "additionalProperties"];
1231
+ readonly additionalProperties: false;
1160
1232
  }];
1161
1233
  }];
1162
1234
  };
@@ -1469,6 +1541,24 @@ export declare const documentModelUnique: {
1469
1541
  };
1470
1542
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
1471
1543
  readonly additionalProperties: false;
1544
+ }, {
1545
+ readonly type: "object";
1546
+ readonly properties: {
1547
+ readonly type: {
1548
+ readonly type: "string";
1549
+ readonly const: "object";
1550
+ };
1551
+ readonly title: {
1552
+ readonly type: "string";
1553
+ readonly const: "JSONObject";
1554
+ };
1555
+ readonly additionalProperties: {
1556
+ readonly type: "boolean";
1557
+ readonly const: true;
1558
+ };
1559
+ };
1560
+ readonly required: readonly ["type", "title", "additionalProperties"];
1561
+ readonly additionalProperties: false;
1472
1562
  }];
1473
1563
  }];
1474
1564
  };
@@ -1777,6 +1867,24 @@ export declare const documentModel: {
1777
1867
  };
1778
1868
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
1779
1869
  readonly additionalProperties: false;
1870
+ }, {
1871
+ readonly type: "object";
1872
+ readonly properties: {
1873
+ readonly type: {
1874
+ readonly type: "string";
1875
+ readonly const: "object";
1876
+ };
1877
+ readonly title: {
1878
+ readonly type: "string";
1879
+ readonly const: "JSONObject";
1880
+ };
1881
+ readonly additionalProperties: {
1882
+ readonly type: "boolean";
1883
+ readonly const: true;
1884
+ };
1885
+ };
1886
+ readonly required: readonly ["type", "title", "additionalProperties"];
1887
+ readonly additionalProperties: false;
1780
1888
  }];
1781
1889
  }];
1782
1890
  };
@@ -2082,6 +2190,24 @@ export declare const documentModel: {
2082
2190
  };
2083
2191
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
2084
2192
  readonly additionalProperties: false;
2193
+ }, {
2194
+ readonly type: "object";
2195
+ readonly properties: {
2196
+ readonly type: {
2197
+ readonly type: "string";
2198
+ readonly const: "object";
2199
+ };
2200
+ readonly title: {
2201
+ readonly type: "string";
2202
+ readonly const: "JSONObject";
2203
+ };
2204
+ readonly additionalProperties: {
2205
+ readonly type: "boolean";
2206
+ readonly const: true;
2207
+ };
2208
+ };
2209
+ readonly required: readonly ["type", "title", "additionalProperties"];
2210
+ readonly additionalProperties: false;
2085
2211
  }];
2086
2212
  }];
2087
2213
  };
@@ -2393,6 +2519,24 @@ export declare const documentModel: {
2393
2519
  };
2394
2520
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
2395
2521
  readonly additionalProperties: false;
2522
+ }, {
2523
+ readonly type: "object";
2524
+ readonly properties: {
2525
+ readonly type: {
2526
+ readonly type: "string";
2527
+ readonly const: "object";
2528
+ };
2529
+ readonly title: {
2530
+ readonly type: "string";
2531
+ readonly const: "JSONObject";
2532
+ };
2533
+ readonly additionalProperties: {
2534
+ readonly type: "boolean";
2535
+ readonly const: true;
2536
+ };
2537
+ };
2538
+ readonly required: readonly ["type", "title", "additionalProperties"];
2539
+ readonly additionalProperties: false;
2396
2540
  }];
2397
2541
  }];
2398
2542
  };
@@ -2705,6 +2849,24 @@ export declare const documentModelsCluster: {
2705
2849
  };
2706
2850
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
2707
2851
  readonly additionalProperties: false;
2852
+ }, {
2853
+ readonly type: "object";
2854
+ readonly properties: {
2855
+ readonly type: {
2856
+ readonly type: "string";
2857
+ readonly const: "object";
2858
+ };
2859
+ readonly title: {
2860
+ readonly type: "string";
2861
+ readonly const: "JSONObject";
2862
+ };
2863
+ readonly additionalProperties: {
2864
+ readonly type: "boolean";
2865
+ readonly const: true;
2866
+ };
2867
+ };
2868
+ readonly required: readonly ["type", "title", "additionalProperties"];
2869
+ readonly additionalProperties: false;
2708
2870
  }];
2709
2871
  }];
2710
2872
  };
@@ -3010,6 +3172,24 @@ export declare const documentModelsCluster: {
3010
3172
  };
3011
3173
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
3012
3174
  readonly additionalProperties: false;
3175
+ }, {
3176
+ readonly type: "object";
3177
+ readonly properties: {
3178
+ readonly type: {
3179
+ readonly type: "string";
3180
+ readonly const: "object";
3181
+ };
3182
+ readonly title: {
3183
+ readonly type: "string";
3184
+ readonly const: "JSONObject";
3185
+ };
3186
+ readonly additionalProperties: {
3187
+ readonly type: "boolean";
3188
+ readonly const: true;
3189
+ };
3190
+ };
3191
+ readonly required: readonly ["type", "title", "additionalProperties"];
3192
+ readonly additionalProperties: false;
3013
3193
  }];
3014
3194
  }];
3015
3195
  };
@@ -3321,6 +3501,24 @@ export declare const documentModelsCluster: {
3321
3501
  };
3322
3502
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
3323
3503
  readonly additionalProperties: false;
3504
+ }, {
3505
+ readonly type: "object";
3506
+ readonly properties: {
3507
+ readonly type: {
3508
+ readonly type: "string";
3509
+ readonly const: "object";
3510
+ };
3511
+ readonly title: {
3512
+ readonly type: "string";
3513
+ readonly const: "JSONObject";
3514
+ };
3515
+ readonly additionalProperties: {
3516
+ readonly type: "boolean";
3517
+ readonly const: true;
3518
+ };
3519
+ };
3520
+ readonly required: readonly ["type", "title", "additionalProperties"];
3521
+ readonly additionalProperties: false;
3324
3522
  }];
3325
3523
  }];
3326
3524
  };
@@ -3634,6 +3832,24 @@ export declare const documentModelsRecord: {
3634
3832
  };
3635
3833
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
3636
3834
  readonly additionalProperties: false;
3835
+ }, {
3836
+ readonly type: "object";
3837
+ readonly properties: {
3838
+ readonly type: {
3839
+ readonly type: "string";
3840
+ readonly const: "object";
3841
+ };
3842
+ readonly title: {
3843
+ readonly type: "string";
3844
+ readonly const: "JSONObject";
3845
+ };
3846
+ readonly additionalProperties: {
3847
+ readonly type: "boolean";
3848
+ readonly const: true;
3849
+ };
3850
+ };
3851
+ readonly required: readonly ["type", "title", "additionalProperties"];
3852
+ readonly additionalProperties: false;
3637
3853
  }];
3638
3854
  }];
3639
3855
  };
@@ -3939,6 +4155,24 @@ export declare const documentModelsRecord: {
3939
4155
  };
3940
4156
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
3941
4157
  readonly additionalProperties: false;
4158
+ }, {
4159
+ readonly type: "object";
4160
+ readonly properties: {
4161
+ readonly type: {
4162
+ readonly type: "string";
4163
+ readonly const: "object";
4164
+ };
4165
+ readonly title: {
4166
+ readonly type: "string";
4167
+ readonly const: "JSONObject";
4168
+ };
4169
+ readonly additionalProperties: {
4170
+ readonly type: "boolean";
4171
+ readonly const: true;
4172
+ };
4173
+ };
4174
+ readonly required: readonly ["type", "title", "additionalProperties"];
4175
+ readonly additionalProperties: false;
3942
4176
  }];
3943
4177
  }];
3944
4178
  };
@@ -4250,6 +4484,24 @@ export declare const documentModelsRecord: {
4250
4484
  };
4251
4485
  readonly required: readonly ["type", "properties", "required", "additionalProperties", "title"];
4252
4486
  readonly additionalProperties: false;
4487
+ }, {
4488
+ readonly type: "object";
4489
+ readonly properties: {
4490
+ readonly type: {
4491
+ readonly type: "string";
4492
+ readonly const: "object";
4493
+ };
4494
+ readonly title: {
4495
+ readonly type: "string";
4496
+ readonly const: "JSONObject";
4497
+ };
4498
+ readonly additionalProperties: {
4499
+ readonly type: "boolean";
4500
+ readonly const: true;
4501
+ };
4502
+ };
4503
+ readonly required: readonly ["type", "title", "additionalProperties"];
4504
+ readonly additionalProperties: false;
4253
4505
  }];
4254
4506
  }];
4255
4507
  };