@sphereon/ssi-sdk.issuance-branding 0.33.0 → 0.33.1-feature.vcdm2.tsup.18

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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM;AACf,6DAAoF;AAA3E,oHAAA,gBAAgB,OAAA;AAAE,2HAAA,uBAAuB,OAAA;AAClD,4DAAyC"}
1
+ {"version":3,"sources":["../plugin.schema.json","../src/agent/IssuanceBranding.ts","../src/index.ts"],"sourcesContent":["{\n \"IIssuanceBranding\": {\n \"components\": {\n \"schemas\": {\n \"IAddCredentialBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"vcHash\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IBasicCredentialLocaleBranding\"\n }\n }\n },\n \"required\": [\n \"issuerCorrelationId\",\n \"vcHash\",\n \"localeBranding\"\n ]\n },\n \"IBasicCredentialLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IBasicImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBasicBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IBasicTextAttributes\"\n },\n \"claims\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IBasicCredentialClaim\"\n }\n }\n },\n \"required\": [\n \"alias\",\n \"description\",\n \"locale\"\n ]\n },\n \"IBasicImageAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"uri\": {\n \"type\": \"string\"\n },\n \"dataUri\": {\n \"type\": \"string\"\n },\n \"mediaType\": {\n \"type\": \"string\"\n },\n \"alt\": {\n \"type\": \"string\"\n },\n \"dimensions\": {\n \"$ref\": \"#/components/schemas/IBasicImageDimensions\"\n }\n }\n },\n \"IBasicImageDimensions\": {\n \"type\": \"object\",\n \"properties\": {\n \"width\": {\n \"type\": \"number\"\n },\n \"height\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\n \"height\",\n \"width\"\n ]\n },\n \"IBasicBackgroundAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"color\": {\n \"type\": \"string\"\n },\n \"image\": {\n \"$ref\": \"#/components/schemas/IBasicImageAttributes\"\n }\n }\n },\n \"IBasicTextAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"color\": {\n \"type\": \"string\"\n }\n }\n },\n \"IBasicCredentialClaim\": {\n \"type\": \"object\",\n \"properties\": {\n \"key\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"key\",\n \"name\"\n ]\n },\n \"ICredentialBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"vcHash\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialLocaleBranding\"\n }\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n },\n \"required\": [\n \"id\",\n \"issuerCorrelationId\",\n \"vcHash\",\n \"localeBranding\",\n \"createdAt\",\n \"lastUpdatedAt\"\n ]\n },\n \"ICredentialLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"alias\": {\n \"type\": \"string\"\n },\n \"locale\": {\n \"type\": \"string\"\n },\n \"logo\": {\n \"$ref\": \"#/components/schemas/IImageAttributes\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/ITextAttributes\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"claims\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialClaim\"\n }\n }\n },\n \"required\": [\n \"createdAt\",\n \"id\",\n \"lastUpdatedAt\"\n ]\n },\n \"IImageAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"uri\": {\n \"type\": \"string\"\n },\n \"dataUri\": {\n \"type\": \"string\"\n },\n \"mediaType\": {\n \"type\": \"string\"\n },\n \"alt\": {\n \"type\": \"string\"\n },\n \"dimensions\": {\n \"$ref\": \"#/components/schemas/IImageDimensions\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"IImageDimensions\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"width\": {\n \"type\": \"number\"\n },\n \"height\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\n \"id\",\n \"width\",\n \"height\"\n ]\n },\n \"IBackgroundAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"image\": {\n \"$ref\": \"#/components/schemas/IImageAttributes\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"ITextAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"ICredentialClaim\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"key\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"key\",\n \"name\"\n ]\n },\n \"IAddCredentialLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credentialBrandingId\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IBasicCredentialLocaleBranding\"\n }\n }\n },\n \"required\": [\n \"credentialBrandingId\",\n \"localeBranding\"\n ]\n },\n \"IAddIssuerBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IBasicIssuerLocaleBranding\"\n }\n }\n },\n \"required\": [\n \"issuerCorrelationId\",\n \"localeBranding\"\n ]\n },\n \"IBasicIssuerLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"clientUri\": {\n \"type\": \"string\"\n },\n \"tosUri\": {\n \"type\": \"string\"\n },\n \"policyUri\": {\n \"type\": \"string\"\n },\n \"contacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IBasicImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBasicBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IBasicTextAttributes\"\n }\n },\n \"required\": [\n \"alias\",\n \"description\",\n \"locale\"\n ]\n },\n \"IIssuerBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IIssuerLocaleBranding\"\n }\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n },\n \"required\": [\n \"id\",\n \"issuerCorrelationId\",\n \"localeBranding\",\n \"createdAt\",\n \"lastUpdatedAt\"\n ]\n },\n \"IIssuerLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"alias\": {\n \"type\": \"string\"\n },\n \"locale\": {\n \"type\": \"string\"\n },\n \"logo\": {\n \"$ref\": \"#/components/schemas/IImageAttributes\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/ITextAttributes\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"clientUri\": {\n \"type\": \"string\"\n },\n \"tosUri\": {\n \"type\": \"string\"\n },\n \"policyUri\": {\n \"type\": \"string\"\n },\n \"contacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"createdAt\",\n \"id\",\n \"lastUpdatedAt\"\n ]\n },\n \"IAddIssuerLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuerBrandingId\": {\n \"type\": \"string\"\n },\n \"localeBranding\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IBasicIssuerLocaleBranding\"\n }\n }\n },\n \"required\": [\n \"issuerBrandingId\",\n \"localeBranding\"\n ]\n },\n \"ICredentialBrandingFromArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IBasicCredentialLocaleBranding\"\n }\n },\n \"required\": [\n \"localeBranding\"\n ]\n },\n \"IGetCredentialBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindCredentialBrandingArgs\"\n }\n }\n },\n \"FindCredentialBrandingArgs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialBrandingFilter\"\n }\n },\n \"ICredentialBrandingFilter\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"vcHash\": {\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IPartialCredentialLocaleBranding\"\n }\n }\n },\n \"IPartialCredentialLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {},\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"createdAt\": {},\n \"lastUpdatedAt\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IPartialImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IPartialBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IPartialTextAttributes\"\n },\n \"claims\": {\n \"$ref\": \"#/components/schemas/IPartialCredentialClaim\"\n }\n }\n },\n \"IPartialImageAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"uri\": {\n \"type\": \"string\"\n },\n \"dataUri\": {\n \"type\": \"string\"\n },\n \"mediaType\": {\n \"type\": \"string\"\n },\n \"alt\": {\n \"type\": \"string\"\n },\n \"dimensions\": {\n \"$ref\": \"#/components/schemas/IPartialImageDimensions\"\n }\n }\n },\n \"IPartialImageDimensions\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"width\": {\n \"type\": \"number\"\n },\n \"height\": {\n \"type\": \"number\"\n }\n }\n },\n \"IPartialBackgroundAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"image\": {\n \"$ref\": \"#/components/schemas/IPartialImageAttributes\"\n }\n }\n },\n \"IPartialTextAttributes\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n }\n }\n },\n \"IPartialCredentialClaim\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"key\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n }\n },\n \"IGetCredentialLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindCredentialLocaleBrandingArgs\"\n }\n }\n },\n \"FindCredentialLocaleBrandingArgs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialLocaleBrandingFilter\"\n }\n },\n \"ICredentialLocaleBrandingFilter\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {},\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"createdAt\": {},\n \"lastUpdatedAt\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IPartialImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IPartialBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IPartialTextAttributes\"\n },\n \"claims\": {\n \"$ref\": \"#/components/schemas/IPartialCredentialClaim\"\n },\n \"credentialBranding\": {\n \"$ref\": \"#/components/schemas/IPartialCredentialBranding\"\n }\n }\n },\n \"IPartialCredentialBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"vcHash\": {\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IPartialCredentialLocaleBranding\"\n }\n }\n },\n \"IGetIssuerBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindIssuerBrandingArgs\"\n }\n }\n },\n \"FindIssuerBrandingArgs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IIssuerBrandingFilter\"\n }\n },\n \"IIssuerBrandingFilter\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IPartialIssuerLocaleBranding\"\n }\n }\n },\n \"IPartialIssuerLocaleBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"clientUri\": {\n \"type\": \"string\"\n },\n \"tosUri\": {\n \"type\": \"string\"\n },\n \"policyUri\": {\n \"type\": \"string\"\n },\n \"id\": {},\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"createdAt\": {},\n \"lastUpdatedAt\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IPartialImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IPartialBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IPartialTextAttributes\"\n },\n \"contacts\": {\n \"type\": \"string\"\n }\n }\n },\n \"IGetIssuerLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindIssuerLocaleBrandingArgs\"\n }\n }\n },\n \"FindIssuerLocaleBrandingArgs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IIssuerLocaleBrandingFilter\"\n }\n },\n \"IIssuerLocaleBrandingFilter\": {\n \"type\": \"object\",\n \"properties\": {\n \"clientUri\": {\n \"type\": \"string\"\n },\n \"tosUri\": {\n \"type\": \"string\"\n },\n \"policyUri\": {\n \"type\": \"string\"\n },\n \"id\": {},\n \"alias\": {},\n \"locale\": {},\n \"description\": {},\n \"createdAt\": {},\n \"lastUpdatedAt\": {},\n \"logo\": {\n \"$ref\": \"#/components/schemas/IPartialImageAttributes\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IPartialBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/IPartialTextAttributes\"\n },\n \"contacts\": {\n \"type\": \"string\"\n },\n \"issuerBranding\": {\n \"$ref\": \"#/components/schemas/IPartialIssuerBranding\"\n }\n }\n },\n \"IPartialIssuerBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"lastUpdatedAt\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IPartialIssuerLocaleBranding\"\n }\n }\n },\n \"IIssuerBrandingFromArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"localeBranding\": {\n \"$ref\": \"#/components/schemas/IBasicIssuerLocaleBranding\"\n }\n },\n \"required\": [\n \"localeBranding\"\n ]\n },\n \"IRemoveCredentialBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindCredentialBrandingArgs\"\n }\n },\n \"required\": [\n \"filter\"\n ]\n },\n \"IDeletionResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"result\": {\n \"type\": \"boolean\"\n },\n \"error\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"result\"\n ]\n },\n \"IRemoveCredentialLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindCredentialLocaleBrandingArgs\"\n }\n },\n \"required\": [\n \"filter\"\n ]\n },\n \"IRemoveIssuerBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindIssuerBrandingArgs\"\n }\n },\n \"required\": [\n \"filter\"\n ]\n },\n \"IRemoveIssuerLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"filter\": {\n \"$ref\": \"#/components/schemas/FindIssuerLocaleBrandingArgs\"\n }\n },\n \"required\": [\n \"filter\"\n ]\n },\n \"IUpdateCredentialBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credentialBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n },\n \"vcHash\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"issuerCorrelationId\",\n \"vcHash\"\n ]\n }\n },\n \"required\": [\n \"credentialBranding\"\n ]\n },\n \"IUpdateCredentialLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"localeBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"alias\": {\n \"type\": \"string\"\n },\n \"locale\": {\n \"type\": \"string\"\n },\n \"logo\": {\n \"$ref\": \"#/components/schemas/IImageAttributes\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/ITextAttributes\"\n }\n },\n \"required\": [\n \"id\"\n ]\n }\n },\n \"required\": [\n \"localeBranding\"\n ]\n },\n \"IUpdateIssuerBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuerBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"issuerCorrelationId\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"issuerCorrelationId\"\n ]\n }\n },\n \"required\": [\n \"issuerBranding\"\n ]\n },\n \"IUpdateIssuerLocaleBrandingArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"localeBranding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"alias\": {\n \"type\": \"string\"\n },\n \"locale\": {\n \"type\": \"string\"\n },\n \"logo\": {\n \"$ref\": \"#/components/schemas/IImageAttributes\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"background\": {\n \"$ref\": \"#/components/schemas/IBackgroundAttributes\"\n },\n \"text\": {\n \"$ref\": \"#/components/schemas/ITextAttributes\"\n }\n },\n \"required\": [\n \"id\"\n ]\n }\n },\n \"required\": [\n \"localeBranding\"\n ]\n }\n },\n \"methods\": {\n \"ibAddCredentialBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IAddCredentialBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/ICredentialBranding\"\n }\n },\n \"ibAddCredentialLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IAddCredentialLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/ICredentialBranding\"\n }\n },\n \"ibAddIssuerBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IAddIssuerBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IIssuerBranding\"\n }\n },\n \"ibAddIssuerLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IAddIssuerLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IIssuerBranding\"\n }\n },\n \"ibCredentialLocaleBrandingFrom\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/ICredentialBrandingFromArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IBasicCredentialLocaleBranding\"\n }\n },\n \"ibGetCredentialBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IGetCredentialBrandingArgs\"\n },\n \"returnType\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialBranding\"\n }\n }\n },\n \"ibGetCredentialLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IGetCredentialLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialLocaleBranding\"\n }\n }\n },\n \"ibGetIssuerBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IGetIssuerBrandingArgs\"\n },\n \"returnType\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IIssuerBranding\"\n }\n }\n },\n \"ibGetIssuerLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IGetIssuerLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IIssuerLocaleBranding\"\n }\n }\n },\n \"ibIssuerLocaleBrandingFrom\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IIssuerBrandingFromArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IBasicIssuerLocaleBranding\"\n }\n },\n \"ibRemoveCredentialBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IRemoveCredentialBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IDeletionResult\"\n }\n },\n \"ibRemoveCredentialLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IRemoveCredentialLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IDeletionResult\"\n }\n },\n \"ibRemoveIssuerBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IRemoveIssuerBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IDeletionResult\"\n }\n },\n \"ibRemoveIssuerLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IRemoveIssuerLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IDeletionResult\"\n }\n },\n \"ibUpdateCredentialBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IUpdateCredentialBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/ICredentialBranding\"\n }\n },\n \"ibUpdateCredentialLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IUpdateCredentialLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/ICredentialLocaleBranding\"\n }\n },\n \"ibUpdateIssuerBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IUpdateIssuerBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IIssuerBranding\"\n }\n },\n \"ibUpdateIssuerLocaleBranding\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IUpdateIssuerLocaleBrandingArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/IIssuerLocaleBranding\"\n }\n }\n }\n }\n }\n}","import { IAgentPlugin } from '@veramo/core'\nimport { downloadImage, getImageDimensions, getImageMediaType, IImageDimensions, IImageResource } from '@sphereon/ssi-sdk.core'\nimport {\n AbstractIssuanceBrandingStore,\n IAddIssuerBrandingArgs,\n IBasicCredentialBranding,\n IBasicCredentialLocaleBranding,\n IBasicImageAttributes,\n IBasicIssuerBranding,\n IBasicIssuerLocaleBranding,\n ICredentialBranding,\n ICredentialLocaleBranding,\n IGetCredentialBrandingArgs,\n IGetCredentialLocaleBrandingArgs,\n IGetIssuerBrandingArgs,\n IIssuerBranding,\n IIssuerLocaleBranding,\n ILocaleBranding,\n} from '@sphereon/ssi-sdk.data-store'\nimport { schema } from '../index'\nimport {\n IAddCredentialBrandingArgs,\n IAdditionalImageAttributes,\n IDeletionResult,\n IIssuanceBranding,\n IRequiredContext,\n IRemoveCredentialBrandingArgs,\n IRemoveIssuerBrandingArgs,\n IUpdateCredentialBrandingArgs,\n IUpdateIssuerBrandingArgs,\n IAddCredentialLocaleBrandingArgs,\n IAddIssuerLocaleBrandingArgs,\n IGetIssuerLocaleBrandingArgs,\n IRemoveIssuerLocaleBrandingArgs,\n IRemoveCredentialLocaleBrandingArgs,\n IUpdateCredentialLocaleBrandingArgs,\n IUpdateIssuerLocaleBrandingArgs,\n ICredentialBrandingFromArgs,\n IIssuerBrandingFromArgs,\n} from '../types/IIssuanceBranding'\nimport Debug from 'debug'\n\nconst debug: Debug.Debugger = Debug('sphereon:ssi-sdk:issuance-branding')\n\nexport const issuanceBrandingMethods: Array<string> = [\n 'ibAddCredentialBranding',\n 'ibGetCredentialBranding',\n 'ibUpdateCredentialBranding',\n 'ibRemoveCredentialBranding',\n 'ibAddCredentialLocaleBranding',\n 'ibGetCredentialLocaleBranding',\n 'ibRemoveCredentialLocaleBranding',\n 'ibUpdateCredentialLocaleBranding',\n 'ibCredentialLocaleBrandingFrom',\n 'ibAddIssuerBranding',\n 'ibGetIssuerBranding',\n 'ibUpdateIssuerBranding',\n 'ibRemoveIssuerBranding',\n 'ibAddIssuerLocaleBranding',\n 'ibGetIssuerLocaleBranding',\n 'ibRemoveIssuerLocaleBranding',\n 'ibUpdateIssuerLocaleBranding',\n 'ibIssuerLocaleBrandingFrom',\n]\n\nconst EMPTY_IMAGE_ATTRIBUTES = {\n mediaType: undefined,\n dataUri: undefined,\n dimensions: undefined,\n}\n\n/**\n * {@inheritDoc IIssuanceBranding}\n */\nexport class IssuanceBranding implements IAgentPlugin {\n readonly schema = schema.IIssuanceBranding\n readonly methods: IIssuanceBranding = {\n ibAddCredentialBranding: this.ibAddCredentialBranding.bind(this),\n ibGetCredentialBranding: this.ibGetCredentialBranding.bind(this),\n ibUpdateCredentialBranding: this.ibUpdateCredentialBranding.bind(this),\n ibRemoveCredentialBranding: this.ibRemoveCredentialBranding.bind(this),\n ibAddCredentialLocaleBranding: this.ibAddCredentialLocaleBranding.bind(this),\n ibGetCredentialLocaleBranding: this.ibGetCredentialLocaleBranding.bind(this),\n ibRemoveCredentialLocaleBranding: this.ibRemoveCredentialLocaleBranding.bind(this),\n ibUpdateCredentialLocaleBranding: this.ibUpdateCredentialLocaleBranding.bind(this),\n ibCredentialLocaleBrandingFrom: this.ibCredentialLocaleBrandingFrom.bind(this),\n ibAddIssuerBranding: this.ibAddIssuerBranding.bind(this),\n ibGetIssuerBranding: this.ibGetIssuerBranding.bind(this),\n ibUpdateIssuerBranding: this.ibUpdateIssuerBranding.bind(this),\n ibRemoveIssuerBranding: this.inRemoveIssuerBranding.bind(this),\n ibAddIssuerLocaleBranding: this.ibAddIssuerLocaleBranding.bind(this),\n ibGetIssuerLocaleBranding: this.ibAGetIssuerLocaleBranding.bind(this),\n ibRemoveIssuerLocaleBranding: this.ibRemoveIssuerLocaleBranding.bind(this),\n ibUpdateIssuerLocaleBranding: this.ibUpdateIssuerLocaleBranding.bind(this),\n ibIssuerLocaleBrandingFrom: this.ibIssuerLocaleBrandingFrom.bind(this),\n }\n\n private readonly store: AbstractIssuanceBrandingStore\n\n constructor(options: { store: AbstractIssuanceBrandingStore }) {\n this.store = options.store\n }\n\n /** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */\n private async ibAddCredentialBranding(args: IAddCredentialBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding> {\n const localeBranding: Array<IBasicIssuerLocaleBranding> = await Promise.all(\n args.localeBranding.map(\n (localeBranding: IBasicCredentialLocaleBranding): IBasicCredentialLocaleBranding | Promise<IBasicCredentialLocaleBranding> =>\n this.setAdditionalImageAttributes(localeBranding),\n ),\n )\n\n const credentialBranding: IBasicCredentialBranding = {\n ...args,\n localeBranding,\n }\n\n debug('Adding credential branding', credentialBranding)\n return this.store.addCredentialBranding(credentialBranding)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */\n private async ibGetCredentialBranding(args?: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>> {\n debug('Getting credential branding', args)\n return this.store.getCredentialBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */\n private async ibUpdateCredentialBranding(args: IUpdateCredentialBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding> {\n debug('Updating credential branding', args)\n return this.store.updateCredentialBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */\n private async ibRemoveCredentialBranding(args: IRemoveCredentialBrandingArgs, context: IRequiredContext): Promise<IDeletionResult> {\n debug('Removing credential branding', args)\n return this.store\n .removeCredentialBranding(args)\n .then(() => ({ result: true }))\n .catch((error: Error) => ({ result: false, error: error.message }))\n }\n\n /** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */\n private async ibAddCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding> {\n const localeBranding: Array<IBasicCredentialLocaleBranding> = await Promise.all(\n args.localeBranding.map(\n (localeBranding: IBasicCredentialLocaleBranding): Promise<IBasicCredentialLocaleBranding> =>\n this.setAdditionalImageAttributes(localeBranding),\n ),\n )\n const addCredentialLocaleBrandingArgs: IAddCredentialLocaleBrandingArgs = {\n ...args,\n localeBranding,\n }\n\n debug('Adding credential locale branding', addCredentialLocaleBrandingArgs)\n return this.store.addCredentialLocaleBranding(addCredentialLocaleBrandingArgs)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */\n private async ibGetCredentialLocaleBranding(args?: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>> {\n debug('Getting credential locale branding', args)\n return this.store.getCredentialLocaleBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */\n private async ibRemoveCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs, context: IRequiredContext): Promise<IDeletionResult> {\n debug('Removing credential locale branding', args)\n return this.store\n .removeCredentialLocaleBranding(args)\n .then(() => ({ result: true }))\n .catch((error: Error) => ({ result: false, error: error.message }))\n }\n\n /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */\n private async ibUpdateCredentialLocaleBranding(\n args: IUpdateCredentialLocaleBrandingArgs,\n context: IRequiredContext,\n ): Promise<ICredentialLocaleBranding> {\n const localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'> = (await this.setAdditionalImageAttributes(\n args.localeBranding,\n )) as ICredentialLocaleBranding\n const updateCredentialLocaleBrandingArgs: IUpdateCredentialLocaleBrandingArgs = {\n ...args,\n localeBranding,\n }\n\n debug('Updating credential locale branding', updateCredentialLocaleBrandingArgs)\n return this.store.updateCredentialLocaleBranding(updateCredentialLocaleBrandingArgs)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */\n private async ibCredentialLocaleBrandingFrom(\n args: ICredentialBrandingFromArgs,\n context: IRequiredContext,\n ): Promise<IBasicCredentialLocaleBranding> {\n debug('get credential locale branding from', args)\n return this.setAdditionalImageAttributes(args.localeBranding)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */\n private async ibAddIssuerBranding(args: IAddIssuerBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding> {\n const localeBranding: Array<IBasicIssuerLocaleBranding> = await Promise.all(\n args.localeBranding.map(\n (localeBranding: IBasicIssuerLocaleBranding): Promise<IBasicIssuerLocaleBranding> => this.setAdditionalImageAttributes(localeBranding),\n ),\n )\n const issuerBranding: IBasicIssuerBranding = {\n ...args,\n localeBranding,\n }\n\n debug('Adding issuer branding', issuerBranding)\n return this.store.addIssuerBranding(issuerBranding)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */\n private async ibGetIssuerBranding(args?: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>> {\n debug('Getting issuer branding', args)\n return this.store.getIssuerBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */\n private async ibUpdateIssuerBranding(args: IUpdateIssuerBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding> {\n debug('Updating issuer branding', args)\n return this.store.updateIssuerBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */\n private async inRemoveIssuerBranding(args: IRemoveIssuerBrandingArgs, context: IRequiredContext): Promise<IDeletionResult> {\n debug('Removing issuer branding', args)\n return this.store\n .removeIssuerBranding(args)\n .then(() => ({ result: true }))\n .catch((error: Error) => ({ result: false, error: error.message }))\n }\n\n /** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */\n private async ibAddIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding> {\n const localeBranding: Array<IBasicIssuerLocaleBranding> = await Promise.all(\n args.localeBranding.map(\n (localeBranding: IBasicIssuerLocaleBranding): Promise<IBasicIssuerLocaleBranding> => this.setAdditionalImageAttributes(localeBranding),\n ),\n )\n const addIssuerLocaleBrandingArgs: IAddIssuerLocaleBrandingArgs = {\n ...args,\n localeBranding,\n }\n\n debug('Adding issuer locale branding', addIssuerLocaleBrandingArgs)\n return this.store.addIssuerLocaleBranding(addIssuerLocaleBrandingArgs)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */\n private async ibAGetIssuerLocaleBranding(args?: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>> {\n debug('Getting issuer locale branding', args)\n return this.store.getIssuerLocaleBranding(args)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */\n private async ibRemoveIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IDeletionResult> {\n debug('Removing issuer locale branding', args)\n return this.store\n .removeIssuerLocaleBranding(args)\n .then(() => ({ result: true }))\n .catch((error: Error) => ({ result: false, error: error.message }))\n }\n\n /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */\n private async ibUpdateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IIssuerLocaleBranding> {\n const localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'> = (await this.setAdditionalImageAttributes(\n args.localeBranding,\n )) as IIssuerLocaleBranding\n const updateIssuerLocaleBrandingArgs: IUpdateIssuerLocaleBrandingArgs = {\n ...args,\n localeBranding,\n }\n\n debug('Updating issuer locale branding', updateIssuerLocaleBrandingArgs)\n return this.store.updateIssuerLocaleBranding(updateIssuerLocaleBrandingArgs)\n }\n\n /** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */\n private async ibIssuerLocaleBrandingFrom(args: IIssuerBrandingFromArgs, context: IRequiredContext): Promise<IBasicIssuerLocaleBranding> {\n debug('get issuer locale branding from', args)\n return this.setAdditionalImageAttributes(args.localeBranding)\n }\n\n // todo: We really should add a cache for urls. We now fetch the same images multiple times in case the logo/background image is the same for multiple locales.\n private async setAdditionalImageAttributes(\n localeBranding: IBasicIssuerLocaleBranding | IBasicCredentialLocaleBranding,\n ): Promise<IBasicIssuerLocaleBranding | IBasicCredentialLocaleBranding> {\n return {\n ...localeBranding,\n ...(localeBranding.logo && {\n logo: {\n ...localeBranding.logo,\n ...(localeBranding.logo.uri\n ? {\n ...(await this.getAdditionalImageAttributes(localeBranding.logo)),\n }\n : EMPTY_IMAGE_ATTRIBUTES),\n },\n }),\n ...(localeBranding.background && {\n background: {\n ...localeBranding.background,\n ...(localeBranding.background.image && {\n image: {\n ...localeBranding.background.image,\n ...(localeBranding.background.image.uri\n ? {\n ...(await this.getAdditionalImageAttributes(localeBranding.background.image)),\n }\n : EMPTY_IMAGE_ATTRIBUTES),\n },\n }),\n },\n }),\n }\n }\n\n private async getAdditionalImageAttributes(image: IBasicImageAttributes): Promise<IAdditionalImageAttributes | IBasicImageAttributes> {\n if (!image.uri) {\n debug(`No image URI present, returning empty attributes`)\n return EMPTY_IMAGE_ATTRIBUTES\n }\n\n const data_uri_regex: RegExp = /^data:image\\/[^;]+;base64,/\n if (data_uri_regex.test(image.uri)) {\n debug('Setting additional image properties for uri', image.uri)\n const base64Content: string = await this.extractBase64FromDataURI(image.uri)\n const dimensions: IImageDimensions = image.dimensions ?? (await getImageDimensions(base64Content))\n const mediaType: string = image.mediaType ?? (await this.getDataTypeFromDataURI(image.uri))\n\n return {\n mediaType,\n dimensions,\n }\n }\n\n debug('Setting additional image properties for url', image.uri)\n const resource: IImageResource | undefined = !image.dataUri ? await downloadImage(image.uri) : undefined\n const dimensions: IImageDimensions =\n image.dimensions ?? (await getImageDimensions(resource?.base64Content ?? (await this.extractBase64FromDataURI(image.dataUri!))))\n const mediaType: string | undefined =\n image.mediaType ??\n resource?.contentType ??\n (resource?.base64Content ? await getImageMediaType(resource?.base64Content!) : await this.getDataTypeFromDataURI(image.uri))\n\n return {\n mediaType,\n dataUri: image.dataUri ?? `data:${mediaType};base64,${resource!.base64Content}`,\n dimensions,\n }\n }\n\n private async extractBase64FromDataURI(uri: string): Promise<string> {\n const data_uri_base64_regex: RegExp = /^data:[^;]+;base64,([\\w+/=-]+)$/i\n const matches: RegExpMatchArray | null = uri.match(data_uri_base64_regex)\n\n if (!matches || matches.length <= 1) {\n return Promise.reject(Error('invalid base64 uri'))\n }\n\n return matches[1]\n }\n\n private async getDataTypeFromDataURI(uri: string): Promise<string> {\n const data_uri_data_type_regex: RegExp = /^data:([^;]+);base64,([\\w+/=-]+)$/i\n const matches: RegExpMatchArray | null = uri.match(data_uri_data_type_regex)\n\n if (!matches || matches.length <= 1) {\n return Promise.reject(Error('invalid base64 uri'))\n }\n\n return matches[1]\n }\n}\n","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { IssuanceBranding, issuanceBrandingMethods } from './agent/IssuanceBranding'\nexport * from './types/IIssuanceBranding'\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,mBAAqB;AAAA,QACnB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,4BAA8B;AAAA,cAC5B,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,qBAAuB;AAAA,kBACrB,MAAQ;AAAA,gBACV;AAAA,gBACA,QAAU;AAAA,kBACR,MAAQ;AAAA,gBACV;AAAA,gBACA,gBAAkB;AAAA,kBAChB,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,cACF;AAAA,cACA,UAAY;AAAA,gBACV;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,YACF;AAAA,YACA,gCAAkC;AAAA,cAChC,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,OAAS,CAAC;AAAA,gBACV,QAAU,CAAC;AAAA,gBACX,aAAe,CAAC;AAAA,gBAChB,MAAQ;AAAA,kBACN,MAAQ;AAAA,gBACV;AAAA,gBACA,YAAc;AAAA,kBACZ,MAAQ;AAAA,gBACV;AAAA,gBACA,MAAQ;AAAA,kBACN,MAAQ;AAAA,gBACV;AAAA,gBACA,QAAU;AAAA,kBACR,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,cACF;AAAA,cACA,UAAY;AAAA,gBACV;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,YACF;AAAA,YACA,uBAAyB;AAAA,cACvB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,KAAO;AAAA,kBACL,MAAQ;AAAA,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ACTF,UAAUJ,gBAAgB,MAAMO,kBAAkBH,UAAUJ,aAAAA,IAAkB,MAAM,KAAKG,uBAAuBN,MAAMH,GAAG;AAE5H,WAAO;MACLnE;MACAE,SAASoE,MAAMpE,WAAW,QAAQF,SAAAA,WAAoB6E,SAAUJ,aAAa;MAC7EtE;IACF;EACF;EAEA,MAAcuE,yBAAyBP,KAA8B;AACnE,UAAMc,wBAAgC;AACtC,UAAMC,UAAmCf,IAAIgB,MAAMF,qBAAAA;AAEnD,QAAI,CAACC,WAAWA,QAAQE,UAAU,GAAG;AACnC,aAAOjD,QAAQkD,OAAOC,MAAM,oBAAA,CAAA;IAC9B;AAEA,WAAOJ,QAAQ,CAAA;EACjB;EAEA,MAAcN,uBAAuBT,KAA8B;AACjE,UAAMoB,2BAAmC;AACzC,UAAML,UAAmCf,IAAIgB,MAAMI,wBAAAA;AAEnD,QAAI,CAACL,WAAWA,QAAQE,UAAU,GAAG;AACnC,aAAOjD,QAAQkD,OAAOC,MAAM,oBAAA,CAAA;IAC9B;AAEA,WAAOJ,QAAQ,CAAA;EACjB;AACF;;;ACvXA,IAAMM,SAASC;","names":["downloadImage","getImageDimensions","getImageMediaType","Debug","debug","Debug","issuanceBrandingMethods","EMPTY_IMAGE_ATTRIBUTES","mediaType","undefined","dataUri","dimensions","IssuanceBranding","schema","IIssuanceBranding","methods","ibAddCredentialBranding","bind","ibGetCredentialBranding","ibUpdateCredentialBranding","ibRemoveCredentialBranding","ibAddCredentialLocaleBranding","ibGetCredentialLocaleBranding","ibRemoveCredentialLocaleBranding","ibUpdateCredentialLocaleBranding","ibCredentialLocaleBrandingFrom","ibAddIssuerBranding","ibGetIssuerBranding","ibUpdateIssuerBranding","ibRemoveIssuerBranding","inRemoveIssuerBranding","ibAddIssuerLocaleBranding","ibGetIssuerLocaleBranding","ibAGetIssuerLocaleBranding","ibRemoveIssuerLocaleBranding","ibUpdateIssuerLocaleBranding","ibIssuerLocaleBrandingFrom","store","constructor","options","args","context","localeBranding","Promise","all","map","setAdditionalImageAttributes","credentialBranding","addCredentialBranding","getCredentialBranding","updateCredentialBranding","removeCredentialBranding","then","result","catch","error","message","addCredentialLocaleBrandingArgs","addCredentialLocaleBranding","getCredentialLocaleBranding","removeCredentialLocaleBranding","updateCredentialLocaleBrandingArgs","updateCredentialLocaleBranding","issuerBranding","addIssuerBranding","getIssuerBranding","updateIssuerBranding","removeIssuerBranding","addIssuerLocaleBrandingArgs","addIssuerLocaleBranding","getIssuerLocaleBranding","removeIssuerLocaleBranding","updateIssuerLocaleBrandingArgs","updateIssuerLocaleBranding","logo","uri","getAdditionalImageAttributes","background","image","data_uri_regex","test","base64Content","extractBase64FromDataURI","getImageDimensions","getDataTypeFromDataURI","resource","downloadImage","contentType","getImageMediaType","data_uri_base64_regex","matches","match","length","reject","Error","data_uri_data_type_regex","schema","require"]}
package/package.json CHANGED
@@ -1,33 +1,44 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.issuance-branding",
3
- "version": "0.33.0",
3
+ "version": "0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
4
4
  "source": "src/index.ts",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "require": "./dist/index.cjs"
