diff --git a/build-tools/dts_parser/kit.json b/build-tools/dts_parser/kit.json index 420cdfea7..bcc8882fc 100644 --- a/build-tools/dts_parser/kit.json +++ b/build-tools/dts_parser/kit.json @@ -1,5 +1,5 @@ { - "data": [ + "kitData": [ { "filePath": "@internal/component/ets/ability_component.d.ts", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, { "filePath": "@internal/component/ets/action_sheet.d.ts", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, { "filePath": "@internal/component/ets/alert_dialog.d.ts", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, diff --git a/build-tools/dts_parser/src/bin/config.ts b/build-tools/dts_parser/src/bin/config.ts index af94cbb52..0e4f8b713 100644 --- a/build-tools/dts_parser/src/bin/config.ts +++ b/build-tools/dts_parser/src/bin/config.ts @@ -52,6 +52,10 @@ export enum toolNameType { * 检查工具 线上版 */ CHECKONLINE = 'checkOnline', + /** + * 兼容性变更检查工具 线上版 + */ + APICHANGECHECK = 'apiChangeCheck', /** * diff工具 */ @@ -122,6 +126,10 @@ export const Plugin: PluginType = { isRequiredOption: false, options: ['--checker ', 'check api rule, split with comma', 'all'], }, + { + isRequiredOption: false, + options: ['--prId ', 'check api prId', ''], + }, { isRequiredOption: false, options: ['--excel ', 'check api excel', 'false'], @@ -175,6 +183,7 @@ export const Plugin: PluginType = { isOH: argv.isOH, path: argv.path, checker: argv.checker, + prId: argv.prId, old: argv.old, new: argv.new, oldVersion: argv.oldVersion, @@ -323,7 +332,7 @@ function collectApiCallback(apiData: ApiStatisticsInfo[], sheet: ExcelJS.Workshe }); } /** - * 收集api工具调用方法 + * api检查工具调用方法 * * @param { OptionObjType } options * @return { ToolNameValueType } @@ -335,7 +344,7 @@ function checkApi(): ToolNameValueType { if (fs.existsSync(filePathTxt)) { mdApiFiles = CommonFunctions.getMdFiles(filePathTxt); } - LocalEntry.checkEntryLocal(mdApiFiles, ['all'], './result.json', 'true'); + LocalEntry.checkEntryLocal(mdApiFiles, ['all'], './result.json', '', 'true'); return { data: [], }; @@ -348,7 +357,7 @@ function checkApi(): ToolNameValueType { } } /** - * 收集api工具调用方法 + * api检查工具调用方法 * * @param { OptionObjType } options * @return { ToolNameValueType } @@ -356,7 +365,8 @@ function checkApi(): ToolNameValueType { function checkOnline(options: OptionObjType): ToolNameValueType { options.format = formatType.NULL; try { - LocalEntry.checkEntryLocal(options.path.split(','), options.checker.split(','), options.output, options.excel); + LocalEntry.checkEntryLocal(options.path.split(','), options.checker.split(','), options.output, options.prId, + options.excel); return { data: [], }; @@ -370,6 +380,29 @@ function checkOnline(options: OptionObjType): ToolNameValueType { }; } +/** + * api检查工具调用方法 + * + * @param { OptionObjType } options + * @return { ToolNameValueType } + */ +function apiChangeCheck(options: OptionObjType): ToolNameValueType { + options.format = formatType.NULL; + try { + LocalEntry.apiChangeCheckEntryLocal(options.prId, options.checker.split(','), options.output, options.excel); + return { + data: [], + }; + } catch (exception) { + const error = exception as Error; + LogUtil.e('error api change check', error.stack ? error.stack : error.message); + } finally { + } + return { + data: [], + }; +} + /** * diffApi工具调用方法 * @@ -573,6 +606,7 @@ export const toolNameMethod: Map = new Map([ [toolNameType.COLLECT, collectApi], [toolNameType.CHECK, checkApi], [toolNameType.CHECKONLINE, checkOnline], + [toolNameType.APICHANGECHECK, apiChangeCheck], [toolNameType.DIFF, diffApi], [toolNameType.LABELDETECTION, detectionApi], [toolNameType.COUNT, countApi] @@ -583,12 +617,13 @@ export const toolNameMethod: Map = new Map([ */ export type OptionObjType = { toolName: toolNameType; + path: string; + checker: string; + prId: string; collectPath: string; collectFile: string; checkLabels: string; isOH: string; - path: string; - checker: string; old: string; new: string; oldVersion: string; diff --git a/build-tools/dts_parser/src/coreImpl/checker/config/api_check_config.json b/build-tools/dts_parser/src/coreImpl/checker/config/api_check_config.json index 18891ab21..2df5588f7 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/config/api_check_config.json +++ b/build-tools/dts_parser/src/coreImpl/checker/config/api_check_config.json @@ -147,21 +147,41 @@ "API_DEFINE_ANONYMOUS_FUNCTION_01": "Anonymous functions or anonymous object that are not allowed are used in this api." }, "CHANEGE": { - "API_CHANGE_INCOMPATIBLE_01": "Forbid changes: API level change to system.", - "API_CHANGE_INCOMPATIBLE_02": "Forbid changes: API mode change.", - "API_CHANGE_INCOMPATIBLE_03": "Forbid changes: API card delete.", - "API_CHANGE_INCOMPATIBLE_04": "Forbid changes: API crossplatform delete.", - "API_CHANGE_INCOMPATIBLE_05": "Forbid changes: API errorcode cannot be created or modified.", - "API_CHANGE_INCOMPATIBLE_06": "Forbid changes: API cannot be changed.", - "API_CHANGE_INCOMPATIBLE_07": "Forbid changes: Function return type cannot be changed.", - "API_CHANGE_INCOMPATIBLE_08": "Forbid changes: Property cannot be changed.", - "API_CHANGE_INCOMPATIBLE_09": "Forbid changes: Constant value cannot be changed.", - "API_CHANGE_INCOMPATIBLE_10": "Forbid changes: Type alias cannot be changed.", - "API_CHANGE_INCOMPATIBLE_11": "Forbid changes: Enum number value cannot be changed.", - "API_CHANGE_INCOMPATIBLE_12": "Forbid changes: API cannot be deleted.", - "API_CHANGE_INCOMPATIBLE_13": "Forbid changes: Historical JSDoc cannot be changed.", - "API_CHANGE_INCOMPATIBLE_14": "Forbid changes: API changes must add a new section of JSDoc.", - "API_CHANGE_INCOMPATIBLE_15": "Forbid changes: Parameters cannot be changed.", - "API_CHANGE_INCOMPATIBLE_16": "Forbid changes: Permission tag cannot be created or modified." + "API_CHANGE_INCOMPATIBLE_01": "Forbid changes: Cannot change from public API to system API.", + "API_CHANGE_INCOMPATIBLE_02": "Forbid changes: Cannot reduce or permission or increase and permission.", + "API_CHANGE_INCOMPATIBLE_03": "Forbid changes: Cannot change permission value,cannot judge the range change.", + "API_CHANGE_INCOMPATIBLE_04": "Forbid changes: The number of error codes cannot be increased from 1 to multiple error codes.", + "API_CHANGE_INCOMPATIBLE_05": "Forbid changes: Cannot change the error code value.", + "API_CHANGE_INCOMPATIBLE_06": "Forbid changes: The card application cannot be changed from supported to not supported.", + "API_CHANGE_INCOMPATIBLE_07": "Forbid changes: Crossplatform cannot be changed from supported to not supported.", + "API_CHANGE_INCOMPATIBLE_08": "Forbid changes: API cannot be deleted.", + "API_CHANGE_INCOMPATIBLE_09": "Forbid changes: Cannot change from FAModelOnly to StageModelOnly.", + "API_CHANGE_INCOMPATIBLE_10": "Forbid changes: Cannot change from StageModelOnly to FAModelOnly.", + "API_CHANGE_INCOMPATIBLE_11": "Forbid changes: Cannot change from nothing to StageModelOnly.", + "API_CHANGE_INCOMPATIBLE_12": "Forbid changes: Cannot change from nothing to FAModelOnly.", + "API_CHANGE_INCOMPATIBLE_13": "Forbid changes: The function return value type cannot be extended.", + "API_CHANGE_INCOMPATIBLE_14": "Forbid changes: The function return value type cannot be reduced.", + "API_CHANGE_INCOMPATIBLE_15": "Forbid changes: Cannot change function return value type.", + "API_CHANGE_INCOMPATIBLE_16": "Forbid changes: Cannot change function param position.", + "API_CHANGE_INCOMPATIBLE_17": "Forbid changes: Cannot add function required param.", + "API_CHANGE_INCOMPATIBLE_18": "Forbid changes: Cannot delete function param.", + "API_CHANGE_INCOMPATIBLE_19": "Forbid changes: Cannot change form unrequired param to required param.", + "API_CHANGE_INCOMPATIBLE_20": "Forbid changes: Cannot change function param type.", + "API_CHANGE_INCOMPATIBLE_21": "Forbid changes: The function param type range is cannot be reduced.", + "API_CHANGE_INCOMPATIBLE_22": "Forbid changes: Read-only properties cannot be changed from optional to required.", + "API_CHANGE_INCOMPATIBLE_23": "Forbid changes: Writable properties cannot be changed from required to optional.", + "API_CHANGE_INCOMPATIBLE_24": "Forbid changes: Writable properties cannot be changed from optional to required.", + "API_CHANGE_INCOMPATIBLE_25": "Forbid changes: Cannot change property type.", + "API_CHANGE_INCOMPATIBLE_26": "Forbid changes: Cannot Expand the range of readonly property types.", + "API_CHANGE_INCOMPATIBLE_27": "Forbid changes: Cannot Expand the range of writable property types.", + "API_CHANGE_INCOMPATIBLE_28": "Forbid changes: Cannot reduce the range of writable property types.", + "API_CHANGE_INCOMPATIBLE_29": "Forbid changes: Decorator cannot be deleted.", + "API_CHANGE_INCOMPATIBLE_30": "Forbid changes: Cannot change constant value.", + "API_CHANGE_INCOMPATIBLE_31": "Forbid changes: Cannot change custom type value.", + "API_CHANGE_INCOMPATIBLE_32": "Forbid changes: Cannot expand the range of custom type.", + "API_CHANGE_INCOMPATIBLE_33": "Forbid changes: Cannot reduce the range of custom type.", + "API_CHANGE_INCOMPATIBLE_34": "Forbid changes: Cannot change Enumeration assignment.", + "API_CHANGE_INCOMPATIBLE_35": "Forbid changes: Historical JSDoc cannot be changed.", + "API_CHANGE_INCOMPATIBLE_36": "Forbid changes: API changes must add a new section of JSDoc." } } \ No newline at end of file diff --git a/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json b/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json index 2e826a620..7aa9b59e9 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json +++ b/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json @@ -1,3025 +1,3666 @@ { - "app": { - "bundleName": "ohos.global.systemres", - "icon": "$media:ohos_app_icon", - "label": "$string:ohos_app_name", - "singleton": true, - "vendor": "ohos", - "version": { - "code": 2, - "name": "2.0.0.1" - }, - "apiVersion": { - "compatible": 3, - "target": 3 - } - }, - "deviceConfig": { - "default": { - } - }, "module": { - "package": "ohos.global.systemres", - "generateBuildHash":true, - "deviceType": [ - "default", - "tv", - "car", - "wearable", - "tablet", - "2in1" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" + "package": "ohos.global.systemres", + "name": "entry", + "type": "entry", + "generateBuildHash": true, + "deviceTypes": [ + "default", + "tv", + "car", + "wearable", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "definePermissions": [ + { + "name": "ohos.permission.ANSWER_CALL", + "grantMode": "user_grant", + "since": 9, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_answer_call", + "description": "$string:ohos_desc_answer_call" }, - "definePermissions": [ - { - "name": "ohos.permission.ANSWER_CALL", - "grantMode": "user_grant", - "since": 9, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_answer_call", - "description": "$string:ohos_desc_answer_call" - }, - { - "name": "ohos.permission.USE_BLUETOOTH", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.DISCOVER_BLUETOOTH", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_BLUETOOTH", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_BLUETOOTH", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_access_bluetooth", - "description": "$string:ohos_desc_access_bluetooth" - }, - { - "name": "ohos.permission.GET_BLUETOOTH_LOCAL_MAC", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INTERNET", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_internet", - "description": "$string:ohos_desc_internet" - }, - { - "name": "ohos.permission.MODIFY_AUDIO_SETTINGS", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_modify_audio_settings", - "description": "$string:ohos_desc_modify_audio_settings" - }, - { - "name": "ohos.permission.ACCESS_NOTIFICATION_POLICY", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_CALENDAR", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_calendar", - "description": "$string:ohos_desc_read_calendar" - }, - { - "name": "ohos.permission.READ_CALL_LOG", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_call_log", - "description": "$string:ohos_desc_read_call_log" - }, - { - "name": "ohos.permission.READ_CELL_MESSAGES", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_cell_messages", - "description": "$string:ohos_desc_read_cell_messages" - }, - { - "name": "ohos.permission.READ_CONTACTS", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_contacts", - "description": "$string:ohos_desc_read_contacts" - }, - { - "name": "ohos.permission.GET_TELEPHONY_STATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_telephony_state", - "description": "$string:ohos_desc_get_telephony_state" - }, - { - "name": "ohos.permission.GET_PHONE_NUMBERS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_phone_numbers", - "description": "$string:ohos_desc_get_phone_numbers" - }, - { - "name": "ohos.permission.READ_MESSAGES", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_messages", - "description": "$string:ohos_desc_read_messages" - }, - { - "name": "ohos.permission.RECEIVE_MMS", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_mms", - "description": "$string:ohos_desc_receive_mms" - }, - { - "name": "ohos.permission.RECEIVE_SMS", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_sms", - "description": "$string:ohos_desc_receive_sms" - }, - { - "name": "ohos.permission.RECEIVE_WAP_MESSAGES", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_wap_messages", - "description": "$string:ohos_desc_receive_wap_messages" - }, - { - "name": "ohos.permission.MICROPHONE", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_microphone", - "description": "$string:ohos_desc_microphone" - }, - { - "name": "ohos.permission.SEND_MESSAGES", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_send_messages", - "description": "$string:ohos_desc_send_messages" - }, - { - "name": "ohos.permission.WRITE_CALENDAR", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_calendar", - "description": "$string:ohos_desc_write_calendar" - }, - { - "name": "ohos.permission.WRITE_CALL_LOG", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_call_log", - "description": "$string:ohos_desc_write_call_log" - }, - { - "name": "ohos.permission.WRITE_CONTACTS", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_contacts", - "description": "$string:ohos_desc_write_contacts" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_distributed_datasync", - "description": "$string:ohos_desc_distributed_datasync" - }, - { - "name": "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": true - }, - { - "name": "ohos.permission.MANAGE_VOICEMAIL", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_manage_voicemail", - "description": "$string:ohos_desc_manage_voicemail" - }, - { - "name": "ohos.permission.REQUIRE_FORM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.AGENT_REQUIRE_FORM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.LOCATION_IN_BACKGROUND", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_location_in_background", - "description": "$string:ohos_desc_location_in_background" - }, - { - "name": "ohos.permission.LOCATION", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_location", - "description": "$string:ohos_desc_location" - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_approximately_location", - "description": "$string:ohos_desc_approximately_location" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_media_location", - "description": "$string:ohos_desc_media_location" - }, - { - "name": "ohos.permission.GET_NETWORK_INFO", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_network_info", - "description": "$string:ohos_desc_get_network_info" - }, - { - "name": "ohos.permission.PLACE_CALL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_place_call", - "description": "$string:ohos_desc_place_call" - }, - { - "name": "ohos.permission.CAMERA", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_camera", - "description": "$string:ohos_desc_camera" - }, - { - "name": "ohos.permission.SET_NETWORK_INFO", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_network_info", - "description": "$string:ohos_desc_set_network_info" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_MEDIA", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_read_media", - "description": "$string:ohos_desc_read_media" - }, - { - "name": "ohos.permission.REBOOT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RUNNING_LOCK", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_write_media", - "description": "$string:ohos_desc_write_media" - }, - { - "name": "ohos.permission.SET_TIME", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_time", - "description": "$string:ohos_desc_set_time" - }, - { - "name": "ohos.permission.SET_TIME_ZONE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_time_zone", - "description": "$string:ohos_desc_set_time_zone" - }, - { - "name": "ohos.permission.DOWNLOAD_SESSION_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_download_session_manager", - "description": "$string:ohos_desc_download_session_manager" - }, - { - "name": "ohos.permission.COMMONEVENT_STICKY", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_commonevent_sticky", - "description": "$string:ohos_desc_commonevent_sticky" - }, - { - "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PRIVACY_WINDOW", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.POWER_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REFRESH_USER_ACTION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.POWER_OPTIMIZATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REBOOT_RECOVERY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_manage_local_accounts", - "description": "$string:ohos_desc_manage_local_accounts" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_interact_across_local_accounts", - "description": "$string:ohos_desc_interact_across_local_accounts" - }, - { - "name": "ohos.permission.VIBRATE", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_vibrate", - "description": "$string:ohos_desc_vibrate" - }, - { - "name": "ohos.permission.SYSTEM_LIGHT_CONTROL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACTIVITY_MOTION", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_activity_motion", - "description": "$string:ohos_desc_activity_motion" - }, - { - "name": "ohos.permission.READ_HEALTH_DATA", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_health_data", - "description": "$string:ohos_desc_read_health_data" - }, - { - "name": "ohos.permission.CONNECT_IME_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_connect_ime_ability", - "description": "$string:ohos_desc_connect_ime_ability" - }, - { - "name": "ohos.permission.CONNECT_SCREEN_SAVER_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_SCREEN_SAVER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_SCREEN_SAVER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_WALLPAPER", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_wallpaper", - "description": "$string:ohos_desc_set_wallpaper" - }, - { - "name": "ohos.permission.GET_WALLPAPER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "provisionEnable": true, - "since": 7, - "deprecated": "", - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_wallpaper", - "description": "$string:ohos_desc_get_wallpaper" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_MISSIONS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "since 9", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UPDATE_CONFIGURATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UPDATE_SYSTEM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.FACTORY_RESET", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UPDATE_MIGRATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_interact_across_local_accounts_extension", - "description": "$string:ohos_desc_interact_across_local_accounts_extension" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCELEROMETER", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_accelerometer", - "description": "$string:ohos_desc_accelerometer" - }, - { - "name": "ohos.permission.GYROSCOPE", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_gyroscope", - "description": "$string:ohos_desc_gyroscope" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_SHORTCUTS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.radio.ACCESS_FM_AM", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since":7 , - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_TELEPHONY_STATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_telephony_state", - "description": "$string:ohos_desc_set_telephony_state" - }, - { - "name": "ohos.permission.START_ABILIIES_FROM_BACKGROUND", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "since 9", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.BUNDLE_ACTIVE_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_bundle_active_info", - "description": "$string:ohos_desc_bundle_active_info" - }, - { - "name": "ohos.permission.START_INVISIBLE_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.sec.ACCESS_UDID", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.LAUNCH_DATA_PRIVACY_CENTER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_MEDIA_RESOURCES", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PUBLISH_AGENT_REMINDER", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_publish_agent_reminder", - "description": "$string:ohos_desc_publish_agent_reminder" - }, - { - "name": "ohos.permission.CONTROL_TASK_SYNC_ANIMATOR", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_control_task_sync_animator", - "description": "$string:ohos_desc_control_task_sync_animator" - }, - { - "name": "ohos.permission.INPUT_MONITORING", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_MISSIONS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_notification_controller", - "description": "$string:ohos_desc_notification_controller" - }, - { - "name": "ohos.permission.CONNECTIVITY_INTERNAL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_NET_STRATEGY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_NETWORK_STATS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_VPN", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_ABILITY_CONTROLLER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.USE_USER_IDM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_USER_IDM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NETSYS_INTERNAL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_BIOMETRIC", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 6, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_USER_AUTH_INTERNAL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_FINGERPRINT_AUTH", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_PIN_AUTH", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_AUTH_RESPOOL", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENFORCE_USER_IDM", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLEAN_APPLICATION_DATA", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RUNNING_STATE_OBSERVER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CAPTURE_SCREEN", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_WIFI_INFO", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_WIFI_INFO_INTERNAL", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since":8 , - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_WIFI_INFO", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_WIFI_PEERS_MAC", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_WIFI_LOCAL_MAC", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_WIFI_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_WIFI_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_WIFI_CONNECTION", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.DUMP", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_WIFI_HOTSPOT", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_ALL_APP_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 7, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_SECURE_SETTINGS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 7, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_DFX_SYSEVENT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 8, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_HIVIEW_SYSTEM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_HIVIEW_SYSTEM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_ENTERPRISE_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_BUNDLE_DIR", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_DATETIME", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_GET_DEVICE_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_RESET_DEVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_WIFI", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_GET_NETWORK_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_NETWORK", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_SECURITY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_BLUETOOTH", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_WIFI", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_APPLICATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_LOCATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_REBOOT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_LOCK_DEVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_GET_SETTINGS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_SETTINGS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_INSTALL_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_SYSTEM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_RESTRICT_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_USB", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_MANAGE_NETWORK", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENTERPRISE_SET_BROWSER_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NFC_TAG", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 7, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NFC_CARD_EMULATION", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 8, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PERMISSION_USED_STATS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NOTIFICATION_AGENT_CONTROLLER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MOUNT_UNMOUNT_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MOUNT_FORMAT_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.STORAGE_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.BACKUP", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLOUDFILE_SYNC_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLOUDFILE_SYNC", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.FILE_ACCESS_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_DEFAULT_APPLICATION", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_DEFAULT_APPLICATION", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_IDS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_DISPOSED_APP_STATUS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_DLP_FILE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PROVISIONING_MESSAGE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_SYSTEM_SETTINGS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_imagevideo", - "description": "$string:ohos_desc_read_imagevideo" - }, - { - "name": "ohos.permission.READ_AUDIO", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_audio", - "description": "$string:ohos_desc_read_audio" - }, - { - "name": "ohos.permission.READ_DOCUMENT", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_document", - "description": "$string:ohos_desc_read_document" - }, - { - "name": "ohos.permission.WRITE_IMAGEVIDEO", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_imagevideo", - "description": "$string:ohos_desc_write_imagevideo" - }, - { - "name": "ohos.permission.WRITE_AUDIO", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_audio", - "description": "$string:ohos_desc_write_audio" - }, - { - "name": "ohos.permission.WRITE_DOCUMENT", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_document", - "description": "$string:ohos_desc_write_document" - }, - { - "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.securityguard.REPORT_SECURITY_INFO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.securityguard.REQUEST_SECURITY_MODEL_RESULT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true - }, - { - "name": "ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true - }, - { - "name": "ohos.permission.ACCESS_CERT_MANAGER_INTERNAL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_CERT_MANAGER", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_LOCAL_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_DISTRIBUTED_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_PUSH_SERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_APP_PUSH_DATA", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_APP_PUSH_DATA", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_AUDIO_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_CAMERA_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RECEIVER_STARTUP_COMPLETED", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_WHOLE_CALENDAR", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_whole_calendar", - "description": "$string:ohos_desc_read_whole_calendar" - }, - { - "name": "ohos.permission.WRITE_WHOLE_CALENDAR", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_whole_calendar", - "description": "$string:ohos_desc_write_whole_calendar" - }, - { - "name": "ohos.permission.ACCESS_SERVICE_DM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RUN_ANY_CODE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.APP_TRACKING_CONSENT", - "grantMode": "user_grant", - "availableLevel": "normal", - "since": 9, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_app_tracking_consent", - "description": "$string:ohos_desc_app_tracking_consent" - }, - { - "name": "ohos.permission.PUBLISH_SYSTEM_COMMON_EVENT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PRINT", - "grantMode": "system_grant", - "since": 10, - "deprecated": "", - "availableLevel": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_PRINT_JOB", - "grantMode": "system_grant", - "since": 10, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CHANGE_OVERLAY_ENABLED_STATE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CONNECT_CELLULAR_CALL_SERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CONNECT_IMS_SERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_SENSING_WITH_ULTRASOUND", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PROXY_AUTHORIZATION_URI", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_ENTERPRISE_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_INSTALLED_BUNDLE_LIST", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_installed_bundle_list", - "description": "$string:ohos_desc_get_installed_bundle_list" - }, - { - "name": "ohos.permission.ACCESS_CAST_ENGINE_MIRROR", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_CAST_ENGINE_STREAM", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLOUDDATA_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.DEVICE_STANDBY_EXEMPTION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RESTRICT_APPLICATION_ACTIVE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_SENSOR", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UPLOAD_SESSION_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PREPARE_APP_TERMINATE", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_ECOLOGICAL_RULE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_SCENE_CODE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.FILE_GUARD_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_FILE_GUARD_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "availableType": "MDM", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.securityguard.SET_MODEL_STATE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.hsdr.HSDR_ACCESS", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SUPPORT_USER_AUTH", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CAPTURE_VOICE_DOWNLINK_AUDIO", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_INTELLIGENT_VOICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_SELF_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.OBSERVE_FORM_RUNNING", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_DEVICE_AUTH_CRED", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UNINSTALL_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RECOVER_BUNDLE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_DOMAIN_ACCOUNTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_UNREMOVABLE_NOTIFICATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.QUERY_ACCESSIBILITY_ELEMENT", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACTIVATE_THEME_PACKAGE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ATTEST_KEY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WAKEUP_VOICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WAKEUP_VISION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ENABLE_DISTRIBUTED_HARDWARE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": true - }, - { - "name": "ohos.permission.ACCESS_DISTRIBUTED_HARDWARE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": true - }, - { - "name": "ohos.permission.INSTANTSHARE_SWITCH_CONTROL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_INSTANTSHARE_SERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_INSTANTSHARE_PRIVATE_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SECURE_PASTE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_PASTEBOARD", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_pasteboard", - "description": "$string:ohos_desc_read_pasteboard" - }, - { - "name": "ohos.permission.ACCESS_MCP_AUTHORIZATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_BUNDLE_RESOURCES", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_CODE_PROTECT_INFO", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_ADVANCED_SECURITY_MODE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_DEVELOPER_MODE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RUN_DYN_CODE", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 11, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.COOPERATE_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PERCEIVE_TRAIL", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.DISABLE_PERMISSION_DIALOG", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.EXECUTE_INSIGHT_INTENT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_ACTIVATION_LOCK", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.VERIFY_ACTIVATION_LOCK", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_PRIVATE_PHOTOS", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_OUC", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.TRUSTED_RING_HASH_DATA_PERMISSION", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.QUERY_TRUSTED_RING_USER_INFO", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_TRUSTED_RING", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.USE_TRUSTED_RING", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INPUT_CONTROL_DISPATCHING", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INTERCEPT_INPUT_EVENT", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_SECURITY_PRIVACY_CENTER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_SECURITY_PRIVACY_ADVICE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_SECURITY_PRIVACY_ADVICE", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.USE_SECURITY_PRIVACY_MESSAGER", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RECORD_VOICE_CALL", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_APP_INSTALL_INFO", - "grantMode": "system_grant", - "since": 11, - "availableLevel": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RECEIVE_APP_INSTALL_INFO_CHANGE", - "grantMode": "system_grant", - "since": 11, - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_ADVANCED_SECURITY_MODE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.STORE_PERSISTENT_DATA", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 11, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_HIVIEWX", - "grantMode": "system_grant", - "since": 11, - "deprecated": "", - "availableLevel": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_PASSWORDVAULT_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_LOWPOWER_MANAGER", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_DDK_USB", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 10, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 10, - "deprecated": "", - "provisionEnable": false, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_DDK_HID", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_APP_BOOT", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_HIVIEWCARE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CONNECT_UI_EXTENSION_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_write_download_directory", - "description": "$string:ohos_desc_read_write_download_directory" - }, - { - "name": "ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_write_documents_directory", - "description": "$string:ohos_desc_read_write_documents_directory" - }, - { - "name": "ohos.permission.READ_WRITE_DESKTOP_DIRECTORY", - "grantMode": "user_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_write_desktop_directory", - "description": "$string:ohos_desc_read_write_desktop_directory" - }, - { - "name": "ohos.permission.FILE_ACCESS_PERSIST", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_SANDBOX_POLICY", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_ACCOUNT_KIT_SERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REQUEST_ANONYMOUS_ATTEST", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_ACCOUNT_KIT_UI", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.START_ABILITY_WITH_ANIMATION", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.START_RECENT_ABILITY", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_CLOUD_SYNC_CONFIG", - "grantMode": "system_grant", - "availableLevel": "normal", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_CLOUD_SYNC_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_FINDDEVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_FINDSERVICE", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.TRIGGER_ACTIVATIONLOCK", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_USB_CONFIG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_PRIVACY_PUSH_DATA", - "grantMode": "system_grant", - "availableLevel": "system_core", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_STATUSBAR_ICON", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.START_SYSTEM_DIALOG", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS", - "grantMode": "system_grant", - "availableLevel": "system_basic", - "since": 11, - "deprecated": "", - "provisionEnable": true, - "distributedSceneEnable": false - } - ] + { + "name": "ohos.permission.USE_BLUETOOTH", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.DISCOVER_BLUETOOTH", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_BLUETOOTH", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_BLUETOOTH", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_access_bluetooth", + "description": "$string:ohos_desc_access_bluetooth" + }, + { + "name": "ohos.permission.GET_BLUETOOTH_LOCAL_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_BLUETOOTH_PEERS_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INTERNET", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_internet", + "description": "$string:ohos_desc_internet" + }, + { + "name": "ohos.permission.MODIFY_AUDIO_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_modify_audio_settings", + "description": "$string:ohos_desc_modify_audio_settings" + }, + { + "name": "ohos.permission.ACCESS_NOTIFICATION_POLICY", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_CALENDAR", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_calendar", + "description": "$string:ohos_desc_read_calendar" + }, + { + "name": "ohos.permission.READ_CALL_LOG", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_call_log", + "description": "$string:ohos_desc_read_call_log" + }, + { + "name": "ohos.permission.READ_CELL_MESSAGES", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_cell_messages", + "description": "$string:ohos_desc_read_cell_messages" + }, + { + "name": "ohos.permission.READ_CONTACTS", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_contacts", + "description": "$string:ohos_desc_read_contacts" + }, + { + "name": "ohos.permission.GET_TELEPHONY_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_get_telephony_state", + "description": "$string:ohos_desc_get_telephony_state" + }, + { + "name": "ohos.permission.GET_PHONE_NUMBERS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_get_phone_numbers", + "description": "$string:ohos_desc_get_phone_numbers" + }, + { + "name": "ohos.permission.READ_MESSAGES", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_messages", + "description": "$string:ohos_desc_read_messages" + }, + { + "name": "ohos.permission.RECEIVE_MMS", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_receive_mms", + "description": "$string:ohos_desc_receive_mms" + }, + { + "name": "ohos.permission.RECEIVE_SMS", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_receive_sms", + "description": "$string:ohos_desc_receive_sms" + }, + { + "name": "ohos.permission.RECEIVE_WAP_MESSAGES", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_receive_wap_messages", + "description": "$string:ohos_desc_receive_wap_messages" + }, + { + "name": "ohos.permission.MICROPHONE", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_microphone", + "description": "$string:ohos_desc_microphone" + }, + { + "name": "ohos.permission.SEND_MESSAGES", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_send_messages", + "description": "$string:ohos_desc_send_messages" + }, + { + "name": "ohos.permission.WRITE_CALENDAR", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_calendar", + "description": "$string:ohos_desc_write_calendar" + }, + { + "name": "ohos.permission.WRITE_CALL_LOG", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_call_log", + "description": "$string:ohos_desc_write_call_log" + }, + { + "name": "ohos.permission.WRITE_CONTACTS", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_contacts", + "description": "$string:ohos_desc_write_contacts" + }, + { + "name": "ohos.permission.DISTRIBUTED_DATASYNC", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_distributed_datasync", + "description": "$string:ohos_desc_distributed_datasync" + }, + { + "name": "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.MANAGE_VOICEMAIL", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_manage_voicemail", + "description": "$string:ohos_desc_manage_voicemail" + }, + { + "name": "ohos.permission.REQUIRE_FORM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.AGENT_REQUIRE_FORM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.LOCATION_IN_BACKGROUND", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_location_in_background", + "description": "$string:ohos_desc_location_in_background" + }, + { + "name": "ohos.permission.LOCATION", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_location", + "description": "$string:ohos_desc_location" + }, + { + "name": "ohos.permission.APPROXIMATELY_LOCATION", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_approximately_location", + "description": "$string:ohos_desc_approximately_location" + }, + { + "name": "ohos.permission.MEDIA_LOCATION", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_media_location", + "description": "$string:ohos_desc_media_location" + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_get_network_info", + "description": "$string:ohos_desc_get_network_info" + }, + { + "name": "ohos.permission.PLACE_CALL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_place_call", + "description": "$string:ohos_desc_place_call" + }, + { + "name": "ohos.permission.CAMERA", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_camera", + "description": "$string:ohos_desc_camera" + }, + { + "name": "ohos.permission.SET_NETWORK_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_set_network_info", + "description": "$string:ohos_desc_set_network_info" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_MEDIA", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_read_media", + "description": "$string:ohos_desc_read_media" + }, + { + "name": "ohos.permission.REBOOT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RUNNING_LOCK", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_MEDIA", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_write_media", + "description": "$string:ohos_desc_write_media" + }, + { + "name": "ohos.permission.SET_TIME", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_set_time", + "description": "$string:ohos_desc_set_time" + }, + { + "name": "ohos.permission.SET_TIME_ZONE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_set_time_zone", + "description": "$string:ohos_desc_set_time_zone" + }, + { + "name": "ohos.permission.DOWNLOAD_SESSION_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_download_session_manager", + "description": "$string:ohos_desc_download_session_manager" + }, + { + "name": "ohos.permission.COMMONEVENT_STICKY", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_commonevent_sticky", + "description": "$string:ohos_desc_commonevent_sticky" + }, + { + "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PRIVACY_WINDOW", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.POWER_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.REFRESH_USER_ACTION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.POWER_OPTIMIZATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.REBOOT_RECOVERY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_manage_local_accounts", + "description": "$string:ohos_desc_manage_local_accounts" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_interact_across_local_accounts", + "description": "$string:ohos_desc_interact_across_local_accounts" + }, + { + "name": "ohos.permission.VIBRATE", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_vibrate", + "description": "$string:ohos_desc_vibrate" + }, + { + "name": "ohos.permission.SYSTEM_LIGHT_CONTROL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACTIVITY_MOTION", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_activity_motion", + "description": "$string:ohos_desc_activity_motion" + }, + { + "name": "ohos.permission.READ_HEALTH_DATA", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_health_data", + "description": "$string:ohos_desc_read_health_data" + }, + { + "name": "ohos.permission.CONNECT_IME_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_connect_ime_ability", + "description": "$string:ohos_desc_connect_ime_ability" + }, + { + "name": "ohos.permission.CONNECT_SCREEN_SAVER_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_SCREEN_SAVER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_SCREEN_SAVER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_WALLPAPER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_set_wallpaper", + "description": "$string:ohos_desc_set_wallpaper" + }, + { + "name": "ohos.permission.GET_WALLPAPER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "provisionEnable": true, + "since": 7, + "deprecated": "", + "distributedSceneEnable": false, + "label": "$string:ohos_lab_get_wallpaper", + "description": "$string:ohos_desc_get_wallpaper" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_MISSIONS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "since 9", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UPDATE_CONFIGURATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UPDATE_SYSTEM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.FACTORY_RESET", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ASSIST_DEVICE_UPDATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UPDATE_MIGRATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_SENSITIVE_PERMISSIONS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_interact_across_local_accounts_extension", + "description": "$string:ohos_desc_interact_across_local_accounts_extension" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCELEROMETER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_accelerometer", + "description": "$string:ohos_desc_accelerometer" + }, + { + "name": "ohos.permission.GYROSCOPE", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_gyroscope", + "description": "$string:ohos_desc_gyroscope" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_SHORTCUTS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.radio.ACCESS_FM_AM", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_TELEPHONY_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_set_telephony_state", + "description": "$string:ohos_desc_set_telephony_state" + }, + { + "name": "ohos.permission.START_ABILIIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "since 9", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.BUNDLE_ACTIVE_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_bundle_active_info", + "description": "$string:ohos_desc_bundle_active_info" + }, + { + "name": "ohos.permission.START_INVISIBLE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.sec.ACCESS_UDID", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.LAUNCH_DATA_PRIVACY_CENTER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_MEDIA_RESOURCES", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PUBLISH_AGENT_REMINDER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_publish_agent_reminder", + "description": "$string:ohos_desc_publish_agent_reminder" + }, + { + "name": "ohos.permission.CONTROL_TASK_SYNC_ANIMATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_control_task_sync_animator", + "description": "$string:ohos_desc_control_task_sync_animator" + }, + { + "name": "ohos.permission.INPUT_MONITORING", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_MISSIONS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NOTIFICATION_CONTROLLER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_notification_controller", + "description": "$string:ohos_desc_notification_controller" + }, + { + "name": "ohos.permission.CONNECTIVITY_INTERNAL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_NET_STRATEGY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_NETWORK_STATS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_VPN", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_ABILITY_CONTROLLER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.USE_USER_IDM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_USER_IDM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NETSYS_INTERNAL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_BIOMETRIC", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 6, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_USER_AUTH_INTERNAL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_FINGERPRINT_AUTH", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PIN_AUTH", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_AUTH_RESPOOL", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENFORCE_USER_IDM", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CLEAN_APPLICATION_DATA", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RUNNING_STATE_OBSERVER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CAPTURE_SCREEN", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_WIFI_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_WIFI_INFO_INTERNAL", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_WIFI_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_WIFI_PEERS_MAC", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_WIFI_LOCAL_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_WIFI_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_WIFI_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_WIFI_CONNECTION", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.DUMP", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_WIFI_HOTSPOT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_ALL_APP_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 7, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_SECURE_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 7, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_DFX_SYSEVENT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 8, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_HIVIEW_SYSTEM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_HIVIEW_SYSTEM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_ENTERPRISE_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_BUNDLE_DIR", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_DATETIME", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_GET_DEVICE_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_RESET_DEVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_WIFI", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_GET_NETWORK_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_NETWORK", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_SECURITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_BLUETOOTH", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_WIFI", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_APPLICATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_LOCATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_REBOOT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_LOCK_DEVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_GET_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_INSTALL_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_CERTIFICATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_SYSTEM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_RESTRICT_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_USB", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_MANAGE_NETWORK", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_SET_BROWSER_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_OPERATE_DEVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_ADMIN_MANAGE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "availableType": "MDM", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENTERPRISE_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NFC_TAG", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 7, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NFC_CARD_EMULATION", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 8, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PERMISSION_USED_STATS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NOTIFICATION_AGENT_CONTROLLER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MOUNT_UNMOUNT_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MOUNT_FORMAT_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.STORAGE_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.BACKUP", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CLOUDFILE_SYNC_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CLOUDFILE_SYNC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.FILE_ACCESS_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_DEFAULT_APPLICATION", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_DEFAULT_APPLICATION", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_IDS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_DISPOSED_APP_STATUS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_DLP_FILE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PROVISIONING_MESSAGE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SYSTEM_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_IMAGEVIDEO", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_imagevideo", + "description": "$string:ohos_desc_read_imagevideo" + }, + { + "name": "ohos.permission.READ_AUDIO", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_audio", + "description": "$string:ohos_desc_read_audio" + }, + { + "name": "ohos.permission.READ_DOCUMENT", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_document", + "description": "$string:ohos_desc_read_document" + }, + { + "name": "ohos.permission.WRITE_IMAGEVIDEO", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_imagevideo", + "description": "$string:ohos_desc_write_imagevideo" + }, + { + "name": "ohos.permission.WRITE_AUDIO", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_audio", + "description": "$string:ohos_desc_write_audio" + }, + { + "name": "ohos.permission.WRITE_DOCUMENT", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_document", + "description": "$string:ohos_desc_write_document" + }, + { + "name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.securityguard.REPORT_SECURITY_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.securityguard.REQUEST_SECURITY_MODEL_RESULT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.securityguard.REQUEST_SECURITY_EVENT_INFO", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.ACCESS_CERT_MANAGER_INTERNAL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_CERT_MANAGER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_LOCAL_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_DISTRIBUTED_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PUSH_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_APP_PUSH_DATA", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_APP_PUSH_DATA", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_AUDIO_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_CAMERA_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RECEIVER_STARTUP_COMPLETED", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_WHOLE_CALENDAR", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_whole_calendar", + "description": "$string:ohos_desc_read_whole_calendar" + }, + { + "name": "ohos.permission.WRITE_WHOLE_CALENDAR", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_write_whole_calendar", + "description": "$string:ohos_desc_write_whole_calendar" + }, + { + "name": "ohos.permission.ACCESS_SERVICE_DM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RUN_ANY_CODE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.APP_TRACKING_CONSENT", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 9, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true, + "label": "$string:ohos_lab_app_tracking_consent", + "description": "$string:ohos_desc_app_tracking_consent" + }, + { + "name": "ohos.permission.PUBLISH_SYSTEM_COMMON_EVENT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PRINT", + "grantMode": "system_grant", + "since": 10, + "deprecated": "", + "availableLevel": "normal", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_PRINT_JOB", + "grantMode": "system_grant", + "since": 10, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CHANGE_OVERLAY_ENABLED_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CONNECT_CELLULAR_CALL_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CONNECT_IMS_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SENSING_WITH_ULTRASOUND", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PROXY_AUTHORIZATION_URI", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_ENTERPRISE_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_INSTALLED_BUNDLE_LIST", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_get_installed_bundle_list", + "description": "$string:ohos_desc_get_installed_bundle_list" + }, + { + "name": "ohos.permission.ACCESS_CAST_ENGINE_MIRROR", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_CAST_ENGINE_STREAM", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CLOUDDATA_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.DEVICE_STANDBY_EXEMPTION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RESTRICT_APPLICATION_ACTIVE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_SENSOR", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UPLOAD_SESSION_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PREPARE_APP_TERMINATE", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_ECOLOGICAL_RULE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_SCENE_CODE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.FILE_GUARD_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_FILE_GUARD_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "availableType": "MDM", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.securityguard.SET_MODEL_STATE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.hsdr.HSDR_ACCESS", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SUPPORT_USER_AUTH", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CAPTURE_VOICE_DOWNLINK_AUDIO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_INTELLIGENT_VOICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_SELF_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.OBSERVE_FORM_RUNNING", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_DEVICE_AUTH_CRED", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UNINSTALL_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RECOVER_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_DOMAIN_ACCOUNTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_UNREMOVABLE_NOTIFICATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.QUERY_ACCESSIBILITY_ELEMENT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACTIVATE_THEME_PACKAGE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ATTEST_KEY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WAKEUP_VOICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WAKEUP_VISION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENABLE_DISTRIBUTED_HARDWARE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.ACCESS_DISTRIBUTED_HARDWARE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.INSTANTSHARE_SWITCH_CONTROL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_INSTANTSHARE_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_INSTANTSHARE_PRIVATE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SECURE_PASTE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_PASTEBOARD", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_pasteboard", + "description": "$string:ohos_desc_read_pasteboard" + }, + { + "name": "ohos.permission.ACCESS_MCP_AUTHORIZATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_BUNDLE_RESOURCES", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_CODE_PROTECT_INFO", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_ADVANCED_SECURITY_MODE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_DEVELOPER_MODE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RUN_DYN_CODE", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 11, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.COOPERATE_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PERCEIVE_TRAIL", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.DISABLE_PERMISSION_DIALOG", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.EXECUTE_INSIGHT_INTENT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_ACTIVATION_LOCK", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.VERIFY_ACTIVATION_LOCK", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_PRIVATE_PHOTOS", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_OUC", + "grantMode": "system_grant", + "since": 11, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.TRUSTED_RING_HASH_DATA_PERMISSION", + "grantMode": "system_grant", + "since": 11, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_TRUSTED_RING", + "grantMode": "system_grant", + "since": 11, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.USE_TRUSTED_RING", + "grantMode": "system_grant", + "since": 11, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INPUT_CONTROL_DISPATCHING", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INTERCEPT_INPUT_EVENT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SECURITY_PRIVACY_CENTER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_SECURITY_PRIVACY_ADVICE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_SECURITY_PRIVACY_ADVICE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.USE_SECURITY_PRIVACY_MESSAGER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RECORD_VOICE_CALL", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_APP_INSTALL_INFO", + "grantMode": "system_grant", + "since": 11, + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.RECEIVE_APP_INSTALL_INFO_CHANGE", + "grantMode": "system_grant", + "since": 11, + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_ADVANCED_SECURITY_MODE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.STORE_PERSISTENT_DATA", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 11, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_HIVIEWX", + "grantMode": "system_grant", + "since": 11, + "deprecated": "", + "availableLevel": "system_basic", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PASSWORDVAULT_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PRIVATE_SPACE_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PRIVATE_SPACE_PASSWORD_PROTECT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_LOWPOWER_MANAGER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_DDK_USB", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 10, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 10, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_DDK_HID", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_APP_BOOT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_HIVIEWCARE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CONNECT_UI_EXTENSION_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_write_download_directory", + "description": "$string:ohos_desc_read_write_download_directory" + }, + { + "name": "ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_write_documents_directory", + "description": "$string:ohos_desc_read_write_documents_directory" + }, + { + "name": "ohos.permission.READ_WRITE_DESKTOP_DIRECTORY", + "grantMode": "user_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_read_write_desktop_directory", + "description": "$string:ohos_desc_read_write_desktop_directory" + }, + { + "name": "ohos.permission.FILE_ACCESS_PERSIST", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_SANDBOX_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_ACCOUNT_KIT_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.REQUEST_ANONYMOUS_ATTEST", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_ACCOUNT_KIT_UI", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_RECENT_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_CLOUD_SYNC_CONFIG", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_CLOUD_SYNC_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_FINDDEVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_FINDSERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_FINDSERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.TRIGGER_ACTIVATIONLOCK", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_USB_CONFIG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_PRIVACY_PUSH_DATA", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_STATUSBAR_ICON", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_SYSTEM_DIALOG", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 11, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_NEARLINK", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_NEARLINK", + "grantMode": "user_grant", + "availableLevel": "normal", + "since": 12, + "deprecated": "", + "provisionEnable": false, + "distributedSceneEnable": false, + "label": "$string:ohos_lab_access_nearlink", + "description": "$string:ohos_desc_access_nearlink" + }, + { + "name": "ohos.permission.GET_NEARLINK_LOCAL_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_NEARLINK_PEER_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PROTOCOL_DFX_DATA", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_PROTOCOL_DFX_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_RGM", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ALLOW_UPGRADE_GUIDE_ACCESS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_USER_ACCOUNT_INFO", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_ACCOUNT_LOGIN_STATE", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_ACCOUNT_LOGIN_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_AS_USER", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.NOTIFY_DEBUG_ASSERT_RESULT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_AI_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_HEALTH_MOTION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.hsdr.REQUEST_HSDR", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.QUERY_PASSWORD_VAULT_DATA", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SUBSCRIBE_NOTIFICATION_WINDOW_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CHANGE_DISPLAYMODE", + "grantMode": "system_grant", + "since": 12, + "deprecated": "", + "availableLevel": "system_core", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_MEDIALIB_THUMB_DB", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MIGRATE_DATA", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_DYNAMIC_ICON", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.EXEMPT_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.EXEMPT_CAMERA_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.EXEMPT_MICROPHONE_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.EXEMPT_LOCATION_PRIVACY_INDICATOR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_SUPER_PRIVACY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_SUPER_PRIVACY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.LAUNCH_SPAMSHIELD_PAGE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SPAMSHIELD_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CHANGE_BUNDLE_UNINSTALL_STATE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_STYLUS_EVENT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SERVICE_NAVIGATION_INFO", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_GTOKEN_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.READ_GTOKEN_POLICY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ENABLE_PROFILER", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.USE_CLOUD_DRIVE_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.USE_CLOUD_BACKUP_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.USE_CLOUD_COMMON_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_DLP_CRED", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.START_SHORTCUT", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_INPUT_INFRARED_EMITTER", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PRELOAD_APPLICATION", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.SET_PROCESS_CACHE_STATE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PRELOAD_UI_EXTENSION_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SYSTEM_APP_CERT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_USER_TRUSTED_CERT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.MANAGE_SETTINGS", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_LOCAL_BACKUP", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.CAST_AUDIO_OUTPUT", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": true + }, + { + "name": "ohos.permission.ACCESS_TEXTAUTOFILL_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.KILL_APP_PROCESSES", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.WRITE_RINGTONE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_MEDIA_DATA", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_ALL_DATA", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_ACCOUNT_MINORS_INFO", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_LOCAL_THEME", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SHADER_CACHE_DIR", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.INSTALL_CLONE_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.UNINSTALL_CLONE_BUNDLE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.PROTECT_SCREEN_LOCK_DATA", + "grantMode": "system_grant", + "availableLevel": "normal", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_DEVICE_COLLABORATION_PRIVATE_ABILITY", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_RINGTONE_RESOURCE", + "grantMode": "system_grant", + "availableLevel": "system_core", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_FILE_CONTENT_SHARE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + }, + { + "name": "ohos.permission.ACCESS_SEARCH_SERVICE", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 12, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false + } + ] } -} +} \ No newline at end of file diff --git a/build-tools/dts_parser/src/coreImpl/checker/config/syscapConfigFile.json b/build-tools/dts_parser/src/coreImpl/checker/config/syscapConfigFile.json index 62d1ad590..1fc6efca8 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/config/syscapConfigFile.json +++ b/build-tools/dts_parser/src/coreImpl/checker/config/syscapConfigFile.json @@ -22,8 +22,8 @@ "SystemCapability.Graphic.Graphic2D.WebGL", "SystemCapability.Graphic.Graphic2D.WebGL2", "SystemCapability.Graphic.Graphic2D.ColorManager.Core", - "SystemCapability.Graphic.Vulkan", "SystemCapability.Window.SessionManager", + "SystemCapability.Graphic.Vulkan", "SystemCapability.WindowManager.WindowManager.Core", "SystemCapability.Notification.CommonEvent", "SystemCapability.Notification.Notification", @@ -81,6 +81,7 @@ "SystemCapability.Multimedia.Media.VideoPlayer", "SystemCapability.Multimedia.Media.VideoRecorder", "SystemCapability.Multimedia.Media.CodecBase", + "SystemCapability.Multimedia.Media.AudioCodec", "SystemCapability.Multimedia.Media.AudioDecoder", "SystemCapability.Multimedia.Media.AudioEncoder", "SystemCapability.Multimedia.Media.VideoDecoder", @@ -92,6 +93,7 @@ "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.AVSession.AVCast", + "SystemCapability.Multimedia.AVSession.ExtendedDisplayCast", "SystemCapability.Multimedia.Audio.Core", "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Audio.Interrupt", @@ -107,11 +109,14 @@ "SystemCapability.Multimedia.Image.ImageSource", "SystemCapability.Multimedia.Image.ImagePacker", "SystemCapability.Multimedia.Image.ImageReceiver", + "SystemCapability.Multimedia.ImageEffect.Core", "SystemCapability.Multimedia.MediaLibrary.Core", "SystemCapability.Multimedia.MediaLibrary.SmartAlbum", "SystemCapability.Multimedia.MediaLibrary.DistributedCore", "SystemCapability.Multimedia.Media.AVPlayer", "SystemCapability.Multimedia.Media.AVRecorder", + "SystemCapability.Multimedia.Media.AVMetadataExtractor", + "SystemCapability.Multimedia.Media.AVImageGenerator", "SystemCapability.Multimedia.Image.ImageCreator", "SystemCapability.Multimedia.SystemSound.Core", "SystemCapability.Telephony.CoreService", @@ -151,11 +156,13 @@ "SystemCapability.HiviewDFX.HiProfiler.HiDebug", "SystemCapability.Update.UpdateService", "SystemCapability.DistributedHardware.DeviceManager", + "SystemCapability.DistributedHardware.DistributedHardwareFWK", "SystemCapability.Security.DeviceAuth", "SystemCapability.Security.DataTransitManager", "SystemCapability.Security.DeviceSecurityLevel", "SystemCapability.Security.Huks.Core", "SystemCapability.Security.Huks.Extension", + "SystemCapability.Security.Asset", "SystemCapability.Security.AccessToken", "SystemCapability.Security.Cipher", "SystemCapability.Security.CertificateManager", @@ -164,6 +171,7 @@ "SystemCapability.Security.DataLossPrevention", "SystemCapability.Security.Cert", "SystemCapability.Security.SecurityGuard", + "SystemCapability.Security.ScreenLockFileManager", "SystemCapability.Account.OsAccount", "SystemCapability.Account.AppAccount", "SystemCapability.UserIAM.UserAuth.Core", @@ -230,6 +238,7 @@ "SystemCapability.Web.Webview.Core", "SystemCapability.Cloud.AAID", "SystemCapability.Advertising.OAID", + "SystemCapability.Advertising.Ads", "SystemCapability.Cloud.VAID", "SystemCapability.Cloud.Push", "SystemCapability.XTS.DeviceAttest", @@ -253,11 +262,9 @@ "SystemCapability.Multimedia.AudioHaptic.Core", "SystemCapability.ArkUi.Graphics3D", "SystemCapability.Multimedia.Drm.Core", - "SystemCapability.Graphics.Drawing" - ], - "test2": [ - 1, - 2, - 3 + "SystemCapability.Graphics.Drawing", + "SystemCapability.ResourceSchedule.SystemLoad", + "SystemCapability.Ability.AppStartup", + "SystemCapability.MultimodalInput.Input.InfraredEmitter" ] } \ No newline at end of file diff --git a/build-tools/dts_parser/src/coreImpl/checker/local_entry.ts b/build-tools/dts_parser/src/coreImpl/checker/local_entry.ts index a603b435a..4900f7955 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/local_entry.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/local_entry.ts @@ -12,28 +12,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ApiResultSimpleInfo, ApiResultMessage } from '../../typedef/checker/result_type'; +import { ApiResultSimpleInfo, ApiResultMessage, ApiBaseInfo } from '../../typedef/checker/result_type'; import { Check } from './src/api_check_plugin'; import { LogUtil } from '../../utils/logUtil'; import { GenerateFile } from '../../utils/checkUtils'; import { compositiveResult, compositiveLocalResult, apiCheckResult } from '../../utils/checkUtils'; import { DOC, DEFINE, CHANEGE } from './config/api_check_config.json'; +import { ApiChangeCheck } from './src/check_api_diff'; /** * local entrance */ export class LocalEntry { - static checkEntryLocal(filePathArr: string[], fileRuleArr: string[], output: string, excel: string): ApiResultMessage[] { + + static checkEntryLocal(filePathArr: string[], fileRuleArr: string[], output: string, prId: string, excel: string): ApiResultMessage[] { let allResult: ApiResultMessage[] = apiCheckResult; try { - Check.scanEntry(filePathArr); + Check.scanEntry(filePathArr, prId); LocalEntry.maskAlarm(compositiveResult, fileRuleArr); } catch (error) { LogUtil.e('API_CHECK_ERROR', error); } finally { GenerateFile.writeFile(apiCheckResult, output, {}); if (excel === 'true') { - GenerateFile.writeExcelFile(compositiveLocalResult); + GenerateFile.writeExcelFile(apiCheckResult); } } return allResult; @@ -53,9 +55,17 @@ export class LocalEntry { } }); } + let allResultInfoSet: Set = new Set(allResultInfo); const maskResult: ApiResultSimpleInfo[] = LocalEntry.filterAllResultInfo(allResultInfo, apiCheckInfos, apiCheckAdmissiveSet); maskResult.forEach(resultItem => { + const apiBaseInfos: ApiBaseInfo = new ApiBaseInfo(); + apiBaseInfos + .setApiName(resultItem.apiName) + .setApiType(resultItem.apiType) + .setHierarchicalRelations(resultItem.hierarchicalRelations) + .setParentModuleName(resultItem.parentModuleName); + const apiChecktErrorLog: ApiResultMessage = new ApiResultMessage(); apiChecktErrorLog .setFilePath(resultItem.filePath) @@ -64,7 +74,8 @@ export class LocalEntry { .setType(resultItem.type) .setMessage(resultItem.message) .setMainBuggyCode(resultItem.apiText) - .setMainBuggyLine(resultItem.location); + .setMainBuggyLine(resultItem.location) + .setExtendInfo(apiBaseInfos); apiCheckResult.push(apiChecktErrorLog); }); } @@ -75,7 +86,7 @@ export class LocalEntry { let resultItemInfo: string = resultItem.message.replace(/API check error of \[.*\]: /g, ''); const regex1 = /Prohibited word in \[.*\]:{option}.The word allowed is \[.*\]\./g; const regex2 = /Prohibited word in \[.*\]:{ability} in the \[.*\] file\./g; - const regex3= /please confirm whether it needs to be corrected to a common word./g; + const regex3 = /please confirm whether it needs to be corrected to a common word./g; if (/\d/g.test(resultItemInfo)) { resultItemInfo = resultItemInfo.replace(/\d+/g, '1'); } @@ -109,4 +120,20 @@ export class LocalEntry { } return ''; } + + static apiChangeCheckEntryLocal(prId: string, fileRuleArr: string[], output: string, excel: string): ApiResultMessage[] { + let apiChangeCheckResult: ApiResultMessage[] = apiCheckResult; + try { + ApiChangeCheck.checkApiChange(prId); + LocalEntry.maskAlarm(compositiveResult, fileRuleArr); + } catch (error) { + LogUtil.e('API_CHECK_ERROR', error); + } finally { + GenerateFile.writeFile(apiCheckResult, output, {}); + if (excel === 'true') { + GenerateFile.writeExcelFile(apiCheckResult); + } + } + return apiChangeCheckResult; + } } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/api_check_plugin.ts b/build-tools/dts_parser/src/coreImpl/checker/src/api_check_plugin.ts index 64089412a..0c9a104e4 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/api_check_plugin.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/api_check_plugin.ts @@ -23,6 +23,8 @@ import { ErrorLevel, ErrorTagFormat, ErrorMessage, + ApiCheckInfo, + ErrorBaseInfo, } from '../../../typedef/checker/result_type'; import { ClassInfo } from '../../../typedef/parser/ApiInfoDefination'; import { Comment } from '../../../typedef/parser/Comment'; @@ -45,15 +47,15 @@ import { TagInheritCheck } from './tag_inherit_check'; import { ChineseCheck } from "./check_chinese"; import { AnonymousFunctionCheck } from './check_anonymous_function'; export let currentFilePath: string = ''; -import {CheckErrorCode} from "./check_error_code"; +import { CheckErrorCode } from "./check_error_code"; export class Check { /** * checker tool main entrance * @param { string[] } files -File path for storing file information. */ - static scanEntry(files: string[]): void { - ApiChangeCheck.checkApiChange(); + static scanEntry(files: string[], prId: string): void { + ApiChangeCheck.checkApiChange(prId); files.forEach((filePath: string, index: number) => { currentFilePath = filePath; if (filePath.indexOf('build-tools') !== -1) { @@ -113,52 +115,41 @@ export class Check { return; } if (apiJsdoc === undefined) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.NO_JSDOC_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.NO_JSDOC, - LogType.LOG_JSDOC, - -1, - singleApi.getApiName(), - singleApi.getJsDocText() + singleApi.getDefinedText(), - ErrorMessage.ERROR_NO_JSDOC, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.NO_JSDOC_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.NO_JSDOC) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(ErrorMessage.ERROR_NO_JSDOC); + const apiInfoNojsdoc: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoNojsdoc, compositiveResult, compositiveLocalResult); } else { if (apiJsdoc.getKit().length === 0) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - { line: 0, character: 0 }, - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - -1, - singleApi.getFilePath(), - singleApi.getFilePath(), - CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit']), - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit'])); + const apiInfoNoKit: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoNoKit, compositiveResult, compositiveLocalResult); } if (!apiJsdoc.getIsFile()) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - { line: 0, character: 0 }, - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - -1, - singleApi.getFilePath(), - singleApi.getFilePath(), - CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file']), - compositiveResult, - compositiveLocalResult - ); + const apiInfo: ApiCheckInfo = new ApiCheckInfo(); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file'])); + const apiInfoNoFile: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoNoFile, compositiveResult, compositiveLocalResult); } // legality check const tagLegalityCheckResult: ErrorTagFormat[] = LegalityCheck.apiLegalityCheck(singleApi, apiJsdoc); @@ -168,10 +159,10 @@ export class Check { const namingCheckResult: ErrorTagFormat = ApiNamingCheck.namingCheck(singleApi); // check jsdoc chinese const chineseCheckResult: ErrorTagFormat = ChineseCheck.checkChinese(apiJsdoc); - // check error code - const errorCodeResult: ErrorTagFormat = CheckErrorCode.checkErrorCode(apiJsdoc); + // check error code + const errorCodeResult: ErrorTagFormat = CheckErrorCode.checkErrorCode(apiJsdoc); // tags name check - const tagNamseCheckResult: ErrorTagFormat = TagNameCheck.tagNameCheck(apiJsdoc); + const tagNameCheckResult: ErrorTagFormat = TagNameCheck.tagNameCheck(apiJsdoc); // tags inherit check const tagInheritCheckResult: ErrorTagFormat[] = TagInheritCheck.tagInheritCheck(singleApi); // tags value check @@ -179,192 +170,149 @@ export class Check { // tags repeat check const tagRepeatCheckResult: ErrorTagFormat[] = TagRepeatCheck.tagRepeatCheck(apiJsdoc); // api forbidden wors check - const forbiddenWorsCheckResult: ErrorTagFormat = ForbiddenWordsCheck.forbiddenWordsCheck(singleApi as ClassInfo); + const forbiddenWordsCheckResult: ErrorTagFormat = ForbiddenWordsCheck.forbiddenWordsCheck(singleApi as ClassInfo); const anonymousFunction: ErrorTagFormat = AnonymousFunctionCheck.checkAnonymousFunction(singleApi); + // console.log(anonymousFunction) if (!orderCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_ORDER_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_ORDER, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - orderCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_ORDER_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_ORDER) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(orderCheckResult.errorInfo); + const apiInfoOrder: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoOrder, compositiveResult, compositiveLocalResult); } - if (!tagNamseCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.UNKNOW_DECORATOR_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.UNKNOW_DECORATOR, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - tagNamseCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + if (!tagNameCheckResult.state) { + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.UNKNOW_DECORATOR_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.UNKNOW_DECORATOR) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(tagNameCheckResult.errorInfo); + const apiInfoName: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoName, compositiveResult, compositiveLocalResult); } - if (!forbiddenWorsCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.FORBIDDEN_WORDS_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.FORBIDDEN_WORDS, - LogType.LOG_API, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - forbiddenWorsCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + if (!forbiddenWordsCheckResult.state) { + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.FORBIDDEN_WORDS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.FORBIDDEN_WORDS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(forbiddenWordsCheckResult.errorInfo); + const apiInfoForbiddenWords: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoForbiddenWords, compositiveResult, compositiveLocalResult); } if (!namingCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.NAMING_ERRORS_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.NAMING_ERRORS, - LogType.LOG_API, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - namingCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.NAMING_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.NAMING_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(namingCheckResult.errorInfo); + const apiInfoNaming: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoNaming, compositiveResult, compositiveLocalResult); } if (!chineseCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.JSDOC_HAS_CHINESE, - ErrorLevel.MIDDLE, - singleApi.getFilePath(), - singleApi.getPos(), - ErrorType.JSDOC_HAS_CHINESE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - chineseCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.JSDOC_HAS_CHINESE) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.JSDOC_HAS_CHINESE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(chineseCheckResult.errorInfo); + const apiInfoChineseCheck: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoChineseCheck, compositiveResult, compositiveLocalResult); } if (!errorCodeResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.ERROR_ERROR_CODE, - ErrorLevel.MIDDLE, - singleApi.getFilePath(), - singleApi.getPos(), - ErrorType.ERROR_ERROR_CODE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - errorCodeResult.errorInfo, - compositiveResult, - compositiveLocalResult, - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.ERROR_ERROR_CODE) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.ERROR_ERROR_CODE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorCodeResult.errorInfo); + const apiInfoErrorCode: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoErrorCode, compositiveResult, compositiveLocalResult); } - tagInheritCheckResult.forEach((InheritCheckResult: ErrorTagFormat) => { - if (!InheritCheckResult.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - InheritCheckResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + tagInheritCheckResult.forEach((inheritCheckResult: ErrorTagFormat) => { + if (!inheritCheckResult.state) { + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(inheritCheckResult.errorInfo); + const apiInfoInherit: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoInherit, compositiveResult, compositiveLocalResult); } }); tagLegalityCheckResult.forEach((legalityResult) => { if (legalityResult.state === false) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - legalityResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(legalityResult.errorInfo); + const apiInfoInherit: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoInherit, compositiveResult, compositiveLocalResult); } }); tagValueCheckResult.forEach((valueResult) => { if (valueResult.state === false) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_VALUE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_VALUE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - valueResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_VALUE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_VALUE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(valueResult.errorInfo); + const apiInfoValue: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoValue, compositiveResult, compositiveLocalResult); } }); tagRepeatCheckResult.forEach((repeatResult) => { if (repeatResult.state === false) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - repeatResult.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(repeatResult.errorInfo); + const apiInfoRepeat: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoRepeat, compositiveResult, compositiveLocalResult); } }); if (!anonymousFunction.state) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.WRONG_SCENE_ID, - ErrorLevel.MIDDLE, - currentFilePath, - singleApi.getPos(), - ErrorType.WRONG_SCENE, - LogType.LOG_JSDOC, - toNumber(apiJsdoc.since), - singleApi.getApiName(), - singleApi.getDefinedText(), - anonymousFunction.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.WRONG_SCENE_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.WRONG_SCENE) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(anonymousFunction.errorInfo); + const apiInfoAnonymousFunction: ApiCheckInfo = CommonFunctions.getErrorInfo(singleApi, apiJsdoc, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoAnonymousFunction, compositiveResult, compositiveLocalResult); } } }); diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/check_api_diff.ts b/build-tools/dts_parser/src/coreImpl/checker/src/check_api_diff.ts index 2e0770a14..80c2dbb90 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/check_api_diff.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/check_api_diff.ts @@ -20,7 +20,7 @@ import { DiffHelper } from '../../diff/diff'; import { FileUtils } from '../../../utils/FileUtils'; import { BasicDiffInfo } from '../../../typedef/diff/ApiInfoDiff'; import { AddErrorLogs } from './compile_info'; -import { compositiveResult, compositiveLocalResult } from '../../../utils/checkUtils'; +import { compositiveResult, compositiveLocalResult, CommonFunctions } from '../../../utils/checkUtils'; import { ErrorType, ErrorID, @@ -28,21 +28,31 @@ import { ErrorLevel, ErrorMessage, incompatibleApiDiffTypes, + ApiCheckInfo, + ErrorBaseInfo, } from '../../../typedef/checker/result_type'; import { ApiDiffType } from '../../../typedef/diff/ApiInfoDiff'; +import { ApiInfo } from '../../../typedef/parser/ApiInfoDefination'; export class ApiChangeCheck { - static checkApiChange(prId?: string): void { - const rootDir = path.resolve( + static checkApiChange(prId: string): void { + let rootDir: string = ''; + const onlineDir: string = path.resolve( FileUtils.getBaseDirName(), - `../../../../../Archive/patch_info/openharmony_interface_sdk-js_${prId}` + `../../../../Archive/patch_info/openharmony_interface_sdk-js_${prId}` ); - if (!fs.existsSync(rootDir)) { - return; + const localDir: string = path.resolve(FileUtils.getBaseDirName(), prId); + + if (fs.existsSync(onlineDir)) { + rootDir = onlineDir; + } else if (fs.existsSync(localDir)) { + rootDir = localDir; } const oldFileDir: string = path.resolve(rootDir, './old'); const newFileDir: string = path.resolve(rootDir, './new'); - + if (!fs.existsSync(oldFileDir) || !fs.existsSync(newFileDir)) { + return; + } const status: fs.Stats = fs.statSync(oldFileDir); let diffInfos: BasicDiffInfo[] = []; if (status.isDirectory()) { @@ -61,36 +71,45 @@ export class ApiChangeCheck { const errorInfo: ErrorMessage | undefined = incompatibleApiDiffTypes.get(diffInfo.getDiffType()); if (diffInfo.getDiffType() === ApiDiffType.REDUCE) { const dtsName = path.basename(diffInfo.getOldDtsName()); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.API_CHANGE_ERRORS_ID, - ErrorLevel.MIDDLE, - dtsName, - diffInfo.getOldPos(), - ErrorType.API_CHANGE_ERRORS, - LogType.LOG_API, - -1, - diffInfo.getOldApiName(), - diffInfo.getOldApiDefinedText(), - errorInfo as string, - compositiveResult, - compositiveLocalResult - ); + let apiInfoDiff: ApiCheckInfo = new ApiCheckInfo(); + const hierarchicalRelations: string[] = diffInfo.getOldHierarchicalRelations(); + const parentModuleName: string = hierarchicalRelations[hierarchicalRelations.length - 1]; + apiInfoDiff + .setErrorID(ErrorID.API_CHANGE_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setFilePath(dtsName) + .setApiPostion(diffInfo.getOldPos()) + .setErrorType(ErrorType.API_CHANGE_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setSinceNumber(-1) + .setApiName(diffInfo.getOldApiName()) + .setApiType(diffInfo.getApiType()) + .setApiText(diffInfo.getOldApiDefinedText()) + .setErrorInfo(errorInfo as string) + .setHierarchicalRelations(diffInfo.getOldHierarchicalRelations().join('|')) + .setParentModuleName(parentModuleName); + + AddErrorLogs.addAPICheckErrorLogs(apiInfoDiff, compositiveResult, compositiveLocalResult); } else { const dtsName = path.basename(diffInfo.getNewDtsName()); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.API_CHANGE_ERRORS_ID, - ErrorLevel.MIDDLE, - dtsName, - diffInfo.getOldPos(), - ErrorType.API_CHANGE_ERRORS, - LogType.LOG_API, - -1, - diffInfo.getNewApiName(), - diffInfo.getNewApiDefinedText(), - errorInfo as string, - compositiveResult, - compositiveLocalResult - ); + let apiInfoDiff: ApiCheckInfo = new ApiCheckInfo(); + const hierarchicalRelations: string[] = diffInfo.getOldHierarchicalRelations(); + const parentModuleName: string = hierarchicalRelations[hierarchicalRelations.length - 1]; + apiInfoDiff + .setErrorID(ErrorID.API_CHANGE_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setFilePath(dtsName) + .setApiPostion(diffInfo.getOldPos()) + .setErrorType(ErrorType.API_CHANGE_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setSinceNumber(-1) + .setApiName(diffInfo.getNewApiName()) + .setApiType(diffInfo.getApiType()) + .setApiText(diffInfo.getNewApiDefinedText()) + .setErrorInfo(errorInfo as string) + .setHierarchicalRelations(diffInfo.getOldHierarchicalRelations().join('|')) + .setParentModuleName(parentModuleName); + AddErrorLogs.addAPICheckErrorLogs(apiInfoDiff, compositiveResult, compositiveLocalResult); } }); } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/check_hump.ts b/build-tools/dts_parser/src/coreImpl/checker/src/check_hump.ts index 792ccf741..2dc857efc 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/check_hump.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/check_hump.ts @@ -23,6 +23,8 @@ import { LogType, ErrorLevel, ErrorMessage, + ApiCheckInfo, + ErrorBaseInfo, } from '../../../typedef/checker/result_type'; import { Comment } from '../../../typedef/parser/Comment'; import { @@ -33,6 +35,7 @@ import { } from '../../../typedef/parser/ApiInfoDefination'; import { CommonFunctions } from '../../../utils/checkUtils'; import { compositiveResult, compositiveLocalResult } from '../../../utils/checkUtils'; +import { currentFilePath } from './api_check_plugin'; export class CheckHump { /** @@ -143,20 +146,16 @@ export class CheckHump { } if (checkResult !== '') { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.TS_SYNTAX_ERROR_ID, - ErrorLevel.MIDDLE, - filePath, - apiInfo.getPos(), - ErrorType.NAMING_ERRORS, - LogType.LOG_API, - -1, - apiName, - apiInfo.getDefinedText(), - checkResult, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.NAMING_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.NAMING_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(checkResult); + const apiInfoHump: ApiCheckInfo = CommonFunctions.getErrorInfo(apiInfo, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoHump, compositiveResult, compositiveLocalResult); } } @@ -190,7 +189,7 @@ export class CheckHump { exportAssignment = (apiInfo.getApiType() === ApiType.EXPORT_DEFAULT || apiInfo.getIsExport()) ? apiInfo.getApiName().replace(StringConstant.EXPORT_DEFAULT, '') : exportAssignment; }); } - const basename: string = path.basename(filePath).replace(new RegExp(StringConstant.DTS_EXTENSION, 'g'), ''); + const basename: string = path.basename(filePath).replace(new RegExp(StringConstant.DTS_EXTENSION, 'g'), '').replace(new RegExp(StringConstant.DETS_EXTENSION, 'g'), ''); const basenames: string[] = basename.split('.'); const lastModuleName: string = basenames.length ? basenames[basenames.length - 1] : ''; @@ -202,20 +201,16 @@ export class CheckHump { checkResult = ErrorMessage.ERROR_LARGE_HUMP_NAME_FILE; } if (checkResult !== '' && version === String(CommonFunctions.getCheckApiVersion())) { - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.MISSPELL_WORDS_ID, - ErrorLevel.MIDDLE, - filePath, - { line: -1, character: -1 }, - ErrorType.NAMING_ERRORS, - LogType.LOG_API, - -1, - 'NA', - 'NA', - checkResult, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.NAMING_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.NAMING_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(checkResult); + const apiInfoHump: ApiCheckInfo = CommonFunctions.getErrorInfo(undefined, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoHump, compositiveResult, compositiveLocalResult); } } } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/compile_info.ts b/build-tools/dts_parser/src/coreImpl/checker/src/compile_info.ts index 4702b1269..a51b6e2aa 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/compile_info.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/compile_info.ts @@ -12,63 +12,51 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import ts from 'typescript'; -import { ApiResultSimpleInfo, ApiResultInfo, ErrorMessage } from '../../../typedef/checker/result_type'; +import { ApiResultSimpleInfo, ApiResultInfo, ErrorMessage, ApiCheckInfo } from '../../../typedef/checker/result_type'; import { CommonFunctions } from '../../../utils/checkUtils'; export class AddErrorLogs { /** * 按照格式生成错误信息 - * @param { number } id -error message id - * @param { number } level -error level - * @param { string } filePath -error message file path - * @param { string } location -error message location - * @param { string } errorType -error message wrong type - * @param { string } apiType -error message log type - * @param { number } version -error message version - * @param { string } apiName -error message api name - * @param { string } apiFullText -error message api text - * @param { string } message -error infomation - * @param { ApiResultSimpleInfo[] } checkErrorInfos -array for storing error information + * @param { ApiCheckInfo } apiInfo -api infomation + * @param { ApiResultSimpleInfo[] } checkErrorInfos -save api check base error info + * @param { ApiResultInfo[] } checkErrorAllInfos -save api check error info */ - static addAPICheckErrorLogs( - id: number, - level: number, - filePath: string, - pos: ts.LineAndCharacter, - errorType: string, - apiType: string, - version: number, - apiName: string, - apiFullText: string, - message: string, - checkErrorInfos: ApiResultSimpleInfo[], - checkErrorAllInfos: ApiResultInfo[] + static addAPICheckErrorLogs(apiInfo: ApiCheckInfo, checkErrorInfos: ApiResultSimpleInfo[], + checkErrorAllInfos: ApiResultInfo[], ): void { - const location = JSON.stringify(pos.line); - const errorMessage: string = `API check error of [${errorType}]: ${message}`; + const location = JSON.stringify(apiInfo.getApiPostion().line); + const errorMessage: string = `API check error of [${apiInfo.getErrorType()}]: ${apiInfo.getErrorInfo()}`; const apiChecktSimpleErrorLog: ApiResultSimpleInfo = new ApiResultSimpleInfo(); + apiChecktSimpleErrorLog - .setID(id) - .setLevel(level) + .setID(apiInfo.getErrorID()) + .setLevel(apiInfo.getErrorLevel()) .setLocation(location) - .setFilePath(filePath) + .setFilePath(apiInfo.getFilePath()) .setMessage(errorMessage) - .setApiText(apiFullText); + .setApiText(apiInfo.getApiText()) + .setApiName(apiInfo.getApiName()) + .setApiType(apiInfo.getApiType()) + .setHierarchicalRelations(apiInfo.getHierarchicalRelations()) + .setParentModuleName(apiInfo.getParentModuleName()); const apiCheckErrorLog: ApiResultInfo = new ApiResultInfo(); apiCheckErrorLog - .setErrorType(errorType) - .setLocation(filePath.slice(filePath.indexOf('api'), filePath.length) + `(line: ${location})`) - .setApiType(apiType) + .setErrorType(apiInfo.getErrorType()) + .setLocation(apiInfo.getFilePath().slice(apiInfo.getFilePath().indexOf('api'), apiInfo.getFilePath().length) + `(line: ${location})`) + .setApiType(apiInfo.getApiType()) .setMessage(errorMessage) - .setVersion(version) - .setLevel(level) - .setApiName(apiName) - .setApiFullText(apiFullText) - .setBaseName(filePath.slice(filePath.lastIndexOf('\\') + 1, filePath.length)); - let isLostKitErrorInfo: boolean = message === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit']); - let isLostFileErrorInfo: boolean = message === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file']); + .setVersion(apiInfo.getSinceNumber()) + .setLevel(apiInfo.getErrorLevel()) + .setApiName(apiInfo.getApiName()) + .setApiFullText(apiInfo.getApiText()) + .setBaseName(apiInfo.getFilePath().slice(apiInfo.getFilePath().lastIndexOf('\\') + 1, apiInfo.getFilePath().length)) + .setHierarchicalRelations(apiInfo.getHierarchicalRelations()) + .setParentModuleName(apiInfo.getParentModuleName()) + .setDefectType(''); + let isLostKitErrorInfo: boolean = apiInfo.getErrorInfo() === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['kit']); + let isLostFileErrorInfo: boolean = apiInfo.getErrorInfo() === CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['file']); let hasLostKitErrorInfo: string[] = []; let hasLostfileErrorInfo: string[] = []; diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/event_method_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/event_method_check.ts index f6b3a228f..81fa25d88 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/event_method_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/event_method_check.ts @@ -16,7 +16,7 @@ import ts from 'typescript'; import { EventConstant } from '../../../utils/Constant'; import { EventMethodData, CollectParamStatus } from '../../../typedef/checker/event_method_check_interface'; -import { ErrorID, ErrorLevel, ErrorMessage, ErrorType, LogType } from '../../../typedef/checker/result_type'; +import { ApiCheckInfo, ErrorBaseInfo, ErrorID, ErrorLevel, ErrorMessage, ErrorType, LogType } from '../../../typedef/checker/result_type'; import { ApiInfo, ApiType, BasicApiInfo, MethodInfo, ParamInfo } from '../../../typedef/parser/ApiInfoDefination'; import { CommonFunctions } from '../../../utils/checkUtils'; import { FilesMap, Parser } from '../../parser/parser'; @@ -24,7 +24,7 @@ import { AddErrorLogs } from './compile_info'; import { compositiveResult, compositiveLocalResult } from '../../../utils/checkUtils'; import { CheckHump } from './check_hump'; import { ApiCheckVersion } from '../config/api_check_version.json'; -import { Check } from './api_check_plugin'; +import { Check, currentFilePath } from './api_check_plugin'; export class EventMethodChecker { private apiData: FilesMap; @@ -56,20 +56,16 @@ export class EventMethodChecker { (eventMethod.onEvents.length !== 0 && eventMethod.offEvents.length === 0)) { const firstEvent: BasicApiInfo = eventMethod.onEvents.concat(eventMethod.offEvents)[0]; const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_ON_AND_OFF_PAIR, []); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.API_PAIR_ERRORS_ID, - ErrorLevel.MIDDLE, - firstEvent.getFilePath(), - firstEvent.getPos(), - ErrorType.API_PAIR_ERRORS, - LogType.LOG_API, - parseInt(firstEvent.getCurrentVersion()), - firstEvent.getApiName(), - firstEvent.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.API_PAIR_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.API_PAIR_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(firstEvent, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); } // check off event @@ -91,20 +87,16 @@ export class EventMethodChecker { (offEvnetCallbackNumber === 0 && eventMethod.offEvents.length !== 0)) { const firstEvent: BasicApiInfo = eventMethod.offEvents[0]; const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_CALLBACK_OPTIONAL, []); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.PARAMETER_ERRORS_ID, - ErrorLevel.MIDDLE, - firstEvent.getFilePath(), - firstEvent.getPos(), - ErrorType.PARAMETER_ERRORS, - LogType.LOG_API, - parseInt(firstEvent.getCurrentVersion()), - firstEvent.getApiName(), - firstEvent.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.PARAMETER_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(firstEvent, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); } } @@ -119,20 +111,16 @@ export class EventMethodChecker { const eventParams: ParamInfo[] = (event as MethodInfo).getParams(); if (eventParams.length < 1) { const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_WITHOUT_PARAMETER, []); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.PARAMETER_ERRORS_ID, - ErrorLevel.MIDDLE, - event.getFilePath(), - event.getPos(), - ErrorType.PARAMETER_ERRORS, - LogType.LOG_API, - parseInt(event.getCurrentVersion()), - event.getApiName(), - event.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.PARAMETER_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(event, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); continue; } const firstParam: ParamInfo = eventParams[0]; @@ -141,55 +129,43 @@ export class EventMethodChecker { if (paramTypeName === '') { const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_NAME_NULL, [firstParam.getApiName()]); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.PARAMETER_ERRORS_ID, - ErrorLevel.MIDDLE, - event.getFilePath(), - event.getPos(), - ErrorType.PARAMETER_ERRORS, - LogType.LOG_API, - parseInt(event.getCurrentVersion()), - event.getApiName(), - event.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.PARAMETER_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(event, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); } else if (!CheckHump.checkSmallHump(paramTypeName)) { const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_NAME_SMALL_HUMP, [paramTypeName]); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.PARAMETER_ERRORS_ID, - ErrorLevel.MIDDLE, - event.getFilePath(), - event.getPos(), - ErrorType.PARAMETER_ERRORS, - LogType.LOG_API, - parseInt(event.getCurrentVersion()), - event.getApiName(), - event.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.PARAMETER_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(event, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); } } else if (firstParam.getParamType() !== ts.SyntaxKind.StringKeyword) { const errorMessage: string = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_EVENT_NAME_STRING, [firstParam.getApiName()]); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.PARAMETER_ERRORS_ID, - ErrorLevel.MIDDLE, - event.getFilePath(), - event.getPos(), - ErrorType.PARAMETER_ERRORS, - LogType.LOG_API, - parseInt(event.getCurrentVersion()), - event.getApiName(), - event.getDefinedText(), - errorMessage, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.PARAMETER_ERRORS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(errorMessage); + const apiInfoEvent: ApiCheckInfo = CommonFunctions.getErrorInfo(event, undefined, currentFilePath, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoEvent, compositiveResult, compositiveLocalResult); } } }); diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/naming_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/naming_check.ts index f43bcea02..fc1de6aeb 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/naming_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/naming_check.ts @@ -20,7 +20,8 @@ import { } from '../../../typedef/checker/result_type'; import { ApiInfo } from '../../../typedef/parser/ApiInfoDefination'; import { Comment } from '../../../typedef/parser/Comment'; -import { CommonFunctions } from '../../../utils/checkUtils'; +import { CommonFunctions, punctuationMarkSet } from '../../../utils/checkUtils'; +import { WordsCheck } from './words_check'; const nameDictionary = require('../config/name_dictionary.json'); const nameScenarioScope = require('../config/name_scenario_scope.json'); @@ -38,12 +39,23 @@ export class ApiNamingCheck { const jsDocInfo: Comment.JsDocInfo[] = singleApi.getJsDocInfos(); const publishVersion: string = CommonFunctions.getSinceVersion(jsDocInfo[0].getSince()); const apiVersionToBeVerified: string = CommonFunctions.getCheckApiVersion(); - const lowIdentifier: string = singleApi.getDefinedText().toLowerCase(); - const fileName:string=singleApi.getFilePath().toLowerCase(); - if (publishVersion === apiVersionToBeVerified) { - ApiNamingCheck.checkApiNamingWords(lowIdentifier, tagNameCheckResult); - ApiNamingCheck.checkApiNamingScenario(fileName, tagNameCheckResult, singleApi); - } + const fileName: string = singleApi.getFilePath().toLowerCase(); + const reg = /\s{2,}/g; + const regx = /(\/\*|\*\/|\*)|\n|\r/g; + let apiText: string = singleApi.getDefinedText().replace(regx, ' '); + punctuationMarkSet.forEach(punctuationMark => { + const punctuationMarkReg = new RegExp(punctuationMark, 'g'); + if (punctuationMarkReg.test(apiText)) { apiText = apiText.replace(punctuationMarkReg, ' ').replace(reg, ' '); } + }); + let apiWordsArr = apiText.split(/\s/g); + let basicWords: string[] = []; + apiWordsArr.forEach((apiWord) => { basicWords = WordsCheck.splitComplexWords(apiWord); }); + basicWords.forEach((basicWord: string) => { + if (publishVersion === apiVersionToBeVerified) { + ApiNamingCheck.checkApiNamingWords(basicWord, tagNameCheckResult); + ApiNamingCheck.checkApiNamingScenario(fileName, tagNameCheckResult, singleApi); + } + }); return tagNameCheckResult; } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts index e4cace99a..6a8d27249 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/tag_legality_check.ts @@ -39,7 +39,6 @@ export class LegalityCheck { const illegalTagsArray: string[] = LegalityCheck.getIllegalTagsArray(apiLegalityTagsArray); let extendsApiValue = ''; let implementsApiValue = ''; - if (singleApi.getApiType() === ApiType.CLASS || singleApi.getApiType() === ApiType.INTERFACE) { extendsApiValue = CommonFunctions.getExtendsApiValue(singleApi); implementsApiValue = CommonFunctions.getImplementsApiValue(singleApi); @@ -61,82 +60,83 @@ export class LegalityCheck { } // 判断api的jsdoc中是否存在非法标签,是否缺失必选标签 - if (Array.isArray(apiLegalityTagsArray)) { - const apiTags: Comment.CommentTag[] | undefined = apiJsdoc.tags; - const apiTagsName: string[] = []; - const throwsCodeArr: string[] = []; - if (apiTags === undefined) { - const sinceLost: ErrorTagFormat = { - state: false, - errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['since']), - }; - const syscapLost: ErrorTagFormat = { - state: false, - errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['syscap']), - }; - apiLegalityCheckResult.push(sinceLost, syscapLost); - return apiLegalityCheckResult; - } - const tagsTag: string[] = []; - apiTags.forEach((apiTag: Comment.CommentTag) => { tagsTag.push(apiTag.tag) }); - if (tagsTag.includes('deprecated')) { - return apiLegalityCheckResult; - } - - let paramTagNumber: number = 0; - let paramApiNumber: number = - singleApi.getApiType() === ApiType.METHOD ? (singleApi as MethodInfo).getParams().length : 0; - - paramApiNumber = singleApi.getApiType() === ApiType.TYPE_ALIAS ? - (singleApi as TypeAliasInfo).getParamInfos().length : paramApiNumber; - - apiTags.forEach((apiTag) => { - apiTagsName.push(apiTag.tag); - if (apiTag.tag === 'throws') { - throwsCodeArr.push(apiTag.name); - } - paramTagNumber = apiTag.tag === 'param' ? paramTagNumber + 1 : paramTagNumber; - const isUseinsteadLegalSituation: boolean = apiTag.tag === 'useinstead' && apiJsdoc.deprecatedVersion !== '-1'; - apiLegalityTagsSet.delete('param'); - if (apiLegalityTagsSet.has(apiTag.tag)) { - apiLegalityTagsSet.delete(apiTag.tag); - } - if (singleApi.getApiType() === ApiType.INTERFACE && (apiTag.tag === 'typedef' || apiTag.tag === 'interface')) { - apiLegalityTagsSet.delete('typedef'); - apiLegalityTagsSet.delete('interface'); - } - if ((singleApi.getApiType() === ApiType.METHOD && (singleApi as MethodInfo).getReturnValue().length === 0) || - singleApi.getApiType() === ApiType.TYPE_ALIAS && ((singleApi as TypeAliasInfo).getReturnType() === 'void' || - !(singleApi as TypeAliasInfo).getTypeIsFunction())) { - apiLegalityTagsSet.delete('returns'); - illegalTagsArray.push('returns'); - } - if (illegalTagsArray.includes(apiTag.tag)) { - if (apiTag.tag !== 'useinstead' || !isUseinsteadLegalSituation) { - const apiRedundantResultFormat: ErrorTagFormat = { - state: false, - errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_USE, [apiTag.tag]), - }; - apiLegalityCheckResult.push(apiRedundantResultFormat); - } - } - }); - if (singleApi.getApiType() === ApiType.METHOD) { - LegalityCheck.checkThrowsCode(throwsCodeArr, apiTagsName, paramApiNumber, apiLegalityCheckResult); - } - // param合法性单独进行校验 - LegalityCheck.paramLegalityCheck(paramTagNumber, paramApiNumber, apiLegalityCheckResult); - // 缺失标签set合集 - apiLegalityTagsSet.forEach((apiLegalityTag) => { - if (!conditionalOptionalTags.includes(apiLegalityTag)) { - const apiLostResultFormat: ErrorTagFormat = { - state: false, - errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, [apiLegalityTag]), - }; - apiLegalityCheckResult.push(apiLostResultFormat); - } - }); + if (!Array.isArray(apiLegalityTagsArray)) { + return apiLegalityCheckResult; } + const apiTags: Comment.CommentTag[] | undefined = apiJsdoc.tags; + const apiTagsName: string[] = []; + const throwsCodeArr: string[] = []; + if (apiTags === undefined) { + const sinceLost: ErrorTagFormat = { + state: false, + errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['since']), + }; + const syscapLost: ErrorTagFormat = { + state: false, + errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, ['syscap']), + }; + apiLegalityCheckResult.push(sinceLost, syscapLost); + return apiLegalityCheckResult; + } + const tagsTag: string[] = []; + apiTags.forEach((apiTag: Comment.CommentTag) => { tagsTag.push(apiTag.tag) }); + if (tagsTag.includes('deprecated')) { + return apiLegalityCheckResult; + } + + let paramTagNumber: number = 0; + let paramApiNumber: number = + singleApi.getApiType() === ApiType.METHOD ? (singleApi as MethodInfo).getParams().length : 0; + + paramApiNumber = singleApi.getApiType() === ApiType.TYPE_ALIAS ? + (singleApi as TypeAliasInfo).getParamInfos().length : paramApiNumber; + + apiTags.forEach((apiTag) => { + apiTagsName.push(apiTag.tag); + if (apiTag.tag === 'throws') { + throwsCodeArr.push(apiTag.name); + } + paramTagNumber = apiTag.tag === 'param' ? paramTagNumber + 1 : paramTagNumber; + const isUseinsteadLegalSituation: boolean = apiTag.tag === 'useinstead' && apiJsdoc.deprecatedVersion !== '-1'; + apiLegalityTagsSet.delete('param'); + if (apiLegalityTagsSet.has(apiTag.tag)) { + apiLegalityTagsSet.delete(apiTag.tag); + } + if (singleApi.getApiType() === ApiType.INTERFACE && (apiTag.tag === 'typedef' || apiTag.tag === 'interface')) { + apiLegalityTagsSet.delete('typedef'); + apiLegalityTagsSet.delete('interface'); + } + if ((singleApi.getApiType() === ApiType.METHOD && (singleApi as MethodInfo).getReturnValue().length === 0) || + singleApi.getApiType() === ApiType.TYPE_ALIAS && ((singleApi as TypeAliasInfo).getReturnType() === 'void' || + !(singleApi as TypeAliasInfo).getTypeIsFunction())) { + apiLegalityTagsSet.delete('returns'); + illegalTagsArray.push('returns'); + } + if (illegalTagsArray.includes(apiTag.tag)) { + if (apiTag.tag !== 'useinstead' || !isUseinsteadLegalSituation) { + const apiRedundantResultFormat: ErrorTagFormat = { + state: false, + errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_USE, [apiTag.tag]), + }; + apiLegalityCheckResult.push(apiRedundantResultFormat); + } + } + }); + if (singleApi.getApiType() === ApiType.METHOD) { + LegalityCheck.checkThrowsCode(throwsCodeArr, apiTagsName, paramApiNumber, apiLegalityCheckResult); + } + // param合法性单独进行校验 + LegalityCheck.paramLegalityCheck(paramTagNumber, paramApiNumber, apiLegalityCheckResult); + // 缺失标签set合集 + apiLegalityTagsSet.forEach((apiLegalityTag) => { + if (!conditionalOptionalTags.includes(apiLegalityTag)) { + const apiLostResultFormat: ErrorTagFormat = { + state: false, + errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, [apiLegalityTag]), + }; + apiLegalityCheckResult.push(apiLostResultFormat); + } + }); return apiLegalityCheckResult; } @@ -209,7 +209,7 @@ export class LegalityCheck { apiLostSystemapiTag.errorInfo = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_LOST_LABEL, [hasSystemapiTag ? 'throws 202' : ParticularErrorCode.ERROR_SYSTEMAPI]); } // check systemapi 401 - if (hasError401 && paramApiNumber===0) { + if (hasError401 && paramApiNumber === 0) { apiRedundantThrows.state = false; apiRedundantThrows.errorInfo = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_REPEATLABEL, ['throws']); } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/tag_order_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/tag_order_check.ts index d68adc48d..48379317c 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/tag_order_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/tag_order_check.ts @@ -46,13 +46,36 @@ export class OrderCheck { // 判断标签是否为官方标签 const firstTag = CommonFunctions.isOfficialTag(tagsOrder[tagIndex]); // 非自定义标签在前或数组降序时报错 - if ((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1)) { + if (tagsOrder[tagIndex].tag !== 'form' && tagsOrder[tagIndex + 1].tag !== 'form' && + ((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1))) { orderCheckResult.state = false; orderCheckResult.errorInfo = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_ORDER, [tagsOrder[tagIndex]]); break; + } else if (tagsOrder[tagIndex].tag === 'form') { + orderCheckResult.state = OrderCheck.formOrderCheck(tagsOrder, tagIndex, firstIndex, secondIndex); + orderCheckResult.errorInfo = CommonFunctions.createErrorInfo(ErrorMessage.ERROR_ORDER, [tagsOrder[tagIndex].tag]); } } } return orderCheckResult; } + + /** + * 对form标签的顺序做兼容处理 + */ + static formOrderCheck(tags: Comment.CommentTag[], tagIndex: number, firstIndex: number, secondIndex: number): boolean { + const frontFirstIndex = tagIndex - 1 > -1 ? tagsArrayOfOrder.indexOf(tags[tagIndex - 1].tag) : 0; + const formNeighborArr = [frontFirstIndex, firstIndex]; + const newTagIndex = tagsArrayOfOrder.lastIndexOf(tags[tagIndex].tag); + const newFormNeighborArr = [frontFirstIndex, newTagIndex]; + if (secondIndex > -1) { + formNeighborArr.push(secondIndex); + newFormNeighborArr.push(secondIndex); + } + if (!CommonFunctions.isAscending(formNeighborArr) && !CommonFunctions.isAscending(newFormNeighborArr)) { + return false; + } + return true; + } + } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts index 1ebd43872..230e76dbd 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/tag_value_check.ts @@ -179,7 +179,6 @@ export class TagValueCheck { errorInfo: '', }; const returnsTagValue: string = tag.type.replace(/\s/g, ''); - let returnsApiValue: string[] = []; const legalApiArr: string[] = [ApiType.METHOD, ApiType.TYPE_ALIAS]; if (!legalApiArr.includes(singleApi.getApiType())) { @@ -191,6 +190,7 @@ export class TagValueCheck { } else { returnsApiValue = spacealCase.length > 0 ? spacealCase : (singleApi as MethodInfo).getReturnValue(); } + if (returnsApiValue.length === 0) { returnsValueCheckResult.state = false; returnsValueCheckResult.errorInfo = ErrorMessage.ERROR_INFO_RETURNS; @@ -431,10 +431,10 @@ export class TagValueCheck { let paramApiName: string = ''; let paramApiType: string[] = []; - if (singleApi.getApiType() === ApiType.TYPE_ALIAS) { - const typeParams: TypeParamInfo[] = (singleApi as TypeAliasInfo).getParamInfos(); - paramApiName = typeParams.length > paramIndex ? typeParams[paramIndex].getParamName() : ''; - paramApiType.push(typeParams.length > paramIndex ? JSON.stringify(typeParams[paramIndex].getParamType()) : ''); + if (singleApi. getApiType() === ApiType.TYPE_ALIAS) { + const typeParams: ParamInfo[] = (singleApi as TypeAliasInfo).getParamInfos(); + paramApiName = typeParams.length > paramIndex ? typeParams[paramIndex].getApiName() : ''; + paramApiType=typeParams.length > paramIndex ? typeParams[paramIndex].getType() : []; } else { const paramApiInfos: ParamInfo[] = (singleApi as MethodInfo).getParams(); paramApiName = paramApiInfos[paramIndex]?.getApiName(); diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/ts_check_plugin.ts b/build-tools/dts_parser/src/coreImpl/checker/src/ts_check_plugin.ts index a68d89230..eddcb3ade 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/ts_check_plugin.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/ts_check_plugin.ts @@ -24,9 +24,11 @@ import { LogType, ErrorLevel, ApiResultInfo, + ApiCheckInfo, + ErrorBaseInfo, } from '../../../typedef/checker/result_type'; import { StringConstant } from '../../../utils/Constant'; -import { CompolerOptions, ObtainFullPath } from '../../../utils/checkUtils'; +import { CommonFunctions, CompolerOptions, ObtainFullPath } from '../../../utils/checkUtils'; import { compositiveResult, compositiveLocalResult } from '../../../utils/checkUtils'; export class TsSyntaxCheck { @@ -95,20 +97,8 @@ export class TsSyntaxCheck { result.forEach((item) => { const filePath: string = item.file?.fileName as string; const fileName: string = filePath.substring(filePath.indexOf('api'), filePath.length); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.TS_SYNTAX_ERROR_ID, - ErrorLevel.MIDDLE, - fileName, - ts.getLineAndCharacterOfPosition(node.getSourceFile(), item.start as number), - ErrorType.TS_SYNTAX_ERROR, - LogType.LOG_API, - -1, - 'NA', - 'NA', - item.messageText as string, - tsResult, - checkErrorAllInfos - ); + const apiInfo: ApiCheckInfo = new ApiCheckInfo(); + AddErrorLogs.addAPICheckErrorLogs(apiInfo, compositiveResult, compositiveLocalResult); }); }); } @@ -118,20 +108,16 @@ export class TsSyntaxCheck { if (path.normalize(item.file?.fileName as string) === path.normalize(fileName)) { const filePath: string = item.file?.fileName as string; const fileName: string = filePath.substring(filePath.indexOf('api'), filePath.length); - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.TS_SYNTAX_ERROR_ID, - ErrorLevel.MIDDLE, - fileName, - ts.getLineAndCharacterOfPosition(node.getSourceFile(), item.start as number), - ErrorType.TS_SYNTAX_ERROR, - LogType.LOG_API, - -1, - 'NA', - 'NA', - item.messageText as string, - tsResult, - checkErrorAllInfos - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.TS_SYNTAX_ERROR_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.PARAMETER_ERRORS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(item.messageText as string); + const apiInfoTsCheck: ApiCheckInfo = CommonFunctions.getErrorInfo(undefined, undefined, fileName, + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoTsCheck, compositiveResult, compositiveLocalResult); } }); } diff --git a/build-tools/dts_parser/src/coreImpl/checker/src/words_check.ts b/build-tools/dts_parser/src/coreImpl/checker/src/words_check.ts index 3d3bd53c9..e1c47bc0f 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/src/words_check.ts +++ b/build-tools/dts_parser/src/coreImpl/checker/src/words_check.ts @@ -21,6 +21,8 @@ import { ErrorLevel, ErrorTagFormat, ErrorMessage, + ApiCheckInfo, + ErrorBaseInfo, } from '../../../typedef/checker/result_type'; import { BasicApiInfo } from '../../../typedef/parser/ApiInfoDefination'; import { tagsArrayOfOrder, officialTagArr, CommonFunctions } from '../../../utils/checkUtils'; @@ -85,20 +87,16 @@ export class WordsCheck { state: false, errorInfo: CommonFunctions.createErrorInfo(ErrorMessage.ERROR_WORD, [apiWord, basicWord]), }; - AddErrorLogs.addAPICheckErrorLogs( - ErrorID.MISSPELL_WORDS_ID, - ErrorLevel.MIDDLE, - baseInfo.getFilePath(), - baseInfo.getPos(), - ErrorType.MISSPELL_WORDS, - LogType.LOG_JSDOC, - -1, - baseInfo.getApiName(), - baseInfo.getDefinedText(), - wordsCheckFormat.errorInfo, - compositiveResult, - compositiveLocalResult - ); + const errorBaseInfo: ErrorBaseInfo = new ErrorBaseInfo(); + errorBaseInfo + .setErrorID(ErrorID.MISSPELL_WORDS_ID) + .setErrorLevel(ErrorLevel.MIDDLE) + .setErrorType(ErrorType.MISSPELL_WORDS) + .setLogType(LogType.LOG_JSDOC) + .setErrorInfo(wordsCheckFormat.errorInfo); + const apiInfoSpell: ApiCheckInfo = CommonFunctions.getErrorInfo(baseInfo, undefined, baseInfo.getFilePath(), + errorBaseInfo); + AddErrorLogs.addAPICheckErrorLogs(apiInfoSpell, compositiveResult, compositiveLocalResult); } }); }); diff --git a/build-tools/dts_parser/src/coreImpl/diff/DiffProcessor.ts b/build-tools/dts_parser/src/coreImpl/diff/DiffProcessor.ts index f07ee885f..2c9d2c561 100644 --- a/build-tools/dts_parser/src/coreImpl/diff/DiffProcessor.ts +++ b/build-tools/dts_parser/src/coreImpl/diff/DiffProcessor.ts @@ -25,6 +25,7 @@ import { PropertyInfo, TypeAliasInfo, ClassInfo, + TypeParamInfo, } from '../../typedef/parser/ApiInfoDefination'; import { Comment } from '../../typedef/parser/Comment'; import { @@ -90,7 +91,7 @@ export namespace DiffProcessorHelper { if (jsDocInfo.getSince() !== '-1') { sinceVersion = jsDocInfo.getSince(); return sinceVersion; - } + } } return sinceVersion; } @@ -282,6 +283,9 @@ export namespace DiffProcessorHelper { if (errorCodesStringOfNew === errorCodesStringOfOld) { return undefined; } + if (errorCodesOfOld.length === 0 && errorCodesOfNew.length !== 0) { + return diffTypeInfo.setStatusCode(ApiStatusCode.NEW_ERRORCODE).setDiffType(ApiDiffType.ERROR_CODE_NA_TO_HAVE); + } if (StringUtils.hasSubstring(errorCodesStringOfNew, errorCodesStringOfOld)) { return diffTypeInfo.setStatusCode(ApiStatusCode.NEW_ERRORCODE).setDiffType(ApiDiffType.ERROR_CODE_ADD); } @@ -291,6 +295,26 @@ export namespace DiffProcessorHelper { return diffTypeInfo.setDiffType(ApiDiffType.ERROR_CODE_CHANGE); } + static diffAtomicService( + oldJsDocInfo: Comment.JsDocInfo | undefined, + newJsDocInfo: Comment.JsDocInfo | undefined + ): DiffTypeInfo | undefined { + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + const isAtomicServiceOfOld: boolean | undefined = oldJsDocInfo? oldJsDocInfo.getIsAtomicService() : false; + const isAtomicServiceOfNew: boolean | undefined = newJsDocInfo? newJsDocInfo.getIsAtomicService() : false; + diffTypeInfo + .setStatusCode(ApiStatusCode.ATOMICSERVICE_CHANGE) + .setOldMessage(StringUtils.transformBooleanToTag(isAtomicServiceOfOld, Comment.JsDocTag.ATOMIC_SERVICE)) + .setNewMessage(StringUtils.transformBooleanToTag(isAtomicServiceOfNew, Comment.JsDocTag.ATOMIC_SERVICE)); + if (isAtomicServiceOfOld === isAtomicServiceOfNew) { + return undefined; + } + if (isAtomicServiceOfNew) { + return diffTypeInfo.setDiffType(ApiDiffType.ATOMIC_SERVICE_NA_TO_HAVE); + } + return diffTypeInfo.setDiffType(ApiDiffType.ATOMIC_SERVICE_HAVE_TO_NA); + } + static diffSyscap( oldJsDocInfo: Comment.JsDocInfo | undefined, newJsDocInfo: Comment.JsDocInfo | undefined @@ -619,7 +643,23 @@ export namespace DiffProcessorHelper { } }); } - + static diffTypeAliasReturnType(oldApiInfo: TypeAliasInfo, newApiInfo: TypeAliasInfo): DiffTypeInfo | undefined { + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + const oldReturnType: string[] = oldApiInfo.getReturnType()?.split('|'); + const newReturnType: string[] = newApiInfo.getReturnType()?.split('|'); + const olaMethodTypeStr = oldReturnType.toString().replace(/\r|\n|\s+|'|"/g, ''); + const newMethodTypeStr = newReturnType.toString().replace(/\r|\n|\s+|'|"/g, ''); + if (olaMethodTypeStr === newMethodTypeStr) return; + diffTypeInfo.setOldMessage(olaMethodTypeStr).setNewMessage(newMethodTypeStr); + if (checkParentContainChild(newReturnType, oldReturnType)) { + return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_ADD); + } + if (checkParentContainChild(oldReturnType, newReturnType)) { + return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_REDUCE); + } + // 旧版本不包含新版本,新版本也不含旧版本,就定义为返回值变更 + return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_CHANGE); + } /** * 处理方法节点的返回值 * @@ -629,23 +669,58 @@ export namespace DiffProcessorHelper { */ static diffMethodReturnType(oldApiInfo: MethodInfo, newApiInfo: MethodInfo): DiffTypeInfo | undefined { const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); - const olaMethodType: string[] = oldApiInfo.getReturnValue(); - const newMethodType: string[] = newApiInfo.getReturnValue(); - const olaMethodTypeStr = olaMethodType.toString().replace(/\r|\n|\s+|'|"/g, ''); - const newMethodTypeStr = newMethodType.toString().replace(/\r|\n|\s+|'|"/g, ''); + const oldReturnType: string[] = oldApiInfo.getReturnValue(); + const newReturnType: string[] = newApiInfo.getReturnValue(); + const olaMethodTypeStr = oldReturnType.toString().replace(/\r|\n|\s+|'|"/g, ''); + const newMethodTypeStr = newReturnType.toString().replace(/\r|\n|\s+|'|"/g, ''); if (olaMethodTypeStr === newMethodTypeStr) { return undefined; } diffTypeInfo.setOldMessage(olaMethodTypeStr).setNewMessage(newMethodTypeStr); - if (StringUtils.hasSubstring(newMethodTypeStr, olaMethodTypeStr)) { + if (checkParentContainChild(newReturnType, oldReturnType)) { return diffTypeInfo.setDiffType(ApiDiffType.FUNCTION_RETURN_TYPE_ADD); } - if (StringUtils.hasSubstring(olaMethodTypeStr, newMethodTypeStr)) { + if (checkParentContainChild(oldReturnType, newReturnType)) { return diffTypeInfo.setDiffType(ApiDiffType.FUNCTION_RETURN_TYPE_REDUCE); } + // 旧版本不包含新版本,新版本也不含旧版本,就定义为返回值变更 return diffTypeInfo.setDiffType(ApiDiffType.FUNCTION_RETURN_TYPE_CHANGE); } + /** + * + * @param isTypeAlias 是否为自定义节点类型 + * @returns {*} {DiffMethodType} 当前节点类型对应的修改类型 + */ + static getDiffMethodTypes(isTypeAlias: boolean): DiffMethodType & DiffTypeChangeType { + if (isTypeAlias) { + return { + POS_CHANGE: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_POS_CHAHGE, + ADD_OPTIONAL_PARAM: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_UNREQUIRED_ADD, + ADD_REQUIRED_PARAM: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REQUIRED_ADD, + REDUCE_PARAM: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REDUCE, + PARAM_TYPE_CHANGE: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_CHANGE, + PARAM_TYPE_ADD: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_ADD, + PARAM_TYPE_REDUCE: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_REDUCE, + PARAM_TO_UNREQUIRED: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_UNREQUIRED, + PARAM_TO_REQUIRED: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_REQUIRED, + PARAM_CHANGE: ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_CHANGE, + }; + } else { + return { + POS_CHANGE: ApiDiffType.FUNCTION_PARAM_POS_CHANGE, + ADD_OPTIONAL_PARAM: ApiDiffType.FUNCTION_PARAM_UNREQUIRED_ADD, + ADD_REQUIRED_PARAM: ApiDiffType.FUNCTION_PARAM_REQUIRED_ADD, + REDUCE_PARAM: ApiDiffType.FUNCTION_PARAM_REDUCE, + PARAM_TYPE_CHANGE: ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, + PARAM_TYPE_ADD: ApiDiffType.FUNCTION_PARAM_TYPE_ADD, + PARAM_TYPE_REDUCE: ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, + PARAM_TO_UNREQUIRED: ApiDiffType.FUNCTION_PARAM_TO_UNREQUIRED, + PARAM_TO_REQUIRED: ApiDiffType.FUNCTION_PARAM_TO_REQUIRED, + PARAM_CHANGE: ApiDiffType.FUNCTION_PARAM_CHANGE, + }; + } + } /** * 处理方法节点的参数,获取对应diff信息 * @@ -653,51 +728,302 @@ export namespace DiffProcessorHelper { * @param {MethodInfo} newApiInfo 新版本的方法节点信息 * @return {*} {ApiDiffType[]} 返回各个参数的变化情况 */ - static diffMethodParams(oldApiInfo: MethodInfo, newApiInfo: MethodInfo): DiffTypeInfo[] { + static diffMethodParams( + oldApiInfo: MethodInfo | TypeAliasInfo, + newApiInfo: MethodInfo | TypeAliasInfo + ): DiffTypeInfo[] { const diffTypeInfos: DiffTypeInfo[] = []; - const diffTypes: ApiDiffType[] = []; - const oldMethodParams: ParamInfo[] = oldApiInfo.getParams(); - const newMethodParams: ParamInfo[] = newApiInfo.getParams(); - const diffProcessors: ((oldApiInfo: ParamInfo, newApiInfo: ParamInfo) => ApiDiffType | undefined)[] = [ - ApiNodeDiffHelper.diffMethodParamName, - ApiNodeDiffHelper.diffMethodParamType, - ApiNodeDiffHelper.diffMethodParamRequired, - ]; - const maxLen: number = Math.max(oldMethodParams.length, newMethodParams.length); - // 遍历方法参数列表 - for (let i = 0; i < maxLen; i++) { - const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); - if (i >= oldMethodParams.length) { - const newElement: ParamInfo = newMethodParams[i]; - const oldParamISRequired: boolean = newElement.getIsRequired(); - diffTypeInfo - .setDiffType( - oldParamISRequired ? ApiDiffType.FUNCTION_PARAM_REQUIRED_ADD : ApiDiffType.FUNCTION_PARAM_UNREQUIRED_ADD - ) - .setNewMessage(newElement.getDefinedText()); - diffTypeInfos.push(diffTypeInfo); - continue; - } - if (i >= newMethodParams.length) { - const oldElement: ParamInfo = oldMethodParams[i]; - diffTypeInfo.setDiffType(ApiDiffType.FUNCTION_PARAM_REDUCE).setOldMessage(oldElement.getDefinedText()); - diffTypeInfos.push(diffTypeInfo); - continue; - } - const oldElement: ParamInfo = oldMethodParams[i]; - const newElement: ParamInfo = newMethodParams[i]; - diffTypeInfo.setOldMessage(oldElement.getDefinedText()).setNewMessage(newElement.getDefinedText()); - for (let j = 0; j < diffProcessors.length; j++) { - const apiSceneDiffProcessor = diffProcessors[j]; - const diffType: ApiDiffType | undefined = apiSceneDiffProcessor(oldElement, newElement); - if (!diffType) { - continue; - } - diffTypeInfos.push(diffTypeInfo.setDiffType(diffType)); - } - } + const isTypeAlias: boolean = oldApiInfo.getApiType() === 'TypeAlias'; + const oldMethodParams: ParamInfo[] = isTypeAlias + ? (oldApiInfo as TypeAliasInfo).getParamInfos() + : (oldApiInfo as MethodInfo).getParams(); + const newMethodParams: ParamInfo[] = isTypeAlias + ? (newApiInfo as TypeAliasInfo).getParamInfos() + : (newApiInfo as MethodInfo).getParams(); + const diffMethodType: DiffMethodType & DiffTypeChangeType = ApiNodeDiffHelper.getDiffMethodTypes(isTypeAlias); + + ApiNodeDiffHelper.diffParamsPosition(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffNewOptionalParam(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffNewRequiredParam(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffReducedParam(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffParamTypeChange(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffParamChange(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); + ApiNodeDiffHelper.diffMethodParamChange(oldMethodParams, newMethodParams, diffTypeInfos, diffMethodType); return diffTypeInfos; } + /** + * 方法参数名变化,且不属于新增、减少的情况,归纳为方法参数变化, + * + * @param {ParamInfo[]} oldMethodParams 函数旧参数节点信息 + * @param {ParamInfo[]} newMethodParams 函数新参数节点信息 + * @param diffTypeInfos 处理好的结果信息 + */ + static diffMethodParamChange( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + // 1.新旧版本参数一个不存在即不符合,直接返回 + if (!oldParamLen || !newParamLen) return; + // 2. 判断新旧版本参数名称相同的参数的个数和新旧版本的参数是否相同,相同即为新增或者减少参数 + // 2.1 循环得到所有的参数名称 + const oldParamNames: string[] = [], + newParamNames: string[] = []; + for (let i: number = 0; i < Math.max(oldParamLen, newParamLen); i++) { + const newCur: ParamInfo = newMethodParams[i]; + const oldCur: ParamInfo = oldMethodParams[i]; + newCur && newParamNames.push(newCur.getApiName()); + oldCur && oldParamNames.push(oldCur.getApiName()); + } + // 2.2 找出旧版本不同的参数名称 + const oldDiffParams: ParamInfo[] = oldMethodParams.filter( + (oldParam: ParamInfo) => !newParamNames.includes(oldParam.getApiName()) + ); + // 2.3 得到参数相同的个数 + const sameParamsLength: number = oldParamLen - oldDiffParams.length; + // 2.4 判断新旧版本参数名称相同的参数的个数和新旧版本的参数是否相同,相同即为新增或者减少参数 + if (sameParamsLength === oldParamLen || sameParamsLength === newParamLen) return; + + let oldDiffInfos: ParamInfo[] = oldMethodParams; + let newDiffInfos: ParamInfo[] = newMethodParams; + // 3.将新旧版本参数信息中前面检查出来的信息去掉 + diffTypeInfos.forEach((diffInfo: DiffTypeInfo) => { + // 循环已经得到的结果信息,找到新旧版本里不在已经得到的结果信息里面的参数信息 + oldDiffInfos = oldDiffInfos.filter( + (oldDiffInfo: ParamInfo) => diffInfo.getOldMessage() !== oldDiffInfo.getDefinedText() + ); + newDiffInfos = newDiffInfos.filter( + (newDiffInfo: ParamInfo) => diffInfo.getNewMessage() !== newDiffInfo.getDefinedText() + ); + }); + // 4.剩下的部分就是发生变化的部分,生成返回信息 + const oldNamesStr: string = stitchMethodParameters(oldDiffInfos); + const newNamesStr: string = stitchMethodParameters(newDiffInfos); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(diffMethodType.PARAM_CHANGE).setOldMessage(oldNamesStr).setNewMessage(newNamesStr); + diffTypeInfos.push(diffTypeInfo); + } + /** + * 比较函数位置发生变化 + * + * @param {ParamInfo[]} oldMethodParams 函数旧参数节点信息 + * @param {ParamInfo[]} newMethodParams 函数新参数节点信息 + * @param diffTypeInfos + */ + static diffParamsPosition( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + // 1.如果旧版本的参数长度不大于1,或者两者长度不一致,直接返回 + if (oldParamLen <= 1 || oldParamLen !== newParamLen) return; + // 2.判断两个版本的相同位置的参数名称是否一致,相同直接返回 + const isSamePosition: boolean = checkIsSameOfSamePosition(newMethodParams, oldMethodParams); + if (isSamePosition) return; + // 3.如果旧版本的参数不完全包含新版本的参数或者两个版本的参数是否完全一致,一个不符合直接返回 + const isContain: boolean = checkIsContain(oldMethodParams, newMethodParams); + if (!isContain) return; + // 4.上述情况都不符合,处理返回信息 + const oldNamesStr: string = stitchMethodParameters(oldMethodParams); + const newNamesStr: string = stitchMethodParameters(newMethodParams); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(diffMethodType.POS_CHANGE).setOldMessage(oldNamesStr).setNewMessage(newNamesStr); + diffTypeInfos.push(diffTypeInfo); + } + + + /** + * 函数新增可选参数 + * + * @param oldMethodParams + * @param newMethodParams + * @param diffTypeInfos + */ + static diffNewOptionalParam( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + // 1.如果新版本参数为空或者旧版本参数长度大于或者等于新版本参数长度,直接返回 + if (newParamLen === 0 || oldParamLen >= newParamLen) return; + // 2.新版本参数需要完全包含旧版本,如果不包含,直接返回 + const isContain: boolean = checkIsContain(newMethodParams, oldMethodParams); + if (!isContain) return; + // 3.是否存在新增的可选参数 + const oldParamNames: string[] = oldMethodParams.map((oldParam: ParamInfo) => oldParam.getApiName()); + const addParams: ParamInfo[] = newMethodParams.filter((newParam: ParamInfo) => { + const curParamName: string = newParam.getApiName(); + return !oldParamNames.includes(curParamName) && !newParam.getIsRequired(); + }); + // 4.新版本新增的参数是否存在参数是可选类型,不存在直接返回 + if (!addParams.length) return; + // 5.存在新增的参数是可选参数,处理返回信息 + const addParamNamesStr: string = stitchMethodParameters(addParams); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setOldMessage('').setDiffType(diffMethodType.ADD_OPTIONAL_PARAM).setNewMessage(addParamNamesStr); + diffTypeInfos.push(diffTypeInfo); + } + + /** + * 函数新增必选参数 + * + * @param oldMethodParams + * @param newMethodParams + * @param diffTypeInfos + */ + static diffNewRequiredParam( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + // 1.如果新版本参数为空或者旧版本参数长度大于或者等于新版本参数长度,直接返回 + if (newParamLen === 0 || oldParamLen >= newParamLen) return; + // 2.新版本参数需要完全包含旧版本,如果不包含,直接返回 + const isContain: boolean = checkIsContain(newMethodParams, oldMethodParams); + if (!isContain) return; + // 3.是否存在新增的必选参数 + const oldParamNames: string[] = oldMethodParams.map((oldParam: ParamInfo) => oldParam.getApiName()); + const addParams: ParamInfo[] = newMethodParams.filter((newParam: ParamInfo) => { + const curParamName: string = newParam.getApiName(); + return !oldParamNames.includes(curParamName) && newParam.getIsRequired(); + }); + // 4.新版本新增的参数是否存在参数是必选类型,不存在直接返回 + if (!addParams.length) return; + // 5.存在新增的参数是可选参数,处理返回信息 + const addParamNamesStr: string = stitchMethodParameters(addParams); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(diffMethodType.ADD_REQUIRED_PARAM).setOldMessage('').setNewMessage(addParamNamesStr); + diffTypeInfos.push(diffTypeInfo); + } + + /** + * 函数删除参数 + * + * @param oldMethodParams + * @param newMethodParams + * @param diffTypeInfos + */ + static diffReducedParam( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + // 1.旧版本参数为空或者新版本参数长度大于或者等于旧版本参数长度,直接返回 + if (oldParamLen === 0 || newParamLen >= oldParamLen) return; + // 2.如果旧版本的参数不包含新版本的参数,直接返回 + const isContain: boolean = checkIsContain(oldMethodParams, newMethodParams); + if (newParamLen > 0 && !isContain) return; + // 3.参数减少,处理返回信息 + const newParamNames: string[] = newMethodParams.map((newParam: ParamInfo) => newParam.getApiName()); + const reduceParams: ParamInfo[] = oldMethodParams.filter( + (oldParam: ParamInfo) => !newParamNames.includes(oldParam.getApiName()) + ); + const reduceNamesStr: string = stitchMethodParameters(reduceParams); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(diffMethodType.REDUCE_PARAM).setOldMessage(reduceNamesStr).setNewMessage(''); + diffTypeInfos.push(diffTypeInfo); + } + /** + * 比较参数必选/可选的变更,(可选->必选,必选->可选) + * + * @param oldMethodParams + * @param newMethodParams + * @param diffTypeInfos + */ + static diffParamChange( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType + ) { + // 1.新旧版本的参数长度应大于0 + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + if (!oldParamLen || !newParamLen) return; + // 2.找到参数名称一致和参数类型一致的参数进行比较,不存在直接返回 + const sameParamInfos: ParamInfo[] = oldMethodParams.filter((oldParam: ParamInfo) => { + const oldParamName: string = oldParam.getApiName(); + return newMethodParams.find((newParam: ParamInfo) => newParam.getApiName() === oldParamName); + }); + if (!sameParamInfos.length) return; + // 3.比较参数名和类型一致是否发生了可选/必选的变化,参数类型不需要计较 + sameParamInfos.forEach((sameInfo: ParamInfo, idx: number) => { + const curOldParamName: string = sameInfo.getApiName(); + const curNewParam: ParamInfo = newMethodParams.find( + (newParam: ParamInfo) => newParam.getApiName() === curOldParamName + )!; + if (curNewParam.getIsRequired() !== sameInfo.getIsRequired()) { + // 参数发生了可选/必选的变化,处理返回信息 + const oldMessage = sameInfo.getDefinedText(); + const newMessage = curNewParam.getDefinedText(); + const changeType: number = sameInfo.getIsRequired() + ? diffMethodType.PARAM_TO_UNREQUIRED + : diffMethodType.PARAM_TO_REQUIRED; + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(changeType).setOldMessage(oldMessage).setNewMessage(newMessage); + diffTypeInfos.push(diffTypeInfo); + } + }); + } + + /** + * 比较参数类型的变更,(参数类型范围扩大/参数类型范围缩小/参数类型变更) + * + * @param oldMethodParams + * @param newMethodParams + * @param diffTypeInfos + */ + static diffParamTypeChange( + oldMethodParams: ParamInfo[], + newMethodParams: ParamInfo[], + diffTypeInfos: DiffTypeInfo[], + diffMethodType: DiffMethodType & DiffTypeChangeType + ) { + //1.判断新旧版本参数长度大于0 + const oldParamLen: number = oldMethodParams.length; + const newParamLen: number = newMethodParams.length; + if (!oldParamLen || !newParamLen) return; + const newParamName: string[] = newMethodParams.map((newParam: ParamInfo) => newParam.getApiName()); + // 2.需要新旧版本存在参数名称一致的,不存在直接返回 + const sameParamInfo: ParamInfo[] = oldMethodParams.filter((oldParam: ParamInfo) => + newParamName.includes(oldParam.getApiName()) + ); + if (!sameParamInfo.length) return; + // 3.寻找参数名称相同的情况下的参数类型变化的 + sameParamInfo.forEach((curSame: ParamInfo, idx: number) => { + const oldParamTypes: string[] = curSame.getType(); + const curNewParam: ParamInfo = newMethodParams.find( + (newParam: ParamInfo) => newParam.getApiName() === curSame.getApiName() + )!; + const newParamTypes: string[] = curNewParam.getType(); + // 处理参数类型不一样的,生成返回信息 + if (oldParamTypes.toString() !== newParamTypes.toString()) { + // 根据参数的差异来获取对应的statusCode + const diffType: number = diffChangeType(oldParamTypes, newParamTypes, diffMethodType); + const oldMessage: string = curSame.getDefinedText(); + const newMessage: string = curNewParam.getDefinedText(); + const diffTypeInfo: DiffTypeInfo = new DiffTypeInfo(); + diffTypeInfo.setDiffType(diffType).setOldMessage(oldMessage).setNewMessage(newMessage); + diffTypeInfos.push(diffTypeInfo); + } + }); + } + /** * 处理方法节点的参数名称 @@ -970,10 +1296,30 @@ export namespace DiffProcessorHelper { const diffInfo: BasicDiffInfo = DiffProcessorHelper.wrapDiffInfo(oldApiInfo, newApiInfo, diffTypeInfo); diffInfos.push(diffInfo); }); + // 自定义类型为方法 + if ((oldApiInfo as TypeAliasInfo).getTypeIsFunction()) { + const diffTypeInfos: DiffTypeInfo[] = ApiNodeDiffHelper.diffMethodParams( + oldApiInfo as TypeAliasInfo, + newApiInfo as TypeAliasInfo + ); + const diffTypeReturnInfo: DiffTypeInfo | undefined = ApiNodeDiffHelper.diffTypeAliasReturnType( + oldApiInfo as TypeAliasInfo, + newApiInfo as TypeAliasInfo + ); + diffTypeReturnInfo && diffTypeInfos.push(diffTypeReturnInfo); + diffTypeInfos.forEach((info: DiffTypeInfo) => { + const diffInfo: BasicDiffInfo = DiffProcessorHelper.wrapDiffInfo( + oldApiInfo, + newApiInfo, + info.setStatusCode(ApiStatusCode.TYPE_CHNAGES) + ); + diffInfos.push(diffInfo); + }); + } } /** - * 处理自定义类型节点的类型 + * 处理自定义类型节点的类型(类型值范围扩大/类型值范围缩小/类型值改变) * * @param {TypeAliasInfo} oldApiInfo 旧版本的自定义类型节点信息 * @param {TypeAliasInfo} newApiInfo 新版本的自定义类型节点信息 @@ -985,19 +1331,24 @@ export namespace DiffProcessorHelper { const newTypeAliasType: string[] = newApiInfo.getType(); const olaTypeAliasTypeStr: string = olaTypeAliasType.toString(); const newTypeAliasTypeStr: string = newTypeAliasType.toString(); - if (olaTypeAliasTypeStr === newTypeAliasTypeStr) { - return undefined; - } - diffTypeInfo.setOldMessage(olaTypeAliasTypeStr).setNewMessage(newTypeAliasTypeStr); - if (StringUtils.hasSubstring(newTypeAliasTypeStr, olaTypeAliasTypeStr)) { - return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_ADD); - } - if (StringUtils.hasSubstring(olaTypeAliasTypeStr, newTypeAliasTypeStr)) { - return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_REDUCE); - } - return diffTypeInfo.setDiffType(ApiDiffType.TYPE_ALIAS_CHANGE); + // 1.两者定义相同,没有变化 + if (olaTypeAliasTypeStr === newTypeAliasTypeStr) return; + // 自定义函数类型 + if (oldApiInfo.getTypeIsFunction()) return; + // 2.两者定义不同 + const diffMethodType: DiffTypeChangeType = { + PARAM_TYPE_CHANGE: ApiDiffType.TYPE_ALIAS_CHANGE, + PARAM_TYPE_ADD: ApiDiffType.TYPE_ALIAS_ADD, + PARAM_TYPE_REDUCE: ApiDiffType.TYPE_ALIAS_REDUCE, + }; + const diffType: number = diffChangeType(olaTypeAliasType, newTypeAliasType, diffMethodType); + diffTypeInfo + .setOldMessage(olaTypeAliasType.join(' | ')) + .setNewMessage(newTypeAliasType.join(' | ')) + .setStatusCode(ApiStatusCode.TYPE_CHNAGES) + .setDiffType(diffType); + return diffTypeInfo; } - /** * 处理枚举值节点,获取对应diff信息 * @@ -1080,6 +1431,101 @@ export namespace DiffProcessorHelper { } } + /** + * 检查父集是否完全包含子集 + * + * @param {ParamInfo[]} parentInfos 父集节点信息 + * @param {ParamInfo[]} childInfos 子集节点信息 + * @returns {*} {boolean} 完全包含为true, 否则为false + */ + function checkIsContain(parentInfos: ParamInfo[], childInfos: ParamInfo[]): boolean { + return childInfos.every((child: ParamInfo) => { + const curChildName = child.getApiName(); + // 父节点里面是否存在子节点的参数名称 + const curParentNode = parentInfos.find((item: ParamInfo) => item.getApiName() === curChildName); + // 相同参数的类型是否一样 + return curParentNode && curParentNode.getApiType() === child.getApiType(); + }); + } + + function checkParentContainChild(parentStrArr: string[], childStrArr: string[]): boolean { + return childStrArr.every((child: string) => parentStrArr.includes(child)); + } + + interface DiffTypeChangeType { + PARAM_TYPE_CHANGE: ApiDiffType; + PARAM_TYPE_ADD: ApiDiffType; + PARAM_TYPE_REDUCE: ApiDiffType; + } + // statusCode对应的几种变化类型 + interface DiffMethodType { + POS_CHANGE: ApiDiffType; + ADD_OPTIONAL_PARAM: ApiDiffType; + ADD_REQUIRED_PARAM: ApiDiffType; + REDUCE_PARAM: ApiDiffType; + PARAM_TO_UNREQUIRED: ApiDiffType; + PARAM_TO_REQUIRED: ApiDiffType; + PARAM_CHANGE: ApiDiffType; + } + /** + * 根据参数的差异来获取对应的statusCode + * + * @param {string[]} oldTypes 旧参数数组 + * @param {string[]} newTypes 新参数数组 + * @returns {*} {ApiDiffType} statusCode + */ + function diffChangeType(oldTypes: string[], newTypes: string[], diffTypes: DiffTypeChangeType): ApiDiffType { + const oldLen: number = oldTypes.length; + const newLen: number = newTypes.length; + switch (oldLen - newLen) { + case 0: + return diffTypes.PARAM_TYPE_CHANGE; + case -newLen: + return diffTypes.PARAM_TYPE_ADD; + case oldLen: + return diffTypes.PARAM_TYPE_REDUCE; + default: + if (oldLen > newLen) { + return newTypes.every((type: string) => oldTypes.includes(type)) + ? diffTypes.PARAM_TYPE_REDUCE + : diffTypes.PARAM_TYPE_CHANGE; + } else { + return oldTypes.every((type: string) => newTypes.includes(type)) + ? diffTypes.PARAM_TYPE_ADD + : diffTypes.PARAM_TYPE_CHANGE; + } + } + } + /** + * 检查两个版本的相同位置的参数的参数名是否相同 + * + * @param {ParamInfo[]} parentInfos 父节点信息 + * @param {ParamInfo[]} childInfos 子集节点信息 + * @returns {*} {boolean} 完全相同为true, 否则为false + */ + function checkIsSameOfSamePosition(parentInfos: ParamInfo[], childInfos: ParamInfo[]): boolean { + return parentInfos.every((curParentItem: ParamInfo, idx: number) => { + const curChildItem: ParamInfo = childInfos[idx]; + return curParentItem.getApiName() === curChildItem.getApiName(); + }); + } + + /** + * 根据当前节点信息来拼接返回的新旧信息 + * + * @param {ParamInfo} methodParams 函数参数的节点信息 + * @returns {*} {string} 字符串拼接后的节点信息 + */ + function stitchMethodParameters(methodParams: ParamInfo[]): string { + return methodParams.reduce((preStr: string, curItem: ParamInfo, idx: number) => { + let curStr: string = curItem.getDefinedText(); + if (idx !== methodParams.length - 1) { + curStr += ', '; + } + return (preStr += curStr); + }, ''); + } + /** * 根据节点信息和type生成需要的diff对象 * @@ -1093,6 +1539,15 @@ export namespace DiffProcessorHelper { newApiInfo: BasicApiInfo | undefined = undefined, diffTypeInfo: DiffTypeInfo ): BasicDiffInfo { + const newPropertyInfo = newApiInfo as PropertyInfo; + let isCompatible = true; + if ( + newApiInfo?.getParentApiType() === ApiType.INTERFACE && diffTypeInfo.getDiffType() === ApiDiffType.ADD && + ((newApiInfo?.getApiType() === ApiType.PROPERTY && newPropertyInfo.getIsRequired()) || + newApiInfo?.getApiType() === ApiType.METHOD) + ) { + isCompatible = false; + } const diffInfo: BasicDiffInfo = new BasicDiffInfo(); const diffType: ApiDiffType = diffTypeInfo.getDiffType(); if (oldApiInfo) { @@ -1104,8 +1559,8 @@ export namespace DiffProcessorHelper { diffInfo .setDiffType(diffType) .setDiffMessage(diffMap.get(diffType) as string) - .setIsCompatible(!incompatibleApiDiffTypes.has(diffType)) .setStatusCode(diffTypeInfo.getStatusCode()) + .setIsCompatible(!isCompatible ? false: !incompatibleApiDiffTypes.has(diffType)) .setOldDescription(diffTypeInfo.getOldMessage()) .setNewDescription(diffTypeInfo.getNewMessage()); return diffInfo; diff --git a/build-tools/dts_parser/src/coreImpl/parser/NodeProcessor.ts b/build-tools/dts_parser/src/coreImpl/parser/NodeProcessor.ts index 737cd36b3..12413aadf 100644 --- a/build-tools/dts_parser/src/coreImpl/parser/NodeProcessor.ts +++ b/build-tools/dts_parser/src/coreImpl/parser/NodeProcessor.ts @@ -276,11 +276,18 @@ export class NodeProcessorHelper { if ( ts.isInterfaceDeclaration(node) || ts.isClassDeclaration(node) || - ts.isEnumDeclaration(node) || - ts.isStructDeclaration(node) + ts.isEnumDeclaration(node) ) { return node.members; } + if (ts.isStructDeclaration(node)) { + return ts.visitNodes(node.members, (node) => { + if (ts.isConstructorDeclaration(node)) { + return + } + return node + }) + } if (ts.isTypeAliasDeclaration(node) && ts.isTypeLiteralNode(node.type)) { return node.type.members; } @@ -958,9 +965,10 @@ export class NodeProcessorHelper { if (ts.isFunctionTypeNode(nodeType)) { const typeParameters = nodeType.parameters; typeParameters.forEach((typeParameter: ts.ParameterDeclaration) => { - const typeParamInfo: TypeParamInfo = new TypeParamInfo(); - typeParamInfo.setParamName(typeParameter.name.getText()); - typeParamInfo.setParamType(typeParameter.type?.getText()); + const typeParamInfo: ParamInfo = NodeProcessorHelper.processParam( + typeParameter, + new MethodInfo(ApiType.METHOD, node, parentApi) + ); typeAliasInfo.setParamInfos(typeParamInfo); }); typeAliasInfo.setReturnType(nodeType.type.getText()); diff --git a/build-tools/dts_parser/src/typedef/checker/result_type.ts b/build-tools/dts_parser/src/typedef/checker/result_type.ts index 0adf0de81..e09023f70 100644 --- a/build-tools/dts_parser/src/typedef/checker/result_type.ts +++ b/build-tools/dts_parser/src/typedef/checker/result_type.ts @@ -1,22 +1,23 @@ /* * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ +import ts from 'typescript'; import { ApiDiffType } from '../../typedef/diff/ApiInfoDiff'; /** - * error message type + * error message type * @enum { string } */ export enum ErrorType { @@ -127,7 +128,7 @@ export enum ErrorMessage { ERROR_USE_INTERFACE = 'The validity verification of the JSDoc tag failed. The [interface] tag and [typedef] tag are not allowed to be used simultaneously. Please confirm the interface class.', ERROR_EVENT_NAME_STRING = 'The event name should be string.', ERROR_EVENT_NAME_NULL = 'The event name cannot be Null value.', - ERROR_EVENT_NAME_SMALL_HUMP = "The event name should be named by small hump. (Received ['$$']).", + ERROR_EVENT_NAME_SMALL_HUMP = 'The event name should be named by small hump. (Received ["$$"]).', ERROR_EVENT_CALLBACK_OPTIONAL = 'The callback parameter of off function should be optional.', ERROR_EVENT_CALLBACK_MISSING = 'The off functions of one single event should have at least one callback parameter, and the callback parameter should be the last parameter.', ERROR_EVENT_ON_AND_OFF_PAIR = 'The on and off event subscription methods do not appear in pair.', @@ -143,66 +144,101 @@ export enum ErrorMessage { ERROR_SMALL_HUMP_NAME_FILE = 'This API file should be named by small hump.', ERROR_LARGE_HUMP_NAME_FILE = 'This API file should be named by large hump.', ERROR_ANONYMOUS_FUNCTION ='Anonymous functions or anonymous object that are not allowed are used in this api.', - ERROR_CHANGES_JSDOC_LEVEL = 'Forbid changes: API defectLevel change to system.', - ERROR_CHANGES_JSDOC_MODEL = 'Forbid changes: API mode change.', - ERROR_CHANGES_JSDOC_CARD = 'Forbid changes: API card delete.', - ERROR_CHANGES_JSDOC_CROSS_PLATFORM = 'Forbid changes: API crossplatform delete.', - ERROR_CHANGES_JSDOC_ERROR_CODE = 'Forbid changes: API errorcode cannot be created or modified.', - ERROR_CHANGES_JSDOC_PERMISSION = 'Forbid changes: Permission tag cannot be created or modified.', - ERROR_CHANGES_API_NAME = 'Forbid changes: API cannot be changed.', - ERROR_CHANGES_FUNCTION_RETURN_TYPE = 'Forbid changes: Function return type cannot be changed.', - ERROR_CHANGES_API_PARAM = 'Forbid changes: Parameters cannot be changed.', - ERROR_CHANGES_PROPERTY = 'Forbid changes: Property cannot be changed.', - ERROR_CHANGES_CONSTANT = 'Forbid changes: Constant value cannot be changed.', - ERROR_CHANGES_TYPE_ALIAS = 'Forbid changes: Type alias cannot be changed.', - ERROR_CHANGES_ENUM_MEMBER = 'Forbid changes: Enum number value cannot be changed.', - ERROR_CHANGES_API = 'Forbid changes: API cannot be deleted.', - ERROR_CHANGES_JSDOC_CHANGE = 'Forbid changes: Historical JSDoc cannot be changed.', - ERROR_CHANGES_JSDOC_NUMBER = 'Forbid changes: API changes must add a new section of JSDoc.', ERROR_NO_JSDOC = 'Jsdoc needs to be added to the current API.', ERROR_NO_JSDOC_TAG = 'add tags to the Jsdoc.', ERROR_HAS_CHINESE= 'Jsdoc has chinese.', - ERROR_ERROR_CODE = 'The generic error code does not contain the current error code.' + ERROR_ERROR_CODE = 'The generic error code does not contain the current error code.', + ERROR_CHANGES_JSDOC_LEVEL = 'Forbid changes: Cannot change from public API to system API.', + ERROR_CHANGES_JSDOC_PERMISSION_RANGE = 'Forbid changes: Cannot reduce or permission or increase and permission.', + ERROR_CHANGES_JSDOC_PERMISSION_VALUE = 'Forbid changes: Cannot change permission value,cannot judge the range change.', + ERROR_CHANGES_JSDOC_ERROR_CODE_ADD = 'Forbid changes: The number of error codes cannot be increased from 0 to multiple error codes.', + ERROR_CHANGES_JSDOC_ERROR_CODE_VALUE = 'Forbid changes: Cannot change the error code value.', + ERROR_CHANGES_JSDOC_CARD = 'Forbid changes: The card application cannot be changed from supported to not supported.', + ERROR_CHANGES_JSDOC_CROSS_PLATFORM = 'Forbid changes: Crossplatform cannot be changed from supported to not supported.', + ERROR_CHANGES_JSDOC_API_DELETE = 'Forbid changes: API cannot be deleted.', + ERROR_CHANGES_JSDOC_FA_TO_STAGE = 'Forbid changes: Cannot change from FAModelOnly to StageModelOnly.', + ERROR_CHANGES_JSDOC_STAGE_TO_FA = 'Forbid changes: Cannot change from StageModelOnly to FAModelOnly.', + ERROR_CHANGES_JSDOC_NA_TO_STAGE = 'Forbid changes: Cannot change from nothing to StageModelOnly.', + ERROR_CHANGES_JSDOC_NA_TO_FA = 'Forbid changes: Cannot change from nothing to FAModelOnly.', + ERROR_CHANGES_FUNCTION_RETURN_TYPE_ADD = 'Forbid changes: The function return value type cannot be extended.', + ERROR_CHANGES_FUNCTION_RETURN_TYPE_REDUCE = 'Forbid changes: The function return value type cannot be reduced.', + ERROR_CHANGES_FUNCTION_RETURN_TYPE_CHANGE = 'Forbid changes: Cannot change function return value type.', + ERROR_CHANGES_FUNCTION_PARAM_POS_CHANGE = 'Forbid changes: Cannot change function param position.', + ERROR_CHANGES_FUNCTION_PARAM_REQUIRED_ADD = 'Forbid changes: Cannot add function required param.', + ERROR_CHANGES_FUNCTION_PARAM_REDUCE = 'Forbid changes: Cannot delete function param.', + ERROR_CHANGES_FUNCTION_PARAM_TO_REQUIRED = 'Forbid changes: Cannot change form unrequired param to required param.', + ERROR_CHANGES_FUNCTION_PARAM_TYPE = 'Forbid changes: Cannot change function param type.', + ERROR_CHANGES_FUNCTION_PARAM_TYPE_REDUCE = 'Forbid changes: The function param type range is cannot be reduced.', + ERROR_CHANGES_PROPERTY_READONLY_TO_REQUIRED = 'Forbid changes: Read-only properties cannot be changed from optional to required.', + ERROR_CHANGES_PROPERTY_WRITABLE_TO_UNREQUIRED = 'Forbid changes: Writable properties cannot be changed from required to optional.', + ERROR_CHANGES_PROPERTY_WRITABLE_TO_REQUIRED = 'Forbid changes: Writable properties cannot be changed from optional to required.', + ERROR_CHANGES_PROPERTY_TYPE_CHANGE = 'Forbid changes: Cannot change property type.', + ERROR_CHANGES_PROPERTY_READONLY_ADD = 'Forbid changes: Cannot Expand the range of readonly property types.', + ERROR_CHANGES_PROPERTY_WRITABLE_ADD = 'Forbid changes: Cannot Expand the range of writable property types.', + ERROR_CHANGES_PROPERTY_WRITABLE_REDUCE = 'Forbid changes: Cannot reduce the range of writable property types.', + ERROR_CHANGES_DELETE_DECORATOR = 'Forbid changes: Decorator cannot be deleted.', + ERROR_CHANGES_CONSTANT_VALUE = 'Forbid changes: Cannot change constant value.', + ERROR_CHANGES_TYPE_ALIAS_VALUE = 'Forbid changes: Cannot change custom type value.', + ERROR_CHANGES_TYPE_ALIAS_ADD = 'Forbid changes: Cannot expand the range of custom type.', + ERROR_CHANGES_TYPE_ALIAS_REDUCE = 'Forbid changes: Cannot reduce the range of custom type.', + ERROR_CHANGES_ENUM_MEMBER_VALUE = 'Forbid changes: Cannot change Enumeration assignment.', + ERROR_CHANGES_JSDOC_CHANGE = 'Forbid changes: Historical JSDoc cannot be changed.', + ERROR_CHANGES_JSDOC_NUMBER = 'Forbid changes: API changes must add a new section of JSDoc.', } -export const incompatibleApiDiffTypes: Map = new Map([ - [ApiDiffType.PUBLIC_TO_SYSTEM, ErrorMessage.ERROR_CHANGES_JSDOC_LEVEL], - [ApiDiffType.NA_TO_STAGE, ErrorMessage.ERROR_CHANGES_JSDOC_MODEL], - [ApiDiffType.NA_TO_FA, ErrorMessage.ERROR_CHANGES_JSDOC_MODEL], - [ApiDiffType.FA_TO_STAGE, ErrorMessage.ERROR_CHANGES_JSDOC_MODEL], - [ApiDiffType.STAGE_TO_FA, ErrorMessage.ERROR_CHANGES_JSDOC_MODEL], - [ApiDiffType.CARD_TO_NA, ErrorMessage.ERROR_CHANGES_JSDOC_CARD], - [ApiDiffType.CROSS_PLATFORM_TO_NA, ErrorMessage.ERROR_CHANGES_JSDOC_CROSS_PLATFORM], - [ApiDiffType.ERROR_CODE_NA_TO_HAVE, ErrorMessage.ERROR_CHANGES_JSDOC_ERROR_CODE], - [ApiDiffType.ERROR_CODE_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_ERROR_CODE], - [ApiDiffType.PERMISSION_NA_TO_HAVE, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION], - [ApiDiffType.PERMISSION_RANGE_SMALLER, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION], - [ApiDiffType.PERMISSION_RANGE_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION], - [ApiDiffType.API_NAME_CHANGE, ErrorMessage.ERROR_CHANGES_API_NAME], - [ApiDiffType.FUNCTION_RETURN_TYPE_ADD, ErrorMessage.ERROR_CHANGES_FUNCTION_RETURN_TYPE], - [ApiDiffType.FUNCTION_RETURN_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_FUNCTION_RETURN_TYPE], - [ApiDiffType.FUNCTION_PARAM_POS_CHANGE, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.FUNCTION_PARAM_REQUIRED_ADD, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.FUNCTION_PARAM_REDUCE, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.FUNCTION_PARAM_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, ErrorMessage.ERROR_CHANGES_API_PARAM], - [ApiDiffType.PROPERTY_READONLY_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_WRITABLE_TO_UNREQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_WRITABLE_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_READONLY_ADD, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_WRITABLE_ADD, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.PROPERTY_WRITABLE_REDUCE, ErrorMessage.ERROR_CHANGES_PROPERTY], - [ApiDiffType.CONSTANT_VALUE_CHANGE, ErrorMessage.ERROR_CHANGES_CONSTANT], - [ApiDiffType.TYPE_ALIAS_CHANGE, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS], - [ApiDiffType.TYPE_ALIAS_ADD, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS], - [ApiDiffType.TYPE_ALIAS_REDUCE, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS], - [ApiDiffType.ENUM_MEMBER_VALUE_CHANGE, ErrorMessage.ERROR_CHANGES_ENUM_MEMBER], - [ApiDiffType.REDUCE, ErrorMessage.ERROR_CHANGES_API], - [ApiDiffType.HISTORICAL_JSDOC_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_CHANGE], - [ApiDiffType.HISTORICAL_API_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_NUMBER], -]); +export const incompatibleApiDiffTypes: Map = new Map( + [ + [ApiDiffType.HISTORICAL_JSDOC_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_CHANGE], + [ApiDiffType.HISTORICAL_API_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_NUMBER], + // 1.访问级别变更 + [ApiDiffType.PUBLIC_TO_SYSTEM, ErrorMessage.ERROR_CHANGES_JSDOC_LEVEL], + // 2.权限变更 + [ApiDiffType.PERMISSION_NA_TO_HAVE, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION_VALUE], + [ApiDiffType.PERMISSION_RANGE_SMALLER, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION_RANGE], + [ApiDiffType.PERMISSION_RANGE_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_PERMISSION_VALUE], + // 3.错误码变更 + [ApiDiffType.ERROR_CODE_NA_TO_HAVE, ErrorMessage.ERROR_CHANGES_JSDOC_ERROR_CODE_ADD], + [ApiDiffType.ERROR_CODE_CHANGE, ErrorMessage.ERROR_CHANGES_JSDOC_ERROR_CODE_VALUE], + // 4.是否支持卡片应用 + [ApiDiffType.CARD_TO_NA, ErrorMessage.ERROR_CHANGES_JSDOC_CARD], + // 5.是否支持跨平台 + [ApiDiffType.CROSS_PLATFORM_TO_NA, ErrorMessage.ERROR_CHANGES_JSDOC_CROSS_PLATFORM], + // 7.api删除 + [ApiDiffType.REDUCE, ErrorMessage.ERROR_CHANGES_JSDOC_API_DELETE], + // 8.模型使用限制变更 + [ApiDiffType.FA_TO_STAGE, ErrorMessage.ERROR_CHANGES_JSDOC_FA_TO_STAGE], + [ApiDiffType.STAGE_TO_FA, ErrorMessage.ERROR_CHANGES_JSDOC_STAGE_TO_FA], + [ApiDiffType.NA_TO_STAGE, ErrorMessage.ERROR_CHANGES_JSDOC_NA_TO_STAGE], + [ApiDiffType.NA_TO_FA, ErrorMessage.ERROR_CHANGES_JSDOC_NA_TO_FA], + // 10.函数变更 + [ApiDiffType.FUNCTION_RETURN_TYPE_ADD, ErrorMessage.ERROR_CHANGES_FUNCTION_RETURN_TYPE_ADD], + [ApiDiffType.FUNCTION_RETURN_TYPE_REDUCE, ErrorMessage.ERROR_CHANGES_FUNCTION_RETURN_TYPE_REDUCE], + [ApiDiffType.FUNCTION_RETURN_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_FUNCTION_RETURN_TYPE_CHANGE], + [ApiDiffType.FUNCTION_PARAM_POS_CHANGE, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_POS_CHANGE], + [ApiDiffType.FUNCTION_PARAM_REQUIRED_ADD, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_REQUIRED_ADD], + [ApiDiffType.FUNCTION_PARAM_REDUCE, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_REDUCE], + [ApiDiffType.FUNCTION_PARAM_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_TO_REQUIRED], + [ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_TYPE], + [ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, ErrorMessage.ERROR_CHANGES_FUNCTION_PARAM_TYPE_REDUCE], + // 12.属性变更 + [ApiDiffType.PROPERTY_READONLY_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY_READONLY_TO_REQUIRED], + [ApiDiffType.PROPERTY_WRITABLE_TO_UNREQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY_WRITABLE_TO_UNREQUIRED], + [ApiDiffType.PROPERTY_WRITABLE_TO_REQUIRED, ErrorMessage.ERROR_CHANGES_PROPERTY_WRITABLE_TO_REQUIRED], + [ApiDiffType.PROPERTY_TYPE_CHANGE, ErrorMessage.ERROR_CHANGES_PROPERTY_TYPE_CHANGE], + [ApiDiffType.PROPERTY_READONLY_ADD, ErrorMessage.ERROR_CHANGES_PROPERTY_READONLY_ADD], + [ApiDiffType.PROPERTY_WRITABLE_ADD, ErrorMessage.ERROR_CHANGES_PROPERTY_WRITABLE_ADD], + [ApiDiffType.PROPERTY_WRITABLE_REDUCE, ErrorMessage.ERROR_CHANGES_PROPERTY_WRITABLE_REDUCE], + [ApiDiffType.DELETE_DECORATOR, ErrorMessage.ERROR_CHANGES_DELETE_DECORATOR], + // 13.常量变更 + [ApiDiffType.CONSTANT_VALUE_CHANGE, ErrorMessage.ERROR_CHANGES_CONSTANT_VALUE], + // 14.自定义类型变更 + [ApiDiffType.TYPE_ALIAS_CHANGE, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS_VALUE], + [ApiDiffType.TYPE_ALIAS_ADD, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS_ADD], + [ApiDiffType.TYPE_ALIAS_REDUCE, ErrorMessage.ERROR_CHANGES_TYPE_ALIAS_REDUCE], + // 15.枚举类型变更 + [ApiDiffType.ENUM_MEMBER_VALUE_CHANGE, ErrorMessage.ERROR_CHANGES_ENUM_MEMBER_VALUE], + ] +); /** * online error message format @@ -215,6 +251,10 @@ export class ApiResultSimpleInfo { message: string = ''; type: string = ''; apiText: string = ''; + apiName: string = ''; + apiType: string = ''; + hierarchicalRelations: string = ''; + parentModuleName: string | undefined = ''; setID(id: number): ApiResultSimpleInfo { this.id = id; @@ -278,6 +318,43 @@ export class ApiResultSimpleInfo { getApiText(): string { return this.apiText; } + + + setApiName(apiName: string): ApiResultSimpleInfo { + this.apiName = apiName; + return this; + } + + getApiName(): string { + return this.apiName; + } + + setApiType(apiType: string): ApiResultSimpleInfo { + this.apiType = apiType; + return this; + } + + getApiType(): string { + return this.apiType; + } + + setHierarchicalRelations(hierarchicalRelations: string): ApiResultSimpleInfo { + this.hierarchicalRelations = hierarchicalRelations; + return this; + } + + getHierarchicalRelations(): string { + return this.hierarchicalRelations; + } + + setParentModuleName(parentModuleName: string | undefined): ApiResultSimpleInfo { + this.parentModuleName = parentModuleName; + return this; + } + + getParentModuleName(): string | undefined { + return this.parentModuleName; + } } /** @@ -293,6 +370,9 @@ export class ApiResultInfo { apiName: string = ''; apiFullText: string = ''; baseName: string = ''; + hierarchicalRelations: string = ''; + parentModuleName: string | undefined = ''; + defectType: string = ''; setErrorType(errorType: string): ApiResultInfo { this.errorType = errorType; @@ -372,6 +452,33 @@ export class ApiResultInfo { getBaseName(): string { return this.baseName; } + + setHierarchicalRelations(hierarchicalRelations: string): ApiResultInfo { + this.hierarchicalRelations = hierarchicalRelations; + return this; + } + + getHierarchicalRelations(): string { + return this.hierarchicalRelations; + } + + setParentModuleName(parentModuleName: string | undefined): ApiResultInfo { + this.parentModuleName = parentModuleName; + return this; + } + + getParentModuleName(): string | undefined { + return this.parentModuleName; + } + + setDefectType(defectType: string): ApiResultInfo { + this.defectType = defectType; + return this; + } + + getDefectType(): string { + return this.defectType; + } } /** @@ -427,6 +534,7 @@ export class ApiResultMessage { language: string = 'typescript'; mainBuggyCode: string = ''; mainBuggyLine: string = ''; + extendInfo: ApiBaseInfo = new ApiBaseInfo(); setLocation(codeContextStaerLine: string): ApiResultMessage { this.codeContextStaerLine = codeContextStaerLine; @@ -489,4 +597,244 @@ export class ApiResultMessage { getMainBuggyLine(): string { return this.mainBuggyLine; } + + setExtendInfo(extendInfo: ApiBaseInfo): ApiResultMessage { + this.extendInfo = extendInfo; + return this; + } + + getExtendInfo(): ApiBaseInfo { + return this.extendInfo; + } } + +/** + * error message format + */ +export class ApiCheckInfo { + errorID: number = -1; + errorLevel: number = -1; + filePath: string = ''; + apiPostion: ts.LineAndCharacter = { line: -1, character: -1 }; + errorType: string = ''; + logType: string = ''; + sinceNumber: number = -1; + apiName: string = ''; + apiType: string = ''; + apiText: string = ''; + errorInfo: string = ''; + hierarchicalRelations: string = ''; + parentModuleName: string | undefined = ''; + + setErrorID(errorID: number): ApiCheckInfo { + this.errorID = errorID; + return this; + } + + getErrorID(): number { + return this.errorID; + } + + setErrorLevel(errorLevel: number): ApiCheckInfo { + this.errorLevel = errorLevel; + return this; + } + + getErrorLevel(): number { + return this.errorLevel; + } + + setFilePath(filePath: string): ApiCheckInfo { + this.filePath = filePath; + return this; + } + + getFilePath(): string { + return this.filePath; + } + + setApiPostion(apiPostion: ts.LineAndCharacter): ApiCheckInfo { + this.apiPostion = apiPostion; + return this; + } + + getApiPostion(): ts.LineAndCharacter { + return this.apiPostion; + } + + setErrorType(errorType: string): ApiCheckInfo { + this.errorType = errorType; + return this; + } + + getErrorType(): string { + return this.errorType; + } + + setLogType(logType: string): ApiCheckInfo { + this.logType = logType; + return this; + } + + getLogType(): string { + return this.logType; + } + + setSinceNumber(sinceNumber: number): ApiCheckInfo { + this.sinceNumber = sinceNumber; + return this; + } + + getSinceNumber(): number { + return this.sinceNumber; + } + + setApiName(apiName: string): ApiCheckInfo { + this.apiName = apiName; + return this; + } + + getApiName(): string { + return this.apiName; + } + + setApiType(apiType: string): ApiCheckInfo { + this.apiType = apiType; + return this; + } + + getApiType(): string { + return this.apiType; + } + + setApiText(apiText: string): ApiCheckInfo { + this.apiText = apiText; + return this; + } + + getApiText(): string { + return this.apiText; + } + + setErrorInfo(errorInfo: string): ApiCheckInfo { + this.errorInfo = errorInfo; + return this; + } + + getErrorInfo(): string { + return this.errorInfo; + } + + setHierarchicalRelations(hierarchicalRelations: string): ApiCheckInfo { + this.hierarchicalRelations = hierarchicalRelations; + return this; + } + + getHierarchicalRelations(): string { + return this.hierarchicalRelations; + } + + setParentModuleName(parentModuleName: string | undefined): ApiCheckInfo { + this.parentModuleName = parentModuleName; + return this; + } + + getParentModuleName(): string | undefined { + return this.parentModuleName; + } +} + +export class ApiBaseInfo { + apiName: string = ''; + apiType: string = ''; + hierarchicalRelations: string = ''; + parentModuleName: string | undefined = ''; + + setApiName(apiName: string): ApiBaseInfo { + this.apiName = apiName; + return this; + } + + getApiName(): string { + return this.apiName; + } + setApiType(apiType: string): ApiBaseInfo { + this.apiType = apiType; + return this; + } + + getApiType(): string { + return this.apiType; + } + setHierarchicalRelations(hierarchicalRelations: string): ApiBaseInfo { + this.hierarchicalRelations = hierarchicalRelations; + return this; + } + + getHierarchicalRelations(): string { + return this.hierarchicalRelations; + } + setParentModuleName(parentModuleName: string | undefined): ApiBaseInfo { + this.parentModuleName = parentModuleName; + return this; + } + + getParentModuleName(): string | undefined { + return this.parentModuleName; + } + +} + +export class ErrorBaseInfo { + errorID: number = -1; + errorLevel: number = -1; + errorType: string = ''; + logType: string = ''; + errorInfo: string = ''; + + setErrorID(errorID: number): ErrorBaseInfo { + this.errorID = errorID; + return this; + } + + getErrorID(): number { + return this.errorID; + } + + setErrorLevel(errorLevel: number): ErrorBaseInfo { + this.errorLevel = errorLevel; + return this; + } + + getErrorLevel(): number { + return this.errorLevel; + } + + + setErrorType(errorType: string): ErrorBaseInfo { + this.errorType = errorType; + return this; + } + + getErrorType(): string { + return this.errorType; + } + + setLogType(logType: string): ErrorBaseInfo { + this.logType = logType; + return this; + } + + getLogType(): string { + return this.logType; + } + + setErrorInfo(errorInfo: string): ErrorBaseInfo { + this.errorInfo = errorInfo; + return this; + } + + getErrorInfo(): string { + return this.errorInfo; + } +} \ No newline at end of file diff --git a/build-tools/dts_parser/src/typedef/diff/ApiInfoDiff.ts b/build-tools/dts_parser/src/typedef/diff/ApiInfoDiff.ts index 1a0dc6c99..9c0003d98 100644 --- a/build-tools/dts_parser/src/typedef/diff/ApiInfoDiff.ts +++ b/build-tools/dts_parser/src/typedef/diff/ApiInfoDiff.ts @@ -60,7 +60,7 @@ export class BasicDiffInfo { newSyscapField: string = ''; //kit信息 oldKitInfo: string = ''; - newKitInfo:string = ''; + newKitInfo: string = ''; setApiType(apiType: string): BasicDiffInfo { if (apiType) { @@ -445,6 +445,7 @@ export enum ApiDiffType { FUNCTION_PARAM_TYPE_ADD, /** 函数的参数类型范围缩小 */ FUNCTION_PARAM_TYPE_REDUCE, + FUNCTION_PARAM_CHANGE, PROPERTY_READONLY_TO_UNREQUIRED, PROPERTY_READONLY_TO_REQUIRED, PROPERTY_WRITABLE_TO_UNREQUIRED, @@ -458,6 +459,25 @@ export enum ApiDiffType { TYPE_ALIAS_CHANGE, TYPE_ALIAS_ADD, TYPE_ALIAS_REDUCE, + TYPE_ALIAS_FUNCTION_RETURN_TYPE_ADD, + TYPE_ALIAS_FUNCTION_RETURN_TYPE_REDUCE, + TYPE_ALIAS_FUNCTION_RETURN_TYPE_CHANGE, + TYPE_ALIAS_FUNCTION_PARAM_POS_CHAHGE, + /** 自定义类型方法新增可选参数 */ + TYPE_ALIAS_FUNCTION_PARAM_UNREQUIRED_ADD, + /** 自定义类型方法新增必选参数 */ + TYPE_ALIAS_FUNCTION_PARAM_REQUIRED_ADD, + TYPE_ALIAS_FUNCTION_PARAM_REDUCE, + TYPE_ALIAS_FUNCTION_PARAM_TYPE_CHANGE, + /** 自定义类型方法中的必选参数变为可选参数 */ + TYPE_ALIAS_FUNCTION_PARAM_TO_UNREQUIRED, + /** 自定义类型方法中的可选参数变为必选参数 */ + TYPE_ALIAS_FUNCTION_PARAM_TO_REQUIRED, + /** 自定义类型方法的参数类型范围扩大 */ + TYPE_ALIAS_FUNCTION_PARAM_TYPE_ADD, + /** 自定义类型方法的参数类型范围缩小 */ + TYPE_ALIAS_FUNCTION_PARAM_TYPE_REDUCE, + TYPE_ALIAS_FUNCTION_PARAM_CHANGE, ENUM_MEMBER_VALUE_CHANGE, ADD, REDUCE, @@ -518,6 +538,7 @@ export const diffTypeMap: Map = new Map([ [ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, '函数变更'], [ApiDiffType.FUNCTION_PARAM_TYPE_ADD, '函数变更'], [ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, '函数变更'], + [ApiDiffType.FUNCTION_PARAM_CHANGE, '函数变更'], [ApiDiffType.PROPERTY_READONLY_TO_UNREQUIRED, '属性变更'], [ApiDiffType.PROPERTY_READONLY_TO_REQUIRED, '属性变更'], [ApiDiffType.PROPERTY_WRITABLE_TO_UNREQUIRED, '属性变更'], @@ -531,6 +552,19 @@ export const diffTypeMap: Map = new Map([ [ApiDiffType.TYPE_ALIAS_CHANGE, '自定义类型变更'], [ApiDiffType.TYPE_ALIAS_ADD, '自定义类型变更'], [ApiDiffType.TYPE_ALIAS_REDUCE, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_ADD, '函数变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_REDUCE, '函数变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_CHANGE, '函数变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_POS_CHAHGE, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_UNREQUIRED_ADD, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REQUIRED_ADD, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REDUCE, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_UNREQUIRED, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_REQUIRED, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_CHANGE, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_ADD, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_REDUCE, '自定义类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_CHANGE, '自定义类型变更'], [ApiDiffType.ENUM_MEMBER_VALUE_CHANGE, '枚举赋值发生改变'], [ApiDiffType.ADD, '新增API'], [ApiDiffType.REDUCE, '删除API'], @@ -589,6 +623,7 @@ export const diffMap: Map = new Map([ [ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, '函数的参数类型变更'], [ApiDiffType.FUNCTION_PARAM_TYPE_ADD, '函数的参数类型范围扩大'], [ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, '函数的参数类型范围缩小'], + [ApiDiffType.FUNCTION_PARAM_CHANGE, '函数的参数变更'], [ApiDiffType.PROPERTY_READONLY_TO_UNREQUIRED, '只读属性由必选变为可选'], [ApiDiffType.PROPERTY_READONLY_TO_REQUIRED, '只读属性由可选变为必选'], [ApiDiffType.PROPERTY_WRITABLE_TO_UNREQUIRED, '可写属性由必选变为可选'], @@ -599,9 +634,22 @@ export const diffMap: Map = new Map([ [ApiDiffType.PROPERTY_WRITABLE_ADD, '可写属性类型范围扩大'], [ApiDiffType.PROPERTY_WRITABLE_REDUCE, '可写属性类型范围缩小'], [ApiDiffType.CONSTANT_VALUE_CHANGE, '常量值发生改变'], - [ApiDiffType.TYPE_ALIAS_CHANGE, '自定义类型值直接改变'], + [ApiDiffType.TYPE_ALIAS_CHANGE, '自定义类型值改变'], [ApiDiffType.TYPE_ALIAS_ADD, '自定义类型值范围扩大'], [ApiDiffType.TYPE_ALIAS_REDUCE, '自定义类型值范围缩小'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_ADD, '自定义方法类型返回值类型扩大'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_REDUCE, '自定义方法类型返回值类型缩小'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_RETURN_TYPE_CHANGE, '自定义方法类型返回值类型改变'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_POS_CHAHGE, '自定义方法类型参数位置发生改变'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_UNREQUIRED_ADD, '自定义方法类型新增可选参数'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REQUIRED_ADD, '自定义方法类型新增必选参数'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_REDUCE, '自定义方法类型删除参数'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_UNREQUIRED, '自定义方法类型的必选参数变为可选参数'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TO_REQUIRED, '自定义方法类型的可选参数变为必选参数'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_CHANGE, '自定义方法类型的参数类型变更'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_ADD, '自定义方法类型的参数类型范围扩大'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_REDUCE, '自定义方法类型的参数类型范围缩小'], + [ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_CHANGE, '自定义方法类型的参数变更'], [ApiDiffType.ENUM_MEMBER_VALUE_CHANGE, '枚举赋值发生改变'], [ApiDiffType.ADD, '新增API'], [ApiDiffType.REDUCE, '删除API'], @@ -639,6 +687,7 @@ export const incompatibleApiDiffTypes: Set = new Set([ ApiDiffType.FUNCTION_PARAM_TO_REQUIRED, ApiDiffType.FUNCTION_PARAM_TYPE_CHANGE, ApiDiffType.FUNCTION_PARAM_TYPE_REDUCE, + ApiDiffType.FUNCTION_PARAM_CHANGE, ApiDiffType.PROPERTY_READONLY_TO_REQUIRED, ApiDiffType.PROPERTY_WRITABLE_TO_UNREQUIRED, ApiDiffType.PROPERTY_WRITABLE_TO_REQUIRED, @@ -654,5 +703,10 @@ export const incompatibleApiDiffTypes: Set = new Set([ ApiDiffType.REDUCE, ApiDiffType.HISTORICAL_JSDOC_CHANGE, ApiDiffType.HISTORICAL_API_CHANGE, + ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_REDUCE, + ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_CHANGE, + ApiDiffType.FUNCTION_RETURN_TYPE_REDUCE, + ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_TYPE_ADD, + ApiDiffType.TYPE_ALIAS_FUNCTION_PARAM_CHANGE, ApiDiffType.ATOMIC_SERVICE_HAVE_TO_NA, ]); \ No newline at end of file diff --git a/build-tools/dts_parser/src/typedef/parser/ApiInfoDefination.ts b/build-tools/dts_parser/src/typedef/parser/ApiInfoDefination.ts index 85dc51ce9..db2ce444e 100644 --- a/build-tools/dts_parser/src/typedef/parser/ApiInfoDefination.ts +++ b/build-tools/dts_parser/src/typedef/parser/ApiInfoDefination.ts @@ -66,10 +66,12 @@ export class BasicApiInfo { jsDocText: string = ''; isJoinType: boolean = false; genericInfo: GenericInfo[] = []; + parentApiType: string | undefined = ''; constructor(apiType: string = '', node: ts.Node, parentApi: BasicApiInfo | undefined) { this.node = node; this.setParentApi(parentApi); + this.setParentApiType(parentApi?.getApiType()) if (parentApi) { this.setFilePath(parentApi.getFilePath()); this.setIsStruct(parentApi.getIsStruct()); @@ -135,6 +137,14 @@ export class BasicApiInfo { getParentApi(): BasicApiInfo | undefined { return this.parentApi; } + + setParentApiType(parentApiType: string | undefined): void { + this.parentApiType = parentApiType; + } + + getParentApiType(): string | undefined { + return this.parentApiType; + } setIsExport(isExport: boolean): void { this.isExport = isExport; @@ -553,7 +563,7 @@ export class TypeAliasInfo extends ApiInfo { type: string[] = []; // type定义的类型 typeName: TypeAliasType = '' as TypeAliasType; //type的类型 returnType: string = ''; //type类型为function时的返回值 - paramInfos: TypeParamInfo[] = []; //type类型为function时的参数名和参数类型 + paramInfos: ParamInfo[] = []; //type类型为function时的参数名和参数类型 typeIsFunction: boolean = false; //type类型是否为function addType(type: string[]): void { @@ -582,11 +592,11 @@ export class TypeAliasInfo extends ApiInfo { return this.returnType; } - setParamInfos(paramInfo: TypeParamInfo) { + setParamInfos(paramInfo: ParamInfo) { this.paramInfos.push(paramInfo); } - getParamInfos(): TypeParamInfo[] { + getParamInfos(): ParamInfo[] { return this.paramInfos; } diff --git a/build-tools/dts_parser/src/utils/FunctionUtils.ts b/build-tools/dts_parser/src/utils/FunctionUtils.ts index 4194eb771..2ebe28913 100644 --- a/build-tools/dts_parser/src/utils/FunctionUtils.ts +++ b/build-tools/dts_parser/src/utils/FunctionUtils.ts @@ -17,7 +17,8 @@ import path from 'path'; import fs from 'fs'; import { FileUtils } from './FileUtils'; import { NumberConstant } from './Constant'; -import { data } from '../../kit.json' +import { kitData } from '../../kit.json' +import { fileContent } from '../../subsystem.json' export class FunctionUtils { /** @@ -57,8 +58,6 @@ export class FunctionUtils { } static readSubsystemFile(): SubSystemData { - const subsystemFilePath: string = path.join(FileUtils.getBaseDirName(), 'subsystem.json'); - const fileContent: Array = JSON.parse(fs.readFileSync(subsystemFilePath, 'utf-8')); const subsystemMap: Map = new Map(); const fileNameMap: Map = new Map(); @@ -81,7 +80,7 @@ export class FunctionUtils { const subsystemMap: Map = new Map(); const kitNameMap: Map = new Map(); const filePathSet: Set = new Set(); - data.forEach((subSystemInfo: KitInfo) => { + kitData.forEach((subSystemInfo: KitInfo) => { subsystemMap.set(subSystemInfo.filePath, subSystemInfo.subSystem); kitNameMap.set(subSystemInfo.filePath, subSystemInfo.kitName); filePathSet.add(subSystemInfo.filePath); diff --git a/build-tools/dts_parser/src/utils/StringUtils.ts b/build-tools/dts_parser/src/utils/StringUtils.ts index 65a516bef..383c39944 100644 --- a/build-tools/dts_parser/src/utils/StringUtils.ts +++ b/build-tools/dts_parser/src/utils/StringUtils.ts @@ -20,6 +20,8 @@ export class StringUtils { try { flag = str.search(sub) !== -1; } catch (error) { + console.log('str=',str) + console.log('sub=',sub) LogUtil.e('StringUtils.hasSubstring', error); } return flag; diff --git a/build-tools/dts_parser/src/utils/checkUtils.ts b/build-tools/dts_parser/src/utils/checkUtils.ts index 05f981d44..93b397af7 100644 --- a/build-tools/dts_parser/src/utils/checkUtils.ts +++ b/build-tools/dts_parser/src/utils/checkUtils.ts @@ -16,11 +16,14 @@ import path, { ParsedPath } from 'path'; import fs, { Stats } from 'fs'; import { Workbook, Worksheet } from 'exceljs'; import ts, { LineAndCharacter } from 'typescript'; -import { ApiResultSimpleInfo, ApiResultInfo, ApiResultMessage } from '../typedef/checker/result_type'; -import { ApiInfo, ClassInfo, ParentClass } from '../typedef/parser/ApiInfoDefination'; +import { ApiResultSimpleInfo, ApiResultInfo, ApiResultMessage, ApiCheckInfo, ErrorBaseInfo } from '../typedef/checker/result_type'; +import { ApiInfo, BasicApiInfo, ClassInfo, ParentClass } from '../typedef/parser/ApiInfoDefination'; import { FileUtils } from './FileUtils'; import { ApiCheckVersion } from '../coreImpl/checker/config/api_check_version.json'; import { PunctuationMark } from './Constant'; +import { Comment } from '../typedef/parser/Comment'; +import { currentFilePath } from '../coreImpl/checker/src/api_check_plugin'; +import { toNumber } from 'lodash'; export class PosOfNode { @@ -99,38 +102,45 @@ export class GenerateFile { ); } + /** * 将错误信息输出为excel文件 * @param { ApiResultInfo[] } apiCheckArr */ - static async writeExcelFile(apiCheckArr: ApiResultInfo[]): Promise { + static async writeExcelFile(apiCheckArr: ApiResultMessage[]): Promise { const workbook: Workbook = new Workbook(); const sheet: Worksheet = workbook.addWorksheet('Js Api', { views: [{ xSplit: 1 }] }); sheet.getRow(1).values = [ 'order', - 'level', - 'errorType', - 'fileName', - 'apiName', - 'apiContent', - 'type', - 'errorInfo', - 'version', - 'model', + 'analyzerName', + 'buggyFilePath', + 'codeContextStaerLine', + 'defectLevel', + 'defectType', + 'description', + 'language', + 'mainBuggyCode', + "apiName", + "apiType", + "hierarchicalRelations", + "parentModuleName" ]; for (let i = 1; i <= apiCheckArr.length; i++) { - const apiData: ApiResultInfo = apiCheckArr[i - 1]; + const apiData: ApiResultMessage = apiCheckArr[i - 1]; sheet.getRow(i + 1).values = [ i, - apiData.getLevel(), - apiData.getErrorType(), + apiData.analyzerName, + apiData.getFilePath(), apiData.getLocation(), - apiData.getApiName(), - apiData.getApiFullText(), - apiData.getApiType(), + apiData.getLevel(), + apiData.getType(), apiData.getMessage(), - apiData.getVersion(), - apiData.getBaseName(), + apiData.language, + apiData.getMainBuggyCode(), + apiData.getExtendInfo().getApiName(), + apiData.getExtendInfo().getApiType(), + apiData.getExtendInfo().getHierarchicalRelations(), + apiData.getExtendInfo().getParentModuleName() ]; } workbook.xlsx.writeBuffer().then((buffer) => { @@ -169,7 +179,6 @@ export class ObtainFullPath { } export class CommonFunctions { - static getSinceVersion(sinceValue: string): string { return sinceValue.indexOf(PunctuationMark.LEFT_PARENTHESES) !== -1 ? sinceValue.substring(sinceValue.indexOf(PunctuationMark.LEFT_PARENTHESES) + 1, @@ -249,6 +258,31 @@ export class CommonFunctions { return implementsApiValue; } + + static getErrorInfo(singleApi: BasicApiInfo | undefined, apiJsdoc: Comment.JsDocInfo | undefined, filePath: string, errorBaseInfo: ErrorBaseInfo): ApiCheckInfo { + let apiInfo: ApiCheckInfo = new ApiCheckInfo(); + if (singleApi === undefined) { + return apiInfo + } + const sinceVersion: number = apiJsdoc === undefined ? -1 : toNumber(apiJsdoc.since); + apiInfo + .setErrorID(errorBaseInfo.errorID) + .setErrorLevel(errorBaseInfo.errorLevel) + .setFilePath(filePath) + .setApiPostion(singleApi.getPos()) + .setErrorType(errorBaseInfo.errorType) + .setLogType(errorBaseInfo.logType) + .setSinceNumber(sinceVersion) + .setApiName(singleApi.getApiName()) + .setApiType(singleApi.getApiType()) + .setApiText(singleApi.getDefinedText()) + .setErrorInfo(errorBaseInfo.errorInfo) + .setHierarchicalRelations(singleApi.getHierarchicalRelations().join('|')) + .setParentModuleName(singleApi.getParentApi()?.getApiName()); + + return apiInfo; + } + static getMdFiles(url: string) { const mdFiles: string[] = []; const content: string = fs.readFileSync(url, 'utf-8'); @@ -270,13 +304,22 @@ export class CommonFunctions { CommonFunctions.splitPath(spliteResult.dir, pathElements); } } + + static isAscending(arr: number[]): boolean { + for (let i = 1; i < arr.length; i++) { + if (arr[i] < arr[i - 1]) { + return false; + } + } + return true; + } } /** * The order between labels */ export const tagsArrayOfOrder: string[] = [ - 'namespace', 'struct', 'extends', 'implements', 'typedef', 'interface', 'permission', 'enum', 'constant', 'type', + 'namespace', 'struct', 'typedef', 'interface', 'extends', 'implements', 'permission', 'enum', 'constant', 'type', 'param', 'default', 'returns', 'readonly', 'throws', 'static', 'fires', 'syscap', 'systemapi', 'famodelonly', 'FAModelOnly', 'stagemodelonly', 'StageModelOnly', 'crossplatform', 'form', 'atomicservice', 'since', 'deprecated', 'useinstead', 'test', 'example' diff --git a/build-tools/dts_parser/subsystem.json b/build-tools/dts_parser/subsystem.json index 7d3a5dbba..58272350b 100644 --- a/build-tools/dts_parser/subsystem.json +++ b/build-tools/dts_parser/subsystem.json @@ -1,244 +1,246 @@ -[ - { - "syscap": "ArkUI", - "subsystem": "ArkUI开发框架", - "fileName": "arkui" - }, - { - "syscap": "BundleManager", - "subsystem": "包管理", - "fileName": "bundle" - }, - { - "syscap": "Graphic", - "subsystem": "图形图像", - "fileName": "graphic" - }, - { - "syscap": "WindowManager", - "subsystem": "窗口管理", - "fileName": "window" - }, - { - "syscap": "Notification", - "subsystem": "事件通知", - "fileName": "notification" - }, - { - "syscap": "Communication", - "subsystem": "基础通信", - "fileName": "communication" - }, - { - "syscap": "Location", - "subsystem": "位置服务", - "fileName": "geolocation" - }, - { - "syscap": "MultimodalInput", - "subsystem": "多模输入", - "fileName": "multi-modal-input" - }, - { - "syscap": "PowerManager", - "subsystem": "电源服务", - "fileName": "battery" - }, - { - "syscap": "Multimedia", - "subsystem": "OS媒体软件", - "fileName": "multimedia" - }, - { - "syscap": "Telephony", - "subsystem": "电话服务", - "fileName": "telephony" - }, - { - "syscap": "Global", - "subsystem": "全球化", - "fileName": "global" - }, - { - "syscap": "Customization", - "subsystem": "定制", - "fileName": "customization" - }, - { - "syscap": "BarrierFree", - "subsystem": "无障碍软件服务", - "fileName": "accessibility" - }, - { - "syscap": "ResourceSchedule", - "subsystem": "资源调度", - "fileName": "resource-scheduler" - }, - { - "syscap": "Utils", - "subsystem": "公共基础类库", - "fileName": "compiler-and-runtime" - }, - { - "syscap": "HiviewDFX", - "subsystem": "DFX", - "fileName": "dfx" - }, - { - "syscap": "Update", - "subsystem": "升级服务", - "fileName": "update" - }, - { - "syscap": "DistributedHardware", - "subsystem": "分布式硬件", - "fileName": "distributed-hardware" - }, - { - "syscap": "Security", - "subsystem": "安全基础能力", - "fileName": "security" - }, - { - "syscap": "Account", - "subsystem": "账号", - "fileName": "account" - }, - { - "syscap": "UserIAM", - "subsystem": "用户IAM", - "fileName": "user-iam" - }, - { - "syscap": "FileManagement", - "subsystem": "文件管理", - "fileName": "file-management" - }, - { - "syscap": "USB", - "subsystem": "USB服务", - "fileName": "usb" - }, - { - "syscap": "Sensors", - "subsystem": "泛sensor服务", - "fileName": "sensor" - }, - { - "syscap": "Startup", - "subsystem": "启动恢复", - "fileName": "start-up" - }, - { - "syscap": "DistributedDataManager", - "subsystem": "分布式数据管理", - "fileName": "distributed-data" - }, - { - "syscap": "Ability", - "subsystem": "元能力", - "fileName": "ability" - }, - { - "syscap": "Web", - "subsystem": "web", - "fileName": "web" - }, - { - "syscap": "Applications", - "subsystem": "应用", - "fileName": "application" - }, - { - "syscap": "Msdp", - "subsystem": "综合传感处理平台", - "fileName": "msdp" - }, - { - "syscap": "Test", - "subsystem": "测试框架", - "fileName": "unitest" - }, - { - "syscap": "Base", - "subsystem": "SDK", - "fileName": "sdk" - }, - { - "syscap": "AI", - "subsystem": "AI业务", - "fileName": "ai" - }, - { - "syscap": "Request", - "subsystem": "上传下载", - "fileName": "download-upload" - }, - { - "syscap": "Download", - "subsystem": "上传下载", - "fileName": "download-upload" - }, - { - "syscap": "Upload", - "subsystem": "上传下载", - "fileName": "download-upload" - }, - { - "syscap": "Wallpaper", - "subsystem": "主题", - "fileName": "theme" - }, - { - "syscap": "Time", - "subsystem": "时间时区", - "fileName": "time" - }, - { - "syscap": "ScreenLock", - "subsystem": "主题", - "fileName": "theme" - }, - { - "syscap": "Pasteboard", - "subsystem": "剪贴板", - "fileName": "pasteboard" - }, - { - "syscap": "InputMethodFramework", - "subsystem": "输入法", - "fileName": "input-method-framework" - },{ - "syscap": "Driver", - "subsystem": "驱动", - "fileName": "driver" - },{ - "syscap": "Developtools", - "subsystem": "研发工具链", - "fileName": "developtools" - },{ - "syscap": "Bluetooth", - "subsystem": "蓝牙", - "fileName": "blue-tooth" - },{ - "syscap": "NetManager", - "subsystem": "网络管理·", - "fileName": "net-manager" - },{ - "syscap": "Print", - "subsystem": "打印", - "fileName": "print" - },{ - "syscap": "Window", - "subsystem": "窗口", - "fileName": "window" - },{ - "syscap": "Advertising", - "subsystem": "广告服务", - "fileName": "advertising" - },{ - "syscap": "XTS", - "subsystem": "XTS", - "fileName": "xts" - } -] \ No newline at end of file +{ + "fileContent":[ + { + "syscap": "ArkUI", + "subsystem": "ArkUI开发框架", + "fileName": "arkui" + }, + { + "syscap": "BundleManager", + "subsystem": "包管理", + "fileName": "bundle" + }, + { + "syscap": "Graphic", + "subsystem": "图形图像", + "fileName": "graphic" + }, + { + "syscap": "WindowManager", + "subsystem": "窗口管理", + "fileName": "window" + }, + { + "syscap": "Notification", + "subsystem": "事件通知", + "fileName": "notification" + }, + { + "syscap": "Communication", + "subsystem": "基础通信", + "fileName": "communication" + }, + { + "syscap": "Location", + "subsystem": "位置服务", + "fileName": "geolocation" + }, + { + "syscap": "MultimodalInput", + "subsystem": "多模输入", + "fileName": "multi-modal-input" + }, + { + "syscap": "PowerManager", + "subsystem": "电源服务", + "fileName": "battery" + }, + { + "syscap": "Multimedia", + "subsystem": "OS媒体软件", + "fileName": "multimedia" + }, + { + "syscap": "Telephony", + "subsystem": "电话服务", + "fileName": "telephony" + }, + { + "syscap": "Global", + "subsystem": "全球化", + "fileName": "global" + }, + { + "syscap": "Customization", + "subsystem": "定制", + "fileName": "customization" + }, + { + "syscap": "BarrierFree", + "subsystem": "无障碍软件服务", + "fileName": "accessibility" + }, + { + "syscap": "ResourceSchedule", + "subsystem": "资源调度", + "fileName": "resource-scheduler" + }, + { + "syscap": "Utils", + "subsystem": "公共基础类库", + "fileName": "compiler-and-runtime" + }, + { + "syscap": "HiviewDFX", + "subsystem": "DFX", + "fileName": "dfx" + }, + { + "syscap": "Update", + "subsystem": "升级服务", + "fileName": "update" + }, + { + "syscap": "DistributedHardware", + "subsystem": "分布式硬件", + "fileName": "distributed-hardware" + }, + { + "syscap": "Security", + "subsystem": "安全基础能力", + "fileName": "security" + }, + { + "syscap": "Account", + "subsystem": "账号", + "fileName": "account" + }, + { + "syscap": "UserIAM", + "subsystem": "用户IAM", + "fileName": "user-iam" + }, + { + "syscap": "FileManagement", + "subsystem": "文件管理", + "fileName": "file-management" + }, + { + "syscap": "USB", + "subsystem": "USB服务", + "fileName": "usb" + }, + { + "syscap": "Sensors", + "subsystem": "泛sensor服务", + "fileName": "sensor" + }, + { + "syscap": "Startup", + "subsystem": "启动恢复", + "fileName": "start-up" + }, + { + "syscap": "DistributedDataManager", + "subsystem": "分布式数据管理", + "fileName": "distributed-data" + }, + { + "syscap": "Ability", + "subsystem": "元能力", + "fileName": "ability" + }, + { + "syscap": "Web", + "subsystem": "web", + "fileName": "web" + }, + { + "syscap": "Applications", + "subsystem": "应用", + "fileName": "application" + }, + { + "syscap": "Msdp", + "subsystem": "综合传感处理平台", + "fileName": "msdp" + }, + { + "syscap": "Test", + "subsystem": "测试框架", + "fileName": "unitest" + }, + { + "syscap": "Base", + "subsystem": "SDK", + "fileName": "sdk" + }, + { + "syscap": "AI", + "subsystem": "AI业务", + "fileName": "ai" + }, + { + "syscap": "Request", + "subsystem": "上传下载", + "fileName": "download-upload" + }, + { + "syscap": "Download", + "subsystem": "上传下载", + "fileName": "download-upload" + }, + { + "syscap": "Upload", + "subsystem": "上传下载", + "fileName": "download-upload" + }, + { + "syscap": "Wallpaper", + "subsystem": "主题", + "fileName": "theme" + }, + { + "syscap": "Time", + "subsystem": "时间时区", + "fileName": "time" + }, + { + "syscap": "ScreenLock", + "subsystem": "主题", + "fileName": "theme" + }, + { + "syscap": "Pasteboard", + "subsystem": "剪贴板", + "fileName": "pasteboard" + }, + { + "syscap": "InputMethodFramework", + "subsystem": "输入法", + "fileName": "input-method-framework" + },{ + "syscap": "Driver", + "subsystem": "驱动", + "fileName": "driver" + },{ + "syscap": "Developtools", + "subsystem": "研发工具链", + "fileName": "developtools" + },{ + "syscap": "Bluetooth", + "subsystem": "蓝牙", + "fileName": "blue-tooth" + },{ + "syscap": "NetManager", + "subsystem": "网络管理·", + "fileName": "net-manager" + },{ + "syscap": "Print", + "subsystem": "打印", + "fileName": "print" + },{ + "syscap": "Window", + "subsystem": "窗口", + "fileName": "window" + },{ + "syscap": "Advertising", + "subsystem": "广告服务", + "fileName": "advertising" + },{ + "syscap": "XTS", + "subsystem": "XTS", + "fileName": "xts" + } + ] +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_01.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_01.d.ts new file mode 100644 index 000000000..36bcc2d32 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_01.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about delete systemapi + * + * @systemapi + */ +export class Test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_02.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_02.d.ts new file mode 100644 index 000000000..d3c0ac03c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_02.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change permission value + * + */ +export namespace test { + /** + * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS and ohos.permission.KEEP_BACKGROUND_RUNNING + */ + function func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_03.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_03.d.ts new file mode 100644 index 000000000..021c79e9c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_03.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change permission value + * + */ +export namespace test { + /** + * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS + */ + function func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_04.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_04.d.ts new file mode 100644 index 000000000..5da44519d --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_04.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change throws from na to has + * + */ +export class Test { + /** + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + */ + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_05.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_05.d.ts new file mode 100644 index 000000000..3674ab882 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_05.d.ts @@ -0,0 +1,28 @@ + +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change throws + * + */ +export class Test { + /** + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - non-system app called system api. + * @throws { BusinessError } 404 - The parameter check failed. + */ + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_06.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_06.d.ts new file mode 100644 index 000000000..808cca4f9 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_06.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about delete form + * + */ +export class Test { + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_07.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_07.d.ts new file mode 100644 index 000000000..1bcbb022e --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_07.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about reduce crossplatform + * + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_08.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_08.d.ts new file mode 100644 index 000000000..8980a39b0 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_08.d.ts @@ -0,0 +1,22 @@ + +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change api + */ +export namespace test { + function func2(str: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_09.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_09.d.ts new file mode 100644 index 000000000..8dbf2e620 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_09.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change famodelonly to stagemodelonly + * + * @stagemodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_10.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_10.d.ts new file mode 100644 index 000000000..55f406dbb --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_10.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change stagemodelonly to famodelonly + * + * @famodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_11.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_11.d.ts new file mode 100644 index 000000000..a06291362 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_11.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about add stagemodelonly + * + * @stagemodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_12.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_12.d.ts new file mode 100644 index 000000000..6c0bb5beb --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_12.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about add famodelonly + * + * @famodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_13.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_13.d.ts new file mode 100644 index 000000000..65fee1f3b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_13.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for add function return type + */ +export namespace test { + function func(str: string, str2: string): string | number {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_14.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_14.d.ts new file mode 100644 index 000000000..75c3ff966 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_14.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for reduce function return type + */ +export namespace test { + function func(str: string, str2: string): string {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_15.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_15.d.ts new file mode 100644 index 000000000..0503ee656 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_15.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function return type + */ +export namespace test { + function func(str: string, str2: string): number {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_16.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_16.d.ts new file mode 100644 index 000000000..aa078b83e --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_16.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function param pos + */ +export namespace test { + function func(str2: string, str: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_17.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_17.d.ts new file mode 100644 index 000000000..4d0b661a0 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_17.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for add function param which is required + */ +export namespace test { + function func(str: string, str2: string, str3: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_18.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_18.d.ts new file mode 100644 index 000000000..36cdc1fbf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_18.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for reduce function param + */ +export namespace test { + function func(str: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_19.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_19.d.ts new file mode 100644 index 000000000..7ada32bd0 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_19.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function param what from not required to required + */ +export namespace test { + function func(str: string, str2: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_20.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_20.d.ts new file mode 100644 index 000000000..915a234f3 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_20.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default fileIo; + +declare namespace fileIo { + export { copyDir }; +} + +declare function copyDir(src: number, dest: string, mode?: number): Promise; + +declare function copyDir(src: string, dest: string, callback: AsyncCallback): ConflictFiles; + +declare function copyDir(src: string, dest: string, callback: AsyncCallback>): void; diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_21.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_21.d.ts new file mode 100644 index 000000000..8a9e087f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_21.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_22.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_22.d.ts new file mode 100644 index 000000000..d7daa8622 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_22.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is readonly to required + * + */ +export interface Test { + readonly constant: 1; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_23.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_23.d.ts new file mode 100644 index 000000000..0769f72b6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_23.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is writable to not required + * + */ +export interface Test { + str?: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_24.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_24.d.ts new file mode 100644 index 000000000..352f9f5b7 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_24.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is writable to required + * + */ +export interface Test { + str: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_25.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_25.d.ts new file mode 100644 index 000000000..805e1196d --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_25.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change type + * + */ +export interface Test { + str: number; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_26.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_26.d.ts new file mode 100644 index 000000000..f545e3fa8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_26.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about expand type which is readonly + * + */ +export interface Test { + readonly constant: string | number; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_27.d.ets b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_27.d.ets new file mode 100644 index 000000000..335b92e54 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_27.d.ets @@ -0,0 +1,18 @@ +/* +* Copyright (C) 2023-2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +@Component +struct MyComponent { + @Prop primaryText: ResourceStrs; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_28.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_28.d.ts new file mode 100644 index 000000000..7e1700c96 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_28.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about reduce type which is writable + * + */ +export interface Test { + str: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_29.d.ets b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_29.d.ets new file mode 100644 index 000000000..fbb43d018 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_29.d.ets @@ -0,0 +1,17 @@ +/* +* Copyright (C) 2023-2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +struct MyComponent { +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_30.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_30.d.ts new file mode 100644 index 000000000..52f7281d9 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_30.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change constant value + */ +export namespace test { + const CONSTANT = 2; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_31.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_31.d.ts new file mode 100644 index 000000000..95950ff23 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_31.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about change + * + */ +export namespace test { + type Type = 'new'; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_32.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_32.d.ts new file mode 100644 index 000000000..abab0280f --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_32.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about expand + * + */ +export namespace test { + type Type = 'none' | 'new'; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_33.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_33.d.ts new file mode 100644 index 000000000..5d7d0e76f --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_33.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about reduce + * + */ +export namespace test { + type Type = 'none'; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_34.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_34.d.ts new file mode 100644 index 000000000..1f5d5e8bd --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_34.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change enum menber value + */ +export enum Test { + VALUE_ONE = 2, + + VALUE_TWO, + + VALUE_THREE, +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_35.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_35.d.ts new file mode 100644 index 000000000..29112b559 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_35.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change enum add menber + */ +export enum Test { + VALUE_ONE, + + VALUE_TWO, + + VALUE_THREE, +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_36.d.ts b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_36.d.ts new file mode 100644 index 000000000..7a699315a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/new/API_CHANGE_INCOMPATIBLE_36.d.ts @@ -0,0 +1,22 @@ + +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change constant value + */ +export namespace test { + const CONSTANT = 2; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/new/image.png b/build-tools/dts_parser/test/ut/apiChange/new/image.png new file mode 100644 index 000000000..ace106ed7 Binary files /dev/null and b/build-tools/dts_parser/test/ut/apiChange/new/image.png differ diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_01.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_01.d.ts new file mode 100644 index 000000000..6565ff5cd --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_01.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about delete systemapi + * + */ +export class Test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_02.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_02.d.ts new file mode 100644 index 000000000..95179b92b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_02.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change permission value + * + */ +export namespace test { + /** + * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS + */ + function func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_03.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_03.d.ts new file mode 100644 index 000000000..95179b92b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_03.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change permission value + * + */ +export namespace test { + /** + * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS + */ + function func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_04.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_04.d.ts new file mode 100644 index 000000000..3947dc526 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_04.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change throws from na to has + * + */ +export class Test { + /** + * + */ + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_05.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_05.d.ts new file mode 100644 index 000000000..a4ec07f83 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_05.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change throws + * + */ +export class Test { + /** + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + */ + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_06.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_06.d.ts new file mode 100644 index 000000000..24530c5d6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_06.d.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about delete form + * + * @form + */ +export class Test { + func(str: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_07.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_07.d.ts new file mode 100644 index 000000000..0edab39e9 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_07.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about reduce crossplatform + * + * @crossplatform + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_08.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_08.d.ts new file mode 100644 index 000000000..aebde0167 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_08.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change api + */ +export namespace test { + function func(str: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_09.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_09.d.ts new file mode 100644 index 000000000..effab632f --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_09.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change famodelonly to stagemodelonly + * + * @famodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_10.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_10.d.ts new file mode 100644 index 000000000..1e58e608c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_10.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about change stagemodelonly to famodelonly + * + * @stagemodelonly + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_11.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_11.d.ts new file mode 100644 index 000000000..183cb85cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_11.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about add stagemodelonly + * + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_12.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_12.d.ts new file mode 100644 index 000000000..68b54ba27 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_12.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for jsdoc about add famodelonly + * + */ +export namespace test {} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_13.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_13.d.ts new file mode 100644 index 000000000..21c8aceca --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_13.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for add function return type + */ +export namespace test { + function func(str: string, str2: string): string {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_14.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_14.d.ts new file mode 100644 index 000000000..e2407f609 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_14.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for reduce function return type + */ +export namespace test { + function func(str: string, str2: string): string | number {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_15.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_15.d.ts new file mode 100644 index 000000000..9a17ea4f8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_15.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function return type + */ +export namespace test { + function func(str: string, str2: string): string {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_16.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_16.d.ts new file mode 100644 index 000000000..9e6c80173 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_16.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function param pos + */ +export namespace test { + function func(str: string, str2: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_17.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_17.d.ts new file mode 100644 index 000000000..9dad00676 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_17.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for add function param which is required + */ +export namespace test { + function func(str: string, str2: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_18.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_18.d.ts new file mode 100644 index 000000000..67898ced1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_18.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for reduce function param + */ +export namespace test { + function func(str: string, str2: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_19.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_19.d.ts new file mode 100644 index 000000000..810f6a10e --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_19.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change function param what from not required to required + */ +export namespace test { + function func(str: string, str2?: string): void {} +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_20.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_20.d.ts new file mode 100644 index 000000000..55d263155 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_20.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default fileIo; + +declare namespace fileIo { + export { copyDir }; +} + +declare function copyDir(src: string, dest: string, mode?: number): Promise; + +declare function copyDir(src: string, dest: string, callback: AsyncCallback): void; + +declare function copyDir(src: string, dest: string, callback: AsyncCallback>): void; diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_21.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_21.d.ts new file mode 100644 index 000000000..7fffaecf1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_21.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number | string, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_22.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_22.d.ts new file mode 100644 index 000000000..a2972b460 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_22.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is readonly to required + * + */ +export interface Test { + readonly constant?: 1; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_23.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_23.d.ts new file mode 100644 index 000000000..9e247adfd --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_23.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is writable to not required + * + */ +export interface Test { + str: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_24.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_24.d.ts new file mode 100644 index 000000000..625a60e6d --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_24.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change one which is writable to required + * + */ +export interface Test { + str?: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_25.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_25.d.ts new file mode 100644 index 000000000..af3d72699 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_25.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about change type + * + */ +export interface Test { + str: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_26.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_26.d.ts new file mode 100644 index 000000000..6bd48a873 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_26.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about expand type which is readonly + * + */ +export interface Test { + readonly constant: string; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_27.d.ets b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_27.d.ets new file mode 100644 index 000000000..e0859a929 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_27.d.ets @@ -0,0 +1,18 @@ +/* +* Copyright (C) 2023-2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +@Component +struct MyComponent { + @Prop primaryText: ResourceStr; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_28.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_28.d.ts new file mode 100644 index 000000000..9c1c0ae26 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_28.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for property about reduce type which is writable + * + */ +export interface Test { + str: string | number; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_29.d.ets b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_29.d.ets new file mode 100644 index 000000000..7874e04b2 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_29.d.ets @@ -0,0 +1,17 @@ +/* +* Copyright (C) 2023-2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +@Component +struct MyComponent { +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_30.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_30.d.ts new file mode 100644 index 000000000..f400bb51a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_30.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change constant value + */ +export namespace test { + const CONSTANT = 1; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_31.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_31.d.ts new file mode 100644 index 000000000..c817befda --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_31.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about change + * + */ +export namespace test { + type Type = 'none' ; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_32.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_32.d.ts new file mode 100644 index 000000000..9fdc95fca --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_32.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about expand + * + */ +export namespace test { + type Type = 'none'; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_33.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_33.d.ts new file mode 100644 index 000000000..abab0280f --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_33.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for type value about expand + * + */ +export namespace test { + type Type = 'none' | 'new'; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_34.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_34.d.ts new file mode 100644 index 000000000..4d43b1e87 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_34.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change enum menber value + */ +export enum Test { + VALUE_ONE, + + VALUE_TWO, + + VALUE_THREE, +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_35.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_35.d.ts new file mode 100644 index 000000000..cddce50a5 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_35.d.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change enum add menber + */ +export enum Test { + VALUE_ONE, + + VALUE_TWO, +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_36.d.ts b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_36.d.ts new file mode 100644 index 000000000..f400bb51a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiChange/old/API_CHANGE_INCOMPATIBLE_36.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ut for change constant value + */ +export namespace test { + const CONSTANT = 1; +} diff --git a/build-tools/dts_parser/test/ut/apiChange/old/image.png b/build-tools/dts_parser/test/ut/apiChange/old/image.png new file mode 100644 index 000000000..ace106ed7 Binary files /dev/null and b/build-tools/dts_parser/test/ut/apiChange/old/image.png differ diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_001.d.ts new file mode 100644 index 000000000..837017a51 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, d: string, b?: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_002.d.ts new file mode 100644 index 000000000..12346d0e4 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_method_multi_change_002.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(b: string, c: number, a: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_001.d.ts new file mode 100644 index 000000000..a81cf0986 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c?: boolean): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_002.d.ts new file mode 100644 index 000000000..842cfe1ca --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c?: boolean): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_003.d.ts new file mode 100644 index 000000000..5e7474aa7 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_optional_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string, c?: boolean): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_001.d.ts new file mode 100644 index 000000000..9bb06a9cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_002.d.ts new file mode 100644 index 000000000..bc807fbda --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c: boolean): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_003.d.ts new file mode 100644 index 000000000..7e9cea79e --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_new_required_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string, c: boolean): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_001.d.ts new file mode 100644 index 000000000..9bb06a9cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_002.d.ts new file mode 100644 index 000000000..068b0fb68 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_003.d.ts new file mode 100644 index 000000000..c10ffcb0c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_optional_to_required_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_001.d.ts new file mode 100644 index 000000000..1660f2c23 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string):void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_002.d.ts new file mode 100644 index 000000000..9989d3702 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(b: string, a: number): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_003.d.ts new file mode 100644 index 000000000..7d2d7184b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_position_change_003.d.ts @@ -0,0 +1 @@ +declare function testFun(b: string, a: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_001.d.ts new file mode 100644 index 000000000..dd4448679 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_002.d.ts new file mode 100644 index 000000000..dcc01f2ab --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b?: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_003.d.ts new file mode 100644 index 000000000..16070b036 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_required_to_optional_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a?: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_change.d.ts new file mode 100644 index 000000000..97e55e1ae --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_change.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableTest' | 'test', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_001.d.ts new file mode 100644 index 000000000..1ee9e67f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableChange' | 'styleChange', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_002.d.ts new file mode 100644 index 000000000..7fffaecf1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number | string, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_003.d.ts new file mode 100644 index 000000000..dc2c759f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_expand_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number | string): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_001.d.ts new file mode 100644 index 000000000..979c531d1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableChange', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_002.d.ts new file mode 100644 index 000000000..8a9e087f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_003.d.ts new file mode 100644 index 000000000..c10ffcb0c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_param_type_range_reduce_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_001.d.ts new file mode 100644 index 000000000..9f83501d0 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, c: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_002.d.ts new file mode 100644 index 000000000..068b0fb68 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_003.d.ts new file mode 100644 index 000000000..7ee663492 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_reduce_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(b: string, c: boolean): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_optional_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_optional_param.d.ts new file mode 100644 index 000000000..e47a9638b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_optional_param.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b?: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_required_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_required_param.d.ts new file mode 100644 index 000000000..467a4a19c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_new_required_param.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_optional_to_required.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_optional_to_required.d.ts new file mode 100644 index 000000000..467a4a19c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_optional_to_required.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_pos_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_pos_change.d.ts new file mode 100644 index 000000000..aed47a0d4 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_pos_change.d.ts @@ -0,0 +1 @@ +export type Test = (b: number, a: Error | any) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_required_to_optional.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_required_to_optional.d.ts new file mode 100644 index 000000000..e47a9638b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_required_to_optional.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b?: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_change_.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_change_.d.ts new file mode 100644 index 000000000..98176f91f --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_change_.d.ts @@ -0,0 +1 @@ +declare type Test = (value: number, ...args: string[] | number[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_expand.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_expand.d.ts new file mode 100644 index 000000000..5ed49dfb8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_expand.d.ts @@ -0,0 +1 @@ +declare type Test = (value: string, ...args: string[] | number[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_reduce.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_reduce.d.ts new file mode 100644 index 000000000..9c7258c2a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_param_type_range_reduce.d.ts @@ -0,0 +1 @@ +declare type Test = (value: string, ...args: string[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_reduce_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_reduce_param.d.ts new file mode 100644 index 000000000..a54bc846a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_reduce_param.d.ts @@ -0,0 +1 @@ +export type Test = (b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_change.d.ts new file mode 100644 index 000000000..74cab4696 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_change.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => Decorator | Test | string; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_expand.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_expand.d.ts new file mode 100644 index 000000000..e1e2ab2cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_expand.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => MethodDecorator |Test | string | TestDecorator; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_reduce.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_reduce.d.ts new file mode 100644 index 000000000..729bc05a6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_function_return_type_range_reduce.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => MethodDecorator | string; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_expand_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_expand_001.d.ts new file mode 100644 index 000000000..393307604 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_expand_001.d.ts @@ -0,0 +1,2 @@ +declare type TestType = + DataAddOperation | DataDeleteOperation | DataChangeOperation | DataMoveOperation | DataExchangeOperation | DataReloadOperation; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_reduce_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_reduce_001.d.ts new file mode 100644 index 000000000..184f249e4 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/new/ut_type_range_reduce_001.d.ts @@ -0,0 +1 @@ +declare type TestAlign = "center" | "end" | "left" | "right"; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_001.d.ts new file mode 100644 index 000000000..ff608ce7c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_002.d.ts new file mode 100644 index 000000000..705223929 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_method_multi_change_002.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c?:boolean): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_001.d.ts new file mode 100644 index 000000000..0e7732f8b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_002.d.ts new file mode 100644 index 000000000..068b0fb68 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_003.d.ts new file mode 100644 index 000000000..c9e2ad6b8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_optional_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_001.d.ts new file mode 100644 index 000000000..ff608ce7c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_002.d.ts new file mode 100644 index 000000000..068b0fb68 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_003.d.ts new file mode 100644 index 000000000..c9e2ad6b8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_new_required_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_001.d.ts new file mode 100644 index 000000000..dd4448679 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_002.d.ts new file mode 100644 index 000000000..6b4fc156b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b?: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_003.d.ts new file mode 100644 index 000000000..16070b036 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_optional_to_required_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a?: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_001.d.ts new file mode 100644 index 000000000..c8dfa84b8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(b: string, a: number):void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_002.d.ts new file mode 100644 index 000000000..bcee7fb64 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_003.d.ts new file mode 100644 index 000000000..c9e2ad6b8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_position_change_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_001.d.ts new file mode 100644 index 000000000..9bb06a9cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_002.d.ts new file mode 100644 index 000000000..068b0fb68 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_003.d.ts new file mode 100644 index 000000000..c10ffcb0c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_required_to_optional_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_change.d.ts new file mode 100644 index 000000000..979c531d1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_change.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableChange', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_001.d.ts new file mode 100644 index 000000000..979c531d1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableChange', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_002.d.ts new file mode 100644 index 000000000..8a9e087f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_003.d.ts new file mode 100644 index 000000000..c10ffcb0c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_expand_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_001.d.ts new file mode 100644 index 000000000..979c531d1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + on(type: 'enableChange', callback: Callback): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_002.d.ts new file mode 100644 index 000000000..7fffaecf1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number | string, b: string, c?: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_003.d.ts new file mode 100644 index 000000000..dc2c759f6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_param_type_range_reduce_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number | string): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_001.d.ts new file mode 100644 index 000000000..9bb06a9cf --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_001.d.ts @@ -0,0 +1,3 @@ +export default class Test { + testFun(a: number, b: string, c: number): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_002.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_002.d.ts new file mode 100644 index 000000000..370cde351 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_002.d.ts @@ -0,0 +1,3 @@ +declare namespace Test { + function testFun(a: number, b: string, c?: boolean): void; +} \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_003.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_003.d.ts new file mode 100644 index 000000000..7e9cea79e --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_reduce_param_003.d.ts @@ -0,0 +1 @@ +declare function testFun(a: number, b: string, c: boolean): void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_optional_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_optional_param.d.ts new file mode 100644 index 000000000..c29c7554c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_optional_param.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_required_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_required_param.d.ts new file mode 100644 index 000000000..c29c7554c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_new_required_param.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_optional_to_required.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_optional_to_required.d.ts new file mode 100644 index 000000000..e47a9638b --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_optional_to_required.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b?: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_pos_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_pos_change.d.ts new file mode 100644 index 000000000..467a4a19c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_pos_change.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_required_to_optional.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_required_to_optional.d.ts new file mode 100644 index 000000000..467a4a19c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_required_to_optional.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_change_.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_change_.d.ts new file mode 100644 index 000000000..9c7258c2a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_change_.d.ts @@ -0,0 +1 @@ +declare type Test = (value: string, ...args: string[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_expand.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_expand.d.ts new file mode 100644 index 000000000..9c7258c2a --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_expand.d.ts @@ -0,0 +1 @@ +declare type Test = (value: string, ...args: string[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_reduce.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_reduce.d.ts new file mode 100644 index 000000000..8e5aed4f2 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_param_type_range_reduce.d.ts @@ -0,0 +1 @@ +declare type Test = (value: string | number, ...args: string[]) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_reduce_param.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_reduce_param.d.ts new file mode 100644 index 000000000..467a4a19c --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_reduce_param.d.ts @@ -0,0 +1 @@ +export type Test = (a: Error | any, b: number) => void; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_change.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_change.d.ts new file mode 100644 index 000000000..729bc05a6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_change.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => MethodDecorator | string; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_expand.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_expand.d.ts new file mode 100644 index 000000000..729bc05a6 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_expand.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => MethodDecorator | string; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_reduce.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_reduce.d.ts new file mode 100644 index 000000000..e12ea0fe1 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_function_return_type_range_reduce.d.ts @@ -0,0 +1 @@ +declare type TestReturn = (value: string, ...args: string[]) => MethodDecorator | Test | string; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_expand_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_expand_001.d.ts new file mode 100644 index 000000000..b3666b9b8 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_expand_001.d.ts @@ -0,0 +1,2 @@ +declare type TestType = + DataAddOperation | DataDeleteOperation | DataChangeOperation | DataMoveOperation | DataExchangeOperation; \ No newline at end of file diff --git a/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_reduce_001.d.ts b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_reduce_001.d.ts new file mode 100644 index 000000000..69af1b453 --- /dev/null +++ b/build-tools/dts_parser/test/ut/apiDiff/old/ut_type_range_reduce_001.d.ts @@ -0,0 +1 @@ +declare type TestAlign = "center" | "end" | "left" | "right" | "start"; \ No newline at end of file diff --git a/build-tools/mdFiles.txt b/build-tools/mdFiles.txt index f9f0cb214..88f320b1c 100644 --- a/build-tools/mdFiles.txt +++ b/build-tools/mdFiles.txt @@ -1,2 +1,2 @@ # api absolute path -Z:\root\interface\sdk-js\api\xxx.d.ts \ No newline at end of file +Z:\root\interface\sdk-js\api\xxx.d.ts