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

daf-core

Package Overview
Dependencies
Maintainers
6
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

daf-core - npm Package Compare versions

Comparing version 4.0.0-beta.37 to 4.0.0-beta.39

build/action/action-handler.d.ts.map

7

build/action/action-handler.d.ts
import { Action } from '../types';
import { Core } from '../core';
import { Agent } from '../agent';
export interface ActionHandler {
setNext(actionHandler: ActionHandler): ActionHandler;
handleAction(action: Action, core: Core): Promise<any>;
handleAction(action: Action, agent: Agent): Promise<any>;
}

@@ -10,3 +10,4 @@ export declare abstract class AbstractActionHandler implements ActionHandler {

setNext(actionHandler: ActionHandler): ActionHandler;
handleAction(action: Action, core: Core): Promise<any>;
handleAction(action: Action, agent: Agent): Promise<any>;
}
//# sourceMappingURL=action-handler.d.ts.map

@@ -46,7 +46,7 @@ "use strict";

};
AbstractActionHandler.prototype.handleAction = function (action, core) {
AbstractActionHandler.prototype.handleAction = function (action, agent) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (this.nextActionHandler) {
return [2 /*return*/, this.nextActionHandler.handleAction(action, core)];
return [2 /*return*/, this.nextActionHandler.handleAction(action, agent)];
}

@@ -53,0 +53,0 @@ return [2 /*return*/, null];

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

export declare const baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n type: String!\n id: String\n data: String\n }\n \n";
export declare const baseTypeDefs = "\n type Query \n\n type Mutation \n\n type Identity {\n did: ID!\n provider: String\n }\n\n";
//# sourceMappingURL=graphql-base-type-defs.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.baseTypeDefs = "\n type Query \n\n type Mutation \n \n type Identity {\n did: ID!\n }\n \n type Message {\n id: ID!\n threadId: String\n rowId: String!\n type: String!\n sender: Identity\n receiver: Identity\n raw: String!\n data: String\n timestamp: Int\n metaData: [MessageMetaData]\n thread: [Message]\n }\n\n type MessageMetaData {\n type: String!\n id: String\n data: String\n }\n \n";
exports.baseTypeDefs = "\n type Query \n\n type Mutation \n\n type Identity {\n did: ID!\n provider: String\n }\n\n";
//# sourceMappingURL=graphql-base-type-defs.js.map

@@ -1,33 +0,110 @@

