daf-data-store
Advanced tools
Comparing version
@@ -42,3 +42,3 @@ import { DataStore } from './data-store'; | ||
}[]>; | ||
messages: (_: any, { iss, sub, tag, limit, }: { | ||
messages: (_: any, { iss, sub, tag, limit }: { | ||
iss: string; | ||
@@ -63,3 +63,3 @@ sub: string; | ||
}; | ||
export declare const typeDefs = "\n extend type Query {\n identity(did: ID!): Identity\n identities(dids: [ID!]): [Identity]\n messages(iss: ID, sub: ID, tag: String, limit: Int): [Message]\n message(hash: ID!): Message!\n credentials(iss: ID, sub: ID): [VerifiableClaim]\n }\n\n extend type Mutation {\n deleteMessage(hash: ID!): Boolean\n }\n\n extend type Identity {\n shortId: String\n firstName: String\n lastName: String\n profileImage: String\n url: String\n description: String\n interactionCount: Int!\n messagesSent: [Message]\n messagesReceived: [Message]\n messagesAll: [Message]\n credentialsIssued: [VerifiableClaim]\n credentialsReceived: [VerifiableClaim]\n credentialsAll: [VerifiableClaim]\n }\n \n extend type Message {\n iss: Identity!\n sub: Identity\n aud: Identity\n jwt: String!\n data: String!\n iat: Int\n nbf: Int\n vis: String\n tag: String\n vc: [VerifiableClaim]\n }\n\n type VerifiableClaim {\n hash: ID!\n parentHash: ID!\n rowId: String!\n iss: Identity!\n sub: Identity!\n json: String!\n jwt: String!\n nbf: Int\n iat: Int\n exp: Int\n fields: [VerifiableClaimField]\n }\n\n type VerifiableClaimField {\n rowId: String!\n hash: ID!\n parentHash: ID!\n iss: Identity!\n sub: Identity!\n type: String!\n value: String!\n isObj: Boolean!\n }\n\n"; | ||
export declare const typeDefs = "\n extend type Query {\n identity(did: ID!): Identity\n identities(dids: [ID!]): [Identity]\n messages(iss: ID, sub: ID, tag: String, limit: Int): [Message]\n message(hash: ID!): Message!\n credentials(iss: ID, sub: ID): [VerifiableClaim]\n }\n\n extend type Mutation {\n deleteMessage(hash: ID!): Boolean\n }\n\n extend type Identity {\n shortId: String\n firstName: String\n lastName: String\n profileImage: String\n url: String\n description: String\n interactionCount: Int!\n messagesSent: [Message]\n messagesReceived: [Message]\n messagesAll: [Message]\n credentialsIssued: [VerifiableClaim]\n credentialsReceived: [VerifiableClaim]\n credentialsAll: [VerifiableClaim]\n }\n \n extend type Message {\n iss: Identity!\n sub: Identity\n jwt: String!\n data: String!\n iat: Int\n nbf: Int\n vis: String\n tag: String\n vc: [VerifiableClaim]\n }\n\n type VerifiableClaim {\n hash: ID!\n parentHash: ID!\n rowId: String!\n iss: Identity!\n sub: Identity!\n json: String!\n jwt: String!\n nbf: Int\n iat: Int\n exp: Int\n fields: [VerifiableClaimField]\n }\n\n type VerifiableClaimField {\n rowId: String!\n hash: ID!\n parentHash: ID!\n iss: Identity!\n sub: Identity!\n type: String!\n value: String!\n isObj: Boolean!\n }\n\n"; | ||
export {}; |
@@ -227,3 +227,3 @@ "use strict"; | ||
}; | ||
exports.typeDefs = "\n extend type Query {\n identity(did: ID!): Identity\n identities(dids: [ID!]): [Identity]\n messages(iss: ID, sub: ID, tag: String, limit: Int): [Message]\n message(hash: ID!): Message!\n credentials(iss: ID, sub: ID): [VerifiableClaim]\n }\n\n extend type Mutation {\n deleteMessage(hash: ID!): Boolean\n }\n\n extend type Identity {\n shortId: String\n firstName: String\n lastName: String\n profileImage: String\n url: String\n description: String\n interactionCount: Int!\n messagesSent: [Message]\n messagesReceived: [Message]\n messagesAll: [Message]\n credentialsIssued: [VerifiableClaim]\n credentialsReceived: [VerifiableClaim]\n credentialsAll: [VerifiableClaim]\n }\n \n extend type Message {\n iss: Identity!\n sub: Identity\n aud: Identity\n jwt: String!\n data: String!\n iat: Int\n nbf: Int\n vis: String\n tag: String\n vc: [VerifiableClaim]\n }\n\n type VerifiableClaim {\n hash: ID!\n parentHash: ID!\n rowId: String!\n iss: Identity!\n sub: Identity!\n json: String!\n jwt: String!\n nbf: Int\n iat: Int\n exp: Int\n fields: [VerifiableClaimField]\n }\n\n type VerifiableClaimField {\n rowId: String!\n hash: ID!\n parentHash: ID!\n iss: Identity!\n sub: Identity!\n type: String!\n value: String!\n isObj: Boolean!\n }\n\n"; | ||
exports.typeDefs = "\n extend type Query {\n identity(did: ID!): Identity\n identities(dids: [ID!]): [Identity]\n messages(iss: ID, sub: ID, tag: String, limit: Int): [Message]\n message(hash: ID!): Message!\n credentials(iss: ID, sub: ID): [VerifiableClaim]\n }\n\n extend type Mutation {\n deleteMessage(hash: ID!): Boolean\n }\n\n extend type Identity {\n shortId: String\n firstName: String\n lastName: String\n profileImage: String\n url: String\n description: String\n interactionCount: Int!\n messagesSent: [Message]\n messagesReceived: [Message]\n messagesAll: [Message]\n credentialsIssued: [VerifiableClaim]\n credentialsReceived: [VerifiableClaim]\n credentialsAll: [VerifiableClaim]\n }\n \n extend type Message {\n iss: Identity!\n sub: Identity\n jwt: String!\n data: String!\n iat: Int\n nbf: Int\n vis: String\n tag: String\n vc: [VerifiableClaim]\n }\n\n type VerifiableClaim {\n hash: ID!\n parentHash: ID!\n rowId: String!\n iss: Identity!\n sub: Identity!\n json: String!\n jwt: String!\n nbf: Int\n iat: Int\n exp: Int\n fields: [VerifiableClaimField]\n }\n\n type VerifiableClaimField {\n rowId: String!\n hash: ID!\n parentHash: ID!\n iss: Identity!\n sub: Identity!\n type: String!\n value: String!\n isObj: Boolean!\n }\n\n"; | ||
//# sourceMappingURL=graphql.js.map |
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.7.5](https://github.com/uport-project/daf/compare/v0.7.4...v0.7.5) (2019-12-02) | ||
### Bug Fixes | ||
* W3C VP subject is aud ([991e64b](https://github.com/uport-project/daf/commit/991e64b3189405ddf2c3a43acc15c2ffe652380a)) | ||
## [0.7.3](https://github.com/uport-project/daf/compare/v0.7.2...v0.7.3) (2019-11-30) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "daf-data-store", | ||
"description": "DID Agent Framework Data Store", | ||
"version": "0.7.3", | ||
"version": "0.7.5", | ||
"main": "build/index.js", | ||
@@ -30,3 +30,3 @@ "types": "build/index.d.ts", | ||
"keywords": [], | ||
"gitHead": "aeee1880e3993b2074b331e73038d0b72934d18d" | ||
"gitHead": "97c26cc285f37e3dd737249851ff101825b79ea7" | ||
} |
@@ -9,12 +9,9 @@ import { DataStore } from './data-store' | ||
Message: { | ||
vc: async (message: any, {}, { dataStore }: Context) => | ||
dataStore.credentialsForMessageHash(message.hash), | ||
vc: async (message: any, {}, { dataStore }: Context) => dataStore.credentialsForMessageHash(message.hash), | ||
}, | ||
VerifiableClaim: { | ||
fields: async (vc: any, {}, { dataStore }: Context) => | ||
dataStore.credentialsFieldsForClaimHash(vc.hash), | ||
fields: async (vc: any, {}, { dataStore }: Context) => dataStore.credentialsFieldsForClaimHash(vc.hash), | ||
}, | ||
Identity: { | ||
shortId: async (identity: any, {}, { dataStore }: Context) => | ||
dataStore.shortId(identity.did), | ||
shortId: async (identity: any, {}, { dataStore }: Context) => dataStore.shortId(identity.did), | ||
firstName: async (identity: any, {}, { dataStore }: Context) => | ||
@@ -42,26 +39,11 @@ dataStore.popularClaimForDid(identity.did, 'firstName'), | ||
dataStore.popularClaimForDid(identity.did, 'description'), | ||
interactionCount: async ( | ||
identity: any, | ||
{ did }: { did: string }, | ||
{ dataStore }: Context, | ||
) => dataStore.interactionCount(identity.did, did), | ||
credentialsIssued: async ( | ||
identity: any, | ||
args: any, | ||
{ dataStore }: Context, | ||
) => { | ||
interactionCount: async (identity: any, { did }: { did: string }, { dataStore }: Context) => | ||
dataStore.interactionCount(identity.did, did), | ||
credentialsIssued: async (identity: any, args: any, { dataStore }: Context) => { | ||
return dataStore.findCredentials({ iss: identity.did }) | ||
}, | ||
credentialsReceived: async ( | ||
identity: any, | ||
args: any, | ||
{ dataStore }: Context, | ||
) => { | ||
credentialsReceived: async (identity: any, args: any, { dataStore }: Context) => { | ||
return dataStore.findCredentials({ sub: identity.did }) | ||
}, | ||
credentialsAll: async ( | ||
identity: any, | ||
args: any, | ||
{ dataStore }: Context, | ||
) => { | ||
credentialsAll: async (identity: any, args: any, { dataStore }: Context) => { | ||
return dataStore.findCredentials({ iss: identity.did, sub: identity.did }) | ||
@@ -72,7 +54,3 @@ }, | ||
}, | ||
messagesReceived: async ( | ||
identity: any, | ||
args: any, | ||
{ dataStore }: Context, | ||
) => { | ||
messagesReceived: async (identity: any, args: any, { dataStore }: Context) => { | ||
return dataStore.findMessages({ sub: identity.did }) | ||
@@ -85,12 +63,5 @@ }, | ||
Query: { | ||
identity: async ( | ||
_: any, | ||
{ did }: { did: string }, | ||
{ dataStore }: Context, | ||
) => dataStore.findIdentityByDid(did), | ||
identities: async ( | ||
_: any, | ||
{ dids }: { dids: string[] }, | ||
{ dataStore }: Context, | ||
) => { | ||
identity: async (_: any, { did }: { did: string }, { dataStore }: Context) => | ||
dataStore.findIdentityByDid(did), | ||
identities: async (_: any, { dids }: { dids: string[] }, { dataStore }: Context) => { | ||
return dids ? dids.map(did => ({ did })) : dataStore.allIdentities() | ||
@@ -100,8 +71,3 @@ }, | ||
_: any, | ||
{ | ||
iss, | ||
sub, | ||
tag, | ||
limit, | ||
}: { iss: string; sub: string; tag: string; limit: number }, | ||
{ iss, sub, tag, limit }: { iss: string; sub: string; tag: string; limit: number }, | ||
{ dataStore }: Context, | ||
@@ -111,12 +77,5 @@ ) => { | ||
}, | ||
message: async ( | ||
_: any, | ||
{ hash }: { hash: string }, | ||
{ dataStore }: Context, | ||
) => dataStore.findMessage(hash), | ||
credentials: async ( | ||
_: any, | ||
{ iss, sub }: { iss: string; sub: string }, | ||
{ dataStore }: Context, | ||
) => { | ||
message: async (_: any, { hash }: { hash: string }, { dataStore }: Context) => | ||
dataStore.findMessage(hash), | ||
credentials: async (_: any, { iss, sub }: { iss: string; sub: string }, { dataStore }: Context) => { | ||
const res = await dataStore.findCredentials({ iss, sub }) | ||
@@ -127,7 +86,4 @@ return res | ||
Mutation: { | ||
deleteMessage: async ( | ||
_: any, | ||
{ hash }: { hash: string }, | ||
{ dataStore }: Context, | ||
) => dataStore.deleteMessage(hash), | ||
deleteMessage: async (_: any, { hash }: { hash: string }, { dataStore }: Context) => | ||
dataStore.deleteMessage(hash), | ||
}, | ||
@@ -168,3 +124,2 @@ } | ||
sub: Identity | ||
aud: Identity | ||
jwt: String! | ||
@@ -171,0 +126,0 @@ data: String! |
Sorry, the diff of this file is not supported yet
116486
-0.09%1845
-2.38%