@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 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, requestContentType, body, headers: reqHeaders } = req;
169
+ const { query, contentType, body, headers: reqHeaders } = req;
170
170
  const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
171
- const isBlobResponse = req.format === "document";
171
+ const isBlobResponse = req.responseFormat === "document";
172
172
  const headers = { ...reqHeaders || {} };
173
173
  let data = body;
174
- if (requestContentType === "multipart/form-data") {
174
+ if (contentType === "multipart/form-data") {
175
175
  data = helper.convertToFormData(body);
176
- } else if (requestContentType) {
177
- headers["Content-Type"] = requestContentType;
176
+ } else if (contentType) {
177
+ headers["Content-Type"] = contentType;
178
178
  }
179
179
  return axios.request({
180
180
  method: req.method,
@@ -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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
24
+ request: <Data>(req: HttpRequest, params?: RequestParams) => Promise<HttpResponse<Data>>;
25
25
  };
26
26
 
27
27
  /// <reference lib="esnext.asynciterable" />
@@ -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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
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, requestContentType, body, headers: reqHeaders } = req;
167
+ const { query, contentType, body, headers: reqHeaders } = req;
168
168
  const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
169
- const isBlobResponse = req.format === "document";
169
+ const isBlobResponse = req.responseFormat === "document";
170
170
  const headers = { ...reqHeaders || {} };
171
171
  let data = body;
172
- if (requestContentType === "multipart/form-data") {
172
+ if (contentType === "multipart/form-data") {
173
173
  data = helper.convertToFormData(body);
174
- } else if (requestContentType) {
175
- headers["Content-Type"] = requestContentType;
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, requestContentType, body, headers: reqHeaders } = req;
169
+ const { query, contentType, body, headers: reqHeaders } = req;
170
170
  const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
171
- const isBlobResponse = req.format === "document";
171
+ const isBlobResponse = req.responseFormat === "document";
172
172
  const headers = { ...reqHeaders || {} };
173
173
  let data = body;
174
- if (requestContentType === "multipart/form-data") {
174
+ if (contentType === "multipart/form-data") {
175
175
  data = helper.convertToFormData(body);
176
- } else if (requestContentType) {
177
- headers["Content-Type"] = requestContentType;
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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
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 Request = {
7
+ type HttpRequest = {
8
8
  path: string;
9
9
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
10
- format?: 'json' | 'document';
10
+ responseFormat?: 'json' | 'document';
11
11
  headers?: Record<string, string>;
12
12
  query?: QueryParams;
13
13
  body?: any;
14
- requestContentType?: RequestContentType;
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: Request, params?: RequestParams) => Promise<HttpResponse<Data>>;
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, requestContentType, body, headers: reqHeaders } = req;
167
+ const { query, contentType, body, headers: reqHeaders } = req;
168
168
  const paramsSerializer = querySerializer ? (r) => helper.serializeQuery(r, querySerializer) : void 0;
169
- const isBlobResponse = req.format === "document";
169
+ const isBlobResponse = req.responseFormat === "document";
170
170
  const headers = { ...reqHeaders || {} };
171
171
  let data = body;
172
- if (requestContentType === "multipart/form-data") {
172
+ if (contentType === "multipart/form-data") {
173
173
  data = helper.convertToFormData(body);
174
- } else if (requestContentType) {
175
- headers["Content-Type"] = requestContentType;
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",
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.13.5"
18
+ "axios": "^1.16.0"
19
19
  },
20
20
  "devDependencies": {
21
- "axios": "^1.5.0"
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": [