@innovatorssoft/innovators-bot2 1.2.8
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 +718 -0
- package/example.jpg +0 -0
- package/example.js +710 -0
- package/index.js +1494 -0
- package/package.json +42 -0
- package/publish-dual.js +40 -0
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@innovatorssoft/innovators-bot2",
|
|
3
|
+
"version": "1.2.8",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node example.js",
|
|
8
|
+
"publish-dual": "node publish-dual.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"whatsapp",
|
|
12
|
+
"bot",
|
|
13
|
+
"automation",
|
|
14
|
+
"baileys",
|
|
15
|
+
"whatsapp-web.js",
|
|
16
|
+
"messaging",
|
|
17
|
+
"chat",
|
|
18
|
+
"nodejs",
|
|
19
|
+
"api",
|
|
20
|
+
"group-management",
|
|
21
|
+
"qr-code",
|
|
22
|
+
"client"
|
|
23
|
+
],
|
|
24
|
+
"author": "Javed Arshad Bhatti",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/innovatorssoft/WhatsAppAPI.git"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/innovatorssoft/WhatsAppAPI?tab=readme-ov-file#whatsapp-api",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@innovatorssoft/baileys": "^7.3.5",
|
|
33
|
+
"figlet": "^1.8.0",
|
|
34
|
+
"link-preview-js": "^3.0.13",
|
|
35
|
+
"mime": "^3.0.0",
|
|
36
|
+
"mime-types": "^2.1.35",
|
|
37
|
+
"node-cache": "^5.1.2",
|
|
38
|
+
"pino": "^9.6.0",
|
|
39
|
+
"qrcode-terminal": "^0.12.0",
|
|
40
|
+
"wa-sticker-formatter": "^4.4.4"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/publish-dual.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const packagePath = path.join(__dirname, 'package.json');
|
|
6
|
+
|
|
7
|
+
// Read the original package.json
|
|
8
|
+
const originalPackage = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
9
|
+
const originalName = originalPackage.name;
|
|
10
|
+
|
|
11
|
+
console.log('š Starting dual npm publish...\n');
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// Step 1: Publish as unscoped package (innovators-bot2)
|
|
15
|
+
console.log(`š¦ Publishing as "${originalName}"...`);
|
|
16
|
+
execSync('npm publish', { stdio: 'inherit', cwd: __dirname });
|
|
17
|
+
console.log(`ā
Successfully published "${originalName}"\n`);
|
|
18
|
+
|
|
19
|
+
// Step 2: Change name to scoped package
|
|
20
|
+
const scopedName = '@innovatorssoft/innovators-bot2';
|
|
21
|
+
console.log(`š¦ Publishing as "${scopedName}"...`);
|
|
22
|
+
|
|
23
|
+
originalPackage.name = scopedName;
|
|
24
|
+
fs.writeFileSync(packagePath, JSON.stringify(originalPackage, null, 2) + '\n');
|
|
25
|
+
|
|
26
|
+
// Step 3: Publish as scoped package with public access
|
|
27
|
+
execSync('npm publish --access public', { stdio: 'inherit', cwd: __dirname });
|
|
28
|
+
console.log(`ā
Successfully published "${scopedName}"\n`);
|
|
29
|
+
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('ā Error during publish:', error.message);
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
} finally {
|
|
34
|
+
// Step 4: Always restore original package.json
|
|
35
|
+
console.log('š Restoring original package.json...');
|
|
36
|
+
originalPackage.name = originalName;
|
|
37
|
+
fs.writeFileSync(packagePath, JSON.stringify(originalPackage, null, 2) + '\n');
|
|
38
|
+
console.log('ā
Original package.json restored');
|
|
39
|
+
console.log('\nš Dual publish complete!');
|
|
40
|
+
}
|