@sphereon/ssi-sdk.data-store-types 0.37.1-next.5 → 0.37.2-next.14
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.
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -1
- package/dist/index.d.ts +91 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/credentialDesign/AbstractCredentialDesignStore.ts +16 -0
- package/src/index.ts +1 -0
- package/src/types/credentialDesign/IAbstractCredentialDesignStore.ts +28 -0
- package/src/types/credentialDesign/credentialDesign.ts +70 -0
- package/src/types/credentialDesign/index.ts +2 -0
- package/src/types/index.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var index_exports = {};
|
|
23
23
|
__export(index_exports, {
|
|
24
24
|
AbstractContactStore: () => AbstractContactStore,
|
|
25
|
+
AbstractCredentialDesignStore: () => AbstractCredentialDesignStore,
|
|
25
26
|
AbstractDigitalCredentialStore: () => AbstractDigitalCredentialStore,
|
|
26
27
|
AbstractEventLoggerStore: () => AbstractEventLoggerStore,
|
|
27
28
|
AbstractIssuanceBrandingStore: () => AbstractIssuanceBrandingStore,
|
|
@@ -37,6 +38,7 @@ __export(index_exports, {
|
|
|
37
38
|
PartyOrigin: () => PartyOrigin,
|
|
38
39
|
PartyTypeType: () => PartyTypeType,
|
|
39
40
|
RegulationType: () => RegulationType,
|
|
41
|
+
ValueType: () => ValueType,
|
|
40
42
|
ensureRawDocument: () => ensureRawDocument
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -83,6 +85,13 @@ var AbstractPDStore = class {
|
|
|
83
85
|
}
|
|
84
86
|
};
|
|
85
87
|
|
|
88
|
+
// src/credentialDesign/AbstractCredentialDesignStore.ts
|
|
89
|
+
var AbstractCredentialDesignStore = class {
|
|
90
|
+
static {
|
|
91
|
+
__name(this, "AbstractCredentialDesignStore");
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
86
95
|
// src/types/contact/contact.ts
|
|
87
96
|
var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
|
|
88
97
|
ConnectionType2["OPENID_CONNECT"] = "OIDC";
|
|
@@ -179,6 +188,15 @@ var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
|
|
|
179
188
|
return CredentialStateType2;
|
|
180
189
|
})({});
|
|
181
190
|
|
|
191
|
+
// src/types/credentialDesign/credentialDesign.ts
|
|
192
|
+
var ValueType = /* @__PURE__ */ (function(ValueType2) {
|
|
193
|
+
ValueType2["Text"] = "Text";
|
|
194
|
+
ValueType2["Number"] = "Number";
|
|
195
|
+
ValueType2["Boolean"] = "Boolean";
|
|
196
|
+
ValueType2["Date"] = "Date";
|
|
197
|
+
return ValueType2;
|
|
198
|
+
})({});
|
|
199
|
+
|
|
182
200
|
// src/utils/MappingUtils.ts
|
|
183
201
|
var import_ssi_types = require("@sphereon/ssi-types");
|
|
184
202
|
function isHex(input) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -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/types/contact/contact.ts","../src/types/digitalCredential/enums.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'\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 { 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 { 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;;;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;;;;AC1DZ,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","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","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 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"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -799,6 +799,88 @@ type NonPersistedDigitalCredential = Omit<DigitalCredential, 'id' | 'regulationT
|
|
|
799
799
|
};
|
|
800
800
|
type UpdateCredentialArgsWithoutIdentifier = Omit<UpdateCredentialArgs, 'id' | 'hash'>;
|
|
801
801
|
|
|
802
|
+
declare enum ValueType {
|
|
803
|
+
Text = "Text",
|
|
804
|
+
Number = "Number",
|
|
805
|
+
Boolean = "Boolean",
|
|
806
|
+
Date = "Date"
|
|
807
|
+
}
|
|
808
|
+
type MetaDataValue = {
|
|
809
|
+
id: string;
|
|
810
|
+
index?: number;
|
|
811
|
+
textValue?: string;
|
|
812
|
+
numberValue?: number;
|
|
813
|
+
booleanValue?: boolean;
|
|
814
|
+
timestampValue?: Date;
|
|
815
|
+
};
|
|
816
|
+
type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>;
|
|
817
|
+
type MetaDataKey = {
|
|
818
|
+
id: string;
|
|
819
|
+
key: string;
|
|
820
|
+
valueType: ValueType;
|
|
821
|
+
metaDataValues: Array<MetaDataValue>;
|
|
822
|
+
};
|
|
823
|
+
type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
|
|
824
|
+
metaDataValues: Array<NonPersistedMetaDataValue>;
|
|
825
|
+
};
|
|
826
|
+
type SchemaDefinition = {
|
|
827
|
+
id: string;
|
|
828
|
+
tenantId?: string;
|
|
829
|
+
extendsId?: string;
|
|
830
|
+
correlationId?: string;
|
|
831
|
+
schemaType?: string;
|
|
832
|
+
entityType?: string;
|
|
833
|
+
schema: string;
|
|
834
|
+
};
|
|
835
|
+
type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>;
|
|
836
|
+
type CredentialDesignBranding = {
|
|
837
|
+
id: string;
|
|
838
|
+
textColor?: string;
|
|
839
|
+
backgroundColor?: string;
|
|
840
|
+
logo?: IImageAttributes;
|
|
841
|
+
backgroundImage?: IImageAttributes;
|
|
842
|
+
};
|
|
843
|
+
type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {
|
|
844
|
+
logo?: IBasicImageAttributes;
|
|
845
|
+
backgroundImage?: IBasicImageAttributes;
|
|
846
|
+
};
|
|
847
|
+
type CredentialDesign = {
|
|
848
|
+
id: string;
|
|
849
|
+
label: string;
|
|
850
|
+
tenantId?: string;
|
|
851
|
+
metaDataKeys: Array<MetaDataKey>;
|
|
852
|
+
schemaDefinitions: Array<SchemaDefinition>;
|
|
853
|
+
branding?: CredentialDesignBranding;
|
|
854
|
+
};
|
|
855
|
+
type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
|
|
856
|
+
metaDataKeys?: Array<NonPersistedMetaDataKey>;
|
|
857
|
+
schemaDefinitions?: Array<NonPersistedSchemaDefinition>;
|
|
858
|
+
branding?: NonPersistedCredentialDesignBranding;
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
type GetCredentialDesignArgs = {
|
|
862
|
+
credentialDesignId: string;
|
|
863
|
+
};
|
|
864
|
+
type GetCredentialDesignsArgs = {
|
|
865
|
+
filter?: {
|
|
866
|
+
tenantId?: string;
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
type AddCredentialDesignArgs = {
|
|
870
|
+
name: string;
|
|
871
|
+
tenantId?: string;
|
|
872
|
+
design?: NonPersistedCredentialDesign;
|
|
873
|
+
};
|
|
874
|
+
type RemoveCredentialDesignArgs = {
|
|
875
|
+
credentialDesignId: string;
|
|
876
|
+
};
|
|
877
|
+
type UpdateCredentialDesignArgs = {
|
|
878
|
+
credentialDesignId: string;
|
|
879
|
+
name?: string;
|
|
880
|
+
tenantId?: string;
|
|
881
|
+
design?: Partial<NonPersistedCredentialDesign>;
|
|
882
|
+
};
|
|
883
|
+
|
|
802
884
|
declare abstract class AbstractContactStore {
|
|
803
885
|
abstract getParty(args: GetPartyArgs): Promise<Party>;
|
|
804
886
|
abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>;
|
|
@@ -929,6 +1011,14 @@ declare abstract class AbstractPDStore {
|
|
|
929
1011
|
abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>;
|
|
930
1012
|
}
|
|
931
1013
|
|
|
1014
|
+
declare abstract class AbstractCredentialDesignStore {
|
|
1015
|
+
abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1016
|
+
abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>;
|
|
1017
|
+
abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1018
|
+
abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1019
|
+
abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
932
1022
|
declare function ensureRawDocument(input: string | object): string;
|
|
933
1023
|
|
|
934
|
-
export { AbstractContactStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, 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, 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 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 MetadataTypes, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetadataItem, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, 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 RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ensureRawDocument };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -799,6 +799,88 @@ type NonPersistedDigitalCredential = Omit<DigitalCredential, 'id' | 'regulationT
|
|
|
799
799
|
};
|
|
800
800
|
type UpdateCredentialArgsWithoutIdentifier = Omit<UpdateCredentialArgs, 'id' | 'hash'>;
|
|
801
801
|
|
|
802
|
+
declare enum ValueType {
|
|
803
|
+
Text = "Text",
|
|
804
|
+
Number = "Number",
|
|
805
|
+
Boolean = "Boolean",
|
|
806
|
+
Date = "Date"
|
|
807
|
+
}
|
|
808
|
+
type MetaDataValue = {
|
|
809
|
+
id: string;
|
|
810
|
+
index?: number;
|
|
811
|
+
textValue?: string;
|
|
812
|
+
numberValue?: number;
|
|
813
|
+
booleanValue?: boolean;
|
|
814
|
+
timestampValue?: Date;
|
|
815
|
+
};
|
|
816
|
+
type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>;
|
|
817
|
+
type MetaDataKey = {
|
|
818
|
+
id: string;
|
|
819
|
+
key: string;
|
|
820
|
+
valueType: ValueType;
|
|
821
|
+
metaDataValues: Array<MetaDataValue>;
|
|
822
|
+
};
|
|
823
|
+
type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
|
|
824
|
+
metaDataValues: Array<NonPersistedMetaDataValue>;
|
|
825
|
+
};
|
|
826
|
+
type SchemaDefinition = {
|
|
827
|
+
id: string;
|
|
828
|
+
tenantId?: string;
|
|
829
|
+
extendsId?: string;
|
|
830
|
+
correlationId?: string;
|
|
831
|
+
schemaType?: string;
|
|
832
|
+
entityType?: string;
|
|
833
|
+
schema: string;
|
|
834
|
+
};
|
|
835
|
+
type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>;
|
|
836
|
+
type CredentialDesignBranding = {
|
|
837
|
+
id: string;
|
|
838
|
+
textColor?: string;
|
|
839
|
+
backgroundColor?: string;
|
|
840
|
+
logo?: IImageAttributes;
|
|
841
|
+
backgroundImage?: IImageAttributes;
|
|
842
|
+
};
|
|
843
|
+
type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {
|
|
844
|
+
logo?: IBasicImageAttributes;
|
|
845
|
+
backgroundImage?: IBasicImageAttributes;
|
|
846
|
+
};
|
|
847
|
+
type CredentialDesign = {
|
|
848
|
+
id: string;
|
|
849
|
+
label: string;
|
|
850
|
+
tenantId?: string;
|
|
851
|
+
metaDataKeys: Array<MetaDataKey>;
|
|
852
|
+
schemaDefinitions: Array<SchemaDefinition>;
|
|
853
|
+
branding?: CredentialDesignBranding;
|
|
854
|
+
};
|
|
855
|
+
type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
|
|
856
|
+
metaDataKeys?: Array<NonPersistedMetaDataKey>;
|
|
857
|
+
schemaDefinitions?: Array<NonPersistedSchemaDefinition>;
|
|
858
|
+
branding?: NonPersistedCredentialDesignBranding;
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
type GetCredentialDesignArgs = {
|
|
862
|
+
credentialDesignId: string;
|
|
863
|
+
};
|
|
864
|
+
type GetCredentialDesignsArgs = {
|
|
865
|
+
filter?: {
|
|
866
|
+
tenantId?: string;
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
type AddCredentialDesignArgs = {
|
|
870
|
+
name: string;
|
|
871
|
+
tenantId?: string;
|
|
872
|
+
design?: NonPersistedCredentialDesign;
|
|
873
|
+
};
|
|
874
|
+
type RemoveCredentialDesignArgs = {
|
|
875
|
+
credentialDesignId: string;
|
|
876
|
+
};
|
|
877
|
+
type UpdateCredentialDesignArgs = {
|
|
878
|
+
credentialDesignId: string;
|
|
879
|
+
name?: string;
|
|
880
|
+
tenantId?: string;
|
|
881
|
+
design?: Partial<NonPersistedCredentialDesign>;
|
|
882
|
+
};
|
|
883
|
+
|
|
802
884
|
declare abstract class AbstractContactStore {
|
|
803
885
|
abstract getParty(args: GetPartyArgs): Promise<Party>;
|
|
804
886
|
abstract getParties(args?: GetPartiesArgs): Promise<Array<Party>>;
|
|
@@ -929,6 +1011,14 @@ declare abstract class AbstractPDStore {
|
|
|
929
1011
|
abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>;
|
|
930
1012
|
}
|
|
931
1013
|
|
|
1014
|
+
declare abstract class AbstractCredentialDesignStore {
|
|
1015
|
+
abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1016
|
+
abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>;
|
|
1017
|
+
abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1018
|
+
abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>;
|
|
1019
|
+
abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
932
1022
|
declare function ensureRawDocument(input: string | object): string;
|
|
933
1023
|
|
|
934
|
-
export { AbstractContactStore, AbstractDigitalCredentialStore, AbstractEventLoggerStore, AbstractIssuanceBrandingStore, AbstractPDStore, type AddCredentialArgs, 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, 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 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 MetadataTypes, type NaturalPerson, type NonPersistedActivityLoggingEvent, type NonPersistedAuditLoggingEvent, type NonPersistedConnection, type NonPersistedConnectionConfig, type NonPersistedContact, type NonPersistedCorrelationIdentifier, type NonPersistedDcqlQueryItem, type NonPersistedDidAuthConfig, type NonPersistedDigitalCredential, type NonPersistedElectronicAddress, type NonPersistedIdentity, type NonPersistedMetadataItem, type NonPersistedNaturalPerson, type NonPersistedOpenIdConfig, type NonPersistedOrganization, type NonPersistedParty, type NonPersistedPartyRelationship, type NonPersistedPartyType, type NonPersistedPhysicalAddress, 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 RemoveElectronicAddressArgs, type RemoveIdentityArgs, type RemovePartyArgs, type RemovePartyTypeArgs, type RemovePhysicalAddressArgs, type RemoveRelationshipArgs, type StoreActivityEventArgs, type StoreAuditEventArgs, type StoreFindMachineStatesArgs, type StoreMachineStateDeleteArgs, type StoreMachineStateDeleteExpiredArgs, type StoreMachineStateGetArgs, type StoreMachineStateInfo, type StoreMachineStatePersistArgs, type StoreMachineStatesFindActiveArgs, type UpdateCredentialArgs, type UpdateCredentialArgsWithoutIdentifier, type UpdateCredentialStateArgs, type UpdateDefinitionArgs, type UpdateElectronicAddressArgs, type UpdateIdentityArgs, type UpdatePartyArgs, type UpdatePartyTypeArgs, type UpdatePhysicalAddressArgs, type UpdateRelationshipArgs, type ValidationConstraint, ensureRawDocument };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,13 @@ var AbstractPDStore = class {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
// src/credentialDesign/AbstractCredentialDesignStore.ts
|
|
47
|
+
var AbstractCredentialDesignStore = class {
|
|
48
|
+
static {
|
|
49
|
+
__name(this, "AbstractCredentialDesignStore");
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
46
53
|
// src/types/contact/contact.ts
|
|
47
54
|
var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
|
|
48
55
|
ConnectionType2["OPENID_CONNECT"] = "OIDC";
|
|
@@ -139,6 +146,15 @@ var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
|
|
|
139
146
|
return CredentialStateType2;
|
|
140
147
|
})({});
|
|
141
148
|
|
|
149
|
+
// src/types/credentialDesign/credentialDesign.ts
|
|
150
|
+
var ValueType = /* @__PURE__ */ (function(ValueType2) {
|
|
151
|
+
ValueType2["Text"] = "Text";
|
|
152
|
+
ValueType2["Number"] = "Number";
|
|
153
|
+
ValueType2["Boolean"] = "Boolean";
|
|
154
|
+
ValueType2["Date"] = "Date";
|
|
155
|
+
return ValueType2;
|
|
156
|
+
})({});
|
|
157
|
+
|
|
142
158
|
// src/utils/MappingUtils.ts
|
|
143
159
|
import { CredentialMapper, ObjectUtils } from "@sphereon/ssi-types";
|
|
144
160
|
function isHex(input) {
|
|
@@ -163,6 +179,7 @@ function ensureRawDocument(input) {
|
|
|
163
179
|
__name(ensureRawDocument, "ensureRawDocument");
|
|
164
180
|
export {
|
|
165
181
|
AbstractContactStore,
|
|
182
|
+
AbstractCredentialDesignStore,
|
|
166
183
|
AbstractDigitalCredentialStore,
|
|
167
184
|
AbstractEventLoggerStore,
|
|
168
185
|
AbstractIssuanceBrandingStore,
|
|
@@ -178,6 +195,7 @@ export {
|
|
|
178
195
|
PartyOrigin,
|
|
179
196
|
PartyTypeType,
|
|
180
197
|
RegulationType,
|
|
198
|
+
ValueType,
|
|
181
199
|
ensureRawDocument
|
|
182
200
|
};
|
|
183
201
|
//# sourceMappingURL=index.js.map
|
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/types/contact/contact.ts","../src/types/digitalCredential/enums.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 { 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 { 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;;;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;;;;AC1DZ,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","ConnectionType","CorrelationIdentifierType","PartyTypeType","PartyOrigin","IdentityOrigin","DocumentType","RegulationType","CredentialDocumentFormat","fromSpecValue","credentialFormat","format","toLowerCase","includes","Error","toSpecValue","documentFormat","documentType","CredentialCorrelationType","CredentialStateType","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 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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store-types",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.2-next.14+b7a013bb",
|
|
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.
|
|
25
|
-
"@sphereon/ssi-types": "0.37.
|
|
24
|
+
"@sphereon/ssi-sdk.core": "0.37.2-next.14+b7a013bb",
|
|
25
|
+
"@sphereon/ssi-types": "0.37.2-next.14+b7a013bb",
|
|
26
26
|
"dcql": "1.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.
|
|
29
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.2-next.14+b7a013bb"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"PostgreSQL",
|
|
48
48
|
"Contact Store"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "b7a013bb77cba07e43a97bb2fed6d085ece4d65f"
|
|
51
51
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CredentialDesign,
|
|
3
|
+
GetCredentialDesignArgs,
|
|
4
|
+
GetCredentialDesignsArgs,
|
|
5
|
+
AddCredentialDesignArgs,
|
|
6
|
+
UpdateCredentialDesignArgs,
|
|
7
|
+
RemoveCredentialDesignArgs
|
|
8
|
+
} from '../types'
|
|
9
|
+
|
|
10
|
+
export abstract class AbstractCredentialDesignStore {
|
|
11
|
+
abstract getCredentialDesign(args: GetCredentialDesignArgs): Promise<CredentialDesign>
|
|
12
|
+
abstract getCredentialDesigns(args?: GetCredentialDesignsArgs): Promise<Array<CredentialDesign>>
|
|
13
|
+
abstract addCredentialDesign(args: AddCredentialDesignArgs): Promise<CredentialDesign>
|
|
14
|
+
abstract updateCredentialDesign(args: UpdateCredentialDesignArgs): Promise<CredentialDesign>
|
|
15
|
+
abstract removeCredentialDesign(args: RemoveCredentialDesignArgs): Promise<void>
|
|
16
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuan
|
|
|
6
6
|
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
7
7
|
export { IAbstractMachineStateStore } from './machineState/IAbstractMachineStateStore'
|
|
8
8
|
export { AbstractPDStore } from './presentationDefinition/AbstractPDStore'
|
|
9
|
+
export { AbstractCredentialDesignStore } from './credentialDesign/AbstractCredentialDesignStore'
|
|
9
10
|
|
|
10
11
|
export * from './types'
|
|
11
12
|
export * from './utils/MappingUtils'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NonPersistedCredentialDesign } from './credentialDesign'
|
|
2
|
+
|
|
3
|
+
export type GetCredentialDesignArgs = {
|
|
4
|
+
credentialDesignId: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type GetCredentialDesignsArgs = {
|
|
8
|
+
filter?: {
|
|
9
|
+
tenantId?: string
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AddCredentialDesignArgs = {
|
|
14
|
+
name: string
|
|
15
|
+
tenantId?: string
|
|
16
|
+
design?: NonPersistedCredentialDesign
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type RemoveCredentialDesignArgs = {
|
|
20
|
+
credentialDesignId: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type UpdateCredentialDesignArgs = {
|
|
24
|
+
credentialDesignId: string
|
|
25
|
+
name?: string
|
|
26
|
+
tenantId?: string
|
|
27
|
+
design?: Partial<NonPersistedCredentialDesign>
|
|
28
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { IBasicImageAttributes, IImageAttributes } from '../issuanceBranding/issuanceBranding'
|
|
2
|
+
|
|
3
|
+
export enum ValueType {
|
|
4
|
+
Text = 'Text',
|
|
5
|
+
Number = 'Number',
|
|
6
|
+
Boolean = 'Boolean',
|
|
7
|
+
Date = 'Date',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type MetaDataValue = {
|
|
11
|
+
id: string
|
|
12
|
+
index?: number
|
|
13
|
+
textValue?: string
|
|
14
|
+
numberValue?: number
|
|
15
|
+
booleanValue?: boolean
|
|
16
|
+
timestampValue?: Date
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type NonPersistedMetaDataValue = Omit<MetaDataValue, 'id'>
|
|
20
|
+
|
|
21
|
+
export type MetaDataKey = {
|
|
22
|
+
id: string
|
|
23
|
+
key: string
|
|
24
|
+
valueType: ValueType
|
|
25
|
+
metaDataValues: Array<MetaDataValue>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type NonPersistedMetaDataKey = Omit<MetaDataKey, 'id' | 'metaDataValues'> & {
|
|
29
|
+
metaDataValues: Array<NonPersistedMetaDataValue>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type SchemaDefinition = {
|
|
33
|
+
id: string
|
|
34
|
+
tenantId?: string
|
|
35
|
+
extendsId?: string
|
|
36
|
+
correlationId?: string
|
|
37
|
+
schemaType?: string
|
|
38
|
+
entityType?: string
|
|
39
|
+
schema: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type NonPersistedSchemaDefinition = Omit<SchemaDefinition, 'id'>
|
|
43
|
+
|
|
44
|
+
export type CredentialDesignBranding = {
|
|
45
|
+
id: string
|
|
46
|
+
textColor?: string
|
|
47
|
+
backgroundColor?: string
|
|
48
|
+
logo?: IImageAttributes
|
|
49
|
+
backgroundImage?: IImageAttributes
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type NonPersistedCredentialDesignBranding = Omit<CredentialDesignBranding, 'id' | 'logo' | 'backgroundImage'> & {
|
|
53
|
+
logo?: IBasicImageAttributes
|
|
54
|
+
backgroundImage?: IBasicImageAttributes
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type CredentialDesign = {
|
|
58
|
+
id: string
|
|
59
|
+
label: string
|
|
60
|
+
tenantId?: string
|
|
61
|
+
metaDataKeys: Array<MetaDataKey>
|
|
62
|
+
schemaDefinitions: Array<SchemaDefinition>
|
|
63
|
+
branding?: CredentialDesignBranding
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type NonPersistedCredentialDesign = Omit<CredentialDesign, 'id' | 'metaDataKeys' | 'schemaDefinitions' | 'branding'> & {
|
|
67
|
+
metaDataKeys?: Array<NonPersistedMetaDataKey>
|
|
68
|
+
schemaDefinitions?: Array<NonPersistedSchemaDefinition>
|
|
69
|
+
branding?: NonPersistedCredentialDesignBranding
|
|
70
|
+
}
|
package/src/types/index.ts
CHANGED