@sphereon/ssi-sdk.data-store 0.37.2-next.28 → 0.37.2-next.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.data-store",
3
- "version": "0.37.2-next.28+0fa1686a",
3
+ "version": "0.37.2-next.46+f19cac5e",
4
4
  "source": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -28,12 +28,12 @@
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.37.2-next.28+0fa1686a",
32
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.2-next.28+0fa1686a",
33
- "@sphereon/ssi-sdk.agent-config": "0.37.2-next.28+0fa1686a",
34
- "@sphereon/ssi-sdk.core": "0.37.2-next.28+0fa1686a",
35
- "@sphereon/ssi-sdk.data-store-types": "0.37.2-next.28+0fa1686a",
36
- "@sphereon/ssi-types": "0.37.2-next.28+0fa1686a",
31
+ "@sphereon/ssi-sdk-ext.did-utils": "0.37.2-next.46+f19cac5e",
32
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.37.2-next.46+f19cac5e",
33
+ "@sphereon/ssi-sdk.agent-config": "0.37.2-next.46+f19cac5e",
34
+ "@sphereon/ssi-sdk.core": "0.37.2-next.46+f19cac5e",
35
+ "@sphereon/ssi-sdk.data-store-types": "0.37.2-next.46+f19cac5e",
36
+ "@sphereon/ssi-types": "0.37.2-next.46+f19cac5e",
37
37
  "@veramo/core": "4.2.0",
38
38
  "@veramo/data-store": "4.2.0",
39
39
  "@veramo/utils": "4.2.0",
@@ -67,5 +67,5 @@
67
67
  "PostgreSQL",
68
68
  "Contact Store"
69
69
  ],
70
- "gitHead": "0fa1686a6609f7a0aed8bbc8c7594639071cf88b"
70
+ "gitHead": "f19cac5ecfea9c564f576bd4efbc5aa55de6f103"
71
71
  }
@@ -18,7 +18,13 @@ import { PartyEntity } from '../entities/contact/PartyEntity'
18
18
  import { PartyRelationshipEntity } from '../entities/contact/PartyRelationshipEntity'
19
19
  import { PartyTypeEntity } from '../entities/contact/PartyTypeEntity'
20
20
  import { PhysicalAddressEntity } from '../entities/contact/PhysicalAddressEntity'
