forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: enhance GenericVerifiableCredential interface with explicit optional properties
- Add name, description, and agent as optional properties to GenericVerifiableCredential - Improve type safety and IntelliSense for common claim properties - Maintain backward compatibility with existing code - Reduce need for type assertions when accessing claim properties
This commit is contained in:
@@ -201,14 +201,9 @@ import QuickNav from "../components/QuickNav.vue";
|
||||
import EntityIcon from "../components/EntityIcon.vue";
|
||||
import OfferDialog from "../components/OfferDialog.vue";
|
||||
import { APP_SERVER, AppString, NotificationIface } from "../constants/app";
|
||||
import {
|
||||
db,
|
||||
logConsoleAndDb,
|
||||
retrieveSettingsForActiveAccount,
|
||||
} from "../db/index";
|
||||
import { logConsoleAndDb } from "../db/index";
|
||||
import { Contact, ContactMethod } from "../db/tables/contacts";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import { parseJsonField } from "../db/databaseUtil";
|
||||
import * as libsUtil from "../libs/util";
|
||||
import {
|
||||
capitalizeAndInsertSpacesBeforeCaps,
|
||||
@@ -272,23 +267,6 @@ function contactToDbRecord(contact: Contact): ContactDbRecord {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a ContactDbRecord back to a Contact object
|
||||
* @param record The database record to convert
|
||||
* @returns A Contact object with parsed contactMethods array
|
||||
*/
|
||||
function dbRecordToContact(record: ContactDbRecord): Contact {
|
||||
return {
|
||||
...record,
|
||||
name: safeString(record.name),
|
||||
notes: safeString(record.notes),
|
||||
profileImageUrl: safeString(record.profileImageUrl),
|
||||
publicKeyBase64: safeString(record.publicKeyBase64),
|
||||
nextPubKeyHashB64: safeString(record.nextPubKeyHashB64),
|
||||
contactMethods: parseJsonField(record.contactMethods, []),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Contact Import View Component
|
||||
* @author Matthew Raymer
|
||||
@@ -632,7 +610,6 @@ export default class ContactImportView extends Vue {
|
||||
this.activeDid,
|
||||
this.apiServer,
|
||||
this.axios,
|
||||
db,
|
||||
contact,
|
||||
true,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user