@navservice/core 1.53.0 → 1.55.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.
@@ -8,9 +8,20 @@ export default class api {
8
8
  private withAuth;
9
9
  constructor({ baseURL, withAuth }: ApiClientOptions);
10
10
  private set_bearer_token;
11
- get<T = any>(url: string, params?: Record<string, any>): Promise<AxiosResponse<T>>;
12
- post<T = any>(url: string, data?: any): Promise<AxiosResponse<T>>;
13
- patch<T = any>(url: string, data?: any): Promise<AxiosResponse<T>>;
14
- delete<T = any>(url: string): Promise<AxiosResponse<T>>;
11
+ get<T = any>({ url, params }: {
12
+ url: string;
13
+ params?: Record<string, any>;
14
+ }): Promise<AxiosResponse<T>>;
15
+ post<T = any>({ url, data }: {
16
+ url: string;
17
+ data?: any;
18
+ }): Promise<AxiosResponse<T>>;
19
+ patch<T = any>({ url, data }: {
20
+ url: string;
21
+ data?: any;
22
+ }): Promise<AxiosResponse<T>>;
23
+ delete<T = any>({ url }: {
24
+ url: string;
25
+ }): Promise<AxiosResponse<T>>;
15
26
  }
16
27
  export {};
package/build/es/utils.js CHANGED
@@ -73,18 +73,18 @@ class api {
73
73
  return config;
74
74
  });
75
75
  }
76
- get(url, params) {
76
+ async get({ url, params }) {
77
77
  return this.axios.get(url, {
78
78
  params
79
79
  });
80
80
  }
81
- post(url, data) {
81
+ async post({ url, data }) {
82
82
  return this.axios.post(url, data);
83
83
  }
84
- patch(url, data) {
84
+ async patch({ url, data }) {
85
85
  return this.axios.patch(url, data);
86
86
  }
87
- delete(url) {
87
+ async delete({ url }) {
88
88
  return this.axios.delete(url);
89
89
  }
90
90
  }
@@ -8,9 +8,20 @@ export default class api {
8
8
  private withAuth;
9
9
  constructor({ baseURL, withAuth }: ApiClientOptions);
10
10
  private set_bearer_token;
11
- get<T = any>(url: string, params?: Record<string, any>): Promise<AxiosResponse<T>>;
12
- post<T = any>(url: string, data?: any): Promise<AxiosResponse<T>>;
13
- patch<T = any>(url: string, data?: any): Promise<AxiosResponse<T>>;
14
- delete<T = any>(url: string): Promise<AxiosResponse<T>>;
11
+ get<T = any>({ url, params }: {
12
+ url: string;
13
+ params?: Record<string, any>;
14
+ }): Promise<AxiosResponse<T>>;
15
+ post<T = any>({ url, data }: {
16
+ url: string;
17
+ data?: any;
18
+ }): Promise<AxiosResponse<T>>;
19
+ patch<T = any>({ url, data }: {
20
+ url: string;
21
+ data?: any;
22
+ }): Promise<AxiosResponse<T>>;
23
+ delete<T = any>({ url }: {
24
+ url: string;
25
+ }): Promise<AxiosResponse<T>>;
15
26
  }
16
27
  export {};
@@ -140,18 +140,18 @@ class api {
140
140
  return config;
141
141
  });
142
142
  }
143
- get(url, params) {
143
+ async get({ url, params }) {
144
144
  return this.axios.get(url, {
145
145
  params
146
146
  });
147
147
  }
148
- post(url, data) {
148
+ async post({ url, data }) {
149
149
  return this.axios.post(url, data);
150
150
  }
151
- patch(url, data) {
151
+ async patch({ url, data }) {
152
152
  return this.axios.patch(url, data);
153
153
  }
154
- delete(url) {
154
+ async delete({ url }) {
155
155
  return this.axios.delete(url);
156
156
  }
157
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navservice/core",
3
- "version": "1.53.0",
3
+ "version": "1.55.0",
4
4
  "description": "Service core de todos os micro serviços",
5
5
  "type": "module",
6
6
  "exports": {