@sphereon/ssi-sdk.data-store 0.15.2-next.6 → 0.15.2-next.77
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/contact/AbstractContactStore.d.ts +21 -11
- package/dist/contact/AbstractContactStore.d.ts.map +1 -1
- package/dist/contact/AbstractContactStore.js.map +1 -1
- package/dist/contact/ContactStore.d.ts +25 -21
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/contact/ContactStore.js +216 -136
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/entities/contact/BaseConfigEntity.d.ts +2 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts.map +1 -1
- package/dist/entities/contact/BaseConfigEntity.js +10 -2
- package/dist/entities/contact/BaseConfigEntity.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.d.ts +10 -0
- package/dist/entities/contact/BaseContactEntity.d.ts.map +1 -0
- package/dist/entities/contact/BaseContactEntity.js +54 -0
- package/dist/entities/contact/BaseContactEntity.js.map +1 -0
- package/dist/entities/contact/ConnectionEntity.d.ts +1 -2
- package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +2 -21
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +2 -3
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +8 -11
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +0 -4
- package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +1 -17
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.d.ts +14 -0
- package/dist/entities/contact/ElectronicAddressEntity.d.ts.map +1 -0
- package/dist/entities/contact/ElectronicAddressEntity.js +92 -0
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -0
- package/dist/entities/contact/IdentityEntity.d.ts +5 -6
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +15 -20
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +1 -3
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +7 -10
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.d.ts +9 -0
- package/dist/entities/contact/NaturalPersonEntity.d.ts.map +1 -0
- package/dist/entities/contact/NaturalPersonEntity.js +72 -0
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +0 -4
- package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +1 -22
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.d.ts +9 -0
- package/dist/entities/contact/OrganizationEntity.d.ts.map +1 -0
- package/dist/entities/contact/OrganizationEntity.js +67 -0
- package/dist/entities/contact/OrganizationEntity.js.map +1 -0
- package/dist/entities/contact/PartyEntity.d.ts +21 -0
- package/dist/entities/contact/PartyEntity.d.ts.map +1 -0
- package/dist/entities/contact/PartyEntity.js +155 -0
- package/dist/entities/contact/PartyEntity.js.map +1 -0
- package/dist/entities/contact/PartyRelationshipEntity.d.ts +13 -0
- package/dist/entities/contact/PartyRelationshipEntity.d.ts.map +1 -0
- package/dist/entities/contact/PartyRelationshipEntity.js +95 -0
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -0
- package/dist/entities/contact/PartyTypeEntity.d.ts +15 -0
- package/dist/entities/contact/PartyTypeEntity.d.ts.map +1 -0
- package/dist/entities/contact/{ContactEntity.js → PartyTypeEntity.js} +35 -36
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -0
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts +19 -0
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts.map +1 -0
- package/dist/entities/statusList2021/StatusList2021Entity.js +115 -0
- package/dist/entities/statusList2021/StatusList2021Entity.js.map +1 -0
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts +11 -0
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts.map +1 -0
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +51 -0
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js.map +1 -0
- package/dist/index.d.ts +20 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/dist/migrations/generic/1-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/generic/1-CreateContacts.js +36 -32
- package/dist/migrations/generic/1-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/2-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/2-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/2-CreateContacts.js +76 -0
- package/dist/migrations/generic/2-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/{1-CreateIssuanceBranding.d.ts → 2-CreateIssuanceBranding.d.ts} +1 -1
- package/dist/migrations/generic/2-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +76 -0
- package/dist/migrations/generic/2-CreateIssuanceBranding.js.map +1 -0
- package/dist/migrations/generic/3-CreateStatusList.d.ts +7 -0
- package/dist/migrations/generic/3-CreateStatusList.d.ts.map +1 -0
- package/dist/migrations/generic/{1-CreateIssuanceBranding.js → 3-CreateStatusList.js} +11 -11
- package/dist/migrations/generic/3-CreateStatusList.js.map +1 -0
- package/dist/migrations/generic/index.d.ts +5 -0
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +10 -3
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.d.ts +2 -1
- package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.js +0 -2
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -1
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +4 -2
- package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +2 -0
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +69 -0
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts +7 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +1 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +32 -0
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +1 -0
- package/dist/migrations/postgres/uuid.d.ts +3 -0
- package/dist/migrations/postgres/uuid.d.ts.map +1 -0
- package/dist/migrations/postgres/uuid.js +25 -0
- package/dist/migrations/postgres/uuid.js.map +1 -0
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +108 -0
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts +7 -0
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts.map +1 -0
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +32 -0
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js.map +1 -0
- package/dist/statusList/IStatusListStore.d.ts +20 -0
- package/dist/statusList/IStatusListStore.d.ts.map +1 -0
- package/dist/statusList/IStatusListStore.js +3 -0
- package/dist/statusList/IStatusListStore.js.map +1 -0
- package/dist/statusList/StatusListStore.d.ts +36 -0
- package/dist/statusList/StatusListStore.d.ts.map +1 -0
- package/dist/statusList/StatusListStore.js +213 -0
- package/dist/statusList/StatusListStore.js.map +1 -0
- package/dist/types/contact/IAbstractContactStore.d.ts +70 -36
- package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -1
- package/dist/types/contact/contact.d.ts +139 -56
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +6 -1
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/statusList/IAbstractStatusListStore.d.ts +38 -0
- package/dist/types/statusList/IAbstractStatusListStore.d.ts.map +1 -0
- package/dist/types/statusList/IAbstractStatusListStore.js +3 -0
- package/dist/types/statusList/IAbstractStatusListStore.js.map +1 -0
- package/dist/types/statusList/statusList.d.ts +25 -0
- package/dist/types/statusList/statusList.d.ts.map +1 -0
- package/dist/types/statusList/statusList.js +3 -0
- package/dist/types/statusList/statusList.js.map +1 -0
- package/dist/types/validation/validation.d.ts +4 -0
- package/dist/types/validation/validation.d.ts.map +1 -0
- package/dist/types/validation/validation.js +3 -0
- package/dist/types/validation/validation.js.map +1 -0
- package/dist/utils/ValidatorUtils.d.ts +4 -0
- package/dist/utils/ValidatorUtils.d.ts.map +1 -0
- package/dist/utils/ValidatorUtils.js +13 -0
- package/dist/utils/ValidatorUtils.js.map +1 -0
- package/dist/utils/contact/MappingUtils.d.ts +47 -0
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -0
- package/dist/utils/contact/MappingUtils.js +291 -0
- package/dist/utils/contact/MappingUtils.js.map +1 -0
- package/package.json +5 -4
- package/src/__tests__/contact.entities.test.ts +1457 -195
- package/src/__tests__/contact.store.test.ts +1302 -266
- package/src/contact/AbstractContactStore.ts +44 -22
- package/src/contact/ContactStore.ts +328 -204
- package/src/entities/contact/BaseConfigEntity.ts +10 -2
- package/src/entities/contact/BaseContactEntity.ts +30 -0
- package/src/entities/contact/ConnectionEntity.ts +4 -23
- package/src/entities/contact/CorrelationIdentifierEntity.ts +9 -13
- package/src/entities/contact/DidAuthConfigEntity.ts +1 -18
- package/src/entities/contact/ElectronicAddressEntity.ts +60 -0
- package/src/entities/contact/IdentityEntity.ts +18 -25
- package/src/entities/contact/IdentityMetadataItemEntity.ts +8 -12
- package/src/entities/contact/NaturalPersonEntity.ts +38 -0
- package/src/entities/contact/OpenIdConfigEntity.ts +1 -23
- package/src/entities/contact/OrganizationEntity.ts +34 -0
- package/src/entities/contact/PartyEntity.ts +118 -0
- package/src/entities/contact/PartyRelationshipEntity.ts +61 -0
- package/src/entities/contact/PartyTypeEntity.ts +59 -0
- package/src/entities/statusList2021/StatusList2021Entity.ts +95 -0
- package/src/entities/statusList2021/StatusList2021EntryEntity.ts +29 -0
- package/src/index.ts +36 -17
- package/src/migrations/generic/1-CreateContacts.ts +46 -36
- package/src/migrations/generic/2-CreateContacts.ts +64 -0
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +62 -0
- package/src/migrations/generic/{1-CreateIssuanceBranding.ts → 3-CreateStatusList.ts} +9 -9
- package/src/migrations/generic/index.ts +11 -2
- package/src/migrations/internal-migrations-ormconfig.ts +2 -4
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +4 -2
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +2 -0
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +94 -0
- package/src/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.ts +24 -0
- package/src/migrations/postgres/uuid.ts +12 -0
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +163 -0
- package/src/migrations/sqlite/1693866470000-CreateStatusList.ts +24 -0
- package/src/statusList/IStatusListStore.ts +44 -0
- package/src/statusList/StatusListStore.ts +237 -0
- package/src/types/contact/IAbstractContactStore.ts +84 -27
- package/src/types/contact/contact.ts +144 -50
- package/src/types/index.ts +4 -0
- package/src/types/statusList/IAbstractStatusListStore.ts +47 -0
- package/src/types/statusList/statusList.ts +39 -0
- package/src/types/validation/validation.ts +3 -0
- package/src/utils/ValidatorUtils.ts +10 -0
- package/src/utils/contact/MappingUtils.ts +344 -0
- package/dist/entities/contact/ContactEntity.d.ts +0 -16
- package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
- package/dist/entities/contact/ContactEntity.js.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
- package/src/entities/contact/ContactEntity.ts +0 -74
|
@@ -1,52 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
NonPersistedPartyType,
|
|
3
|
+
NonPersistedContact,
|
|
4
|
+
NonPersistedIdentity,
|
|
5
|
+
Party,
|
|
6
|
+
Identity,
|
|
7
|
+
PartialParty,
|
|
8
|
+
PartialIdentity,
|
|
9
|
+
PartyTypeEnum,
|
|
10
|
+
PartyType,
|
|
11
|
+
PartyRelationship,
|
|
12
|
+
PartialPartyRelationship,
|
|
13
|
+
PartialPartyType,
|
|
14
|
+
NonPersistedElectronicAddress,
|
|
15
|
+
} from './contact'
|
|
5
16
|
|
|
6
|
-
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
17
|
+
export type FindPartyArgs = Array<PartialParty>
|
|
18
|
+
export type FindIdentityArgs = Array<PartialIdentity>
|
|
19
|
+
export type FindPartyTypeArgs = Array<PartialPartyType>
|
|
20
|
+
export type FindRelationshipArgs = Array<PartialPartyRelationship>
|
|
9
21
|
|
|
10
|
-
export
|
|
11
|
-
|
|
22
|
+
export type GetPartyArgs = {
|
|
23
|
+
partyId: string
|
|
12
24
|
}
|
|
13
25
|
|
|
14
|
-
export
|
|
15
|
-
filter?:
|
|
26
|
+
export type GetPartiesArgs = {
|
|
27
|
+
filter?: FindPartyArgs
|
|
16
28
|
}
|
|
17
29
|
|
|
18
|
-
export
|
|
19
|
-
name: string
|
|
20
|
-
alias: string
|
|
30
|
+
export type AddPartyArgs = {
|
|
21
31
|
uri?: string
|
|
22
|
-
|
|
32
|
+
partyType: NonPersistedPartyType
|
|
33
|
+
contact: NonPersistedContact
|
|
34
|
+
identities?: Array<NonPersistedIdentity>
|
|
35
|
+
electronicAddresses?: Array<NonPersistedElectronicAddress>
|
|
23
36
|
}
|
|
24
37
|
|
|
25
|
-
export
|
|
26
|
-
|
|
38
|
+
export type UpdatePartyArgs = {
|
|
39
|
+
party: Omit<Party, 'identities' | 'electronicAddresses' | 'partyType' | 'createdAt' | 'lastUpdatedAt'>
|
|
27
40
|
}
|
|
28
41
|
|
|
29
|
-
export
|
|
30
|
-
|
|
42
|
+
export type RemovePartyArgs = {
|
|
43
|
+
partyId: string
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
export
|
|
46
|
+
export type GetIdentityArgs = {
|
|
34
47
|
identityId: string
|
|
35
48
|
}
|
|
36
49
|
|
|
37
|
-
export
|
|
50
|
+
export type GetIdentitiesArgs = {
|
|
38
51
|
filter?: FindIdentityArgs
|
|
39
52
|
}
|
|
40
53
|
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
identity:
|
|
54
|
+
export type AddIdentityArgs = {
|
|
55
|
+
partyId: string
|
|
56
|
+
identity: NonPersistedIdentity
|
|
44
57
|
}
|
|
45
58
|
|
|
46
|
-
export
|
|
47
|
-
identity:
|
|
59
|
+
export type UpdateIdentityArgs = {
|
|
60
|
+
identity: Identity
|
|
48
61
|
}
|
|
49
62
|
|
|
50
|
-
export
|
|
63
|
+
export type RemoveIdentityArgs = {
|
|
51
64
|
identityId: string
|
|
52
65
|
}
|
|
66
|
+
|
|
67
|
+
export type RemoveRelationshipArgs = {
|
|
68
|
+
relationshipId: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type AddRelationshipArgs = {
|
|
72
|
+
leftId: string
|
|
73
|
+
rightId: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type GetRelationshipArgs = {
|
|
77
|
+
relationshipId: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type GetRelationshipsArgs = {
|
|
81
|
+
filter: FindRelationshipArgs
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type UpdateRelationshipArgs = {
|
|
85
|
+
relationship: Omit<PartyRelationship, 'createdAt' | 'lastUpdatedAt'>
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type AddPartyTypeArgs = {
|
|
89
|
+
type: PartyTypeEnum
|
|
90
|
+
name: string
|
|
91
|
+
tenantId: string
|
|
92
|
+
description?: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type GetPartyTypeArgs = {
|
|
96
|
+
partyTypeId: string
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type GetPartyTypesArgs = {
|
|
100
|
+
filter?: FindPartyTypeArgs
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type UpdatePartyTypeArgs = {
|
|
104
|
+
partyType: Omit<PartyType, 'createdAt' | 'lastUpdatedAt'>
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type RemovePartyTypeArgs = {
|
|
108
|
+
partyTypeId: string
|
|
109
|
+
}
|
|
@@ -1,82 +1,87 @@
|
|
|
1
1
|
import { IIdentifier } from '@veramo/core'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
ISSUER = 'issuer',
|
|
5
|
-
VERIFIER = 'verifier',
|
|
6
|
-
HOLDER = 'holder',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export enum ConnectionTypeEnum {
|
|
10
|
-
OPENID_CONNECT = 'OIDC',
|
|
11
|
-
SIOPv2 = 'SIOPv2',
|
|
12
|
-
SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export enum CorrelationIdentifierEnum {
|
|
16
|
-
DID = 'did',
|
|
17
|
-
URL = 'url',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface IContact {
|
|
3
|
+
export type Party = {
|
|
21
4
|
id: string
|
|
22
|
-
name: string
|
|
23
|
-
alias: string
|
|
24
5
|
uri?: string
|
|
25
6
|
roles: Array<IdentityRoleEnum>
|
|
26
|
-
identities: Array<
|
|
7
|
+
identities: Array<Identity>
|
|
8
|
+
electronicAddresses: Array<ElectronicAddress>
|
|
9
|
+
contact: Contact
|
|
10
|
+
partyType: PartyType
|
|
11
|
+
relationships: Array<PartyRelationship>
|
|
27
12
|
createdAt: Date
|
|
28
13
|
lastUpdatedAt: Date
|
|
29
14
|
}
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
identities?: Array<
|
|
15
|
+
export type NonPersistedParty = Omit<
|
|
16
|
+
Party,
|
|
17
|
+
'id' | 'identities' | 'electronicAddresses' | 'contact' | 'roles' | 'partyType' | 'relationships' | 'createdAt' | 'lastUpdatedAt'
|
|
18
|
+
> & {
|
|
19
|
+
identities?: Array<NonPersistedIdentity>
|
|
20
|
+
electronicAddresses?: Array<NonPersistedElectronicAddress>
|
|
21
|
+
contact: NonPersistedContact
|
|
22
|
+
partyType: NonPersistedPartyType
|
|
23
|
+
relationships?: Array<NonPersistedPartyRelationship>
|
|
24
|
+
}
|
|
25
|
+
export type PartialParty = Partial<Omit<Party, 'identities' | 'electronicAddresses' | 'contact' | 'partyType' | 'relationships'>> & {
|
|
26
|
+
identities?: PartialIdentity
|
|
27
|
+
electronicAddresses?: PartialElectronicAddress
|
|
28
|
+
contact?: PartialContact
|
|
29
|
+
partyType?: PartialPartyType
|
|
30
|
+
relationships?: PartialPartyRelationship
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
export
|
|
33
|
+
export type Identity = {
|
|
38
34
|
id: string
|
|
39
35
|
alias: string
|
|
40
36
|
roles: Array<IdentityRoleEnum>
|
|
41
|
-
identifier:
|
|
42
|
-
connection?:
|
|
43
|
-
metadata?: Array<
|
|
37
|
+
identifier: CorrelationIdentifier
|
|
38
|
+
connection?: Connection
|
|
39
|
+
metadata?: Array<MetadataItem>
|
|
44
40
|
createdAt: Date
|
|
45
41
|
lastUpdatedAt: Date
|
|
46
42
|
}
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
export type NonPersistedIdentity = Omit<Identity, 'id' | 'identifier' | 'connection' | 'metadata' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
44
|
+
identifier: NonPersistedCorrelationIdentifier
|
|
45
|
+
connection?: NonPersistedConnection
|
|
46
|
+
metadata?: Array<NonPersistedMetadataItem>
|
|
47
|
+
}
|
|
48
|
+
export type PartialIdentity = Partial<Omit<Identity, 'identifier' | 'connection' | 'metadata' | 'roles'>> & {
|
|
49
|
+
identifier?: PartialCorrelationIdentifier
|
|
50
|
+
connection?: PartialConnection
|
|
51
|
+
metadata?: PartialMetadataItem
|
|
52
|
+
roles?: IdentityRoleEnum
|
|
53
|
+
partyId?: string
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
export
|
|
56
|
+
export type MetadataItem = {
|
|
56
57
|
id: string
|
|
57
58
|
label: string
|
|
58
59
|
value: string
|
|
59
60
|
}
|
|
60
|
-
export
|
|
61
|
+
export type NonPersistedMetadataItem = Omit<MetadataItem, 'id'>
|
|
62
|
+
export type PartialMetadataItem = Partial<MetadataItem>
|
|
61
63
|
|
|
62
|
-
export
|
|
64
|
+
export type CorrelationIdentifier = {
|
|
63
65
|
id: string
|
|
64
66
|
type: CorrelationIdentifierEnum
|
|
65
67
|
correlationId: string
|
|
66
68
|
}
|
|
67
|
-
export
|
|
69
|
+
export type NonPersistedCorrelationIdentifier = Omit<CorrelationIdentifier, 'id'>
|
|
70
|
+
export type PartialCorrelationIdentifier = Partial<CorrelationIdentifier>
|
|
68
71
|
|
|
69
|
-
export
|
|
72
|
+
export type Connection = {
|
|
70
73
|
id: string
|
|
71
74
|
type: ConnectionTypeEnum
|
|
72
75
|
config: ConnectionConfig
|
|
73
76
|
}
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
export type NonPersistedConnection = Omit<Connection, 'id' | 'config'> & {
|
|
78
|
+
config: NonPersistedConnectionConfig
|
|
79
|
+
}
|
|
80
|
+
export type PartialConnection = Partial<Omit<Connection, 'config'>> & {
|
|
81
|
+
config: PartialConnectionConfig
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
export
|
|
84
|
+
export type OpenIdConfig = {
|
|
80
85
|
id: string
|
|
81
86
|
clientId: string
|
|
82
87
|
clientSecret: string
|
|
@@ -86,16 +91,105 @@ export interface IOpenIdConfig {
|
|
|
86
91
|
dangerouslyAllowInsecureHttpRequests: boolean
|
|
87
92
|
clientAuthMethod: 'basic' | 'post' | undefined
|
|
88
93
|
}
|
|
89
|
-
export
|
|
94
|
+
export type NonPersistedOpenIdConfig = Omit<OpenIdConfig, 'id'>
|
|
95
|
+
export type PartialOpenIdConfig = Partial<OpenIdConfig>
|
|
90
96
|
|
|
91
|
-
export
|
|
97
|
+
export type DidAuthConfig = {
|
|
92
98
|
id: string
|
|
93
99
|
identifier: IIdentifier
|
|
94
100
|
stateId: string
|
|
95
101
|
redirectUrl: string
|
|
96
102
|
sessionId: string
|
|
97
103
|
}
|
|
98
|
-
export
|
|
104
|
+
export type NonPersistedDidAuthConfig = Omit<DidAuthConfig, 'id'>
|
|
105
|
+
export type PartialDidAuthConfig = Partial<Omit<DidAuthConfig, 'identifier'>> & {
|
|
106
|
+
identifier: Partial<IIdentifier> // TODO, we need to create partials for sub types in IIdentifier
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type ConnectionConfig = OpenIdConfig | DidAuthConfig
|
|
110
|
+
export type NonPersistedConnectionConfig = NonPersistedDidAuthConfig | NonPersistedOpenIdConfig
|
|
111
|
+
export type PartialConnectionConfig = PartialOpenIdConfig | PartialDidAuthConfig
|
|
99
112
|
|
|
100
|
-
export
|
|
101
|
-
|
|
113
|
+
export type NaturalPerson = {
|
|
114
|
+
id: string
|
|
115
|
+
firstName: string
|
|
116
|
+
lastName: string
|
|
117
|
+
middleName?: string
|
|
118
|
+
displayName: string
|
|
119
|
+
createdAt: Date
|
|
120
|
+
lastUpdatedAt: Date
|
|
121
|
+
}
|
|
122
|
+
export type NonPersistedNaturalPerson = Omit<NaturalPerson, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
123
|
+
export type PartialNaturalPerson = Partial<NaturalPerson>
|
|
124
|
+
|
|
125
|
+
export type Organization = {
|
|
126
|
+
id: string
|
|
127
|
+
legalName: string
|
|
128
|
+
displayName: string
|
|
129
|
+
createdAt: Date
|
|
130
|
+
lastUpdatedAt: Date
|
|
131
|
+
}
|
|
132
|
+
export type NonPersistedOrganization = Omit<Organization, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
133
|
+
export type PartialOrganization = Partial<Organization>
|
|
134
|
+
|
|
135
|
+
export type Contact = NaturalPerson | Organization
|
|
136
|
+
export type NonPersistedContact = NonPersistedNaturalPerson | NonPersistedOrganization
|
|
137
|
+
export type PartialContact = PartialNaturalPerson | PartialOrganization
|
|
138
|
+
|
|
139
|
+
export type PartyType = {
|
|
140
|
+
id: string
|
|
141
|
+
type: PartyTypeEnum
|
|
142
|
+
name: string
|
|
143
|
+
tenantId: string
|
|
144
|
+
description?: string
|
|
145
|
+
createdAt: Date
|
|
146
|
+
lastUpdatedAt: Date
|
|
147
|
+
}
|
|
148
|
+
export type NonPersistedPartyType = Omit<PartyType, 'id' | 'createdAt' | 'lastUpdatedAt'> & {
|
|
149
|
+
id?: string
|
|
150
|
+
}
|
|
151
|
+
export type PartialPartyType = Partial<PartyType>
|
|
152
|
+
|
|
153
|
+
export type PartyRelationship = {
|
|
154
|
+
id: string
|
|
155
|
+
leftId: string
|
|
156
|
+
rightId: string
|
|
157
|
+
createdAt: Date
|
|
158
|
+
lastUpdatedAt: Date
|
|
159
|
+
}
|
|
160
|
+
export type NonPersistedPartyRelationship = Omit<PartyRelationship, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
161
|
+
export type PartialPartyRelationship = Partial<PartyRelationship>
|
|
162
|
+
|
|
163
|
+
export type ElectronicAddress = {
|
|
164
|
+
id: string
|
|
165
|
+
type: ElectronicAddressType
|
|
166
|
+
electronicAddress: string
|
|
167
|
+
createdAt: Date
|
|
168
|
+
lastUpdatedAt: Date
|
|
169
|
+
}
|
|
170
|
+
export type NonPersistedElectronicAddress = Omit<ElectronicAddress, 'id' | 'createdAt' | 'lastUpdatedAt'>
|
|
171
|
+
export type PartialElectronicAddress = Partial<ElectronicAddress>
|
|
172
|
+
|
|
173
|
+
export type ElectronicAddressType = 'email'
|
|
174
|
+
|
|
175
|
+
export enum IdentityRoleEnum {
|
|
176
|
+
ISSUER = 'issuer',
|
|
177
|
+
VERIFIER = 'verifier',
|
|
178
|
+
HOLDER = 'holder',
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export enum ConnectionTypeEnum {
|
|
182
|
+
OPENID_CONNECT = 'OIDC',
|
|
183
|
+
SIOPv2 = 'SIOPv2',
|
|
184
|
+
SIOPv2_OpenID4VP = 'SIOPv2+OpenID4VP',
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export enum CorrelationIdentifierEnum {
|
|
188
|
+
DID = 'did',
|
|
189
|
+
URL = 'url',
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export enum PartyTypeEnum {
|
|
193
|
+
NATURAL_PERSON = 'naturalPerson',
|
|
194
|
+
ORGANIZATION = 'organization',
|
|
195
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -2,3 +2,7 @@ export * from './issuanceBranding/issuanceBranding'
|
|
|
2
2
|
export * from './issuanceBranding/IAbstractIssuanceBrandingStore'
|
|
3
3
|
export * from './contact/contact'
|
|
4
4
|
export * from './contact/IAbstractContactStore'
|
|
5
|
+
|
|
6
|
+
export * from './validation/validation'
|
|
7
|
+
export * from './statusList/statusList'
|
|
8
|
+
export * from './statusList/IAbstractStatusListStore'
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FindOptionsWhere } from 'typeorm'
|
|
2
|
+
import { IStatusListEntity, IStatusListEntryEntity } from './statusList'
|
|
3
|
+
|
|
4
|
+
export type FindStatusListArgs = FindOptionsWhere<IStatusListEntity>[]
|
|
5
|
+
export type FindStatusListEntryArgs = FindOptionsWhere<IStatusListEntryEntity>[] | FindOptionsWhere<IStatusListEntryEntity>
|
|
6
|
+
|
|
7
|
+
export interface IStatusListEntryAvailableArgs {
|
|
8
|
+
statusListId?: string
|
|
9
|
+
correlationId?: string
|
|
10
|
+
statusListIndex: number | number[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IGetStatusListEntryByIndexArgs {
|
|
14
|
+
statusListId?: string
|
|
15
|
+
correlationId?: string
|
|
16
|
+
statusListIndex: number
|
|
17
|
+
errorOnNotFound?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IGetStatusListEntryByCredentialIdArgs {
|
|
21
|
+
statusListId?: string
|
|
22
|
+
statusListCorrelationId?: string
|
|
23
|
+
entryCorrelationId?: string
|
|
24
|
+
credentialId: string
|
|
25
|
+
errorOnNotFound?: boolean
|
|
26
|
+
}
|
|
27
|
+
export interface IGetStatusListEntriesArgs {
|
|
28
|
+
statusListId: string
|
|
29
|
+
filter?: FindStatusListEntryArgs
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type IAddStatusListEntryArgs = IStatusListEntryEntity
|
|
33
|
+
|
|
34
|
+
export interface IGetStatusListArgs {
|
|
35
|
+
id?: string
|
|
36
|
+
correlationId?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type IRemoveStatusListArgs = IGetStatusListArgs
|
|
40
|
+
|
|
41
|
+
export interface IGetStatusListsArgs {
|
|
42
|
+
filter?: FindStatusListArgs
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type IAddStatusListArgs = IStatusListEntity
|
|
46
|
+
|
|
47
|
+
export type IUpdateStatusListIndexArgs = IStatusListEntity
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IIssuer,
|
|
3
|
+
OriginalVerifiableCredential,
|
|
4
|
+
StatusListCredentialIdMode,
|
|
5
|
+
StatusListDriverType,
|
|
6
|
+
StatusListIndexingDirection,
|
|
7
|
+
StatusListType,
|
|
8
|
+
StatusPurpose2021,
|
|
9
|
+
} from '@sphereon/ssi-types'
|
|
10
|
+
import { ProofFormat } from '@veramo/core'
|
|
11
|
+
import { StatusListEntity } from '../../entities/statusList2021/StatusList2021Entity'
|
|
12
|
+
|
|
13
|
+
export interface IStatusListEntity {
|
|
14
|
+
id: string
|
|
15
|
+
correlationId: string
|
|
16
|
+
driverType: StatusListDriverType
|
|
17
|
+
credentialIdMode: StatusListCredentialIdMode
|
|
18
|
+
length: number
|
|
19
|
+
issuer: string | IIssuer
|
|
20
|
+
type: StatusListType
|
|
21
|
+
proofFormat: ProofFormat
|
|
22
|
+
indexingDirection: StatusListIndexingDirection
|
|
23
|
+
statusPurpose: StatusPurpose2021
|
|
24
|
+
statusListCredential?: OriginalVerifiableCredential
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IStatusListEntryEntity {
|
|
28
|
+
statusList: StatusListEntity | string // string is here to accept the id, so we can query it easily with typeorm
|
|
29
|
+
|
|
30
|
+
value?: string
|
|
31
|
+
|
|
32
|
+
statusListIndex: number
|
|
33
|
+
|
|
34
|
+
credentialHash?: string
|
|
35
|
+
|
|
36
|
+
credentialId?: string
|
|
37
|
+
|
|
38
|
+
correlationId?: string
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ValidationError } from 'class-validator'
|
|
2
|
+
import { ValidationConstraint } from '../types'
|
|
3
|
+
|
|
4
|
+
export const getConstraint = (validation: ValidationError): ValidationConstraint | undefined => {
|
|
5
|
+
if (validation.children && validation.children.length > 0) {
|
|
6
|
+
return getConstraint(validation.children[0])
|
|
7
|
+
} else {
|
|
8
|
+
return validation.constraints
|
|
9
|
+
}
|
|
10
|
+
}
|