From 0c9b98fd4438fe23cf4c582fe7811f971910be81 Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Wed, 22 Sep 2021 15:06:12 +0800 Subject: [PATCH] IssueNo:#I4BBQK Description:add schema Sig:packingTool Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengjia Change-Id: I210d293e47d75c298be5fdf47be7861f28dded80 Signed-off-by: wangdengjia --- configcheck/configSchema_lite.json | 234 +++++++++++++++++++++-- configcheck/configSchema_rich.json | 294 +++++++++++++++++++++++++++-- 2 files changed, 504 insertions(+), 24 deletions(-) diff --git a/configcheck/configSchema_lite.json b/configcheck/configSchema_lite.json index 3c2f30c5..05b2c1cb 100644 --- a/configcheck/configSchema_lite.json +++ b/configcheck/configSchema_lite.json @@ -39,7 +39,7 @@ "type": "string", "maxLength": 127, "minLength": 7, - "pattern": "^(([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[.]([0-9a-zA-Z_.]+))|([{]([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[}](.huawei.com))$" + "pattern": "^(([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[.]([0-9a-zA-Z_.]+))|([{]([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[}](.huawei.com))|[{](bundleName)[}]$" }, "vendor": { "description": "Describes the application vendor. The value is a string with a maximum of 255 bytes. This label can be left blank by default.", @@ -65,28 +65,25 @@ "description": "Indicates the version number of the application. The value is an integer greater than 0. A larger value generally represents a later version.The system determines the application version based on the tag value.This label cannot be left blank.", "type": "integer", "minimum": 0, - "maxLength": 32 + "maximum": 2147483647 }, "name": { "description": "Indicates the text description of the application version.Used for displaying to users.A string can contain a maximum of 127 bytes.This label cannot be left blank.", "type": "string", "maxLength": 127, - "pattern": "^[0-9.]+$" + "pattern": "^[0-9.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" }, "minCompatibleVersionCode": { "description": "This label identifies the earliest historical version compatible with the app pack, which is used for cross-device compatibility determination.This label is an integer and can be defaulted.", "type": "integer", "minimum": 0, - "maxLength": 32 + "maximum": 2147483647 } } }, "apiVersion": { "description": "This tag identifies the Harmony API version on which the application depends.", "type": "object", - "required": [ - "compatible" - ], "propertyNames": { "enum": [ "compatible", @@ -206,7 +203,8 @@ "distro", "reqCapabilities", "metaData", - "resizeable" + "resizeable", + "distroFilter" ] }, "properties": { @@ -321,7 +319,7 @@ "label": { "description": "Indicates the ability name visible to users. The tag value is set to the resource index of this name to support multiple languages.", "type": "string", - "pattern": "^[$]string:[0-9a-zA-Z_.]+$", + "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$", "maxLength": 255 }, "visible": { @@ -343,7 +341,7 @@ "type": "boolean" }, "srcLanguage": { - "description": "Type of the ability development language. The value can be java, js, or ets.The label cannot be defaulted.", + "description": "Type of the capability development language. The value can be java, js, or ets.The label cannot be defaulted.", "type": "string", "enum": [ "java", @@ -352,7 +350,7 @@ ] }, "srcPath": { - "description": "This tag indicates the JS component code path corresponding to the ability. The tag value is a character string.", + "description": "This tag indicates the JS component code path corresponding to the ability. The tag value is a character string (a maximum of 127 bytes). When srcLanguage is set to js or ets, this tag cannot be defaulted.", "type": "string", "maxLength": 127 } @@ -474,6 +472,194 @@ "description": "Indicates whether the application supports the multi-window feature.", "type": "boolean" }, + "distroFilter": { + "description": "This tag is used for precise matching during cloud distribution in the AppGallery and defines the HAP distribution policy.", + "type": "object", + "propertyNames": { + "enum": [ + "apiVersion", + "screenShape", + "screenWindow", + "screenDensity", + "countryCode" + ] + }, + "properties": { + "apiVersion": { + "description": "Indicates the supported apiVersion range. The value can be 3, 4, or 5. This label is optional.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "integer", + "minimum": 3 + }, + "uniqueItems": true + } + } + }, + "screenShape": { + "description": "Indicates the screen shape enumeration. The value can be circle or rect, indicating a circle or rectangle screen.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "circle", + "rect" + ] + }, + "uniqueItems": true + } + } + }, + "screenWindow": { + "description": "Indicates the resolution of the window when the application is running. This parameter can be configured only for liteWearable devices. This field is optional. If this field is configured, the value must be valid. The tag value type is a string array.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "pattern": "^([1-9][0-9]*)\\*([1-9][0-9]*)$" + }, + "uniqueItems": true + } + } + }, + "screenDensity": { + "description": "This label indicates the pixel density of the screen (dpi: Dots Per Inch). This field is optional. If this field is configured, the value must be valid. The tag value is a string array.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "sdpi", + "mdpi", + "ldpi", + "xldpi", + "xxldpi", + "xxxldpi" + ] + }, + "uniqueItems": true + } + } + }, + "countryCode": { + "description": "This label indicates the country code to be distributed to the application. The specific value is subject to the ISO-3166 -1 standard. Multiple country and region enumeration definitions are supported. This field is optional. If this field is configured, the value must be valid. The tag value is astring array. The substring indicates the supported country or region and consists of two uppercase letters.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + } + } + } + }, "metaData": { "description": "Indicates the metadata of the ability.", "type": "object", @@ -584,6 +770,32 @@ } } } + }, + "if": { + "properties": { + "distro": { + "properties": { + "moduleType": { + "const": "feature" + } + } + } + } + }, + "then": { + "propertyNames": { + "enum": [ + "description", + "abilities", + "js", + "reqPermissions", + "deviceType", + "distro", + "reqCapabilities", + "metaData", + "resizeable" + ] + } } } } diff --git a/configcheck/configSchema_rich.json b/configcheck/configSchema_rich.json index c5637f1e..072d1186 100644 --- a/configcheck/configSchema_rich.json +++ b/configcheck/configSchema_rich.json @@ -42,7 +42,7 @@ "type": "string", "maxLength": 127, "minLength": 7, - "pattern": "^(([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[.]([0-9a-zA-Z_.]+))|([{]([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[}](.huawei.com))$" + "pattern": "^(([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[.]([0-9a-zA-Z_.]+))|([{]([a-zA-Z]|[a-zA-Z][0-9a-zA-Z_]+)[}](.huawei.com))|[{](bundleName)[}]$" }, "vendor": { "description": "Describes the application vendor. The value is a string with a maximum of 255 bytes. This label is a string type and can be defaulted.", @@ -68,28 +68,25 @@ "description": "Indicates the version number of the application. The value is an integer greater than 0. A larger value generally represents a later version.The system determines the application version based on the tag value.This label cannot be left blank.", "type": "integer", "minimum": 0, - "maxLength": 32 + "maximum": 2147483647 }, "name": { "description": "Indicates the text description of the application version.Used for displaying to users.A string can contain a maximum of 127 bytes.This label cannot be left blank.", "type": "string", "maxLength": 127, - "pattern": "^[0-9.]+$" + "pattern": "^[0-9.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" }, "minCompatibleVersionCode": { "description": "This label identifies the earliest historical version compatible with the app pack, which is used for cross-device compatibility determination.This label is an integer and can be defaulted.", "type": "integer", "minimum": 0, - "maxLength": 32 + "maximum": 2147483647 } } }, "apiVersion": { "description": "This tag identifies the Harmony API version on which the application depends.", "type": "object", - "required": [ - "compatible" - ], "propertyNames": { "enum": [ "compatible", @@ -1143,7 +1140,8 @@ "theme", "mainAbility", "resizeable", - "entryTheme" + "entryTheme", + "distroFilter" ] }, "properties": { @@ -1497,7 +1495,7 @@ "label": { "description": "Indicates the ability name visible to users. The tag value is set to the resource index of this name to support multiple languages.", "type": "string", - "pattern": "^[$]string:[0-9a-zA-Z_.]+$", + "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$", "maxLength": 255 }, "visible": { @@ -1851,7 +1849,8 @@ "mnc", "orientation", "size", - "smallestSize" + "smallestSize", + "colorMode" ] } }, @@ -1886,7 +1885,7 @@ "type": "boolean" }, "srcLanguage": { - "description": "Type of the ability development language. The value can be java, js, or ets.The label cannot be defaulted.", + "description": "Type of the capability development language. The value can be java, js, or ets.The label cannot be defaulted.", "type": "string", "enum": [ "java", @@ -1895,7 +1894,7 @@ ] }, "srcPath": { - "description": "This tag indicates the JS component code path corresponding to the ability. The tag value is a character string.", + "description": "This tag indicates the JS component code path corresponding to the ability. The tag value is a character string (a maximum of 127 bytes). When srcLanguage is set to js or ets, this tag cannot be defaulted.", "type": "string", "maxLength": 127 }, @@ -2180,7 +2179,8 @@ "name", "pages", "window", - "type" + "type", + "mode" ] }, "properties": { @@ -2225,6 +2225,48 @@ "form" ] }, + "mode": { + "description": "Defines the development mode of the JS component. This tag can be defaulted. The tag value is an object and contains two subtags: type and syntax.", + "type": "object", + "propertyNames": { + "enum": [ + "type", + "syntax" + ] + }, + "properties": { + "type": { + "description": "Defines the function type of the JS component. The tag can be defaulted. The default value is pageAbility. The combination of type to form and syntax to ets is not supported.", + "type": "string", + "enum": [ + "pageAbility", + "form" + ] + }, + "syntax": { + "description": "Defines the syntax type of the JS component. The tag can be defaulted. The default value is hml. The combination of type to form and syntax to ets is not supported.", + "type": "string", + "enum": [ + "hml", + "ets" + ] + } + }, + "if": { + "properties": { + "type": { + "const": "form" + } + } + }, + "then": { + "properties": { + "syntax": { + "const": "hml" + } + } + } + }, "mergeRule": { "description": "Tags identify the rule for merging configs.", "type": "object", @@ -2690,6 +2732,194 @@ "type": "string", "pattern": "^[$](.*):(.*)+$" }, + "distroFilter": { + "description": "This tag is used for precise matching during cloud distribution in the AppGallery and defines the HAP distribution policy.", + "type": "object", + "propertyNames": { + "enum": [ + "apiVersion", + "screenShape", + "screenWindow", + "screenDensity", + "countryCode" + ] + }, + "properties": { + "apiVersion": { + "description": "Indicates the supported apiVersion range. The value can be 3, 4, or 5. This label is optional.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "integer", + "minimum": 3 + }, + "uniqueItems": true + } + } + }, + "screenShape": { + "description": "Indicates the screen shape enumeration. The value can be circle or rect, indicating a circle or rectangle screen.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "circle", + "rect" + ] + }, + "uniqueItems": true + } + } + }, + "screenWindow": { + "description": "Indicates the resolution of the window when the application is running. This parameter can be configured only for liteWearable devices. This field is optional. If this field is configured, the value must be valid. The tag value type is a string array.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "pattern": "^([1-9][0-9]*)\\*([1-9][0-9]*)$" + }, + "uniqueItems": true + } + } + }, + "screenDensity": { + "description": "This label indicates the pixel density of the screen (dpi: Dots Per Inch). This field is optional. If this field is configured, the value must be valid. The tag value is a string array.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "sdpi", + "mdpi", + "ldpi", + "xldpi", + "xxldpi", + "xxxldpi" + ] + }, + "uniqueItems": true + } + } + }, + "countryCode": { + "description": "This label indicates the country code to be distributed to the application. The specific value is subject to the ISO-3166 -1 standard. Multiple country and region enumeration definitions are supported. This field is optional. If this field is configured, the value must be valid. The tag value is astring array. The substring indicates the supported country or region and consists of two uppercase letters.", + "type": "object", + "propertyNames": { + "enum": [ + "policy", + "value" + ] + }, + "required": [ + "policy", + "value" + ], + "properties": { + "policy": { + "description": "The policy tag indicates the list rule of the value of the sublabel. Either exclude or include can be used.", + "type": "string", + "enum": [ + "include", + "exclude" + ] + }, + "value": { + "description": "Indicates the value range of the sublabel.", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + } + } + } + }, "metaData": { "description": "Indicates the metadata of the ability.", "type": "object", @@ -2887,6 +3117,44 @@ } } } + }, + "if": { + "properties": { + "distro": { + "properties": { + "moduleType": { + "const": "feature" + } + } + } + } + }, + "then": { + "propertyNames": { + "enum": [ + "commonEvents", + "description", + "abilities", + "js", + "reqPermissions", + "deviceType", + "distro", + "reqCapabilities", + "metaData", + "package", + "name", + "supportedModes", + "shortcuts", + "defPermissions", + "defPermissionGroups", + "allowClassMap", + "colorMode", + "theme", + "mainAbility", + "resizeable", + "entryTheme" + ] + } } } }, -- Gitee