21
- import { contactMetadataItemEntityFrom, DataStoreEntitiesWithVeramo, DataStoreMigrationsWithVeramo, identityMetadataItemEntityFrom, partyTypeFrom } from '../index'
21
+ import {
22
+ contactMetadataItemEntityFrom,
23
+ DataStoreEntitiesWithVeramo,
24
+ DataStoreMigrationsWithVeramo,
25
+ identityMetadataItemEntityFrom,
26
+ partyTypeFrom,
27
+ } from '../index'
22
28
  import {
23
29
  IdentityOrigin,
24
30
  MetadataTypes,
@@ -74,9 +74,7 @@ describe('Credential Design store tests', (): void => {
74
74
  it('should throw error when getting credential design with unknown id', async (): Promise<void> => {
75
75
  const credentialDesignId = 'unknownCredentialDesignId'
76
76
 
77
- await expect(store.getCredentialDesign({ credentialDesignId })).rejects.toThrow(
78
- `No credential design found for id: ${credentialDesignId}`,
79
- )
77
+ await expect(store.getCredentialDesign({ credentialDesignId })).rejects.toThrow(`No credential design found for id: ${credentialDesignId}`)
80
78
  })
81
79
 
82
80
  it('should get all credential designs', async (): Promise<void> => {
@@ -412,8 +410,6 @@ describe('Credential Design store tests', (): void => {
412
410
  it('should throw error when removing credential design with unknown id', async (): Promise<void> => {
413
411
  const credentialDesignId = 'unknownCredentialDesignId'
414
412
 
415
- await expect(store.removeCredentialDesign({ credentialDesignId })).rejects.toThrow(
416
- `No credential design found for id: ${credentialDesignId}`,
417
- )
413
+ await expect(store.removeCredentialDesign({ credentialDesignId })).rejects.toThrow(`No credential design found for id: ${credentialDesignId}`)
418
414
  })
419
415
  })
@@ -15,7 +15,14 @@ import {
15
15
  import { OrPromise } from '@sphereon/ssi-types'
16
16
  import Debug from 'debug'
17
17
  import { DataSource, EntityManager, Repository } from 'typeorm'
18
- import { MetadataSetEntity, MetadataKeyEntity, MetadataValueEntity, SchemaDefinitionEntity, CredentialDesignBrandingEntity, FormStepEntity } from '../entities/credentialDesign'
18
+ import {
19
+ MetadataSetEntity,
20
+ MetadataKeyEntity,
21
+ MetadataValueEntity,
22
+ SchemaDefinitionEntity,
23
+ CredentialDesignBrandingEntity,
24
+ FormStepEntity,
25
+ } from '../entities/credentialDesign'
19
26
  import { ImageAttributesEntity } from '../entities/issuanceBranding/ImageAttributesEntity'
20
27
  import { ImageDimensionsEntity } from '../entities/issuanceBranding/ImageDimensionsEntity'
21
28
  import {
package/src/index.ts CHANGED
@@ -147,11 +147,7 @@ export const DataStoreEntities = [
147
147
  ]
148
148
 
149
149
  // All entities combined with Veramo entities if a party wants to enable them all at once
150
- export const DataStoreEntitiesWithVeramo = [
151
- ...VeramoDataStoreEntities,
152
- ...DataStoreEntities,
153
- ]
154
-
150
+ export const DataStoreEntitiesWithVeramo = [...VeramoDataStoreEntities, ...DataStoreEntities]
155
151
 
156
152
  export {
157
153
  BaseConfigEntity,
@@ -98,9 +98,7 @@ export class IssuanceBrandingStore extends AbstractIssuanceBrandingStore {
98
98
 
99
99
  if (knownStates && Object.keys(knownStates).length > 0) {
100
100
  // First do a lightweight query selecting only id and state to determine which records are "dirty"
101
- const stateQuery = repository
102
- .createQueryBuilder('branding')
103
- .select(['branding.id', 'branding.state'])
101
+ const stateQuery = repository.createQueryBuilder('branding').select(['branding.id', 'branding.state'])
104
102
  if (filter) {
105
103
  stateQuery.where(filter)
106
104
  }
@@ -41,9 +41,7 @@ export const DataStoreIssuanceBrandingMigrations = [
41
41
  AddBrandingState1766000000000,
42
42
  AddCredentialClaimOrder1768000000000,
43
43
  ]
44
- export const DataStoreCredentialDesignMigrations = [
45
- AddCredentialDesigns1773657426000,
46
- ]
44
+ export const DataStoreCredentialDesignMigrations = [AddCredentialDesigns1773657426000]
47
45
  export const DataStoreStatusListMigrations = [
48
46
  CreateStatusList1693866470000,
49
47
  AddBitstringStatusListEnum1741895823000,
@@ -69,10 +67,7 @@ export const DataStoreMigrations = [
69
67
  ]
70
68
 
71
69
  // All migrations combined with Veramo migrations first - use this when you need both
72
- export const DataStoreMigrationsWithVeramo = [
73
- ...VeramoDataStoreMigrations,
74
- ...DataStoreMigrations,
75
- ]
70
+ export const DataStoreMigrationsWithVeramo = [...VeramoDataStoreMigrations, ...DataStoreMigrations]
76
71
 
77
72
  // Re-export Veramo migrations and entities for convenience
78
73
  export { VeramoDataStoreMigrations, VeramoDataStoreEntities }
@@ -14,12 +14,10 @@ export class AddServiceMetadata1764000000001 implements MigrationInterface {
14
14
  // Skip this migration as there's no service table to modify
15
15
  debug(
16
16
  'AddServiceMetadata: Skipping migration - service table does not exist. ' +
17
- 'This is expected if Veramo DID Manager is not being used. ' +
18
- 'If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.'
19
- )
20
- console.warn(
21
- '[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)'
17
+ 'This is expected if Veramo DID Manager is not being used. ' +
18
+ 'If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.',
22
19
  )
20
+ console.warn('[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)')
23
21
  return
24
22
  }
25
23
 
@@ -35,7 +33,7 @@ export class AddServiceMetadata1764000000001 implements MigrationInterface {
35
33
  if (!table) {
36
34
  return
37
35
  }
38
-
36
+
39
37
  await queryRunner.query(`
40
38
  ALTER TABLE "service"
41
39
  DROP COLUMN IF EXISTS "metadata"
@@ -4,7 +4,6 @@ export class AddCredentialDesignsPostgres1773657426000 implements MigrationInter
4
4
  name = 'AddCredentialDesignsPostgres1773657426000'
5
5
 
6
6
  public async up(queryRunner: QueryRunner): Promise<void> {
7
-
8
7
  await queryRunner.query(`
9
8
  DO $$ BEGIN
10
9
  CREATE TYPE "value_type" AS ENUM ('Text', 'Number', 'Boolean', 'Date');
@@ -14,12 +14,10 @@ export class AddServiceMetadata1764000000002 implements MigrationInterface {
14
14
  // Skip this migration as there's no service table to modify
15
15
  debug(
16
16
  'AddServiceMetadata: Skipping migration - service table does not exist. ' +
17
- 'This is expected if Veramo DID Manager is not being used. ' +
18
- 'If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.'
19
- )
20
- console.warn(
21
- '[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)'
17
+ 'This is expected if Veramo DID Manager is not being used. ' +
18
+ 'If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.',
22
19
  )
20
+ console.warn('[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)')
23
21
  return
24
22
  }
25
23
 
@@ -8,9 +8,7 @@ export class AddCredentialDesignsSqlite1773657426000 implements MigrationInterfa
8
8
  `CREATE TABLE IF NOT EXISTS "meta_data_set" ("id" varchar PRIMARY KEY NOT NULL, "tenant_id" varchar, "name" text NOT NULL)`,
9
9
  )
10
10
 
11
- await queryRunner.query(
12
- `CREATE UNIQUE INDEX IF NOT EXISTS "meta_data_set_unique_tenant" ON "meta_data_set" ("name", "tenant_id")`,
13
- )
11
+ await queryRunner.query(`CREATE UNIQUE INDEX IF NOT EXISTS "meta_data_set_unique_tenant" ON "meta_data_set" ("name", "tenant_id")`)
14
12
 
15
13
  await queryRunner.query(
16
14
  `CREATE TABLE IF NOT EXISTS "meta_data_keys" ("id" varchar PRIMARY KEY NOT NULL, "set_id" varchar NOT NULL, "key" text NOT NULL, "value_type" varchar CHECK( "value_type" IN ('Text','Number','Boolean','Date') ) NOT NULL, CONSTRAINT "fk_meta_data_set" FOREIGN KEY ("set_id") REFERENCES "meta_data_set" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
@@ -24,9 +22,7 @@ export class AddCredentialDesignsSqlite1773657426000 implements MigrationInterfa
24
22
  `CREATE TABLE IF NOT EXISTS "form_step" ("id" varchar PRIMARY KEY NOT NULL, "tenant_id" varchar, "form_id" text, "step_nr" integer, "order" integer)`,
25
23
  )
26
24
 
27
- await queryRunner.query(
28
- `CREATE UNIQUE INDEX IF NOT EXISTS "formstep_unique_step" ON "form_step" ("step_nr", "form_id", "order")`,
29
- )
25
+ await queryRunner.query(`CREATE UNIQUE INDEX IF NOT EXISTS "formstep_unique_step" ON "form_step" ("step_nr", "form_id", "order")`)
30
26
 
31
27
  await queryRunner.query(
32
28
  `CREATE TABLE IF NOT EXISTS "schema_definition" ("id" varchar PRIMARY KEY NOT NULL, "tenant_id" varchar, "extends_id" varchar, "correlation_id" text, "schema_type" text, "entity_type" text, "schema" text NOT NULL, "meta_data_set_id" varchar, CONSTRAINT "fk_schemadef_metadata" FOREIGN KEY ("meta_data_set_id") REFERENCES "meta_data_set" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,