{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/truescript-for-tscript-files/versions/latest.json",
  "title": "TrueScript for *.tscript files",
  "description": "The Ultimate Script Language for monday.com - © 2024 MakeITSimple",
  "x-lintel": {
    "source": "https://www.schemastore.org/truescript.json",
    "sourceSha256": "c62021a11815e6e3bc00467d4f47ac12b90d2d16a2e09b2c551c4ec98440f87c",
    "fileMatch": [
      "*.tscript",
      "*.tscript.yaml",
      "*.tscript.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "truescript_version": {
      "$ref": "#/$defs/TrueScriptVersion",
      "description": "The minimal version to run this TrueScript. Format: \"major.minor.patch\""
    },
    "id": {
      "$ref": "#/$defs/UUID4",
      "description": "Unique ID of the TrueScript (UUID4)"
    },
    "name": {
      "description": "Short description of the TrueScript",
      "type": "string"
    },
    "description": {
      "description": "A more detailed description of the TrueScript",
      "type": "string"
    },
    "environment": {
      "$ref": "#/$defs/Environment",
      "description": "Intended environment to run the TrueScript"
    },
    "item_id": {
      "$ref": "#/$defs/MondayId",
      "description": "The item's ID to execute the TrueScript upon"
    },
    "params": {
      "description": "Parameters that will be passed to the TrueScript",
      "type": "object",
      "additionalProperties": true
    },
    "tags": {
      "description": "Free tags for any classification",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "result": {
      "description": "The expected result when running this TrueScript",
      "type": "object",
      "properties": {
        "result": {
          "$ref": "#/$defs/Result",
          "description": "The result of the execution of the TrueScript"
        },
        "error": {
          "description": "The error info (when 'result=error')",
          "type": "object",
          "properties": {
            "additionalProperties": true
          }
        }
      },
      "required": [
        "result"
      ]
    },
    "script": {
      "description": "The TrueScript itself",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    }
  },
  "$defs": {
    "TrueScriptVersion": {
      "description": "TrueScript version info. Format: \"major.minor.patch\"",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$"
    },
    "UUID4": {
      "description": "Unique ID (UUID4)",
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "Environment": {
      "description": "TrueScript environment",
      "type": "string",
      "enum": [
        "production",
        "staging",
        "development"
      ]
    },
    "MondayId": {
      "description": "Any monday.com ID",
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "Result": {
      "description": "The result of the execution of the TrueScript",
      "type": "string",
      "enum": [
        "success",
        "error"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "truescript_version",
    "id",
    "name",
    "environment",
    "item_id",
    "script"
  ]
}