import { Core } from '../core';
import { LastMessageTimestampForInstance } from '../service/service-manager';
import { Message } from '../message/message';
interface Context {
core: Core;
import { Agent } from '../agent';
import { Message } from '../entities/message';
import { Presentation } from '../entities/presentation';
import { Credential } from '../entities/credential';
import { Claim } from '../entities/claim';
import { Identity } from '../entities/identity';
export interface Context {
agent: Agent;
}
export interface FindOptions {
take?: number;
skip?: number;
}
export declare const resolvers: {
Query: {
serviceMessagesSince: (_: any, args: {
ts: LastMessageTimestampForInstance[];
}, ctx: Context) => Promise<{
id: any;
data: string;
raw: string;
metaData: import("../message/message").MetaData[];
type: string | null;
threadId: string | null;
sender: string | null;
receiver: string | null;
timestamp: number | null;
vc?: any;
}[]>;
};
Mutation: {
newMessage: (_: any, args: {
handleMessage: (_: any, args: {
raw: string;
sourceType: string;
sourceId?: string | undefined;
metaData?: [{
type: string;
value?: string;
}];
save: boolean;
}, ctx: Context) => Promise<Message>;
};
Query: {
identity: (_: any, { did }: {
did: any;
}) => Promise<Identity>;
identities: (_: any, { input }: {
input: any;
}) => Promise<Identity[]>;
message: (_: any, { id }: {
id: any;
}) => Promise<Message>;
messages: (_: any, { input, }: {
input?: {
options?: FindOptions;
from?: string[];
to?: string[];
type?: string[];
threadId?: string[];
};
}) => Promise<Message[]>;
presentation: (_: any, { hash }: {
hash: any;
}) => Promise<Presentation>;
presentations: (_: any, { input, }: {
input?: {
options?: FindOptions;
issuer?: string[];
audience?: string[];
type?: string[];
context?: string[];
};
}) => Promise<Presentation[]>;
credential: (_: any, { hash }: {
hash: any;
}) => Promise<Credential>;
credentials: (_: any, { input, }: {
input?: {
options?: FindOptions;
issuer?: string[];
subject?: string[];
type?: string[];
context?: string[];
};
}) => Promise<Credential[]>;
claim: (_: any, { hash }: {
hash: any;
}) => Promise<Claim>;
claims: (_: any, { input, }: {
input?: {
options?: FindOptions;
issuer?: string[];
subject?: string[];
type?: string[];
value?: string[];
};
}) => Promise<Claim[]>;
};
Identity: {
shortDid: (identity: Identity) => Promise<string>;
latestClaimValue: (identity: Identity, args: {
type: string;
}) => Promise<String>;
sentMessages: (identity: Identity) => Promise<Message[]>;
receivedMessages: (identity: Identity) => Promise<Message[]>;
issuedPresentations: (identity: Identity) => Promise<Presentation[]>;
receivedPresentations: (identity: Identity) => Promise<Presentation[]>;
issuedCredentials: (identity: Identity) => Promise<Credential[]>;
receivedCredentials: (identity: Identity) => Promise<Credential[]>;
issuedClaims: (identity: Identity) => Promise<Claim[]>;
receivedClaims: (identity: Identity) => Promise<Claim[]>;
};
Credential: {
claims: (credential: Credential) => Promise<Claim[]>;
messages: (credential: Credential) => Promise<Message[]>;
presentations: (credential: Credential) => Promise<Presentation[]>;
};
Presentation: {
credentials: (presentation: Presentation) => Promise<Credential[]>;
messages: (presentation: Presentation) => Promise<Message[]>;
};
Message: {
presentations: (message: Message) => Promise<Presentation[]>;
credentials: (message: Message) => Promise<Credential[]>;
};
};
export declare const typeDefs = "\n input LastMessageTimestampForInstance {\n timestamp: Int!\n did: String!\n type: String!\n id: String!\n }\n\n type ServiceMessage {\n id: String!\n threadId: String,\n timestamp: Int,\n sender: String,\n receiver: String,\n type: String,\n raw: String,\n data: String,\n metaData: [MessageMetaData]\n }\n\n extend type Query {\n serviceMessagesSince(ts: [LastMessageTimestampForInstance]!): [ServiceMessage]\n }\n\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n";
export {};
export declare const typeDefs = "\n\n input FindOptions {\n take: Int\n skip: Int\n }\n\n input IdentitiesInput {\n options: FindOptions\n }\n\n input MessagesInput {\n from: [String]\n to: [String]\n type: [String]\n threadId: [String]\n options: FindOptions\n }\n\n input PresentationsInput {\n issuer: [String]\n audience: [String]\n type: [String]\n context: [String]\n options: FindOptions\n }\n\n input CredentialsInput {\n issuer: [String]\n subject: [String]\n type: [String]\n context: [String]\n options: FindOptions\n }\n\n input ClaimsInput {\n issuer: [ID]\n subject: [ID]\n type: [String]\n value: [String]\n options: FindOptions\n }\n\n extend type Query {\n identity(did: ID!): Identity\n identities(input: IdentitiesInput): [Identity]\n message(id: ID!): Message\n messages(input: MessagesInput): [Message]\n presentation(hash: ID!): Presentation\n presentations(input: PresentationsInput): [Presentation]\n credential(hash: ID!): Credential\n credentials(input: CredentialsInput): [Credential]\n claim(hash: ID!): Claim\n claims(input: ClaimsInput): [Claim]\n }\n\n input MetaDataInput {\n type: String!\n value: String\n }\n extend type Mutation {\n handleMessage(raw: String!, meta: [MetaDataInput], save: Boolean = true): Message\n }\n\n\n extend type Identity {\n shortDid: String!\n latestClaimValue(type: String): String\n sentMessages: [Message]\n receivedMessages: [Message]\n issuedPresentations: [Presentation]\n receivedPresentations: [Presentation]\n issuedCredentials: [Credential]\n receivedCredentials: [Credential]\n issuedClaims: [Claim]\n receivedClaims: [Claim]\n }\n\n scalar Object\n scalar Date\n \n type Message {\n id: ID!\n saveDate: Date!\n updateDate: Date!\n createdAt: Date\n expiresAt: Date\n threadId: String\n type: String!\n raw: String\n data: Object\n replyTo: [String]\n replyUrl: [String]\n from: Identity\n to: Identity\n metaData: [MetaData]\n presentations: [Presentation]\n credentials: [Credential]\n }\n\n type MetaData {\n type: String!\n value: String\n }\n\n type Presentation {\n hash: ID!\n raw: String!\n issuer: Identity!\n audience: Identity!\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n type: [String]\n credentials: [Credential]\n messages: [Message]\n }\n \n type Credential {\n hash: ID!\n raw: String!\n issuer: Identity!\n subject: Identity\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n type: [String]\n credentialSubject: Object\n claims: [Claim]\n presentations: [Presentation]\n messages: [Message]\n }\n\n type Claim {\n hash: ID!\n issuer: Identity!\n subject: Identity\n credential: Credential!\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n credentialType: [String]\n type: String!\n value: String!\n isObj: Boolean\n } \n";
//# sourceMappingURL=graphql-core.d.ts.map

@@ -50,37 +50,299 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var message_1 = require("../message/message");
var newMessage = function (_, args, ctx) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.validateMessage(new message_1.Message({
raw: args.raw,
meta: {
type: args.sourceType,
id: args.sourceId,
},
}))];
case 1: return [2 /*return*/, _a.sent()];
}
var typeorm_1 = require("typeorm");
var message_1 = require("../entities/message");
var presentation_1 = require("../entities/presentation");
var credential_1 = require("../entities/credential");
var claim_1 = require("../entities/claim");
var identity_1 = require("../entities/identity");
var messages = function (_, _a) {
var input = _a.input;
return __awaiter(void 0, void 0, void 0, function () {
var options;
var _b, _c;
return __generator(this, function (_d) {
options = {
where: {},
};
if (input === null || input === void 0 ? void 0 : input.from)
options.where['from'] = typeorm_1.In(input.from);
if (input === null || input === void 0 ? void 0 : input.to)
options.where['to'] = typeorm_1.In(input.to);
if (input === null || input === void 0 ? void 0 : input.type)
options.where['type'] = typeorm_1.In(input.type);
if (input === null || input === void 0 ? void 0 : input.threadId)
options.where['threadId'] = typeorm_1.In(input.threadId);
if ((_b = input === null || input === void 0 ? void 0 : input.options) === null || _b === void 0 ? void 0 : _b.skip)
options['skip'] = input.options.skip;
if ((_c = input === null || input === void 0 ? void 0 : input.options) === null || _c === void 0 ? void 0 : _c.take)
options['take'] = input.options.take;
return [2 /*return*/, message_1.Message.find(options)];
});
});
}); };
var serviceMessagesSince = function (_, args, ctx) { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.getMessagesSince(args.ts)];
case 1:
res = _a.sent();
return [2 /*return*/, res.map(function (msg) { return (__assign(__assign({}, msg), { id: msg.id, data: JSON.stringify(msg.data), raw: msg.raw, metaData: msg.allMeta })); })];
}
};
var presentations = function (_, _a) {
var input = _a.input;
return __awaiter(void 0, void 0, void 0, function () {
var options;
var _b, _c;
return __generator(this, function (_d) {
options = {
where: {},
};
if (input === null || input === void 0 ? void 0 : input.issuer)
options.where['issuer'] = typeorm_1.In(input.issuer);
if (input === null || input === void 0 ? void 0 : input.audience)
options.where['audience'] = typeorm_1.In(input.audience);
if (input === null || input === void 0 ? void 0 : input.type)
options.where['type'] = typeorm_1.In(input.type);
if (input === null || input === void 0 ? void 0 : input.context)
options.where['context'] = typeorm_1.In(input.context);
if ((_b = input === null || input === void 0 ? void 0 : input.options) === null || _b === void 0 ? void 0 : _b.skip)
options['skip'] = input.options.skip;
if ((_c = input === null || input === void 0 ? void 0 : input.options) === null || _c === void 0 ? void 0 : _c.take)
options['take'] = input.options.take;
return [2 /*return*/, presentation_1.Presentation.find(options)];
});
});
}); };
};
var credentials = function (_, _a) {
var input = _a.input;
return __awaiter(void 0, void 0, void 0, function () {
var options;
var _b, _c;
return __generator(this, function (_d) {
options = {
where: {},
};
if (input === null || input === void 0 ? void 0 : input.issuer)
options.where['issuer'] = typeorm_1.In(input.issuer);
if (input === null || input === void 0 ? void 0 : input.subject)
options.where['audience'] = typeorm_1.In(input.subject);
if (input === null || input === void 0 ? void 0 : input.type)
options.where['type'] = typeorm_1.In(input.type);
if (input === null || input === void 0 ? void 0 : input.context)
options.where['context'] = typeorm_1.In(input.context);
if ((_b = input === null || input === void 0 ? void 0 : input.options) === null || _b === void 0 ? void 0 : _b.skip)
options['skip'] = input.options.skip;
if ((_c = input === null || input === void 0 ? void 0 : input.options) === null || _c === void 0 ? void 0 : _c.take)
options['take'] = input.options.take;
return [2 /*return*/, credential_1.Credential.find(options)];
});
});
};
var claims = function (_, _a) {
var input = _a.input;
return __awaiter(void 0, void 0, void 0, function () {
var options;
var _b, _c;
return __generator(this, function (_d) {
options = {
relations: ['credential'],
where: {},
};
if (input === null || input === void 0 ? void 0 : input.issuer)
options.where['issuer'] = typeorm_1.In(input.issuer);
if (input === null || input === void 0 ? void 0 : input.subject)
options.where['subject'] = typeorm_1.In(input.subject);
if (input === null || input === void 0 ? void 0 : input.type)
options.where['type'] = typeorm_1.In(input.type);
if (input === null || input === void 0 ? void 0 : input.value)
options.where['value'] = typeorm_1.In(input.value);
if ((_b = input === null || input === void 0 ? void 0 : input.options) === null || _b === void 0 ? void 0 : _b.skip)
options['skip'] = input.options.skip;
if ((_c = input === null || input === void 0 ? void 0 : input.options) === null || _c === void 0 ? void 0 : _c.take)
options['take'] = input.options.take;
return [2 /*return*/, claim_1.Claim.find(options)];
});
});
};
exports.resolvers = {
Mutation: {
handleMessage: function (_, args, ctx) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, ctx.agent.handleMessage(args)];
}); }); },
},
Query: {
serviceMessagesSince: serviceMessagesSince,
identity: function (_, _a) {
var did = _a.did;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, identity_1.Identity.findOne(did)];
}); });
},
identities: function (_, _a) {
var input = _a.input;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, identity_1.Identity.find(__assign({}, input === null || input === void 0 ? void 0 : input.options))];
}); });
},
message: function (_, _a) {
var id = _a.id;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, message_1.Message.findOne(id)];
}); });
},
messages: messages,
presentation: function (_, _a) {
var hash = _a.hash;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, presentation_1.Presentation.findOne(hash)];
}); });
},
presentations: presentations,
credential: function (_, _a) {
var hash = _a.hash;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, credential_1.Credential.findOne(hash)];
}); });
},
credentials: credentials,
claim: function (_, _a) {
var hash = _a.hash;
return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) {
return [2 /*return*/, claim_1.Claim.findOne(hash, { relations: ['credential'] })];
}); });
},
claims: claims,
},
Mutation: {
newMessage: newMessage,
Identity: {
shortDid: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did)];
case 1: return [2 /*return*/, (_a.sent()).shortDid()];
}
}); }); },
latestClaimValue: function (identity, args) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did)];
case 1: return [2 /*return*/, (_a.sent()).getLatestClaimValue({ type: args.type })];
}
}); }); },
sentMessages: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['sentMessages'] })];
case 1: return [2 /*return*/, (_a.sent()).sentMessages];
}
}); }); },
receivedMessages: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['receivedMessages'] })];
case 1: return [2 /*return*/, (_a.sent()).receivedMessages];
}
}); }); },
issuedPresentations: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['issuedPresentations'] })];
case 1: return [2 /*return*/, (_a.sent()).issuedPresentations];
}
}); }); },
receivedPresentations: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['receivedPresentations'] })];
case 1: return [2 /*return*/, (_a.sent()).receivedPresentations];
}
}); }); },
issuedCredentials: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['issuedCredentials'] })];
case 1: return [2 /*return*/, (_a.sent()).issuedCredentials];
}
}); }); },
receivedCredentials: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['receivedCredentials'] })];
case 1: return [2 /*return*/, (_a.sent()).receivedCredentials];
}
}); }); },
issuedClaims: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['issuedClaims'] })];
case 1: return [2 /*return*/, (_a.sent()).issuedClaims];
}
}); }); },
receivedClaims: function (identity) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, identity_1.Identity.findOne(identity.did, { relations: ['receivedClaims'] })];
case 1: return [2 /*return*/, (_a.sent()).receivedClaims];
}
}); }); },
},
Credential: {
claims: function (credential) { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = credential.claims;
if (_a) return [3 /*break*/, 2];
return [4 /*yield*/, credential_1.Credential.findOne(credential.hash, { relations: ['claims'] })];
case 1:
_a = (_b.sent()).claims;
_b.label = 2;
case 2: return [2 /*return*/, _a];
}
}); }); },
messages: function (credential) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, credential_1.Credential.findOne(credential.hash, { relations: ['messages'] })];
case 1: return [2 /*return*/, (_a.sent()).messages];
}
}); }); },
presentations: function (credential) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, credential_1.Credential.findOne(credential.hash, { relations: ['presentations'] })];
case 1: return [2 /*return*/, (_a.sent()).presentations];
}
}); }); },
},
Presentation: {
credentials: function (presentation) { return __awaiter(void 0, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = presentation.credentials;
if (_a) return [3 /*break*/, 2];
return [4 /*yield*/, presentation_1.Presentation.findOne(presentation.hash, { relations: ['credentials'] })];
case 1:
_a = (_b.sent()).credentials;
_b.label = 2;
case 2: return [2 /*return*/, _a];
}
});
}); },
messages: function (presentation) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, presentation_1.Presentation.findOne(presentation.hash, { relations: ['messages'] })];
case 1: return [2 /*return*/, (_a.sent()).messages];
}
}); }); },
},
Message: {
presentations: function (message) { return __awaiter(void 0, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = message.presentations;
if (_a) return [3 /*break*/, 2];
return [4 /*yield*/, message_1.Message.findOne(message.id, { relations: ['presentations'] })];
case 1:
_a = (_b.sent()).presentations;
_b.label = 2;
case 2: return [2 /*return*/, _a];
}
});
}); },
credentials: function (message) { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = message.credentials;
if (_a) return [3 /*break*/, 2];
return [4 /*yield*/, message_1.Message.findOne(message.id, { relations: ['credentials'] })];
case 1:
_a = (_b.sent()).credentials;
_b.label = 2;
case 2: return [2 /*return*/, _a];
}
}); }); },
},
};
exports.typeDefs = "\n input LastMessageTimestampForInstance {\n timestamp: Int!\n did: String!\n type: String!\n id: String!\n }\n\n type ServiceMessage {\n id: String!\n threadId: String,\n timestamp: Int,\n sender: String,\n receiver: String,\n type: String,\n raw: String,\n data: String,\n metaData: [MessageMetaData]\n }\n\n extend type Query {\n serviceMessagesSince(ts: [LastMessageTimestampForInstance]!): [ServiceMessage]\n }\n\n extend type Mutation {\n newMessage(raw: String!, sourceType: String!, sourceId: String): Message\n }\n";
exports.typeDefs = "\n\n input FindOptions {\n take: Int\n skip: Int\n }\n\n input IdentitiesInput {\n options: FindOptions\n }\n\n input MessagesInput {\n from: [String]\n to: [String]\n type: [String]\n threadId: [String]\n options: FindOptions\n }\n\n input PresentationsInput {\n issuer: [String]\n audience: [String]\n type: [String]\n context: [String]\n options: FindOptions\n }\n\n input CredentialsInput {\n issuer: [String]\n subject: [String]\n type: [String]\n context: [String]\n options: FindOptions\n }\n\n input ClaimsInput {\n issuer: [ID]\n subject: [ID]\n type: [String]\n value: [String]\n options: FindOptions\n }\n\n extend type Query {\n identity(did: ID!): Identity\n identities(input: IdentitiesInput): [Identity]\n message(id: ID!): Message\n messages(input: MessagesInput): [Message]\n presentation(hash: ID!): Presentation\n presentations(input: PresentationsInput): [Presentation]\n credential(hash: ID!): Credential\n credentials(input: CredentialsInput): [Credential]\n claim(hash: ID!): Claim\n claims(input: ClaimsInput): [Claim]\n }\n\n input MetaDataInput {\n type: String!\n value: String\n }\n extend type Mutation {\n handleMessage(raw: String!, meta: [MetaDataInput], save: Boolean = true): Message\n }\n\n\n extend type Identity {\n shortDid: String!\n latestClaimValue(type: String): String\n sentMessages: [Message]\n receivedMessages: [Message]\n issuedPresentations: [Presentation]\n receivedPresentations: [Presentation]\n issuedCredentials: [Credential]\n receivedCredentials: [Credential]\n issuedClaims: [Claim]\n receivedClaims: [Claim]\n }\n\n scalar Object\n scalar Date\n \n type Message {\n id: ID!\n saveDate: Date!\n updateDate: Date!\n createdAt: Date\n expiresAt: Date\n threadId: String\n type: String!\n raw: String\n data: Object\n replyTo: [String]\n replyUrl: [String]\n from: Identity\n to: Identity\n metaData: [MetaData]\n presentations: [Presentation]\n credentials: [Credential]\n }\n\n type MetaData {\n type: String!\n value: String\n }\n\n type Presentation {\n hash: ID!\n raw: String!\n issuer: Identity!\n audience: Identity!\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n type: [String]\n credentials: [Credential]\n messages: [Message]\n }\n \n type Credential {\n hash: ID!\n raw: String!\n issuer: Identity!\n subject: Identity\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n type: [String]\n credentialSubject: Object\n claims: [Claim]\n presentations: [Presentation]\n messages: [Message]\n }\n\n type Claim {\n hash: ID!\n issuer: Identity!\n subject: Identity\n credential: Credential!\n issuanceDate: Date!\n expirationDate: Date\n context: [String]\n credentialType: [String]\n type: String!\n value: String!\n isObj: Boolean\n } \n";
//# sourceMappingURL=graphql-core.js.map

