starLexicon

tcmts.records.starLexicon · #duzbgutz · term · runs anywhere

A star's lexicon: someone's word that they like a library, across its versions; one per person per library.

import { STAR_COLLECTION } from "#codebase/tcmts/records";

export const starLexicon = {
  lexicon: 1,
  id: STAR_COLLECTION,
  description: "A star on a tcm library.",
  defs: {
    main: {
      type: "record",
      description:
        "A star on a tcm library announced on the AT Protocol: its author's DID and package, across versions. Its key is <author>:<package> (with any other character as ~), so a person stars a library once.",
      key: "any",
      record: {
        type: "object",
        required: ["subject", "createdAt"],
        properties: {
          subject: { type: "ref", ref: "#subject" },
          createdAt: { type: "string", format: "datetime", description: "When it was starred." },
        },
      },
    },
    subject: {
      type: "object",
      description: "The library: who announced it, and its package's name.",
      required: ["author", "package"],
      properties: {
        author: { type: "string", format: "did", description: "Who announced the library." },
        package: {
          type: "string",
          minLength: 1,
          maxLength: 214,
          description: "The library's package name.",
        },
      },
    },
  },
} as const

uses

used by