@hyperbytes/wappler-imap-manager 1.0.6 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbytes/wappler-imap-manager",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "IMAP eMail Management for Wappler",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -14,6 +14,9 @@
14
14
  "wappler",
15
15
  "node"
16
16
  ],
17
+ "scripts": {
18
+ "postinstall": "node scripts/copyFiles.js"
19
+ },
17
20
  "dependencies": {
18
21
  "imap": "^0.8.0",
19
22
  "mailparser": "^3.7.2",
@@ -0,0 +1,26 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ // Define Source and Destination Directories
4
+ const srcDir = path.join(__dirname, '../server_connect');
5
+ const destDir = path.join(__dirname, '../../../../extensions/server_connect');
6
+
7
+ // Get All Subdirectories in Source
8
+ const subDirs = fs.readdirSync(srcDir, { withFileTypes: true })
9
+ .filter(dirent => dirent.isDirectory())
10
+ .map(dirent => dirent.name);
11
+
12
+ // Loop Through Each Subdirectory
13
+ for (const subDir of subDirs) {
14
+
15
+ // 🛠️ Build Full Paths for Source and Destination
16
+ const srcSubDir = path.join(srcDir, subDir);
17
+ const destSubDir = path.join(destDir, subDir);
18
+
19
+ // Create Destination Folder If It Doesn’t Exist
20
+ if (!fs.existsSync(destSubDir)) {
21
+ fs.mkdirSync(destSubDir, { recursive: true });
22
+ }
23
+ // Copy Contents from Source to Destination
24
+ fs.copySync(srcSubDir, destSubDir, { overwrite: true });
25
+ }
26
+