Update service provider data structure

This commit is contained in:
Yarmo Mackenbach 2020-11-06 02:27:56 +01:00
parent d2f03d9bde
commit aaf9079de5
15 changed files with 42 additions and 30 deletions

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: `https://dev.to/${match[1]}` uri: `https://dev.to/${match[1]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['body_markdown'], path: ['body_markdown'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `${match[2]}@${match[1]}`, display: `${match[2]}@${match[1]}`,
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['user', 'bio_raw'], path: ['user', 'bio_raw'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -53,7 +53,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: `https://${match[1]}` uri: `https://${match[1]}`,
qr: null
}, },
proof: { proof: {
uri: utils.generateProxyURL('dns', match[1]), uri: utils.generateProxyURL('dns', match[1]),
@ -67,7 +68,6 @@ const processURI = (uri, opts) => {
path: ['records', 'txt'], path: ['records', 'txt'],
relation: 'contains' relation: 'contains'
}, },
qr: null,
customRequestHandler: customRequestHandler customRequestHandler: customRequestHandler
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `@${match[2]}@${match[1]}`, display: `@${match[2]}@${match[1]}`,
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['summary'], path: ['summary'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `${match[2]}@${match[1]}`, display: `${match[2]}@${match[1]}`,
uri: `https://${match[1]}/${match[2]}` uri: `https://${match[1]}/${match[2]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['description'], path: ['description'],
relation: 'equals' relation: 'equals'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: `https://github.com/${match[1]}` uri: `https://github.com/${match[1]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['files', 'openpgp.md', 'content'], path: ['files', 'openpgp.md', 'content'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -53,7 +53,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `${match[2]}@${match[1]}`, display: `${match[2]}@${match[1]}`,
uri: `https://${match[1]}/${match[2]}` uri: `https://${match[1]}/${match[2]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -67,7 +68,6 @@ const processURI = (uri, opts) => {
path: ['description'], path: ['description'],
relation: 'equals' relation: 'equals'
}, },
qr: null,
customRequestHandler: customRequestHandler customRequestHandler: customRequestHandler
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: `https://hacker-news.firebaseio.com/v0/user/${match[1]}.json`, uri: `https://hacker-news.firebaseio.com/v0/user/${match[1]}.json`,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['about'], path: ['about'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['statements', 'content'], path: ['statements', 'content'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: `https://lobste.rs/u/${match[1]}.json`, uri: `https://lobste.rs/u/${match[1]}.json`,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['about'], path: ['about'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `@${match[2]}@${match[1]}`, display: `@${match[2]}@${match[1]}`,
uri: uri uri: uri,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['attachment', 'value'], path: ['attachment', 'value'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: match[1], display: match[1],
uri: `https://www.reddit.com/user/${match[1]}` uri: `https://www.reddit.com/user/${match[1]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: ['data', 'children', 'data', 'selftext'], path: ['data', 'children', 'data', 'selftext'],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `@${match[1]}`, display: `@${match[1]}`,
uri: `https://twitter.com/${match[1]}` uri: `https://twitter.com/${match[1]}`,
qr: null
}, },
proof: { proof: {
uri: uri, uri: uri,
@ -40,7 +41,7 @@ const processURI = (uri, opts) => {
path: [], path: [],
relation: 'contains' relation: 'contains'
}, },
qr: null customRequestHandler: null
} }
} }

View file

@ -26,7 +26,8 @@ const processURI = (uri, opts) => {
}, },
profile: { profile: {
display: `${match[1]}@${match[2]}`, display: `${match[1]}@${match[2]}`,
uri: uri uri: uri,
qr: uri
}, },
proof: { proof: {
uri: 'xmppVcardServerDomain' in opts uri: 'xmppVcardServerDomain' in opts
@ -42,7 +43,7 @@ const processURI = (uri, opts) => {
path: [], path: [],
relation: 'contains' relation: 'contains'
}, },
qr: uri customRequestHandler: null
} }
} }

View file

@ -29,7 +29,8 @@ const pattern = {
}, },
profile: { profile: {
display: _.isString, display: _.isString,
uri: _.isString uri: _.isString,
qr: (x) => { return _.isString(x) || _.isNull(x) }
}, },
proof: { proof: {
uri: (x) => { return _.isString(x) || _.isNull(x) }, uri: (x) => { return _.isString(x) || _.isNull(x) },
@ -43,7 +44,6 @@ const pattern = {
path: _.isArray, path: _.isArray,
relation: _.isString relation: _.isString
}, },
qr: (x) => { return _.isString(x) || _.isNull(x) },
customRequestHandler: (x) => { return _.isFunction(x) || _.isNull(x) || _.isUndefined(x) } customRequestHandler: (x) => { return _.isFunction(x) || _.isNull(x) || _.isUndefined(x) }
} }