@sphereon/ssi-sdk.data-store 0.34.1-next.3 → 0.34.1-next.323
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 +3377 -2924
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +357 -1203
- package/dist/index.d.ts +357 -1203
- package/dist/index.js +3300 -2847
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/src/__tests__/contact.entities.test.ts +4 -10
- package/src/__tests__/contact.store.test.ts +11 -6
- package/src/__tests__/digitalCredential.entities.test.ts +13 -6
- package/src/__tests__/digitalCredential.store.test.ts +6 -6
- package/src/__tests__/eventLogger.entities.test.ts +3 -3
- package/src/__tests__/eventLogger.store.test.ts +9 -4
- package/src/__tests__/issuanceBranding.entities.test.ts +2 -2
- package/src/__tests__/issuanceBranding.store.test.ts +3 -3
- package/src/__tests__/machineState.entities.test.ts +1 -1
- package/src/__tests__/machineState.store.test.ts +1 -1
- package/src/__tests__/pd-manager.entities.test.ts +27 -98
- package/src/__tests__/pd-manager.store.test.ts +151 -101
- package/src/__tests__/statusList.entities.test.ts +61 -4
- package/src/__tests__/statusList.store.test.ts +67 -4
- package/src/contact/ContactStore.ts +35 -35
- package/src/digitalCredential/DigitalCredentialStore.ts +6 -7
- package/src/entities/contact/BaseConfigEntity.ts +2 -2
- package/src/entities/contact/BaseContactEntity.ts +4 -5
- package/src/entities/contact/ConnectionEntity.ts +4 -4
- package/src/entities/contact/ContactMetadataItemEntity.ts +3 -4
- package/src/entities/contact/CorrelationIdentifierEntity.ts +3 -4
- package/src/entities/contact/DidAuthConfigEntity.ts +1 -2
- package/src/entities/contact/ElectronicAddressEntity.ts +15 -5
- package/src/entities/contact/IdentityEntity.ts +12 -11
- package/src/entities/contact/IdentityMetadataItemEntity.ts +3 -3
- package/src/entities/contact/NaturalPersonEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +1 -1
- package/src/entities/contact/PartyEntity.ts +7 -7
- package/src/entities/contact/PartyRelationshipEntity.ts +8 -8
- package/src/entities/contact/PartyTypeEntity.ts +4 -4
- package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +4 -3
- package/src/entities/eventLogger/AuditEventEntity.ts +2 -2
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +6 -7
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +1 -1
- package/src/entities/presentationDefinition/{PresentationDefinitionItemEntity.ts → DcqlQueryItemEntity.ts} +10 -14
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +60 -0
- package/src/entities/statusList/StatusList2021EntryEntity.ts +4 -3
- package/src/entities/statusList/StatusListEntities.ts +55 -7
- package/src/eventLogger/EventLoggerStore.ts +2 -2
- package/src/index.ts +31 -26
- package/src/issuanceBranding/IssuanceBrandingStore.ts +25 -25
- package/src/machineState/MachineStateStore.ts +7 -7
- package/src/migrations/generic/1-CreateContacts.ts +1 -1
- package/src/migrations/generic/10-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +2 -2
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +82 -0
- package/src/migrations/generic/13-CreateDcqlQueryItem.ts +67 -0
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/generic/3-CreateContacts.ts +2 -2
- package/src/migrations/generic/4-CreateStatusList.ts +1 -1
- package/src/migrations/generic/5-CreateAuditEvents.ts +2 -2
- package/src/migrations/generic/6-CreateDigitalCredential.ts +1 -1
- package/src/migrations/generic/7-CreateMachineStateStore.ts +1 -1
- package/src/migrations/generic/8-CreateContacts.ts +1 -1
- package/src/migrations/generic/9-CreateContacts.ts +1 -1
- package/src/migrations/generic/index.ts +10 -4
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/postgres/1726588800000-CreateDcqlQueryItem.ts +25 -0
- package/src/migrations/postgres/1737110469001-UpdateStatusList.ts +1 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +67 -0
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/sqlite/1726617600000-CreateDcqlQueryItem.ts +24 -0
- package/src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts +145 -0
- package/src/presentationDefinition/PDStore.ts +45 -45
- package/src/statusList/IStatusListStore.ts +14 -11
- package/src/statusList/StatusListStore.ts +74 -36
- package/src/types/index.ts +0 -12
- package/src/types/statusList/IAbstractStatusListStore.ts +55 -5
- package/src/types/statusList/statusList.ts +50 -2
- package/src/utils/ValidatorUtils.ts +1 -1
- package/src/utils/contact/MappingUtils.ts +10 -10
- package/src/utils/digitalCredential/MappingUtils.ts +3 -21
- package/src/utils/eventLogger/MappingUtils.ts +2 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +13 -13
- package/src/utils/presentationDefinition/MappingUtils.ts +31 -22
- package/src/utils/statusList/MappingUtils.ts +71 -30
- package/src/contact/AbstractContactStore.ts +0 -71
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +0 -21
- package/src/eventLogger/AbstractEventLoggerStore.ts +0 -9
- package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +0 -41
- package/src/machineState/IAbstractMachineStateStore.ts +0 -65
- package/src/presentationDefinition/AbstractPDStore.ts +0 -20
- package/src/types/contact/IAbstractContactStore.ts +0 -161
- package/src/types/contact/contact.ts +0 -295
- package/src/types/contact/index.ts +0 -2
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +0 -43
- package/src/types/digitalCredential/enums.ts +0 -70
- package/src/types/digitalCredential/index.ts +0 -3
- package/src/types/digitalCredential/types.ts +0 -39
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +0 -22
- package/src/types/eventLogger/eventLogger.ts +0 -4
- package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +0 -85
- package/src/types/issuanceBranding/issuanceBranding.ts +0 -138
- package/src/types/machineState/IAbstractMachineStateStore.ts +0 -68
- package/src/types/presentationDefinition/IAbstractPDStore.ts +0 -25
- package/src/types/presentationDefinition/presentationDefinition.ts +0 -19
- package/src/types/validation/validation.ts +0 -3
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
2
|
-
import { IIdentifier } from '@veramo/core'
|
|
3
|
-
import { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
|
-
import { CredentialRole } from '../digitalCredential'
|
|
5
|
-
|
|
6
|
-
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
7
|
-
|
|
8
|
-
export interface IMetadataEntity {
|
|
9
|
-
// TODO move to types
|
|
10
|
-
label: string
|
|
11
|
-
stringValue?: string
|
|
12
|
-
numberValue?: number
|
|
13
|
-
dateValue?: Date
|
|
14
|
-
boolValue?: boolean
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type Party = {
|
|
18
|
-
id: string
|
|
19
|
-
uri?: string
|
|
20
|
-
roles: Array<CredentialRole>
|
|
21
|
-
ownerId?: string
|
|
22
|
-
tenantId?: string
|
|
23
|
-
identities: Array<Identity>
|
|
24
|
-
electronicAddresses: Array<ElectronicAddress>
|
|
25
|
-
physicalAddresses: Array<PhysicalAddress>
|
|
26
|
-
contact: Contact
|
|
27
|
-
partyType: PartyType
|
|
28
|
-
/**
|
|
29
|
-
* 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.
|
|
30
|
-
*
|
|
31
|
-
* Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:
|
|
32
|
-
* 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).
|
|
33
|
-
* 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.
|
|
34
|
-
* 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.
|
|
35
|
-
*
|
|
36
|
-
* 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.
|
|
37
|
-
*/
|
|
38
|
-
branding?: IIssuerLocaleBranding
|
|
39
|
-
relationships: Array<PartyRelationship>
|
|
40
|
-
createdAt: Date
|
|
41
|
-
lastUpdatedAt: Date
|
|
42
|
-
}
|
|
43
|
-
export type NonPersistedParty = Omit<
|
|
44
|
-
Party,
|
|
45
|
-
| 'id'
|
|
46
|
-
| 'identities'
|
|
47
|
-
| 'electronicAddresses'
|
|
48
|
-
| 'physicalAddresses'
|
|
49
|
-
| 'contact'
|
|
50
|
-
| 'roles'
|
|
51
|
-
| 'partyType'
|
|
52
|
-
| 'relationships'
|
|
53
|
-
| 'createdAt'
|
|
54
|
-
| 'lastUpdatedAt'
|
|
55
|
-
> & {
|
|
56
|
-
identities?: Array<NonPersistedIdentity>
|
|
57
|
-
electronicAddresses?: Array<NonPersistedElectronicAddress>
|
|
58
|
-
physicalAddresses?: Array<NonPersistedPhysicalAddress>
|
|
59
|
-
contact: NonPersistedContact
|
|
60
|
-
partyType: NonPersistedPartyType
|
|
61
|
-
relationships?: Array<NonPersistedPartyRelationship>
|
|
62
|
-
}
|
|
63
|
-
export type PartialParty = Partial<
|
|
64
|
-
Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>
|
|
65
|
-
> & {
|
|
66
|
-
identities?: PartialIdentity
|
|
67
|
-
electronicAddresses?: PartialElectronicAddress
|
|
68
|
-
physicalAddresses?: PartialPhysicalAddress
|
|
69
|
-
contact?: PartialContact
|
|
70
|
-
partyType?: PartialPartyType
|
|
71
|
-
relationships?: PartialPartyRelationship
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type Identity = {
|
|
75
|
-
id: string
|
|
76
|
-
alias: string
|
|
77
|
-
ownerId?: string
|
|
78
|
-
tenantId?: string
|
|
79
|
-
origin: IdentityOrigin
|
|
80
|
-
roles: Array<CredentialRole>
|
|
81
|
-
identifier: CorrelationIdentifier
|
|
82
|
-
connection?: Connection
|
|
83
|
-
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
84
|
-
createdAt: Date
|
|
85
|
-
lastUpdatedAt: Date
|
|
86
|
-
}
|
|
87
|
-
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'origin' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
88
|
-
origin: IdentityOrigin
|
|
89
|
-
identifier: NonPersistedCorrelationIdentifier
|
|
90
|
-
connection?: NonPersistedConnection
|
|
91
|
-
metadata?: Array<NonPersistedMetadataItem<MetadataTypes>>
|
|
92
|
-
}
|
|
93
|
-
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'origin' | 'roles'>> & {
|
|
94
|
-
identifier?: PartialCorrelationIdentifier
|
|
95
|
-
connection?: PartialConnection
|
|
96
|
-
metadata?: PartialMetadataItem<MetadataTypes> // Usage: FindIdentityArgs = Array<PartialIdentity>
|
|
97
|
-
origin?: IdentityOrigin
|
|
98
|
-
roles?: CredentialRole
|
|
99
|
-
partyId?: string
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type MetadataItem<T extends MetadataTypes> = {
|
|
103
|
-
id: string
|
|
104
|
-
label: string
|
|
105
|
-
value: T
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type NonPersistedMetadataItem<T extends MetadataTypes> = Omit<MetadataItem<T>, 'id'>
|
|
109
|
-
export type PartialMetadataItem<T extends MetadataTypes> = Partial<MetadataItem<T>>
|
|
110
|
-
|
|
111
|
-
export type CorrelationIdentifier = {
|
|
112
|
-
id: string
|
|
113
|
-
ownerId?: string
|
|
114
|
-
tenantId?: string
|
|
115
|
-
type: CorrelationIdentifierType
|
|
116
|
-
correlationId: string
|
|
117
|
-
}
|
|
118
|
-
export type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>
|
|
119
|
-
export type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>
|
|
120
|
-
|
|
121
|
-
export type Connection = {
|
|
122
|
-
id: string
|
|
123
|
-
ownerId?: string
|
|
124
|
-
tenantId?: string
|
|
125
|
-
type: ConnectionType
|
|
126
|
-
config: ConnectionConfig
|
|
127
|
-
}
|
|
128
|
-
export type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {
|
|
129
|
-
config: NonPersistedConnectionConfig
|
|
130
|
-
}
|
|
131
|
-
export type PartialConnection = Partial<Omit<Connection, 'config'>> & {
|
|
132
|
-
config: PartialConnectionConfig
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export type OpenIdConfig = {
|
|
136
|
-
id: string
|
|
137
|
-
clientId: string
|
|
138
|
-
clientSecret: string
|
|
139
|
-
ownerId?: string
|
|
140
|
-
tenantId?: string
|
|
141
|
-
scopes: Array<string>
|
|
142
|
-
issuer: string
|
|
143
|
-
redirectUrl: string
|
|
144
|
-
dangerouslyAllowInsecureHttpRequests: boolean
|
|
145
|
-
clientAuthMethod: 'basic' | 'post' | undefined
|
|
146
|
-
}
|
|
147
|
-
export type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>
|
|
148
|
-
export type PartialOpenIdConfig = Partial<OpenIdConfig>
|
|
149
|
-
|
|
150
|
-
export type DidAuthConfig = {
|
|
151
|
-
id: string
|
|
152
|
-
idOpts: ManagedIdentifierOptsOrResult
|
|
153
|
-
stateId: string
|
|
154
|
-
ownerId?: string
|
|
155
|
-
tenantId?: string
|
|
156
|
-
redirectUrl: string
|
|
157
|
-
sessionId: string
|
|
158
|
-
}
|
|
159
|
-
export type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>
|
|
160
|
-
export type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {
|
|
161
|
-
identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export type ConnectionConfig = OpenIdConfig | DidAuthConfig
|
|
165
|
-
export type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig
|
|
166
|
-
export type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig
|
|
167
|
-
|
|
168
|
-
export type NaturalPerson = {
|
|
169
|
-
id: string
|
|
170
|
-
firstName: string
|
|
171
|
-
lastName: string
|
|
172
|
-
middleName?: string
|
|
173
|
-
displayName: string
|
|
174
|
-
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
175
|
-
ownerId?: string
|
|
176
|
-
tenantId?: string
|
|
177
|
-
createdAt: Date
|
|
178
|
-
lastUpdatedAt: Date
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
182
|
-
|
|
183
|
-
export type PartialNaturalPerson = Partial<Omit<NaturalPerson, 'metadata'>> & {
|
|
184
|
-
metadata?: PartialMetadataItem<MetadataTypes>
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export type Organization = {
|
|
188
|
-
id: string
|
|
189
|
-
legalName: string
|
|
190
|
-
displayName: string
|
|
191
|
-
metadata?: Array<MetadataItem<MetadataTypes>>
|
|
192
|
-
ownerId?: string
|
|
193
|
-
tenantId?: string
|
|
194
|
-
createdAt: Date
|
|
195
|
-
lastUpdatedAt: Date
|
|
196
|
-
}
|
|
197
|
-
export type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
198
|
-
export type PartialOrganization = Partial<Omit<Organization, 'metadata'>> & {
|
|
199
|
-
metadata?: PartialMetadataItem<MetadataTypes>
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export type Contact = NaturalPerson | Organization
|
|
203
|
-
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
204
|
-
export type PartialContact = PartialNaturalPerson | PartialOrganization
|
|
205
|
-
|
|
206
|
-
export type PartyType = {
|
|
207
|
-
id: string
|
|
208
|
-
type: PartyTypeType
|
|
209
|
-
origin: PartyOrigin
|
|
210
|
-
name: string
|
|
211
|
-
tenantId: string
|
|
212
|
-
description?: string
|
|
213
|
-
createdAt: Date
|
|
214
|
-
lastUpdatedAt: Date
|
|
215
|
-
}
|
|
216
|
-
export type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
217
|
-
id?: string
|
|
218
|
-
}
|
|
219
|
-
export type PartialPartyType = Partial<PartyType>
|
|
220
|
-
|
|
221
|
-
export type PartyRelationship = {
|
|
222
|
-
id: string
|
|
223
|
-
leftId: string
|
|
224
|
-
rightId: string
|
|
225
|
-
ownerId?: string
|
|
226
|
-
tenantId?: string
|
|
227
|
-
createdAt: Date
|
|
228
|
-
lastUpdatedAt: Date
|
|
229
|
-
}
|
|
230
|
-
export type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
231
|
-
export type PartialPartyRelationship = Partial<PartyRelationship>
|
|
232
|
-
|
|
233
|
-
export type ElectronicAddress = {
|
|
234
|
-
id: string
|
|
235
|
-
type: ElectronicAddressType
|
|
236
|
-
electronicAddress: string
|
|
237
|
-
ownerId?: string
|
|
238
|
-
tenantId?: string
|
|
239
|
-
createdAt: Date
|
|
240
|
-
lastUpdatedAt: Date
|
|
241
|
-
}
|
|
242
|
-
export type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
243
|
-
export type PartialElectronicAddress = Partial<ElectronicAddress> & {
|
|
244
|
-
partyId?: string
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export type PhysicalAddress = {
|
|
248
|
-
id: string
|
|
249
|
-
type: PhysicalAddressType
|
|
250
|
-
streetName: string
|
|
251
|
-
streetNumber: string
|
|
252
|
-
postalCode: string
|
|
253
|
-
cityName: string
|
|
254
|
-
provinceName: string
|
|
255
|
-
countryCode: string
|
|
256
|
-
buildingName?: string
|
|
257
|
-
ownerId?: string
|
|
258
|
-
tenantId?: string
|
|
259
|
-
createdAt: Date
|
|
260
|
-
lastUpdatedAt: Date
|
|
261
|
-
}
|
|
262
|
-
export type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
263
|
-
export type PartialPhysicalAddress = Partial<PhysicalAddress> & {
|
|
264
|
-
partyId?: string
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export type ElectronicAddressType = 'email' | 'phone'
|
|
268
|
-
|
|
269
|
-
export type PhysicalAddressType = 'home' | 'visit' | 'postal'
|
|
270
|
-
|
|
271
|
-
export enum ConnectionType {
|
|
272
|
-
OPENID_CONNECT = 'OIDC',
|
|
273
|
-
SIOPv2 = 'SIOPv2',
|
|
274
|
-
SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export enum CorrelationIdentifierType {
|
|
278
|
-
DID = 'did',
|
|
279
|
-
URL = 'url',
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export enum PartyTypeType {
|
|
283
|
-
NATURAL_PERSON = 'naturalPerson',
|
|
284
|
-
ORGANIZATION = 'organization',
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export enum PartyOrigin {
|
|
288
|
-
INTERNAL = 'INTERNAL',
|
|
289
|
-
EXTERNAL = 'EXTERNAL',
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
export enum IdentityOrigin {
|
|
293
|
-
INTERNAL = 'INTERNAL',
|
|
294
|
-
EXTERNAL = 'EXTERNAL',
|
|
295
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { HasherSync } from '@sphereon/ssi-types'
|
|
2
|
-
import { FindOptionsOrder } from 'typeorm'
|
|
3
|
-
import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
|
|
4
|
-
import { DigitalCredential } from './types'
|
|
5
|
-
import { CredentialCorrelationType, CredentialRole, CredentialStateType, RegulationType } from './enums'
|
|
6
|
-
|
|
7
|
-
export type GetCredentialArgs = { id: string } | { hash: string }
|
|
8
|
-
|
|
9
|
-
export type FindDigitalCredentialArgs = Array<Partial<DigitalCredential>>
|
|
10
|
-
|
|
11
|
-
export type GetCredentialsArgs = {
|
|
12
|
-
filter?: FindDigitalCredentialArgs
|
|
13
|
-
offset?: number
|
|
14
|
-
limit?: number
|
|
15
|
-
order?: string | FindOptionsOrder<DigitalCredentialEntity>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type GetCredentialsResponse = {
|
|
19
|
-
data: Array<DigitalCredential>
|
|
20
|
-
total: number
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type AddCredentialArgs = {
|
|
24
|
-
rawDocument: string
|
|
25
|
-
kmsKeyRef?: string
|
|
26
|
-
identifierMethod?: string
|
|
27
|
-
regulationType?: RegulationType
|
|
28
|
-
parentId?: string
|
|
29
|
-
issuerCorrelationType: CredentialCorrelationType
|
|
30
|
-
subjectCorrelationType?: CredentialCorrelationType
|
|
31
|
-
issuerCorrelationId: string
|
|
32
|
-
subjectCorrelationId?: string
|
|
33
|
-
credentialRole: CredentialRole
|
|
34
|
-
tenantId?: string
|
|
35
|
-
state?: CredentialStateType
|
|
36
|
-
verifiedAt?: Date
|
|
37
|
-
revokedAt?: Date
|
|
38
|
-
opts?: { maxTimeSkewInMS?: number; hasher?: HasherSync }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type UpdateCredentialStateArgs = GetCredentialArgs & { verifiedState: CredentialStateType; verifiedAt?: Date; revokedAt?: Date }
|
|
42
|
-
|
|
43
|
-
export type RemoveCredentialArgs = GetCredentialArgs
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export enum DocumentType {
|
|
2
|
-
VC = 'VC',
|
|
3
|
-
VP = 'VP',
|
|
4
|
-
P = 'P',
|
|
5
|
-
C = 'C',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum RegulationType {
|
|
9
|
-
PID = 'PID',
|
|
10
|
-
QEAA = 'QEAA',
|
|
11
|
-
EAA = 'EAA',
|
|
12
|
-
NON_REGULATED = 'NON_REGULATED',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export enum CredentialDocumentFormat {
|
|
16
|
-
JSON_LD = 'JSON_LD',
|
|
17
|
-
JWT = 'JWT',
|
|
18
|
-
SD_JWT = 'SD_JWT',
|
|
19
|
-
MSO_MDOC = 'MSO_MDOC',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export namespace CredentialDocumentFormat {
|
|
23
|
-
export function fromSpecValue(credentialFormat: string) {
|
|
24
|
-
const format = credentialFormat.toLowerCase()
|
|
25
|
-
if (format.includes('sd')) {
|
|
26
|
-
return CredentialDocumentFormat.SD_JWT
|
|
27
|
-
} else if (format.includes('ldp')) {
|
|
28
|
-
return CredentialDocumentFormat.JSON_LD
|
|
29
|
-
} else if (format.includes('mso') || credentialFormat.includes('mdoc')) {
|
|
30
|
-
return CredentialDocumentFormat.MSO_MDOC
|
|
31
|
-
} else if (format.includes('jwt_')) {
|
|
32
|
-
return CredentialDocumentFormat.JWT
|
|
33
|
-
} else {
|
|
34
|
-
throw Error(`Could not map format ${format} to known format`)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {
|
|
39
|
-
switch (documentFormat) {
|
|
40
|
-
case CredentialDocumentFormat.SD_JWT:
|
|
41
|
-
return 'vc+sd-jwt'
|
|
42
|
-
case CredentialDocumentFormat.MSO_MDOC:
|
|
43
|
-
return 'mso_mdoc'
|
|
44
|
-
case CredentialDocumentFormat.JSON_LD:
|
|
45
|
-
return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'
|
|
46
|
-
case CredentialDocumentFormat.JWT:
|
|
47
|
-
return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export enum CredentialCorrelationType {
|
|
53
|
-
DID = 'DID',
|
|
54
|
-
X509_SAN = 'X509_SAN',
|
|
55
|
-
KID = 'KID',
|
|
56
|
-
URL = 'URL',
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export enum CredentialRole {
|
|
60
|
-
ISSUER = 'ISSUER',
|
|
61
|
-
VERIFIER = 'VERIFIER',
|
|
62
|
-
HOLDER = 'HOLDER',
|
|
63
|
-
FEDERATION_TRUST_ANCHOR = 'FEDERATION_TRUST_ANCHOR',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export enum CredentialStateType {
|
|
67
|
-
REVOKED = 'REVOKED',
|
|
68
|
-
VERIFIED = 'VERIFIED',
|
|
69
|
-
EXPIRED = 'EXPIRED',
|
|
70
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { CredentialCorrelationType, CredentialDocumentFormat, CredentialRole, CredentialStateType, DocumentType, RegulationType } from './enums'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* DigitalCredential
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export type DigitalCredential = {
|
|
9
|
-
id: string
|
|
10
|
-
parentId?: string
|
|
11
|
-
documentType: DocumentType
|
|
12
|
-
documentFormat: CredentialDocumentFormat
|
|
13
|
-
credentialRole: CredentialRole
|
|
14
|
-
regulationType: RegulationType
|
|
15
|
-
rawDocument: string
|
|
16
|
-
uniformDocument: string
|
|
17
|
-
credentialId?: string
|
|
18
|
-
hash: string
|
|
19
|
-
kmsKeyRef?: string
|
|
20
|
-
identifierMethod?: string
|
|
21
|
-
issuerCorrelationType: CredentialCorrelationType
|
|
22
|
-
subjectCorrelationType?: CredentialCorrelationType
|
|
23
|
-
rpCorrelationType?: CredentialCorrelationType
|
|
24
|
-
isIssuerSigned?: boolean
|
|
25
|
-
issuerCorrelationId: string
|
|
26
|
-
subjectCorrelationId?: string
|
|
27
|
-
rpCorrelationId?: string
|
|
28
|
-
verifiedState?: CredentialStateType
|
|
29
|
-
tenantId?: string
|
|
30
|
-
createdAt: Date
|
|
31
|
-
presentedAt?: Date
|
|
32
|
-
lastUpdatedAt: Date
|
|
33
|
-
validUntil?: Date
|
|
34
|
-
validFrom?: Date
|
|
35
|
-
verifiedAt?: Date
|
|
36
|
-
revokedAt?: Date
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type NonPersistedDigitalCredential = Omit<DigitalCredential, 'id' | 'regulationType'> & { regulationType?: RegulationType }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PartialActivityLoggingEvent, PartialAuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
-
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from './eventLogger'
|
|
3
|
-
|
|
4
|
-
export type FindAuditLoggingEventArgs = Array<PartialAuditLoggingEvent>
|
|
5
|
-
|
|
6
|
-
export type FindActivityLoggingEventArgs = Array<PartialActivityLoggingEvent>
|
|
7
|
-
|
|
8
|
-
export type StoreAuditEventArgs = {
|
|
9
|
-
event: NonPersistedAuditLoggingEvent
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type StoreActivityEventArgs = {
|
|
13
|
-
event: NonPersistedActivityLoggingEvent
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type GetAuditEventsArgs = {
|
|
17
|
-
filter?: FindAuditLoggingEventArgs
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type GetActivityEventsArgs = {
|
|
21
|
-
filter?: FindActivityLoggingEventArgs
|
|
22
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IBasicCredentialLocaleBranding,
|
|
3
|
-
IBasicIssuerLocaleBranding,
|
|
4
|
-
ICredentialBranding,
|
|
5
|
-
ICredentialLocaleBrandingFilter,
|
|
6
|
-
IIssuerBranding,
|
|
7
|
-
IIssuerBrandingFilter,
|
|
8
|
-
IIssuerLocaleBrandingFilter,
|
|
9
|
-
ILocaleBranding,
|
|
10
|
-
ICredentialBrandingFilter,
|
|
11
|
-
} from './issuanceBranding'
|
|
12
|
-
|
|
13
|
-
export type FindCredentialBrandingArgs = Array<ICredentialBrandingFilter>
|
|
14
|
-
export type FindCredentialLocaleBrandingArgs = Array<ICredentialLocaleBrandingFilter>
|
|
15
|
-
export type FindIssuerBrandingArgs = Array<IIssuerBrandingFilter>
|
|
16
|
-
export type FindIssuerLocaleBrandingArgs = Array<IIssuerLocaleBrandingFilter>
|
|
17
|
-
|
|
18
|
-
export interface IAddCredentialBrandingArgs {
|
|
19
|
-
vcHash: string
|
|
20
|
-
issuerCorrelationId: string
|
|
21
|
-
localeBranding: Array<IBasicCredentialLocaleBranding>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface IGetCredentialBrandingArgs {
|
|
25
|
-
filter?: FindCredentialBrandingArgs
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface IUpdateCredentialBrandingArgs {
|
|
29
|
-
credentialBranding: Omit<ICredentialBranding, 'localeBranding' | 'createdAt' | 'lastUpdatedAt'>
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface IRemoveCredentialBrandingArgs {
|
|
33
|
-
filter: FindCredentialBrandingArgs
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface IAddCredentialLocaleBrandingArgs {
|
|
37
|
-
credentialBrandingId: string
|
|
38
|
-
localeBranding: Array<IBasicCredentialLocaleBranding>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IUpdateCredentialLocaleBrandingArgs {
|
|
42
|
-
localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'>
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface IRemoveCredentialLocaleBrandingArgs {
|
|
46
|
-
filter: FindCredentialLocaleBrandingArgs
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface IGetCredentialLocaleBrandingArgs {
|
|
50
|
-
filter?: FindCredentialLocaleBrandingArgs
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface IAddIssuerBrandingArgs {
|
|
54
|
-
issuerCorrelationId: string
|
|
55
|
-
localeBranding: Array<IBasicIssuerLocaleBranding>
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface IGetIssuerBrandingArgs {
|
|
59
|
-
filter?: FindIssuerBrandingArgs
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface IUpdateIssuerBrandingArgs {
|
|
63
|
-
issuerBranding: Omit<IIssuerBranding, 'localeBranding' | 'createdAt' | 'lastUpdatedAt'>
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface IRemoveIssuerBrandingArgs {
|
|
67
|
-
filter: FindIssuerBrandingArgs
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface IAddIssuerLocaleBrandingArgs {
|
|
71
|
-
issuerBrandingId: string
|
|
72
|
-
localeBranding: Array<IBasicIssuerLocaleBranding>
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface IUpdateIssuerLocaleBrandingArgs {
|
|
76
|
-
localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'>
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface IRemoveIssuerLocaleBrandingArgs {
|
|
80
|
-
filter: FindIssuerLocaleBrandingArgs
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface IGetIssuerLocaleBrandingArgs {
|
|
84
|
-
filter?: FindIssuerLocaleBrandingArgs
|
|
85
|
-
}
|