Skip to content

Commit

Permalink
Merge pull request #586 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release 1.0.8
  • Loading branch information
MichaelTaylor3D authored Jun 2, 2022
2 parents d8852c4 + ce0824c commit 9f594d7
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 135 deletions.
204 changes: 102 additions & 102 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
{
"name": "climate-warehouse",
"version": "1.0.7",
"private": true,
"bin": "build/server.js",
"type": "module",
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"requirements-check": "node --experimental-json-modules check_node_version.js",
"start": "npx cross-env NODE_ENV=local node --experimental-specifier-resolution=node --no-warnings ./src/server.js",
"test": "npm run resetTestDb && npx cross-env NODE_ENV=test USE_SIMULATOR=true mocha tests/**/*.spec.js --reporter spec --exit --timeout 300000",
"release": "npx standard-version",
"postinstall": "npm run requirements-check",
"cleandb": "rm -f ~/.chia/climate-warehouse/data.sqlite3",
"resetTestDb": "rm -f ./test.sqlite3 && rm -f ./testMirror.sqlite3",
"resetMirrorDb": "npx sequelize-cli db:drop --env mirror",
"prepare": "husky install",
"build": "babel src --keep-file-extension --out-dir build --copy-files && cp package.json ./build",
"build-migrations": "babel migrations --keep-file-extension --out-dir dist/migrations --copy-files",
"prepare-binary": "rm -rf dist && mkdir dist",
"create-win-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-win-x64 --out-path dist",
"create-mac-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-macos-x64 --out-path dist",
"create-linux-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-linux-x64 --out-path dist"
},
"pkg": {
"scripts": "package.json",
"assets": "package.json"
},
"dependencies": {
"body-parser": "^1.19.0",
"char-spinner": "^1.0.1",
"cli-spinner": "^0.2.10",
"cli-spinners": "^2.6.1",
"cors": "^2.8.5",
"csvtojson": "^2.0.10",
"dotenv": "^10.0.0",
"express": "~4.16.1",
"express-fileupload": "^1.2.1",
"express-joi-validation": "^5.0.0",
"joi": "^17.5.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"log-update": "^4.0.0",
"mysql2": "^2.3.3",
"mysql2-promise": "^0.1.4",
"node-xlsx": "^0.21.0",
"random-hash": "^4.0.1",
"regenerator-runtime": "^0.13.9",
"request-promise": "^4.2.6",
"rxjs": "^7.5.1",
"sequelize": "^6.17.0",
"sequelize-mock": "^0.10.2",
"socket.io": "^4.4.0",
"socket.io-client": "^4.4.0",
"sqlite3": "4.1.1",
"toad-scheduler": "^1.6.0",
"updeep": "^1.2.1",
"uuidv4": "^6.2.12",
"winston": "^3.7.2",
"winston-daily-rotate-file": "^4.6.1"
},
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"babel-eslint": "^10.1.0",
"babel-plugin-module-resolver": "^4.1.0",
"chai": "^4.3.4",
"chai-http": "^4.3.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-react": "^7.26.1",
"git-authors-cli": "^1.0.36",
"husky": "^7.0.4",
"jest": "^27.3.1",
"lint-staged": "^11.2.6",
"mocha": "^9.2.0",
"prettier": "^2.4.1",
"semver": "^7.3.5",
"sinon": "^12.0.1",
"standard-version": "^9.3.2",
"supertest": "^6.1.6"
},
"standard-version": {
"skip": {
"bump": true,
"commit": true,
"tag": true
}
},
"contributors": [
"Michael Taylor <[email protected]>",
"Mike Keen <[email protected]>",
"Michael.Taylor <[email protected]>",
"Frantz Arty <[email protected]>",
"Chris Marslender <[email protected]>",
"Justin England <[email protected]>"
]
}
{
"name": "climate-warehouse",
"version": "1.0.8",
"private": true,
"bin": "build/server.js",
"type": "module",
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"requirements-check": "node --experimental-json-modules check_node_version.js",
"start": "npx cross-env NODE_ENV=local node --experimental-specifier-resolution=node --no-warnings ./src/server.js",
"test": "npm run resetTestDb && npx cross-env NODE_ENV=test USE_SIMULATOR=true mocha tests/**/*.spec.js --reporter spec --exit --timeout 300000",
"release": "npx standard-version",
"postinstall": "npm run requirements-check",
"cleandb": "rm -f ~/.chia/climate-warehouse/data.sqlite3",
"resetTestDb": "rm -f ./test.sqlite3 && rm -f ./testMirror.sqlite3",
"resetMirrorDb": "npx sequelize-cli db:drop --env mirror",
"prepare": "husky install",
"build": "babel src --keep-file-extension --out-dir build --copy-files && cp package.json ./build",
"build-migrations": "babel migrations --keep-file-extension --out-dir dist/migrations --copy-files",
"prepare-binary": "rm -rf dist && mkdir dist",
"create-win-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-win-x64 --out-path dist",
"create-mac-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-macos-x64 --out-path dist",
"create-linux-x64-dist": "npm run build && npm run prepare-binary && pkg package.json -t node16-linux-x64 --out-path dist"
},
"pkg": {
"scripts": "package.json",
"assets": "package.json"
},
"dependencies": {
"body-parser": "^1.19.0",
"char-spinner": "^1.0.1",
"cli-spinner": "^0.2.10",
"cli-spinners": "^2.6.1",
"cors": "^2.8.5",
"csvtojson": "^2.0.10",
"dotenv": "^10.0.0",
"express": "~4.16.1",
"express-fileupload": "^1.2.1",
"express-joi-validation": "^5.0.0",
"joi": "^17.5.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"log-update": "^4.0.0",
"mysql2": "^2.3.3",
"mysql2-promise": "^0.1.4",
"node-xlsx": "^0.21.0",
"random-hash": "^4.0.1",
"regenerator-runtime": "^0.13.9",
"request-promise": "^4.2.6",
"rxjs": "^7.5.1",
"sequelize": "^6.17.0",
"sequelize-mock": "^0.10.2",
"socket.io": "^4.4.0",
"socket.io-client": "^4.4.0",
"sqlite3": "4.1.1",
"toad-scheduler": "^1.6.0",
"updeep": "^1.2.1",
"uuidv4": "^6.2.12",
"winston": "^3.7.2",
"winston-daily-rotate-file": "^4.6.1"
},
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"babel-eslint": "^10.1.0",
"babel-plugin-module-resolver": "^4.1.0",
"chai": "^4.3.4",
"chai-http": "^4.3.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-react": "^7.26.1",
"git-authors-cli": "^1.0.36",
"husky": "^7.0.4",
"jest": "^27.3.1",
"lint-staged": "^11.2.6",
"mocha": "^9.2.0",
"prettier": "^2.4.1",
"semver": "^7.3.5",
"sinon": "^12.0.1",
"standard-version": "^9.3.2",
"supertest": "^6.1.6"
},
"standard-version": {
"skip": {
"bump": true,
"commit": true,
"tag": true
}
},
"contributors": [
"Michael Taylor <[email protected]>",
"Mike Keen <[email protected]>",
"Michael.Taylor <[email protected]>",
"Frantz Arty <[email protected]>",
"Chris Marslender <[email protected]>",
"Justin England <[email protected]>"
]
}
66 changes: 33 additions & 33 deletions src/utils/datalayer-utils.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
export const encodeHex = (str) => {
return Buffer.from(str).toString('hex');
};

