From 55dc8cb2a41093091d56784aa085c12f90b58ea9 Mon Sep 17 00:00:00 2001 From: Garrett Hopper Date: Mon, 5 Jun 2023 08:53:02 -0600 Subject: [PATCH 1/2] Add geolocation to address VC data type --- packages/vc-data/package-lock.json | 4 ++-- packages/vc-data/package.json | 2 +- packages/vc-data/src/address/v2.ts | 12 ++++++++---- packages/vc-data/src/base/v2.ts | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/packages/vc-data/package-lock.json b/packages/vc-data/package-lock.json index 3b675fa..57507ca 100644 --- a/packages/vc-data/package-lock.json +++ b/packages/vc-data/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bloomprotocol/vc-data", - "version": "0.1.40", + "version": "0.1.54", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bloomprotocol/vc-data", - "version": "0.1.40", + "version": "0.1.54", "license": "Apache-2.0", "dependencies": { "@ahryman40k/ts-fhir-types": "^4.0.34", diff --git a/packages/vc-data/package.json b/packages/vc-data/package.json index 6f83d2b..ebda621 100644 --- a/packages/vc-data/package.json +++ b/packages/vc-data/package.json @@ -1,7 +1,7 @@ { "name": "@bloomprotocol/vc-data", "description": "Data types for verifiable credentials (forked from @affinidi/vc-data)", - "version": "0.1.53", + "version": "0.1.54", "author": "Bloom Team ", "license": "Apache-2.0", "repository": "https://github.com/hellobloom/ssi-sdk/tree/main/packages/vc-data", diff --git a/packages/vc-data/src/address/v2.ts b/packages/vc-data/src/address/v2.ts index 0131446..8912cb2 100644 --- a/packages/vc-data/src/address/v2.ts +++ b/packages/vc-data/src/address/v2.ts @@ -1,23 +1,27 @@ import { CreateVCType, createSubjectContext, createContextConfig, createContext } from '../util/v2' -import { PostalAddressV2, postalAddressV2Context } from '../base/v2' +import { PostalAddressV2, postalAddressV2Context, GeoCoordinates as GeoCoordinates, geoCoordinatesContext } from '../base/v2' export type AddressPersonV2 = { '@type': 'AddressPerson' address: string | PostalAddressV2 + geo?: GeoCoordinates } export type VCAddressPersonV2Type = 'AddressCredentialPersonV2' export const getVCAddressPersonV2ContextConfig = () => { - const phonePersonContext = createSubjectContext({ + const addressPersonContext = createSubjectContext({ type: 'AddressPerson', base: 'bloomSchema', - properties: { address: 'schema' }, + properties: { + address: 'schema', + geo: 'schema', + }, }) return createContextConfig({ type: 'AddressCredentialPersonV2', - subjects: [phonePersonContext, postalAddressV2Context], + subjects: [addressPersonContext, postalAddressV2Context, geoCoordinatesContext], }) } diff --git a/packages/vc-data/src/base/v2.ts b/packages/vc-data/src/base/v2.ts index b7fc634..40a8fdc 100644 --- a/packages/vc-data/src/base/v2.ts +++ b/packages/vc-data/src/base/v2.ts @@ -70,6 +70,21 @@ export const postalAddressV2Context = createSubjectContext({ }, }) +export type GeoCoordinates = { + '@type': 'GeoCoordinates' + latitude?: number + longitude?: number +} + +export const geoCoordinatesContext = createSubjectContext({ + type: 'GeoCoordinates', + base: 'schema', + properties: { + latitude: 'schema', + longitude: 'schema', + }, +}) + export type GenericOrgType = { '@type': string; name?: string; address?: OneOrMore } export type OrganizationV2 = { From 6492cb483ac62f00efd921acaa5a737d9f030519 Mon Sep 17 00:00:00 2001 From: djvs Date: Thu, 8 Jun 2023 12:09:59 -0400 Subject: [PATCH 2/2] accreditation identifier --- packages/vc-data/package.json | 2 +- packages/vc-data/src/accreditation/v2.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vc-data/package.json b/packages/vc-data/package.json index 6f83d2b..ebda621 100644 --- a/packages/vc-data/package.json +++ b/packages/vc-data/package.json @@ -1,7 +1,7 @@ { "name": "@bloomprotocol/vc-data", "description": "Data types for verifiable credentials (forked from @affinidi/vc-data)", - "version": "0.1.53", + "version": "0.1.54", "author": "Bloom Team ", "license": "Apache-2.0", "repository": "https://github.com/hellobloom/ssi-sdk/tree/main/packages/vc-data", diff --git a/packages/vc-data/src/accreditation/v2.ts b/packages/vc-data/src/accreditation/v2.ts index be6e5cc..20a7c12 100644 --- a/packages/vc-data/src/accreditation/v2.ts +++ b/packages/vc-data/src/accreditation/v2.ts @@ -53,6 +53,7 @@ export type AccreditationPersonV2 = { email?: string birthDate?: string + identifier?: string name?: string givenName?: string additionalName?: string @@ -72,6 +73,7 @@ export const getVCAccreditationPersonV2ContextConfig = () => { address: 'schema', birthDate: 'schema', + identifier: 'schema', email: 'schema', name: 'schema', givenName: 'schema',