UNPKG

106 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.js","sources":["../ts/types.ts","../ts/util/guards.ts","../ts/util/version.ts","../ts/util/jsonld.ts","../ts/util/jsonSchemas.ts","../ts/util/nodeType.ts","../ts/util/microdata.ts"],"sourcesContent":["/* eslint-disable */\n\n// This file was automatically generated by `typescript.ts`.\n// Do not modify it by hand. Instead, modify the source `.schema.yaml` files\n// in the `schema` directory and run `npm run build:ts` to regenerate it.\n\n// Remove properties from an Object if their values is undefined\nconst compact = <O extends object>(o: O): O =>\n Object.entries(o).reduce(\n (compactedO: O, [k, v]) =>\n v === undefined ? compactedO : { ...compactedO, [k]: v },\n {} as O\n )\n\nexport interface Types {\n Array: Array<any>\n ArrayValidator: ArrayValidator\n Article: Article\n AudioObject: AudioObject\n BlockContent: BlockContent\n Boolean: boolean\n BooleanValidator: BooleanValidator\n Brand: Brand\n Cite: Cite\n CiteGroup: CiteGroup\n Code: Code\n CodeBlock: CodeBlock\n CodeBlockTypes: CodeBlockTypes\n CodeChunk: CodeChunk\n CodeError: CodeError\n CodeExpression: CodeExpression\n CodeFragment: CodeFragment\n CodeFragmentTypes: CodeFragmentTypes\n CodeTypes: CodeTypes\n Collection: Collection\n Comment: Comment\n ConstantValidator: ConstantValidator\n ContactPoint: ContactPoint\n ContactPointTypes: ContactPointTypes\n CreativeWork: CreativeWork\n CreativeWorkTypes: CreativeWorkTypes\n Datatable: Datatable\n DatatableColumn: DatatableColumn\n Date: Date\n DefinedTerm: DefinedTerm\n Delete: Delete\n Emphasis: Emphasis\n Entity: Entity\n EntityTypes: EntityTypes\n EnumValidator: EnumValidator\n Figure: Figure\n Function: Function\n Grant: Grant\n GrantTypes: GrantTypes\n Heading: Heading\n ImageObject: ImageObject\n Include: Include\n InlineContent: InlineContent\n IntegerValidator: IntegerValidator\n Link: Link\n List: List\n ListItem: ListItem\n Mark: Mark\n MarkTypes: MarkTypes\n Math: Math\n MathBlock: MathBlock\n MathFragment: MathFragment\n MathTypes: MathTypes\n MediaObject: MediaObject\n MediaObjectTypes: MediaObjectTypes\n MonetaryGrant: MonetaryGrant\n Node: Node\n NontextualAnnotation: NontextualAnnotation\n Null: null\n Number: number\n NumberValidator: NumberValidator\n NumberValidatorTypes: NumberValidatorTypes\n Object: object\n Organization: Organization\n Paragraph: Paragraph\n Parameter: Parameter\n Periodical: Periodical\n Person: Person\n PostalAddress: PostalAddress\n Product: Product\n PropertyValue: PropertyValue\n PublicationIssue: PublicationIssue\n PublicationVolume: PublicationVolume\n Quote: Quote\n QuoteBlock: QuoteBlock\n Review: Review\n SoftwareApplication: SoftwareApplication\n SoftwareEnvironment: SoftwareEnvironment\n SoftwareSession: SoftwareSession\n SoftwareSourceCode: SoftwareSourceCode\n StringValidator: StringValidator\n Strong: Strong\n Subscript: Subscript\n Superscript: Superscript\n Table: Table\n TableCell: TableCell\n TableRow: TableRow\n Text: Text\n ThematicBreak: ThematicBreak\n Thing: Thing\n ThingTypes: ThingTypes\n TupleValidator: TupleValidator\n ValidatorTypes: ValidatorTypes\n Variable: Variable\n VariableTypes: VariableTypes\n VideoObject: VideoObject\n VolumeMount: VolumeMount\n}\n\n/**\n * The most simple compound (ie. non-atomic like `number`, `string` etc) type.\n */\nexport interface Entity {\n type:\n | 'Entity'\n | 'ArrayValidator'\n | 'Article'\n | 'AudioObject'\n | 'BooleanValidator'\n | 'Brand'\n | 'Cite'\n | 'CiteGroup'\n | 'Code'\n | 'CodeBlock'\n | 'CodeChunk'\n | 'CodeError'\n | 'CodeExpression'\n | 'CodeFragment'\n | 'Collection'\n | 'Comment'\n | 'ConstantValidator'\n | 'ContactPoint'\n | 'CreativeWork'\n | 'Datatable'\n | 'DatatableColumn'\n | 'Date'\n | 'DefinedTerm'\n | 'Delete'\n | 'Emphasis'\n | 'EnumValidator'\n | 'Figure'\n | 'Function'\n | 'Grant'\n | 'Heading'\n | 'ImageObject'\n | 'Include'\n | 'IntegerValidator'\n | 'Link'\n | 'List'\n | 'ListItem'\n | 'Mark'\n | 'Math'\n | 'MathBlock'\n | 'MathFragment'\n | 'MediaObject'\n | 'MonetaryGrant'\n | 'NontextualAnnotation'\n | 'NumberValidator'\n | 'Organization'\n | 'Paragraph'\n | 'Parameter'\n | 'Periodical'\n | 'Person'\n | 'PostalAddress'\n | 'Product'\n | 'PropertyValue'\n | 'PublicationIssue'\n | 'PublicationVolume'\n | 'Quote'\n | 'QuoteBlock'\n | 'Review'\n | 'SoftwareApplication'\n | 'SoftwareEnvironment'\n | 'SoftwareSession'\n | 'SoftwareSourceCode'\n | 'StringValidator'\n | 'Strong'\n | 'Subscript'\n | 'Superscript'\n | 'Table'\n | 'TableCell'\n | 'TableRow'\n | 'ThematicBreak'\n | 'Thing'\n | 'TupleValidator'\n | 'Variable'\n | 'VideoObject'\n | 'VolumeMount'\n id?: string\n meta?: { [key: string]: any }\n}\n\n/**\n * Create a `Entity` node\n * @param props Object containing Entity schema properties as key/value pairs\n * @returns {Entity} Entity schema node\n */\nexport const entity = (props: Omit<Entity, 'type'> = {}): Entity => ({\n ...compact(props),\n type: 'Entity',\n})\n\n/**\n * A validator specifying constraints on an array node.\n */\nexport interface ArrayValidator extends Entity {\n type: 'ArrayValidator'\n contains?: ValidatorTypes\n itemsValidator?: ValidatorTypes\n maxItems?: number\n minItems?: number\n uniqueItems?: boolean\n}\n\n/**\n * Create a `ArrayValidator` node\n * @param props Object containing ArrayValidator schema properties as key/value pairs\n * @returns {ArrayValidator} ArrayValidator schema node\n */\nexport const arrayValidator = (\n props: Omit<ArrayValidator, 'type'> = {}\n): ArrayValidator => ({\n ...compact(props),\n type: 'ArrayValidator',\n})\n\n/**\n * A schema specifying that a node must be a boolean value.\n */\nexport interface BooleanValidator extends Entity {\n type: 'BooleanValidator'\n}\n\n/**\n * Create a `BooleanValidator` node\n * @param props Object containing BooleanValidator schema properties as key/value pairs\n * @returns {BooleanValidator} BooleanValidator schema node\n */\nexport const booleanValidator = (\n props: Omit<BooleanValidator, 'type'> = {}\n): BooleanValidator => ({\n ...compact(props),\n type: 'BooleanValidator',\n})\n\n/**\n * A reference to a CreativeWork that is cited in another CreativeWork.\n */\nexport interface Cite extends Entity {\n type: 'Cite'\n target: string\n citationMode?: 'normal' | 'suppressAuthor'\n content?: Array<InlineContent>\n pageEnd?: number | string\n pageStart?: number | string\n pagination?: string\n prefix?: string\n suffix?: string\n}\n\n/**\n * Create a `Cite` node\n * @param props Object containing Cite schema properties as key/value pairs\n * @returns {Cite} Cite schema node\n */\nexport const cite = (props: Omit<Cite, 'type'>): Cite => ({\n ...compact(props),\n type: 'Cite',\n})\n\n/**\n * A group of `Cite` nodes\n */\nexport interface CiteGroup extends Entity {\n type: 'CiteGroup'\n items: Array<Cite>\n}\n\n/**\n * Create a `CiteGroup` node\n * @param props Object containing CiteGroup schema properties as key/value pairs\n * @returns {CiteGroup} CiteGroup schema node\n */\nexport const citeGroup = (props: Omit<CiteGroup, 'type'>): CiteGroup => ({\n ...compact(props),\n type: 'CiteGroup',\n})\n\n/**\n * Base type for code nodes e.g. `CodeBlock`, `CodeExpression`.\n */\nexport interface Code extends Entity {\n type: 'Code' | 'CodeBlock' | 'CodeChunk' | 'CodeExpression' | 'CodeFragment'\n text: string\n format?: string\n programmingLanguage?: string\n}\n\n/**\n * Create a `Code` node\n * @param props Object containing Code schema properties as key/value pairs\n * @returns {Code} Code schema node\n */\nexport const code = (props: Omit<Code, 'type'>): Code => ({\n ...compact(props),\n type: 'Code',\n})\n\n/**\n * A code block.\n */\nexport interface CodeBlock extends Code {\n type: 'CodeBlock' | 'CodeChunk'\n exportFrom?: string\n importTo?: string\n}\n\n/**\n * Create a `CodeBlock` node\n * @param props Object containing CodeBlock schema properties as key/value pairs\n * @returns {CodeBlock} CodeBlock schema node\n */\nexport const codeBlock = (props: Omit<CodeBlock, 'type'>): CodeBlock => ({\n ...compact(props),\n type: 'CodeBlock',\n})\n\n/**\n * A executable chunk of code.\n */\nexport interface CodeChunk extends CodeBlock {\n type: 'CodeChunk'\n alters?: Array<string>\n assigns?: Array<string | Variable>\n caption?: string | Array<Node>\n declares?: Array<string | Variable | Function>\n duration?: number\n errors?: Array<CodeError>\n imports?: Array<string | SoftwareSourceCode | SoftwareApplication>\n label?: string\n outputs?: Array<Node>\n reads?: Array<string>\n uses?: Array<string | Variable>\n}\n\n/**\n * Create a `CodeChunk` node\n * @param props Object containing CodeChunk schema properties as key/value pairs\n * @returns {CodeChunk} CodeChunk schema node\n */\nexport const codeChunk = (props: Omit<CodeChunk, 'type'>): CodeChunk => ({\n ...compact(props),\n type: 'CodeChunk',\n})\n\n/**\n * Inline code.\n */\nexport interface CodeFragment extends Code {\n type: 'CodeFragment' | 'CodeExpression'\n}\n\n/**\n * Create a `CodeFragment` node\n * @param props Object containing CodeFragment schema properties as key/value pairs\n * @returns {CodeFragment} CodeFragment schema node\n */\nexport const codeFragment = (\n props: Omit<CodeFragment, 'type'>\n): CodeFragment => ({\n ...compact(props),\n type: 'CodeFragment',\n})\n\n/**\n * An expression defined in programming language source code.\n */\nexport interface CodeExpression extends CodeFragment {\n type: 'CodeExpression'\n errors?: Array<CodeError>\n output?: Node\n}\n\n/**\n * Create a `CodeExpression` node\n * @param props Object containing CodeExpression schema properties as key/value pairs\n * @returns {CodeExpression} CodeExpression schema node\n */\nexport const codeExpression = (\n props: Omit<CodeExpression, 'type'>\n): CodeExpression => ({\n ...compact(props),\n type: 'CodeExpression',\n})\n\n/**\n * An error that occurred when parsing, compiling or executing a Code node.\n */\nexport interface CodeError extends Entity {\n type: 'CodeError'\n errorMessage: string\n errorType?: string\n stackTrace?: string\n}\n\n/**\n * Create a `CodeError` node\n * @param props Object containing CodeError schema properties as key/value pairs\n * @returns {CodeError} CodeError schema node\n */\nexport const codeError = (props: Omit<CodeError, 'type'>): CodeError => ({\n ...compact(props),\n type: 'CodeError',\n})\n\n/**\n * A validator specifying a constant value that a node must have.\n */\nexport interface ConstantValidator extends Entity {\n type: 'ConstantValidator'\n value?: Node\n}\n\n/**\n * Create a `ConstantValidator` node\n * @param props Object containing ConstantValidator schema properties as key/value pairs\n * @returns {ConstantValidator} ConstantValidator schema node\n */\nexport const constantValidator = (\n props: Omit<ConstantValidator, 'type'> = {}\n): ConstantValidator => ({\n ...compact(props),\n type: 'ConstantValidator',\n})\n\n/**\n * A date encoded as a ISO 8601 string.\n */\nexport interface Date extends Entity {\n type: 'Date'\n value: string\n}\n\n/**\n * Create a `Date` node\n * @param props Object containing Date schema properties as key/value pairs\n * @returns {Date} Date schema node\n */\nexport const date = (props: Omit<Date, 'type'>): Date => ({\n ...compact(props),\n type: 'Date',\n})\n\n/**\n * A base class for nodes that mark some other inline content\n * in some way (e.g. as being emphasised, or quoted).\n */\nexport interface Mark extends Entity {\n type:\n | 'Mark'\n | 'Delete'\n | 'Emphasis'\n | 'NontextualAnnotation'\n | 'Quote'\n | 'Strong'\n | 'Subscript'\n | 'Superscript'\n content: Array<InlineContent>\n}\n\n/**\n * Create a `Mark` node\n * @param props Object containing Mark schema properties as key/value pairs\n * @returns {Mark} Mark schema node\n */\nexport const mark = (props: Omit<Mark, 'type'>): Mark => ({\n ...compact(props),\n type: 'Mark',\n})\n\n/**\n * Content that is marked for deletion\n */\nexport interface Delete extends Mark {\n type: 'Delete'\n}\n\n/**\n * Create a `Delete` node\n * @param props Object containing Delete schema properties as key/value pairs\n * @returns {Delete} Delete schema node\n */\nexport const del = (props: Omit<Delete, 'type'>): Delete => ({\n ...compact(props),\n type: 'Delete',\n})\n\n/**\n * Emphasised content.\n */\nexport interface Emphasis extends Mark {\n type: 'Emphasis'\n}\n\n/**\n * Create a `Emphasis` node\n * @param props Object containing Emphasis schema properties as key/value pairs\n * @returns {Emphasis} Emphasis schema node\n */\nexport const emphasis = (props: Omit<Emphasis, 'type'>): Emphasis => ({\n ...compact(props),\n type: 'Emphasis',\n})\n\n/**\n * The most generic type of item.\n */\nexport interface Thing extends Entity {\n type:\n | 'Thing'\n | 'Article'\n | 'AudioObject'\n | 'Brand'\n | 'Collection'\n | 'Comment'\n | 'ContactPoint'\n | 'CreativeWork'\n | 'Datatable'\n | 'DatatableColumn'\n | 'DefinedTerm'\n | 'Figure'\n | 'Grant'\n | 'ImageObject'\n | 'ListItem'\n | 'MediaObject'\n | 'MonetaryGrant'\n | 'Organization'\n | 'Periodical'\n | 'Person'\n | 'PostalAddress'\n | 'Product'\n | 'PropertyValue'\n | 'PublicationIssue'\n | 'PublicationVolume'\n | 'Review'\n | 'SoftwareApplication'\n | 'SoftwareEnvironment'\n | 'SoftwareSession'\n | 'SoftwareSourceCode'\n | 'Table'\n | 'VideoObject'\n | 'VolumeMount'\n alternateNames?: Array<string>\n description?: Array<BlockContent> | Array<InlineContent> | string\n identifiers?: Array<PropertyValue | string>\n images?: Array<ImageObject | string>\n name?: string\n url?: string\n}\n\n/**\n * Create a `Thing` node\n * @param props Object containing Thing schema properties as key/value pairs\n * @returns {Thing} Thing schema node\n */\nexport const thing = (props: Omit<Thing, 'type'> = {}): Thing => ({\n ...compact(props),\n type: 'Thing',\n})\n\n/**\n * A brand used by an organization or person for labeling a product,\n * product group, or similar.\n */\nexport interface Brand extends Thing {\n type: 'Brand'\n name: string\n logo?: string | ImageObject\n reviews?: Array<string>\n}\n\n/**\n * Create a `Brand` node\n * @param props Object containing Brand schema properties as key/value pairs\n * @returns {Brand} Brand schema node\n */\nexport const brand = (props: Omit<Brand, 'type'>): Brand => ({\n ...compact(props),\n type: 'Brand',\n})\n\n/**\n * A contact point, for example, a R&D department.\n */\nexport interface ContactPoint extends Thing {\n type: 'ContactPoint' | 'PostalAddress'\n availableLanguages?: Array<string>\n emails?: Array<string>\n telephoneNumbers?: Array<string>\n}\n\n/**\n * Create a `ContactPoint` node\n * @param props Object containing ContactPoint schema properties as key/value pairs\n * @returns {ContactPoint} ContactPoint schema node\n */\nexport const contactPoint = (\n props: Omit<ContactPoint, 'type'> = {}\n): ContactPoint => ({\n ...compact(props),\n type: 'ContactPoint',\n})\n\n/**\n * A creative work, including books, movies, photographs, software programs, etc.\n */\nexport interface CreativeWork extends Thing {\n type:\n | 'CreativeWork'\n | 'Article'\n | 'AudioObject'\n | 'Collection'\n | 'Comment'\n | 'Datatable'\n | 'Figure'\n | 'ImageObject'\n | 'MediaObject'\n | 'Periodical'\n | 'PublicationIssue'\n | 'PublicationVolume'\n | 'Review'\n | 'SoftwareApplication'\n | 'SoftwareSourceCode'\n | 'Table'\n | 'VideoObject'\n about?: Array<Thing>\n authors?: Array<Person | Organization>\n comments?: Array<Comment>\n content?: Array<Node>\n dateAccepted?: Date | string\n dateCreated?: Date | string\n dateModified?: Date | string\n datePublished?: Date | string\n dateReceived?: Date | string\n editors?: Array<Person>\n fundedBy?: Array<Grant | MonetaryGrant>\n funders?: Array<Person | Organization>\n genre?: Array<string>\n isPartOf?: CreativeWorkTypes\n keywords?: Array<string>\n licenses?: Array<CreativeWorkTypes | string>\n maintainers?: Array<Organization | Person>\n parts?: Array<CreativeWorkTypes>\n publisher?: Person | Organization\n references?: Array<CreativeWorkTypes | string>\n text?: string\n title?: Array<InlineContent> | string\n version?: string | number\n}\n\n/**\n * Create a `CreativeWork` node\n * @param props Object containing CreativeWork schema properties as key/value pairs\n * @returns {CreativeWork} CreativeWork schema node\n */\nexport const creativeWork = (\n props: Omit<CreativeWork, 'type'> = {}\n): CreativeWork => ({\n ...compact(props),\n type: 'CreativeWork',\n})\n\n/**\n * An article, including news and scholarly articles.\n */\nexport interface Article extends CreativeWork {\n type: 'Article'\n pageEnd?: number | string\n pageStart?: number | string\n pagination?: string\n}\n\n/**\n * Create a `Article` node\n * @param props Object containing Article schema properties as key/value pairs\n * @returns {Article} Article schema node\n */\nexport const article = (props: Omit<Article, 'type'> = {}): Article => ({\n ...compact(props),\n type: 'Article',\n})\n\n/**\n * A created collection of CreativeWorks or other artefacts.\n */\nexport interface Collection extends CreativeWork {\n type: 'Collection'\n parts: Array<CreativeWorkTypes>\n}\n\n/**\n * Create a `Collection` node\n * @param props Object containing Collection schema properties as key/value pairs\n * @returns {Collection} Collection schema node\n */\nexport const collection = (props: Omit<Collection, 'type'>): Collection => ({\n ...compact(props),\n type: 'Collection',\n})\n\n/**\n * A comment on an item, e.g on a Article, or SoftwareSourceCode.\n */\nexport interface Comment extends CreativeWork {\n type: 'Comment'\n commentAspect?: string\n parentItem?: Comment\n}\n\n/**\n * Create a `Comment` node\n * @param props Object containing Comment schema properties as key/value pairs\n * @returns {Comment} Comment schema node\n */\nexport const comment = (props: Omit<Comment, 'type'> = {}): Comment => ({\n ...compact(props),\n type: 'Comment',\n})\n\n/**\n * A table of data.\n */\nexport interface Datatable extends CreativeWork {\n type: 'Datatable'\n columns: Array<DatatableColumn>\n}\n\n/**\n * Create a `Datatable` node\n * @param props Object containing Datatable schema properties as key/value pairs\n * @returns {Datatable} Datatable schema node\n */\nexport const datatable = (props: Omit<Datatable, 'type'>): Datatable => ({\n ...compact(props),\n type: 'Datatable',\n})\n\n/**\n * A media object, such as an image, video, or audio object embedded in a web page or a\n * downloadable dataset.\n */\nexport interface MediaObject extends CreativeWork {\n type: 'MediaObject' | 'AudioObject' | 'ImageObject' | 'VideoObject'\n contentUrl: string\n bitrate?: number\n contentSize?: number\n embedUrl?: string\n format?: string\n}\n\n/**\n * Create a `MediaObject` node\n * @param props Object containing MediaObject schema properties as key/value pairs\n * @returns {MediaObject} MediaObject schema node\n */\nexport const mediaObject = (props: Omit<MediaObject, 'type'>): MediaObject => ({\n ...compact(props),\n type: 'MediaObject',\n})\n\n/**\n * An audio file\n */\nexport interface AudioObject extends MediaObject {\n type: 'AudioObject'\n caption?: string\n transcript?: string\n}\n\n/**\n * Create a `AudioObject` node\n * @param props Object containing AudioObject schema properties as key/value pairs\n * @returns {AudioObject} AudioObject schema node\n */\nexport const audioObject = (props: Omit<AudioObject, 'type'>): AudioObject => ({\n ...compact(props),\n type: 'AudioObject',\n})\n\n/**\n * A column of data within a Datatable.\n */\nexport interface DatatableColumn extends Thing {\n type: 'DatatableColumn'\n name: string\n values: Array<any>\n validator?: ArrayValidator\n}\n\n/**\n * Create a `DatatableColumn` node\n * @param props Object containing DatatableColumn schema properties as key/value pairs\n * @returns {DatatableColumn} DatatableColumn schema node\n */\nexport const datatableColumn = (\n props: Omit<DatatableColumn, 'type'>\n): DatatableColumn => ({\n ...compact(props),\n type: 'DatatableColumn',\n})\n\n/**\n * A word, name, acronym, phrase, etc. with a formal definition.\n */\nexport interface DefinedTerm extends Thing {\n type: 'DefinedTerm'\n name: string\n termCode?: string\n}\n\n/**\n * Create a `DefinedTerm` node\n * @param props Object containing DefinedTerm schema properties as key/value pairs\n * @returns {DefinedTerm} DefinedTerm schema node\n */\nexport const definedTerm = (props: Omit<DefinedTerm, 'type'>): DefinedTerm => ({\n ...compact(props),\n type: 'DefinedTerm',\n})\n\n/**\n * A schema specifying that a node must be one of several values.\n */\nexport interface EnumValidator extends Entity {\n type: 'EnumValidator'\n values?: Array<Node>\n}\n\n/**\n * Create a `EnumValidator` node\n * @param props Object containing EnumValidator schema properties as key/value pairs\n * @returns {EnumValidator} EnumValidator schema node\n */\nexport const enumValidator = (\n props: Omit<EnumValidator, 'type'> = {}\n): EnumValidator => ({\n ...compact(props),\n type: 'EnumValidator',\n})\n\n/**\n * Encapsulates one or more images, videos, tables, etc, and provides captions and labels for them.\n */\nexport interface Figure extends CreativeWork {\n type: 'Figure'\n caption?: string | Array<Node>\n label?: string\n}\n\n/**\n * Create a `Figure` node\n * @param props Object containing Figure schema properties as key/value pairs\n * @returns {Figure} Figure schema node\n */\nexport const figure = (props: Omit<Figure, 'type'> = {}): Figure => ({\n ...compact(props),\n type: 'Figure',\n})\n\n/**\n * A function with a name, which might take Parameters and return a value of a certain type.\n */\nexport interface Function extends Entity {\n type: 'Function'\n name?: string\n parameters?: Array<Parameter>\n returns?: ValidatorTypes\n}\n\n/**\n * Create a `Function` node\n * @param props Object containing Function schema properties as key/value pairs\n * @returns {Function} Function schema node\n */\nexport const function_ = (props: Omit<Function, 'type'> = {}): Function => ({\n ...compact(props),\n type: 'Function',\n})\n\n/**\n * A grant, typically financial or otherwise quantifiable, of resources.\n */\nexport interface Grant extends Thing {\n type: 'Grant' | 'MonetaryGrant'\n fundedItems?: Array<Thing>\n sponsors?: Array<Person | Organization>\n}\n\n/**\n * Create a `Grant` node\n * @param props Object containing Grant schema properties as key/value pairs\n * @returns {Grant} Grant schema node\n */\nexport const grant = (props: Omit<Grant, 'type'> = {}): Grant => ({\n ...compact(props),\n type: 'Grant',\n})\n\n/**\n * Heading\n */\nexport interface Heading extends Entity {\n type: 'Heading'\n content: Array<InlineContent>\n depth?: number\n}\n\n/**\n * Create a `Heading` node\n * @param props Object containing Heading schema properties as key/value pairs\n * @returns {Heading} Heading schema node\n */\nexport const heading = (props: Omit<Heading, 'type'>): Heading => ({\n ...compact(props),\n type: 'Heading',\n})\n\n/**\n * An image file.\n */\nexport interface ImageObject extends MediaObject {\n type: 'ImageObject'\n caption?: string\n thumbnail?: ImageObject\n}\n\n/**\n * Create a `ImageObject` node\n * @param props Object containing ImageObject schema properties as key/value pairs\n * @returns {ImageObject} ImageObject schema node\n */\nexport const imageObject = (props: Omit<ImageObject, 'type'>): ImageObject => ({\n ...compact(props),\n type: 'ImageObject',\n})\n\n/**\n * A directive to include content from an external source (e.g. file, URL) or content.\n */\nexport interface Include extends Entity {\n type: 'Include'\n source: string\n content?: Array<BlockContent>\n format?: string\n}\n\n/**\n * Create a `Include` node\n * @param props Object containing Include schema properties as key/value pairs\n * @returns {Include} Include schema node\n */\nexport const include = (props: Omit<Include, 'type'>): Include => ({\n ...compact(props),\n type: 'Include',\n})\n\n/**\n * A validator specifying the constraints on a numeric node.\n */\nexport interface NumberValidator extends Entity {\n type: 'NumberValidator' | 'IntegerValidator'\n exclusiveMaximum?: number\n exclusiveMinimum?: number\n maximum?: number\n minimum?: number\n multipleOf?: number\n}\n\n/**\n * Create a `NumberValidator` node\n * @param props Object containing NumberValidator schema properties as key/value pairs\n * @returns {NumberValidator} NumberValidator schema node\n */\nexport const numberValidator = (\n props: Omit<NumberValidator, 'type'> = {}\n): NumberValidator => ({\n ...compact(props),\n type: 'NumberValidator',\n})\n\n/**\n * A validator specifying the constraints on an integer node.\n */\nexport interface IntegerValidator extends NumberValidator {\n type: 'IntegerValidator'\n}\n\n/**\n * Create a `IntegerValidator` node\n * @param props Object containing IntegerValidator schema properties as key/value pairs\n * @returns {IntegerValidator} IntegerValidator schema node\n */\nexport const integerValidator = (\n props: Omit<IntegerValidator, 'type'> = {}\n): IntegerValidator => ({\n ...compact(props),\n type: 'IntegerValidator',\n})\n\n/**\n * A hyperlink to other pages, sections within the same document, resources, or any URL.\n */\nexport interface Link extends Entity {\n type: 'Link'\n content: Array<InlineContent>\n target: string\n exportFrom?: string\n importTo?: string\n relation?: string\n title?: string\n}\n\n/**\n * Create a `Link` node\n * @param props Object containing Link schema properties as key/value pairs\n * @returns {Link} Link schema node\n */\nexport const link = (props: Omit<Link, 'type'>): Link => ({\n ...compact(props),\n type: 'Link',\n})\n\n/**\n * A list of items.\n */\nexport interface List extends Entity {\n type: 'List'\n items: Array<ListItem>\n order?: 'ascending' | 'descending' | 'unordered'\n}\n\n/**\n * Create a `List` node\n * @param props Object containing List schema properties as key/value pairs\n * @returns {List} List schema node\n */\nexport const list = (props: Omit<List, 'type'>): List => ({\n ...compact(props),\n type: 'List',\n})\n\n/**\n * A single item in a list.\n */\nexport interface ListItem extends Thing {\n type: 'ListItem'\n content?: Array<Node>\n isChecked?: boolean\n item?: Node\n position?: number\n}\n\n/**\n * Create a `ListItem` node\n * @param props Object containing ListItem schema properties as key/value pairs\n * @returns {ListItem} ListItem schema node\n */\nexport const listItem = (props: Omit<ListItem, 'type'> = {}): ListItem => ({\n ...compact(props),\n type: 'ListItem',\n})\n\n/**\n * A mathematical variable or equation.\n */\nexport interface Math extends Entity {\n type: 'Math' | 'MathBlock' | 'MathFragment'\n text: string\n errors?: Array<string>\n mathLanguage?: string\n}\n\n/**\n * Create a `Math` node\n * @param props Object containing Math schema properties as key/value pairs\n * @returns {Math} Math schema node\n */\nexport const math = (props: Omit<Math, 'type'>): Math => ({\n ...compact(props),\n type: 'Math',\n})\n\n/**\n * A block of math, e.g an equation, to be treated as block content.\n */\nexport interface MathBlock extends Math {\n type: 'MathBlock'\n}\n\n/**\n * Create a `MathBlock` node\n * @param props Object containing MathBlock schema properties as key/value pairs\n * @returns {MathBlock} MathBlock schema node\n */\nexport const mathBlock = (props: Omit<MathBlock, 'type'>): MathBlock => ({\n ...compact(props),\n type: 'MathBlock',\n})\n\n/**\n * A fragment of math, e.g a variable name, to be treated as inline content.\n */\nexport interface MathFragment extends Math {\n type: 'MathFragment'\n}\n\n/**\n * Create a `MathFragment` node\n * @param props Object containing MathFragment schema properties as key/value pairs\n * @returns {MathFragment} MathFragment schema node\n */\nexport const mathFragment = (\n props: Omit<MathFragment, 'type'>\n): MathFragment => ({\n ...compact(props),\n type: 'MathFragment',\n})\n\n/**\n * A monetary grant.\n */\nexport interface MonetaryGrant extends Grant {\n type: 'MonetaryGrant'\n amounts?: number\n funders?: Array<Person | Organization>\n}\n\n/**\n * Create a `MonetaryGrant` node\n * @param props Object containing MonetaryGrant schema properties as key/value pairs\n * @returns {MonetaryGrant} MonetaryGrant schema node\n */\nexport const monetaryGrant = (\n props: Omit<MonetaryGrant, 'type'> = {}\n): MonetaryGrant => ({\n ...compact(props),\n type: 'MonetaryGrant',\n})\n\n/**\n * Inline text that has a non-textual annotation.\n */\nexport interface NontextualAnnotation extends Mark {\n type: 'NontextualAnnotation'\n}\n\n/**\n * Create a `NontextualAnnotation` node\n * @param props Object containing NontextualAnnotation schema properties as key/value pairs\n * @returns {NontextualAnnotation} NontextualAnnotation schema node\n */\nexport const nontextualAnnotation = (\n props: Omit<NontextualAnnotation, 'type'>\n): NontextualAnnotation => ({\n ...compact(props),\n type: 'NontextualAnnotation',\n})\n\n/**\n * An organization such as a school, NGO, corporation, club, etc.\n */\nexport interface Organization extends Thing {\n type: 'Organization'\n address?: string | PostalAddress\n brands?: Array<Brand>\n contactPoints?: Array<ContactPoint>\n departments?: Array<Organization>\n funders?: Array<Organization | Person>\n legalName?: string\n logo?: string | ImageObject\n members?: Array<Organization | Person>\n parentOrganization?: Organization\n}\n\n/**\n * Create a `Organization` node\n * @param props Object containing Organization schema properties as key/value pairs\n * @returns {Organization} Organization schema node\n */\nexport const organization = (\n props: Omit<Organization, 'type'> = {}\n): Organization => ({\n ...compact(props),\n type: 'Organization',\n})\n\n/**\n * Paragraph\n */\nexport interface Paragraph extends Entity {\n type: 'Paragraph'\n content: Array<InlineContent>\n}\n\n/**\n * Create a `Paragraph` node\n * @param props Object containing Paragraph schema properties as key/value pairs\n * @returns {Paragraph} Paragraph schema node\n */\nexport const paragraph = (props: Omit<Paragraph, 'type'>): Paragraph => ({\n ...compact(props),\n type: 'Paragraph',\n})\n\n/**\n * A variable representing a name / value pair.\n */\nexport interface Variable extends Entity {\n type: 'Variable' | 'Parameter'\n name: string\n isReadonly?: boolean\n validator?: ValidatorTypes\n value?: Node\n}\n\n/**\n * Create a `Variable` node\n * @param props Object containing Variable schema properties as key/value pairs\n * @returns {Variable} Variable schema node\n */\nexport const variable = (props: Omit<Variable, 'type'>): Variable => ({\n ...compact(props),\n type: 'Variable',\n})\n\n/**\n * A parameter that can be set and used in evaluated code.\n */\nexport interface Parameter extends Variable {\n type: 'Parameter'\n default?: Node\n isExtensible?: boolean\n isRequired?: boolean\n isVariadic?: boolean\n}\n\n/**\n * Create a `Parameter` node\n * @param props Object containing Parameter schema properties as key/value pairs\n * @returns {Parameter} Parameter schema node\n */\nexport const parameter = (props: Omit<Parameter, 'type'>): Parameter => ({\n ...compact(props),\n type: 'Parameter',\n})\n\n/**\n * A periodical publication.\n */\nexport interface Periodical extends CreativeWork {\n type: 'Periodical'\n dateEnd?: Date | string\n dateStart?: Date | string\n issns?: Array<string>\n}\n\n/**\n * Create a `Periodical` node\n * @param props Object containing Periodical schema properties as key/value pairs\n * @returns {Periodical} Periodical schema node\n */\nexport const periodical = (\n props: Omit<Periodical, 'type'> = {}\n): Periodical => ({\n ...compact(props),\n type: 'Periodical',\n})\n\n/**\n * A person (alive, dead, undead, or fictional).\n */\nexport interface Person extends Thing {\n type: 'Person'\n address?: string | PostalAddress\n affiliations?: Array<Organization>\n emails?: Array<string>\n familyNames?: Array<string>\n funders?: Array<Organization | Person>\n givenNames?: Array<string>\n honorificPrefix?: string\n honorificSuffix?: string\n jobTitle?: string\n memberOf?: Array<Organization>\n telephoneNumbers?: Array<string>\n}\n\n/**\n * Create a `Person` node\n * @param props Object containing Person schema properties as key/value pairs\n * @returns {Person} Person schema node\n */\nexport const person = (props: Omit<Person, 'type'> = {}): Person => ({\n ...compact(props),\n type: 'Person',\n})\n\n/**\n * A physical mailing address.\n */\nexport interface PostalAddress extends ContactPoint {\n type: 'PostalAddress'\n addressCountry?: string\n addressLocality?: string\n addressRegion?: string\n postOfficeBoxNumber?: string\n postalCode?: string\n streetAddress?: string\n}\n\n/**\n * Create a `PostalAddress` node\n * @param props Object containing PostalAddress schema properties as key/value pairs\n * @returns {PostalAddress} PostalAddress schema node\n */\nexport const postalAddress = (\n props: Omit<PostalAddress, 'type'> = {}\n): PostalAddress => ({\n ...compact(props),\n type: 'PostalAddress',\n})\n\n/**\n * Any offered product or service. For example, a pair of shoes;\n * a haircut; or an episode of a TV show streamed online.\n */\nexport interface Product extends Thing {\n type: 'Product'\n brands?: Array<Brand>\n logo?: string | ImageObject\n productID?: string\n}\n\n/**\n * Create a `Product` node\n * @param props Object containing Product schema properties as key/value pairs\n * @returns {Product} Product schema node\n */\nexport const product = (props: Omit<Product, 'type'> = {}): Product => ({\n ...compact(props),\n type: 'Product',\n})\n\n/**\n * A property-value pair.\n */\nexport interface PropertyValue extends Thing {\n type: 'PropertyValue'\n value: Node\n propertyID?: string\n}\n\n/**\n * Create a `PropertyValue` node\n * @param props Object containing PropertyValue schema properties as key/value pairs\n * @returns {PropertyValue} PropertyValue schema node\n */\nexport const propertyValue = (\n props: Omit<PropertyValue, 'type'>\n): PropertyValue => ({\n ...compact(props),\n type: 'PropertyValue',\n})\n\n/**\n * A part of a successively published publication such as a periodical or publication\n * volume, often numbered.\n */\nexport interface PublicationIssue extends CreativeWork {\n type: 'PublicationIssue'\n issueNumber?: number | string\n pageEnd?: number | string\n pageStart?: number | string\n pagination?: string\n}\n\n/**\n * Create a `PublicationIssue` node\n * @param props Object containing PublicationIssue schema properties as key/value pairs\n * @returns {PublicationIssue} PublicationIssue schema node\n */\nexport const publicationIssue = (\n props: Omit<PublicationIssue, 'type'> = {}\n): PublicationIssue => ({\n ...compact(props),\n type: 'PublicationIssue',\n})\n\n/**\n * A part of a successively published publication such as a periodical or multi-volume work.\n */\nexport interface PublicationVolume extends CreativeWork {\n type: 'PublicationVolume'\n pageEnd?: number | string\n pageStart?: number | string\n pagination?: string\n volumeNumber?: number | string\n}\n\n/**\n * Create a `PublicationVolume` node\n * @param props Object containing PublicationVolume schema properties as key/value pairs\n * @returns {PublicationVolume} PublicationVolume schema node\n */\nexport const publicationVolume = (\n props: Omit<PublicationVolume, 'type'> = {}\n): PublicationVolume => ({\n ...compact(props),\n type: 'PublicationVolume',\n})\n\n/**\n * Inline, quoted content.\n */\nexport interface Quote extends Mark {\n type: 'Quote'\n cite?: Cite | string\n}\n\n/**\n * Create a `Quote` node\n * @param props Object containing Quote schema properties as key/value pairs\n * @returns {Quote} Quote schema node\n */\nexport const quote = (props: Omit<Quote, 'type'>): Quote => ({\n ...compact(props),\n type: 'Quote',\n})\n\n/**\n * A section quoted from somewhere else.\n */\nexport interface QuoteBlock extends Entity {\n type: 'QuoteBlock'\n content: Array<BlockContent>\n cite?: Cite | string\n}\n\n/**\n * Create a `QuoteBlock` node\n * @param props Object containing QuoteBlock schema properties as key/value pairs\n * @returns {QuoteBlock} QuoteBlock schema node\n */\nexport const quoteBlock = (props: Omit<QuoteBlock, 'type'>): QuoteBlock => ({\n ...compact(props),\n type: 'QuoteBlock',\n})\n\n/**\n * A review of an item, e.g of an Article, or SoftwareSourceCode.\n */\nexport interface Review extends CreativeWork {\n type: 'Review'\n itemReviewed?: Thing\n reviewAspect?: string\n}\n\n/**\n * Create a `Review` node\n * @param props Object containing Review schema properties as key/value pairs\n * @returns {Review} Review schema node\n */\nexport const review = (props: Omit<Review, 'type'> = {}): Review => ({\n ...compact(props),\n type: 'Review',\n})\n\n/**\n * A software application.\n */\nexport interface SoftwareApplication extends CreativeWork {\n type: 'SoftwareApplication'\n softwareRequirements?: Array<SoftwareApplication>\n softwareVersion?: string\n}\n\n/**\n * Create a `SoftwareApplication` node\n * @param props Object containing SoftwareApplication schema properties as key/value pairs\n * @returns {SoftwareApplication} SoftwareApplication schema node\n */\nexport const softwareApplication = (\n props: Omit<SoftwareApplication, 'type'> = {}\n): SoftwareApplication => ({\n ...compact(props),\n type: 'SoftwareApplication',\n})\n\n/**\n * A computational environment.\n */\nexport interface SoftwareEnvironment extends Thing {\n type: 'SoftwareEnvironment'\n name: string\n adds?: Array<SoftwareSourceCode>\n extends?: Array<SoftwareEnvironment>\n removes?: Array<SoftwareSourceCode>\n}\n\n/**\n * Create a `SoftwareEnvironment` node\n * @param props Object containing SoftwareEnvironment schema properties as key/value pairs\n * @returns {SoftwareEnvironment} SoftwareEnvironment schema node\n */\nexport const softwareEnvironment = (\n props: Omit<SoftwareEnvironment, 'type'>\n): SoftwareEnvironment => ({\n ...compact(props),\n type: 'SoftwareEnvironment',\n})\n\n/**\n * Definition of a compute session, including its software and compute resource\n * requirements and status.\n */\nexport interface SoftwareSession extends Thing {\n type: 'SoftwareSession'\n clientsLimit?: number\n clientsRequest?: number\n cpuLimit?: number\n cpuRequest?: number\n dateEnd?: Date | string\n dateStart?: Date | string\n durationLimit?: number\n durationRequest?: number\n environment?: SoftwareEnvironment\n memoryLimit?: number\n memoryRequest?: number\n networkTransferLimit?: number\n networkTransferRequest?: number\n status?:\n | 'unknown'\n | 'starting'\n | 'started'\n | 'stopping'\n | 'stopped'\n | 'failed'\n timeoutLimit?: number\n timeoutRequest?: number\n volumeMounts?: Array<VolumeMount>\n}\n\n/**\n * Create a `SoftwareSession` node\n * @param props Object containing SoftwareSession schema properties as key/value pairs\n * @returns {SoftwareSession} SoftwareSession schema node\n */\nexport const softwareSession = (\n props: Omit<SoftwareSession, 'type'> = {}\n): SoftwareSession => ({\n ...compact(props),\n type: 'SoftwareSession',\n})\n\n/**\n * Computer programming source code. Example: Full (compile ready) solutions, code snippet samples, scripts, templates.\n */\nexport interface SoftwareSourceCode extends CreativeWork {\n type: 'SoftwareSourceCode'\n codeRepository?: string\n codeSampleType?: string\n programmingLanguage?: string\n runtimePlatform?: Array<string>\n softwareRequirements?: Array<\n SoftwareSourceCode | SoftwareApplication | string\n >\n targetProducts?: Array<SoftwareApplication>\n}\n\n/**\n * Create a `SoftwareSourceCode` node\n * @param props Object containing SoftwareSourceCode schema properties as key/value pairs\n * @returns {SoftwareSourceCode} SoftwareSourceCode schema node\n */\nexport const softwareSourceCode = (\n props: Omit<SoftwareSourceCode, 'type'> = {}\n): SoftwareSourceCode => ({\n ...compact(props),\n type: 'SoftwareSourceCode',\n})\n\n/**\n * A schema specifying constraints on a string node.\n */\nexport interface StringValidator extends Entity {\n type: 'StringValidator'\n maxLength?: number\n minLength?: number\n pattern?: string\n}\n\n/**\n * Create a `StringValidator` node\n * @param props Object containing StringValidator schema properties as key/value pairs\n * @returns {StringValidator} StringValidator schema node\n */\nexport const stringValidator = (\n props: Omit<StringValidator, 'type'> = {}\n): StringValidator => ({\n ...compact(props),\n type: 'StringValidator',\n})\n\n/**\n * Strongly emphasised content.\n */\nexport interface Strong extends Mark {\n type: 'Strong'\n}\n\n/**\n * Create a `Strong` node\n * @param props Object containing Strong schema properties as key/value pairs\n * @returns {Strong} Strong schema node\n */\nexport const strong = (props: Omit<Strong, 'type'>): Strong => ({\n ...compact(props),\n type: 'Strong',\n})\n\n/**\n * Subscripted content.\n */\nexport interface Subscript extends Mark {\n type: 'Subscript'\n}\n\n/**\n * Create a `Subscript` node\n * @param props Object containing Subscript schema properties as key/value pairs\n * @returns {Subscript} Subscript schema node\n */\nexport const subscript = (props: Omit<Subscript, 'type'>): Subscript => ({\n ...compact(props),\n type: 'Subscript',\n})\n\n/**\n * Superscripted content.\n */\nexport interface Superscript extends Mark {\n type: 'Superscript'\n}\n\n/**\n * Create a `Superscript` node\n * @param props Object containing Superscript schema properties as key/value pairs\n * @returns {Superscript} Superscript schema node\n */\nexport const superscript = (props: Omit<Superscript, 'type'>): Superscript => ({\n ...compact(props),\n type: 'Superscript',\n})\n\n/**\n * A table.\n */\nexport interface Table extends CreativeWork {\n type: 'Table'\n rows: Array<TableRow>\n caption?: string | Array<Node>\n label?: string\n}\n\n/**\n * Create a `Table` node\n * @param props Object containing Table schema properties as key/value pairs\n * @returns {Table} Table schema node\n */\nexport const table = (props: Omit<Table, 'type'>): Table => ({\n ...compact(props),\n type: 'Table',\n})\n\n/**\n * A cell within a `Table`.\n */\nexport interface TableCell extends Entity {\n type: 'TableCell'\n content: Array<Node>\n cellType?: 'data' | 'header'\n colspan?: number\n name?: string\n rowspan?: number\n}\n\n/**\n * Create a `TableCell` node\n * @param props Object containing TableCell schema properties as key/value pairs\n * @returns {TableCell} TableCell schema node\n */\nexport const tableCell = (props: Omit<TableCell, 'type'>): TableCell => ({\n ...compact(props),\n type: 'TableCell',\n})\n\n/**\n * A row within a Table.\n */\nexport interface TableRow extends Entity {\n type: 'TableRow'\n cells: Array<TableCell>\n rowType?: 'header' | 'footer'\n}\n\n/**\n * Create a `TableRow` node\n * @param props Object containing TableRow schema properties as key/value pairs\n * @returns {TableRow} TableRow schema node\n */\nexport const tableRow = (props: Omit<TableRow, 'type'>): TableRow => ({\n ...compact(props),\n type: 'TableRow',\n})\n\n/**\n * A thematic break, such as a scene change in a story, a transition to another topic, or a new document.\n */\nexport interface ThematicBreak extends Entity {\n type: 'ThematicBreak'\n}\n\n/**\n * Create a `ThematicBreak` node\n * @param props Object containing ThematicBreak schema properties as key/value pairs\n * @returns {ThematicBreak} ThematicBreak schema node\n */\nexport const thematicBreak = (\n props: Omit<ThematicBreak, 'type'> = {}\n): ThematicBreak => ({\n ...compact(props),\n type: 'ThematicBreak',\n})\n\n/**\n * A validator specifying constraints on an array of heterogeneous items.\n */\nexport interface TupleValidator extends Entity {\n type: 'TupleValidator'\n items?: Array<ValidatorTypes>\n}\n\n/**\n * Create a `TupleValidator` node\n * @param props Object containing TupleValidator schema properties as key/value pairs\n * @returns {TupleValidator} TupleValidator schema node\n */\nexport const tupleValidator = (\n props: Omit<TupleValidator, 'type'> = {}\n): TupleValidator => ({\n ...compact(props),\n type: 'TupleValidator',\n})\n\n/**\n * A video file.\n */\nexport interface VideoObject extends MediaObject {\n type: 'VideoObject'\n caption?: string\n thumbnail?: ImageObject\n transcript?: string\n}\n\n/**\n * Create a `VideoObject` node\n * @param props Object containing VideoObject schema properties as key/value pairs\n * @returns {VideoObject} VideoObject schema node\n */\nexport const videoObject = (props: Omit<VideoObject, 'type'>): VideoObject => ({\n ...compact(props),\n type: 'VideoObject',\n})\n\n/**\n * Describes a volume mount from a host to container.\n */\nexport interface VolumeMount extends Thing {\n type: 'VolumeMount'\n mountDestination: string\n mountOptions?: Array<string>\n mountSource?: string\n mountType?: string\n}\n\n/**\n * Create a `VolumeMount` node\n * @param props Object containing VolumeMount schema properties as key/value pairs\n * @returns {VolumeMount} VolumeMount schema node\n */\nexport const volumeMount = (props: Omit<VolumeMount, 'type'>): VolumeMount => ({\n ...compact(props),\n type: 'VolumeMount',\n})\n\n/**\n * Union type for valid block content.\n */\nexport type BlockContent =\n | CodeBlock\n | CodeChunk\n | Collection\n | Figure\n | Heading\n | List\n | ListItem\n | MathBlock\n | Paragraph\n | QuoteBlock\n | Table\n | ThematicBreak\n\n/**\n * All type schemas that are derived from CodeBlock\n */\nexport type CodeBlockTypes = CodeBlock | CodeChunk\n\n/**\n * All type schemas that are derived from CodeFragment\n */\nexport type CodeFragmentTypes = CodeFragment | CodeExpression\n\n/**\n * All type schemas that are derived from Code\n */\nexport type CodeTypes =\n | Code\n | CodeBlock\n | CodeChunk\n | CodeExpression\n | CodeFragment\n\n/**\n * All type schemas that are derived from ContactPoint\n */\nexport type ContactPointTypes = ContactPoint | PostalAddress\n\n/**\n * All type schemas that are derived from CreativeWork\n */\nexport type CreativeWorkTypes =\n | CreativeWork\n | Article\n | AudioObject\n | Collection\n | Comment\n | Datatable\n | Figure\n | ImageObject\n | MediaObject\n | Periodical\n | PublicationIssue\n | PublicationVolume\n | Review\n | SoftwareApplication\n | SoftwareSourceCode\n | Table\n | VideoObject\n\n/**\n * All type schemas that are derived from Entity\n */\nexport type EntityTypes =\n | Entity\n | ArrayValidator\n | Article\n | AudioObject\n | BooleanValidator\n | Brand\n | Cite\n | CiteGroup\n | Code\n | CodeBlock\n | CodeChunk\n | CodeError\n | CodeExpression\n | CodeFragment\n | Collection\n | Comment\n | ConstantValidator\n | ContactPoint\n | CreativeWork\n | Datatable\n | DatatableColumn\n | Date\n | DefinedTerm\n | Delete\n | Emphasis\n | EnumValidator\n | Figure\n | Function\n | Grant\n | Heading\n | ImageObject\n | Include\n | IntegerValidator\n | Link\n | List\n | ListItem\n | Mark\n | Math\n | MathBlock\n | MathFragment\n | MediaObject\n | MonetaryGrant\n | NontextualAnnotation\n | NumberValidator\n | Organization\n | Paragraph\n | Parameter\n | Periodical\n | Person\n | PostalAddress\n | Product\n | PropertyValue\n | PublicationIssue\n | PublicationVolume\n | Quote\n | QuoteBlock\n | Review\n | SoftwareApplication\n | SoftwareEnvironment\n | SoftwareSession\n | SoftwareSourceCode\n | StringValidator\n | Strong\n | Subscript\n | Superscript\n | Table\n | TableCell\n | TableRow\n | ThematicBreak\n | Thing\n | TupleValidator\n | Variable\n | VideoObject\n | VolumeMount\n\n/**\n * All type schemas that are derived from Grant\n */\nexport type GrantTypes = Grant | MonetaryGrant\n\n/**\n * Union type for valid inline content.\n */\nexport type InlineContent =\n | CodeFragment\n | CodeExpression\n | Delete\n | Emphasis\n | ImageObject\n | Link\n | MathFragment\n | NontextualAnnotation\n | Quote\n | Strong\n | Subscript\n | Superscript\n | Cite\n | CiteGroup\n | number\n | boolean\n | null\n | string\n\n/**\n * All type schemas that are derived from Mark\n */\nexport type MarkTypes =\n | Mark\n | Delete\n | Emphasis\n | NontextualAnnotation\n | Quote\n | Strong\n | Subscript\n | Superscript\n\n/**\n * All type schemas that are derived from Math\n */\nexport type MathTypes = Math | MathBlock | MathFragment\n\n/**\n * All type schemas that are derived from MediaObject\n */\nexport type MediaObjectTypes =\n | MediaObject\n | AudioObject\n | ImageObject\n | VideoObject\n\n/**\n * Union type for all valid nodes.\n */\nexport type Node =\n | Entity\n | number\n | boolean\n | null\n | string\n | Array<any>\n | { [key: string]: any }\n\n/**\n * All type schemas that are derived from NumberValidator\n */\nexport type NumberValidatorTypes = NumberValidator | IntegerValidator\n\n/**\n * All type schemas that are derived from Thing\n */\nexport type ThingTypes =\n | Thing\n | Article\n | AudioObject\n | Brand\n | Collection\n | Comment\n | ContactPoint\n | CreativeWork\n | Datatable\n | DatatableColumn\n | DefinedTerm\n | Figure\n | Grant\n | ImageObject\n | ListItem\n | MediaObject\n | MonetaryGrant\n | Organization\n | Periodical\n | Person\n | PostalAddress\n | Product\n | PropertyValue\n | PublicationIssue\n | PublicationVolume\n | Review\n | SoftwareApplication\n | SoftwareEnvironment\n | SoftwareSession\n | SoftwareSourceCode\n | Table\n | VideoObject\n | VolumeMount\n\n/**\n * Union type for all validator types.\n */\nexport type ValidatorTypes =\n | ConstantValidator\n | EnumValidator\n | BooleanValidator\n | NumberValidator\n | IntegerValidator\n | StringValidator\n | ArrayValidator\n | TupleValidator\n\n/**\n * All type schemas that are derived from Variable\n */\nexport type VariableTypes = Variable | Parameter\n\nexport type TypeMap<T extends Entity = Entity> = { [key in T['type']]: key }\n\nexport type TypeMapGeneric<\n T extends { type: string } & object = { type: string }\n> = { [key in T['type']]: key }\n\ntype Primitives = undefined | null | boolean | string | number\n\nexport const codeBlockTypes: TypeMap<Exclude<CodeBlockTypes, Primitives>> = {\n CodeBlock: 'CodeBlock',\n CodeChunk: 'CodeChunk',\n}\n\nexport const codeFragmentTypes: TypeMap<\n Exclude<CodeFragmentTypes, Primitives>\n> = {\n CodeFragment: 'CodeFragment',\n CodeExpression: 'CodeExpression',\n}\n\nexport const codeTypes: TypeMap<Exclude<CodeTypes, Primitives>> = {\n Code: 'Code',\n CodeBlock: 'CodeBlock',\n CodeChunk: 'CodeChunk',\n CodeExpression: 'CodeExpression',\n CodeFragment: 'CodeFragment',\n}\n\nexport const contactPointTypes: TypeMap<\n Exclude<ContactPointTypes, Primitives>\n> = {\n ContactPoint: 'ContactPoint',\n PostalAddress: 'PostalAddress',\n}\n\nexport const creativeWorkTypes: TypeMap<\n Exclude<CreativeWorkTypes, Primitives>\n> = {\n CreativeWork: 'CreativeWork',\n Article: 'Article',\n AudioObject: 'AudioObject',\n Collection: 'Collection',\n Comment: 'Comment',\n Datatable: 'Datatable',\n Figure: 'Figure',\n ImageObject: 'ImageObject',\n MediaObject: 'MediaObject',\n Periodical: 'Periodical',\n PublicationIssue: 'PublicationIssue',\n PublicationVolume: 'PublicationVolume',\n Review: 'Review',\n SoftwareApplication: 'SoftwareApplication',\n SoftwareSourceCode: 'SoftwareSourceCode',\n Table: 'Table',\n VideoObject: 'VideoObject',\n}\n\nexport const entityTypes: TypeMap<Exclude<EntityTypes, Primitives>> = {\n Entity: 'Entity',\n ArrayValidator: 'ArrayValidator',\n Article: 'Article',\n AudioObject: 'AudioObject',\n BooleanValidator: 'BooleanValidator',\n Brand: 'Brand',\n Cite: 'Cite',\n CiteGroup: 'CiteGroup',\n Code: 'Code',\n CodeBlock: 'CodeBlock',\n CodeChunk: 'CodeChunk',\n CodeError: 'CodeError',\n CodeExpression: 'CodeExpression',\n CodeFragment: 'CodeFragment',\n Collection: 'Collection',\n Comment: 'Comment',\n ConstantValidator: 'ConstantValidator',\n ContactPoint: 'ContactPoint',\n CreativeWork: 'CreativeWork',\n Datatable: 'Datatable',\n DatatableColumn: 'DatatableColumn',\n Date: 'Date',\n DefinedTerm: 'DefinedTerm',\n Delete: 'Delete',\n Emphasis: 'Emphasis',\n EnumValidator: 'EnumValidator',\n Figure: 'Figure',\n Function: 'Function',\n Grant: 'Grant',\n Heading: 'Heading',\n ImageObject: 'ImageObject',\n Include: 'Include',\n IntegerValidator: 'IntegerValidator',\n Link: 'Link',\n List: 'List',\n ListItem: 'ListItem',\n Mark: 'Mark',\n Math: 'Math',\n MathBlock: 'MathBlock',\n MathFragment: 'MathFragment',\n MediaObject: 'MediaObject',\n MonetaryGrant: 'MonetaryGrant',\n NontextualAnnotation: 'NontextualAnnotation',\n NumberValidator: 'NumberValidator',\n Organization: 'Organization',\n Paragraph: 'Paragraph',\n Parameter: 'Parameter',\n Periodical: 'Periodical',\n Person: 'Person',\n PostalAddress: 'PostalAddress',\n Product: 'Product',\n PropertyValue: 'PropertyValue',\n PublicationIssue: 'PublicationIssue',\n PublicationVolume: 'PublicationVolume',\n Quote: 'Quote',\n QuoteBlock: 'QuoteBlock',\n Review: 'Review',\n SoftwareApplication: 'SoftwareApplication',\n SoftwareEnvironment: 'SoftwareEnvironment',\n SoftwareSession: 'SoftwareSession',\n SoftwareSourceCode: 'SoftwareSourceCode',\n StringValidator: 'StringValidator',\n Strong: 'Strong',\n Subscript: 'Subscript',\n Superscript: 'Superscript',\n Table: 'Table',\n TableCell: 'TableCell',\n TableRow: 'TableRow',\n ThematicBreak: 'ThematicBreak',\n Thing: 'Thing',\n TupleValidator: 'TupleValidator',\n Variable: 'Variable',\n VideoObject: 'VideoObject',\n VolumeMount: 'VolumeMount',\n}\n\nexport const grantTypes: TypeMap<Exclude<GrantTypes, Primitives>> = {\n Grant: 'Grant',\n MonetaryGrant: 'MonetaryGrant',\n}\n\nexport const markTypes: TypeMap<Exclude<MarkTypes, Primitives>> = {\n Mark: 'Mark',\n Delete: 'Delete',\n Emphasis: 'Emphasis',\n NontextualAnnotation: 'NontextualAnnotation',\n Quote: 'Quote',\n Strong: 'Strong',\n Subscript: 'Subscript',\n Superscript: 'Superscript',\n}\n\nexport const mathTypes: TypeMap<Exclude<MathTypes, Primitives>> = {\n Math: 'Math',\n MathBlock: 'MathBlock',\n MathFragment: 'MathFragment',\n}\n\nexport const mediaObjectTypes: TypeMap<\n Exclude<MediaObjectTypes, Primitives>\n> = {\n MediaObject: 'MediaObject',\n AudioObject: 'AudioObject',\n ImageObject: 'ImageObject',\n VideoObject: 'VideoObject',\n}\n\nexport const numberValidatorTypes: TypeMap<\n Exclude<NumberValidatorTypes, Primitives>\n> = {\n NumberValidator: 'NumberValidator',\n IntegerValidator: 'IntegerValidator',\n}\n\nexport const thingTypes: TypeMap<Exclude<ThingTypes, Primitives>> = {\n Thing: 'Thing',\n Article: 'Article',\n AudioObject: 'AudioObject',\n Brand: 'Brand',\n Collection: 'Collection',\n Comment: 'Comment',\n ContactPoint: 'ContactPoint',\n CreativeWork: 'CreativeWork',\n Datatable: 'Datatable',\n DatatableColumn: 'DatatableColumn',\n DefinedTerm: 'DefinedTerm',\n Figure: 'Figure',\n Grant: 'Grant',\n ImageObject: 'ImageObject',\n ListItem: 'ListItem',\n MediaObject: 'MediaObject',\n MonetaryGrant: 'MonetaryGrant',\n Organization: 'Organization',\n Periodical: 'Periodical',\n Person: 'Person',\n PostalAddress: 'PostalAddress',\n Product: 'Product',\n PropertyValue: 'PropertyValue',\n PublicationIssue: 'PublicationIssue',\n PublicationVolume: 'PublicationVolume',\n Review: 'Review',\n SoftwareApplication: 'SoftwareApplication',\n SoftwareEnvironment: 'SoftwareEnvironment',\n SoftwareSession: 'SoftwareSession',\n SoftwareSourceCode: 'SoftwareSourceCode',\n Table: 'Table',\n VideoObject: 'VideoObject',\n VolumeMount: 'VolumeMount',\n}\n\nexport const validatorTypes: TypeMap<Exclude<ValidatorTypes, Primitives>> = {\n ConstantValidator: 'ConstantValidator',\n EnumValidator: 'EnumValidator',\n BooleanValidator: 'BooleanValidator',\n NumberValidator: 'NumberValidator',\n IntegerValidator: 'IntegerValidator',\n StringValidator: 'StringValidator',\n ArrayValidator: 'ArrayValidator',\n TupleValidator: 'TupleValidator',\n}\n\nexport const variableTypes: TypeMap<Exclude<VariableTypes, Primitives>> = {\n Variable: 'Variable',\n Parameter: 'Parameter',\n}\n\nexport const blockContentTypes: TypeMap<Exclude<BlockContent, Primitives>> = {\n CodeBlock: 'CodeBlock',\n CodeChunk: 'CodeChunk',\n Collection: 'Collection',\n Figure: 'Figure',\n Heading: 'Heading',\n List: 'List',\n ListItem: 'ListItem',\n MathBlock: 'MathBlock',\n Paragraph: 'Paragraph',\n QuoteBlock: 'QuoteBlock',\n Table: 'Table',\n ThematicBreak: 'ThematicBreak',\n}\n\nexport const inlineContentTypes: TypeMap<Exclude<InlineContent, Primitives>> = {\n CodeFragment: 'CodeFragment',\n CodeExpression: 'CodeExpression',\n Delete: 'Delete',\n Emphasis: 'Emphasis',\n ImageObject: 'ImageObject',\n Link: 'Link',\n MathFragment: 'MathFragment',\n NontextualAnnotation: 'NontextualAnnotation',\n Quote: 'Quote',\n Strong: 'Strong',\n Subscript: 'Subscript',\n Superscript: 'Superscript',\n Cite: 'Cite',\n CiteGroup: 'CiteGroup',\n}\n","import {\n Article,\n blockContentTypes,\n codeTypes,\n creativeWorkTypes,\n Entity,\n InlineContent,\n inlineContentTypes,\n ListItem,\n Node,\n Paragraph,\n TypeMap,\n TypeMapGeneric,\n Types,\n} from '../types'\n\ntype ExtractGeneric<Type> = Type extends TypeMap<infer X>\n ? X\n : Type extends TypeMapGeneric<infer Y>\n ? Y\n : never\n\n/**\n * Returns a function which returns true is the type is a member\n * of the type map.\n *\n * @param {TypeMap} typeMap An object containing schema type values\n */\nexport const typeIs = <T extends Partial<TypeMap | TypeMapGeneric>>(\n typeMap: T\n) => (type: string): boolean => Object.keys(typeMap).includes(type)\n\n/**\n * Returns a type guard to determine whether a node belongs to a set\n * of types.\n * Returns a boolean value and narrows the TypeScript inferred type to\n * the type.\n *\n * @template {TypeMap} T\n * @param {T} typeMap\n * @param {Node} node A Stencila schema node object\n */\nexport const nodeIs = <T extends Partial<TypeMap | TypeMapGeneric>>(\n typeMap: T\n) => (node?: Node): node is ExtractGeneric<T> => {\n return isEntity(node) ? typeIs(typeMap)(node.type) : false\n}\n\n/**\n * Returns a type guard to determine whether a node is of a particular type.\n * Returns a boolean value and narrows the TypeScript inferred type to\n * the type.\n *\n * @param type The type to test for\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const is = <Ts extends Entity>(type: keyof TypeMap<Ts>) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const typeMap: TypeMap<Ts> = {\n [type]: type,\n }\n return nodeIs(typeMap)\n}\n\n/**\n * A type guard to determine whether a node is of a specific type.\n * Returns a boolean value and narrows the TypeScript inferred type to\n * the type.\n *\n * e.g. `isA('Paragraph', node)`\n *\n * @param type The name of the type to test for\n * @param node The node being tested\n */\nexport const isA = <K extends keyof Types>(\n type: K,\n node: Node | undefined\n): node is Types[K] => {\n return isEntity(node) && node.type === type\n}\n\nexport const isInstanceOf = <\n E = never,\n TM = TypeMap<E extends Entity ? E : never>\n>(\n typeMap: E extends never ? never : TM,\n node?: Node\n): node is E => {\n return isEntity(node) && Object.keys(typeMap).includes(node.type)\n}\n\n/**\n * Returns a type guard to determine whether a node is of a specific type.\n * Returns a boolean value and narrows the TypeScript inferred type to\n * the type.\n *\n * e.g. `article.content.filter(isType('Paragraph'))`\n *\n * @param type The type to test for\n */\nexport const isType = <K extends keyof Types>(type: K) => (\n node?: Node\n): node is Types[K] => {\n return node !== undefined && isA(type, node)\n}\n\n/**\n * Type guard to determine whether a node is a primitive type.\n * Returns a boolean value and narrows the TypeScript inferred type.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is null | boolean | number | string)} Returns true if node is one of `null`, `boolean`, `string`, or `number`\n */\nexport const isPrimitive = (\n node?: Node\n): node is null | boolean | number | string => {\n const type = typeof node\n if (node === null) return true\n if (type === 'boolean') return true\n if (type === 'number') return true\n if (type === 'string') return true\n return false\n}\n\n/**\n * Type guard to determine whether a node is an `Entity`\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is Entity)} Returns true if node is an `Entity` or derived type\n */\nexport const isEntity = (node?: Node): node is Entity => {\n if (node === null || node === undefined) return false\n return Object.prototype.hasOwnProperty.call(node, 'type')\n}\n\n/**\n * Type guard to determine whether a node is both `InlineContent` and\n * and an `Entity`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is InlineContent)}\n */\nexport const isInlineEntity = (node?: Node): node is InlineContent => {\n return typeof node === 'object' && isEntity(node)\n ? typeIs(inlineContentTypes)(node.type)\n : false\n}\n/**\n * Type guard to determine whether a node is `InlineContent`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is InlineContent)}\n */\nexport const isInlineContent = (node?: Node): node is InlineContent => {\n return isPrimitive(node) || isInlineEntity(node)\n}\n\n/**\n * Type guard to determine whether a node is `BlockContent`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is BlockContent)}\n */\nexport const isBlockContent = nodeIs(blockContentTypes)\n\n/**\n * Type guard to determine whether a node is a `CreativeWork`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is CreativeWork)}\n */\nexport const isCreativeWork = nodeIs(creativeWorkTypes)\n\n/**\n * Type guard to determine whether a node is a `Code`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is Code)}\n */\nexport const isCode = nodeIs(codeTypes)\n\n/**\n * Type guard to determine whether a node is an `Article`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is Article)}\n */\nexport const isArticle = is<Article>('Article')\n\n/**\n * Type guard to determine whether a node is an `Paragraph`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is Paragraph)}\n */\nexport const isParagraph = is<Paragraph>('Paragraph')\n\n/**\n * Type guard to determine whether a node is an `ListItem`.\n *\n * @param {Node} node The node to get the type for\n * @returns {(node is ListItem)}\n */\nexport const isListItem = is<ListItem>('ListItem')\n","import { version as pkgVersion } from '../../package.json'\n\n/**\n * Get the version string (e.g \"1.2.3\") for this package\n */\nexport const version = pkgVersion\n\n/**\n * Get the major version string (e.g \"1\") for this package\n */\nexport const versionMajor: string = version.split('.')[0]\n\n/**\n * Get the minor version string (e.g \"1.2\") for this package\n */\nexport const versionMinor: string = version.split('.').slice(0, 2).join('.')\n","import fs from 'fs'\nimport path from 'path'\nimport { versionMajor } from './version'\n\n// Lazily loaded JSON-LD context used for mapping\n// between Stencila Schema type and property names\n// and URLs\nlet CONTEXT: Record<string, string | { '@id': string }>\n\n// Maps between vocabulary terms (Stencila Schema types and\n// property names) and their compact IRIs ('@id's) and vice-versa.\nconst termToId: Record<string, string> = {}\nconst idToTerm: Record<string, string> = {}\n\n// Initialize maps. Called once, lazily.\nfunction initMaps(): void {\n const context = jsonLdContext()\n for (const [term, value] of Object.entries(context)) {\n if (typeof value === 'string' && !term.startsWith('@')) {\n termToId[term] = value\n idToTerm[value] = term\n } else if (typeof value === 'object') {\n const id = value['@id']\n termToId[term] = id\n idToTerm[id] = term\n }\n }\n}\n\n/**\n * Get the URL of Stencila Schema's JSON-LD `@context` or\n * for a specific `stencila:` term e.g. `CodeChunk`, `outputs`.\n *\n * The `@context`'s URL needs to have a trailing slash because\n * it gets prefixed to all keys during JSON-LD expansion.\n * e.g. the term `CodeChunk` gets expanded to `http://schema.stenci.la/v0/jsonld/CodeChunk`\n * (which in gets redirected to `https://unpkg.com/@stencila/schema@0.32.1/dist/CodeChunk.jsonld`)\n *\n * @param term The Stencila term (type or property) to generate the\n * URL for. Defaults to empty string i.e. the context.\n */\nexport function jsonLdUrl(term = ''): string {\n return `http://schema.stenci.la/v${versionMajor}/jsonld/${term}`\n}\n\n/**\n * Get Stencila Schema's JSON-LD `@context` as an object.\n */\nexport function jsonLdContext(): typeof CONTEXT {\n if (CONTEXT === undefined) {\n const json = fs.readFileSync(\n path.join(\n __dirname,\n ...(__filename.endsWith('.ts') ? ['..', '..', 'public'] : []),\n 'stencila.jsonld'\n ),\n 'utf8'\n )\n CONTEXT = JSON.parse(json)['@context']\n }\n return CONTEXT\n}\n\n/**\n * Get the URL for a term in the Stencila Schema's JSON-LD `@context`\n * from it's name.\n *\n * This uses the JSON-LD `@context` in `stencila.jsonld` (which\n * provides a mapping between vocabularies) to translate\n * type names used in the Stencila Schema\n * to those used in other schemas (e.g. Schema.org, Bioschemas).\n * The [compact IRIs](https://www.w3.org/TR/json-ld11/#compact-iris)\n * in the `@context` e.g. `schema:Person` are expanded to a URL\n * e.g. `http://schema.org/Person` suitable for the `itemtype` attribute.\n *\n * @param term A term in the JSON-LD `@context`. May, or may not be in\n * the `stencila` namespace\n */\nexport function jsonLdTermUrl(term: string): string | undefined {\n if (Object.keys(termToId).length === 0) initMaps()\n\n const id = termToId[term]\n if (id === undefined) return undefined\n\n const [prefix, name] = id.split(':')\n const context = jsonLdContext()\n const base = context[prefix]\n if (base === undefined) return undefined\n\n return `${base}${name}`\n}\n\n/**\n * Get the name of a term in the Stencila Schema's JSON-LD `@context`\n * from a URL.\n *\n * This is the inverse of `jsonLdTermUrl`.\n *\n * @param url A url to resolve into a term\n */\nexport function jsonLdTermName(url: string): string | undefined {\n if (Object.keys(idToTerm).length === 0) initMaps()\n\n // Parse the url into a base URL / term pair\n const { hash, pathname } = new URL(url)\n const term = hash !== '' ? hash.slice(1) : pathname.split('/').pop()\n const baseUrl = url.replace(new RegExp(`${term}$`), '')\n\n // Resolve the URL into a prefix\n const prefix = idToTerm[baseUrl]\n if (prefix === undefined) return undefined\n\n // Resolve the `@id` to the term name\n return idToTerm[`${prefix}:${term}`]\n}\n","/**\n * Utility functions for runtime inspection of JSON Schemas\n * in this repository.\n *\n * As with the other utility modules it\n * avoids using non-builtin modules so that this package has\n * no production dependencies.\n */\n\nimport fs from 'fs'\nimport path from 'path'\nimport { JsonSchema } from '../JsonSchema'\n\n// Lazily loaded set of JSON Schemas\nlet SCHEMAS: Record<string, JsonSchema> = {}\n\nexport interface Property {\n /**\n * Name of the property\n */\n name: string\n\n /**\n * Id of the property\n */\n id: string\n\n /**\n * Types that this property exists on.\n *\n * @see https://schema.org/domainIncludes\n */\n domainIncludes: string[]\n\n /**\n * Is the property an array?\n */\n isArray: boolean\n\n /**\n * Is the property name pluralized (ends in `s`).\n */\n isPlural: boolean\n}\n\n// Lazily populated set properties across all schemas\nlet PROPERTIES: Record<string, Property> = {}\n\n/**\n * Get all Stencila Schema's JSON Schemas.\n */\nexport async function jsonSchemas(): Promise<typeof SCHEMAS> {\n if (Object.keys(SCHEMAS).length === 0) {\n const dir = path.join(\n __dirname,\n ...(__filename.endsWith('.ts') ? ['..', '..', 'public'] : [])\n )\n const files = await new Promise<string[]>((resolve, reject) =>\n fs.readdir(dir, 'utf8', (error, files) =>\n error !== null ? reject(error) : resolve(files)\n )\n )\n const schemaFiles = files.filter((filename) =>\n filename.endsWith('.schema.json')\n )\n const promises = schemaFiles.map(async (file) => {\n const json = await new Promise<string>((resolve, reject) =>\n fs.readFile(path.join(dir, file), 'utf8', (error, content) =>\n error !== null ? reject(error) : resolve(content)\n )\n )\n return JSON.parse(json) as JsonSchema\n })\n const schemas = await Promise.all(promises)\n SCHEMAS = schemas.reduce((prev: typeof SCHEMAS, schema) => {\n const { title } = schema\n return title === undefined ? prev : { ...prev, [title]: schema }\n }, {})\n }\n return SCHEMAS\n}\n\n/**\n * Get all the names of all types in the Stencila Schema.\n */\nexport async function jsonSchemaTypes(): Promise<string[]> {\n const schemas = await jsonSchemas()\n return Object.keys(schemas)\n}\n\n/**\n * Get all the properties in all types in the Stencila Schema.\n *\n * Returns a alphabetically sorted `Record` with information on\n * each property, including the types that it occurs on,\n * and whether or not it is an array property.\n */\nexport async function jsonSchemaProperties(): Promise<\n Record<string, Property>\n> {\n if (Object.keys(PROPERTIES).length === 0) {\n const schemas = await jsonSchemas()\n // Accumulate properties across types\n const props = Object.values(schemas).reduce(\n (prev: typeof PROPERTIES, type) => {\n const { title = '', properties = {} } = type\n Object.entries(properties).forEach(([name, prop]) => {\n const { '@id': id = '', isArray = false, isPlural = false } = prop\n const existing = prev[name]\n if (existing === undefined) {\n prev[name] = {\n name,\n id,\n domainIncludes: [title],\n isArray,\n isPlural,\n }\n } else {\n // Check that there is consistency in the property\n // Most of these checks are done in `../schema.ts` when the\n // JSON Schema files are generated. These checks may be moved\n // to elsewhere.\n const message = `${title}.${name} differs to that on ${existing.domainIncludes}`\n if (id !== existing.id) throw new Error(`${message}: @id ${id}`)\n if (isArray !== existing.isArray)\n throw new Error(`${message}: isArray ${isArray}`)\n if (isPlural !== existing.isPlural)\n throw new Error(`${message}: isPlural ${isPlural}`)\n // Add the type...\n existing.domainIncludes.push(title)\n }\n })\n return prev\n },\n {}\n )\n // Sort by key\n PROPERTIES = Object.keys(props)\n .sort()\n .reduce((prev, key) => ({ ...prev, [key]: props[key] }), {})\n }\n return PROPERTIES\n}\n","import { Types, Node } from '../types'\nimport { isEntity } from './guards'\n\n/**\n * Get the type of a node\n *\n * @param {Node} node The schema node to get the type for\n */\nexport const nodeType = (node: Node): keyof Types => {\n if (node === null) return 'Null'\n if (typeof node === 'boolean') return 'Boolean'\n if (typeof node === 'number') return 'Number'\n if (typeof node === 'string') return 'Text'\n if (Array.isArray(node)) return 'Array'\n if (isEntity(node)) return node.type\n return 'Object'\n}\n","import { Node, Types } from '../types'\nimport {\n jsonLdContext,\n jsonLdTermName,\n jsonLdTermUrl,\n jsonLdUrl,\n} from './jsonld'\nimport { nodeType } from './nodeType'\nimport { isPrimitive } from './guards'\n\n/**\n * Get the URL used in Microdata attributes.\n *\n * This is used to normalize the versioned URL from the\n * JSON-LD context.\n */\nexport function microdataUrl(type = ''): string {\n return `http://schema.stenci.la/${type}`\n}\n\n/**\n * Attributes for Microdata [\"items\"](https://www.w3.org/TR/microdata/#items)\n *\n * \"The itemtype attribute must not be specified on elements that do not have\n * an itemscope attribute specified.\"\n */\nexport interface MicrodataItem {\n itemscope?: ''\n itemtype?: string\n 'data-itemtype'?: string\n itemid?: string\n}\n\n/**\n * Create `MicrodataItem` attributes for a node.\n *\n * Does not create the `itemscope` and `itemtype` attributes for nodes that\n * are primitive (and therefore which do not represent a \"scope\" having\n * `itemprop`s nested within it). Instead, for primitive nodes, other than `Text`\n * add the `data-itemtype` attribute, do they can be styled if so desired.\n *\n * @param node The node to create Microdata attributes for\n * @param id Id of the Microdata item. Used to link to this node using the `itemref` property.\n */\nexport function microdataItem(node: Node, id?: string): MicrodataItem {\n const itemtype = microdataItemtype(nodeType(node))\n const itemidAttr = id !== undefined ? { itemid: `#${id}` } : {}\n if (itemtype !== undefined && !isPrimitive(node))\n return {\n itemscope: '',\n itemtype,\n ...itemidAttr,\n }\n else if (typeof node !== 'string')\n return {\n 'data-itemtype': itemtype,\n ...itemidAttr,\n }\n else return itemidAttr\n}\n\n/**\n * Get the HTML Microdata `itemtype` for a Stencila Schema type\n *\n * @see {@link https://www.w3.org/TR/microdata/#dfn-itemtype}\n */\nexport function microdataItemtype(type: keyof Types): string | undefined {\n return jsonLdTermUrl(type)?.replace(jsonLdUrl(), microdataUrl())\n}\n\n/**\n * Get the Stencila Schema type from a HTML Microdata `itemtype`.\n *\n * This is the inverse of `microdataItemtype`.\n */\nexport function microdataType(itemtype: string): keyof Types | undefined {\n return jsonLdTermName(\n itemtype.replace(microdataUrl(), jsonLdUrl())\n ) as keyof Types\n}\n\n/**\n * Attributes for Microdata [\"properties\"](https://www.w3.org/TR/microdata/#names:-the-itemprop-attribute)\n *\n * The `data-itemprop` attribute is not part of the Microdata standard.\n * It is used for properties that are not defined in schema.org and which validators\n * like Google Structured Data Testing Tool throw errors about.\n */\nexport interface MicrodataProperty {\n itemprop?: string\n 'data-itemprop'?: string\n itemref?: string\n}\n\ntype Role = 'array' | 'item'\n\n/**\n * Create `MicrodataProperty` attributes for a node property.\n *\n * @param property The name of the property\n * @param isItem Is the node for which attributes are being generated\n * an item within an array property? e.g. a `Person` in `authors`.\n * @param id Id of another Microdata item to link to using the `itemref` property.\n */\nexport function microdataProperty(\n property: string,\n role?: Role,\n id?: string\n): MicrodataProperty {\n const [prefix, name = ''] = microdataItemprop(property, role)\n const key = prefix === 'schema' ? 'itemprop' : 'data-itemprop'\n const itemrefAttr = id !== undefined ? { itemref: id } : {}\n return { [key]: name, ...itemrefAttr }\n}\n\n/**\n * Get the HTML Microdata `itemprop` for a Stencila Schema property.\n *\n * The `itemprop` attribute is normally just the name of the property\n * i.e. it is not prefixed by a base URL. This function returns the\n * `[prefix, name]` pair e.g. `[\"schema\", \"author\"]`,\n * `[\"codemeta\", \"maintainer\"]` because you may only want to encode\n * `itemprop`s for well known schemas e.g. schema.org\n *\n * @see {@link https://www.w3.org/TR/microdata/#dfn-attr-itemprop}\n *\n * @param property The name of the property\n * @param role Is the node for which attributes are being generated\n * an item within an array property? e.g. a `Person` in `authors`.\n */\nexport function microdataItemprop(\n property: string,\n role?: Role\n): [string | undefined, string | undefined] {\n if (role === 'array') return ['stencila', property]\n\n const context = jsonLdContext()\n const mapping = context[property]\n if (mapping === undefined) return [undefined, undefined]\n if (typeof mapping === 'string') return [undefined, mapping]\n\n const id = mapping['@id']\n let [prefix, name] = id.split(':')\n\n // If this is an item in an array property and the\n // name is a plural, then return a singular name.\n // For external vocabs the `@id` is usually a singular already e.g.\n // schema:author\n // codemeta:maintainer\n if (role === 'item' && prefix === 'stencila' && name.endsWith('s'))\n name = name.slice(0, -1)\n\n return [prefix, name]\n}\n\nexport type Microdata = MicrodataItem & MicrodataProperty\n\n/**\n * Create all Microdata attributes for a Stencila `Node`.\n *\n * @param node The node e.g. a `Person` node\n * @param property The name of the property that this node is part of e.g `authors`\n * @param role Is this an item within an array property e.g a `Person` within `authors`\n * @param id The id used to link to / from this Microdata item\n */\nexport function microdata(\n node: Node,\n property?: string,\n role?: Role,\n id?: string\n): Microdata {\n return {\n ...(role !== 'array'\n ? microdataItem(node, property === undefined ? id : undefined)\n : {}),\n ...(property !== undefined ? microdataProperty(property, role, id) : {}),\n }\n}\n\n/**\n * Get the 'pseudo' HTML Microdata attribute for the root element.\n *\n * This attribute name / value pair is used to scope CSS variables to\n * the root Stencila node in an HML document. It is used by Encoda when\n * encoding to HTML, it is in Thema to scope CSS variable thereby\n * avoiding variable name clashes from using the CSS `:root` pseudo-class.\n *\n * Although not directly related to Microdata, given it is used in both\n * of those projects, this appears to be the best place for it.\n */\nexport function microdataRoot(): { 'data-itemscope': 'root' } {\n return { 'data-itemscope': 'root' }\n}\n"],"names":["compact","o","Object","entries","reduce","compactedO","k","v","undefined","entity","props","type","arrayValidator","booleanValidator","cite","citeGroup","code","codeBlock","codeChunk","codeFragment","codeExpression","codeError","constantValidator","date","mark","del","emphasis","thing","brand","contactPoint","creativeWork","article","collection","comment","datatable","mediaObject","audioObject","datatableColumn","definedTerm","enumValidator","figure","function_","grant","heading","imageObject","include","numberValidator","integerValidator","link","list","listItem","math","mathBlock","mathFragment","monetaryGrant","nontextualAnnotation","organization","paragraph","variable","parameter","periodical","person","postalAddress","product","propertyValue","publicationIssue","publicationVolume","quote","quoteBlock","review","softwareApplication","softwareEnvironment","softwareSession","softwareSourceCode","stringValidator","strong","subscript","superscript","table","tableCell","tableRow","thematicBreak","tupleValidator","videoObject","volumeMount","codeBlockTypes","CodeBlock","CodeChunk","codeFragmentTypes","CodeFragment","CodeExpression","codeTypes","Code","contactPointTypes","ContactPoint","PostalAddress","creativeWorkTypes","CreativeWork","Article","AudioObject","Collection","Comment","Datatable","Figure","ImageObject","MediaObject","Periodical","PublicationIssue","PublicationVolume","Review","SoftwareApplication","SoftwareSourceCode","Table","VideoObject","entityTypes","Entity","ArrayValidator","BooleanValidator","Brand","Cite","CiteGroup","CodeError","ConstantValidator","DatatableColumn","Date","DefinedTerm","Delete","Emphasis","EnumValidator","Function","Grant","Heading","Include","IntegerValidator","Link","List","ListItem","Mark","Math","MathBlock","MathFragment","MonetaryGrant","NontextualAnnotation","NumberValidator","Organization","Paragraph","Parameter","Person","Product","PropertyValue","Quote","QuoteBlock","SoftwareEnvironment","SoftwareSession","StringValidator","Strong","Subscript","Superscript","TableCell","TableRow","ThematicBreak","Thing","TupleValidator","Variable","VolumeMount","grantTypes","markTypes","mathTypes","mediaObjectTypes","numberValidatorTypes","thingTypes","validatorTypes","variableTypes","blockContentTypes","inlineContentTypes","typeIs","typeMap","keys","includes","nodeIs","node","isEntity","is","isA","isInstanceOf","isType","isPrimitive","prototype","hasOwnProperty","call","isInlineEntity","isInlineContent","isBlockContent","isCreativeWork","isCode","isArticle","isParagraph","isListItem","version","pkgVersion","versionMajor","split","versionMinor","slice","join","CONTEXT","termToId","idToTerm","initMaps","context","jsonLdContext","term","value","startsWith","id","jsonLdUrl","json","fs","readFileSync","path","__dirname","__filename","endsWith","JSON","parse","jsonLdTermUrl","length","prefix","name","base","jsonLdTermName","url","hash","pathname","URL","pop","baseUrl","replace","RegExp","SCHEMAS","PROPERTIES","jsonSchemas","dir","files","Promise","resolve","reject","readdir","error","schemaFiles","filter","filename","promises","map","file","readFile","content","schemas","all","prev","schema","title","jsonSchemaTypes","jsonSchemaProperties","values","properties","forEach","prop","isArray","isPlural","existing","domainIncludes","message","Error","push","sort","key","nodeType","Array","microdataUrl","microdataItem","itemtype","microdataItemtype","itemidAttr","itemid","itemscope","microdataType","microdataProperty","property","role","microdataItemprop","itemrefAttr","itemref","mapping","microdata","microdataRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AAEA;AACA,MAAMA,OAAO,GAAsBC,CAAnB,IACdC,MAAM,CAACC,OAAP,CAAeF,CAAf,EAAkBG,MAAlB,CACE,CAACC,UAAD,EAAgB,CAACC,CAAD,EAAIC,CAAJ,CAAhB,KACEA,CAAC,KAAKC,SAAN,GAAkBH,UAAlB,gBAAoCA,UAApC;AAAgD,GAACC,CAAD,GAAKC;AAArD,EAFJ,EAGE,EAHF,CADF;AA8LA;;;;;;;MAKaE,MAAM,GAAG,CAACC,QAA8B,EAA/B,kBACjBV,OAAO,CAACU,KAAD,CADU;AAEpBC,EAAAA,IAAI,EAAE;AAFc;AAiBtB;;;;;;MAKaC,cAAc,GAAG,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