@@ -1,4 +0,4 @@

import { Core } from '../core';
import { Agent } from '../agent';
export interface Context {
core: Core;
agent: Agent;
}

@@ -10,9 +10,6 @@ export declare const resolvers: {

Query: {
identityProviders: (_: any, args: any, ctx: Context) => Promise<{
type: string;
description: string;
}[]>;
identityProviders: (_: any, args: any, ctx: Context) => Promise<import("..").AbstractIdentityProvider[]>;
managedIdentities: (_: any, args: any, ctx: Context) => Promise<{
did: string;
type: string;
provider: string;
__typename: string;

@@ -30,3 +27,3 @@ }[]>;

did: string;
type: string;
provider: string;
__typename: string;

@@ -43,3 +40,3 @@ }>;

did: string;
type: string;
provider: string;
__typename: string;

@@ -49,2 +46,3 @@ }>;

};
export declare const typeDefs = "\n type IdentityProvider {\n type: String!\n description: String\n }\n extend type Query {\n identityProviders: [IdentityProvider]\n managedIdentities: [Identity]\n managedIdentitySecret(type: String, did: String): String\n }\n\n extend type Mutation {\n createIdentity(type: String): Identity!\n deleteIdentity(type: String, did: String): Boolean!\n importIdentity(type: String, secret: String): Identity!\n }\n\n extend type Identity {\n type: String\n isManaged: Boolean!\n }\n \n";
export declare const typeDefs = "\n type IdentityProvider {\n type: String!\n description: String\n }\n extend type Query {\n identityProviders: [IdentityProvider]\n managedIdentities: [Identity]\n managedIdentitySecret(type: String, did: String): String\n }\n\n extend type Mutation {\n createIdentity(type: String): Identity!\n deleteIdentity(type: String, did: String): Boolean!\n importIdentity(type: String, secret: String): Identity!\n }\n\n extend type Identity {\n isManaged: Boolean!\n }\n \n";
//# sourceMappingURL=graphql-identity-manager.d.ts.map

