{
  "title": "Package Solution Task Configuration",
  "description": "Defines parameters for task which creates the SharePoint Package",

  "definitions": {
    "localized-string": {
      "type": "object",
      "oneOf": [
        {
          "required": ["default"]
        },
        {
          "required": ["id"]
        }
      ],
      "properties": {
        "default": {
          "title": "Default string",
          "description": "String to be used if a locale doesn't exist",
          "type": "string",
          "minLength": 1
        },
        "id": {
          "title": "Id for the localized string",
          "description": "Id for the localized string in the form '$<moduleName>:<expression>;'",
          "type": "string",
          "minLength": 1,
          "pattern": "^\\$[^:]+:.+;$"
        }
      },
      "additionalProperties": {
        "title": "Localized string",
        "type": "string",
        "minLength": 1
      }
    }
  },

  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "paths": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "packageDir": {
          "title": "Base Package Directory",
          "description": "The packaging root folder. Defaults to './sharepoint'",
          "type": "string"
        },
        "debugDir": {
          "title": "Debug Directory",
          "description": "The folder to write the raw package to disk for debugging. Defaults to 'solution/debug'",
          "type": "string"
        },
        "zippedPackage": {
          "title": "Zipped Package Name",
          "description": "The name of the sppkg to create (including extension) Defaults to 'ClientSolution.sppkg'",
          "type": "string"
        },
        "featureXmlDir": {
          "title": "Feature XML Directory",
          "description": "The folder containing the raw feature_xml to import into the package. Defaults to 'feature_xml'",
          "type": "string"
        },
        "sharepointAssetDir": {
          "title": "SharePoint Assets Directory",
          "description": "The folder containing SharePoint assets (elements.xml, upgrade actions, etc.). Defaults to 'assets'",
          "type": "string"
        }
      }
    },
    "solution": {
      "type": "object",
      "required": ["name", "id"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string",
          "description": "Non localized name to identify the package"
        },
        "id": {
          "title": "Name",
          "type": "string",
          "description": "A GUID identifier for this particular package"
        },
        "title": {
          "title": "Title",
          "description": "Localizable string for the title of the package. Can either be a non-localized string, or `$Resources:<stringId>;` if localized resources are provided for the package through a .resx file",
          "type": "string"
        },
        "supportedLocales": {
          "title": "Supported Locales",
          "description": "The list of cultures which this package can be used with. Follows LL-CC for each locale.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "version": {
          "title": "Version",
          "description": "Version of the package, may not match with the version of the components.",
          "type": "string",
          "pattern": "^[0-9]*.[0-9]*.[0-9]*.[0-9]*$"
        },
        "iconPath": {
          "title": "Icon Path",
          "description": "Relative path to the icon file. Base path is the base package directory.",
          "type": "string"
        },
        "skipFeatureDeployment": {
          "title": "Skip Feature Deployment",
          "description": "If true, allow the tenant admin the choice of being able to deploy the components to all sites immediately without running any feature deployment or adding apps in sites.",
          "type": "boolean"
        },
        "includeClientSideAssets": {
          "title": "Deploy client-side assets to SharePoint",
          "description": "If true, all client-side resources will be automatically included in the package and will be deployed to your SharePoint tenancy.",
          "type": "boolean"
        },
        "features": {
          "type": "array",
          "description": "If omitted, a feature will be created to contain the components.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["title", "description", "id"],
            "properties": {
              "title": {
                "title": "Title",
                "type": "string"
              },
              "description": {
                "title": "Description",
                "type": "string"
              },
              "id": {
                "title": "ID",
                "description": "A GUID identifier for this Feature",
                "type": "string"
              },
              "version": {
                "title": "The version of this Feature",
                "type": "string"
              },
              "componentIds": {
                "title": "The GUIDs of components which should be included in this feature. If omitted, all components will be included in this feature.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "assets": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "elementFiles": {
                    "title": "A list of element filenames.",
                    "description": "Any supported files that accompany the element manifest will be an element file. For example, the list instance schema is an element manifest that is associated with a list instance that is defined in an element manifest.",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "elementManifests": {
                    "title": "A list of element manifest filenames.",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "upgradeActions": {
                    "title": "A list of upgrade action filenames.",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "webApiPermissionRequests": {
          "title": "Web Api Permission Requests",
          "type": "array",
          "description": "Create a list of required WebApiPermissionRequests necessary for the solution.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["resource", "scope"],
            "dependencies": {
              "appId": ["replyUrl"],
              "replyUrl": ["appId"]
            },
            "properties": {
              "resource": {
                "title": "Resource",
                "description": "Specifies the name of the resource service principal to which access has been granted.",
                "type": "string"
              },
              "scope": {
                "title": "Scope",
                "description": "Specifies the name of the scope claim that the resource application should expect in the OAuth 2.0 access token.",
                "type": "string"
              },
              "appId": {
                "title": "AppId",
                "description": "Specifies the multi tenant application id of resource service principal application to which access should be granted",
                "type": "string"
              },
              "replyUrl": {
                "title": "ReplyUrl",
                "description": "Specifies the multi tenant app's replyUrl of resource service principal application, we need this for consenting flow",
                "type": "string"
              }
            }
          }
        },
        "isDomainIsolated": {
          "title": "Domain Isolation",
          "description": "If true, web parts in the package are rendered in a different domain for isolation",
          "type": "boolean"
        },
        "developer": {
          "title": "Developer Properties",
          "type": "object",
          "required": ["name", "websiteUrl", "privacyUrl", "termsOfUseUrl", "mpnId"],
          "properties": {
            "name": {
              "title": "developer name",
              "type": "string"
            },
            "websiteUrl": {
              "title": "developer website url",
              "type": "string"
            },
            "privacyUrl": {
              "title": "developer privacy url",
              "type": "string"
            },
            "termsOfUseUrl": {
              "title": "terms of use url",
              "type": "string"
            },
            "mpnId": {
              "title": "microsoft partner network id",
              "type": "string"
            }
          }
        },
        "metadata": {
          "title": "Additional Solution Metadata",
          "type": "object",
          "properties": {
            "shortDescription": {
              "title": "Short Description",
              "description": "Short description of the solution. This value will be displayed on Add an app page. A dictionary must contain a \"default\" key.",
              "$ref": "#/definitions/localized-string"
            },
            "longDescription": {
              "title": "Long Description",
              "description": "Long description of the solution with HTML support. This value will be displayed on the App's About page. A dictionary must contain a \"default\" key.",
              "$ref": "#/definitions/localized-string"
            },
            "screenshotPaths": {
              "type": "array",
              "maxItems": 5,
              "items": {
                "type": "string"
              },
              "title": "Solution Screenshots",
              "description": "Relative paths or absolute external URLs to the screenshots. The base for relative paths is the base package directory. The screenshots will be displayed on the App's About page. The developer may add up to 5 screenshots."
            },
            "videoUrl": {
              "title": "Video link (YouTube or Vimeo only)",
              "description": "Add a URL for your video (YouTube or Vimeo only). Recommended length: 60-90 seconds. Your video should communicate the value of your product in narrative form and/or demonstrate how the product works.",
              "type": "string"
            },
            "categories": {
              "title": "Categories",
              "description": "Choose the right categories to help your customers find your product in the marketplace. Your product description should show how these categories apply to your product.",
              "type": "array",
              "maxItems": 3,
              "items": {
                "type": "string",
                "enum": [
                  "Accounting + Finance",
                  "Collaboration",
                  "Content management",
                  "CRM",
                  "Data + analytics",
                  "File managers",
                  "IT/admin",
                  "Legal + HR",
                  "News + weather",
                  "Productivity",
                  "Project management",
                  "Reference",
                  "Sales + marketing",
                  "Site Design",
                  "Social",
                  "Workflow & Process Management"
                ]
              }
            }
          }
        }
      }
    }
  }
}
