node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

26
server/node_modules/node-machine-id/.babelrc generated vendored Normal file
View File

@@ -0,0 +1,26 @@
{
"env": {
"development": {}
},
"presets": ["stage-0", "es2015"],
"plugins": [
"transform-runtime",
"transform-regenerator",
"transform-decorators-legacy",
"transform-class-properties",
"transform-flow-strip-types",
"syntax-object-rest-spread",
"syntax-decorators",
"syntax-async-functions",
"array-includes",
["transform-async-to-module-method", {
"module": "bluebird",
"method": "coroutine"
}],
["babel-plugin-module-resolver", [
{ "src": "./src/", "expose": "~" },
{ "src": "./test", "expose": "t" }
]],
"lodash"
]
}

2
server/node_modules/node-machine-id/.eslintignore generated vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
dist/

140
server/node_modules/node-machine-id/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,140 @@
---
env:
browser: true
node: true
es6: true
jquery: true
mocha: true
parser: "babel-eslint"
parserOptions:
ecmaVersion: 7
sourceType: "module"
ecmaFeatures:
arrowFunctions: true
blockBindings: true
classes: true
defaultParams: true
destructuring: true
forOf: false
generators: true
modules: true
objectLiteralComputedProperties: true
objectLiteralDuplicateProperties: true
objectLiteralShorthandMethods: true
objectLiteralShorthandProperties: true
octalLiterals: true
regexUFlag: true
regexYFlag: true
restParams: true
spread: true
superInFunctions: true
templateStrings: true
unicodeCodePointEscapes: true
globalReturn: false
rules:
indent:
- "error"
- 4
-
SwitchCase: 1
semi:
- 2
- "always"
quotes:
- 2
- "single"
strict:
- 2
- "never"
eqeqeq:
- 2
- "smart"
no-var: 2
valid-jsdoc: "error"
no-undef: "error"
no-unused-labels: "error"
no-unused-expressions: "error"
no-useless-concat: "error"
block-scoped-var: 2
camelcase:
- "error"
-
properties: "never"
comma-style:
- 2
- "last"
curly:
- 2
- "all"
dot-notation:
- 2
-
allowKeywords: true
no-caller: 2
no-cond-assign:
- 2
- "except-parens"
no-debugger: 2
no-extend-native: 2
no-extra-parens: 2
no-irregular-whitespace: 2
no-iterator: 2
no-loop-func: 2
no-multi-str: 2
no-new: 2
no-proto: 2
no-script-url: 2
no-sequences: 2
no-unused-vars:
- "error"
-
caughtErrors: "none"
args: "none"
no-with: 2
valid-typeof: 2
wrap-iife:
- 2
- "inside"
no-multi-spaces: "error"
newline-per-chained-call:
- "error"
-
ignoreChainWithDepth: 3
no-duplicate-imports:
- "error"
-
includeExports: true
no-dupe-class-members: "error"
no-const-assign: "error"
no-confusing-arrow: "error"
constructor-super: "error"
babel/generator-star-spacing: 1
babel/new-cap:
- 2
-
capIsNewExceptions:
- "$.Event"
babel/object-shorthand: 1
babel/arrow-parens: 1
babel/no-await-in-loop: 1
flowtype/require-parameter-type: 1
flowtype/require-return-type:
- 1
- "always"
-
annotateUndefined: "never"
flowtype/space-after-type-colon:
- 1
- "always"
flowtype/space-before-type-colon:
- 1
- "never"
flowtype/type-id-match:
- 1
- "^([A-Z][a-z0-9]+)+Type$"
plugins:
- "babel"
- "flowtype"
settings:
flowtype:
onlyFilesWithFlowAnnotation: true

9
server/node_modules/node-machine-id/.flowconfig generated vendored Normal file
View File

@@ -0,0 +1,9 @@
[ignore]
.*/node_modules/.*
dist/.*
[include]
[libs]
[options]

21
server/node_modules/node-machine-id/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Aleksandr Komlev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

84
server/node_modules/node-machine-id/README.md generated vendored Normal file
View File