@@ -42,3 +42,3 @@ "use strict";

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.getIdentityProviderTypes()];
case 0: return [4 /*yield*/, ctx.agent.identityManager.getIdentityProviders()];
case 1: return [2 /*return*/, _a.sent()];

@@ -52,3 +52,3 @@ }

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.getIdentities()];
case 0: return [4 /*yield*/, ctx.agent.identityManager.getIdentities()];
case 1:

@@ -58,3 +58,3 @@ list = _a.sent();

did: identity.did,
type: identity.identityProviderType,
provider: identity.identityProviderType,
__typename: 'Identity',

@@ -69,3 +69,3 @@ }); })];

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.getIdentities()];
case 0: return [4 /*yield*/, ctx.agent.identityManager.getIdentities()];
case 1:

@@ -81,3 +81,3 @@ list = _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.createIdentity(args.type)];
case 0: return [4 /*yield*/, ctx.agent.identityManager.createIdentity(args.type)];
case 1:

@@ -87,3 +87,3 @@ identity = _a.sent();

did: identity.did,
type: identity.identityProviderType,
provider: identity.identityProviderType,
__typename: 'Identity',

@@ -97,3 +97,3 @@ }];

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.deleteIdentity(args.type, args.did)];
case 0: return [4 /*yield*/, ctx.agent.identityManager.deleteIdentity(args.type, args.did)];
case 1: return [2 /*return*/, _a.sent()];

