diff --git a/.changeset/warm-chicken-heal.md b/.changeset/warm-chicken-heal.md new file mode 100644 index 0000000000..5371a53813 --- /dev/null +++ b/.changeset/warm-chicken-heal.md @@ -0,0 +1,5 @@ +--- +"@learncard/vc-templates-plugin": patch +--- + +[LC-914] Add network field types and update context definitions diff --git a/packages/learn-card-contexts/boosts/1.0.2.json b/packages/learn-card-contexts/boosts/1.0.2.json new file mode 100644 index 0000000000..63651a028d --- /dev/null +++ b/packages/learn-card-contexts/boosts/1.0.2.json @@ -0,0 +1,252 @@ +{ + "@context": { + "id": "@id", + "type": "@type", + "lcn": "https://docs.learncard.com/definitions#", + "cred": "https://www.w3.org/2018/credentials#", + "xsd": "https://www.w3.org/2001/XMLSchema#", + "BoostCredential": { + "@context": { + "address": { + "@id": "https://purl.imsglobal.org/spec/vc/ob/vocab.html#Address" + }, + "network": { + "@id": "lcn:boostNetwork", + "@context": { + "networkType": { + "@id": "lcn:boostNetworkType", + "@type": "xsd:string" + }, + "country": { + "@id": "lcn:boostNetworkCountry", + "@type": "xsd:string" + }, + "region": { + "@id": "lcn:boostNetworkRegion", + "@type": "xsd:string" + }, + "organization": { + "@id": "lcn:boostNetworkOrganization", + "@type": "xsd:string" + } + } + }, + "attachments": { + "@container": "@set", + "@context": { + "title": { + "@id": "lcn:boostAttachmentTitle", + "@type": "xsd:string" + }, + "type": { + "@id": "lcn:boostAttachmentType", + "@type": "xsd:string" + }, + "url": { + "@id": "lcn:boostAttachmentUrl", + "@type": "xsd:string" + }, + "fileName": { + "@id": "lcn:boostAttachmentFileName", + "@type": "xsd:string" + }, + "fileSize": { + "@id": "lcn:boostAttachmentFileSize", + "@type": "xsd:string" + }, + "fileType": { + "@id": "lcn:boostAttachmentFileType", + "@type": "xsd:string" + } + }, + "@id": "lcn:boostAttachments" + }, + "boostId": { + "@id": "lcn:boostId", + "@type": "xsd:string" + }, + "display": { + "@context": { + "backgroundColor": { + "@id": "lcn:boostBackgroundColor", + "@type": "xsd:string" + }, + "backgroundImage": { + "@id": "lcn:boostBackgroundImage", + "@type": "xsd:string" + }, + "displayType": { + "@id": "lcn:boostDisplayType", + "@type": "xsd:string" + }, + "emoji": { + "@context": { + "activeSkinTone": { + "@id": "lcn:boostEmojiActiveSkinTone", + "@type": "xsd:string" + }, + "imageUrl": { + "@id": "lcn:boostEmojiImageUrl", + "@type": "xsd:string" + }, + "names": { + "@container": "@set", + "@id": "lcn:boostEmojiNames", + "@type": "xsd:string" + }, + "unified": { + "@id": "lcn:boostEmojiUnified", + "@type": "xsd:string" + }, + "unifiedWithoutSkinTone": { + "@id": "lcn:boostEmojiUnifiedWithoutSkinTone", + "@type": "xsd:string" + } + }, + "@id": "lcn:boostEmoji" + }, + "fadeBackgroundImage": { + "@id": "lcn:boostFadeBackgroundImage", + "@type": "xsd:boolean" + }, + "repeatBackgroundImage": { + "@id": "lcn:boostRepeatBackgroundImage", + "@type": "xsd:boolean" + } + }, + "@id": "lcn:boostDisplay" + }, + "familyTitles": { + "@context": { + "dependents": { + "@container": "@set", + "@context": { + "plural": { + "@id": "lcn:plural", + "@type": "xsd:string" + }, + "singular": { + "@id": "lcn:singular", + "@type": "xsd:string" + } + }, + "@id": "lcn:dependents" + }, + "guardians": { + "@container": "@set", + "@context": { + "plural": { + "@id": "lcn:plural", + "@type": "xsd:string" + }, + "singular": { + "@id": "lcn:singular", + "@type": "xsd:string" + } + }, + "@id": "lcn:guardians" + } + }, + "@id": "lcn:familyTitles" + }, + "groupID": { + "@id": "lcn:groupID", + "@type": "xsd:string" + }, + "skills": { + "@container": "@set", + "@context": { + "category": { + "@id": "lcn:boostSkillCategory", + "@type": "xsd:string" + }, + "skill": { + "@id": "lcn:boostSkill", + "@type": "xsd:string" + }, + "subskills": { + "@container": "@set", + "@id": "lcn:boostSubskills", + "@type": "xsd:string" + } + }, + "@id": "lcn:boostSkills" + } + }, + "@id": "lcn:boostCredential" + }, + "BoostID": { + "@id": "lcn:boostID", + "@context": { + "boostID": { + "@id": "lcn:boostIDField", + "@context": { + "fontColor": { + "@id": "lcn:boostIDFontColor", + "@type": "xsd:string" + }, + "accentColor": { + "@id": "lcn:boostIDAccentColor", + "@type": "xsd:string" + }, + "backgroundImage": { + "@id": "lcn:boostIDBackgroundImage", + "@type": "xsd:string" + }, + "dimBackgroundImage": { + "@id": "lcn:boostIDDimBackgroundImage", + "@type": "xsd:boolean" + }, + "issuerThumbnail": { + "@id": "lcn:boostIDIssuerThumbnail", + "@type": "xsd:string" + }, + "showIssuerThumbnail": { + "@id": "lcn:boostIDShowIssuerThumbnail", + "@type": "xsd:boolean" + }, + "IDIssuerName": { + "@id": "lcn:boostIDIssuerName", + "@type": "xsd:string" + }, + "idThumbnail": { + "@id": "lcn:boostIDThumbnail", + "@type": "xsd:string" + }, + "accentFontColor": { + "@id": "lcn:boostIDFontColor", + "@type": "xsd:string" + }, + "idBackgroundColor": { + "@id": "lcn:boostIDBackgroundColor", + "@type": "xsd:string" + }, + "repeatIdBackgroundImage": { + "@id": "lcn:boostIDRepeatIdBackgroundImage", + "@type": "xsd:boolean" + }, + "idDescription": { + "@id": "lcn:boostIDDescription", + "@type": "xsd:string" + } + } + } + } + }, + "CertifiedBoostCredential": { + "@id": "lcn:certifiedBoostCredential", + "@context": { + "@version": 1.1, + "boostId": { + "@id": "lcn:boostId", + "@type": "xsd:string" + }, + "boostCredential": { + "@id": "cred:VerifiableCredential", + "@type": "@id", + "@container": "@graph" + } + } + } + } +} diff --git a/packages/plugins/vc-templates/src/templates.ts b/packages/plugins/vc-templates/src/templates.ts index 2294d38e26..3aa2c26092 100644 --- a/packages/plugins/vc-templates/src/templates.ts +++ b/packages/plugins/vc-templates/src/templates.ts @@ -118,6 +118,7 @@ export const VC_TEMPLATES: { display, familyTitles, skills, + network, groupID = '', } = {}, crypto @@ -153,6 +154,7 @@ export const VC_TEMPLATES: { image: boostImage, attachments, skills, + ...(network ? { network } : {}), groupID, }), boostID: ( @@ -175,6 +177,7 @@ export const VC_TEMPLATES: { display, familyTitles, boostID, + network, groupID = '', } = {}, crypto @@ -221,6 +224,7 @@ export const VC_TEMPLATES: { attachments, skills, boostID, + ...(network ? { network } : {}), groupID, }), delegate: ( diff --git a/packages/plugins/vc-templates/src/types.ts b/packages/plugins/vc-templates/src/types.ts index 6106b5af04..916e8d33fa 100644 --- a/packages/plugins/vc-templates/src/types.ts +++ b/packages/plugins/vc-templates/src/types.ts @@ -74,6 +74,12 @@ export type AddressSpec = { longitude?: number | undefined; }; }; +export type BoostNetworkFields = { + networkType?: string; + country?: string; + region?: string; + organization?: string; +}; export type BoostTemplate = { did?: string; subject?: string; @@ -94,6 +100,7 @@ export type BoostTemplate = { familyTitles?: BoostFamilyTitles; boostID?: BoostID; address?: AddressSpec; + network?: BoostNetworkFields; groupID?: string; };