@thangnm.nip/arouter 0.1.2 → 0.1.4
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +5 -5
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/(dashboard)/mitm/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/console-logs/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/locale/route.js +2 -2
- package/.next/standalone/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.html +1 -1
- package/.next/standalone/.next/server/app/mitm.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/mitm.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +5 -5
- package/.next/standalone/.next/server/chunks/411.js +1 -1
- package/.next/standalone/.next/server/middleware.js +2 -2
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{702-90a93bbee38dba8f.js → 702-0864796c00fc702e.js} +1 -1
- package/.next/standalone/node_modules/node-forge/LICENSE +331 -0
- package/.next/standalone/node_modules/node-forge/README.md +2071 -0
- package/.next/standalone/node_modules/node-forge/dist/forge.all.min.js +2 -0
- package/.next/standalone/node_modules/node-forge/dist/forge.all.min.js.map +1 -0
- package/.next/standalone/node_modules/node-forge/dist/forge.min.js +2 -0
- package/.next/standalone/node_modules/node-forge/dist/forge.min.js.map +1 -0
- package/.next/standalone/node_modules/node-forge/dist/prime.worker.min.js +2 -0
- package/.next/standalone/node_modules/node-forge/dist/prime.worker.min.js.map +1 -0
- package/.next/standalone/node_modules/node-forge/flash/swf/SocketPool.swf +0 -0
- package/.next/standalone/node_modules/node-forge/lib/aes.js +1091 -0
- package/.next/standalone/node_modules/node-forge/lib/aesCipherSuites.js +282 -0
- package/.next/standalone/node_modules/node-forge/lib/asn1-validator.js +91 -0
- package/.next/standalone/node_modules/node-forge/lib/asn1.js +1503 -0
- package/.next/standalone/node_modules/node-forge/lib/baseN.js +186 -0
- package/.next/standalone/node_modules/node-forge/lib/cipher.js +230 -0
- package/.next/standalone/node_modules/node-forge/lib/cipherModes.js +999 -0
- package/.next/standalone/node_modules/node-forge/lib/des.js +496 -0
- package/.next/standalone/node_modules/node-forge/lib/ed25519.js +1072 -0
- package/.next/standalone/node_modules/node-forge/lib/forge.js +13 -0
- package/.next/standalone/node_modules/node-forge/lib/form.js +149 -0
- package/.next/standalone/node_modules/node-forge/lib/hmac.js +146 -0
- package/.next/standalone/node_modules/node-forge/lib/http.js +1346 -0
- package/.next/standalone/node_modules/node-forge/lib/index.all.js +16 -0
- package/.next/standalone/node_modules/node-forge/lib/index.js +33 -0
- package/.next/standalone/node_modules/node-forge/lib/jsbn.js +1264 -0
- package/.next/standalone/node_modules/node-forge/lib/kem.js +168 -0
- package/.next/standalone/node_modules/node-forge/lib/log.js +319 -0
- package/.next/standalone/node_modules/node-forge/lib/md.all.js +13 -0
- package/.next/standalone/node_modules/node-forge/lib/md.js +11 -0
- package/.next/standalone/node_modules/node-forge/lib/md5.js +289 -0
- package/.next/standalone/node_modules/node-forge/lib/mgf.js +12 -0
- package/.next/standalone/node_modules/node-forge/lib/mgf1.js +57 -0
- package/.next/standalone/node_modules/node-forge/lib/oids.js +179 -0
- package/.next/standalone/node_modules/node-forge/lib/pbe.js +1023 -0
- package/.next/standalone/node_modules/node-forge/lib/pbkdf2.js +211 -0
- package/.next/standalone/node_modules/node-forge/lib/pem.js +237 -0
- package/.next/standalone/node_modules/node-forge/lib/pkcs1.js +276 -0
- package/.next/standalone/node_modules/node-forge/lib/pkcs12.js +1078 -0
- package/.next/standalone/node_modules/node-forge/lib/pkcs7.js +1260 -0
- package/.next/standalone/node_modules/node-forge/lib/pkcs7asn1.js +410 -0
- package/.next/standalone/node_modules/node-forge/lib/pki.js +102 -0
- package/.next/standalone/node_modules/node-forge/lib/prime.js +297 -0
- package/.next/standalone/node_modules/node-forge/lib/prime.worker.js +168 -0
- package/.next/standalone/node_modules/node-forge/lib/prng.js +419 -0
- package/.next/standalone/node_modules/node-forge/lib/pss.js +241 -0
- package/.next/standalone/node_modules/node-forge/lib/random.js +191 -0
- package/.next/standalone/node_modules/node-forge/lib/rc2.js +410 -0
- package/.next/standalone/node_modules/node-forge/lib/rsa.js +1949 -0
- package/.next/standalone/node_modules/node-forge/lib/sha1.js +319 -0
- package/.next/standalone/node_modules/node-forge/lib/sha256.js +327 -0
- package/.next/standalone/node_modules/node-forge/lib/sha512.js +561 -0
- package/.next/standalone/node_modules/node-forge/lib/socket.js +287 -0
- package/.next/standalone/node_modules/node-forge/lib/ssh.js +236 -0
- package/.next/standalone/node_modules/node-forge/lib/tls.js +4282 -0
- package/.next/standalone/node_modules/node-forge/lib/tlssocket.js +249 -0
- package/.next/standalone/node_modules/node-forge/lib/util.js +2652 -0
- package/.next/standalone/node_modules/node-forge/lib/x509.js +3242 -0
- package/.next/standalone/node_modules/node-forge/lib/xhr.js +738 -0
- package/.next/standalone/node_modules/node-forge/package.json +123 -0
- package/.next/standalone/node_modules/node-machine-id/.babelrc +26 -0
- package/.next/standalone/node_modules/node-machine-id/.eslintignore +2 -0
- package/.next/standalone/node_modules/node-machine-id/.eslintrc +140 -0
- package/.next/standalone/node_modules/node-machine-id/.flowconfig +9 -0
- package/.next/standalone/node_modules/node-machine-id/LICENSE +21 -0
- package/.next/standalone/node_modules/node-machine-id/README.md +84 -0
- package/.next/standalone/node_modules/node-machine-id/dist/index.js +1 -0
- package/.next/standalone/node_modules/node-machine-id/index.js +80 -0
- package/.next/standalone/node_modules/node-machine-id/package.json +74 -0
- package/.next/standalone/node_modules/node-machine-id/tests/index.js +45 -0
- package/.next/standalone/node_modules/node-machine-id/types/index.d.ts +17 -0
- package/.next/standalone/node_modules/node-machine-id/webpack.config.babel.js +59 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/src/mitm/cert/generate.js +32 -0
- package/.next/standalone/src/mitm/cert/install.js +176 -0
- package/.next/standalone/src/mitm/cert/rootCA.js +173 -0
- package/.next/standalone/src/mitm/dns/dnsConfig.js +216 -0
- package/.next/standalone/src/mitm/logger.js +8 -0
- package/.next/standalone/src/mitm/manager.js +603 -0
- package/.next/standalone/src/mitm/paths.js +16 -0
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{Ws7kclTEFgfHRwd7pk9Ly → DkVxg6bby4SUixuq1vdO8}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Ws7kclTEFgfHRwd7pk9Ly → DkVxg6bby4SUixuq1vdO8}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-forge",
|
|
3
|
+
"version": "1.3.3",
|
|
4
|
+
"description": "JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.",
|
|
5
|
+
"homepage": "https://github.com/digitalbazaar/forge",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Digital Bazaar, Inc.",
|
|
8
|
+
"email": "support@digitalbazaar.com",
|
|
9
|
+
"url": "http://digitalbazaar.com/"
|
|
10
|
+
},
|
|
11
|
+
"contributors": [
|
|
12
|
+
"Dave Longley <dlongley@digitalbazaar.com>",
|
|
13
|
+
"David I. Lehn <dlehn@digitalbazaar.com>",
|
|
14
|
+
"Stefan Siegl <stesie@brokenpipe.de>",
|
|
15
|
+
"Christoph Dorn <christoph@christophdorn.com>"
|
|
16
|
+
],
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"browserify": "^16.5.2",
|
|
19
|
+
"commander": "^2.20.0",
|
|
20
|
+
"cross-env": "^5.2.1",
|
|
21
|
+
"eslint": "^7.27.0",
|
|
22
|
+
"eslint-config-digitalbazaar": "^2.8.0",
|
|
23
|
+
"express": "^4.16.2",
|
|
24
|
+
"karma": "^4.4.1",
|
|
25
|
+
"karma-browserify": "^7.0.0",
|
|
26
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
27
|
+
"karma-edge-launcher": "^0.4.2",
|
|
28
|
+
"karma-firefox-launcher": "^1.3.0",
|
|
29
|
+
"karma-ie-launcher": "^1.0.0",
|
|
30
|
+
"karma-mocha": "^1.3.0",
|
|
31
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
32
|
+
"karma-safari-launcher": "^1.0.0",
|
|
33
|
+
"karma-sauce-launcher": "^2.0.2",
|
|
34
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
35
|
+
"karma-tap-reporter": "0.0.6",
|
|
36
|
+
"karma-webpack": "^4.0.2",
|
|
37
|
+
"mocha": "^5.2.0",
|
|
38
|
+
"mocha-lcov-reporter": "^1.2.0",
|
|
39
|
+
"nodejs-websocket": "^1.7.1",
|
|
40
|
+
"nyc": "^15.1.0",
|
|
41
|
+
"opts": "^1.2.7",
|
|
42
|
+
"webpack": "^4.44.1",
|
|
43
|
+
"webpack-cli": "^3.3.12",
|
|
44
|
+
"worker-loader": "^2.0.0"
|
|
45
|
+
},
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/digitalbazaar/forge"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/digitalbazaar/forge/issues",
|
|
52
|
+
"email": "support@digitalbazaar.com"
|
|
53
|
+
},
|
|
54
|
+
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
55
|
+
"main": "lib/index.js",
|
|
56
|
+
"files": [
|
|
57
|
+
"lib/*.js",
|
|
58
|
+
"flash/swf/*.swf",
|
|
59
|
+
"dist/*.min.js",
|
|
60
|
+
"dist/*.min.js.map"
|
|
61
|
+
],
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">= 6.13.0"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"aes",
|
|
67
|
+
"asn",
|
|
68
|
+
"asn.1",
|
|
69
|
+
"cbc",
|
|
70
|
+
"crypto",
|
|
71
|
+
"cryptography",
|
|
72
|
+
"csr",
|
|
73
|
+
"des",
|
|
74
|
+
"gcm",
|
|
75
|
+
"hmac",
|
|
76
|
+
"http",
|
|
77
|
+
"https",
|
|
78
|
+
"md5",
|
|
79
|
+
"network",
|
|
80
|
+
"pkcs",
|
|
81
|
+
"pki",
|
|
82
|
+
"prng",
|
|
83
|
+
"rc2",
|
|
84
|
+
"rsa",
|
|
85
|
+
"sha1",
|
|
86
|
+
"sha256",
|
|
87
|
+
"sha384",
|
|
88
|
+
"sha512",
|
|
89
|
+
"ssh",
|
|
90
|
+
"tls",
|
|
91
|
+
"x.509",
|
|
92
|
+
"x509"
|
|
93
|
+
],
|
|
94
|
+
"scripts": {
|
|
95
|
+
"prepublish": "npm run build",
|
|
96
|
+
"build": "webpack",
|
|
97
|
+
"test-build": "webpack --config webpack-tests.config.js",
|
|
98
|
+
"test": "npm run test-node",
|
|
99
|
+
"test-node": "cross-env NODE_ENV=test mocha -t 30000 -R ${REPORTER:-spec} tests/unit/index.js",
|
|
100
|
+
"test-karma": "karma start",
|
|
101
|
+
"test-karma-sauce": "karma start karma-sauce.conf",
|
|
102
|
+
"test-server": "node tests/server.js",
|
|
103
|
+
"test-server-ws": "node tests/websockets/server-ws.js",
|
|
104
|
+
"test-server-webid": "node tests/websockets/server-webid.js",
|
|
105
|
+
"coverage": "rm -rf coverage && nyc --reporter=lcov --reporter=text-summary npm test",
|
|
106
|
+
"coverage-ci": "rm -rf coverage && nyc --reporter=lcovonly npm test",
|
|
107
|
+
"coverage-report": "nyc report",
|
|
108
|
+
"lint": "eslint *.js lib/*.js tests/*.js tests/**/*.js examples/*.js flash/*.js"
|
|
109
|
+
},
|
|
110
|
+
"nyc": {
|
|
111
|
+
"exclude": [
|
|
112
|
+
"tests"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"jspm": {
|
|
116
|
+
"format": "amd"
|
|
117
|
+
},
|
|
118
|
+
"browser": {
|
|
119
|
+
"buffer": false,
|
|
120
|
+
"crypto": false,
|
|
121
|
+
"process": false
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"development": {}
|
|
4
|
+
},
|
|
5
|
+
"presets": ["stage-0", "es2015"],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"transform-runtime",
|
|
8
|
+
"transform-regenerator",
|
|
9
|
+
"transform-decorators-legacy",
|
|
10
|
+
"transform-class-properties",
|
|
11
|
+
"transform-flow-strip-types",
|
|
12
|
+
"syntax-object-rest-spread",
|
|
13
|
+
"syntax-decorators",
|
|
14
|
+
"syntax-async-functions",
|
|
15
|
+
"array-includes",
|
|
16
|
+
["transform-async-to-module-method", {
|
|
17
|
+
"module": "bluebird",
|
|
18
|
+
"method": "coroutine"
|
|
19
|
+
}],
|
|
20
|
+
["babel-plugin-module-resolver", [
|
|
21
|
+
{ "src": "./src/", "expose": "~" },
|
|
22
|
+
{ "src": "./test", "expose": "t" }
|
|
23
|
+
]],
|
|
24
|
+
"lodash"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
env:
|
|
3
|
+
browser: true
|
|
4
|
+
node: true
|
|
5
|
+
es6: true
|
|
6
|
+
jquery: true
|
|
7
|
+
mocha: true
|
|
8
|
+
parser: "babel-eslint"
|
|
9
|
+
parserOptions:
|
|
10
|
+
ecmaVersion: 7
|
|
11
|
+
sourceType: "module"
|
|
12
|
+
ecmaFeatures:
|
|
13
|
+
arrowFunctions: true
|
|
14
|
+
blockBindings: true
|
|
15
|
+
classes: true
|
|
16
|
+
defaultParams: true
|
|
17
|
+
destructuring: true
|
|
18
|
+
forOf: false
|
|
19
|
+
generators: true
|
|
20
|
+
modules: true
|
|
21
|
+
objectLiteralComputedProperties: true
|
|
22
|
+
objectLiteralDuplicateProperties: true
|
|
23
|
+
objectLiteralShorthandMethods: true
|
|
24
|
+
objectLiteralShorthandProperties: true
|
|
25
|
+
octalLiterals: true
|
|
26
|
+
regexUFlag: true
|
|
27
|
+
regexYFlag: true
|
|
28
|
+
restParams: true
|
|
29
|
+
spread: true
|
|
30
|
+
superInFunctions: true
|
|
31
|
+
templateStrings: true
|
|
32
|
+
unicodeCodePointEscapes: true
|
|
33
|
+
globalReturn: false
|
|
34
|
+
rules:
|
|
35
|
+
indent:
|
|
36
|
+
- "error"
|
|
37
|
+
- 4
|
|
38
|
+
-
|
|
39
|
+
SwitchCase: 1
|
|
40
|
+
semi:
|
|
41
|
+
- 2
|
|
42
|
+
- "always"
|
|
43
|
+
quotes:
|
|
44
|
+
- 2
|
|
45
|
+
- "single"
|
|
46
|
+
strict:
|
|
47
|
+
- 2
|
|
48
|
+
- "never"
|
|
49
|
+
eqeqeq:
|
|
50
|
+
- 2
|
|
51
|
+
- "smart"
|
|
52
|
+
no-var: 2
|
|
53
|
+
valid-jsdoc: "error"
|
|
54
|
+
no-undef: "error"
|
|
55
|
+
no-unused-labels: "error"
|
|
56
|
+
no-unused-expressions: "error"
|
|
57
|
+
no-useless-concat: "error"
|
|
58
|
+
block-scoped-var: 2
|
|
59
|
+
camelcase:
|
|
60
|
+
- "error"
|
|
61
|
+
-
|
|
62
|
+
properties: "never"
|
|
63
|
+
comma-style:
|
|
64
|
+
- 2
|
|
65
|
+
- "last"
|
|
66
|
+
curly:
|
|
67
|
+
- 2
|
|
68
|
+
- "all"
|
|
69
|
+
dot-notation:
|
|
70
|
+
- 2
|
|
71
|
+
-
|
|
72
|
+
allowKeywords: true
|
|
73
|
+
no-caller: 2
|
|
74
|
+
no-cond-assign:
|
|
75
|
+
- 2
|
|
76
|
+
- "except-parens"
|
|
77
|
+
no-debugger: 2
|
|
78
|
+
no-extend-native: 2
|
|
79
|
+
no-extra-parens: 2
|
|
80
|
+
no-irregular-whitespace: 2
|
|
81
|
+
no-iterator: 2
|
|
82
|
+
no-loop-func: 2
|
|
83
|
+
no-multi-str: 2
|
|
84
|
+
no-new: 2
|
|
85
|
+
no-proto: 2
|
|
86
|
+
no-script-url: 2
|
|
87
|
+
no-sequences: 2
|
|
88
|
+
no-unused-vars:
|
|
89
|
+
- "error"
|
|
90
|
+
-
|
|
91
|
+
caughtErrors: "none"
|
|
92
|
+
args: "none"
|
|
93
|
+
no-with: 2
|
|
94
|
+
valid-typeof: 2
|
|
95
|
+
wrap-iife:
|
|
96
|
+
- 2
|
|
97
|
+
- "inside"
|
|
98
|
+
no-multi-spaces: "error"
|
|
99
|
+
newline-per-chained-call:
|
|
100
|
+
- "error"
|
|
101
|
+
-
|
|
102
|
+
ignoreChainWithDepth: 3
|
|
103
|
+
no-duplicate-imports:
|
|
104
|
+
- "error"
|
|
105
|
+
-
|
|
106
|
+
includeExports: true
|
|
107
|
+
no-dupe-class-members: "error"
|
|
108
|
+
no-const-assign: "error"
|
|
109
|
+
no-confusing-arrow: "error"
|
|
110
|
+
constructor-super: "error"
|
|
111
|
+
babel/generator-star-spacing: 1
|
|
112
|
+
babel/new-cap:
|
|
113
|
+
- 2
|
|
114
|
+
-
|
|
115
|
+
capIsNewExceptions:
|
|
116
|
+
- "$.Event"
|
|
117
|
+
babel/object-shorthand: 1
|
|
118
|
+
babel/arrow-parens: 1
|
|
119
|
+
babel/no-await-in-loop: 1
|
|
120
|
+
flowtype/require-parameter-type: 1
|
|
121
|
+
flowtype/require-return-type:
|
|
122
|
+
- 1
|
|
123
|
+
- "always"
|
|
124
|
+
-
|
|
125
|
+
annotateUndefined: "never"
|
|
126
|
+
flowtype/space-after-type-colon:
|
|
127
|
+
- 1
|
|
128
|
+
- "always"
|
|
129
|
+
flowtype/space-before-type-colon:
|
|
130
|
+
- 1
|
|
131
|
+
- "never"
|
|
132
|
+
flowtype/type-id-match:
|
|
133
|
+
- 1
|
|
134
|
+
- "^([A-Z][a-z0-9]+)+Type$"
|
|
135
|
+
plugins:
|
|
136
|
+
- "babel"
|
|
137
|
+
- "flowtype"
|
|
138
|
+
settings:
|
|
139
|
+
flowtype:
|
|
140
|
+
onlyFilesWithFlowAnnotation: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Aleksandr Komlev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
**Cross-platform unique machine (desktop) id discovery**
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Use cases
|
|
5
|
+
- Software restrictions
|
|
6
|
+
- Installation tracking
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
- Hardware independent
|
|
10
|
+
- Unique within the OS installation
|
|
11
|
+
- No elevated rights required
|
|
12
|
+
- No external dependencies and does not require any native bindings
|
|
13
|
+
- Cross-platform (OSx, Win, Linux)
|
|
14
|
+
|
|
15
|
+
## How it works
|
|
16
|
+
|
|
17
|
+
Module based on OS native UUID/GUID which used for internal needs.
|
|
18
|
+
|
|
19
|
+
**All others approaches requires elevated rights or much depends on hardware components, but this approach summarize the methods of selecting the most reliable unique identifier**
|
|
20
|
+
|
|
21
|
+
- **Win32/64** uses key ```MachineGuid``` in registry
|
|
22
|
+
```HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography``` **(can be changed by administrator but with unpredictable consequences)**
|
|
23
|
+
> It is generated during OS installation and won't change unless you make another OS
|
|
24
|
+
> updates or reinstall. Depending on the OS version it may contain the network adapter
|
|
25
|
+
> MAC address embedded (plus some other numbers, including random), or a pseudorandom number.
|
|
26
|
+
|
|
27
|
+
- **OSx** uses ```IOPlatformUUID``` (the same Hardware UUID)
|
|
28
|
+
``` ioreg -rd1 -c IOPlatformExpertDevice ```
|
|
29
|
+
> Value from I/O Kit registry in IOPlatformExpertDevice class
|
|
30
|
+
|
|
31
|
+
- **Linux** uses ```/var/lib/dbus/machine-id``` **(can be changed by ```root``` but with unpredictable consequences)**
|
|
32
|
+
http://man7.org/linux/man-pages/man5/machine-id.5.html
|
|
33
|
+
> The /var/lib/dbus/machine-id file contains the unique machine ID of the local
|
|
34
|
+
> system that is set during installation. The machine ID is a single
|
|
35
|
+
> newline-terminated, hexadecimal, 32-character, lowercase machine ID
|
|
36
|
+
> string. When decoded from hexadecimal, this corresponds with a
|
|
37
|
+
> 16-byte/128-bit string.
|
|
38
|
+
>
|
|
39
|
+
> The machine ID is usually generated from a random source during
|
|
40
|
+
> system installation and stays constant for all subsequent boots.
|
|
41
|
+
> Optionally, for stateless systems, it is generated during runtime at
|
|
42
|
+
> early boot if it is found to be empty.
|
|
43
|
+
>
|
|
44
|
+
> The machine ID does not change based on user configuration or when
|
|
45
|
+
> hardware is replaced.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
```
|
|
50
|
+
npm install node-machine-id
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
### Function: machineId(original)
|
|
55
|
+
- **original** ```<Boolean>```, If ```true``` return original value of machine id, otherwise return hashed value (sha-256), default: ```false```
|
|
56
|
+
|
|
57
|
+
### Function: machineIdSync(original);
|
|
58
|
+
- syncronous version of ```machineId```
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
import {machineId, machineIdSync} from 'node-machine-id';
|
|
62
|
+
|
|
63
|
+
// Asyncronous call with async/await or Promise
|
|
64
|
+
|
|
65
|
+
async function getMachineId() {
|
|
66
|
+
let id = await machineId();
|
|
67
|
+
...
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
machineId().then((id) => {
|
|
71
|
+
...
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
// Syncronous call
|
|
75
|
+
|
|
76
|
+
let id = machineIdSync()
|
|
77
|
+
// id = c24b0fe51856497eebb6a2bfcd120247aac0d6334d670bb92e09a00ce8169365
|
|
78
|
+
let id = machineIdSync({original: true})
|
|
79
|
+
// id = 98912984-c4e9-5ceb-8000-03882a0485e4
|
|
80
|
+
```
|
|
81
|
+
### Caveats
|
|
82
|
+
|
|
83
|
+
- Image-based environments have usually the same `machine-id`
|
|
84
|
+
> As a workaround you can generate new machine-ids for each instance (or container) with `dbus-uuidgen` and changed them in the respective > files: `/etc/machine-id` and `/var/lib/dbus/machine-id`. Thanks [@stefanhuber](https://github.com/stefanhuber)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("child_process"),require("crypto")):"function"==typeof define&&define.amd?define(["child_process","crypto"],n):"object"==typeof exports?exports["electron-machine-id"]=n(require("child_process"),require("crypto")):t["electron-machine-id"]=n(t.child_process,t.crypto)}(this,function(t,n){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){t.exports=r(34)},function(t,n,r){var e=r(29)("wks"),o=r(33),i=r(2).Symbol,c="function"==typeof i,u=t.exports=function(t){return e[t]||(e[t]=c&&i[t]||(c?i:o)("Symbol."+t))};u.store=e},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(9);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n,r){t.exports=!r(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(12),o=r(17);t.exports=r(4)?function(t,n,r){return e.f(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,n,r){var e=r(14);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports={}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(3),o=r(26),i=r(32),c=Object.defineProperty;n.f=r(4)?Object.defineProperty:function(t,n,r){if(e(t),n=i(n,!0),e(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(42),o=r(15);t.exports=function(t){return e(o(t))}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(9),o=r(2).document,i=e(o)&&e(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(12).f,o=r(8),i=r(1)("toStringTag");t.exports=function(t,n,r){t&&!o(t=r?t:t.prototype,i)&&e(t,i,{configurable:!0,value:n})}},function(t,n,r){var e=r(29)("keys"),o=r(33);t.exports=function(t){return e[t]||(e[t]=o(t))}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(11),o=r(1)("toStringTag"),i="Arguments"==e(function(){return arguments}()),c=function(t,n){try{return t[n]}catch(t){}};t.exports=function(t){var n,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=c(n=Object(t),o))?r:i?e(n):"Object"==(u=e(n))&&"function"==typeof n.callee?"Arguments":u}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(2),o=r(6),i=r(7),c=r(5),u="prototype",s=function(t,n,r){var f,a,p,l=t&s.F,v=t&s.G,h=t&s.S,d=t&s.P,y=t&s.B,_=t&s.W,x=v?o:o[n]||(o[n]={}),m=x[u],w=v?e:h?e[n]:(e[n]||{})[u];v&&(r=n);for(f in r)a=!l&&w&&void 0!==w[f],a&&f in x||(p=a?w[f]:r[f],x[f]=v&&"function"!=typeof w[f]?r[f]:y&&a?i(p,e):_&&w[f]==p?function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n[u]=t[u],n}(p):d&&"function"==typeof p?i(Function.call,p):p,d&&((x.virtual||(x.virtual={}))[f]=p,t&s.R&&m&&!m[f]&&c(m,f,p)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,r){t.exports=r(2).document&&document.documentElement},function(t,n,r){t.exports=!r(4)&&!r(24)(function(){return 7!=Object.defineProperty(r(16)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){"use strict";var e=r(28),o=r(23),i=r(57),c=r(5),u=r(8),s=r(10),f=r(45),a=r(18),p=r(52),l=r(1)("iterator"),v=!([].keys&&"next"in[].keys()),h="@@iterator",d="keys",y="values",_=function(){return this};t.exports=function(t,n,r,x,m,w,g){f(r,n,x);var b,O,j,S=function(t){if(!v&&t in T)return T[t];switch(t){case d:return function(){return new r(this,t)};case y:return function(){return new r(this,t)}}return function(){return new r(this,t)}},E=n+" Iterator",P=m==y,M=!1,T=t.prototype,A=T[l]||T[h]||m&&T[m],k=A||S(m),C=m?P?S("entries"):k:void 0,I="Array"==n?T.entries||A:A;if(I&&(j=p(I.call(new t)),j!==Object.prototype&&(a(j,E,!0),e||u(j,l)||c(j,l,_))),P&&A&&A.name!==y&&(M=!0,k=function(){return A.call(this)}),e&&!g||!v&&!M&&T[l]||c(T,l,k),s[n]=k,s[E]=_,m)if(b={values:P?k:S(y),keys:w?k:S(d),entries:C},g)for(O in b)O in T||i(T,O,b[O]);else o(o.P+o.F*(v||M),n,b);return b}},function(t,n){t.exports=!0},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e,o,i,c=r(7),u=r(41),s=r(25),f=r(16),a=r(2),p=a.process,l=a.setImmediate,v=a.clearImmediate,h=a.MessageChannel,d=0,y={},_="onreadystatechange",x=function(){var t=+this;if(y.hasOwnProperty(t)){var n=y[t];delete y[t],n()}},m=function(t){x.call(t.data)};l&&v||(l=function(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return y[++d]=function(){u("function"==typeof t?t:Function(t),n)},e(d),d},v=function(t){delete y[t]},"process"==r(11)(p)?e=function(t){p.nextTick(c(x,t,1))}:h?(o=new h,i=o.port2,o.port1.onmessage=m,e=c(i.postMessage,i,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts?(e=function(t){a.postMessage(t+"","*")},a.addEventListener("message",m,!1)):e=_ in f("script")?function(t){s.appendChild(f("script"))[_]=function(){s.removeChild(this),x.call(t)}}:function(t){setTimeout(c(x,t,1),0)}),t.exports={set:l,clear:v}},function(t,n,r){var e=r(20),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){var e=r(9);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}function o(){return"win32"!==process.platform?"":"ia32"===process.arch&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function i(t){return(0,l.createHash)("sha256").update(t).digest("hex")}function c(t){switch(h){case"darwin":return t.split("IOPlatformUUID")[1].split("\n")[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return t.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return t.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return t.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(t){var n=c((0,p.execSync)(y[h]).toString());return t?n:i(n)}function s(t){return new a.default(function(n,r){return(0,p.exec)(y[h],{},function(e,o,u){if(e)return r(new Error("Error while obtaining machine id: "+e.stack));var s=c(o.toString());return n(t?s:i(s))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=r(35),a=e(f);n.machineIdSync=u,n.machineId=s;var p=r(70),l=r(71),v=process,h=v.platform,d={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},y={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:d[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,r){t.exports={default:r(36),__esModule:!0}},function(t,n,r){r(66),r(68),r(69),r(67),t.exports=r(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var e=r(13),o=r(31),i=r(62);t.exports=function(t){return function(n,r,c){var u,s=e(n),f=o(s.length),a=i(c,f);if(t&&r!=r){for(;f>a;)if(u=s[a++],u!=u)return!0}else for(;f>a;a++)if((t||a in s)&&s[a]===r)return t||a||0;return!t&&-1}}},function(t,n,r){var e=r(7),o=r(44),i=r(43),c=r(3),u=r(31),s=r(64),f={},a={},n=t.exports=function(t,n,r,p,l){var v,h,d,y,_=l?function(){return t}:s(t),x=e(r,p,n?2:1),m=0;if("function"!=typeof _)throw TypeError(t+" is not iterable!");if(i(_)){for(v=u(t.length);v>m;m++)if(y=n?x(c(h=t[m])[0],h[1]):x(t[m]),y===f||y===a)return y}else for(d=_.call(t);!(h=d.next()).done;)if(y=o(d,x,h.value,n),y===f||y===a)return y};n.BREAK=f,n.RETURN=a},function(t,n){t.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},function(t,n,r){var e=r(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(10),o=r(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||i[o]===t)}},function(t,n,r){var e=r(3);t.exports=function(t,n,r,o){try{return o?n(e(r)[0],r[1]):n(r)}catch(n){var i=t.return;throw void 0!==i&&e(i.call(t)),n}}},function(t,n,r){"use strict";var e=r(49),o=r(17),i=r(18),c={};r(5)(c,r(1)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(c,{next:o(1,r)}),i(t,n+" Iterator")}},function(t,n,r){var e=r(1)("iterator"),o=!1;try{var i=[7][e]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,n){if(!n&&!o)return!1;var r=!1;try{var i=[7],c=i[e]();c.next=function(){return{done:r=!0}},i[e]=function(){return c},t(i)}catch(t){}return r}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){var e=r(2),o=r(30).set,i=e.MutationObserver||e.WebKitMutationObserver,c=e.process,u=e.Promise,s="process"==r(11)(c);t.exports=function(){var t,n,r,f=function(){var e,o;for(s&&(e=c.domain)&&e.exit();t;){o=t.fn,t=t.next;try{o()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(s)r=function(){c.nextTick(f)};else if(i){var a=!0,p=document.createTextNode("");new i(f).observe(p,{characterData:!0}),r=function(){p.data=a=!a}}else if(u&&u.resolve){var l=u.resolve();r=function(){l.then(f)}}else r=function(){o.call(e,f)};return function(e){var o={fn:e,next:void 0};n&&(n.next=o),t||(t=o,r()),n=o}}},function(t,n,r){var e=r(3),o=r(50),i=r(22),c=r(19)("IE_PROTO"),u=function(){},s="prototype",f=function(){var t,n=r(16)("iframe"),e=i.length,o=">";for(n.style.display="none",r(25).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write("<script>document.F=Object</script"+o),t.close(),f=t.F;e--;)delete f[s][i[e]];return f()};t.exports=Object.create||function(t,n){var r;return null!==t?(u[s]=e(t),r=new u,u[s]=null,r[c]=t):r=f(),void 0===n?r:o(r,n)}},function(t,n,r){var e=r(12),o=r(3),i=r(54);t.exports=r(4)?Object.defineProperties:function(t,n){o(t);for(var r,c=i(n),u=c.length,s=0;u>s;)e.f(t,r=c[s++],n[r]);return t}},function(t,n,r){var e=r(55),o=r(17),i=r(13),c=r(32),u=r(8),s=r(26),f=Object.getOwnPropertyDescriptor;n.f=r(4)?f:function(t,n){if(t=i(t),n=c(n,!0),s)try{return f(t,n)}catch(t){}if(u(t,n))return o(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(8),o=r(63),i=r(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),e(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},function(t,n,r){var e=r(8),o=r(13),i=r(39)(!1),c=r(19)("IE_PROTO");t.exports=function(t,n){var r,u=o(t),s=0,f=[];for(r in u)r!=c&&e(u,r)&&f.push(r);for(;n.length>s;)e(u,r=n[s++])&&(~i(f,r)||f.push(r));return f}},function(t,n,r){var e=r(53),o=r(22);t.exports=Object.keys||function(t){return e(t,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(5);t.exports=function(t,n,r){for(var o in n)r&&t[o]?t[o]=n[o]:e(t,o,n[o]);return t}},function(t,n,r){t.exports=r(5)},function(t,n,r){var e=r(9),o=r(3),i=function(t,n){if(o(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,e){try{e=r(7)(Function.call,r(51).f(Object.prototype,"__proto__").set,2),e(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,r){return i(t,r),n?t.__proto__=r:e(t,r),t}}({},!1):void 0),check:i}},function(t,n,r){"use strict";var e=r(2),o=r(6),i=r(12),c=r(4),u=r(1)("species");t.exports=function(t){var n="function"==typeof o[t]?o[t]:e[t];c&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,r){var e=r(3),o=r(14),i=r(1)("species");t.exports=function(t,n){var r,c=e(t).constructor;return void 0===c||void 0==(r=e(c)[i])?n:o(r)}},function(t,n,r){var e=r(20),o=r(15);t.exports=function(t){return function(n,r){var i,c,u=String(o(n)),s=e(r),f=u.length;return s<0||s>=f?t?"":void 0:(i=u.charCodeAt(s),i<55296||i>56319||s+1===f||(c=u.charCodeAt(s+1))<56320||c>57343?t?u.charAt(s):i:t?u.slice(s,s+2):(i-55296<<10)+(c-56320)+65536)}}},function(t,n,r){var e=r(20),o=Math.max,i=Math.min;t.exports=function(t,n){return t=e(t),t<0?o(t+n,0):i(t,n)}},function(t,n,r){var e=r(15);t.exports=function(t){return Object(e(t))}},function(t,n,r){var e=r(21),o=r(1)("iterator"),i=r(10);t.exports=r(6).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[e(t)]}},function(t,n,r){"use strict";var e=r(37),o=r(47),i=r(10),c=r(13);t.exports=r(27)(Array,"Array",function(t,n){this._t=c(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):"keys"==n?o(0,r):"values"==n?o(0,t[r]):o(0,[r,t[r]])},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries")},function(t,n){},function(t,n,r){"use strict";var e,o,i,c=r(28),u=r(2),s=r(7),f=r(21),a=r(23),p=r(9),l=(r(3),r(14)),v=r(38),h=r(40),d=(r(58).set,r(60)),y=r(30).set,_=r(48)(),x="Promise",m=u.TypeError,w=u.process,g=u[x],w=u.process,b="process"==f(w),O=function(){},j=!!function(){try{var t=g.resolve(1),n=(t.constructor={})[r(1)("species")]=function(t){t(O,O)};return(b||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof n}catch(t){}}(),S=function(t,n){return t===n||t===g&&n===i},E=function(t){var n;return!(!p(t)||"function"!=typeof(n=t.then))&&n},P=function(t){return S(g,t)?new M(t):new o(t)},M=o=function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw m("Bad Promise constructor");n=t,r=e}),this.resolve=l(n),this.reject=l(r)},T=function(t){try{t()}catch(t){return{error:t}}},A=function(t,n){if(!t._n){t._n=!0;var r=t._c;_(function(){for(var e=t._v,o=1==t._s,i=0,c=function(n){var r,i,c=o?n.ok:n.fail,u=n.resolve,s=n.reject,f=n.domain;try{c?(o||(2==t._h&&I(t),t._h=1),c===!0?r=e:(f&&f.enter(),r=c(e),f&&f.exit()),r===n.promise?s(m("Promise-chain cycle")):(i=E(r))?i.call(r,u,s):u(r)):s(e)}catch(t){s(t)}};r.length>i;)c(r[i++]);t._c=[],t._n=!1,n&&!t._h&&k(t)})}},k=function(t){y.call(u,function(){var n,r,e,o=t._v;if(C(t)&&(n=T(function(){b?w.emit("unhandledRejection",o,t):(r=u.onunhandledrejection)?r({promise:t,reason:o}):(e=u.console)&&e.error&&e.error("Unhandled promise rejection",o)}),t._h=b||C(t)?2:1),t._a=void 0,n)throw n.error})},C=function(t){if(1==t._h)return!1;for(var n,r=t._a||t._c,e=0;r.length>e;)if(n=r[e++],n.fail||!C(n.promise))return!1;return!0},I=function(t){y.call(u,function(){var n;b?w.emit("rejectionHandled",t):(n=u.onrejectionhandled)&&n({promise:t,reason:t._v})})},R=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),A(n,!0))},F=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw m("Promise can't be resolved itself");(n=E(t))?_(function(){var e={_w:r,_d:!1};try{n.call(t,s(F,e,1),s(R,e,1))}catch(t){R.call(e,t)}}):(r._v=t,r._s=1,A(r,!1))}catch(t){R.call({_w:r,_d:!1},t)}}};j||(g=function(t){v(this,g,x,"_h"),l(t),e.call(this);try{t(s(F,this,1),s(R,this,1))}catch(t){R.call(this,t)}},e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=r(56)(g.prototype,{then:function(t,n){var r=P(d(this,g));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=b?w.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&A(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),M=function(){var t=new e;this.promise=t,this.resolve=s(F,t,1),this.reject=s(R,t,1)}),a(a.G+a.W+a.F*!j,{Promise:g}),r(18)(g,x),r(59)(x),i=r(6)[x],a(a.S+a.F*!j,x,{reject:function(t){var n=P(this),r=n.reject;return r(t),n.promise}}),a(a.S+a.F*(c||!j),x,{resolve:function(t){if(t instanceof g&&S(t.constructor,this))return t;var n=P(this),r=n.resolve;return r(t),n.promise}}),a(a.S+a.F*!(j&&r(46)(function(t){g.all(t).catch(O)})),x,{all:function(t){var n=this,r=P(n),e=r.resolve,o=r.reject,i=T(function(){var r=[],i=0,c=1;h(t,!1,function(t){var u=i++,s=!1;r.push(void 0),c++,n.resolve(t).then(function(t){s||(s=!0,r[u]=t,--c||e(r))},o)}),--c||e(r)});return i&&o(i.error),r.promise},race:function(t){var n=this,r=P(n),e=r.reject,o=T(function(){h(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return o&&e(o.error),r.promise}})},function(t,n,r){"use strict";var e=r(61)(!0);r(27)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){r(65);for(var e=r(2),o=r(5),i=r(10),c=r(1)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],s=0;s<5;s++){var f=u[s],a=e[f],p=a&&a.prototype;p&&!p[c]&&o(p,c,f),i[f]=i.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import {exec, execSync} from 'child_process';
|
|
3
|
+
import {createHash} from 'crypto';
|
|
4
|
+
|
|
5
|
+
let {platform}: Object = process,
|
|
6
|
+
win32RegBinPath = {
|
|
7
|
+
native: '%windir%\\System32',
|
|
8
|
+
mixed: '%windir%\\sysnative\\cmd.exe /c %windir%\\System32'
|
|
9
|
+
},
|
|
10
|
+
guid: Object = {
|
|
11
|
+
darwin: 'ioreg -rd1 -c IOPlatformExpertDevice',
|
|
12
|
+
win32: `${win32RegBinPath[isWindowsProcessMixedOrNativeArchitecture()]}\\REG.exe ` +
|
|
13
|
+
'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography ' +
|
|
14
|
+
'/v MachineGuid',
|
|
15
|
+
linux: '( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :',
|
|
16
|
+
freebsd: 'kenv -q smbios.system.uuid || sysctl -n kern.hostuuid'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function isWindowsProcessMixedOrNativeArchitecture(): string {
|
|
20
|
+
// detect if the node binary is the same arch as the Windows OS.
|
|
21
|
+
// or if this is 32 bit node on 64 bit windows.
|
|
22
|
+
if(process.platform !== 'win32') {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
if( process.arch === 'ia32' && process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432') ) {
|
|
26
|
+
return 'mixed';
|
|
27
|
+
}
|
|
28
|
+
return 'native';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function hash(guid: string): string {
|
|
32
|
+
return createHash('sha256').update(guid).digest('hex');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function expose(result: string): string {
|
|
36
|
+
switch (platform) {
|
|
37
|
+
case 'darwin':
|
|
38
|
+
return result
|
|
39
|
+
.split('IOPlatformUUID')[1]
|
|
40
|
+
.split('\n')[0].replace(/\=|\s+|\"/ig, '')
|
|
41
|
+
.toLowerCase();
|
|
42
|
+
case 'win32':
|
|
43
|
+
return result
|
|
44
|
+
.toString()
|
|
45
|
+
.split('REG_SZ')[1]
|
|
46
|
+
.replace(/\r+|\n+|\s+/ig, '')
|
|
47
|
+
.toLowerCase();
|
|
48
|
+
case 'linux':
|
|
49
|
+
return result
|
|
50
|
+
.toString()
|
|
51
|
+
.replace(/\r+|\n+|\s+/ig, '')
|
|
52
|
+
.toLowerCase();
|
|
53
|
+
case 'freebsd':
|
|
54
|
+
return result
|
|
55
|
+
.toString()
|
|
56
|
+
.replace(/\r+|\n+|\s+/ig, '')
|
|
57
|
+
.toLowerCase();
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function machineIdSync(original: boolean): string {
|
|
64
|
+
let id: string = expose(execSync(guid[platform]).toString());
|
|
65
|
+
return original ? id : hash(id);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function machineId(original: boolean): Promise<string> {
|
|
69
|
+
return new Promise((resolve: Function, reject: Function): Object => {
|
|
70
|
+
return exec(guid[platform], {}, (err: any, stdout: any, stderr: any) => {
|
|
71
|
+
if (err) {
|
|
72
|
+
return reject(
|
|
73
|
+
new Error(`Error while obtaining machine id: ${err.stack}`)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
let id: string = expose(stdout.toString());
|
|
77
|
+
return resolve(original ? id : hash(id));
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-machine-id",
|
|
3
|
+
"version": "1.1.12",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./types/index.d.ts",
|
|
6
|
+
"description": "Unique machine (desktop) id (no admin privileges required).",
|
|
7
|
+
"author": "Aleksandr Komlev",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git@github.com:automation-stack/node-machine-id.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"unique id",
|
|
15
|
+
"license",
|
|
16
|
+
"trial",
|
|
17
|
+
"user license",
|
|
18
|
+
"user id",
|
|
19
|
+
"machine id",
|
|
20
|
+
"unique platform id",
|
|
21
|
+
"node platform id",
|
|
22
|
+
"unique identifier",
|
|
23
|
+
"restrictions",
|
|
24
|
+
"electron id",
|
|
25
|
+
"nw.js id"
|
|
26
|
+
],
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/automation-stack/node-machine-id/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/automation-stack/node-machine-id#readme",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "WEBPACK=node_modules/webpack/bin/webpack.js && $WEBPACK --config webpack.config.babel.js",
|
|
33
|
+
"prepublish": "npm run test",
|
|
34
|
+
"lint": "node_modules/eslint/bin/eslint.js -c .eslintrc ./src",
|
|
35
|
+
"test": "node_modules/mocha/bin/mocha --compilers js:babel-core/register ./tests"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"babel-cli": "^6.18.0",
|
|
39
|
+
"babel-core": "^6.21.0",
|
|
40
|
+
"babel-eslint": "^7.1.1",
|
|
41
|
+
"babel-loader": "^6.2.4",
|
|
42
|
+
"babel-plugin-array-includes": "^2.0.3",
|
|
43
|
+
"babel-plugin-lodash": "^2.2.1",
|
|
44
|
+
"babel-plugin-module-resolver": "^2.4.0",
|
|
45
|
+
"babel-plugin-syntax-async-functions": "^6.5.0",
|
|
46
|
+
"babel-plugin-syntax-decorators": "^6.5.0",
|
|
47
|
+
"babel-plugin-syntax-flow": "^6.8.0",
|
|
48
|
+
"babel-plugin-syntax-object-rest-spread": "^6.5.0",
|
|
49
|
+
"babel-plugin-transform-async-to-module-method": "^6.7.0",
|
|
50
|
+
"babel-plugin-transform-class-properties": "^6.6.0",
|
|
51
|
+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
|
52
|
+
"babel-plugin-transform-flow-strip-types": "^6.8.0",
|
|
53
|
+
"babel-plugin-transform-regenerator": "^6.6.5",
|
|
54
|
+
"babel-plugin-transform-runtime": "^6.6.0",
|
|
55
|
+
"babel-polyfill": "^6.7.2",
|
|
56
|
+
"babel-preset-es2015": "^6.6.0",
|
|
57
|
+
"babel-preset-stage-0": "^6.5.0",
|
|
58
|
+
"babel-runtime": "^6.6.1",
|
|
59
|
+
"bundlesize": "^0.6.1",
|
|
60
|
+
"chai": "^3.5.0",
|
|
61
|
+
"copy-webpack-plugin": "^1.1.1",
|
|
62
|
+
"eslint": "^2.6.0",
|
|
63
|
+
"eslint-loader": "^1.3.0",
|
|
64
|
+
"eslint-plugin-babel": "^3.2.0",
|
|
65
|
+
"eslint-plugin-flowtype": "^2.3.0",
|
|
66
|
+
"estraverse-fb": "^1.3.1",
|
|
67
|
+
"html-webpack-plugin": "^2.10.0",
|
|
68
|
+
"json-loader": "^0.5.4",
|
|
69
|
+
"mocha": "^2.4.5",
|
|
70
|
+
"raw-loader": "^0.5.1",
|
|
71
|
+
"source-map-support": "^0.4.0",
|
|
72
|
+
"webpack": "1.14.0"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {assert} from 'chai';
|
|
2
|
+
import {machineId, machineIdSync} from '../dist/index';
|
|
3
|
+
|
|
4
|
+
let {platform} = process,
|
|
5
|
+
originalPattern = {
|
|
6
|
+
darwin: /^[0-9,A-z]{8}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{12}$/,
|
|
7
|
+
win32: /^[0-9,A-z]{8}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{12}$/,
|
|
8
|
+
linux: /^[0-9,A-z]{32}$/,
|
|
9
|
+
freebsd: /^[0-9,A-z]{8}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{4}-[0-9,A-z]{12}$/
|
|
10
|
+
},
|
|
11
|
+
hashPattern = /^[0-9,A-z]{64}$/;
|
|
12
|
+
|
|
13
|
+
describe('Async call: machineId({original: true})', function() {
|
|
14
|
+
it('should return original unique id', async () => {
|
|
15
|
+
let id = await machineId({original: true});
|
|
16
|
+
assert.match(id, originalPattern[platform]);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('Sync call: machineIdSync({original: true})', function() {
|
|
21
|
+
it('should return original unique id', () => {
|
|
22
|
+
assert.match(machineIdSync({original: true}), originalPattern[platform]);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('Async call: machineId()', function() {
|
|
27
|
+
it('should return unique sha256-hash', async () => {
|
|
28
|
+
let id = await machineId();
|
|
29
|
+
assert.match(id, hashPattern);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('Sync call: machineIdSync()', function() {
|
|
34
|
+
it('should return unique sha256-hash', () => {
|
|
35
|
+
assert.match(machineIdSync(), hashPattern);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('CommonJS imports', function () {
|
|
40
|
+
it('should return function machineIdSync, machineId', function () {
|
|
41
|
+
let __module__ = require('../dist/index');
|
|
42
|
+
assert.isFunction(__module__.machineId);
|
|
43
|
+
assert.isFunction(__module__.machineIdSync);
|
|
44
|
+
});
|
|
45
|
+
});
|