@@ -107,3 +107,3 @@ }

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.importIdentity(args.type, args.secret)];
case 0: return [4 /*yield*/, ctx.agent.identityManager.importIdentity(args.type, args.secret)];
case 1:

@@ -113,3 +113,3 @@ identity = _a.sent();

did: identity.did,
type: identity.identityProviderType,
provider: identity.identityProviderType,
__typename: 'Identity',

@@ -124,3 +124,3 @@ }];

switch (_a.label) {
case 0: return [4 /*yield*/, ctx.core.identityManager.exportIdentity(args.type, args.did)];
case 0: return [4 /*yield*/, ctx.agent.identityManager.exportIdentity(args.type, args.did)];
case 1: return [2 /*return*/, _a.sent()];

@@ -146,3 +146,3 @@ }

};
exports.typeDefs = "\n type IdentityProvider {\n type: String!\n description: String\n }\n extend type Query {\n identityProviders: [IdentityProvider]\n managedIdentities: [Identity]\n managedIdentitySecret(type: String, did: String): String\n }\n\n extend type Mutation {\n createIdentity(type: String): Identity!\n deleteIdentity(type: String, did: String): Boolean!\n importIdentity(type: String, secret: String): Identity!\n }\n\n extend type Identity {\n type: String\n isManaged: Boolean!\n }\n \n";
exports.typeDefs = "\n type IdentityProvider {\n type: String!\n description: String\n }\n extend type Query {\n identityProviders: [IdentityProvider]\n managedIdentities: [Identity]\n managedIdentitySecret(type: String, did: String): String\n }\n\n extend type Mutation {\n createIdentity(type: String): Identity!\n deleteIdentity(type: String, did: String): Boolean!\n importIdentity(type: String, secret: String): Identity!\n }\n\n extend type Identity {\n isManaged: Boolean!\n }\n \n";
//# sourceMappingURL=graphql-identity-manager.js.map

