web-ledger-client
Advanced tools
Comparing version 6.0.0 to 7.0.0
/*! | ||
* Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
module.exports = { | ||
DEFAULT_HEADERS: {Accept: 'application/ld+json, application/json'}, | ||
WEB_LEDGER_CONTEXT_V1_URL: 'https://w3id.org/webledger/v1', | ||
ZCAP_CONTEXT_V1_URL: 'https://w3id.org/zcap/v1' | ||
export const DEFAULT_HEADERS = { | ||
Accept: 'application/ld+json, application/json' | ||
}; | ||
export const WEB_LEDGER_CONTEXT_V1_URL = 'https://w3id.org/webledger/v1'; | ||
export const ZCAP_CONTEXT_V1_URL = 'https://w3id.org/zcap/v1'; |
/*! | ||
* Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
module.exports = { | ||
constants: require('./constants'), | ||
WebLedgerClient: require('./WebLedgerClient'), | ||
WebLedgerClientError: require('./WebLedgerClientError'), | ||
}; | ||
export * as constants from './constants.js'; | ||
export {WebLedgerClient} from './WebLedgerClient.js'; | ||
export {WebLedgerClientError} from './WebLedgerClientError.js'; |
/*! | ||
* Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
import * as constants from './constants.js'; | ||
import {httpClient, DEFAULT_HEADERS} from '@digitalbazaar/http-client'; | ||
import {WebLedgerClientError} from './WebLedgerClientError.js'; | ||
const _get = require('lodash.get'); | ||
const constants = require('./constants'); | ||
const {httpClient, DEFAULT_HEADERS} = require('@digitalbazaar/http-client'); | ||
const WebLedgerClientError = require('./WebLedgerClientError'); | ||
/** | ||
@@ -30,4 +27,6 @@ * A SSL capable HTTP Agent. | ||
class WebLedgerClient { | ||
export class WebLedgerClient { | ||
/** | ||
* @class WebLedgerClient | ||
* | ||
* @param {object} options - Options for the WebLedgerClient. | ||
@@ -185,3 +184,3 @@ * @param {string} options.hostname - The hostname of the ledger node. | ||
} | ||
const serviceURL = _get(this.ledgerAgent.service, serviceId); | ||
const serviceURL = this.ledgerAgent.service?.[serviceId]; | ||
if(!serviceURL) { | ||
@@ -410,3 +409,1 @@ throw new WebLedgerClientError( | ||
} | ||
module.exports = WebLedgerClient; |
/*! | ||
* Copyright (c) 2019-2021 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
module.exports = class WebLedgerClientError extends Error { | ||
export class WebLedgerClientError extends Error { | ||
constructor(message, name, details) { | ||
@@ -16,2 +14,2 @@ super(message); | ||
} | ||
}; | ||
} |
{ | ||
"name": "web-ledger-client", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "A WebLedger client.", | ||
@@ -38,30 +38,32 @@ "homepage": "https://github.com/digitalbazaar/web-ledger-client", | ||
"license": "BSD-3-Clause", | ||
"main": "lib/index.js", | ||
"type": "module", | ||
"exports": "./lib/index.js", | ||
"files": [ | ||
"lib/**/*.js" | ||
], | ||
"dependencies": { | ||
"@digitalbazaar/http-client": "^1.1.0", | ||
"lodash.get": "^4.4.2" | ||
"@digitalbazaar/http-client": "^3.2.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"c8": "^7.11.3", | ||
"chai": "^4.3.6", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.21.0", | ||
"eslint-config-digitalbazaar": "^2.6.1", | ||
"eslint-plugin-jsdoc": "^35.2.0", | ||
"jsdoc-to-markdown": "^7.0.1", | ||
"mocha": "^9.0.0", | ||
"eslint": "^8.17.0", | ||
"eslint-config-digitalbazaar": "^3.0.0", | ||
"eslint-plugin-jsdoc": "^39.3.2", | ||
"eslint-plugin-unicorn": "^42.0.0", | ||
"jsdoc-to-markdown": "^7.1.1", | ||
"mocha": "^10.0.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"nock": "^13.1.0", | ||
"nyc": "^15.1.0" | ||
"nock": "^13.2.6" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"tests" | ||
], | ||
"c8": { | ||
"reporter": [ | ||
"html", | ||
"text-summary" | ||
"lcov", | ||
"text-summary", | ||
"text" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=14" | ||
}, | ||
@@ -76,11 +78,9 @@ "keywords": [ | ||
"generate-docs": "jsdoc2md lib/*.js > ./docs/api.md", | ||
"test": "npm run lint && npm run test-node", | ||
"test": "npm run test-node", | ||
"test-node": "cross-env NODE_ENV=test mocha --preserve-symlinks -t 10000 tests/*.spec.js", | ||
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary npm run test-node", | ||
"coverage-ci": "cross-env NODE_ENV=test nyc --reporter=lcovonly npm run test-node", | ||
"coverage-report": "nyc report", | ||
"lint": "eslint .", | ||
"preversion": "npm test", | ||
"postversion": "git push --follow-tags" | ||
"coverage": "cross-env NODE_ENV=test c8 npm run test-node", | ||
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", | ||
"coverage-report": "c8 report", | ||
"lint": "eslint ." | ||
} | ||
} |
@@ -25,3 +25,3 @@ # Web Ledger Client _(web-ledger-client)_ | ||
Requires Node.js 10+ | ||
- Browsers and Node.js 14+ are supported. | ||
@@ -28,0 +28,0 @@ To install via NPM: |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
0
Yes
18330
11
7
407
+ Added@digitalbazaar/http-client@3.4.1(transitive)
+ Added@fastify/busboy@2.1.1(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addedky@0.33.3(transitive)
+ Addedky-universal@0.11.0(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedundici@5.28.5(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removedlodash.get@^4.4.2
- Removed@digitalbazaar/http-client@1.2.0(transitive)
- Removeddata-uri-to-buffer@3.0.1(transitive)
- Removedesm@3.2.25(transitive)
- Removedfetch-blob@2.1.2(transitive)
- Removedky@0.25.1(transitive)
- Removedky-universal@0.8.2(transitive)
- Removedlodash.get@4.4.2(transitive)
- Removednode-fetch@3.0.0-beta.9(transitive)