@hypequery/protocol-conformance 0.15.1 → 0.16.0

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.
@@ -0,0 +1,594 @@
1
+ [
2
+ {
3
+ "id": "unsupported-version",
4
+ "base": "build",
5
+ "set": [
6
+ {
7
+ "path": "/version",
8
+ "value": 2
9
+ }
10
+ ],
11
+ "error": "HQ_CLIENT_VERSION",
12
+ "path": "",
13
+ "message": "Unsupported client contract version."
14
+ },
15
+ {
16
+ "id": "unknown-root-field",
17
+ "base": "build",
18
+ "set": [
19
+ {
20
+ "path": "/tenant",
21
+ "value": "synthetic_tenant"
22
+ }
23
+ ],
24
+ "error": "HQ_CLIENT_UNKNOWN_FIELD",
25
+ "path": "",
26
+ "message": "Unknown client contract field."
27
+ },
28
+ {
29
+ "id": "physical-source",
30
+ "base": "build",
31
+ "set": [
32
+ {
33
+ "path": "/endpoints/1/source",
34
+ "value": "private_orders"
35
+ }
36
+ ],
37
+ "error": "HQ_CLIENT_UNKNOWN_FIELD",
38
+ "path": "/endpoints/1",
39
+ "message": "Unknown client contract field."
40
+ },
41
+ {
42
+ "id": "physical-column",
43
+ "base": "build",
44
+ "set": [
45
+ {
46
+ "path": "/endpoints/1/dimensions/country/column",
47
+ "value": "private_country"
48
+ }
49
+ ],
50
+ "error": "HQ_CLIENT_UNKNOWN_FIELD",
51
+ "path": "/endpoints/1/dimensions/country",
52
+ "message": "Unknown client contract field."
53
+ },
54
+ {
55
+ "id": "duplicate-endpoint",
56
+ "base": "build",
57
+ "set": [
58
+ {
59
+ "path": "/endpoints/-",
60
+ "value": {
61
+ "id": "countries",
62
+ "kind": "dataset",
63
+ "dataset": "countries",
64
+ "path": "/api/v1/datasets/countries/query",
65
+ "dimensions": {
66
+ "country": {
67
+ "type": "string",
68
+ "wireType": "string",
69
+ "nullable": false,
70
+ "groupable": true,
71
+ "orderable": true
72
+ }
73
+ },
74
+ "measures": {},
75
+ "filters": {},
76
+ "time": null,
77
+ "defaultMeasures": [],
78
+ "metadata": false,
79
+ "limits": {
80
+ "defaultLimit": 100,
81
+ "maxLimit": 1000,
82
+ "maxOffset": 10000,
83
+ "maxDimensions": 50,
84
+ "maxMeasures": 0,
85
+ "maxPredicates": 0,
86
+ "maxOrderBy": 50,
87
+ "maxFilterValues": 1000
88
+ },
89
+ "schemaHash": "9a5f50cd7564f283d2f0ee8f3f1cdc27731683c939e176bd25919a83d28d94ca"
90
+ }
91
+ }
92
+ ],
93
+ "error": "HQ_CLIENT_DUPLICATE",
94
+ "path": "/endpoints/3",
95
+ "message": "Duplicate client contract entry."
96
+ },
97
+ {
98
+ "id": "dataset-id-mismatch",
99
+ "base": "build",
100
+ "set": [
101
+ {
102
+ "path": "/endpoints/1/dataset",
103
+ "value": "differentOrders"
104
+ }
105
+ ],
106
+ "error": "HQ_CLIENT_REFERENCE",
107
+ "path": "/endpoints/1",
108
+ "message": "Inconsistent client contract reference."
109
+ },
110
+ {
111
+ "id": "foreign-route",
112
+ "base": "build",
113
+ "set": [
114
+ {
115
+ "path": "/endpoints/1/path",
116
+ "value": "https://other.example/query"
117
+ }
118
+ ],
119
+ "error": "HQ_CLIENT_PATH",
120
+ "path": "/endpoints/1/path",
121
+ "message": "Invalid client endpoint path."
122
+ },
123
+ {
124
+ "id": "encoded-route",
125
+ "base": "build",
126
+ "set": [
127
+ {
128
+ "path": "/endpoints/1/path",
129
+ "value": "/api/%2e%2e/private"
130
+ }
131
+ ],
132
+ "error": "HQ_CLIENT_PATH",
133
+ "path": "/endpoints/1/path",
134
+ "message": "Invalid client endpoint path."
135
+ },
136
+ {
137
+ "id": "dot-segment",
138
+ "base": "build",
139
+ "set": [
140
+ {
141
+ "path": "/endpoints/1/path",
142
+ "value": "/api/../private"
143
+ }
144
+ ],
145
+ "error": "HQ_CLIENT_PATH",
146
+ "path": "/endpoints/1/path",
147
+ "message": "Invalid client endpoint path."
148
+ },
149
+ {
150
+ "id": "templated-route",
151
+ "base": "build",
152
+ "set": [
153
+ {
154
+ "path": "/endpoints/1/path",
155
+ "value": "/datasets/{dataset}/query"
156
+ }
157
+ ],
158
+ "error": "HQ_CLIENT_PATH",
159
+ "path": "/endpoints/1/path",
160
+ "message": "Invalid client endpoint path."
161
+ },
162
+ {
163
+ "id": "query-in-route",
164
+ "base": "build",
165
+ "set": [
166
+ {
167
+ "path": "/endpoints/1/path",
168
+ "value": "/query?tenant=synthetic"
169
+ }
170
+ ],
171
+ "error": "HQ_CLIENT_PATH",
172
+ "path": "/endpoints/1/path",
173
+ "message": "Invalid client endpoint path."
174
+ },
175
+ {
176
+ "id": "unknown-default-measure",
177
+ "base": "build",
178
+ "set": [
179
+ {
180
+ "path": "/endpoints/1/defaultMeasures",
181
+ "value": [
182
+ "missing"
183
+ ]
184
+ }
185
+ ],
186
+ "error": "HQ_CLIENT_REFERENCE",
187
+ "path": "/endpoints/1",
188
+ "message": "Inconsistent client contract reference."
189
+ },
190
+ {
191
+ "id": "duplicate-default-measure",
192
+ "base": "build",
193
+ "set": [
194
+ {
195
+ "path": "/endpoints/1/defaultMeasures",
196
+ "value": [
197
+ "revenue",
198
+ "revenue"
199
+ ]
200
+ }
201
+ ],
202
+ "error": "HQ_CLIENT_DUPLICATE",
203
+ "path": "/endpoints/1/defaultMeasures",
204
+ "message": "Duplicate client contract entry."
205
+ },
206
+ {
207
+ "id": "measure-dimension-collision",
208
+ "base": "build",
209
+ "set": [
210
+ {
211
+ "path": "/endpoints/1/measures/country",
212
+ "value": {
213
+ "wireType": "string",
214
+ "nullable": true,
215
+ "having": false
216
+ }
217
+ }
218
+ ],
219
+ "error": "HQ_CLIENT_REFERENCE",
220
+ "path": "/endpoints/1",
221
+ "message": "Inconsistent client contract reference."
222
+ },
223
+ {
224
+ "id": "invalid-qualified-name",
225
+ "base": "build",
226
+ "set": [
227
+ {
228
+ "path": "/endpoints/1/dimensions/customer.next.tier",
229
+ "value": {
230
+ "type": "string",
231
+ "wireType": "string",
232
+ "nullable": false,
233
+ "groupable": true,
234
+ "orderable": true
235
+ }
236
+ }
237
+ ],
238
+ "error": "HQ_CLIENT_IDENTIFIER",
239
+ "path": "/endpoints/1/dimensions",
240
+ "message": "Invalid client contract identifier."
241
+ },
242
+ {
243
+ "id": "unsafe-boolean-operator",
244
+ "base": "build",
245
+ "set": [
246
+ {
247
+ "path": "/endpoints/1/filters/customer.active/operators",
248
+ "value": [
249
+ "gt"
250
+ ]
251
+ }
252
+ ],
253
+ "error": "HQ_CLIENT_SHAPE",
254
+ "path": "/endpoints/1/filters/customer.active/operators/0",
255
+ "message": "Invalid client contract shape."
256
+ },
257
+ {
258
+ "id": "empty-operator-list",
259
+ "base": "build",
260
+ "set": [
261
+ {
262
+ "path": "/endpoints/1/filters/country/operators",
263
+ "value": []
264
+ }
265
+ ],
266
+ "error": "HQ_CLIENT_SHAPE",
267
+ "path": "/endpoints/1/filters/country/operators",
268
+ "message": "Invalid client contract shape."
269
+ },
270
+ {
271
+ "id": "duplicate-operator",
272
+ "base": "build",
273
+ "set": [
274
+ {
275
+ "path": "/endpoints/1/filters/country/operators",
276
+ "value": [
277
+ "eq",
278
+ "eq"
279
+ ]
280
+ }
281
+ ],
282
+ "error": "HQ_CLIENT_DUPLICATE",
283
+ "path": "/endpoints/1/filters/country/operators",
284
+ "message": "Duplicate client contract entry."
285
+ },
286
+ {
287
+ "id": "number-with-boolean-wire-type",
288
+ "base": "build",
289
+ "set": [
290
+ {
291
+ "path": "/endpoints/1/dimensions/amount/wireType",
292
+ "value": "boolean"
293
+ }
294
+ ],
295
+ "error": "HQ_CLIENT_SHAPE",
296
+ "path": "/endpoints/1/dimensions/amount/wireType",
297
+ "message": "Invalid client contract shape."
298
+ },
299
+ {
300
+ "id": "related-non-null-guarantee",
301
+ "base": "build",
302
+ "set": [
303
+ {
304
+ "path": "/endpoints/1/dimensions/customer.tier/nullable",
305
+ "value": false
306
+ }
307
+ ],
308
+ "error": "HQ_CLIENT_SHAPE",
309
+ "path": "/endpoints/1/dimensions/customer.tier",
310
+ "message": "Invalid client contract shape."
311
+ },
312
+ {
313
+ "id": "invalid-limit",
314
+ "base": "build",
315
+ "set": [
316
+ {
317
+ "path": "/endpoints/1/limits/maxLimit",
318
+ "value": -1
319
+ }
320
+ ],
321
+ "error": "HQ_CLIENT_SHAPE",
322
+ "path": "/endpoints/1/limits/maxLimit",
323
+ "message": "Invalid client contract shape."
324
+ },
325
+ {
326
+ "id": "boolean-limit",
327
+ "base": "build",
328
+ "set": [
329
+ {
330
+ "path": "/endpoints/1/limits/defaultLimit",
331
+ "value": true
332
+ }
333
+ ],
334
+ "error": "HQ_CLIENT_SHAPE",
335
+ "path": "/endpoints/1/limits/defaultLimit",
336
+ "message": "Invalid client contract shape."
337
+ },
338
+ {
339
+ "id": "default-exceeds-limit",
340
+ "base": "build",
341
+ "set": [
342
+ {
343
+ "path": "/endpoints/1/limits/defaultLimit",
344
+ "value": 1001
345
+ }
346
+ ],
347
+ "error": "HQ_CLIENT_REFERENCE",
348
+ "path": "/endpoints/1",
349
+ "message": "Inconsistent client contract reference."
350
+ },
351
+ {
352
+ "id": "metric-default-selection",
353
+ "base": "build",
354
+ "set": [
355
+ {
356
+ "path": "/endpoints/2/defaultMeasures",
357
+ "value": [
358
+ "revenue"
359
+ ]
360
+ }
361
+ ],
362
+ "error": "HQ_CLIENT_UNKNOWN_FIELD",
363
+ "path": "/endpoints/2",
364
+ "message": "Unknown client contract field."
365
+ },
366
+ {
367
+ "id": "metric-multiple-measures",
368
+ "base": "build",
369
+ "set": [
370
+ {
371
+ "path": "/endpoints/2/measures/other",
372
+ "value": {
373
+ "wireType": "string",
374
+ "nullable": true,
375
+ "having": false
376
+ }
377
+ }
378
+ ],
379
+ "error": "HQ_CLIENT_SHAPE",
380
+ "path": "/endpoints/2",
381
+ "message": "Invalid client contract shape."
382
+ },
383
+ {
384
+ "id": "metric-having",
385
+ "base": "build",
386
+ "set": [
387
+ {
388
+ "path": "/endpoints/2/measures/revenue/having",
389
+ "value": true
390
+ }
391
+ ],
392
+ "error": "HQ_CLIENT_SHAPE",
393
+ "path": "/endpoints/2",
394
+ "message": "Invalid client contract shape."
395
+ },
396
+ {
397
+ "id": "unsupported-segments",
398
+ "base": "build",
399
+ "set": [
400
+ {
401
+ "path": "/endpoints/1/segments",
402
+ "value": [
403
+ "paid"
404
+ ]
405
+ }
406
+ ],
407
+ "error": "HQ_CLIENT_UNKNOWN_FIELD",
408
+ "path": "/endpoints/1",
409
+ "message": "Unknown client contract field."
410
+ },
411
+ {
412
+ "id": "invalid-grain",
413
+ "base": "build",
414
+ "set": [
415
+ {
416
+ "path": "/endpoints/1/time/grains",
417
+ "value": [
418
+ "fortnight"
419
+ ]
420
+ }
421
+ ],
422
+ "error": "HQ_CLIENT_SHAPE",
423
+ "path": "/endpoints/1/time/grains/0",
424
+ "message": "Invalid client contract shape."
425
+ },
426
+ {
427
+ "id": "invalid-schema-hash",
428
+ "base": "build",
429
+ "set": [
430
+ {
431
+ "path": "/endpoints/1/schemaHash",
432
+ "value": "0000000000000000000000000000000000000000000000000000000000000000"
433
+ }
434
+ ],
435
+ "error": "HQ_CLIENT_IDENTITY",
436
+ "path": "/endpoints/1/schemaHash",
437
+ "message": "Client contract identity does not match."
438
+ },
439
+ {
440
+ "id": "invalid-content-hash",
441
+ "base": "build",
442
+ "set": [
443
+ {
444
+ "path": "/contentHash",
445
+ "value": "0000000000000000000000000000000000000000000000000000000000000000"
446
+ }
447
+ ],
448
+ "error": "HQ_CLIENT_IDENTITY",
449
+ "path": "/contentHash",
450
+ "message": "Client contract identity does not match."
451
+ },
452
+ {
453
+ "id": "endpoints-256",
454
+ "mode": "boundary",
455
+ "generator": {
456
+ "type": "endpoints",
457
+ "count": 256
458
+ },
459
+ "error": "HQ_CLIENT_SHAPE",
460
+ "path": "/endpoints/0/kind",
461
+ "message": "Invalid client contract shape."
462
+ },
463
+ {
464
+ "id": "endpoints-257",
465
+ "mode": "boundary",
466
+ "generator": {
467
+ "type": "endpoints",
468
+ "count": 257
469
+ },
470
+ "error": "HQ_CLIENT_LIMIT",
471
+ "path": "/endpoints",
472
+ "message": "Client contract exceeds validation limits."
473
+ },
474
+ {
475
+ "id": "descriptors-64",
476
+ "mode": "boundary",
477
+ "generator": {
478
+ "type": "descriptors",
479
+ "count": 64
480
+ },
481
+ "error": "HQ_CLIENT_SHAPE",
482
+ "path": "/endpoints/0/kind",
483
+ "message": "Invalid client contract shape."
484
+ },
485
+ {
486
+ "id": "descriptors-65",
487
+ "mode": "boundary",
488
+ "generator": {
489
+ "type": "descriptors",
490
+ "count": 65
491
+ },
492
+ "error": "HQ_CLIENT_LIMIT",
493
+ "path": "/endpoints/64",
494
+ "message": "Client contract exceeds validation limits."
495
+ },
496
+ {
497
+ "id": "bytes-1048576",
498
+ "mode": "boundary",
499
+ "generator": {
500
+ "type": "bytes",
501
+ "count": 1048576
502
+ },
503
+ "error": "HQ_CLIENT_VERSION",
504
+ "path": "",
505
+ "message": "Unsupported client contract version."
506
+ },
507
+ {
508
+ "id": "bytes-1048577",
509
+ "mode": "boundary",
510
+ "generator": {
511
+ "type": "bytes",
512
+ "count": 1048577
513
+ },
514
+ "error": "HQ_CLIENT_LIMIT",
515
+ "path": "",
516
+ "message": "Client contract exceeds validation limits."
517
+ },
518
+ {
519
+ "id": "depth-16",
520
+ "mode": "boundary",
521
+ "generator": {
522
+ "type": "depth",
523
+ "count": 16
524
+ },
525
+ "error": "HQ_CLIENT_SHAPE",
526
+ "path": "",
527
+ "message": "Invalid client contract shape."
528
+ },
529
+ {
530
+ "id": "depth-17",
531
+ "mode": "boundary",
532
+ "generator": {
533
+ "type": "depth",
534
+ "count": 17
535
+ },
536
+ "error": "HQ_CLIENT_LIMIT",
537
+ "path": "",
538
+ "message": "Client contract exceeds validation limits."
539
+ },
540
+ {
541
+ "id": "duplicate-key",
542
+ "mode": "decode",
543
+ "value": "{\"version\":1,\"\\u0076ersion\":1}",
544
+ "error": "HQ_CLIENT_DUPLICATE",
545
+ "path": "",
546
+ "message": "Duplicate client contract entry."
547
+ },
548
+ {
549
+ "id": "trailing-comma",
550
+ "mode": "decode",
551
+ "value": "{\"x\":1,}",
552
+ "error": "HQ_CLIENT_TYPE",
553
+ "path": "",
554
+ "message": "Expected plain JSON data."
555
+ },
556
+ {
557
+ "id": "non-finite-number",
558
+ "mode": "decode",
559
+ "value": "{\"x\":1e400}",
560
+ "error": "HQ_CLIENT_TYPE",
561
+ "path": "",
562
+ "message": "Expected plain JSON data."
563
+ },
564
+ {
565
+ "id": "unpaired-surrogate",
566
+ "mode": "decode",
567
+ "value": "{\"x\":\"\\ud800\"}",
568
+ "error": "HQ_CLIENT_TYPE",
569
+ "path": "",
570
+ "message": "Expected plain JSON data."
571
+ },
572
+ {
573
+ "id": "array-members-20000",
574
+ "mode": "boundary",
575
+ "generator": {
576
+ "type": "members",
577
+ "count": 20000
578
+ },
579
+ "error": "HQ_CLIENT_SHAPE",
580
+ "path": "",
581
+ "message": "Invalid client contract shape."
582
+ },
583
+ {
584
+ "id": "array-members-20001",
585
+ "mode": "boundary",
586
+ "generator": {
587
+ "type": "members",
588
+ "count": 20001
589
+ },
590
+ "error": "HQ_CLIENT_LIMIT",
591
+ "path": "",
592
+ "message": "Client contract exceeds validation limits."
593
+ }
594
+ ]
@@ -0,0 +1,70 @@
1
+ [
2
+ {
3
+ "id": "limits-do-not-change-schema",
4
+ "left": "build",
5
+ "right": "narrowed",
6
+ "sameEndpointSchemas": [
7
+ "countries",
8
+ "orders",
9
+ "ordersRevenue"
10
+ ],
11
+ "sameContentHash": false,
12
+ "mode": "relation",
13
+ "expected": {
14
+ "sameEndpointSchemas": [
15
+ "countries",
16
+ "orders",
17
+ "ordersRevenue"
18
+ ],
19
+ "sameContentHash": false
20
+ }
21
+ },
22
+ {
23
+ "id": "metric-only-retains-its-schema",
24
+ "left": "build",
25
+ "right": "metric-only",
26
+ "sameEndpointSchemas": [
27
+ "ordersRevenue"
28
+ ],
29
+ "sameContentHash": false,
30
+ "mode": "relation",
31
+ "expected": {
32
+ "sameEndpointSchemas": [
33
+ "ordersRevenue"
34
+ ],
35
+ "sameContentHash": false
36
+ }
37
+ },
38
+ {
39
+ "id": "empty-view-has-no-tools",
40
+ "contract": "empty",
41
+ "queryDatasetTargets": [],
42
+ "queryMetricTargets": [],
43
+ "mode": "relation",
44
+ "expected": {
45
+ "queryDatasetTargets": [],
46
+ "queryMetricTargets": []
47
+ }
48
+ },
49
+ {
50
+ "id": "metric-only-view-does-not-advertise-dataset",
51
+ "contract": "metric-only",
52
+ "queryDatasetTargets": [],
53
+ "queryMetricTargets": [
54
+ {
55
+ "dataset": "orders",
56
+ "metric": "ordersRevenue"
57
+ }
58
+ ],
59
+ "mode": "relation",
60
+ "expected": {
61
+ "queryDatasetTargets": [],
62
+ "queryMetricTargets": [
63
+ {
64
+ "dataset": "orders",
65
+ "metric": "ordersRevenue"
66
+ }
67
+ ]
68
+ }
69
+ }
70
+ ]