@hypequery/protocol-conformance 0.15.2 → 0.16.1

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.
Files changed (30) hide show
  1. package/README.md +8 -0
  2. package/dist/adapters/client-contract.d.ts +5 -0
  3. package/dist/adapters/client-contract.d.ts.map +1 -0
  4. package/dist/adapters/client-contract.js +29 -0
  5. package/dist/adapters/reference.d.ts +1 -1
  6. package/dist/adapters/reference.d.ts.map +1 -1
  7. package/dist/adapters/reference.js +8 -2
  8. package/dist/adapters/utils/client-contract-targets.d.ts +4 -0
  9. package/dist/adapters/utils/client-contract-targets.d.ts.map +1 -0
  10. package/dist/adapters/utils/client-contract-targets.js +7 -0
  11. package/dist/client-contract-fixtures.d.ts +3 -0
  12. package/dist/client-contract-fixtures.d.ts.map +1 -0
  13. package/dist/client-contract-fixtures.js +61 -0
  14. package/dist/compare.d.ts.map +1 -1
  15. package/dist/compare.js +8 -0
  16. package/dist/manifest.d.ts.map +1 -1
  17. package/dist/manifest.js +3 -1
  18. package/fixtures/client-contract-v1/README.md +29 -0
  19. package/fixtures/client-contract-v1/identities.json +36 -0
  20. package/fixtures/client-contract-v1/queries.json +484 -0
  21. package/fixtures/client-contract-v1/query-rejections.json +2114 -0
  22. package/fixtures/client-contract-v1/rejections.json +594 -0
  23. package/fixtures/client-contract-v1/relations.json +70 -0
  24. package/fixtures/client-contract-v1/success.json +696 -0
  25. package/fixtures/client-contract-v1/timezone-names.txt +597 -0
  26. package/fixtures/deployments-v2/identity.json +20 -0
  27. package/fixtures/deployments-v2/rejections.json +101 -0
  28. package/fixtures/deployments-v2/success.json +98 -0
  29. package/fixtures/manifest.json +33 -0
  30. package/package.json +3 -3
