@ps-aux/api-client-axios 0.7.0-rc.4 → 0.7.0-rc.5
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/browser.cjs +15 -0
- package/dist/browser.d.cts +11 -2
- package/dist/browser.d.mts +11 -2
- package/dist/browser.d.ts +11 -2
- package/dist/browser.mjs +14 -1
- package/dist/node.cjs +15 -0
- package/dist/node.d.cts +11 -2
- package/dist/node.d.mts +11 -2
- package/dist/node.d.ts +11 -2
- package/dist/node.mjs +14 -1
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -160,6 +160,19 @@ class HttpClientHelper {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
const noOpInterceptor = () => (context, next) => next(context);
|
|
164
|
+
|
|
165
|
+
const HTTP_CLIENT_FIELD = "http";
|
|
166
|
+
const unwrap = (api) => {
|
|
167
|
+
const candidate = api[HTTP_CLIENT_FIELD];
|
|
168
|
+
if (!candidate || typeof candidate !== "object" || typeof candidate.request !== "function") {
|
|
169
|
+
throw new TypeError(
|
|
170
|
+
"Expected a generated API instance backed by a PromiseHttpClient"
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return candidate;
|
|
174
|
+
};
|
|
175
|
+
|
|
163
176
|
const createHttpClient$1 = (axios, opts) => {
|
|
164
177
|
const { querySerializer } = opts;
|
|
165
178
|
const helper = new HttpClientHelper();
|
|
@@ -237,3 +250,5 @@ const createHttpClient = (axios, opts) => {
|
|
|
237
250
|
};
|
|
238
251
|
|
|
239
252
|
exports.createHttpClient = createHttpClient;
|
|
253
|
+
exports.noOpInterceptor = noOpInterceptor;
|
|
254
|
+
exports.unwrap = unwrap;
|
package/dist/browser.d.cts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/browser.d.mts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/browser.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/browser.mjs
CHANGED
|
@@ -158,6 +158,19 @@ class HttpClientHelper {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
const noOpInterceptor = () => (context, next) => next(context);
|
|
162
|
+
|
|
163
|
+
const HTTP_CLIENT_FIELD = "http";
|
|
164
|
+
const unwrap = (api) => {
|
|
165
|
+
const candidate = api[HTTP_CLIENT_FIELD];
|
|
166
|
+
if (!candidate || typeof candidate !== "object" || typeof candidate.request !== "function") {
|
|
167
|
+
throw new TypeError(
|
|
168
|
+
"Expected a generated API instance backed by a PromiseHttpClient"
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return candidate;
|
|
172
|
+
};
|
|
173
|
+
|
|
161
174
|
const createHttpClient$1 = (axios, opts) => {
|
|
162
175
|
const { querySerializer } = opts;
|
|
163
176
|
const helper = new HttpClientHelper();
|
|
@@ -234,4 +247,4 @@ const createHttpClient = (axios, opts) => {
|
|
|
234
247
|
});
|
|
235
248
|
};
|
|
236
249
|
|
|
237
|
-
export { createHttpClient };
|
|
250
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
package/dist/node.cjs
CHANGED
|
@@ -160,6 +160,19 @@ class HttpClientHelper {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
const noOpInterceptor = () => (context, next) => next(context);
|
|
164
|
+
|
|
165
|
+
const HTTP_CLIENT_FIELD = "http";
|
|
166
|
+
const unwrap = (api) => {
|
|
167
|
+
const candidate = api[HTTP_CLIENT_FIELD];
|
|
168
|
+
if (!candidate || typeof candidate !== "object" || typeof candidate.request !== "function") {
|
|
169
|
+
throw new TypeError(
|
|
170
|
+
"Expected a generated API instance backed by a PromiseHttpClient"
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return candidate;
|
|
174
|
+
};
|
|
175
|
+
|
|
163
176
|
const createHttpClient$1 = (axios, opts) => {
|
|
164
177
|
const { querySerializer } = opts;
|
|
165
178
|
const helper = new HttpClientHelper();
|
|
@@ -237,3 +250,5 @@ const createHttpClient = (axios, opts) => {
|
|
|
237
250
|
};
|
|
238
251
|
|
|
239
252
|
exports.createHttpClient = createHttpClient;
|
|
253
|
+
exports.noOpInterceptor = noOpInterceptor;
|
|
254
|
+
exports.unwrap = unwrap;
|
package/dist/node.d.cts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/node.d.mts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/node.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ type HttpClient<RequestParams = never> = {
|
|
|
24
24
|
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
type HttpClientInterceptorContext<P = never> = {
|
|
28
|
+
request: HttpRequest;
|
|
29
|
+
params?: P;
|
|
30
|
+
};
|
|
31
|
+
type HttpClientInterceptor<P = never> = <D>(ctx: HttpClientInterceptorContext<P>, next: (ctx: HttpClientInterceptorContext<P>) => Promise<HttpResponse<D>>) => Promise<HttpResponse<D>>;
|
|
32
|
+
declare const noOpInterceptor: <P = never>() => HttpClientInterceptor<P>;
|
|
33
|
+
|
|
34
|
+
declare const unwrap: <RequestParams = never>(api: object) => HttpClient<RequestParams>;
|
|
35
|
+
|
|
27
36
|
/// <reference lib="esnext.asynciterable" />
|
|
28
37
|
|
|
29
38
|
/**
|
|
@@ -40,5 +49,5 @@ declare const createHttpClient: (axios: AxiosInstance, opts: {
|
|
|
40
49
|
querySerializer: QuerySerializer | null;
|
|
41
50
|
}) => HttpClient;
|
|
42
51
|
|
|
43
|
-
export { createHttpClient };
|
|
44
|
-
export type { HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
|
52
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|
|
53
|
+
export type { HttpClientInterceptor, HttpClientInterceptorContext, HttpRequest, HttpResponse, HttpClient as PromiseHttpClient, QuerySerializer };
|
package/dist/node.mjs
CHANGED
|
@@ -158,6 +158,19 @@ class HttpClientHelper {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
const noOpInterceptor = () => (context, next) => next(context);
|
|
162
|
+
|
|
163
|
+
const HTTP_CLIENT_FIELD = "http";
|
|
164
|
+
const unwrap = (api) => {
|
|
165
|
+
const candidate = api[HTTP_CLIENT_FIELD];
|
|
166
|
+
if (!candidate || typeof candidate !== "object" || typeof candidate.request !== "function") {
|
|
167
|
+
throw new TypeError(
|
|
168
|
+
"Expected a generated API instance backed by a PromiseHttpClient"
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return candidate;
|
|
172
|
+
};
|
|
173
|
+
|
|
161
174
|
const createHttpClient$1 = (axios, opts) => {
|
|
162
175
|
const { querySerializer } = opts;
|
|
163
176
|
const helper = new HttpClientHelper();
|
|
@@ -234,4 +247,4 @@ const createHttpClient = (axios, opts) => {
|
|
|
234
247
|
});
|
|
235
248
|
};
|
|
236
249
|
|
|
237
|
-
export { createHttpClient };
|
|
250
|
+
export { createHttpClient, noOpInterceptor, unwrap };
|