@sphereon/ssi-sdk.data-store 0.23.5-unstable.88 → 0.24.0
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/LICENSE +201 -201
- package/README.md +77 -77
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -15
- package/dist/index.js.map +1 -1
- package/dist/migrations/generic/index.d.ts +0 -2
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +1 -4
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +1 -2
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +22 -22
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js +16 -16
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +21 -21
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js +15 -15
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +1 -1
- package/package.json +4 -5
- package/src/__tests__/contact.entities.test.ts +2542 -2542
- package/src/__tests__/contact.store.test.ts +2471 -2471
- package/src/__tests__/digitalCredential.entities.test.ts +254 -254
- package/src/__tests__/digitalCredential.store.test.ts +294 -294
- package/src/__tests__/eventLogger.entities.test.ts +73 -73
- package/src/__tests__/eventLogger.store.test.ts +136 -136
- package/src/__tests__/issuanceBranding.entities.test.ts +844 -844
- package/src/__tests__/issuanceBranding.store.test.ts +1884 -1884
- package/src/__tests__/machineState.entities.test.ts +51 -51
- package/src/__tests__/machineState.store.test.ts +174 -174
- package/src/contact/AbstractContactStore.ts +71 -71
- package/src/contact/ContactStore.ts +723 -723
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +17 -17
- package/src/digitalCredential/DigitalCredentialStore.ts +127 -127
- package/src/entities/contact/BaseContactEntity.ts +39 -39
- package/src/entities/contact/ConnectionEntity.ts +29 -29
- package/src/entities/contact/CorrelationIdentifierEntity.ts +37 -37
- package/src/entities/contact/DidAuthConfigEntity.ts +14 -14
- package/src/entities/contact/ElectronicAddressEntity.ts +63 -63
- package/src/entities/contact/IdentityEntity.ts +97 -97
- package/src/entities/contact/IdentityMetadataItemEntity.ts +35 -35
- package/src/entities/contact/NaturalPersonEntity.ts +38 -38
- package/src/entities/contact/OpenIdConfigEntity.ts +26 -26
- package/src/entities/contact/OrganizationEntity.ts +34 -34
- package/src/entities/contact/PartyEntity.ts +110 -110
- package/src/entities/contact/PartyRelationshipEntity.ts +61 -61
- package/src/entities/contact/PartyTypeEntity.ts +62 -62
- package/src/entities/contact/PhysicalAddressEntity.ts +87 -87
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +64 -64
- package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +78 -78
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +57 -57
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +72 -72
- package/src/entities/machineState/MachineStateInfoEntity.ts +58 -58
- package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
- package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
- package/src/eventLogger/EventLoggerStore.ts +62 -62
- package/src/index.ts +141 -154
- package/src/issuanceBranding/IssuanceBrandingStore.ts +559 -559
- package/src/machineState/IAbstractMachineStateStore.ts +65 -65
- package/src/machineState/MachineStateStore.ts +149 -149
- package/src/migrations/generic/1-CreateContacts.ts +66 -66
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
- package/src/migrations/generic/3-CreateContacts.ts +66 -66
- package/src/migrations/generic/4-CreateStatusList.ts +54 -54
- package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
- package/src/migrations/generic/6-CreateDigitalCredential.ts +66 -66
- package/src/migrations/generic/7-CreateMachineStateStore.ts +66 -66
- package/src/migrations/generic/index.ts +33 -36
- package/src/migrations/index.ts +9 -10
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +63 -63
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +85 -85
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +104 -104
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +44 -44
- package/src/migrations/postgres/1708797018115-CreateMachineStateStore.ts +29 -29
- package/src/migrations/sqlite/1659463069549-CreateContacts.ts +110 -110
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +119 -119
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +161 -161
- package/src/migrations/sqlite/1693866470000-CreateStatusList.ts +24 -24
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +34 -34
- package/src/migrations/sqlite/1708796002272-CreateMachineStateStore.ts +28 -28
- package/src/statusList/StatusListStore.ts +237 -237
- package/src/types/contact/IAbstractContactStore.ts +161 -161
- package/src/types/contact/contact.ts +237 -237
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +37 -37
- package/src/types/digitalCredential/digitalCredential.ts +46 -46
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +10 -12
- package/src/types/machineState/IAbstractMachineStateStore.ts +68 -68
- package/src/utils/SortingUtils.ts +16 -16
- package/src/utils/contact/MappingUtils.ts +385 -385
- package/src/utils/digitalCredential/MappingUtils.ts +122 -122
- package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.d.ts +0 -13
- package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.d.ts.map +0 -1
- package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.js +0 -71
- package/dist/entities/presentationDefinitions/PresentationDefinitionItemEntity.js.map +0 -1
- package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts +0 -7
- package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts.map +0 -1
- package/dist/migrations/generic/8-CreatePresentationDefinitions.js +0 -78
- package/dist/migrations/generic/8-CreatePresentationDefinitions.js.map +0 -1
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.d.ts +0 -7
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.d.ts.map +0 -1
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js +0 -40
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js.map +0 -1
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.d.ts +0 -7
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.d.ts.map +0 -1
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js +0 -37
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js.map +0 -1
- package/dist/pd/AbstractPDStore.d.ts +0 -10
- package/dist/pd/AbstractPDStore.d.ts.map +0 -1
- package/dist/pd/AbstractPDStore.js +0 -7
- package/dist/pd/AbstractPDStore.js.map +0 -1
- package/dist/pd/PDStore.d.ts +0 -14
- package/dist/pd/PDStore.d.ts.map +0 -1
- package/dist/pd/PDStore.js +0 -90
- package/dist/pd/PDStore.js.map +0 -1
- package/dist/types/pd/IAbstractPDStore.d.ts +0 -14
- package/dist/types/pd/IAbstractPDStore.d.ts.map +0 -1
- package/dist/types/pd/IAbstractPDStore.js +0 -3
- package/dist/types/pd/IAbstractPDStore.js.map +0 -1
- package/dist/types/pd/pd.d.ts +0 -15
- package/dist/types/pd/pd.d.ts.map +0 -1
- package/dist/types/pd/pd.js +0 -3
- package/dist/types/pd/pd.js.map +0 -1
- package/dist/utils/presentationDefinitions/MappingUtils.d.ts +0 -6
- package/dist/utils/presentationDefinitions/MappingUtils.d.ts.map +0 -1
- package/dist/utils/presentationDefinitions/MappingUtils.js +0 -50
- package/dist/utils/presentationDefinitions/MappingUtils.js.map +0 -1
- package/src/entities/presentationDefinitions/PresentationDefinitionItemEntity.ts +0 -41
- package/src/migrations/generic/8-CreatePresentationDefinitions.ts +0 -66
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +0 -24
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +0 -23
- package/src/pd/AbstractPDStore.ts +0 -10
- package/src/pd/PDStore.ts +0 -103
- package/src/types/pd/IAbstractPDStore.ts +0 -19
- package/src/types/pd/pd.ts +0 -16
- package/src/utils/presentationDefinitions/MappingUtils.ts +0 -54
|
@@ -1,237 +1,237 @@
|
|
|
1
|
-
import { IIdentifier } from '@veramo/core'
|
|
2
|
-
|
|
3
|
-
export type Party = {
|
|
4
|
-
id: string
|
|
5
|
-
uri?: string
|
|
6
|
-
roles: Array<IdentityRole>
|
|
7
|
-
identities: Array<Identity>
|
|
8
|
-
electronicAddresses: Array<ElectronicAddress>
|
|
9
|
-
physicalAddresses: Array<PhysicalAddress>
|
|
10
|
-
contact: Contact
|
|
11
|
-
partyType: PartyType
|
|
12
|
-
relationships: Array<PartyRelationship>
|
|
13
|
-
createdAt: Date
|
|
14
|
-
lastUpdatedAt: Date
|
|
15
|
-
}
|
|
16
|
-
export type NonPersistedParty = Omit<
|
|
17
|
-
Party,
|
|
18
|
-
| 'id'
|
|
19
|
-
| 'identities'
|
|
20
|
-
| 'electronicAddresses'
|
|
21
|
-
| 'physicalAddresses'
|
|
22
|
-
| 'contact'
|
|
23
|
-
| 'roles'
|
|
24
|
-
| 'partyType'
|
|
25
|
-
| 'relationships'
|
|
26
|
-
| 'createdAt'
|
|
27
|
-
| 'lastUpdatedAt'
|
|
28
|
-
> & {
|
|
29
|
-
identities?: Array<NonPersistedIdentity>
|
|
30
|
-
electronicAddresses?: Array<NonPersistedElectronicAddress>
|
|
31
|
-
physicalAddresses?: Array<NonPersistedPhysicalAddress>
|
|
32
|
-
contact: NonPersistedContact
|
|
33
|
-
partyType: NonPersistedPartyType
|
|
34
|
-
relationships?: Array<NonPersistedPartyRelationship>
|
|
35
|
-
}
|
|
36
|
-
export type PartialParty = Partial<
|
|
37
|
-
Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>
|
|
38
|
-
> & {
|
|
39
|
-
identities?: PartialIdentity
|
|
40
|
-
electronicAddresses?: PartialElectronicAddress
|
|
41
|
-
physicalAddresses?: PartialPhysicalAddress
|
|
42
|
-
contact?: PartialContact
|
|
43
|
-
partyType?: PartialPartyType
|
|
44
|
-
relationships?: PartialPartyRelationship
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type Identity = {
|
|
48
|
-
id: string
|
|
49
|
-
alias: string
|
|
50
|
-
roles: Array<IdentityRole>
|
|
51
|
-
identifier: CorrelationIdentifier
|
|
52
|
-
connection?: Connection
|
|
53
|
-
metadata?: Array<MetadataItem>
|
|
54
|
-
createdAt: Date
|
|
55
|
-
lastUpdatedAt: Date
|
|
56
|
-
}
|
|
57
|
-
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
58
|
-
identifier: NonPersistedCorrelationIdentifier
|
|
59
|
-
connection?: NonPersistedConnection
|
|
60
|
-
metadata?: Array<NonPersistedMetadataItem>
|
|
61
|
-
}
|
|
62
|
-
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'roles'>> & {
|
|
63
|
-
identifier?: PartialCorrelationIdentifier
|
|
64
|
-
connection?: PartialConnection
|
|
65
|
-
metadata?: PartialMetadataItem
|
|
66
|
-
roles?: IdentityRole
|
|
67
|
-
partyId?: string
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export type MetadataItem = {
|
|
71
|
-
id: string
|
|
72
|
-
label: string
|
|
73
|
-
value: string
|
|
74
|
-
}
|
|
75
|
-
export type NonPersistedMetadataItem = Omit<MetadataItem, 'id'>
|
|
76
|
-
export type PartialMetadataItem = Partial<MetadataItem>
|
|
77
|
-
|
|
78
|
-
export type CorrelationIdentifier = {
|
|
79
|
-
id: string
|
|
80
|
-
type: CorrelationIdentifierType
|
|
81
|
-
correlationId: string
|
|
82
|
-
}
|
|
83
|
-
export type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>
|
|
84
|
-
export type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>
|
|
85
|
-
|
|
86
|
-
export type Connection = {
|
|
87
|
-
id: string
|
|
88
|
-
type: ConnectionType
|
|
89
|
-
config: ConnectionConfig
|
|
90
|
-
}
|
|
91
|
-
export type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {
|
|
92
|
-
config: NonPersistedConnectionConfig
|
|
93
|
-
}
|
|
94
|
-
export type PartialConnection = Partial<Omit<Connection, 'config'>> & {
|
|
95
|
-
config: PartialConnectionConfig
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export type OpenIdConfig = {
|
|
99
|
-
id: string
|
|
100
|
-
clientId: string
|
|
101
|
-
clientSecret: string
|
|
102
|
-
scopes: Array<string>
|
|
103
|
-
issuer: string
|
|
104
|
-
redirectUrl: string
|
|
105
|
-
dangerouslyAllowInsecureHttpRequests: boolean
|
|
106
|
-
clientAuthMethod: 'basic' | 'post' | undefined
|
|
107
|
-
}
|
|
108
|
-
export type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>
|
|
109
|
-
export type PartialOpenIdConfig = Partial<OpenIdConfig>
|
|
110
|
-
|
|
111
|
-
export type DidAuthConfig = {
|
|
112
|
-
id: string
|
|
113
|
-
identifier: IIdentifier
|
|
114
|
-
stateId: string
|
|
115
|
-
redirectUrl: string
|
|
116
|
-
sessionId: string
|
|
117
|
-
}
|
|
118
|
-
export type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>
|
|
119
|
-
export type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {
|
|
120
|
-
identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export type ConnectionConfig = OpenIdConfig | DidAuthConfig
|
|
124
|
-
export type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig
|
|
125
|
-
export type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig
|
|
126
|
-
|
|
127
|
-
export type NaturalPerson = {
|
|
128
|
-
id: string
|
|
129
|
-
firstName: string
|
|
130
|
-
lastName: string
|
|
131
|
-
middleName?: string
|
|
132
|
-
displayName: string
|
|
133
|
-
createdAt: Date
|
|
134
|
-
lastUpdatedAt: Date
|
|
135
|
-
}
|
|
136
|
-
export type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
137
|
-
export type PartialNaturalPerson = Partial<NaturalPerson>
|
|
138
|
-
|
|
139
|
-
export type Organization = {
|
|
140
|
-
id: string
|
|
141
|
-
legalName: string
|
|
142
|
-
displayName: string
|
|
143
|
-
createdAt: Date
|
|
144
|
-
lastUpdatedAt: Date
|
|
145
|
-
}
|
|
146
|
-
export type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
147
|
-
export type PartialOrganization = Partial<Organization>
|
|
148
|
-
|
|
149
|
-
export type Contact = NaturalPerson | Organization
|
|
150
|
-
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
151
|
-
export type PartialContact = PartialNaturalPerson | PartialOrganization
|
|
152
|
-
|
|
153
|
-
export type PartyType = {
|
|
154
|
-
id: string
|
|
155
|
-
type: PartyTypeType
|
|
156
|
-
origin: PartyOrigin
|
|
157
|
-
name: string
|
|
158
|
-
tenantId: string
|
|
159
|
-
description?: string
|
|
160
|
-
createdAt: Date
|
|
161
|
-
lastUpdatedAt: Date
|
|
162
|
-
}
|
|
163
|
-
export type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
164
|
-
id?: string
|
|
165
|
-
}
|
|
166
|
-
export type PartialPartyType = Partial<PartyType>
|
|
167
|
-
|
|
168
|
-
export type PartyRelationship = {
|
|
169
|
-
id: string
|
|
170
|
-
leftId: string
|
|
171
|
-
rightId: string
|
|
172
|
-
createdAt: Date
|
|
173
|
-
lastUpdatedAt: Date
|
|
174
|
-
}
|
|
175
|
-
export type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
176
|
-
export type PartialPartyRelationship = Partial<PartyRelationship>
|
|
177
|
-
|
|
178
|
-
export type ElectronicAddress = {
|
|
179
|
-
id: string
|
|
180
|
-
type: ElectronicAddressType
|
|
181
|
-
electronicAddress: string
|
|
182
|
-
createdAt: Date
|
|
183
|
-
lastUpdatedAt: Date
|
|
184
|
-
}
|
|
185
|
-
export type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
186
|
-
export type PartialElectronicAddress = Partial<ElectronicAddress> & {
|
|
187
|
-
partyId?: string
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export type PhysicalAddress = {
|
|
191
|
-
id: string
|
|
192
|
-
type: PhysicalAddressType
|
|
193
|
-
streetName: string
|
|
194
|
-
streetNumber: string
|
|
195
|
-
postalCode: string
|
|
196
|
-
cityName: string
|
|
197
|
-
provinceName: string
|
|
198
|
-
countryCode: string
|
|
199
|
-
buildingName?: string
|
|
200
|
-
createdAt: Date
|
|
201
|
-
lastUpdatedAt: Date
|
|
202
|
-
}
|
|
203
|
-
export type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
204
|
-
export type PartialPhysicalAddress = Partial<PhysicalAddress> & {
|
|
205
|
-
partyId?: string
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export type ElectronicAddressType = 'email' | 'phone'
|
|
209
|
-
|
|
210
|
-
export type PhysicalAddressType = 'home' | 'visit' | 'postal'
|
|
211
|
-
|
|
212
|
-
export enum IdentityRole {
|
|
213
|
-
ISSUER = 'issuer',
|
|
214
|
-
VERIFIER = 'verifier',
|
|
215
|
-
HOLDER = 'holder',
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export enum ConnectionType {
|
|
219
|
-
OPENID_CONNECT = 'OIDC',
|
|
220
|
-
SIOPv2 = 'SIOPv2',
|
|
221
|
-
SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export enum CorrelationIdentifierType {
|
|
225
|
-
DID = 'did',
|
|
226
|
-
URL = 'url',
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export enum PartyTypeType {
|
|
230
|
-
NATURAL_PERSON = 'naturalPerson',
|
|
231
|
-
ORGANIZATION = 'organization',
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export enum PartyOrigin {
|
|
235
|
-
INTERNAL = 'INTERNAL',
|
|
236
|
-
EXTERNAL = 'EXTERNAL',
|
|
237
|
-
}
|
|
1
|
+
import { IIdentifier } from '@veramo/core'
|
|
2
|
+
|
|
3
|
+
export type Party = {
|
|
4
|
+
id: string
|
|
5
|
+
uri?: string
|
|
6
|
+
roles: Array<IdentityRole>
|
|
7
|
+
identities: Array<Identity>
|
|
8
|
+
electronicAddresses: Array<ElectronicAddress>
|
|
9
|
+
physicalAddresses: Array<PhysicalAddress>
|
|
10
|
+
contact: Contact
|
|
11
|
+
partyType: PartyType
|
|
12
|
+
relationships: Array<PartyRelationship>
|
|
13
|
+
createdAt: Date
|
|
14
|
+
lastUpdatedAt: Date
|
|
15
|
+
}
|
|
16
|
+
export type NonPersistedParty = Omit<
|
|
17
|
+
Party,
|
|
18
|
+
| 'id'
|
|
19
|
+
| 'identities'
|
|
20
|
+
| 'electronicAddresses'
|
|
21
|
+
| 'physicalAddresses'
|
|
22
|
+
| 'contact'
|
|
23
|
+
| 'roles'
|
|
24
|
+
| 'partyType'
|
|
25
|
+
| 'relationships'
|
|
26
|
+
| 'createdAt'
|
|
27
|
+
| 'lastUpdatedAt'
|
|
28
|
+
> & {
|
|
29
|
+
identities?: Array<NonPersistedIdentity>
|
|
30
|
+
electronicAddresses?: Array<NonPersistedElectronicAddress>
|
|
31
|
+
physicalAddresses?: Array<NonPersistedPhysicalAddress>
|
|
32
|
+
contact: NonPersistedContact
|
|
33
|
+
partyType: NonPersistedPartyType
|
|
34
|
+
relationships?: Array<NonPersistedPartyRelationship>
|
|
35
|
+
}
|
|
36
|
+
export type PartialParty = Partial<
|
|
37
|
+
Omit<Party, 'identities' | 'electronicAddresses' | 'physicalAddresses' | 'contact' | 'partyType' | 'relationships'>
|
|
38
|
+
> & {
|
|
39
|
+
identities?: PartialIdentity
|
|
40
|
+
electronicAddresses?: PartialElectronicAddress
|
|
41
|
+
physicalAddresses?: PartialPhysicalAddress
|
|
42
|
+
contact?: PartialContact
|
|
43
|
+
partyType?: PartialPartyType
|
|
44
|
+
relationships?: PartialPartyRelationship
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type Identity = {
|
|
48
|
+
id: string
|
|
49
|
+
alias: string
|
|
50
|
+
roles: Array<IdentityRole>
|
|
51
|
+
identifier: CorrelationIdentifier
|
|
52
|
+
connection?: Connection
|
|
53
|
+
metadata?: Array<MetadataItem>
|
|
54
|
+
createdAt: Date
|
|
55
|
+
lastUpdatedAt: Date
|
|
56
|
+
}
|
|
57
|
+
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
58
|
+
identifier: NonPersistedCorrelationIdentifier
|
|
59
|
+
connection?: NonPersistedConnection
|
|
60
|
+
metadata?: Array<NonPersistedMetadataItem>
|
|
61
|
+
}
|
|
62
|
+
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'roles'>> & {
|
|
63
|
+
identifier?: PartialCorrelationIdentifier
|
|
64
|
+
connection?: PartialConnection
|
|
65
|
+
metadata?: PartialMetadataItem
|
|
66
|
+
roles?: IdentityRole
|
|
67
|
+
partyId?: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type MetadataItem = {
|
|
71
|
+
id: string
|
|
72
|
+
label: string
|
|
73
|
+
value: string
|
|
74
|
+
}
|
|
75
|
+
export type NonPersistedMetadataItem = Omit<MetadataItem, 'id'>
|
|
76
|
+
export type PartialMetadataItem = Partial<MetadataItem>
|
|
77
|
+
|
|
78
|
+
export type CorrelationIdentifier = {
|
|
79
|
+
id: string
|
|
80
|
+
type: CorrelationIdentifierType
|
|
81
|
+
correlationId: string
|
|
82
|
+
}
|
|
83
|
+
export type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>
|
|
84
|
+
export type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>
|
|
85
|
+
|
|
86
|
+
export type Connection = {
|
|
87
|
+
id: string
|
|
88
|
+
type: ConnectionType
|
|
89
|
+
config: ConnectionConfig
|
|
90
|
+
}
|
|
91
|
+
export type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {
|
|
92
|
+
config: NonPersistedConnectionConfig
|
|
93
|
+
}
|
|
94
|
+
export type PartialConnection = Partial<Omit<Connection, 'config'>> & {
|
|
95
|
+
config: PartialConnectionConfig
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type OpenIdConfig = {
|
|
99
|
+
id: string
|
|
100
|
+
clientId: string
|
|
101
|
+
clientSecret: string
|
|
102
|
+
scopes: Array<string>
|
|
103
|
+
issuer: string
|
|
104
|
+
redirectUrl: string
|
|
105
|
+
dangerouslyAllowInsecureHttpRequests: boolean
|
|
106
|
+
clientAuthMethod: 'basic' | 'post' | undefined
|
|
107
|
+
}
|
|
108
|
+
export type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>
|
|
109
|
+
export type PartialOpenIdConfig = Partial<OpenIdConfig>
|
|
110
|
+
|
|
111
|
+
export type DidAuthConfig = {
|
|
112
|
+
id: string
|
|
113
|
+
identifier: IIdentifier
|
|
114
|
+
stateId: string
|
|
115
|
+
redirectUrl: string
|
|
116
|
+
sessionId: string
|
|
117
|
+
}
|
|
118
|
+
export type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>
|
|
119
|
+
export type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {
|
|
120
|
+
identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type ConnectionConfig = OpenIdConfig | DidAuthConfig
|
|
124
|
+
export type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig
|
|
125
|
+
export type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig
|
|
126
|
+
|
|
127
|
+
export type NaturalPerson = {
|
|
128
|
+
id: string
|
|
129
|
+
firstName: string
|
|
130
|
+
lastName: string
|
|
131
|
+
middleName?: string
|
|
132
|
+
displayName: string
|
|
133
|
+
createdAt: Date
|
|
134
|
+
lastUpdatedAt: Date
|
|
135
|
+
}
|
|
136
|
+
export type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
137
|
+
export type PartialNaturalPerson = Partial<NaturalPerson>
|
|
138
|
+
|
|
139
|
+
export type Organization = {
|
|
140
|
+
id: string
|
|
141
|
+
legalName: string
|
|
142
|
+
displayName: string
|
|
143
|
+
createdAt: Date
|
|
144
|
+
lastUpdatedAt: Date
|
|
145
|
+
}
|
|
146
|
+
export type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
147
|
+
export type PartialOrganization = Partial<Organization>
|
|
148
|
+
|
|
149
|
+
export type Contact = NaturalPerson | Organization
|
|
150
|
+
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
151
|
+
export type PartialContact = PartialNaturalPerson | PartialOrganization
|
|
152
|
+
|
|
153
|
+
export type PartyType = {
|
|
154
|
+
id: string
|
|
155
|
+
type: PartyTypeType
|
|
156
|
+
origin: PartyOrigin
|
|
157
|
+
name: string
|
|
158
|
+
tenantId: string
|
|
159
|
+
description?: string
|
|
160
|
+
createdAt: Date
|
|
161
|
+
lastUpdatedAt: Date
|
|
162
|
+
}
|
|
163
|
+
export type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
164
|
+
id?: string
|
|
165
|
+
}
|
|
166
|
+
export type PartialPartyType = Partial<PartyType>
|
|
167
|
+
|
|
168
|
+
export type PartyRelationship = {
|
|
169
|
+
id: string
|
|
170
|
+
leftId: string
|
|
171
|
+
rightId: string
|
|
172
|
+
createdAt: Date
|
|
173
|
+
lastUpdatedAt: Date
|
|
174
|
+
}
|
|
175
|
+
export type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
176
|
+
export type PartialPartyRelationship = Partial<PartyRelationship>
|
|
177
|
+
|
|
178
|
+
export type ElectronicAddress = {
|
|
179
|
+
id: string
|
|
180
|
+
type: ElectronicAddressType
|
|
181
|
+
electronicAddress: string
|
|
182
|
+
createdAt: Date
|
|
183
|
+
lastUpdatedAt: Date
|
|
184
|
+
}
|
|
185
|
+
export type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
186
|
+
export type PartialElectronicAddress = Partial<ElectronicAddress> & {
|
|
187
|
+
partyId?: string
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type PhysicalAddress = {
|
|
191
|
+
id: string
|
|
192
|
+
type: PhysicalAddressType
|
|
193
|
+
streetName: string
|
|
194
|
+
streetNumber: string
|
|
195
|
+
postalCode: string
|
|
196
|
+
cityName: string
|
|
197
|
+
provinceName: string
|
|
198
|
+
countryCode: string
|
|
199
|
+
buildingName?: string
|
|
200
|
+
createdAt: Date
|
|
201
|
+
lastUpdatedAt: Date
|
|
202
|
+
}
|
|
203
|
+
export type NonPersistedPhysicalAddress = Omit<PhysicalAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
204
|
+
export type PartialPhysicalAddress = Partial<PhysicalAddress> & {
|
|
205
|
+
partyId?: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export type ElectronicAddressType = 'email' | 'phone'
|
|
209
|
+
|
|
210
|
+
export type PhysicalAddressType = 'home' | 'visit' | 'postal'
|
|
211
|
+
|
|
212
|
+
export enum IdentityRole {
|
|
213
|
+
ISSUER = 'issuer',
|
|
214
|
+
VERIFIER = 'verifier',
|
|
215
|
+
HOLDER = 'holder',
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export enum ConnectionType {
|
|
219
|
+
OPENID_CONNECT = 'OIDC',
|
|
220
|
+
SIOPv2 = 'SIOPv2',
|
|
221
|
+
SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export enum CorrelationIdentifierType {
|
|
225
|
+
DID = 'did',
|
|
226
|
+
URL = 'url',
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export enum PartyTypeType {
|
|
230
|
+
NATURAL_PERSON = 'naturalPerson',
|
|
231
|
+
ORGANIZATION = 'organization',
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export enum PartyOrigin {
|
|
235
|
+
INTERNAL = 'INTERNAL',
|
|
236
|
+
EXTERNAL = 'EXTERNAL',
|
|
237
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { CredentialCorrelationType, CredentialStateType, DigitalCredential } from './digitalCredential'
|
|
2
|
-
import { Hasher } from '@sphereon/ssi-types'
|
|
3
|
-
import { FindOptionsOrder } from 'typeorm'
|
|
4
|
-
import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
|
|
5
|
-
|
|
6
|
-
export type GetCredentialArgs = { id: string } | { hash: string }
|
|
7
|
-
|
|
8
|
-
export type FindDigitalCredentialArgs = Array<Partial<DigitalCredential>>
|
|
9
|
-
|
|
10
|
-
export type GetCredentialsArgs = {
|
|
11
|
-
filter?: FindDigitalCredentialArgs
|
|
12
|
-
offset?: number
|
|
13
|
-
limit?: number
|
|
14
|
-
order?: string | FindOptionsOrder<DigitalCredentialEntity>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type GetCredentialsResponse = {
|
|
18
|
-
data: Array<DigitalCredential>
|
|
19
|
-
total: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type AddCredentialArgs = {
|
|
23
|
-
rawDocument: string
|
|
24
|
-
issuerCorrelationType: CredentialCorrelationType
|
|
25
|
-
subjectCorrelationType?: CredentialCorrelationType
|
|
26
|
-
issuerCorrelationId: string
|
|
27
|
-
subjectCorrelationId?: string
|
|
28
|
-
tenantId?: string
|
|
29
|
-
state?: CredentialStateType
|
|
30
|
-
verifiedAt?: Date
|
|
31
|
-
revokedAt?: Date
|
|
32
|
-
opts?: { maxTimeSkewInMS?: number; hasher?: Hasher }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type UpdateCredentialStateArgs = GetCredentialArgs & { verifiedState: CredentialStateType; verifiedAt?: Date; revokedAt?: Date }
|
|
36
|
-
|
|
37
|
-
export type RemoveCredentialArgs = GetCredentialArgs
|
|
1
|
+
import { CredentialCorrelationType, CredentialStateType, DigitalCredential } from './digitalCredential'
|
|
2
|
+
import { Hasher } from '@sphereon/ssi-types'
|
|
3
|
+
import { FindOptionsOrder } from 'typeorm'
|
|
4
|
+
import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
|
|
5
|
+
|
|
6
|
+
export type GetCredentialArgs = { id: string } | { hash: string }
|
|
7
|
+
|
|
8
|
+
export type FindDigitalCredentialArgs = Array<Partial<DigitalCredential>>
|
|
9
|
+
|
|
10
|
+
export type GetCredentialsArgs = {
|
|
11
|
+
filter?: FindDigitalCredentialArgs
|
|
12
|
+
offset?: number
|
|
13
|
+
limit?: number
|
|
14
|
+
order?: string | FindOptionsOrder<DigitalCredentialEntity>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type GetCredentialsResponse = {
|
|
18
|
+
data: Array<DigitalCredential>
|
|
19
|
+
total: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type AddCredentialArgs = {
|
|
23
|
+
rawDocument: string
|
|
24
|
+
issuerCorrelationType: CredentialCorrelationType
|
|
25
|
+
subjectCorrelationType?: CredentialCorrelationType
|
|
26
|
+
issuerCorrelationId: string
|
|
27
|
+
subjectCorrelationId?: string
|
|
28
|
+
tenantId?: string
|
|
29
|
+
state?: CredentialStateType
|
|
30
|
+
verifiedAt?: Date
|
|
31
|
+
revokedAt?: Date
|
|
32
|
+
opts?: { maxTimeSkewInMS?: number; hasher?: Hasher }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type UpdateCredentialStateArgs = GetCredentialArgs & { verifiedState: CredentialStateType; verifiedAt?: Date; revokedAt?: Date }
|
|
36
|
+
|
|
37
|
+
export type RemoveCredentialArgs = GetCredentialArgs
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
export type NonPersistedDigitalCredential = Omit<DigitalCredential, 'id'>
|
|
2
|
-
|
|
3
|
-
export type DigitalCredential = {
|
|
4
|
-
id: string
|
|
5
|
-
documentType: DocumentType
|
|
6
|
-
documentFormat: CredentialDocumentFormat
|
|
7
|
-
rawDocument: string
|
|
8
|
-
uniformDocument: string
|
|
9
|
-
hash: string
|
|
10
|
-
issuerCorrelationType: CredentialCorrelationType
|
|
11
|
-
subjectCorrelationType?: CredentialCorrelationType
|
|
12
|
-
issuerCorrelationId: string
|
|
13
|
-
subjectCorrelationId?: string
|
|
14
|
-
verifiedState?: CredentialStateType
|
|
15
|
-
tenantId?: string
|
|
16
|
-
createdAt: Date
|
|
17
|
-
lastUpdatedAt: Date
|
|
18
|
-
validUntil?: Date
|
|
19
|
-
validFrom?: Date
|
|
20
|
-
verifiedAt?: Date
|
|
21
|
-
revokedAt?: Date
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export enum DocumentType {
|
|
25
|
-
VC = 'VC',
|
|
26
|
-
VP = 'VP',
|
|
27
|
-
P = 'P',
|
|
28
|
-
C = 'C',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export enum CredentialDocumentFormat {
|
|
32
|
-
JSON_LD = 'JSON_LD',
|
|
33
|
-
JWT = 'JWT',
|
|
34
|
-
SD_JWT = 'SD_JWT',
|
|
35
|
-
MDOC = 'MDOC',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export enum CredentialCorrelationType {
|
|
39
|
-
DID = 'DID',
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export enum CredentialStateType {
|
|
43
|
-
REVOKED = 'REVOKED',
|
|
44
|
-
VERIFIED = 'VERIFIED',
|
|
45
|
-
EXPIRED = 'EXPIRED',
|
|
46
|
-
}
|
|
1
|
+
export type NonPersistedDigitalCredential = Omit<DigitalCredential, 'id'>
|
|
2
|
+
|
|
3
|
+
export type DigitalCredential = {
|
|
4
|
+
id: string
|
|
5
|
+
documentType: DocumentType
|
|
6
|
+
documentFormat: CredentialDocumentFormat
|
|
7
|
+
rawDocument: string
|
|
8
|
+
uniformDocument: string
|
|
9
|
+
hash: string
|
|
10
|
+
issuerCorrelationType: CredentialCorrelationType
|
|
11
|
+
subjectCorrelationType?: CredentialCorrelationType
|
|
12
|
+
issuerCorrelationId: string
|
|
13
|
+
subjectCorrelationId?: string
|
|
14
|
+
verifiedState?: CredentialStateType
|
|
15
|
+
tenantId?: string
|
|
16
|
+
createdAt: Date
|
|
17
|
+
lastUpdatedAt: Date
|
|
18
|
+
validUntil?: Date
|
|
19
|
+
validFrom?: Date
|
|
20
|
+
verifiedAt?: Date
|
|
21
|
+
revokedAt?: Date
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum DocumentType {
|
|
25
|
+
VC = 'VC',
|
|
26
|
+
VP = 'VP',
|
|
27
|
+
P = 'P',
|
|
28
|
+
C = 'C',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum CredentialDocumentFormat {
|
|
32
|
+
JSON_LD = 'JSON_LD',
|
|
33
|
+
JWT = 'JWT',
|
|
34
|
+
SD_JWT = 'SD_JWT',
|
|
35
|
+
MDOC = 'MDOC',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum CredentialCorrelationType {
|
|
39
|
+
DID = 'DID',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export enum CredentialStateType {
|
|
43
|
+
REVOKED = 'REVOKED',
|
|
44
|
+
VERIFIED = 'VERIFIED',
|
|
45
|
+
EXPIRED = 'EXPIRED',
|
|
46
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PartialAuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
-
import { NonPersistedAuditLoggingEvent } from './eventLogger'
|
|
3
|
-
|
|
4
|
-
export type FindAuditLoggingEventArgs = Array<PartialAuditLoggingEvent>
|
|
5
|
-
|
|
6
|
-
export type StoreAuditEventArgs = {
|
|
7
|
-
event: NonPersistedAuditLoggingEvent
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type GetAuditEventsArgs = {
|
|
11
|
-
filter?: FindAuditLoggingEventArgs
|
|
12
|
-
}
|
|
1
|
+
import { PartialAuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
import { NonPersistedAuditLoggingEvent } from './eventLogger'
|
|
3
|
+
|
|
4
|
+
export type FindAuditLoggingEventArgs = Array<PartialAuditLoggingEvent>
|
|
5
|
+
|
|
6
|
+
export type StoreAuditEventArgs = {
|
|
7
|
+
event: NonPersistedAuditLoggingEvent
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type GetAuditEventsArgs = {
|
|
11
|
+
filter?: FindAuditLoggingEventArgs
|
|
12
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
-
|
|
3
|
-
export type NonPersistedAuditLoggingEvent = Omit<AuditLoggingEvent, 'id'>
|
|
1
|
+
import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
|
|
3
|
+
export type NonPersistedAuditLoggingEvent = Omit<AuditLoggingEvent, 'id'>
|