17
+ }
18
+ },
7
19
  "veramo": {
8
20
  "pluginInterfaces": {
9
21
  "IIssuanceBranding": "./src/types/IIssuanceBranding.ts"
10
22
  }
11
23
  },
12
24
  "scripts": {
13
- "build": "tsc",
14
- "build:clean": "tsc --build --clean && tsc --build",
25
+ "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json",
15
26
  "generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
16
27
  },
17
28
  "dependencies": {
18
- "@sphereon/ssi-sdk.core": "0.33.0",
19
- "@sphereon/ssi-sdk.data-store": "0.33.0",
29
+ "@sphereon/ssi-sdk.core": "^0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
30
+ "@sphereon/ssi-sdk.data-store": "^0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
20
31
  "debug": "^4.3.5",
21
- "typeorm": "^0.3.21"
32
+ "typeorm": "^0.3.22"
22
33
  },
23
34
  "devDependencies": {
24
- "@sphereon/ssi-sdk.agent-config": "0.33.0",
35
+ "@sphereon/ssi-sdk.agent-config": "^0.33.1-feature.vcdm2.tsup.18+1fbb8be0",
25
36
  "@veramo/remote-client": "4.2.0",
26
37
  "@veramo/remote-server": "4.2.0"
27
38
  },
28
39
  "files": [
29
- "dist/**/*",
30
- "src/**/*",
40
+ "dist",
41
+ "src",
31
42
  "README.md",
32
43
  "plugin.schema.json",
33
44
  "LICENSE"
@@ -49,6 +60,5 @@
49
60
  "OID4VCI",
50
61
  "SSI"
51
62
  ],
