@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.45.91 → 0.34.1-feature.SSISDK.45.93
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 +1402 -1371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +158 -164
- package/dist/index.d.ts +158 -164
- package/dist/index.js +1359 -1328
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/digitalCredential/DigitalCredentialStore.ts +9 -9
- package/src/entities/contact/IdentityEntity.ts +2 -1
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +2 -1
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +31 -2
- package/src/migrations/generic/index.ts +8 -4
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +13 -2
- package/src/types/contact/contact.ts +1 -1
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +2 -1
- package/src/types/digitalCredential/enums.ts +0 -7
- package/src/types/digitalCredential/types.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store",
|
|
3
|
-
"version": "0.34.1-feature.SSISDK.45.
|
|
3
|
+
"version": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
30
30
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
31
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.45.
|
|
32
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.45.
|
|
33
|
-
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.45.
|
|
34
|
-
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.45.
|
|
35
|
-
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.
|
|
31
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
32
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
33
|
+
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
34
|
+
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
35
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.93+e2988de4",
|
|
36
36
|
"@veramo/core": "4.2.0",
|
|
37
37
|
"@veramo/utils": "4.2.0",
|
|
38
38
|
"blakejs": "^1.2.1",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"PostgreSQL",
|
|
66
66
|
"Contact Store"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "e2988de4fefe3562aa17e64048824f17672d7cd5"
|
|
69
69
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CredentialRole, OrPromise } from '@sphereon/ssi-types'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { DataSource, type FindOptionsOrder, type FindOptionsWhere, Repository } from 'typeorm'
|
|
4
|
+
|
|
5
|
+
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from '../../src'
|
|
6
|
+
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
2
7
|
import {
|
|
3
8
|
AddCredentialArgs,
|
|
4
|
-
CredentialRole,
|
|
5
9
|
CredentialStateType,
|
|
6
10
|
DigitalCredential,
|
|
7
11
|
GetCredentialArgs,
|
|
@@ -11,14 +15,10 @@ import {
|
|
|
11
15
|
RemoveCredentialArgs,
|
|
12
16
|
UpdateCredentialStateArgs,
|
|
13
17
|
} from '../types'
|
|
14
|
-
import { OrPromise } from '@sphereon/ssi-types'
|
|
15
|
-
import { DataSource, type FindOptionsOrder, type FindOptionsWhere, Repository } from 'typeorm'
|
|
16
|
-
import Debug from 'debug'
|
|
17
|
-
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
18
|
-
|
|
19
|
-
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from '../../src'
|
|
20
18
|
import { parseAndValidateOrderOptions } from '../utils/SortingUtils'
|
|
21
19
|
|
|
20
|
+
import { AbstractDigitalCredentialStore } from './AbstractDigitalCredentialStore'
|
|
21
|
+
|
|
22
22
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:credential-store')
|
|
23
23
|
|
|
24
24
|
export class DigitalCredentialStore extends AbstractDigitalCredentialStore {
|
|
@@ -78,7 +78,7 @@ export class DigitalCredentialStore extends AbstractDigitalCredentialStore {
|
|
|
78
78
|
return false
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
const query: FindOptionsWhere<DigitalCredentialEntity> = {}
|
|
82
82
|
|
|
83
83
|
if ('id' in args) {
|
|
84
84
|
query.id = args.id
|
|
@@ -17,7 +17,8 @@ import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
|
17
17
|
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity'
|
|
18
18
|
import { ConnectionEntity } from './ConnectionEntity'
|
|
19
19
|
import { IdentityMetadataItemEntity } from './IdentityMetadataItemEntity'
|
|
20
|
-
import {
|
|
20
|
+
import { IdentityOrigin, ValidationConstraint } from '../../types'
|
|
21
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
21
22
|
import { PartyEntity } from './PartyEntity'
|
|
22
23
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
23
24
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { typeormDate, typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
2
3
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
CredentialCorrelationType,
|
|
5
7
|
CredentialDocumentFormat,
|
|
6
|
-
CredentialRole,
|
|
7
8
|
CredentialStateType,
|
|
8
9
|
type DigitalCredential,
|
|
9
10
|
DocumentType,
|
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
1
|
import Debug from 'debug'
|
|
3
|
-
import {
|
|
2
|
+
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
|
+
import {
|
|
4
|
+
AddBitstringStatusListEnumPG1741895823000,
|
|
5
|
+
CreateBitstringStatusListPG1741895823000,
|
|
6
|
+
} from '../postgres/1741895823000-CreateBitstringStatusList'
|
|
4
7
|
import { CreateBitstringStatusListSqlite1741895823001 } from '../sqlite/1741895823001-CreateBitstringStatusList'
|
|
5
8
|
|
|
6
9
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
7
10
|
|
|
11
|
+
export class AddBitstringStatusListEnum1741895823000 implements MigrationInterface {
|
|
12
|
+
name = 'AddBitstringStatusListEnum1741895823000'
|
|
13
|
+
|
|
14
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
15
|
+
debug('migration: creating bitstring status list tables')
|
|
16
|
+
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
17
|
+
switch (dbType) {
|
|
18
|
+
case 'postgres': {
|
|
19
|
+
const mig = new AddBitstringStatusListEnumPG1741895823000()
|
|
20
|
+
await mig.up(queryRunner)
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
case 'sqlite':
|
|
24
|
+
case 'expo':
|
|
25
|
+
case 'react-native': {
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
|
+
default:
|
|
29
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
|
+
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
35
|
+
}
|
|
36
|
+
|
|
8
37
|
export class CreateBitstringStatusList1741895823000 implements MigrationInterface {
|
|
9
38
|
name = 'CreateBitstringStatusList1741895823000'
|
|
10
39
|
|
|
@@ -1,4 +1,7 @@
|
|
|
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'
|
|
2
5
|
import { CreateIssuanceBranding1659463079429 } from './2-CreateIssuanceBranding'
|
|
3
6
|
import { CreateContacts1690925872318 } from './3-CreateContacts'
|
|
4
7
|
import { CreateStatusList1693866470000 } from './4-CreateStatusList'
|
|
@@ -7,9 +10,6 @@ import { CreateDigitalCredential1708525189000 } from './6-CreateDigitalCredentia
|
|
|
7
10
|
import { CreateMachineStateStore1708098041262 } from './7-CreateMachineStateStore'
|
|
8
11
|
import { CreateContacts1708525189000 } from './8-CreateContacts'
|
|
9
12
|
import { CreateContacts1715761125000 } from './9-CreateContacts'
|
|
10
|
-
import { CreatePresentationDefinitions1716533767523 } from './10-CreatePresentationDefinitions'
|
|
11
|
-
import { FixCredentialClaimsReferencesUuid1741895822987 } from './11-FixCredentialClaimsReferenceUuid'
|
|
12
|
-
import { CreateBitstringStatusList1741895823000 } from './12-CreateBitstringStatusList'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
@@ -27,7 +27,11 @@ export const DataStoreContactMigrations = [
|
|
|
27
27
|
CreateContacts1715761125000,
|
|
28
28
|
]
|
|
29
29
|
export const DataStoreIssuanceBrandingMigrations = [CreateIssuanceBranding1659463079429, FixCredentialClaimsReferencesUuid1741895822987]
|
|
30
|
-
export const DataStoreStatusListMigrations = [
|
|
30
|
+
export const DataStoreStatusListMigrations = [
|
|
31
|
+
CreateStatusList1693866470000,
|
|
32
|
+
AddBitstringStatusListEnum1741895823000,
|
|
33
|
+
CreateBitstringStatusList1741895823000,
|
|
34
|
+
]
|
|
31
35
|
export const DataStoreEventLoggerMigrations = [CreateAuditEvents1701635835330]
|
|
32
36
|
export const DataStoreDigitalCredentialMigrations = [CreateDigitalCredential1708525189000]
|
|
33
37
|
export const DataStoreMachineStateMigrations = [CreateMachineStateStore1708098041262]
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
2
|
|
|
3
|
-
export class
|
|
4
|
-
name = '
|
|
3
|
+
export class AddBitstringStatusListEnumPG1741895823000 implements MigrationInterface {
|
|
4
|
+
name = 'AddBitstringStatusListEnum1741895823000'
|
|
5
5
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
7
|
await queryRunner.startTransaction()
|
|
8
8
|
await queryRunner.query(`ALTER TYPE "StatusList_type_enum" ADD VALUE 'BitstringStatusList'`)
|
|
9
9
|
await queryRunner.commitTransaction()
|
|
10
|
+
}
|
|
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
|
+
export class CreateBitstringStatusListPG1741895823000 implements MigrationInterface {
|
|
19
|
+
name = 'CreateBitstringStatusList1741895823000'
|
|
20
|
+
|
|
21
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
11
22
|
// Add BitstringStatusList columns to StatusList table
|
|
12
23
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`)
|
|
13
24
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
2
2
|
import { IIdentifier } from '@veramo/core'
|
|
3
3
|
import { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
|
-
import { CredentialRole } from '
|
|
4
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
5
5
|
|
|
6
6
|
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
7
7
|
|
|
@@ -2,7 +2,8 @@ import { HasherSync } from '@sphereon/ssi-types'
|
|
|
2
2
|
import { FindOptionsOrder } from 'typeorm'
|
|
3
3
|
import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
|
|
4
4
|
import { DigitalCredential } from './types'
|
|
5
|
-
import { CredentialCorrelationType,
|
|
5
|
+
import { CredentialCorrelationType, CredentialStateType, RegulationType } from './enums'
|
|
6
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
6
7
|
|
|
7
8
|
export type GetCredentialArgs = { id: string } | { hash: string }
|
|
8
9
|
|
|
@@ -56,13 +56,6 @@ export enum CredentialCorrelationType {
|
|
|
56
56
|
URL = 'URL',
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export enum CredentialRole {
|
|
60
|
-
ISSUER = 'ISSUER',
|
|
61
|
-
VERIFIER = 'VERIFIER',
|
|
62
|
-
HOLDER = 'HOLDER',
|
|
63
|
-
FEDERATION_TRUST_ANCHOR = 'FEDERATION_TRUST_ANCHOR',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
59
|
export enum CredentialStateType {
|
|
67
60
|
REVOKED = 'REVOKED',
|
|
68
61
|
VERIFIED = 'VERIFIED',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CredentialCorrelationType, CredentialDocumentFormat,
|
|
1
|
+
import { CredentialCorrelationType, CredentialDocumentFormat, CredentialStateType, DocumentType, RegulationType } from './enums'
|
|
2
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* DigitalCredential
|