diff --git a/code/DocsSample/ArkTSUtilsDocModule/.gitignore b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/.gitignore similarity index 92% rename from code/DocsSample/ArkTSUtilsDocModule/.gitignore rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/.gitignore index fbabf771011fe78f9919db0b1195ab6cadffc2b0..8514e821bac8db62bf0dfa9eca7f7eb5fa659116 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/.gitignore +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/.gitignore @@ -1,11 +1,11 @@ -/node_modules -/oh_modules -/local.properties -/.idea -**/build -/.hvigor -.cxx -/.clangd -/.clang-format -/.clang-tidy +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy **/.test \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/AppScope/app.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/app.json5 similarity index 85% rename from code/DocsSample/ArkTSUtilsDocModule/AppScope/app.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/app.json5 index 29ba22003405e9601a16182bd9330ab00f7bfa80..97a25f8cb904e363d36cb9080bf9c5b23f3b2379 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/AppScope/app.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/app.json5 @@ -1,25 +1,25 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "app": { - "bundleName": "com.samples.arktsutilsdocmodule", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name" - } -} +/* + * Copyright (c) 2025 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. + */ + +{ + "app": { + "bundleName": "com.samples.arktssimpledemo", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/AppScope/resources/base/element/string.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/resources/base/element/string.json similarity index 59% rename from code/DocsSample/ArkTSUtilsDocModule/AppScope/resources/base/element/string.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/resources/base/element/string.json index 0fe0a24a318666959f8f29fc217987a5d03c4a39..84d83e53f71a3bfdb67fb019038549e5033f1dfa 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/AppScope/resources/base/element/string.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/resources/base/element/string.json @@ -1,8 +1,8 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ArkTSUtilsDocsSample" - } - ] -} +{ + "string": [ + { + "name": "app_name", + "value": "ArkTsSimpleDemo" + } + ] +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/AppScope/resources/base/media/app_icon.png b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/resources/base/media/app_icon.png similarity index 100% rename from code/DocsSample/ArkTSUtilsDocModule/AppScope/resources/base/media/app_icon.png rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/AppScope/resources/base/media/app_icon.png diff --git a/code/DocsSample/ArkTSUtilsDocModule/README.MD b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README.MD similarity index 96% rename from code/DocsSample/ArkTSUtilsDocModule/README.MD rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README.MD index 013a73a6e75abee83f1b325099cc20bcf32b7da2..100898f456a9eefe0725dac6176de54277b74bf6 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/README.MD +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README.MD @@ -1,73 +1,73 @@ -# Example ArkTS Guide Document - -### Introduction - -This example uses the [ArkTS Guide Document]( https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/arkts-utils )The development examples of various scenarios in the project are presented to help developers better understand the various capabilities provided by ArkTS and make reasonable use of them. The detailed description of the code displayed in this project can be found in the following link: - -1. [Shared module development guidance](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/arkts-sendable-module.md). -2. [CPU intensive task development guidance(TaskPool and Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md). -3. [I/O intensive task development guide(TaskPool)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/io-intensive-task-development.md). -4. [Single I/O task development guidance(Promise and async/await)](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.1-Release/zh-cn/application-dev/arkts-utils/single-io-development.md). -5. [Synchronous task development guidance(TaskPool and Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/sync-task-development.md). -6. [Overview of Asynchronous Concurrency(Promise and async/await)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/async-concurrency-overview.md). - -### Effect preview - -|Homepage | Dropdown options for selecting various scenarios | Immediate feedback on execution and results| -|-------------------------------------|-------------------------------------|-----------------------| -| ![](screenshots/device/image1.jpeg) | ![](screenshots/device/image2.jpeg) | ![](screenshots/device/image3.jpeg) | - -### Instructions for use - -1. On the main interface, you can click on the dropdown option and select the scene that needs to be executed. - -2. Select the scenario that needs to be executed and click the * * Execute this Test * * button below to start executing. - -3. The execution result will be immediately feedback above the button. - -### Engineering Catalog - -``` -entry/src/main/ets/ -|---entryability -|---managers -| |---arkts-sendable-module.ets // sample code for shared modules -| |---async-concurrency-overview.ets // asynchronous example code -| |---cpu-intensive-task.ets // example code for intensive tasks -| |---file-write.ets // sample code for file read and write implementation -| |---Handle.ets // sample code for synchronizing task data definition -| |---io-intensive-task.ets // IO intensive example code -| |---manager.ets // summarize and call the functions of each module -| |---sharedModule.ets // sample code for defining shared module data -| |---single-io-development.ets // single IO Example Code -| |---sync-task-development.ets // sample code for synchronization task -|---pages -| |---Index.ets // 应用页面 -``` - -### Related permissions - -Not involved. - -### Dependency - -Not involved. - -### Constraints and limitations -1. This example only supports running on standard systems and supports devices such as RK3568. - -2. This example is a Stage model that supports API12 version SDK, version number: 5.0.0.26, and image version number: OpenHarmony_5.0.0.27. - -3. This example requires DevEco Studio NEXT Developer Preview2 (Build Version: 4.1.3.700, build on March 19, 2024) and above to compile and run. - -### Download - -To download this project separately, execute the following command: - -```` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkTSUtilsDocModule/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master +# Example ArkTS Guide Document + +### Introduction + +This example uses the [ArkTS Guide Document]( https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/arkts-utils )The development examples of various scenarios in the project are presented to help developers better understand the various capabilities provided by ArkTS and make reasonable use of them. The detailed description of the code displayed in this project can be found in the following link: + +1. [Shared module development guidance](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/arkts-sendable-module.md). +2. [CPU intensive task development guidance(TaskPool and Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md). +3. [I/O intensive task development guide(TaskPool)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/io-intensive-task-development.md). +4. [Single I/O task development guidance(Promise and async/await)](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.1-Release/zh-cn/application-dev/arkts-utils/single-io-development.md). +5. [Synchronous task development guidance(TaskPool and Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/sync-task-development.md). +6. [Overview of Asynchronous Concurrency(Promise and async/await)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/async-concurrency-overview.md). + +### Effect preview + +|Homepage | Dropdown options for selecting various scenarios | Immediate feedback on execution and results| +|-------------------------------------|-------------------------------------|-----------------------| +| ![](screenshots/device/image1.jpeg) | ![](screenshots/device/image2.jpeg) | ![](screenshots/device/image3.jpeg) | + +### Instructions for use + +1. On the main interface, you can click on the dropdown option and select the scene that needs to be executed. + +2. Select the scenario that needs to be executed and click the * * Execute this Test * * button below to start executing. + +3. The execution result will be immediately feedback above the button. + +### Engineering Catalog + +``` +entry/src/main/ets/ +|---entryability +|---managers +| |---arkts-sendable-module.ets // sample code for shared modules +| |---async-concurrency-overview.ets // asynchronous example code +| |---cpu-intensive-task.ets // example code for intensive tasks +| |---file-write.ets // sample code for file read and write implementation +| |---Handle.ets // sample code for synchronizing task data definition +| |---io-intensive-task.ets // IO intensive example code +| |---manager.ets // summarize and call the functions of each module +| |---sharedModule.ets // sample code for defining shared module data +| |---single-io-development.ets // single IO Example Code +| |---sync-task-development.ets // sample code for synchronization task +|---pages +| |---Index.ets // 应用页面 +``` + +### Related permissions + +Not involved. + +### Dependency + +Not involved. + +### Constraints and limitations +1. This example only supports running on standard systems and supports devices such as RK3568. + +2. This example is a Stage model that supports API12 version SDK, version number: 5.0.0.26, and image version number: OpenHarmony_5.0.0.27. + +3. This example requires DevEco Studio NEXT Developer Preview2 (Build Version: 4.1.3.700, build on March 19, 2024) and above to compile and run. + +### Download + +To download this project separately, execute the following command: + +```` +git init +git config core.sparsecheckout true +echo code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/ > .git/info/sparse-checkout +git remote add origin https://gitee.com/openharmony/applications_app_samples.git +git pull origin master ```` \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/README_zh.md b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README_zh.md similarity index 79% rename from code/DocsSample/ArkTSUtilsDocModule/README_zh.md rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README_zh.md index eb900d664bd54cd3eaf889835603c39edda3cd31..4e965076347699148ea2f859f99c613b9e72b1da 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/README_zh.md +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/README_zh.md @@ -1,76 +1,73 @@ -# ArkTS指南文档示例 - -### 介绍 - -本示例通过使用[ArkTS指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/arkts-utils)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkTS提供的各项能力并合理使用。 - -该工程中展示的代码详细描述可查如下链接: - -1. [共享模块开发指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/arkts-sendable-module.md) -2. [CPU密集型任务开发指导 (TaskPool和Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md) -3. [I/O密集型任务开发指导 (TaskPool)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/io-intensive-task-development.md) -4. [单次I/O任务开发指导 (Promise和async/await)](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.1-Release/zh-cn/application-dev/arkts-utils/single-io-development.md) -5. [同步任务开发指导 (TaskPool和Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/sync-task-development.md) -6. [异步并发概述 (Promise和async/await)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/async-concurrency-overview.md) - -### 效果预览 - -| 首页 | 下拉选项选择各场景 | 执行及结果即时反馈 | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| ![](screenshots/device/image1.jpeg) | ![](screenshots/device/image2.jpeg) | ![](screenshots/device/image3.jpeg) | - -### 使用说明 - -1. 在主界面,可以点击下拉选项,选择需要执行的场景。 - -2. 选择需要执行的场景,点击下方**Execute this Test**按钮开始执行。 - -3. 执行结果会即时反馈在按钮上方。 - -### 工程目录 - -``` -entry/src/main/ets/ -|---entryability -|---managers -| |---arkts-sendable-module.ets // 共享模块示例代码 -| |---async-concurrency-overview.ets // 异步示例代码 -| |---cpu-intensive-task.ets // 密集型任务示例代码 -| |---file-write.ets // 文件读写实现示例代码 -| |---Handle.ets // 同步任务数据定义示例代码 -| |---io-intensive-task.ets // IO密集型示例代码 -| |---manager.ets // 各模块函数汇总调用 -| |---sharedModule.ets // 共享模块数据定义示例代码 -| |---single-io-development.ets // 单次IO示例代码 -| |---sync-task-development.ets // 同步任务示例代码 -|---pages -| |---Index.ets // 应用页面 -``` - -### 相关权限 - -不涉及。 - -### 依赖 - -不涉及。 - -### 约束与限制 - -1.本示例仅支持标准系统上运行, 支持设备:RK3568。 - -2.本示例为Stage模型,支持API12版本SDK,版本号:5.0.0.26,镜像版本号:OpenHarmony_5.0.0.27。 - -3.本示例需要使用DevEco Studio NEXT Developer Preview2 (Build Version: 4.1.3.700, built on March 19, 2024)及以上版本才可编译运行。 - -### 下载 - -如需单独下载本工程,执行如下命令: - -``` -git init -git config core.sparsecheckout true -echo code/DocsSample/ArkTSUtilsDocModule/ > .git/info/sparse-checkout -git remote add origin https://gitee.com/openharmony/applications_app_samples.git -git pull origin master -``` +# ArkTS指南文档示例 + +### 介绍 + +本示例通过使用[ArkTS指南文档](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/arkts-utils)中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkTS提供的各项能力并合理使用。该工程中展示的代码详细描述可查如下链接: + +1. [共享模块开发指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/arkts-sendable-module.md)。 +2. [CPU密集型任务开发指导 (TaskPool和Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/cpu-intensive-task-development.md)。 +3. [I/O密集型任务开发指导 (TaskPool)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/io-intensive-task-development.md)。 +4. [单次I/O任务开发指导 (Promise和async/await)](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.1-Release/zh-cn/application-dev/arkts-utils/single-io-development.md)。 +5. [同步任务开发指导 (TaskPool和Worker)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/sync-task-development.md)。 +6. [异步并发概述 (Promise和async/await)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/async-concurrency-overview.md)。 + +### 效果预览 + +| 首页 | 下拉选项选择各场景 | 执行及结果即时反馈 | +|-------------------------------------|-------------------------------------|-----------------------| +| ![](screenshots/device/image1.jpeg) | ![](screenshots/device/image2.jpeg) | ![](screenshots/device/image3.jpeg) | + +### 使用说明 + +1. 在主界面,可以点击下拉选项,选择需要执行的场景。 + +2. 选择需要执行的场景,点击下方**Execute this Test**按钮开始执行。 + +3. 执行结果会即时反馈在按钮上方。 + +### 工程目录 +``` +entry/src/main/ets/ +|---entryability +|---managers +| |---arkts-sendable-module.ets // 共享模块示例代码 +| |---async-concurrency-overview.ets // 异步示例代码 +| |---cpu-intensive-task.ets // 密集型任务示例代码 +| |---file-write.ets // 文件读写实现示例代码 +| |---Handle.ets // 同步任务数据定义示例代码 +| |---io-intensive-task.ets // IO密集型示例代码 +| |---manager.ets // 各模块函数汇总调用 +| |---sharedModule.ets // 共享模块数据定义示例代码 +| |---single-io-development.ets // 单次IO示例代码 +| |---sync-task-development.ets // 同步任务示例代码 +|---pages +| |---Index.ets // 应用页面 +``` + +### 相关权限 + +不涉及。 + +### 依赖 + +不涉及。 + +### 约束与限制 + +1.本示例仅支持标准系统上运行, 支持设备:RK3568。 + +2.本示例为Stage模型,支持API12版本SDK,版本号:5.0.0.26,镜像版本号:OpenHarmony_5.0.0.27。 + +3.本示例需要使用DevEco Studio NEXT Developer Preview2 (Build Version: 4.1.3.700, built on March 19, 2024)及以上版本才可编译运行。 + +### 下载 + +如需单独下载本工程,执行如下命令: + +```` +git init +git config core.sparsecheckout true +echo code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/ > .git/info/sparse-checkout +git remote add origin https://gitee.com/openharmony/applications_app_samples.git +git pull origin master +```` \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/build-profile.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/build-profile.json5 similarity index 92% rename from code/DocsSample/ArkTSUtilsDocModule/build-profile.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/build-profile.json5 index b1c8c3cd25bd7355607a7694e7dfe04383ee7c2b..9ce78bb919b07f7d16de56c5d7cb350d0aca204a 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/build-profile.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/build-profile.json5 @@ -1,51 +1,51 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "app": { - "signingConfigs": [], - "products": [ - { - "name": "default", - "signingConfig": "default", - "compileSdkVersion": 12, - "compatibleSdkVersion": 12, - "runtimeOS": "OpenHarmony", - } - ], - "buildModeSet": [ - { - "name": "debug", - }, - { - "name": "release" - } - ] - }, - "modules": [ - { - "name": "entry", - "srcPath": "./entry", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] - } - ] +/* + * Copyright (c) 2025 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. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compileSdkVersion": 12, + "compatibleSdkVersion": 12, + "runtimeOS": "OpenHarmony", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/.gitignore b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/.gitignore similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/.gitignore rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/.gitignore index e2713a2779c5a3e0eb879efe6115455592caeea5..32abf8fd5e44623ebe60bf2adeee4a366372cc85 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/.gitignore +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/.gitignore @@ -1,6 +1,6 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx +/node_modules +/oh_modules +/.preview +/build +/.cxx /.test \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/build-profile.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/build-profile.json5 similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/build-profile.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/build-profile.json5 index 63b88fb1a0053e40acb2391457a7e9d71af748fe..9377bc2b1878408fedd07f908195cb9de2ad4583 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/build-profile.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/build-profile.json5 @@ -1,43 +1,43 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "apiType": "stageMode", - "buildOption": { - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] +/* + * Copyright (c) 2025 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. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/hvigorfile.ts b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/hvigorfile.ts similarity index 97% rename from code/DocsSample/ArkTSUtilsDocModule/entry/hvigorfile.ts rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/hvigorfile.ts index c6edcd90486dd5a853cf7d34c8647f08414ca7a3..ba9480d0a9291ab74ff5856e77634a1c05d027a9 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/hvigorfile.ts +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/hvigorfile.ts @@ -1,6 +1,6 @@ -import { hapTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/obfuscation-rules.txt b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/obfuscation-rules.txt similarity index 85% rename from code/DocsSample/ArkTSUtilsDocModule/entry/obfuscation-rules.txt rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/obfuscation-rules.txt index 985b2aeb7658286b17bd26eab8f217c3fe75ea8b..3277ba04f832c1c88d7722dcc1953d595bdb2d8d 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/obfuscation-rules.txt +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/obfuscation-rules.txt @@ -1,18 +1,22 @@ -# Define project specific obfuscation rules here. -# You can include the obfuscation configuration files in the current module's build-profile.json5. -# -# For more details, see -# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md - -# Obfuscation options: -# -disable-obfuscation: disable all obfuscations -# -enable-property-obfuscation: obfuscate the property names -# -enable-toplevel-obfuscation: obfuscate the names in the global scope -# -compact: remove unnecessary blank spaces and all line feeds -# -remove-log: remove all console.* statements -# -print-namecache: print the name cache that contains the mapping from the old names to new names -# -apply-namecache: reuse the given cache file - -# Keep options: -# -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/oh-package.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/oh-package.json5 similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/oh-package.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/oh-package.json5 index 4e54d14e1b444a338b2c922f94a4fe4deed5be45..4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/oh-package.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/oh-package.json5 @@ -1,25 +1,25 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": {} -} - +/* + * Copyright (c) 2025 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. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/entryability/EntryAbility.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/entryability/EntryAbility.ets similarity index 95% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/entryability/EntryAbility.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/entryability/EntryAbility.ets index 6dc4e216a727aec21761c0200d30d7af0150e128..1d3bd73402408476e94dec764490601a5f6a5011 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/entryability/EntryAbility.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/entryability/EntryAbility.ets @@ -1,56 +1,56 @@ -/* - * Copyright (c) 2024 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. - */ - -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} +/* + * Copyright (c) 2025 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. + */ + +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/Handle.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/Handle.ets similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/Handle.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/Handle.ets index 49a5e2613ea1a84d6b6ec954de7f9d28247e7c23..9e13fff60475c0867d566d9082f150d8bd54baa0 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/Handle.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/Handle.ets @@ -1,45 +1,45 @@ -/* - * Copyright (c) 2024 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. - */ - -'use shared' - -@Sendable -export default class Handle { - private static instance: Handle = new Handle; - static getInstance(): Handle { - // 返回单例对象 - return Handle.instance; - } - - static syncGet(): void { - // 同步Get方法 - } - - static syncSet(num: number): number { - // 模拟同步步骤1 - console.info('taskpool: this is 1st print!'); - // 模拟同步步骤2 - console.info('taskpool: this is 2nd print!'); - return ++num; - } - - static syncSet2(num: number): number { - // 模拟同步步骤1 - console.info('taskpool: this is syncSet2 1st print!'); - // 模拟同步步骤2 - console.info('taskpool: this is syncSet2 2nd print!'); - return ++num; - } +/* + * Copyright (c) 2025 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. + */ + +'use shared' + +@Sendable +export default class Handle { + private static instance: Handle = new Handle; + static getInstance(): Handle { + // 返回单例对象 + return Handle.instance; + } + + static syncGet(): void { + // 同步Get方法 + } + + static syncSet(num: number): number { + // 模拟同步步骤1 + console.info('taskpool: this is 1st print!'); + // 模拟同步步骤2 + console.info('taskpool: this is 2nd print!'); + return ++num; + } + + static syncSet2(num: number): number { + // 模拟同步步骤1 + console.info('taskpool: this is syncSet2 1st print!'); + // 模拟同步步骤2 + console.info('taskpool: this is syncSet2 2nd print!'); + return ++num; + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/arkts-sendable-module.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/arkts-sendable-module.ets similarity index 90% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/arkts-sendable-module.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/arkts-sendable-module.ets index 4d0ec2cae0760dd2b0765ffb153c637d5b5c9432..122a108d40b8973c39455e0a88ac2cb4fc35637b 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/arkts-sendable-module.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/arkts-sendable-module.ets @@ -1,51 +1,51 @@ -/* - * Copyright (c) 2024 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. - */ - -import { taskpool } from '@kit.ArkTS'; -import { SingletonA } from './sharedModule'; - -let sig: SingletonA = SingletonA.getInstance(); - -@Concurrent -async function test2(sig: SingletonA) { - console.info('sendable: taskpool count is:' + await sig.getCount()); - let n = Date.now(); - // 等待1000us,模拟实际业务 - while (Date.now() - n < 1000) { - console.info('this is test2 func'); - } -} - -async function mainThreadTest() { - // 主线程调用单例sig.incrementCount()、fetchCount(); - sig.increaseCount(); - console.info('sendable: main thread count is:' + await sig.getCount()); -} - -async function childThreadTest() { - let task = new taskpool.Task(test2, sig); - await taskpool.execute(task); -} - -export async function sendableModuleTest(): Promise { - await mainThreadTest(); - childThreadTest(); - if(await sig.getCount() == 1) { - console.info('arkts-utils:: SendableModuleTest success'); - return 'SendableModuleTest Succeed'; - } else { - return 'SendableModuleTest Failed'; - } +/* + * Copyright (c) 2025 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. + */ + +import { taskpool } from '@kit.ArkTS'; +import { SingletonA } from './sharedModule'; + +let sig: SingletonA = SingletonA.getInstance(); + +@Concurrent +async function test2(sig: SingletonA) { + console.info('sendable: taskpool count is:' + await sig.getCount()); + let n = Date.now(); + // 等待1000us,模拟实际业务 + while (Date.now() - n < 1000) { + console.info('this is test2 func'); + } +} + +async function mainThreadTest() { + // 主线程调用单例sig.incrementCount()、fetchCount(); + sig.increaseCount(); + console.info('sendable: main thread count is:' + await sig.getCount()); +} + +async function childThreadTest() { + let task = new taskpool.Task(test2, sig); + await taskpool.execute(task); +} + +export async function sendableModuleTest(): Promise { + await mainThreadTest(); + childThreadTest(); + if(await sig.getCount() == 1) { + console.info('ArkTs-SimpleDemo:: SendableModuleTest success'); + return 'SendableModuleTest Succeed'; + } else { + return 'SendableModuleTest Failed'; + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/async-concurrency-overview.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/async-concurrency-overview.ets similarity index 92% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/async-concurrency-overview.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/async-concurrency-overview.ets index a31eed2a47caf34e079d54fc3a7f9e85ae2f261a..a2b874f8e51192de3fac588aca9a30d996c74788 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/async-concurrency-overview.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/async-concurrency-overview.ets @@ -1,28 +1,28 @@ -/* - * Copyright (c) 2024 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 async function asyncConcurrencyTest(): Promise { - const result: string = await new Promise((resolve: Function) => { - setTimeout(() => { - resolve('Hello, world!'); - }, 3000); - }); - console.info(result); // 输出: Hello, world! - if (result == 'Hello, world!') { - return 'AsyncConcurrencyTest Succeed'; - } else { - return 'AsyncConcurrencyTest Failed'; - } +/* + * Copyright (c) 2025 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 async function asyncConcurrencyTest(): Promise { + const result: string = await new Promise((resolve: Function) => { + setTimeout(() => { + resolve('Hello, world!'); + }, 3000); + }); + console.info(result); // 输出: Hello, world! + if (result == 'Hello, world!') { + return 'AsyncConcurrencyTest Succeed'; + } else { + return 'AsyncConcurrencyTest Failed'; + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/cpu-intensive-task.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/cpu-intensive-task.ets similarity index 95% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/cpu-intensive-task.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/cpu-intensive-task.ets index 96e497782fe7e8a2ab8ea171b93efa0ad8eb799d..7610685705b77c8007abad68180db5c6781b8125 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/cpu-intensive-task.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/cpu-intensive-task.ets @@ -1,54 +1,54 @@ -/* - * Copyright (c) 2024 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. - */ - -import { taskpool } from '@kit.ArkTS'; - -@Concurrent -function imageProcessing(dataSlice: ArrayBuffer): ArrayBuffer { - // 步骤1: 具体的图像处理操作及其他耗时操作 - return dataSlice; -} - -function histogramStatistic(pixelBuffer: ArrayBuffer): void { - // 步骤2: 分成三段并发调度 - let number: number = pixelBuffer.byteLength / 3; - let buffer1: ArrayBuffer = pixelBuffer.slice(0, number); - let buffer2: ArrayBuffer = pixelBuffer.slice(number, number * 2); - let buffer3: ArrayBuffer = pixelBuffer.slice(number * 2); - - let group: taskpool.TaskGroup = new taskpool.TaskGroup(); - group.addTask(imageProcessing, buffer1); - group.addTask(imageProcessing, buffer2); - group.addTask(imageProcessing, buffer3); - - taskpool.execute(group, taskpool.Priority.HIGH).then((ret: Object) => { - // 步骤3: 结果数组汇总处理 - }) -} - -export async function imagePreprocessing(): Promise { - let context = getContext(); - // 获取resourceManager资源管理器 - const resourceMgr = context.resourceManager; - - const fileData = await resourceMgr.getRawFileContent('startIcon.png'); - // 获取图片的ArrayBuffer - const buffer = fileData.buffer; - - const arrayBuffer = new ArrayBuffer(buffer.byteLength); - new Uint8Array(arrayBuffer).set(new Uint8Array(buffer)); - histogramStatistic(arrayBuffer); - return 'imagePreprocessing success'; -} +/* + * Copyright (c) 2025 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. + */ + +import { taskpool } from '@kit.ArkTS'; + +@Concurrent +function imageProcessing(dataSlice: ArrayBuffer): ArrayBuffer { + // 步骤1: 具体的图像处理操作及其他耗时操作 + return dataSlice; +} + +function histogramStatistic(pixelBuffer: ArrayBuffer): void { + // 步骤2: 分成三段并发调度 + let number: number = pixelBuffer.byteLength / 3; + let buffer1: ArrayBuffer = pixelBuffer.slice(0, number); + let buffer2: ArrayBuffer = pixelBuffer.slice(number, number * 2); + let buffer3: ArrayBuffer = pixelBuffer.slice(number * 2); + + let group: taskpool.TaskGroup = new taskpool.TaskGroup(); + group.addTask(imageProcessing, buffer1); + group.addTask(imageProcessing, buffer2); + group.addTask(imageProcessing, buffer3); + + taskpool.execute(group, taskpool.Priority.HIGH).then((ret: Object) => { + // 步骤3: 结果数组汇总处理 + }) +} + +export async function imagePreprocessing(): Promise { + let context = getContext(); + // 获取resourceManager资源管理器 + const resourceMgr = context.resourceManager; + + const fileData = await resourceMgr.getRawFileContent('startIcon.png'); + // 获取图片的ArrayBuffer + const buffer = fileData.buffer; + + const arrayBuffer = new ArrayBuffer(buffer.byteLength); + new Uint8Array(arrayBuffer).set(new Uint8Array(buffer)); + histogramStatistic(arrayBuffer); + return 'imagePreprocessing success'; +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/file-write.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/file-write.ets similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/file-write.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/file-write.ets index ca4bc84d41d9a1040d51c1dff073e44aa1bc783a..6d07bd8799528a633f5c59635f4684281f8b5fc0 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/file-write.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/file-write.ets @@ -1,24 +1,24 @@ -/* - * Copyright (c) 2024 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. - */ - -import { fileIo } from '@kit.CoreFileKit'; - -// 定义并发函数,内部密集调用I/O能力 -// 写入文件的实现 -export async function write(data: string, filePath: string): Promise { - let file: fileIo.File = await fileIo.open(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - await fileIo.write(file.fd, data); - fileIo.close(file); -} +/* + * Copyright (c) 2025 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. + */ + +import { fileIo } from '@kit.CoreFileKit'; + +// 定义并发函数,内部密集调用I/O能力 +// 写入文件的实现 +export async function write(data: string, filePath: string): Promise { + let file: fileIo.File = await fileIo.open(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); + await fileIo.write(file.fd, data); + fileIo.close(file); +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/io-intensive-task.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/io-intensive-task.ets similarity index 80% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/io-intensive-task.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/io-intensive-task.ets index 06bfb30a9ee6e1db14695138a73aac571b1b1ac2..1546387b215377512da10e963aff8c5bb39863ca 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/io-intensive-task.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/io-intensive-task.ets @@ -1,50 +1,50 @@ -/* - * Copyright (c) 2024 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. - */ - -import { write } from './file-write'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { taskpool } from '@kit.ArkTS'; -import { fileIo } from '@kit.CoreFileKit'; - -@Concurrent -async function concurrentTest(fileList: string[]): Promise { - // 循环写文件操作 - for (let i: number = 0; i < fileList.length; i++) { - console.info('arkts-utils:: this filepath is:' + fileList[i]); - write('Hello World!', fileList[i]).then(() => { - console.info(`arkts-utils:: Succeeded in writing the file. FileList: ${fileList[i]}`); - }).catch((err: BusinessError) => { - console.error(`arkts-utils:: Failed to write the file. Code is ${err.code}, message is ${err.message}`); - return false; - }) - } - return true; -} - -export async function ioTaskTest(): Promise { - let context = getContext(); - const filePath1 = context.filesDir + '/111.txt'; - const filePath2 = context.filesDir + '/222.txt'; - - // 使用TaskPool执行包含密集I/O的并发函数 - // 数组较大时,I/O密集型任务任务分发也会抢占主线程,需要使用多线程能力 - await taskpool.execute(concurrentTest, [filePath1, filePath2]); - let result = fileIo.access(filePath1, fileIo.AccessModeType.EXIST); - - if (!result) { - return 'IoTaskTest Failed'; - } - return 'IoTaskTest Succeed'; +/* + * Copyright (c) 2025 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. + */ + +import { write } from './file-write'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { taskpool } from '@kit.ArkTS'; +import { fileIo } from '@kit.CoreFileKit'; + +@Concurrent +async function concurrentTest(fileList: string[]): Promise { + // 循环写文件操作 + for (let i: number = 0; i < fileList.length; i++) { + console.info('ArkTs-SimpleDemo:: this filepath is:' + fileList[i]); + write('Hello World!', fileList[i]).then(() => { + console.info(`ArkTs-SimpleDemo:: Succeeded in writing the file. FileList: ${fileList[i]}`); + }).catch((err: BusinessError) => { + console.error(`ArkTs-SimpleDemo:: Failed to write the file. Code is ${err.code}, message is ${err.message}`); + return false; + }) + } + return true; +} + +export async function ioTaskTest(): Promise { + let context = getContext(); + const filePath1 = context.filesDir + '/111.txt'; + const filePath2 = context.filesDir + '/222.txt'; + + // 使用TaskPool执行包含密集I/O的并发函数 + // 数组较大时,I/O密集型任务任务分发也会抢占主线程,需要使用多线程能力 + await taskpool.execute(concurrentTest, [filePath1, filePath2]); + let result = fileIo.access(filePath1, fileIo.AccessModeType.EXIST); + + if (!result) { + return 'IoTaskTest Failed'; + } + return 'IoTaskTest Succeed'; } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/manager.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/manager.ets similarity index 75% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/manager.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/manager.ets index 2fb0518149e7e6a5e16edb119d5d93ef52bae172..c0ad16e011196480916c4cc625b3ce90a11f39ba 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/manager.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/manager.ets @@ -1,55 +1,55 @@ -/* - * Copyright (c) 2024 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. - */ - -import { sendableModuleTest } from './arkts-sendable-module'; -import { imagePreprocessing } from './cpu-intensive-task'; -import { ioTaskTest } from './io-intensive-task'; -import { singleIoTest } from './single-io-development'; -import { syncTaskTest } from './sync-task-development'; -import { asyncConcurrencyTest } from './async-concurrency-overview'; - -type TestFunction = (() => string | Promise); -type TestList = [name: string, func: TestFunction][]; -let allTests: TestList = [ - ['arkts-utils/arkts-sendable-module', sendableModuleTest], - ['arkts-utils/cpu-intensive-task-development', imagePreprocessing], - ['arkts-utils/io-intensive-task-development', ioTaskTest], - ['arkts-utils/single-io-development', singleIoTest], - ['arkts-utils/sync-task-development', syncTaskTest], - ['arkts-utils/async-concurrency-overview', asyncConcurrencyTest], -]; - -export function listAllTests(): TestList { - return allTests; -} - -let currentTest: string = allTests[0][0]; -export function selectTest(index: number, value: string) { - currentTest = value; -} - -export function startTest(): Promise { - let item = allTests.find((v) => { - return v[0] == currentTest; - }); - if(item != undefined) { - return new Promise((res) => { - let v = item![1](); - res(v); - }) - } else { - return Promise.resolve('Error! Selected test is not found.'); - } +/* + * Copyright (c) 2025 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. + */ + +import { sendableModuleTest } from './arkts-sendable-module'; +import { imagePreprocessing } from './cpu-intensive-task'; +import { ioTaskTest } from './io-intensive-task'; +import { singleIoTest } from './single-io-development'; +import { syncTaskTest } from './sync-task-development'; +import { asyncConcurrencyTest } from './async-concurrency-overview'; + +type TestFunction = (() => string | Promise); +type TestList = [name: string, func: TestFunction][]; +let allTests: TestList = [ + ['ArkTs-SimpleDemo/arkts-sendable-module', sendableModuleTest], + ['ArkTs-SimpleDemo/cpu-intensive-task-development', imagePreprocessing], + ['ArkTs-SimpleDemo/io-intensive-task-development', ioTaskTest], + ['ArkTs-SimpleDemo/single-io-development', singleIoTest], + ['ArkTs-SimpleDemo/sync-task-development', syncTaskTest], + ['ArkTs-SimpleDemo/async-concurrency-overview', asyncConcurrencyTest], +]; + +export function listAllTests(): TestList { + return allTests; +} + +let currentTest: string = allTests[0][0]; +export function selectTest(index: number, value: string) { + currentTest = value; +} + +export function startTest(): Promise { + let item = allTests.find((v) => { + return v[0] == currentTest; + }); + if(item != undefined) { + return new Promise((res) => { + let v = item![1](); + res(v); + }) + } else { + return Promise.resolve('Error! Selected test is not found.'); + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sharedModule.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sharedModule.ets similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sharedModule.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sharedModule.ets index 2799d3e77dbcbe26972c4bbffd9e176085e4bc67..caf4986823ce2dd8114ebb40d989d4a7067459d1 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sharedModule.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sharedModule.ets @@ -1,46 +1,46 @@ -/* - * Copyright (c) 2024 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. - */ - -// 共享模块sharedModule.ets -import { ArkTSUtils } from '@kit.ArkTS'; - -// 声明当前模块为共享模块,只能导出可Sendable数据 -'use shared' - -export { SingletonA } - -// 共享模块,SingletonA全局唯一 -@Sendable -class SingletonA { - private static instance: SingletonA = new SingletonA; - private count_: number = 0; - private lock_: ArkTSUtils.locks.AsyncLock = new ArkTSUtils.locks.AsyncLock(); - - public static getInstance(): SingletonA { - return SingletonA.instance; - } - - public async getCount(): Promise { - return this.lock_.lockAsync(() => { - return this.count_; - }) - } - - public async increaseCount() { - await this.lock_.lockAsync(() => { - this.count_++; - }) - } +/* + * Copyright (c) 2025 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. + */ + +// 共享模块sharedModule.ets +import { ArkTSUtils } from '@kit.ArkTS'; + +// 声明当前模块为共享模块,只能导出可Sendable数据 +'use shared' + +export { SingletonA } + +// 共享模块,SingletonA全局唯一 +@Sendable +class SingletonA { + private static instance: SingletonA = new SingletonA; + private count_: number = 0; + private lock_: ArkTSUtils.locks.AsyncLock = new ArkTSUtils.locks.AsyncLock(); + + public static getInstance(): SingletonA { + return SingletonA.instance; + } + + public async getCount(): Promise { + return this.lock_.lockAsync(() => { + return this.count_; + }) + } + + public async increaseCount() { + await this.lock_.lockAsync(() => { + this.count_++; + }) + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/single-io-development.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/single-io-development.ets similarity index 95% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/single-io-development.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/single-io-development.ets index e62d0f411ad9afba55ddf4b3474058ebdd9defd9..e1b8b15fd835fb5a0981d408ee8c87bae2ac77e1 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/single-io-development.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/single-io-development.ets @@ -1,45 +1,45 @@ -/* - * Copyright (c) 2024 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. - */ - -import { fileIo } from '@kit.CoreFileKit'; -import { BusinessError } from '@ohos.base'; -import { common } from '@kit.AbilityKit'; - -async function write(data: string, file: fileIo.File): Promise { - fileIo.write(file.fd, data).then((writeLen: number) => { - console.info('write data length is: ' + writeLen); - }).catch((err: BusinessError) => { - console.error(`Failed to write data. Code is ${err.code}, message is ${err.message}`); - }) -} - -export async function singleIoTest(): Promise { - let context = getContext() as common.UIAbilityContext; - let filePath: string = context.filesDir + '/ioTest.txt'; // 应用文件路径 - let file: fileIo.File = await fileIo.open(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); - write('Hello World!', file).then(() => { - console.info('Succeeded in writing data.'); - fileIo.close(file); - }).catch((err: BusinessError) => { - console.error(`Failed to write data. Code is ${err.code}, message is ${err.message}`); - fileIo.close(file); - }) - - let result = await fileIo.access(filePath, fileIo.AccessModeType.EXIST); - if (!result) { - return 'SingleIoTest Failed'; - } - return 'SingleIoTest Succeed'; +/* + * Copyright (c) 2025 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. + */ + +import { fileIo } from '@kit.CoreFileKit'; +import { BusinessError } from '@ohos.base'; +import { common } from '@kit.AbilityKit'; + +async function write(data: string, file: fileIo.File): Promise { + fileIo.write(file.fd, data).then((writeLen: number) => { + console.info('write data length is: ' + writeLen); + }).catch((err: BusinessError) => { + console.error(`Failed to write data. Code is ${err.code}, message is ${err.message}`); + }) +} + +export async function singleIoTest(): Promise { + let context = getContext() as common.UIAbilityContext; + let filePath: string = context.filesDir + '/ioTest.txt'; // 应用文件路径 + let file: fileIo.File = await fileIo.open(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); + write('Hello World!', file).then(() => { + console.info('Succeeded in writing data.'); + fileIo.close(file); + }).catch((err: BusinessError) => { + console.error(`Failed to write data. Code is ${err.code}, message is ${err.message}`); + fileIo.close(file); + }) + + let result = await fileIo.access(filePath, fileIo.AccessModeType.EXIST); + if (!result) { + return 'SingleIoTest Failed'; + } + return 'SingleIoTest Succeed'; } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sync-task-development.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sync-task-development.ets similarity index 95% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sync-task-development.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sync-task-development.ets index 1326a3fe80315c527901af010e713b0f96d594c6..cabc937bae6b8bb0d4002fd81137305b327d9906 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/managers/sync-task-development.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/managers/sync-task-development.ets @@ -1,56 +1,56 @@ -/* - * Copyright (c) 2024 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. - */ - -import { taskpool } from '@kit.ArkTS'; -import Handle from './Handle'; // 返回静态句柄 - -// 步骤1: 定义并发函数,内部调用同步方法 -@Concurrent -function func(num: number): number { - // 调用静态类对象中实现的同步等待调用 - // 先调用syncSet方法并将其结果作为syncSet2的参数,模拟同步调用逻辑 - let tmpNum: number = Handle.syncSet(num); - console.info('this is Child_Thread'); - return Handle.syncSet2(tmpNum); -} - -// 步骤2: 创建任务并执行 -async function asyncGet(): Promise { - // 创建task、task2并传入函数func - let task: taskpool.Task = new taskpool.Task(func, 1); - let task2: taskpool.Task = new taskpool.Task(func, 2); - // 执行task、task2任务,await保证其同步执行 - let res: number = await taskpool.execute(task) as number; - let res2: number = await taskpool.execute(task2) as number; - // 打印任务结果 - console.info('taskpool: task res is: ' + res); - console.info('taskpool: task res2 is: ' + res2); - if (res == 3 && res2 == 4) { - return true; - } else { - return false; - } -} - -export async function syncTaskTest(): Promise { - let num: number = Handle.syncSet(100); - console.info('this is Main_Thread!'); - let res = await asyncGet(); - if(res) { - return 'syncTaskTest Succeed'; - } else { - return 'syncTaskTest Failed'; - } +/* + * Copyright (c) 2025 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. + */ + +import { taskpool } from '@kit.ArkTS'; +import Handle from './Handle'; // 返回静态句柄 + +// 步骤1: 定义并发函数,内部调用同步方法 +@Concurrent +function func(num: number): number { + // 调用静态类对象中实现的同步等待调用 + // 先调用syncSet方法并将其结果作为syncSet2的参数,模拟同步调用逻辑 + let tmpNum: number = Handle.syncSet(num); + console.info('this is Child_Thread'); + return Handle.syncSet2(tmpNum); +} + +// 步骤2: 创建任务并执行 +async function asyncGet(): Promise { + // 创建task、task2并传入函数func + let task: taskpool.Task = new taskpool.Task(func, 1); + let task2: taskpool.Task = new taskpool.Task(func, 2); + // 执行task、task2任务,await保证其同步执行 + let res: number = await taskpool.execute(task) as number; + let res2: number = await taskpool.execute(task2) as number; + // 打印任务结果 + console.info('taskpool: task res is: ' + res); + console.info('taskpool: task res2 is: ' + res2); + if (res == 3 && res2 == 4) { + return true; + } else { + return false; + } +} + +export async function syncTaskTest(): Promise { + let num: number = Handle.syncSet(100); + console.info('this is Main_Thread!'); + let res = await asyncGet(); + if(res) { + return 'syncTaskTest Succeed'; + } else { + return 'syncTaskTest Failed'; + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/pages/Index.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/pages/Index.ets similarity index 92% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/pages/Index.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/pages/Index.ets index 0c157a718b5d70384beaf21c1d19cf7ce3e01d9f..ba7da86e88cd733fe6d84bb21942c15b4c5acb1f 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/ets/pages/Index.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/ets/pages/Index.ets @@ -1,65 +1,65 @@ -/* - * Copyright (c) 2024 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. - */ - -import { listAllTests, selectTest, startTest} from '../managers/manager'; -import promptAction from '@ohos.promptAction'; - -@Entry -@Component -struct Index { - @State message: string = 'Please run a test...'; - - build() { - Row() { - Navigation() { - Column({space: 16}) { - Select(listAllTests().map((v) => { - return { value: v[0] } - })) - .id("selectTest") - .value("Choose the test option") - .onSelect(selectTest) - .width('88%') - .height('12vp') - .optionWidth("414vp") - Button("Execute this Test") - .onClick(() => { - this.message = ''; - let res = startTest(); - res.then((v) => { - promptAction.showToast({ - message: v - }); - }).catch((e: Error) => { - promptAction.showToast({ - message: e.message - }); - }); - }) - .id("execute") - .position({ x: "6%", y: "90%" }) - .width('88%') - .fontSize(16) - .height('40') - } - .width("100%") - .height("100%") - }.title("ArkTS-UtilsDocsSample") - - } - .width("100%") - .height("100%") - } +/* + * Copyright (c) 2025 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. + */ + +import { listAllTests, selectTest, startTest} from '../managers/manager'; +import promptAction from '@ohos.promptAction'; + +@Entry +@Component +struct Index { + @State message: string = 'Please run a test...'; + + build() { + Row() { + Navigation() { + Column({space: 16}) { + Select(listAllTests().map((v) => { + return { value: v[0] } + })) + .id("selectTest") + .value("Choose the test option") + .onSelect(selectTest) + .width('88%') + .height('12vp') + .optionWidth("414vp") + Button("Execute this Test") + .onClick(() => { + this.message = ''; + let res = startTest(); + res.then((v) => { + promptAction.showToast({ + message: v + }); + }).catch((e: Error) => { + promptAction.showToast({ + message: e.message + }); + }); + }) + .id("execute") + .position({ x: "6%", y: "90%" }) + .width('88%') + .fontSize(16) + .height('40') + } + .width("100%") + .height("100%") + }.title("ArkTS-SimpleDemo") + + } + .width("100%") + .height("100%") + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/module.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/module.json5 similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/module.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/module.json5 index a39fed0b3a78cf6e85d52f2fc40a466874d6aa4b..281a0ef3081e131291c5eadc25c9ae33bde01324 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/module.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/module.json5 @@ -1,52 +1,52 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } +/* + * Copyright (c) 2025 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. + */ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/color.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/color.json similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/color.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/color.json index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/color.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/color.json @@ -1,8 +1,8 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/en_US/element/string.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/string.json similarity index 82% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/en_US/element/string.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/string.json index b95397798bd2165a754b20d6ac43f12b128ee23a..120c675619e925bd030e59fcfa444c61e7de84c6 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/en_US/element/string.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/element/string.json @@ -1,16 +1,16 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ArkTSUtilsDocsSample" - } - ] +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ArkTsSimpleDemo" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/media/icon.png b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/media/icon.png similarity index 100% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/media/icon.png rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/media/icon.png diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/media/startIcon.png b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/media/startIcon.png similarity index 100% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/media/startIcon.png rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/media/startIcon.png diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/profile/main_pages.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/profile/main_pages.json similarity index 88% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/profile/main_pages.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/profile/main_pages.json index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..14bbd62cb9de385b1f5551945d749bb5e0e5fc2c 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/profile/main_pages.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/base/profile/main_pages.json @@ -1,5 +1,5 @@ -{ - "src": [ - "pages/Index" - ] -} +{ + "src": [ + "pages/Index" + ] +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/string.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/en_US/element/string.json similarity index 82% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/string.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/en_US/element/string.json index b95397798bd2165a754b20d6ac43f12b128ee23a..120c675619e925bd030e59fcfa444c61e7de84c6 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/base/element/string.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/en_US/element/string.json @@ -1,16 +1,16 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ArkTSUtilsDocsSample" - } - ] +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ArkTsSimpleDemo" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/rawfile/startIcon.png b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/rawfile/startIcon.png similarity index 100% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/rawfile/startIcon.png rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/rawfile/startIcon.png diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/zh_CN/element/string.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/zh_CN/element/string.json similarity index 81% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/zh_CN/element/string.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/zh_CN/element/string.json index 3976dc343196e6780d26e129b910a9aee656bfcb..f750a7bb4af66526316ef6a26747503488aa3019 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/main/resources/zh_CN/element/string.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/main/resources/zh_CN/element/string.json @@ -1,16 +1,16 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "ArkTSUtilsDocsSample" - } - ] +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "ArkTsSimpleDemo" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/mock/mock-config.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/mock/mock-config.json5 similarity index 90% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/mock/mock-config.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/mock/mock-config.json5 index 26ed9f53bc46192a07ad5ab16ea24e7ce9a79328..aba5ed077b5cdc929a22668da42747a98504034a 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/mock/mock-config.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/mock/mock-config.json5 @@ -1,17 +1,17 @@ -/* - * Copyright (c) 2024 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. - */ - -{ +/* + * Copyright (c) 2025 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. + */ + +{ } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/Ability.test.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/Ability.test.ets similarity index 94% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/Ability.test.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/Ability.test.ets index 358aa98c3db4283ef2d9c4c14f6b51bd2d1e6f44..330f170e1115594472ee4e87a29ce69b95b2607f 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/Ability.test.ets @@ -1,152 +1,152 @@ -/* - * Copyright (c) 2024 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. - */ - -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, it, expect } from '@ohos/hypium'; -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -import { sendableModuleTest } from '../../../main/ets/managers/arkts-sendable-module'; -import { asyncConcurrencyTest } from '../../../main/ets/managers/async-concurrency-overview'; -import { imagePreprocessing } from '../../../main/ets/managers/cpu-intensive-task'; -import { ioTaskTest } from '../../../main/ets/managers/io-intensive-task'; -import { singleIoTest } from '../../../main/ets/managers/single-io-development'; -import { syncTaskTest } from '../../../main/ets/managers/sync-task-development'; - -const TAG = '[Sample_ArkTSUtils]'; -const DOMAIN = 0xF811; -const BUNDLE = 'ArkTsUtils_'; - -export default function abilityTest() { - describe('abilityTest', () => { - /** - * @tc.number : ArkTS_UtilsTest_001 - * @tc.name : Start ability - * @tc.desc : Start an application - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_001', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_001 begin'); - let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - try { - await abilityDelegator.startAbility({ - bundleName: "com.samples.arktsutilsdocmodule", - abilityName: "EntryAbility" - }); - done(); - } catch (err) { - expect(err.code).assertEqual(0); - done(); - } - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_001 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_002 - * @tc.name : Execute SendableTest - * @tc.desc : execute SendableTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_002', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_002 begin'); - let str = await sendableModuleTest(); - expect(str).assertEqual("SendableModuleTest Succeed"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_002 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_003 - * @tc.name : Execute AsyncConcurrencyTest - * @tc.desc : execute AsyncConcurrencyTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_003', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_003 begin'); - let str = await asyncConcurrencyTest(); - expect(str).assertEqual("AsyncConcurrencyTest Succeed"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_003 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_004 - * @tc.name : Execute imagePreprocessingTest - * @tc.desc : execute imagePreprocessingTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_004', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_004 begin'); - let str = await imagePreprocessing(); - expect(str).assertEqual("imagePreprocessing success"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_004 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_005 - * @tc.name : Execute IoTaskTest - * @tc.desc : execute IoTaskTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_005', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_005 begin'); - let str = await ioTaskTest(); - expect(str).assertEqual("IoTaskTest Succeed"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_005 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_006 - * @tc.name : Execute SingleIoTest - * @tc.desc : execute SingleIoTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_006', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_006 begin'); - let str = await singleIoTest(); - expect(str).assertEqual("SingleIoTest Succeed"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_006 end'); - }) - - /** - * @tc.number : ArkTS_UtilsTest_007 - * @tc.name : Execute syncTaskTest - * @tc.desc : execute syncTaskTest - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('ArkTS_UtilsTest_007', 0, async (done: Function) => { - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_007 begin'); - let str = await syncTaskTest(); - expect(str).assertEqual("syncTaskTest Succeed"); - done(); - hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_007 end'); - }) - }) +/* + * Copyright (c) 2025 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. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, it, expect } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { sendableModuleTest } from '../../../main/ets/managers/arkts-sendable-module'; +import { asyncConcurrencyTest } from '../../../main/ets/managers/async-concurrency-overview'; +import { imagePreprocessing } from '../../../main/ets/managers/cpu-intensive-task'; +import { ioTaskTest } from '../../../main/ets/managers/io-intensive-task'; +import { singleIoTest } from '../../../main/ets/managers/single-io-development'; +import { syncTaskTest } from '../../../main/ets/managers/sync-task-development'; + +const TAG = '[Sample_ArkTsSimpleDemo]'; +const DOMAIN = 0xF811; +const BUNDLE = 'ArkTsSimpleDemo_'; + +export default function abilityTest() { + describe('abilityTest', () => { + /** + * @tc.number : ArkTS_UtilsTest_001 + * @tc.name : Start ability + * @tc.desc : Start an application + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_001', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_001 begin'); + let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + try { + await abilityDelegator.startAbility({ + bundleName: "com.samples.arktssimpledemo", + abilityName: "EntryAbility" + }); + done(); + } catch (err) { + expect(err.code).assertEqual(0); + done(); + } + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_001 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_002 + * @tc.name : Execute SendableTest + * @tc.desc : execute SendableTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_002', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_002 begin'); + let str = await sendableModuleTest(); + expect(str).assertEqual("SendableModuleTest Succeed"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_002 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_003 + * @tc.name : Execute AsyncConcurrencyTest + * @tc.desc : execute AsyncConcurrencyTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_003', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_003 begin'); + let str = await asyncConcurrencyTest(); + expect(str).assertEqual("AsyncConcurrencyTest Succeed"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_003 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_004 + * @tc.name : Execute imagePreprocessingTest + * @tc.desc : execute imagePreprocessingTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_004', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_004 begin'); + let str = await imagePreprocessing(); + expect(str).assertEqual("imagePreprocessing success"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_004 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_005 + * @tc.name : Execute IoTaskTest + * @tc.desc : execute IoTaskTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_005', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_005 begin'); + let str = await ioTaskTest(); + expect(str).assertEqual("IoTaskTest Succeed"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_005 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_006 + * @tc.name : Execute SingleIoTest + * @tc.desc : execute SingleIoTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_006', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_006 begin'); + let str = await singleIoTest(); + expect(str).assertEqual("SingleIoTest Succeed"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_006 end'); + }) + + /** + * @tc.number : ArkTS_UtilsTest_007 + * @tc.name : Execute syncTaskTest + * @tc.desc : execute syncTaskTest + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('ArkTS_UtilsTest_007', 0, async (done: Function) => { + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_007 begin'); + let str = await syncTaskTest(); + expect(str).assertEqual("syncTaskTest Succeed"); + done(); + hilog.info(DOMAIN, TAG, BUNDLE + 'ArkTS_UtilsTest_007 end'); + }) + }) } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/List.test.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/List.test.ets similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/List.test.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/List.test.ets index e909c66ab67746c53f694cc12a0a604748a8b661..a10a79ed1d91b6040cc81d926b62c250e8f3866d 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/test/List.test.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/test/List.test.ets @@ -1,20 +1,20 @@ -/* - * Copyright (c) 2024 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. - */ - -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); +/* + * Copyright (c) 2025 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. + */ + +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/TestAbility.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/TestAbility.ets similarity index 96% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/TestAbility.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/TestAbility.ets index 7a25191b9dd63bae14151301390e2408a80affa7..080c6151ab22ed4daa3f09cc020d8e906b4ec806 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -1,63 +1,63 @@ -/* - * Copyright (c) 2024 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. - */ - -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { abilityDelegatorRegistry } from '@kit.TestKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; - abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; - abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } +/* + * Copyright (c) 2025 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. + */ + +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { abilityDelegatorRegistry } from '@kit.TestKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; + +export default class TestAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; + abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); + let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; + abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/pages/Index.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/pages/Index.ets similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/pages/Index.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/pages/Index.ets index 85a5c3d422035c84e15b5fae3ff7bcb6c868dfa6..712b120b30df7ebd3d4ac44492005802807c9600 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testability/pages/Index.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -1,32 +1,32 @@ -/* - * Copyright (c) 2024 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } +/* + * Copyright (c) 2025 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. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets similarity index 96% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets index 65e97481902535cd95e984e3c882762375709138..becece5de248c3d92b947db24053d2e372dedce4 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets @@ -1,105 +1,105 @@ -/* - * Copyright (c) 2024 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. - */ - -import { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { resourceManager } from '@kit.LocalizationKit'; -import { util } from '@kit.ArkTS'; - -let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; -let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; -let jsonPath: string = 'mock/mock-config.json'; -let tag: string = 'testTag'; - -async function onAbilityCreateCallback(data: UIAbility) { - hilog.info(0x0000, 'testTag', 'onAbilityCreateCallback, data: ${}', JSON.stringify(data)); -} - -async function addAbilityMonitorCallback(err: BusinessError) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); - } - - async onRun() { - let tag = 'testTag'; - hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = abilityDelegatorRegistry.getArguments() - abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() - let moduleName = abilityDelegatorArguments.parameters['-m']; - let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); - let mResourceManager = context.resourceManager; - await checkMock(abilityDelegator, mResourceManager); - const bundleName = abilityDelegatorArguments.bundleName; - const testAbilityName: string = 'TestAbility'; - let lMonitor: abilityDelegatorRegistry.AbilityMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - moduleName: moduleName - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - const want: Want = { - bundleName: bundleName, - abilityName: testAbilityName, - moduleName: moduleName - }; - abilityDelegator.startAbility(want, (err: BusinessError, data: void) => { - hilog.info(0x0000, tag, 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, tag, 'startAbility : data : %{public}s', JSON.stringify(data) ?? ''); - }) - hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} - -async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { - let rawFile: Uint8Array; - try { - rawFile = resourceManager.getRawFileContentSync(jsonPath); - hilog.info(0x0000, tag, 'MockList file exists'); - let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); - let mockMap: Record = getMockList(mockStr); - try { - abilityDelegator.setMockList(mockMap) - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(0x0000, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); - } - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(0x0000, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); - } -} - -function getMockList(jsonStr: string) { - let jsonObj: Record = JSON.parse(jsonStr); - let map: Map = new Map(Object.entries(jsonObj)); - let mockList: Record = {}; - map.forEach((value: object, key: string) => { - let realValue: string = value['source'].toString(); - mockList[key] = realValue; - }); - hilog.info(0x0000, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); - return mockList; +/* + * Copyright (c) 2025 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. + */ + +import { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; +import { UIAbility, Want } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { resourceManager } from '@kit.LocalizationKit'; +import { util } from '@kit.ArkTS'; + +let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; +let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; +let jsonPath: string = 'mock/mock-config.json'; +let tag: string = 'testTag'; + +async function onAbilityCreateCallback(data: UIAbility) { + hilog.info(0x0000, 'testTag', 'onAbilityCreateCallback, data: ${}', JSON.stringify(data)); +} + +async function addAbilityMonitorCallback(err: BusinessError) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); + } + + async onRun() { + let tag = 'testTag'; + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = abilityDelegatorRegistry.getArguments() + abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() + let moduleName = abilityDelegatorArguments.parameters['-m']; + let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); + let mResourceManager = context.resourceManager; + await checkMock(abilityDelegator, mResourceManager); + const bundleName = abilityDelegatorArguments.bundleName; + const testAbilityName: string = 'TestAbility'; + let lMonitor: abilityDelegatorRegistry.AbilityMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + moduleName: moduleName + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + const want: Want = { + bundleName: bundleName, + abilityName: testAbilityName, + moduleName: moduleName + }; + abilityDelegator.startAbility(want, (err: BusinessError, data: void) => { + hilog.info(0x0000, tag, 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, tag, 'startAbility : data : %{public}s', JSON.stringify(data) ?? ''); + }) + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} + +async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { + let rawFile: Uint8Array; + try { + rawFile = resourceManager.getRawFileContentSync(jsonPath); + hilog.info(0x0000, tag, 'MockList file exists'); + let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); + let mockMap: Record = getMockList(mockStr); + try { + abilityDelegator.setMockList(mockMap) + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); + } + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); + } +} + +function getMockList(jsonStr: string) { + let jsonObj: Record = JSON.parse(jsonStr); + let map: Map = new Map(Object.entries(jsonObj)); + let mockList: Record = {}; + map.forEach((value: object, key: string) => { + let realValue: string = value['source'].toString(); + mockList[key] = realValue; + }); + hilog.info(0x0000, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); + return mockList; } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/module.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/module.json5 similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/module.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/module.json5 index a7685a59ea27672ae8074c984c4699bd73f36a5b..d287e53fae5560981459f79f5f24fc485b603935 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/module.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/module.json5 @@ -1,51 +1,51 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} +/* + * Copyright (c) 2025 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. + */ + +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/color.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/color.json similarity index 93% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/color.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/color.json index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/color.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/color.json @@ -1,8 +1,8 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/string.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/string.json similarity index 94% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/string.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/string.json index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..04e87abb7232eeca56a0e436b32ecc84576d5ead 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/element/string.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/element/string.json @@ -1,16 +1,16 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/media/icon.png b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/media/icon.png similarity index 100% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/media/icon.png rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/media/icon.png diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/profile/test_pages.json b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/profile/test_pages.json similarity index 90% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/profile/test_pages.json rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/profile/test_pages.json index b7e7343cacb32ce982a45e76daad86e435e054fe..c3d813c41aa8ac1b64ccf124bb705adefb381787 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1,5 +1,5 @@ -{ - "src": [ - "testability/pages/Index" - ] -} +{ + "src": [ + "testability/pages/Index" + ] +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/test/List.test.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/List.test.ets similarity index 91% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/test/List.test.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/List.test.ets index ab6445db05608a5b7f851a85add24f32b890b0f8..234f7bd3c746fcb3f90e852a2a7099ecc01e730c 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/test/List.test.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/List.test.ets @@ -1,20 +1,20 @@ -/* - * Copyright (c) 2024 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. - */ - -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); +/* + * Copyright (c) 2025 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. + */ + +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/entry/src/test/LocalUnit.test.ets b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/LocalUnit.test.ets similarity index 95% rename from code/DocsSample/ArkTSUtilsDocModule/entry/src/test/LocalUnit.test.ets rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/LocalUnit.test.ets index 50ee262931df5967ed717570e4efa981ce2f99e8..4fbb7151f25e42ba574a37f52672f0b2e5bb330a 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/entry/src/test/LocalUnit.test.ets +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/entry/src/test/LocalUnit.test.ets @@ -1,48 +1,48 @@ -/* - * Copyright (c) 2024 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. - */ - -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest',() => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); +/* + * Copyright (c) 2025 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. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest',() => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-config.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigor/hvigor-config.json5 similarity index 56% rename from code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-config.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigor/hvigor-config.json5 index b77b06ff217a6873bf4c6e404b70a5b2014e3330..34d7bb42d6c1d68b7ad731fea6b9622b734424d9 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-config.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigor/hvigor-config.json5 @@ -1,22 +1,31 @@ -{ - "hvigorVersion": "4.1.2", - "dependencies": { - "@ohos/hvigor-ohos-plugin": "4.1.2" - }, - "execution": { - // "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */ - // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ - // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ - // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ - // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ - }, - "logging": { - // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ - }, - "debugging": { - // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ - }, - "nodeOptions": { - // "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */ - } +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "properties": { + // 配置为0,表示不启用内存缓存配置,默认为4,数值越低,内存中缓存数据越少 + "hvigor.pool.cache.capacity": 0, + // 默认配置为cpu核数-1, 包含ohos.arkCompile.maxSize4,值越小,占用内存越少 + "hvigor.pool.maxSize" : 1, + // 默认配置值为5, 值越小,占用内存越少 + "ohos.arkCompile.maxSize": 1, + // 默认配置值为true, 表示开启内存缓存,占用内存较多,配置为false,关闭内存缓存,占用内存较少 + "hvigor.enableMemoryCache": false + }, + "nodeOptions": { +// "maxOldSpaceSize": 12288 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */ + } } \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/hvigorfile.ts b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigorfile.ts similarity index 97% rename from code/DocsSample/ArkTSUtilsDocModule/hvigorfile.ts rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigorfile.ts index f3cb9f1a87a81687554a76283af8df27d8bda775..159890e9ee8c4dc8cfff2a03e6207edb86abb0b5 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/hvigorfile.ts +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/hvigorfile.ts @@ -1,6 +1,6 @@ -import { appTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/DocsSample/ArkTSUtilsDocModule/oh-package.json5 b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/oh-package.json5 similarity index 30% rename from code/DocsSample/ArkTSUtilsDocModule/oh-package.json5 rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/oh-package.json5 index 972792f689517568b314e0ff5ecedb0054fb5d4d..14f6e25819c0257c7083b9127687a2eb35986ed9 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/oh-package.json5 +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/oh-package.json5 @@ -1,29 +1,15 @@ -/* - * Copyright (c) 2024 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. - */ - -{ - "name": "arktsutilsdocssample", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - }, - "devDependencies": { - "@ohos/hypium": "1.0.15", - "@ohos/hamock": "1.0.0" - } -} +{ + "modelVersion": "5.0.0", + "name": "arktsutilsdocssample", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.15", + "@ohos/hamock": "1.0.0" + } +} \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/ohosTest.md b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/ohosTest.md similarity index 99% rename from code/DocsSample/ArkTSUtilsDocModule/ohosTest.md rename to code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/ohosTest.md index 0050b3271933f73c43849e3056175ac4ad282062..179c1e83b154a140ddca0753e7ee3bce9c0edb22 100644 --- a/code/DocsSample/ArkTSUtilsDocModule/ohosTest.md +++ b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/ohosTest.md @@ -1,9 +1,9 @@ -| 测试功能 | 预置条件 | 输入 | 预期输出 |是否自动|测试结果| -|-------------------|------|------------|---------------------------------------------------|--------------------------------|--------------------------------| -| 拉起应用 | 设备正常运行 | | 成功拉起应用 |是|Pass| -| Sendable共享模块能力测试 | 执行用例 | 执行无需输入 | SendableModuleTest Succeed |是|Pass| -| 同步任务能力测试 | 执行用例 | 执行无需输入 | syncTaskTest Succeed |是|Pass| -| CPU密集型任务能力测试 | 执行用例 | 执行无需输入 | imagePreprocessing success |是|Pass| -| IO密集型任务能力测试 | 执行用例 | 执行无需输入 | IoTaskTest Succeed |是|Pass| -| 单步IO任务能力测试 | 执行用例 | 执行无需输入 | SingleIoTest Succeed |是|Pass| +| 测试功能 | 预置条件 | 输入 | 预期输出 |是否自动|测试结果| +|-------------------|------|------------|---------------------------------------------------|--------------------------------|--------------------------------| +| 拉起应用 | 设备正常运行 | | 成功拉起应用 |是|Pass| +| Sendable共享模块能力测试 | 执行用例 | 执行无需输入 | SendableModuleTest Succeed |是|Pass| +| 同步任务能力测试 | 执行用例 | 执行无需输入 | syncTaskTest Succeed |是|Pass| +| CPU密集型任务能力测试 | 执行用例 | 执行无需输入 | imagePreprocessing success |是|Pass| +| IO密集型任务能力测试 | 执行用例 | 执行无需输入 | IoTaskTest Succeed |是|Pass| +| 单步IO任务能力测试 | 执行用例 | 执行无需输入 | SingleIoTest Succeed |是|Pass| | 异步任务能力测试 | 执行用例 | 执行无需输入 | AsyncConcurrencyTest Succeed |是|Pass| \ No newline at end of file diff --git a/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image1.jpeg b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image1.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..0e8115371bd5ca324b92f180b2fab7929e9931ca Binary files /dev/null and b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image1.jpeg differ diff --git a/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image2.jpeg b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image2.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7accd8b85b011df4bde2401dc6fb9b5b62fb481a Binary files /dev/null and b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image2.jpeg differ diff --git a/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image3.jpeg b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image3.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..61e3ff4d0a55afd70499d80931ec8daf7b28d8c1 Binary files /dev/null and b/code/DocsSample/ArkTS/ArkTsConcurrent/ArkTsSimpleDemo/screenshots/device/image3.jpeg differ diff --git a/code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-wrapper.js b/code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-wrapper.js deleted file mode 100644 index 8ec2d0156d8cca1c9ced7289a8f76c4d2efed7d8..0000000000000000000000000000000000000000 --- a/code/DocsSample/ArkTSUtilsDocModule/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),D=require("net"),d=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},E={},h={},C=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h,"__esModule",{value:!0}),h.maxPathLength=h.isMac=h.isLinux=h.isWindows=void 0;const m=C(t),F="Windows_NT",y="Darwin";function g(){return m.default.type()===F}function A(){return m.default.type()===y}h.isWindows=g,h.isLinux=function(){return"Linux"===m.default.type()},h.isMac=A,h.maxPathLength=function(){return A()?1016:g()?259:4095},function(n){var r=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),u=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return u(t,e),t};Object.defineProperty(n,"__esModule",{value:!0}),n.LOG_LEVEL=n.ANALYZE=n.PARALLEL=n.INCREMENTAL=n.DAEMON=n.DOT=n.PROPERTIES=n.HVIGOR_POOL_CACHE_TTL=n.HVIGOR_POOL_CACHE_CAPACITY=n.HVIGOR_POOL_MAX_CORE_SIZE=n.HVIGOR_POOL_MAX_SIZE=n.ENABLE_SIGN_TASK_KEY=n.HVIGOR_CACHE_DIR_KEY=n.WORK_SPACE=n.HVIGOR_PROJECT_WRAPPER_HOME=n.HVIGOR_PROJECT_ROOT_DIR=n.HVIGOR_PROJECT_CACHES_HOME=n.HVIGOR_PNPM_STORE_PATH=n.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=n.PROJECT_CACHES=n.HVIGOR_WRAPPER_TOOLS_HOME=n.HVIGOR_USER_HOME=n.DEFAULT_PACKAGE_JSON=n.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=n.PNPM=n.HVIGOR=n.NPM_TOOL=n.PNPM_TOOL=n.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const i=o(t),s=o(e),c=h;n.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",n.PNPM_TOOL=(0,c.isWindows)()?"pnpm.cmd":"pnpm",n.NPM_TOOL=(0,c.isWindows)()?"npm.cmd":"npm",n.HVIGOR="hvigor",n.PNPM="pnpm",n.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",n.DEFAULT_PACKAGE_JSON="package.json",n.HVIGOR_USER_HOME=s.resolve(i.homedir(),".hvigor"),n.HVIGOR_WRAPPER_TOOLS_HOME=s.resolve(n.HVIGOR_USER_HOME,"wrapper","tools"),n.PROJECT_CACHES="project_caches",n.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=s.resolve(n.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",n.PNPM_TOOL),n.HVIGOR_PNPM_STORE_PATH=s.resolve(n.HVIGOR_USER_HOME,"caches"),n.HVIGOR_PROJECT_CACHES_HOME=s.resolve(n.HVIGOR_USER_HOME,n.PROJECT_CACHES),n.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),n.HVIGOR_PROJECT_WRAPPER_HOME=s.resolve(n.HVIGOR_PROJECT_ROOT_DIR,n.HVIGOR),n.WORK_SPACE="workspace",n.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",n.ENABLE_SIGN_TASK_KEY="enableSignTask",n.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",n.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",n.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",n.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",n.PROPERTIES="properties",n.DOT=".",n.DAEMON="daemon",n.INCREMENTAL="incremental",n.PARALLEL="typeCheck",n.ANALYZE="analyze",n.LOG_LEVEL="logLevel"}(E);var v={},S={};Object.defineProperty(S,"__esModule",{value:!0}),S.logError=S.logInfo=S.logErrorAndExit=void 0,S.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},S.logInfo=function(e){console.log(e)},S.logError=function(e){console.error(e)};var w=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),O=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&w(t,e,n);return O(t,e),t};Object.defineProperty(v,"__esModule",{value:!0});var b=v.executeBuild=void 0;const B=_(n),I=_(e),x=S,P=r;b=v.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=B.realpathSync(t),n=process.argv.slice(2),r=(0,P.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var N,T,k,R,M,L={},j={},$={exports:{}},H={exports:{}};function G(){if(T)return N;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return N=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function U(){if(R)return k;return R=1,k=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),W={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function Q(){return K||(K=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=X();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=U()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Y,Y.exports)),Y.exports}q=$,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?q.exports=(M||(M=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=U()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(H,H.exports)),H.exports):q.exports=Q();var ee=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=te(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=te(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,se=e=>e&&"object"==typeof e&&!Array.isArray(e),ce=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ne.inspect(e,{depth:5})}) - ${n}`)}))};var ae={configure:e=>{re("New configuration to be validated: ",e),ce(e,ie(se(e)),"must be an object."),re(`Calling pre-processing listeners (${ue.length})`),ue.forEach((t=>t(e))),re("Configuration pre-processing finished."),re(`Calling configuration listeners (${oe.length})`),oe.forEach((t=>t(e))),re("Configuration finished.")},addListener:e=>{oe.push(e),re(`Added listener, now ${oe.length} listeners`)},addPreProcessingListener:e=>{ue.push(e),re(`Added pre-processing listener, now ${ue.length} listeners`)},throwExceptionIf:ce,anObject:se,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ie},le={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),D=n(u.getSeconds()),d=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,D).replace(/SSS/g,d).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(le);const fe=le.exports,De=t,de=i,pe=e,Ee=s,he=$.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function me(e){return e?`[${Ce[e][0]}m`:""}function Fe(e){return e?`[${Ce[e][1]}m`:""}function ye(e,t){return n=de.format("[%s] [%s] %s - ",fe.asString(e.startTime),e.level.toString(),e.categoryName),me(r=t)+n+Fe(r);var n,r}function ge(e){return ye(e)+de.format(...e.data)}function Ae(e){return ye(e,e.level.colour)+de.format(...e.data)}function ve(e){return de.format(...e.data)}function Se(e){return e.data[0]}function we(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(pe.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.lengthve,basic:()=>ge,colored:()=>Ae,coloured:()=>Ae,pattern:e=>we(e&&e.pattern,e&&e.tokens),dummy:()=>Se};var _e={basicLayout:ge,messagePassThroughLayout:ve,patternLayout:we,colouredLayout:Ae,coloredLayout:Ae,dummyLayout:Se,addLayout(e,t){Oe[e]=t},layout:(e,t)=>Oe[e]&&Oe[e](t)};const be=ae,Be=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),be.addListener((e=>{const t=e.levels;if(t){be.throwExceptionIf(e,be.not(be.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{be.throwExceptionIf(e,be.not(be.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),be.throwExceptionIf(e,be.not(be.anObject(t[n])),`level "${n}" must be an object`),be.throwExceptionIf(e,be.not(t[n].value),`level "${n}" must have a 'value' property`),be.throwExceptionIf(e,be.not(be.anInteger(t[n].value)),`level "${n}".value must have an integer value`),be.throwExceptionIf(e,be.not(t[n].colour),`level "${n}" must have a 'colour' property`),be.throwExceptionIf(e,be.not(Be.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Be.join(", ")}`)}))}})),be.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Pe={exports:{}},Ne={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Te,stringify:ke}=JSON,{keys:Re}=Object,Me=String,Le="string",je={},$e="object",He=(e,t)=>t,Ge=e=>e instanceof Me?Me(e):e,Ue=(e,t)=>typeof t===Le?new Me(t):t,Ve=(e,t,n,r)=>{const u=[];for(let o=Re(n),{length:i}=o,s=0;s{const r=Me(t.push(n)-1);return e.set(n,r),r},We=(e,t)=>{const n=Te(e,Ue).map(Ge),r=n[0],u=t||He,o=typeof r===$e&&r?Ve(n,new Set,r,u):r;return u.call({"":o},"",o)};Ne.parse=We;const ze=(e,t,n)=>{const r=t&&typeof t===$e?(e,n)=>""===e||-1Te(ze(e));Ne.fromJSON=e=>We(ke(e));const Ke=Ne,qe=xe;const Ye=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Ze=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ke.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Ye.serialise(t))))}static deserialise(e){let t;try{const n=Ke.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Ye.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Ze(n.categoryName,qe.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Ze("log4js",qe.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var Xe=Ze;const Qe=$.exports("log4js:clustering"),et=Xe,tt=ae;let nt=!1,rt=null;try{rt=require("cluster")}catch(e){Qe("cluster module not present"),nt=!0}const ut=[];let ot=!1,it="NODE_APP_INSTANCE";const st=()=>ot&&"0"===process.env[it],ct=()=>nt||rt&&rt.isMaster||st(),at=e=>{ut.forEach((t=>t(e)))},lt=(e,t)=>{if(Qe("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Qe("received message: ",t.data);const e=et.deserialise(t.data);at(e)}};nt||tt.addListener((e=>{ut.length=0,({pm2:ot,disableClustering:nt,pm2InstanceVar:it="NODE_APP_INSTANCE"}=e),Qe(`clustering disabled ? ${nt}`),Qe(`cluster.isMaster ? ${rt&&rt.isMaster}`),Qe(`pm2 enabled ? ${ot}`),Qe(`pm2InstanceVar = ${it}`),Qe(`process.env[${it}] = ${process.env[it]}`),ot&&process.removeListener("message",lt),rt&&rt.removeListener&&rt.removeListener("message",lt),nt||e.disableClustering?Qe("Not listening for cluster messages, because clustering disabled."):st()?(Qe("listening for PM2 broadcast messages"),process.on("message",lt)):rt&&rt.isMaster?(Qe("listening for cluster messages"),rt.on("message",lt)):Qe("not listening for messages, because we are not a master process")}));var ft={onlyOnMaster:(e,t)=>ct()?e():t,isMaster:ct,send:e=>{ct()?at(e):(ot||(e.cluster={workerId:rt.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{ut.push(e)}},Dt={};function dt(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function pt(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:dt},e)}const Et={dateFile:pt,file:pt,fileSync:pt};Dt.modifyConfig=e=>Et[e.type]?Et[e.type](e):e;var ht={};const Ct=console.log.bind(console);ht.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var mt={};mt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var yt={};yt.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var gt={};const At=$.exports("log4js:categoryFilter");gt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{At(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(At("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var vt={};const St=$.exports("log4js:noLogFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{St(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={},Ot={exports:{}},_t={},bt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},Bt=c,It=process.cwd,xt=null,Pt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Nt=process.chdir;process.chdir=function(e){xt=null,Nt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Nt)}var Tt=function(e){Bt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,Bt.O_WRONLY|Bt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,Bt.O_WRONLY|Bt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){Bt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,Bt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,Bt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Pt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,D){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var kt=a.Stream,Rt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);kt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);kt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Mt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Lt(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Lt=Object.getPrototypeOf||function(e){return e.__proto__};var jt,$t,Ht=n,Gt=Tt,Ut=Rt,Vt=Mt,Jt=i;function Wt(e,t){Object.defineProperty(e,jt,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(jt=Symbol.for("graceful-fs.queue"),$t=Symbol.for("graceful-fs.previous")):(jt="___graceful-fs.queue",$t="___graceful-fs.previous");var zt=function(){};if(Jt.debuglog?zt=Jt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(zt=function(){var e=Jt.format.apply(Jt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Ht[jt]){var Kt=p[jt]||[];Wt(Ht,Kt),Ht.close=function(e){function t(t,n){return e.call(Ht,t,(function(e){e||Qt(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,$t,{value:e}),t}(Ht.close),Ht.closeSync=function(e){function t(t){e.apply(Ht,arguments),Qt()}return Object.defineProperty(t,$t,{value:e}),t}(Ht.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){zt(Ht[jt]),l.equal(Ht[jt].length,0)}))}p[jt]||Wt(p,Ht[jt]);var qt,Yt=Zt(Vt(Ht));function Zt(e){Gt(e),e.gracefulify=Zt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):Xt([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):Xt([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):Xt([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Ut(e);D=s.ReadStream,d=s.WriteStream}var c=e.ReadStream;c&&(D.prototype=Object.create(c.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(d.prototype=Object.create(a.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var l=D;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=d;function D(e,t){return this instanceof D?(c.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function d(e,t){return this instanceof d?(a.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):Xt([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function Xt(e){zt("ENQUEUE",e[0].name,e[1]),Ht[jt].push(e),en()}function Qt(){for(var e=Date.now(),t=0;t2&&(Ht[jt][t][3]=e,Ht[jt][t][4]=e);en()}function en(){if(clearTimeout(qt),qt=void 0,0!==Ht[jt].length){var e=Ht[jt].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)zt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){zt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(zt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Ht[jt].push(e)}void 0===qt&&(qt=setTimeout(en,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ht.__patched&&(Yt=Zt(Ht),Ht.__patched=!0),function(e){const t=bt.fromCallback,n=Yt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(_t);const tn=e;function nn(e){return(e=tn.normalize(tn.resolve(e)).split(tn.sep)).length>0?e[0]:null}const rn=/[<>:"|?*]/;var un=function(e){const t=nn(e);return e=e.replace(t,""),rn.test(e)};const on=Yt,sn=e,cn=un,an=parseInt("0777",8);var ln=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&cn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||on;void 0===o&&(o=an&~process.umask()),u||(u=null),r=r||function(){},t=sn.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(sn.dirname(t)===t)return r(o);e(sn.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const fn=Yt,Dn=e,dn=un,pn=parseInt("0777",8);var En=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||fn;if("win32"===process.platform&&dn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=pn&~process.umask()),r||(r=null),t=Dn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Dn.dirname(t)===t)throw u;r=e(Dn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const hn=(0,bt.fromCallback)(ln);var Cn={mkdirs:hn,mkdirsSync:En,mkdirp:hn,mkdirpSync:En,ensureDir:hn,ensureDirSync:En};const mn=Yt;var Fn=function(e,t,n,r){mn.open(e,"r+",((e,u)=>{if(e)return r(e);mn.futimes(u,t,n,(e=>{mn.close(u,(t=>{r&&r(e||t)}))}))}))},yn=function(e,t,n){const r=mn.openSync(e,"r+");return mn.futimesSync(r,t,n),mn.closeSync(r)};const gn=Yt,An=e,vn=10,Sn=5,wn=0,On=process.versions.node.split("."),_n=Number.parseInt(On[0],10),bn=Number.parseInt(On[1],10),Bn=Number.parseInt(On[2],10);function In(){if(_n>vn)return!0;if(_n===vn){if(bn>Sn)return!0;if(bn===Sn&&Bn>=wn)return!0}return!1}function xn(e,t){const n=An.resolve(e).split(An.sep).filter((e=>e)),r=An.resolve(t).split(An.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Pn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Nn,Tn,kn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?gn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);gn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):gn.stat(e,((e,r)=>{if(e)return n(e);gn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Pn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?gn.statSync(e,{bigint:!0}):gn.statSync(e);try{r=In()?gn.statSync(t,{bigint:!0}):gn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Pn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=An.resolve(An.dirname(t)),s=An.resolve(An.dirname(r));if(s===i||s===An.parse(s).root)return o();In()?gn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Pn(t,r,u))):e(t,n,s,u,o))):gn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Pn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=An.resolve(An.dirname(t)),i=An.resolve(An.dirname(r));if(i===o||i===An.parse(i).root)return;let s;try{s=In()?gn.statSync(i,{bigint:!0}):gn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Pn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Rn=Yt,Mn=e,Ln=Cn.mkdirsSync,jn=yn,$n=kn;function Hn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Rn.statSync:Rn.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Rn.mkdirSync(n),Un(t,n,r),Rn.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Un(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Rn.unlinkSync(n),Gn(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Gn(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Rn.readlinkSync(t);r.dereference&&(u=Mn.resolve(process.cwd(),u));if(e){let e;try{e=Rn.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Rn.symlinkSync(u,n);throw e}if(r.dereference&&(e=Mn.resolve(process.cwd(),e)),$n.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Rn.statSync(n).isDirectory()&&$n.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Rn.unlinkSync(t),Rn.symlinkSync(e,t)}(u,n)}return Rn.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Gn(e,t,n,r){return"function"==typeof Rn.copyFileSync?(Rn.copyFileSync(t,n),Rn.chmodSync(n,e.mode),r.preserveTimestamps?jn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Nn:(Tn=1,Nn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Rn.openSync(t,"r"),s=Rn.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=Mn.join(t,e),o=Mn.join(n,e),{destStat:i}=$n.checkPathsSync(u,o,"copy");return Hn(i,u,o,r)}(r,e,t,n)))}var Vn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=$n.checkPathsSync(e,t,"copy");return $n.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=Mn.dirname(n);Rn.existsSync(u)||Ln(u);return Hn(e,t,n,r)}(u,e,t,n)},Jn={copySync:Vn};const Wn=bt.fromPromise,zn=_t;var Kn={pathExists:Wn((function(e){return zn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:zn.existsSync};const qn=Yt,Yn=e,Zn=Cn.mkdirs,Xn=Kn.pathExists,Qn=Fn,er=kn;function tr(e,t,n,r,u){const o=Yn.dirname(n);Xn(o,((i,s)=>i?u(i):s?rr(e,t,n,r,u):void Zn(o,(o=>o?u(o):rr(e,t,n,r,u)))))}function nr(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function rr(e,t,n,r,u){return r.filter?nr(ur,e,t,n,r,u):ur(e,t,n,r,u)}function ur(e,t,n,r,u){(r.dereference?qn.stat:qn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){qn.mkdir(n,(o=>{if(o)return u(o);sr(t,n,r,(t=>t?u(t):qn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return sr(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();qn.unlink(n,(o=>o?u(o):or(e,t,n,r,u)))}(e,n,r,u,o):or(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){qn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Yn.resolve(process.cwd(),o)),e?void qn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?qn.symlink(o,n,u):u(t):(r.dereference&&(i=Yn.resolve(process.cwd(),i)),er.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&er.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){qn.unlink(t,(r=>r?n(r):qn.symlink(e,t,n)))}(o,n,u)))):qn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function or(e,t,n,r,u){return"function"==typeof qn.copyFile?qn.copyFile(t,n,(t=>t?u(t):ir(e,n,r,u))):function(e,t,n,r,u){const o=qn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=qn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>ir(e,n,r,u)))}))}(e,t,n,r,u)}function ir(e,t,n,r){qn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?Qn(t,e.atime,e.mtime,r):r()))}function sr(e,t,n,r){qn.readdir(e,((u,o)=>u?r(u):cr(o,e,t,n,r)))}function cr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Yn.join(n,t),s=Yn.join(r,t);er.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;rr(a,i,s,u,(t=>t?o(t):cr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var ar=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),er.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;er.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?nr(tr,s,e,t,n,r):tr(s,e,t,n,r)))}))};var lr={copy:(0,bt.fromCallback)(ar)};const fr=Yt,Dr=e,dr=l,pr="win32"===process.platform;function Er(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||fr[t],e[t+="Sync"]=e[t]||fr[t]})),e.maxBusyTries=e.maxBusyTries||3}function hr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),dr(e,"rimraf: missing path"),dr.strictEqual(typeof e,"string","rimraf: path should be a string"),dr.strictEqual(typeof n,"function","rimraf: callback function required"),dr(t,"rimraf: invalid options argument provided"),dr.strictEqual(typeof t,"object","rimraf: options should be object"),Er(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rCr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){dr(e),dr(t),dr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&pr?mr(e,t,r,n):u&&u.isDirectory()?yr(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return pr?mr(e,t,r,n):yr(e,t,r,n);if("EISDIR"===r.code)return yr(e,t,r,n)}return n(r)}))))}function mr(e,t,n,r){dr(e),dr(t),dr("function"==typeof r),n&&dr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?yr(e,t,n,r):t.unlink(e,r)}))}))}function Fr(e,t,n){let r;dr(e),dr(t),n&&dr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Ar(e,t,n):t.unlinkSync(e)}function yr(e,t,n,r){dr(e),dr(t),n&&dr(n instanceof Error),dr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){dr(e),dr(t),dr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{hr(Dr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function gr(e,t){let n;Er(t=t||{}),dr(e,"rimraf: missing path"),dr.strictEqual(typeof e,"string","rimraf: path should be a string"),dr(t,"rimraf: missing options"),dr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&pr&&Fr(e,t,n)}try{n&&n.isDirectory()?Ar(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return pr?Fr(e,t,n):Ar(e,t,n);if("EISDIR"!==n.code)throw n;Ar(e,t,n)}}function Ar(e,t,n){dr(e),dr(t),n&&dr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(dr(e),dr(t),t.readdirSync(e).forEach((n=>gr(Dr.join(e,n),t))),!pr){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var vr=hr;hr.sync=gr;const Sr=vr;var wr={remove:(0,bt.fromCallback)(Sr),removeSync:Sr.sync};const Or=bt.fromCallback,_r=Yt,br=e,Br=Cn,Ir=wr,xr=Or((function(e,t){t=t||function(){},_r.readdir(e,((n,r)=>{if(n)return Br.mkdirs(e,t);r=r.map((t=>br.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Pr(e){let t;try{t=_r.readdirSync(e)}catch(t){return Br.mkdirsSync(e)}t.forEach((t=>{t=br.join(e,t),Ir.removeSync(t)}))}var Nr={emptyDirSync:Pr,emptydirSync:Pr,emptyDir:xr,emptydir:xr};const Tr=bt.fromCallback,kr=e,Rr=Yt,Mr=Cn,Lr=Kn.pathExists;var jr={createFile:Tr((function(e,t){function n(){Rr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Rr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=kr.dirname(e);Lr(o,((e,r)=>e?t(e):r?n():void Mr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Rr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=kr.dirname(e);Rr.existsSync(n)||Mr.mkdirsSync(n),Rr.writeFileSync(e,"")}};const $r=bt.fromCallback,Hr=e,Gr=Yt,Ur=Cn,Vr=Kn.pathExists;var Jr={createLink:$r((function(e,t,n){function r(e,t){Gr.link(e,t,(e=>{if(e)return n(e);n(null)}))}Vr(t,((u,o)=>u?n(u):o?n(null):void Gr.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Hr.dirname(t);Vr(o,((u,i)=>u?n(u):i?r(e,t):void Ur.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Gr.existsSync(t))return;try{Gr.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Hr.dirname(t);return Gr.existsSync(n)||Ur.mkdirsSync(n),Gr.linkSync(e,t)}};const Wr=e,zr=Yt,Kr=Kn.pathExists;var qr={symlinkPaths:function(e,t,n){if(Wr.isAbsolute(e))return zr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Wr.dirname(t),u=Wr.join(r,e);return Kr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):zr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Wr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Wr.isAbsolute(e)){if(n=zr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Wr.dirname(t),u=Wr.join(r,e);if(n=zr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=zr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Wr.relative(r,e)}}}};const Yr=Yt;var Zr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Yr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Yr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Xr=bt.fromCallback,Qr=e,eu=Yt,tu=Cn.mkdirs,nu=Cn.mkdirsSync,ru=qr.symlinkPaths,uu=qr.symlinkPathsSync,ou=Zr.symlinkType,iu=Zr.symlinkTypeSync,su=Kn.pathExists;var cu={createSymlink:Xr((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,su(t,((u,o)=>u?r(u):o?r(null):void ru(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,ou(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=Qr.dirname(t);su(o,((n,i)=>n?r(n):i?eu.symlink(e,t,u,r):void tu(o,(n=>{if(n)return r(n);eu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(eu.existsSync(t))return;const r=uu(e,t);e=r.toDst,n=iu(r.toCwd,n);const u=Qr.dirname(t);return eu.existsSync(u)||nu(u),eu.symlinkSync(e,t,n)}};var au,lu={createFile:jr.createFile,createFileSync:jr.createFileSync,ensureFile:jr.createFile,ensureFileSync:jr.createFileSync,createLink:Jr.createLink,createLinkSync:Jr.createLinkSync,ensureLink:Jr.createLink,ensureLinkSync:Jr.createLinkSync,createSymlink:cu.createSymlink,createSymlinkSync:cu.createSymlinkSync,ensureSymlink:cu.createSymlink,ensureSymlinkSync:cu.createSymlinkSync};try{au=Yt}catch(e){au=n}function fu(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Du(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var du={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||au,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Du(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||au,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Du(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||au,o="";try{o=fu(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||au,u=fu(t,n);return r.writeFileSync(e,u,n)}},pu=du;const Eu=bt.fromCallback,hu=pu;var Cu={readJson:Eu(hu.readFile),readJsonSync:hu.readFileSync,writeJson:Eu(hu.writeFile),writeJsonSync:hu.writeFileSync};const mu=e,Fu=Cn,yu=Kn.pathExists,gu=Cu;var Au=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=mu.dirname(e);yu(u,((o,i)=>o?r(o):i?gu.writeJson(e,t,n,r):void Fu.mkdirs(u,(u=>{if(u)return r(u);gu.writeJson(e,t,n,r)}))))};const vu=Yt,Su=e,wu=Cn,Ou=Cu;var _u=function(e,t,n){const r=Su.dirname(e);vu.existsSync(r)||wu.mkdirsSync(r),Ou.writeJsonSync(e,t,n)};const bu=bt.fromCallback,Bu=Cu;Bu.outputJson=bu(Au),Bu.outputJsonSync=_u,Bu.outputJSON=Bu.outputJson,Bu.outputJSONSync=Bu.outputJsonSync,Bu.writeJSON=Bu.writeJson,Bu.writeJSONSync=Bu.writeJsonSync,Bu.readJSON=Bu.readJson,Bu.readJSONSync=Bu.readJsonSync;var Iu=Bu;const xu=Yt,Pu=e,Nu=Jn.copySync,Tu=wr.removeSync,ku=Cn.mkdirpSync,Ru=kn;function Mu(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Nu(e,t,r),Tu(e)}(e,t,n)}}var Lu=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Ru.checkPathsSync(e,t,"move");return Ru.checkParentPathsSync(e,u,t,"move"),ku(Pu.dirname(t)),function(e,t,n){if(n)return Tu(t),Mu(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return Mu(e,t,n)}(e,t,r)},ju={moveSync:Lu};const $u=Yt,Hu=e,Gu=lr.copy,Uu=wr.remove,Vu=Cn.mkdirp,Ju=Kn.pathExists,Wu=kn;function zu(e,t,n,r){$u.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Gu(e,t,u,(t=>t?r(t):Uu(e,r)))}(e,t,n,r):r()))}var Ku=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Wu.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Wu.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Vu(Hu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Uu(t,(u=>u?r(u):zu(e,t,n,r)));Ju(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):zu(e,t,n,r)))}(e,t,u,r)))}))}))};var qu={move:(0,bt.fromCallback)(Ku)};const Yu=bt.fromCallback,Zu=Yt,Xu=e,Qu=Cn,eo=Kn.pathExists;var to={outputFile:Yu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Xu.dirname(e);eo(u,((o,i)=>o?r(o):i?Zu.writeFile(e,t,n,r):void Qu.mkdirs(u,(u=>{if(u)return r(u);Zu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Xu.dirname(e);if(Zu.existsSync(n))return Zu.writeFileSync(e,...t);Qu.mkdirsSync(n),Zu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},_t,Jn,lr,Nr,lu,Iu,Cn,ju,qu,to,Kn,wr);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(Ot);const no=$.exports("streamroller:fileNameFormatter"),ro=e;const uo=$.exports("streamroller:fileNameParser"),oo=le.exports;const io=$.exports("streamroller:moveAndMaybeCompressFile"),so=Ot.exports,co=f;var ao=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return io(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await so.pathExists(e))if(io(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=so.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=so.createReadStream(e).on("open",(()=>{t.pipe(co.createGzip()).pipe(i)})).on("error",(t=>{io(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{io(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),so.unlink(e).then(r).catch((t=>{io(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),so.truncate(e).then(r).catch((t=>{io(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(io(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),so.unlink(t).then((()=>{u(e)})).catch((e=>{io(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(io(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{io(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await so.move(e,t,{overwrite:!0})}catch(n){if(io(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){io("moveAndMaybeCompressFile: trying copy+truncate instead");try{await so.copy(e,t,{overwrite:!0}),await so.truncate(e)}catch(e){io("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else io("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const lo=$.exports("streamroller:RollingFileWriteStream"),fo=Ot.exports,Do=e,po=t,Eo=()=>new Date,ho=le.exports,{Writable:Co}=a,mo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=ro.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,D=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(no(`_formatFileName: date=${e}, index=${t}`),D.reduce(((n,r)=>r(n,t,e)),s))},Fo=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(uo("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(uo("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(uo("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];uo("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),uo(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=oo.parse(n,i,new Date(0,0));return oo.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return uo(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(uo("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},yo=ao;var go=class extends Co{constructor(e,t){if(lo(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Do.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Do.sep}`)&&(e=e.replace("~",po.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Do.parse(e),""===this.fileObject.dir&&(this.fileObject=Do.parse(Do.join(process.cwd(),e))),this.fileFormatter=mo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return lo(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{lo(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(lo(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==ho(this.options.pattern,Eo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return lo("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){lo(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await yo(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?ho(this.options.pattern,Eo()):null,lo(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await fo.readdir(this.fileObject.dir).catch((()=>[]));lo(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:Eo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return fo.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Do.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(fo.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;fo.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=fo.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(lo(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),lo("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Do.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,lo(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>fo.unlink(e).catch((t=>{lo(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Ao=go;var vo=class extends Ao{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const So=go;var wo={RollingFileWriteStream:go,RollingFileStream:vo,DateRollingFileStream:class extends So{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Oo=$.exports("log4js:file"),_o=e,bo=wo,Bo=t,Io=Bo.EOL;let xo=!1;const Po=new Set;function No(){Po.forEach((e=>{e.sighupHandler()}))}wt.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(_o.sep))throw new Error(`Filename is a directory: ${e}`);function i(e,t,n,r){const u=new bo.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}e=e.replace(new RegExp(`^~(?=${_o.sep}.+)`),Bo.homedir()),e=_o.normalize(e),Oo("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let s=i(e,n,r,u);const c=function(e){if(s.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}s.write(t(e,o)+Io,"utf8")||process.emit("log4js:pause",!0)}};return c.reopen=function(){s.end((()=>{s=i(e,n,r,u)}))},c.sighupHandler=function(){Oo("SIGHUP handler called."),c.reopen()},c.shutdown=function(e){Po.delete(c),0===Po.size&&xo&&(process.removeListener("SIGHUP",No),xo=!1),s.end("","utf-8",e)},Po.add(c),xo||(process.on("SIGHUP",No),xo=!0),c}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var To={};const ko=wo,Ro=t.EOL;function Mo(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new ko.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Ro,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}To.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Mo(e.filename,e.pattern,n,e,e.timezoneOffset)};var Lo={};const jo=$.exports("log4js:fileSync"),$o=e,Ho=n,Go=t,Uo=Go.EOL;function Vo(e,t){const n=e=>{try{return Ho.mkdirSync(e,{recursive:!0})}catch(t){if("ENOENT"===t.code)return n($o.dirname(e)),n(e);if("EEXIST"!==t.code&&"EROFS"!==t.code)throw t;try{if(Ho.statSync(e).isDirectory())return e;throw t}catch(e){throw t}}};n($o.dirname(e)),Ho.appendFileSync(e,"",{mode:t.mode,flag:t.flags})}class Jo{constructor(e,t,n,r){if(jo("In RollingFileStream"),t<0)throw new Error(`maxLogSize (${t}) should be > 0`);this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=Ho.statSync(e).size}catch(t){Vo(e,r)}return t}(this.filename)}shouldRoll(){return jo("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${$o.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.slice(`${$o.basename(e)}.`.length),10)||0}function o(e,t){return u(e)-u(t)}function i(n){const r=u(n);if(jo(`Index of ${n} is ${r}`),0===t.backups)Ho.truncateSync(e,0);else if(r ${e}.${r+1}`),Ho.renameSync($o.join($o.dirname(e),n),`${e}.${r+1}`)}}jo("Rolling, rolling, rolling"),jo("Renaming the old files"),Ho.readdirSync($o.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;jo("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),jo("writing the chunk to the file"),n.currentSize+=e.length,Ho.appendFileSync(n.filename,e)}}Lo.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){if("string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith($o.sep))throw new Error(`Filename is a directory: ${e}`);e=e.replace(new RegExp(`^~(?=${$o.sep}.+)`),Go.homedir()),e=$o.normalize(e),jo("Creating fileSync appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");const i=function(e,t,n){let r;var o;return t?r=new Jo(e,t,n,u):(Vo(o=e,u),r={write(e){Ho.appendFileSync(o,e)}}),r}(e,n,r);return e=>{i.write(t(e,o)+Uo)}}(e.filename,n,e.maxLogSize,e.backups,r,e.timezoneOffset)};var Wo={};const zo=$.exports("log4js:tcp"),Ko=D;Wo.configure=function(e,t){zo(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){zo("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(zo("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(zo("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){zo(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=Ko.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{zo("socket connected"),c(),n=!0})),u.on("drain",(()=>{zo("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{zo("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){zo("shutdown called"),r.length&&o?(zo("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const qo=e,Yo=$.exports("log4js:appenders"),Zo=ae,Xo=ft,Qo=xe,ei=_e,ti=Dt,ni=new Map;ni.set("console",ht),ni.set("stdout",mt),ni.set("stderr",Ft),ni.set("logLevelFilter",yt),ni.set("categoryFilter",gt),ni.set("noLogFilter",vt),ni.set("file",wt),ni.set("dateFile",To),ni.set("fileSync",Lo),ni.set("tcp",Wo);const ri=new Map,ui=(e,t)=>{let n;try{const t=`${e}.cjs`;n=require.resolve(t),Yo("Loading module from ",t)}catch(t){n=e,Yo("Loading module from ",e)}try{return require(n)}catch(n){return void Zo.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},oi=new Set,ii=(e,t)=>{if(ri.has(e))return ri.get(e);if(!t.appenders[e])return!1;if(oi.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);oi.add(e),Yo(`Creating appender ${e}`);const n=si(e,t);return oi.delete(e),ri.set(e,n),n},si=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ni.get(e)||ui(`./${e}`,t)||ui(e,t)||require.main&&require.main.filename&&ui(qo.join(qo.dirname(require.main.filename),e),t)||ui(qo.join(process.cwd(),e),t))(n.type,t);return Zo.throwExceptionIf(t,Zo.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&(process.emitWarning(`Appender ${n.type} exports an appender function.`,"DeprecationWarning","log4js-node-DEP0001"),Yo("[log4js-node-DEP0001]",`DEPRECATION: Appender ${n.type} exports an appender function.`)),r.shutdown&&(process.emitWarning(`Appender ${n.type} exports a shutdown function.`,"DeprecationWarning","log4js-node-DEP0002"),Yo("[log4js-node-DEP0002]",`DEPRECATION: Appender ${n.type} exports a shutdown function.`)),Yo(`${e}: clustering.isMaster ? ${Xo.isMaster()}`),Yo(`${e}: appenderModule is ${i.inspect(r)}`),Xo.onlyOnMaster((()=>(Yo(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ti.modifyConfig(n),ei,(e=>ii(e,t)),Qo))),(()=>{}))},ci=e=>{if(ri.clear(),oi.clear(),!e)return;const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type||"multiprocess"===e.appenders[n].type)&&ii(n,e)}))},ai=()=>{ci()};ai(),Zo.addListener((e=>{Zo.throwExceptionIf(e,Zo.not(Zo.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);Zo.throwExceptionIf(e,Zo.not(t.length),"must define at least one appender."),t.forEach((t=>{Zo.throwExceptionIf(e,Zo.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),Zo.addListener(ci),Pe.exports=ri,Pe.exports.init=ai;var li={exports:{}};!function(e){const t=$.exports("log4js:categories"),n=ae,r=xe,u=Pe.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.slice(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{if(o.clear(),!e)return;Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c()};a(),n.addListener(c);const l=e=>{if(t(`configForCategory: searching for config for ${e}`),o.has(e))return t(`configForCategory: ${e} exists in config, returning it`),o.get(e);let n;return e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, cloning from parents`),n={...l(e.slice(0,e.lastIndexOf(".")))}):(o.has("default")||c({categories:{default:{appenders:["out"],level:"OFF"}}}),t("configForCategory: cloning default category"),n={...o.get("default")}),o.set(e,n),n};e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,t)=>{l(e).level=t},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(li);const fi=$.exports("log4js:logger"),Di=Xe,di=xe,pi=ft,Ei=li.exports,hi=ae,Ci=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function mi(e,t=4){try{const n=e.stack.split("\n").slice(t);if(!n.length)return null;const r=Ci.exec(n[0]);if(r&&6===r.length){let e="",t="",u="";return r[1]&&""!==r[1]&&([t,u]=r[1].replace(/[[\]]/g,"").split(" as "),u=u||"",t.includes(".")&&([e,t]=t.split("."))),{fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n"),className:e,functionName:t,functionAlias:u,callerName:r[1]||""}}console.error("log4js.logger - defaultParseCallStack error")}catch(e){console.error("log4js.logger - defaultParseCallStack error",e)}return null}let Fi=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.callStackSkipIndex=0,this.parseCallStack=mi,fi(`Logger created (${this.category}, ${this.level})`)}get level(){return di.getLevel(Ei.getLevelForCategory(this.category),di.OFF)}set level(e){Ei.setLevelForCategory(this.category,di.getLevel(e,this.level))}get useCallStack(){return Ei.getEnableCallStackForCategory(this.category)}set useCallStack(e){Ei.setEnableCallStackForCategory(this.category,!0===e)}get callStackLinesToSkip(){return this.callStackSkipIndex}set callStackLinesToSkip(e){if("number"!=typeof e)throw new TypeError("Must be a number");if(e<0)throw new RangeError("Must be >= 0");this.callStackSkipIndex=e}log(e,...t){const n=di.getLevel(e);n?this.isLevelEnabled(n)&&this._log(n,t):hi.validIdentifier(e)&&t.length>0?(this.log(di.WARN,"log4js:logger.log: valid log-level not found as first parameter given:",e),this.log(di.INFO,`[${e}]`,...t)):this.log(di.INFO,e,...t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){fi(`sending log data (${e}) to appenders`);const n=t.find((e=>e instanceof Error));let r;if(this.useCallStack){try{n&&(r=this.parseCallStack(n,this.callStackSkipIndex+1))}catch(e){}r=r||this.parseCallStack(new Error,this.callStackSkipIndex+3+1)}const u=new Di(this.category,e,t,this.context,r,n);pi.send(u)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){if("function"==typeof e)this.parseCallStack=e;else{if(void 0!==e)throw new TypeError("Invalid type passed to setParseCallStackFunction");this.parseCallStack=mi}}};function yi(e){const t=di.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Fi.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Fi.prototype[n]=function(...e){this.log(t,...e)}}di.levels.forEach(yi),hi.addListener((()=>{di.levels.forEach(yi)}));var gi=Fi;const Ai=xe;function vi(e){return e.originalUrl||e.url}function Si(e,t){for(let n=0;n{if(void 0!==e._logging)return i();if("function"!=typeof t.nolog){const n=function(e){let t=null;if(e instanceof RegExp&&(t=e),"string"==typeof e&&(t=new RegExp(e)),Array.isArray(e)){const n=e.map((e=>e.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);if(n&&n.test(e.originalUrl))return i()}if(n.isLevelEnabled(r)||"auto"===t.level){const i=new Date,{writeHead:s}=o;e._logging=!0,o.writeHead=(e,t)=>{o.writeHead=s,o.writeHead(e,t),o.__statusCode=e,o.__headers=t||{}};let c=!1;const a=()=>{if(c)return;if(c=!0,"function"==typeof t.nolog&&!0===t.nolog(e,o))return void(e._logging=!1);o.responseTime=new Date-i,o.statusCode&&"auto"===t.level&&(r=Ai.INFO,o.statusCode>=300&&(r=Ai.WARN),o.statusCode>=400&&(r=Ai.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ai.getLevel(t.level,r))}return r}(o.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:vi(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eSi(e,s)));t&&n.log(r,t)}else n.log(r,Si(u,s));t.context&&n.removeContext("res")};o.on("end",a),o.on("finish",a),o.on("error",a),o.on("close",a)}return i()}},Hi=Bi;let Gi=!1;function Ui(e){if(!Gi)return;Ii("Received log event ",e);Mi.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function Vi(e){Gi&&Ji();let t=e;return"string"==typeof t&&(t=function(e){Ii(`Loading configuration from ${e}`);try{return JSON.parse(xi.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ii(`Configuration is ${t}`),Ni.configure(Pi(t)),ji.onMessage(Ui),Gi=!0,Wi}function Ji(e=(()=>{})){if("function"!=typeof e)throw new TypeError("Invalid callback passed to shutdown");Ii("Shutdown called. Disabling all log writing."),Gi=!1;const t=Array.from(Ri.values());Ri.init(),Mi.init();const n=t.reduce(((e,t)=>t.shutdown?e+1:e),0);0===n&&(Ii("No appenders with shutdown functions found."),e());let r,u=0;function o(t){r=r||t,u+=1,Ii(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ii("All shutdown functions completed."),e(r))}Ii(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o)))}const Wi={getLogger:function(e){return Gi||Vi(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Li(e||"default")},configure:Vi,shutdown:Ji,connectLogger:$i,levels:ki,addLayout:Ti.addLayout,recording:function(){return Hi}};var zi=Wi;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.addCustomPLlugin=e.addCustomTask=e.hvigorTrace=void 0;const t=zi;e.hvigorTrace={totalTime:0,moduleNum:0,taskTime:{},isIncremental:!0,hasIncremental:!1,isParallel:!0,IS_DAEMON:!0,LOG_LEVEL:t.levels.INFO.levelStr,IS_HVIGORFILE_TYPE_CHECK:!1},e.addCustomTask=function(t){var n;let r=null!==(n=e.hvigorTrace.CUSTOM_TASKS)&&void 0!==n?n:[];r.length>0&&(r=r.filter((e=>e.NAME!==t.NAME))),r.push(t),e.hvigorTrace.CUSTOM_TASKS=r},e.addCustomPLlugin=function(t){var n;let r=null!==(n=e.hvigorTrace.CUSTOM_PLUGINS)&&void 0!==n?n:[];r.length>0&&(r=r.filter((e=>e.PLUGIN_ID!==t.PLUGIN_ID))),r.push({PLUGIN_ID:t.PLUGIN_ID}),e.hvigorTrace.CUSTOM_PLUGINS=r}}(j);var Ki,qi={};Ki=qi,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.isCI=void 0,Ki.isCI=function(){return!("false"===process.env.CI||!(process.env.BUILD_ID||process.env.BUILD_NUMBER||process.env.CI||process.env.CI_APP_ID||process.env.CI_BUILD_ID||process.env.CI_BUILD_NUMBER||process.env.CI_NAME||process.env.CONTINUOUS_INTEGRATION||process.env.RUN_ID||Ki.name))};var Yi={};!function(e){var t=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.hashFile=e.hash=e.createHash=void 0;const r=t(d),u=t(n);e.createHash=(e="MD5")=>r.default.createHash(e);e.hash=(t,n)=>(0,e.createHash)(n).update(t).digest("hex");e.hashFile=(t,n)=>{if(u.default.existsSync(t))return(0,e.hash)(u.default.readFileSync(t,"utf-8"),n)}}(Yi);var Zi={},Xi={},Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.Unicode=void 0;class es{}Qi.Unicode=es,es.SPACE_SEPARATOR=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,es.ID_START=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,es.ID_CONTINUE=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.JudgeUtil=void 0;const ts=Qi;Xi.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&ts.Unicode.SPACE_SEPARATOR.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||ts.Unicode.ID_START.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||ts.Unicode.ID_CONTINUE.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ns=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.parseJsonText=Zi.parseJsonFile=void 0;const rs=ns(n),us=ns(t),os=ns(e),is=Xi;var ss;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(ss||(ss={}));let cs,as,ls,fs,Ds,ds,ps="start",Es=[],hs=0,Cs=1,ms=0,Fs=!1,ys="default",gs="'",As=1;function vs(e,t=!1){as=String(e),ps="start",Es=[],hs=0,Cs=1,ms=0,fs=void 0,Fs=t;do{cs=Ss(),xs[ps]()}while("eof"!==cs.type);return fs}function Ss(){for(ys="default",Ds="",gs="'",As=1;;){ds=ws();const e=_s[ys]();if(e)return e}}function ws(){if(as[hs])return String.fromCodePoint(as.codePointAt(hs))}function Os(){const e=ws();return"\n"===e?(Cs++,ms=0):e?ms+=e.length:ms++,e&&(hs+=e.length),e}Zi.parseJsonFile=function(e,t=!1,n="utf-8"){const r=rs.default.readFileSync(os.default.resolve(e),{encoding:n});try{return vs(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");if(2===n.length)throw new Error(`${n[0].trim()}${us.default.EOL}\t at ${e}:${n[1].trim()}`)}throw new Error(`${e} is not in valid JSON/JSON5 format.`)}},Zi.parseJsonText=vs;const _s={default(){switch(ds){case"/":return Os(),void(ys="comment");case void 0:return Os(),bs("eof")}if(!is.JudgeUtil.isIgnoreChar(ds)&&!is.JudgeUtil.isSpaceSeparator(ds))return _s[ps]();Os()},start(){ys="value"},beforePropertyName(){switch(ds){case"$":case"_":return Ds=Os(),void(ys="identifierName");case"\\":return Os(),void(ys="identifierNameStartEscape");case"}":return bs("punctuator",Os());case'"':case"'":return gs=ds,Os(),void(ys="string")}if(is.JudgeUtil.isIdStartChar(ds))return Ds+=Os(),void(ys="identifierName");throw ks(ss.Char,Os())},afterPropertyName(){if(":"===ds)return bs("punctuator",Os());throw ks(ss.Char,Os())},beforePropertyValue(){ys="value"},afterPropertyValue(){switch(ds){case",":case"}":return bs("punctuator",Os())}throw ks(ss.Char,Os())},beforeArrayValue(){if("]"===ds)return bs("punctuator",Os());ys="value"},afterArrayValue(){switch(ds){case",":case"]":return bs("punctuator",Os())}throw ks(ss.Char,Os())},end(){throw ks(ss.Char,Os())},comment(){switch(ds){case"*":return Os(),void(ys="multiLineComment");case"/":return Os(),void(ys="singleLineComment")}throw ks(ss.Char,Os())},multiLineComment(){switch(ds){case"*":return Os(),void(ys="multiLineCommentAsterisk");case void 0:throw ks(ss.Char,Os())}Os()},multiLineCommentAsterisk(){switch(ds){case"*":return void Os();case"/":return Os(),void(ys="default");case void 0:throw ks(ss.Char,Os())}Os(),ys="multiLineComment"},singleLineComment(){switch(ds){case"\n":case"\r":case"\u2028":case"\u2029":return Os(),void(ys="default");case void 0:return Os(),bs("eof")}Os()},value(){switch(ds){case"{":case"[":return bs("punctuator",Os());case"n":return Os(),Bs("ull"),bs("null",null);case"t":return Os(),Bs("rue"),bs("boolean",!0);case"f":return Os(),Bs("alse"),bs("boolean",!1);case"-":case"+":return"-"===Os()&&(As=-1),void(ys="numerical");case".":case"0":case"I":case"N":return void(ys="numerical");case'"':case"'":return gs=ds,Os(),Ds="",void(ys="string")}if(void 0===ds||!is.JudgeUtil.isDigitWithoutZero(ds))throw ks(ss.Char,Os());ys="numerical"},numerical(){switch(ds){case".":return Ds=Os(),void(ys="decimalPointLeading");case"0":return Ds=Os(),void(ys="zero");case"I":return Os(),Bs("nfinity"),bs("numeric",As*(1/0));case"N":return Os(),Bs("aN"),bs("numeric",NaN)}if(void 0!==ds&&is.JudgeUtil.isDigitWithoutZero(ds))return Ds=Os(),void(ys="decimalInteger");throw ks(ss.Char,Os())},zero(){switch(ds){case".":case"e":case"E":return void(ys="decimal");case"x":case"X":return Ds+=Os(),void(ys="hexadecimal")}return bs("numeric",0)},decimalInteger(){switch(ds){case".":case"e":case"E":return void(ys="decimal")}if(!is.JudgeUtil.isDigit(ds))return bs("numeric",As*Number(Ds));Ds+=Os()},decimal(){switch(ds){case".":Ds+=Os(),ys="decimalFraction";break;case"e":case"E":Ds+=Os(),ys="decimalExponent"}},decimalPointLeading(){if(is.JudgeUtil.isDigit(ds))return Ds+=Os(),void(ys="decimalFraction");throw ks(ss.Char,Os())},decimalFraction(){switch(ds){case"e":case"E":return Ds+=Os(),void(ys="decimalExponent")}if(!is.JudgeUtil.isDigit(ds))return bs("numeric",As*Number(Ds));Ds+=Os()},decimalExponent(){switch(ds){case"+":case"-":return Ds+=Os(),void(ys="decimalExponentSign")}if(is.JudgeUtil.isDigit(ds))return Ds+=Os(),void(ys="decimalExponentInteger");throw ks(ss.Char,Os())},decimalExponentSign(){if(is.JudgeUtil.isDigit(ds))return Ds+=Os(),void(ys="decimalExponentInteger");throw ks(ss.Char,Os())},decimalExponentInteger(){if(!is.JudgeUtil.isDigit(ds))return bs("numeric",As*Number(Ds));Ds+=Os()},hexadecimal(){if(is.JudgeUtil.isHexDigit(ds))return Ds+=Os(),void(ys="hexadecimalInteger");throw ks(ss.Char,Os())},hexadecimalInteger(){if(!is.JudgeUtil.isHexDigit(ds))return bs("numeric",As*Number(Ds));Ds+=Os()},identifierNameStartEscape(){if("u"!==ds)throw ks(ss.Char,Os());Os();const e=Is();switch(e){case"$":case"_":break;default:if(!is.JudgeUtil.isIdStartChar(e))throw ks(ss.Identifier)}Ds+=e,ys="identifierName"},identifierName(){switch(ds){case"$":case"_":case"‌":case"‍":return void(Ds+=Os());case"\\":return Os(),void(ys="identifierNameEscape")}if(!is.JudgeUtil.isIdContinueChar(ds))return bs("identifier",Ds);Ds+=Os()},identifierNameEscape(){if("u"!==ds)throw ks(ss.Char,Os());Os();const e=Is();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!is.JudgeUtil.isIdContinueChar(e))throw ks(ss.Identifier)}Ds+=e,ys="identifierName"},string(){switch(ds){case"\\":return Os(),void(Ds+=function(){const e=ws(),t=function(){switch(ws()){case"b":return Os(),"\b";case"f":return Os(),"\f";case"n":return Os(),"\n";case"r":return Os(),"\r";case"t":return Os(),"\t";case"v":return Os(),"\v"}return}();if(t)return t;switch(e){case"0":if(Os(),is.JudgeUtil.isDigit(ws()))throw ks(ss.Char,Os());return"\0";case"x":return Os(),function(){let e="",t=ws();if(!is.JudgeUtil.isHexDigit(t))throw ks(ss.Char,Os());if(e+=Os(),t=ws(),!is.JudgeUtil.isHexDigit(t))throw ks(ss.Char,Os());return e+=Os(),String.fromCodePoint(parseInt(e,16))}();case"u":return Os(),Is();case"\n":case"\u2028":case"\u2029":return Os(),"";case"\r":return Os(),"\n"===ws()&&Os(),""}if(void 0===e||is.JudgeUtil.isDigitWithoutZero(e))throw ks(ss.Char,Os());return Os()}());case'"':case"'":if(ds===gs){const e=bs("string",Ds);return Os(),e}return void(Ds+=Os());case"\n":case"\r":case void 0:throw ks(ss.Char,Os());case"\u2028":case"\u2029":!function(e){console.warn(`JSON5: '${Ts(e)}' in strings is not valid ECMAScript; consider escaping.`)}(ds)}Ds+=Os()}};function bs(e,t){return{type:e,value:t,line:Cs,column:ms}}function Bs(e){for(const t of e){if(ws()!==t)throw ks(ss.Char,Os());Os()}}function Is(){let e="",t=4;for(;t-- >0;){const t=ws();if(!is.JudgeUtil.isHexDigit(t))throw ks(ss.Char,Os());e+=Os()}return String.fromCodePoint(parseInt(e,16))}const xs={start(){if("eof"===cs.type)throw ks(ss.EOF);Ps()},beforePropertyName(){switch(cs.type){case"identifier":case"string":return ls=cs.value,void(ps="afterPropertyName");case"punctuator":return void Ns();case"eof":throw ks(ss.EOF)}},afterPropertyName(){if("eof"===cs.type)throw ks(ss.EOF);ps="beforePropertyValue"},beforePropertyValue(){if("eof"===cs.type)throw ks(ss.EOF);Ps()},afterPropertyValue(){if("eof"===cs.type)throw ks(ss.EOF);switch(cs.value){case",":return void(ps="beforePropertyName");case"}":Ns()}},beforeArrayValue(){if("eof"===cs.type)throw ks(ss.EOF);"punctuator"!==cs.type||"]"!==cs.value?Ps():Ns()},afterArrayValue(){if("eof"===cs.type)throw ks(ss.EOF);switch(cs.value){case",":return void(ps="beforeArrayValue");case"]":Ns()}},end(){}};function Ps(){const e=function(){let e;switch(cs.type){case"punctuator":switch(cs.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=cs.value}return e}();if(Fs&&"object"==typeof e&&(e._line=Cs,e._column=ms),void 0===fs)fs=e;else{const t=Es[Es.length-1];Array.isArray(t)?Fs&&"object"!=typeof e?t.push({value:e,_line:Cs,_column:ms}):t.push(e):t[ls]=Fs&&"object"!=typeof e?{value:e,_line:Cs,_column:ms}:e}!function(e){if(e&&"object"==typeof e)Es.push(e),ps=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Es[Es.length-1];ps=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ns(){Es.pop();const e=Es[Es.length-1];ps=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function Ts(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function ks(e,t){let n="";switch(e){case ss.Char:n=void 0===t?`JSON5: invalid end of input at ${Cs}:${ms}`:`JSON5: invalid character '${Ts(t)}' at ${Cs}:${ms}`;break;case ss.EOF:n=`JSON5: invalid end of input at ${Cs}:${ms}`;break;case ss.Identifier:ms-=5,n=`JSON5: invalid identifier character at ${Cs}:${ms}`}const r=new Rs(n);return r.lineNumber=Cs,r.columnNumber=ms,r}class Rs extends SyntaxError{}var Ms={},Ls=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),js=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$s=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Ls(t,e,n);return js(t,e),t},Hs=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.isFileExists=Ms.offlinePluginConversion=Ms.executeCommand=Ms.getNpmPath=Ms.hasNpmPackInPaths=void 0;const Gs=r,Us=Hs(n),Vs=$s(e),Js=E,Ws=S;Ms.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},Ms.getNpmPath=function(){const e=process.execPath;return Vs.join(Vs.dirname(e),Js.NPM_TOOL)},Ms.executeCommand=function(e,t,n){0!==(0,Gs.spawnSync)(e,t,n).status&&(0,Ws.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},Ms.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?Vs.resolve(e,Js.HVIGOR,t.replace("file:","")):t},Ms.isFileExists=function(e){return Us.default.existsSync(e)&&Us.default.statSync(e).isFile()};var zs={};!function(u){var o=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},c=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u,"__esModule",{value:!0}),u.executeInstallPnpm=u.isPnpmInstalled=u.environmentHandler=u.checkNpmConifg=u.PNPM_VERSION=void 0;const a=r,l=s(n),f=c(t),D=s(e),d=E,h=S,C=Ms;u.PNPM_VERSION="7.30.0",u.checkNpmConifg=function(){const e=D.resolve(d.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=D.resolve(f.default.homedir(),".npmrc");if((0,C.isFileExists)(e)||(0,C.isFileExists)(t))return;const n=(0,C.getNpmPath)(),r=(0,a.spawnSync)(n,["config","get","prefix"],{cwd:d.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,h.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=D.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,C.isFileExists)(u)||(0,h.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},u.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},u.isPnpmInstalled=function(){return!!l.existsSync(d.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,C.hasNpmPackInPaths)("pnpm",[d.HVIGOR_WRAPPER_TOOLS_HOME])},u.executeInstallPnpm=function(){(0,h.logInfo)(`Installing pnpm@${u.PNPM_VERSION}...`);const e=(0,C.getNpmPath)();!function(){const e=D.resolve(d.HVIGOR_WRAPPER_TOOLS_HOME,d.DEFAULT_PACKAGE_JSON);try{l.existsSync(d.HVIGOR_WRAPPER_TOOLS_HOME)||l.mkdirSync(d.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const t={dependencies:{}};t.dependencies[d.PNPM]=u.PNPM_VERSION,l.writeFileSync(e,JSON.stringify(t))}catch(t){(0,h.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${e} failed.`)}}(),(0,C.executeCommand)(e,["install","pnpm"],{cwd:d.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,h.logInfo)("Pnpm install success.")}}(zs);var Ks=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),qs=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ys=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Ks(t,e,n);return qs(t,e),t},Zs=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L,"__esModule",{value:!0});var Xs=L.initProjectWorkSpace=void 0;const Qs=Ys(n),ec=Zs(t),tc=Ys(e),nc=Zs(u),rc=j,uc=E,oc=qi,ic=Yi,sc=Zi,cc=S,ac=Ms,lc=zs;let fc,Dc,dc;function pc(e,t,n){return void 0!==n.dependencies&&(0,ac.offlinePluginConversion)(uc.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===tc.normalize(n.dependencies[e])}Xs=L.initProjectWorkSpace=function(){if(fc=function(){const e=tc.resolve(uc.HVIGOR_PROJECT_WRAPPER_HOME,uc.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);Qs.existsSync(e)||(0,cc.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`);return(0,sc.parseJsonFile)(e)}(),dc=function(e){let t;t=function(e){const t=e.hvigorVersion;if(t.startsWith("file:")||t.endsWith(".tgz"))return!1;const n=e.dependencies,r=Object.getOwnPropertyNames(n);for(const e of r){const t=n[e];if(t.startsWith("file:")||t.endsWith(".tgz"))return!1}if(1===r.length&&"@ohos/hvigor-ohos-plugin"===r[0])return t>"2.5.0";return!1}(e)?function(e){let t=`${uc.HVIGOR_ENGINE_PACKAGE_NAME}@${e.hvigorVersion}`;const n=e.dependencies;if(n){Object.getOwnPropertyNames(n).sort().forEach((e=>{t+=`,${e}@${n[e]}`}))}return(0,ic.hash)(t)}(e):(0,ic.hash)(nc.default.cwd());return tc.resolve(ec.default.homedir(),".hvigor","project_caches",t)}(fc),Dc=function(){const e=tc.resolve(dc,uc.WORK_SPACE,uc.DEFAULT_PACKAGE_JSON);return Qs.existsSync(e)?(0,sc.parseJsonFile)(e):{dependencies:{}}}(),function(){const e=tc.resolve(uc.HVIGOR_USER_HOME,uc.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);if(Qs.existsSync(e))(0,sc.parseJsonFile)(e)}(),!(0,ac.hasNpmPackInPaths)(uc.HVIGOR_ENGINE_PACKAGE_NAME,[tc.join(dc,uc.WORK_SPACE)])||(0,ac.offlinePluginConversion)(uc.HVIGOR_PROJECT_ROOT_DIR,fc.hvigorVersion)!==Dc.dependencies[uc.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}const t=e(fc),n=e(Dc);if(t+1!==n)return!1;for(const e in null==fc?void 0:fc.dependencies)if(!(0,ac.hasNpmPackInPaths)(e,[tc.join(dc,uc.WORK_SPACE)])||!pc(e,fc,Dc))return!1;return!0}())try{const e=nc.default.hrtime();(0,lc.checkNpmConifg)(),function(){(0,cc.logInfo)("Hvigor installing...");for(const e in fc.dependencies)fc.dependencies[e]&&(fc.dependencies[e]=(0,ac.offlinePluginConversion)(uc.HVIGOR_PROJECT_ROOT_DIR,fc.dependencies[e]));const e={dependencies:{...fc.dependencies}};e.dependencies[uc.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ac.offlinePluginConversion)(uc.HVIGOR_PROJECT_ROOT_DIR,fc.hvigorVersion);const t=tc.join(dc,uc.WORK_SPACE);try{Qs.mkdirSync(t,{recursive:!0});const n=tc.resolve(t,uc.DEFAULT_PACKAGE_JSON);Qs.writeFileSync(n,JSON.stringify(e))}catch(e){(0,cc.logErrorAndExit)(e)}(function(){const e=["config","set","store-dir",uc.HVIGOR_PNPM_STORE_PATH],t={cwd:tc.join(dc,uc.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,ac.executeCommand)(uc.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,t)})(),function(){const e=["install"];(0,oc.isCI)()&&e.push("--no-frozen-lockfile");const t={cwd:tc.join(dc,uc.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,ac.executeCommand)(uc.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,t)}(),(0,cc.logInfo)("Hvigor install success.")}();const t=nc.default.hrtime(e);rc.hvigorTrace.HVIGOR_INSTALL_TIME=1e9*t[0]+t[1]}catch(e){!function(){const e=tc.join(dc,uc.WORK_SPACE);if((0,cc.logInfo)("Hvigor cleaning..."),!Qs.existsSync(e))return;const t=Qs.readdirSync(e);if(!t||0===t.length)return;const n=tc.resolve(dc,"node_modules","@ohos","hvigor","bin","hvigor.js");Qs.existsSync(n)&&(0,ac.executeCommand)(nc.default.argv[0],[n,"--stop-daemon"],{});try{t.forEach((t=>{Qs.rmSync(tc.resolve(e,t),{recursive:!0})}))}catch(t){(0,cc.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${e}.`)}}()}return dc},function(){zs.environmentHandler(),zs.isPnpmInstalled()||(zs.checkNpmConifg(),zs.executeInstallPnpm());const t=Xs();b(e.join(t,E.WORK_SPACE))}(); \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/hvigorw b/code/DocsSample/ArkTSUtilsDocModule/hvigorw deleted file mode 100644 index 6c7cb1aaea802dd1ad273ba6f364c931dbcf18d6..0000000000000000000000000000000000000000 --- a/code/DocsSample/ArkTSUtilsDocModule/hvigorw +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -#/* -# * Copyright (c) 2024 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. -# */ -# ---------------------------------------------------------------------------- -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME="`pwd -P`" -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -#NODE_OPTS="--max-old-space-size=4096" - -fail() { - echo "$*" - exit 1 -} - -set_executable_node() { - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ -x "$EXECUTABLE_NODE" ]; then - return - fi - - EXECUTABLE_NODE="${NODE_HOME}/node" - if [ -x "$EXECUTABLE_NODE" ]; then - return - fi - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ]; then - set_executable_node -else - EXECUTABLE_NODE="node" - command -v ${EXECUTABLE_NODE} &> /dev/null || fail "ERROR: NODE_HOME not set and 'node' command not found" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ]; then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -if [ -z "${NODE_OPTS}" ]; then - NODE_OPTS="--" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" "${NODE_OPTS}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/code/DocsSample/ArkTSUtilsDocModule/hvigorw.bat b/code/DocsSample/ArkTSUtilsDocModule/hvigorw.bat deleted file mode 100644 index b5eecf5a159f733825a80568476b6e1f5ef17cf2..0000000000000000000000000000000000000000 --- a/code/DocsSample/ArkTSUtilsDocModule/hvigorw.bat +++ /dev/null @@ -1,54 +0,0 @@ -@rem -@rem ---------------------------------------------------------------------------- -@rem Hvigor startup script for Windows, version 1.0.0 -@rem -@rem Required ENV vars: -@rem ------------------ -@rem NODE_HOME - location of a Node home dir -@rem or -@rem Add %NODE_HOME%/bin to the PATH environment variable -@rem ---------------------------------------------------------------------------- -@rem -@echo off - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe -@rem set NODE_OPTS="--max-old-space-size=4096" - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -if not defined NODE_OPTS set NODE_OPTS="--" - -@rem Find node.exe -if defined NODE_HOME ( - set NODE_HOME=%NODE_HOME:"=% - set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% -) - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" ( - "%NODE_EXE%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* -) else if exist "%NODE_EXE_PATH%" ( - "%NODE_EXE%" "%NODE_OPTS%" "%WRAPPER_MODULE_PATH%" %* -) else ( - echo. - echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. - echo. - echo Please set the NODE_HOME variable in your environment to match the - echo location of your NodeJs installation. -) - -if "%ERRORLEVEL%" == "0" ( - if "%OS%" == "Windows_NT" endlocal -) else ( - exit /b %ERRORLEVEL% -) \ No newline at end of file diff --git a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image1.jpeg b/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image1.jpeg deleted file mode 100644 index 44b92b7a1cdc8e2e269e98ac72685c0eef77c698..0000000000000000000000000000000000000000 Binary files a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image1.jpeg and /dev/null differ diff --git a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image2.jpeg b/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image2.jpeg deleted file mode 100644 index a6618b1b6c3e8069d9fa2c1846f51f0a0a19128e..0000000000000000000000000000000000000000 Binary files a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image2.jpeg and /dev/null differ diff --git a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image3.jpeg b/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image3.jpeg deleted file mode 100644 index 05bb540865ed04b6a16ed9ca538b20b4ad82661e..0000000000000000000000000000000000000000 Binary files a/code/DocsSample/ArkTSUtilsDocModule/screenshots/device/image3.jpeg and /dev/null differ