From 869515f292bc7d42da7379cc01db3bb97cdfd7ce Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Thu, 14 Mar 2019 13:37:37 +0100 Subject: [PATCH] Update NodeJS VCX Wrapper demo. - Update readme - Add logging - Generate distinct wallets on every demo run - Prefix wallet names with 'node_vcx_demo_' - Use winston logger with colorprinting Signed-off-by: Patrik Stas --- vcx/wrappers/node/README.md | 2 +- vcx/wrappers/node/demo/alice.js | 34 +++-- vcx/wrappers/node/demo/faber.js | 66 +++++---- vcx/wrappers/node/demo/logger.js | 22 +++ vcx/wrappers/node/package-lock.json | 220 ++++++++++++++++++++++++++-- vcx/wrappers/node/package.json | 15 +- 6 files changed, 295 insertions(+), 64 deletions(-) create mode 100644 vcx/wrappers/node/demo/logger.js diff --git a/vcx/wrappers/node/README.md b/vcx/wrappers/node/README.md index 09319615de..e433e9ee30 100644 --- a/vcx/wrappers/node/README.md +++ b/vcx/wrappers/node/README.md @@ -67,7 +67,7 @@ npm install - Compile LibVCX Wrapper ``` -npm compile +npm run compile ``` - Start [Dummy Cloud Agent](../../dummy-cloud-agent) - Run Faber agent, representing an institution diff --git a/vcx/wrappers/node/demo/alice.js b/vcx/wrappers/node/demo/alice.js index 7e1a12f91d..44cbc5e850 100644 --- a/vcx/wrappers/node/demo/alice.js +++ b/vcx/wrappers/node/demo/alice.js @@ -5,12 +5,15 @@ import {StateType} from "../dist/src"; import readlineSync from 'readline-sync' import sleepPromise from 'sleep-promise' import * as demoCommon from './common' +import logger from './logger' + +const utime = Math.floor(new Date() / 1000); const provisionConfig = { 'agency_url': 'http://localhost:8080', 'agency_did': 'VsKV7grR1BUE29mG2Fm2kX', 'agency_verkey': 'Hezce2UWMZ3wUhVkh2LfKSs8nDzWwzs2Win7EzNN3YaR', - 'wallet_name': 'alice_wallet', + 'wallet_name': `node_vcx_demo_alice_wallet_${utime}`, 'wallet_key': '123', 'payment_method': 'null', 'enterprise_seed': '000000000000000000000000Trustee1' @@ -21,36 +24,37 @@ const logLevel = 'warn'; async function run() { await demoCommon.initLibNullPay(); - console.log("#0 initialize rust API from NodeJS"); + logger.info("#0 initialize rust API from NodeJS"); await demoCommon.initRustApiAndLogger(logLevel); - console.log("#1 Provision an agent and wallet, get back configuration details"); + logger.info("#1 Provision an agent and wallet, get back configuration details"); let config = await demoCommon.provisionAgentInAgency(provisionConfig); - console.log("#2 Initialize libvcx with new configuration"); + logger.info("#2 Initialize libvcx with new configuration"); await demoCommon.initVcxWithProvisionedAgentConfig(config); - console.log("#9 Input faber.py invitation details"); + logger.info("#9 Input faber.py invitation details"); const details = readlineSync.question('Enter your invite details: '); const jdetails = JSON.parse(details); - console.log("#10 Convert to valid json and string and create a connection to faber"); + logger.info("#10 Convert to valid json and string and create a connection to faber"); const connection_to_faber = await Connection.createWithInvite({id: 'faber', invite: JSON.stringify(jdetails)}); await connection_to_faber.connect({data: '{"use_public_did": true}'}); await connection_to_faber.updateState(); - console.log("#11 Wait for faber.py to issue a credential offer"); + logger.info("#11 Wait for faber.py to issue a credential offer"); await sleepPromise(5000); const offers = await Credential.getOffers(connection_to_faber); - console.log(`Alice found following credentiaal offers: ${JSON.stringify(offers)}`); + logger.info(`Alice found ${offers.length} credential offers.`); + logger.debug(JSON.stringify(offers)); // Create a credential object from the credential offer const credential = await Credential.create({sourceId: 'credential', offer: JSON.stringify(offers[0])}); - console.log("#15 After receiving credential offer, send credential request"); + logger.info("#15 After receiving credential offer, send credential request"); await credential.sendRequest({connection: connection_to_faber, payment : 0}); - console.log("#16 Poll agency and accept credential offer from faber"); + logger.info("#16 Poll agency and accept credential offer from faber"); let credential_state = await credential.getState(); while (credential_state !== StateType.Accepted) { sleepPromise(2000); @@ -58,13 +62,13 @@ async function run() { credential_state = await credential.getState(); } - console.log("#22 Poll agency for a proof request"); + logger.info("#22 Poll agency for a proof request"); const requests = await DisclosedProof.getRequests(connection_to_faber); - console.log("#23 Create a Disclosed proof object from proof request"); + logger.info("#23 Create a Disclosed proof object from proof request"); const proof = await DisclosedProof.create({sourceId: 'proof', request: JSON.stringify(requests[0])}); - console.log("#24 Query for credentials in the wallet that satisfy the proof request"); + logger.info("#24 Query for credentials in the wallet that satisfy the proof request"); const credentials = await proof.getCredentials(); // Use the first available credentials to satisfy the proof request @@ -75,10 +79,10 @@ async function run() { } } - console.log("#25 Generate the proof"); + logger.info("#25 Generate the proof"); await proof.generateProof({selectedCreds: credentials, selfAttestedAttrs: {}}); - console.log("#26 Send the proof to faber"); + logger.info("#26 Send the proof to faber"); await proof.sendProof(connection_to_faber); } diff --git a/vcx/wrappers/node/demo/faber.js b/vcx/wrappers/node/demo/faber.js index 5cb4b0d9d3..53a1a4d322 100644 --- a/vcx/wrappers/node/demo/faber.js +++ b/vcx/wrappers/node/demo/faber.js @@ -7,13 +7,15 @@ import {StateType, ProofState} from "../dist/src"; import sleepPromise from 'sleep-promise' import * as demoCommon from "./common"; import {getRandomInt} from "./common"; +import logger from './logger' +const utime = Math.floor(new Date() / 1000); const provisionConfig = { 'agency_url': 'http://localhost:8080', 'agency_did': 'VsKV7grR1BUE29mG2Fm2kX', 'agency_verkey': 'Hezce2UWMZ3wUhVkh2LfKSs8nDzWwzs2Win7EzNN3YaR', - 'wallet_name': 'faber_wallet', + 'wallet_name': `node_vcx_demo_faber_wallet_${utime}`, 'wallet_key': '123', 'payment_method': 'null', 'enterprise_seed': '000000000000000000000000Trustee1' @@ -24,16 +26,18 @@ const logLevel = 'error'; async function run() { await demoCommon.initLibNullPay(); - console.log("#0 initialize rust API from NodeJS"); + logger.info("#0 initialize rust API from NodeJS"); await demoCommon.initRustApiAndLogger(logLevel); - console.log("#1 Provision an agent and wallet, get back configuration details"); + logger.info("#1 Provision an agent and wallet, get back configuration details"); + logger.debug(`Config used to provision agent in agency: ${JSON.stringify(provisionConfig, null, 2)}`); let config = await demoCommon.provisionAgentInAgency(provisionConfig); - console.log("#2 Initialize libvcx with new configuration"); + logger.info("#2 Initialize libvcx with new configuration"); + logger.debug(`${JSON.stringify(config, null, 2)}`); await demoCommon.initVcxWithProvisionedAgentConfig(config); - console.log("#3 Create a new schema on the ledger"); + logger.info("#3 Create a new schema on the ledger"); const version = `${getRandomInt(1, 101)}.${getRandomInt(1, 101)}.${getRandomInt(1, 101)}`; const schemaData = { data: { @@ -47,9 +51,9 @@ async function run() { const schema = await Schema.create(schemaData); const schemaId = await schema.getSchemaId(); - console.log(`Created schema with id ${schemaId}`); + logger.info(`Created schema with id ${schemaId}`); - console.log("#4 Create a new credential definition on the ledger"); + logger.info("#4 Create a new credential definition on the ledger"); const data = { name: 'DemoCredential123', paymentHandle: 0, @@ -63,29 +67,29 @@ async function run() { const cred_def = await CredentialDef.create(data); const cred_def_id = await cred_def.getCredDefId(); const credDefHandle = cred_def.handle; - console.log(`Created credential with id ${cred_def_id} and handle ${credDefHandle}`); + logger.info(`Created credential with id ${cred_def_id} and handle ${credDefHandle}`); - console.log("#5 Create a connection to alice and print out the invite details"); + logger.info("#5 Create a connection to alice and print out the invite details"); const connectionToAlice = await Connection.create({id: 'alice'}); await connectionToAlice.connect('{"use_public_did": true}'); await connectionToAlice.updateState(); const details = await connectionToAlice.inviteDetails(false); - console.log("\n\n**invite details**"); - console.log("**You'll ge queried to paste this data to alice side of the demo. This is invitation to connect.**"); - console.log("**It's assumed this is obtained by Alice from Faber by some existing secure channel.**"); - console.log("**Could be on website via HTTPS, QR code scanned at Faber institution, ...**"); - console.log("\n******************\n\n"); - console.log(JSON.stringify(JSON.parse(details))); - console.log("\n\n******************\n\n"); - - console.log("#6 Polling agency and waiting for alice to accept the invitation. (start alice.py now)"); + logger.info("\n\n**invite details**"); + logger.info("**You'll ge queried to paste this data to alice side of the demo. This is invitation to connect.**"); + logger.info("**It's assumed this is obtained by Alice from Faber by some existing secure channel.**"); + logger.info("**Could be on website via HTTPS, QR code scanned at Faber institution, ...**"); + logger.info("\n******************\n\n"); + logger.info(JSON.stringify(JSON.parse(details))); + logger.info("\n\n******************\n\n"); + + logger.info("#6 Polling agency and waiting for alice to accept the invitation. (start alice.py now)"); let connection_state = await connectionToAlice.getState(); while (connection_state !== StateType.Accepted) { await sleepPromise(2000); await connectionToAlice.updateState(); connection_state = await connectionToAlice.getState(); } - console.log(`Connection to alice was Accepted!`); + logger.info(`Connection to alice was Accepted!`); const schema_attrs = { 'name': 'alice', @@ -93,7 +97,7 @@ async function run() { 'degree': 'maths', }; - console.log("#12 Create an IssuerCredential object using the schema and credential definition") + logger.info("#12 Create an IssuerCredential object using the schema and credential definition") const credentialForAlice = await IssuerCredential.create({ attr: schema_attrs, @@ -103,11 +107,11 @@ async function run() { price: '0' }); - console.log("#13 Issue credential offer to alice"); + logger.info("#13 Issue credential offer to alice"); await credentialForAlice.sendOffer(connectionToAlice); await credentialForAlice.updateState(); - console.log("#14 Poll agency and wait for alice to send a credential request"); + logger.info("#14 Poll agency and wait for alice to send a credential request"); let credential_state = await credentialForAlice.getState(); while (credential_state !== StateType.RequestReceived) { await sleepPromise(2000); @@ -115,11 +119,11 @@ async function run() { credential_state = await credentialForAlice.getState(); } - console.log("#17 Issue credential to alice"); + logger.info("#17 Issue credential to alice"); await credentialForAlice.sendCredential(connectionToAlice); - console.log("#18 Wait for alice to accept credential"); + logger.info("#18 Wait for alice to accept credential"); await credentialForAlice.updateState(); credential_state = await credentialForAlice.getState(); while (credential_state !== StateType.Accepted) { @@ -134,7 +138,7 @@ async function run() { {'name': 'degree', 'restrictions': [{'issuer_did': config['institution_did']}]} ]; - console.log("#19 Create a Proof object"); + logger.info("#19 Create a Proof object"); const proof = await Proof.create({ sourceId: "213", attrs: proofAttributes, @@ -142,10 +146,10 @@ async function run() { revocationInterval: {} }); - console.log("#20 Request proof of degree from alice"); + logger.info("#20 Request proof of degree from alice"); await proof.requestProof(connectionToAlice); - console.log("#21 Poll agency and wait for alice to provide proof"); + logger.info("#21 Poll agency and wait for alice to provide proof"); let proofState = await proof.getState(); while (proofState !== StateType.Accepted) { sleepPromise(2000); @@ -153,14 +157,14 @@ async function run() { proofState = await proof.getState(); } - console.log("#27 Process the proof provided by alice"); + logger.info("#27 Process the proof provided by alice"); await proof.getProof(connectionToAlice); - console.log("#28 Check if proof is valid"); + logger.info("#28 Check if proof is valid"); if (proof.proofState === ProofState.Verified) { - console.log("proof is verified!!") + logger.info("proof is verified!!") } else { - console.log("could not verify proof :(") + logger.info("could not verify proof :(") } } diff --git a/vcx/wrappers/node/demo/logger.js b/vcx/wrappers/node/demo/logger.js new file mode 100644 index 0000000000..0fe7645c6e --- /dev/null +++ b/vcx/wrappers/node/demo/logger.js @@ -0,0 +1,22 @@ +const { createLogger, format, transports } = require('winston'); +const { label } = format; + +const prettyFormatter = format.combine( + format.printf( + info => `${info.label} [${info.level}]: ${info.message}` + ) +); + +const logger = createLogger({ + level: 'debug', + format: format.combine( + label({ label: 'Demo Faber:' }), + format.colorize({all: true}), + prettyFormatter + ), + transports: [ + new transports.Console(), + ] +}); + +export default logger; \ No newline at end of file diff --git a/vcx/wrappers/node/package-lock.json b/vcx/wrappers/node/package-lock.json index 0a89f5fd57..24a8648296 100644 --- a/vcx/wrappers/node/package-lock.json +++ b/vcx/wrappers/node/package-lock.json @@ -1162,6 +1162,27 @@ "object-visit": "1.0.1" } }, + "color": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", + "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", + "dev": true, + "requires": { + "color-convert": "1.9.3", + "color-string": "1.5.3" + }, + "dependencies": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + } + } + }, "color-convert": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", @@ -1177,6 +1198,38 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "color-string": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "1.1.3", + "simple-swizzle": "0.2.2" + } + }, + "colornames": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz", + "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y=", + "dev": true + }, + "colors": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "dev": true + }, + "colorspace": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.1.tgz", + "integrity": "sha512-pI3btWyiuz7Ken0BWh9Elzsmv2bM9AhA7psXib4anUXy/orfZ/E0MbQwhSOG/9L8hLlalqrU0UhOuqxW1YjmVw==", + "dev": true, + "requires": { + "color": "3.0.0", + "text-hex": "1.0.0" + } + }, "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", @@ -1220,8 +1273,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true + "dev": true }, "debug": { "version": "2.6.9", @@ -1308,6 +1360,17 @@ "repeating": "2.0.1" } }, + "diagnostics": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", + "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==", + "dev": true, + "requires": { + "colorspace": "1.1.1", + "enabled": "1.0.2", + "kuler": "1.0.1" + } + }, "diff": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", @@ -1330,6 +1393,21 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "enabled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", + "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", + "dev": true, + "requires": { + "env-variable": "0.0.5" + } + }, + "env-variable": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.5.tgz", + "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1393,6 +1471,18 @@ "is-extglob": "1.0.0" } }, + "fast-safe-stringify": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", + "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==", + "dev": true + }, + "fecha": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", + "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", + "dev": true + }, "ffi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ffi/-/ffi-2.2.0.tgz", @@ -2243,6 +2333,12 @@ "kind-of": "3.2.2" } }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", @@ -2375,6 +2471,12 @@ "dev": true, "optional": true }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -2494,6 +2596,15 @@ "graceful-fs": "4.1.11" } }, + "kuler": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", + "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", + "dev": true, + "requires": { + "colornames": "1.1.1" + } + }, "loader-utils": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", @@ -2517,6 +2628,27 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "logform": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", + "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", + "dev": true, + "requires": { + "colors": "1.3.3", + "fast-safe-stringify": "2.0.6", + "fecha": "2.3.3", + "ms": "2.1.1", + "triple-beam": "1.3.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "lolex": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.0.tgz", @@ -2862,6 +2994,12 @@ "wrappy": "1.0.2" } }, + "one-time": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", + "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=", + "dev": true + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -2965,8 +3103,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true, - "optional": true + "dev": true }, "progress": { "version": "2.0.0", @@ -3007,7 +3144,6 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, - "optional": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -3022,8 +3158,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true + "dev": true } } }, @@ -3588,6 +3723,15 @@ "rechoir": "0.6.2" } }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "0.3.2" + } + }, "sinon": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.1.2.tgz", @@ -3797,6 +3941,12 @@ "extend-shallow": "3.0.2" } }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -3823,7 +3973,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "optional": true, "requires": { "safe-buffer": "5.1.2" } @@ -3864,6 +4013,12 @@ "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", "dev": true }, + "text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "dev": true + }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", @@ -3920,6 +4075,12 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "triple-beam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", + "dev": true + }, "ts-node": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.1.2.tgz", @@ -4474,8 +4635,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true + "dev": true }, "v8flags": { "version": "2.1.1", @@ -4507,6 +4667,46 @@ } } }, + "winston": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", + "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", + "dev": true, + "requires": { + "async": "2.6.1", + "diagnostics": "1.1.1", + "is-stream": "1.1.0", + "logform": "2.1.2", + "one-time": "0.0.4", + "readable-stream": "3.2.0", + "stack-trace": "0.0.10", + "triple-beam": "1.3.0", + "winston-transport": "4.3.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", + "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + } + } + }, + "winston-transport": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", + "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", + "dev": true, + "requires": { + "readable-stream": "2.3.6", + "triple-beam": "1.3.0" + } + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/vcx/wrappers/node/package.json b/vcx/wrappers/node/package.json index fb0375fc4a..33ee5b9e6a 100644 --- a/vcx/wrappers/node/package.json +++ b/vcx/wrappers/node/package.json @@ -43,27 +43,28 @@ "test-logging": "export TS_NODE_PROJECT=\"./test/tsconfig.json\" export NODE_ENV='test'&& find ./test/suite3 -name '*.test.ts' -exec ./node_modules/.bin/mocha --timeout 10000 -gc --expose-gc --exit --recursive --use_strict --require ts-node/register \\{} \\;" }, "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "6.2.4", - "babel-preset-es2015": "^6.24.1", - "sleep-promise": "^8.0.1", - "readline-sync": "^1.4.9", "@types/chai": "^4.1.4", "@types/lodash": "^4.14.109", "@types/mocha": "^5.2.3", "@types/sinon": "^5.0.1", "@types/weak": "^1.0.0", "app-module-path": "^2.2.0", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "6.2.4", + "babel-preset-es2015": "^6.24.1", "chai": "^4.1.2", "jsdoc": "^3.5.5", "mocha": "^5.2.0", + "readline-sync": "^1.4.9", "sinon": "^4.1.2", + "sleep-promise": "^8.0.1", "ts-node": "^6.1.2", "tslint": "^5.8.0", "tslint-config-standard": "^7.1.0", "typedoc": "0.11.1", - "typescript": "^2.9.1" + "typescript": "^2.9.1", + "winston": "^3.2.1" }, "main": "dist/src/index.js", "homepage": "https://github.com/evernym/vcx#readme",