@@ -0,0 +1,84 @@
**Cross-platform unique machine (desktop) id discovery**
## Use cases
- Software restrictions
- Installation tracking
## Features
- Hardware independent
- Unique within the OS installation
- No elevated rights required
- No external dependencies and does not require any native bindings
- Cross-platform (OSx, Win, Linux)
## How it works
Module based on OS native UUID/GUID which used for internal needs.
**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**
- **Win32/64** uses key ```MachineGuid``` in registry
```HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography``` **(can be changed by administrator but with unpredictable consequences)**
> It is generated during OS installation and won't change unless you make another OS
> updates or reinstall. Depending on the OS version it may contain the network adapter
> MAC address embedded (plus some other numbers, including random), or a pseudorandom number.
- **OSx** uses ```IOPlatformUUID``` (the same Hardware UUID)
``` ioreg -rd1 -c IOPlatformExpertDevice ```
> Value from I/O Kit registry in IOPlatformExpertDevice class
- **Linux** uses ```/var/lib/dbus/machine-id``` **(can be changed by ```root``` but with unpredictable consequences)**
http://man7.org/linux/man-pages/man5/machine-id.5.html
> The /var/lib/dbus/machine-id file contains the unique machine ID of the local
> system that is set during installation. The machine ID is a single
> newline-terminated, hexadecimal, 32-character, lowercase machine ID
> string. When decoded from hexadecimal, this corresponds with a
> 16-byte/128-bit string.
>
> The machine ID is usually generated from a random source during
> system installation and stays constant for all subsequent boots.
> Optionally, for stateless systems, it is generated during runtime at
> early boot if it is found to be empty.
>
> The machine ID does not change based on user configuration or when
> hardware is replaced.
## Installation
```
npm install node-machine-id
```
## Usage
### Function: machineId(original)
- **original** ```<Boolean>```, If ```true``` return original value of machine id, otherwise return hashed value (sha-256), default: ```false```
### Function: machineIdSync(original);
- syncronous version of ```machineId```
```js
import {machineId, machineIdSync} from 'node-machine-id';
// Asyncronous call with async/await or Promise
async function getMachineId() {
let id = await machineId();
...
}
machineId().then((id) => {
...
})
// Syncronous call
let id = machineIdSync()
// id = c24b0fe51856497eebb6a2bfcd120247aac0d6334d670bb92e09a00ce8169365
let id = machineIdSync({original: true})
// id = 98912984-c4e9-5ceb-8000-03882a0485e4
```
### Caveats
- Image-based environments have usually the same `machine-id`
> 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)

1
server/node_modules/node-machine-id/dist/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