@@ -0,0 +1,484 @@
1
+ [
2
+ {
3
+ "id": "default-base-selection",
4
+ "contract": "build",
5
+ "endpoint": "orders",
6
+ "input": {},
7
+ "mode": "query",
8
+ "expected": {
9
+ "body": {
10
+ "dimensions": [],
11
+ "filters": [],
12
+ "orderBy": [],
13
+ "limit": 100,
14
+ "offset": 0,
15
+ "includeMeta": false,
16
+ "measures": [
17
+ "revenue",
18
+ "orderCount",
19
+ "latestLabel"
20
+ ],
21
+ "having": []
22
+ },
23
+ "selectedMeasures": [
24
+ "revenue",
25
+ "orderCount",
26
+ "latestLabel"
27
+ ],
28
+ "effectiveLimit": 100
29
+ }
30
+ },
31
+ {
32
+ "id": "explicit-derived-and-related",
33
+ "contract": "build",
34
+ "endpoint": "orders",
35
+ "input": {
36
+ "dimensions": [
37
+ "country",
38
+ "customer.tier"
39
+ ],
40
+ "measures": [
41
+ "averageRevenue",
42
+ "customer.unique"
43
+ ]
44
+ },
45
+ "mode": "query",
46
+ "expected": {
47
+ "body": {
48
+ "dimensions": [
49
+ "country",
50
+ "customer.tier"
51
+ ],
52
+ "filters": [],
53
+ "orderBy": [],
54
+ "limit": 100,
55
+ "offset": 0,
56
+ "includeMeta": false,
57
+ "measures": [
58
+ "averageRevenue",
59
+ "customer.unique"
60
+ ],
61
+ "having": []
62
+ },
63
+ "selectedMeasures": [
64
+ "averageRevenue",
65
+ "customer.unique"
66
+ ],
67
+ "effectiveLimit": 100
68
+ }
69
+ },
70
+ {
71
+ "id": "explicit-empty-measures",
72
+ "contract": "build",
73
+ "endpoint": "orders",
74
+ "input": {
75
+ "dimensions": [
76
+ "country"
77
+ ],
78
+ "measures": []
79
+ },
80
+ "mode": "query",
81
+ "expected": {
82
+ "body": {
83
+ "dimensions": [
84
+ "country"
85
+ ],
86
+ "filters": [],
87
+ "orderBy": [],
88
+ "limit": 100,
89
+ "offset": 0,
90
+ "includeMeta": false,
91
+ "measures": [],
92
+ "having": []
93
+ },
94
+ "selectedMeasures": [],
95
+ "effectiveLimit": 100
96
+ }
97
+ },
98
+ {
99
+ "id": "typed-number-range",
100
+ "contract": "build",
101
+ "endpoint": "orders",
102
+ "input": {
103
+ "measures": [
104
+ "revenue"
105
+ ],
106
+ "filters": [
107
+ {
108
+ "field": "amount",
109
+ "operator": "between",
110
+ "value": [
111
+ 10,
112
+ 20
113
+ ]
114
+ }
115
+ ]
116
+ },
117
+ "mode": "query",
118
+ "expected": {
119
+ "body": {
120
+ "dimensions": [],
121
+ "filters": [
122
+ {
123
+ "field": "amount",
124
+ "operator": "between",
125
+ "value": [
126
+ 10,
127
+ 20
128
+ ]
129
+ }
130
+ ],
131
+ "orderBy": [],
132
+ "limit": 100,
133
+ "offset": 0,
134
+ "includeMeta": false,
135
+ "measures": [
136
+ "revenue"
137
+ ],
138
+ "having": []
139
+ },
140
+ "selectedMeasures": [
141
+ "revenue"
142
+ ],
143
+ "effectiveLimit": 100
144
+ }
145
+ },
146
+ {
147
+ "id": "typed-related-boolean",
148
+ "contract": "build",
149
+ "endpoint": "orders",
150
+ "input": {
151
+ "filters": [
152
+ {
153
+ "field": "customer.active",
154
+ "operator": "eq",
155
+ "value": true
156
+ }
157
+ ]
158
+ },
159
+ "mode": "query",
160
+ "expected": {
161
+ "body": {
162
+ "dimensions": [],
163
+ "filters": [
164
+ {
165
+ "field": "customer.active",
166
+ "operator": "eq",
167
+ "value": true
168
+ }
169
+ ],
170
+ "orderBy": [],
171
+ "limit": 100,
172
+ "offset": 0,
173
+ "includeMeta": false,
174
+ "measures": [
175
+ "revenue",
176
+ "orderCount",
177
+ "latestLabel"
178
+ ],
179
+ "having": []
180
+ },
181
+ "selectedMeasures": [
182
+ "revenue",
183
+ "orderCount",
184
+ "latestLabel"
185
+ ],
186
+ "effectiveLimit": 100
187
+ }
188
+ },
189
+ {
190
+ "id": "filter-alias-not-dimension",
191
+ "contract": "build",
192
+ "endpoint": "orders",
193
+ "input": {
194
+ "filters": [
195
+ {
196
+ "field": "paidStatus",
197
+ "operator": "eq",
198
+ "value": "paid"
199
+ }
200
+ ]
201
+ },
202
+ "mode": "query",
203
+ "expected": {
204
+ "body": {
205
+ "dimensions": [],
206
+ "filters": [
207
+ {
208
+ "field": "paidStatus",
209
+ "operator": "eq",
210
+ "value": "paid"
211
+ }
212
+ ],
213
+ "orderBy": [],
214
+ "limit": 100,
215
+ "offset": 0,
216
+ "includeMeta": false,
217
+ "measures": [
218
+ "revenue",
219
+ "orderCount",
220
+ "latestLabel"
221
+ ],
222
+ "having": []
223
+ },
224
+ "selectedMeasures": [
225
+ "revenue",
226
+ "orderCount",
227
+ "latestLabel"
228
+ ],
229
+ "effectiveLimit": 100
230
+ }
231
+ },
232
+ {
233
+ "id": "grain-timezone",
234
+ "contract": "build",
235
+ "endpoint": "orders",
236
+ "input": {
237
+ "by": "hour",
238
+ "timezone": "America/New_York",
239
+ "orderBy": [
240
+ {
241
+ "field": "period",
242
+ "direction": "asc"
243
+ }
244
+ ]
245
+ },
246
+ "mode": "query",
247
+ "expected": {
248
+ "body": {
249
+ "dimensions": [],
250
+ "filters": [],
251
+ "orderBy": [
252
+ {
253
+ "field": "period",
254
+ "direction": "asc"
255
+ }
256
+ ],
257
+ "limit": 100,
258
+ "offset": 0,
259
+ "includeMeta": false,
260
+ "measures": [
261
+ "revenue",
262
+ "orderCount",
263
+ "latestLabel"
264
+ ],
265
+ "having": [],
266
+ "by": "hour",
267
+ "timezone": "America/New_York"
268
+ },
269
+ "selectedMeasures": [
270
+ "revenue",
271
+ "orderCount",
272
+ "latestLabel"
273
+ ],
274
+ "effectiveLimit": 100
275
+ }
276
+ },
277
+ {
278
+ "id": "having-selected",
279
+ "contract": "build",
280
+ "endpoint": "orders",
281
+ "input": {
282
+ "measures": [
283
+ "revenue"
284
+ ],
285
+ "having": [
286
+ {
287
+ "measure": "revenue",
288
+ "operator": "gt",
289
+ "value": 10
290
+ }
291
+ ]
292
+ },
293
+ "mode": "query",
294
+ "expected": {
295
+ "body": {
296
+ "dimensions": [],
297
+ "filters": [],
298
+ "orderBy": [],
299
+ "limit": 100,
300
+ "offset": 0,
301
+ "includeMeta": false,
302
+ "measures": [
303
+ "revenue"
304
+ ],
305
+ "having": [
306
+ {
307
+ "measure": "revenue",
308
+ "operator": "gt",
309
+ "value": 10
310
+ }
311
+ ]
312
+ },
313
+ "selectedMeasures": [
314
+ "revenue"
315
+ ],
316
+ "effectiveLimit": 100
317
+ }
318
+ },
319
+ {
320
+ "id": "metric-query",
321
+ "contract": "metric-only",
322
+ "endpoint": "ordersRevenue",
323
+ "input": {
324
+ "dimensions": [
325
+ "country"
326
+ ],
327
+ "includeMeta": true
328
+ },
329
+ "mode": "query",
330
+ "expected": {
331
+ "body": {
332
+ "dimensions": [
333
+ "country"
334
+ ],
335
+ "filters": [],
336
+ "orderBy": [],
337
+ "limit": 20,
338
+ "offset": 0,
339
+ "includeMeta": true
340
+ },
341
+ "selectedMeasures": [
342
+ "revenue"
343
+ ],
344
+ "effectiveLimit": 20
345
+ }
346
+ },
347
+ {
348
+ "id": "dimensions-only-dataset",
349
+ "contract": "build",
350
+ "endpoint": "countries",
351
+ "input": {
352
+ "dimensions": [
353
+ "country"
354
+ ],
355
+ "measures": []
356
+ },
357
+ "mode": "query",
358
+ "expected": {
359
+ "body": {
360
+ "dimensions": [
361
+ "country"
362
+ ],
363
+ "filters": [],
364
+ "orderBy": [],
365
+ "limit": 100,
366
+ "offset": 0,
367
+ "includeMeta": false,
368
+ "measures": [],
369
+ "having": []
370
+ },
371
+ "selectedMeasures": [],
372
+ "effectiveLimit": 100
373
+ }
374
+ },
375
+ {
376
+ "id": "clamped-limit",
377
+ "contract": "build",
378
+ "endpoint": "orders",
379
+ "input": {
380
+ "limit": 100000,
381
+ "includeMeta": true
382
+ },
383
+ "mode": "query",
384
+ "expected": {
385
+ "body": {
386
+ "dimensions": [],
387
+ "filters": [],
388
+ "orderBy": [],
389
+ "limit": 1000,
390
+ "offset": 0,
391
+ "includeMeta": true,
392
+ "measures": [
393
+ "revenue",
394
+ "orderCount",
395
+ "latestLabel"
396
+ ],
397
+ "having": []
398
+ },
399
+ "selectedMeasures": [
400
+ "revenue",
401
+ "orderCount",
402
+ "latestLabel"
403
+ ],
404
+ "effectiveLimit": 1000
405
+ }
406
+ },
407
+ {
408
+ "id": "mcp-grain-mapping",
409
+ "contract": "build",
410
+ "endpoint": "orders",
411
+ "input": {
412
+ "dataset": "orders",
413
+ "grain": "hour",
414
+ "measures": [
415
+ "revenue"
416
+ ]
417
+ },
418
+ "transport": "mcp",
419
+ "http": {
420
+ "by": "hour",
421
+ "measures": [
422
+ "revenue"
423
+ ]
424
+ },
425
+ "mode": "query",
426
+ "expected": {
427
+ "body": {
428
+ "dimensions": [],
429
+ "filters": [],
430
+ "orderBy": [],
431
+ "limit": 100,
432
+ "offset": 0,
433
+ "includeMeta": false,
434
+ "measures": [
435
+ "revenue"
436
+ ],
437
+ "having": [],
438
+ "by": "hour"
439
+ },
440
+ "selectedMeasures": [
441
+ "revenue"
442
+ ],
443
+ "effectiveLimit": 100
444
+ }
445
+ },
446
+ {
447
+ "id": "mcp-limit-at-max",
448
+ "contract": "build",
449
+ "endpoint": "orders",
450
+ "input": {
451
+ "dataset": "orders",
452
+ "measures": [
453
+ "revenue"
454
+ ],
455
+ "limit": 1000
456
+ },
457
+ "transport": "mcp",
458
+ "http": {
459
+ "measures": [
460
+ "revenue"
461
+ ],
462
+ "limit": 1000
463
+ },
464
+ "mode": "query",
465
+ "expected": {
466
+ "body": {
467
+ "dimensions": [],
468
+ "filters": [],
469
+ "orderBy": [],
470
+ "limit": 1000,
471
+ "offset": 0,
472
+ "includeMeta": false,
473
+ "measures": [
474
+ "revenue"
475
+ ],
476
+ "having": []
477
+ },
478
+ "selectedMeasures": [
479
+ "revenue"
480
+ ],
481
+ "effectiveLimit": 1000
482
+ }
483
+ }
484
+ ]