Skip to content

Commit

Permalink
Revert "chore: Make sure plugins having listener methods, actually ex…
Browse files Browse the repository at this point in the history
…pose the interface"

This reverts commit fbbbfea.
  • Loading branch information
nklomp committed Mar 5, 2024
1 parent fbbbfea commit 99db568
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
9 changes: 8 additions & 1 deletion packages/data-store/src/__tests__/xstate.store.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { DataSource } from 'typeorm'
import { DataStoreXStateStoreEntities, GetActiveStateArgs, NonPersistedXStateStoreEvent, SaveStateArgs, State, XStateStore } from '../index'
import {
DataStoreXStateStoreEntities,
GetActiveStateArgs,
NonPersistedXStateStoreEvent,
SaveStateArgs,
State,
XStateStore,
} from '../index'
import { DataStoreXStateStoreMigrations } from '../migrations'

describe('Database entities tests', (): void => {
Expand Down
3 changes: 1 addition & 2 deletions packages/event-logger/src/agent/EventLogger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IAgentPlugin } from '@veramo/core'
import { AbstractEventLoggerStore } from '@sphereon/ssi-sdk.data-store'
import { AuditLoggingEvent, LoggingEventType, LogLevel } from '@sphereon/ssi-sdk.core'
import { IEventListener } from '@veramo/core/src/types/IAgent'
import { v4 as uuidv4 } from 'uuid'
import { schema } from '../index'
import { EventLoggerOptions, GetAuditEventsArgs, IEventLogger, RequiredContext, LogAuditEventArgs, LoggingEvent } from '../types/IEventLogger'
Expand All @@ -14,7 +13,7 @@ import { EventLoggerOptions, GetAuditEventsArgs, IEventLogger, RequiredContext,
export const eventLoggerAuditMethods: Array<string> = ['loggerGetAuditEvents', 'loggerLogAuditEvent']
export const eventLoggerMethods: Array<string> = [...eventLoggerAuditMethods]

export class EventLogger implements IAgentPlugin, IEventListener {
export class EventLogger implements IAgentPlugin {
readonly schema = schema.IEventLogger
readonly eventTypes: Array<LoggingEventType> = []

Expand Down
3 changes: 1 addition & 2 deletions packages/oid4vci-holder/src/agent/OID4VCIHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Party,
} from '@sphereon/ssi-sdk.data-store'
import { IAgentPlugin, VerifiableCredential } from '@veramo/core'
import { IEventListener } from '@veramo/core/src/types/IAgent'
import { computeEntryHash } from '@veramo/utils'
import { v4 as uuidv4 } from 'uuid'
import { OID4VCIMachine } from '../machine/oid4vciMachine'
Expand Down Expand Up @@ -50,7 +49,7 @@ import {
* {@inheritDoc IOID4VCIHolder}
*/

export class OID4VCIHolder implements IAgentPlugin, IEventListener {
export class OID4VCIHolder implements IAgentPlugin {
readonly eventTypes: Array<OID4VCIHolderEvent> = [OID4VCIHolderEvent.CONTACT_IDENTITY_CREATED, OID4VCIHolderEvent.CREDENTIAL_STORED]

readonly methods: IOID4VCIHolder = {
Expand Down
27 changes: 22 additions & 5 deletions packages/xstate-persistence/plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"description": "Machine type/id"
}
},
"required": ["machineType"],
"required": [
"machineType"
],
"additionalProperties": false
},
"DeleteStateResult": {
Expand All @@ -30,7 +32,9 @@
"type": "string"
}
},
"required": ["machineType"]
"required": [
"machineType"
]
},
"State": {
"type": "object",
Expand Down Expand Up @@ -73,7 +77,15 @@
"type": "string"
}
},
"required": ["id", "stateName", "machineType", "xStateEventType", "state", "createdAt", "updatedAt"]
"required": [
"id",
"stateName",
"machineType",
"xStateEventType",
"state",
"createdAt",
"updatedAt"
]
},
"NonPersistedMachineSnapshot": {
"$ref": "#/components/schemas/SaveStateArgs"
Expand Down Expand Up @@ -108,7 +120,12 @@
"type": "string"
}
},
"required": ["stateName", "machineType", "xStateEventType", "state"]
"required": [
"stateName",
"machineType",
"xStateEventType",
"state"
]
}
},
"methods": {
Expand Down Expand Up @@ -142,4 +159,4 @@
}
}
}
}
}
3 changes: 1 addition & 2 deletions packages/xstate-persistence/src/agent/XStatePersistence.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IAbstractXStateStore, State } from '@sphereon/ssi-sdk.data-store'
import { IAgentPlugin } from '@veramo/core'
import { IEventListener } from '@veramo/core/src/types/IAgent'

import {
DeleteExpiredStatesArgs,
Expand All @@ -21,7 +20,7 @@ import { IXStatePersistence, LoadActiveStateArgs } from '../types'
*
* @beta This API may change without a BREAKING CHANGE notice.
*/
export class XStatePersistence implements IAgentPlugin, IEventListener {
export class XStatePersistence implements IAgentPlugin {
readonly schema = schema.IXStatePersistence
readonly methods: IXStatePersistence
readonly eventTypes: Array<string>
Expand Down

0 comments on commit 99db568

Please sign in to comment.