@ps-aux/api-client-axios 0.7.0-rc.3 → 0.7.0-rc.4
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 +5 -5
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.mts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.mjs +5 -5
- package/dist/node.cjs +5 -5
- package/dist/node.d.cts +4 -4
- package/dist/node.d.mts +4 -4
- package/dist/node.d.ts +4 -4
- package/dist/node.mjs +5 -5
- package/package.json +3 -3
package/dist/browser.cjs
CHANGED
|
@@ -166,15 +166,15 @@ const createHttpClient$1 = (axios, opts) => {
|
|
|
166
166
|
return {
|
|
167
167
|
request: (req) => {
|
|
168
168
|
helper.validateRequest(req);
|
|
169
|
-
const { query,
|
|
169
|
+
const { query, contentType, body, headers: reqHeaders } = req;
|
|
170
170
|
const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
|
|
171
|
-
const isBlobResponse = req.
|
|
171
|
+
const isBlobResponse = req.responseFormat === "document";
|
|
172
172
|
const headers = { ...reqHeaders || {} };
|
|
173
173
|
let data = body;
|
|
174
|
-
if (
|
|
174
|
+
if (contentType === "multipart/form-data") {
|
|
175
175
|
data = helper.convertToFormData(body);
|
|
176
|
-
} else if (
|
|
177
|
-
headers["Content-Type"] =
|
|
176
|
+
} else if (contentType) {
|
|
177
|
+
headers["Content-Type"] = contentType;
|
|
178
178
|
}
|
|
179
179
|
return axios.request({
|
|
180
180
|
method: req.method,
|
package/dist/browser.d.cts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/browser.d.mts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/browser.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/browser.mjs
CHANGED
|
@@ -164,15 +164,15 @@ const createHttpClient$1 = (axios, opts) => {
|
|
|
164
164
|
return {
|
|
165
165
|
request: (req) => {
|
|
166
166
|
helper.validateRequest(req);
|
|
167
|
-
const { query,
|
|
167
|
+
const { query, contentType, body, headers: reqHeaders } = req;
|
|
168
168
|
const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
|
|
169
|
-
const isBlobResponse = req.
|
|
169
|
+
const isBlobResponse = req.responseFormat === "document";
|
|
170
170
|
const headers = { ...reqHeaders || {} };
|
|
171
171
|
let data = body;
|
|
172
|
-
if (
|
|
172
|
+
if (contentType === "multipart/form-data") {
|
|
173
173
|
data = helper.convertToFormData(body);
|
|
174
|
-
} else if (
|
|
175
|
-
headers["Content-Type"] =
|
|
174
|
+
} else if (contentType) {
|
|
175
|
+
headers["Content-Type"] = contentType;
|
|
176
176
|
}
|
|
177
177
|
return axios.request({
|
|
178
178
|
method: req.method,
|
package/dist/node.cjs
CHANGED
|
@@ -166,15 +166,15 @@ const createHttpClient$1 = (axios, opts) => {
|
|
|
166
166
|
return {
|
|
167
167
|
request: (req) => {
|
|
168
168
|
helper.validateRequest(req);
|
|
169
|
-
const { query,
|
|
169
|
+
const { query, contentType, body, headers: reqHeaders } = req;
|
|
170
170
|
const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
|
|
171
|
-
const isBlobResponse = req.
|
|
171
|
+
const isBlobResponse = req.responseFormat === "document";
|
|
172
172
|
const headers = { ...reqHeaders || {} };
|
|
173
173
|
let data = body;
|
|
174
|
-
if (
|
|
174
|
+
if (contentType === "multipart/form-data") {
|
|
175
175
|
data = helper.convertToFormData(body);
|
|
176
|
-
} else if (
|
|
177
|
-
headers["Content-Type"] =
|
|
176
|
+
} else if (contentType) {
|
|
177
|
+
headers["Content-Type"] = contentType;
|
|
178
178
|
}
|
|
179
179
|
return axios.request({
|
|
180
180
|
method: req.method,
|
package/dist/node.d.cts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/node.d.mts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/node.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ type KnownRequestContentType = 'application/json' | 'multipart/form-data' | 'app
|
|
|
4
4
|
type RequestContentType = KnownRequestContentType | string;
|
|
5
5
|
type QueryValue = string | number | boolean | null | undefined | QueryValue[] | Record<string, any> | unknown;
|
|
6
6
|
type QueryParams = Record<string, QueryValue>;
|
|
7
|
-
type
|
|
7
|
+
type HttpRequest = {
|
|
8
8
|
path: string;
|
|
9
9
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
|
-
|
|
10
|
+
responseFormat?: 'json' | 'document';
|
|
11
11
|
headers?: Record<string, string>;
|
|
12
12
|
query?: QueryParams;
|
|
13
13
|
body?: any;
|
|
14
|
-
|
|
14
|
+
contentType?: RequestContentType;
|
|
15
15
|
};
|
|
16
16
|
type HttpResponse<Data> = {
|
|
17
17
|
body: Data;
|
|
@@ -21,7 +21,7 @@ type HttpResponse<Data> = {
|
|
|
21
21
|
type QuerySerializer = (params: QueryParams) => string;
|
|
22
22
|
|
|
23
23
|
type HttpClient<RequestParams = never> = {
|
|
24
|
-
request: <Data>(req:
|
|
24
|
+
request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/// <reference lib="esnext.asynciterable" />
|
package/dist/node.mjs
CHANGED
|
@@ -164,15 +164,15 @@ const createHttpClient$1 = (axios, opts) => {
|
|
|
164
164
|
return {
|
|
165
165
|
request: (req) => {
|
|
166
166
|
helper.validateRequest(req);
|
|
167
|
-
const { query,
|
|
167
|
+
const { query, contentType, body, headers: reqHeaders } = req;
|
|
168
168
|
const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
|
|
169
|
-
const isBlobResponse = req.
|
|
169
|
+
const isBlobResponse = req.responseFormat === "document";
|
|
170
170
|
const headers = { ...reqHeaders || {} };
|
|
171
171
|
let data = body;
|
|
172
|
-
if (
|
|
172
|
+
if (contentType === "multipart/form-data") {
|
|
173
173
|
data = helper.convertToFormData(body);
|
|
174
|
-
} else if (
|
|
175
|
-
headers["Content-Type"] =
|
|
174
|
+
} else if (contentType) {
|
|
175
|
+
headers["Content-Type"] = contentType;
|
|
176
176
|
}
|
|
177
177
|
return axios.request({
|
|
178
178
|
method: req.method,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ps-aux/api-client-axios",
|
|
3
|
-
"version": "0.7.0-rc.
|
|
3
|
+
"version": "0.7.0-rc.4",
|
|
4
4
|
"main": "dist/node.cjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"author": "psaux",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"axios": "^1.
|
|
18
|
+
"axios": "^1.16.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"axios": "^1.
|
|
21
|
+
"axios": "^1.16.0"
|
|
22
22
|
},
|
|
23
23
|
"description": "Axios-based HTTP client for OpenAPI-generated APIs (Node and browser builds).",
|
|
24
24
|
"keywords": [
|