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/README.md +533 -1099
- package/dist/client.d.ts +11 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +327 -98
- package/dist/index.js.map +1 -1
- package/dist/modules/admin.d.ts +12 -3
- package/dist/modules/chat.d.ts +38 -17
- package/dist/modules/group.d.ts +35 -10
- package/dist/modules/newsletter.d.ts +9 -0
- package/dist/modules/session.d.ts +23 -11
- package/dist/modules/user.d.ts +10 -5
- package/dist/modules/webhook.d.ts +12 -3
- package/dist/types/chat.d.ts +55 -0
- package/dist/types/common.d.ts +4 -1
- package/dist/types/group.d.ts +52 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/newsletter.d.ts +17 -0
- package/dist/types/session.d.ts +16 -0
- package/dist/types/user.d.ts +5 -0
- package/dist/types/webhook.d.ts +9 -0
- package/dist/wuzapi-client.d.ts +4 -2
- package/package.json +1 -1
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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';
|