wuzapi 1.3.1 → 1.4.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.
@@ -1,20 +1,21 @@
1
1
  import { BaseClient } from '../client.js';
2
+ import { RequestOptions } from '../types/common.js';
2
3
  import { UserInfoResponse, UserCheckResponse, UserAvatarResponse, ContactsResponse } from '../types/user.js';
3
4
  export declare class UserModule extends BaseClient {
4
5
  /**
5
6
  * Get user details for specified phone numbers
6
7
  */
7
- getInfo(phones: string[]): Promise<UserInfoResponse>;
8
+ getInfo(phones: string[], options?: RequestOptions): Promise<UserInfoResponse>;
8
9
  /**
9
10
  * Check if phone numbers are registered WhatsApp users
10
11
  */
11
- check(phones: string[]): Promise<UserCheckResponse>;
12
+ check(phones: string[], options?: RequestOptions): Promise<UserCheckResponse>;
12
13
  /**
13
14
  * Get user avatar/profile picture
14
15
  */
15
- getAvatar(phone: string, preview?: boolean): Promise<UserAvatarResponse>;
16
+ getAvatar(phone: string, preview?: boolean, options?: RequestOptions): Promise<UserAvatarResponse>;
16
17
  /**
17
18
  * Get all contacts
18
19
  */
19
- getContacts(): Promise<ContactsResponse>;
20
+ getContacts(options?: RequestOptions): Promise<ContactsResponse>;
20
21
  }
@@ -1,12 +1,13 @@
1
1
  import { BaseClient } from '../client.js';
2
+ import { RequestOptions } from '../types/common.js';
2
3
  import { SetWebhookResponse, GetWebhookResponse } from '../types/webhook.js';
3
4
  export declare class WebhookModule extends BaseClient {
4
5
  /**
5
6
  * Set webhook URL and events to subscribe to
6
7
  */
7
- setWebhook(webhookURL: string): Promise<SetWebhookResponse>;
8
+ setWebhook(webhookURL: string, options?: RequestOptions): Promise<SetWebhookResponse>;
8
9
  /**
9
10
  * Get current webhook configuration
10
11
  */
11
- getWebhook(): Promise<GetWebhookResponse>;
12
+ getWebhook(options?: RequestOptions): Promise<GetWebhookResponse>;
12
13
  }
@@ -1,6 +1,9 @@
1
1
  export interface WuzapiConfig {
2
2
  apiUrl: string;
3
- token: string;
3
+ token?: string;
4
+ }
5
+ export interface RequestOptions {
6
+ token?: string;
4
7
  }
5
8
  export interface WuzapiResponse<T = unknown> {
6
9
  code: number;
@@ -1,4 +1,4 @@
1
- import { WuzapiConfig } from './types/common.js';
1
+ import { WuzapiConfig, RequestOptions } from './types/common.js';
2
2
  import { AdminModule } from './modules/admin.js';
3
3
  import { SessionModule } from './modules/session.js';
4
4
  import { UserModule } from './modules/user.js';
@@ -18,5 +18,5 @@ export declare class WuzapiClient {
18
18
  /**
19
19
  * Test connection to the API
20
20
  */
21
- ping(): Promise<boolean>;
21
+ ping(options?: RequestOptions): Promise<boolean>;
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wuzapi",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "TypeScript client library for WuzAPI WhatsApp API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",