@sphereon/ui-components.credential-branding 0.3.1-unstable.5 → 0.4.1-next.7
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/details/CredentialDetails.d.ts +7 -27
- package/dist/details/CredentialDetails.js +162 -161
- package/dist/types/index.d.ts +37 -1
- package/package.json +12 -9
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
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: (
|
|
14
|
-
|
|
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: (
|
|
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
|
|
111
|
-
return __generator(this, function (
|
|
112
|
-
switch (
|
|
113
|
-
case 0: return [4, (0,
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (!
|
|
119
|
-
return [4, (0,
|
|
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
|
-
|
|
122
|
-
|
|
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 (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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 (
|
|
134
|
-
var object
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
217
|
-
|
|
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 (
|
|
244
|
-
var
|
|
245
|
-
var verifiableCredential =
|
|
246
|
-
var title = (
|
|
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 (
|
|
263
|
-
var
|
|
264
|
-
var verifiableCredential =
|
|
265
|
-
var issuerName = typeof verifiableCredential.issuer === 'string' ? verifiableCredential.issuer : (
|
|
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 (
|
|
280
|
-
var 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 (
|
|
292
|
-
var verifiableCredential
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
4
|
+
"version": "0.4.1-next.7+bbe56cb",
|
|
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.
|
|
32
|
-
"@sphereon/ssi-sdk.data-store": "0.
|
|
33
|
-
"@sphereon/ssi-types": "0.
|
|
34
|
-
"@sphereon/ui-components.core": "0.
|
|
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-next.7+bbe56cb",
|
|
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.
|
|
44
|
+
"@types/react": "~18.3.18",
|
|
44
45
|
"@types/uuid": "^9.0.8",
|
|
45
|
-
"
|
|
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": "
|
|
54
|
+
"gitHead": "bbe56cbb8f611ce183e5300ee3c533541505e04f"
|
|
52
55
|
}
|