{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "additionalProperties": false,
      "properties": {
        "artifactRelativePath": {
          "allOf": [
            {
              "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\/\\/)[^\\0\\r\\n]+\\.md$"
            }
          ],
          "type": "string"
        },
        "canonicalPath": {
          "allOf": [
            {
              "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\/\\/)[^\\0\\r\\n]+$"
            }
          ],
          "type": "string"
        },
        "citationAddress": {
          "type": "string"
        },
        "citationTargetId": {
          "type": "string"
        },
        "datasetDigest": {
          "allOf": [
            {
              "pattern": "^[0-9a-f]{64}$"
            }
          ],
          "type": "string"
        },
        "documentOrder": {
          "type": "integer"
        },
        "headingText": {
          "type": "string"
        },
        "headingTrail": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "markdown": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "schemaVersion": {
          "type": "string"
        },
        "slug": {
          "allOf": [
            {
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            }
          ],
          "type": "string"
        },
        "sourceArtifactBlockEndExclusive": {
          "type": "integer"
        },
        "sourceArtifactBlockStartIndex": {
          "type": "integer"
        },
        "sourceArtifactKind": {
          "enum": [
            "file",
            "directory-index",
            "document-frontmatter",
            "document-contents",
            "document-preamble"
          ],
          "type": "string"
        },
        "sourceDocumentPath": {
          "type": "string"
        },
        "sourceIndexKind": {
          "enum": [
            "body-block",
            "body-div"
          ],
          "type": "string"
        },
        "sourceTextUrl": {
          "allOf": [
            {
              "pattern": "^https:\\/\\/www\\.legislation\\.gov\\.au\\/.+$"
            }
          ],
          "type": "string"
        },
        "structuralPath": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "targetKind": {
          "enum": [
            "markdown-artifact"
          ],
          "type": "string"
        },
        "textDigest": {
          "allOf": [
            {
              "pattern": "^[0-9a-f]{64}$"
            }
          ],
          "type": "string"
        },
        "textDigestAlgorithm": {
          "enum": [
            "sha256"
          ],
          "type": "string"
        },
        "titleId": {
          "type": "string"
        },
        "versionDate": {
          "allOf": [
            {
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          ],
          "type": "string"
        }
      },
      "required": [
        "artifactRelativePath",
        "canonicalPath",
        "citationAddress",
        "citationTargetId",
        "datasetDigest",
        "documentOrder",
        "headingText",
        "headingTrail",
        "markdown",
        "name",
        "schemaVersion",
        "slug",
        "sourceArtifactBlockEndExclusive",
        "sourceArtifactBlockStartIndex",
        "sourceArtifactKind",
        "sourceDocumentPath",
        "sourceIndexKind",
        "sourceTextUrl",
        "structuralPath",
        "targetKind",
        "textDigest",
        "textDigestAlgorithm",
        "titleId",
        "versionDate"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "artifactRelativePath": {
          "allOf": [
            {
              "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\/\\/)[^\\0\\r\\n]+$"
            }
          ],
          "type": "string"
        },
        "canonicalPath": {
          "allOf": [
            {
              "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\/\\/)[^\\0\\r\\n]+$"
            }
          ],
          "type": "string"
        },
        "citationAddress": {
          "type": "string"
        },
        "citationTargetId": {
          "type": "string"
        },
        "datasetDigest": {
          "allOf": [
            {
              "pattern": "^[0-9a-f]{64}$"
            }
          ],
          "type": "string"
        },
        "headingText": {
          "type": "string"
        },
        "headingTrail": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "name": {
          "type": "string"
        },
        "schemaVersion": {
          "type": "string"
        },
        "slug": {
          "allOf": [
            {
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            }
          ],
          "type": "string"
        },
        "sourceArtifactKind": {
          "enum": [
            "structural-container"
          ],
          "type": "string"
        },
        "sourceTextUrl": {
          "allOf": [
            {
              "pattern": "^https:\\/\\/www\\.legislation\\.gov\\.au\\/.+$"
            }
          ],
          "type": "string"
        },
        "structuralPath": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "structuralPreorderIndex": {
          "type": "integer"
        },
        "targetKind": {
          "enum": [
            "structural-container"
          ],
          "type": "string"
        },
        "textDigest": {
          "allOf": [
            {
              "pattern": "^[0-9a-f]{64}$"
            }
          ],
          "type": "string"
        },
        "textDigestAlgorithm": {
          "enum": [
            "sha256"
          ],
          "type": "string"
        },
        "titleId": {
          "type": "string"
        },
        "versionDate": {
          "allOf": [
            {
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
            }
          ],
          "type": "string"
        }
      },
      "required": [
        "artifactRelativePath",
        "canonicalPath",
        "citationAddress",
        "citationTargetId",
        "datasetDigest",
        "headingText",
        "headingTrail",
        "name",
        "schemaVersion",
        "slug",
        "sourceArtifactKind",
        "sourceTextUrl",
        "structuralPath",
        "structuralPreorderIndex",
        "targetKind",
        "textDigest",
        "textDigestAlgorithm",
        "titleId",
        "versionDate"
      ],
      "type": "object"
    }
  ],
  "x-legislation": {
    "artifactFamilyKey": "citation-targets",
    "artifactPathPattern": ".tooling/citation-targets/<slug>.jsonl",
    "derivationMode": "effect-derived",
    "schemaPath": ".tooling/schemas/citation-targets.schema.json",
    "schemaVersion": "1.0.0",
    "shapeKind": "encoded-jsonl-record",
    "sourceEffectExport": "CitationTargetRecordJson",
    "sourceEffectModule": "src/domain/citationTarget.ts"
  }
}
