@sphereon/ssi-sdk.data-store 0.36.1-next.119 → 0.36.1-next.149

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.
Files changed (28) hide show
  1. package/dist/index.cjs +669 -107
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +21 -1
  4. package/dist/index.d.ts +21 -1
  5. package/dist/index.js +686 -122
  6. package/dist/index.js.map +1 -1
  7. package/package.json +9 -8
  8. package/src/__tests__/contact.entities.test.ts +3 -3
  9. package/src/__tests__/contact.store.test.ts +3 -3
  10. package/src/__tests__/issuanceBranding.entities.test.ts +5 -5
  11. package/src/__tests__/issuanceBranding.store.test.ts +314 -4
  12. package/src/contact/ContactStore.ts +51 -4
  13. package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +44 -1
  14. package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +64 -1
  15. package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +63 -1
  16. package/src/index.ts +12 -0
  17. package/src/issuanceBranding/IssuanceBrandingStore.ts +45 -6
  18. package/src/migrations/generic/15-AddBrandingState.ts +64 -0
  19. package/src/migrations/generic/15-AddServiceMetadata.ts +66 -0
  20. package/src/migrations/generic/index.ts +21 -1
  21. package/src/migrations/index.ts +4 -0
  22. package/src/migrations/postgres/1764000000001-AddServiceMetadata.ts +44 -0
  23. package/src/migrations/postgres/1766000000000-AddBrandingState.ts +15 -0
  24. package/src/migrations/sqlite/1764000000002-AddServiceMetadata.ts +41 -0
  25. package/src/migrations/sqlite/1766000000000-AddBrandingState.ts +87 -0
  26. package/src/utils/issuanceBranding/HashUtils.ts +30 -0
  27. package/src/utils/issuanceBranding/MappingUtils.ts +21 -1
  28. package/src/utils/presentationDefinition/MappingUtils.ts +5 -2
@@ -1,10 +1,13 @@
1
1
  import type { IPresentationDefinition } from '@sphereon/pex'
2
2
  import type { DcqlQueryItem, NonPersistedDcqlQueryItem, PartialDcqlQueryItem } from '@sphereon/ssi-sdk.data-store-types'
3
- import * as blakepkg from 'blakejs'
3
+ import * as blakejs from 'blakejs'
4
4
  import { DcqlQuery } from 'dcql'
5
5
  import { DcqlQueryItemEntity } from '../../entities/presentationDefinition/DcqlQueryItemEntity'
6
6
  import { replaceNullWithUndefined } from '../FormattingUtils'
7
7
 
8
+ // Handle CommonJS/ESM interop - blakejs may be wrapped in a default export
9
+ const blake = (blakejs as any).default ?? blakejs
10
+
8
11
  export const dcqlQueryItemFrom = (entity: DcqlQueryItemEntity): DcqlQueryItem => {
9
12
  const result: DcqlQueryItem = {
10
13
  id: entity.id,
@@ -41,7 +44,7 @@ export const dcqlQueryEntityItemFrom = (item: NonPersistedDcqlQueryItem): DcqlQu
41
44
  }
42
45
 
43
46
  function hashPayload(payload: IPresentationDefinition | DcqlQuery): string {
44
- return blakepkg.blake2bHex(JSON.stringify(payload))
47
+ return blake.blake2bHex(JSON.stringify(payload))
45
48
  }
46
49
 
47
50
  export function isPresentationDefinitionEqual(base: PartialDcqlQueryItem, compare: PartialDcqlQueryItem): boolean {