autobot-fca 1.0.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.
@@ -0,0 +1,294 @@
1
+ interface CheckUpdateConfig {
2
+ enabled?: boolean;
3
+ install?: boolean;
4
+ notifyIfCurrent?: boolean;
5
+ packageName?: string;
6
+ registryUrl?: string;
7
+ timeoutMs?: number;
8
+ }
9
+ interface MqttConfig {
10
+ enabled?: boolean;
11
+ reconnectInterval?: number;
12
+ }
13
+ interface AntiGetInfoConfig {
14
+ AntiGetThreadInfo?: boolean;
15
+ AntiGetUserInfo?: boolean;
16
+ }
17
+ interface RemoteControlConfig {
18
+ enabled?: boolean;
19
+ url?: string;
20
+ token?: string;
21
+ autoReconnect?: boolean;
22
+ }
23
+ interface ThreadCacheConfig {
24
+ maxAgeMs?: number;
25
+ invalidateIntervalMs?: number;
26
+ }
27
+ interface FcaCredentials {
28
+ email?: string;
29
+ password?: string;
30
+ twofactor?: string;
31
+ Cookie?: string;
32
+ cookie?: string;
33
+ cookies?: any;
34
+ appState?: any[];
35
+ appstate?: any[];
36
+ }
37
+ interface FcaConfig {
38
+ autoUpdate?: boolean;
39
+ checkUpdate?: CheckUpdateConfig;
40
+ mqtt?: MqttConfig;
41
+ autoLogin?: boolean;
42
+ apiServer?: string;
43
+ apiKey?: string;
44
+ credentials?: FcaCredentials;
45
+ antiGetInfo?: AntiGetInfoConfig;
46
+ remoteControl?: RemoteControlConfig;
47
+ threadCache?: ThreadCacheConfig;
48
+ cookiePath?: string;
49
+ cookiesPath?: string;
50
+ cookieFile?: string;
51
+ cookiesFile?: string;
52
+ appStatePath?: string;
53
+ appstatePath?: string;
54
+ [key: string]: any;
55
+ }
56
+ interface LoginOptions {
57
+ online?: boolean;
58
+ forceLogin?: boolean;
59
+ autoMarkRead?: boolean;
60
+ listenEvents?: boolean;
61
+ selfListen?: boolean;
62
+ userAgent?: string;
63
+ logLevel?: "silent" | "error" | "warn" | "info" | "debug";
64
+ updatePresence?: boolean;
65
+ autoReconnect?: boolean;
66
+ [key: string]: any;
67
+ }
68
+ interface MessagePayload {
69
+ body?: string;
70
+ attachment?: any;
71
+ mentions?: Array<{
72
+ tag: string;
73
+ id: string;
74
+ }>;
75
+ sticker?: string;
76
+ location?: any;
77
+ replyToMessage?: string;
78
+ [key: string]: any;
79
+ }
80
+ interface ThreadInfo {
81
+ threadID: string;
82
+ threadName?: string;
83
+ participantIDs?: string[];
84
+ userInfo?: Array<{
85
+ id: string;
86
+ name: string;
87
+ }>;
88
+ unreadCount?: number;
89
+ messageCount?: number;
90
+ isGroup?: boolean;
91
+ isArchived?: boolean;
92
+ emoji?: string;
93
+ color?: string;
94
+ adminIDs?: string[];
95
+ nicknames?: Record<string, string>;
96
+ imageSrc?: string;
97
+ [key: string]: any;
98
+ }
99
+ interface UserInfo {
100
+ id: string;
101
+ name: string;
102
+ firstName?: string;
103
+ vanity?: string;
104
+ thumbSrc?: string;
105
+ profileUrl?: string;
106
+ gender?: string;
107
+ type?: string;
108
+ isFriend?: boolean;
109
+ isBirthday?: boolean;
110
+ [key: string]: any;
111
+ }
112
+ interface AppStateEntry {
113
+ key: string;
114
+ value: string;
115
+ domain?: string;
116
+ path?: string;
117
+ expires?: number;
118
+ [key: string]: any;
119
+ }
120
+ type MiddlewareFn = (event: any, api: any, next: () => void) => void | Promise<void>;
121
+ interface FcaClient {
122
+ messages: {
123
+ send: (message: string | MessagePayload, threadID: string, callback?: any) => Promise<any> | any;
124
+ edit: (text: string, messageID: string, callback?: any) => Promise<any> | any;
125
+ reply: (message: string | MessagePayload, messageID: string, callback?: any) => Promise<any> | any;
126
+ unsend: (messageID: string, callback?: any) => Promise<any> | any;
127
+ forward: (messageID: string, threadID: string, callback?: any) => Promise<any> | any;
128
+ react: (reaction: string, messageID: string, callback?: any) => Promise<any> | any;
129
+ delete: (messageID: string | string[], callback?: any) => Promise<any> | any;
130
+ sendTypingIndicator: (threadID: string, callback?: any) => Promise<any> | any;
131
+ };
132
+ threads: {
133
+ getInfo: (threadID: string, callback?: any) => Promise<ThreadInfo> | any;
134
+ getList: (limit?: number, timestamp?: number, tags?: string[], callback?: any) => Promise<ThreadInfo[]> | any;
135
+ getHistory: (threadID: string, amount?: number, timestamp?: number, callback?: any) => Promise<any[]> | any;
136
+ getPictures: (threadID: string, offset?: number, limit?: number, callback?: any) => Promise<any[]> | any;
137
+ setTitle: (newTitle: string, threadID: string, callback?: any) => Promise<any> | any;
138
+ changeColor: (color: string, threadID: string, callback?: any) => Promise<any> | any;
139
+ changeEmoji: (emoji: string, threadID: string, callback?: any) => Promise<any> | any;
140
+ changeNickname: (nickname: string, threadID: string, participantID: string, callback?: any) => Promise<any> | any;
141
+ changeGroupImage: (image: any, threadID: string, callback?: any) => Promise<any> | any;
142
+ changeAdminStatus: (threadID: string, adminIDs: string | string[], adminStatus: boolean, callback?: any) => Promise<any> | any;
143
+ changeArchivedStatus: (threadID: string, archive: boolean, callback?: any) => Promise<any> | any;
144
+ addUser: (userID: string | string[], threadID: string, callback?: any) => Promise<any> | any;
145
+ removeUser: (userID: string, threadID: string, callback?: any) => Promise<any> | any;
146
+ createPoll: (title: string, options: Record<string, boolean> | string[], threadID: string, callback?: any) => Promise<any> | any;
147
+ deleteThread: (threadID: string | string[], callback?: any) => Promise<any> | any;
148
+ markAsRead: (threadID: string, callback?: any) => Promise<any> | any;
149
+ };
150
+ users: {
151
+ getInfo: (userIDs: string | string[], callback?: any) => Promise<Record<string, UserInfo>> | any;
152
+ getUserID: (name: string, callback?: any) => Promise<Array<{
153
+ id: string;
154
+ name: string;
155
+ }>> | any;
156
+ getFriendsList: (callback?: any) => Promise<any[]> | any;
157
+ block: (userID: string, callback?: any) => Promise<any> | any;
158
+ unblock: (userID: string, callback?: any) => Promise<any> | any;
159
+ };
160
+ account: {
161
+ getCurrentUserID: () => string;
162
+ getAppState: () => AppStateEntry[];
163
+ setOptions: (options: Partial<LoginOptions>) => void;
164
+ setBio: (bio: string, publishId?: boolean, callback?: any) => Promise<any> | any;
165
+ };
166
+ realtime: {
167
+ listen: (callback: (err: any, event: any) => void) => () => void;
168
+ stopListening: (callback?: any) => void;
169
+ stopListeningAsync: () => Promise<any>;
170
+ };
171
+ http: {
172
+ get: (url: string, params?: any, callback?: any) => Promise<any> | any;
173
+ post: (url: string, body?: any, callback?: any) => Promise<any> | any;
174
+ postFormData: (url: string, formData?: any, callback?: any) => Promise<any> | any;
175
+ };
176
+ scheduler: {
177
+ scheduleMessage: (message?: any, threadID?: any, timestamp?: any) => any;
178
+ };
179
+ [key: string]: any;
180
+ }
181
+ interface FcaApi {
182
+ sendMessage: (message: string | MessagePayload, threadID: string, callback?: any) => Promise<any> | any;
183
+ editMessage: (text: string, messageID: string, callback?: any) => Promise<any> | any;
184
+ replyMessage: (message: string | MessagePayload, messageID: string, callback?: any) => Promise<any> | any;
185
+ unsendMessage: (messageID: string, callback?: any) => Promise<any> | any;
186
+ setMessageReaction: (reaction: string, messageID: string, callback?: any, force?: boolean) => Promise<any> | any;
187
+ sendTypingIndicator: (threadID: string, callback?: any) => ((callback?: any) => void) | Promise<any> | any;
188
+ deleteMessage: (messageID: string | string[], callback?: any) => Promise<any> | any;
189
+ forwardAttachment: (attachmentID: string, threadID: string, callback?: any) => Promise<any> | any;
190
+ getThreadInfo: (threadID: string, callback?: any) => Promise<ThreadInfo> | any;
191
+ getThreadList: (limit?: number, timestamp?: number, tags?: string[], callback?: any) => Promise<ThreadInfo[]> | any;
192
+ getThreadHistory: (threadID: string, amount?: number, timestamp?: number, callback?: any) => Promise<any[]> | any;
193
+ getThreadPictures: (threadID: string, offset?: number, limit?: number, callback?: any) => Promise<any[]> | any;
194
+ setTitle: (newTitle: string, threadID: string, callback?: any) => Promise<any> | any;
195
+ changeThreadColor: (color: string, threadID: string, callback?: any) => Promise<any> | any;
196
+ changeThreadEmoji: (emoji: string, threadID: string, callback?: any) => Promise<any> | any;
197
+ changeNickname: (nickname: string, threadID: string, participantID: string, callback?: any) => Promise<any> | any;
198
+ changeGroupImage: (image: any, threadID: string, callback?: any) => Promise<any> | any;
199
+ changeAdminStatus: (threadID: string, adminIDs: string | string[], adminStatus: boolean, callback?: any) => Promise<any> | any;
200
+ changeArchivedStatus: (threadID: string, archive: boolean, callback?: any) => Promise<any> | any;
201
+ addUserToGroup: (userID: string | string[], threadID: string, callback?: any) => Promise<any> | any;
202
+ removeUserFromGroup: (userID: string, threadID: string, callback?: any) => Promise<any> | any;
203
+ createPoll: (title: string, options: Record<string, boolean> | string[], threadID: string, callback?: any) => Promise<any> | any;
204
+ deleteThread: (threadID: string | string[], callback?: any) => Promise<any> | any;
205
+ markAsRead: (threadID: string, callback?: any) => Promise<any> | any;
206
+ markAsReadAll: (callback?: any) => Promise<any> | any;
207
+ markAsSeen: (seen?: boolean, callback?: any) => Promise<any> | any;
208
+ markAsDelivered: (threadID: string, messageID: string, callback?: any) => Promise<any> | any;
209
+ getUserInfo: (userIDs: string | string[], callback?: any) => Promise<Record<string, UserInfo>> | any;
210
+ getUserID: (name: string, callback?: any) => Promise<Array<{
211
+ id: string;
212
+ name: string;
213
+ }>> | any;
214
+ getFriendsList: (callback?: any) => Promise<any[]> | any;
215
+ blockUser: (userID: string, callback?: any) => Promise<any> | any;
216
+ unblockUser: (userID: string, callback?: any) => Promise<any> | any;
217
+ getCurrentUserID: () => string;
218
+ getAppState: () => AppStateEntry[];
219
+ setOptions: (options: Partial<LoginOptions>) => void;
220
+ setBio: (bio: string, publishId?: boolean, callback?: any) => Promise<any> | any;
221
+ listenMqtt: (callback: (err: any, event: any) => void) => () => void;
222
+ stopListening: (callback?: any) => void;
223
+ stopListeningAsync: () => Promise<any>;
224
+ useMiddleware: (fn: MiddlewareFn) => void;
225
+ removeMiddleware: (fn: MiddlewareFn) => void;
226
+ clearMiddleware: () => void;
227
+ listMiddleware: () => MiddlewareFn[];
228
+ setMiddlewareEnabled: (enabled: boolean) => boolean;
229
+ httpGet: (url: string, params?: any, callback?: any) => Promise<any> | any;
230
+ httpPost: (url: string, body?: any, callback?: any) => Promise<any> | any;
231
+ postFormData: (url: string, formData?: any, callback?: any) => Promise<any> | any;
232
+ handleReply: Map<string, any>;
233
+ handleReaction: Map<string, any>;
234
+ handleSchedule: Map<string, any>;
235
+ client?: FcaClient;
236
+ messages?: any;
237
+ threads?: any;
238
+ users?: any;
239
+ account?: any;
240
+ realtime?: any;
241
+ http?: any;
242
+ scheduler?: any;
243
+ [key: string]: any;
244
+ }
245
+ interface FcaLoginContext {
246
+ api: FcaApi;
247
+ userID: string;
248
+ fbid?: string;
249
+ }
250
+
251
+ declare function login(credentials?: FcaCredentials | any, options?: LoginOptions | ((err: any, ctx?: FcaLoginContext) => void), callback?: (err: any, ctx?: FcaLoginContext) => void): Promise<FcaLoginContext>;
252
+ declare function createMessengerBot(credentials?: any, options?: any): Promise<FcaLoginContext>;
253
+
254
+ declare function createFcaClient(api: any): FcaClient;
255
+ declare function attachClientFacade(api: any): FcaClient;
256
+
257
+ declare const DEFAULT_FCA_CONFIG: FcaConfig;
258
+ declare function resolveConfig(customConfig?: Partial<FcaConfig>): FcaConfig;
259
+ declare function loadConfig(configPath?: string): FcaConfig;
260
+
261
+ declare function toCookiePair(name?: string | null, value?: any): string | null;
262
+ declare function dedupeCookiePairs(pairs: string[]): string[];
263
+ declare function parseCookieHeaderString(raw?: string): string[];
264
+ declare function parseNetscapeCookieText(raw?: string): string[];
265
+ declare function normalizeCookiePayload(payload: any): string | null;
266
+ declare function cookieToAppState(cookie: any): Array<{
267
+ key: string;
268
+ value: string;
269
+ domain: string;
270
+ path: string;
271
+ expires?: number;
272
+ }>;
273
+ declare function appStateToCookie(appState: any[]): string;
274
+ declare function toNetscapeCookieText(cookies: any): string;
275
+
276
+ declare const defaultExport: typeof login & {
277
+ login: typeof login;
278
+ createMessengerBot: typeof createMessengerBot;
279
+ createFcaClient: typeof createFcaClient;
280
+ attachClientFacade: typeof attachClientFacade;
281
+ resolveConfig: typeof resolveConfig;
282
+ loadConfig: typeof loadConfig;
283
+ DEFAULT_FCA_CONFIG: FcaConfig;
284
+ toCookiePair: typeof toCookiePair;
285
+ dedupeCookiePairs: typeof dedupeCookiePairs;
286
+ parseCookieHeaderString: typeof parseCookieHeaderString;
287
+ parseNetscapeCookieText: typeof parseNetscapeCookieText;
288
+ normalizeCookiePayload: typeof normalizeCookiePayload;
289
+ cookieToAppState: typeof cookieToAppState;
290
+ appStateToCookie: typeof appStateToCookie;
291
+ toNetscapeCookieText: typeof toNetscapeCookieText;
292
+ };
293
+
294
+ export { type AntiGetInfoConfig, type AppStateEntry, type CheckUpdateConfig, DEFAULT_FCA_CONFIG, type FcaApi, type FcaClient, type FcaConfig, type FcaCredentials, type FcaLoginContext, type LoginOptions, type MessagePayload, type MiddlewareFn, type MqttConfig, type RemoteControlConfig, type ThreadCacheConfig, type ThreadInfo, type UserInfo, appStateToCookie, attachClientFacade, cookieToAppState, createFcaClient, createMessengerBot, dedupeCookiePairs, defaultExport as default, loadConfig, login, normalizeCookiePayload, parseCookieHeaderString, parseNetscapeCookieText, resolveConfig, toCookiePair, toNetscapeCookieText };
@@ -0,0 +1,294 @@
1
+ interface CheckUpdateConfig {
2
+ enabled?: boolean;
3
+ install?: boolean;
4
+ notifyIfCurrent?: boolean;
5
+ packageName?: string;
6
+ registryUrl?: string;
7
+ timeoutMs?: number;
8
+ }
9
+ interface MqttConfig {
10
+ enabled?: boolean;
11
+ reconnectInterval?: number;
12
+ }
13
+ interface AntiGetInfoConfig {
14
+ AntiGetThreadInfo?: boolean;
15
+ AntiGetUserInfo?: boolean;
16
+ }
17
+ interface RemoteControlConfig {
18
+ enabled?: boolean;
19
+ url?: string;
20
+ token?: string;
21
+ autoReconnect?: boolean;
22
+ }
23
+ interface ThreadCacheConfig {
24
+ maxAgeMs?: number;
25
+ invalidateIntervalMs?: number;
26
+ }
27
+ interface FcaCredentials {
28
+ email?: string;
29
+ password?: string;
30
+ twofactor?: string;
31
+ Cookie?: string;
32
+ cookie?: string;
33
+ cookies?: any;
34
+ appState?: any[];
35
+ appstate?: any[];
36
+ }
37
+ interface FcaConfig {
38
+ autoUpdate?: boolean;
39
+ checkUpdate?: CheckUpdateConfig;
40
+ mqtt?: MqttConfig;
41
+ autoLogin?: boolean;
42
+ apiServer?: string;
43
+ apiKey?: string;
44
+ credentials?: FcaCredentials;
45
+ antiGetInfo?: AntiGetInfoConfig;
46
+ remoteControl?: RemoteControlConfig;
47
+ threadCache?: ThreadCacheConfig;
48
+ cookiePath?: string;
49
+ cookiesPath?: string;
50
+ cookieFile?: string;
51
+ cookiesFile?: string;
52
+ appStatePath?: string;
53
+ appstatePath?: string;
54
+ [key: string]: any;
55
+ }
56
+ interface LoginOptions {
57
+ online?: boolean;
58
+ forceLogin?: boolean;
59
+ autoMarkRead?: boolean;
60
+ listenEvents?: boolean;
61
+ selfListen?: boolean;
62
+ userAgent?: string;
63
+ logLevel?: "silent" | "error" | "warn" | "info" | "debug";
64
+ updatePresence?: boolean;
65
+ autoReconnect?: boolean;
66
+ [key: string]: any;
67
+ }
68
+ interface MessagePayload {
69
+ body?: string;
70
+ attachment?: any;
71
+ mentions?: Array<{
72
+ tag: string;
73
+ id: string;
74
+ }>;
75
+ sticker?: string;
76
+ location?: any;
77
+ replyToMessage?: string;
78
+ [key: string]: any;
79
+ }
80
+ interface ThreadInfo {
81
+ threadID: string;
82
+ threadName?: string;
83
+ participantIDs?: string[];
84
+ userInfo?: Array<{
85
+ id: string;
86
+ name: string;
87
+ }>;
88
+ unreadCount?: number;
89
+ messageCount?: number;
90
+ isGroup?: boolean;
91
+ isArchived?: boolean;
92
+ emoji?: string;
93
+ color?: string;
94
+ adminIDs?: string[];
95
+ nicknames?: Record<string, string>;
96
+ imageSrc?: string;
97
+ [key: string]: any;
98
+ }
99
+ interface UserInfo {
100
+ id: string;
101
+ name: string;
102
+ firstName?: string;
103
+ vanity?: string;
104
+ thumbSrc?: string;
105
+ profileUrl?: string;
106
+ gender?: string;
107
+ type?: string;
108
+ isFriend?: boolean;
109
+ isBirthday?: boolean;
110
+ [key: string]: any;
111
+ }
112
+ interface AppStateEntry {
113
+ key: string;
114
+ value: string;
115
+ domain?: string;
116
+ path?: string;
117
+ expires?: number;
118
+ [key: string]: any;
119
+ }
120
+ type MiddlewareFn = (event: any, api: any, next: () => void) => void | Promise<void>;
121
+ interface FcaClient {
122
+ messages: {
123
+ send: (message: string | MessagePayload, threadID: string, callback?: any) => Promise<any> | any;
124
+ edit: (text: string, messageID: string, callback?: any) => Promise<any> | any;
125
+ reply: (message: string | MessagePayload, messageID: string, callback?: any) => Promise<any> | any;
126
+ unsend: (messageID: string, callback?: any) => Promise<any> | any;
127
+ forward: (messageID: string, threadID: string, callback?: any) => Promise<any> | any;
128
+ react: (reaction: string, messageID: string, callback?: any) => Promise<any> | any;
129
+ delete: (messageID: string | string[], callback?: any) => Promise<any> | any;
130
+ sendTypingIndicator: (threadID: string, callback?: any) => Promise<any> | any;
131
+ };
132
+ threads: {
133
+ getInfo: (threadID: string, callback?: any) => Promise<ThreadInfo> | any;
134
+ getList: (limit?: number, timestamp?: number, tags?: string[], callback?: any) => Promise<ThreadInfo[]> | any;
135
+ getHistory: (threadID: string, amount?: number, timestamp?: number, callback?: any) => Promise<any[]> | any;
136
+ getPictures: (threadID: string, offset?: number, limit?: number, callback?: any) => Promise<any[]> | any;
137
+ setTitle: (newTitle: string, threadID: string, callback?: any) => Promise<any> | any;
138
+ changeColor: (color: string, threadID: string, callback?: any) => Promise<any> | any;
139
+ changeEmoji: (emoji: string, threadID: string, callback?: any) => Promise<any> | any;
140
+ changeNickname: (nickname: string, threadID: string, participantID: string, callback?: any) => Promise<any> | any;
141
+ changeGroupImage: (image: any, threadID: string, callback?: any) => Promise<any> | any;
142
+ changeAdminStatus: (threadID: string, adminIDs: string | string[], adminStatus: boolean, callback?: any) => Promise<any> | any;
143
+ changeArchivedStatus: (threadID: string, archive: boolean, callback?: any) => Promise<any> | any;
144
+ addUser: (userID: string | string[], threadID: string, callback?: any) => Promise<any> | any;
145
+ removeUser: (userID: string, threadID: string, callback?: any) => Promise<any> | any;
146
+ createPoll: (title: string, options: Record<string, boolean> | string[], threadID: string, callback?: any) => Promise<any> | any;
147
+ deleteThread: (threadID: string | string[], callback?: any) => Promise<any> | any;
148
+ markAsRead: (threadID: string, callback?: any) => Promise<any> | any;
149
+ };
150
+ users: {
151
+ getInfo: (userIDs: string | string[], callback?: any) => Promise<Record<string, UserInfo>> | any;
152
+ getUserID: (name: string, callback?: any) => Promise<Array<{
153
+ id: string;
154
+ name: string;
155
+ }>> | any;
156
+ getFriendsList: (callback?: any) => Promise<any[]> | any;
157
+ block: (userID: string, callback?: any) => Promise<any> | any;
158
+ unblock: (userID: string, callback?: any) => Promise<any> | any;
159
+ };
160
+ account: {
161
+ getCurrentUserID: () => string;
162
+ getAppState: () => AppStateEntry[];
163
+ setOptions: (options: Partial<LoginOptions>) => void;
164
+ setBio: (bio: string, publishId?: boolean, callback?: any) => Promise<any> | any;
165
+ };
166
+ realtime: {
167
+ listen: (callback: (err: any, event: any) => void) => () => void;
168
+ stopListening: (callback?: any) => void;
169
+ stopListeningAsync: () => Promise<any>;
170
+ };
171
+ http: {
172
+ get: (url: string, params?: any, callback?: any) => Promise<any> | any;
173
+ post: (url: string, body?: any, callback?: any) => Promise<any> | any;
174
+ postFormData: (url: string, formData?: any, callback?: any) => Promise<any> | any;
175
+ };
176
+ scheduler: {
177
+ scheduleMessage: (message?: any, threadID?: any, timestamp?: any) => any;
178
+ };
179
+ [key: string]: any;
180
+ }
181
+ interface FcaApi {
182
+ sendMessage: (message: string | MessagePayload, threadID: string, callback?: any) => Promise<any> | any;
183
+ editMessage: (text: string, messageID: string, callback?: any) => Promise<any> | any;
184
+ replyMessage: (message: string | MessagePayload, messageID: string, callback?: any) => Promise<any> | any;
185
+ unsendMessage: (messageID: string, callback?: any) => Promise<any> | any;
186
+ setMessageReaction: (reaction: string, messageID: string, callback?: any, force?: boolean) => Promise<any> | any;
187
+ sendTypingIndicator: (threadID: string, callback?: any) => ((callback?: any) => void) | Promise<any> | any;
188
+ deleteMessage: (messageID: string | string[], callback?: any) => Promise<any> | any;
189
+ forwardAttachment: (attachmentID: string, threadID: string, callback?: any) => Promise<any> | any;
190
+ getThreadInfo: (threadID: string, callback?: any) => Promise<ThreadInfo> | any;
191
+ getThreadList: (limit?: number, timestamp?: number, tags?: string[], callback?: any) => Promise<ThreadInfo[]> | any;
192
+ getThreadHistory: (threadID: string, amount?: number, timestamp?: number, callback?: any) => Promise<any[]> | any;
193
+ getThreadPictures: (threadID: string, offset?: number, limit?: number, callback?: any) => Promise<any[]> | any;
194
+ setTitle: (newTitle: string, threadID: string, callback?: any) => Promise<any> | any;
195
+ changeThreadColor: (color: string, threadID: string, callback?: any) => Promise<any> | any;
196
+ changeThreadEmoji: (emoji: string, threadID: string, callback?: any) => Promise<any> | any;
197
+ changeNickname: (nickname: string, threadID: string, participantID: string, callback?: any) => Promise<any> | any;
198
+ changeGroupImage: (image: any, threadID: string, callback?: any) => Promise<any> | any;
199
+ changeAdminStatus: (threadID: string, adminIDs: string | string[], adminStatus: boolean, callback?: any) => Promise<any> | any;
200
+ changeArchivedStatus: (threadID: string, archive: boolean, callback?: any) => Promise<any> | any;
201
+ addUserToGroup: (userID: string | string[], threadID: string, callback?: any) => Promise<any> | any;
202
+ removeUserFromGroup: (userID: string, threadID: string, callback?: any) => Promise<any> | any;
203
+ createPoll: (title: string, options: Record<string, boolean> | string[], threadID: string, callback?: any) => Promise<any> | any;
204
+ deleteThread: (threadID: string | string[], callback?: any) => Promise<any> | any;
205
+ markAsRead: (threadID: string, callback?: any) => Promise<any> | any;
206
+ markAsReadAll: (callback?: any) => Promise<any> | any;
207
+ markAsSeen: (seen?: boolean, callback?: any) => Promise<any> | any;
208
+ markAsDelivered: (threadID: string, messageID: string, callback?: any) => Promise<any> | any;
209
+ getUserInfo: (userIDs: string | string[], callback?: any) => Promise<Record<string, UserInfo>> | any;
210
+ getUserID: (name: string, callback?: any) => Promise<Array<{
211
+ id: string;
212
+ name: string;
213
+ }>> | any;
214
+ getFriendsList: (callback?: any) => Promise<any[]> | any;
215
+ blockUser: (userID: string, callback?: any) => Promise<any> | any;
216
+ unblockUser: (userID: string, callback?: any) => Promise<any> | any;
217
+ getCurrentUserID: () => string;
218
+ getAppState: () => AppStateEntry[];
219
+ setOptions: (options: Partial<LoginOptions>) => void;
220
+ setBio: (bio: string, publishId?: boolean, callback?: any) => Promise<any> | any;
221
+ listenMqtt: (callback: (err: any, event: any) => void) => () => void;
222
+ stopListening: (callback?: any) => void;
223
+ stopListeningAsync: () => Promise<any>;
224
+ useMiddleware: (fn: MiddlewareFn) => void;
225
+ removeMiddleware: (fn: MiddlewareFn) => void;
226
+ clearMiddleware: () => void;
227
+ listMiddleware: () => MiddlewareFn[];
228
+ setMiddlewareEnabled: (enabled: boolean) => boolean;
229
+ httpGet: (url: string, params?: any, callback?: any) => Promise<any> | any;
230
+ httpPost: (url: string, body?: any, callback?: any) => Promise<any> | any;
231
+ postFormData: (url: string, formData?: any, callback?: any) => Promise<any> | any;
232
+ handleReply: Map<string, any>;
233
+ handleReaction: Map<string, any>;
234
+ handleSchedule: Map<string, any>;
235
+ client?: FcaClient;
236
+ messages?: any;
237
+ threads?: any;
238
+ users?: any;
239
+ account?: any;
240
+ realtime?: any;
241
+ http?: any;
242
+ scheduler?: any;
243
+ [key: string]: any;
244
+ }
245
+ interface FcaLoginContext {
246
+ api: FcaApi;
247
+ userID: string;
248
+ fbid?: string;
249
+ }
250
+
251
+ declare function login(credentials?: FcaCredentials | any, options?: LoginOptions | ((err: any, ctx?: FcaLoginContext) => void), callback?: (err: any, ctx?: FcaLoginContext) => void): Promise<FcaLoginContext>;
252
+ declare function createMessengerBot(credentials?: any, options?: any): Promise<FcaLoginContext>;
253
+
254
+ declare function createFcaClient(api: any): FcaClient;
255
+ declare function attachClientFacade(api: any): FcaClient;
256
+
257
+ declare const DEFAULT_FCA_CONFIG: FcaConfig;
258
+ declare function resolveConfig(customConfig?: Partial<FcaConfig>): FcaConfig;
259
+ declare function loadConfig(configPath?: string): FcaConfig;
260
+
261
+ declare function toCookiePair(name?: string | null, value?: any): string | null;
262
+ declare function dedupeCookiePairs(pairs: string[]): string[];
263
+ declare function parseCookieHeaderString(raw?: string): string[];
264
+ declare function parseNetscapeCookieText(raw?: string): string[];
265
+ declare function normalizeCookiePayload(payload: any): string | null;
266
+ declare function cookieToAppState(cookie: any): Array<{
267
+ key: string;
268
+ value: string;
269
+ domain: string;
270
+ path: string;
271
+ expires?: number;
272
+ }>;
273
+ declare function appStateToCookie(appState: any[]): string;
274
+ declare function toNetscapeCookieText(cookies: any): string;
275
+
276
+ declare const defaultExport: typeof login & {
277
+ login: typeof login;
278
+ createMessengerBot: typeof createMessengerBot;
279
+ createFcaClient: typeof createFcaClient;
280
+ attachClientFacade: typeof attachClientFacade;
281
+ resolveConfig: typeof resolveConfig;
282
+ loadConfig: typeof loadConfig;
283
+ DEFAULT_FCA_CONFIG: FcaConfig;
284
+ toCookiePair: typeof toCookiePair;
285
+ dedupeCookiePairs: typeof dedupeCookiePairs;
286
+ parseCookieHeaderString: typeof parseCookieHeaderString;
287
+ parseNetscapeCookieText: typeof parseNetscapeCookieText;
288
+ normalizeCookiePayload: typeof normalizeCookiePayload;
289
+ cookieToAppState: typeof cookieToAppState;
290
+ appStateToCookie: typeof appStateToCookie;
291
+ toNetscapeCookieText: typeof toNetscapeCookieText;
292
+ };
293
+
294
+ export { type AntiGetInfoConfig, type AppStateEntry, type CheckUpdateConfig, DEFAULT_FCA_CONFIG, type FcaApi, type FcaClient, type FcaConfig, type FcaCredentials, type FcaLoginContext, type LoginOptions, type MessagePayload, type MiddlewareFn, type MqttConfig, type RemoteControlConfig, type ThreadCacheConfig, type ThreadInfo, type UserInfo, appStateToCookie, attachClientFacade, cookieToAppState, createFcaClient, createMessengerBot, dedupeCookiePairs, defaultExport as default, loadConfig, login, normalizeCookiePayload, parseCookieHeaderString, parseNetscapeCookieText, resolveConfig, toCookiePair, toNetscapeCookieText };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ module.exports = require("./cjs.cjs");