@@ -8,6 +8,20 @@ export interface ServiceEndpoint {

export declare abstract class AbstractIdentityController {
/**
*
* @param type String
* @param proofPurpose String[]
*/
addPublicKey(type: string, proofPurpose?: string[]): Promise<string>;
/**
*
* @param keyId String
*/
removePublicKey(keyId: string): Promise<boolean>;
/**
*
* @param service ServiceEndpoint
*/
addService(service: ServiceEndpoint): Promise<any>;
removeService(service: ServiceEndpoint): Promise<boolean>;
}
//# sourceMappingURL=abstract-identity-controller.d.ts.map

@@ -6,8 +6,21 @@ "use strict";

}
/**
*
* @param type String
* @param proofPurpose String[]
*/
AbstractIdentityController.prototype.addPublicKey = function (type, proofPurpose) {
return Promise.reject('Method addPublicKey not implemented');
};
/**
*
* @param keyId String
*/
AbstractIdentityController.prototype.removePublicKey = function (keyId) {
return Promise.reject('Method removePublicKey not implemented');
};
/**
*
* @param service ServiceEndpoint
*/
AbstractIdentityController.prototype.addService = function (service) {

@@ -14,0 +27,0 @@ return Promise.reject('Method addService not implemented');

@@ -18,1 +18,2 @@ /// <reference types="node" />

export {};
//# sourceMappingURL=abstract-identity-provider.d.ts.map

@@ -13,1 +13,2 @@ import { SerializedKey } from './abstract-key-management-system';

}
//# sourceMappingURL=abstract-identity-store.d.ts.map

@@ -14,1 +14,2 @@ import { AbstractKey, KeyType } from './abstract-key-management-system';

export {};
//# sourceMappingURL=abstract-identity.d.ts.map

@@ -26,3 +26,5 @@ export declare type KeyType = 'Ed25519' | 'Secp256k1';

abstract deleteKey(kid: string): Promise<boolean>;
importKey(key: SerializedKey): Promise<AbstractKey>;
}
export {};
//# sourceMappingURL=abstract-key-management-system.d.ts.map

@@ -15,2 +15,5 @@ "use strict";

}
AbstractKeyManagementSystem.prototype.importKey = function (key) {
return Promise.reject('Method importKey not implemented');
};
return AbstractKeyManagementSystem;

@@ -17,0 +20,0 @@ }());

@@ -7,1 +7,2 @@ import { SerializedKey } from './abstract-key-management-system';

}
//# sourceMappingURL=abstract-key-store.d.ts.map

@@ -9,6 +9,3 @@ import { AbstractIdentity } from './abstract-identity';

constructor(options: Options);
getIdentityProviderTypes(): Promise<{
type: string;
description: string;
}[]>;
getIdentityProviders(): Promise<AbstractIdentityProvider[]>;
getIdentityProvider(type: string): Promise<AbstractIdentityProvider>;

@@ -23,1 +20,2 @@ getIdentities(): Promise<AbstractIdentity[]>;

export {};
//# sourceMappingURL=identity-manager.d.ts.map

@@ -54,9 +54,6 @@ "use strict";

}
IdentityManager.prototype.getIdentityProviderTypes = function () {
IdentityManager.prototype.getIdentityProviders = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.identityProviders.map(function (provider) { return ({
type: provider.type,
description: provider.description,
}); })];
return [2 /*return*/, this.identityProviders];
});

@@ -63,0 +60,0 @@ });

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

export { Core, EventTypes, Resolver } from './core';
export { Agent, EventTypes, Resolver } from './agent';
export { AbstractActionHandler } from './action/action-handler';

@@ -7,17 +7,20 @@ export { IdentityManager } from './identity/identity-manager';

export { AbstractIdentityProvider, IdentityProviderDerived } from './identity/abstract-identity-provider';
export { AbstractKeyManagementSystem, AbstractKey, KeyType, SerializedKey, } from './identity/abstract-key-management-system';
export { AbstractKeyManagementSystem, AbstractKey, SerializedKey, } from './identity/abstract-key-management-system';
export { AbstractIdentityStore, SerializedIdentity } from './identity/abstract-identity-store';
export { AbstractKeyStore } from './identity/abstract-key-store';
export { AbstractMessageValidator } from './message/abstract-message-validator';
export { Message } from './message/message';
export { AbstractMessageHandler } from './message/abstract-message-handler';
export { ServiceManager, LastMessageTimestampForInstance, ServiceEventTypes } from './service/service-manager';
export { AbstractServiceController } from './service/abstract-service-controller';
import * as Types from './types';
import * as GqlCore from './graphql/graphql-core';
import * as GqlIdentityManager from './graphql/graphql-identity-manager';
declare const Gql: {
baseTypeDefs: string;
Core: typeof GqlCore;
IdentityManager: typeof GqlIdentityManager;
};
export { Types, Gql };
export { Gql } from './graphql/index';
export { Action } from './types';
export { IdentityStore } from './identity/identity-store';
export { KeyStore } from './identity/key-store';
import { Key, KeyType } from './entities/key';
import { Identity } from './entities/identity';
import { Claim } from './entities/claim';
import { Credential } from './entities/credential';
import { Presentation } from './entities/presentation';
import { Message } from './entities/message';
export declare const Entities: (typeof Key | typeof Identity | typeof Claim | typeof Credential | typeof Presentation | typeof Message)[];
export { KeyType, Key, Identity, Message, Claim, Credential, Presentation };
//# sourceMappingURL=index.d.ts.map
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("./core");
exports.Core = core_1.Core;
exports.EventTypes = core_1.EventTypes;
var agent_1 = require("./agent");
exports.Agent = agent_1.Agent;
exports.EventTypes = agent_1.EventTypes;
var action_handler_1 = require("./action/action-handler");

