@sphereon/ssi-sdk.data-store-types 0.37.2-next.14 → 0.37.2-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/contact/AbstractContactStore.ts","../src/digitalCredential/AbstractDigitalCredentialStore.ts","../src/issuanceBranding/AbstractIssuanceBrandingStore.ts","../src/eventLogger/AbstractEventLoggerStore.ts","../src/machineState/IAbstractMachineStateStore.ts","../src/presentationDefinition/AbstractPDStore.ts","../src/credentialDesign/AbstractCredentialDesignStore.ts","../src/types/contact/contact.ts","../src/types/digitalCredential/enums.ts","../src/types/credentialDesign/credentialDesign.ts","../src/utils/MappingUtils.ts"],"sourcesContent":["// import {PartyCorrelationType} from \"@sphereon/ssi-sdk.core\";\n\nexport { AbstractContactStore } from './contact/AbstractContactStore'\nexport { AbstractDigitalCredentialStore } from './digitalCredential/AbstractDigitalCredentialStore'\nexport { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'\nexport { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'\nexport { IAbstractMachineStateStore } from './machineState/IAbstractMachineStateStore'\nexport { AbstractPDStore } from './presentationDefinition/AbstractPDStore'\nexport { AbstractCredentialDesignStore } from './credentialDesign/AbstractCredentialDesignStore'\n\nexport * from './types'\nexport * from './utils/MappingUtils'\n","import {\n AddElectronicAddressArgs,\n AddIdentityArgs,\n AddPartyArgs,\n AddPartyTypeArgs,\n AddPhysicalAddressArgs,\n AddRelationshipArgs,\n ElectronicAddress,\n GetElectronicAddressArgs,\n GetElectronicAddressesArgs,\n GetIdentitiesArgs,\n GetIdentityArgs,\n GetPartiesArgs,\n GetPartyArgs,\n GetPartyTypeArgs,\n GetPartyTypesArgs,\n GetPhysicalAddressArgs,\n GetPhysicalAddressesArgs,\n GetRelationshipArgs,\n GetRelationshipsArgs,\n Identity,\n Party,\n PartyRelationship,\n PartyType,\n PhysicalAddress,\n RemoveElectronicAddressArgs,\n RemoveIdentityArgs,\n RemovePartyArgs,\n RemovePartyTypeArgs,\n RemovePhysicalAddressArgs,\n RemoveRelationshipArgs,\n UpdateElectronicAddressArgs,\n UpdateIdentityArgs,\n UpdatePartyArgs,\n UpdatePartyTypeArgs,\n UpdatePhysicalAddressArgs,\n UpdateRelationshipArgs,\n} from '../types'\n\nexport abstract class AbstractContactStore {\n abstract getParty(args: GetPartyArgs): Promise<Party>\n abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>\n abstract addParty(args: AddPartyArgs): Promise<Party>\n abstract updateParty(args: UpdatePartyArgs): Promise<Party>\n abstract removeParty(args: RemovePartyArgs): Promise<void>\n abstract getIdentity(args: GetIdentityArgs): Promise<Identity>\n abstract getIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>\n abstract addIdentity(args: AddIdentityArgs): Promise<Identity>\n abstract updateIdentity(args: UpdateIdentityArgs): Promise<Identity>\n abstract removeIdentity(args: RemoveIdentityArgs): Promise<void>\n abstract getRelationship(args: GetRelationshipArgs): Promise<PartyRelationship>\n abstract getRelationships(args?: GetRelationshipsArgs): Promise<Array<PartyRelationship>>\n abstract addRelationship(args: AddRelationshipArgs): Promise<PartyRelationship>\n abstract updateRelationship(args: UpdateRelationshipArgs): Promise<PartyRelationship>\n abstract removeRelationship(args: RemoveRelationshipArgs): Promise<void>\n abstract getPartyType(args: GetPartyTypeArgs): Promise<PartyType>\n abstract getPartyTypes(args?: GetPartyTypesArgs): Promise<Array<PartyType>>\n abstract addPartyType(args: AddPartyTypeArgs): Promise<PartyType>\n abstract updatePartyType(args: UpdatePartyTypeArgs): Promise<PartyType>\n abstract removePartyType(args: RemovePartyTypeArgs): Promise<void>\n abstract getElectronicAddress(args: GetElectronicAddressArgs): Promise<ElectronicAddress>\n abstract getElectronicAddresses(args?: GetElectronicAddressesArgs): Promise<Array<ElectronicAddress>>\n abstract addElectronicAddress(args: AddElectronicAddressArgs): Promise<ElectronicAddress>\n abstract updateElectronicAddress(args: UpdateElectronicAddressArgs): Promise<ElectronicAddress>\n abstract removeElectronicAddress(args: RemoveElectronicAddressArgs): Promise<void>\n abstract getPhysicalAddress(args: GetPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract getPhysicalAddresses(args?: GetPhysicalAddressesArgs): Promise<Array<PhysicalAddress>>\n abstract addPhysicalAddress(args: AddPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract updatePhysicalAddress(args: UpdatePhysicalAddressArgs): Promise<PhysicalAddress>\n abstract removePhysicalAddress(args: RemovePhysicalAddressArgs): Promise<void>\n}\n","import {\n AddCredentialArgs,\n DigitalCredential,\n GetCredentialArgs,\n GetCredentialsArgs,\n GetCredentialsResponse,\n RemoveCredentialArgs,\n UpdateCredentialArgs,\n UpdateCredentialStateArgs,\n} from '../types'\n\nexport abstract class AbstractDigitalCredentialStore {\n abstract getCredential(args: GetCredentialArgs): Promise<DigitalCredential>\n\n abstract getCredentials(args?: GetCredentialsArgs): Promise<GetCredentialsResponse>\n\n abstract addCredential(args: AddCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredential(args: UpdateCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredentialState(args: UpdateCredentialStateArgs): Promise<DigitalCredential>\n\n abstract removeCredential(args: RemoveCredentialArgs): Promise<boolean>\n}\n","import type {\n IAddCredentialBrandingArgs,\n IAddCredentialLocaleBrandingArgs,\n IAddIssuerBrandingArgs,\n IAddIssuerLocaleBrandingArgs,\n ICredentialBranding,\n ICredentialLocaleBranding,\n IGetCredentialBrandingArgs,\n IGetCredentialLocaleBrandingArgs,\n IGetIssuerBrandingArgs,\n IGetIssuerLocaleBrandingArgs,\n IIssuerBranding,\n IIssuerLocaleBranding,\n IRemoveCredentialBrandingArgs,\n IRemoveCredentialLocaleBrandingArgs,\n IRemoveIssuerBrandingArgs,\n IRemoveIssuerLocaleBrandingArgs,\n IUpdateCredentialBrandingArgs,\n IUpdateCredentialLocaleBrandingArgs,\n IUpdateIssuerBrandingArgs,\n IUpdateIssuerLocaleBrandingArgs,\n} from '../types'\n\nexport abstract class AbstractIssuanceBrandingStore {\n public abstract addCredentialBranding(args: IAddCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialBranding(args?: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>>\n public abstract updateCredentialBranding(args: IUpdateCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract removeCredentialBranding(args: IRemoveCredentialBrandingArgs): Promise<void>\n public abstract addCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialLocaleBranding(args?: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>>\n public abstract updateCredentialLocaleBranding(args: IUpdateCredentialLocaleBrandingArgs): Promise<ICredentialLocaleBranding>\n public abstract removeCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs): Promise<void>\n public abstract addIssuerBranding(args: IAddIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerBranding(args?: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>>\n public abstract updateIssuerBranding(args: IUpdateIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract removeIssuerBranding(args: IRemoveIssuerBrandingArgs): Promise<void>\n public abstract addIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerLocaleBranding(args?: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>>\n public abstract updateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs): Promise<IIssuerLocaleBranding>\n public abstract removeIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs): Promise<void>\n}\n","import type { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'\nimport type { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'\n\nexport abstract class AbstractEventLoggerStore {\n abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>\n abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>\n abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>\n abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>\n}\n","import type {\n StoreMachineStateDeleteExpiredArgs,\n StoreMachineStateDeleteArgs,\n StoreMachineStatesFindActiveArgs,\n StoreFindMachineStatesArgs,\n StoreMachineStatePersistArgs,\n StoreMachineStateInfo,\n StoreMachineStateGetArgs,\n} from '../types'\n\n/**\n * Represents an abstract class for storing machine states.\n * This class provides methods for persisting, retrieving, and deleting machine states.\n *\n * @interface\n */\nexport abstract class IAbstractMachineStateStore {\n /**\n * Persists the machine state.\n *\n * @param {StoreMachineStatePersistArgs} state - The object containing the machine state to persist.\n * @return {Promise<StoreMachineStateInfo>} - A Promise that resolves to the information about the persisted machine state.\n */\n abstract persistMachineState(state: StoreMachineStatePersistArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds active machine states based on the given arguments.\n *\n * @param {StoreMachineStatesFindActiveArgs} args - The arguments for finding active machine states.\n * @return {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves with an array of active machine states.\n */\n abstract findActiveMachineStates(args: StoreMachineStatesFindActiveArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Retrieves the state of a particular machine.\n *\n * @param {StoreMachineStateGetArgs} args - The arguments for retrieving the machine state.\n * @returns {Promise<StoreMachineStateInfo>} - A promise that resolves to the machine state information.\n */\n abstract getMachineState(args: StoreMachineStateGetArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds the machine states based on the given arguments.\n *\n * @param {StoreFindMachineStatesArgs} [args] - The arguments to filter the machine states.\n * @returns {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves to an array of machine state information.\n */\n abstract findMachineStates(args?: StoreFindMachineStatesArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Deletes a machine state.\n *\n * @param {StoreMachineStateDeleteArgs} args - The arguments for deleting the machine state.\n * @return {Promise<boolean>} - A promise that resolves to a boolean indicating if the machine state was successfully deleted or not.\n */\n abstract deleteMachineState(args: StoreMachineStateDeleteArgs): Promise<boolean>\n\n /**\n * Deletes expired machine states from the database.\n *\n * @param {StoreMachineStateDeleteExpiredArgs} args - The arguments for deleting expired machine states.\n * @return {Promise<number>} - A promise that resolves to the number of deleted machine states.\n */\n abstract deleteExpiredMachineStates(args: StoreMachineStateDeleteExpiredArgs): Promise<number>\n}\n","import type {\n GetDefinitionArgs,\n GetDefinitionsArgs,\n DeleteDefinitionArgs,\n DcqlQueryItem,\n AddDefinitionArgs,\n UpdateDefinitionArgs,\n DeleteDefinitionsArgs,\n} from '../types'\n\nexport abstract class AbstractPDStore {\n abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>\n abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>\n abstract getDefinition(args: GetDefinitionArgs): Promise<DcqlQueryItem>\n abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<DcqlQueryItem>>\n abstract addDefinition(args: AddDefinitionArgs): Promise<DcqlQueryItem>\n abstract updateDefinition(args: UpdateDefinitionArgs): Promise<DcqlQueryItem>\n abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>\n abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>\n}\n","import {\n CredentialDesign,\n GetCredentialDesignArgs,\n GetCredentialDesignsArgs,\n AddCredentialDesignArgs,\n UpdateCredentialDesignArgs,\n RemoveCredentialDesignArgs\n} from '../types'\n\nexport abstract class AbstractCredentialDesignStore {\n abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>\n abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>\n abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>\n abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>\n abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>\n}\n","import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'\nimport { IIdentifier } from '@veramo/core'\nimport { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'\nimport { CredentialRole } from '@sphereon/ssi-types'\n\nexport type MetadataTypes = string | number | Date | boolean | undefined\n\nexport interface IMetadataEntity {\n // TODO move to types\n label: string\n stringValue?: string\n numberValue?: number\n dateValue?: Date\n boolValue?: boolean\n}\n\nexport type Party = {\n id: string\n uri?: string\n roles: Array<CredentialRole>\n ownerId?: string\n tenantId?: string\n identities: Array<Identity>\n electronicAddresses: Array<ElectronicAddress>\n physicalAddresses: Array<PhysicalAddress>\n contact: Contact\n partyType: PartyType\n /**\n * TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.\n *\n * Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:\n * 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).\n * 2. While it makes sense to have this combined type in the SDK, the logic to support database connections for these types is complex. The types belong to different modules, and we don't use them together currently.\n * 3. Implementing the full logic now would require significant changes and cross-module interactions, which we don't have the time to address at present.\n *\n * For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.\n */\n branding?: IIssuerLocaleBranding\n relationships: Array<PartyRelationship>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedParty = Omit<\n Party,\n | 'id'\n | 'identities'\n | 'electronicAddresses'\n | 'physicalAddresses'\n | 'contact'\n | 'roles'\n | 'partyType'\n | 'relationships'\n | 'createdAt'\n | 'lastUpdatedAt'\n> & {\n identities?: Array<NonPersistedIdentity>\n electronicAddresses?: Array<NonPersistedElectronicAddress>\n physicalAddresses?: Array<NonPersistedPhysicalAddress>\n contact: NonPersistedContact\n partyType: NonPersistedPartyType\n relationships?: Array<NonPersistedPartyRelationship>\n}\nexport type PartialParty = Partial<\n Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>\n> & {\n identities?: PartialIdentity\n electronicAddresses?: PartialElectronicAddress\n physicalAddresses?: PartialPhysicalAddress\n contact?: PartialContact\n partyType?: PartialPartyType\n relationships?: PartialPartyRelationship\n}\n\nexport type Identity = {\n id: string\n alias: string\n ownerId?: string\n tenantId?: string\n origin: IdentityOrigin\n roles: Array<CredentialRole>\n identifier: CorrelationIdentifier\n connection?: Connection\n metadata?: Array<MetadataItem<MetadataTypes>>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {\n origin: IdentityOrigin\n identifier: NonPersistedCorrelationIdentifier\n connection?: NonPersistedConnection\n metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>\n}\nexport type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {\n identifier?: PartialCorrelationIdentifier\n connection?: PartialConnection\n metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>\n origin?: IdentityOrigin\n roles?: CredentialRole\n partyId?: string\n}\n\nexport type MetadataItem<T extends MetadataTypes> = {\n id: string\n label: string\n value: T\n}\n\nexport type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>\nexport type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>\n\nexport type CorrelationIdentifier = {\n id: string\n ownerId?: string\n tenantId?: string\n type: CorrelationIdentifierType\n correlationId: string\n}\nexport type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>\nexport type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>\n\nexport type Connection = {\n id: string\n ownerId?: string\n tenantId?: string\n type: ConnectionType\n config: ConnectionConfig\n}\nexport type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {\n config: NonPersistedConnectionConfig\n}\nexport type PartialConnection = Partial<Omit<Connection, 'config'>> & {\n config: PartialConnectionConfig\n}\n\nexport type OpenIdConfig = {\n id: string\n clientId: string\n clientSecret?: string\n ownerId?: string\n tenantId?: string\n scopes: Array<string>\n issuer: string\n redirectUrl: string\n dangerouslyAllowInsecureHttpRequests: boolean\n clientAuthMethod: 'basic' | 'post' | undefined\n}\nexport type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>\nexport type PartialOpenIdConfig = Partial<OpenIdConfig>\n\nexport type DidAuthConfig = {\n id: string\n idOpts: ManagedIdentifierOptsOrResult\n stateId: string\n ownerId?: string\n tenantId?: string\n redirectUrl: string\n sessionId: string\n}\nexport type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>\nexport type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {\n identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier\n}\n\nexport type ConnectionConfig = OpenIdConfig | DidAuthConfig\nexport type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig\nexport type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig\n\nexport type NaturalPerson = {\n id: string\n firstName: string\n lastName: string\n middleName?: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\n\nexport type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>\n\nexport type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Organization = {\n id: string\n legalName: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Contact = NaturalPerson | Organization\nexport type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization\nexport type PartialContact = PartialNaturalPerson | PartialOrganization\n\nexport type PartyType = {\n id: string\n type: PartyTypeType\n origin: PartyOrigin\n name: string\n tenantId: string\n description?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {\n id?: string\n}\nexport type PartialPartyType = Partial<PartyType>\n\nexport type PartyRelationship = {\n id: string\n leftId: string\n rightId: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPartyRelationship = Partial<PartyRelationship>\n\nexport type ElectronicAddress = {\n id: string\n type: ElectronicAddressType\n electronicAddress: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialElectronicAddress = Partial<ElectronicAddress> & {\n partyId?: string\n}\n\nexport type PhysicalAddress = {\n id: string\n type: PhysicalAddressType\n streetName: string\n streetNumber: string\n postalCode: string\n cityName: string\n provinceName: string\n countryCode: string\n buildingName?: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPhysicalAddress = Partial<PhysicalAddress> & {\n partyId?: string\n}\n\nexport type ElectronicAddressType = 'email' | 'phone'\n\nexport type PhysicalAddressType = 'home' | 'visit' | 'postal'\n\nexport enum ConnectionType {\n OPENID_CONNECT = 'OIDC',\n SIOPv2 = 'SIOPv2',\n SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',\n}\n\nexport enum CorrelationIdentifierType {\n DID = 'did',\n URL = 'url',\n}\n\nexport enum PartyTypeType {\n NATURAL_PERSON = 'naturalPerson',\n ORGANIZATION = 'organization',\n}\n\nexport enum PartyOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n\nexport enum IdentityOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n","export enum DocumentType {\n VC = 'VC',\n VP = 'VP',\n P = 'P',\n C = 'C',\n}\n\nexport enum RegulationType {\n PID = 'PID',\n QEAA = 'QEAA',\n EAA = 'EAA',\n NON_REGULATED = 'NON_REGULATED',\n}\n\nexport enum CredentialDocumentFormat {\n JSON_LD = 'JSON_LD',\n JWT = 'JWT',\n SD_JWT = 'SD_JWT',\n MSO_MDOC = 'MSO_MDOC',\n}\n\nexport namespace CredentialDocumentFormat {\n export function fromSpecValue(credentialFormat: string) {\n const format = credentialFormat.toLowerCase()\n if (format.includes('sd')) {\n return CredentialDocumentFormat.SD_JWT\n } else if (format.includes('ldp')) {\n return CredentialDocumentFormat.JSON_LD\n } else if (format.includes('mso') || credentialFormat.includes('mdoc')) {\n return CredentialDocumentFormat.MSO_MDOC\n } else if (format.includes('jwt_')) {\n return CredentialDocumentFormat.JWT\n } else {\n throw Error(`Could not map format ${format} to known format`)\n }\n }\n\n export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {\n switch (documentFormat) {\n case CredentialDocumentFormat.SD_JWT:\n return 'dc+sd-jwt'\n case CredentialDocumentFormat.MSO_MDOC:\n return 'mso_mdoc'\n case CredentialDocumentFormat.JSON_LD:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'\n case CredentialDocumentFormat.JWT:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'\n }\n }\n}\n\nexport enum CredentialCorrelationType {\n DID = 'DID',\n X509_SAN = 'X509_SAN',\n KID = 'KID',\n URL = 'URL',\n}\n\nexport enum CredentialStateType {\n REVOKED = 'REVOKED',\n VERIFIED = 'VERIFIED',\n EXPIRED = 'EXPIRED',\n}\n","import { IBasicImageAttributes, IImageAttributes } from '../issuanceBranding/issuanceBranding'\n\nexport enum ValueType {\n Text = 'Text',\n Number = 'Number',\n Boolean = 'Boolean',\n Date = 'Date',\n}\n\nexport type MetaDataValue = {\n id: string\n index?: number\n textValue?: string\n numberValue?: number\n booleanValue?: boolean\n timestampValue?: Date\n}\n\nexport type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>\n\nexport type MetaDataKey = {\n id: string\n key: string\n valueType: ValueType\n metaDataValues: Array<MetaDataValue>\n}\n\nexport type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {\n metaDataValues: Array<NonPersistedMetaDataValue>\n}\n\nexport type SchemaDefinition = {\n id: string\n tenantId?: string\n extendsId?: string\n correlationId?: string\n schemaType?: string\n entityType?: string\n schema: string\n}\n\nexport type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>\n\nexport type CredentialDesignBranding = {\n id: string\n textColor?: string\n backgroundColor?: string\n logo?: IImageAttributes\n backgroundImage?: IImageAttributes\n}\n\nexport type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {\n logo?: IBasicImageAttributes\n backgroundImage?: IBasicImageAttributes\n}\n\nexport type CredentialDesign = {\n id: string\n label: string\n tenantId?: string\n metaDataKeys: Array<MetaDataKey>\n schemaDefinitions: Array<SchemaDefinition>\n branding?: CredentialDesignBranding\n}\n\nexport type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {\n metaDataKeys?: Array<NonPersistedMetaDataKey>\n schemaDefinitions?: Array<NonPersistedSchemaDefinition>\n branding?: NonPersistedCredentialDesignBranding\n}\n","import { CredentialMapper, ObjectUtils } from '@sphereon/ssi-types'\n\nfunction isHex(input: string) {\n return input.match(/^([0-9A-Fa-f])+$/g) !== null\n}\n\nexport function ensureRawDocument(input: string | object): string {\n if (typeof input === 'string') {\n if (isHex(input) || ObjectUtils.isBase64(input)) {\n // mso_mdoc\n return input\n } else if (CredentialMapper.isJwtEncoded(input) || CredentialMapper.isSdJwtEncoded(input)) {\n return input\n }\n throw Error('Unknown input to be mapped as rawDocument')\n }\n\n try {\n return JSON.stringify(input)\n } catch (e) {\n throw new Error(`Can't stringify to a raw credential: ${input}`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;ACuCO,IAAeA,uBAAf,MAAeA;EAAtB,OAAsBA;;;AA+BtB;;;AC3DO,IAAeC,iCAAf,MAAeA;EAAtB,OAAsBA;;;AAYtB;;;ACAO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAiBtB;;;ACrCO,IAAeC,2BAAf,MAAeA;EAAtB,OAAsBA;;;AAKtB;;;ACQO,IAAeC,6BAAf,MAAeA;EANtB,OAMsBA;;;AAgDtB;;;ACtDO,IAAeC,kBAAf,MAAeA;EAAtB,OAAsBA;;;AAStB;;;ACVO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAMtB;;;AC+PO,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;SAAAA;;AAML,IAAKC,4BAAAA,0BAAAA,4BAAAA;;;SAAAA;;AAKL,IAAKC,gBAAAA,0BAAAA,gBAAAA;;;SAAAA;;AAKL,IAAKC,cAAAA,0BAAAA,cAAAA;;;SAAAA;;AAKL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;SAAAA;;;;ACnSL,IAAKC,eAAAA,0BAAAA,eAAAA;;;;;SAAAA;;AAOL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;;SAAAA;;AAOL,IAAKC,2BAAAA,0BAAAA,2BAAAA;;;;;SAAAA;;UAOKA,2BAAAA;AACR,WAASC,cAAcC,kBAAwB;AACpD,UAAMC,SAASD,iBAAiBE,YAAW;AAC3C,QAAID,OAAOE,SAAS,IAAA,GAAO;AACzB,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,GAAQ;AACjC,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,KAAUH,iBAAiBG,SAAS,MAAA,GAAS;AACtE,aAAA;IACF,WAAWF,OAAOE,SAAS,MAAA,GAAS;AAClC,aAAA;IACF,OAAO;AACL,YAAMC,MAAM,wBAAwBH,MAAAA,kBAAwB;IAC9D;EACF;AAbgBF;4BAAAA,gBAAAA;AAeT,WAASM,YAAYC,gBAA0CC,cAA0B;AAC9F,YAAQD,gBAAAA;MACN,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAOC,iBAAAA,OAAmCA,iBAAAA,OAAmC,WAAW;MAC1F,KAAA;AACE,eAAOA,iBAAAA,OAAmCA,iBAAAA,OAAmC,gBAAgB;IACjG;EACF;AAXgBF;4BAAAA,cAAAA;AAYlB,GA5BiBP,6BAAAA,2BAAAA,CAAAA,EAAAA;AA8BV,IAAKU,4BAAAA,0BAAAA,4BAAAA;;;;;SAAAA;;AAOL,IAAKC,sBAAAA,0BAAAA,sBAAAA;;;;SAAAA;;;;ACxDL,IAAKC,YAAAA,0BAAAA,YAAAA;;;;;SAAAA;;;;ACFZ,uBAA8C;AAE9C,SAASC,MAAMC,OAAa;AAC1B,SAAOA,MAAMC,MAAM,mBAAA,MAAyB;AAC9C;AAFSF;AAIF,SAASG,kBAAkBF,OAAsB;AACtD,MAAI,OAAOA,UAAU,UAAU;AAC7B,QAAID,MAAMC,KAAAA,KAAUG,6BAAYC,SAASJ,KAAAA,GAAQ;AAE/C,aAAOA;IACT,WAAWK,kCAAiBC,aAAaN,KAAAA,KAAUK,kCAAiBE,eAAeP,KAAAA,GAAQ;AACzF,aAAOA;IACT;AACA,UAAMQ,MAAM,2CAAA;EACd;AAEA,MAAI;AACF,WAAOC,KAAKC,UAAUV,KAAAA;EACxB,SAASW,GAAG;AACV,UAAM,IAAIH,MAAM,wCAAwCR,KAAAA,EAAO;EACjE;AACF;AAhBgBE;","names":["AbstractContactStore","AbstractDigitalCredentialStore","AbstractIssuanceBrandingStore","AbstractEventLoggerStore","IAbstractMachineStateStore","AbstractPDStore","AbstractCredentialDesignStore","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","ValueType","isHex","input","match","ensureRawDocument","ObjectUtils","isBase64","CredentialMapper","isJwtEncoded","isSdJwtEncoded","Error","JSON","stringify","e"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/contact/AbstractContactStore.ts","../src/digitalCredential/AbstractDigitalCredentialStore.ts","../src/issuanceBranding/AbstractIssuanceBrandingStore.ts","../src/eventLogger/AbstractEventLoggerStore.ts","../src/machineState/IAbstractMachineStateStore.ts","../src/presentationDefinition/AbstractPDStore.ts","../src/credentialDesign/AbstractCredentialDesignStore.ts","../src/types/contact/contact.ts","../src/types/digitalCredential/enums.ts","../src/types/credentialDesign/credentialDesign.ts","../src/utils/MappingUtils.ts"],"sourcesContent":["// import {PartyCorrelationType} from \"@sphereon/ssi-sdk.core\";\n\nexport { AbstractContactStore } from './contact/AbstractContactStore'\nexport { AbstractDigitalCredentialStore } from './digitalCredential/AbstractDigitalCredentialStore'\nexport { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'\nexport { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'\nexport { IAbstractMachineStateStore } from './machineState/IAbstractMachineStateStore'\nexport { AbstractPDStore } from './presentationDefinition/AbstractPDStore'\nexport { AbstractCredentialDesignStore } from './credentialDesign/AbstractCredentialDesignStore'\n\nexport * from './types'\nexport * from './utils/MappingUtils'\n","import {\n AddElectronicAddressArgs,\n AddIdentityArgs,\n AddPartyArgs,\n AddPartyTypeArgs,\n AddPhysicalAddressArgs,\n AddRelationshipArgs,\n ElectronicAddress,\n GetElectronicAddressArgs,\n GetElectronicAddressesArgs,\n GetIdentitiesArgs,\n GetIdentityArgs,\n GetPartiesArgs,\n GetPartyArgs,\n GetPartyTypeArgs,\n GetPartyTypesArgs,\n GetPhysicalAddressArgs,\n GetPhysicalAddressesArgs,\n GetRelationshipArgs,\n GetRelationshipsArgs,\n Identity,\n Party,\n PartyRelationship,\n PartyType,\n PhysicalAddress,\n RemoveElectronicAddressArgs,\n RemoveIdentityArgs,\n RemovePartyArgs,\n RemovePartyTypeArgs,\n RemovePhysicalAddressArgs,\n RemoveRelationshipArgs,\n UpdateElectronicAddressArgs,\n UpdateIdentityArgs,\n UpdatePartyArgs,\n UpdatePartyTypeArgs,\n UpdatePhysicalAddressArgs,\n UpdateRelationshipArgs,\n} from '../types'\n\nexport abstract class AbstractContactStore {\n abstract getParty(args: GetPartyArgs): Promise<Party>\n abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>\n abstract addParty(args: AddPartyArgs): Promise<Party>\n abstract updateParty(args: UpdatePartyArgs): Promise<Party>\n abstract removeParty(args: RemovePartyArgs): Promise<void>\n abstract getIdentity(args: GetIdentityArgs): Promise<Identity>\n abstract getIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>\n abstract addIdentity(args: AddIdentityArgs): Promise<Identity>\n abstract updateIdentity(args: UpdateIdentityArgs): Promise<Identity>\n abstract removeIdentity(args: RemoveIdentityArgs): Promise<void>\n abstract getRelationship(args: GetRelationshipArgs): Promise<PartyRelationship>\n abstract getRelationships(args?: GetRelationshipsArgs): Promise<Array<PartyRelationship>>\n abstract addRelationship(args: AddRelationshipArgs): Promise<PartyRelationship>\n abstract updateRelationship(args: UpdateRelationshipArgs): Promise<PartyRelationship>\n abstract removeRelationship(args: RemoveRelationshipArgs): Promise<void>\n abstract getPartyType(args: GetPartyTypeArgs): Promise<PartyType>\n abstract getPartyTypes(args?: GetPartyTypesArgs): Promise<Array<PartyType>>\n abstract addPartyType(args: AddPartyTypeArgs): Promise<PartyType>\n abstract updatePartyType(args: UpdatePartyTypeArgs): Promise<PartyType>\n abstract removePartyType(args: RemovePartyTypeArgs): Promise<void>\n abstract getElectronicAddress(args: GetElectronicAddressArgs): Promise<ElectronicAddress>\n abstract getElectronicAddresses(args?: GetElectronicAddressesArgs): Promise<Array<ElectronicAddress>>\n abstract addElectronicAddress(args: AddElectronicAddressArgs): Promise<ElectronicAddress>\n abstract updateElectronicAddress(args: UpdateElectronicAddressArgs): Promise<ElectronicAddress>\n abstract removeElectronicAddress(args: RemoveElectronicAddressArgs): Promise<void>\n abstract getPhysicalAddress(args: GetPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract getPhysicalAddresses(args?: GetPhysicalAddressesArgs): Promise<Array<PhysicalAddress>>\n abstract addPhysicalAddress(args: AddPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract updatePhysicalAddress(args: UpdatePhysicalAddressArgs): Promise<PhysicalAddress>\n abstract removePhysicalAddress(args: RemovePhysicalAddressArgs): Promise<void>\n}\n","import {\n AddCredentialArgs,\n DigitalCredential,\n GetCredentialArgs,\n GetCredentialsArgs,\n GetCredentialsResponse,\n RemoveCredentialArgs,\n UpdateCredentialArgs,\n UpdateCredentialStateArgs,\n} from '../types'\n\nexport abstract class AbstractDigitalCredentialStore {\n abstract getCredential(args: GetCredentialArgs): Promise<DigitalCredential>\n\n abstract getCredentials(args?: GetCredentialsArgs): Promise<GetCredentialsResponse>\n\n abstract addCredential(args: AddCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredential(args: UpdateCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredentialState(args: UpdateCredentialStateArgs): Promise<DigitalCredential>\n\n abstract removeCredential(args: RemoveCredentialArgs): Promise<boolean>\n}\n","import type {\n IAddCredentialBrandingArgs,\n IAddCredentialLocaleBrandingArgs,\n IAddIssuerBrandingArgs,\n IAddIssuerLocaleBrandingArgs,\n ICredentialBranding,\n ICredentialLocaleBranding,\n IGetCredentialBrandingArgs,\n IGetCredentialLocaleBrandingArgs,\n IGetIssuerBrandingArgs,\n IGetIssuerLocaleBrandingArgs,\n IIssuerBranding,\n IIssuerLocaleBranding,\n IRemoveCredentialBrandingArgs,\n IRemoveCredentialLocaleBrandingArgs,\n IRemoveIssuerBrandingArgs,\n IRemoveIssuerLocaleBrandingArgs,\n IUpdateCredentialBrandingArgs,\n IUpdateCredentialLocaleBrandingArgs,\n IUpdateIssuerBrandingArgs,\n IUpdateIssuerLocaleBrandingArgs,\n} from '../types'\n\nexport abstract class AbstractIssuanceBrandingStore {\n public abstract addCredentialBranding(args: IAddCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialBranding(args?: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>>\n public abstract updateCredentialBranding(args: IUpdateCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract removeCredentialBranding(args: IRemoveCredentialBrandingArgs): Promise<void>\n public abstract addCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialLocaleBranding(args?: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>>\n public abstract updateCredentialLocaleBranding(args: IUpdateCredentialLocaleBrandingArgs): Promise<ICredentialLocaleBranding>\n public abstract removeCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs): Promise<void>\n public abstract addIssuerBranding(args: IAddIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerBranding(args?: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>>\n public abstract updateIssuerBranding(args: IUpdateIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract removeIssuerBranding(args: IRemoveIssuerBrandingArgs): Promise<void>\n public abstract addIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerLocaleBranding(args?: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>>\n public abstract updateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs): Promise<IIssuerLocaleBranding>\n public abstract removeIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs): Promise<void>\n}\n","import type { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'\nimport type { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'\n\nexport abstract class AbstractEventLoggerStore {\n abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>\n abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>\n abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>\n abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>\n}\n","import type {\n StoreMachineStateDeleteExpiredArgs,\n StoreMachineStateDeleteArgs,\n StoreMachineStatesFindActiveArgs,\n StoreFindMachineStatesArgs,\n StoreMachineStatePersistArgs,\n StoreMachineStateInfo,\n StoreMachineStateGetArgs,\n} from '../types'\n\n/**\n * Represents an abstract class for storing machine states.\n * This class provides methods for persisting, retrieving, and deleting machine states.\n *\n * @interface\n */\nexport abstract class IAbstractMachineStateStore {\n /**\n * Persists the machine state.\n *\n * @param {StoreMachineStatePersistArgs} state - The object containing the machine state to persist.\n * @return {Promise<StoreMachineStateInfo>} - A Promise that resolves to the information about the persisted machine state.\n */\n abstract persistMachineState(state: StoreMachineStatePersistArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds active machine states based on the given arguments.\n *\n * @param {StoreMachineStatesFindActiveArgs} args - The arguments for finding active machine states.\n * @return {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves with an array of active machine states.\n */\n abstract findActiveMachineStates(args: StoreMachineStatesFindActiveArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Retrieves the state of a particular machine.\n *\n * @param {StoreMachineStateGetArgs} args - The arguments for retrieving the machine state.\n * @returns {Promise<StoreMachineStateInfo>} - A promise that resolves to the machine state information.\n */\n abstract getMachineState(args: StoreMachineStateGetArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds the machine states based on the given arguments.\n *\n * @param {StoreFindMachineStatesArgs} [args] - The arguments to filter the machine states.\n * @returns {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves to an array of machine state information.\n */\n abstract findMachineStates(args?: StoreFindMachineStatesArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Deletes a machine state.\n *\n * @param {StoreMachineStateDeleteArgs} args - The arguments for deleting the machine state.\n * @return {Promise<boolean>} - A promise that resolves to a boolean indicating if the machine state was successfully deleted or not.\n */\n abstract deleteMachineState(args: StoreMachineStateDeleteArgs): Promise<boolean>\n\n /**\n * Deletes expired machine states from the database.\n *\n * @param {StoreMachineStateDeleteExpiredArgs} args - The arguments for deleting expired machine states.\n * @return {Promise<number>} - A promise that resolves to the number of deleted machine states.\n */\n abstract deleteExpiredMachineStates(args: StoreMachineStateDeleteExpiredArgs): Promise<number>\n}\n","import type {\n GetDefinitionArgs,\n GetDefinitionsArgs,\n DeleteDefinitionArgs,\n DcqlQueryItem,\n AddDefinitionArgs,\n UpdateDefinitionArgs,\n DeleteDefinitionsArgs,\n} from '../types'\n\nexport abstract class AbstractPDStore {\n abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>\n abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>\n abstract getDefinition(args: GetDefinitionArgs): Promise<DcqlQueryItem>\n abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<DcqlQueryItem>>\n abstract addDefinition(args: AddDefinitionArgs): Promise<DcqlQueryItem>\n abstract updateDefinition(args: UpdateDefinitionArgs): Promise<DcqlQueryItem>\n abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>\n abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>\n}\n","import {\n CredentialDesign,\n GetCredentialDesignArgs,\n GetCredentialDesignsArgs,\n CountCredentialDesignsArgs,\n FormStepGetOrCreateArgs,\n AddCredentialDesignArgs,\n UpdateCredentialDesignArgs,\n RemoveCredentialDesignArgs\n} from '../types'\n\nexport abstract class AbstractCredentialDesignStore {\n abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>\n abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>\n abstract countCredentialDesigns(args?: CountCredentialDesignsArgs): Promise<number>\n abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>\n abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>\n abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>\n abstract formStepGetOrCreate(args: FormStepGetOrCreateArgs): Promise<string>\n}\n","import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'\nimport { IIdentifier } from '@veramo/core'\nimport { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'\nimport { CredentialRole } from '@sphereon/ssi-types'\n\nexport type MetadataTypes = string | number | Date | boolean | undefined\n\nexport interface IMetadataEntity {\n // TODO move to types\n label: string\n stringValue?: string\n numberValue?: number\n dateValue?: Date\n boolValue?: boolean\n}\n\nexport type Party = {\n id: string\n uri?: string\n roles: Array<CredentialRole>\n ownerId?: string\n tenantId?: string\n identities: Array<Identity>\n electronicAddresses: Array<ElectronicAddress>\n physicalAddresses: Array<PhysicalAddress>\n contact: Contact\n partyType: PartyType\n /**\n * TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.\n *\n * Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:\n * 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).\n * 2. While it makes sense to have this combined type in the SDK, the logic to support database connections for these types is complex. The types belong to different modules, and we don't use them together currently.\n * 3. Implementing the full logic now would require significant changes and cross-module interactions, which we don't have the time to address at present.\n *\n * For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.\n */\n branding?: IIssuerLocaleBranding\n relationships: Array<PartyRelationship>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedParty = Omit<\n Party,\n | 'id'\n | 'identities'\n | 'electronicAddresses'\n | 'physicalAddresses'\n | 'contact'\n | 'roles'\n | 'partyType'\n | 'relationships'\n | 'createdAt'\n | 'lastUpdatedAt'\n> & {\n identities?: Array<NonPersistedIdentity>\n electronicAddresses?: Array<NonPersistedElectronicAddress>\n physicalAddresses?: Array<NonPersistedPhysicalAddress>\n contact: NonPersistedContact\n partyType: NonPersistedPartyType\n relationships?: Array<NonPersistedPartyRelationship>\n}\nexport type PartialParty = Partial<\n Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>\n> & {\n identities?: PartialIdentity\n electronicAddresses?: PartialElectronicAddress\n physicalAddresses?: PartialPhysicalAddress\n contact?: PartialContact\n partyType?: PartialPartyType\n relationships?: PartialPartyRelationship\n}\n\nexport type Identity = {\n id: string\n alias: string\n ownerId?: string\n tenantId?: string\n origin: IdentityOrigin\n roles: Array<CredentialRole>\n identifier: CorrelationIdentifier\n connection?: Connection\n metadata?: Array<MetadataItem<MetadataTypes>>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {\n origin: IdentityOrigin\n identifier: NonPersistedCorrelationIdentifier\n connection?: NonPersistedConnection\n metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>\n}\nexport type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {\n identifier?: PartialCorrelationIdentifier\n connection?: PartialConnection\n metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>\n origin?: IdentityOrigin\n roles?: CredentialRole\n partyId?: string\n}\n\nexport type MetadataItem<T extends MetadataTypes> = {\n id: string\n label: string\n value: T\n}\n\nexport type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>\nexport type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>\n\nexport type CorrelationIdentifier = {\n id: string\n ownerId?: string\n tenantId?: string\n type: CorrelationIdentifierType\n correlationId: string\n}\nexport type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>\nexport type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>\n\nexport type Connection = {\n id: string\n ownerId?: string\n tenantId?: string\n type: ConnectionType\n config: ConnectionConfig\n}\nexport type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {\n config: NonPersistedConnectionConfig\n}\nexport type PartialConnection = Partial<Omit<Connection, 'config'>> & {\n config: PartialConnectionConfig\n}\n\nexport type OpenIdConfig = {\n id: string\n clientId: string\n clientSecret?: string\n ownerId?: string\n tenantId?: string\n scopes: Array<string>\n issuer: string\n redirectUrl: string\n dangerouslyAllowInsecureHttpRequests: boolean\n clientAuthMethod: 'basic' | 'post' | undefined\n}\nexport type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>\nexport type PartialOpenIdConfig = Partial<OpenIdConfig>\n\nexport type DidAuthConfig = {\n id: string\n idOpts: ManagedIdentifierOptsOrResult\n stateId: string\n ownerId?: string\n tenantId?: string\n redirectUrl: string\n sessionId: string\n}\nexport type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>\nexport type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {\n identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier\n}\n\nexport type ConnectionConfig = OpenIdConfig | DidAuthConfig\nexport type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig\nexport type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig\n\nexport type NaturalPerson = {\n id: string\n firstName: string\n lastName: string\n middleName?: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\n\nexport type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>\n\nexport type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Organization = {\n id: string\n legalName: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Contact = NaturalPerson | Organization\nexport type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization\nexport type PartialContact = PartialNaturalPerson | PartialOrganization\n\nexport type PartyType = {\n id: string\n type: PartyTypeType\n origin: PartyOrigin\n name: string\n tenantId: string\n description?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {\n id?: string\n}\nexport type PartialPartyType = Partial<PartyType>\n\nexport type PartyRelationship = {\n id: string\n leftId: string\n rightId: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPartyRelationship = Partial<PartyRelationship>\n\nexport type ElectronicAddress = {\n id: string\n type: ElectronicAddressType\n electronicAddress: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialElectronicAddress = Partial<ElectronicAddress> & {\n partyId?: string\n}\n\nexport type PhysicalAddress = {\n id: string\n type: PhysicalAddressType\n streetName: string\n streetNumber: string\n postalCode: string\n cityName: string\n provinceName: string\n countryCode: string\n buildingName?: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPhysicalAddress = Partial<PhysicalAddress> & {\n partyId?: string\n}\n\nexport type ElectronicAddressType = 'email' | 'phone'\n\nexport type PhysicalAddressType = 'home' | 'visit' | 'postal'\n\nexport enum ConnectionType {\n OPENID_CONNECT = 'OIDC',\n SIOPv2 = 'SIOPv2',\n SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',\n}\n\nexport enum CorrelationIdentifierType {\n DID = 'did',\n URL = 'url',\n}\n\nexport enum PartyTypeType {\n NATURAL_PERSON = 'naturalPerson',\n ORGANIZATION = 'organization',\n}\n\nexport enum PartyOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n\nexport enum IdentityOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n","export enum DocumentType {\n VC = 'VC',\n VP = 'VP',\n P = 'P',\n C = 'C',\n}\n\nexport enum RegulationType {\n PID = 'PID',\n QEAA = 'QEAA',\n EAA = 'EAA',\n NON_REGULATED = 'NON_REGULATED',\n}\n\nexport enum CredentialDocumentFormat {\n JSON_LD = 'JSON_LD',\n JWT = 'JWT',\n SD_JWT = 'SD_JWT',\n MSO_MDOC = 'MSO_MDOC',\n}\n\nexport namespace CredentialDocumentFormat {\n export function fromSpecValue(credentialFormat: string) {\n const format = credentialFormat.toLowerCase()\n if (format.includes('sd')) {\n return CredentialDocumentFormat.SD_JWT\n } else if (format.includes('ldp')) {\n return CredentialDocumentFormat.JSON_LD\n } else if (format.includes('mso') || credentialFormat.includes('mdoc')) {\n return CredentialDocumentFormat.MSO_MDOC\n } else if (format.includes('jwt_')) {\n return CredentialDocumentFormat.JWT\n } else {\n throw Error(`Could not map format ${format} to known format`)\n }\n }\n\n export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {\n switch (documentFormat) {\n case CredentialDocumentFormat.SD_JWT:\n return 'dc+sd-jwt'\n case CredentialDocumentFormat.MSO_MDOC:\n return 'mso_mdoc'\n case CredentialDocumentFormat.JSON_LD:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'\n case CredentialDocumentFormat.JWT:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'\n }\n }\n}\n\nexport enum CredentialCorrelationType {\n DID = 'DID',\n X509_SAN = 'X509_SAN',\n KID = 'KID',\n URL = 'URL',\n}\n\nexport enum CredentialStateType {\n REVOKED = 'REVOKED',\n VERIFIED = 'VERIFIED',\n EXPIRED = 'EXPIRED',\n}\n","import { IBasicImageAttributes, IImageAttributes } from '../issuanceBranding/issuanceBranding'\n\nexport enum ValueType {\n Text = 'Text',\n Number = 'Number',\n Boolean = 'Boolean',\n Date = 'Date',\n}\n\nexport type MetadataValue = {\n id: string\n index?: number\n textValue?: string\n numberValue?: number\n booleanValue?: boolean\n timestampValue?: Date\n}\n\nexport type NonPersistedMetadataValue = Omit<MetadataValue, 'id'>\n\nexport type MetadataKey = {\n id: string\n key: string\n valueType: ValueType\n metadataValues: Array<MetadataValue>\n}\n\nexport type NonPersistedMetadataKey = Omit<MetadataKey, 'id' | 'metadataValues'> & {\n metadataValues: Array<NonPersistedMetadataValue>\n}\n\nexport type SchemaDefinition = {\n id: string\n tenantId?: string\n extendsId?: string\n correlationId?: string\n schemaType?: string\n entityType?: string\n schema: string\n}\n\nexport type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>\n\nexport type CredentialDesignBranding = {\n id: string\n textColor?: string\n backgroundColor?: string\n logo?: IImageAttributes\n backgroundImage?: IImageAttributes\n}\n\nexport type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {\n logo?: IBasicImageAttributes\n backgroundImage?: IBasicImageAttributes\n}\n\nexport type CredentialDesign = {\n id: string\n identifier: string\n tenantId?: string\n metadataKeys: Array<MetadataKey>\n schemaDefinitions: Array<SchemaDefinition>\n branding?: CredentialDesignBranding\n}\n\nexport type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metadataKeys' | 'schemaDefinitions' | 'branding'> & {\n metadataKeys?: Array<NonPersistedMetadataKey>\n schemaDefinitions?: Array<NonPersistedSchemaDefinition>\n branding?: NonPersistedCredentialDesignBranding\n}\n","import { CredentialMapper, ObjectUtils } from '@sphereon/ssi-types'\n\nfunction isHex(input: string) {\n return input.match(/^([0-9A-Fa-f])+$/g) !== null\n}\n\nexport function ensureRawDocument(input: string | object): string {\n if (typeof input === 'string') {\n if (isHex(input) || ObjectUtils.isBase64(input)) {\n // mso_mdoc\n return input\n } else if (CredentialMapper.isJwtEncoded(input) || CredentialMapper.isSdJwtEncoded(input)) {\n return input\n }\n throw Error('Unknown input to be mapped as rawDocument')\n }\n\n try {\n return JSON.stringify(input)\n } catch (e) {\n throw new Error(`Can't stringify to a raw credential: ${input}`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;ACuCO,IAAeA,uBAAf,MAAeA;EAAtB,OAAsBA;;;AA+BtB;;;AC3DO,IAAeC,iCAAf,MAAeA;EAAtB,OAAsBA;;;AAYtB;;;ACAO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAiBtB;;;ACrCO,IAAeC,2BAAf,MAAeA;EAAtB,OAAsBA;;;AAKtB;;;ACQO,IAAeC,6BAAf,MAAeA;EANtB,OAMsBA;;;AAgDtB;;;ACtDO,IAAeC,kBAAf,MAAeA;EAAtB,OAAsBA;;;AAStB;;;ACRO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAQtB;;;AC2PO,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;SAAAA;;AAML,IAAKC,4BAAAA,0BAAAA,4BAAAA;;;SAAAA;;AAKL,IAAKC,gBAAAA,0BAAAA,gBAAAA;;;SAAAA;;AAKL,IAAKC,cAAAA,0BAAAA,cAAAA;;;SAAAA;;AAKL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;SAAAA;;;;ACnSL,IAAKC,eAAAA,0BAAAA,eAAAA;;;;;SAAAA;;AAOL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;;SAAAA;;AAOL,IAAKC,2BAAAA,0BAAAA,2BAAAA;;;;;SAAAA;;UAOKA,2BAAAA;AACR,WAASC,cAAcC,kBAAwB;AACpD,UAAMC,SAASD,iBAAiBE,YAAW;AAC3C,QAAID,OAAOE,SAAS,IAAA,GAAO;AACzB,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,GAAQ;AACjC,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,KAAUH,iBAAiBG,SAAS,MAAA,GAAS;AACtE,aAAA;IACF,WAAWF,OAAOE,SAAS,MAAA,GAAS;AAClC,aAAA;IACF,OAAO;AACL,YAAMC,MAAM,wBAAwBH,MAAAA,kBAAwB;IAC9D;EACF;AAbgBF;4BAAAA,gBAAAA;AAeT,WAASM,YAAYC,gBAA0CC,cAA0B;AAC9F,YAAQD,gBAAAA;MACN,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAOC,iBAAAA,OAAmCA,iBAAAA,OAAmC,WAAW;MAC1F,KAAA;AACE,eAAOA,iBAAAA,OAAmCA,iBAAAA,OAAmC,gBAAgB;IACjG;EACF;AAXgBF;4BAAAA,cAAAA;AAYlB,GA5BiBP,6BAAAA,2BAAAA,CAAAA,EAAAA;AA8BV,IAAKU,4BAAAA,0BAAAA,4BAAAA;;;;;SAAAA;;AAOL,IAAKC,sBAAAA,0BAAAA,sBAAAA;;;;SAAAA;;;;ACxDL,IAAKC,YAAAA,0BAAAA,YAAAA;;;;;SAAAA;;;;ACFZ,uBAA8C;AAE9C,SAASC,MAAMC,OAAa;AAC1B,SAAOA,MAAMC,MAAM,mBAAA,MAAyB;AAC9C;AAFSF;AAIF,SAASG,kBAAkBF,OAAsB;AACtD,MAAI,OAAOA,UAAU,UAAU;AAC7B,QAAID,MAAMC,KAAAA,KAAUG,6BAAYC,SAASJ,KAAAA,GAAQ;AAE/C,aAAOA;IACT,WAAWK,kCAAiBC,aAAaN,KAAAA,KAAUK,kCAAiBE,eAAeP,KAAAA,GAAQ;AACzF,aAAOA;IACT;AACA,UAAMQ,MAAM,2CAAA;EACd;AAEA,MAAI;AACF,WAAOC,KAAKC,UAAUV,KAAAA;EACxB,SAASW,GAAG;AACV,UAAM,IAAIH,MAAM,wCAAwCR,KAAAA,EAAO;EACjE;AACF;AAhBgBE;","names":["AbstractContactStore","AbstractDigitalCredentialStore","AbstractIssuanceBrandingStore","AbstractEventLoggerStore","IAbstractMachineStateStore","AbstractPDStore","AbstractCredentialDesignStore","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","ValueType","isHex","input","match","ensureRawDocument","ObjectUtils","isBase64","CredentialMapper","isJwtEncoded","isSdJwtEncoded","Error","JSON","stringify","e"]}
package/dist/index.d.cts CHANGED
@@ -805,7 +805,7 @@ declare enum ValueType {
805
805
  Boolean = "Boolean",
806
806
  Date = "Date"
807
807
  }
