@sphereon/ssi-sdk.data-store 0.34.1-feature.FIDES.1.274 → 0.34.1-feature.IDK.11.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3844 -3819
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1270 -339
- package/dist/index.d.ts +1270 -339
- package/dist/index.js +3791 -3766
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
- package/src/__tests__/contact.entities.test.ts +10 -4
- package/src/__tests__/contact.store.test.ts +6 -11
- package/src/__tests__/digitalCredential.entities.test.ts +6 -13
- package/src/__tests__/digitalCredential.store.test.ts +6 -6
- package/src/__tests__/eventLogger.entities.test.ts +3 -3
- package/src/__tests__/eventLogger.store.test.ts +4 -9
- package/src/__tests__/issuanceBranding.entities.test.ts +2 -2
- package/src/__tests__/issuanceBranding.store.test.ts +3 -3
- package/src/__tests__/machineState.entities.test.ts +1 -1
- package/src/__tests__/machineState.store.test.ts +1 -1
- package/src/__tests__/pd-manager.entities.test.ts +98 -27
- package/src/__tests__/pd-manager.store.test.ts +101 -151
- package/src/__tests__/statusList.entities.test.ts +4 -4
- package/src/__tests__/statusList.store.test.ts +3 -3
- package/src/contact/AbstractContactStore.ts +71 -0
- package/src/contact/ContactStore.ts +35 -35
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +21 -0
- package/src/digitalCredential/DigitalCredentialStore.ts +7 -6
- package/src/entities/contact/BaseConfigEntity.ts +2 -2
- package/src/entities/contact/BaseContactEntity.ts +5 -4
- package/src/entities/contact/ConnectionEntity.ts +4 -4
- package/src/entities/contact/ContactMetadataItemEntity.ts +4 -3
- package/src/entities/contact/CorrelationIdentifierEntity.ts +4 -3
- package/src/entities/contact/DidAuthConfigEntity.ts +2 -1
- package/src/entities/contact/ElectronicAddressEntity.ts +5 -15
- package/src/entities/contact/IdentityEntity.ts +11 -12
- package/src/entities/contact/IdentityMetadataItemEntity.ts +3 -3
- package/src/entities/contact/NaturalPersonEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +1 -1
- package/src/entities/contact/PartyEntity.ts +7 -7
- package/src/entities/contact/PartyRelationshipEntity.ts +8 -8
- package/src/entities/contact/PartyTypeEntity.ts +4 -4
- package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +3 -4
- package/src/entities/eventLogger/AuditEventEntity.ts +2 -2
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +7 -6
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +1 -1
- package/src/entities/presentationDefinition/{DcqlQueryItemEntity.ts → PresentationDefinitionItemEntity.ts} +14 -10
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +1 -1
- package/src/entities/statusList/StatusListEntities.ts +4 -3
- package/src/eventLogger/AbstractEventLoggerStore.ts +9 -0
- package/src/eventLogger/EventLoggerStore.ts +2 -2
- package/src/index.ts +26 -21
- package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +41 -0
- package/src/issuanceBranding/IssuanceBrandingStore.ts +25 -25
- package/src/machineState/IAbstractMachineStateStore.ts +65 -0
- package/src/machineState/MachineStateStore.ts +7 -7
- package/src/migrations/generic/1-CreateContacts.ts +1 -1
- package/src/migrations/generic/10-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +2 -2
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +2 -32
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/generic/3-CreateContacts.ts +2 -2
- package/src/migrations/generic/4-CreateStatusList.ts +1 -1
- package/src/migrations/generic/5-CreateAuditEvents.ts +2 -2
- package/src/migrations/generic/6-CreateDigitalCredential.ts +1 -1
- package/src/migrations/generic/7-CreateMachineStateStore.ts +1 -1
- package/src/migrations/generic/8-CreateContacts.ts +1 -1
- package/src/migrations/generic/9-CreateContacts.ts +1 -1
- package/src/migrations/generic/index.ts +5 -10
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/postgres/1737110469001-UpdateStatusList.ts +1 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +2 -15
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +1 -1
- package/src/presentationDefinition/AbstractPDStore.ts +20 -0
- package/src/presentationDefinition/PDStore.ts +45 -45
- package/src/statusList/IStatusListStore.ts +1 -1
- package/src/statusList/StatusListStore.ts +3 -3
- package/src/types/contact/IAbstractContactStore.ts +161 -0
- package/src/types/contact/contact.ts +295 -0
- package/src/types/contact/index.ts +2 -0
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +43 -0
- package/src/types/digitalCredential/enums.ts +70 -0
- package/src/types/digitalCredential/index.ts +3 -0
- package/src/types/digitalCredential/types.ts +39 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +22 -0
- package/src/types/eventLogger/eventLogger.ts +4 -0
- package/src/types/index.ts +12 -0
- package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +85 -0
- package/src/types/issuanceBranding/issuanceBranding.ts +138 -0
- package/src/types/machineState/IAbstractMachineStateStore.ts +68 -0
- package/src/types/presentationDefinition/IAbstractPDStore.ts +25 -0
- package/src/types/presentationDefinition/presentationDefinition.ts +19 -0
- package/src/types/statusList/IAbstractStatusListStore.ts +9 -9
- package/src/types/validation/validation.ts +3 -0
- package/src/utils/ValidatorUtils.ts +1 -1
- package/src/utils/contact/MappingUtils.ts +10 -10
- package/src/utils/digitalCredential/MappingUtils.ts +21 -3
- package/src/utils/eventLogger/MappingUtils.ts +2 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +13 -13
- package/src/utils/presentationDefinition/MappingUtils.ts +22 -31
- package/src/utils/statusList/MappingUtils.ts +1 -1
- package/src/migrations/generic/13-CreateDcqlQueryItem.ts +0 -67
- package/src/migrations/postgres/1726588800000-CreateDcqlQueryItem.ts +0 -25
- package/src/migrations/sqlite/1726617600000-CreateDcqlQueryItem.ts +0 -24
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
import { type OrPromise } from '@sphereon/ssi-types'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { DataSource, type DeleteResult, In, Not, type Repository } from 'typeorm'
|
|
4
|
+
import {
|
|
5
|
+
credentialBrandingEntityFrom,
|
|
6
|
+
credentialBrandingFrom,
|
|
7
|
+
credentialLocaleBrandingEntityFrom,
|
|
8
|
+
issuerBrandingEntityFrom,
|
|
9
|
+
issuerBrandingFrom,
|
|
10
|
+
issuerLocaleBrandingEntityFrom,
|
|
11
|
+
localeBrandingFrom,
|
|
12
|
+
} from '../utils/issuanceBranding/MappingUtils'
|
|
13
|
+
import { BackgroundAttributesEntity } from '../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
14
|
+
import { ImageAttributesEntity } from '../entities/issuanceBranding/ImageAttributesEntity'
|
|
15
|
+
import { ImageDimensionsEntity } from '../entities/issuanceBranding/ImageDimensionsEntity'
|
|
16
|
+
import { IssuerBrandingEntity } from '../entities/issuanceBranding/IssuerBrandingEntity'
|
|
17
|
+
import { CredentialBrandingEntity } from '../entities/issuanceBranding/CredentialBrandingEntity'
|
|
18
|
+
import { CredentialLocaleBrandingEntity } from '../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
19
|
+
import { IssuerLocaleBrandingEntity } from '../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
20
|
+
import { BaseLocaleBrandingEntity } from '../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
21
|
+
import { TextAttributesEntity } from '../entities/issuanceBranding/TextAttributesEntity'
|
|
22
|
+
import { AbstractIssuanceBrandingStore } from './AbstractIssuanceBrandingStore'
|
|
1
23
|
import type {
|
|
2
24
|
IAddCredentialBrandingArgs,
|
|
3
25
|
IAddCredentialLocaleBrandingArgs,
|
|
@@ -6,7 +28,7 @@ import type {
|
|
|
6
28
|
IBasicCredentialLocaleBranding,
|
|
7
29
|
IBasicIssuerLocaleBranding,
|
|
8
30
|
ICredentialBranding,
|
|
9
|
-
|
|
31
|
+
IPartialCredentialBranding,
|
|
10
32
|
ICredentialLocaleBranding,
|
|
11
33
|
ICredentialLocaleBrandingFilter,
|
|
12
34
|
IGetCredentialBrandingArgs,
|
|
@@ -17,7 +39,6 @@ import type {
|
|
|
17
39
|
IIssuerBrandingFilter,
|
|
18
40
|
IIssuerLocaleBranding,
|
|
19
41
|
IIssuerLocaleBrandingFilter,
|
|
20
|
-
IPartialCredentialBranding,
|
|
21
42
|
IRemoveCredentialBrandingArgs,
|
|
22
43
|
IRemoveCredentialLocaleBrandingArgs,
|
|
23
44
|
IRemoveIssuerBrandingArgs,
|
|
@@ -26,29 +47,8 @@ import type {
|
|
|
26
47
|
IUpdateCredentialLocaleBrandingArgs,
|
|
27
48
|
IUpdateIssuerBrandingArgs,
|
|
28
49
|
IUpdateIssuerLocaleBrandingArgs,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { type OrPromise } from '@sphereon/ssi-types'
|
|
32
|
-
import Debug from 'debug'
|
|
33
|
-
import { DataSource, type DeleteResult, In, Not, type Repository } from 'typeorm'
|
|
34
|
-
import { BackgroundAttributesEntity } from '../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
35
|
-
import { BaseLocaleBrandingEntity } from '../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
36
|
-
import { CredentialBrandingEntity } from '../entities/issuanceBranding/CredentialBrandingEntity'
|
|
37
|
-
import { CredentialLocaleBrandingEntity } from '../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
38
|
-
import { ImageAttributesEntity } from '../entities/issuanceBranding/ImageAttributesEntity'
|
|
39
|
-
import { ImageDimensionsEntity } from '../entities/issuanceBranding/ImageDimensionsEntity'
|
|
40
|
-
import { IssuerBrandingEntity } from '../entities/issuanceBranding/IssuerBrandingEntity'
|
|
41
|
-
import { IssuerLocaleBrandingEntity } from '../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
42
|
-
import { TextAttributesEntity } from '../entities/issuanceBranding/TextAttributesEntity'
|
|
43
|
-
import {
|
|
44
|
-
credentialBrandingEntityFrom,
|
|
45
|
-
credentialBrandingFrom,
|
|
46
|
-
credentialLocaleBrandingEntityFrom,
|
|
47
|
-
issuerBrandingEntityFrom,
|
|
48
|
-
issuerBrandingFrom,
|
|
49
|
-
issuerLocaleBrandingEntityFrom,
|
|
50
|
-
localeBrandingFrom,
|
|
51
|
-
} from '../utils/issuanceBranding/MappingUtils'
|
|
50
|
+
ICredentialBrandingFilter,
|
|
51
|
+
} from '../types'
|
|
52
52
|
|
|
53
53
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:issuance-branding-store')
|
|
54
54
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
StoreMachineStateDeleteExpiredArgs,
|
|
3
|
+
StoreMachineStateDeleteArgs,
|
|
4
|
+
StoreMachineStatesFindActiveArgs,
|
|
5
|
+
StoreFindMachineStatesArgs,
|
|
6
|
+
StoreMachineStatePersistArgs,
|
|
7
|
+
StoreMachineStateInfo,
|
|
8
|
+
StoreMachineStateGetArgs,
|
|
9
|
+
} from '../types'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an abstract class for storing machine states.
|
|
13
|
+
* This class provides methods for persisting, retrieving, and deleting machine states.
|
|
14
|
+
*
|
|
15
|
+
* @interface
|
|
16
|
+
*/
|
|
17
|
+
export abstract class IAbstractMachineStateStore {
|
|
18
|
+
/**
|
|
19
|
+
* Persists the machine state.
|
|
20
|
+
*
|
|
21
|
+
* @param {StoreMachineStatePersistArgs} state - The object containing the machine state to persist.
|
|
22
|
+
* @return {Promise<StoreMachineStateInfo>} - A Promise that resolves to the information about the persisted machine state.
|
|
23
|
+
*/
|
|
24
|
+
abstract persistMachineState(state: StoreMachineStatePersistArgs): Promise<StoreMachineStateInfo>
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Finds active machine states based on the given arguments.
|
|
28
|
+
*
|
|
29
|
+
* @param {StoreMachineStatesFindActiveArgs} args - The arguments for finding active machine states.
|
|
30
|
+
* @return {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves with an array of active machine states.
|
|
31
|
+
*/
|
|
32
|
+
abstract findActiveMachineStates(args: StoreMachineStatesFindActiveArgs): Promise<Array<StoreMachineStateInfo>>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the state of a particular machine.
|
|
36
|
+
*
|
|
37
|
+
* @param {StoreMachineStateGetArgs} args - The arguments for retrieving the machine state.
|
|
38
|
+
* @returns {Promise<StoreMachineStateInfo>} - A promise that resolves to the machine state information.
|
|
39
|
+
*/
|
|
40
|
+
abstract getMachineState(args: StoreMachineStateGetArgs): Promise<StoreMachineStateInfo>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Finds the machine states based on the given arguments.
|
|
44
|
+
*
|
|
45
|
+
* @param {StoreFindMachineStatesArgs} [args] - The arguments to filter the machine states.
|
|
46
|
+
* @returns {Promise<Array<StoreMachineStateInfo>>} - A promise that resolves to an array of machine state information.
|
|
47
|
+
*/
|
|
48
|
+
abstract findMachineStates(args?: StoreFindMachineStatesArgs): Promise<Array<StoreMachineStateInfo>>
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a machine state.
|
|
52
|
+
*
|
|
53
|
+
* @param {StoreMachineStateDeleteArgs} args - The arguments for deleting the machine state.
|
|
54
|
+
* @return {Promise<boolean>} - A promise that resolves to a boolean indicating if the machine state was successfully deleted or not.
|
|
55
|
+
*/
|
|
56
|
+
abstract deleteMachineState(args: StoreMachineStateDeleteArgs): Promise<boolean>
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Deletes expired machine states from the database.
|
|
60
|
+
*
|
|
61
|
+
* @param {StoreMachineStateDeleteExpiredArgs} args - The arguments for deleting expired machine states.
|
|
62
|
+
* @return {Promise<number>} - A promise that resolves to the number of deleted machine states.
|
|
63
|
+
*/
|
|
64
|
+
abstract deleteExpiredMachineStates(args: StoreMachineStateDeleteExpiredArgs): Promise<number>
|
|
65
|
+
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { type OrPromise } from '@sphereon/ssi-types'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { Brackets, DataSource, type FindOptionsWhere, IsNull, LessThan, Not } from 'typeorm'
|
|
4
|
+
|
|
5
|
+
import { MachineStateInfoEntity } from '../entities/machineState/MachineStateInfoEntity'
|
|
1
6
|
import type {
|
|
2
7
|
StoreFindMachineStatesArgs,
|
|
3
8
|
StoreMachineStateDeleteArgs,
|
|
@@ -6,13 +11,8 @@ import type {
|
|
|
6
11
|
StoreMachineStateInfo,
|
|
7
12
|
StoreMachineStatePersistArgs,
|
|
8
13
|
StoreMachineStatesFindActiveArgs,
|
|
9
|
-
} from '
|
|
10
|
-
import { IAbstractMachineStateStore } from '
|
|
11
|
-
import { type OrPromise } from '@sphereon/ssi-types'
|
|
12
|
-
import Debug from 'debug'
|
|
13
|
-
import { Brackets, DataSource, type FindOptionsWhere, IsNull, LessThan, Not } from 'typeorm'
|
|
14
|
-
|
|
15
|
-
import { MachineStateInfoEntity } from '../entities/machineState/MachineStateInfoEntity'
|
|
14
|
+
} from '../types'
|
|
15
|
+
import { IAbstractMachineStateStore } from './IAbstractMachineStateStore'
|
|
16
16
|
|
|
17
17
|
const debug = Debug('sphereon:ssi-sdk:machine-state:store')
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateContacts1659463079428 } from '../postgres/1659463079428-CreateContacts'
|
|
4
4
|
import { CreateContacts1659463069549 } from '../sqlite/1659463069549-CreateContacts'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreatePresentationDefinitions1716475165345 } from '../postgres/1716475165345-CreatePresentationDefinitions'
|
|
4
4
|
import { CreatePresentationDefinitions1716475165344 } from '../sqlite/1716475165344-CreatePresentationDefinitions'
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
|
-
import { FixCredentialClaimsReferencesUuidPG1741895822987 } from '../postgres/1741895822987-FixCredentialClaimsReferencesUuid'
|
|
5
4
|
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
|
+
import { FixCredentialClaimsReferencesUuidPG1741895822987 } from '../postgres/1741895822987-FixCredentialClaimsReferencesUuid'
|
|
6
6
|
import { FixCredentialClaimsReferencesUuidSqlite1741895822987 } from '../sqlite/1741895822987-FixCredentialClaimsReferencesUuid'
|
|
7
7
|
|
|
8
8
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
@@ -1,40 +1,10 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
AddBitstringStatusListEnumPG1741895823000,
|
|
6
|
-
CreateBitstringStatusListPG1741895823000,
|
|
7
|
-
} from '../postgres/1741895823000-CreateBitstringStatusList'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateBitstringStatusListPG1741895823000 } from '../postgres/1741895823000-CreateBitstringStatusList'
|
|
8
4
|
import { CreateBitstringStatusListSqlite1741895823001 } from '../sqlite/1741895823001-CreateBitstringStatusList'
|
|
9
5
|
|
|
10
6
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
11
7
|
|
|
12
|
-
export class AddBitstringStatusListEnum1741895823000 implements MigrationInterface {
|
|
13
|
-
name = 'AddBitstringStatusListEnum1741895823000'
|
|
14
|
-
|
|
15
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
16
|
-
debug('migration: creating bitstring status list tables')
|
|
17
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
18
|
-
switch (dbType) {
|
|
19
|
-
case 'postgres': {
|
|
20
|
-
const mig = new AddBitstringStatusListEnumPG1741895823000()
|
|
21
|
-
await mig.up(queryRunner)
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
case 'sqlite':
|
|
25
|
-
case 'expo':
|
|
26
|
-
case 'react-native': {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
default:
|
|
30
|
-
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
-
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
8
|
export class CreateBitstringStatusList1741895823000 implements MigrationInterface {
|
|
39
9
|
name = 'CreateBitstringStatusList1741895823000'
|
|
40
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
4
|
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
|
-
import
|
|
2
|
+
import Debug from 'debug'
|
|
4
3
|
import { CreateContacts1690925872693 } from '../sqlite/1690925872693-CreateContacts'
|
|
4
|
+
import { CreateContacts1690925872592 } from '../postgres/1690925872592-CreateContacts'
|
|
5
5
|
|
|
6
6
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Debug from 'debug'
|
|
2
2
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
3
|
import { CreateStatusList1693866470001 } from '../postgres/1693866470001-CreateStatusList'
|
|
4
|
-
import { UpdateStatusList1737110469001 } from '../postgres/1737110469001-UpdateStatusList'
|
|
5
4
|
import { CreateStatusList1693866470002 } from '../sqlite/1693866470000-CreateStatusList'
|
|
5
|
+
import { UpdateStatusList1737110469001 } from '../postgres/1737110469001-UpdateStatusList'
|
|
6
6
|
import { UpdateStatusList1737110469000 } from '../sqlite/1737110469000-UpdateStatusList'
|
|
7
7
|
|
|
8
8
|
const debug = Debug('sphereon:ssi-sdk:migrations')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Debug, { Debugger } from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
|
-
import {
|
|
2
|
+
import Debug, { Debugger } from 'debug'
|
|
4
3
|
import { CreateAuditEvents1701634819487 } from '../sqlite/1701634819487-CreateAuditEvents'
|
|
4
|
+
import { CreateAuditEvents1701634812183 } from '../postgres/1701634812183-CreateAuditEvents'
|
|
5
5
|
|
|
6
6
|
const debug: Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug, { Debugger } from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug, { Debugger } from 'debug'
|
|
3
3
|
import { CreateDigitalCredential1708525189001 } from '../postgres/1708525189001-CreateDigitalCredential'
|
|
4
4
|
import { CreateDigitalCredential1708525189002 } from '../sqlite/1708525189002-CreateDigitalCredential'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateMachineStateStore1708797018115 } from '../postgres/1708797018115-CreateMachineStateStore'
|
|
4
4
|
import { CreateMachineStateStore1708796002272 } from '../sqlite/1708796002272-CreateMachineStateStore'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateContacts1710438363001 } from '../postgres/1710438363001-CreateContacts'
|
|
4
4
|
import { CreateContacts1710438363002 } from '../sqlite/1710438363002-CreateContacts'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
1
|
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
3
|
import { CreateContacts1715761125001 } from '../postgres/1715761125001-CreateContacts'
|
|
4
4
|
import { CreateContacts1715761125002 } from '../sqlite/1715761125002-CreateContacts'
|
|
5
5
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { CreateContacts1659463079429 } from './1-CreateContacts'
|
|
2
|
-
import { CreatePresentationDefinitions1716533767523 } from './10-CreatePresentationDefinitions'
|
|
3
|
-
import { FixCredentialClaimsReferencesUuid1741895822987 } from './11-FixCredentialClaimsReferenceUuid'
|
|
4
|
-
import { AddBitstringStatusListEnum1741895823000, CreateBitstringStatusList1741895823000 } from './12-CreateBitstringStatusList'
|
|
5
|
-
import { CreateDcqlQueryItem1726617600000 } from './13-CreateDcqlQueryItem'
|
|
6
2
|
import { CreateIssuanceBranding1659463079429 } from './2-CreateIssuanceBranding'
|
|
7
3
|
import { CreateContacts1690925872318 } from './3-CreateContacts'
|
|
8
4
|
import { CreateStatusList1693866470000 } from './4-CreateStatusList'
|
|
@@ -11,6 +7,9 @@ import { CreateDigitalCredential1708525189000 } from './6-CreateDigitalCredentia
|
|
|
11
7
|
import { CreateMachineStateStore1708098041262 } from './7-CreateMachineStateStore'
|
|
12
8
|
import { CreateContacts1708525189000 } from './8-CreateContacts'
|
|
13
9
|
import { CreateContacts1715761125000 } from './9-CreateContacts'
|
|
10
|
+
import { CreatePresentationDefinitions1716533767523 } from './10-CreatePresentationDefinitions'
|
|
11
|
+
import { FixCredentialClaimsReferencesUuid1741895822987 } from './11-FixCredentialClaimsReferenceUuid'
|
|
12
|
+
import { CreateBitstringStatusList1741895823000 } from './12-CreateBitstringStatusList'
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
@@ -28,15 +27,11 @@ export const DataStoreContactMigrations = [
|
|
|
28
27
|
CreateContacts1715761125000,
|
|
29
28
|
]
|
|
30
29
|
export const DataStoreIssuanceBrandingMigrations = [CreateIssuanceBranding1659463079429, FixCredentialClaimsReferencesUuid1741895822987]
|
|
31
|
-
export const DataStoreStatusListMigrations = [
|
|
32
|
-
CreateStatusList1693866470000,
|
|
33
|
-
AddBitstringStatusListEnum1741895823000,
|
|
34
|
-
CreateBitstringStatusList1741895823000,
|
|
35
|
-
]
|
|
30
|
+
export const DataStoreStatusListMigrations = [CreateStatusList1693866470000, CreateBitstringStatusList1741895823000]
|
|
36
31
|
export const DataStoreEventLoggerMigrations = [CreateAuditEvents1701635835330]
|
|
37
32
|
export const DataStoreDigitalCredentialMigrations = [CreateDigitalCredential1708525189000]
|
|
38
33
|
export const DataStoreMachineStateMigrations = [CreateMachineStateStore1708098041262]
|
|
39
|
-
export const DataStorePresentationDefinitionMigrations = [CreatePresentationDefinitions1716533767523
|
|
34
|
+
export const DataStorePresentationDefinitionMigrations = [CreatePresentationDefinitions1716533767523]
|
|
40
35
|
|
|
41
36
|
// All migrations together
|
|
42
37
|
export const DataStoreMigrations = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
2
1
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
|
|
4
4
|
export class CreateContacts1659463079428 implements MigrationInterface {
|
|
5
5
|
name = 'CreateContacts1659463079428'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
2
1
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
|
|
4
4
|
export class CreateIssuanceBranding1685628974232 implements MigrationInterface {
|
|
5
5
|
name = 'CreateIssuanceBranding1685628974232'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
2
1
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
|
|
4
4
|
export class CreateContacts1690925872592 implements MigrationInterface {
|
|
5
5
|
name = 'CreateContacts1690925872592'
|
|
@@ -13,7 +13,7 @@ CREATE TABLE "PresentationDefinitionItem" (
|
|
|
13
13
|
"version" TEXT NOT NULL,
|
|
14
14
|
"purpose" TEXT,
|
|
15
15
|
"definition_payload" TEXT NOT NULL,
|
|
16
|
-
"
|
|
16
|
+
"dcql_payload" TEXT,
|
|
17
17
|
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
18
18
|
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
19
19
|
CONSTRAINT "PK_PresentationDefinitionItem_id" PRIMARY KEY ("id"))
|
|
@@ -10,7 +10,7 @@ export class UpdateStatusList1737110469001 implements MigrationInterface {
|
|
|
10
10
|
// Make columns nullable and add new columns
|
|
11
11
|
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" DROP NOT NULL`)
|
|
12
12
|
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" DROP NOT NULL`)
|
|
13
|
-
await queryRunner.query(`ALTER TABLE "StatusList" ADD "bitsPerStatus" integer
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD "bitsPerStatus" integer`)
|
|
14
14
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD "expiresAt" timestamp with time zone`)
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
2
|
|
|
3
|
-
export class AddBitstringStatusListEnumPG1741895823000 implements MigrationInterface {
|
|
4
|
-
name = 'AddBitstringStatusListEnum1741895823000'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.startTransaction()
|
|
8
|
-
await queryRunner.query(`ALTER TYPE "StatusList_type_enum" ADD VALUE 'BitstringStatusList'`)
|
|
9
|
-
await queryRunner.commitTransaction()
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
14
|
-
// Note: Cannot remove enum value in Postgres without recreating the type
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
3
|
export class CreateBitstringStatusListPG1741895823000 implements MigrationInterface {
|
|
19
4
|
name = 'CreateBitstringStatusList1741895823000'
|
|
20
5
|
|
|
21
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
22
7
|
// Add BitstringStatusList columns to StatusList table
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`)
|
|
23
9
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`)
|
|
24
10
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`)
|
|
25
11
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validUntil" TIMESTAMP`)
|
|
@@ -35,6 +21,7 @@ export class CreateBitstringStatusListPG1741895823000 implements MigrationInterf
|
|
|
35
21
|
|
|
36
22
|
// Add BitstringStatusListEntry specific columns to StatusListEntry table
|
|
37
23
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusPurpose" character varying`)
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`)
|
|
38
25
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusMessage" text`)
|
|
39
26
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusReference" text`)
|
|
40
27
|
|
|
@@ -13,7 +13,7 @@ export class CreatePresentationDefinitions1716475165344 implements MigrationInte
|
|
|
13
13
|
"version" varchar NOT NULL,
|
|
14
14
|
"purpose" varchar,
|
|
15
15
|
"definition_payload" varchar NOT NULL,
|
|
16
|
-
"
|
|
16
|
+
"dcql_payload" varchar,
|
|
17
17
|
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
18
18
|
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
19
19
|
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GetDefinitionArgs,
|
|
3
|
+
GetDefinitionsArgs,
|
|
4
|
+
DeleteDefinitionArgs,
|
|
5
|
+
PresentationDefinitionItem,
|
|
6
|
+
AddDefinitionArgs,
|
|
7
|
+
UpdateDefinitionArgs,
|
|
8
|
+
DeleteDefinitionsArgs,
|
|
9
|
+
} from '../types'
|
|
10
|
+
|
|
11
|
+
export abstract class AbstractPDStore {
|
|
12
|
+
abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>
|
|
13
|
+
abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>
|
|
14
|
+
abstract getDefinition(args: GetDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
15
|
+
abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<PresentationDefinitionItem>>
|
|
16
|
+
abstract addDefinition(args: AddDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
17
|
+
abstract updateDefinition(args: UpdateDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
18
|
+
abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>
|
|
19
|
+
abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>
|
|
20
|
+
}
|