@sphereon/ui-components.credential-branding 0.3.1-unstable.5 → 0.4.1-unstable.2

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.
@@ -1,32 +1,12 @@
1
- import { VerifiableCredential } from '@veramo/core';
2
- import { CredentialRole, IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store';
3
- import { CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
4
- import { ICredential } from '@sphereon/ssi-types';
5
- export declare const toNonPersistedCredentialSummary: ({ verifiableCredential, credentialRole, branding, issuer, subject, }: {
6
- verifiableCredential: ICredential | VerifiableCredential;
7
- credentialRole: CredentialRole;
8
- branding?: IBasicCredentialLocaleBranding[] | undefined;
9
- issuer?: Party | undefined;
10
- subject?: Party | undefined;
11
- }) => Promise<CredentialSummary>;
1
+ import { IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding } from '@sphereon/ssi-sdk.data-store';
2
+ import { CredentialDetailsRow, CredentialSummary, GetCredentialDisplayNameArgs, GetCredentialIssuerNameAndAliasArgs, ISelectAppLocaleBrandingArgs, ToCredentialDetailsRowArgs, ToCredentialSummaryArgs, ToNonPersistedCredentialSummaryArgs } from '../types';
3
+ export declare const toCredentialDetailsRow: (args: ToCredentialDetailsRowArgs) => Promise<CredentialDetailsRow[]>;
4
+ export declare const toNonPersistedCredentialSummary: (args: ToNonPersistedCredentialSummaryArgs) => Promise<CredentialSummary>;
12
5
  export declare const getDate: (...dates: (number | string | undefined)[]) => number | undefined;
13
- export declare const getCredentialDisplayName: ({ verifiableCredential, localeBranding, }: {
14
- verifiableCredential: VerifiableCredential;
15
- localeBranding?: IBasicCredentialLocaleBranding | undefined;
16
- }) => string;
17
- export declare const getCredentialIssuerNameAndAlias: ({ verifiableCredential, issuer, }: {
18
- verifiableCredential: VerifiableCredential;
19
- issuer?: Party | undefined;
20
- }) => {
6
+ export declare const getCredentialDisplayName: (args: GetCredentialDisplayNameArgs) => string;
7
+ export declare const getCredentialIssuerNameAndAlias: (args: GetCredentialIssuerNameAndAliasArgs) => {
21
8
  issuerAlias: string;
22
9
  issuerName: string;
23
10
  };
24
- export declare const toCredentialSummary: ({ verifiableCredential, hash, credentialRole, branding, issuer, subject, }: {
25
- verifiableCredential: VerifiableCredential;
26
- hash: string;
27
- credentialRole: CredentialRole;
28
- branding?: IBasicCredentialLocaleBranding[] | undefined;
29
- issuer?: Party | undefined;
30
- subject?: Party | undefined;
31
- }) => Promise<CredentialSummary>;
11
+ export declare const toCredentialSummary: (args: ToCredentialSummaryArgs) => Promise<CredentialSummary>;
32
12
  export declare const selectAppLocaleBranding: (args: ISelectAppLocaleBrandingArgs) => Promise<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding | undefined>;
@@ -90,7 +90,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
90
90
  return to.concat(ar || Array.prototype.slice.call(from));
91
91
  };
92
92
  exports.__esModule = true;
93
- exports.selectAppLocaleBranding = exports.toCredentialSummary = exports.getCredentialIssuerNameAndAlias = exports.getCredentialDisplayName = exports.getDate = exports.toNonPersistedCredentialSummary = void 0;
93
+ exports.selectAppLocaleBranding = exports.toCredentialSummary = exports.getCredentialIssuerNameAndAlias = exports.getCredentialDisplayName = exports.getDate = exports.toNonPersistedCredentialSummary = exports.toCredentialDetailsRow = void 0;
94
94
  var uuid_1 = require("uuid");
95
95
  var utils_1 = require("@veramo/utils");
96
96
  var ui_components_core_1 = require("@sphereon/ui-components.core");
@@ -102,119 +102,121 @@ function findCorrelationIdName(correlationId, parties, activeUser) {
102
102
  if (activeUser) {
103
103
  parties.push(activeUser);
104
104
  }
105
- return ((_b = (_a = allParties === null || allParties === void 0 ? void 0 : allParties.find(function (contact) {
106
- return contact.identities.some(function (identity) { return identity.identifier.correlationId === correlationId; });
107
- })) === null || _a === void 0 ? void 0 : _a.contact.displayName) !== null && _b !== void 0 ? _b : correlationId);
105
+ return ((_b = (_a = allParties === null || allParties === void 0 ? void 0 : allParties.find(function (contact) { var _a; return (_a = contact.identities) === null || _a === void 0 ? void 0 : _a.some(function (identity) { return identity.identifier.correlationId === correlationId; }); })) === null || _a === void 0 ? void 0 : _a.contact.displayName) !== null && _b !== void 0 ? _b : correlationId);
108
106
  }
109
107
  var getImageSize = function (image) { return __awaiter(void 0, void 0, void 0, function () {
110
- var downloadedImage, imageSize, _a;
111
- return __generator(this, function (_b) {
112
- switch (_b.label) {
113
- case 0: return [4, (0, ssi_sdk_core_1.downloadImage)(image)];
108
+ var downloadedImage;
109
+ return __generator(this, function (_a) {
110
+ switch (_a.label) {
111
+ case 0: return [4, (0, utils_2.isImageAddress)(image)];
114
112
  case 1:
115
- downloadedImage = _b.sent();
116
- imageSize = undefined;
117
- _a = downloadedImage;
118
- if (!_a) return [3, 3];
119
- return [4, (0, utils_2.isImageAddress)(image)];
113
+ if (!(_a.sent())) {
114
+ return [2];
115
+ }
116
+ if (!(image.startsWith('http://') && !image.startsWith('https://'))) return [3, 3];
117
+ return [4, (0, ssi_sdk_core_1.downloadImage)(image)];
120
118
  case 2:
121
- _a = (_b.sent());
122
- _b.label = 3;
119
+ downloadedImage = _a.sent();
120
+ if (downloadedImage) {
121
+ return [2, (0, ssi_sdk_core_1.getImageDimensions)(downloadedImage.base64Content)];
122
+ }
123
+ return [3, 4];
123
124
  case 3:
124
- if (!_a) return [3, 5];
125
- return [4, (0, ssi_sdk_core_1.getImageDimensions)(downloadedImage.base64Content)];
126
- case 4:
127
- imageSize = _b.sent();
128
- _b.label = 5;
129
- case 5: return [2, imageSize];
125
+ if (ui_components_core_1.IS_IMAGE_URI_REGEX.test(image)) {
126
+ return [2, (0, ssi_sdk_core_1.getImageDimensions)(image.split('base64,')[1])];
127
+ }
128
+ _a.label = 4;
129
+ case 4: return [2];
130
130
  }
131
131
  });
132
132
  }); };
133
- var toCredentialDetailsRow = function (_a) {
134
- var object = _a.object, subject = _a.subject, issuer = _a.issuer;
135
- return __awaiter(void 0, void 0, void 0, function () {
136
- var rows, _i, _b, _c, key, value, image, _d, _e, _f, _g, label, contacts, imageSize, _h;
137
- var _j;
138
- return __generator(this, function (_k) {
139
- switch (_k.label) {
140
- case 0:
141
- rows = [];
142
- _i = 0, _b = Object.entries(object);
143
- _k.label = 1;
144
- case 1:
145
- if (!(_i < _b.length)) return [3, 12];
146
- _c = _b[_i], key = _c[0], value = _c[1];
147
- if (!key.toLowerCase().includes('image')) return [3, 3];
148
- image = typeof value === 'string' ? value : value.id;
149
- _e = (_d = rows).push;
150
- _j = {
151
- id: (0, uuid_1.v4)(),
152
- label: 'image',
153
- value: image
154
- };
155
- return [4, getImageSize(image)];
156
- case 2:
157
- _e.apply(_d, [(_j.imageSize = _k.sent(),
158
- _j)]);
159
- return [3, 11];
160
- case 3:
161
- if (key === 'type') {
162
- rows.push({
163
- id: (0, uuid_1.v4)(),
164
- label: key,
165
- value: value
166
- });
167
- return [3, 11];
168
- }
169
- _k.label = 4;
170
- case 4:
171
- if (!(typeof value !== 'string')) return [3, 6];
172
- _g = (_f = rows).concat;
173
- return [4, toCredentialDetailsRow({ object: value, subject: subject, issuer: issuer })];
174
- case 5:
175
- rows = _g.apply(_f, [_k.sent()]);
176
- return [3, 11];
177
- case 6:
178
- if (key === '0' || value === undefined) {
179
- return [3, 11];
180
- }
181
- label = key;
182
- if (key === 'id' && value.startsWith('did:')) {
183
- label = 'subject';
184
- }
185
- if (value.startsWith('did:')) {
186
- contacts = __spreadArray(__spreadArray([], (issuer ? [issuer] : []), true), (subject ? [subject] : []), true);
187
- value = findCorrelationIdName(value, contacts);
188
- }
189
- return [4, (0, utils_2.isImageAddress)(value)];
190
- case 7:
191
- if (!(_k.sent())) return [3, 9];
192
- return [4, getImageSize(value)];
193
- case 8:
194
- _h = _k.sent();
195
- return [3, 10];
196
- case 9:
197
- _h = undefined;
198
- _k.label = 10;
199
- case 10:
200
- imageSize = _h;
201
- rows.push({
202
- id: (0, uuid_1.v4)(),
203
- label: label,
204
- value: value,
205
- imageSize: imageSize
133
+ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0, void 0, function () {
134
+ var object, subject, issuer, branding, _a, parentKey, rows, _loop_1, _i, _b, _c, key, value;
135
+ var _d, _e;
136
+ return __generator(this, function (_f) {
137
+ switch (_f.label) {
138
+ case 0:
139
+ object = args.object, subject = args.subject, issuer = args.issuer, branding = args.branding, _a = args.parentKey, parentKey = _a === void 0 ? '' : _a;
140
+ rows = [];
141
+ if (!object) {
142
+ return [2, rows];
143
+ }
144
+ _loop_1 = function (key, value) {
145
+ var _g, _h, label, contacts, imageSize, _j;
146
+ return __generator(this, function (_k) {
147
+ switch (_k.label) {
148
+ case 0:
149
+ if (!key) {
150
+ return [2, "continue"];
151
+ }
152
+ if (key === 'type') {
153
+ rows.push({
154
+ id: (0, uuid_1.v4)(),
155
+ label: key,
156
+ value: value
157
+ });
158
+ return [2, "continue"];
159
+ }
160
+ if (!(typeof value === 'object' && value !== null && value !== undefined)) return [3, 2];
161
+ _h = (_g = rows).concat;
162
+ return [4, (0, exports.toCredentialDetailsRow)({ object: value, subject: subject, issuer: issuer, branding: branding, parentKey: parentKey ? "".concat(parentKey, ".").concat(key) : key })];
163
+ case 1:
164
+ rows = _h.apply(_g, [_k.sent()]);
165
+ return [3, 7];
166
+ case 2:
167
+ if (key === '0' || value === undefined || value === null) {
168
+ return [2, "continue"];
169
+ }
170
+ label = (_e = (_d = branding === null || branding === void 0 ? void 0 : branding.find(function (claim) { return claim.key === (parentKey ? "".concat(parentKey, ".").concat(key) : key); })) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : key;
171
+ if (key === 'id' && typeof value === 'string' && value.startsWith('did:')) {
172
+ label = 'subject';
173
+ }
174
+ if (typeof value === 'string' && value.startsWith('did:')) {
175
+ contacts = __spreadArray(__spreadArray([], (issuer ? [issuer] : []), true), (subject ? [subject] : []), true);
176
+ value = findCorrelationIdName(value, contacts);
177
+ }
178
+ return [4, (0, utils_2.isImageAddress)(value)];
179
+ case 3:
180
+ if (!(_k.sent())) return [3, 5];
181
+ return [4, getImageSize(value)];
182
+ case 4:
183
+ _j = _k.sent();
184
+ return [3, 6];
185
+ case 5:
186
+ _j = undefined;
187
+ _k.label = 6;
188
+ case 6:
189
+ imageSize = _j;
190
+ rows.push({
191
+ id: (0, uuid_1.v4)(),
192
+ label: label,
193
+ value: value,
194
+ imageSize: imageSize
195
+ });
196
+ _k.label = 7;
197
+ case 7: return [2];
198
+ }
206
199
  });
207
- _k.label = 11;
208
- case 11:
209
- _i++;
210
- return [3, 1];
211
- case 12: return [2, rows];
212
- }
213
- });
200
+ };
201
+ _i = 0, _b = Object.entries(object);
202
+ _f.label = 1;
203
+ case 1:
204
+ if (!(_i < _b.length)) return [3, 4];
205
+ _c = _b[_i], key = _c[0], value = _c[1];
206
+ return [5, _loop_1(key, value)];
207
+ case 2:
208
+ _f.sent();
209
+ _f.label = 3;
210
+ case 3:
211
+ _i++;
212
+ return [3, 1];
213
+ case 4: return [2, rows];
214
+ }
214
215
  });
215
- };
216
- var toNonPersistedCredentialSummary = function (_a) {
217
- var verifiableCredential = _a.verifiableCredential, credentialRole = _a.credentialRole, branding = _a.branding, issuer = _a.issuer, subject = _a.subject;
216
+ }); };
217
+ exports.toCredentialDetailsRow = toCredentialDetailsRow;
218
+ var toNonPersistedCredentialSummary = function (args) {
219
+ var verifiableCredential = args.verifiableCredential, credentialRole = args.credentialRole, branding = args.branding, issuer = args.issuer, subject = args.subject;
218
220
  return (0, exports.toCredentialSummary)({
219
221
  verifiableCredential: verifiableCredential,
220
222
  hash: (0, utils_1.computeEntryHash)(verifiableCredential),
@@ -240,10 +242,10 @@ var getDate = function () {
240
242
  return Math.round(new Date(date + '').valueOf() / ui_components_core_1.EPOCH_MILLISECONDS);
241
243
  };
242
244
  exports.getDate = getDate;
243
- var getCredentialDisplayName = function (_a) {
244
- var _b, _c;
245
- var verifiableCredential = _a.verifiableCredential, localeBranding = _a.localeBranding;
246
- var title = (_c = (_b = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.alias) !== null && _b !== void 0 ? _b : verifiableCredential.name) !== null && _c !== void 0 ? _c : (!verifiableCredential.type ? 'unknown' : undefined);
245
+ var getCredentialDisplayName = function (args) {
246
+ var _a, _b;
247
+ var verifiableCredential = args.verifiableCredential, localeBranding = args.localeBranding;
248
+ var title = (_b = (_a = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.alias) !== null && _a !== void 0 ? _a : verifiableCredential.name) !== null && _b !== void 0 ? _b : (!verifiableCredential.type ? 'unknown' : undefined);
247
249
  if (verifiableCredential.type) {
248
250
  var types = (0, utils_1.asArray)(verifiableCredential.type).filter(function (val) { return val !== 'VerifiableCredential'; });
249
251
  if (types.length === 1) {
@@ -259,10 +261,10 @@ var getCredentialDisplayName = function (_a) {
259
261
  return title;
260
262
  };
261
263
  exports.getCredentialDisplayName = getCredentialDisplayName;
262
- var getCredentialIssuerNameAndAlias = function (_a) {
263
- var _b;
264
- var verifiableCredential = _a.verifiableCredential, issuer = _a.issuer;
265
- var issuerName = typeof verifiableCredential.issuer === 'string' ? verifiableCredential.issuer : (_b = verifiableCredential.issuer) === null || _b === void 0 ? void 0 : _b.id;
264
+ var getCredentialIssuerNameAndAlias = function (args) {
265
+ var _a;
266
+ var verifiableCredential = args.verifiableCredential, issuer = args.issuer;
267
+ var issuerName = typeof verifiableCredential.issuer === 'string' ? verifiableCredential.issuer : (_a = verifiableCredential.issuer) === null || _a === void 0 ? void 0 : _a.id;
266
268
  var issuerAlias = undefined;
267
269
  if (typeof (verifiableCredential === null || verifiableCredential === void 0 ? void 0 : verifiableCredential.issuer) === 'object') {
268
270
  issuerAlias = verifiableCredential.issuer.name;
@@ -276,8 +278,8 @@ var getCredentialIssuerNameAndAlias = function (_a) {
276
278
  return { issuerName: issuerName, issuerAlias: issuerAlias };
277
279
  };
278
280
  exports.getCredentialIssuerNameAndAlias = getCredentialIssuerNameAndAlias;
279
- var getTermsOfUse = function (_a) {
280
- var verifiableCredential = _a.verifiableCredential;
281
+ var getTermsOfUse = function (args) {
282
+ var verifiableCredential = args.verifiableCredential;
281
283
  if (!verifiableCredential.termsOfUse) {
282
284
  return;
283
285
  }
@@ -288,54 +290,53 @@ var getTermsOfUse = function (_a) {
288
290
  return __assign((_a = {}, _a[type] = id, _a), rest);
289
291
  });
290
292
  };
291
- var toCredentialSummary = function (_a) {
292
- var verifiableCredential = _a.verifiableCredential, hash = _a.hash, credentialRole = _a.credentialRole, branding = _a.branding, issuer = _a.issuer, subject = _a.subject;
293
- return __awaiter(void 0, void 0, void 0, function () {
294
- var expirationDate, issueDate, localeBranding, credentialStatus, title, properties, logo, url, _b, issuerName, issuerAlias, termsOfUse;
295
- var _c, _d;
296
- return __generator(this, function (_e) {
297
- switch (_e.label) {
298
- case 0:
299
- expirationDate = (_c = (0, exports.getDate)(verifiableCredential.expirationDate, verifiableCredential.validTo, verifiableCredential.exp)) !== null && _c !== void 0 ? _c : 0;
300
- issueDate = (0, exports.getDate)(verifiableCredential.issuanceDate, verifiableCredential.validFrom, verifiableCredential.nbf, verifiableCredential.iat);
301
- return [4, (0, exports.selectAppLocaleBranding)({ localeBranding: branding })];
302
- case 1:
303
- localeBranding = _e.sent();
304
- credentialStatus = (0, utils_2.getCredentialStatus)(verifiableCredential);
305
- title = (0, exports.getCredentialDisplayName)({ verifiableCredential: verifiableCredential, localeBranding: localeBranding });
306
- return [4, toCredentialDetailsRow({
307
- object: __assign(__assign({}, (_d = verifiableCredential.vc) === null || _d === void 0 ? void 0 : _d.credentialSubject), verifiableCredential.credentialSubject),
308
- subject: subject,
309
- issuer: issuer
310
- })];
311
- case 2:
312
- properties = _e.sent();
313
- logo = (0, utils_2.getIssuerLogo)(verifiableCredential, localeBranding);
314
- url = typeof verifiableCredential.issuer !== 'string' ? verifiableCredential.issuer.url : undefined;
315
- _b = (0, exports.getCredentialIssuerNameAndAlias)({ verifiableCredential: verifiableCredential, issuer: issuer }), issuerName = _b.issuerName, issuerAlias = _b.issuerAlias;
316
- termsOfUse = getTermsOfUse({ verifiableCredential: verifiableCredential });
317
- return [2, {
318
- hash: hash,
319
- id: verifiableCredential.id,
320
- title: title,
321
- credentialStatus: credentialStatus,
322
- credentialRole: credentialRole,
323
- issueDate: issueDate,
324
- expirationDate: expirationDate,
325
- properties: properties,
326
- branding: localeBranding,
327
- termsOfUse: termsOfUse,
328
- issuer: {
329
- name: issuerName,
330
- alias: issuerAlias ? (issuerAlias.length > 50 ? "".concat(issuerAlias.substring(0, 50), "...") : issuerAlias) : '',
331
- image: logo,
332
- url: url
333
- }
334
- }];
335
- }
336
- });
293
+ var toCredentialSummary = function (args) { return __awaiter(void 0, void 0, void 0, function () {
294
+ var verifiableCredential, hash, credentialRole, branding, issuer, subject, expirationDate, issueDate, localeBranding, credentialStatus, title, properties, logo, url, _a, issuerName, issuerAlias, termsOfUse;
295
+ var _b, _c;
296
+ return __generator(this, function (_d) {
297
+ switch (_d.label) {
298
+ case 0:
299
+ verifiableCredential = args.verifiableCredential, hash = args.hash, credentialRole = args.credentialRole, branding = args.branding, issuer = args.issuer, subject = args.subject;
300
+ expirationDate = (_b = (0, exports.getDate)(verifiableCredential.expirationDate, verifiableCredential.validTo, verifiableCredential.exp)) !== null && _b !== void 0 ? _b : 0;
301
+ issueDate = (0, exports.getDate)(verifiableCredential.issuanceDate, verifiableCredential.validFrom, verifiableCredential.nbf, verifiableCredential.iat);
302
+ return [4, (0, exports.selectAppLocaleBranding)({ localeBranding: branding })];
303
+ case 1:
304
+ localeBranding = _d.sent();
305
+ credentialStatus = (0, utils_2.getCredentialStatus)(verifiableCredential);
306
+ title = (0, exports.getCredentialDisplayName)({ verifiableCredential: verifiableCredential, localeBranding: localeBranding });
307
+ return [4, (0, exports.toCredentialDetailsRow)({
308
+ object: __assign(__assign({}, (_c = verifiableCredential.vc) === null || _c === void 0 ? void 0 : _c.credentialSubject), verifiableCredential.credentialSubject),
309
+ subject: subject,
310
+ issuer: issuer,
311
+ branding: localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.claims
312
+ })];
313
+ case 2:
314
+ properties = _d.sent();
315
+ logo = (0, utils_2.getIssuerLogo)(verifiableCredential, localeBranding);
316
+ url = verifiableCredential.issuer && typeof verifiableCredential.issuer !== 'string' ? verifiableCredential.issuer.url : undefined;
317
+ _a = (0, exports.getCredentialIssuerNameAndAlias)({ verifiableCredential: verifiableCredential, issuer: issuer }), issuerName = _a.issuerName, issuerAlias = _a.issuerAlias;
318
+ termsOfUse = getTermsOfUse({ verifiableCredential: verifiableCredential });
319
+ return [2, {
320
+ hash: hash,
321
+ id: verifiableCredential.id,
322
+ title: title,
323
+ credentialStatus: credentialStatus,
324
+ credentialRole: credentialRole,
325
+ issueDate: issueDate,
326
+ expirationDate: expirationDate,
327
+ properties: properties,
328
+ branding: localeBranding,
329
+ termsOfUse: termsOfUse,
330
+ issuer: {
331
+ name: issuerName,
332
+ alias: issuerAlias ? (issuerAlias.length > 50 ? "".concat(issuerAlias.substring(0, 50), "...") : issuerAlias) : '',
333
+ image: logo,
334
+ url: url
335
+ }
336
+ }];
337
+ }
337
338
  });
338
- };
339
+ }); };
339
340
  exports.toCredentialSummary = toCredentialSummary;
340
341
  var selectAppLocaleBranding = function (args) { return __awaiter(void 0, void 0, void 0, function () {
341
342
  var appLocale, localeBranding, logo, imagePreloader, ReactNativeImagePreloader, WebImagePreloader, backgroundImage;
@@ -1,5 +1,7 @@
1
1
  import { CredentialStatus, ImageSize, IssuerStatus } from '@sphereon/ui-components.core';
2
- import { CredentialRole, IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding } from '@sphereon/ssi-sdk.data-store';
2
+ import { CredentialRole, IBasicCredentialClaim, IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store';
3
+ import { ICredential } from '@sphereon/ssi-types';
4
+ import { VerifiableCredential } from '@veramo/core';
3
5
  export type CredentialSummary = {
4
6
  hash: string;
5
7
  id?: string;
@@ -28,8 +30,42 @@ export type CredentialDetailsRow = {
28
30
  isEditable?: boolean;
29
31
  status?: LabelStatus;
30
32
  imageSize?: ImageSize;
33
+ onPress?: () => Promise<void>;
31
34
  };
32
35
  export type LabelStatus = CredentialStatus | IssuerStatus;
33
36
  export interface ISelectAppLocaleBrandingArgs {
34
37
  localeBranding?: Array<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding>;
35
38
  }
39
+ export type ToCredentialDetailsRowArgs = {
40
+ object: Record<string, any>;
41
+ parentKey?: string;
42
+ subject?: Party;
43
+ issuer?: Party;
44
+ branding?: Array<IBasicCredentialClaim>;
45
+ };
46
+ export type ToNonPersistedCredentialSummaryArgs = {
47
+ verifiableCredential: ICredential | VerifiableCredential;
48
+ credentialRole: CredentialRole;
49
+ branding?: Array<IBasicCredentialLocaleBranding>;
50
+ issuer?: Party;
51
+ subject?: Party;
52
+ };
53
+ export type GetCredentialDisplayNameArgs = {
54
+ verifiableCredential: VerifiableCredential;
55
+ localeBranding?: IBasicCredentialLocaleBranding;
56
+ };
57
+ export type GetCredentialIssuerNameAndAliasArgs = {
58
+ verifiableCredential: VerifiableCredential;
59
+ issuer?: Party;
60
+ };
61
+ export type GetTermsOfUseArgs = {
62
+ verifiableCredential: VerifiableCredential;
63
+ };
64
+ export type ToCredentialSummaryArgs = {
65
+ verifiableCredential: VerifiableCredential;
66
+ hash: string;
67
+ credentialRole: CredentialRole;
68
+ branding?: Array<IBasicCredentialLocaleBranding>;
69
+ issuer?: Party;
70
+ subject?: Party;
71
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sphereon/ui-components.credential-branding",
3
3
  "private": false,
4
- "version": "0.3.1-unstable.5+14fb900",
4
+ "version": "0.4.1-unstable.2+64023ed",
5
5
  "description": "SSI UI components credential branding",
6
6
  "repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
7
7
  "author": "Sphereon <dev@sphereon.com>",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@sphereon/ssi-sdk.core": "0.29.0",
32
- "@sphereon/ssi-sdk.data-store": "0.29.0",
33
- "@sphereon/ssi-types": "0.29.0",
34
- "@sphereon/ui-components.core": "0.3.1-unstable.5+14fb900",
31
+ "@sphereon/ssi-sdk.core": "^0.33",
32
+ "@sphereon/ssi-sdk.data-store": "^0.33",
33
+ "@sphereon/ssi-types": "^0.33",
34
+ "@sphereon/ui-components.core": "0.4.1-unstable.2+64023ed",
35
35
  "@veramo/core": "4.2.0",
36
36
  "@veramo/utils": "4.2.0",
37
37
  "i18n-js": "^3.8.0",
@@ -39,14 +39,17 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/i18n-js": "^3.8.4",
42
+ "@types/jest": "^29.5.12",
42
43
  "@types/node": "^20.4.0",
43
- "@types/react": "~18.2.79",
44
+ "@types/react": "~18.3.18",
44
45
  "@types/uuid": "^9.0.8",
45
- "react": "18.2.0",
46
+ "jest": "^29.7.0",
47
+ "react": "18.3.1",
48
+ "ts-jest": "^29.2.5",
46
49
  "typescript": "4.9.5"
47
50
  },
48
51
  "peerDependencies": {
49
- "react": ">= 18"
52
+ "react": ">= 18.2"
50
53
  },
51
- "gitHead": "14fb900e9a7fffa91ed70500402d470afa5aa5b3"
54
+ "gitHead": "64023ed017c2754d1fcfef36d3f3dee0bf428777"
52
55
  }