{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ts-force-config-json/latest.json",
  "x-lintel": {
    "source": "https://www.schemastore.org/ts-force-config.json",
    "sourceSha256": "9df4c3b93d27d3131680d032c1dada7cd73f4a268ace562db500a24629a3a007",
    "fileMatch": [
      "ts-force-config.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "auth": {
      "$ref": "#/$defs/AuthConfig",
      "description": "Authentication Method.  Choose one of three:\n- You can either username/password oAuth configuration\n- sfdx configuration (`username` only)\n- `accessToken` & `instanceUrl`\nSee readme for examples."
    },
    "enforcePicklistValues": {
      "description": "Make picklist fields strongly typed to generated enums. `generatePicklists` must also be `true`\n  `ALL`: for all picklist fields, regardless of salesforce enforcement\n  `RESTRICTED`: only on fields where the values are restricted on Salesforce",
      "enum": [
        "ALL",
        "RESTRICTED",
        false
      ]
    },
    "generatePicklists": {
      "description": "Flag to generate enums for picklist fields.  Defaulted to false",
      "type": "boolean"
    },
    "outPath": {
      "description": "The path to generate files to.\n   If the destination is a folder, it will generate one file per object.\n   If the destination is a `.ts` file, a single file will be generated.\n   If not set, class output will be logged to `stdout`",
      "type": "string"
    },
    "sObjects": {
      "description": "The SObjects to generate classes for.  Can either be a string or an `SObjectConfig` object",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/SObjectConfig"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array"
    }
  },
  "$defs": {
    "AuthConfig": {
      "properties": {
        "accessToken": {
          "type": "string"
        },
        "clientId": {
          "type": "string"
        },
        "clientSecret": {
          "type": "string"
        },
        "instanceUrl": {
          "type": "string"
        },
        "oAuthHost": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "username": {
          "description": "If using `sfdx-cli` auth, this is the only property needed to authenticate.\nOtherwise, supply additional oAuth parameters",
          "type": "string"
        },
        "version": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "FieldMapping": {
      "properties": {
        "apiName": {
          "description": "The Target SObject API name",
          "type": "string"
        },
        "propName": {
          "description": "The generated class property name",
          "type": "string"
        }
      },
      "required": [
        "apiName",
        "propName"
      ],
      "type": "object"
    },
    "SObjectConfig": {
      "description": "Object used to configure advanced settings on SObject generation",
      "properties": {
        "apiName": {
          "description": "The Target SObject API name",
          "type": "string"
        },
        "autoConvertNames": {
          "description": "Defaulted to true.  If set to false, names will NOT be auto-converted to standard javascript conventions",
          "type": "boolean"
        },
        "className": {
          "description": "The generated class name.  If not set, it will be automatically\nconverted to standard javascript Class convention",
          "type": "string"
        },
        "enforcePicklistValues": {
          "description": "*Overrides Global Setting*\nThe path to generate files to.\n   If the destination is a folder, it will generate one file per object.\n   If the destination is a `.ts` file, a single file will be generated.\n   If not set, class output will be logged to `stdout`",
          "enum": [
            "ALL",
            "RESTRICTED",
            false
          ]
        },
        "fieldMappings": {
          "description": "List of field mappings to override the auto-conversion",
          "items": {
            "$ref": "#/$defs/FieldMapping"
          },
          "type": "array"
        },
        "generatePicklists": {
          "description": "*Overrides Global Setting*\nMake picklist fields strongly typed to generated enums. `generatePicklists` must also be `true`\n  `ALL`: for all picklist fields, regardless of salesforce enforcement\n  `RESTRICTED`: only on fields where the values are restricted on Salesforce",
          "type": "boolean"
        }
      },
      "required": [
        "apiName"
      ],
      "type": "object"
    }
  }
}