808
- type MetaDataValue = {
808
+ type MetadataValue = {
809
809
  id: string;
810
810
  index?: number;
811
811
  textValue?: string;
@@ -813,15 +813,15 @@ type MetaDataValue = {
813
813
  booleanValue?: boolean;
814
814
  timestampValue?: Date;
815
815
  };
816
- type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>;
817
- type MetaDataKey = {
816
+ type NonPersistedMetadataValue = Omit<MetadataValue, 'id'>;
817
+ type MetadataKey = {
818
818
  id: string;
819
819
  key: string;
820
820
  valueType: ValueType;
821
- metaDataValues: Array<MetaDataValue>;
821
+ metadataValues: Array<MetadataValue>;
822
822
  };
823
- type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
824
- metaDataValues: Array<NonPersistedMetaDataValue>;
823
+ type NonPersistedMetadataKey = Omit<MetadataKey, 'id' | 'metadataValues'> & {
824
+ metadataValues: Array<NonPersistedMetadataValue>;
825
825
  };
826
826
  type SchemaDefinition = {
827
827
  id: string;
@@ -846,14 +846,14 @@ type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id'
846
846
  };
847
847
  type CredentialDesign = {
848
848
  id: string;
849
- label: string;
849
+ identifier: string;
850
850
  tenantId?: string;
851
- metaDataKeys: Array<MetaDataKey>;
851
+ metadataKeys: Array<MetadataKey>;
852
852
  schemaDefinitions: Array<SchemaDefinition>;
853
853
  branding?: CredentialDesignBranding;
854
854
  };
855
- type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
856
- metaDataKeys?: Array<NonPersistedMetaDataKey>;
855
+ type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metadataKeys' | 'schemaDefinitions' | 'branding'> & {
856
+ metadataKeys?: Array<NonPersistedMetadataKey>;
857
857
  schemaDefinitions?: Array<NonPersistedSchemaDefinition>;
858
858
  branding?: NonPersistedCredentialDesignBranding;
859
859
  };
@@ -865,18 +865,29 @@ type GetCredentialDesignsArgs = {
865
865
  filter?: {
866
866
  tenantId?: string;
867
867
  };
868
+ limit?: number;
869
+ offset?: number;
870
+ };
871
+ type CountCredentialDesignsArgs = {
872
+ filter?: {
873
+ tenantId?: string;
874
+ };
875
+ };
876
+ type FormStepGetOrCreateArgs = {
877
+ formStepId: string;
868
878
  };
869
879
  type AddCredentialDesignArgs = {
870
- name: string;
880
+ identifier: string;
871
881
  tenantId?: string;
872
882
  design?: NonPersistedCredentialDesign;
883
+ formStepId?: string;
873
884
  };
874
885
  type RemoveCredentialDesignArgs = {
875
886
  credentialDesignId: string;
876
887
  };
877
888
  type UpdateCredentialDesignArgs = {
878
889
  credentialDesignId: string;
879
- name?: string;
890
+ identifier?: string;
880
891
  tenantId?: string;
881
892
  design?: Partial<NonPersistedCredentialDesign>;
882
893
  };
@@ -1014,11 +1025,13 @@ declare abstract class AbstractPDStore {
1014
1025
  declare abstract class AbstractCredentialDesignStore {
1015
1026
  abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>;
1016
1027
  abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>;
1028
+ abstract countCredentialDesigns(args?: CountCredentialDesignsArgs): Promise<number>;
1017
1029
  abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>;
1018
1030
  abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>;
1019
1031
  abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>;
1032
+ abstract formStepGetOrCreate(args: FormStepGetOrCreateArgs): Promise<string>;
1020
1033
  }
1021
1034
 
1022
1035
  declare function ensureRawDocument(input: string | object): string;
1023
1036
 
1024
- export { AbstractContactStore, AbstractCredentialDesignStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, type AddCredentialDesignArgs, type AddDefinitionArgs, type AddElectronicAddressArgs, type AddIdentityArgs, type AddPartyArgs, type AddPartyTypeArgs, type AddPhysicalAddressArgs, type AddRelationshipArgs, type Connection, type ConnectionConfig, ConnectionType, type Contact, type CorrelationIdentifier, CorrelationIdentifierType, CredentialCorrelationType, type CredentialDesign, type CredentialDesignBranding, CredentialDocumentFormat, CredentialStateType, type DcqlQueryItem, type DcqlQueryItemFilter, type DeleteDefinitionArgs, type DeleteDefinitionsArgs, type DidAuthConfig, type DigitalCredential, DocumentType, type ElectronicAddress, type ElectronicAddressType, type FindActivityLoggingEventArgs, type FindAuditLoggingEventArgs, type FindCredentialBrandingArgs, type FindCredentialLocaleBrandingArgs, type FindDcqlQueryArgs, type FindDigitalCredentialArgs, type FindElectronicAddressArgs, type FindIdentityArgs, type FindIssuerBrandingArgs, type FindIssuerLocaleBrandingArgs, type FindMachineStatesFilterArgs, type FindPartyArgs, type FindPartyTypeArgs, type FindPhysicalAddressArgs, type FindRelationshipArgs, type GetActivityEventsArgs, type GetAuditEventsArgs, type GetCredentialArgs, type GetCredentialDesignArgs, type GetCredentialDesignsArgs, type GetCredentialsArgs, type GetCredentialsResponse, type GetDefinitionArgs, type GetDefinitionsArgs, type GetElectronicAddressArgs, type GetElectronicAddressesArgs, type GetIdentitiesArgs, type GetIdentityArgs, type GetPartiesArgs, type GetPartyArgs, type GetPartyTypeArgs, type GetPartyTypesArgs, type GetPhysicalAddressArgs, type GetPhysicalAddressesArgs, type GetRelationshipArgs, type GetRelationshipsArgs, type HasDefinitionArgs, type HasDefinitionsArgs, IAbstractMachineStateStore, type IAddCredentialBrandingArgs, type IAddCredentialLocaleBrandingArgs, type IAddIssuerBrandingArgs, type IAddIssuerLocaleBrandingArgs, type IBackgroundAttributes, type IBasicBackgroundAttributes, type IBasicCredentialBranding, type IBasicCredentialClaim, type IBasicCredentialLocaleBranding, type IBasicImageAttributes, type IBasicImageDimensions, type IBasicIssuerBranding, type IBasicIssuerLocaleBranding, type IBasicTextAttributes, type ICredentialBranding, type ICredentialBrandingFilter, type ICredentialClaim, type ICredentialLocaleBranding, type ICredentialLocaleBrandingFilter, type IGetCredentialBrandingArgs, type IGetCredentialLocaleBrandingArgs, type IGetIssuerBrandingArgs, type IGetIssuerLocaleBrandingArgs, type IImageAttributes, type IImageDimensions, type IIssuerBranding, type IIssuerBrandingFilter, type IIssuerLocaleBranding, type IIssuerLocaleBrandingFilter, type ILocaleBranding, type IMetadataEntity, type IPartialBackgroundAttributes, type IPartialCredentialBranding, type IPartialCredentialClaim, type IPartialCredentialLocaleBranding, type IPartialImageAttributes, type IPartialImageDimensions, type IPartialIssuerBranding, type IPartialIssuerLocaleBranding, type IPartialTextAttributes, type IRemoveCredentialBrandingArgs, type IRemoveCredentialLocaleBrandingArgs, type IRemoveIssuerBrandingArgs, type IRemoveIssuerLocaleBrandingArgs, type ITextAttributes, type IUpdateCredentialBrandingArgs, type IUpdateCredentialLocaleBrandingArgs, type IUpdateIssuerBrandingArgs, type IUpdateIssuerLocaleBrandingArgs, type Identity, IdentityOrigin, type ImportDcqlQueryItem, type MetaDataKey, type MetaDataValue, type MetadataItem, type MetadataTypes, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedCredentialDesign, type NonPersistedCredentialDesignBranding, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetaDataKey, type NonPersistedMetaDataValue, type NonPersistedMetadataItem, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, type NonPersistedSchemaDefinition, type OpenIdConfig, type Organization, type PartialConnection, type PartialConnectionConfig, type PartialContact, type PartialCorrelationIdentifier, type PartialDcqlQueryItem, type PartialDidAuthConfig, type PartialElectronicAddress, type PartialIdentity, type PartialMetadataItem, type PartialNaturalPerson, type PartialOpenIdConfig, type PartialOrganization, type PartialParty, type PartialPartyRelationship, type PartialPartyType, type PartialPhysicalAddress, type Party, PartyOrigin, type PartyRelationship, type PartyType, PartyTypeType, type PhysicalAddress, type PhysicalAddressType, RegulationType, type RemoveCredentialArgs, type RemoveCredentialDesignArgs, type RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type SchemaDefinition, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialDesignArgs, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ValueType, ensureRawDocument };
1037
+ export { AbstractContactStore, AbstractCredentialDesignStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, type AddCredentialDesignArgs, type AddDefinitionArgs, type AddElectronicAddressArgs, type AddIdentityArgs, type AddPartyArgs, type AddPartyTypeArgs, type AddPhysicalAddressArgs, type AddRelationshipArgs, type Connection, type ConnectionConfig, ConnectionType, type Contact, type CorrelationIdentifier, CorrelationIdentifierType, type CountCredentialDesignsArgs, CredentialCorrelationType, type CredentialDesign, type CredentialDesignBranding, CredentialDocumentFormat, CredentialStateType, type DcqlQueryItem, type DcqlQueryItemFilter, type DeleteDefinitionArgs, type DeleteDefinitionsArgs, type DidAuthConfig, type DigitalCredential, DocumentType, type ElectronicAddress, type ElectronicAddressType, type FindActivityLoggingEventArgs, type FindAuditLoggingEventArgs, type FindCredentialBrandingArgs, type FindCredentialLocaleBrandingArgs, type FindDcqlQueryArgs, type FindDigitalCredentialArgs, type FindElectronicAddressArgs, type FindIdentityArgs, type FindIssuerBrandingArgs, type FindIssuerLocaleBrandingArgs, type FindMachineStatesFilterArgs, type FindPartyArgs, type FindPartyTypeArgs, type FindPhysicalAddressArgs, type FindRelationshipArgs, type FormStepGetOrCreateArgs, type GetActivityEventsArgs, type GetAuditEventsArgs, type GetCredentialArgs, type GetCredentialDesignArgs, type GetCredentialDesignsArgs, type GetCredentialsArgs, type GetCredentialsResponse, type GetDefinitionArgs, type GetDefinitionsArgs, type GetElectronicAddressArgs, type GetElectronicAddressesArgs, type GetIdentitiesArgs, type GetIdentityArgs, type GetPartiesArgs, type GetPartyArgs, type GetPartyTypeArgs, type GetPartyTypesArgs, type GetPhysicalAddressArgs, type GetPhysicalAddressesArgs, type GetRelationshipArgs, type GetRelationshipsArgs, type HasDefinitionArgs, type HasDefinitionsArgs, IAbstractMachineStateStore, type IAddCredentialBrandingArgs, type IAddCredentialLocaleBrandingArgs, type IAddIssuerBrandingArgs, type IAddIssuerLocaleBrandingArgs, type IBackgroundAttributes, type IBasicBackgroundAttributes, type IBasicCredentialBranding, type IBasicCredentialClaim, type IBasicCredentialLocaleBranding, type IBasicImageAttributes, type IBasicImageDimensions, type IBasicIssuerBranding, type IBasicIssuerLocaleBranding, type IBasicTextAttributes, type ICredentialBranding, type ICredentialBrandingFilter, type ICredentialClaim, type ICredentialLocaleBranding, type ICredentialLocaleBrandingFilter, type IGetCredentialBrandingArgs, type IGetCredentialLocaleBrandingArgs, type IGetIssuerBrandingArgs, type IGetIssuerLocaleBrandingArgs, type IImageAttributes, type IImageDimensions, type IIssuerBranding, type IIssuerBrandingFilter, type IIssuerLocaleBranding, type IIssuerLocaleBrandingFilter, type ILocaleBranding, type IMetadataEntity, type IPartialBackgroundAttributes, type IPartialCredentialBranding, type IPartialCredentialClaim, type IPartialCredentialLocaleBranding, type IPartialImageAttributes, type IPartialImageDimensions, type IPartialIssuerBranding, type IPartialIssuerLocaleBranding, type IPartialTextAttributes, type IRemoveCredentialBrandingArgs, type IRemoveCredentialLocaleBrandingArgs, type IRemoveIssuerBrandingArgs, type IRemoveIssuerLocaleBrandingArgs, type ITextAttributes, type IUpdateCredentialBrandingArgs, type IUpdateCredentialLocaleBrandingArgs, type IUpdateIssuerBrandingArgs, type IUpdateIssuerLocaleBrandingArgs, type Identity, IdentityOrigin, type ImportDcqlQueryItem, type MetadataItem, type MetadataKey, type MetadataTypes, type MetadataValue, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedCredentialDesign, type NonPersistedCredentialDesignBranding, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetadataItem, type NonPersistedMetadataKey, type NonPersistedMetadataValue, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, type NonPersistedSchemaDefinition, type OpenIdConfig, type Organization, type PartialConnection, type PartialConnectionConfig, type PartialContact, type PartialCorrelationIdentifier, type PartialDcqlQueryItem, type PartialDidAuthConfig, type PartialElectronicAddress, type PartialIdentity, type PartialMetadataItem, type PartialNaturalPerson, type PartialOpenIdConfig, type PartialOrganization, type PartialParty, type PartialPartyRelationship, type PartialPartyType, type PartialPhysicalAddress, type Party, PartyOrigin, type PartyRelationship, type PartyType, PartyTypeType, type PhysicalAddress, type PhysicalAddressType, RegulationType, type RemoveCredentialArgs, type RemoveCredentialDesignArgs, type RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type SchemaDefinition, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialDesignArgs, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ValueType, ensureRawDocument };
package/dist/index.d.ts CHANGED
@@ -805,7 +805,7 @@ declare enum ValueType {
805
805
  Boolean = "Boolean",
806
806
  Date = "Date"
807
807
  }
808
- type MetaDataValue = {
808
+ type MetadataValue = {
809
809
  id: string;
810
810
  index?: number;
811
811
  textValue?: string;
@@ -813,15 +813,15 @@ type MetaDataValue = {
813
813
  booleanValue?: boolean;
814
814
  timestampValue?: Date;
815
815
  };
816
- type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>;
817
- type MetaDataKey = {
816
+ type NonPersistedMetadataValue = Omit<MetadataValue, 'id'>;
817
+ type MetadataKey = {
818
818
  id: string;
819
819
  key: string;
820
820
  valueType: ValueType;
821
- metaDataValues: Array<MetaDataValue>;
821
+ metadataValues: Array<MetadataValue>;
822
822
  };
823
- type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
824
- metaDataValues: Array<NonPersistedMetaDataValue>;
823
+ type NonPersistedMetadataKey = Omit<MetadataKey, 'id' | 'metadataValues'> & {
824
+ metadataValues: Array<NonPersistedMetadataValue>;
825
825
  };
826
826
  type SchemaDefinition = {
827
827
  id: string;
@@ -846,14 +846,14 @@ type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id'
846
846
  };
847
847
  type CredentialDesign = {
848
848
  id: string;
849
- label: string;
849
+ identifier: string;
850
850
  tenantId?: string;
851
- metaDataKeys: Array<MetaDataKey>;
851
+ metadataKeys: Array<MetadataKey>;
852
852
  schemaDefinitions: Array<SchemaDefinition>;
853
853
  branding?: CredentialDesignBranding;
854
854
  };
855
- type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
856
- metaDataKeys?: Array<NonPersistedMetaDataKey>;
855
+ type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metadataKeys' | 'schemaDefinitions' | 'branding'> & {
856
+ metadataKeys?: Array<NonPersistedMetadataKey>;
857
857
  schemaDefinitions?: Array<NonPersistedSchemaDefinition>;
858
858
  branding?: NonPersistedCredentialDesignBranding;
859
859
  };
@@ -865,18 +865,29 @@ type GetCredentialDesignsArgs = {
865
865
  filter?: {
866
866
  tenantId?: string;
867
867
  };
868
+ limit?: number;
869
+ offset?: number;
870
+ };
871
+ type CountCredentialDesignsArgs = {
872
+ filter?: {
873
+ tenantId?: string;
874
+ };
875
+ };
876
+ type FormStepGetOrCreateArgs = {
877
+ formStepId: string;
868
878
  };
869
879
  type AddCredentialDesignArgs = {
870
- name: string;
880
+ identifier: string;
871
881
  tenantId?: string;
872
882
  design?: NonPersistedCredentialDesign;
883
+ formStepId?: string;
873
884
  };
874
885
  type RemoveCredentialDesignArgs = {
875
886
  credentialDesignId: string;
876
887
  };
877
888
  type UpdateCredentialDesignArgs = {
878
889
  credentialDesignId: string;
879
- name?: string;
890
+ identifier?: string;
880
891
  tenantId?: string;
881
892
  design?: Partial<NonPersistedCredentialDesign>;
882
893
  };
@@ -1014,11 +1025,13 @@ declare abstract class AbstractPDStore {
1014
1025
  declare abstract class AbstractCredentialDesignStore {
1015
1026
  abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>;
1016
1027
  abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>;
1028
+ abstract countCredentialDesigns(args?: CountCredentialDesignsArgs): Promise<number>;
1017
1029
  abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>;
1018
1030
  abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>;
1019
1031
  abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>;
1032
+ abstract formStepGetOrCreate(args: FormStepGetOrCreateArgs): Promise<string>;
1020
1033
  }
1021
1034
 
1022
1035
  declare function ensureRawDocument(input: string | object): string;
1023
1036
 
1024
- export { AbstractContactStore, AbstractCredentialDesignStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, type AddCredentialDesignArgs, type AddDefinitionArgs, type AddElectronicAddressArgs, type AddIdentityArgs, type AddPartyArgs, type AddPartyTypeArgs, type AddPhysicalAddressArgs, type AddRelationshipArgs, type Connection, type ConnectionConfig, ConnectionType, type Contact, type CorrelationIdentifier, CorrelationIdentifierType, CredentialCorrelationType, type CredentialDesign, type CredentialDesignBranding, CredentialDocumentFormat, CredentialStateType, type DcqlQueryItem, type DcqlQueryItemFilter, type DeleteDefinitionArgs, type DeleteDefinitionsArgs, type DidAuthConfig, type DigitalCredential, DocumentType, type ElectronicAddress, type ElectronicAddressType, type FindActivityLoggingEventArgs, type FindAuditLoggingEventArgs, type FindCredentialBrandingArgs, type FindCredentialLocaleBrandingArgs, type FindDcqlQueryArgs, type FindDigitalCredentialArgs, type FindElectronicAddressArgs, type FindIdentityArgs, type FindIssuerBrandingArgs, type FindIssuerLocaleBrandingArgs, type FindMachineStatesFilterArgs, type FindPartyArgs, type FindPartyTypeArgs, type FindPhysicalAddressArgs, type FindRelationshipArgs, type GetActivityEventsArgs, type GetAuditEventsArgs, type GetCredentialArgs, type GetCredentialDesignArgs, type GetCredentialDesignsArgs, type GetCredentialsArgs, type GetCredentialsResponse, type GetDefinitionArgs, type GetDefinitionsArgs, type GetElectronicAddressArgs, type GetElectronicAddressesArgs, type GetIdentitiesArgs, type GetIdentityArgs, type GetPartiesArgs, type GetPartyArgs, type GetPartyTypeArgs, type GetPartyTypesArgs, type GetPhysicalAddressArgs, type GetPhysicalAddressesArgs, type GetRelationshipArgs, type GetRelationshipsArgs, type HasDefinitionArgs, type HasDefinitionsArgs, IAbstractMachineStateStore, type IAddCredentialBrandingArgs, type IAddCredentialLocaleBrandingArgs, type IAddIssuerBrandingArgs, type IAddIssuerLocaleBrandingArgs, type IBackgroundAttributes, type IBasicBackgroundAttributes, type IBasicCredentialBranding, type IBasicCredentialClaim, type IBasicCredentialLocaleBranding, type IBasicImageAttributes, type IBasicImageDimensions, type IBasicIssuerBranding, type IBasicIssuerLocaleBranding, type IBasicTextAttributes, type ICredentialBranding, type ICredentialBrandingFilter, type ICredentialClaim, type ICredentialLocaleBranding, type ICredentialLocaleBrandingFilter, type IGetCredentialBrandingArgs, type IGetCredentialLocaleBrandingArgs, type IGetIssuerBrandingArgs, type IGetIssuerLocaleBrandingArgs, type IImageAttributes, type IImageDimensions, type IIssuerBranding, type IIssuerBrandingFilter, type IIssuerLocaleBranding, type IIssuerLocaleBrandingFilter, type ILocaleBranding, type IMetadataEntity, type IPartialBackgroundAttributes, type IPartialCredentialBranding, type IPartialCredentialClaim, type IPartialCredentialLocaleBranding, type IPartialImageAttributes, type IPartialImageDimensions, type IPartialIssuerBranding, type IPartialIssuerLocaleBranding, type IPartialTextAttributes, type IRemoveCredentialBrandingArgs, type IRemoveCredentialLocaleBrandingArgs, type IRemoveIssuerBrandingArgs, type IRemoveIssuerLocaleBrandingArgs, type ITextAttributes, type IUpdateCredentialBrandingArgs, type IUpdateCredentialLocaleBrandingArgs, type IUpdateIssuerBrandingArgs, type IUpdateIssuerLocaleBrandingArgs, type Identity, IdentityOrigin, type ImportDcqlQueryItem, type MetaDataKey, type MetaDataValue, type MetadataItem, type MetadataTypes, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedCredentialDesign, type NonPersistedCredentialDesignBranding, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetaDataKey, type NonPersistedMetaDataValue, type NonPersistedMetadataItem, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, type NonPersistedSchemaDefinition, type OpenIdConfig, type Organization, type PartialConnection, type PartialConnectionConfig, type PartialContact, type PartialCorrelationIdentifier, type PartialDcqlQueryItem, type PartialDidAuthConfig, type PartialElectronicAddress, type PartialIdentity, type PartialMetadataItem, type PartialNaturalPerson, type PartialOpenIdConfig, type PartialOrganization, type PartialParty, type PartialPartyRelationship, type PartialPartyType, type PartialPhysicalAddress, type Party, PartyOrigin, type PartyRelationship, type PartyType, PartyTypeType, type PhysicalAddress, type PhysicalAddressType, RegulationType, type RemoveCredentialArgs, type RemoveCredentialDesignArgs, type RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type SchemaDefinition, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialDesignArgs, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ValueType, ensureRawDocument };
1037
+ export { AbstractContactStore, AbstractCredentialDesignStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, type AddCredentialDesignArgs, type AddDefinitionArgs, type AddElectronicAddressArgs, type AddIdentityArgs, type AddPartyArgs, type AddPartyTypeArgs, type AddPhysicalAddressArgs, type AddRelationshipArgs, type Connection, type ConnectionConfig, ConnectionType, type Contact, type CorrelationIdentifier, CorrelationIdentifierType, type CountCredentialDesignsArgs, CredentialCorrelationType, type CredentialDesign, type CredentialDesignBranding, CredentialDocumentFormat, CredentialStateType, type DcqlQueryItem, type DcqlQueryItemFilter, type DeleteDefinitionArgs, type DeleteDefinitionsArgs, type DidAuthConfig, type DigitalCredential, DocumentType, type ElectronicAddress, type ElectronicAddressType, type FindActivityLoggingEventArgs, type FindAuditLoggingEventArgs, type FindCredentialBrandingArgs, type FindCredentialLocaleBrandingArgs, type FindDcqlQueryArgs, type FindDigitalCredentialArgs, type FindElectronicAddressArgs, type FindIdentityArgs, type FindIssuerBrandingArgs, type FindIssuerLocaleBrandingArgs, type FindMachineStatesFilterArgs, type FindPartyArgs, type FindPartyTypeArgs, type FindPhysicalAddressArgs, type FindRelationshipArgs, type FormStepGetOrCreateArgs, type GetActivityEventsArgs, type GetAuditEventsArgs, type GetCredentialArgs, type GetCredentialDesignArgs, type GetCredentialDesignsArgs, type GetCredentialsArgs, type GetCredentialsResponse, type GetDefinitionArgs, type GetDefinitionsArgs, type GetElectronicAddressArgs, type GetElectronicAddressesArgs, type GetIdentitiesArgs, type GetIdentityArgs, type GetPartiesArgs, type GetPartyArgs, type GetPartyTypeArgs, type GetPartyTypesArgs, type GetPhysicalAddressArgs, type GetPhysicalAddressesArgs, type GetRelationshipArgs, type GetRelationshipsArgs, type HasDefinitionArgs, type HasDefinitionsArgs, IAbstractMachineStateStore, type IAddCredentialBrandingArgs, type IAddCredentialLocaleBrandingArgs, type IAddIssuerBrandingArgs, type IAddIssuerLocaleBrandingArgs, type IBackgroundAttributes, type IBasicBackgroundAttributes, type IBasicCredentialBranding, type IBasicCredentialClaim, type IBasicCredentialLocaleBranding, type IBasicImageAttributes, type IBasicImageDimensions, type IBasicIssuerBranding, type IBasicIssuerLocaleBranding, type IBasicTextAttributes, type ICredentialBranding, type ICredentialBrandingFilter, type ICredentialClaim, type ICredentialLocaleBranding, type ICredentialLocaleBrandingFilter, type IGetCredentialBrandingArgs, type IGetCredentialLocaleBrandingArgs, type IGetIssuerBrandingArgs, type IGetIssuerLocaleBrandingArgs, type IImageAttributes, type IImageDimensions, type IIssuerBranding, type IIssuerBrandingFilter, type IIssuerLocaleBranding, type IIssuerLocaleBrandingFilter, type ILocaleBranding, type IMetadataEntity, type IPartialBackgroundAttributes, type IPartialCredentialBranding, type IPartialCredentialClaim, type IPartialCredentialLocaleBranding, type IPartialImageAttributes, type IPartialImageDimensions, type IPartialIssuerBranding, type IPartialIssuerLocaleBranding, type IPartialTextAttributes, type IRemoveCredentialBrandingArgs, type IRemoveCredentialLocaleBrandingArgs, type IRemoveIssuerBrandingArgs, type IRemoveIssuerLocaleBrandingArgs, type ITextAttributes, type IUpdateCredentialBrandingArgs, type IUpdateCredentialLocaleBrandingArgs, type IUpdateIssuerBrandingArgs, type IUpdateIssuerLocaleBrandingArgs, type Identity, IdentityOrigin, type ImportDcqlQueryItem, type MetadataItem, type MetadataKey, type MetadataTypes, type MetadataValue, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedCredentialDesign, type NonPersistedCredentialDesignBranding, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetadataItem, type NonPersistedMetadataKey, type NonPersistedMetadataValue, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, type NonPersistedSchemaDefinition, type OpenIdConfig, type Organization, type PartialConnection, type PartialConnectionConfig, type PartialContact, type PartialCorrelationIdentifier, type PartialDcqlQueryItem, type PartialDidAuthConfig, type PartialElectronicAddress, type PartialIdentity, type PartialMetadataItem, type PartialNaturalPerson, type PartialOpenIdConfig, type PartialOrganization, type PartialParty, type PartialPartyRelationship, type PartialPartyType, type PartialPhysicalAddress, type Party, PartyOrigin, type PartyRelationship, type PartyType, PartyTypeType, type PhysicalAddress, type PhysicalAddressType, RegulationType, type RemoveCredentialArgs, type RemoveCredentialDesignArgs, type RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type SchemaDefinition, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialDesignArgs, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ValueType, ensureRawDocument };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contact/AbstractContactStore.ts","../src/digitalCredential/AbstractDigitalCredentialStore.ts","../src/issuanceBranding/AbstractIssuanceBrandingStore.ts","../src/eventLogger/AbstractEventLoggerStore.ts","../src/machineState/IAbstractMachineStateStore.ts","../src/presentationDefinition/AbstractPDStore.ts","../src/credentialDesign/AbstractCredentialDesignStore.ts","../src/types/contact/contact.ts","../src/types/digitalCredential/enums.ts","../src/types/credentialDesign/credentialDesign.ts","../src/utils/MappingUtils.ts"],"sourcesContent":["import {\n AddElectronicAddressArgs,\n AddIdentityArgs,\n AddPartyArgs,\n AddPartyTypeArgs,\n AddPhysicalAddressArgs,\n AddRelationshipArgs,\n ElectronicAddress,\n GetElectronicAddressArgs,\n GetElectronicAddressesArgs,\n GetIdentitiesArgs,\n GetIdentityArgs,\n GetPartiesArgs,\n GetPartyArgs,\n GetPartyTypeArgs,\n GetPartyTypesArgs,\n GetPhysicalAddressArgs,\n GetPhysicalAddressesArgs,\n GetRelationshipArgs,\n GetRelationshipsArgs,\n Identity,\n Party,\n PartyRelationship,\n PartyType,\n PhysicalAddress,\n RemoveElectronicAddressArgs,\n RemoveIdentityArgs,\n RemovePartyArgs,\n RemovePartyTypeArgs,\n RemovePhysicalAddressArgs,\n RemoveRelationshipArgs,\n UpdateElectronicAddressArgs,\n UpdateIdentityArgs,\n UpdatePartyArgs,\n UpdatePartyTypeArgs,\n UpdatePhysicalAddressArgs,\n UpdateRelationshipArgs,\n} from '../types'\n\nexport abstract class AbstractContactStore {\n abstract getParty(args: GetPartyArgs): Promise<Party>\n abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>\n abstract addParty(args: AddPartyArgs): Promise<Party>\n abstract updateParty(args: UpdatePartyArgs): Promise<Party>\n abstract removeParty(args: RemovePartyArgs): Promise<void>\n abstract getIdentity(args: GetIdentityArgs): Promise<Identity>\n abstract getIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>\n abstract addIdentity(args: AddIdentityArgs): Promise<Identity>\n abstract updateIdentity(args: UpdateIdentityArgs): Promise<Identity>\n abstract removeIdentity(args: RemoveIdentityArgs): Promise<void>\n abstract getRelationship(args: GetRelationshipArgs): Promise<PartyRelationship>\n abstract getRelationships(args?: GetRelationshipsArgs): Promise<Array<PartyRelationship>>\n abstract addRelationship(args: AddRelationshipArgs): Promise<PartyRelationship>\n abstract updateRelationship(args: UpdateRelationshipArgs): Promise<PartyRelationship>\n abstract removeRelationship(args: RemoveRelationshipArgs): Promise<void>\n abstract getPartyType(args: GetPartyTypeArgs): Promise<PartyType>\n abstract getPartyTypes(args?: GetPartyTypesArgs): Promise<Array<PartyType>>\n abstract addPartyType(args: AddPartyTypeArgs): Promise<PartyType>\n abstract updatePartyType(args: UpdatePartyTypeArgs): Promise<PartyType>\n abstract removePartyType(args: RemovePartyTypeArgs): Promise<void>\n abstract getElectronicAddress(args: GetElectronicAddressArgs): Promise<ElectronicAddress>\n abstract getElectronicAddresses(args?: GetElectronicAddressesArgs): Promise<Array<ElectronicAddress>>\n abstract addElectronicAddress(args: AddElectronicAddressArgs): Promise<ElectronicAddress>\n abstract updateElectronicAddress(args: UpdateElectronicAddressArgs): Promise<ElectronicAddress>\n abstract removeElectronicAddress(args: RemoveElectronicAddressArgs): Promise<void>\n abstract getPhysicalAddress(args: GetPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract getPhysicalAddresses(args?: GetPhysicalAddressesArgs): Promise<Array<PhysicalAddress>>\n abstract addPhysicalAddress(args: AddPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract updatePhysicalAddress(args: UpdatePhysicalAddressArgs): Promise<PhysicalAddress>\n abstract removePhysicalAddress(args: RemovePhysicalAddressArgs): Promise<void>\n}\n","import {\n AddCredentialArgs,\n DigitalCredential,\n GetCredentialArgs,\n GetCredentialsArgs,\n GetCredentialsResponse,\n RemoveCredentialArgs,\n UpdateCredentialArgs,\n UpdateCredentialStateArgs,\n} from '../types'\n\nexport abstract class AbstractDigitalCredentialStore {\n abstract getCredential(args: GetCredentialArgs): Promise<DigitalCredential>\n\n abstract getCredentials(args?: GetCredentialsArgs): Promise<GetCredentialsResponse>\n\n abstract addCredential(args: AddCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredential(args: UpdateCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredentialState(args: UpdateCredentialStateArgs): Promise<DigitalCredential>\n\n abstract removeCredential(args: RemoveCredentialArgs): Promise<boolean>\n}\n","import type {\n IAddCredentialBrandingArgs,\n IAddCredentialLocaleBrandingArgs,\n IAddIssuerBrandingArgs,\n IAddIssuerLocaleBrandingArgs,\n ICredentialBranding,\n ICredentialLocaleBranding,\n IGetCredentialBrandingArgs,\n IGetCredentialLocaleBrandingArgs,\n IGetIssuerBrandingArgs,\n IGetIssuerLocaleBrandingArgs,\n IIssuerBranding,\n IIssuerLocaleBranding,\n IRemoveCredentialBrandingArgs,\n IRemoveCredentialLocaleBrandingArgs,\n IRemoveIssuerBrandingArgs,\n IRemoveIssuerLocaleBrandingArgs,\n IUpdateCredentialBrandingArgs,\n IUpdateCredentialLocaleBrandingArgs,\n IUpdateIssuerBrandingArgs,\n IUpdateIssuerLocaleBrandingArgs,\n} from '../types'\n\nexport abstract class AbstractIssuanceBrandingStore {\n public abstract addCredentialBranding(args: IAddCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialBranding(args?: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>>\n public abstract updateCredentialBranding(args: IUpdateCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract removeCredentialBranding(args: IRemoveCredentialBrandingArgs): Promise<void>\n public abstract addCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialLocaleBranding(args?: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>>\n public abstract updateCredentialLocaleBranding(args: IUpdateCredentialLocaleBrandingArgs): Promise<ICredentialLocaleBranding>\n public abstract removeCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs): Promise<void>\n public abstract addIssuerBranding(args: IAddIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerBranding(args?: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>>\n public abstract updateIssuerBranding(args: IUpdateIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract removeIssuerBranding(args: IRemoveIssuerBrandingArgs): Promise<void>\n public abstract addIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerLocaleBranding(args?: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>>\n public abstract updateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs): Promise<IIssuerLocaleBranding>\n public abstract removeIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs): Promise<void>\n}\n","import type { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'\nimport type { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'\n\nexport abstract class AbstractEventLoggerStore {\n abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>\n abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>\n abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>\n abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>\n}\n","import type {\n StoreMachineStateDeleteExpiredArgs,\n StoreMachineStateDeleteArgs,\n StoreMachineStatesFindActiveArgs,\n StoreFindMachineStatesArgs,\n StoreMachineStatePersistArgs,\n StoreMachineStateInfo,\n StoreMachineStateGetArgs,\n} from '../types'\n\n/**\n * Represents an abstract class for storing machine states.\n * This class provides methods for persisting, retrieving, and deleting machine states.\n *\n * @interface\n */\nexport abstract class IAbstractMachineStateStore {\n /**\n * Persists the machine state.\n *\n * @param {StoreMachineStatePersistArgs} state - The object containing the machine state to persist.\n * @return {Promise<StoreMachineStateInfo>} - A Promise that resolves to the information about the persisted machine state.\n */\n abstract persistMachineState(state: StoreMachineStatePersistArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds active machine states based on the given arguments.\n *\n * @param {StoreMachineStatesFindActiveArgs} args - The arguments for finding active machine states.\n * @return {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves with an array of active machine states.\n */\n abstract findActiveMachineStates(args: StoreMachineStatesFindActiveArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Retrieves the state of a particular machine.\n *\n * @param {StoreMachineStateGetArgs} args - The arguments for retrieving the machine state.\n * @returns {Promise<StoreMachineStateInfo>} - A promise that resolves to the machine state information.\n */\n abstract getMachineState(args: StoreMachineStateGetArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds the machine states based on the given arguments.\n *\n * @param {StoreFindMachineStatesArgs} [args] - The arguments to filter the machine states.\n * @returns {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves to an array of machine state information.\n */\n abstract findMachineStates(args?: StoreFindMachineStatesArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Deletes a machine state.\n *\n * @param {StoreMachineStateDeleteArgs} args - The arguments for deleting the machine state.\n * @return {Promise<boolean>} - A promise that resolves to a boolean indicating if the machine state was successfully deleted or not.\n */\n abstract deleteMachineState(args: StoreMachineStateDeleteArgs): Promise<boolean>\n\n /**\n * Deletes expired machine states from the database.\n *\n * @param {StoreMachineStateDeleteExpiredArgs} args - The arguments for deleting expired machine states.\n * @return {Promise<number>} - A promise that resolves to the number of deleted machine states.\n */\n abstract deleteExpiredMachineStates(args: StoreMachineStateDeleteExpiredArgs): Promise<number>\n}\n","import type {\n GetDefinitionArgs,\n GetDefinitionsArgs,\n DeleteDefinitionArgs,\n DcqlQueryItem,\n AddDefinitionArgs,\n UpdateDefinitionArgs,\n DeleteDefinitionsArgs,\n} from '../types'\n\nexport abstract class AbstractPDStore {\n abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>\n abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>\n abstract getDefinition(args: GetDefinitionArgs): Promise<DcqlQueryItem>\n abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<DcqlQueryItem>>\n abstract addDefinition(args: AddDefinitionArgs): Promise<DcqlQueryItem>\n abstract updateDefinition(args: UpdateDefinitionArgs): Promise<DcqlQueryItem>\n abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>\n abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>\n}\n","import {\n CredentialDesign,\n GetCredentialDesignArgs,\n GetCredentialDesignsArgs,\n AddCredentialDesignArgs,\n UpdateCredentialDesignArgs,\n RemoveCredentialDesignArgs\n} from '../types'\n\nexport abstract class AbstractCredentialDesignStore {\n abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>\n abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>\n abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>\n abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>\n abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>\n}\n","import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'\nimport { IIdentifier } from '@veramo/core'\nimport { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'\nimport { CredentialRole } from '@sphereon/ssi-types'\n\nexport type MetadataTypes = string | number | Date | boolean | undefined\n\nexport interface IMetadataEntity {\n // TODO move to types\n label: string\n stringValue?: string\n numberValue?: number\n dateValue?: Date\n boolValue?: boolean\n}\n\nexport type Party = {\n id: string\n uri?: string\n roles: Array<CredentialRole>\n ownerId?: string\n tenantId?: string\n identities: Array<Identity>\n electronicAddresses: Array<ElectronicAddress>\n physicalAddresses: Array<PhysicalAddress>\n contact: Contact\n partyType: PartyType\n /**\n * TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.\n *\n * Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:\n * 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).\n * 2. While it makes sense to have this combined type in the SDK, the logic to support database connections for these types is complex. The types belong to different modules, and we don't use them together currently.\n * 3. Implementing the full logic now would require significant changes and cross-module interactions, which we don't have the time to address at present.\n *\n * For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.\n */\n branding?: IIssuerLocaleBranding\n relationships: Array<PartyRelationship>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedParty = Omit<\n Party,\n | 'id'\n | 'identities'\n | 'electronicAddresses'\n | 'physicalAddresses'\n | 'contact'\n | 'roles'\n | 'partyType'\n | 'relationships'\n | 'createdAt'\n | 'lastUpdatedAt'\n> & {\n identities?: Array<NonPersistedIdentity>\n electronicAddresses?: Array<NonPersistedElectronicAddress>\n physicalAddresses?: Array<NonPersistedPhysicalAddress>\n contact: NonPersistedContact\n partyType: NonPersistedPartyType\n relationships?: Array<NonPersistedPartyRelationship>\n}\nexport type PartialParty = Partial<\n Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>\n> & {\n identities?: PartialIdentity\n electronicAddresses?: PartialElectronicAddress\n physicalAddresses?: PartialPhysicalAddress\n contact?: PartialContact\n partyType?: PartialPartyType\n relationships?: PartialPartyRelationship\n}\n\nexport type Identity = {\n id: string\n alias: string\n ownerId?: string\n tenantId?: string\n origin: IdentityOrigin\n roles: Array<CredentialRole>\n identifier: CorrelationIdentifier\n connection?: Connection\n metadata?: Array<MetadataItem<MetadataTypes>>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {\n origin: IdentityOrigin\n identifier: NonPersistedCorrelationIdentifier\n connection?: NonPersistedConnection\n metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>\n}\nexport type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {\n identifier?: PartialCorrelationIdentifier\n connection?: PartialConnection\n metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>\n origin?: IdentityOrigin\n roles?: CredentialRole\n partyId?: string\n}\n\nexport type MetadataItem<T extends MetadataTypes> = {\n id: string\n label: string\n value: T\n}\n\nexport type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>\nexport type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>\n\nexport type CorrelationIdentifier = {\n id: string\n ownerId?: string\n tenantId?: string\n type: CorrelationIdentifierType\n correlationId: string\n}\nexport type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>\nexport type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>\n\nexport type Connection = {\n id: string\n ownerId?: string\n tenantId?: string\n type: ConnectionType\n config: ConnectionConfig\n}\nexport type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {\n config: NonPersistedConnectionConfig\n}\nexport type PartialConnection = Partial<Omit<Connection, 'config'>> & {\n config: PartialConnectionConfig\n}\n\nexport type OpenIdConfig = {\n id: string\n clientId: string\n clientSecret?: string\n ownerId?: string\n tenantId?: string\n scopes: Array<string>\n issuer: string\n redirectUrl: string\n dangerouslyAllowInsecureHttpRequests: boolean\n clientAuthMethod: 'basic' | 'post' | undefined\n}\nexport type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>\nexport type PartialOpenIdConfig = Partial<OpenIdConfig>\n\nexport type DidAuthConfig = {\n id: string\n idOpts: ManagedIdentifierOptsOrResult\n stateId: string\n ownerId?: string\n tenantId?: string\n redirectUrl: string\n sessionId: string\n}\nexport type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>\nexport type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {\n identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier\n}\n\nexport type ConnectionConfig = OpenIdConfig | DidAuthConfig\nexport type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig\nexport type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig\n\nexport type NaturalPerson = {\n id: string\n firstName: string\n lastName: string\n middleName?: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\n\nexport type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>\n\nexport type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Organization = {\n id: string\n legalName: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Contact = NaturalPerson | Organization\nexport type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization\nexport type PartialContact = PartialNaturalPerson | PartialOrganization\n\nexport type PartyType = {\n id: string\n type: PartyTypeType\n origin: PartyOrigin\n name: string\n tenantId: string\n description?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {\n id?: string\n}\nexport type PartialPartyType = Partial<PartyType>\n\nexport type PartyRelationship = {\n id: string\n leftId: string\n rightId: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPartyRelationship = Partial<PartyRelationship>\n\nexport type ElectronicAddress = {\n id: string\n type: ElectronicAddressType\n electronicAddress: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialElectronicAddress = Partial<ElectronicAddress> & {\n partyId?: string\n}\n\nexport type PhysicalAddress = {\n id: string\n type: PhysicalAddressType\n streetName: string\n streetNumber: string\n postalCode: string\n cityName: string\n provinceName: string\n countryCode: string\n buildingName?: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPhysicalAddress = Partial<PhysicalAddress> & {\n partyId?: string\n}\n\nexport type ElectronicAddressType = 'email' | 'phone'\n\nexport type PhysicalAddressType = 'home' | 'visit' | 'postal'\n\nexport enum ConnectionType {\n OPENID_CONNECT = 'OIDC',\n SIOPv2 = 'SIOPv2',\n SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',\n}\n\nexport enum CorrelationIdentifierType {\n DID = 'did',\n URL = 'url',\n}\n\nexport enum PartyTypeType {\n NATURAL_PERSON = 'naturalPerson',\n ORGANIZATION = 'organization',\n}\n\nexport enum PartyOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n\nexport enum IdentityOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n","export enum DocumentType {\n VC = 'VC',\n VP = 'VP',\n P = 'P',\n C = 'C',\n}\n\nexport enum RegulationType {\n PID = 'PID',\n QEAA = 'QEAA',\n EAA = 'EAA',\n NON_REGULATED = 'NON_REGULATED',\n}\n\nexport enum CredentialDocumentFormat {\n JSON_LD = 'JSON_LD',\n JWT = 'JWT',\n SD_JWT = 'SD_JWT',\n MSO_MDOC = 'MSO_MDOC',\n}\n\nexport namespace CredentialDocumentFormat {\n export function fromSpecValue(credentialFormat: string) {\n const format = credentialFormat.toLowerCase()\n if (format.includes('sd')) {\n return CredentialDocumentFormat.SD_JWT\n } else if (format.includes('ldp')) {\n return CredentialDocumentFormat.JSON_LD\n } else if (format.includes('mso') || credentialFormat.includes('mdoc')) {\n return CredentialDocumentFormat.MSO_MDOC\n } else if (format.includes('jwt_')) {\n return CredentialDocumentFormat.JWT\n } else {\n throw Error(`Could not map format ${format} to known format`)\n }\n }\n\n export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {\n switch (documentFormat) {\n case CredentialDocumentFormat.SD_JWT:\n return 'dc+sd-jwt'\n case CredentialDocumentFormat.MSO_MDOC:\n return 'mso_mdoc'\n case CredentialDocumentFormat.JSON_LD:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'\n case CredentialDocumentFormat.JWT:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'\n }\n }\n}\n\nexport enum CredentialCorrelationType {\n DID = 'DID',\n X509_SAN = 'X509_SAN',\n KID = 'KID',\n URL = 'URL',\n}\n\nexport enum CredentialStateType {\n REVOKED = 'REVOKED',\n VERIFIED = 'VERIFIED',\n EXPIRED = 'EXPIRED',\n}\n","import { IBasicImageAttributes, IImageAttributes } from '../issuanceBranding/issuanceBranding'\n\nexport enum ValueType {\n Text = 'Text',\n Number = 'Number',\n Boolean = 'Boolean',\n Date = 'Date',\n}\n\nexport type MetaDataValue = {\n id: string\n index?: number\n textValue?: string\n numberValue?: number\n booleanValue?: boolean\n timestampValue?: Date\n}\n\nexport type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>\n\nexport type MetaDataKey = {\n id: string\n key: string\n valueType: ValueType\n metaDataValues: Array<MetaDataValue>\n}\n\nexport type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {\n metaDataValues: Array<NonPersistedMetaDataValue>\n}\n\nexport type SchemaDefinition = {\n id: string\n tenantId?: string\n extendsId?: string\n correlationId?: string\n schemaType?: string\n entityType?: string\n schema: string\n}\n\nexport type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>\n\nexport type CredentialDesignBranding = {\n id: string\n textColor?: string\n backgroundColor?: string\n logo?: IImageAttributes\n backgroundImage?: IImageAttributes\n}\n\nexport type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {\n logo?: IBasicImageAttributes\n backgroundImage?: IBasicImageAttributes\n}\n\nexport type CredentialDesign = {\n id: string\n label: string\n tenantId?: string\n metaDataKeys: Array<MetaDataKey>\n schemaDefinitions: Array<SchemaDefinition>\n branding?: CredentialDesignBranding\n}\n\nexport type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {\n metaDataKeys?: Array<NonPersistedMetaDataKey>\n schemaDefinitions?: Array<NonPersistedSchemaDefinition>\n branding?: NonPersistedCredentialDesignBranding\n}\n","import { CredentialMapper, ObjectUtils } from '@sphereon/ssi-types'\n\nfunction isHex(input: string) {\n return input.match(/^([0-9A-Fa-f])+$/g) !== null\n}\n\nexport function ensureRawDocument(input: string | object): string {\n if (typeof input === 'string') {\n if (isHex(input) || ObjectUtils.isBase64(input)) {\n // mso_mdoc\n return input\n } else if (CredentialMapper.isJwtEncoded(input) || CredentialMapper.isSdJwtEncoded(input)) {\n return input\n }\n throw Error('Unknown input to be mapped as rawDocument')\n }\n\n try {\n return JSON.stringify(input)\n } catch (e) {\n throw new Error(`Can't stringify to a raw credential: ${input}`)\n }\n}\n"],"mappings":";;;;AAuCO,IAAeA,uBAAf,MAAeA;EAAtB,OAAsBA;;;AA+BtB;;;AC3DO,IAAeC,iCAAf,MAAeA;EAAtB,OAAsBA;;;AAYtB;;;ACAO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAiBtB;;;ACrCO,IAAeC,2BAAf,MAAeA;EAAtB,OAAsBA;;;AAKtB;;;ACQO,IAAeC,6BAAf,MAAeA;EANtB,OAMsBA;;;AAgDtB;;;ACtDO,IAAeC,kBAAf,MAAeA;EAAtB,OAAsBA;;;AAStB;;;ACVO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAMtB;;;AC+PO,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;SAAAA;;AAML,IAAKC,4BAAAA,0BAAAA,4BAAAA;;;SAAAA;;AAKL,IAAKC,gBAAAA,0BAAAA,gBAAAA;;;SAAAA;;AAKL,IAAKC,cAAAA,0BAAAA,cAAAA;;;SAAAA;;AAKL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;SAAAA;;;;ACnSL,IAAKC,eAAAA,0BAAAA,eAAAA;;;;;SAAAA;;AAOL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;;SAAAA;;AAOL,IAAKC,2BAAAA,0BAAAA,2BAAAA;;;;;SAAAA;;UAOKA,2BAAAA;AACR,WAASC,cAAcC,kBAAwB;AACpD,UAAMC,SAASD,iBAAiBE,YAAW;AAC3C,QAAID,OAAOE,SAAS,IAAA,GAAO;AACzB,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,GAAQ;AACjC,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,KAAUH,iBAAiBG,SAAS,MAAA,GAAS;AACtE,aAAA;IACF,WAAWF,OAAOE,SAAS,MAAA,GAAS;AAClC,aAAA;IACF,OAAO;AACL,YAAMC,MAAM,wBAAwBH,MAAAA,kBAAwB;IAC9D;EACF;AAbgBF;4BAAAA,gBAAAA;AAeT,WAASM,YAAYC,gBAA0CC,cAA0B;AAC9F,YAAQD,gBAAAA;MACN,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAOC,iBAAAA,OAAmCA,iBAAAA,OAAmC,WAAW;MAC1F,KAAA;AACE,eAAOA,iBAAAA,OAAmCA,iBAAAA,OAAmC,gBAAgB;IACjG;EACF;AAXgBF;4BAAAA,cAAAA;AAYlB,GA5BiBP,6BAAAA,2BAAAA,CAAAA,EAAAA;AA8BV,IAAKU,4BAAAA,0BAAAA,4BAAAA;;;;;SAAAA;;AAOL,IAAKC,sBAAAA,0BAAAA,sBAAAA;;;;SAAAA;;;;ACxDL,IAAKC,YAAAA,0BAAAA,YAAAA;;;;;SAAAA;;;;ACFZ,SAASC,kBAAkBC,mBAAmB;AAE9C,SAASC,MAAMC,OAAa;AAC1B,SAAOA,MAAMC,MAAM,mBAAA,MAAyB;AAC9C;AAFSF;AAIF,SAASG,kBAAkBF,OAAsB;AACtD,MAAI,OAAOA,UAAU,UAAU;AAC7B,QAAID,MAAMC,KAAAA,KAAUG,YAAYC,SAASJ,KAAAA,GAAQ;AAE/C,aAAOA;IACT,WAAWK,iBAAiBC,aAAaN,KAAAA,KAAUK,iBAAiBE,eAAeP,KAAAA,GAAQ;AACzF,aAAOA;IACT;AACA,UAAMQ,MAAM,2CAAA;EACd;AAEA,MAAI;AACF,WAAOC,KAAKC,UAAUV,KAAAA;EACxB,SAASW,GAAG;AACV,UAAM,IAAIH,MAAM,wCAAwCR,KAAAA,EAAO;EACjE;AACF;AAhBgBE;","names":["AbstractContactStore","AbstractDigitalCredentialStore","AbstractIssuanceBrandingStore","AbstractEventLoggerStore","IAbstractMachineStateStore","AbstractPDStore","AbstractCredentialDesignStore","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","ValueType","CredentialMapper","ObjectUtils","isHex","input","match","ensureRawDocument","ObjectUtils","isBase64","CredentialMapper","isJwtEncoded","isSdJwtEncoded","Error","JSON","stringify","e"]}
1
+ {"version":3,"sources":["../src/contact/AbstractContactStore.ts","../src/digitalCredential/AbstractDigitalCredentialStore.ts","../src/issuanceBranding/AbstractIssuanceBrandingStore.ts","../src/eventLogger/AbstractEventLoggerStore.ts","../src/machineState/IAbstractMachineStateStore.ts","../src/presentationDefinition/AbstractPDStore.ts","../src/credentialDesign/AbstractCredentialDesignStore.ts","../src/types/contact/contact.ts","../src/types/digitalCredential/enums.ts","../src/types/credentialDesign/credentialDesign.ts","../src/utils/MappingUtils.ts"],"sourcesContent":["import {\n AddElectronicAddressArgs,\n AddIdentityArgs,\n AddPartyArgs,\n AddPartyTypeArgs,\n AddPhysicalAddressArgs,\n AddRelationshipArgs,\n ElectronicAddress,\n GetElectronicAddressArgs,\n GetElectronicAddressesArgs,\n GetIdentitiesArgs,\n GetIdentityArgs,\n GetPartiesArgs,\n GetPartyArgs,\n GetPartyTypeArgs,\n GetPartyTypesArgs,\n GetPhysicalAddressArgs,\n GetPhysicalAddressesArgs,\n GetRelationshipArgs,\n GetRelationshipsArgs,\n Identity,\n Party,\n PartyRelationship,\n PartyType,\n PhysicalAddress,\n RemoveElectronicAddressArgs,\n RemoveIdentityArgs,\n RemovePartyArgs,\n RemovePartyTypeArgs,\n RemovePhysicalAddressArgs,\n RemoveRelationshipArgs,\n UpdateElectronicAddressArgs,\n UpdateIdentityArgs,\n UpdatePartyArgs,\n UpdatePartyTypeArgs,\n UpdatePhysicalAddressArgs,\n UpdateRelationshipArgs,\n} from '../types'\n\nexport abstract class AbstractContactStore {\n abstract getParty(args: GetPartyArgs): Promise<Party>\n abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>\n abstract addParty(args: AddPartyArgs): Promise<Party>\n abstract updateParty(args: UpdatePartyArgs): Promise<Party>\n abstract removeParty(args: RemovePartyArgs): Promise<void>\n abstract getIdentity(args: GetIdentityArgs): Promise<Identity>\n abstract getIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>\n abstract addIdentity(args: AddIdentityArgs): Promise<Identity>\n abstract updateIdentity(args: UpdateIdentityArgs): Promise<Identity>\n abstract removeIdentity(args: RemoveIdentityArgs): Promise<void>\n abstract getRelationship(args: GetRelationshipArgs): Promise<PartyRelationship>\n abstract getRelationships(args?: GetRelationshipsArgs): Promise<Array<PartyRelationship>>\n abstract addRelationship(args: AddRelationshipArgs): Promise<PartyRelationship>\n abstract updateRelationship(args: UpdateRelationshipArgs): Promise<PartyRelationship>\n abstract removeRelationship(args: RemoveRelationshipArgs): Promise<void>\n abstract getPartyType(args: GetPartyTypeArgs): Promise<PartyType>\n abstract getPartyTypes(args?: GetPartyTypesArgs): Promise<Array<PartyType>>\n abstract addPartyType(args: AddPartyTypeArgs): Promise<PartyType>\n abstract updatePartyType(args: UpdatePartyTypeArgs): Promise<PartyType>\n abstract removePartyType(args: RemovePartyTypeArgs): Promise<void>\n abstract getElectronicAddress(args: GetElectronicAddressArgs): Promise<ElectronicAddress>\n abstract getElectronicAddresses(args?: GetElectronicAddressesArgs): Promise<Array<ElectronicAddress>>\n abstract addElectronicAddress(args: AddElectronicAddressArgs): Promise<ElectronicAddress>\n abstract updateElectronicAddress(args: UpdateElectronicAddressArgs): Promise<ElectronicAddress>\n abstract removeElectronicAddress(args: RemoveElectronicAddressArgs): Promise<void>\n abstract getPhysicalAddress(args: GetPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract getPhysicalAddresses(args?: GetPhysicalAddressesArgs): Promise<Array<PhysicalAddress>>\n abstract addPhysicalAddress(args: AddPhysicalAddressArgs): Promise<PhysicalAddress>\n abstract updatePhysicalAddress(args: UpdatePhysicalAddressArgs): Promise<PhysicalAddress>\n abstract removePhysicalAddress(args: RemovePhysicalAddressArgs): Promise<void>\n}\n","import {\n AddCredentialArgs,\n DigitalCredential,\n GetCredentialArgs,\n GetCredentialsArgs,\n GetCredentialsResponse,\n RemoveCredentialArgs,\n UpdateCredentialArgs,\n UpdateCredentialStateArgs,\n} from '../types'\n\nexport abstract class AbstractDigitalCredentialStore {\n abstract getCredential(args: GetCredentialArgs): Promise<DigitalCredential>\n\n abstract getCredentials(args?: GetCredentialsArgs): Promise<GetCredentialsResponse>\n\n abstract addCredential(args: AddCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredential(args: UpdateCredentialArgs): Promise<DigitalCredential>\n\n abstract updateCredentialState(args: UpdateCredentialStateArgs): Promise<DigitalCredential>\n\n abstract removeCredential(args: RemoveCredentialArgs): Promise<boolean>\n}\n","import type {\n IAddCredentialBrandingArgs,\n IAddCredentialLocaleBrandingArgs,\n IAddIssuerBrandingArgs,\n IAddIssuerLocaleBrandingArgs,\n ICredentialBranding,\n ICredentialLocaleBranding,\n IGetCredentialBrandingArgs,\n IGetCredentialLocaleBrandingArgs,\n IGetIssuerBrandingArgs,\n IGetIssuerLocaleBrandingArgs,\n IIssuerBranding,\n IIssuerLocaleBranding,\n IRemoveCredentialBrandingArgs,\n IRemoveCredentialLocaleBrandingArgs,\n IRemoveIssuerBrandingArgs,\n IRemoveIssuerLocaleBrandingArgs,\n IUpdateCredentialBrandingArgs,\n IUpdateCredentialLocaleBrandingArgs,\n IUpdateIssuerBrandingArgs,\n IUpdateIssuerLocaleBrandingArgs,\n} from '../types'\n\nexport abstract class AbstractIssuanceBrandingStore {\n public abstract addCredentialBranding(args: IAddCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialBranding(args?: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>>\n public abstract updateCredentialBranding(args: IUpdateCredentialBrandingArgs): Promise<ICredentialBranding>\n public abstract removeCredentialBranding(args: IRemoveCredentialBrandingArgs): Promise<void>\n public abstract addCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs): Promise<ICredentialBranding>\n public abstract getCredentialLocaleBranding(args?: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>>\n public abstract updateCredentialLocaleBranding(args: IUpdateCredentialLocaleBrandingArgs): Promise<ICredentialLocaleBranding>\n public abstract removeCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs): Promise<void>\n public abstract addIssuerBranding(args: IAddIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerBranding(args?: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>>\n public abstract updateIssuerBranding(args: IUpdateIssuerBrandingArgs): Promise<IIssuerBranding>\n public abstract removeIssuerBranding(args: IRemoveIssuerBrandingArgs): Promise<void>\n public abstract addIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs): Promise<IIssuerBranding>\n public abstract getIssuerLocaleBranding(args?: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>>\n public abstract updateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs): Promise<IIssuerLocaleBranding>\n public abstract removeIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs): Promise<void>\n}\n","import type { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'\nimport type { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'\n\nexport abstract class AbstractEventLoggerStore {\n abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>\n abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>\n abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>\n abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>\n}\n","import type {\n StoreMachineStateDeleteExpiredArgs,\n StoreMachineStateDeleteArgs,\n StoreMachineStatesFindActiveArgs,\n StoreFindMachineStatesArgs,\n StoreMachineStatePersistArgs,\n StoreMachineStateInfo,\n StoreMachineStateGetArgs,\n} from '../types'\n\n/**\n * Represents an abstract class for storing machine states.\n * This class provides methods for persisting, retrieving, and deleting machine states.\n *\n * @interface\n */\nexport abstract class IAbstractMachineStateStore {\n /**\n * Persists the machine state.\n *\n * @param {StoreMachineStatePersistArgs} state - The object containing the machine state to persist.\n * @return {Promise<StoreMachineStateInfo>} - A Promise that resolves to the information about the persisted machine state.\n */\n abstract persistMachineState(state: StoreMachineStatePersistArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds active machine states based on the given arguments.\n *\n * @param {StoreMachineStatesFindActiveArgs} args - The arguments for finding active machine states.\n * @return {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves with an array of active machine states.\n */\n abstract findActiveMachineStates(args: StoreMachineStatesFindActiveArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Retrieves the state of a particular machine.\n *\n * @param {StoreMachineStateGetArgs} args - The arguments for retrieving the machine state.\n * @returns {Promise<StoreMachineStateInfo>} - A promise that resolves to the machine state information.\n */\n abstract getMachineState(args: StoreMachineStateGetArgs): Promise<StoreMachineStateInfo>\n\n /**\n * Finds the machine states based on the given arguments.\n *\n * @param {StoreFindMachineStatesArgs} [args] - The arguments to filter the machine states.\n * @returns {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves to an array of machine state information.\n */\n abstract findMachineStates(args?: StoreFindMachineStatesArgs): Promise<Array<StoreMachineStateInfo>>\n\n /**\n * Deletes a machine state.\n *\n * @param {StoreMachineStateDeleteArgs} args - The arguments for deleting the machine state.\n * @return {Promise<boolean>} - A promise that resolves to a boolean indicating if the machine state was successfully deleted or not.\n */\n abstract deleteMachineState(args: StoreMachineStateDeleteArgs): Promise<boolean>\n\n /**\n * Deletes expired machine states from the database.\n *\n * @param {StoreMachineStateDeleteExpiredArgs} args - The arguments for deleting expired machine states.\n * @return {Promise<number>} - A promise that resolves to the number of deleted machine states.\n */\n abstract deleteExpiredMachineStates(args: StoreMachineStateDeleteExpiredArgs): Promise<number>\n}\n","import type {\n GetDefinitionArgs,\n GetDefinitionsArgs,\n DeleteDefinitionArgs,\n DcqlQueryItem,\n AddDefinitionArgs,\n UpdateDefinitionArgs,\n DeleteDefinitionsArgs,\n} from '../types'\n\nexport abstract class AbstractPDStore {\n abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>\n abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>\n abstract getDefinition(args: GetDefinitionArgs): Promise<DcqlQueryItem>\n abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<DcqlQueryItem>>\n abstract addDefinition(args: AddDefinitionArgs): Promise<DcqlQueryItem>\n abstract updateDefinition(args: UpdateDefinitionArgs): Promise<DcqlQueryItem>\n abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>\n abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>\n}\n","import {\n CredentialDesign,\n GetCredentialDesignArgs,\n GetCredentialDesignsArgs,\n CountCredentialDesignsArgs,\n FormStepGetOrCreateArgs,\n AddCredentialDesignArgs,\n UpdateCredentialDesignArgs,\n RemoveCredentialDesignArgs\n} from '../types'\n\nexport abstract class AbstractCredentialDesignStore {\n abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>\n abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>\n abstract countCredentialDesigns(args?: CountCredentialDesignsArgs): Promise<number>\n abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>\n abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>\n abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>\n abstract formStepGetOrCreate(args: FormStepGetOrCreateArgs): Promise<string>\n}\n","import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'\nimport { IIdentifier } from '@veramo/core'\nimport { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'\nimport { CredentialRole } from '@sphereon/ssi-types'\n\nexport type MetadataTypes = string | number | Date | boolean | undefined\n\nexport interface IMetadataEntity {\n // TODO move to types\n label: string\n stringValue?: string\n numberValue?: number\n dateValue?: Date\n boolValue?: boolean\n}\n\nexport type Party = {\n id: string\n uri?: string\n roles: Array<CredentialRole>\n ownerId?: string\n tenantId?: string\n identities: Array<Identity>\n electronicAddresses: Array<ElectronicAddress>\n physicalAddresses: Array<PhysicalAddress>\n contact: Contact\n partyType: PartyType\n /**\n * TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.\n *\n * Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:\n * 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).\n * 2. While it makes sense to have this combined type in the SDK, the logic to support database connections for these types is complex. The types belong to different modules, and we don't use them together currently.\n * 3. Implementing the full logic now would require significant changes and cross-module interactions, which we don't have the time to address at present.\n *\n * For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.\n */\n branding?: IIssuerLocaleBranding\n relationships: Array<PartyRelationship>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedParty = Omit<\n Party,\n | 'id'\n | 'identities'\n | 'electronicAddresses'\n | 'physicalAddresses'\n | 'contact'\n | 'roles'\n | 'partyType'\n | 'relationships'\n | 'createdAt'\n | 'lastUpdatedAt'\n> & {\n identities?: Array<NonPersistedIdentity>\n electronicAddresses?: Array<NonPersistedElectronicAddress>\n physicalAddresses?: Array<NonPersistedPhysicalAddress>\n contact: NonPersistedContact\n partyType: NonPersistedPartyType\n relationships?: Array<NonPersistedPartyRelationship>\n}\nexport type PartialParty = Partial<\n Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>\n> & {\n identities?: PartialIdentity\n electronicAddresses?: PartialElectronicAddress\n physicalAddresses?: PartialPhysicalAddress\n contact?: PartialContact\n partyType?: PartialPartyType\n relationships?: PartialPartyRelationship\n}\n\nexport type Identity = {\n id: string\n alias: string\n ownerId?: string\n tenantId?: string\n origin: IdentityOrigin\n roles: Array<CredentialRole>\n identifier: CorrelationIdentifier\n connection?: Connection\n metadata?: Array<MetadataItem<MetadataTypes>>\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {\n origin: IdentityOrigin\n identifier: NonPersistedCorrelationIdentifier\n connection?: NonPersistedConnection\n metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>\n}\nexport type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {\n identifier?: PartialCorrelationIdentifier\n connection?: PartialConnection\n metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>\n origin?: IdentityOrigin\n roles?: CredentialRole\n partyId?: string\n}\n\nexport type MetadataItem<T extends MetadataTypes> = {\n id: string\n label: string\n value: T\n}\n\nexport type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>\nexport type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>\n\nexport type CorrelationIdentifier = {\n id: string\n ownerId?: string\n tenantId?: string\n type: CorrelationIdentifierType\n correlationId: string\n}\nexport type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>\nexport type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>\n\nexport type Connection = {\n id: string\n ownerId?: string\n tenantId?: string\n type: ConnectionType\n config: ConnectionConfig\n}\nexport type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {\n config: NonPersistedConnectionConfig\n}\nexport type PartialConnection = Partial<Omit<Connection, 'config'>> & {\n config: PartialConnectionConfig\n}\n\nexport type OpenIdConfig = {\n id: string\n clientId: string\n clientSecret?: string\n ownerId?: string\n tenantId?: string\n scopes: Array<string>\n issuer: string\n redirectUrl: string\n dangerouslyAllowInsecureHttpRequests: boolean\n clientAuthMethod: 'basic' | 'post' | undefined\n}\nexport type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>\nexport type PartialOpenIdConfig = Partial<OpenIdConfig>\n\nexport type DidAuthConfig = {\n id: string\n idOpts: ManagedIdentifierOptsOrResult\n stateId: string\n ownerId?: string\n tenantId?: string\n redirectUrl: string\n sessionId: string\n}\nexport type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>\nexport type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {\n identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier\n}\n\nexport type ConnectionConfig = OpenIdConfig | DidAuthConfig\nexport type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig\nexport type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig\n\nexport type NaturalPerson = {\n id: string\n firstName: string\n lastName: string\n middleName?: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\n\nexport type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>\n\nexport type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Organization = {\n id: string\n legalName: string\n displayName: string\n metadata?: Array<MetadataItem<MetadataTypes>>\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {\n metadata?: PartialMetadataItem<MetadataTypes>\n}\n\nexport type Contact = NaturalPerson | Organization\nexport type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization\nexport type PartialContact = PartialNaturalPerson | PartialOrganization\n\nexport type PartyType = {\n id: string\n type: PartyTypeType\n origin: PartyOrigin\n name: string\n tenantId: string\n description?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {\n id?: string\n}\nexport type PartialPartyType = Partial<PartyType>\n\nexport type PartyRelationship = {\n id: string\n leftId: string\n rightId: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPartyRelationship = Partial<PartyRelationship>\n\nexport type ElectronicAddress = {\n id: string\n type: ElectronicAddressType\n electronicAddress: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialElectronicAddress = Partial<ElectronicAddress> & {\n partyId?: string\n}\n\nexport type PhysicalAddress = {\n id: string\n type: PhysicalAddressType\n streetName: string\n streetNumber: string\n postalCode: string\n cityName: string\n provinceName: string\n countryCode: string\n buildingName?: string\n ownerId?: string\n tenantId?: string\n createdAt: Date\n lastUpdatedAt: Date\n}\nexport type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>\nexport type PartialPhysicalAddress = Partial<PhysicalAddress> & {\n partyId?: string\n}\n\nexport type ElectronicAddressType = 'email' | 'phone'\n\nexport type PhysicalAddressType = 'home' | 'visit' | 'postal'\n\nexport enum ConnectionType {\n OPENID_CONNECT = 'OIDC',\n SIOPv2 = 'SIOPv2',\n SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',\n}\n\nexport enum CorrelationIdentifierType {\n DID = 'did',\n URL = 'url',\n}\n\nexport enum PartyTypeType {\n NATURAL_PERSON = 'naturalPerson',\n ORGANIZATION = 'organization',\n}\n\nexport enum PartyOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n\nexport enum IdentityOrigin {\n INTERNAL = 'INTERNAL',\n EXTERNAL = 'EXTERNAL',\n}\n","export enum DocumentType {\n VC = 'VC',\n VP = 'VP',\n P = 'P',\n C = 'C',\n}\n\nexport enum RegulationType {\n PID = 'PID',\n QEAA = 'QEAA',\n EAA = 'EAA',\n NON_REGULATED = 'NON_REGULATED',\n}\n\nexport enum CredentialDocumentFormat {\n JSON_LD = 'JSON_LD',\n JWT = 'JWT',\n SD_JWT = 'SD_JWT',\n MSO_MDOC = 'MSO_MDOC',\n}\n\nexport namespace CredentialDocumentFormat {\n export function fromSpecValue(credentialFormat: string) {\n const format = credentialFormat.toLowerCase()\n if (format.includes('sd')) {\n return CredentialDocumentFormat.SD_JWT\n } else if (format.includes('ldp')) {\n return CredentialDocumentFormat.JSON_LD\n } else if (format.includes('mso') || credentialFormat.includes('mdoc')) {\n return CredentialDocumentFormat.MSO_MDOC\n } else if (format.includes('jwt_')) {\n return CredentialDocumentFormat.JWT\n } else {\n throw Error(`Could not map format ${format} to known format`)\n }\n }\n\n export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {\n switch (documentFormat) {\n case CredentialDocumentFormat.SD_JWT:\n return 'dc+sd-jwt'\n case CredentialDocumentFormat.MSO_MDOC:\n return 'mso_mdoc'\n case CredentialDocumentFormat.JSON_LD:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'\n case CredentialDocumentFormat.JWT:\n return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'\n }\n }\n}\n\nexport enum CredentialCorrelationType {\n DID = 'DID',\n X509_SAN = 'X509_SAN',\n KID = 'KID',\n URL = 'URL',\n}\n\nexport enum CredentialStateType {\n REVOKED = 'REVOKED',\n VERIFIED = 'VERIFIED',\n EXPIRED = 'EXPIRED',\n}\n","import { IBasicImageAttributes, IImageAttributes } from '../issuanceBranding/issuanceBranding'\n\nexport enum ValueType {\n Text = 'Text',\n Number = 'Number',\n Boolean = 'Boolean',\n Date = 'Date',\n}\n\nexport type MetadataValue = {\n id: string\n index?: number\n textValue?: string\n numberValue?: number\n booleanValue?: boolean\n timestampValue?: Date\n}\n\nexport type NonPersistedMetadataValue = Omit<MetadataValue, 'id'>\n\nexport type MetadataKey = {\n id: string\n key: string\n valueType: ValueType\n metadataValues: Array<MetadataValue>\n}\n\nexport type NonPersistedMetadataKey = Omit<MetadataKey, 'id' | 'metadataValues'> & {\n metadataValues: Array<NonPersistedMetadataValue>\n}\n\nexport type SchemaDefinition = {\n id: string\n tenantId?: string\n extendsId?: string\n correlationId?: string\n schemaType?: string\n entityType?: string\n schema: string\n}\n\nexport type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>\n\nexport type CredentialDesignBranding = {\n id: string\n textColor?: string\n backgroundColor?: string\n logo?: IImageAttributes\n backgroundImage?: IImageAttributes\n}\n\nexport type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {\n logo?: IBasicImageAttributes\n backgroundImage?: IBasicImageAttributes\n}\n\nexport type CredentialDesign = {\n id: string\n identifier: string\n tenantId?: string\n metadataKeys: Array<MetadataKey>\n schemaDefinitions: Array<SchemaDefinition>\n branding?: CredentialDesignBranding\n}\n\nexport type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metadataKeys' | 'schemaDefinitions' | 'branding'> & {\n metadataKeys?: Array<NonPersistedMetadataKey>\n schemaDefinitions?: Array<NonPersistedSchemaDefinition>\n branding?: NonPersistedCredentialDesignBranding\n}\n","import { CredentialMapper, ObjectUtils } from '@sphereon/ssi-types'\n\nfunction isHex(input: string) {\n return input.match(/^([0-9A-Fa-f])+$/g) !== null\n}\n\nexport function ensureRawDocument(input: string | object): string {\n if (typeof input === 'string') {\n if (isHex(input) || ObjectUtils.isBase64(input)) {\n // mso_mdoc\n return input\n } else if (CredentialMapper.isJwtEncoded(input) || CredentialMapper.isSdJwtEncoded(input)) {\n return input\n }\n throw Error('Unknown input to be mapped as rawDocument')\n }\n\n try {\n return JSON.stringify(input)\n } catch (e) {\n throw new Error(`Can't stringify to a raw credential: ${input}`)\n }\n}\n"],"mappings":";;;;AAuCO,IAAeA,uBAAf,MAAeA;EAAtB,OAAsBA;;;AA+BtB;;;AC3DO,IAAeC,iCAAf,MAAeA;EAAtB,OAAsBA;;;AAYtB;;;ACAO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAiBtB;;;ACrCO,IAAeC,2BAAf,MAAeA;EAAtB,OAAsBA;;;AAKtB;;;ACQO,IAAeC,6BAAf,MAAeA;EANtB,OAMsBA;;;AAgDtB;;;ACtDO,IAAeC,kBAAf,MAAeA;EAAtB,OAAsBA;;;AAStB;;;ACRO,IAAeC,gCAAf,MAAeA;EAAtB,OAAsBA;;;AAQtB;;;AC2PO,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;SAAAA;;AAML,IAAKC,4BAAAA,0BAAAA,4BAAAA;;;SAAAA;;AAKL,IAAKC,gBAAAA,0BAAAA,gBAAAA;;;SAAAA;;AAKL,IAAKC,cAAAA,0BAAAA,cAAAA;;;SAAAA;;AAKL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;SAAAA;;;;ACnSL,IAAKC,eAAAA,0BAAAA,eAAAA;;;;;SAAAA;;AAOL,IAAKC,iBAAAA,0BAAAA,iBAAAA;;;;;SAAAA;;AAOL,IAAKC,2BAAAA,0BAAAA,2BAAAA;;;;;SAAAA;;UAOKA,2BAAAA;AACR,WAASC,cAAcC,kBAAwB;AACpD,UAAMC,SAASD,iBAAiBE,YAAW;AAC3C,QAAID,OAAOE,SAAS,IAAA,GAAO;AACzB,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,GAAQ;AACjC,aAAA;IACF,WAAWF,OAAOE,SAAS,KAAA,KAAUH,iBAAiBG,SAAS,MAAA,GAAS;AACtE,aAAA;IACF,WAAWF,OAAOE,SAAS,MAAA,GAAS;AAClC,aAAA;IACF,OAAO;AACL,YAAMC,MAAM,wBAAwBH,MAAAA,kBAAwB;IAC9D;EACF;AAbgBF;4BAAAA,gBAAAA;AAeT,WAASM,YAAYC,gBAA0CC,cAA0B;AAC9F,YAAQD,gBAAAA;MACN,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAO;MACT,KAAA;AACE,eAAOC,iBAAAA,OAAmCA,iBAAAA,OAAmC,WAAW;MAC1F,KAAA;AACE,eAAOA,iBAAAA,OAAmCA,iBAAAA,OAAmC,gBAAgB;IACjG;EACF;AAXgBF;4BAAAA,cAAAA;AAYlB,GA5BiBP,6BAAAA,2BAAAA,CAAAA,EAAAA;AA8BV,IAAKU,4BAAAA,0BAAAA,4BAAAA;;;;;SAAAA;;AAOL,IAAKC,sBAAAA,0BAAAA,sBAAAA;;;;SAAAA;;;;ACxDL,IAAKC,YAAAA,0BAAAA,YAAAA;;;;;SAAAA;;;;ACFZ,SAASC,kBAAkBC,mBAAmB;AAE9C,SAASC,MAAMC,OAAa;AAC1B,SAAOA,MAAMC,MAAM,mBAAA,MAAyB;AAC9C;AAFSF;AAIF,SAASG,kBAAkBF,OAAsB;AACtD,MAAI,OAAOA,UAAU,UAAU;AAC7B,QAAID,MAAMC,KAAAA,KAAUG,YAAYC,SAASJ,KAAAA,GAAQ;AAE/C,aAAOA;IACT,WAAWK,iBAAiBC,aAAaN,KAAAA,KAAUK,iBAAiBE,eAAeP,KAAAA,GAAQ;AACzF,aAAOA;IACT;AACA,UAAMQ,MAAM,2CAAA;EACd;AAEA,MAAI;AACF,WAAOC,KAAKC,UAAUV,KAAAA;EACxB,SAASW,GAAG;AACV,UAAM,IAAIH,MAAM,wCAAwCR,KAAAA,EAAO;EACjE;AACF;AAhBgBE;","names":["AbstractContactStore","AbstractDigitalCredentialStore","AbstractIssuanceBrandingStore","AbstractEventLoggerStore","IAbstractMachineStateStore","AbstractPDStore","AbstractCredentialDesignStore","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","ValueType","CredentialMapper","ObjectUtils","isHex","input","match","ensureRawDocument","ObjectUtils","isBase64","CredentialMapper","isJwtEncoded","isSdJwtEncoded","Error","JSON","stringify","e"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.data-store-types",
3
- "version": "0.37.2-next.14+b7a013bb",
3
+ "version": "0.37.2-next.21+d0cb5b4b",
4
4
  "source": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,12 +21,12 @@
21
21
  "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
22
22
  },
23
23
  "dependencies": {
24
- "@sphereon/ssi-sdk.core": "0.37.2-next.14+b7a013bb",
25
- "@sphereon/ssi-types": "0.37.2-next.14+b7a013bb",
24
+ "@sphereon/ssi-sdk.core": "0.37.2-next.21+d0cb5b4b",
25
+ "@sphereon/ssi-types": "0.37.2-next.21+d0cb5b4b",
26
26
  "dcql": "1.0.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.2-next.14+b7a013bb"
29
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.2-next.21+d0cb5b4b"
30
30
  },
31
31
  "files": [
32
32
  "dist",
@@ -47,5 +47,5 @@
47
47
  "PostgreSQL",
48
48
  "Contact Store"
49
49
  ],
50
- "gitHead": "b7a013bb77cba07e43a97bb2fed6d085ece4d65f"
50
+ "gitHead": "d0cb5b4ba4baf038fc8d64be3524b0a5b83d54cb"
51
51
  }
@@ -2,6 +2,8 @@ import {
2
2
  CredentialDesign,
3
3
  GetCredentialDesignArgs,
4
4
  GetCredentialDesignsArgs,
5
+ CountCredentialDesignsArgs,
6
+ FormStepGetOrCreateArgs,
5
7
  AddCredentialDesignArgs,
6
8
  UpdateCredentialDesignArgs,
7
9
  RemoveCredentialDesignArgs
@@ -10,7 +12,9 @@ import {
10
12
  export abstract class AbstractCredentialDesignStore {
11
13
  abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>
12
14
  abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>
15
+ abstract countCredentialDesigns(args?: CountCredentialDesignsArgs): Promise<number>
13
16
  abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>
14
17
  abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>
15
18
  abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>
19
+ abstract formStepGetOrCreate(args: FormStepGetOrCreateArgs): Promise<string>
16
20
  }
@@ -8,12 +8,25 @@ export type GetCredentialDesignsArgs = {
8
8
  filter?: {
9
9
  tenantId?: string
10
10
  }
11
+ limit?: number
12
+ offset?: number
13
+ }
14
+
15
+ export type CountCredentialDesignsArgs = {
16
+ filter?: {
17
+ tenantId?: string
18
+ }
19
+ }
20
+
21
+ export type FormStepGetOrCreateArgs = {
22
+ formStepId: string
11
23
  }
12
24
 
13
25
  export type AddCredentialDesignArgs = {
14
- name: string
26
+ identifier: string
15
27
  tenantId?: string
16
28
  design?: NonPersistedCredentialDesign
29
+ formStepId?: string
17
30
  }
18
31
 
19
32
  export type RemoveCredentialDesignArgs = {
@@ -22,7 +35,7 @@ export type RemoveCredentialDesignArgs = {
22
35
 
23
36
  export type UpdateCredentialDesignArgs = {
24
37
  credentialDesignId: string
25
- name?: string
38
+ identifier?: string
26
39
  tenantId?: string
27
40
  design?: Partial<NonPersistedCredentialDesign>
28
41
  }
@@ -7,7 +7,7 @@ export enum ValueType {
7
7
  Date = 'Date',
8
8
  }
9
9
 
10
- export type MetaDataValue = {
10
+ export type MetadataValue = {
11
11
  id: string
12
12
  index?: number
13
13
  textValue?: string
@@ -16,17 +16,17 @@ export type MetaDataValue = {
16
16
  timestampValue?: Date
17
17
  }
18
18
 
19
- export type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>
19
+ export type NonPersistedMetadataValue = Omit<MetadataValue, 'id'>
20
20
 
21
- export type MetaDataKey = {
21
+ export type MetadataKey = {
22
22
  id: string
23
23
  key: string
24
24
  valueType: ValueType
25
- metaDataValues: Array<MetaDataValue>
25
+ metadataValues: Array<MetadataValue>
26
26
  }
27
27
 
28
- export type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
29
- metaDataValues: Array<NonPersistedMetaDataValue>
28
+ export type NonPersistedMetadataKey = Omit<MetadataKey, 'id' | 'metadataValues'> & {
29
+ metadataValues: Array<NonPersistedMetadataValue>
30
30
  }
31
31
 
32
32
  export type SchemaDefinition = {
@@ -56,15 +56,15 @@ export type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding
56
56
 
57
57
  export type CredentialDesign = {
58
58
  id: string
59
- label: string
59
+ identifier: string
60
60
  tenantId?: string
61
- metaDataKeys: Array<MetaDataKey>
61
+ metadataKeys: Array<MetadataKey>
62
62
  schemaDefinitions: Array<SchemaDefinition>
63
63
  branding?: CredentialDesignBranding
64
64
  }
65
65
 
66
- export type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
67
- metaDataKeys?: Array<NonPersistedMetaDataKey>
66
+ export type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metadataKeys' | 'schemaDefinitions' | 'branding'> & {
67
+ metadataKeys?: Array<NonPersistedMetadataKey>
68
68
  schemaDefinitions?: Array<NonPersistedSchemaDefinition>
69
69
  branding?: NonPersistedCredentialDesignBranding
70
70
  }