Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

did-resolver

Package Overview
Dependencies
Maintainers
7
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

did-resolver - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## [2.1.2](https://github.com/decentralized-identity/did-resolver/compare/2.1.1...2.1.2) (2020-12-09)
### Bug Fixes
* **types:** fix data type for "authentication" array in `DIDDocument` ([#60](https://github.com/decentralized-identity/did-resolver/issues/60)) ([d017cb3](https://github.com/decentralized-identity/did-resolver/commit/d017cb32cc24ec84994d1b7c4fb56126a796dfff))
* extend `DIDDocument.[@context](https://github.com/context)` data type to include arrays ([#70](https://github.com/decentralized-identity/did-resolver/issues/70)) ([8781b69](https://github.com/decentralized-identity/did-resolver/commit/8781b691ebeacd24a185b96ae33d8426309df9a4)), closes [#68](https://github.com/decentralized-identity/did-resolver/issues/68)
## [2.1.1](https://github.com/decentralized-identity/did-resolver/compare/2.1.0...2.1.1) (2020-08-19)

@@ -2,0 +10,0 @@

19

lib/resolver.d.ts
export interface DIDDocument {
'@context': 'https://w3id.org/did/v1';
'@context': 'https://w3id.org/did/v1' | string | string[];
id: string;
publicKey: PublicKey[];
authentication?: Authentication[];
authentication?: (string | PublicKey | Authentication)[];
/**
* @deprecated This does not appear in the did-core spec
*/
uportProfile?: any;
service?: ServiceEndpoint[];
/**
* @deprecated this property has been removed from the did-core spec
*/
created?: string;
/**
* @deprecated this property has been removed from the did-core spec
*/
updated?: string;
/**
* @deprecated this property has been removed from the did-core spec
*/
proof?: LinkedDataProof;

@@ -29,2 +41,5 @@ keyAgreement?: (string | PublicKey)[];

}
/**
* @deprecated The `authentication` array should be an array of strings or `PublicKey`
*/
export interface Authentication {

@@ -31,0 +46,0 @@ type: string;

2

lib/resolver.esm.js

@@ -1,2 +0,2 @@

function r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function t(r,e){return e()}var n=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function o(e){if(""===e||!e)throw new Error("Missing DID");var t=e.match(n);if(t){var o={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:e};if(t[4]){var i=t[4].slice(1).split(";");o.params={};for(var a,u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var c=a.value.split("=");o.params[c[0]]=c[1]}}return t[6]&&(o.path=t[6]),t[7]&&(o.query=t[7].slice(1)),t[8]&&(o.fragment=t[8].slice(1)),o}throw new Error("Invalid DID "+e)}var i=function(){function r(r,n){void 0===r&&(r={}),this.registry=r,this.cache=!0===n?e():n||t}return r.prototype.resolve=function(r){try{var e,t=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+i.method+"'")},n=this,i=o(r),a=n.registry[i.method],u=function(){if(a)return Promise.resolve(n.cache(i,function(){return a(i.did,i,n)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+i.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(t):t(u))}catch(r){return Promise.reject(r)}},r}();export{i as Resolver,e as inMemoryCache,t as noCache,o as parse};
function r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function t(r,e){return e()}var n=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function o(e){if(""===e||!e)throw new Error("Missing DID");var t=e.match(n);if(t){var o={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:e};if(t[4]){var i=t[4].slice(1).split(";");o.params={};for(var a,u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var c=a.value.split("=");o.params[c[0]]=c[1]}}return t[6]&&(o.path=t[6]),t[7]&&(o.query=t[7].slice(1)),t[8]&&(o.fragment=t[8].slice(1)),o}throw new Error("Invalid DID "+e)}var i=function(){function r(r,n){void 0===r&&(r={}),this.registry=r,this.cache=!0===n?e():n||t}return r.prototype.resolve=function(r){try{var e,t=this,n=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+i.method+"'")},i=o(r),a=t.registry[i.method],u=function(){if(a)return Promise.resolve(t.cache(i,function(){return a(i.did,i,t)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+i.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(r){return Promise.reject(r)}},r}();export{i as Resolver,e as inMemoryCache,t as noCache,o as parse};
//# sourceMappingURL=resolver.esm.js.map

@@ -1,2 +0,2 @@

function r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function t(r,e){return e()}var n=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function o(e){if(""===e||!e)throw new Error("Missing DID");var t=e.match(n);if(t){var o={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:e};if(t[4]){var i=t[4].slice(1).split(";");o.params={};for(var a,u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var s=a.value.split("=");o.params[s[0]]=s[1]}}return t[6]&&(o.path=t[6]),t[7]&&(o.query=t[7].slice(1)),t[8]&&(o.fragment=t[8].slice(1)),o}throw new Error("Invalid DID "+e)}exports.Resolver=function(){function r(r,n){void 0===r&&(r={}),this.registry=r,this.cache=!0===n?e():n||t}return r.prototype.resolve=function(r){try{var e,t=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+i.method+"'")},n=this,i=o(r),a=n.registry[i.method],u=function(){if(a)return Promise.resolve(n.cache(i,function(){return a(i.did,i,n)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+i.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(t):t(u))}catch(r){return Promise.reject(r)}},r}(),exports.inMemoryCache=e,exports.noCache=t,exports.parse=o;
function r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function t(r,e){return e()}var n=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function o(e){if(""===e||!e)throw new Error("Missing DID");var t=e.match(n);if(t){var o={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:e};if(t[4]){var i=t[4].slice(1).split(";");o.params={};for(var a,u=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,void 0):void 0}}(e))){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var s=a.value.split("=");o.params[s[0]]=s[1]}}return t[6]&&(o.path=t[6]),t[7]&&(o.query=t[7].slice(1)),t[8]&&(o.fragment=t[8].slice(1)),o}throw new Error("Invalid DID "+e)}exports.Resolver=function(){function r(r,n){void 0===r&&(r={}),this.registry=r,this.cache=!0===n?e():n||t}return r.prototype.resolve=function(r){try{var e,t=this,n=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+i.method+"'")},i=o(r),a=t.registry[i.method],u=function(){if(a)return Promise.resolve(t.cache(i,function(){return a(i.did,i,t)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+i.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(r){return Promise.reject(r)}},r}(),exports.inMemoryCache=e,exports.noCache=t,exports.parse=o;
//# sourceMappingURL=resolver.js.map

@@ -1,2 +0,2 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r=r||self).didResolver={})}(this,function(r){function e(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function t(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function n(r,e){return e()}var o=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function i(r){if(""===r||!r)throw new Error("Missing DID");var t=r.match(o);if(t){var n={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:r};if(t[4]){var i=t[4].slice(1).split(";");n.params={};for(var a,u=function(r,t){var n;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,void 0);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,void 0):void 0}}(r))){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=r[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var c=a.value.split("=");n.params[c[0]]=c[1]}}return t[6]&&(n.path=t[6]),t[7]&&(n.query=t[7].slice(1)),t[8]&&(n.fragment=t[8].slice(1)),n}throw new Error("Invalid DID "+r)}r.Resolver=function(){function r(r,e){void 0===r&&(r={}),this.registry=r,this.cache=!0===e?t():e||n}return r.prototype.resolve=function(r){try{var e,t=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+o.method+"'")},n=this,o=i(r),a=n.registry[o.method],u=function(){if(a)return Promise.resolve(n.cache(o,function(){return a(o.did,o,n)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+o.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(t):t(u))}catch(r){return Promise.reject(r)}},r}(),r.inMemoryCache=t,r.noCache=n,r.parse=i});
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r=r||self).didResolver={})}(this,function(r){function e(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function t(){var r=new Map;return function(e,t){try{var n,o=function(o){if(n)return o;var i=r.get(e.did);return void 0!==i?i:Promise.resolve(t()).then(function(t){return null!==t&&r.set(e.did,t),t})},i=function(){if(e.params&&"true"===e.params["no-cache"])return n=1,Promise.resolve(t())}();return Promise.resolve(i&&i.then?i.then(o):o(i))}catch(r){return Promise.reject(r)}}}function n(r,e){return e()}var o=new RegExp("^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$");function i(r){if(""===r||!r)throw new Error("Missing DID");var t=r.match(o);if(t){var n={did:"did:"+t[1]+":"+t[2],method:t[1],id:t[2],didUrl:r};if(t[4]){var i=t[4].slice(1).split(";");n.params={};for(var a,u=function(r,t){var n;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(n=function(r,t){if(r){if("string"==typeof r)return e(r,void 0);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,void 0):void 0}}(r))){n&&(r=n);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=r[Symbol.iterator]()).next.bind(n)}(i);!(a=u()).done;){var c=a.value.split("=");n.params[c[0]]=c[1]}}return t[6]&&(n.path=t[6]),t[7]&&(n.query=t[7].slice(1)),t[8]&&(n.fragment=t[8].slice(1)),n}throw new Error("Invalid DID "+r)}r.Resolver=function(){function r(r,e){void 0===r&&(r={}),this.registry=r,this.cache=!0===e?t():e||n}return r.prototype.resolve=function(r){try{var e,t=this,n=function(r){if(e)return r;throw new Error("Unsupported DID method: '"+o.method+"'")},o=i(r),a=t.registry[o.method],u=function(){if(a)return Promise.resolve(t.cache(o,function(){return a(o.did,o,t)})).then(function(r){if(null==r)throw new Error("resolver returned null for "+o.did);return e=1,r})}();return Promise.resolve(u&&u.then?u.then(n):n(u))}catch(r){return Promise.reject(r)}},r}(),r.inMemoryCache=t,r.noCache=n,r.parse=i});
//# sourceMappingURL=resolver.umd.js.map
{
"name": "did-resolver",
"version": "2.1.1",
"version": "2.1.2",
"description": "Resolve DID documents",

@@ -33,19 +33,19 @@ "main": "lib/resolver.js",

"devDependencies": {
"@commitlint/cli": "9.1.2",
"@commitlint/config-conventional": "9.1.2",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"@types/jest": "26.0.10",
"@types/jest": "26.0.18",
"@types/node": "12.12.47",
"codecov": "3.7.2",
"jest": "26.4.0",
"microbundle": "0.12.3",
"prettier": "2.0.5",
"codecov": "3.8.1",
"jest": "26.6.3",
"microbundle": "0.12.4",
"prettier": "2.2.1",
"regenerator-runtime": "0.13.7",
"semantic-release": "17.1.1",
"ts-jest": "26.2.0",
"semantic-release": "17.3.0",
"ts-jest": "26.4.4",
"tslint": "6.1.3",
"tslint-config-prettier": "1.18.0",
"tslint-eslint-rules": "5.4.0",
"typescript": "3.9.7"
"typescript": "4.1.2"
},

@@ -72,4 +72,4 @@ "jest": {

"resolutions": {
"@babel/core": "7.11.1"
"@babel/core": "7.12.9"
}
}

@@ -16,10 +16,22 @@ // Copyright 2018 ConsenSys AG

export interface DIDDocument {
'@context': 'https://w3id.org/did/v1'
'@context': 'https://w3id.org/did/v1' | string | string[]
id: string
publicKey: PublicKey[]
authentication?: Authentication[]
authentication?: (string | PublicKey | Authentication)[]
/**
* @deprecated This does not appear in the did-core spec
*/
uportProfile?: any
service?: ServiceEndpoint[]
/**
* @deprecated this property has been removed from the did-core spec
*/
created?: string
/**
* @deprecated this property has been removed from the did-core spec
*/
updated?: string
/**
* @deprecated this property has been removed from the did-core spec
*/
proof?: LinkedDataProof

@@ -47,2 +59,5 @@ keyAgreement?: (string | PublicKey)[]

/**
* @deprecated The `authentication` array should be an array of strings or `PublicKey`
*/
export interface Authentication {

@@ -49,0 +64,0 @@ type: string

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc