Skip to content
Snippets Groups Projects

feat(ssi): credential definition module

Merged Berend Sliedrecht requested to merge tsabolov/ocm-engine:credential-definitions into main
8 files
+ 281
0
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 70
0
 
import type { BaseEventInput } from './baseEvents.js';
 
import type { AnonCredsSchema } from '@aries-framework/anoncreds';
 
 
import { BaseEvent } from './baseEvents.js';
 
 
export type EventAnonCredsSchemasGetAllInput = BaseEventInput;
 
export class EventAnonCredsSchemasGetAll extends BaseEvent<
 
Array<AnonCredsSchema>
 
> {
 
public static token = 'anoncreds.schemas.getAll';
 
 
public get instance() {
 
return this.data;
 
}
 
 
public static fromEvent(e: EventAnonCredsSchemasGetAll) {
 
return new EventAnonCredsSchemasGetAll(
 
e.data,
 
e.tenantId,
 
e.id,
 
e.type,
 
e.timestamp,
 
);
 
}
 
}
 
 
export type EventAnonCredsSchemasGetByIdInput = BaseEventInput<{
 
schemaId: string;
 
}>;
 
export class EventAnonCredsSchemasGetById extends BaseEvent<AnonCredsSchema | null> {
 
public static token = 'anoncreds.schemas.getById';
 
 
public get instance() {
 
return this.data;
 
}
 
 
public static fromEvent(e: EventAnonCredsSchemasGetById) {
 
return new EventAnonCredsSchemasGetById(
 
e.data,
 
e.tenantId,
 
e.id,
 
e.type,
 
e.timestamp,
 
);
 
}
 
}
 
 
export type EventAnonCredsSchemasRegisterInput = BaseEventInput<{
 
issuerDid: string;
 
name: string;
 
version: string;
 
attributeNames: Array<string>;
 
}>;
 
export class EventAnonCredsSchemasRegister extends BaseEvent<AnonCredsSchema> {
 
public static token = 'anoncreds.schemas.register';
 
 
public get instance() {
 
return this.data;
 
}
 
 
public static fromEvent(e: EventAnonCredsSchemasRegister) {
 
return new EventAnonCredsSchemasRegister(
 
e.data,
 
e.tenantId,
 
e.id,
 
e.type,
 
e.timestamp,
 
);
 
}
 
}
Loading