wuzapi 1.1.0 → 1.3.1
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 +920 -1
- package/dist/index.js +394 -1
- package/dist/index.js.map +1 -1
- package/dist/types/chat.d.ts +10 -10
- package/dist/types/common.d.ts +1 -1
- package/dist/types/events.d.ts +629 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/message.d.ts +799 -0
- package/dist/types/webhook.d.ts +36 -0
- package/package.json +1 -1
package/dist/types/webhook.d.ts
CHANGED
|
@@ -8,3 +8,39 @@ export interface GetWebhookResponse {
|
|
|
8
8
|
subscribe: string[];
|
|
9
9
|
webhook: string;
|
|
10
10
|
}
|
|
11
|
+
export interface S3MediaInfo {
|
|
12
|
+
url: string;
|
|
13
|
+
key: string;
|
|
14
|
+
bucket: string;
|
|
15
|
+
size: number;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
fileName: string;
|
|
18
|
+
}
|
|
19
|
+
export interface WebhookPayload<T = unknown> {
|
|
20
|
+
event: T;
|
|
21
|
+
s3?: S3MediaInfo;
|
|
22
|
+
base64?: string;
|
|
23
|
+
mimeType?: string;
|
|
24
|
+
fileName?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface S3OnlyWebhookPayload<T = unknown> {
|
|
27
|
+
event: T;
|
|
28
|
+
s3: S3MediaInfo;
|
|
29
|
+
}
|
|
30
|
+
export interface Base64OnlyWebhookPayload<T = unknown> {
|
|
31
|
+
event: T;
|
|
32
|
+
base64: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
fileName: string;
|
|
35
|
+
}
|
|
36
|
+
export interface BothMediaWebhookPayload<T = unknown> {
|
|
37
|
+
event: T;
|
|
38
|
+
s3: S3MediaInfo;
|
|
39
|
+
base64: string;
|
|
40
|
+
mimeType: string;
|
|
41
|
+
fileName: string;
|
|
42
|
+
}
|
|
43
|
+
export type AnyWebhookPayload<T = unknown> = WebhookPayload<T> | S3OnlyWebhookPayload<T> | Base64OnlyWebhookPayload<T> | BothMediaWebhookPayload<T>;
|
|
44
|
+
export declare function hasS3Media(payload: WebhookPayload): payload is S3OnlyWebhookPayload | BothMediaWebhookPayload;
|
|
45
|
+
export declare function hasBase64Media(payload: WebhookPayload): payload is Base64OnlyWebhookPayload | BothMediaWebhookPayload;
|
|
46
|
+
export declare function hasBothMedia(payload: WebhookPayload): payload is BothMediaWebhookPayload;
|