@kubun/protocol 0.3.2 → 0.3.4

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.
@@ -70,11 +70,11 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
70
70
  maxItems?: number | undefined;
71
71
  minItems?: number | undefined;
72
72
  uniqueItems?: boolean | undefined;
73
- title?: string | undefined;
74
73
  type: "array";
75
74
  items: {
76
75
  $ref: string;
77
76
  };
77
+ title: string;
78
78
  } | {
79
79
  type: "object";
80
80
  required: string[];
@@ -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
  };
@@ -149,11 +153,11 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
149
153
  maxItems?: number | undefined;
150
154
  minItems?: number | undefined;
151
155
  uniqueItems?: boolean | undefined;
152
- title?: string | undefined;
153
156
  type: "array";
154
157
  items: {
155
158
  $ref: string;
156
159
  };
160
+ title: string;
157
161
  } | {
158
162
  type: "object";
159
163
  required: string[];
@@ -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
  };
@@ -228,11 +236,11 @@ export declare const validateDocumentModel: import("@enkaku/schema").Validator<{
228
236
  maxItems?: number | undefined;
229
237
  minItems?: number | undefined;
230
238
  uniqueItems?: boolean | undefined;
231
- title?: string | undefined;
232
239
  type: "array";
233
240
  items: {
234
241
  $ref: string;
235
242
  };
243
+ title: string;
236
244
  } | {
237
245
  type: "object";
238
246
  required: string[];
@@ -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
  };
@@ -476,7 +488,7 @@ export declare const clusterModel: {
476
488
  readonly type: "integer";
477
489
  };
478
490
  };
479
- readonly required: readonly ["type", "items"];
491
+ readonly required: readonly ["type", "title", "items"];
480
492
  readonly additionalProperties: false;
481
493
  }, {
482
494
  readonly type: "object";
@@ -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
  };
@@ -781,7 +811,7 @@ export declare const clusterModel: {
781
811
  readonly type: "integer";
782
812
  };
783
813
  };
784
- readonly required: readonly ["type", "items"];
814
+ readonly required: readonly ["type", "title", "items"];
785
815
  readonly additionalProperties: false;
786
816
  }, {
787
817
  readonly type: "object";
@@ -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
  };
@@ -1092,7 +1140,7 @@ export declare const clusterModel: {
1092
1140
  readonly type: "integer";
1093
1141
  };
1094
1142
  };
1095
- readonly required: readonly ["type", "items"];
1143
+ readonly required: readonly ["type", "title", "items"];
1096
1144
  readonly additionalProperties: false;
1097
1145
  }, {
1098
1146
  readonly type: "object";
@@ -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
  };
@@ -1263,11 +1329,11 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1263
1329
  maxItems?: number | undefined;
1264
1330
  minItems?: number | undefined;
1265
1331
  uniqueItems?: boolean | undefined;
1266
- title?: string | undefined;
1267
1332
  type: "array";
1268
1333
  items: {
1269
1334
  $ref: string;
1270
1335
  };
1336
+ title: string;
1271
1337
  } | {
1272
1338
  type: "object";
1273
1339
  required: string[];
@@ -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
  };
@@ -1342,11 +1412,11 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1342
1412
  maxItems?: number | undefined;
1343
1413
  minItems?: number | undefined;
1344
1414
  uniqueItems?: boolean | undefined;
1345
- title?: string | undefined;
1346
1415
  type: "array";
1347
1416
  items: {
1348
1417
  $ref: string;
1349
1418
  };
1419
+ title: string;
1350
1420
  } | {
1351
1421
  type: "object";
1352
1422
  required: string[];
@@ -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
  };
@@ -1421,11 +1495,11 @@ export declare const validateClusterModel: import("@enkaku/schema").Validator<{
1421
1495
  maxItems?: number | undefined;
1422
1496
  minItems?: number | undefined;
1423
1497
  uniqueItems?: boolean | undefined;
1424
- title?: string | undefined;
1425
1498
  type: "array";
1426
1499
  items: {
1427
1500
  $ref: string;
1428
1501
  };
1502
+ title: string;
1429
1503
  } | {
1430
1504
  type: "object";
1431
1505
  required: string[];
@@ -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
  };
1440
1518
  };
1441
1519
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../src/models/cluster.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,gBAAgB,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAyD,MAAM,WAAW,CAAA;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAG1B,MAAM,eAAe,CAAA;AAItB,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,WAAW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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAmDlD,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC;CAOhE"}
@@ -3,6 +3,11 @@ import { assertType, createValidator } from '@enkaku/schema';
3
3
  import { DocumentModelID, ScalarModelID, ShapeModelID, digestJSON } from '@kubun/id';
4
4
  import { documentModel, documentModelsCluster } from './document.js';
5
5
  import { binaryStringValue } from './value.js';
6
+ const JSONObjectSchema = {
7
+ type: 'object',
8
+ title: 'JSONObject',
9
+ additionalProperties: true
10
+ };
6
11
  export const REFERENCE_PREFIX = '#/$defs/';
7
12
  function toReference(id) {
8
13
  return `${REFERENCE_PREFIX}${id}`;
@@ -28,6 +33,9 @@ function encodeSchema(refs, schema) {
28
33
  switch(type){
29
34
  case 'array':
30
35
  {
36
+ if (schema.title == null) {
37
+ throw new Error('Invalid array schema: missing title');
38
+ }
31
39
  if (schema.items == null) {
32
40
  throw new Error('Invalid array schema: missing items');
33
41
  }
@@ -41,10 +49,7 @@ function encodeSchema(refs, schema) {
41
49
  case 'object':
42
50
  {
43
51
  if (schema.additionalProperties) {
44
- return addScalar(refs, {
45
- type: 'string',
46
- title: 'JSONObject'
47
- });
52
+ return addShape(refs, JSONObjectSchema);
48
53
  }
49
54
  if (schema.title == null) {
50
55
  throw new Error('Invalid object schema: missing title');