@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.
- package/dist/index.cjs +669 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +686 -122
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
- package/src/__tests__/contact.entities.test.ts +3 -3
- package/src/__tests__/contact.store.test.ts +3 -3
- package/src/__tests__/issuanceBranding.entities.test.ts +5 -5
- package/src/__tests__/issuanceBranding.store.test.ts +314 -4
- package/src/contact/ContactStore.ts +51 -4
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +44 -1
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +64 -1
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +63 -1
- package/src/index.ts +12 -0
- package/src/issuanceBranding/IssuanceBrandingStore.ts +45 -6
- package/src/migrations/generic/15-AddBrandingState.ts +64 -0
- package/src/migrations/generic/15-AddServiceMetadata.ts +66 -0
- package/src/migrations/generic/index.ts +21 -1
- package/src/migrations/index.ts +4 -0
- package/src/migrations/postgres/1764000000001-AddServiceMetadata.ts +44 -0
- package/src/migrations/postgres/1766000000000-AddBrandingState.ts +15 -0
- package/src/migrations/sqlite/1764000000002-AddServiceMetadata.ts +41 -0
- package/src/migrations/sqlite/1766000000000-AddBrandingState.ts +87 -0
- package/src/utils/issuanceBranding/HashUtils.ts +30 -0
- package/src/utils/issuanceBranding/MappingUtils.ts +21 -1
- 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
|
|
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
|
|
47
|
+
return blake.blake2bHex(JSON.stringify(payload))
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export function isPresentationDefinitionEqual(base: PartialDcqlQueryItem, compare: PartialDcqlQueryItem): boolean {
|