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:
Matthew Raymer
2025-06-23 10:30:08 +00:00
parent 360f00c073
commit d359263704
48 changed files with 141 additions and 205 deletions

View File

@@ -324,20 +324,12 @@ import {
NotificationIface,
DEFAULT_PARTNER_API_SERVER,
} from "../constants/app";
import {
db,
logConsoleAndDb,
retrieveSettingsForActiveAccount,
} from "../db/index";
import { logConsoleAndDb } from "../db/index";
import { Contact } from "../db/tables/contacts";
import { BoundingBox } from "../db/tables/settings";
import * as databaseUtil from "../db/databaseUtil";
import { PlanData } from "../interfaces";
import {
didInfo,
errorStringForLog,
getHeaders,
} from "../libs/endorserServer";
import { didInfo, errorStringForLog, getHeaders } from "../libs/endorserServer";
import { OnboardPage, retrieveAccountDids } from "../libs/util";
import { logger } from "../utils/logger";
import { UserProfile } from "@/libs/partnerServer";
@@ -396,7 +388,6 @@ export default class DiscoverView extends Vue {
didInfo = didInfo;
async mounted() {
this.searchTerms = this.$route.query["searchText"]?.toString() || "";
const searchPeople = !!this.$route.query["searchPeople"];
@@ -410,7 +401,9 @@ export default class DiscoverView extends Vue {
const platformService = PlatformServiceFactory.getInstance();
const dbContacts = await platformService.dbQuery("SELECT * FROM contacts");
this.allContacts = databaseUtil.mapQueryResultToValues(dbContacts) as unknown as Contact[];
this.allContacts = databaseUtil.mapQueryResultToValues(
dbContacts,
) as unknown as Contact[];
this.allMyDids = await retrieveAccountDids();
@@ -504,7 +497,8 @@ export default class DiscoverView extends Vue {
} else {
throw JSON.stringify(results);
}
} else { // people search must be active
} else {
// people search must be active
this.projects = [];
const profiles: UserProfile[] = results.data;
if (profiles) {
@@ -707,7 +701,8 @@ export default class DiscoverView extends Vue {
this.clearMarkers();
const results = await response.json();
if (results.data?.tiles?.length > 0) {
for (const tile: Tile of results.data.tiles) {
for (const t of results.data.tiles) {
const tile: Tile = t;
const pinLat = (tile.minFoundLat + tile.maxFoundLat) / 2;
const pinLon = (tile.minFoundLon + tile.maxFoundLon) / 2;
const numberIcon = L.divIcon({