@hypequery/protocol 0.0.0-canary-20261022063821 → 0.0.0-canary-20261022065415
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/client-contract/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/client-contract/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAKzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AA2ED,gGAAgG;AAChG,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,GAAE,MAAM,GAAG,KAAc,GACxF,eAAe,CAmBjB"}
|
|
@@ -25,7 +25,7 @@ function predicateValue(value, type, operator, maximum) {
|
|
|
25
25
|
clientError('HQ_CLIENT_QUERY');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function bodyFor(endpoint, source) {
|
|
28
|
+
function bodyFor(endpoint, source, transport) {
|
|
29
29
|
const keys = ['dimensions', 'filters', 'orderBy', 'limit', 'offset', 'includeMeta',
|
|
30
30
|
...(endpoint.kind === 'dataset' ? ['measures', 'having'] : []),
|
|
31
31
|
...(endpoint.time ? ['by', ...(endpoint.time.timezone ? ['timezone'] : [])] : [])];
|
|
@@ -72,8 +72,10 @@ function bodyFor(endpoint, source) {
|
|
|
72
72
|
clientError('HQ_CLIENT_QUERY');
|
|
73
73
|
ordered.add(order.field);
|
|
74
74
|
}
|
|
75
|
+
// HTTP clamps a larger limit; an agent is refused one, so it never reads a
|
|
76
|
+
// silently shortened page as the whole answer.
|
|
75
77
|
const effectiveLimit = Math.min(source.limit === undefined ? caps.defaultLimit
|
|
76
|
-
: integer(source.limit, 1, Number.MAX_SAFE_INTEGER, '/limit'), caps.maxLimit);
|
|
78
|
+
: integer(source.limit, 1, transport === 'mcp' ? caps.maxLimit : Number.MAX_SAFE_INTEGER, '/limit'), caps.maxLimit);
|
|
77
79
|
const offset = source.offset === undefined ? 0 : integer(source.offset, 0, caps.maxOffset, '/offset');
|
|
78
80
|
if (source.includeMeta !== undefined && typeof source.includeMeta !== 'boolean')
|
|
79
81
|
clientError('HQ_CLIENT_QUERY');
|
|
@@ -109,7 +111,7 @@ export function validateProtocolClientQuery(contract, endpointId, input, transpo
|
|
|
109
111
|
}
|
|
110
112
|
else if (transport !== 'http')
|
|
111
113
|
clientError('HQ_CLIENT_QUERY');
|
|
112
|
-
return bodyFor(endpoint, source);
|
|
114
|
+
return bodyFor(endpoint, source, transport);
|
|
113
115
|
}
|
|
114
116
|
catch (error) {
|
|
115
117
|
if (error instanceof ProtocolClientContractError)
|
package/package.json
CHANGED