Skip to content
Merged
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
22 changes: 22 additions & 0 deletions public/contracts/artifacts/contracts/mdbase.contact/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
kind: mdbase.contract
contract_type: record
id: mdbase.contact
version: 1.0.0
name: Contact
description: A compact application-facing view of a person or organisation.
record_schema:
dialect: json-schema-2020-12
ref: ../../schemas/mdbase.contact/1.0.0.schema.json
---

# Contact

This contract exposes the small set of contact semantics commonly shared by
address books, relationship tools, and other applications. A collection keeps
its own field names and may store richer local data; the implementing type maps
only the fields it wants applications to see.

The contract is deliberately not an interchange format. Exporters can convert
this view to JSContact, vCard, or another wire representation without requiring
Markdown records to store that representation directly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mdbase.dev/contracts/schemas/mdbase.contact/1.0.0.schema.json",
"title": "Contact",
"description": "A compact application-facing contact view.",
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name applications should use when presenting this contact."
},
"kind": {
"type": "string",
"enum": ["individual", "organisation", "group"],
"description": "The broad kind of contact when the collection distinguishes it."
},
"primary_email": {
"type": "string",
"format": "email",
"description": "The preferred email address for this contact."
},
"primary_phone": {
"type": "string",
"minLength": 1,
"description": "The preferred telephone number for this contact."
},
"organisation": {
"type": "string",
"minLength": 1,
"description": "The organisation most closely associated with this contact."
},
"birthday": {
"type": "string",
"format": "date",
"description": "The contact's birthday when known."
}
},
"additionalProperties": false
}
76 changes: 76 additions & 0 deletions public/contracts/artifacts/types/contact/2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
kind: mdbase.type
name: contact
version: 1
description: A person or organisation you want to stay in touch with
match:
where:
type: contact
schema:
dialect: json-schema-2020-12
value:
$schema: https://json-schema.org/draft/2020-12/schema
title: Contact
description: A friendly local contact with room for collection-specific fields.
type: object
required:
- type
- name
properties:
type:
const: contact
name:
type: string
minLength: 1
description: The name shown in contact lists.
kind:
type: string
enum:
- individual
- organisation
- group
default: individual
description: The broad kind of contact.
email:
type: string
format: email
description: The preferred email address.
phone:
type: string
minLength: 1
description: The preferred telephone number.
organisation:
type: string
minLength: 1
description: The contact's main organisation.
birthday:
type: string
format: date
description: The contact's birthday.
additionalProperties: true
collection:
display:
name_field: name
description_field: organisation
icon: address-book
implements:
- contract: mdbase.contact
version: 1.0.0
fields:
name: name
kind: kind
primary_email: email
primary_phone: phone
organisation: organisation
birthday: birthday
---

# Contact

Contact notes use familiar frontmatter fields and leave the Markdown body free
for history, context, and anything else worth remembering. Applications using
the `mdbase.contact` contract see only the mapped contact fields.

