Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-chicken-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@learncard/vc-templates-plugin": patch
---

[LC-914] Add network field types and update context definitions
252 changes: 252 additions & 0 deletions packages/learn-card-contexts/boosts/1.0.2.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
4 changes: 4 additions & 0 deletions packages/plugins/vc-templates/src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const VC_TEMPLATES: {
display,
familyTitles,
skills,
network,
groupID = '',
} = {},
crypto
Expand Down Expand Up @@ -153,6 +154,7 @@ export const VC_TEMPLATES: {
image: boostImage,
attachments,
skills,
...(network ? { network } : {}),
groupID,
}),
boostID: (
Expand All @@ -175,6 +177,7 @@ export const VC_TEMPLATES: {
display,
familyTitles,
boostID,
network,
groupID = '',
} = {},
crypto
Expand Down Expand Up @@ -221,6 +224,7 @@ export const VC_TEMPLATES: {
attachments,
skills,
boostID,
...(network ? { network } : {}),
groupID,
}),
delegate: (
Expand Down
7 changes: 7 additions & 0 deletions packages/plugins/vc-templates/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -94,6 +100,7 @@ export type BoostTemplate = {
familyTitles?: BoostFamilyTitles;
boostID?: BoostID;
address?: AddressSpec;
network?: BoostNetworkFields;
groupID?: string;
};

Expand Down
Loading