zaileys 0.27.1-dev → 0.28.2-dev

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.
Files changed (48) hide show
  1. package/README.md +24 -0
  2. package/dist/index.d.mts +29 -190
  3. package/dist/index.d.ts +29 -190
  4. package/dist/index.js +104 -1
  5. package/dist/index.mjs +104 -1
  6. package/package.json +22 -49
  7. package/storage/store.json +1 -0
  8. package/storage/temp/session/app-state-sync-key-AAAAAFNh.json +1 -0
  9. package/storage/temp/session/app-state-sync-key-AAAAAFNi.json +1 -0
  10. package/storage/temp/session/app-state-sync-version-critical_block.json +1 -0
  11. package/storage/temp/session/app-state-sync-version-critical_unblock_low.json +1 -0
  12. package/storage/temp/session/app-state-sync-version-regular.json +1 -0
  13. package/storage/temp/session/app-state-sync-version-regular_high.json +1 -0
  14. package/storage/temp/session/app-state-sync-version-regular_low.json +1 -0
  15. package/storage/temp/session/creds.json +1 -0
  16. package/storage/temp/session/pre-key-1.json +1 -0
  17. package/storage/temp/session/pre-key-10.json +1 -0
  18. package/storage/temp/session/pre-key-11.json +1 -0
  19. package/storage/temp/session/pre-key-12.json +1 -0
  20. package/storage/temp/session/pre-key-13.json +1 -0
  21. package/storage/temp/session/pre-key-14.json +1 -0
  22. package/storage/temp/session/pre-key-15.json +1 -0
  23. package/storage/temp/session/pre-key-16.json +1 -0
  24. package/storage/temp/session/pre-key-17.json +1 -0
  25. package/storage/temp/session/pre-key-19.json +1 -0
  26. package/storage/temp/session/pre-key-2.json +1 -0
  27. package/storage/temp/session/pre-key-20.json +1 -0
  28. package/storage/temp/session/pre-key-21.json +1 -0
  29. package/storage/temp/session/pre-key-22.json +1 -0
  30. package/storage/temp/session/pre-key-23.json +1 -0
  31. package/storage/temp/session/pre-key-24.json +1 -0
  32. package/storage/temp/session/pre-key-25.json +1 -0
  33. package/storage/temp/session/pre-key-26.json +1 -0
  34. package/storage/temp/session/pre-key-27.json +1 -0
  35. package/storage/temp/session/pre-key-28.json +1 -0
  36. package/storage/temp/session/pre-key-29.json +1 -0
  37. package/storage/temp/session/pre-key-3.json +1 -0
  38. package/storage/temp/session/pre-key-30.json +1 -0
  39. package/storage/temp/session/pre-key-4.json +1 -0
  40. package/storage/temp/session/pre-key-5.json +1 -0
  41. package/storage/temp/session/pre-key-6.json +1 -0
  42. package/storage/temp/session/pre-key-7.json +1 -0
  43. package/storage/temp/session/pre-key-8.json +1 -0
  44. package/storage/temp/session/pre-key-9.json +1 -0
  45. package/storage/temp/session/session-6285878897780.0.json +1 -0
  46. package/storage/temp/session/session-62858788977802.0.json +1 -0
  47. package/LICENSE +0 -21
  48. package/README.MD +0 -3
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ ## my-ts-project
2
+
3
+ bot wa
4
+
5
+ ---
6
+ if you want to build package :
7
+ ```bash
8
+ yarn build
9
+ ```
10
+
11
+ if you want to generate docs :
12
+ ```bash
13
+ yarn build
14
+ ```
15
+
16
+ if you want to publish :
17
+ ```bash
18
+ yarn build
19
+ ```
20
+
21
+ ---
22
+
23
+ This is auto generating **Node Package Manager** by [setup-npm](https://www.npmjs.com/package/setup-npm) developing by [zaadevofc](https://instagram.com/zaadevofc)
24
+
package/dist/index.d.mts CHANGED
@@ -1,192 +1,31 @@
1
- import { WAMessage, makeInMemoryStore, AuthenticationState, UserFacingSocketConfig } from 'baileys';
2
-
3
- /**
4
- * Represents the properties of the ReadyParserProps.
5
- * Used to represent the status of the client.
6
- */
7
- type ReadyParserProps = 'ready' | 'connecting' | 'close';
8
- /**
9
- * Represents the properties of the MessageTypeProps.
10
- * Used to represent the type of the message.
11
- */
12
- type MessageTypeProps = 'text' | 'sticker' | 'image' | 'video' | 'document' | 'product' | 'reaction' | 'gif' | 'audio' | 'voice' | 'contact' | 'polling' | 'location' | 'unknown';
13
- /**
14
- * Represents the internal properties of a message.
15
- * Used to hold the essential information about a message.
16
- */
17
- type MessageInternalProps = {
18
- /**
19
- * The ID of the chat the message is in.
20
- * @type {string}
21
- */
22
- chatId: string;
23
- /**
24
- * Whether the message was sent by the current user.
25
- * @type {boolean}
26
- */
27
- fromMe: boolean;
28
- /**
29
- * The user's username.
30
- * @type {string}
31
- */
32
- pushName: string;
33
- /**
34
- * The user's ID.
35
- * @type {string}
36
- */
37
- remoteJid: string;
38
- /**
39
- * The timestamp of the message.
40
- * @type {number}
41
- */
42
- timestamp: number;
43
- /**
44
- * Whether the message is from an authorized user.
45
- * @type {boolean}
46
- */
47
- isAuthor: boolean;
48
- /**
49
- * Whether the message is a broadcast message.
50
- * @type {boolean}
51
- */
52
- isBroadcast: boolean;
53
- /**
54
- * Whether the message is sent in a group.
55
- * @type {boolean}
56
- */
57
- isGroup: boolean;
58
- /**
59
- * Whether the message is a view-once message.
60
- * @type {boolean}
61
- */
62
- isViewOnce: boolean;
63
- };
64
- /**
65
- * Represents the parsed properties of a message.
66
- * Used to hold the parsed information about a message.
67
- */
68
- type MessageParserProps = MessageInternalProps[] & {
69
- /**
70
- * The body of the message.
71
- * @type {Object}
72
- * @property {MessageTypeProps} type - The type of the message.
73
- * @property {string} [text] - The text of the message (if applicable).
74
- */
75
- body: {
76
- type: MessageTypeProps;
77
- text?: string | undefined;
78
- };
79
- }[];
80
-
81
- type Prettify<T> = {
82
- [K in keyof T]: T[K];
83
- } & {};
84
- type ClientProps = {
85
- phoneNumber: number;
86
- pairing?: boolean;
87
- showLogs?: boolean;
88
- ignoreMe?: boolean;
89
- authors?: number[];
90
- };
91
- type ActionsProps = {
92
- message: MessageParserProps;
93
- connection: ReadyParserProps;
94
- };
95
-
96
- declare class Client {
97
- pairing: boolean;
98
- phoneNumber: number;
99
- showLogs: boolean;
100
- authors: number[];
101
- ignoreMe: boolean;
102
- private canNext;
103
- private socket;
104
- private sock;
105
- constructor({ pairing, phoneNumber, showLogs, authors, ignoreMe }: ClientProps);
106
- private init;
107
- on<T extends keyof ActionsProps>(actions: T, callback: (ctx: Prettify<ActionsProps[T]>) => void): Promise<void>;
1
+ import * as baileys from '@whiskeysockets/baileys';
2
+ import { EventEmitter } from 'events';
3
+
4
+ type EventName = 'open' | 'message' | 'close' | 'error';
5
+ declare class Client extends EventEmitter {
6
+ private conn;
7
+ private store;
8
+ private logger;
9
+ private spinner;
10
+ isRunning: boolean;
11
+ constructor();
12
+ private showBanner;
13
+ private start;
14
+ private setupProcessHandlers;
15
+ private initClient;
16
+ private setupPairingCode;
17
+ private handleConnection;
18
+ private startLoading;
19
+ private stopLoading;
20
+ private handleMessages;
21
+ private handleContactsUpdate;
22
+ private handleContactsUpsert;
23
+ private handleGroupsUpdate;
24
+ sendMessage(jid: string, content: baileys.AnyMessageContent, options?: baileys.MiscMessageGenerationOptions): Promise<baileys.WAProto.WebMessageInfo | undefined>;
25
+ on(eventName: EventName, callback: (...args: any[]) => void): this;
26
+ simulateMessage(data: any): void;
27
+ simulateClose(code: number, reason: string): void;
28
+ simulateError(error: Error): void;
108
29
  }
109
30
 
110
- declare function InitDisplay(config: ClientProps): void;
111
-
112
- declare function MessageParser(ctx: WAMessage[], config: ClientProps, store: ReturnType<typeof makeInMemoryStore>): Promise<MessageParserProps | undefined>;
113
-
114
- declare function ConnectionConfig(props: ClientProps, state: AuthenticationState, store: ReturnType<typeof makeInMemoryStore>): UserFacingSocketConfig;
115
- declare const MESSAGE_TYPE: {
116
- text: string;
117
- conversation: string;
118
- imageMessage: string;
119
- contactMessage: string;
120
- locationMessage: string;
121
- extendedTextMessage: string;
122
- documentMessage: string;
123
- audioMessage: string;
124
- videoMessage: string;
125
- protocolMessage: string;
126
- contactsArrayMessage: string;
127
- highlyStructuredMessage: string;
128
- sendPaymentMessage: string;
129
- liveLocationMessage: string;
130
- requestPaymentMessage: string;
131
- declinePaymentRequestMessage: string;
132
- cancelPaymentRequestMessage: string;
133
- templateMessage: string;
134
- stickerMessage: string;
135
- groupInviteMessage: string;
136
- templateButtonReplyMessage: string;
137
- productMessage: string;
138
- deviceSentMessage: string;
139
- listMessage: string;
140
- viewOnceMessage: string;
141
- orderMessage: string;
142
- listResponseMessage: string;
143
- ephemeralMessage: string;
144
- invoiceMessage: string;
145
- buttonsMessage: string;
146
- buttonsResponseMessage: string;
147
- paymentInviteMessage: string;
148
- interactiveMessage: string;
149
- reactionMessage: string;
150
- stickerSyncRmrMessage: string;
151
- interactiveResponseMessage: string;
152
- pollCreationMessage: string;
153
- pollUpdateMessage: string;
154
- keepInChatMessage: string;
155
- documentWithCaptionMessage: string;
156
- requestPhoneNumberMessage: string;
157
- viewOnceMessageV2: string;
158
- encReactionMessage: string;
159
- editedMessage: string;
160
- viewOnceMessageV2Extension: string;
161
- pollCreationMessageV2: string;
162
- scheduledCallCreationMessage: string;
163
- groupMentionedMessage: string;
164
- pinInChatMessage: string;
165
- pollCreationMessageV3: string;
166
- scheduledCallEditMessage: string;
167
- ptvMessage: string;
168
- botInvokeMessage: string;
169
- callLogMesssage: string;
170
- encCommentMessage: string;
171
- bcallMessage: string;
172
- lottieStickerMessage: string;
173
- eventMessage: string;
174
- commentMessage: string;
175
- newsletterAdminInviteMessage: string;
176
- extendedTextMessageWithParentKey: string;
177
- placeholderMessage: string;
178
- encEventUpdateMessage: string;
179
- };
180
-
181
- declare function loop(cb: () => void, ms: number): NodeJS.Timeout;
182
- declare function jsonString(obj: any): any;
183
- declare function jsonParse(obj: any): any;
184
- declare function timeout(cb: () => void, ms: number): NodeJS.Timeout;
185
- declare function delay(ms: number): Promise<unknown>;
186
- declare const fetchJson: (uri: any, method?: any) => Promise<any>;
187
- declare const postJson: (uri: any, data: any) => Promise<any>;
188
- declare function getValuesByKeys(object: any, keys: string[]): any[];
189
- declare function removeKeys(object: any, keys: string[]): any;
190
- declare function getMessageType(obj: any): string[];
191
-
192
- export { type ActionsProps, Client, type ClientProps, ConnectionConfig, InitDisplay, MESSAGE_TYPE, MessageParser, type Prettify, delay, fetchJson, getMessageType, getValuesByKeys, jsonParse, jsonString, loop, postJson, removeKeys, timeout };
31
+ export { Client };
package/dist/index.d.ts CHANGED
@@ -1,192 +1,31 @@
1
- import { WAMessage, makeInMemoryStore, AuthenticationState, UserFacingSocketConfig } from 'baileys';
2
-
3
- /**
4
- * Represents the properties of the ReadyParserProps.
5
- * Used to represent the status of the client.
6
- */
7
- type ReadyParserProps = 'ready' | 'connecting' | 'close';
8
- /**
9
- * Represents the properties of the MessageTypeProps.
10
- * Used to represent the type of the message.
11
- */
12
- type MessageTypeProps = 'text' | 'sticker' | 'image' | 'video' | 'document' | 'product' | 'reaction' | 'gif' | 'audio' | 'voice' | 'contact' | 'polling' | 'location' | 'unknown';
13
- /**
14
- * Represents the internal properties of a message.
15
- * Used to hold the essential information about a message.
16
- */
17
- type MessageInternalProps = {
18
- /**
19
- * The ID of the chat the message is in.
20
- * @type {string}
21
- */
22
- chatId: string;
23
- /**
24
- * Whether the message was sent by the current user.
25
- * @type {boolean}
26
- */
27
- fromMe: boolean;
28
- /**
29
- * The user's username.
30
- * @type {string}
31
- */
32
- pushName: string;
33
- /**
34
- * The user's ID.
35
- * @type {string}
36
- */
37
- remoteJid: string;
38
- /**
39
- * The timestamp of the message.
40
- * @type {number}
41
- */
42
- timestamp: number;
43
- /**
44
- * Whether the message is from an authorized user.
45
- * @type {boolean}
46
- */
47
- isAuthor: boolean;
48
- /**
49
- * Whether the message is a broadcast message.
50
- * @type {boolean}
51
- */
52
- isBroadcast: boolean;
53
- /**
54
- * Whether the message is sent in a group.
55
- * @type {boolean}
56
- */
57
- isGroup: boolean;
58
- /**
59
- * Whether the message is a view-once message.
60
- * @type {boolean}
61
- */
62
- isViewOnce: boolean;
63
- };
64
- /**
65
- * Represents the parsed properties of a message.
66
- * Used to hold the parsed information about a message.
67
- */
68
- type MessageParserProps = MessageInternalProps[] & {
69
- /**
70
- * The body of the message.
71
- * @type {Object}
72
- * @property {MessageTypeProps} type - The type of the message.
73
- * @property {string} [text] - The text of the message (if applicable).
74
- */
75
- body: {
76
- type: MessageTypeProps;
77
- text?: string | undefined;
78
- };
79
- }[];
80
-
81
- type Prettify<T> = {
82
- [K in keyof T]: T[K];
83
- } & {};
84
- type ClientProps = {
85
- phoneNumber: number;
86
- pairing?: boolean;
87
- showLogs?: boolean;
88
- ignoreMe?: boolean;
89
- authors?: number[];
90
- };
91
- type ActionsProps = {
92
- message: MessageParserProps;
93
- connection: ReadyParserProps;
94
- };
95
-
96
- declare class Client {
97
- pairing: boolean;
98
- phoneNumber: number;
99
- showLogs: boolean;
100
- authors: number[];
101
- ignoreMe: boolean;
102
- private canNext;
103
- private socket;
104
- private sock;
105
- constructor({ pairing, phoneNumber, showLogs, authors, ignoreMe }: ClientProps);
106
- private init;
107
- on<T extends keyof ActionsProps>(actions: T, callback: (ctx: Prettify<ActionsProps[T]>) => void): Promise<void>;
1
+ import * as baileys from '@whiskeysockets/baileys';
2
+ import { EventEmitter } from 'events';
3
+
4
+ type EventName = 'open' | 'message' | 'close' | 'error';
5
+ declare class Client extends EventEmitter {
6
+ private conn;
7
+ private store;
8
+ private logger;
9
+ private spinner;
10
+ isRunning: boolean;
11
+ constructor();
12
+ private showBanner;
13
+ private start;
14
+ private setupProcessHandlers;
15
+ private initClient;
16
+ private setupPairingCode;
17
+ private handleConnection;
18
+ private startLoading;
19
+ private stopLoading;
20
+ private handleMessages;
21
+ private handleContactsUpdate;
22
+ private handleContactsUpsert;
23
+ private handleGroupsUpdate;
24
+ sendMessage(jid: string, content: baileys.AnyMessageContent, options?: baileys.MiscMessageGenerationOptions): Promise<baileys.WAProto.WebMessageInfo | undefined>;
25
+ on(eventName: EventName, callback: (...args: any[]) => void): this;
26
+ simulateMessage(data: any): void;
27
+ simulateClose(code: number, reason: string): void;
28
+ simulateError(error: Error): void;
108
29
  }
109
30
 
110
- declare function InitDisplay(config: ClientProps): void;
111
-
112
- declare function MessageParser(ctx: WAMessage[], config: ClientProps, store: ReturnType<typeof makeInMemoryStore>): Promise<MessageParserProps | undefined>;
113
-
114
- declare function ConnectionConfig(props: ClientProps, state: AuthenticationState, store: ReturnType<typeof makeInMemoryStore>): UserFacingSocketConfig;
115
- declare const MESSAGE_TYPE: {
116
- text: string;
117
- conversation: string;
118
- imageMessage: string;
119
- contactMessage: string;
120
- locationMessage: string;
121
- extendedTextMessage: string;
122
- documentMessage: string;
123
- audioMessage: string;
124
- videoMessage: string;
125
- protocolMessage: string;
126
- contactsArrayMessage: string;
127
- highlyStructuredMessage: string;
128
- sendPaymentMessage: string;
129
- liveLocationMessage: string;
130
- requestPaymentMessage: string;
131
- declinePaymentRequestMessage: string;
132
- cancelPaymentRequestMessage: string;
133
- templateMessage: string;
134
- stickerMessage: string;
135
- groupInviteMessage: string;
136
- templateButtonReplyMessage: string;
137
- productMessage: string;
138
- deviceSentMessage: string;
139
- listMessage: string;
140
- viewOnceMessage: string;
141
- orderMessage: string;
142
- listResponseMessage: string;
143
- ephemeralMessage: string;
144
- invoiceMessage: string;
145
- buttonsMessage: string;
146
- buttonsResponseMessage: string;
147
- paymentInviteMessage: string;
148
- interactiveMessage: string;
149
- reactionMessage: string;
150
- stickerSyncRmrMessage: string;
151
- interactiveResponseMessage: string;
152
- pollCreationMessage: string;
153
- pollUpdateMessage: string;
154
- keepInChatMessage: string;
155
- documentWithCaptionMessage: string;
156
- requestPhoneNumberMessage: string;
157
- viewOnceMessageV2: string;
158
- encReactionMessage: string;
159
- editedMessage: string;
160
- viewOnceMessageV2Extension: string;
161
- pollCreationMessageV2: string;
162
- scheduledCallCreationMessage: string;
163
- groupMentionedMessage: string;
164
- pinInChatMessage: string;
165
- pollCreationMessageV3: string;
166
- scheduledCallEditMessage: string;
167
- ptvMessage: string;
168
- botInvokeMessage: string;
169
- callLogMesssage: string;
170
- encCommentMessage: string;
171
- bcallMessage: string;
172
- lottieStickerMessage: string;
173
- eventMessage: string;
174
- commentMessage: string;
175
- newsletterAdminInviteMessage: string;
176
- extendedTextMessageWithParentKey: string;
177
- placeholderMessage: string;
178
- encEventUpdateMessage: string;
179
- };
180
-
181
- declare function loop(cb: () => void, ms: number): NodeJS.Timeout;
182
- declare function jsonString(obj: any): any;
183
- declare function jsonParse(obj: any): any;
184
- declare function timeout(cb: () => void, ms: number): NodeJS.Timeout;
185
- declare function delay(ms: number): Promise<unknown>;
186
- declare const fetchJson: (uri: any, method?: any) => Promise<any>;
187
- declare const postJson: (uri: any, data: any) => Promise<any>;
188
- declare function getValuesByKeys(object: any, keys: string[]): any[];
189
- declare function removeKeys(object: any, keys: string[]): any;
190
- declare function getMessageType(obj: any): string[];
191
-
192
- export { type ActionsProps, Client, type ClientProps, ConnectionConfig, InitDisplay, MESSAGE_TYPE, MessageParser, type Prettify, delay, fetchJson, getMessageType, getValuesByKeys, jsonParse, jsonString, loop, postJson, removeKeys, timeout };
31
+ export { Client };