@hyper-fetch/core 9.3.0 → 9.4.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.
- package/__tests__/features/adapter/adapter.request-options.spec.ts +116 -0
- package/dist/adapter/adapter.d.ts +17 -12
- package/dist/adapter/adapter.d.ts.map +1 -1
- package/dist/adapter/adapter.types.d.ts +5 -3
- package/dist/adapter/adapter.types.d.ts.map +1 -1
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.d.ts.map +1 -1
- package/dist/http-adapter/http-adapter.fetch.d.ts +1 -1
- package/dist/http-adapter/http-adapter.fetch.d.ts.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/adapter.types.d.ts +13 -11
- package/dist/types/adapter.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapter/adapter.ts +33 -13
- package/src/adapter/adapter.types.ts +7 -3
- package/src/client/client.ts +2 -1
- package/src/types/adapter.types.ts +18 -11
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { AdapterInstance, DeclareAdapterType, DefaultMapperType, QueryParamsType } from "adapter";
|
|
2
|
+
import { Adapter } from "adapter";
|
|
3
|
+
import { Client } from "client";
|
|
4
|
+
import type { stringifyQueryParams } from "http-adapter";
|
|
5
|
+
import type { ExtractAdapterRequestOptionsType } from "types";
|
|
6
|
+
import { expectTypeOf } from "vitest";
|
|
7
|
+
|
|
8
|
+
import { HttpMethods } from "../../../src/constants/http.constants";
|
|
9
|
+
|
|
10
|
+
type CustomRequestOptions = { document?: string };
|
|
11
|
+
|
|
12
|
+
const createAdapter = () =>
|
|
13
|
+
new Adapter<
|
|
14
|
+
{ timeout?: number },
|
|
15
|
+
"GET",
|
|
16
|
+
number,
|
|
17
|
+
{ headers: Record<string, string> },
|
|
18
|
+
QueryParamsType | string,
|
|
19
|
+
undefined,
|
|
20
|
+
string,
|
|
21
|
+
(endpoint: string) => string,
|
|
22
|
+
typeof stringifyQueryParams,
|
|
23
|
+
DefaultMapperType,
|
|
24
|
+
DefaultMapperType,
|
|
25
|
+
CustomRequestOptions
|
|
26
|
+
>({
|
|
27
|
+
name: "test-adapter",
|
|
28
|
+
defaultMethod: HttpMethods.GET,
|
|
29
|
+
defaultExtra: { headers: {} },
|
|
30
|
+
systemErrorStatus: 0,
|
|
31
|
+
systemErrorExtra: { headers: {} },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe("Adapter [ Request options ]", () => {
|
|
35
|
+
describe("when creating requests", () => {
|
|
36
|
+
it("should keep the additional field in the request options", () => {
|
|
37
|
+
const client = new Client({ url: "http://localhost" }).setAdapter(createAdapter());
|
|
38
|
+
|
|
39
|
+
const request = client.createRequest()({ endpoint: "/test", document: "value" });
|
|
40
|
+
|
|
41
|
+
expect(request.requestOptions).toMatchObject({ endpoint: "/test", document: "value" });
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("should keep the additional field on clones and after serialization", () => {
|
|
45
|
+
const client = new Client({ url: "http://localhost" }).setAdapter(createAdapter());
|
|
46
|
+
|
|
47
|
+
const request = client.createRequest()({ endpoint: "/test", document: "value" });
|
|
48
|
+
const cloned = request.setRetry(1).clone();
|
|
49
|
+
const restored = client.fromJSON(JSON.parse(JSON.stringify(request.toJSON())));
|
|
50
|
+
|
|
51
|
+
expect(cloned.requestOptions).toMatchObject({ document: "value" });
|
|
52
|
+
expect(restored.requestOptions).toMatchObject({ document: "value" });
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("when using the devtools endpoint getter", () => {
|
|
57
|
+
it("should allow to read the request options", () => {
|
|
58
|
+
const adapter = createAdapter().setDevtoolsEndpointGetter(
|
|
59
|
+
(endpoint, requestOptions) => requestOptions?.document ?? endpoint,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
expect(adapter.unstable_devtoolsEndpointGetter("/test")).toBe("/test");
|
|
63
|
+
expect(adapter.unstable_devtoolsEndpointGetter("/test", { document: "value" })).toBe("value");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe("when checking types", () => {
|
|
68
|
+
it("should extract the declared request options", () => {
|
|
69
|
+
type TestAdapter = ReturnType<typeof createAdapter>;
|
|
70
|
+
|
|
71
|
+
expectTypeOf<ExtractAdapterRequestOptionsType<TestAdapter>>().toEqualTypeOf<CustomRequestOptions>();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("should support declaring the request options", () => {
|
|
75
|
+
type Declared = DeclareAdapterType<{
|
|
76
|
+
adapterOptions: Record<string, never>;
|
|
77
|
+
methodType: "GET";
|
|
78
|
+
statusType: number;
|
|
79
|
+
extra: Record<string, never>;
|
|
80
|
+
endpointType: string;
|
|
81
|
+
requestOptions: CustomRequestOptions;
|
|
82
|
+
}>;
|
|
83
|
+
|
|
84
|
+
expectTypeOf<ExtractAdapterRequestOptionsType<Declared>>().toEqualTypeOf<CustomRequestOptions>();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("should default to no additional fields", () => {
|
|
88
|
+
type Default = DeclareAdapterType<{
|
|
89
|
+
adapterOptions: Record<string, never>;
|
|
90
|
+
methodType: "GET";
|
|
91
|
+
statusType: number;
|
|
92
|
+
extra: Record<string, never>;
|
|
93
|
+
endpointType: string;
|
|
94
|
+
}>;
|
|
95
|
+
|
|
96
|
+
expectTypeOf<ExtractAdapterRequestOptionsType<Default>>().toEqualTypeOf<{}>();
|
|
97
|
+
expectTypeOf<ExtractAdapterRequestOptionsType<AdapterInstance>>().toEqualTypeOf<{}>();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("should reject not declared fields and validate the declared ones", () => {
|
|
101
|
+
const client = new Client({ url: "http://localhost" }).setAdapter(createAdapter());
|
|
102
|
+
const http = new Client({ url: "http://localhost" });
|
|
103
|
+
|
|
104
|
+
const create = () => {
|
|
105
|
+
// @ts-expect-error wrong type of the declared field
|
|
106
|
+
client.createRequest()({ endpoint: "/test", document: 1 });
|
|
107
|
+
// @ts-expect-error field not declared by the adapter
|
|
108
|
+
client.createRequest()({ endpoint: "/test", other: 1 });
|
|
109
|
+
// @ts-expect-error field not declared by the default adapter
|
|
110
|
+
http.createRequest()({ endpoint: "/test", document: "value" });
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
expect(create).toBeFunction();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -11,7 +11,7 @@ export declare const defaultMapper: DefaultMapperType;
|
|
|
11
11
|
* header/payload/query-params mapping, and the actual fetch call. Extend or configure this class
|
|
12
12
|
* to integrate custom transport layers (e.g., axios, graphql, firebase).
|
|
13
13
|
*/
|
|
14
|
-
export declare class Adapter<AdapterOptions, MethodType extends string, StatusType extends number | string, Extra extends Record<string, any>, QueryParams = QueryParamsType | string | EmptyTypes, DefaultQueryParams = undefined, EndpointType = string, EndpointMapperType extends EndpointMapper<EndpointType> | DefaultMapperType = DefaultMapperType, QueryParamsMapperType extends QueryParamsMapper<QueryParams> | DefaultMapperType = DefaultMapperType, HeaderMapperType extends HeaderMappingType | DefaultMapperType = DefaultMapperType, PayloadMapperType extends AdapterPayloadMappingType | DefaultMapperType = DefaultMapperType> {
|
|
14
|
+
export declare class Adapter<AdapterOptions, MethodType extends string, StatusType extends number | string, Extra extends Record<string, any>, QueryParams = QueryParamsType | string | EmptyTypes, DefaultQueryParams = undefined, EndpointType = string, EndpointMapperType extends EndpointMapper<EndpointType> | DefaultMapperType = DefaultMapperType, QueryParamsMapperType extends QueryParamsMapper<QueryParams> | DefaultMapperType = DefaultMapperType, HeaderMapperType extends HeaderMappingType | DefaultMapperType = DefaultMapperType, PayloadMapperType extends AdapterPayloadMappingType | DefaultMapperType = DefaultMapperType, RequestOptions extends Record<string, any> = {}> {
|
|
15
15
|
options: {
|
|
16
16
|
name: string;
|
|
17
17
|
defaultMethod: MethodType;
|
|
@@ -21,7 +21,7 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
21
21
|
defaultRequestOptions?: RequestOptionsType<EndpointType, AdapterOptions, MethodType>;
|
|
22
22
|
};
|
|
23
23
|
/** Fetching function */
|
|
24
|
-
unstable_fetcher: AdapterFetcherType<Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>>;
|
|
24
|
+
unstable_fetcher: AdapterFetcherType<Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>>;
|
|
25
25
|
/**
|
|
26
26
|
* ********************
|
|
27
27
|
* Defaults
|
|
@@ -43,6 +43,11 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
43
43
|
unstable_headerMapperConfig: Parameters<HeaderMapperType>[1];
|
|
44
44
|
unstable_payloadMapperConfig: Parameters<PayloadMapperType>[1];
|
|
45
45
|
unstable_endpointMapperConfig: Parameters<EndpointMapperType>[1];
|
|
46
|
+
/**
|
|
47
|
+
* Type-only carrier of the additional `createRequest` fields declared by this adapter.
|
|
48
|
+
* It has no runtime value - adapters read those fields from `request.requestOptions`.
|
|
49
|
+
*/
|
|
50
|
+
unstable_requestOptionsType?: RequestOptions;
|
|
46
51
|
constructor(options: {
|
|
47
52
|
name: string;
|
|
48
53
|
defaultMethod: MethodType;
|
|
@@ -73,7 +78,7 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
73
78
|
unstable_queryParamsMapper: QueryParamsMapperType;
|
|
74
79
|
/** Get default adapter options for the request. */
|
|
75
80
|
unstable_getAdapterDefaults?: (request: ExtendRequest<RequestInstance, {
|
|
76
|
-
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>>;
|
|
81
|
+
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>>;
|
|
77
82
|
}>) => AdapterOptions;
|
|
78
83
|
/** Get default request options for the request. */
|
|
79
84
|
unstable_getRequestDefaults?: (options: RequestOptionsType<EndpointType, AdapterOptions, MethodType>) => Partial<RequestOptionsType<EndpointType, AdapterOptions, MethodType>>;
|
|
@@ -81,7 +86,7 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
81
86
|
* Get formatted endpoint name of the request.
|
|
82
87
|
* Helpful in displaying long endpoints like in case of graphql schemas etc.
|
|
83
88
|
*/
|
|
84
|
-
unstable_devtoolsEndpointGetter: (endpoint: string) => string;
|
|
89
|
+
unstable_devtoolsEndpointGetter: (endpoint: string, requestOptions?: Record<string, any>) => string;
|
|
85
90
|
/**
|
|
86
91
|
* ********************
|
|
87
92
|
* Methods
|
|
@@ -92,7 +97,7 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
92
97
|
/** Set the default extra metadata attached to every request response (e.g., headers, status). */
|
|
93
98
|
setDefaultExtra: (extra: Extra) => this;
|
|
94
99
|
/** Set a function that formats the endpoint string for display in devtools. */
|
|
95
|
-
setDevtoolsEndpointGetter: (callback: (endpoint: string) => string) => this;
|
|
100
|
+
setDevtoolsEndpointGetter: (callback: (endpoint: string, requestOptions?: Record<string, any>) => string) => this;
|
|
96
101
|
/**
|
|
97
102
|
* This method allows to configure global defaults for the request configuration like method, auth, deduplication etc.
|
|
98
103
|
*/
|
|
@@ -101,26 +106,26 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
101
106
|
* Set the adapter default options added to every sent request
|
|
102
107
|
*/
|
|
103
108
|
setAdapterDefaults: (callback: (request: ExtendRequest<RequestInstance, {
|
|
104
|
-
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>>;
|
|
109
|
+
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>>;
|
|
105
110
|
}>) => AdapterOptions) => this;
|
|
106
111
|
/** Set a custom mapping for internal adapter errors before they are returned in the response. */
|
|
107
112
|
setInternalErrorMapping: (callback: (error: ReturnType<typeof getErrorMessage>) => any) => this;
|
|
108
113
|
/**
|
|
109
114
|
* Set the custom header mapping function
|
|
110
115
|
*/
|
|
111
|
-
setHeaderMapper: <NewMapper extends HeaderMappingType>(headerMapper: NewMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, NewMapper, PayloadMapperType>;
|
|
116
|
+
setHeaderMapper: <NewMapper extends HeaderMappingType>(headerMapper: NewMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, NewMapper, PayloadMapperType, RequestOptions>;
|
|
112
117
|
/**
|
|
113
118
|
* Set the request payload mapping function which gets triggered before request is send
|
|
114
119
|
*/
|
|
115
|
-
setPayloadMapper: <NewMapper extends AdapterPayloadMappingType>(payloadMapper: NewMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, NewMapper>;
|
|
120
|
+
setPayloadMapper: <NewMapper extends AdapterPayloadMappingType>(payloadMapper: NewMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, NewMapper, RequestOptions>;
|
|
116
121
|
/**
|
|
117
122
|
* Set the endpoint mapping function which transforms the endpoint string before the request is sent
|
|
118
123
|
*/
|
|
119
|
-
setEndpointMapper: <NewEndpointMapper extends EndpointMapper<EndpointType>>(endpointMapper: NewEndpointMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, NewEndpointMapper, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>;
|
|
124
|
+
setEndpointMapper: <NewEndpointMapper extends EndpointMapper<EndpointType>>(endpointMapper: NewEndpointMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, NewEndpointMapper, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>;
|
|
120
125
|
/**
|
|
121
126
|
* Set the query params mapping function which get triggered before request get sent
|
|
122
127
|
*/
|
|
123
|
-
setQueryParamsMapper: <NewQueryParamsMapper extends QueryParamsMapper<QueryParams>>(queryParamsMapper: NewQueryParamsMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, NewQueryParamsMapper, HeaderMapperType, PayloadMapperType>;
|
|
128
|
+
setQueryParamsMapper: <NewQueryParamsMapper extends QueryParamsMapper<QueryParams>>(queryParamsMapper: NewQueryParamsMapper) => Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, NewQueryParamsMapper, HeaderMapperType, PayloadMapperType, RequestOptions>;
|
|
124
129
|
/** Set the configuration object passed as the second argument to the query params mapper. */
|
|
125
130
|
setQueryParamsMapperConfig: <NewQueryParamsMapperConfig extends Parameters<QueryParamsMapperType>[1]>(config: NewQueryParamsMapperConfig) => this;
|
|
126
131
|
/** Set the configuration object passed as the second argument to the header mapper. */
|
|
@@ -135,10 +140,10 @@ export declare class Adapter<AdapterOptions, MethodType extends string, StatusTy
|
|
|
135
140
|
* ********************
|
|
136
141
|
*/
|
|
137
142
|
/** Set the fetcher function that performs the actual network request. Must be called before any request can be executed. */
|
|
138
|
-
setFetcher(fetcher: AdapterFetcherType<Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>>): this;
|
|
143
|
+
setFetcher(fetcher: AdapterFetcherType<Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>>): this;
|
|
139
144
|
/** Execute a request through the adapter pipeline: maps endpoint/headers/payload, runs plugins, then calls the fetcher. */
|
|
140
145
|
fetch(request: ExtendRequest<RequestInstance, {
|
|
141
|
-
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType>>;
|
|
146
|
+
client: Client<any, Adapter<AdapterOptions, MethodType, StatusType, Extra, QueryParams, DefaultQueryParams, EndpointType, EndpointMapperType, QueryParamsMapperType, HeaderMapperType, PayloadMapperType, RequestOptions>>;
|
|
142
147
|
}>, requestId: string): Promise<RequestResponseType<RequestInstance>>;
|
|
143
148
|
}
|
|
144
149
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AACzB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CACL,cAAc,EACd,UAAU,EACV,UAAU,EACV,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,CACf,CACF,CAAC;KACH,CACF,EACD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;CAuFjD"}
|
|
@@ -5,8 +5,8 @@ import { getAdapterBindings } from './adapter.bindings';
|
|
|
5
5
|
/**
|
|
6
6
|
* Base Adapter
|
|
7
7
|
*/
|
|
8
|
-
export type AdapterInstance = Adapter<any, any, any, any, any, any, any, any, any, any, any>;
|
|
9
|
-
export type AdapterGenericType<AdapterOptions, MethodType extends string, StatusType extends number | string, Extra extends Record<string, any>, QueryParams = QueryParamsType | string | EmptyTypes, DefaultQueryParams = undefined, EndpointType = string, EndpointMapperType extends EndpointMapper<EndpointType> | DefaultMapperType = DefaultMapperType, QueryParamsMapperType extends QueryParamsMapper<QueryParams> | DefaultMapperType = DefaultMapperType, HeaderMapperType extends HeaderMappingType | DefaultMapperType = DefaultMapperType, PayloadMapperType extends AdapterPayloadMappingType | DefaultMapperType = DefaultMapperType> = {
|
|
8
|
+
export type AdapterInstance = Adapter<any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
9
|
+
export type AdapterGenericType<AdapterOptions, MethodType extends string, StatusType extends number | string, Extra extends Record<string, any>, QueryParams = QueryParamsType | string | EmptyTypes, DefaultQueryParams = undefined, EndpointType = string, EndpointMapperType extends EndpointMapper<EndpointType> | DefaultMapperType = DefaultMapperType, QueryParamsMapperType extends QueryParamsMapper<QueryParams> | DefaultMapperType = DefaultMapperType, HeaderMapperType extends HeaderMappingType | DefaultMapperType = DefaultMapperType, PayloadMapperType extends AdapterPayloadMappingType | DefaultMapperType = DefaultMapperType, RequestOptions extends Record<string, any> = {}> = {
|
|
10
10
|
adapterOptions: AdapterOptions;
|
|
11
11
|
methodType: MethodType;
|
|
12
12
|
statusType: StatusType;
|
|
@@ -18,8 +18,10 @@ export type AdapterGenericType<AdapterOptions, MethodType extends string, Status
|
|
|
18
18
|
queryParamsMapperType?: QueryParamsMapperType;
|
|
19
19
|
headerMapperType?: HeaderMapperType;
|
|
20
20
|
payloadMapperType?: PayloadMapperType;
|
|
21
|
+
/** Additional fields accepted by `createRequest` on clients using this adapter */
|
|
22
|
+
requestOptions?: RequestOptions;
|
|
21
23
|
};
|
|
22
|
-
export type DeclareAdapterType<Properties extends AdapterGenericType<any, any, any, any, any, any, any, any, any, any>> = Adapter<TypeWithDefaults<Properties, "adapterOptions", any>, TypeWithDefaults<Properties, "methodType", any>, TypeWithDefaults<Properties, "statusType", any>, TypeWithDefaults<Properties, "extra", any>, TypeWithDefaults<Properties, "queryParams", QueryParamsType | string | EmptyTypes>, TypeWithDefaults<Properties, "defaultQueryParams", undefined>, TypeWithDefaults<Properties, "endpointType", string>, TypeWithDefaults<Properties, "endpointMapperType", DefaultMapperType>, TypeWithDefaults<Properties, "queryParamsMapperType", DefaultMapperType>, TypeWithDefaults<Properties, "headerMapperType", DefaultMapperType>, NonNullable<TypeWithDefaults<Properties, "payloadMapperType", DefaultMapperType
|
|
24
|
+
export type DeclareAdapterType<Properties extends AdapterGenericType<any, any, any, any, any, any, any, any, any, any, any, any>> = Adapter<TypeWithDefaults<Properties, "adapterOptions", any>, TypeWithDefaults<Properties, "methodType", any>, TypeWithDefaults<Properties, "statusType", any>, TypeWithDefaults<Properties, "extra", any>, TypeWithDefaults<Properties, "queryParams", QueryParamsType | string | EmptyTypes>, TypeWithDefaults<Properties, "defaultQueryParams", undefined>, TypeWithDefaults<Properties, "endpointType", string>, TypeWithDefaults<Properties, "endpointMapperType", DefaultMapperType>, TypeWithDefaults<Properties, "queryParamsMapperType", DefaultMapperType>, TypeWithDefaults<Properties, "headerMapperType", DefaultMapperType>, NonNullable<TypeWithDefaults<Properties, "payloadMapperType", DefaultMapperType>>, TypeWithDefaults<Properties, "requestOptions", {}>>;
|
|
23
25
|
export type AdapterFetcherType<Adapter extends AdapterInstance> = (options: Omit<Awaited<ReturnType<typeof getAdapterBindings<Adapter>>>, "payload"> & {
|
|
24
26
|
url: string;
|
|
25
27
|
endpoint: ReturnType<ExtractAdapterEndpointMapperType<Adapter>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.types.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EACV,UAAU,EACV,gCAAgC,EAChC,uBAAuB,EACvB,+BAA+B,EAC/B,8BAA8B,EAC9B,mCAAmC,EACnC,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.types.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EACV,UAAU,EACV,gCAAgC,EAChC,uBAAuB,EACvB,+BAA+B,EAC/B,8BAA8B,EAC9B,mCAAmC,EACnC,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE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C;AAIF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { HttpAdapterType } from '../http-adapter';
|
|
|
6
6
|
import { LogLevel, AppManager, LoggerManager, RequestManager } from '../managers';
|
|
7
7
|
import { PluginInstance, PluginMethodParameters, PluginMethods } from '../plugin';
|
|
8
8
|
import { RequestInstance, RequestJSON, RequestOptionsType, Request } from '../request';
|
|
9
|
-
import { EmptyTypes, TypeWithDefaults, ExtractAdapterMethodType, ExtractAdapterOptionsType, ExtractAdapterQueryParamsType, ExtractAdapterEndpointType, ExtractUnionAdapter, HydrateDataType, HydrationOptions, ExtractAdapterDefaultQueryParamsType } from '../types';
|
|
9
|
+
import { EmptyTypes, TypeWithDefaults, ExtractAdapterMethodType, ExtractAdapterOptionsType, ExtractAdapterQueryParamsType, ExtractAdapterEndpointType, ExtractUnionAdapter, HydrateDataType, HydrationOptions, ExtractAdapterDefaultQueryParamsType, ExtractAdapterRequestOptionsType } from '../types';
|
|
10
10
|
/**
|
|
11
11
|
* **Client** is a class that allows you to configure the connection with the server and then use it to create
|
|
12
12
|
* requests. It allows you to set global defaults for the requests configuration, query params configuration.
|
|
@@ -198,7 +198,7 @@ export declare class Client<GlobalErrorType extends ClientErrorType = Error, Ada
|
|
|
198
198
|
*
|
|
199
199
|
* This solution will be removed once https://github.com/microsoft/TypeScript/issues/10571 get resolved.
|
|
200
200
|
*/
|
|
201
|
-
_USE_DOUBLE_INITIALIZATION?: never) => <EndpointType extends ExtractAdapterEndpointType<Adapter>, AdapterOptions extends ExtractAdapterOptionsType<Adapter>, MethodType extends ExtractAdapterMethodType<Adapter>>(params: RequestOptionsType<EndpointType, AdapterOptions, MethodType>) => Request<TypeWithDefaults<RequestProperties, "response", undefined>, TypeWithDefaults<RequestProperties, "payload", undefined>, TypeWithDefaults<RequestProperties, "queryParams", ExtractAdapterDefaultQueryParamsType<Adapter>, never>, TypeWithDefaults<RequestProperties, "error", GlobalErrorType>, TypeWithDefaults<RequestProperties, "endpoint", EndpointType> extends string ? TypeWithDefaults<RequestProperties, "endpoint", EndpointType> : any, Client<GlobalErrorType, ExtractUnionAdapter<Adapter, {
|
|
201
|
+
_USE_DOUBLE_INITIALIZATION?: never) => <EndpointType extends ExtractAdapterEndpointType<Adapter>, AdapterOptions extends ExtractAdapterOptionsType<Adapter>, MethodType extends ExtractAdapterMethodType<Adapter>>(params: RequestOptionsType<EndpointType, AdapterOptions, MethodType> & ExtractAdapterRequestOptionsType<Adapter>) => Request<TypeWithDefaults<RequestProperties, "response", undefined>, TypeWithDefaults<RequestProperties, "payload", undefined>, TypeWithDefaults<RequestProperties, "queryParams", ExtractAdapterDefaultQueryParamsType<Adapter>, never>, TypeWithDefaults<RequestProperties, "error", GlobalErrorType>, TypeWithDefaults<RequestProperties, "endpoint", EndpointType> extends string ? TypeWithDefaults<RequestProperties, "endpoint", EndpointType> : any, Client<GlobalErrorType, ExtractUnionAdapter<Adapter, {
|
|
202
202
|
method: MethodType;
|
|
203
203
|
options: AdapterOptions;
|
|
204
204
|
queryParams: TypeWithDefaults<RequestProperties, "queryParams", ExtractAdapterDefaultQueryParamsType<Adapter>, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAA+B,OAAO,EAAY,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,oCAAoC,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE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,UAAU,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,SAAS,eAAe,kEACL;IAE3G;;;;OAIG;IACH,QAAQ,GAAI,iBAAiB,SAAS,kBAAkB,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EACnG,MAAM,WAAW,CAAC,eAAe,CAAC,KAU6C,OAAO,iSAKpF,gEAAiB,MAAM,6DAAc,MAAM,EAC3C,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CACjC,CACD;IAEF;;OAEG;IACH,KAAK,aAuBH;IAEF;;;;OAIG;IACH,OAAO,GACL,eAAe,CAAC,eAAe,GAAG,UAAU,CAAC,EAAE,EAC/C,UAAU,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC,UA2B5F;IAEF;;;;OAIG;IACH,aAAa,GAAI,iBAAiB,SAAS,kBAAkB,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE;IACxG;;;;;;;;;;;;;;;OAeG;IAEH,6BAA6B,KAAK,MAWhC,YAAY,SAAS,0BAA0B,CAAC,OAAO,CAAC,EACxD,cAAc,SAAS,yBAAyB,CAAC,OAAO,CAAC,EACzD,UAAU,SAAS,wBAAwB,CAAC,OAAO,CAAC,EAEpD,QAAQ,kBAAkB,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,CAAC,GAAG,gCAAgC,CAAC,OAAO,CAAC;gBAUpG,UAAU;iBACT,cAAc;;;gBADf,UAAU;iBACT,cAAc;;yCA4B7B;CACH"}
|
|
@@ -2,5 +2,5 @@ import { QueryParamsType } from '../adapter';
|
|
|
2
2
|
import { HttpMethodsType } from '../types';
|
|
3
3
|
import { Adapter } from '../adapter/adapter';
|
|
4
4
|
import { HttpAdapterExtraType, FetchAdapterOptionsType } from './http-adapter.types';
|
|
5
|
-
export declare const getAdapter: () => Adapter<FetchAdapterOptionsType, HttpMethodsType, number, HttpAdapterExtraType, string | QueryParamsType | null, undefined, string, import('../adapter').DefaultMapperType, (queryParams: QueryParamsType | string | import('../types').EmptyTypes, options?: import('./http-adapter.types').QueryStringifyOptionsType) => string, import('../adapter').DefaultMapperType, import('../adapter').DefaultMapperType>;
|
|
5
|
+
export declare const getAdapter: () => Adapter<FetchAdapterOptionsType, HttpMethodsType, number, HttpAdapterExtraType, string | QueryParamsType | null, undefined, string, import('../adapter').DefaultMapperType, (queryParams: QueryParamsType | string | import('../types').EmptyTypes, options?: import('./http-adapter.types').QueryStringifyOptionsType) => string, import('../adapter').DefaultMapperType, import('../adapter').DefaultMapperType, {}>;
|
|
6
6
|
//# sourceMappingURL=http-adapter.fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-adapter.fetch.d.ts","sourceRoot":"","sources":["../../src/http-adapter/http-adapter.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAK1F,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"http-adapter.fetch.d.ts","sourceRoot":"","sources":["../../src/http-adapter/http-adapter.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAK1F,eAAO,MAAM,UAAU,kZA4KlB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1550,6 +1550,11 @@ var Adapter = class {
|
|
|
1550
1550
|
unstable_headerMapperConfig;
|
|
1551
1551
|
unstable_payloadMapperConfig;
|
|
1552
1552
|
unstable_endpointMapperConfig;
|
|
1553
|
+
/**
|
|
1554
|
+
* Type-only carrier of the additional `createRequest` fields declared by this adapter.
|
|
1555
|
+
* It has no runtime value - adapters read those fields from `request.requestOptions`.
|
|
1556
|
+
*/
|
|
1557
|
+
unstable_requestOptionsType = void 0;
|
|
1553
1558
|
constructor(options) {
|
|
1554
1559
|
this.options = options;
|
|
1555
1560
|
this.name = options.name;
|