{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/liferay-client-extension-yaml/latest.json",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/liferay/liferay-portal/master/modules/sdk/gradle-plugins-workspace/src/main/resources/schemas/client-extension.schema.json",
    "sourceSha256": "4dff15c4bf356d81a78b63eb56955eb65d184c7b237da5a9dc5562eaa8ebe124",
    "fileMatch": [
      "client-extension.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "assemble": {
      "description": "Declares one or more copy schema definitions for copying resources to the client extension payload. The keys are used to construct a Gradle Copy task. See <https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Copy.html>.",
      "items": {
        "$ref": "#/$defs/schemas/properties/gradleCopySchema"
      },
      "type": "array"
    }
  },
  "$comment": "This JSON schema is published to https://www.schemastore.org/json. It can be found by searching under 'Liferay client-extension.yaml.' IntelliJ IDEA and VS Code both come with support for detecting schemas from JSON Schema Store.",
  "patternProperties": {
    "^(?!assemble$)[a-z][a-z-0-9]+$": {
      "description": "Kebab-case keys are treated as individual client extension definitions.",
      "oneOf": [
        {
          "$ref": "#/$defs/types/properties/batch",
          "properties": {
            "type": {
              "const": "batch"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/customElement",
          "properties": {
            "type": {
              "const": "customElement"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/editorConfigContributor",
          "properties": {
            "type": {
              "const": "editorConfigContributor"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/fdsCellRenderer",
          "properties": {
            "type": {
              "const": "fdsCellRenderer"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/fdsFilter",
          "properties": {
            "type": {
              "const": "fdsFilter"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/globalCSS",
          "properties": {
            "type": {
              "const": "globalCSS"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/globalJS",
          "properties": {
            "type": {
              "const": "globalJS"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/iframe",
          "properties": {
            "type": {
              "const": "iframe"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/instanceSettings",
          "properties": {
            "type": {
              "const": "instanceSettings"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/jsImportMapsEntry",
          "properties": {
            "type": {
              "const": "jsImportMapsEntry"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/notificationType",
          "properties": {
            "type": {
              "const": "notificationType"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/oAuthApplicationHeadlessServer",
          "properties": {
            "type": {
              "const": "oAuthApplicationHeadlessServer"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/oAuthApplicationUserAgent",
          "properties": {
            "type": {
              "const": "oAuthApplicationUserAgent"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/objectAction",
          "properties": {
            "type": {
              "const": "objectAction"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/objectEntryManager",
          "properties": {
            "type": {
              "const": "objectEntryManager"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/objectValidationRule",
          "properties": {
            "type": {
              "const": "objectValidationRule"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/siteInitializer",
          "properties": {
            "type": {
              "const": "siteInitializer"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/staticContent",
          "properties": {
            "type": {
              "const": "staticContent"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/themeCSS",
          "properties": {
            "type": {
              "const": "themeCSS"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/themeFavicon",
          "properties": {
            "type": {
              "const": "themeFavicon"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/themeSpritemap",
          "properties": {
            "type": {
              "const": "themeSpritemap"
            }
          },
          "type": "object"
        },
        {
          "$ref": "#/$defs/types/properties/workflowAction",
          "properties": {
            "type": {
              "const": "workflowAction"
            }
          },
          "type": "object"
        }
      ],
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "enum": [
            "batch",
            "customElement",
            "editorConfigContributor",
            "fdsCellRenderer",
            "fdsFilter",
            "globalCSS",
            "globalJS",
            "iframe",
            "instanceSettings",
            "jsImportMapsEntry",
            "notificationType",
            "oAuthApplicationHeadlessServer",
            "oAuthApplicationUserAgent",
            "objectAction",
            "objectEntryManager",
            "objectValidationRule",
            "siteInitializer",
            "staticContent",
            "themeCSS",
            "themeFavicon",
            "themeSpritemap",
            "workflowAction"
          ]
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "$defs": {
    "datatypes": {
      "properties": {
        "uniqueStringArray": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        }
      }
    },
    "propertySets": {
      "properties": {
        "batchJob": {
          "properties": {
            "oAuthApplicationHeadlessServer": {
              "type": "string"
            }
          },
          "required": [
            "oAuthApplicationHeadlessServer"
          ],
          "type": "object"
        },
        "externalService": {
          "properties": {
            ".serviceAddress": {
              "type": "string"
            },
            ".serviceScheme": {
              "type": "string"
            },
            "scopes": {
              "$ref": "#/$defs/datatypes/properties/uniqueStringArray"
            }
          },
          "required": [
            ".serviceAddress",
            ".serviceScheme",
            "scopes"
          ],
          "type": "object"
        },
        "url": {
          "properties": {
            "url": {
              "type": "string"
            }
          },
          "required": [
            "url"
          ],
          "type": "object"
        },
        "webHook": {
          "properties": {
            "oAuth2ApplicationExternalReferenceCode": {
              "type": "string"
            },
            "resourcePath": {
              "type": "string"
            }
          },
          "required": [
            "oAuth2ApplicationExternalReferenceCode",
            "resourcePath"
          ],
          "type": "object"
        }
      }
    },
    "schemas": {
      "properties": {
        "gradleCopySchema": {
          "type": "object",
          "properties": {
            "from": {
              "description": "The source directory to copy from. If none is provided, the yaml file's directory is used. Mutually exclusive with 'fromTask'.",
              "type": "string"
            },
            "fromTask": {
              "description": "The name of a Gradle task. The outputs of the declared task will be copied. Mutually exclusive with 'from'.",
              "type": "string"
            },
            "include": {
              "$ref": "#/$defs/datatypes/properties/uniqueStringArray",
              "description": "An array of glob patterns to include from the 'from' or 'fromTask' source. If none are provided, all contents will be copied."
            },
            "into": {
              "description": "The destination directory inside the project's build directory. If none is provided, it it will go to the build directory root.",
              "type": "string"
            }
          },
          "dependentSchemas": {
            "from": {
              "not": {
                "required": [
                  "fromTask"
                ]
              }
            },
            "fromTask": {
              "not": {
                "required": [
                  "from"
                ]
              }
            }
          }
        }
      }
    },
    "types": {
      "properties": {
        "batch": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/batchJob"
            }
          ],
          "description": "Description for batch"
        },
        "customElement": {
          "allOf": [
            {
              "properties": {
                "cssURLs": {
                  "$ref": "#/$defs/datatypes/properties/uniqueStringArray"
                },
                "friendlyURLMapping": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "htmlElementName": {
                  "description": "A lower-case kebab-case name to be used for the custom element. Must contain at least one hyphen.",
                  "pattern": "^[a-z]+-([a-z-]+)?[a-z]",
                  "type": "string"
                },
                "instanceable": {
                  "type": "boolean"
                },
                "jsonUrls": {
                  "$ref": "#/$defs/datatypes/properties/uniqueStringArray"
                },
                "key": {
                  "type": "string"
                },
                "portletCategoryName": {
                  "type": "string"
                },
                "properties": {
                  "type": "object"
                },
                "singleURL": {
                  "type": "string"
                },
                "urls": {
                  "$ref": "#/$defs/datatypes/properties/uniqueStringArray"
                },
                "useESM": {
                  "type": "boolean"
                }
              },
              "required": [
                "htmlElementName",
                "urls"
              ],
              "type": "object"
            }
          ],
          "description": "Description for customElement"
        },
        "editorConfigContributor": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            }
          ],
          "description": "Description for editorConfigContributor"
        },
        "fdsCellRenderer": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            }
          ],
          "description": "Description for fdsCellRenderer"
        },
        "fdsFilter": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            }
          ],
          "description": "Description for fdsFilter"
        },
        "globalCSS": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            },
            {
              "properties": {
                "scope": {
                  "default": "layout",
                  "enum": [
                    "company",
                    "layout"
                  ]
                }
              }
            }
          ],
          "description": "Description for globalCSS"
        },
        "globalJS": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            },
            {
              "properties": {
                "scope": {
                  "default": "layout",
                  "enum": [
                    "company",
                    "layout"
                  ]
                },
                "scriptElementAttributes": {
                  "type": "object",
                  "description": "",
                  "properties": {
                    "src": false
                  },
                  "title": "Script Element Attributes",
                  "additionalProperties": {
                    "type": [
                      "boolean",
                      "integer",
                      "number",
                      "string"
                    ]
                  }
                },
                "scriptLocation": {
                  "description": "",
                  "type": "string"
                }
              },
              "type": "object"
            }
          ],
          "description": "Description for globalJS"
        },
        "iframe": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            },
            {
              "properties": {
                "portletCategoryName": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          ],
          "description": "Description for iframe"
        },
        "instanceSettings": {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/liferay-client-extension-yaml/_shared/latest--client-extension-type-instance-settings.schema.json",
          "description": "Description for instanceSettings"
        },
        "jsImportMapsEntry": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            },
            {
              "properties": {
                "bareSpecifier": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          ],
          "description": "Description for jsImportMapsEntry"
        },
        "notificationType": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/webHook"
            }
          ],
          "description": "Description for notificationType"
        },
        "oAuthApplicationHeadlessServer": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/externalService"
            }
          ],
          "description": "Description for oAuthApplicationHeadlessServer"
        },
        "oAuthApplicationUserAgent": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/externalService"
            }
          ],
          "description": "Description for oAuthApplicationUserAgent"
        },
        "objectAction": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/webHook"
            }
          ],
          "description": "Description for objectAction"
        },
        "objectEntryManager": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/webHook"
            }
          ],
          "description": "Description for objectEntryManager"
        },
        "objectValidationRule": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/webHook"
            },
            {
              "properties": {
                "allowedObjectDefinitionNames": {
                  "$ref": "#/$defs/datatypes/properties/uniqueStringArray"
                }
              },
              "type": "object"
            }
          ],
          "description": "Description for objectValidationRule"
        },
        "siteInitializer": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/batchJob"
            },
            {
              "properties": {
                "builtInTemplateKey": {
                  "type": "string"
                },
                "builtInTemplateType": {
                  "enum": [
                    "site-initializer",
                    "site-template"
                  ]
                },
                "membershipType": {
                  "default": "open",
                  "enum": [
                    "open",
                    "private",
                    "restricted"
                  ]
                },
                "parentSiteKey": {
                  "type": "string"
                },
                "siteExternalReferenceCode": {
                  "type": "string"
                },
                "siteName": {
                  "type": "string"
                }
              },
              "required": [
                "siteName",
                "siteExternalReferenceCode"
              ],
              "type": "object"
            }
          ],
          "description": "Description for siteInitializer"
        },
        "staticContent": {
          "description": "Description for staticContent"
        },
        "themeCSS": {
          "allOf": [
            {
              "properties": {
                "clayRTLURL": {
                  "type": "string"
                },
                "clayURL": {
                  "type": "string"
                },
                "mainRTLURL": {
                  "type": "string"
                },
                "mainURL": {
                  "type": "string"
                },
                "scope": {
                  "default": "layout",
                  "enum": [
                    "controlPanel",
                    "layout"
                  ]
                }
              },
              "type": "object"
            }
          ],
          "description": "Description for themeCSS"
        },
        "themeFavicon": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            }
          ],
          "description": "Description for themeFavicon"
        },
        "themeSpritemap": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/url"
            }
          ],
          "description": "Description for themeSpritemap"
        },
        "workflowAction": {
          "allOf": [
            {
              "$ref": "#/$defs/propertySets/properties/webHook"
            }
          ],
          "description": "Description for workflowAction"
        }
      }
    }
  }
}