52
- "nx": {},
53
- "gitHead": "c575bdd6642bda761881f0152e0a70ddc82d7f61"
63
+ "gitHead": "1fbb8be0256ec8dbc1b52d860b7bfd09d12f0d00"
54
64
  }
@@ -1,56 +0,0 @@
1
- import { IAgentPlugin } from '@veramo/core';
2
- import { AbstractIssuanceBrandingStore } from '@sphereon/ssi-sdk.data-store';
3
- import { IIssuanceBranding } from '../types/IIssuanceBranding';
4
- export declare const issuanceBrandingMethods: Array<string>;
5
- /**
6
- * {@inheritDoc IIssuanceBranding}
7
- */
8
- export declare class IssuanceBranding implements IAgentPlugin {
9
- readonly schema: any;
10
- readonly methods: IIssuanceBranding;
11
- private readonly store;
12
- constructor(options: {
13
- store: AbstractIssuanceBrandingStore;
14
- });
15
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
16
- private ibAddCredentialBranding;
17
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
18
- private ibGetCredentialBranding;
19
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
20
- private ibUpdateCredentialBranding;
21
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
22
- private ibRemoveCredentialBranding;
23
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
24
- private ibAddCredentialLocaleBranding;
25
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
26
- private ibGetCredentialLocaleBranding;
27
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
28
- private ibRemoveCredentialLocaleBranding;
29
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
30
- private ibUpdateCredentialLocaleBranding;
31
- /** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
32
- private ibCredentialLocaleBrandingFrom;
33
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
34
- private ibAddIssuerBranding;
35
- /** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
36
- private ibGetIssuerBranding;
37
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
38
- private ibUpdateIssuerBranding;
39
- /** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
40
- private inRemoveIssuerBranding;
41
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
42
- private ibAddIssuerLocaleBranding;
43
- /** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
44
- private ibAGetIssuerLocaleBranding;
45
- /** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
46
- private ibRemoveIssuerLocaleBranding;
47
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
48
- private ibUpdateIssuerLocaleBranding;
49
- /** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
50
- private ibIssuerLocaleBrandingFrom;
51
- private setAdditionalImageAttributes;
52
- private getAdditionalImageAttributes;
53
- private extractBase64FromDataURI;
54
- private getDataTypeFromDataURI;
55
- }
56
- //# sourceMappingURL=IssuanceBranding.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IssuanceBranding.d.ts","sourceRoot":"","sources":["../../src/agent/IssuanceBranding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAe9B,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAIL,iBAAiB,EAelB,MAAM,4BAA4B,CAAA;AAKnC,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAmBjD,CAAA;AAQD;;GAEG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,QAAQ,CAAC,MAAM,MAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAmBlC;IAED,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;gBAEzC,OAAO,EAAE;QAAE,KAAK,EAAE,6BAA6B,CAAA;KAAE;IAI7D,8DAA8D;YAChD,uBAAuB;IAiBrC,8DAA8D;YAChD,uBAAuB;IAKrC,iEAAiE;YACnD,0BAA0B;IAKxC,iEAAiE;YACnD,0BAA0B;IAQxC,oEAAoE;YACtD,6BAA6B;IAgB3C,oEAAoE;YACtD,6BAA6B;IAK3C,uEAAuE;YACzD,gCAAgC;IAQ9C,uEAAuE;YACzD,gCAAgC;IAgB9C,qEAAqE;YACvD,8BAA8B;IAQ5C,0DAA0D;YAC5C,mBAAmB;IAejC,0DAA0D;YAC5C,mBAAmB;IAKjC,6DAA6D;YAC/C,sBAAsB;IAKpC,6DAA6D;YAC/C,sBAAsB;IAQpC,gEAAgE;YAClD,yBAAyB;IAevC,iEAAiE;YACnD,0BAA0B;IAKxC,mEAAmE;YACrD,4BAA4B;IAQ1C,mEAAmE;YACrD,4BAA4B;IAa1C,iEAAiE;YACnD,0BAA0B;YAM1B,4BAA4B;YAiC5B,4BAA4B;YAmC5B,wBAAwB;YAWxB,sBAAsB;CAUrC"}
@@ -1,288 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.IssuanceBranding = exports.issuanceBrandingMethods = void 0;
16
- const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
17
- const index_1 = require("../index");
18
- const debug_1 = __importDefault(require("debug"));
19
- const debug = (0, debug_1.default)('sphereon:ssi-sdk:issuance-branding');
20
- exports.issuanceBrandingMethods = [
21
- 'ibAddCredentialBranding',
22
- 'ibGetCredentialBranding',
23
- 'ibUpdateCredentialBranding',
24
- 'ibRemoveCredentialBranding',
25
- 'ibAddCredentialLocaleBranding',
26
- 'ibGetCredentialLocaleBranding',
27
- 'ibRemoveCredentialLocaleBranding',
28
- 'ibUpdateCredentialLocaleBranding',
29
- 'ibCredentialLocaleBrandingFrom',
30
- 'ibAddIssuerBranding',
31
- 'ibGetIssuerBranding',
32
- 'ibUpdateIssuerBranding',
33
- 'ibRemoveIssuerBranding',
34
- 'ibAddIssuerLocaleBranding',
35
- 'ibGetIssuerLocaleBranding',
36
- 'ibRemoveIssuerLocaleBranding',
37
- 'ibUpdateIssuerLocaleBranding',
38
- 'ibIssuerLocaleBrandingFrom',
39
- ];
40
- const EMPTY_IMAGE_ATTRIBUTES = {
41
- mediaType: undefined,
42
- dataUri: undefined,
43
- dimensions: undefined,
44
- };
45
- /**
46
- * {@inheritDoc IIssuanceBranding}
47
- */
48
- class IssuanceBranding {
49
- constructor(options) {
50
- this.schema = index_1.schema.IIssuanceBranding;
51
- this.methods = {
52
- ibAddCredentialBranding: this.ibAddCredentialBranding.bind(this),
53
- ibGetCredentialBranding: this.ibGetCredentialBranding.bind(this),
54
- ibUpdateCredentialBranding: this.ibUpdateCredentialBranding.bind(this),
55
- ibRemoveCredentialBranding: this.ibRemoveCredentialBranding.bind(this),
56
- ibAddCredentialLocaleBranding: this.ibAddCredentialLocaleBranding.bind(this),
57
- ibGetCredentialLocaleBranding: this.ibGetCredentialLocaleBranding.bind(this),
58
- ibRemoveCredentialLocaleBranding: this.ibRemoveCredentialLocaleBranding.bind(this),
59
- ibUpdateCredentialLocaleBranding: this.ibUpdateCredentialLocaleBranding.bind(this),
60
- ibCredentialLocaleBrandingFrom: this.ibCredentialLocaleBrandingFrom.bind(this),
61
- ibAddIssuerBranding: this.ibAddIssuerBranding.bind(this),
62
- ibGetIssuerBranding: this.ibGetIssuerBranding.bind(this),
63
- ibUpdateIssuerBranding: this.ibUpdateIssuerBranding.bind(this),
64
- ibRemoveIssuerBranding: this.inRemoveIssuerBranding.bind(this),
65
- ibAddIssuerLocaleBranding: this.ibAddIssuerLocaleBranding.bind(this),
66
- ibGetIssuerLocaleBranding: this.ibAGetIssuerLocaleBranding.bind(this),
67
- ibRemoveIssuerLocaleBranding: this.ibRemoveIssuerLocaleBranding.bind(this),
68
- ibUpdateIssuerLocaleBranding: this.ibUpdateIssuerLocaleBranding.bind(this),
69
- ibIssuerLocaleBrandingFrom: this.ibIssuerLocaleBrandingFrom.bind(this),
70
- };
71
- this.store = options.store;
72
- }
73
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
74
- ibAddCredentialBranding(args, context) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
77
- const credentialBranding = Object.assign(Object.assign({}, args), { localeBranding });
78
- debug('Adding credential branding', credentialBranding);
79
- return this.store.addCredentialBranding(credentialBranding);
80
- });
81
- }
82
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
83
- ibGetCredentialBranding(args) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- debug('Getting credential branding', args);
86
- return this.store.getCredentialBranding(args);
87
- });
88
- }
89
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
90
- ibUpdateCredentialBranding(args, context) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- debug('Updating credential branding', args);
93
- return this.store.updateCredentialBranding(args);
94
- });
95
- }
96
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
97
- ibRemoveCredentialBranding(args, context) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- debug('Removing credential branding', args);
100
- return this.store
101
- .removeCredentialBranding(args)
102
- .then(() => ({ result: true }))
103
- .catch((error) => ({ result: false, error: error.message }));
104
- });
105
- }
106
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
107
- ibAddCredentialLocaleBranding(args, context) {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
110
- const addCredentialLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
111
- debug('Adding credential locale branding', addCredentialLocaleBrandingArgs);
112
- return this.store.addCredentialLocaleBranding(addCredentialLocaleBrandingArgs);
113
- });
114
- }
115
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
116
- ibGetCredentialLocaleBranding(args) {
117
- return __awaiter(this, void 0, void 0, function* () {
118
- debug('Getting credential locale branding', args);
119
- return this.store.getCredentialLocaleBranding(args);
120
- });
121
- }
122
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
123
- ibRemoveCredentialLocaleBranding(args, context) {
124
- return __awaiter(this, void 0, void 0, function* () {
125
- debug('Removing credential locale branding', args);
126
- return this.store
127
- .removeCredentialLocaleBranding(args)
128
- .then(() => ({ result: true }))
129
- .catch((error) => ({ result: false, error: error.message }));
130
- });
131
- }
132
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
133
- ibUpdateCredentialLocaleBranding(args, context) {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- const localeBranding = (yield this.setAdditionalImageAttributes(args.localeBranding));
136
- const updateCredentialLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
137
- debug('Updating credential locale branding', updateCredentialLocaleBrandingArgs);
138
- return this.store.updateCredentialLocaleBranding(updateCredentialLocaleBrandingArgs);
139
- });
140
- }
141
- /** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
142
- ibCredentialLocaleBrandingFrom(args, context) {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- debug('get credential locale branding from', args);
145
- return this.setAdditionalImageAttributes(args.localeBranding);
146
- });
147
- }
148
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
149
- ibAddIssuerBranding(args, context) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
152
- const issuerBranding = Object.assign(Object.assign({}, args), { localeBranding });
153
- debug('Adding issuer branding', issuerBranding);
154
- return this.store.addIssuerBranding(issuerBranding);
155
- });
156
- }
157
- /** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
158
- ibGetIssuerBranding(args) {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- debug('Getting issuer branding', args);
161
- return this.store.getIssuerBranding(args);
162
- });
163
- }
164
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
165
- ibUpdateIssuerBranding(args, context) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- debug('Updating issuer branding', args);
168
- return this.store.updateIssuerBranding(args);
169
- });
170
- }
171
- /** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
172
- inRemoveIssuerBranding(args, context) {
173
- return __awaiter(this, void 0, void 0, function* () {
174
- debug('Removing issuer branding', args);
175
- return this.store
176
- .removeIssuerBranding(args)
177
- .then(() => ({ result: true }))
178
- .catch((error) => ({ result: false, error: error.message }));
179
- });
180
- }
181
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
182
- ibAddIssuerLocaleBranding(args, context) {
183
- return __awaiter(this, void 0, void 0, function* () {
184
- const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
185
- const addIssuerLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
186
- debug('Adding issuer locale branding', addIssuerLocaleBrandingArgs);
187
- return this.store.addIssuerLocaleBranding(addIssuerLocaleBrandingArgs);
188
- });
189
- }
190
- /** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
191
- ibAGetIssuerLocaleBranding(args) {
192
- return __awaiter(this, void 0, void 0, function* () {
193
- debug('Getting issuer locale branding', args);
194
- return this.store.getIssuerLocaleBranding(args);
195
- });
196
- }
197
- /** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
198
- ibRemoveIssuerLocaleBranding(args, context) {
199
- return __awaiter(this, void 0, void 0, function* () {
200
- debug('Removing issuer locale branding', args);
201
- return this.store
202
- .removeIssuerLocaleBranding(args)
203
- .then(() => ({ result: true }))
204
- .catch((error) => ({ result: false, error: error.message }));
205
- });
206
- }
207
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
208
- ibUpdateIssuerLocaleBranding(args, context) {
209
- return __awaiter(this, void 0, void 0, function* () {
210
- const localeBranding = (yield this.setAdditionalImageAttributes(args.localeBranding));
211
- const updateIssuerLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
212
- debug('Updating issuer locale branding', updateIssuerLocaleBrandingArgs);
213
- return this.store.updateIssuerLocaleBranding(updateIssuerLocaleBrandingArgs);
214
- });
215
- }
216
- /** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
217
- ibIssuerLocaleBrandingFrom(args, context) {
218
- return __awaiter(this, void 0, void 0, function* () {
219
- debug('get issuer locale branding from', args);
220
- return this.setAdditionalImageAttributes(args.localeBranding);
221
- });
222
- }
223
- // todo: We really should add a cache for urls. We now fetch the same images multiple times in case the logo/background image is the same for multiple locales.
224
- setAdditionalImageAttributes(localeBranding) {
225
- return __awaiter(this, void 0, void 0, function* () {
226
- return Object.assign(Object.assign(Object.assign({}, localeBranding), (localeBranding.logo && {
227
- logo: Object.assign(Object.assign({}, localeBranding.logo), (localeBranding.logo.uri
228
- ? Object.assign({}, (yield this.getAdditionalImageAttributes(localeBranding.logo))) : EMPTY_IMAGE_ATTRIBUTES)),
229
- })), (localeBranding.background && {
230
- background: Object.assign(Object.assign({}, localeBranding.background), (localeBranding.background.image && {
231
- image: Object.assign(Object.assign({}, localeBranding.background.image), (localeBranding.background.image.uri
232
- ? Object.assign({}, (yield this.getAdditionalImageAttributes(localeBranding.background.image))) : EMPTY_IMAGE_ATTRIBUTES)),
233
- })),
234
- }));
235
- });
236
- }
237
- getAdditionalImageAttributes(image) {
238
- return __awaiter(this, void 0, void 0, function* () {
239
- var _a, _b, _c, _d, _e, _f, _g;
240
- if (!image.uri) {
241
- debug(`No image URI present, returning empty attributes`);
242
- return EMPTY_IMAGE_ATTRIBUTES;
243
- }
244
- const data_uri_regex = /^data:image\/[^;]+;base64,/;
245
- if (data_uri_regex.test(image.uri)) {
246
- debug('Setting additional image properties for uri', image.uri);
247
- const base64Content = yield this.extractBase64FromDataURI(image.uri);
248
- const dimensions = (_a = image.dimensions) !== null && _a !== void 0 ? _a : (yield (0, ssi_sdk_core_1.getImageDimensions)(base64Content));
249
- const mediaType = (_b = image.mediaType) !== null && _b !== void 0 ? _b : (yield this.getDataTypeFromDataURI(image.uri));
250
- return {
251
- mediaType,
252
- dimensions,
253
- };
254
- }
255
- debug('Setting additional image properties for url', image.uri);
256
- const resource = !image.dataUri ? yield (0, ssi_sdk_core_1.downloadImage)(image.uri) : undefined;
257
- const dimensions = (_c = image.dimensions) !== null && _c !== void 0 ? _c : (yield (0, ssi_sdk_core_1.getImageDimensions)((_d = resource === null || resource === void 0 ? void 0 : resource.base64Content) !== null && _d !== void 0 ? _d : (yield this.extractBase64FromDataURI(image.dataUri))));
258
- const mediaType = (_f = (_e = image.mediaType) !== null && _e !== void 0 ? _e : resource === null || resource === void 0 ? void 0 : resource.contentType) !== null && _f !== void 0 ? _f : ((resource === null || resource === void 0 ? void 0 : resource.base64Content) ? yield (0, ssi_sdk_core_1.getImageMediaType)(resource === null || resource === void 0 ? void 0 : resource.base64Content) : yield this.getDataTypeFromDataURI(image.uri));
259
- return {
260
- mediaType,
261
- dataUri: (_g = image.dataUri) !== null && _g !== void 0 ? _g : `data:${mediaType};base64,${resource.base64Content}`,
262
- dimensions,
263
- };
264
- });
265
- }
266
- extractBase64FromDataURI(uri) {
267
- return __awaiter(this, void 0, void 0, function* () {
268
- const data_uri_base64_regex = /^data:[^;]+;base64,([\w+/=-]+)$/i;
269
- const matches = uri.match(data_uri_base64_regex);
270
- if (!matches || matches.length <= 1) {
271
- return Promise.reject(Error('invalid base64 uri'));
272
- }
273
- return matches[1];
274
- });
275
- }
276
- getDataTypeFromDataURI(uri) {
277
- return __awaiter(this, void 0, void 0, function* () {
278
- const data_uri_data_type_regex = /^data:([^;]+);base64,([\w+/=-]+)$/i;
279
- const matches = uri.match(data_uri_data_type_regex);
280
- if (!matches || matches.length <= 1) {
281
- return Promise.reject(Error('invalid base64 uri'));
282
- }
283
- return matches[1];
284
- });
285
- }
286
- }
287
- exports.IssuanceBranding = IssuanceBranding;
288
- //# sourceMappingURL=IssuanceBranding.js.map