wuzapi 1.3.1 → 1.5.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.
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { WuzapiConfig } from './types/common.js';
2
+ import { WuzapiConfig, RequestOptions } from './types/common.js';
3
3
  export declare class WuzapiError extends Error {
4
4
  code: number;
5
5
  details?: unknown;
@@ -9,8 +9,14 @@ export declare class BaseClient {
9
9
  protected axios: AxiosInstance;
10
10
  protected config: WuzapiConfig;
11
11
  constructor(config: WuzapiConfig);
12
- protected request<T>(method: "GET" | "POST" | "DELETE", endpoint: string, data?: unknown): Promise<T>;
13
- protected get<T>(endpoint: string): Promise<T>;
14
- protected post<T>(endpoint: string, data?: unknown): Promise<T>;
15
- protected delete<T>(endpoint: string): Promise<T>;
12
+ /**
13
+ * Resolve the token from request options or instance config
14
+ * Throws an error if no token is available
15
+ */
16
+ private resolveToken;
17
+ protected request<T>(method: "GET" | "POST" | "DELETE" | "PUT", endpoint: string, data?: unknown, options?: RequestOptions): Promise<T>;
18
+ protected get<T>(endpoint: string, options?: RequestOptions): Promise<T>;
19
+ protected post<T>(endpoint: string, data?: unknown, options?: RequestOptions): Promise<T>;
20
+ protected put<T>(endpoint: string, data?: unknown, options?: RequestOptions): Promise<T>;
21
+ protected delete<T>(endpoint: string, options?: RequestOptions): Promise<T>;
16
22
  }
package/dist/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export { UserModule } from './modules/user.js';
7
7
  export { ChatModule } from './modules/chat.js';
8
8
  export { GroupModule } from './modules/group.js';
9
9
  export { WebhookModule } from './modules/webhook.js';
10
+ export { NewsletterModule } from './modules/newsletter.js';
10
11
  export { WuzapiClient as default } from './wuzapi-client.js';