@@ -30,6 +23,4 @@ exports.AbstractActionHandler = action_handler_1.AbstractActionHandler;

exports.AbstractKeyStore = abstract_key_store_1.AbstractKeyStore;
var abstract_message_validator_1 = require("./message/abstract-message-validator");
exports.AbstractMessageValidator = abstract_message_validator_1.AbstractMessageValidator;
var message_1 = require("./message/message");
exports.Message = message_1.Message;
var abstract_message_handler_1 = require("./message/abstract-message-handler");
exports.AbstractMessageHandler = abstract_message_handler_1.AbstractMessageHandler;
var service_manager_1 = require("./service/service-manager");

@@ -40,13 +31,21 @@ exports.ServiceManager = service_manager_1.ServiceManager;

exports.AbstractServiceController = abstract_service_controller_1.AbstractServiceController;
var Types = __importStar(require("./types"));
exports.Types = Types;
var graphql_base_type_defs_1 = require("./graphql/graphql-base-type-defs");
var GqlCore = __importStar(require("./graphql/graphql-core"));
var GqlIdentityManager = __importStar(require("./graphql/graphql-identity-manager"));
var Gql = {
baseTypeDefs: graphql_base_type_defs_1.baseTypeDefs,
Core: GqlCore,
IdentityManager: GqlIdentityManager,
};
exports.Gql = Gql;
var index_1 = require("./graphql/index");
exports.Gql = index_1.Gql;
var identity_store_1 = require("./identity/identity-store");
exports.IdentityStore = identity_store_1.IdentityStore;
var key_store_1 = require("./identity/key-store");
exports.KeyStore = key_store_1.KeyStore;
var key_1 = require("./entities/key");
exports.Key = key_1.Key;
var identity_1 = require("./entities/identity");
exports.Identity = identity_1.Identity;
var claim_1 = require("./entities/claim");
exports.Claim = claim_1.Claim;
var credential_1 = require("./entities/credential");
exports.Credential = credential_1.Credential;
var presentation_1 = require("./entities/presentation");
exports.Presentation = presentation_1.Presentation;
var message_1 = require("./entities/message");
exports.Message = message_1.Message;
exports.Entities = [key_1.Key, identity_1.Identity, message_1.Message, claim_1.Claim, credential_1.Credential, presentation_1.Presentation];
//# sourceMappingURL=index.js.map
/// <reference types="node" />
import { EventEmitter } from 'events';
import { AbstractIdentity } from '../identity/abstract-identity';
import { Resolver } from '../core';
import { Message } from '../message/message';
import { Resolver } from '../agent';
import { Message } from '../entities/message';
export declare abstract class AbstractServiceController extends EventEmitter {

@@ -23,1 +23,2 @@ readonly identity: AbstractIdentity;

export {};
//# sourceMappingURL=abstract-service-controller.d.ts.map
/// <reference types="node" />
import { EventEmitter } from 'events';
import { Resolver } from '../core';
import { Resolver } from '../agent';
import { ServiceControllerDerived } from './abstract-service-controller';
import { AbstractIdentity } from '../identity/abstract-identity';
import { Message } from '../message/message';
import { Message } from '../entities/message';
export declare enum ServiceEventTypes {

@@ -31,1 +31,2 @@ NewMessages = "NewMessages"

export {};
//# sourceMappingURL=service-manager.d.ts.map

@@ -5,1 +5,2 @@ export interface Action {

}
//# sourceMappingURL=types.d.ts.map
{
"name": "daf-core",
"description": "DID Agent Framework Core",
"version": "4.0.0-beta.37+cf659c0",
"version": "4.0.0-beta.39+63dd12d",
"main": "build/index.js",

@@ -31,3 +31,3 @@ "types": "build/index.d.ts",

"keywords": [],
"gitHead": "cf659c09768325031fe66adc0228eb1d976f2932"
"gitHead": "63dd12da63b2245d32379b435a7a774a56a1f019"
}
# DID Agent Framework Core
### Core functions -
### Core functions

@@ -5,0 +5,0 @@ - Validates messages

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

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