@sphereon/ssi-sdk.data-store 0.11.1-unstable.101 → 0.11.1-unstable.103

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.11.1-unstable.101+4765914",
3
+ "version": "0.11.1-unstable.103+28aa53a",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "typeorm-postgres:migration:run": "pnpm run typeorm -- migration:run -c migration-postgres"
14
14
  },
15
15
  "dependencies": {
16
- "@sphereon/ssi-types": "0.11.1-unstable.101+4765914",
16
+ "@sphereon/ssi-types": "0.11.1-unstable.103+28aa53a",
17
17
  "@veramo/core": "4.2.0",
18
18
  "class-validator": "^0.14.0",
19
19
  "debug": "^4.3.4",
@@ -41,5 +41,5 @@
41
41
  "PostgreSQL",
42
42
  "Contact Store"
43
43
  ],
44
- "gitHead": "47659148a629c0b56b88413e1105d1b9cd6afc28"
44
+ "gitHead": "28aa53a065ee49369c6784d9651b6ac312694bba"
45
45
  }
@@ -947,6 +947,55 @@ describe('Issuance branding store tests', (): void => {
947
947
  expect(result?.localeBranding.filter((localeBranding: ICredentialLocaleBranding) => localeBranding.locale === undefined).length).toEqual(1)
948
948
  })
949
949
 
950
+ it('should store blank strings as undefined when adding credential locale branding', async (): Promise<void> => {
951
+ const credentialBranding: IBasicCredentialBranding = {
952
+ issuerCorrelationId: 'issuerCorrelationId',
953
+ vcHash: 'vcHash',
954
+ localeBranding: [
955
+ {
956
+ alias: '',
957
+ locale: '',
958
+ logo: {
959
+ uri: '',
960
+ dataUri: '',
961
+ mediaType: '',
962
+ alt: ''
963
+ },
964
+ description: '',
965
+ background: {
966
+ color: '',
967
+ image: {
968
+ uri: '',
969
+ mediaType: '',
970
+ dataUri: '',
971
+ alt: ''
972
+ }
973
+ },
974
+ text: {
975
+ color: '',
976
+ }
977
+ }
978
+ ]
979
+ }
980
+
981
+ const result: ICredentialBranding = await issuanceBrandingStore.addCredentialBranding(credentialBranding)
982
+
983
+ expect(result).toBeDefined()
984
+ expect(result?.localeBranding.length).toEqual(1)
985
+ expect(result?.localeBranding[0].locale).toBeUndefined()
986
+ expect(result?.localeBranding[0].alias).toBeUndefined()
987
+ expect(result?.localeBranding[0].logo!.uri).toBeUndefined()
988
+ expect(result?.localeBranding[0].logo!.dataUri).toBeUndefined()
989
+ expect(result?.localeBranding[0].logo!.mediaType).toBeUndefined()
990
+ expect(result?.localeBranding[0].logo!.alt).toBeUndefined()
991
+ expect(result?.localeBranding[0].description).toBeUndefined()
992
+ expect(result?.localeBranding[0].background!.image!.uri).toBeUndefined()
993
+ expect(result?.localeBranding[0].background!.image!.dataUri).toBeUndefined()
994
+ expect(result?.localeBranding[0].background!.image!.mediaType).toBeUndefined()
995
+ expect(result?.localeBranding[0].background!.image!.alt).toBeUndefined()
996
+ expect(result?.localeBranding[0].text!.color).toBeUndefined()
997
+ })
998
+
950
999
  // Issuer tests
951
1000
 
952
1001
  it('should add issuer branding', async (): Promise<void> => {
@@ -1800,4 +1849,52 @@ describe('Issuance branding store tests', (): void => {
1800
1849
  expect(result?.localeBranding.length).toEqual(2)
1801
1850
  expect(result?.localeBranding.filter((localeBranding: ICredentialLocaleBranding) => localeBranding.locale === undefined).length).toEqual(1)
1802
1851
  })
1852
+
1853
+ it('should store blank strings as undefined when adding issuer locale branding', async (): Promise<void> => {
1854
+ const issuerBranding: IBasicIssuerBranding = {
1855
+ issuerCorrelationId: 'issuerCorrelationId',
1856
+ localeBranding: [
1857
+ {
1858
+ alias: '',
1859
+ locale: '',
1860
+ logo: {
1861
+ uri: '',
1862
+ dataUri: '',
1863
+ mediaType: '',
1864
+ alt: ''
1865
+ },
1866
+ description: '',
1867
+ background: {
1868
+ color: '',
1869
+ image: {
1870
+ uri: '',
1871
+ mediaType: '',
1872
+ dataUri: '',
1873
+ alt: ''
1874
+ }
1875
+ },
1876
+ text: {
1877
+ color: '',
1878
+ }
1879
+ }
1880
+ ]
1881
+ }
1882
+
1883
+ const result: IIssuerBranding = await issuanceBrandingStore.addIssuerBranding(issuerBranding)
1884
+
1885
+ expect(result).toBeDefined()
1886
+ expect(result?.localeBranding.length).toEqual(1)
1887
+ expect(result?.localeBranding[0].locale).toBeUndefined()
1888
+ expect(result?.localeBranding[0].alias).toBeUndefined()
1889
+ expect(result?.localeBranding[0].logo!.uri).toBeUndefined()
1890
+ expect(result?.localeBranding[0].logo!.dataUri).toBeUndefined()
1891
+ expect(result?.localeBranding[0].logo!.mediaType).toBeUndefined()
1892
+ expect(result?.localeBranding[0].logo!.alt).toBeUndefined()
1893
+ expect(result?.localeBranding[0].description).toBeUndefined()
1894
+ expect(result?.localeBranding[0].background!.image!.uri).toBeUndefined()
1895
+ expect(result?.localeBranding[0].background!.image!.dataUri).toBeUndefined()
1896
+ expect(result?.localeBranding[0].background!.image!.mediaType).toBeUndefined()
1897
+ expect(result?.localeBranding[0].background!.image!.alt).toBeUndefined()
1898
+ expect(result?.localeBranding[0].text!.color).toBeUndefined()
1899
+ })
1803
1900
  })