export const decodeHex = (str) => {
return Buffer.from(str.replace('0x', ''), 'hex').toString();
};

export const decodeDataLayerResponse = (data) => {
return data.keys_values.map((item) => ({
key: decodeHex(item.key),
value: decodeHex(item.value),
}));
};

export const keyValueToChangeList = (key, value, includeDelete) => {
const changeList = [];

if (includeDelete) {
changeList.push({
action: 'delete',
key: encodeHex(key),
});
}

changeList.push({
action: 'insert',
key: encodeHex(key),
value: encodeHex(value),
});

return changeList;
};
export const encodeHex = (str) => {
return Buffer.from(str).toString('hex');
};

export const decodeHex = (str = '') => {
return Buffer.from(str.replace('0x', ''), 'hex').toString();
};

export const decodeDataLayerResponse = (data) => {
return data.keys_values.map((item) => ({
key: decodeHex(item.key),
value: decodeHex(item.value),
}));
};

export const keyValueToChangeList = (key, value, includeDelete) => {
const changeList = [];

if (includeDelete) {
changeList.push({
action: 'delete',
key: encodeHex(key),
});
}

changeList.push({
action: 'insert',
key: encodeHex(key),
value: encodeHex(value),
});

return changeList;
};

0 comments on commit 9f594d7

Please sign in to comment.