@sphereon/ui-components.credential-branding 0.3.1-next.17 → 0.3.1-next.19
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,7 +1,12 @@
|
|
|
1
1
|
import { VerifiableCredential } from '@veramo/core';
|
|
2
2
|
import { CredentialRole, IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store';
|
|
3
|
-
import { CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
|
|
3
|
+
import { CredentialDetailsRow, CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
|
|
4
4
|
import { ICredential } from '@sphereon/ssi-types';
|
|
5
|
+
export declare const toCredentialDetailsRow: ({ object, subject, issuer, }: {
|
|
6
|
+
object: Record<string, any>;
|
|
7
|
+
subject?: Party | undefined;
|
|
8
|
+
issuer?: Party | undefined;
|
|
9
|
+
}) => Promise<CredentialDetailsRow[]>;
|
|
5
10
|
export declare const toNonPersistedCredentialSummary: ({ verifiableCredential, credentialRole, branding, issuer, subject, }: {
|
|
6
11
|
verifiableCredential: ICredential | VerifiableCredential;
|
|
7
12
|
credentialRole: CredentialRole;
|
|
@@ -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");
|
|
@@ -159,7 +159,7 @@ var toCredentialDetailsRow = function (_a) {
|
|
|
159
159
|
}
|
|
160
160
|
if (!(typeof value === 'object' && value !== null && value !== undefined)) return [3, 3];
|
|
161
161
|
_e = (_d = rows).concat;
|
|
162
|
-
return [4, toCredentialDetailsRow({ object: value, subject: subject, issuer: issuer })];
|
|
162
|
+
return [4, (0, exports.toCredentialDetailsRow)({ object: value, subject: subject, issuer: issuer })];
|
|
163
163
|
case 2:
|
|
164
164
|
rows = _e.apply(_d, [_g.sent()]);
|
|
165
165
|
return [3, 8];
|
|
@@ -202,6 +202,7 @@ var toCredentialDetailsRow = function (_a) {
|
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
|
+
exports.toCredentialDetailsRow = toCredentialDetailsRow;
|
|
205
206
|
var toNonPersistedCredentialSummary = function (_a) {
|
|
206
207
|
var verifiableCredential = _a.verifiableCredential, credentialRole = _a.credentialRole, branding = _a.branding, issuer = _a.issuer, subject = _a.subject;
|
|
207
208
|
return (0, exports.toCredentialSummary)({
|
|
@@ -233,7 +234,7 @@ var getCredentialDisplayName = function (_a) {
|
|
|
233
234
|
var _b, _c;
|
|
234
235
|
var verifiableCredential = _a.verifiableCredential, localeBranding = _a.localeBranding;
|
|
235
236
|
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);
|
|
236
|
-
if (verifiableCredential.type) {
|
|
237
|
+
if (!title && verifiableCredential.type) {
|
|
237
238
|
var types = (0, utils_1.asArray)(verifiableCredential.type).filter(function (val) { return val !== 'VerifiableCredential'; });
|
|
238
239
|
if (types.length === 1) {
|
|
239
240
|
title = types[0];
|
|
@@ -292,7 +293,7 @@ var toCredentialSummary = function (_a) {
|
|
|
292
293
|
localeBranding = _e.sent();
|
|
293
294
|
credentialStatus = (0, utils_2.getCredentialStatus)(verifiableCredential);
|
|
294
295
|
title = (0, exports.getCredentialDisplayName)({ verifiableCredential: verifiableCredential, localeBranding: localeBranding });
|
|
295
|
-
return [4, toCredentialDetailsRow({
|
|
296
|
+
return [4, (0, exports.toCredentialDetailsRow)({
|
|
296
297
|
object: __assign(__assign({}, (_d = verifiableCredential.vc) === null || _d === void 0 ? void 0 : _d.credentialSubject), verifiableCredential.credentialSubject),
|
|
297
298
|
subject: subject,
|
|
298
299
|
issuer: issuer
|
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-next.
|
|
4
|
+
"version": "0.3.1-next.19+36d5111",
|
|
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>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@sphereon/ssi-sdk.core": "0.29.0",
|
|
32
32
|
"@sphereon/ssi-sdk.data-store": "0.29.0",
|
|
33
33
|
"@sphereon/ssi-types": "0.29.0",
|
|
34
|
-
"@sphereon/ui-components.core": "0.3.1-next.
|
|
34
|
+
"@sphereon/ui-components.core": "0.3.1-next.19+36d5111",
|
|
35
35
|
"@veramo/core": "4.2.0",
|
|
36
36
|
"@veramo/utils": "4.2.0",
|
|
37
37
|
"i18n-js": "^3.8.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "36d51113c7a7496fb1c0b83392a4840ecef7d4b7"
|
|
55
55
|
}
|