80
server/node_modules/node-machine-id/index.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
/* @flow */
import {exec, execSync} from 'child_process';
import {createHash} from 'crypto';
let {platform}: Object = process,
win32RegBinPath = {
native: '%windir%\\System32',
mixed: '%windir%\\sysnative\\cmd.exe /c %windir%\\System32'
},
guid: Object = {
darwin: 'ioreg -rd1 -c IOPlatformExpertDevice',
win32: `${win32RegBinPath[isWindowsProcessMixedOrNativeArchitecture()]}\\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 isWindowsProcessMixedOrNativeArchitecture(): string {
// detect if the node binary is the same arch as the Windows OS.
// or if this is 32 bit node on 64 bit windows.
if(process.platform !== 'win32') {
return '';
}
if( process.arch === 'ia32' && process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432') ) {
return 'mixed';
}
return 'native';
}
function hash(guid: string): string {
return createHash('sha256').update(guid).digest('hex');
}
function expose(result: string): string {
switch (platform) {
case 'darwin':
return result
.split('IOPlatformUUID')[1]
.split('\n')[0].replace(/\=|\s+|\"/ig, '')
.toLowerCase();
case 'win32':
return result
.toString()
.split('REG_SZ')[1]
.replace(/\r+|\n+|\s+/ig, '')
.toLowerCase();
case 'linux':
return result
.toString()
.replace(/\r+|\n+|\s+/ig, '')
.toLowerCase();
case 'freebsd':
return result
.toString()
.replace(/\r+|\n+|\s+/ig, '')
.toLowerCase();
default:
throw new Error(`Unsupported platform: ${process.platform}`);
}
}
export function machineIdSync(original: boolean): string {
let id: string = expose(execSync(guid[platform]).toString());
return original ? id : hash(id);
}
export function machineId(original: boolean): Promise<string> {
return new Promise((resolve: Function, reject: Function): Object => {
return exec(guid[platform], {}, (err: any, stdout: any, stderr: any) => {
if (err) {
return reject(
new Error(`Error while obtaining machine id: ${err.stack}`)
);
}
let id: string = expose(stdout.toString());
return resolve(original ? id : hash(id));
});
});
}

74
server/node_modules/node-machine-id/package.json generated vendored Normal file
View File

@@ -0,0 +1,74 @@
{
"name": "node-machine-id",
"version": "1.1.12",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"description": "Unique machine (desktop) id (no admin privileges required).",
"author": "Aleksandr Komlev",
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:automation-stack/node-machine-id.git"
},
"keywords": [
"unique id",
"license",
"trial",
"user license",
"user id",
"machine id",
"unique platform id",
"node platform id",
"unique identifier",
"restrictions",
"electron id",
"nw.js id"
],
"bugs": {
"url": "https://github.com/automation-stack/node-machine-id/issues"
},
"homepage": "https://github.com/automation-stack/node-machine-id#readme",
"scripts": {
"build": "WEBPACK=node_modules/webpack/bin/webpack.js && $WEBPACK --config webpack.config.babel.js",
"prepublish": "npm run test",
"lint": "node_modules/eslint/bin/eslint.js -c .eslintrc ./src",
"test": "node_modules/mocha/bin/mocha --compilers js:babel-core/register ./tests"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.4",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-lodash": "^2.2.1",
"babel-plugin-module-resolver": "^2.4.0",
"babel-plugin-syntax-async-functions": "^6.5.0",
"babel-plugin-syntax-decorators": "^6.5.0",
"babel-plugin-syntax-flow": "^6.8.0",
"babel-plugin-syntax-object-rest-spread": "^6.5.0",
"babel-plugin-transform-async-to-module-method": "^6.7.0",
"babel-plugin-transform-class-properties": "^6.6.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-plugin-transform-regenerator": "^6.6.5",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-polyfill": "^6.7.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"babel-runtime": "^6.6.1",
"bundlesize": "^0.6.1",
"chai": "^3.5.0",
"copy-webpack-plugin": "^1.1.1",
"eslint": "^2.6.0",
"eslint-loader": "^1.3.0",
"eslint-plugin-babel": "^3.2.0",
"eslint-plugin-flowtype": "^2.3.0",
"estraverse-fb": "^1.3.1",
"html-webpack-plugin": "^2.10.0",
"json-loader": "^0.5.4",
"mocha": "^2.4.5",
"raw-loader": "^0.5.1",
"source-map-support": "^0.4.0",
"webpack": "1.14.0"
}
}

45
server/node_modules/node-machine-id/tests/index.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
import {assert} from 'chai';
import {machineId, machineIdSync} from '../dist/index';
let {platform} = process,
originalPattern = {
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}$/,
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}$/,
linux: /^[0-9,A-z]{32}$/,
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}$/
},
hashPattern = /^[0-9,A-z]{64}$/;
describe('Async call: machineId({original: true})', function() {
it('should return original unique id', async () => {
let id = await machineId({original: true});
assert.match(id, originalPattern[platform]);
});
});
describe('Sync call: machineIdSync({original: true})', function() {
it('should return original unique id', () => {
assert.match(machineIdSync({original: true}), originalPattern[platform]);
});
});
describe('Async call: machineId()', function() {
it('should return unique sha256-hash', async () => {
let id = await machineId();
assert.match(id, hashPattern);
});
});
describe('Sync call: machineIdSync()', function() {
it('should return unique sha256-hash', () => {
assert.match(machineIdSync(), hashPattern);
});
});
describe('CommonJS imports', function () {
it('should return function machineIdSync, machineId', function () {
let __module__ = require('../dist/index');
assert.isFunction(__module__.machineId);
assert.isFunction(__module__.machineIdSync);
});
});

17
server/node_modules/node-machine-id/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/**
* Module based on OS native UUID/GUID which used for internal needs.
*/
declare module 'node-machine-id' {
/**
* This function gets the OS native UUID/GUID synchronously, hashed by default.
* @param {boolean} [original=false] - If true return original value of machine id, otherwise return hashed value (sha - 256)
*/
function machineIdSync(original?: boolean): string;
/**
* This function gets the OS native UUID/GUID asynchronously (recommended), hashed by default.
* @param {boolean} [original=false] - If true return original value of machine id, otherwise return hashed value (sha - 256)
*/
function machineId(original?: boolean): Promise<string>;
}

View File

@@ -0,0 +1,59 @@
import fs from 'fs';
import webpack from 'webpack';
let nodeModules = fs.readdirSync('./node_modules')
.filter((module) => {
return module !== '.bin';
})
.reduce((prev, module) => {
return Object.assign(prev, {[module]: 'commonjs ' + module});
}, {});
export default {
entry: ['./index.js'],
output: {
path: './dist',
filename: 'index.js',
library: 'electron-machine-id',
libraryTarget: 'umd'
},
target: 'electron',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true
}
},
{
test: /\.json$/,
loader: 'json'
}
]
},
plugins: [
new webpack.IgnorePlugin(/node_modules/),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
output: { comments: false },
})
],
node: {
//do not include polyfills...
//http://webpack.github.io/docs/configuration.html#node
console: false,
process: false,
child_process: false,
global: false,
buffer: false,
crypto: false,
__filename: false,
__dirname: false
},
externals: nodeModules
};