@vertz/fetch 0.2.46 → 0.2.49
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.
- package/dist/index.d.ts +10 -3
- package/dist/index.js +1 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -44,9 +44,16 @@ interface FetchClientConfig {
|
|
|
44
44
|
fetch?: typeof fetch;
|
|
45
45
|
credentials?: RequestCredentials;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Query parameters for URL construction.
|
|
49
|
+
* Typed as `object` so that generated interfaces (e.g., from `@vertz/openapi`)
|
|
50
|
+
* are assignable without needing an explicit index signature.
|
|
51
|
+
* Values are serialized via `String(value)` — null and undefined are skipped.
|
|
52
|
+
*/
|
|
53
|
+
type QueryParams = object;
|
|
47
54
|
interface RequestOptions {
|
|
48
55
|
headers?: Record<string, string>;
|
|
49
|
-
query?:
|
|
56
|
+
query?: QueryParams;
|
|
50
57
|
body?: unknown;
|
|
51
58
|
signal?: AbortSignal;
|
|
52
59
|
}
|
|
@@ -154,7 +161,7 @@ declare function isQueryDescriptor<
|
|
|
154
161
|
T,
|
|
155
162
|
E = FetchError
|
|
156
163
|
>(value: unknown): value is QueryDescriptor<T, E>;
|
|
157
|
-
declare function createDescriptor<T>(method: string, path: string, fetchFn: () => Promise<FetchResponse<T>>, query?:
|
|
164
|
+
declare function createDescriptor<T>(method: string, path: string, fetchFn: () => Promise<FetchResponse<T>>, query?: QueryParams, entity?: EntityQueryMeta): QueryDescriptor<T>;
|
|
158
165
|
declare function isMutationDescriptor<
|
|
159
166
|
T,
|
|
160
167
|
E = FetchError
|
|
@@ -232,4 +239,4 @@ declare function encodeVertzQL(params: VertzQLParams): string;
|
|
|
232
239
|
* Returns the query unchanged if no VertzQL keys are present.
|
|
233
240
|
*/
|
|
234
241
|
declare function resolveVertzQL(query?: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
235
|
-
export { unwrapOr, unwrap, resolveVertzQL, ok, matchError, isQueryDescriptor, isOk, isMutationDescriptor, isErr, err, encodeVertzQL, createMutationDescriptor, createErrorFromStatus, createDescriptor, VertzQLParams, UnprocessableEntityError, UnauthorizedError, StreamingRequestOptions, StreamingFormat, ServiceUnavailableError, RetryConfig, Result3 as Result, RequestOptions, RateLimitError, QueryDescriptor, OptimisticHandler, NotFoundError, MutationMeta, MutationDescriptor, ListResponse, InternalServerError, HooksConfig, GoneError, ForbiddenError, FetchResponse, FetchErrorType, FetchError2 as FetchError, FetchClientConfig, FetchClient, EntityQueryMeta, EntityErrorType, ConflictError, BadRequestError, AuthStrategy };
|
|
242
|
+
export { unwrapOr, unwrap, resolveVertzQL, ok, matchError, isQueryDescriptor, isOk, isMutationDescriptor, isErr, err, encodeVertzQL, createMutationDescriptor, createErrorFromStatus, createDescriptor, VertzQLParams, UnprocessableEntityError, UnauthorizedError, StreamingRequestOptions, StreamingFormat, ServiceUnavailableError, RetryConfig, Result3 as Result, RequestOptions, RateLimitError, QueryParams, QueryDescriptor, OptimisticHandler, NotFoundError, MutationMeta, MutationDescriptor, ListResponse, InternalServerError, HooksConfig, GoneError, ForbiddenError, FetchResponse, FetchErrorType, FetchError2 as FetchError, FetchClientConfig, FetchClient, EntityQueryMeta, EntityErrorType, ConflictError, BadRequestError, AuthStrategy };
|
package/dist/index.js
CHANGED
|
@@ -411,8 +411,7 @@ function serializeQuery(query) {
|
|
|
411
411
|
if (!query)
|
|
412
412
|
return "";
|
|
413
413
|
const params = new URLSearchParams;
|
|
414
|
-
for (const key of Object.
|
|
415
|
-
const value = query[key];
|
|
414
|
+
for (const [key, value] of Object.entries(query).sort(([a], [b]) => a.localeCompare(b))) {
|
|
416
415
|
if (value !== undefined && value !== null) {
|
|
417
416
|
params.set(key, String(value));
|
|
418
417
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/fetch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.49",
|
|
4
4
|
"description": "Type-safe HTTP client for Vertz",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"provenance": true
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "bunup",
|
|
29
|
+
"build": "vtzx bunup",
|
|
30
30
|
"test": "bun test",
|
|
31
|
-
"typecheck": "tsc --noEmit"
|
|
31
|
+
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@vertz/errors": "^0.2.
|
|
34
|
+
"@vertz/errors": "^0.2.48"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^25.3.1",
|