You can rename or extend the local fields in mdbase-editor. Keep the contract
mapping aligned so other contact-aware applications continue to understand
the type.
42 changes: 16 additions & 26 deletions public/contracts/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,14 @@
},
"contracts": [
{
"id": "mdbase.jscontact.card",
"version": "2.0.0",
"name": "JSContact Card 2.0 core",
"description": "A strict, portable core profile of an IETF JSContact 2.0 Card.",
"id": "mdbase.contact",
"version": "1.0.0",
"name": "Contact",
"description": "A compact application-facing view of a person or organisation.",
"contract_type": "record",
"digest": "sha256:c56c5acbf7992155d6890294842a261fe80a933ec75a226ea875b97ba57dcaa2",
"artifact": "./artifacts/contracts/mdbase.jscontact.card/2.0.0.md",
"standards": [
{
"name": "JSContact",
"version": "2.0",
"scope": "Strict core profile covering the Card envelope, names, email addresses, phones, organizations, and notes.",
"references": [
"https://www.rfc-editor.org/rfc/rfc9553.html",
"https://www.rfc-editor.org/rfc/rfc9982.html"
]
}
]
"digest": "sha256:e3634a35737ada5eb62e3e15f1c0c9d2e27c55a3f98dfab94bbc14c40404903d",
"artifact": "./artifacts/contracts/mdbase.contact/1.0.0.md",
"standards": []
},
{
"id": "mdbase.record.created",
Expand Down Expand Up @@ -192,27 +182,27 @@
],
"packs": [
{
"id": "mdbase.jscontact",
"version": "2.0.3",
"id": "mdbase.contact",
"version": "1.0.0",
"name": "Contact type pack",
"description": "The mdbase JSContact Card core contract and a fully expanded, editable Contact type.",
"digest": "sha256:e89693733a9d3d98bdd05fc040a08d7fb6f5eaea22089ed4ef8e0f1392e9c269",
"provision": "./packs/mdbase.jscontact/2.0.3.json",
"description": "A compact contact contract and a friendly, editable Contact type.",
"digest": "sha256:f5be1e7ea7b8dacda628d0cd809eb02cbad965505dc44c98bbd709ffb4847330",
"provision": "./packs/mdbase.contact/1.0.0.json",
"provides": [
{
"id": "mdbase.jscontact.card",
"version": "2.0.0"
"id": "mdbase.contact",
"version": "1.0.0"
}
],
"resource_count": 3,
"display": {
"name": "Contact",
"summary": "Store people and organisations with names, email addresses, phone numbers, and notes.",
"summary": "Keep people and organisations with familiar names, email addresses, phone numbers, and birthdays.",
"category": "people",
"audience": "general",
"icon": "address-book",
"badges": [
"JSContact 2.0"
"Portable contact semantics"
]
},
"installation": {
Expand Down
49 changes: 49 additions & 0 deletions public/contracts/packs/mdbase.contact/1.0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"manifest": {
"kind": "mdbase.type-pack",
"id": "mdbase.contact",
"version": "1.0.0",
"name": "Contact type pack",
"description": "A compact contact contract and a friendly, editable Contact type.",
"resources": [
{
"kind": "schema",
"source": "schemas/mdbase.contact/1.0.0.schema.json",
"target": "schemas/mdbase.contact/1.0.0.schema.json",
"digest": "sha256:bd8a011d18c71164b633f4e82cb33faa5b658cdba4f89312a34c13bf46a350d2"
},
{
"kind": "contract",
"source": "contracts/mdbase.contact/1.0.0.md",
"target": "_contracts/mdbase.contact/1.0.0.md",
"digest": "sha256:e3634a35737ada5eb62e3e15f1c0c9d2e27c55a3f98dfab94bbc14c40404903d"
},
{
"kind": "type",
"source": "types/contact/2.md",
"target": "_types/contact.md",
"digest": "sha256:c925ac22674b5fa9b1a7b8b3af827e5ce3ba15e423b64487f626f5ab4cc1c80a"
}
]
},
"resources": [
{
"source": "schemas/mdbase.contact/1.0.0.schema.json",
"document": "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://mdbase.dev/contracts/schemas/mdbase.contact/1.0.0.schema.json\",\n \"title\": \"Contact\",\n \"description\": \"A compact application-facing contact view.\",\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The name applications should use when presenting this contact.\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\"individual\", \"organisation\", \"group\"],\n \"description\": \"The broad kind of contact when the collection distinguishes it.\"\n },\n \"primary_email\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"The preferred email address for this contact.\"\n },\n \"primary_phone\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The preferred telephone number for this contact.\"\n },\n \"organisation\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The organisation most closely associated with this contact.\"\n },\n \"birthday\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"The contact's birthday when known.\"\n }\n },\n \"additionalProperties\": false\n}\n"
},
{
"source": "contracts/mdbase.contact/1.0.0.md",
"document": "---\nkind: mdbase.contract\ncontract_type: record\nid: mdbase.contact\nversion: 1.0.0\nname: Contact\ndescription: A compact application-facing view of a person or organisation.\nrecord_schema:\n dialect: json-schema-2020-12\n ref: ../../schemas/mdbase.contact/1.0.0.schema.json\n---\n\n# Contact\n\nThis contract exposes the small set of contact semantics commonly shared by\naddress books, relationship tools, and other applications. A collection keeps\nits own field names and may store richer local data; the implementing type maps\nonly the fields it wants applications to see.\n\nThe contract is deliberately not an interchange format. Exporters can convert\nthis view to JSContact, vCard, or another wire representation without requiring\nMarkdown records to store that representation directly.\n"
},
{
"source": "types/contact/2.md",
"document": "---\nkind: mdbase.type\nname: contact\nversion: 1\ndescription: A person or organisation you want to stay in touch with\nmatch:\n where:\n type: contact\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n title: Contact\n description: A friendly local contact with room for collection-specific fields.\n type: object\n required:\n - type\n - name\n properties:\n type:\n const: contact\n name:\n type: string\n minLength: 1\n description: The name shown in contact lists.\n kind:\n type: string\n enum:\n - individual\n - organisation\n - group\n default: individual\n description: The broad kind of contact.\n email:\n type: string\n format: email\n description: The preferred email address.\n phone:\n type: string\n minLength: 1\n description: The preferred telephone number.\n organisation:\n type: string\n minLength: 1\n description: The contact's main organisation.\n birthday:\n type: string\n format: date\n description: The contact's birthday.\n additionalProperties: true\ncollection:\n display:\n name_field: name\n description_field: organisation\n icon: address-book\nimplements:\n - contract: mdbase.contact\n version: 1.0.0\n fields:\n name: name\n kind: kind\n primary_email: email\n primary_phone: phone\n organisation: organisation\n birthday: birthday\n---\n\n# Contact\n\nContact notes use familiar frontmatter fields and leave the Markdown body free\nfor history, context, and anything else worth remembering. Applications using\nthe `mdbase.contact` contract see only the mapped contact fields.\n\nYou can rename or extend the local fields in mdbase-editor. Keep the contract\nmapping aligned so other contact-aware applications continue to understand\nthe type.\n"
}
],
"provides": [
{
"id": "mdbase.contact",
"version": "1.0.0"
}
]
}
41 changes: 41 additions & 0 deletions public/contracts/schemas/mdbase.contact/1.0.0.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mdbase.dev/contracts/schemas/mdbase.contact/1.0.0.schema.json",
"title": "Contact",
"description": "A compact application-facing contact view.",
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "The name applications should use when presenting this contact."
},
"kind": {
"type": "string",
"enum": ["individual", "organisation", "group"],
"description": "The broad kind of contact when the collection distinguishes it."
},
"primary_email": {
"type": "string",
"format": "email",
"description": "The preferred email address for this contact."
},
"primary_phone": {
"type": "string",
"minLength": 1,
"description": "The preferred telephone number for this contact."
},
"organisation": {
"type": "string",
"minLength": 1,
"description": "The organisation most closely associated with this contact."
},
"birthday": {
"type": "string",
"format": "date",
"description": "The contact's birthday when known."
}
},
"additionalProperties": false
}
62 changes: 61 additions & 1 deletion public/testbed/v0.1/fixtures/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
}
}
},
"contract.example-summary": {
"kind": "contract",
"value": {
"kind": "mdbase.contract",
"contract_type": "record",
"id": "example.summary",
"version": "1.0.0",
"name": "Portable example summary",
"record_schema": {
"dialect": "json-schema-2020-12",
"value": {
"type": "object",
"required": ["label"],
"additionalProperties": false,
"properties": {
"label": { "type": "string", "minLength": 1 },
"category": { "type": "string", "minLength": 1 }
}
}
}
}
},
"type.shared-note": {
"kind": "type",
"value": {
Expand Down Expand Up @@ -51,11 +73,49 @@
]
}
},
"type.multi-contract-note": {
"kind": "type",
"value": {
"kind": "mdbase.type",
"name": "shared_note",
"version": 1,
"schema": {
"dialect": "json-schema-2020-12",
"value": {
"type": "object",
"required": ["type", "headline", "category"],
"properties": {
"type": { "const": "shared_note" },
"headline": { "type": "string", "minLength": 1 },
"category": { "type": "string", "minLength": 1 }
}
}
},
"implements": [
{
"contract": "example.note",
"version": "1.0.0",
"fields": {
"title": "headline"
}
},
{
"contract": "example.summary",
"version": "1.0.0",
"fields": {
"label": "headline",
"category": "category"
}
}
]
}
},
"record.shared-note": {
"kind": "record",
"value": {
"type": "shared_note",
"headline": "One record, two consumers"
"headline": "One record, two consumers",
"category": "reference"
}
},
"contract.record-changed": {
Expand Down
Loading