@sphereon/ssi-sdk.data-store 0.18.1 → 0.18.2-unstable.10
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/contact/AbstractContactStore.d.ts +23 -23
- package/dist/contact/AbstractContactStore.js +6 -6
- package/dist/contact/ContactStore.d.ts +32 -32
- package/dist/contact/ContactStore.js +365 -365
- package/dist/entities/contact/BaseConfigEntity.d.ts +6 -6
- package/dist/entities/contact/BaseConfigEntity.js +33 -33
- package/dist/entities/contact/BaseContactEntity.d.ts +9 -9
- package/dist/entities/contact/BaseContactEntity.js +53 -53
- package/dist/entities/contact/ConnectionEntity.d.ts +10 -10
- package/dist/entities/contact/ConnectionEntity.js +46 -46
- package/dist/entities/contact/ContactEntity.d.ts +16 -0
- package/dist/entities/contact/ContactEntity.d.ts.map +1 -0
- package/dist/entities/contact/ContactEntity.js +164 -0
- package/dist/entities/contact/ContactEntity.js.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +10 -10
- package/dist/entities/contact/CorrelationIdentifierEntity.js +71 -71
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +6 -6
- package/dist/entities/contact/DidAuthConfigEntity.js +32 -32
- package/dist/entities/contact/ElectronicAddressEntity.d.ts +13 -13
- package/dist/entities/contact/ElectronicAddressEntity.js +91 -91
- package/dist/entities/contact/IdentityEntity.d.ts +20 -20
- package/dist/entities/contact/IdentityEntity.js +128 -128
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +9 -9
- package/dist/entities/contact/IdentityMetadataItemEntity.js +68 -68
- package/dist/entities/contact/NaturalPersonEntity.d.ts +8 -8
- package/dist/entities/contact/NaturalPersonEntity.js +71 -71
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +10 -10
- package/dist/entities/contact/OpenIdConfigEntity.js +48 -48
- package/dist/entities/contact/OrganizationEntity.d.ts +8 -8
- package/dist/entities/contact/OrganizationEntity.js +66 -66
- package/dist/entities/contact/PartyEntity.d.ts +19 -19
- package/dist/entities/contact/PartyEntity.js +131 -131
- package/dist/entities/contact/PartyRelationshipEntity.d.ts +12 -12
- package/dist/entities/contact/PartyRelationshipEntity.js +94 -94
- package/dist/entities/contact/PartyTypeEntity.d.ts +14 -14
- package/dist/entities/contact/PartyTypeEntity.js +103 -103
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +26 -26
- package/dist/entities/eventLogger/AuditEventEntity.js +123 -123
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +10 -10
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +73 -73
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +17 -17
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +119 -119
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +14 -14
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +101 -101
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +91 -91
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +38 -38
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +94 -94
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +61 -61
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts +18 -18
- package/dist/entities/statusList2021/StatusList2021Entity.js +114 -114
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts +10 -10
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +50 -50
- package/dist/entities/validators/index.d.ts +6 -6
- package/dist/entities/validators/index.js +26 -26
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts +6 -6
- package/dist/eventLogger/AbstractEventLoggerStore.js +6 -6
- package/dist/eventLogger/EventLoggerStore.d.ts +12 -12
- package/dist/eventLogger/EventLoggerStore.js +43 -43
- package/dist/index.d.ts +41 -41
- package/dist/index.js +127 -127
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +19 -19
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +6 -6
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +30 -30
- package/dist/issuanceBranding/IssuanceBrandingStore.js +374 -374
- package/dist/migrations/generic/1-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/1-CreateContacts.js +77 -77
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +7 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +96 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +1 -0
- 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 +78 -0
- package/dist/migrations/generic/2-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/2-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +77 -77
- package/dist/migrations/generic/3-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/3-CreateContacts.js +77 -77
- 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/3-CreateStatusList.js +72 -0
- package/dist/migrations/generic/3-CreateStatusList.js.map +1 -0
- package/dist/migrations/generic/4-CreateStatusList.d.ts +6 -6
- package/dist/migrations/generic/4-CreateStatusList.js +71 -71
- package/dist/migrations/generic/5-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/generic/5-CreateAuditEvents.js +77 -77
- package/dist/migrations/generic/index.d.ts +16 -16
- package/dist/migrations/generic/index.js +27 -27
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.js +5 -5
- package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -6
- package/dist/migrations/internal-migrations-ormconfig.js +26 -26
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +56 -56
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +68 -68
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +68 -68
- package/dist/migrations/postgres/1693866470001-CreateStatusList.d.ts +6 -6
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +31 -31
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +42 -42
- 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/1659463069549-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +78 -78
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +88 -88
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +107 -107
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts +6 -6
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +31 -31
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +28 -28
- package/dist/statusList/IStatusListStore.d.ts +19 -19
- package/dist/statusList/IStatusListStore.js +2 -2
- package/dist/statusList/StatusListStore.d.ts +35 -35
- package/dist/statusList/StatusListStore.js +212 -212
- package/dist/types/contact/IAbstractContactStore.d.ts +74 -74
- package/dist/types/contact/IAbstractContactStore.js +2 -2
- package/dist/types/contact/contact.d.ts +173 -173
- package/dist/types/contact/contact.js +25 -25
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -9
- package/dist/types/eventLogger/IAbstractEventLoggerStore.js +2 -2
- package/dist/types/eventLogger/eventLogger.d.ts +2 -2
- package/dist/types/eventLogger/eventLogger.js +2 -2
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.js +25 -25
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +58 -58
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +2 -2
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +114 -114
- package/dist/types/issuanceBranding/issuanceBranding.js +2 -2
- package/dist/types/statusList/IAbstractStatusListStore.d.ts +37 -37
- package/dist/types/statusList/IAbstractStatusListStore.js +2 -2
- package/dist/types/statusList/statusList.d.ts +24 -24
- package/dist/types/statusList/statusList.js +2 -2
- package/dist/types/validation/validation.d.ts +3 -3
- package/dist/types/validation/validation.js +2 -2
- package/dist/utils/ValidatorUtils.d.ts +3 -3
- package/dist/utils/ValidatorUtils.js +12 -12
- package/dist/utils/contact/MappingUtils.d.ts +46 -46
- package/dist/utils/contact/MappingUtils.js +290 -290
- package/package.json +4 -4
- package/src/__tests__/eventLogger.entities.test.ts +73 -73
- package/src/__tests__/eventLogger.store.test.ts +136 -136
- package/src/contact/ContactStore.ts +501 -501
- package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
- 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 +113 -113
- 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/index.ts +27 -27
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +163 -163
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +9 -9
package/src/index.ts
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { BaseConfigEntity } from './entities/contact/BaseConfigEntity'
|
|
2
|
-
import { BaseLocaleBrandingEntity } from './entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
3
|
-
import { BaseContactEntity } from './entities/contact/BaseContactEntity'
|
|
4
|
-
import { ConnectionEntity } from './entities/contact/ConnectionEntity'
|
|
5
|
-
import { PartyEntity } from './entities/contact/PartyEntity'
|
|
6
|
-
import { CorrelationIdentifierEntity } from './entities/contact/CorrelationIdentifierEntity'
|
|
7
|
-
import { DidAuthConfigEntity } from './entities/contact/DidAuthConfigEntity'
|
|
8
|
-
import { IdentityEntity } from './entities/contact/IdentityEntity'
|
|
9
|
-
import { IdentityMetadataItemEntity } from './entities/contact/IdentityMetadataItemEntity'
|
|
10
|
-
import { OpenIdConfigEntity } from './entities/contact/OpenIdConfigEntity'
|
|
11
|
-
import { BackgroundAttributesEntity, backgroundAttributesEntityFrom } from './entities/issuanceBranding/BackgroundAttributesEntity'
|
|
12
|
-
import { CredentialBrandingEntity, credentialBrandingEntityFrom } from './entities/issuanceBranding/CredentialBrandingEntity'
|
|
13
|
-
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from './entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
14
|
-
import { ImageAttributesEntity, imageAttributesEntityFrom } from './entities/issuanceBranding/ImageAttributesEntity'
|
|
15
|
-
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './entities/issuanceBranding/ImageDimensionsEntity'
|
|
16
|
-
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from './entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
17
|
-
import { IssuerBrandingEntity, issuerBrandingEntityFrom } from './entities/issuanceBranding/IssuerBrandingEntity'
|
|
18
|
-
import { TextAttributesEntity, textAttributesEntityFrom } from './entities/issuanceBranding/TextAttributesEntity'
|
|
19
|
-
import { StatusListEntity } from './entities/statusList2021/StatusList2021Entity'
|
|
20
|
-
import { StatusListEntryEntity } from './entities/statusList2021/StatusList2021EntryEntity'
|
|
21
|
-
import { IStatusListEntity, IStatusListEntryEntity } from './types'
|
|
22
|
-
import { PartyRelationshipEntity } from './entities/contact/PartyRelationshipEntity'
|
|
23
|
-
import { PartyTypeEntity } from './entities/contact/PartyTypeEntity'
|
|
24
|
-
import { OrganizationEntity } from './entities/contact/OrganizationEntity'
|
|
25
|
-
import { NaturalPersonEntity } from './entities/contact/NaturalPersonEntity'
|
|
26
|
-
import { ElectronicAddressEntity } from './entities/contact/ElectronicAddressEntity'
|
|
27
|
-
export { ContactStore } from './contact/ContactStore'
|
|
28
|
-
export { AbstractContactStore } from './contact/AbstractContactStore'
|
|
29
|
-
export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'
|
|
30
|
-
export { IssuanceBrandingStore } from './issuanceBranding/IssuanceBrandingStore'
|
|
31
|
-
export { StatusListStore } from './statusList/StatusListStore'
|
|
32
|
-
import { AuditEventEntity, auditEventEntityFrom } from './entities/eventLogger/AuditEventEntity'
|
|
33
|
-
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
34
|
-
export { EventLoggerStore } from './eventLogger/EventLoggerStore'
|
|
35
|
-
export { DataStoreMigrations } from './migrations'
|
|
36
|
-
export * from './types'
|
|
37
|
-
export * from './utils/contact/MappingUtils'
|
|
38
|
-
|
|
39
|
-
export const DataStoreContactEntities = [
|
|
40
|
-
BaseConfigEntity,
|
|
41
|
-
ConnectionEntity,
|
|
42
|
-
PartyEntity,
|
|
43
|
-
IdentityEntity,
|
|
44
|
-
IdentityMetadataItemEntity,
|
|
45
|
-
CorrelationIdentifierEntity,
|
|
46
|
-
DidAuthConfigEntity,
|
|
47
|
-
OpenIdConfigEntity,
|
|
48
|
-
PartyRelationshipEntity,
|
|
49
|
-
PartyTypeEntity,
|
|
50
|
-
BaseContactEntity,
|
|
51
|
-
OrganizationEntity,
|
|
52
|
-
NaturalPersonEntity,
|
|
53
|
-
ElectronicAddressEntity,
|
|
54
|
-
]
|
|
55
|
-
|
|
56
|
-
export const DataStoreIssuanceBrandingEntities = [
|
|
57
|
-
BackgroundAttributesEntity,
|
|
58
|
-
CredentialBrandingEntity,
|
|
59
|
-
ImageAttributesEntity,
|
|
60
|
-
ImageDimensionsEntity,
|
|
61
|
-
BaseLocaleBrandingEntity,
|
|
62
|
-
IssuerBrandingEntity,
|
|
63
|
-
TextAttributesEntity,
|
|
64
|
-
CredentialLocaleBrandingEntity,
|
|
65
|
-
IssuerLocaleBrandingEntity,
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
export const DataStoreStatusListEntities = [StatusListEntity, StatusListEntryEntity]
|
|
69
|
-
|
|
70
|
-
export const DataStoreEventLoggerEntities = [AuditEventEntity]
|
|
71
|
-
|
|
72
|
-
// All entities combined if a party wants to enable them all at once
|
|
73
|
-
export const DataStoreEntities = [
|
|
74
|
-
...DataStoreContactEntities,
|
|
75
|
-
...DataStoreIssuanceBrandingEntities,
|
|
76
|
-
...DataStoreStatusListEntities,
|
|
77
|
-
...DataStoreEventLoggerEntities,
|
|
78
|
-
]
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
BaseConfigEntity,
|
|
82
|
-
ConnectionEntity,
|
|
83
|
-
PartyEntity,
|
|
84
|
-
CorrelationIdentifierEntity,
|
|
85
|
-
DidAuthConfigEntity,
|
|
86
|
-
IdentityEntity,
|
|
87
|
-
IdentityMetadataItemEntity,
|
|
88
|
-
OpenIdConfigEntity,
|
|
89
|
-
BackgroundAttributesEntity,
|
|
90
|
-
CredentialBrandingEntity,
|
|
91
|
-
ImageAttributesEntity,
|
|
92
|
-
ImageDimensionsEntity,
|
|
93
|
-
BaseLocaleBrandingEntity,
|
|
94
|
-
IssuerBrandingEntity,
|
|
95
|
-
TextAttributesEntity,
|
|
96
|
-
CredentialLocaleBrandingEntity,
|
|
97
|
-
IssuerLocaleBrandingEntity,
|
|
98
|
-
ElectronicAddressEntity,
|
|
99
|
-
backgroundAttributesEntityFrom,
|
|
100
|
-
credentialBrandingEntityFrom,
|
|
101
|
-
imageAttributesEntityFrom,
|
|
102
|
-
imageDimensionsEntityFrom,
|
|
103
|
-
issuerBrandingEntityFrom,
|
|
104
|
-
textAttributesEntityFrom,
|
|
105
|
-
issuerLocaleBrandingEntityFrom,
|
|
106
|
-
credentialLocaleBrandingEntityFrom,
|
|
107
|
-
IStatusListEntity,
|
|
108
|
-
IStatusListEntryEntity,
|
|
109
|
-
StatusListEntity,
|
|
110
|
-
StatusListEntryEntity,
|
|
111
|
-
AuditEventEntity,
|
|
112
|
-
auditEventEntityFrom,
|
|
113
|
-
}
|
|
1
|
+
import { BaseConfigEntity } from './entities/contact/BaseConfigEntity'
|
|
2
|
+
import { BaseLocaleBrandingEntity } from './entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
3
|
+
import { BaseContactEntity } from './entities/contact/BaseContactEntity'
|
|
4
|
+
import { ConnectionEntity } from './entities/contact/ConnectionEntity'
|
|
5
|
+
import { PartyEntity } from './entities/contact/PartyEntity'
|
|
6
|
+
import { CorrelationIdentifierEntity } from './entities/contact/CorrelationIdentifierEntity'
|
|
7
|
+
import { DidAuthConfigEntity } from './entities/contact/DidAuthConfigEntity'
|
|
8
|
+
import { IdentityEntity } from './entities/contact/IdentityEntity'
|
|
9
|
+
import { IdentityMetadataItemEntity } from './entities/contact/IdentityMetadataItemEntity'
|
|
10
|
+
import { OpenIdConfigEntity } from './entities/contact/OpenIdConfigEntity'
|
|
11
|
+
import { BackgroundAttributesEntity, backgroundAttributesEntityFrom } from './entities/issuanceBranding/BackgroundAttributesEntity'
|
|
12
|
+
import { CredentialBrandingEntity, credentialBrandingEntityFrom } from './entities/issuanceBranding/CredentialBrandingEntity'
|
|
13
|
+
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from './entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
14
|
+
import { ImageAttributesEntity, imageAttributesEntityFrom } from './entities/issuanceBranding/ImageAttributesEntity'
|
|
15
|
+
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './entities/issuanceBranding/ImageDimensionsEntity'
|
|
16
|
+
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from './entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
17
|
+
import { IssuerBrandingEntity, issuerBrandingEntityFrom } from './entities/issuanceBranding/IssuerBrandingEntity'
|
|
18
|
+
import { TextAttributesEntity, textAttributesEntityFrom } from './entities/issuanceBranding/TextAttributesEntity'
|
|
19
|
+
import { StatusListEntity } from './entities/statusList2021/StatusList2021Entity'
|
|
20
|
+
import { StatusListEntryEntity } from './entities/statusList2021/StatusList2021EntryEntity'
|
|
21
|
+
import { IStatusListEntity, IStatusListEntryEntity } from './types'
|
|
22
|
+
import { PartyRelationshipEntity } from './entities/contact/PartyRelationshipEntity'
|
|
23
|
+
import { PartyTypeEntity } from './entities/contact/PartyTypeEntity'
|
|
24
|
+
import { OrganizationEntity } from './entities/contact/OrganizationEntity'
|
|
25
|
+
import { NaturalPersonEntity } from './entities/contact/NaturalPersonEntity'
|
|
26
|
+
import { ElectronicAddressEntity } from './entities/contact/ElectronicAddressEntity'
|
|
27
|
+
export { ContactStore } from './contact/ContactStore'
|
|
28
|
+
export { AbstractContactStore } from './contact/AbstractContactStore'
|
|
29
|
+
export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'
|
|
30
|
+
export { IssuanceBrandingStore } from './issuanceBranding/IssuanceBrandingStore'
|
|
31
|
+
export { StatusListStore } from './statusList/StatusListStore'
|
|
32
|
+
import { AuditEventEntity, auditEventEntityFrom } from './entities/eventLogger/AuditEventEntity'
|
|
33
|
+
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
34
|
+
export { EventLoggerStore } from './eventLogger/EventLoggerStore'
|
|
35
|
+
export { DataStoreMigrations } from './migrations'
|
|
36
|
+
export * from './types'
|
|
37
|
+
export * from './utils/contact/MappingUtils'
|
|
38
|
+
|
|
39
|
+
export const DataStoreContactEntities = [
|
|
40
|
+
BaseConfigEntity,
|
|
41
|
+
ConnectionEntity,
|
|
42
|
+
PartyEntity,
|
|
43
|
+
IdentityEntity,
|
|
44
|
+
IdentityMetadataItemEntity,
|
|
45
|
+
CorrelationIdentifierEntity,
|
|
46
|
+
DidAuthConfigEntity,
|
|
47
|
+
OpenIdConfigEntity,
|
|
48
|
+
PartyRelationshipEntity,
|
|
49
|
+
PartyTypeEntity,
|
|
50
|
+
BaseContactEntity,
|
|
51
|
+
OrganizationEntity,
|
|
52
|
+
NaturalPersonEntity,
|
|
53
|
+
ElectronicAddressEntity,
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
export const DataStoreIssuanceBrandingEntities = [
|
|
57
|
+
BackgroundAttributesEntity,
|
|
58
|
+
CredentialBrandingEntity,
|
|
59
|
+
ImageAttributesEntity,
|
|
60
|
+
ImageDimensionsEntity,
|
|
61
|
+
BaseLocaleBrandingEntity,
|
|
62
|
+
IssuerBrandingEntity,
|
|
63
|
+
TextAttributesEntity,
|
|
64
|
+
CredentialLocaleBrandingEntity,
|
|
65
|
+
IssuerLocaleBrandingEntity,
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
export const DataStoreStatusListEntities = [StatusListEntity, StatusListEntryEntity]
|
|
69
|
+
|
|
70
|
+
export const DataStoreEventLoggerEntities = [AuditEventEntity]
|
|
71
|
+
|
|
72
|
+
// All entities combined if a party wants to enable them all at once
|
|
73
|
+
export const DataStoreEntities = [
|
|
74
|
+
...DataStoreContactEntities,
|
|
75
|
+
...DataStoreIssuanceBrandingEntities,
|
|
76
|
+
...DataStoreStatusListEntities,
|
|
77
|
+
...DataStoreEventLoggerEntities,
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
BaseConfigEntity,
|
|
82
|
+
ConnectionEntity,
|
|
83
|
+
PartyEntity,
|
|
84
|
+
CorrelationIdentifierEntity,
|
|
85
|
+
DidAuthConfigEntity,
|
|
86
|
+
IdentityEntity,
|
|
87
|
+
IdentityMetadataItemEntity,
|
|
88
|
+
OpenIdConfigEntity,
|
|
89
|
+
BackgroundAttributesEntity,
|
|
90
|
+
CredentialBrandingEntity,
|
|
91
|
+
ImageAttributesEntity,
|
|
92
|
+
ImageDimensionsEntity,
|
|
93
|
+
BaseLocaleBrandingEntity,
|
|
94
|
+
IssuerBrandingEntity,
|
|
95
|
+
TextAttributesEntity,
|
|
96
|
+
CredentialLocaleBrandingEntity,
|
|
97
|
+
IssuerLocaleBrandingEntity,
|
|
98
|
+
ElectronicAddressEntity,
|
|
99
|
+
backgroundAttributesEntityFrom,
|
|
100
|
+
credentialBrandingEntityFrom,
|
|
101
|
+
imageAttributesEntityFrom,
|
|
102
|
+
imageDimensionsEntityFrom,
|
|
103
|
+
issuerBrandingEntityFrom,
|
|
104
|
+
textAttributesEntityFrom,
|
|
105
|
+
issuerLocaleBrandingEntityFrom,
|
|
106
|
+
credentialLocaleBrandingEntityFrom,
|
|
107
|
+
IStatusListEntity,
|
|
108
|
+
IStatusListEntryEntity,
|
|
109
|
+
StatusListEntity,
|
|
110
|
+
StatusListEntryEntity,
|
|
111
|
+
AuditEventEntity,
|
|
112
|
+
auditEventEntityFrom,
|
|
113
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
import Debug from 'debug'
|
|
3
|
-
import { CreateContacts1659463079428 } from '../postgres/1659463079428-CreateContacts'
|
|
4
|
-
import { CreateContacts1659463069549 } from '../sqlite/1659463069549-CreateContacts'
|
|
5
|
-
|
|
6
|
-
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
-
|
|
8
|
-
export class CreateContacts1659463079429 implements MigrationInterface {
|
|
9
|
-
name = 'CreateContacts1659463079429'
|
|
10
|
-
|
|
11
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
-
debug('migration: creating contacts tables')
|
|
13
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
-
|
|
15
|
-
switch (dbType) {
|
|
16
|
-
case 'postgres': {
|
|
17
|
-
debug('using postgres migration file')
|
|
18
|
-
const mig: CreateContacts1659463079428 = new CreateContacts1659463079428()
|
|
19
|
-
await mig.up(queryRunner)
|
|
20
|
-
debug('Migration statements executed')
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
case 'sqlite':
|
|
24
|
-
case 'expo':
|
|
25
|
-
case 'react-native': {
|
|
26
|
-
debug('using sqlite/react-native migration file')
|
|
27
|
-
const mig: CreateContacts1659463069549 = new CreateContacts1659463069549()
|
|
28
|
-
await mig.up(queryRunner)
|
|
29
|
-
debug('Migration statements executed')
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
default:
|
|
33
|
-
return Promise.reject(
|
|
34
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
40
|
-
debug('migration: reverting contacts tables')
|
|
41
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
42
|
-
|
|
43
|
-
switch (dbType) {
|
|
44
|
-
case 'postgres': {
|
|
45
|
-
debug('using postgres migration file')
|
|
46
|
-
const mig: CreateContacts1659463079428 = new CreateContacts1659463079428()
|
|
47
|
-
await mig.down(queryRunner)
|
|
48
|
-
debug('Migration statements executed')
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
case 'sqlite':
|
|
52
|
-
case 'expo':
|
|
53
|
-
case 'react-native': {
|
|
54
|
-
debug('using sqlite/react-native migration file')
|
|
55
|
-
const mig: CreateContacts1659463069549 = new CreateContacts1659463069549()
|
|
56
|
-
await mig.down(queryRunner)
|
|
57
|
-
debug('Migration statements executed')
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
default:
|
|
61
|
-
return Promise.reject(
|
|
62
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateContacts1659463079428 } from '../postgres/1659463079428-CreateContacts'
|
|
4
|
+
import { CreateContacts1659463069549 } from '../sqlite/1659463069549-CreateContacts'
|
|
5
|
+
|
|
6
|
+
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
+
|
|
8
|
+
export class CreateContacts1659463079429 implements MigrationInterface {
|
|
9
|
+
name = 'CreateContacts1659463079429'
|
|
10
|
+
|
|
11
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
debug('migration: creating contacts tables')
|
|
13
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
+
|
|
15
|
+
switch (dbType) {
|
|
16
|
+
case 'postgres': {
|
|
17
|
+
debug('using postgres migration file')
|
|
18
|
+
const mig: CreateContacts1659463079428 = new CreateContacts1659463079428()
|
|
19
|
+
await mig.up(queryRunner)
|
|
20
|
+
debug('Migration statements executed')
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
case 'sqlite':
|
|
24
|
+
case 'expo':
|
|
25
|
+
case 'react-native': {
|
|
26
|
+
debug('using sqlite/react-native migration file')
|
|
27
|
+
const mig: CreateContacts1659463069549 = new CreateContacts1659463069549()
|
|
28
|
+
await mig.up(queryRunner)
|
|
29
|
+
debug('Migration statements executed')
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
default:
|
|
33
|
+
return Promise.reject(
|
|
34
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
40
|
+
debug('migration: reverting contacts tables')
|
|
41
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
42
|
+
|
|
43
|
+
switch (dbType) {
|
|
44
|
+
case 'postgres': {
|
|
45
|
+
debug('using postgres migration file')
|
|
46
|
+
const mig: CreateContacts1659463079428 = new CreateContacts1659463079428()
|
|
47
|
+
await mig.down(queryRunner)
|
|
48
|
+
debug('Migration statements executed')
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
case 'sqlite':
|
|
52
|
+
case 'expo':
|
|
53
|
+
case 'react-native': {
|
|
54
|
+
debug('using sqlite/react-native migration file')
|
|
55
|
+
const mig: CreateContacts1659463069549 = new CreateContacts1659463069549()
|
|
56
|
+
await mig.down(queryRunner)
|
|
57
|
+
debug('Migration statements executed')
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
return Promise.reject(
|
|
62
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
import Debug from 'debug'
|
|
3
|
-
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
|
-
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
|
-
|
|
6
|
-
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
-
|
|
8
|
-
export class CreateIssuanceBranding1659463079429 implements MigrationInterface {
|
|
9
|
-
name = 'CreateIssuanceBranding1659463079429'
|
|
10
|
-
|
|
11
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
-
debug('migration: creating issuance branding tables')
|
|
13
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
-
switch (dbType) {
|
|
15
|
-
case 'postgres': {
|
|
16
|
-
debug('using postgres migration file')
|
|
17
|
-
const mig: CreateIssuanceBranding1685628974232 = new CreateIssuanceBranding1685628974232()
|
|
18
|
-
await mig.up(queryRunner)
|
|
19
|
-
debug('Migration statements executed')
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
case 'sqlite':
|
|
23
|
-
case 'expo':
|
|
24
|
-
case 'react-native': {
|
|
25
|
-
debug('using sqlite/react-native migration file')
|
|
26
|
-
const mig: CreateIssuanceBranding1685628973231 = new CreateIssuanceBranding1685628973231()
|
|
27
|
-
await mig.up(queryRunner)
|
|
28
|
-
debug('Migration statements executed')
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
default:
|
|
32
|
-
return Promise.reject(
|
|
33
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
39
|
-
debug('migration: reverting issuance branding tables')
|
|
40
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
41
|
-
switch (dbType) {
|
|
42
|
-
case 'postgres': {
|
|
43
|
-
debug('using postgres migration file')
|
|
44
|
-
const mig: CreateIssuanceBranding1685628974232 = new CreateIssuanceBranding1685628974232()
|
|
45
|
-
await mig.down(queryRunner)
|
|
46
|
-
debug('Migration statements executed')
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
case 'sqlite':
|
|
50
|
-
case 'expo':
|
|
51
|
-
case 'react-native': {
|
|
52
|
-
debug('using sqlite/react-native migration file')
|
|
53
|
-
const mig: CreateIssuanceBranding1685628973231 = new CreateIssuanceBranding1685628973231()
|
|
54
|
-
await mig.down(queryRunner)
|
|
55
|
-
debug('Migration statements executed')
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
default:
|
|
59
|
-
return Promise.reject(
|
|
60
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
|
+
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
|
+
|
|
6
|
+
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
+
|
|
8
|
+
export class CreateIssuanceBranding1659463079429 implements MigrationInterface {
|
|
9
|
+
name = 'CreateIssuanceBranding1659463079429'
|
|
10
|
+
|
|
11
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
debug('migration: creating issuance branding tables')
|
|
13
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
+
switch (dbType) {
|
|
15
|
+
case 'postgres': {
|
|
16
|
+
debug('using postgres migration file')
|
|
17
|
+
const mig: CreateIssuanceBranding1685628974232 = new CreateIssuanceBranding1685628974232()
|
|
18
|
+
await mig.up(queryRunner)
|
|
19
|
+
debug('Migration statements executed')
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
case 'sqlite':
|
|
23
|
+
case 'expo':
|
|
24
|
+
case 'react-native': {
|
|
25
|
+
debug('using sqlite/react-native migration file')
|
|
26
|
+
const mig: CreateIssuanceBranding1685628973231 = new CreateIssuanceBranding1685628973231()
|
|
27
|
+
await mig.up(queryRunner)
|
|
28
|
+
debug('Migration statements executed')
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
return Promise.reject(
|
|
33
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
39
|
+
debug('migration: reverting issuance branding tables')
|
|
40
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
41
|
+
switch (dbType) {
|
|
42
|
+
case 'postgres': {
|
|
43
|
+
debug('using postgres migration file')
|
|
44
|
+
const mig: CreateIssuanceBranding1685628974232 = new CreateIssuanceBranding1685628974232()
|
|
45
|
+
await mig.down(queryRunner)
|
|
46
|
+
debug('Migration statements executed')
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
case 'sqlite':
|
|
50
|
+
case 'expo':
|
|
51
|
+
case 'react-native': {
|
|
52
|
+
debug('using sqlite/react-native migration file')
|
|
53
|
+
const mig: CreateIssuanceBranding1685628973231 = new CreateIssuanceBranding1685628973231()
|
|
54
|
+
await mig.down(queryRunner)
|
|
55
|
+
debug('Migration statements executed')
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
return Promise.reject(
|
|
60
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
import Debug from 'debug'
|
|
3
|
-
import { CreateContacts1690925872693 } from '../sqlite/1690925872693-CreateContacts'
|
|
4
|
-
import { CreateContacts1690925872592 } from '../postgres/1690925872592-CreateContacts'
|
|
5
|
-
|
|
6
|
-
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
-
|
|
8
|
-
export class CreateContacts1690925872318 implements MigrationInterface {
|
|
9
|
-
name = 'CreateContacts1690925872318'
|
|
10
|
-
|
|
11
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
-
debug('migration: creating contacts tables')
|
|
13
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
-
|
|
15
|
-
switch (dbType) {
|
|
16
|
-
case 'postgres': {
|
|
17
|
-
debug('using postgres migration file')
|
|
18
|
-
const mig: CreateContacts1690925872592 = new CreateContacts1690925872592()
|
|
19
|
-
await mig.up(queryRunner)
|
|
20
|
-
debug('Migration statements executed')
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
case 'sqlite':
|
|
24
|
-
case 'expo':
|
|
25
|
-
case 'react-native': {
|
|
26
|
-
debug('using sqlite/react-native migration file')
|
|
27
|
-
const mig: CreateContacts1690925872693 = new CreateContacts1690925872693()
|
|
28
|
-
await mig.up(queryRunner)
|
|
29
|
-
debug('Migration statements executed')
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
default:
|
|
33
|
-
return Promise.reject(
|
|
34
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
40
|
-
debug('migration: reverting contacts tables')
|
|
41
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
42
|
-
|
|
43
|
-
switch (dbType) {
|
|
44
|
-
case 'postgres': {
|
|
45
|
-
debug('using postgres migration file')
|
|
46
|
-
const mig: CreateContacts1690925872592 = new CreateContacts1690925872592()
|
|
47
|
-
await mig.down(queryRunner)
|
|
48
|
-
debug('Migration statements executed')
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
case 'sqlite':
|
|
52
|
-
case 'expo':
|
|
53
|
-
case 'react-native': {
|
|
54
|
-
debug('using sqlite/react-native migration file')
|
|
55
|
-
const mig: CreateContacts1690925872693 = new CreateContacts1690925872693()
|
|
56
|
-
await mig.down(queryRunner)
|
|
57
|
-
debug('Migration statements executed')
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
default:
|
|
61
|
-
return Promise.reject(
|
|
62
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateContacts1690925872693 } from '../sqlite/1690925872693-CreateContacts'
|
|
4
|
+
import { CreateContacts1690925872592 } from '../postgres/1690925872592-CreateContacts'
|
|
5
|
+
|
|
6
|
+
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
+
|
|
8
|
+
export class CreateContacts1690925872318 implements MigrationInterface {
|
|
9
|
+
name = 'CreateContacts1690925872318'
|
|
10
|
+
|
|
11
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
debug('migration: creating contacts tables')
|
|
13
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
14
|
+
|
|
15
|
+
switch (dbType) {
|
|
16
|
+
case 'postgres': {
|
|
17
|
+
debug('using postgres migration file')
|
|
18
|
+
const mig: CreateContacts1690925872592 = new CreateContacts1690925872592()
|
|
19
|
+
await mig.up(queryRunner)
|
|
20
|
+
debug('Migration statements executed')
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
case 'sqlite':
|
|
24
|
+
case 'expo':
|
|
25
|
+
case 'react-native': {
|
|
26
|
+
debug('using sqlite/react-native migration file')
|
|
27
|
+
const mig: CreateContacts1690925872693 = new CreateContacts1690925872693()
|
|
28
|
+
await mig.up(queryRunner)
|
|
29
|
+
debug('Migration statements executed')
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
default:
|
|
33
|
+
return Promise.reject(
|
|
34
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
40
|
+
debug('migration: reverting contacts tables')
|
|
41
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
42
|
+
|
|
43
|
+
switch (dbType) {
|
|
44
|
+
case 'postgres': {
|
|
45
|
+
debug('using postgres migration file')
|
|
46
|
+
const mig: CreateContacts1690925872592 = new CreateContacts1690925872592()
|
|
47
|
+
await mig.down(queryRunner)
|
|
48
|
+
debug('Migration statements executed')
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
case 'sqlite':
|
|
52
|
+
case 'expo':
|
|
53
|
+
case 'react-native': {
|
|
54
|
+
debug('using sqlite/react-native migration file')
|
|
55
|
+
const mig: CreateContacts1690925872693 = new CreateContacts1690925872693()
|
|
56
|
+
await mig.down(queryRunner)
|
|
57
|
+
debug('Migration statements executed')
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
return Promise.reject(
|
|
62
|
+
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|