whatsapp-pi 1.0.21 → 1.0.22
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/package.json
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { useMultiFileAuthState } from '@whiskeysockets/baileys';
|
|
2
|
-
import { join
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { readFile, writeFile, mkdir, rm } from 'fs/promises';
|
|
4
|
+
import { homedir } from 'os';
|
|
5
5
|
import { SessionStatus } from '../models/whatsapp.types.js';
|
|
6
6
|
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
7
|
export interface Contact {
|
|
10
8
|
number: string;
|
|
11
9
|
name?: string;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export class SessionManager {
|
|
15
|
-
// Data is stored in
|
|
16
|
-
private readonly baseDir = join(
|
|
13
|
+
// Data is stored in the user's home directory to persist across updates
|
|
14
|
+
private readonly baseDir = join(homedir(), '.pi', 'whatsapp-pi');
|
|
17
15
|
private readonly authDir = join(this.baseDir, 'auth');
|
|
18
16
|
private readonly configPath = join(this.baseDir, 'config.json');
|
|
19
17
|
|