@adatechnology/http-client 0.0.1 → 0.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @adatechnology/http-client
2
2
 
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Ajusta `peerDependencies` do Nest para garantir versões mínimas com correções de segurança (ex.: `@nestjs/common >= 11.0.16`).
8
+
3
9
  ## 0.0.1
4
10
 
5
11
  ### Patch Changes
@@ -1,8 +1,27 @@
1
- import { Observable } from "rxjs";
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { AxiosRequestConfig, AxiosInstance } from 'axios';
3
+ import { Observable } from 'rxjs';
4
+
5
+ declare class HttpModule {
6
+ /**
7
+ * Configure HttpModule with an Axios instance or AxiosRequestConfig.
8
+ * This will import the implementation-specific module (currently Axios).
9
+ */
10
+ static forRoot(config?: AxiosRequestConfig | AxiosInstance): DynamicModule;
11
+ }
12
+
13
+ declare class HttpImplementationAxiosModule {
14
+ static forRoot(config?: AxiosRequestConfig | AxiosInstance): DynamicModule;
15
+ }
16
+
17
+ declare const HTTP_AXIOS_CONNECTION = "HTTP_AXIOS_CONNECTION";
18
+ declare const HTTP_AXIOS_PROVIDER = "HTTP_AXIOS_PROVIDER";
19
+ declare const HTTP_PROVIDER = "HTTP_PROVIDER";
20
+
2
21
  /**
3
22
  * HTTP methods supported
4
23
  */
5
- export declare enum HttpMethod {
24
+ declare enum HttpMethod {
6
25
  GET = "GET",
7
26
  POST = "POST",
8
27
  PUT = "PUT",
@@ -14,7 +33,7 @@ export declare enum HttpMethod {
14
33
  /**
15
34
  * Content types for HTTP requests
16
35
  */
17
- export declare enum ContentType {
36
+ declare enum ContentType {
18
37
  JSON = "application/json",
19
38
  FORM_URLENCODED = "application/x-www-form-urlencoded",
20
39
  FORM_DATA = "multipart/form-data",
@@ -24,7 +43,7 @@ export declare enum ContentType {
24
43
  /**
25
44
  * HTTP request configuration
26
45
  */
27
- export interface HttpRequestConfig {
46
+ interface HttpRequestConfig {
28
47
  url: string;
29
48
  method?: HttpMethod;
30
49
  headers?: Record<string, string>;
@@ -42,7 +61,7 @@ export interface HttpRequestConfig {
42
61
  /**
43
62
  * HTTP response structure
44
63
  */
45
- export interface HttpResponse<T = any> {
64
+ interface HttpResponse<T = any> {
46
65
  data: T;
47
66
  status: number;
48
67
  statusText: string;
@@ -50,25 +69,14 @@ export interface HttpResponse<T = any> {
50
69
  config: HttpRequestConfig;
51
70
  request?: any;
52
71
  }
53
- /**
54
- * HTTP error structure
55
- */
56
- export interface HttpError extends Error {
57
- config: HttpRequestConfig;
58
- response?: HttpResponse;
59
- status?: number;
60
- statusText?: string;
61
- isNetworkError?: boolean;
62
- isTimeout?: boolean;
63
- }
64
72
  /**
65
73
  * Error interceptor function
66
74
  */
67
- export type ErrorInterceptor = (error: any) => any;
75
+ type ErrorInterceptor = (error: any) => any;
68
76
  /**
69
77
  * HTTP provider interface
70
78
  */
71
- export interface HttpProviderInterface {
79
+ interface HttpProviderInterface {
72
80
  /**
73
81
  * Make a GET request
74
82
  */
@@ -173,3 +181,5 @@ export interface HttpProviderInterface {
173
181
  options$<T = any>(url: string, config?: Omit<HttpRequestConfig, "url" | "method">): Observable<HttpResponse<T>>;
174
182
  request$<T = any>(config: HttpRequestConfig): Observable<HttpResponse<T>>;
175
183
  }
184
+
185
+ export { HTTP_AXIOS_CONNECTION, HTTP_AXIOS_PROVIDER, HTTP_PROVIDER, HttpImplementationAxiosModule, HttpModule, type HttpProviderInterface };