diff --git a/apps/shared/src/events/credentialOfferEvents.ts b/apps/shared/src/events/credentialOfferEvents.ts new file mode 100644 index 0000000000000000000000000000000000000000..d120f84048244d20cbcc87d3bf96966b8b58725b --- /dev/null +++ b/apps/shared/src/events/credentialOfferEvents.ts @@ -0,0 +1,48 @@ +import type { BaseEventInput } from './baseEvents.js'; +import type { AnonCredsCredentialOffer } from '@aries-framework/anoncreds'; + +import { BaseEvent } from './baseEvents.js'; + +export type EventAnonCredsCredentialOfferGetAllInput = BaseEventInput; + +export class EventAnonCredsCredentialOfferGetAll extends BaseEvent< + Array<AnonCredsCredentialOffer> +> { + public static token = 'anoncreds.credentialOffers.getAll'; + + public get instance() { + return this.data; + } + + public static fromEvent(e: EventAnonCredsCredentialOfferGetAll) { + return new EventAnonCredsCredentialOfferGetAll( + e.data, + e.tenantId, + e.id, + e.type, + e.timestamp, + ); + } +} + +export type EventAnonCredsCredentialOfferGetByIdInput = BaseEventInput & { + credentialOfferId: string; +}; + +export class EventAnonCredsCredentialOfferGetById extends BaseEvent<AnonCredsCredentialOffer | null> { + public static token = 'anoncreds.credentialOffers.getById'; + + public get instance() { + return this.data; + } + + public static fromEvent(e: EventAnonCredsCredentialOfferGetById) { + return new EventAnonCredsCredentialOfferGetById( + e.data, + e.tenantId, + e.id, + e.type, + e.timestamp, + ); + } +} diff --git a/apps/shared/src/index.ts b/apps/shared/src/index.ts index 9abcab20e1289b74917187fdc62072fc3ec5c618..7e5e2824e92af93cf89cd6432a613c83c0f3a454 100644 --- a/apps/shared/src/index.ts +++ b/apps/shared/src/index.ts @@ -10,6 +10,7 @@ export * from './events/tenantEvents.js'; export * from './events/schemaEvents.js'; export * from './events/credentialDefinitionEvents.js'; export * from './events/credentialEvents.js'; +export * from './events/credentialOfferEvents.js'; export * from './dto/pagination-params.dto.js'; export * from './dto/multitenancy-params.dto.js';